@arcgis/core 4.34.0-next.6 → 4.34.0-next.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Map.js +1 -1
- package/applications/ExperienceBuilder/sketchUtils.d.ts +1 -0
- package/applications/ExperienceBuilder/sketchUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{feaf79b69d2e2a1f2aa2.js → 06877ea5b9df7de89aff.js} +1 -1
- package/assets/esri/core/workers/chunks/{54ea93f416ab52b413c1.js → 076f830d6d0337dfce9d.js} +1 -1
- package/assets/esri/core/workers/chunks/09907c9ff597df9bc954.js +1 -0
- package/assets/esri/core/workers/chunks/0dbb350ce651bc236ec8.js +1 -0
- package/assets/esri/core/workers/chunks/0ed4ec00ef16aa58a33d.js +1 -0
- package/assets/esri/core/workers/chunks/{0624ae07d3af8d5f1ac8.js → 15b3eb60f86954783fab.js} +1 -1
- package/assets/esri/core/workers/chunks/{b845586219f284a215b2.js → 1db026cc25338dbc208e.js} +1 -1
- package/assets/esri/core/workers/chunks/21de4516bf5c9630edfd.js +1 -0
- package/assets/esri/core/workers/chunks/2254989ca3ff3960f2fe.js +1 -0
- package/assets/esri/core/workers/chunks/248a198f97871a8d6dd6.js +1 -0
- package/assets/esri/core/workers/chunks/2dbd18df5c691c8d0a61.js +1 -0
- package/assets/esri/core/workers/chunks/2e1ceff3f88a6c78dfa2.js +1 -0
- package/assets/esri/core/workers/chunks/{847e88e1d6da1e74cdc8.js → 2ecc1057d53e0b4a60b7.js} +1 -1
- package/assets/esri/core/workers/chunks/3025e420e13e2bc8c0a1.js +1 -0
- package/assets/esri/core/workers/chunks/32537e2b014bc3d82f5c.js +346 -0
- package/assets/esri/core/workers/chunks/34f55bb89ddf26b10260.js +1 -0
- package/assets/esri/core/workers/chunks/355ab428a04ee9fcf888.js +1 -0
- package/assets/esri/core/workers/chunks/{28e31ac00dc95a1318e9.js → 3916879b9ca8c6979011.js} +1 -1
- package/assets/esri/core/workers/chunks/3a74654fa539f78ceb86.js +1 -0
- package/assets/esri/core/workers/chunks/3bec10a4f01757590c1c.js +1 -0
- package/assets/esri/core/workers/chunks/4088f4c25a09932a3eb1.js +1 -0
- package/assets/esri/core/workers/chunks/427318722815bef1496b.js +1 -0
- package/assets/esri/core/workers/chunks/4c3bd6cc0badb78c7112.js +1 -0
- package/assets/esri/core/workers/chunks/500fb5f615f0c1db1b66.js +1 -0
- package/assets/esri/core/workers/chunks/5222523fff30d07f88de.js +1 -0
- package/assets/esri/core/workers/chunks/52c34d6ecd9d45a33e69.js +1 -0
- package/assets/esri/core/workers/chunks/539541dec5fcf3b657aa.js +1 -0
- package/assets/esri/core/workers/chunks/53e8c061f36516c3c3e4.js +1 -0
- package/assets/esri/core/workers/chunks/{ca76950d81ab4ebb65e1.js → 58f403f956b7b3467344.js} +1 -1
- package/assets/esri/core/workers/chunks/5a01bd7a9ee24be7bac4.js +1 -0
- package/assets/esri/core/workers/chunks/5bfcb3d87380e7f85b08.js +1 -0
- package/assets/esri/core/workers/chunks/5d3246b8fc50f9d9e2c4.js +1 -0
- package/assets/esri/core/workers/chunks/{4dd0a5f327fa5fc7249d.js → 5ef1095842e21090f1f4.js} +1 -1
- package/assets/esri/core/workers/chunks/614bc3f05873b37af091.js +1 -0
- package/assets/esri/core/workers/chunks/6194636638b0439fccd8.js +1 -0
- package/assets/esri/core/workers/chunks/66e4cb2479bed1384ed5.js +1 -0
- package/assets/esri/core/workers/chunks/6b0ae9ccdd1acef5b5b4.js +1 -0
- package/assets/esri/core/workers/chunks/7112b092d98172b7db8b.js +1 -0
- package/assets/esri/core/workers/chunks/72ea996b03932c0f004f.js +1 -0
- package/assets/esri/core/workers/chunks/74d18c22fa1c178bd9df.js +1 -0
- package/assets/esri/core/workers/chunks/766e08d0c56b2b31b63b.js +1 -0
- package/assets/esri/core/workers/chunks/77dbb1d5d5e1a6ced932.js +1 -0
- package/assets/esri/core/workers/chunks/{bd7b54db7fd278b15500.js → 7a2189614f2dad49ffcd.js} +1 -1
- package/assets/esri/core/workers/chunks/7ae88c141a5d85e5bb88.js +1 -0
- package/assets/esri/core/workers/chunks/7aef81778155be373d3e.js +1 -0
- package/assets/esri/core/workers/chunks/7e1906d35a764f7f10b0.js +1 -0
- package/assets/esri/core/workers/chunks/80777a9db53bee2ad8a8.js +1 -0
- package/assets/esri/core/workers/chunks/8249b5de5c15461a6787.js +1 -0
- package/assets/esri/core/workers/chunks/{a036503087baa1f9fd00.js → 82ff4229c51011b243f2.js} +1 -1
- package/assets/esri/core/workers/chunks/8385c13ac10e595374cb.js +1 -0
- package/assets/esri/core/workers/chunks/83db8bd42f94f97c7cf1.js +1 -0
- package/assets/esri/core/workers/chunks/87623ebe32c6ae9cb223.js +1 -0
- package/assets/esri/core/workers/chunks/88b1214c284c2ec7d51b.js +1 -0
- package/assets/esri/core/workers/chunks/8b86c75426c55b29ebed.js +1 -0
- package/assets/esri/core/workers/chunks/8c4b26d86483646c70d2.js +1 -0
- package/assets/esri/core/workers/chunks/9cb242dfc3765b590f51.js +1 -0
- package/assets/esri/core/workers/chunks/9ddb0b07be31c3747238.js +1 -0
- package/assets/esri/core/workers/chunks/9f0f1472f36b42c507d1.js +1 -0
- package/assets/esri/core/workers/chunks/{f840e1655c4f6b6630be.js → 9f964467f7353039dd9c.js} +19 -19
- package/assets/esri/core/workers/chunks/9fe62638dc7dce466612.js +1 -0
- package/assets/esri/core/workers/chunks/a2e9141ff4efd13413a1.js +66 -0
- package/assets/esri/core/workers/chunks/adf6982e2d8102669cdf.js +1 -0
- package/assets/esri/core/workers/chunks/{d9b2263e0a9f9068ab62.js → b6c3a2d93a59df9a1418.js} +1 -1
- package/assets/esri/core/workers/chunks/b763292829aa4d3fab60.js +1 -0
- package/assets/esri/core/workers/chunks/ba015f4f72714820a12f.js +1 -0
- package/assets/esri/core/workers/chunks/bbbd58b02a3ee8fe595e.js +1 -0
- package/assets/esri/core/workers/chunks/c3d95f7f4370486eed2c.js +1 -0
- package/assets/esri/core/workers/chunks/c3df693d1bce8f189fa2.js +1 -0
- package/assets/esri/core/workers/chunks/{6993a59cbb78bc26f029.js → c45a314ace9725aa250e.js} +1 -1
- package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +1 -0
- package/assets/esri/core/workers/chunks/c9fbada1e84981784f6c.js +1 -0
- package/assets/esri/core/workers/chunks/cefcecbeef4f0a46f58c.js +1 -0
- package/assets/esri/core/workers/chunks/d2317b87aa2ac3ad97a6.js +1 -0
- package/assets/esri/core/workers/chunks/{0bbb38f59f37c51c72f0.js → d45a4e5806a80b69ceec.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a23dc625a812a562c21.js → d5f770302dc686e55ba7.js} +1 -1
- package/assets/esri/core/workers/chunks/dc14507cfc052faa5890.js +1 -0
- package/assets/esri/core/workers/chunks/e7a440476cd1eb4c6547.js +1 -0
- package/assets/esri/core/workers/chunks/ede9738ac20e7dd5ce63.js +1 -0
- package/assets/esri/core/workers/chunks/eec034d88db320880133.js +1 -0
- package/assets/esri/core/workers/chunks/f1e87720b425d7fb348a.js +1 -0
- package/assets/esri/core/workers/chunks/f2863c501d62dece5fdd.js +1 -0
- package/assets/esri/core/workers/chunks/f5741d09fd4e1809f580.js +1 -0
- package/assets/esri/core/workers/chunks/f9e1b73976027e17cd03.js +1 -0
- package/assets/esri/core/workers/chunks/fd207a40faf882d3b2a3.js +1 -0
- package/assets/esri/core/workers/chunks/fe3832107278244dc04d.js +1 -0
- package/assets/esri/widgets/Editor/t9n/Editor.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_en.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/chunks/aiServices.js +1 -1
- package/config.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/effects/FocusArea.d.ts +4 -0
- package/effects/FocusArea.js +1 -1
- package/effects/FocusAreaOutline.d.ts +4 -0
- package/effects/FocusAreaOutline.js +1 -1
- package/effects/FocusAreas.d.ts +4 -0
- package/effects/FocusAreas.js +1 -1
- package/geometry.js +1 -1
- package/interfaces.d.ts +530 -433
- package/kernel.js +1 -1
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/GroupLayer.js +1 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/VideoLayer.js +1 -1
- package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/operationalLayerModuleMap.js +1 -1
- package/layers/mixins/operationalLayers.js +1 -1
- package/layers/support/BuildingSummaryStatistics.js +1 -1
- package/layers/support/PromiseQueue.js +1 -1
- package/layers/support/TelemetryDisplay.js +1 -1
- package/layers/support/TitleCreator.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/featurePopupQueryUtils.js +5 -0
- package/layers/support/fieldUtils.js +1 -1
- package/layers/support/layersCreator.js +1 -1
- package/layers/support/multiLayerServiceUtils.js +5 -0
- package/networks/CircuitManager.js +1 -1
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/UNTraceConfiguration.js +1 -1
- package/networks/support/typeUtils.js +1 -1
- package/package.json +1 -1
- package/portal/PortalItem.js +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/rasterRenderers.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/renderers.js +1 -1
- package/rest/featureService/FeatureService.js +1 -1
- package/rest/networks/circuits/queryCircuits.js +1 -1
- package/rest/networks/circuits/support/QueryCircuitsParameters.js +1 -1
- package/rest/networks/support/CircuitTraceResult.js +5 -0
- package/rest/networks/support/TraceResult.js +1 -1
- package/rest/networks/unitIdentifiers/support/{QueryUnitIdentifiersParamters.js → QueryUnitIdentifiersParameters.js} +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/effects/EffectEnclosingPolygon.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/symbols/support/ElevationInfo.d.ts +4 -0
- package/symbols/support/ElevationInfo.js +1 -1
- package/symbols/support/FeatureExpressionInfo.d.ts +4 -0
- package/symbols/support/FeatureExpressionInfo.js +1 -1
- package/symbols/support/cimSymbolUtils.js +1 -1
- package/symbols/support/previewCIMSymbol.js +1 -1
- package/symbols.js +1 -1
- package/views/2d/engine/webgl/animations/infos.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/animations/utils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedPolyShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechniques.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/ComputedAnimatedParams.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/attributes.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/enums.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/utils.js +1 -1
- package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
- package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
- package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
- package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/AllRenderPasses.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +3 -3
- package/views/3d/webgl-engine/lib/Texture.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/layers/CatalogDynamicGroupLayerView.js +1 -1
- package/views/layers/FeatureLayerView.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/PointCloudLayerView.js +1 -1
- package/views/support/TextureCompressionTracker.js +5 -0
- package/views/webgl/Texture.js +1 -1
- package/webdoc/support/writeUtils.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Attachments.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/DirectionsVisibleElements.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/featureFormUtils.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/Features/FeaturesViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/videoViewerUtils.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/SelectionOperation.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/003ddb190a5cc56f7925.js +0 -1
- package/assets/esri/core/workers/chunks/03db109e9b695528c35d.js +0 -1
- package/assets/esri/core/workers/chunks/09da6b3085fc84cd69d5.js +0 -1
- package/assets/esri/core/workers/chunks/09f76ca9b47b465c934f.js +0 -1
- package/assets/esri/core/workers/chunks/0a770f283eb77c8dc97a.js +0 -1
- package/assets/esri/core/workers/chunks/0b70b2ee62904318a12c.js +0 -1
- package/assets/esri/core/workers/chunks/0c2dccec20c0994366fe.js +0 -1
- package/assets/esri/core/workers/chunks/0d78fc2c2bc1152f84db.js +0 -1
- package/assets/esri/core/workers/chunks/0fb5de3f8a4d69b2d514.js +0 -1
- package/assets/esri/core/workers/chunks/17e43a050fbf8dc87588.js +0 -1
- package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +0 -1
- package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +0 -1
- package/assets/esri/core/workers/chunks/22e53cb1c8c575fa4d46.js +0 -1
- package/assets/esri/core/workers/chunks/2cf82d3645c75d311e99.js +0 -1
- package/assets/esri/core/workers/chunks/2d90806faa4269828948.js +0 -1
- package/assets/esri/core/workers/chunks/306e262f148b3057b11b.js +0 -1
- package/assets/esri/core/workers/chunks/377a7f0f7d304ff9fe5b.js +0 -1
- package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +0 -1
- package/assets/esri/core/workers/chunks/3d7eedb787c1e3b9fbfc.js +0 -1
- package/assets/esri/core/workers/chunks/3fe7be535affae31de7e.js +0 -1
- package/assets/esri/core/workers/chunks/417293f00b2c21cc3175.js +0 -1
- package/assets/esri/core/workers/chunks/41cbba9b286cf5558a9c.js +0 -1
- package/assets/esri/core/workers/chunks/42bb9bb6fe44a47d9b81.js +0 -1
- package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +0 -1
- package/assets/esri/core/workers/chunks/4ca0738ed38c15b68a77.js +0 -1
- package/assets/esri/core/workers/chunks/515e3295495d0958db7e.js +0 -1
- package/assets/esri/core/workers/chunks/51ba7345c31e6eb79060.js +0 -1
- package/assets/esri/core/workers/chunks/51c31e6d014005107d42.js +0 -1
- package/assets/esri/core/workers/chunks/5200be8bce60fa831026.js +0 -1
- package/assets/esri/core/workers/chunks/52a57106a41b8c9483d7.js +0 -1
- package/assets/esri/core/workers/chunks/536d7986ebb710a8a452.js +0 -1
- package/assets/esri/core/workers/chunks/5617532299f73d186968.js +0 -1
- package/assets/esri/core/workers/chunks/56d2a20c1b143697aa19.js +0 -1
- package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +0 -1
- package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +0 -1
- package/assets/esri/core/workers/chunks/5e1f7fe6bbc5754efee1.js +0 -1
- package/assets/esri/core/workers/chunks/61f9747c960d959b571b.js +0 -346
- package/assets/esri/core/workers/chunks/74c0db9e3a62e9839b23.js +0 -1
- package/assets/esri/core/workers/chunks/7b12607633bbdc318936.js +0 -1
- package/assets/esri/core/workers/chunks/86023cc5ccbc7ac43479.js +0 -1
- package/assets/esri/core/workers/chunks/87eca6de502d18d8b7eb.js +0 -1
- package/assets/esri/core/workers/chunks/8aa8f9986b966ccb64e2.js +0 -1
- package/assets/esri/core/workers/chunks/8d14e957219364a81d5f.js +0 -66
- package/assets/esri/core/workers/chunks/937b653b10e8704b38bf.js +0 -1
- package/assets/esri/core/workers/chunks/98ef17d15517368d2383.js +0 -1
- package/assets/esri/core/workers/chunks/9cac00d4bfac14aaae12.js +0 -1
- package/assets/esri/core/workers/chunks/a0c35521e677459f6fa3.js +0 -1
- package/assets/esri/core/workers/chunks/a32dcd5bc4680374d30c.js +0 -1
- package/assets/esri/core/workers/chunks/aaa6d45316a7d3466d0f.js +0 -1
- package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +0 -1
- package/assets/esri/core/workers/chunks/b2a6afa0cd537805b4b8.js +0 -1
- package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +0 -1
- package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +0 -1
- package/assets/esri/core/workers/chunks/c779335f5d5455c77a62.js +0 -1
- package/assets/esri/core/workers/chunks/c9ab067b07d1eab974d1.js +0 -1
- package/assets/esri/core/workers/chunks/d3c0d7799c92c6f0e7d3.js +0 -1
- package/assets/esri/core/workers/chunks/d52f5214a0330ed2e05e.js +0 -1
- package/assets/esri/core/workers/chunks/dbe10c20df7e0e563a0b.js +0 -1
- package/assets/esri/core/workers/chunks/df7ca2fe12e22ccfde17.js +0 -1
- package/assets/esri/core/workers/chunks/df933eac03dc63064723.js +0 -1
- package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +0 -1
- package/assets/esri/core/workers/chunks/ee6240636d04d7d37b7b.js +0 -1
- package/assets/esri/core/workers/chunks/ef7955a2509be0f03ca2.js +0 -1
- package/assets/esri/core/workers/chunks/f00f8609bf0d14b488b8.js +0 -1
- package/assets/esri/core/workers/chunks/f1c6df5cf2ccb6ac47a1.js +0 -1
- package/assets/esri/core/workers/chunks/f3d97a4c4f433adbdab5.js +0 -1
- package/assets/esri/core/workers/chunks/fc0a3db3d6d26c763fb9.js +0 -1
- package/assets/esri/core/workers/chunks/fd4c020297badcb81947.js +0 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerTechnique.js +0 -5
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedShader.js +0 -5
- package/views/support/TextureCompressionHandle.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{CIMSymbolHelper as e}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as a}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Alignment as i}from"../../../../../../../symbols/cim/enums.js";import{Techniques as l}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{getMaxSizeVVSize as t,noVisualVariables as o}from"../VisualVariablesSchema.js";import{hasSizeVVUniform as r}from"./utils.js";function n(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function s(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,l,t]=e;return[a,i,l,255*t]}return"string"==typeof e?e:{...e,defaultValue:s(e?.defaultValue)}}async function c(a,i){const{cimResourceManager:l,cimAnalyzer:t,scaleExpression:o}=i.schemaOptions;await Promise.all(e.fetchResources(a.symbol,l,[]));const r=t.analyzeSymbolReference(a,!1),s={scaleInfo:n(a),scaleExpression:o},c=[];for(const e of r)switch(e.type){case"marker":c.push(...u(e,i,s));break;case"fill":c.push(...z(e,i,s));break;case"outlineFill":c.push(...S(e,i,s));break;case"gradientFill":c.push(...d(e,i,s));break;case"line":c.push(...y(e,i,s));break;case"gradientStroke":c.push(...R(e,i,s));break;case"text":c.push(...k(e,i,s))}return c}function u(e,a,i){const{uniforms:t,schemaOptions:r}=a,{store:n}=r,s=e.isOutline?{...o,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation};if(e.animationParams){return f(n.ensureInstance(l.animatedMarker,{uniforms:s,optionalAttributes:{zoomRange:!0}}),e,o,i)}return p(n.ensureInstance(l.marker,{uniforms:s,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,t,i)}function f(e,a,l,t){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:a.spriteRasterizationParam,animations:a.animationParams,scaleInfo:t.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:a.alignment===i.MAP,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio})]}function p(e,i,l,{scaleInfo:o,scaleExpression:n}){const c=r(l);return[e.createMeshInfo({size:i.size,scaleX:i.scaleX,anchorX:i.anchorPoint.x,anchorY:i.anchorPoint.y,angle:i.rotation,color:s(i.color)??[0,0,0,0],colorLocked:i.colorLocked,frameHeight:i.frameHeight,widthRatio:i.widthRatio,scaleInfo:o,offsetX:i.offsetX,offsetY:i.offsetY,outlineColor:s(i.outlineColor)??[0,0,0,0],outlineSize:i.outlineWidth,referenceSize:i.referenceSize||a.CIMVectorMarker.size,rotateClockwise:i.rotateClockwise,scaleFactor:n??1,sizeRatio:i.sizeRatio,alignment:i.alignment,isAbsoluteAnchorPoint:i.isAbsoluteAnchorPoint,scaleSymbolsProportionally:i.scaleSymbolsProportionally,sprite:i.spriteRasterizationParam,hasSizeVV:c,placement:i.markerPlacement,effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,transforms:i.transform,minPixelBuffer:t(l)})]}function m(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o;return V(r.ensureInstance(l.fill,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function S(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o;return b(r.ensureInstance(l.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function b(e,a,i){const l=s(a.color)??[0,0,0,0],t=s(a.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:l,outlineColor:t,width:a.outlineWidth,referenceWidth:a.referenceWidth,capType:a.cap,joinType:a.join,miterLimit:a.miterLimit,outlineUsesColorVV:!a.outlineColorLocked,hasSizeVV:!1,scaleInfo:i.scaleInfo,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,outlineEffects:a.outlineEffects?{type:"cim-effect-infos",effectInfos:a.outlineEffects}:null})]}function V(e,a,{scaleInfo:i}){return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function z(e,a,i){if(!e.spriteRasterizationParam)return m(e,a,i);const{uniforms:t,schemaOptions:o}=a,{store:r}=o;return h(r.ensureInstance(l.complexFill,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,null!=t.visualVariableColor,i)}function h(e,a,i,{scaleInfo:l}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const t=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),o=a.sampleAlphaOnly&&!t,r=a.spriteRasterizationParam;return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:o,scaleProportionally:"CIMHatchFill"===r.resource.type,sprite:r,scaleInfo:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function d(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o;return v(r.ensureInstance(l.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:t.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function v(e,a,{scaleInfo:i}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({color:s(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function y(e,a,i){const{uniforms:t,schemaOptions:r}=a,{store:n}=r,s=e.isOutline?{...o,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},c={uniforms:s,optionalAttributes:{zoomRange:!!i.scaleInfo}},u=!!(s.visualVariableSizeMinMaxValue||s.visualVariableSizeScaleStops||s.visualVariableSizeStops||s.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return g(n.ensureInstance(l.line,c),e,u,i)}return M(n.ensureInstance(l.texturedLine,c),e,u,i)}function I(e,a,{scaleInfo:i}){return{color:s(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:a,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function g(e,a,i,l){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=I(a,i,l);return[e.createMeshInfo(t)]}function M(e,a,i,l){const{spriteRasterizationParam:t,scaleDash:o,sampleAlphaOnly:r}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...I(a,i,l),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:o??!1,shouldSampleAlphaOnly:r,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function R(e,a,i){const{uniforms:t,schemaOptions:r}=a,{store:n}=r;return C(n.ensureInstance(l.gradientStroke,{uniforms:e.isOutline?{...o,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function C(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({...I(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function k(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o;return O(r.ensureInstance(l.text,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1,visibility:!1}}),e,t,i)}function O(e,a,i,{scaleInfo:l,scaleExpression:o}){return[e.createMeshInfo({boxBackgroundColor:s(a.backgroundColor),boxBorderLineColor:s(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:s(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:s(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:s(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:o??1,minPixelBuffer:t(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,labelClassId:-1})]}export{f as createAnimatedMarkerMeshInfos,h as createComplexFillMeshInfos,p as createComplexMarkerMeshInfos,V as createComplexSimpleFillMeshInfos,g as createComplexSimpleLineMeshInfos,b as createComplexSimpleOutlineFillMeshInfos,c as createComplexSymbolInstances,O as createComplexTextMeshInfos,M as createComplexTexturedLineMeshInfos,v as createGradientFillMeshInfos,C as createGradientStrokeMeshInfos,n as getScaleInfo};
|
|
5
|
+
import{CIMSymbolHelper as e}from"../../../../../../../symbols/cim/CIMSymbolHelper.js";import{defaultCIMValues as a}from"../../../../../../../symbols/cim/defaultCIMValues.js";import{Alignment as i}from"../../../../../../../symbols/cim/enums.js";import{Techniques as l}from"../../../../../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import{getMaxSizeVVSize as t,noVisualVariables as n}from"../VisualVariablesSchema.js";import{getAnimatedTechniqueSprite as o,hasSizeVVUniform as r}from"./utils.js";function s(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function c(e){if(null==e)return null;if(Array.isArray(e)){const[a,i,l,t]=e;return[a,i,l,255*t]}return"string"==typeof e?e:{...e,defaultValue:c(e?.defaultValue)}}async function u(a,i){const{cimResourceManager:l,cimAnalyzer:t,scaleExpression:n}=i.schemaOptions;await Promise.all(e.fetchResources(a.symbol,l,[]));const o=t.analyzeSymbolReference(a,!1),r={scaleInfo:s(a),scaleExpression:n},c=[];for(const e of o)switch(e.type){case"marker":c.push(...f(e,i,r));break;case"fill":c.push(...v(e,i,r));break;case"outlineFill":c.push(...V(e,i,r));break;case"gradientFill":c.push(...y(e,i,r));break;case"line":c.push(...I(e,i,r));break;case"gradientStroke":c.push(...k(e,i,r));break;case"text":c.push(...A(e,i,r))}return c}function f(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o,s=e.isOutline?{...n,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue,visualVariableRotation:t.visualVariableRotation};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,t=a?l.animatedMarkerShift:l.animatedMarker;return m(r.ensureInstance(t,{uniforms:s,optionalAttributes:{zoomRange:!0,value1Position2Value2:e.animationParams.params.hasShiftAnimation,lineLength:a}}),e,n,i)}return S(r.ensureInstance(l.marker,{uniforms:s,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,t,i)}function m(e,a,l,t){if(!a.animationParams)return[];return[e.createMeshInfo({pixelDimensions:a.pixelDimensions,texelDimensions:a.texelDimensions,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:o(a),animations:a.animationParams,scaleInfo:t.scaleInfo,scaleSymbolsProportionally:a.scaleSymbolsProportionally,strokeWidth:a.outlineWidth,isMapAligned:a.alignment===i.MAP,colorLocked:a.colorLocked,isStroke:a.isStroke,baseSize:a.baseSize,placement:a.markerPlacement,referenceSize:a.referenceSize,angleToLine:!!a.markerPlacement&&(a.markerPlacement.placement&&"angleToLine"in a.markerPlacement.placement&&a.markerPlacement.placement.angleToLine),sizeRatio:a.sizeRatio,patternHeight:null})]}function p(e,a,i,l){if(!a.animationParams)return[];return[e.createMeshInfo({effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,sprite:o(a),animations:a.animationParams,scaleInfo:l.scaleInfo,scaleSymbolsProportionally:!1,strokeWidth:1,isMapAligned:!0,colorLocked:a.colorLocked||!1,isStroke:!1,baseSize:"width"in a?a.width:-1,placement:null,referenceSize:2,angleToLine:!1,sizeRatio:1,patternHeight:"fill"===a.type&&a.spriteRasterizationParam?a.height:null,joinType:"join"in a?a.join:"round",capType:"cap"in a?a.cap:"round",miterLimit:"miterLimit"in a&&a.miterLimit||2})]}function S(e,i,l,{scaleInfo:n,scaleExpression:o}){const s=r(l);return[e.createMeshInfo({size:i.size,scaleX:i.scaleX,anchorX:i.anchorPoint.x,anchorY:i.anchorPoint.y,angle:i.rotation,color:c(i.color)??[0,0,0,0],colorLocked:i.colorLocked,frameHeight:i.frameHeight,widthRatio:i.widthRatio,scaleInfo:n,offsetX:i.offsetX,offsetY:i.offsetY,outlineColor:c(i.outlineColor)??[0,0,0,0],outlineSize:i.outlineWidth,referenceSize:i.referenceSize||a.CIMVectorMarker.size,rotateClockwise:i.rotateClockwise,scaleFactor:o??1,sizeRatio:i.sizeRatio,alignment:i.alignment,isAbsoluteAnchorPoint:i.isAbsoluteAnchorPoint,scaleSymbolsProportionally:i.scaleSymbolsProportionally,sprite:i.spriteRasterizationParam,hasSizeVV:s,placement:i.markerPlacement,effects:i.effects?{type:"cim-effect-infos",effectInfos:i.effects}:null,transforms:i.transform,minPixelBuffer:t(l)})]}function b(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o,s={visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity};if(e.animationParams){const a=l.animatedFill;return p(r.ensureInstance(a,{uniforms:{...s,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}}),e,n,i)}return h(r.ensureInstance(l.fill,{uniforms:s,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function V(e,a,i){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return z(o.ensureInstance(l.outlineFill,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function z(e,a,i){const l=c(a.color)??[0,0,0,0],t=c(a.outlineColor)??[0,0,0,0];return[e.createMeshInfo({color:l,outlineColor:t,width:a.outlineWidth,referenceWidth:a.referenceWidth,capType:a.cap,joinType:a.join,miterLimit:a.miterLimit,outlineUsesColorVV:!a.outlineColorLocked,hasSizeVV:!1,scaleInfo:i.scaleInfo,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,outlineEffects:a.outlineEffects?{type:"cim-effect-infos",effectInfos:a.outlineEffects}:null})]}function h(e,a,{scaleInfo:i}){return[e.createMeshInfo({color:c(a.color)??[0,0,0,0],scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function v(e,a,i){if(!e.spriteRasterizationParam)return b(e,a,i);const{uniforms:t,schemaOptions:o}=a,{store:r}=o,s={visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity};if(e.animationParams){const a=l.animatedFill;return p(r.ensureInstance(a,{uniforms:{...s,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableSizeScaleStops:null,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,lineLength:!1}}),e,n,i)}return d(r.ensureInstance(l.complexFill,{uniforms:s,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,null!=t.visualVariableColor,i)}function d(e,a,i,{scaleInfo:l}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const t=!!a.hasUnresolvedReplacementColor&&(!i||a.colorLocked),n=a.sampleAlphaOnly&&!t,o=a.spriteRasterizationParam;return[e.createMeshInfo({color:c(a.color)??[0,0,0,0],height:a.height,aspectRatio:a.scaleX,offsetX:a.offsetX,offsetY:a.offsetY,scaleX:1,scaleY:1,angle:a.angle,applyRandomOffset:a.applyRandomOffset,sampleAlphaOnly:n,scaleProportionally:"CIMHatchFill"===o.resource.type,sprite:o,scaleInfo:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function y(e,a,i){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return g(o.ensureInstance(l.gradientFill,{uniforms:{visualVariableColor:null,visualVariableOpacity:t.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function g(e,a,{scaleInfo:i}){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({color:c(a.color)??[0,0,0,0],angle:a.angle,gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,scaleInfo:i,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function I(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o,s=e.isOutline?{...n,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue};if(e.animationParams){const{hasShiftAnimation:a}=e.animationParams.params,t=l.animatedLine;return p(r.ensureInstance(t,{uniforms:{...s,visualVariableRotation:null},optionalAttributes:{zoomRange:!0,value1Position2Value2:!1,accumulatedDistance:!0,segmentDirection:!0,normal:!0,lineLength:a}}),e,n,i)}const c={uniforms:s,optionalAttributes:{zoomRange:!!i.scaleInfo}},u=!!(s.visualVariableSizeMinMaxValue||s.visualVariableSizeScaleStops||s.visualVariableSizeStops||s.visualVariableSizeUnitValue);if(!e.spriteRasterizationParam){return P(r.ensureInstance(l.line,c),e,u,i)}return R(r.ensureInstance(l.texturedLine,c),e,u,i)}function M(e,a,{scaleInfo:i}){return{color:c(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:a,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function P(e,a,i,l){if(a.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const t=M(a,i,l);return[e.createMeshInfo(t)]}function R(e,a,i,l){const{spriteRasterizationParam:t,scaleDash:n,sampleAlphaOnly:o}=a;if(!t)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...M(a,i,l),offsetAlongLine:a.offsetAlongLine??0,shouldScaleDash:n??!1,shouldSampleAlphaOnly:o,isSDF:"CIMPictureStroke"!==t.resource.type&&"CIMGradientStroke"!==t.resource.type,sprite:t})]}function k(e,a,i){const{uniforms:t,schemaOptions:o}=a,{store:r}=o;return C(r.ensureInstance(l.gradientStroke,{uniforms:e.isOutline?{...n,visualVariableSizeScaleStops:t.visualVariableSizeOutlineScaleStops}:{visualVariableColor:null,visualVariableOpacity:t.visualVariableOpacity,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function C(e,a,i){if(!a.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const l=a.spriteRasterizationParam;return[e.createMeshInfo({...M(a,!1,i),gradientMethod:a.gradientMethod,gradientSize:a.gradientSize,gradientSizeUnits:a.gradientSizeUnits,gradientType:a.gradientType,sprite:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null})]}function A(e,a,i){const{uniforms:t,schemaOptions:n}=a,{store:o}=n;return L(o.ensureInstance(l.text,{uniforms:{visualVariableColor:e.colorLocked?null:t.visualVariableColor,visualVariableOpacity:t.visualVariableOpacity,visualVariableRotation:t.visualVariableRotation,visualVariableSizeMinMaxValue:t.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:t.visualVariableSizeScaleStops,visualVariableSizeStops:t.visualVariableSizeStops,visualVariableSizeUnitValue:t.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1,visibility:!1}}),e,t,i)}function L(e,a,i,{scaleInfo:l,scaleExpression:n}){return[e.createMeshInfo({boxBackgroundColor:c(a.backgroundColor),boxBorderLineColor:c(a.borderLineColor),boxBorderLineSize:a.borderLineWidth??0,color:c(a.color)??[0,0,0,0],offsetX:a.offsetX,offsetY:a.offsetY,postAngle:a.angle,fontSize:a.size,referenceSize:a.referenceSize,decoration:a.decoration,haloColor:c(a.haloColor)??[0,0,0,0],haloSize:a.haloSize??0,outlineColor:c(a.outlineColor)??[0,0,0,0],outlineSize:a.outlineSize,lineWidth:a.lineWidth||512,lineHeightRatio:1,horizontalAlignment:a.horizontalAlignment??"center",verticalAlignment:a.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:a.textRasterizationParam,scaleInfo:l,effects:a.effects?{type:"cim-effect-infos",effectInfos:a.effects}:null,placement:a.markerPlacement,transforms:a.transform,scaleFactor:n??1,minPixelBuffer:t(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null,labelClassId:-1})]}export{m as createAnimatedMarkerMeshInfos,p as createAnimatedPolyMeshInfos,d as createComplexFillMeshInfos,S as createComplexMarkerMeshInfos,h as createComplexSimpleFillMeshInfos,P as createComplexSimpleLineMeshInfos,z as createComplexSimpleOutlineFillMeshInfos,u as createComplexSymbolInstances,L as createComplexTextMeshInfos,R as createComplexTexturedLineMeshInfos,g as createGradientFillMeshInfos,C as createGradientStrokeMeshInfos,s as getScaleInfo};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function
|
|
5
|
+
import{TextureFilter as A}from"../../../../../../../symbols/cim/enums.js";function e(A){return!!(A.visualVariableSizeMinMaxValue||A.visualVariableSizeScaleStops||A.visualVariableSizeStops||A.visualVariableSizeUnitValue||A.visualVariableSizeOutlineScaleStops)}function a(A){return!!A.visualVariableRotation}function i(e){return e.spriteRasterizationParam?e.spriteRasterizationParam:{type:"sprite-rasterization-param",resource:{type:"CIMPictureMarker",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAJOgAACToAYJjBRwAAAAsSURBVEhL7c0xAQAwDASh+jf9lcCU7TDA27ECKqACKqACKqACKqACKqDjYPuLVfSmMPfafQAAAABJRU5ErkJggg==",size:16,invertBackfaceTexture:!1,scaleX:1,textureFilter:A.Picture},overrides:[]}}export{i as getAnimatedTechniqueSprite,a as hasRotationVVUniform,e as hasSizeVVUniform};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ReshapeOperation as r}from"./ReshapeOperation.js";import{InteractiveToolBase as s}from"../../../../interactive/InteractiveToolBase.js";import{sketchKeys as p}from"../../../../interactive/keybindings.js";import a from"../../../../interactive/sketch/SketchOptions.js";let h=class extends s{constructor(e){super(e),this._reshapeOperation=null,this.events=new t,this.enableZShape=!0,this.enableZVertex=!0,this.enableMoveObject=!0,this.enableDeleteVertices=!0,this.autoHideManipulators=!1,this.enableMidpoints=!0,this.enableEdgeOffset=!1,this.type="reshape-3d",this.sketchOptions=new a,this.snappingManager=null,this.automaticManipulatorSelection=!1}initialize(){const e=this._reshapeOperation=new r({tool:this});this.addHandles([e.events.on("reshape",(e=>this.events.emit("reshape",e))),e.events.on("move",(e=>this.events.emit("move",e))),e.events.on("vertex-add",(e=>this.events.emit("vertex-add",e))),e.events.on("vertex-remove",(e=>this.events.emit("vertex-remove",e))),e.events.on("immediate-click",(e=>this.events.emit("immediate-click",{...e,object:this.object}))),this.view.on("pointer-down",["Shift"],(e=>e.stopPropagation()))]),this.finishToolCreation()}destroy(){this._reshapeOperation=o(this._reshapeOperation)}get updating(){return((this.object.updating??!1)||this._reshapeOperation?.updating)??!1}get activeTooltipInfo(){return this._reshapeOperation?.activeTooltipInfo??null}get tooltip(){return this._reshapeOperation?.tooltip??null}onManipulatorSelectionChanged(){this._reshapeOperation?.onManipulatorSelectionChanged()}get canUndo(){return this._reshapeOperation?.canUndo??!1}undo(){this.snappingManager?.doneSnapping(),this._reshapeOperation?.undo()}get canRedo(){return this._reshapeOperation?.canRedo??!1}redo(){this.snappingManager?.doneSnapping(),this._reshapeOperation?.redo()}onInputEvent(e){const t=this._reshapeOperation;if(t&&!t.enterInputModeIfAvailable(e)&&this.enableDeleteVertices&&"key-down"===e.type&&p.delete.includes(e.key)){t.removeSelectedVertices()>0&&e.stopPropagation()}}reset(){}};e([i()],h.prototype,"_reshapeOperation",void 0),e([i({constructOnly:!0})],h.prototype,"view",void 0),e([i({constructOnly:!0})],h.prototype,"automaticAreaMeasurementUtils",void 0),e([i({constructOnly:!0})],h.prototype,"automaticLengthMeasurementUtils",void 0),e([i({constructOnly:!0})],h.prototype,"object",void 0),e([i()],h.prototype,"enableZShape",void 0),e([i()],h.prototype,"enableZVertex",void 0),e([i()],h.prototype,"enableMoveObject",void 0),e([i()],h.prototype,"enableDeleteVertices",void 0),e([i()],h.prototype,"autoHideManipulators",void 0),e([i()],h.prototype,"enableMidpoints",void 0),e([i()],h.prototype,"enableEdgeOffset",void 0),e([i()],h.prototype,"type",void 0),e([i({type:a})],h.prototype,"sketchOptions",void 0),e([i()],h.prototype,"snappingManager",void 0),e([i()],h.prototype,"updating",null),e([i()],h.prototype,"activeTooltipInfo",null),e([i()],h.prototype,"tooltip",null),e([i()],h.prototype,"automaticManipulatorSelection",void 0),h=e([n("esri.views.3d.interactive.editingTools.reshape.ReshapeTool3D")],h);export{h as ReshapeTool3D};
|
|
5
|
+
import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import{destroyMaybe as o}from"../../../../../core/maybe.js";import{property as i}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators/subclass.js";import{ReshapeOperation as r}from"./ReshapeOperation.js";import{InteractiveToolBase as s}from"../../../../interactive/InteractiveToolBase.js";import{sketchKeys as p}from"../../../../interactive/keybindings.js";import a from"../../../../interactive/sketch/SketchOptions.js";let h=class extends s{constructor(e){super(e),this._reshapeOperation=null,this.events=new t,this.enableZShape=!0,this.enableZVertex=!0,this.enableMoveObject=!0,this.enableDeleteVertices=!0,this.autoHideManipulators=!1,this.enableMidpoints=!0,this.enableEdgeOffset=!1,this.type="reshape-3d",this.sketchOptions=new a,this.snappingManager=null,this.automaticManipulatorSelection=!1}initialize(){const e=this._reshapeOperation=new r({tool:this});this.addHandles([e.events.on("reshape",(e=>this.events.emit("reshape",e))),e.events.on("move",(e=>this.events.emit("move",e))),e.events.on("vertex-add",(e=>this.events.emit("vertex-add",e))),e.events.on("vertex-remove",(e=>this.events.emit("vertex-remove",e))),e.events.on("immediate-click",(e=>this.events.emit("immediate-click",{...e,object:this.object}))),this.view.on("pointer-down",["Shift"],(e=>e.stopPropagation()))]),this.finishToolCreation()}destroy(){this._reshapeOperation=o(this._reshapeOperation)}get updating(){return((this.object.updating??!1)||this._reshapeOperation?.updating||this.snappingManager?.updating)??!1}get activeTooltipInfo(){return this._reshapeOperation?.activeTooltipInfo??null}get tooltip(){return this._reshapeOperation?.tooltip??null}onManipulatorSelectionChanged(){this._reshapeOperation?.onManipulatorSelectionChanged()}get canUndo(){return this._reshapeOperation?.canUndo??!1}undo(){this.snappingManager?.doneSnapping(),this._reshapeOperation?.undo()}get canRedo(){return this._reshapeOperation?.canRedo??!1}redo(){this.snappingManager?.doneSnapping(),this._reshapeOperation?.redo()}onInputEvent(e){const t=this._reshapeOperation;if(t&&!t.enterInputModeIfAvailable(e)&&this.enableDeleteVertices&&"key-down"===e.type&&p.delete.includes(e.key)){t.removeSelectedVertices()>0&&e.stopPropagation()}}reset(){}};e([i()],h.prototype,"_reshapeOperation",void 0),e([i({constructOnly:!0})],h.prototype,"view",void 0),e([i({constructOnly:!0})],h.prototype,"automaticAreaMeasurementUtils",void 0),e([i({constructOnly:!0})],h.prototype,"automaticLengthMeasurementUtils",void 0),e([i({constructOnly:!0})],h.prototype,"object",void 0),e([i()],h.prototype,"enableZShape",void 0),e([i()],h.prototype,"enableZVertex",void 0),e([i()],h.prototype,"enableMoveObject",void 0),e([i()],h.prototype,"enableDeleteVertices",void 0),e([i()],h.prototype,"autoHideManipulators",void 0),e([i()],h.prototype,"enableMidpoints",void 0),e([i()],h.prototype,"enableEdgeOffset",void 0),e([i()],h.prototype,"type",void 0),e([i({type:a})],h.prototype,"sketchOptions",void 0),e([i()],h.prototype,"snappingManager",void 0),e([i()],h.prototype,"updating",null),e([i()],h.prototype,"activeTooltipInfo",null),e([i()],h.prototype,"tooltip",null),e([i()],h.prototype,"automaticManipulatorSelection",void 0),h=e([n("esri.views.3d.interactive.editingTools.reshape.ReshapeTool3D")],h);export{h as ReshapeTool3D};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import s from"../../../../core/Identifiable.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{DrapedRenderGroup as i,DrapeSourceType as c}from"../../layers/interfaces.js";import{DirtyOperation as u}from"../../webgl-engine/lib/ModelDirtyTypes.js";import{UpdatePolicy as a}from"../../webgl-engine/lib/UpdatePolicy.js";class
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import r from"../../../../core/Accessor.js";import s from"../../../../core/Identifiable.js";import{property as t}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as o}from"../../../../core/accessorSupport/decorators/subclass.js";import{DrapedRenderGroup as i,DrapeSourceType as c}from"../../layers/interfaces.js";import{DirtyOperation as u}from"../../webgl-engine/lib/ModelDirtyTypes.js";import{UpdatePolicy as a}from"../../webgl-engine/lib/UpdatePolicy.js";class d{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1,this._renderGroup=i.Outline}destroy(){this._destroyResources()}get resources(){return this._resources?.external}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){this._renderGroup=e;const r=this._resources?.layerView;r&&(r.renderGroup=e)}recreate(){this.attached&&this._createResources()}recreateGeometry(){this._resourceFactory.recreateGeometry?null!=this._resources&&(this._ensureRenderGeometriesRemoved(),this._resourceFactory.recreateGeometry(this._resources.external),this._syncGeometriesToRenderer()):this.recreate()}forEachMaterial(e){this._resources&&this._resourceFactory.forEachMaterial(this._resources.external,e)}_createOrDestroyResources(){this._attached?null==this._resources&&this._createResources():this._destroyResources()}_createResources(){this._destroyResources();const e=this._resourceFactory.createResources(),r=new n({view:this._resourceFactory.view,renderGroup:this._renderGroup}),s=this._resourceFactory.view.basemapTerrain?.overlayManager;this._resources={layerView:r,external:e,geometriesAdded:!1},s&&(this._resources.drapeSourceRenderer=s.registerGeometryDrapeSource(r)),this._syncGeometriesToRenderer()}_destroyResources(){if(null==this._resources)return;this._ensureRenderGeometriesRemoved();const e=this._resourceFactory.view.basemapTerrain?.overlayManager;e&&e.unregisterDrapeSource(this._resources.layerView),this._resourceFactory.destroyResources(this._resources.external),this._resources=null}_syncGeometriesToRenderer(){this._visible?this._ensureRenderGeometriesAdded():this._ensureRenderGeometriesRemoved()}_ensureRenderGeometriesRemoved(){if(null==this._resources?.drapeSourceRenderer)return;if(!this._resources.geometriesAdded)return;this._resources.drapeSourceRenderer.removeGeometries(this._resources.external.geometries,u.UPDATE),this._resources.geometriesAdded=!1}_ensureRenderGeometriesAdded(){if(null==this._resources?.drapeSourceRenderer)return;if(this._resources.geometriesAdded)return;this._resources.drapeSourceRenderer.addGeometries(this._resources.external.geometries,u.UPDATE),this._resources.geometriesAdded=!0}}let n=class extends(s.IdentifiableMixin(r)){constructor(e){super(e),this.drapeSourceType=c.Features,this.updatePolicy=a.SYNC,this.renderGroup=i.Outline}};e([t({constructOnly:!0})],n.prototype,"view",void 0),e([t({readOnly:!0})],n.prototype,"drapeSourceType",void 0),e([t()],n.prototype,"renderGroup",void 0),n=e([o("esri.views.3d.interactive.visualElements.DrapedVisualElementResources")],n);export{d as DrapedVisualElementResources};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../Graphic.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as l,throwIfAbortError as a}from"../../../core/promiseUtils.js";import{syncAndInitial as o,initial as n}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../core/sql/WhereClause.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import h from"../../../layers/support/FeatureFilter.js";import{fixFields as y,unpackFieldNames as c,populateMissingFields as f}from"../../../layers/support/fieldUtils.js";import m from"../../../rest/support/Query.js";import{isNumber as g}from"../../../support/guards.js";import{BuildingSublayerView3DMixin as F}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as b}from"./I3SMeshView3D.js";import{ForAllFeaturesMode as _}from"./II3SMeshView3D.js";import{applyFilterMode as w}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as E}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as x}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as S}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as j,I3SQueryFeature as v}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as I}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as Q,getIndexCrs as q}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as R}from"./support/DefinitionExpressionSceneLayerView.js";import{TemporalSceneLayerView as L}from"./support/TemporalSceneLayerView.js";import V from"../../layers/BuildingComponentSublayerView.js";import{hasPopupTemplate as U,getRequiredFields as A,getFetchPopupTemplate as C}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as H}from"../../support/layerViewUtils.js";import{TaskPriority as O}from"../../support/Scheduler.js";let D=class extends(L(R(b(F(V))))){constructor(e){super(e),this.type="building-component-sublayer-3d",this._elevationContext="scene",this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null}get i3slayer(){return this.sublayer}get layerViewUid(){return this.layerView.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){return this.sublayer.popupEnabled&&U(this.sublayer,this.layerView.view.popup?.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add((()=>this.mergedFilter),(e=>{null!=e&&x.checkSupport(e)?null==this._i3sFilter?this._i3sFilter=new x({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,r)=>this.addSqlFilter(e,r,this.logError),addTimeFilter:(e,r)=>this.addTimeFilter(e,r)}):this._i3sFilter.viewFilter=e:this._i3sFilter=s(this._i3sFilter)}),o),this._updatingHandles.add((()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields]),(()=>this._updateRequiredFields())),this._updatingHandles.add((()=>this.sublayer.renderer),(e=>this._rendererChange(e)),n);const e=()=>this._filterChange();this._updatingHandles.add((()=>this.parsedDefinitionExpression),e),this._updatingHandles.add((()=>this._i3sFilter?.sortedObjectIds),e),this._updatingHandles.add((()=>this._i3sFilter?.parsedWhereClause),e),this._updatingHandles.add((()=>this.getTimeFilterDependencies()),e),this._updatingHandles.add((()=>this.mergedFilter),e),this._updatingHandles.add((()=>[this._i3sFilter?.parsedGeometry,this.filter?.spatialRelationship]),(()=>this._geometryFilterChange())),this._updatingHandles.add((()=>this.parsedFilterExpressions),(()=>this._updateSymbologyOverride()),n),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.object.lodFactor}get parsedFilterExpressions(){return"Overview"===this.sublayer.modelName?[]:this.layerView.filterExpressions.map((([e,r])=>{let t;try{t=p.create(e,{fieldsIndex:this.sublayer.fieldsIndex})}catch(a){return i.getLogger(this).error("Failed to parse filterExpression: "+a),null}if(!t.isStandardized)return i.getLogger(this).error("filterExpression is using non standard function"),null;const s=[],l=t.fieldNames;return Q(l,this.sublayer.
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import r from"../../../Graphic.js";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as l,throwIfAbortError as a}from"../../../core/promiseUtils.js";import{syncAndInitial as o,initial as n}from"../../../core/reactiveUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import p from"../../../core/sql/WhereClause.js";import"../../../layers/buildingSublayers/BuildingComponentSublayer.js";import h from"../../../layers/support/FeatureFilter.js";import{fixFields as y,unpackFieldNames as c,populateMissingFields as f}from"../../../layers/support/fieldUtils.js";import m from"../../../rest/support/Query.js";import{isNumber as g}from"../../../support/guards.js";import{BuildingSublayerView3DMixin as F}from"./BuildingSublayerView3D.js";import{I3SMeshView3D as b}from"./I3SMeshView3D.js";import{ForAllFeaturesMode as _}from"./II3SMeshView3D.js";import{applyFilterMode as w}from"./i3s/BuildingFilterUtil.js";import{createGetFeatureExtent as E}from"./i3s/I3SGeometryUtil.js";import{I3SMeshViewFilter as x}from"./i3s/I3SMeshViewFilter.js";import{I3SQueryEngine as S}from"./i3s/I3SQueryEngine.js";import{I3SQueryFeatureAdapter as j,I3SQueryFeature as v}from"./i3s/I3SQueryFeatureAdapter.js";import{I3SQueryFeatureStore as I}from"./i3s/I3SQueryFeatureStore.js";import{findFieldsCaseInsensitive as Q,getIndexCrs as q}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as R}from"./support/DefinitionExpressionSceneLayerView.js";import{TemporalSceneLayerView as L}from"./support/TemporalSceneLayerView.js";import V from"../../layers/BuildingComponentSublayerView.js";import{hasPopupTemplate as U,getRequiredFields as A,getFetchPopupTemplate as C}from"../../layers/support/popupUtils.js";import{isInEffectiveScaleRange as H}from"../../support/layerViewUtils.js";import{TaskPriority as O}from"../../support/Scheduler.js";let D=class extends(L(R(b(F(V))))){constructor(e){super(e),this.type="building-component-sublayer-3d",this._elevationContext="scene",this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null}get i3slayer(){return this.sublayer}get layerViewUid(){return this.layerView.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){return this.sublayer.popupEnabled&&U(this.sublayer,this.layerView.view.popup?.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add((()=>this.mergedFilter),(e=>{null!=e&&x.checkSupport(e)?null==this._i3sFilter?this._i3sFilter=new x({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:e=>this._loadAsyncModule(e),addSqlFilter:(e,r)=>this.addSqlFilter(e,r,this.logError),addTimeFilter:(e,r)=>this.addTimeFilter(e,r)}):this._i3sFilter.viewFilter=e:this._i3sFilter=s(this._i3sFilter)}),o),this._updatingHandles.add((()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields]),(()=>this._updateRequiredFields())),this._updatingHandles.add((()=>this.sublayer.renderer),(e=>this._rendererChange(e)),n);const e=()=>this._filterChange();this._updatingHandles.add((()=>this.parsedDefinitionExpression),e),this._updatingHandles.add((()=>this._i3sFilter?.sortedObjectIds),e),this._updatingHandles.add((()=>this._i3sFilter?.parsedWhereClause),e),this._updatingHandles.add((()=>this.getTimeFilterDependencies()),e),this._updatingHandles.add((()=>this.mergedFilter),e),this._updatingHandles.add((()=>[this._i3sFilter?.parsedGeometry,this.filter?.spatialRelationship]),(()=>this._geometryFilterChange())),this._updatingHandles.add((()=>this.parsedFilterExpressions),(()=>this._updateSymbologyOverride()),n),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.object.lodFactor}get parsedFilterExpressions(){return"Overview"===this.sublayer.modelName?[]:this.layerView.filterExpressions.map((([e,r])=>{let t;try{t=p.create(e,{fieldsIndex:this.sublayer.fieldsIndex})}catch(a){return i.getLogger(this).error("Failed to parse filterExpression: "+a),null}if(!t.isStandardized)return i.getLogger(this).error("filterExpression is using non standard function"),null;const s=[],l=t.fieldNames;return Q(l,this.sublayer.fieldsIndex,{missingFields:s}),s.length>0?(i.getLogger(this).error(`filterExpression references unknown fields: ${s.join(", ")}`),null):[t,r]})).filter((e=>null!=e))}get filter(){return this._get("filter")}set filter(e){this._set("filter",x.checkSupport(e)?e:null)}isUpdating(){return super.isUpdating()||(this._i3sFilter?.updating??!1)}_updateSymbologyOverride(){const e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride(((r,t)=>{for(const[s,l]of e)try{if(s.testFeature(r))return w(t,l)}catch(i){this.logError(i)}return w(t,null)}),this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return y(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce(((e,[r])=>e.concat(r.fieldNames)),new Array))}get availableFields(){const e=this.sublayer,r=e.fieldsIndex;let t=this.requiredFields;if(e.outFields||e.layer.outFields){const i=[...e.outFields||[],...e.layer.outFields||[]];t=[...c(r,i),...t]}return y(r,t)}_createLayerGraphic(e){return new r({attributes:e,layer:this.sublayer.layer,sourceLayer:this.sublayer})}canResume(){return super.canResume()&&H(this.i3slayer.effectiveScaleRange,this.view.scale)&&(!this._controller||this._controller.rootNodeVisible)}async fetchPopupFeaturesFromGraphics(e,r){const t=this._validateFetchPopupFeatures(r);if(t)throw t;if(0===e.length)return[];const s=[],o=[],n=null!=this.sublayer.associatedLayer?await this.sublayer.associatedLayer.load(r):this.sublayer,u=c(this.sublayer.fieldsIndex,await A(n,C(this.sublayer,r)));l(r);const d=new Set;for(const i of e)f(i,u,d)?o.push(i):s.push(i);return 0===o.length?s:(null!=this.sublayer.associatedLayer&&await this.sublayer.associatedLayer.load().catch((()=>i.getLogger(this).warn("Failed to load associated feature layer. Displaying popup attributes from cached attributes."))),this.whenGraphicAttributes(o,Array.from(d)).catch((e=>(a(e),o))).then((e=>s.concat(e))))}async _updateRequiredFields(){const e=y(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:r}=this,{popupEnabled:i}=r;return i?C(r,e)?void 0:new t("buildingscenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{sublayer:r}):new t("buildingscenelayerview3d:fetchPopupFeatures","Popups are disabled",{sublayer:r})}getFilters(){const e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this._i3sFilter?.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return null!=this.filter?this.filter.createQuery(e):new m(e)}queryExtent(e,r){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),r?.signal)}queryFeatureCount(e,r){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),r?.signal)}queryFeatures(e,r){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),r?.signal).then((e=>{if(!e?.features)return e;const r=this.sublayer,t=r.layer;for(const i of e.features)i.layer=t,i.sourceLayer=r;return e}))}async queryObjectIds(e,r){return(await this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),r?.signal)).filter(g)}_ensureQueryEngine(){return this._queryEngine??=this._createQueryEngine(),this._queryEngine}_createQueryEngine(){const e=E(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new S({layerView:this,priority:O.FEATURE_QUERY_ENGINE,spatialIndex:new I({featureAdapter:new j({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),forAllFeatures:(e,r)=>this._forAllFeatures(((r,t,i)=>e(new v(r,t,i))),r,_.QUERYABLE),getFeatureExtent:e,sourceSpatialReference:q(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():m.from(e))}};e([u()],D.prototype,"i3slayer",null),e([u()],D.prototype,"layerView",void 0),e([u()],D.prototype,"lodFactor",null),e([u({readOnly:!0})],D.prototype,"parsedFilterExpressions",null),e([u({type:h})],D.prototype,"filter",null),e([u()],D.prototype,"_i3sFilter",void 0),e([u({type:[String],readOnly:!0})],D.prototype,"filterExpressionFields",null),e([u({type:[String],readOnly:!0})],D.prototype,"requiredFields",void 0),e([u({type:[String],readOnly:!0})],D.prototype,"availableFields",null),D=e([d("esri.views.3d.layers.BuildingComponentSublayerView3D")],D);export{D as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{removeUnordered as s,isSome as r}from"../../../core/arrayUtils.js";import{ByteSizeUnit as o}from"../../../core/ByteSizeUnit.js";import has from"../../../core/has.js";import n from"../../../core/Logger.js";import{equals as a}from"../../../core/MapUtils.js";import{destroyMaybe as l}from"../../../core/maybe.js";import d from"../../../core/PooledArray.js";import{ignoreAbortErrors as h,isAbortError as c,throwIfAborted as u,createResolver as _}from"../../../core/promiseUtils.js";import{initial as m,watch as g}from"../../../core/reactiveUtils.js";import{schedule as f}from"../../../core/scheduling.js";import{equals as p}from"../../../core/SetUtils.js";import{isArrayBuffer as y}from"../../../core/typedArrayUtil.js";import{property as b}from"../../../core/accessorSupport/decorators/property.js";import{subclass as I}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as v,invert as C}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as M}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as w,getTranslation as x}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{clone as E,create as R}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as O}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as j,t as S,o as A,a as D,f as T,g as F,d as V,H as N}from"../../../chunks/vec32.js";import{create as H}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as P}from"../../../chunks/vec42.js";import{fromValues as U}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as k}from"../../../core/support/UpdatingHandles.js";import{getSphericalPCPF as L}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{localLinearScaleFactors as G}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectBoundingSphere as B}from"../../../geometry/projection/projectBoundingSphere.js";import{projectBuffer as q}from"../../../geometry/projection/projectBuffer.js";import{getProjectorName as W}from"../../../geometry/projection/projectors.js";import{projectVectorToVector as z}from"../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as K,create as $,toRect as Q}from"../../../geometry/support/aaBoundingBox.js";import{create as X,intersects as Y}from"../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as J}from"../../../geometry/support/DoubleArray.js";import{compactFloatArray as Z}from"../../../geometry/support/FloatArray.js";import{compactIndices as ee}from"../../../geometry/support/Indices.js";import{a as te,f as ie,g as se}from"../../../chunks/sphere.js";import{newUByteArray as re}from"../../../geometry/support/UByteArray.js";import{fallbackObjectIDAttribute as oe}from"../../../layers/LayerConstants.js";import ne from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as ae}from"../../../layers/support/fieldUtils.js";import le from"../../../layers/support/SceneModification.js";import{getColor as de,getOpacity as he}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{isBasemapLayerView as ce}from"../../../support/basemapUtils.js";import{getElevationOffset as ue}from"../../../support/elevationInfoUtils.js";import{isQuery as _e}from"../../../support/guards.js";import{loadArcade as me}from"../../../support/loadArcade.js";import ge from"../../../symbols/MeshSymbol3D.js";import fe from"../../../symbols/SimpleFillSymbol.js";import{ContentGeometryUpdateEvent as pe}from"./ContentGeometryLayerView.js";import ye from"./I3SMeshViewLabeler.js";import{I3SMeshViewPerformanceInfo as be}from"./I3SMeshViewPerformanceInfo.js";import{I3SMeshWorkerHandle as Ie,toWasmModification as ve}from"./I3SMeshWorkerHandle.js";import{ElevationMode as Ce,ForAllFeaturesReturnType as Me,ForAllFeaturesMode as we}from"./II3SMeshView3D.js";import{initialize as xe,setModificationsSync as Ee,filterObbsForModificationsSync as Re,interpretObbModificationResults as Oe}from"./SceneLayerWorker.js";import{overrideColor as je}from"./graphics/graphicUtils.js";import{areLabelsVisible as Se}from"./graphics/Labeler.js";import{TextureUsage as Ae,TextureEncoding as De}from"./i3s/enums.js";import Te from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as Fe}from"./i3s/I3SAsyncElevationUpdater.js";import{getCachedAttributeValue as Ve}from"./i3s/I3SBinaryReader.js";import{I3SCrossfadeHelper as Ne,NodeCrossfadeMetaData as He}from"./i3s/I3SCrossfadeHelper.js";import{boundingBoxCornerPoints as Pe}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Ue}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as ke,selectEncoding as Le,defaultMaterial as Ge,createTexture as Be,configureMaterial as qe}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as We,NodeState as ze}from"./i3s/I3SNode.js";import{I3SOverrides as Ke}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as $e}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Qe,checkSceneLayerValid as Xe,checkSceneLayerCompatibleWithView as Ye,whenGraphicAttributes as Je,computeVisibilityObb as Ze,filterInPlace as et,intersectBoundingRectWithMbs as tt,MbsIntersectResult as it,addWraparound as st,getSymbolInfo as rt,transparentEdgeMaterial as ot,getClipRect as nt}from"./i3s/I3SUtil.js";import{IDBCache as at}from"./i3s/IDBCache.js";import{IDBMockCache as lt}from"./i3s/IDBMockCache.js";import{LayerElevationProvider as dt}from"./i3s/LayerElevationProvider.js";import{SymbologyInfo as ht}from"./i3s/SymbologyInfo.js";import{attributeLookup as ct}from"./support/attributeUtils.js";import{emptyHighlightHandle as ut,normalizeHighlightTargetExceptQuery as _t}from"./support/highlightUtils.js";import{makeScheduleFunction as mt}from"./support/makeScheduleFunction.js";import{ColorMixModeEnum as gt}from"./support/symbolColorUtils.js";import{debugFlags as ft}from"../support/debugFlags.js";import{ElevationRange as pt}from"../support/ElevationRange.js";import{toBoundingRect as yt}from"../support/extentUtils.js";import{Obb as bt}from"../support/orientedBoundingBox.js";import{updatingProgress as It}from"../support/updatingProperties.js";import{glLayout as vt}from"../support/buffer/glUtil.js";import{ObjectParameters as Ct}from"../webgl-engine/collections/Component/ObjectParameters.js";import{createVertexBufferLayout as Mt,GeometryParameters as wt}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as xt}from"../webgl-engine/collections/Component/Transform.js";import{TextureCoordinateType as Et}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasisTranscoder as Rt}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as Ot}from"../webgl-engine/lib/edgeRendering/interfaces.js";import{defaultHighlightName as jt}from"../../support/HighlightDefaults.js";import{TextureCompressionHandle as St}from"../../support/TextureCompressionHandle.js";import{alphaCutoff as At}from"../../../webscene/support/AlphaCutoff.js";const Dt=[1,1,1,1];class Tt extends He{constructor(e,t,i,s,r,o,n,a,l){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=n,this.anchorIds=a,this.anchors=l,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0}get cachedMemory(){return this.node.memory}get featureExtents(){return this._featureExtents??=new Float64Array(6*this.featureIds.length).fill(Number.POSITIVE_INFINITY),this._featureExtents}}var Ft;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(Ft||(Ft={}));const Vt=26,Nt=100*o.MEGABYTES,Ht=t=>{let o=class extends t{constructor(){super(...arguments),this._applySSAO=!0,this._shadeNormals=!0,this._updatingHandles=new k,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._compressionHandle=new St,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._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,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._planetRadiusInGlobalMode=0,this._elevationTask=null,this._needFilterResolve=!1,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new i,this._crossfadeHelper=new Ne(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerViewUid(){return this.uid}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get _isIntegratedMesh(){return"integrated-mesh"===this.i3slayer.type}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible&&this.fullOpacity>At}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Qe(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?Ae.AllTexturesPBR:Ae.AllTextures:this._usePBR||this._hasLoadedPBRTextures?Ae.GeometryTexturesPBR:Ae.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;return null!=e&&"absolute-height"===e.mode?ue(e,this.i3slayer.spatialReference):0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return new Jt(Ce.Absolute,0);const t=ue(e,this.i3slayer.spatialReference);switch(e.mode){case"absolute-height":return new Jt(Ce.Absolute,t);case"relative-to-ground":return new Jt(Ce.RelativeToGround,t);case"on-the-ground":return new Jt(Ce.OnTheGround,0);default:return new Jt(Ce.Absolute,0)}}get supportedTextureEncodings(){return ke(this.view.stage.renderView.capabilities)}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){const e=this._nodeId2Meta,t=new pt;for(const i of e.values()){if(null==i)continue;const{node:{serviceMbsInIndexSR:e}}=i,[s,r,o,n]=e;t.expandElevationRangeValues(o-n,o+n)}return t.elevationRangeValid?t:null}get fullExtent(){return this.i3slayer.fullExtent}initialize(){const e=has("enable-feature:idb-mock-cache");this._idbCache=e?new lt(this.view,e):new at("esri-scenelayer-cache","geometries"),this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const t=this.view.resourceController,i=t.memoryController;this.i3sOverrides=new Ke({view:this.view,layer:this.i3slayer,memoryController:i}),this._worker=new Ie(mt(t)),this.addResolvingPromise(this._worker.promise);const s=this.i3slayer.store;this.addResolvingPromise(this._worker.setLegacySchema(this.uid,s.defaultGeometrySchema).catch(h)),Xe(this.i3slayer),Ye(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new ne({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 r=s.defaultGeometrySchema;if(this._isIntegratedMesh||!r)this._hasComponentData=!1;else{const e=r.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=(r?.vertexAttributes.color??null)&&!this.i3slayer.cachedDrawingInfo?.color;const o=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,(e=>this._deleteComponentObject(e)));this._memCache=o;const a=this._controller,d=this._nodeId2Meta,c=this._nodeId2MetaReloading,u=e=>{const t=a.index;if(!t)return;const i=t.rootNode;if(!i)return;const s=t=>{const i=t.index,s=d.get(i)||c.get(i);return e(t,s?.objectHandle??null)};t.traverse(i,s)};this._intersectionHandler=new Ue({layerViewUid:this.layerViewUid,sublayerId:this.sublayerId,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:u}),this._elevationProvider=new dt({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),m),this._updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this._updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this._updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this._updatingHandles.add((()=>this.elevationInfo),((e,t)=>this._elevationInfoChanged(e,t)),m),this._updatingHandles.add((()=>!this.suspended&&this.elevationInfo.mode!==Ce.Absolute),((e,t)=>{e?this.addHandles(this.view.basemapTerrain.on("elevation-change",(({extent:e})=>this._ensureElevationTask().addExtent(e))),ti):t&&this.removeHandles(ti)}),m),this._updatingHandles.add((()=>this._usePBR),(e=>this._updatePBR(e)));const _=()=>{this._reloadAll(),this.clearMemCache()};this._updatingHandles.add((()=>this.rendererTextureUsage),_),this._updatingHandles.add((()=>this.contentVisible),(e=>this._contentVisibleChanged(e)),m),this._updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),m),this._updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),m),this._updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),m),this.addHandles([g((()=>ft.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&ft.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||ft.I3S_TREE_SHOW_TILES||(this._treeDebugger=l(this._treeDebugger))}),m),g((()=>ft.I3S_SHOW_MODIFICATIONS),(()=>this._showModifications()),m)]),this._cacheKeySuffix=this._getCacheKeySuffix(),this._idbCache.init().catch((e=>n.getLogger(this).warn(`Failed to initialize IndexedDB cache: ${e}`)));const{view:f}=this,{viewingMode:p,renderCoordsHelper:y}=f;this._planetRadiusInGlobalMode="local"===p?0:y.referenceEllipsoid.radius}destroy(){this._clearAddTasks(),this._elevationTask=l(this._elevationTask),this.i3sOverrides=l(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.objectsChanged(this.getVisibleObbs()),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=l(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=l(this._labeler),this._treeDebugger=l(this._treeDebugger),this._controller=l(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=l(this._crossfadeHelper),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null),this._updatingHandles=l(this._updatingHandles)}_memEstimateTextureAdded(e){const t=e.usedMemory;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(null!=e){const t=e.usedMemory;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=null!=this._labeler?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=null!=t?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=null!=t?t.node.memory:0)),e}get unloadedMemory(){return(null!=this._controller?this._controller.unloadedMemoryEstimate:0)+(null!=this._labeler?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!(Se(this.i3slayer)&&this._supportsLabeling))return void(null!=this._labeler&&(this._labeler.destroy(),this._labeler=null));if(null!=this._labeler)return;const e=new ye({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides,layerViewUid:this.uid});this._nodeId2Meta.forEach((t=>null!=t&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=xe().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=ve(this._layerClippingArea,this._modifications,t);Ee({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new d:null;this._nodeId2Meta.forEach(((e,t)=>{null==e?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._updateFeatureIdCounts(e,-1),this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):null!=s&&s.push(e.node)})),this.notifyChange("elevationRange"),null!=s&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),null!=s&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==We.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),null!=t?(this._updateFeatureIdCounts(t,-1),this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t),this.notifyChange("elevationRange")):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(null!=this._modificationGraphics&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!ft.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={outline:{color:[255,255,255],width:1}};this._modificationGraphics=[];for(const s of this._modifications){const r=s.geometry;r.spatialReference=this.i3slayer.spatialReference;const o=new fe({...t,color:e[s.type]});this._modificationGraphics.push(new i({geometry:r,symbol:o}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_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(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);null!=i?.attributeInfo&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);null!=s&&(await this.i3sOverrides.applyAttributeOverrides(s.featureIds,t,i,this._controller.requiredAttributes),s.attributeInfo=t,this._controller.reschedule((()=>{this._nodeId2Meta.get(e)===s&&this._attributeValuesChanged(s)}),i).catch((e=>{c(e)||n.getLogger(this).warn("Error while updating attribute values. Layer might not display correctly.",e)})))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.appliedFilters=null,null!=this._labeler&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){null!=this._memCache&&this._memCache.clear(),this._addTasks.forEach((e=>e.allowMemCache=!1))}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>null!=t&&e.push(t.node))),e}getVisibleObbs(){const e=new Array;return this._nodeId2Meta.forEach((t=>t&&e.push(this._collection.getComponentObb(t.objectHandle)))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&0!==(this.supportedTextureEncodings&De.Basis)&&this.i3slayer.textureSetDefinitions?.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))&&Rt()}_getVertexBufferLayout(e,t){return vt(Mt(this._getGeometryParameters({hasTexture:Wt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion})))}_getObjectIdField(){return this.i3slayer.objectIdField||oe}_getGlobalIdField(){return this.i3slayer.associatedLayer?.globalIdField}_findGraphicNodeAndIndex(e){const t=ct(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());for(const i of this._nodeId2Meta.values()){const e=i?.featureIds.indexOf(t);if(null!=e&&e>=0)return{node:i.node,index:e}}return null}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(null==i)return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const n of t){const e=ct(o,n.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this.getAABB(t.node.index,t.index);return null==i?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this.getAABB(e.nodeIndex,e.componentIndex)}getAABB(e,t){const i=this._nodeId2Meta.get(e);if(null==i?.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=Pe(t,this._collection,s,J(24),0),o=this.view.renderSpatialReference,n=this.view.spatialReference;return q(r,o,0,r,n,0)?K(r):null}whenGraphicAttributes(e,t){return Je(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(r)))}getGraphicFromIntersectorTarget(e,t){if(null==e.nodeIndex||null==e.componentIndex)return null;const i=this._nodeId2Meta.get(e.nodeIndex);if(null==i?.featureIds||e.componentIndex>=i.featureIds.length)return null;const s=this._createLayerGraphic(this._createAttributes(e.componentIndex,i));return t.defer?(t.defer((async()=>(s.geometry=(await import("./i3s/meshUtils.js")).createMesh({layerView:this,nodeIndex:e.nodeIndex,featureIndex:e.componentIndex}),s))),null):s}_getCacheKey(e){return`${this._layerUrl}/v${Vt}/${e}${this._cacheKeySuffix}`}_getCacheKeySuffix(){const e=this.view.renderSpatialReference;if(null==e)return si;if(e===L(e))return ri;return this.i3slayer.spatialReference.equals(e)?ii:null!=e.wkid?`@${e.wkid}`:null}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return null!=this._memCache?this._memCache.pop(this._getMemCacheKey(e)):null}deleteCachedGPUData(e){null!=e&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(null==this._memCache)return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,i)}loadMissingTextures(e,t,i,s){const r=e?.filter(((e,i)=>{if(0===(e.usage&this.rendererTextureUsage))return!1;if(null==t)return!0;const s=Le(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(null==r?.data||s&&r.encoding!==s.encoding)}))??[];return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e.id),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e.id)),null):(this.elevationInfo.mode===Ce.Absolute&&(e.geometryObbInRenderSR=bt.fromData(s.geometryObbData)),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&null!=s.textureData&&(s.byteSize=$t(s.transformedGeometry,s.textureData),s.textureData.every(Kt)&&this._indexedDbSizeCheck(e,s)&&this._idbCache.put(this._getCacheKey(e.id),s).catch((t=>n.getLogger(this).warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),u(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return zt(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(null==s)return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:a,anchorIds:l,anchors:d,transformedGeometry:h,globalTrafo:c}=s,u=j(Zt,r.center.x,r.center.y,r.center.z);S(u,u,c);const _=new bt(u,[r.extents.x,r.extents.y,r.extents.z],O(r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w));this.elevationInfo.mode===Ce.Absolute&&(e.geometryObbInRenderSR=_),t.geometryData.componentOffsets=o,a&&(t.geometryData.featureIds=Array.from(a)),t.geometryData.anchorIds=l,t.geometryData.anchors=d;const m={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:h,globalTrafo:c,geometryObbData:_.data,byteSize:$t(h,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&this._indexedDbSizeCheck(e,m)){const t=null!=m.textureData?m.textureData.map((e=>Kt(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e.id),{...m,textureData:t}).catch((t=>n.getLogger(this).warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,m,i)}),i))))):Promise.reject()}getElevationRange(e){const t=new pt,i=this._controller,{index:s}=i;if(!s)return t;const{rootNode:r}=s;if(!r)return t;const o=this._nodeId2Meta,n=e[3],a=i.viewportQueries,l=this._planetRadiusInGlobalMode,{view:d}=this,{renderCoordsHelper:h}=d,c=h.referenceEllipsoid.radius,u=this._collection,_=i=>{const{childrenLoaded:s}=i;if(0===s)return!1;const r=a.getAndUpdateVisibilityObbInRenderSR(i);let d=null,_=-1;if(r){if(_=r.radius,!r.intersectSphereWithMBS(e,_))return!1}else d=a.getServiceMbsInRenderSR(i),d&&(_=d[3]);if(_>=0&&n>=1*_)return null!=r?ai(t,r,l):null!=d&&d[3]>=0&&li(t,d,l),!1;const m=ni;if(m.elevationRangeMin=1/0,m.elevationRangeMax=-1/0,(null!=r||null!=d)&&(null!=r?ai(m,r,l):null!=d&&li(m,d,l),m.elevationRangeMin>=t.elevationRangeMin&&m.elevationRangeMax<=t.elevationRangeMax))return!1;const g=o.get(i.index);if(g){const{geometryObbInRenderSR:s}=i;if(!s||s.intersectSphereWithMBS(e)){if(s){if(n>0*s.radius)return ai(t,s,l),!1}const{objectHandle:e}=g,i=u.getObjectTransform(e),r=h.getAltitude(i.position);u.expandRangeWithComponentObjectElevationRange(e,r,c,t)}}return s-(g?1:0)>0};return s.traverse(r,_),t}computeVisibilityObb(e){return Ze(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(e,t,i){const s=t.geometryData.geometries??[],r=new Array(s.length);for(let f=0;f<s.length;++f)r[f]=this._getVertexBufferLayout(s[f],t.geometryDescriptor);const o=this.i3slayer.normalReferenceFrame,n=t.normalReferenceFrame??o??"none",a=e.serviceMbsInIndexSR,l=this.elevationOffset,d=this._controller.crsIndex,h=this._controller.crsVertex,c=this.view.renderSpatialReference,u=$e(a,l,n,d,c),_=W(d,h),m=W(h,c);if(null==_||null==m)return Promise.resolve(null);const g={context:this.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,globalTrafo:u,mbs:a,obbData:e.serviceObbInIndexSR?.data,elevationOffset:l,needNormals:this._controller.isMeshPyramid,normalReferenceFrame:n,indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get _supportsNodeCrossFading(){return!this.view?.stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||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,i){if(this.elevationInfo.mode===Ce.Absolute&&(e.geometryObbInRenderSR=this._collection.getComponentObb(t.objectHandle).clone()),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);null!=this._labeler&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,!0),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==Ce.Absolute&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights.objectCreated(t),null!=this._treeDebugger&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,i){if(!this.contentVisible||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(null==t)return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:o,globalTrafo:a}=t;await this.i3sOverrides.applyAttributeOverrides(r.featureIds,s.attributeInfo,i,this._controller.requiredAttributes);const l=null!=t.textureData?t.textureData.filter((e=>null!=e&&0!==(e.usage&this.rendererTextureUsage))):[];!has("disable-feature:i3s-basis")&&l.some((e=>null!=e&&(e.encoding===De.Basis||e.encoding===De.KTX2)))&&await Rt(),e.memory=0;const{componentOffsets:d,geometries:h,featureIds:c,anchorIds:u,anchors:_}=r,m=this._collection,g=h[0],{layout:f,indices:p,interleavedVertexData:y,positionData:b,hasColors:I}=o,{material:O,geometryParameters:j}=this._materialParameters(g,f),S=d||new Uint32Array([0,p?p.length:y.byteLength/f[0].stride]),T={vertices:{data:y,count:y.byteLength/f[0].stride,layoutParameters:j},positionData:{positions:Z(b.data),indices:ee(b.indices)},indices:p,componentOffsets:S},F=g.transformation?E(g.transformation):R();w(F,a,F);const V=x(H(),F),N=v(M(),F),P=this.view.renderSpatialReference,k=this.view.basemapTerrain.spatialReference,L=bt.fromData(t.geometryObbData).center,B=[1,1,1];G(L,P,B,k)||n.getLogger(this).errorOnce("Unsupported coordinate system for IM overlay");const q=H();z(L,P,q,k);const W=M();C(W,N);const K=H();A(K,D(K,L,V),W);const $=q[0]-K[0]*B[0],Q=q[1]-K[1]*B[1],X=m.createObject(new Ct(U($,Q,B[0],B[1]),new xt(V,N),bt.fromData(t.geometryObbData),T)),Y=j.textureCoordinates===Et.Atlas,{textures:J,texturePromise:te}=this._initMaterialAndTextures(X,O,l,Y,e);e.memory+=this._memEstimateGeometryAdded(X),e.memory+=J.reduce(((e,t)=>e+(null!=t?this._memEstimateTextureAdded(t):0)),0);const ie=!!O.hasParametersFromSource,se="blend"!==O.alphaMode&&O.metallicRoughness.baseColorFactor[3]>=1,re=new Tt(e,c,X,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:ie,isOpaque:se},J,u,_);s.meta=re,this._hasTextures||=t.requiredTextures?.some((({usage:e})=>0!==(e&Ae.ColorTextures)))||!!e.resources.texture,this._hasData=!0,this._hasColors||=I,this.notifyChange("hasTexturesOrVertexColors");const oe=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(re),te]).then((([t,s])=>(this._addTasks.has(e.index)&&t?.updateObjectVisibility(re.objectHandle,!1).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,re),i.meta=null,!this.contentVisible)return void this._removeNodeStageData(e.index,this.elevationOffset);m.setObjectVisibility(X,!0),t?.updateObjectVisibility(re.objectHandle,!0).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),re.attributeInfo=i.attributeInfo;const s=re.cachedRendererVersion!==this._rendererVersion,r=oe!==this.slicePlaneEnabled;this._updateElevationOffsets(re);const o=re.elevationOffsets;this._updateComponentData(re);const n=this._applyFiltersToNode(re);(s||null!=t&&(r||n||o))&&this._addOrUpdateEdgeRendering(re),null!=this._labeler&&this._addMetaToLabeler(this._labeler,re),this._visibleGeometryChanged(re,Pt.ADD),this._highlights.objectCreated(re),this._updateMaterial(re),this._setNewNodeOpacity(re),null!=this._treeDebugger&&this._treeDebugger.update()}),i)))).catch((e=>{const{meta:t,allowMemCache:i}=s;throw s.meta=null,t&&i?this._cacheGPUData(t):t&&this._deleteComponentObject(t),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){n.getLogger(this).error("Removing duplicated node");const t=this._nodeId2Meta.get(e);t&&(this._deleteComponentObject(t),this._updateFeatureIdCounts(t,-1))}else this._controller.updateLoadStatus(e,!0);t&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Yt(t.cachedEdgeMaterials,0),this._updateFeatureIdCounts(t,1)),this._nodeId2Meta.set(e,t),this.notifyChange("elevationRange")}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this._controller.crsIndex,s=this.elevationInfo,r=this.view.basemapTerrain,o=r.spatialReference,n=s.mode;if(null==t||null==o||n===Ce.Absolute)return void(e.elevationOffsets=null);const a=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const l=Zt,d=ei,h=n===Ce.OnTheGround,c=this.view.renderCoordsHelper,u=e.featureIds.length,_=(()=>{if(e.cachedElevationAnchors)return e.cachedElevationAnchors;const s=J(3*u);e.cachedElevationAnchors=s;for(let r=0;r<u;r++){const n=3*r,h=e.anchorIds?.indexOf(r)??-1;e.anchors&&h>=0?(j(l,e.anchors[3*h],e.anchors[3*h+1],e.anchors[3*h+2]),T(l,l,te(e.node.serviceMbsInIndexSR)),z(l,i,l,o),s[n]=l[0],s[n+1]=l[1],s[n+2]=c.getAltitude(l)):(this._collection.getComponentAabb(e.objectHandle,r,d,!0),j(l,(d[0]+d[3])/2,(d[1]+d[4])/2,d[2]),A(l,l,a.rotationScale),T(l,l,a.position),s[n+2]=c.getAltitude(l),z(l,t,l,o),s[n]=l[0],s[n+1]=l[1])}return s})(),m=s.offset,g=e.elevationOffsets,f=(e,t)=>{const i=h?_[3*e+2]:0;g[e]=m+(t??0)-i};r.getElevations(_,u,f)}_ensureElevationTask(){return null!=this._elevationTask||(this._elevationTask=new Fe(this.view.resourceController.scheduler,(e=>this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference)?.filterInPlace((e=>null!=this._nodeId2Meta.get(e)))),(e=>this._nodeElevationAlignmentChanged(this._nodeId2Meta.get(e))),(()=>this.elevationInfo?.mode))),this._elevationTask}_elevationInfoChanged(e,t){const i=e.mode!==Ce.Absolute,s=!!t&&t!==e&&t.mode!==Ce.Absolute;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach((e=>this._nodeElevationAlignmentChanged(e)))}_nodeElevationAlignmentChanged(e){null!=e&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),null!=this._labeler&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,Pt.UPDATE),this._elevationProvider.objectChanged(this._collection.getComponentObb(e.objectHandle)))}_safeReschedule(e,t){return u(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=null!=e.params.material?e.params.material:Ge(),s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=Wt(i);return{geometryParameters:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s,r){const o=this._stage.renderView,n=e=>{this._gpuMemoryEstimate-=e,this._texMemoryEstimate-=e,r.memory-=e},a=i.map((e=>Be(e,t,s,o,this._compressionHandle,n)));this._stage.addTextures(a);let l=null;return this._collection.updateMaterial(e,(e=>{l=qe(e,t,a,i,this.view.stage.renderView.textures,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:a,texturePromise:l}}_getGeometryParameters(e){return new wt(this._hasVertexColors,e.hasTexture?e.hasRegions?Et.Atlas:Et.Default:Et.None,e.hasNormals,this._shadeNormals,this._applySSAO)}_addData(e,t,i){let s=this._addTasks.get(e.index);if(s)s.attributeInfo=t;else{const r=_();s=new Xt(t,null,r.promise),this._addTasks.set(e.index,s),i().then(r.resolve,r.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))}return s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{null!=e.meta&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=X();this._renderClippingArea=yt(this.view.clippingArea,i,e)?i:null;const s=X();this._layerClippingArea=yt(this.view.clippingArea,s,t)?s: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),this._assertFeatureIdNodeCounts(e)}_assertFeatureIdNodeCounts(e){e&&!this._featureIdCounts?(this._featureIdCounts=_i(this._nodeId2Meta.values()),this._filteredIdCounts=_i(this._nodeId2Meta.values(),ui.Filtered),this._weaklyRemovedIdCounts=_i(this._nodeId2Meta.values(),ui.WeaklyRemoved),this.addHandles(g((()=>this._controller.updating),(e=>{!e&&this._needFilterResolve&&(this.multiGeometryFilterResolve(),this._needFilterResolve=!1,this.notifyUpdate())}),{sync:!0}),"updateFinished")):!e&&this._featureIdCounts&&(this._featureIdCounts=null,this._filteredIdCounts=null,this._weaklyRemovedIdCounts=null,this._mismatchShow=null,this._mismatchHide=null,this.removeHandles("updateFinished"),this._needFilterResolve=!1,this.notifyUpdate())}_updateFeatureIdCounts(e,t){this._featureIdCounts&&(this._needFilterResolve=!0,ci(this._featureIdCounts,e.featureIds,t),ci(this._filteredIdCounts,e.filteredIds,t),ci(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,t))}_updateFilteredIdCounts(e,t,i){this._filteredIdCounts&&(this._needFilterResolve=!0,ci(this._filteredIdCounts,t,-1),ci(this._filteredIdCounts,e.filteredIds,1),ci(this._weaklyRemovedIdCounts,i,-1),ci(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,1))}_checkFeatureIdNodeCountInvariant(){const e=null!=this._featureIdCounts;if(this.hasGeometryFilter!==e&&n.getLogger(this).error("checkFeatureIdNodeCountInvariant()","LayerView should have feature id node counts if and only if it has a geometry filter",{layerView:this,hasNodeCounts:e}),!this._featureIdCounts||!this._filteredIdCounts)return;const t=_i(this._nodeId2Meta.values());a(this._featureIdCounts,t)||n.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _featureIdCounts",{layerView:this,counts:this._featureIdCounts,expected:t});const i=_i(this._nodeId2Meta.values(),ui.Filtered);a(this._filteredIdCounts,i)||n.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _filteredIdCounts",{layerView:this,counts:this._filteredIdCounts,expected:i});const s=_i(this._nodeId2Meta.values(),ui.WeaklyRemoved);a(this._weaklyRemovedIdCounts,s)||n.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _weaklyRemovedIdCounts",{layerView:this,counts:this._weaklyRemovedIdCounts,expected:i})}multiGeometryFilterResolve(){if(!this._featureIdCounts||!this._filteredIdCounts)return;let e=null,t=null;for(const[i,s]of this._filteredIdCounts){const r=this._featureIdCounts.get(i);if(r!==s){s+(this._weaklyRemovedIdCounts?.get(i)??0)===r?(e??=new Set,e.add(i)):(t??=new Set,t.add(i))}}p(e,this._mismatchShow)&&p(t,this._mismatchHide)||(this._mismatchShow=e,this._mismatchHide=t,this._nodeId2Meta.forEach((e=>{if(!e?.filteredIds)return;const t=hi(e,this._mismatchShow,this._mismatchHide);this._collection.setAllComponentVisibilities(e.objectHandle,t),this._visibleGeometryChanged(e,Pt.UPDATE)})))}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{e&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,Pt.UPDATE))}))}getFilters(){const e=[],t=this._renderClippingArea;return null!=t&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(null!=t){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},n=this._createLayerGraphic(o),a=this.i3slayer.objectIdField,l=t.featureIds,d=t.attributeInfo?.attributeData;s.every((e=>e===a||null!=d?.[e]))&&et(e,l,(e=>{o[a]=l[e];for(const i of s)i!==a&&(o[i]=d?Ve(d[i],e):null);try{return i.testFeature(n)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return B(e.node.serviceMbsInIndexSR,this._controller.crsIndex,qt,this.view.renderSpatialReference),tt(t,qt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,Ut),Q(Ut,kt),Y(i,kt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===it.INSIDE)return;if(r===it.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const n=this._transformClippingArea(Lt,i,t.objectHandle);et(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,n)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}async _addOrUpdateEdgeRendering(e,t=!0){const i=e.objectHandle,{hasEdges:s,perFeatureEdgeMaterials:r}=this._getFilteredEdgeMaterials(e);s&&!this._edgeView&&(this._edgeView=await this._stage.renderer.loadEdgeView());const o=this._edgeView;if(!o)return null;const n=o.hasObject(i);if(s){if(n){if(this.nodeCrossfadingEnabled){Yt(r,this.getNodeOpacity(e))}return o.updateAllComponentMaterials(i,r,this.slicePlaneEnabled,t).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),o.updateObjectVisibility(i,!0).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),o.updateAllVerticalOffsets(i,e.elevationOffsets).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),o}const s=await this._collection.addEdges(i,o,r,this.slicePlaneEnabled,e.elevationOffsets);return e.edgeMemoryUsage=s,e.node.memory+=s,o}return n&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,o.removeObject(i)),null}_applyFiltersToNode(e){const t=e.filteredIds,i=e.weaklyRemovedIds;return!!this._applyFiltersToNodeComponents(e)&&(this._updateFilteredIdCounts(e,t,i),this._labeler?.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=t.getComponentCount(e.objectHandle),s=null!=e.filteredIds,r=0===i.invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!r;if(null!=e.filteredIds&&e.appliedFilters===this._filters||(e.weaklyRemovedIds=null,e.filteredIds=di(e,this._filters),e.appliedFilters=this._filters),s&&e.filteredIds===e.featureIds&&(!this._mismatchHide||e.filteredIds.every((e=>!this._mismatchHide?.has(e)))))return!r;const o=hi(e,this._mismatchShow,this._mismatchHide);return t.setAllComponentVisibilities(e.objectHandle,o),!0}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading))),this._elevationTask=l(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),null!=this._elevationTask&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);null!=s?(this._collection.setObjectVisibility(s.objectHandle,!1),null!=this._edgeView&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),this._visibleGeometryChanged(s,Pt.REMOVE),null!=this._labeler&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._updateFeatureIdCounts(s,-1),this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),null!=this._treeDebugger&&this._treeDebugger.update()):i.delete(e)}_deleteComponentObject(e){if(null!=this._edgeView&&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.removeTexture(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);null!=i&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===ze.Hole))}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){const i=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,i),this.notifyChange("elevationRange")}const i=this._nodeId2MetaReloading.get(e);i&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,i))}_invalidateAllSymbols(){this._rendererVersion=st(this._rendererVersion,1),this._controller?.requestUpdate()}_getInvalidRendererVersion(){return st(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=st(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 me()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:n.getLogger(this).warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.symbols)"mesh-3d"!==t.type&&n.getLogger(this).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(i,s)=>{const r=5*i;P(s.externalColor,t[r]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255);const o=this._stage.renderView.olidRenderHelper;if(o){const t=e.featureIds[i],r=this.sublayerId?`${this.layerViewUid}_${this.sublayerId}`:this.layerViewUid,n=ce(this.view,this.uid);o.setUidToObjectAndLayerId(t,t,this.layerId,r,this.layerPopupEnabledAndHasTemplate&&!n,e.node.resources.attributes,i,this.sublayerId),s.objectAndLayerIdColor=o.getObjectAndLayerIdColor({graphicUid:t,layerViewUid:r})}s.externalColorMixMode=t[r+4]&(1<<Ft.CastShadows)-1,s.castShadows=!!(t[r+4]&1<<Ft.CastShadows),s.pickable=!!(t[r+4]&1<<Ft.Pickable),s.elevationOffset=e.elevationOffsets?.[i]??0}}_getSymbolInfo(e,t){const i=e?.getSymbol(t,{arcade:this._arcade});if(!(i instanceof ge))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=rt(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=null!=this._symbologyOverrideFields&&this._symbologyOverrideFields.length>0?null!=this._rendererFields&&this._rendererFields.length>0?ae(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=e.attributeInfo?.attributeData,o=e.featureIds?this.i3slayer.objectIdField:null,n=null!=r&&null!=this._symbologyFields&&this._symbologyFields.length>0;let a=null,l=null;if(n&&null!=this._symbologyFields){a=[],l=[];for(const e of this._symbologyFields){const t=r[e];t&&(a.push(e),l.push(t))}}e.cachedSymbology||(e.cachedSymbology=re(5*e.featureIds.length));const d=new ht,h=this.fullOpacity,c=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):h;let u=null,_=Ot.OPAQUE,m=ot,g=0;for(let f=0;f<e.featureIds.length;f++){if(null!=o&&(i[o]=e.featureIds[f]),n&&a)for(let e=0;e<a.length;e++)i[a[e]]=Ve(l[e],f);const r=s?this._getSymbolInfo(s,t):null;let h,p;if(d.pickable=!0,s&&"visualVariables"in s){if(this._colorVariable){const e=de(this._colorVariable,t,{color:Bt,arcade:this._arcade});e&&(h=d.color,h[0]=e.r/255,h[1]=e.g/255,h[2]=e.b/255,h[3]=e.a??1,this._opacityVariable||null===e.a||(p=e.a))}this._opacityVariable&&(p=he(this._opacityVariable,t,{arcade:this._arcade}))}if(r?.material){const e=r.material;h=null==h||null==p?je(h,p,e.color,e.alpha,Dt,d.color):je(h,p,null,null,Dt,d.color)}if(h??=P(d.color,1,1,1,1),d.colorMixMode=r?.material?.colorMixMode??gt.Multiply,d.edgeMaterial=r?.edgeMaterial,this._symbologyOverride?.(t,d),null!=this._nodeColorOverride&&(this._nodeColorOverride(e.node,h),d.colorMixMode=gt.Replace),d.pickable&&=h[3]>=At,d.castShadows=r?r.castShadows:d.pickable,null!=d.edgeMaterial){const t=h[3]>=1&&(e.material.isOpaque||d.colorMixMode===gt.Replace)?Ot.OPAQUE:Ot.TRANSPARENT;d.edgeMaterial===u&&t===_||(m={...d.edgeMaterial,opacity:c,objectTransparency:t},u=d.edgeMaterial,_=t),e.cachedEdgeMaterials[f]=m}else e.cachedEdgeMaterials[f]=ot;e.cachedSymbology[g++]=Math.round(255*h[0]),e.cachedSymbology[g++]=Math.round(255*h[1]),e.cachedSymbology[g++]=Math.round(255*h[2]),e.cachedSymbology[g++]=Math.round(255*h[3]),e.cachedSymbology[g++]=d.colorMixMode|+d.castShadows<<Ft.CastShadows|+d.pickable<<Ft.Pickable}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||Yt(t,this.fullOpacity);const i=e.filteredIds;if(null==i){return{hasEdges:t.some((e=>e!==ot)),perFeatureEdgeMaterials:t}}let s=0,r=!1;const o=t.map(((t,o)=>e.featureIds[o]!==i[s]?ot:(r=r||t!==ot,s++,t)));return{hasEdges:r,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Yt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR,this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,Pt.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),null!=this._labeler&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,(t=>t.commonMaterialParameters.hasSlicePlane=e)),this._updateEdgeRendering(t,!1))}))}_updatePBR(e){this._nodeId2Meta.forEach((t=>{null!=t&&this._collection.updateMaterial(t.objectHandle,(t=>t.usePBR=e))})),this._hasLoadedPBRTextures=!0}get _usePBR(){return this._shadeNormals&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){null!=this._edgeView&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,i,s)=>s.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?Me.CONTINUE:e(t,i,s):e}_forAllFeatures(e,t,i){for(const s of this._nodeId2Meta.values()){if(null==s)continue;if(null!=t){switch(t(s.node.serviceMbsInIndexSR)){case Me.EXIT:return;case Me.SKIP:continue}}let r=Me.CONTINUE;switch(i){case we.ALL:r=this._forAllFeaturesOfNode(s,e);break;case we.VISIBLE_ONLY:r=this._forAllVisibleFeaturesOfNode(s,e);break;case we.QUERYABLE:r=this._forAllQueryableFeaturesOfNode(s,e)}if(r===Me.EXIT)return}}_forAllFeaturesOfNode(e,t){let i=Me.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===Me.EXIT)return i;return i}_forAllVisibleFeaturesOfNode(e,t){let i=Me.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===Me.CONTINUE))),i}_forAllQueryableFeaturesOfNode(e,t){const i=this._ignoreClientNodeOverriddenFeatures(t);if(null==this._renderClippingArea)return this._forAllFeaturesOfNode(e,i);const s=this._boundingRectNodeTest(e,this._renderClippingArea);if(s===it.OUTSIDE)return Me.CONTINUE;if(s===it.INSIDE)return this._forAllFeaturesOfNode(e,i);const r=Me.CONTINUE,o=e.featureIds,n=e.objectHandle,a=nt(this._renderClippingArea,this._collection.getObjectTransform(n));for(let l=0;l<o.length;l++){if(!this._boundingRectFeatureTest(e,l,a))continue;const t=i(o[l],l,e);if(t===Me.EXIT)return t}return r}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=t.attributeInfo?.attributeData;if(null!=s)for(const r of Object.keys(s))i[r]=Ve(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e,t){if(_e(e))return ut;const s=_t(e);if(0===s.length)return ut;const r=t?.name??jt,o=s[0]instanceof i?this._featureIdsFromGraphics(s):"number"==typeof s[0]?s:null;if(!o)return ut;const{set:n,handle:a}=this._highlights.acquireSet(r);return this._highlights.setFeatureIds(n,o),a}_featureIdsFromGraphics(e){const t=this.i3slayer.fieldsIndex,i=this._getObjectIdField();return e.map((e=>ct(t,e.attributes,i)))}resetHighlights(){l(this._highlights),this._highlights=new Te({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,we.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)})}_visibleGeometryChanged(e,t){this._elevationProvider&&(null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=f((()=>{const{node:t}=e,i=t.visibilityObbInRenderSR??t.geometryObbInRenderSR??t.serviceObbInRenderSR;if(null!=i){const e=$();i.toAaBoundingBox(e),this.emit("visible-geometry-changed",new pe(e))}else this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle=null}))),this._updateSnappingSources(e,t),this._elevationProvider.objectChanged(this._collection.getComponentObb(e.objectHandle)))}get performanceInfo(){return new be(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/1048576),this._idbCacheEnabled?Math.round(100*this._idbCache.getHitRate()):0)}checkInvariants(){}get test(){}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return null!=e?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}getNodeComponentHandle(e){return this._nodeId2Meta.get(e)?.objectHandle}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(e)}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);null!=s&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);null!=i&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(null==this._edgeView||!e.cachedEdgeMaterials)return;Yt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch((e=>this._logEdgeViewError(e,this.i3slayer.title)))}get hasModifications(){return this._isIntegratedMesh&&null!=this._layerClippingArea||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.uid,s=Qt(e);if(s){const t={context:i,buffer:s.buffer};Re(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=Oe(i);e.imModificationImpact=s,s!==We.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||null!=this._labeler&&this._labeler.updating||this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||null!=this._elevationTask&&this._elevationTask.running||this._needFilterResolve||this._compressionHandle.compressing}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(null==s)throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return this._snappingLocationsApplyElevation(s,o,r),{type:"components",objectIds:s.featureIds,locations:o,origin:r}},remove:()=>s(this._snappingSourcesTrackers,t)};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach(((t,i)=>{if(null==t)return;const s=this._controller.getRenderMbs(t.node);s&&e.add(i,s)})),t}_snappingLocationsApplyElevation(e,t,i){if(!e.elevationOffsets||this.elevationInfo.mode===Ce.Absolute)return;const s=t.position0,r=t.position1,o=t.componentIndex,n=H(),a=H(),l=(e,t)=>{T(e,e,i),this.view.renderCoordsHelper.worldUpAtPosition(e,a),T(e,e,F(a,a,t)),V(e,e,i)};for(let d=0;d<s.count;d++){const t=e.elevationOffsets[o.get(d)];s.getVec(d,n),l(n,t),s.setVec(d,n),r.getVec(d,n),l(n,t),r.setVec(d,n)}}_updateSnappingSources(e,t){const{index:i}=e.node,s=this._controller.getRenderMbs(e.node);if(null!=s)for(const r of this._snappingSourcesTrackers)t!==Pt.REMOVE&&t!==Pt.UPDATE||r.events.remove(i),t!==Pt.ADD&&t!==Pt.UPDATE||r.events.add(i,s)}_logEdgeViewError(e,t){c(e)||n.getLogger(this).warn("Error while processing edges. Edges on this layer might not display correctly",t,e)}_indexedDbSizeCheck(e,t){return t.byteSize>Nt?(n.getLogger(this).warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}};return e([b()],o.prototype,"_hasLoadedPBRTextures",void 0),e([b()],o.prototype,"_asyncModuleLoading",void 0),e([b()],o.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([b()],o.prototype,"view",void 0),e([b()],o.prototype,"i3slayer",void 0),e([b()],o.prototype,"_controller",void 0),e([b()],o.prototype,"_labeler",void 0),e([b()],o.prototype,"updating",void 0),e([b()],o.prototype,"suspended",void 0),e([b()],o.prototype,"contentVisible",null),e([b({readOnly:!0})],o.prototype,"legendEnabled",null),e([b(It)],o.prototype,"updatingProgress",void 0),e([b()],o.prototype,"updatingProgressValue",null),e([b()],o.prototype,"hasTexturesOrVertexColors",null),e([b()],o.prototype,"rendererTextureUsage",null),e([b()],o.prototype,"elevationOffset",null),e([b()],o.prototype,"elevationInfo",null),e([b({type:Boolean})],o.prototype,"slicePlaneEnabled",void 0),e([b()],o.prototype,"supportedTextureEncodings",null),e([b({type:[le]})],o.prototype,"_modifications",void 0),e([b({readOnly:!0})],o.prototype,"clientGeometry",null),e([b()],o.prototype,"elevationRange",null),e([b()],o.prototype,"fullExtent",null),e([b()],o.prototype,"_elevationTask",void 0),e([b({readOnly:!0})],o.prototype,"_usePBR",null),o=e([I("esri.views.3d.layers.I3SMeshView3D")],o),o};var Pt;!function(e){e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE"}(Pt||(Pt={}));const Ut=$(),kt=X(),Lt=X(),Gt=new bt,Bt=new t([0,0,0,0]),qt=ie(0,0,0,0);function Wt(e){if(null==e)return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function zt(e){return"geometryData"in e}function Kt(e){return null!=e&&y(e.data)}function $t(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(null!=t)for(const s of t)null!=s&&y(s.data)&&(i+=s.data.byteLength);return i}function Qt(e){if(0===e.length)return;const t=10*e.length,i=new Float64Array(t);let s=0;return e.forAll((e=>{let t=e.serviceObbInIndexSR;null==t&&(t=Gt,t.center=te(e.serviceMbsInIndexSR),t.halfSize=[e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3]]);const r=t.data;i[s++]=r[0],i[s++]=r[1],i[s++]=r[2],i[s++]=r[3],i[s++]=r[4],i[s++]=r[5],i[s++]=r[6],i[s++]=r[7],i[s++]=r[8],i[s++]=r[9]})),i}class Xt{constructor(e,t,i){this.attributeInfo=e,this.meta=t,this.promise=i,this.allowMemCache=!0}}function Yt(e,t){e.forEach((e=>e.opacity=t))}class Jt{constructor(e,t){this.mode=e,this.offset=t}}const Zt=H(),ei=$(),ti="elevation-change",ii="",si="@null",ri="@ECEF",oi=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],ni=new pt;function ai(e,t,i){let s=e.elevationRangeMin,r=e.elevationRangeMax;const o=i;if(o>0){t.getCorners(oi);for(const e of oi){const t=N(e)-o;s=Math.min(s,t),r=Math.max(r,t)}}else{t.getCorners(oi);for(const e of oi){const t=e[2];s=Math.min(s,t),r=Math.max(r,t)}}e.expandElevationRangeValues(s,r)}function li(e,t,i){const s=te(t),r=i>0?N(s)-i:s[2],o=se(t);e.expandElevationRangeValues(r-o,r+o)}function di(e,t){const i=e.featureIds.slice();for(const s of t)if(s(i,e),0===i.length)break;return i.length===e.featureIds.length?e.featureIds:i}function hi(e,t,i){const s=new Array,r=e.filteredIds;if(null==r||t?.size||i?.size){if(null!=r){let o=0;e.featureIds.forEach(((e,n)=>{if(r[o]===e)++o;else if(!t?.has(e))return;i?.has(e)||s.push(n)}))}}else e.featureIds.forEach(((e,t)=>{r[s.length]===e&&s.push(t)}));return s}function ci(e,t,i){if(e&&t)for(const s of t){const t=(e.get(s)??0)+i;t>0?e.set(s,t):e.delete(s)}}var ui;function _i(e,t=ui.All){const i=new Map;for(const s of e){ci(i,t===ui.All?s?.featureIds:t===ui.Filtered?s?.filteredIds:s?.weaklyRemovedIds,1)}return i}!function(e){e[e.All=0]="All",e[e.Filtered=1]="Filtered",e[e.WeaklyRemoved=2]="WeaklyRemoved"}(ui||(ui={}));export{Ht as I3SMeshView3D};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Color.js";import i from"../../../Graphic.js";import{removeUnordered as s,isSome as r}from"../../../core/arrayUtils.js";import{ByteSizeUnit as o}from"../../../core/ByteSizeUnit.js";import has from"../../../core/has.js";import a from"../../../core/Logger.js";import{equals as n}from"../../../core/MapUtils.js";import{destroyMaybe as l}from"../../../core/maybe.js";import d from"../../../core/PooledArray.js";import{ignoreAbortErrors as h,isAbortError as c,throwIfAborted as u,createResolver as _}from"../../../core/promiseUtils.js";import{initial as m,watch as g}from"../../../core/reactiveUtils.js";import{schedule as f}from"../../../core/scheduling.js";import{equals as p}from"../../../core/SetUtils.js";import{isArrayBuffer as y}from"../../../core/typedArrayUtil.js";import{property as b}from"../../../core/accessorSupport/decorators/property.js";import{subclass as I}from"../../../core/accessorSupport/decorators/subclass.js";import{fromMat4 as v,invert as C}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as M}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{multiply as w,getTranslation as x}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{clone as E,create as R}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as O}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{i as j,t as S,o as A,a as T,f as D,g as F,d as V,H as N}from"../../../chunks/vec32.js";import{create as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as H}from"../../../chunks/vec42.js";import{fromValues as U}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{UpdatingHandles as k}from"../../../core/support/UpdatingHandles.js";import{getSphericalPCPF as L}from"../../../geometry/spatialReferenceEllipsoidUtils.js";import{localLinearScaleFactors as G}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectBoundingSphere as B}from"../../../geometry/projection/projectBoundingSphere.js";import{projectBuffer as q}from"../../../geometry/projection/projectBuffer.js";import{getProjectorName as W}from"../../../geometry/projection/projectors.js";import{projectVectorToVector as z}from"../../../geometry/projection/projectVectorToVector.js";import{fromBuffer as K,create as $,toRect as Q}from"../../../geometry/support/aaBoundingBox.js";import{create as X,intersects as Y}from"../../../geometry/support/aaBoundingRect.js";import{newDoubleArray as J}from"../../../geometry/support/DoubleArray.js";import{compactFloatArray as Z}from"../../../geometry/support/FloatArray.js";import{compactIndices as ee}from"../../../geometry/support/Indices.js";import{a as te,f as ie,g as se}from"../../../chunks/sphere.js";import{newUByteArray as re}from"../../../geometry/support/UByteArray.js";import{fallbackObjectIDAttribute as oe}from"../../../layers/LayerConstants.js";import ae from"../../../layers/graphics/controllers/I3SOnDemandController.js";import{fixFields as ne}from"../../../layers/support/fieldUtils.js";import le from"../../../layers/support/SceneModification.js";import{getColor as de,getOpacity as he}from"../../../renderers/visualVariables/support/visualVariableUtils.js";import{isBasemapLayerView as ce}from"../../../support/basemapUtils.js";import{getElevationOffset as ue}from"../../../support/elevationInfoUtils.js";import{isQuery as _e}from"../../../support/guards.js";import{loadArcade as me}from"../../../support/loadArcade.js";import ge from"../../../symbols/MeshSymbol3D.js";import fe from"../../../symbols/SimpleFillSymbol.js";import{ContentGeometryUpdateEvent as pe}from"./ContentGeometryLayerView.js";import ye from"./I3SMeshViewLabeler.js";import{I3SMeshViewPerformanceInfo as be}from"./I3SMeshViewPerformanceInfo.js";import{I3SMeshWorkerHandle as Ie,toWasmModification as ve}from"./I3SMeshWorkerHandle.js";import{ElevationMode as Ce,ForAllFeaturesReturnType as Me,ForAllFeaturesMode as we}from"./II3SMeshView3D.js";import{initialize as xe,setModificationsSync as Ee,filterObbsForModificationsSync as Re,interpretObbModificationResults as Oe}from"./SceneLayerWorker.js";import{overrideColor as je}from"./graphics/graphicUtils.js";import{areLabelsVisible as Se}from"./graphics/Labeler.js";import{TextureUsage as Ae,TextureEncoding as Te}from"./i3s/enums.js";import De from"./i3s/Highlights.js";import{I3SAsyncElevationUpdater as Fe}from"./i3s/I3SAsyncElevationUpdater.js";import{getCachedAttributeValue as Ve}from"./i3s/I3SBinaryReader.js";import{I3SCrossfadeHelper as Ne,NodeCrossfadeMetaData as Pe}from"./i3s/I3SCrossfadeHelper.js";import{boundingBoxCornerPoints as He}from"./i3s/I3SGeometryUtil.js";import{I3SIntersectionHandler as Ue}from"./i3s/I3SIntersectionHandler.js";import{getSupportedEncodings as ke,selectEncoding as Le,defaultMaterial as Ge,createTexture as Be,configureMaterial as qe}from"./i3s/I3SMaterialUtil.js";import{NodeIMModificationImpact as We,NodeState as ze}from"./i3s/I3SNode.js";import{I3SOverrides as Ke}from"./i3s/I3SOverrides.js";import{computeGlobalTransformation as $e}from"./i3s/I3SProjectionUtil.js";import{rendererNeedsTextures as Qe,checkSceneLayerValid as Xe,checkSceneLayerCompatibleWithView as Ye,whenGraphicAttributes as Je,computeVisibilityObb as Ze,filterInPlace as et,intersectBoundingRectWithMbs as tt,MbsIntersectResult as it,addWraparound as st,getSymbolInfo as rt,transparentEdgeMaterial as ot,getClipRect as at}from"./i3s/I3SUtil.js";import{IDBCache as nt}from"./i3s/IDBCache.js";import{IDBMockCache as lt}from"./i3s/IDBMockCache.js";import{LayerElevationProvider as dt}from"./i3s/LayerElevationProvider.js";import{SymbologyInfo as ht}from"./i3s/SymbologyInfo.js";import{attributeLookup as ct}from"./support/attributeUtils.js";import{emptyHighlightHandle as ut,normalizeHighlightTargetExceptQuery as _t}from"./support/highlightUtils.js";import{makeScheduleFunction as mt}from"./support/makeScheduleFunction.js";import{ColorMixModeEnum as gt}from"./support/symbolColorUtils.js";import{debugFlags as ft}from"../support/debugFlags.js";import{ElevationRange as pt}from"../support/ElevationRange.js";import{toBoundingRect as yt}from"../support/extentUtils.js";import{Obb as bt}from"../support/orientedBoundingBox.js";import{updatingProgress as It}from"../support/updatingProperties.js";import{glLayout as vt}from"../support/buffer/glUtil.js";import{ObjectParameters as Ct}from"../webgl-engine/collections/Component/ObjectParameters.js";import{createVertexBufferLayout as Mt,GeometryParameters as wt}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as xt}from"../webgl-engine/collections/Component/Transform.js";import{TextureCoordinateType as Et}from"../webgl-engine/core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{loadBasisTranscoder as Rt}from"../webgl-engine/lib/BasisUtil.js";import{Transparency as Ot}from"../webgl-engine/lib/edgeRendering/interfaces.js";import{defaultHighlightName as jt}from"../../support/HighlightDefaults.js";import{TextureCompressionTracker as St}from"../../support/TextureCompressionTracker.js";import{alphaCutoff as At}from"../../../webscene/support/AlphaCutoff.js";const Tt=[1,1,1,1];class Dt extends Pe{constructor(e,t,i,s,r,o,a,n,l){super(),this.node=e,this.featureIds=t,this.objectHandle=i,this.cachedRendererVersion=s,this.attributeInfo=r,this.material=o,this.textures=a,this.anchorIds=n,this.anchors=l,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0}get cachedMemory(){return this.node.memory}get featureExtents(){return this._featureExtents??=new Float64Array(6*this.featureIds.length).fill(Number.POSITIVE_INFINITY),this._featureExtents}}var Ft;!function(e){e[e.CastShadows=4]="CastShadows",e[e.Pickable=5]="Pickable"}(Ft||(Ft={}));const Vt=26,Nt=100*o.MEGABYTES,Pt=t=>{let o=class extends t{constructor(){super(...arguments),this._applySSAO=!0,this._shadeNormals=!0,this._updatingHandles=new k,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._compressionTracker=new St,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._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,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._planetRadiusInGlobalMode=0,this._elevationTask=null,this._needFilterResolve=!1,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new i,this._crossfadeHelper=new Ne(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerViewUid(){return this.uid}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get _isIntegratedMesh(){return"integrated-mesh"===this.i3slayer.type}get contentVisible(){return!this.suspended&&this._controller?.rootNodeVisible&&this.fullOpacity>At}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}get updatingProgressValue(){return this._controller?.updatingProgress??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Qe(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?Ae.AllTexturesPBR:Ae.AllTextures:this._usePBR||this._hasLoadedPBRTextures?Ae.GeometryTexturesPBR:Ae.GeometryTextures}get elevationOffset(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;return null!=e&&"absolute-height"===e.mode?ue(e,this.i3slayer.spatialReference):0}get elevationInfo(){const e=null!=this.i3slayer?this.i3slayer.elevationInfo:null;if(null==e)return new Jt(Ce.Absolute,0);const t=ue(e,this.i3slayer.spatialReference);switch(e.mode){case"absolute-height":return new Jt(Ce.Absolute,t);case"relative-to-ground":return new Jt(Ce.RelativeToGround,t);case"on-the-ground":return new Jt(Ce.OnTheGround,0);default:return new Jt(Ce.Absolute,0)}}get supportedTextureEncodings(){return ke(this.view.stage.renderView.capabilities)}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){const e=this._nodeId2Meta,t=new pt;for(const i of e.values()){if(null==i)continue;const{node:{serviceMbsInIndexSR:e}}=i,[s,r,o,a]=e;t.expandElevationRangeValues(o-a,o+a)}return t.elevationRangeValid?t:null}get fullExtent(){return this.i3slayer.fullExtent}initialize(){const e=has("enable-feature:idb-mock-cache");this._idbCache=e?new lt(this.view,e):new nt("esri-scenelayer-cache","geometries"),this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const t=this.view.resourceController,i=t.memoryController;this.i3sOverrides=new Ke({view:this.view,layer:this.i3slayer,memoryController:i}),this._worker=new Ie(mt(t)),this.addResolvingPromise(this._worker.promise);const s=this.i3slayer.store;this.addResolvingPromise(this._worker.setLegacySchema(this.uid,s.defaultGeometrySchema).catch(h)),Xe(this.i3slayer),Ye(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new ae({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 r=s.defaultGeometrySchema;if(this._isIntegratedMesh||!r)this._hasComponentData=!1;else{const e=r.featureAttributes;this._hasComponentData=!!(e&&e.faceRange&&e.id)}this._hasVertexColors=null!=(r?.vertexAttributes.color??null)&&!this.i3slayer.cachedDrawingInfo?.color;const o=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,(e=>this._deleteComponentObject(e)));this._memCache=o;const n=this._controller,d=this._nodeId2Meta,c=this._nodeId2MetaReloading,u=e=>{const t=n.index;if(!t)return;const i=t.rootNode;if(!i)return;const s=t=>{const i=t.index,s=d.get(i)||c.get(i);return e(t,s?.objectHandle??null)};t.traverse(i,s)};this._intersectionHandler=new Ue({layerViewUid:this.layerViewUid,sublayerId:this.sublayerId,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:u}),this._elevationProvider=new dt({view:this.view,layerElevationSource:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add((()=>this.view.clippingArea),(()=>this._clippingAreaChanged()),m),this._updatingHandles.add((()=>this.fullOpacity),(e=>this._opacityChange(e))),this._updatingHandles.add((()=>this.slicePlaneEnabled),(e=>this._slicePlaneEnabledChange(e))),this._updatingHandles.add((()=>this.elevationOffset),((e,t)=>{this._reloadAll(t),this._controller.invalidateVisibilityObbs()})),this._updatingHandles.add((()=>this.elevationInfo),((e,t)=>this._elevationInfoChanged(e,t)),m),this._updatingHandles.add((()=>!this.suspended&&this.elevationInfo.mode!==Ce.Absolute),((e,t)=>{e?this.addHandles(this.view.basemapTerrain.on("elevation-change",(({extent:e})=>this._ensureElevationTask().addExtent(e))),ti):t&&this.removeHandles(ti)}),m),this._updatingHandles.add((()=>this._usePBR),(e=>this._updatePBR(e)));const _=()=>{this._reloadAll(),this.clearMemCache()};this._updatingHandles.add((()=>this.rendererTextureUsage),_),this._updatingHandles.add((()=>this.contentVisible),(e=>this._contentVisibleChanged(e)),m),this._updatingHandles.add((()=>this.i3slayer.labelsVisible),(()=>this._labelingChanged()),m),this._updatingHandles.add((()=>this.i3slayer.labelingInfo),(()=>this._labelingChanged()),m),this._updatingHandles.add((()=>this._modifications),(()=>this._modificationsChanged()),m),this.addHandles([g((()=>ft.I3S_TREE_SHOW_TILES),(e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then((({I3STreeDebugger:t})=>{!this._treeDebugger&&ft.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))}))}else e||ft.I3S_TREE_SHOW_TILES||(this._treeDebugger=l(this._treeDebugger))}),m),g((()=>ft.I3S_SHOW_MODIFICATIONS),(()=>this._showModifications()),m)]),this._cacheKeySuffix=this._getCacheKeySuffix(),this._idbCache.init().catch((e=>a.getLogger(this).warn(`Failed to initialize IndexedDB cache: ${e}`)));const{view:f}=this,{viewingMode:p,renderCoordsHelper:y}=f;this._planetRadiusInGlobalMode="local"===p?0:y.referenceEllipsoid.radius}destroy(){this._clearAddTasks(),this._elevationTask=l(this._elevationTask),this.i3sOverrides=l(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.objectsChanged(this.getVisibleObbs()),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=l(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=l(this._labeler),this._treeDebugger=l(this._treeDebugger),this._controller=l(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=l(this._crossfadeHelper),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null),this._updatingHandles=l(this._updatingHandles)}_memEstimateTextureAdded(e){const t=e.usedMemory;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(null!=e){const t=e.usedMemory;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=null!=this._labeler?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach((t=>e+=null!=t?t.node.memory:0)),this._nodeId2MetaReloading.forEach((t=>e+=null!=t?t.node.memory:0)),e}get unloadedMemory(){return(null!=this._controller?this._controller.unloadedMemoryEstimate:0)+(null!=this._labeler?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!(Se(this.i3slayer)&&this._supportsLabeling))return void(null!=this._labeler&&(this._labeler.destroy(),this._labeler=null));if(null!=this._labeler)return;const e=new ye({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides,layerViewUid:this.uid});this._nodeId2Meta.forEach((t=>null!=t&&this._addMetaToLabeler(e,t))),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then((e=>(--this._asyncModuleLoading,e)),(e=>{throw--this._asyncModuleLoading,e}))}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=xe().then((()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()})),void this.notifyUpdate();if(!0!==this._i3sWasmLoaded)return;const e=this.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const i=ve(this._layerClippingArea,this._modifications,t);Ee({context:e,modifications:i,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const s=this.hasModifications?new d:null;this._nodeId2Meta.forEach(((e,t)=>{null==e?(this._nodeId2Meta.delete(t),this._controller.updateLoadStatus(t,!1)):e.node.hasModifications?(this._updateFeatureIdCounts(e,-1),this._nodeId2Meta.delete(t),this._nodeId2MetaReloading.set(t,e)):null!=s&&s.push(e.node)})),this.notifyChange("elevationRange"),null!=s&&this._nodeId2MetaReloading.forEach((e=>s.push(e.node))),null!=s&&s.length>0&&(this.updateNodeModificationStatus(s),s.forAll((e=>{if(e.imModificationImpact!==We.Culled){const t=this._nodeId2Meta.get(e.index);this._controller.invalidateGeometryVisibility(e.index),null!=t?(this._updateFeatureIdCounts(t,-1),this._nodeId2Meta.delete(e.index),this._nodeId2MetaReloading.set(e.index,t),this.notifyChange("elevationRange")):this._nodeId2Meta.has(e.index)&&(this._nodeId2Meta.delete(e.index),this._controller.updateLoadStatus(e.index,!1))}}))),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(null!=this._modificationGraphics&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!ft.I3S_SHOW_MODIFICATIONS||0===this._modifications.length)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={outline:{color:[255,255,255],width:1}};this._modificationGraphics=[];for(const s of this._modifications){const r=s.geometry;r.spatialReference=this.i3slayer.spatialReference;const o=new fe({...t,color:e[s.type]});this._modificationGraphics.push(new i({geometry:r,symbol:o}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,((e,t)=>this._createAttributes(e,t)))}_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(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}setAttributeData(e,t){const i=this._nodeId2Meta.get(e);null!=i?.attributeInfo&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const s=this._nodeId2Meta.get(e);null!=s&&(await this.i3sOverrides.applyAttributeOverrides(s.featureIds,t,i,this._controller.requiredAttributes),s.attributeInfo=t,this._controller.reschedule((()=>{this._nodeId2Meta.get(e)===s&&this._attributeValuesChanged(s)}),i).catch((e=>{c(e)||a.getLogger(this).warn("Error while updating attribute values. Layer might not display correctly.",e)})))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.appliedFilters=null,null!=this._labeler&&this._labeler.setNodeMetaAttributes(e,((e,t)=>this._createAttributes(e,t))),this._updateEngineObject(e)}clearMemCache(){null!=this._memCache&&this._memCache.clear(),this._addTasks.forEach((e=>e.allowMemCache=!1))}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach((t=>null!=t&&e.push(t.node))),e}getVisibleObbs(){const e=new Array;return this._nodeId2Meta.forEach((t=>t&&e.push(this._collection.getComponentObb(t.objectHandle)))),e}getLoadedNodeIndices(e){this._nodeId2Meta.forEach(((t,i)=>e.push(i))),this._nodeId2MetaReloading.forEach(((t,i)=>e.push(i)))}_preLoadBasis(){!has("disable-feature:i3s-basis")&&0!==(this.supportedTextureEncodings&Te.Basis)&&this.i3slayer.textureSetDefinitions?.some((e=>e.formats.some((e=>"basis"===e.format||"ktx2"===e.format))))&&Rt()}_getVertexBufferLayout(e,t){return vt(Mt(this._getGeometryParameters({hasTexture:Wt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion})))}_getObjectIdField(){return this.i3slayer.objectIdField||oe}_getGlobalIdField(){return this.i3slayer.globalIdField}_findGraphicNodeAndIndex(e){const t=ct(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());for(const i of this._nodeId2Meta.values()){const e=i?.featureIds.indexOf(t);if(null!=e&&e>=0)return{node:i.node,index:e}}return null}_getGraphicIndices(e,t){const i=this._nodeId2Meta.get(e.index);if(null==i)return[];const s=[],r=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const a of t){const e=ct(o,a.attributes,r),t=i.featureIds.indexOf(e);-1!==t&&s.push(t)}return s}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const i=this.getAABB(t.node.index,t.index);return null==i?Promise.reject():Promise.resolve({boundingBox:i,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return null==e.nodeIndex||null==e.componentIndex?null:this.getAABB(e.nodeIndex,e.componentIndex)}getAABB(e,t){const i=this._nodeId2Meta.get(e);if(null==i?.featureIds||t>=i.featureIds.length)return null;const s=i.objectHandle,r=He(t,this._collection,s,J(24),0),o=this.view.renderSpatialReference,a=this.view.spatialReference;return q(r,o,0,r,a,0)?K(r):null}whenGraphicAttributes(e,t){return Je(this.i3slayer,e,this._getObjectIdField(),t,(()=>[...this._nodeId2Meta.values()].filter(r)))}getGraphicFromIntersectorTarget(e,t){if(null==e.nodeIndex||null==e.componentIndex)return null;const i=this._nodeId2Meta.get(e.nodeIndex);if(null==i?.featureIds||e.componentIndex>=i.featureIds.length)return null;const s=this._createLayerGraphic(this._createAttributes(e.componentIndex,i));return t.defer?(t.defer((async()=>(s.geometry=(await import("./i3s/meshUtils.js")).createMesh({layerView:this,nodeIndex:e.nodeIndex,featureIndex:e.componentIndex}),s))),null):s}_getCacheKey(e){return`${this._layerUrl}/v${Vt}/${e}${this._cacheKeySuffix}`}_getCacheKeySuffix(){const e=this.view.renderSpatialReference;if(null==e)return si;if(e===L(e))return ri;return this.i3slayer.spatialReference.equals(e)?ii:null!=e.wkid?`@${e.wkid}`:null}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&0===this.elevationOffset&&null!=this._cacheKeySuffix}loadCachedGPUData(e){return null!=this._memCache?this._memCache.pop(this._getMemCacheKey(e)):null}deleteCachedGPUData(e){null!=e&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(null==this._memCache)return void this._deleteComponentObject(e);const i=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,i)}loadMissingTextures(e,t,i,s){const r=e?.filter(((e,i)=>{if(0===(e.usage&this.rendererTextureUsage))return!1;if(null==t)return!0;const s=Le(e.encodings,this.supportedTextureEncodings),r=t[i];return!!(null==r?.data||s&&r.encoding!==s.encoding)}))??[];return 0===r.length?Promise.resolve(!1):i(r,s).then((i=>{let s=0;for(let r=0;r<e.length;r++)s<i.length&&i[s].id===e[r].id&&(t[r]=i[s],s++);return!0}))}loadCachedNodeData(e,t,i){return this._idbCacheEnabled?this._idbCache.get(this._getCacheKey(e.id),t).then((s=>null==s?null:s.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e.id)),null):(this.elevationInfo.mode===Ce.Absolute&&(e.geometryObbInRenderSR=bt.fromData(s.geometryObbData)),this.loadMissingTextures(s.requiredTextures,s.textureData,i,t).then((i=>(i&&this._idbCache.initialized&&null!=s.textureData&&(s.byteSize=$t(s.transformedGeometry,s.textureData),s.textureData.every(Kt)&&this._indexedDbSizeCheck(e,s)&&this._idbCache.put(this._getCacheKey(e.id),s).catch((t=>a.getLogger(this).warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${t}`)))),u(t),s)))))):Promise.resolve(null)}addNode(e,t,i){return zt(t)?null==t.geometryBuffer?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,(()=>this._transformNode(e,t,i).then((s=>this._safeReschedule((()=>{if(null==s)return e.hasModifications=!1,this._addCachedNodeData(e,null,i);e.hasModifications=s.transformedGeometry.hasModifications;const{obb:r,componentOffsets:o,featureIds:n,anchorIds:l,anchors:d,transformedGeometry:h,globalTrafo:c}=s,u=j(Zt,r.center.x,r.center.y,r.center.z);S(u,u,c);const _=new bt(u,[r.extents.x,r.extents.y,r.extents.z],O(r.orientation.x,r.orientation.y,r.orientation.z,r.orientation.w));this.elevationInfo.mode===Ce.Absolute&&(e.geometryObbInRenderSR=_),t.geometryData.componentOffsets=o,n&&(t.geometryData.featureIds=Array.from(n)),t.geometryData.anchorIds=l,t.geometryData.anchors=d;const m={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:h,globalTrafo:c,geometryObbData:_.data,byteSize:$t(h,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&this._indexedDbSizeCheck(e,m)){const t=null!=m.textureData?m.textureData.map((e=>Kt(e)?e:null)):null;this._idbCache.put(this._getCacheKey(e.id),{...m,textureData:t}).catch((t=>a.getLogger(this).warn(`Failed to store node in IndexedDB cache: ${e.id}: ${t}`)))}return this._addCachedNodeData(e,m,i)}),i))))):Promise.reject()}getElevationRange(e){const t=new pt,i=this._controller,{index:s}=i;if(!s)return t;const{rootNode:r}=s;if(!r)return t;const o=this._nodeId2Meta,a=e[3],n=i.viewportQueries,l=this._planetRadiusInGlobalMode,{view:d}=this,{renderCoordsHelper:h}=d,c=h.referenceEllipsoid.radius,u=this._collection,_=i=>{const{childrenLoaded:s}=i;if(0===s)return!1;const r=n.getAndUpdateVisibilityObbInRenderSR(i);let d=null,_=-1;if(r){if(_=r.radius,!r.intersectSphereWithMBS(e,_))return!1}else d=n.getServiceMbsInRenderSR(i),d&&(_=d[3]);if(_>=0&&a>=1*_)return null!=r?ni(t,r,l):null!=d&&d[3]>=0&&li(t,d,l),!1;const m=ai;if(m.elevationRangeMin=1/0,m.elevationRangeMax=-1/0,(null!=r||null!=d)&&(null!=r?ni(m,r,l):null!=d&&li(m,d,l),m.elevationRangeMin>=t.elevationRangeMin&&m.elevationRangeMax<=t.elevationRangeMax))return!1;const g=o.get(i.index);if(g){const{geometryObbInRenderSR:s}=i;if(!s||s.intersectSphereWithMBS(e)){if(s){if(a>0*s.radius)return ni(t,s,l),!1}const{objectHandle:e}=g,i=u.getObjectTransform(e),r=h.getAltitude(i.position);u.expandRangeWithComponentObjectElevationRange(e,r,c,t)}}return s-(g?1:0)>0};return s.traverse(r,_),t}computeVisibilityObb(e){return Ze(e,this.view.renderSpatialReference,this._controller.crsIndex,this.i3slayer.spatialReference,this.elevationOffset,this._modifications,this.view.renderCoordsHelper.sphericalPCPF)}_transformNode(e,t,i){const s=t.geometryData.geometries??[],r=new Array(s.length);for(let f=0;f<s.length;++f)r[f]=this._getVertexBufferLayout(s[f],t.geometryDescriptor);const o=this.i3slayer.normalReferenceFrame,a=t.normalReferenceFrame??o??"none",n=e.serviceMbsInIndexSR,l=this.elevationOffset,d=this._controller.crsIndex,h=this._controller.crsVertex,c=this.view.renderSpatialReference,u=$e(n,l,a,d,c),_=W(d,h),m=W(h,c);if(null==_||null==m)return Promise.resolve(null);const g={context:this.uid,geometryBuffer:t.geometryBuffer,geometryData:t.geometryData,geometryDescriptor:t.geometryDescriptor,layouts:r,globalTrafo:u,mbs:n,obbData:e.serviceObbInIndexSR?.data,elevationOffset:l,needNormals:this._controller.isMeshPyramid,normalReferenceFrame:a,indexToVertexProjector:_,vertexToRenderProjector:m};return this._worker.invoke(g,i)}get _supportsNodeCrossFading(){return!this.view?.stage?.renderer.shadowsEnabled}get nodeCrossfadingEnabled(){return this._supportsNodeCrossFading&&(this.lodCrossfadeinDuration>0||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,i){if(this.elevationInfo.mode===Ce.Absolute&&(e.geometryObbInRenderSR=this._collection.getComponentObb(t.objectHandle).clone()),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);null!=this._labeler&&this._addMetaToLabeler(this._labeler,t);const s=e.index;this._addNodeMeta(s,t),this.updateNodeState(s,i),this._collection.setObjectVisibility(t.objectHandle,!0),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==Ce.Absolute&&this._ensureElevationTask().schedule(s),this._updateEngineObject(t),this._highlights.objectCreated(t),null!=this._treeDebugger&&this._treeDebugger.update()}addCachedNodeData(e,t,i,s){return this._addData(e,i,(()=>this._addCachedNodeData(e,t,s)))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,i){if(!this.contentVisible||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(null==t)return void this._addNodeMeta(e.index,null);const s=this._addTasks.get(e.index),{geometryData:r,transformedGeometry:o,globalTrafo:n}=t;await this.i3sOverrides.applyAttributeOverrides(r.featureIds,s.attributeInfo,i,this._controller.requiredAttributes);const l=null!=t.textureData?t.textureData.filter((e=>null!=e&&0!==(e.usage&this.rendererTextureUsage))):[];!has("disable-feature:i3s-basis")&&l.some((e=>null!=e&&(e.encoding===Te.Basis||e.encoding===Te.KTX2)))&&await Rt(),e.memory=0;const{componentOffsets:d,geometries:h,featureIds:c,anchorIds:u,anchors:_}=r,m=this._collection,g=h[0],{layout:f,indices:p,interleavedVertexData:y,positionData:b,hasColors:I}=o,{material:O,geometryParameters:j}=this._materialParameters(g,f),S=d||new Uint32Array([0,p?p.length:y.byteLength/f[0].stride]),D={vertices:{data:y,count:y.byteLength/f[0].stride,layoutParameters:j},positionData:{positions:Z(b.data),indices:ee(b.indices)},indices:p,componentOffsets:S},F=g.transformation?E(g.transformation):R();w(F,n,F);const V=x(P(),F),N=v(M(),F),H=this.view.renderSpatialReference,k=this.view.basemapTerrain.spatialReference,L=bt.fromData(t.geometryObbData).center,B=[1,1,1];G(L,H,B,k)||a.getLogger(this).errorOnce("Unsupported coordinate system for IM overlay");const q=P();z(L,H,q,k);const W=M();C(W,N);const K=P();A(K,T(K,L,V),W);const $=q[0]-K[0]*B[0],Q=q[1]-K[1]*B[1],X=m.createObject(new Ct(U($,Q,B[0],B[1]),new xt(V,N),bt.fromData(t.geometryObbData),D)),Y=j.textureCoordinates===Et.Atlas,{textures:J,texturePromise:te}=this._initMaterialAndTextures(X,O,l,Y,e);e.memory+=this._memEstimateGeometryAdded(X),e.memory+=J.reduce(((e,t)=>e+(null!=t?this._memEstimateTextureAdded(t):0)),0);const ie=!!O.hasParametersFromSource,se="blend"!==O.alphaMode&&O.metallicRoughness.baseColorFactor[3]>=1,re=new Dt(e,c,X,this._getInvalidRendererVersion(),s.attributeInfo,{hasParametersFromSource:ie,isOpaque:se},J,u,_);s.meta=re,this._hasTextures||=t.requiredTextures?.some((({usage:e})=>0!==(e&Ae.ColorTextures)))||!!e.resources.texture,this._hasData=!0,this._hasColors||=I,this.notifyChange("hasTexturesOrVertexColors");const oe=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(re),te]).then((([t,s])=>(this._addTasks.has(e.index)&&t?.updateObjectVisibility(re.objectHandle,!1).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),this._safeReschedule((()=>{const i=this._addTasks.get(e.index);if(!i)return;if(this._addNodeMeta(e.index,re),i.meta=null,!this.contentVisible)return void this._removeNodeStageData(e.index,this.elevationOffset);m.setObjectVisibility(X,!0),t?.updateObjectVisibility(re.objectHandle,!0).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),re.attributeInfo=i.attributeInfo;const s=re.cachedRendererVersion!==this._rendererVersion,r=oe!==this.slicePlaneEnabled;this._updateElevationOffsets(re);const o=re.elevationOffsets;this._updateComponentData(re);const a=this._applyFiltersToNode(re);(s||null!=t&&(r||a||o))&&this._addOrUpdateEdgeRendering(re),null!=this._labeler&&this._addMetaToLabeler(this._labeler,re),this._visibleGeometryChanged(re,Ht.ADD),this._highlights.objectCreated(re),this._updateMaterial(re),this._setNewNodeOpacity(re),null!=this._treeDebugger&&this._treeDebugger.update()}),i)))).catch((e=>{const{meta:t,allowMemCache:i}=s;throw s.meta=null,t&&i?this._cacheGPUData(t):t&&this._deleteComponentObject(t),e}))}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){a.getLogger(this).error("Removing duplicated node");const t=this._nodeId2Meta.get(e);t&&(this._deleteComponentObject(t),this._updateFeatureIdCounts(t,-1))}else this._controller.updateLoadStatus(e,!0);t&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&Yt(t.cachedEdgeMaterials,0),this._updateFeatureIdCounts(t,1)),this._nodeId2Meta.set(e,t),this.notifyChange("elevationRange")}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,i=this._controller.crsIndex,s=this.elevationInfo,r=this.view.basemapTerrain,o=r.spatialReference,a=s.mode;if(null==t||null==o||a===Ce.Absolute)return void(e.elevationOffsets=null);const n=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const l=Zt,d=ei,h=a===Ce.OnTheGround,c=this.view.renderCoordsHelper,u=e.featureIds.length,_=(()=>{if(e.cachedElevationAnchors)return e.cachedElevationAnchors;const s=J(3*u);e.cachedElevationAnchors=s;for(let r=0;r<u;r++){const a=3*r,h=e.anchorIds?.indexOf(r)??-1;e.anchors&&h>=0?(j(l,e.anchors[3*h],e.anchors[3*h+1],e.anchors[3*h+2]),D(l,l,te(e.node.serviceMbsInIndexSR)),z(l,i,l,o),s[a]=l[0],s[a+1]=l[1],s[a+2]=c.getAltitude(l)):(this._collection.getComponentAabb(e.objectHandle,r,d,!0),j(l,(d[0]+d[3])/2,(d[1]+d[4])/2,d[2]),A(l,l,n.rotationScale),D(l,l,n.position),s[a+2]=c.getAltitude(l),z(l,t,l,o),s[a]=l[0],s[a+1]=l[1])}return s})(),m=s.offset,g=e.elevationOffsets,f=(e,t)=>{const i=h?_[3*e+2]:0;g[e]=m+(t??0)-i};r.getElevations(_,u,f)}_ensureElevationTask(){return null!=this._elevationTask||(this._elevationTask=new Fe(this.view.resourceController.scheduler,(e=>this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference)?.filterInPlace((e=>null!=this._nodeId2Meta.get(e)))),(e=>this._nodeElevationAlignmentChanged(this._nodeId2Meta.get(e))),(()=>this.elevationInfo?.mode))),this._elevationTask}_elevationInfoChanged(e,t){const i=e.mode!==Ce.Absolute,s=!!t&&t!==e&&t.mode!==Ce.Absolute;this._intersectionHandler.updateElevationAlignState(i,this.view.state.viewingMode),i&&!s&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach((e=>this._nodeElevationAlignmentChanged(e)))}_nodeElevationAlignmentChanged(e){null!=e&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),null!=this._labeler&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,Ht.UPDATE),this._elevationProvider.objectChanged(this._collection.getComponentObb(e.objectHandle)))}_safeReschedule(e,t){return u(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const i=null!=e.params.material?e.params.material:Ge(),s=t.some((e=>"uvRegion"===e.name)),r=t.some((e=>"normalCompressed"===e.name)),o=Wt(i);return{geometryParameters:this._getGeometryParameters({hasTexture:o,hasNormals:r,hasRegions:s}),material:i}}_initMaterialAndTextures(e,t,i,s,r){const o=this._stage.renderView,a=e=>{this._gpuMemoryEstimate-=e,this._texMemoryEstimate-=e,r.memory-=e},n=i.map((e=>Be(e,t,s,o,this._compressionTracker,a)));this._stage.addTextures(n);let l=null;return this._collection.updateMaterial(e,(e=>{l=qe(e,t,n,i,this.view.stage.renderView.textures,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(e)})),{textures:n,texturePromise:l}}_getGeometryParameters(e){return new wt(this._hasVertexColors,e.hasTexture?e.hasRegions?Et.Atlas:Et.Default:Et.None,e.hasNormals,this._shadeNormals,this._applySSAO)}_addData(e,t,i){let s=this._addTasks.get(e.index);if(s)s.attributeInfo=t;else{const r=_();s=new Xt(t,null,r.promise),this._addTasks.set(e.index,s),i().then(r.resolve,r.reject).then((()=>this._addTasks.delete(e.index))).catch((t=>{throw this._addTasks.delete(e.index),t}))}return s.promise}_clearAddTasks(){this._addTasks.forEach((e=>{null!=e.meta&&(this._cacheGPUData(e.meta),e.meta=null)})),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,i=X();this._renderClippingArea=yt(this.view.clippingArea,i,e)?i:null;const s=X();this._layerClippingArea=yt(this.view.clippingArea,s,t)?s: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),this._assertFeatureIdNodeCounts(e)}_assertFeatureIdNodeCounts(e){e&&!this._featureIdCounts?(this._featureIdCounts=_i(this._nodeId2Meta.values()),this._filteredIdCounts=_i(this._nodeId2Meta.values(),ui.Filtered),this._weaklyRemovedIdCounts=_i(this._nodeId2Meta.values(),ui.WeaklyRemoved),this.addHandles(g((()=>this._controller.updating),(e=>{!e&&this._needFilterResolve&&(this.multiGeometryFilterResolve(),this._needFilterResolve=!1,this.notifyUpdate())}),{sync:!0}),"updateFinished")):!e&&this._featureIdCounts&&(this._featureIdCounts=null,this._filteredIdCounts=null,this._weaklyRemovedIdCounts=null,this._mismatchShow=null,this._mismatchHide=null,this.removeHandles("updateFinished"),this._needFilterResolve=!1,this.notifyUpdate())}_updateFeatureIdCounts(e,t){this._featureIdCounts&&(this._needFilterResolve=!0,ci(this._featureIdCounts,e.featureIds,t),ci(this._filteredIdCounts,e.filteredIds,t),ci(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,t))}_updateFilteredIdCounts(e,t,i){this._filteredIdCounts&&(this._needFilterResolve=!0,ci(this._filteredIdCounts,t,-1),ci(this._filteredIdCounts,e.filteredIds,1),ci(this._weaklyRemovedIdCounts,i,-1),ci(this._weaklyRemovedIdCounts,e.weaklyRemovedIds,1))}_checkFeatureIdNodeCountInvariant(){const e=null!=this._featureIdCounts;if(this.hasGeometryFilter!==e&&a.getLogger(this).error("checkFeatureIdNodeCountInvariant()","LayerView should have feature id node counts if and only if it has a geometry filter",{layerView:this,hasNodeCounts:e}),!this._featureIdCounts||!this._filteredIdCounts)return;const t=_i(this._nodeId2Meta.values());n(this._featureIdCounts,t)||a.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _featureIdCounts",{layerView:this,counts:this._featureIdCounts,expected:t});const i=_i(this._nodeId2Meta.values(),ui.Filtered);n(this._filteredIdCounts,i)||a.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _filteredIdCounts",{layerView:this,counts:this._filteredIdCounts,expected:i});const s=_i(this._nodeId2Meta.values(),ui.WeaklyRemoved);n(this._weaklyRemovedIdCounts,s)||a.getLogger(this).error("checkFeatureIdNodeCountInvariant()","Incorrect _weaklyRemovedIdCounts",{layerView:this,counts:this._weaklyRemovedIdCounts,expected:i})}multiGeometryFilterResolve(){if(!this._featureIdCounts||!this._filteredIdCounts)return;let e=null,t=null;for(const[i,s]of this._filteredIdCounts){const r=this._featureIdCounts.get(i);if(r!==s){s+(this._weaklyRemovedIdCounts?.get(i)??0)===r?(e??=new Set,e.add(i)):(t??=new Set,t.add(i))}}p(e,this._mismatchShow)&&p(t,this._mismatchHide)||(this._mismatchShow=e,this._mismatchHide=t,this._nodeId2Meta.forEach((e=>{if(!e?.filteredIds)return;const t=hi(e,this._mismatchShow,this._mismatchHide);this._collection.setAllComponentVisibilities(e.objectHandle,t),this._visibleGeometryChanged(e,Ht.UPDATE)})))}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach((e=>{e&&this._applyFiltersToNode(e)&&(this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,Ht.UPDATE))}))}getFilters(){const e=[],t=this._renderClippingArea;return null!=t&&e.push(((e,i)=>this._boundingRectFilter(e,i,t))),e}addSqlFilter(e,t,i){if(null!=t){const s=t.fieldNames;e.push(((e,r)=>this._sqlFilter(e,r,t,s,i)))}}_sqlFilter(e,t,i,s,r){const o={},a=this._createLayerGraphic(o),n=this.i3slayer.objectIdField,l=t.featureIds,d=t.attributeInfo?.attributeData;s.every((e=>e===n||null!=d?.[e]))&&et(e,l,(e=>{o[n]=l[e];for(const i of s)i!==n&&(o[i]=d?Ve(d[i],e):null);try{return i.testFeature(a)}catch(t){return r(t),!1}}))}_boundingRectNodeTest(e,t){return B(e.node.serviceMbsInIndexSR,this._controller.crsIndex,qt,this.view.renderSpatialReference),tt(t,qt)}_boundingRectFeatureTest(e,t,i){return this._collection.getComponentAabb(e.objectHandle,t,Ut),Q(Ut,kt),Y(i,kt)}_boundingRectFilter(e,t,i){const s=this._collection,r=this._boundingRectNodeTest(t,i);if(r===it.INSIDE)return;if(r===it.OUTSIDE)return void(e.length=0);const o=s.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const a=this._transformClippingArea(Lt,i,t.objectHandle);et(e,t.featureIds,(e=>this._boundingRectFeatureTest(t,e,a)))}_transformClippingArea(e,t,i){const s=this._collection.getObjectTransform(i),r=s.position,o=s.rotationScale;return e[0]=(t[0]-r[0])/o[0],e[1]=(t[1]-r[1])/o[4],e[2]=(t[2]-r[0])/o[0],e[3]=(t[3]-r[1])/o[4],e}async _addOrUpdateEdgeRendering(e,t=!0){const i=e.objectHandle,{hasEdges:s,perFeatureEdgeMaterials:r}=this._getFilteredEdgeMaterials(e);s&&!this._edgeView&&(this._edgeView=await this._stage.renderer.loadEdgeView());const o=this._edgeView;if(!o)return null;const a=o.hasObject(i);if(s){if(a){if(this.nodeCrossfadingEnabled){Yt(r,this.getNodeOpacity(e))}return o.updateAllComponentMaterials(i,r,this.slicePlaneEnabled,t).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),o.updateObjectVisibility(i,!0).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),o.updateAllVerticalOffsets(i,e.elevationOffsets).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),o}const s=await this._collection.addEdges(i,o,r,this.slicePlaneEnabled,e.elevationOffsets);return e.edgeMemoryUsage=s,e.node.memory+=s,o}return a&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,o.removeObject(i)),null}_applyFiltersToNode(e){const t=e.filteredIds,i=e.weaklyRemovedIds;return!!this._applyFiltersToNodeComponents(e)&&(this._updateFilteredIdCounts(e,t,i),this._labeler?.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,i=t.getComponentCount(e.objectHandle),s=null!=e.filteredIds,r=0===i.invisible;if(t.setAllComponentVisibilities(e.objectHandle,"all"),0===this._filters.length)return e.filteredIds=null,!r;if(null!=e.filteredIds&&e.appliedFilters===this._filters||(e.weaklyRemovedIds=null,e.filteredIds=di(e,this._filters),e.appliedFilters=this._filters),s&&e.filteredIds===e.featureIds&&(!this._mismatchHide||e.filteredIds.every((e=>!this._mismatchHide?.has(e)))))return!r;const o=hi(e,this._mismatchShow,this._mismatchHide);return t.setAllComponentVisibilities(e.objectHandle,o),!0}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach(((t,i)=>this._removeNodeStageData(i,e))),this._nodeId2MetaReloading.forEach(((t,i)=>this._removeNodeStageData(i,e,this._nodeId2MetaReloading))),this._elevationTask=l(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),null!=this._elevationTask&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,i=this._nodeId2Meta){i.has(e)&&this._controller.updateLoadStatus(e,!1);const s=i.get(e);null!=s?(this._collection.setObjectVisibility(s.objectHandle,!1),null!=this._edgeView&&this._edgeView.hasObject(s.objectHandle)&&this._edgeView.updateObjectVisibility(s.objectHandle,!1).catch((e=>this._logEdgeViewError(e,this.i3slayer.title))),this._visibleGeometryChanged(s,Ht.REMOVE),null!=this._labeler&&this._labeler.removeNodeMeta(s),i.delete(e),this._highlights.objectDeleted(s),i===this._nodeId2Meta?(this._updateFeatureIdCounts(s,-1),this._cacheGPUData(s,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(s)):this._deleteComponentObject(s),null!=this._treeDebugger&&this._treeDebugger.update()):i.delete(e)}_deleteComponentObject(e){if(null!=this._edgeView&&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.removeTexture(t)}updateNodeState(e,t){const i=this._nodeId2Meta.get(e);null!=i&&this._collection.updateMaterial(i.objectHandle,(e=>e.polygonOffsetEnabled=t===ze.Hole))}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){const i=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,i),this.notifyChange("elevationRange")}const i=this._nodeId2MetaReloading.get(e);i&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,i))}_invalidateAllSymbols(){this._rendererVersion=st(this._rendererVersion,1),this._controller?.requestUpdate()}_getInvalidRendererVersion(){return st(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=st(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 me()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)"color"===t.type?this._colorVariable=t:"opacity"===t.type?this._opacityVariable=t:a.getLogger(this).warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.symbols)"mesh-3d"!==t.type&&a.getLogger(this).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(i,s)=>{const r=5*i;H(s.externalColor,t[r]/255,t[r+1]/255,t[r+2]/255,t[r+3]/255);const o=this._stage.renderView.olidRenderHelper;if(o){const t=e.featureIds[i],r=this.sublayerId?`${this.layerViewUid}_${this.sublayerId}`:this.layerViewUid,a=ce(this.view,this.uid);o.setUidToObjectAndLayerId(t,t,this.layerId,r,this.layerPopupEnabledAndHasTemplate&&!a,e.node.resources.attributes,i,this.sublayerId),s.objectAndLayerIdColor=o.getObjectAndLayerIdColor({graphicUid:t,layerViewUid:r})}s.externalColorMixMode=t[r+4]&(1<<Ft.CastShadows)-1,s.castShadows=!!(t[r+4]&1<<Ft.CastShadows),s.pickable=!!(t[r+4]&1<<Ft.Pickable),s.elevationOffset=e.elevationOffsets?.[i]??0}}_getSymbolInfo(e,t){const i=e?.getSymbol(t,{arcade:this._arcade});if(!(i instanceof ge))return null;const s=i.id;if(this._symbolInfos.has(s))return this._symbolInfos.get(s);const r=rt(i);return this._symbolInfos.set(s,r),r}_setSymbologyOverride(e,t){this._symbologyOverride!==e&&(this._symbologyOverride=e,this._symbologyOverrideFields=t,this._invalidateAllSymbols(),this._updateSymbologyFields())}_updateSymbologyFields(){this._symbologyFields=null!=this._symbologyOverrideFields&&this._symbologyOverrideFields.length>0?null!=this._rendererFields&&this._rendererFields.length>0?ne(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,i={};t.attributes=i;const s=this._currentRenderer,r=e.attributeInfo?.attributeData,o=e.featureIds?this.i3slayer.objectIdField:null,a=null!=r&&null!=this._symbologyFields&&this._symbologyFields.length>0;let n=null,l=null;if(a&&null!=this._symbologyFields){n=[],l=[];for(const e of this._symbologyFields){const t=r[e];t&&(n.push(e),l.push(t))}}e.cachedSymbology||(e.cachedSymbology=re(5*e.featureIds.length));const d=new ht,h=this.fullOpacity,c=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):h;let u=null,_=Ot.OPAQUE,m=ot,g=0;for(let f=0;f<e.featureIds.length;f++){if(null!=o&&(i[o]=e.featureIds[f]),a&&n)for(let e=0;e<n.length;e++)i[n[e]]=Ve(l[e],f);const r=s?this._getSymbolInfo(s,t):null;let h,p;if(d.pickable=!0,s&&"visualVariables"in s){if(this._colorVariable){const e=de(this._colorVariable,t,{color:Bt,arcade:this._arcade});e&&(h=d.color,h[0]=e.r/255,h[1]=e.g/255,h[2]=e.b/255,h[3]=e.a??1,this._opacityVariable||null===e.a||(p=e.a))}this._opacityVariable&&(p=he(this._opacityVariable,t,{arcade:this._arcade}))}if(r?.material){const e=r.material;h=null==h||null==p?je(h,p,e.color,e.alpha,Tt,d.color):je(h,p,null,null,Tt,d.color)}if(h??=H(d.color,1,1,1,1),d.colorMixMode=r?.material?.colorMixMode??gt.Multiply,d.edgeMaterial=r?.edgeMaterial,this._symbologyOverride?.(t,d),null!=this._nodeColorOverride&&(this._nodeColorOverride(e.node,h),d.colorMixMode=gt.Replace),d.pickable&&=h[3]>=At,d.castShadows=r?r.castShadows:d.pickable,null!=d.edgeMaterial){const t=h[3]>=1&&(e.material.isOpaque||d.colorMixMode===gt.Replace)?Ot.OPAQUE:Ot.TRANSPARENT;d.edgeMaterial===u&&t===_||(m={...d.edgeMaterial,opacity:c,objectTransparency:t},u=d.edgeMaterial,_=t),e.cachedEdgeMaterials[f]=m}else e.cachedEdgeMaterials[f]=ot;e.cachedSymbology[g++]=Math.round(255*h[0]),e.cachedSymbology[g++]=Math.round(255*h[1]),e.cachedSymbology[g++]=Math.round(255*h[2]),e.cachedSymbology[g++]=Math.round(255*h[3]),e.cachedSymbology[g++]=d.colorMixMode|+d.castShadows<<Ft.CastShadows|+d.pickable<<Ft.Pickable}}_getFilteredEdgeMaterials(e){const t=this._getCachedEdgeMaterials(e);this.nodeCrossfadingEnabled||Yt(t,this.fullOpacity);const i=e.filteredIds;if(null==i){return{hasEdges:t.some((e=>e!==ot)),perFeatureEdgeMaterials:t}}let s=0,r=!1;const o=t.map(((t,o)=>e.featureIds[o]!==i[s]?ot:(r=r||t!==ot,s++,t)));return{hasEdges:r,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,i=this._getComponentParameters(e);this._collection.setComponentData(t,i),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),null!=this._controller&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach((t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,(t=>t.objectOpacity=e)),Yt(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))}))}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,(e=>{e.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,e.usePBR=this._usePBR,this._updateMaterialOverlay(e)}))}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,Ht.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),null!=this._labeler&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach((t=>{null!=t&&(this._collection.updateMaterial(t.objectHandle,(t=>t.commonMaterialParameters.hasSlicePlane=e)),this._updateEdgeRendering(t,!1))}))}_updatePBR(e){this._nodeId2Meta.forEach((t=>{null!=t&&this._collection.updateMaterial(t.objectHandle,(t=>t.usePBR=e))})),this._hasLoadedPBRTextures=!0}get _usePBR(){return this._shadeNormals&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){null!=this._edgeView&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,i,s)=>s.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?Me.CONTINUE:e(t,i,s):e}_forAllFeatures(e,t,i){for(const s of this._nodeId2Meta.values()){if(null==s)continue;if(null!=t){switch(t(s.node.serviceMbsInIndexSR)){case Me.EXIT:return;case Me.SKIP:continue}}let r=Me.CONTINUE;switch(i){case we.ALL:r=this._forAllFeaturesOfNode(s,e);break;case we.VISIBLE_ONLY:r=this._forAllVisibleFeaturesOfNode(s,e);break;case we.QUERYABLE:r=this._forAllQueryableFeaturesOfNode(s,e)}if(r===Me.EXIT)return}}_forAllFeaturesOfNode(e,t){let i=Me.CONTINUE;const s=e.featureIds;for(let r=0;r<s.length;r++)if(i=t(s[r],r,e),i===Me.EXIT)return i;return i}_forAllVisibleFeaturesOfNode(e,t){let i=Me.CONTINUE;const s=e.featureIds;return this._collection.forEachVisibleComponent(e.objectHandle,(r=>(i=t(s[r],r,e),i===Me.CONTINUE))),i}_forAllQueryableFeaturesOfNode(e,t){const i=this._ignoreClientNodeOverriddenFeatures(t);if(null==this._renderClippingArea)return this._forAllFeaturesOfNode(e,i);const s=this._boundingRectNodeTest(e,this._renderClippingArea);if(s===it.OUTSIDE)return Me.CONTINUE;if(s===it.INSIDE)return this._forAllFeaturesOfNode(e,i);const r=Me.CONTINUE,o=e.featureIds,a=e.objectHandle,n=at(this._renderClippingArea,this._collection.getObjectTransform(a));for(let l=0;l<o.length;l++){if(!this._boundingRectFeatureTest(e,l,n))continue;const t=i(o[l],l,e);if(t===Me.EXIT)return t}return r}_createAttributes(e,t){const i={};null!=t.featureIds&&(i[this._getObjectIdField()]=t.featureIds[e]);const s=t.attributeInfo?.attributeData;if(null!=s)for(const r of Object.keys(s))i[r]=Ve(s[r],e);return i}_createGraphic(e,t){return this._createLayerGraphic(this._createAttributes(e,t))}highlight(e,t){if(_e(e))return ut;const s=_t(e);if(0===s.length)return ut;const r=t?.name??jt,o=s[0]instanceof i?this._featureIdsFromGraphics(s):"number"==typeof s[0]?s:null;if(!o)return ut;const{set:a,handle:n}=this._highlights.acquireSet(r);return this._highlights.setFeatureIds(a,o),n}_featureIdsFromGraphics(e){const t=this.i3slayer.fieldsIndex,i=this._getObjectIdField();return e.map((e=>ct(t,e.attributes,i)))}resetHighlights(){l(this._highlights),this._highlights=new De({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,we.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)})}_visibleGeometryChanged(e,t){this._elevationProvider&&(null==this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle=f((()=>{const{node:t}=e,i=t.visibilityObbInRenderSR??t.geometryObbInRenderSR??t.serviceObbInRenderSR;if(null!=i){const e=$();i.toAaBoundingBox(e),this.emit("visible-geometry-changed",new pe(e))}else this.emit("visible-geometry-changed");this._visibleGeometryChangedSchedulerHandle=null}))),this._updateSnappingSources(e,t),this._elevationProvider.objectChanged(this._collection.getComponentObb(e.objectHandle)))}get performanceInfo(){return new be(this.usedMemory,this._nodeId2Meta.size,Math.round(this._gpuMemoryEstimate/1048576),Math.round(this._geoMemoryEstimate/1048576),Math.round(this._texMemoryEstimate/1048576),Math.round(this.unloadedMemory/1048576),this._idbCacheEnabled?Math.round(100*this._idbCache.getHitRate()):0)}checkInvariants(){}get test(){}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return null!=e?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}getNodeComponentHandle(e){return this._nodeId2Meta.get(e)?.objectHandle}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach(e)}fadeNode(e,t,i){if(!this.nodeCrossfadingEnabled)return;const s=this._nodeId2Meta.get(e);null!=s&&this._crossfadeHelper.fadeNode(e,s,t,i)}setNodeOpacityByIndex(e,t){const i=this._nodeId2Meta.get(e);null!=i&&this._setNodeOpacity(i,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,(e=>e.objectOpacity=t)),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(null==this._edgeView||!e.cachedEdgeMaterials)return;Yt(e.cachedEdgeMaterials,t);const i=e.objectHandle;this._edgeView.hasObject(i)&&this._edgeView.updateAllComponentOpacities(i,t).catch((e=>this._logEdgeViewError(e,this.i3slayer.title)))}get hasModifications(){return this._isIntegratedMesh&&null!=this._layerClippingArea||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||!0!==this._i3sWasmLoaded)return;const i=this.uid,s=Qt(e);if(s){const t={context:i,buffer:s.buffer};Re(t);const r=new Float64Array(s.buffer);e.forAll(((e,t)=>{const i=r[t],s=Oe(i);e.imModificationImpact=s,s!==We.Unmodified&&this._controller.invalidateGeometryVisibility(e.index)}))}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||null!=this._labeler&&this._labeler.updating||this._crossfadeHelper?.updating||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||null!=this._elevationTask&&this._elevationTask.running||this._needFilterResolve||this._compressionTracker.compressing}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(e,t,i)=>{const s=this._nodeId2Meta.get(e);if(null==s)throw new Error("invalid-node");const{origin:r,buffer:o}=await this._collection.extractEdgeInformation(s.objectHandle,t,i);return this._snappingLocationsApplyElevation(s,o,r),{type:"components",objectIds:s.featureIds,locations:o,origin:r}},remove:()=>s(this._snappingSourcesTrackers,t)};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach(((t,i)=>{if(null==t)return;const s=this._controller.getRenderMbs(t.node);s&&e.add(i,s)})),t}_snappingLocationsApplyElevation(e,t,i){if(!e.elevationOffsets||this.elevationInfo.mode===Ce.Absolute)return;const s=t.position0,r=t.position1,o=t.componentIndex,a=P(),n=P(),l=(e,t)=>{D(e,e,i),this.view.renderCoordsHelper.worldUpAtPosition(e,n),D(e,e,F(n,n,t)),V(e,e,i)};for(let d=0;d<s.count;d++){const t=e.elevationOffsets[o.get(d)];s.getVec(d,a),l(a,t),s.setVec(d,a),r.getVec(d,a),l(a,t),r.setVec(d,a)}}_updateSnappingSources(e,t){const{index:i}=e.node,s=this._controller.getRenderMbs(e.node);if(null!=s)for(const r of this._snappingSourcesTrackers)t!==Ht.REMOVE&&t!==Ht.UPDATE||r.events.remove(i),t!==Ht.ADD&&t!==Ht.UPDATE||r.events.add(i,s)}_logEdgeViewError(e,t){c(e)||a.getLogger(this).warn("Error while processing edges. Edges on this layer might not display correctly",t,e)}_indexedDbSizeCheck(e,t){return t.byteSize>Nt?(a.getLogger(this).warn(`Node is too big to store in IndexedDB cache: ${e.id} (${t.byteSize} bytes)`),!1):t.byteSize>0}};return e([b()],o.prototype,"_hasLoadedPBRTextures",void 0),e([b()],o.prototype,"_asyncModuleLoading",void 0),e([b()],o.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([b()],o.prototype,"view",void 0),e([b()],o.prototype,"i3slayer",void 0),e([b()],o.prototype,"_controller",void 0),e([b()],o.prototype,"_labeler",void 0),e([b()],o.prototype,"updating",void 0),e([b()],o.prototype,"suspended",void 0),e([b()],o.prototype,"contentVisible",null),e([b({readOnly:!0})],o.prototype,"legendEnabled",null),e([b(It)],o.prototype,"updatingProgress",void 0),e([b()],o.prototype,"updatingProgressValue",null),e([b()],o.prototype,"hasTexturesOrVertexColors",null),e([b()],o.prototype,"rendererTextureUsage",null),e([b()],o.prototype,"elevationOffset",null),e([b()],o.prototype,"elevationInfo",null),e([b({type:Boolean})],o.prototype,"slicePlaneEnabled",void 0),e([b()],o.prototype,"supportedTextureEncodings",null),e([b({type:[le]})],o.prototype,"_modifications",void 0),e([b({readOnly:!0})],o.prototype,"clientGeometry",null),e([b()],o.prototype,"elevationRange",null),e([b()],o.prototype,"fullExtent",null),e([b()],o.prototype,"_elevationTask",void 0),e([b({readOnly:!0})],o.prototype,"_usePBR",null),o=e([I("esri.views.3d.layers.I3SMeshView3D")],o),o};var Ht;!function(e){e[e.ADD=0]="ADD",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE"}(Ht||(Ht={}));const Ut=$(),kt=X(),Lt=X(),Gt=new bt,Bt=new t([0,0,0,0]),qt=ie(0,0,0,0);function Wt(e){if(null==e)return!1;const t=e.metallicRoughness;return t&&t.baseColorTextureId>=0||t&&t.metallicRoughnessTextureId>=0||e.normalTextureId>=0||e.emissiveTextureId>=0||e.occlusionTextureId>=0}function zt(e){return"geometryData"in e}function Kt(e){return null!=e&&y(e.data)}function $t(e,t){let i=1024+e.interleavedVertexData.byteLength+(e.indices?e.indices.byteLength:0)+e.positionData.data.byteLength+e.positionData.indices.byteLength;if(null!=t)for(const s of t)null!=s&&y(s.data)&&(i+=s.data.byteLength);return i}function Qt(e){if(0===e.length)return;const t=10*e.length,i=new Float64Array(t);let s=0;return e.forAll((e=>{let t=e.serviceObbInIndexSR;null==t&&(t=Gt,t.center=te(e.serviceMbsInIndexSR),t.halfSize=[e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3],e.serviceMbsInIndexSR[3]]);const r=t.data;i[s++]=r[0],i[s++]=r[1],i[s++]=r[2],i[s++]=r[3],i[s++]=r[4],i[s++]=r[5],i[s++]=r[6],i[s++]=r[7],i[s++]=r[8],i[s++]=r[9]})),i}class Xt{constructor(e,t,i){this.attributeInfo=e,this.meta=t,this.promise=i,this.allowMemCache=!0}}function Yt(e,t){e.forEach((e=>e.opacity=t))}class Jt{constructor(e,t){this.mode=e,this.offset=t}}const Zt=P(),ei=$(),ti="elevation-change",ii="",si="@null",ri="@ECEF",oi=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],ai=new pt;function ni(e,t,i){let s=e.elevationRangeMin,r=e.elevationRangeMax;const o=i;if(o>0){t.getCorners(oi);for(const e of oi){const t=N(e)-o;s=Math.min(s,t),r=Math.max(r,t)}}else{t.getCorners(oi);for(const e of oi){const t=e[2];s=Math.min(s,t),r=Math.max(r,t)}}e.expandElevationRangeValues(s,r)}function li(e,t,i){const s=te(t),r=i>0?N(s)-i:s[2],o=se(t);e.expandElevationRangeValues(r-o,r+o)}function di(e,t){const i=e.featureIds.slice();for(const s of t)if(s(i,e),0===i.length)break;return i.length===e.featureIds.length?e.featureIds:i}function hi(e,t,i){const s=new Array,r=e.filteredIds;if(null==r||t?.size||i?.size){if(null!=r){let o=0;e.featureIds.forEach(((e,a)=>{if(r[o]===e)++o;else if(!t?.has(e))return;i?.has(e)||s.push(a)}))}}else e.featureIds.forEach(((e,t)=>{r[s.length]===e&&s.push(t)}));return s}function ci(e,t,i){if(e&&t)for(const s of t){const t=(e.get(s)??0)+i;t>0?e.set(s,t):e.delete(s)}}var ui;function _i(e,t=ui.All){const i=new Map;for(const s of e){ci(i,t===ui.All?s?.featureIds:t===ui.Filtered?s?.filteredIds:s?.weaklyRemovedIds,1)}return i}!function(e){e[e.All=0]="All",e[e.Filtered=1]="Filtered",e[e.WeaklyRemoved=2]="WeaklyRemoved"}(ui||(ui={}));export{Pt as I3SMeshView3D};
|