@arcgis/core 6.0.0-next.25 → 6.0.0-next.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{6f1d6453184e0a1530ad.js → 00580a68835aac653038.js} +22 -22
- package/assets/esri/core/workers/chunks/0363d29fc665d169ebc4.js +1 -0
- package/assets/esri/core/workers/chunks/037c67ef5c4398d5954d.js +1 -0
- package/assets/esri/core/workers/chunks/07b726a46864501b90a0.js +1 -0
- package/assets/esri/core/workers/chunks/0864da8f8f147016cf1c.js +1 -0
- package/assets/esri/core/workers/chunks/0bd04bcd4b2710838d48.js +1 -0
- package/assets/esri/core/workers/chunks/{768389f7f8dba6080df7.js → 0cc7fba402a93e6d2455.js} +2 -2
- package/assets/esri/core/workers/chunks/0cfdeb53fb7d5532cf01.js +1 -0
- package/assets/esri/core/workers/chunks/112ed86f812e4400a7e0.js +1 -0
- package/assets/esri/core/workers/chunks/177f353ce72133e2eeed.js +1 -0
- package/assets/esri/core/workers/chunks/1dc6f093028530a492e6.js +1 -0
- package/assets/esri/core/workers/chunks/2294254af2c6afb560ee.js +1 -0
- package/assets/esri/core/workers/chunks/23a4806b4cdf7cc32e4d.js +1 -0
- package/assets/esri/core/workers/chunks/2447d2e2a4a3ab8fcf94.js +1 -0
- package/assets/esri/core/workers/chunks/271ae7deccb94112c2df.js +1 -0
- package/assets/esri/core/workers/chunks/2df37a9a95ceebb87a5f.js +1 -0
- package/assets/esri/core/workers/chunks/2e00c155e447e4930442.js +1 -0
- package/assets/esri/core/workers/chunks/2e9a1673b1d51aa082b6.js +1 -0
- package/assets/esri/core/workers/chunks/344f5334ad95c7974349.js +1 -0
- package/assets/esri/core/workers/chunks/348f1def9cd2ddf92e87.js +1 -0
- package/assets/esri/core/workers/chunks/{8e4206068c6953bb7df2.js → 3a47fc97c400fca2c736.js} +1 -1
- package/assets/esri/core/workers/chunks/47c97640ec525676918b.js +1 -0
- package/assets/esri/core/workers/chunks/50763ea061d5fb3f2e49.js +1 -0
- package/assets/esri/core/workers/chunks/518ab22f80c3300bcfff.js +1 -0
- package/assets/esri/core/workers/chunks/58609bf94f72bc4f1952.js +1 -0
- package/assets/esri/core/workers/chunks/586a929bc037e23857af.js +1 -0
- package/assets/esri/core/workers/chunks/58d10e0b35968680fd9f.js +1 -0
- package/assets/esri/core/workers/chunks/59bc55880e6fd8ce20c0.js +1 -0
- package/assets/esri/core/workers/chunks/62a0abcf45a2bd14ecbe.js +1 -0
- package/assets/esri/core/workers/chunks/63c4412c16d8a44a5668.js +1 -0
- package/assets/esri/core/workers/chunks/6b4c3411f63a9ad9354c.js +1 -0
- package/assets/esri/core/workers/chunks/{f528ac5c648ca6a98582.js → 711cfb84659cb4437679.js} +1 -1
- package/assets/esri/core/workers/chunks/77463141652bf1ca6fb2.js +1 -0
- package/assets/esri/core/workers/chunks/7d3f7940815fa5dc244e.js +1 -0
- package/assets/esri/core/workers/chunks/914a0b5d9fef683cdf9c.js +1 -0
- package/assets/esri/core/workers/chunks/96f87c8efd4b11b37686.js +1 -0
- package/assets/esri/core/workers/chunks/97ec46605f16333144b7.js +1 -0
- package/assets/esri/core/workers/chunks/{7b482afb9fd1229f5707.js → 9934e8e19f94e9169eea.js} +1 -1
- package/assets/esri/core/workers/chunks/99f51d5d9da6e9bfc430.js +1 -0
- package/assets/esri/core/workers/chunks/9aebe876b1a2fb075f9c.js +1 -0
- package/assets/esri/core/workers/chunks/9c3db7a7c05fa0e81f0a.js +1 -0
- package/assets/esri/core/workers/chunks/a2cc53ad1a514167e4b8.js +1 -0
- package/assets/esri/core/workers/chunks/a33ba23aee3f8f40200f.js +1 -0
- package/assets/esri/core/workers/chunks/{45ba4aa87a4732198596.js → b13d8f4e4e80ef00b1bd.js} +1 -1
- package/assets/esri/core/workers/chunks/b3801d58c024224917df.js +1 -0
- package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +1 -0
- package/assets/esri/core/workers/chunks/b3dbcf43f136ba2dadc5.js +1 -0
- package/assets/esri/core/workers/chunks/b9596d862da1ec342cd3.js +1 -0
- package/assets/esri/core/workers/chunks/bc1fcc9c897461e68e29.js +1 -0
- package/assets/esri/core/workers/chunks/{8b4e9fd88c0c313416d4.js → be04f40f8b403befd0ef.js} +1 -1
- package/assets/esri/core/workers/chunks/c29091fe157564cffcf7.js +1 -0
- package/assets/esri/core/workers/chunks/{150e7a7bd5df25693da7.js → c90388932a7825d9d933.js} +1 -1
- package/assets/esri/core/workers/chunks/ca21786e519c914fc9e1.js +1 -0
- package/assets/esri/core/workers/chunks/cdb5c26fed7d9a97db49.js +1 -0
- package/assets/esri/core/workers/chunks/cdf0c7706d3e1221f49b.js +1 -0
- package/assets/esri/core/workers/chunks/d63e181f0e48bde73395.js +1 -0
- package/assets/esri/core/workers/chunks/d77888c84a8b49478807.js +1 -0
- package/assets/esri/core/workers/chunks/d7f2f1708d2a2668676c.js +1 -0
- package/assets/esri/core/workers/chunks/ec1c4d66142b6efb0e8b.js +1 -0
- package/assets/esri/core/workers/chunks/ef2c3febcceedc44b3ac.js +1 -0
- package/assets/esri/core/workers/chunks/f08a2a262a3b55149396.js +1 -0
- package/assets/esri/core/workers/chunks/f2d56f5c15d5977e1d19.js +1 -0
- package/assets/esri/core/workers/chunks/ffe2077a9df7c838ea27.js +1 -0
- package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
- package/chunks/GlobalIllumination.glsl.js +15 -30
- package/chunks/RibbonLine.glsl.js +2 -2
- package/config.js +1 -1
- package/core/ReentrantObjectPool.js +1 -1
- package/core/memoryEstimations.js +1 -1
- package/core/workers/workers.js +2 -2
- package/core/workers.d.ts +1 -1
- package/form/elements/inputs.d.ts +126 -25
- package/form/elements/inputs.js +1 -1
- package/form/elements.d.ts +1 -0
- package/geometry/support/Indices.js +1 -1
- package/graphic/MapNotesGraphicOrigin.d.ts +1 -0
- package/kernel.js +1 -1
- package/layers/GeospatialPDFLayer.js +1 -1
- package/layers/MapNotesLayer.d.ts +3 -2
- package/layers/VectorTileLayer.d.ts +10 -1
- package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +2 -1
- package/layers/geospatialPDF/CIM2DLayerview.js +2 -0
- package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/mixins/SublayersOwner.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/support/Sublayer.d.ts +2 -2
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/SubtypeSublayer.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/package.json +3 -3
- package/rest/support/AttributeBinsQuery.d.ts +3 -2
- package/rest/support/ImageGPSInfoParameters.d.ts +2 -1
- package/rest/support/OutDistance.d.ts +2 -1
- package/rest/support/Query.d.ts +3 -2
- package/rest/support/TopFeaturesQuery.d.ts +2 -1
- package/rest/support/types.d.ts +10 -1
- package/smartMapping/raster/renderers/flow.d.ts +2 -1
- package/smartMapping/renderers/color.d.ts +11 -8
- package/smartMapping/renderers/location.d.ts +7 -4
- package/smartMapping/renderers/predominance.d.ts +7 -4
- package/smartMapping/renderers/relationship.d.ts +7 -4
- package/smartMapping/renderers/size.d.ts +6 -4
- package/smartMapping/renderers/type.d.ts +7 -4
- package/smartMapping/renderers/types.d.ts +15 -0
- package/smartMapping/renderers/univariateColorSize.d.ts +4 -2
- package/smartMapping/symbology/flow.d.ts +2 -1
- package/smartMapping/symbology/types.d.ts +2 -1
- package/symbols/cim/CIMCursor.js +1 -1
- package/tables/elements.d.ts +1 -0
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterVertexPack.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/layers/GeospatialPDFLayerView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DBufferGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DDrapedGraphicLayerBase.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicCreationContext.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLodInstanceGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DStageObjectGraphicLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/defaultSymbolComplexity.js +1 -1
- package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainData.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/terrain/TextureReference.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderInfo.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/terrainUtils.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +25 -25
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIlluminationTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
- package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/BufferObject3D.js +1 -1
- package/views/3d/webgl-engine/lib/DirtyEvents.js +1 -1
- package/views/3d/webgl-engine/lib/Geometry.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/ModelDirtySet.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/geometryMemoryUtils.js +2 -0
- package/views/VideoView.js +1 -1
- package/views/selection/SelectionOperation.js +1 -1
- package/views/selection/types.d.ts +43 -3
- package/views/support/layerViewUtils.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
- package/widgets/OrientedImageryViewer.js +2 -2
- package/widgets/Print.js +1 -1
- package/widgets/support/SelectionList/GroupLayerItem.d.ts +6 -0
- package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
- package/widgets/support/SelectionList/ItemBase.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +6 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
- package/widgets/support/SelectionToolbar.d.ts +8 -1
- package/widgets/support/SelectionToolbar.js +1 -1
- package/widgets/support/Selector2D/selectorUtils.js +1 -1
- package/assets/esri/core/workers/chunks/0320cbd825f9a4222042.js +0 -1
- package/assets/esri/core/workers/chunks/067de1910190da228291.js +0 -1
- package/assets/esri/core/workers/chunks/09bd5df07eab80ae7b15.js +0 -1
- package/assets/esri/core/workers/chunks/164e74d586297946a717.js +0 -1
- package/assets/esri/core/workers/chunks/1c0c5cb13c2590aae906.js +0 -1
- package/assets/esri/core/workers/chunks/1c77de1e79860f8d2228.js +0 -1
- package/assets/esri/core/workers/chunks/24dac4970526a4e0ae63.js +0 -1
- package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +0 -1
- package/assets/esri/core/workers/chunks/30dcf2cfb31cb70de7df.js +0 -1
- package/assets/esri/core/workers/chunks/371e2ddb88cc6b9a41e8.js +0 -1
- package/assets/esri/core/workers/chunks/42f6194633c2d879c8da.js +0 -1
- package/assets/esri/core/workers/chunks/44f90e75c1dc3d726a95.js +0 -1
- package/assets/esri/core/workers/chunks/4abd3753cd9b80e4d937.js +0 -1
- package/assets/esri/core/workers/chunks/4bb9a5f4ca944d3fc206.js +0 -1
- package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +0 -1
- package/assets/esri/core/workers/chunks/4d93bed14945e3d34d5c.js +0 -1
- package/assets/esri/core/workers/chunks/4e3f651ac76fcd53df2b.js +0 -1
- package/assets/esri/core/workers/chunks/505227797bcf2a1d908d.js +0 -1
- package/assets/esri/core/workers/chunks/58da3f8cf0f7f6a7e4fa.js +0 -1
- package/assets/esri/core/workers/chunks/5a19a9c3e01d3d415188.js +0 -1
- package/assets/esri/core/workers/chunks/5a830bc35adbedd33783.js +0 -1
- package/assets/esri/core/workers/chunks/6db0f8fe1402643fbe1a.js +0 -1
- package/assets/esri/core/workers/chunks/7124ad8dc5ad40dc66f3.js +0 -1
- package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +0 -1
- package/assets/esri/core/workers/chunks/7c631e2947243e2c9bde.js +0 -1
- package/assets/esri/core/workers/chunks/7f0f9dddc44b1f1600f0.js +0 -1
- package/assets/esri/core/workers/chunks/7fb7493f483cd9878bfa.js +0 -1
- package/assets/esri/core/workers/chunks/8e310e9cb9d84ac3ca2f.js +0 -1
- package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +0 -1
- package/assets/esri/core/workers/chunks/99a0a434ea2162166754.js +0 -1
- package/assets/esri/core/workers/chunks/9afc87474cef1fc4fe4a.js +0 -1
- package/assets/esri/core/workers/chunks/9cbde13e536676767900.js +0 -1
- package/assets/esri/core/workers/chunks/9cd3fcb5fca6f9dbbcd8.js +0 -1
- package/assets/esri/core/workers/chunks/a025ee38d402504193df.js +0 -1
- package/assets/esri/core/workers/chunks/a4b822ee45810c4c292a.js +0 -1
- package/assets/esri/core/workers/chunks/a51576d84edca88e41dd.js +0 -1
- package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +0 -1
- package/assets/esri/core/workers/chunks/ace41659a5ca0e5abfc3.js +0 -1
- package/assets/esri/core/workers/chunks/b01804aa6c47a220a603.js +0 -1
- package/assets/esri/core/workers/chunks/b3273f847405799e3362.js +0 -1
- package/assets/esri/core/workers/chunks/ba3d5abff65aefcb8dee.js +0 -1
- package/assets/esri/core/workers/chunks/bca6b469940b7b954123.js +0 -1
- package/assets/esri/core/workers/chunks/c0d7ae314ebfad1e3791.js +0 -1
- package/assets/esri/core/workers/chunks/c337fc0e6dc69c233e6d.js +0 -1
- package/assets/esri/core/workers/chunks/cd9aa950cb74b09008fe.js +0 -1
- package/assets/esri/core/workers/chunks/e0d9dc97985561320bd4.js +0 -1
- package/assets/esri/core/workers/chunks/e2775b4b753306dc8477.js +0 -1
- package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +0 -1
- package/assets/esri/core/workers/chunks/ebbf425af348e6ede814.js +0 -1
- package/assets/esri/core/workers/chunks/efc53007cd2e4991d7d4.js +0 -1
- package/assets/esri/core/workers/chunks/f46e92c67986c8c09bdd.js +0 -1
- package/assets/esri/core/workers/chunks/f8bc474434fd365ab174.js +0 -1
- package/assets/esri/core/workers/chunks/f8d2225f333524ce1d88.js +0 -1
- package/assets/esri/core/workers/chunks/f95a1f878c9c1146180e.js +0 -1
- package/assets/esri/core/workers/chunks/fb37f0848196c28b7fd7.js +0 -1
- /package/assets/esri/core/workers/chunks/{768389f7f8dba6080df7.js.LICENSE.txt → 0cc7fba402a93e6d2455.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Logger.js";import{isAbortError as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Collection.js";import{makeHandle as r}from"../../../core/handleUtils.js";import i from"../../../core/Logger.js";import{destroyMaybe as a}from"../../../core/maybe.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as s,whenOnce as c}from"../../../core/reactiveUtils.js";import{property as l,subclass as u}from"../../../core/accessorSupport/decorators.js";import{LAYERVIEW_2D_SYMBOL as d}from"../../../layers/geospatialPDF/CIM2DLayerview.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/has.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../../core/memoryEstimations.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import f from"./graphics/GraphicsView2D.js";import p from"./graphics/GraphicContainer.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../../../geometry/support/normalizeUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{LayerView2D as m}from"./LayerView2D.js";import h from"./imagery/ImageryTileView2D.js";import g from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as _}from"../../layers/RefreshableLayerView.js";let v=class extends _(m(g)){constructor(){super(...arguments),this._graphics=new n,this._graphicsView=null,this.subview=null}get displayParameters(){let{layer:e}=this,t=this._get(`displayParameters`);return e.visible?{clipToNeatline:e.clippedToNeatline}:t}update(e){this.subview?.update(e),this._graphicsView?.processUpdate(e),this.notifyChange(`updating`)}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage();let e=new h({layer:this.layer,layerView:this,scheduler:this.scheduler});e.useWebGLForProcessing=!0,e.useProgressiveUpdate=!0,this.subview=e;let t=new n,a=new p(this.view.featuresTilingScheme),l=new f({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:t,container:a});this._graphicsView=l;let u=new AbortController;y(this.layer,t,this.view.spatialReference);let d=r(()=>{u.abort(),this.container.removeChild(l.container),this._graphicsView===l&&(this._graphicsView=null),l.destroy(),a.destroy(),t.destroy()});this.addAttachHandles([d,s(()=>this.layer.clippedToNeatline,()=>{let t=e.redrawOrRefetch({refetch:!0,reprocess:!1}).catch(e=>{o(e)||i.getLogger(this).error(e)});this._updatingHandles.addPromise(t)})]),this._attachSubview(e),this.container.addChild(a),c(()=>!e.updating&&e.container.children.some(e=>e.bitmap?.rawPixelData?.pixelBlock!=null),u.signal).then(()=>d.remove()).catch(e=>{o(e)||i.getLogger(this).error(e)}),this.requestUpdate()}detach(){this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._graphicsView&&=(this.container.removeChild(this._graphicsView.container),a(this._graphicsView)??null),this._graphics.removeAll(),this.layer.decreaseRasterJobHandlerUsage()}viewChange(){this._graphicsView?.viewChange(),this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0))}_detachSubview(e){e?.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};e([l()],v.prototype,`subview`,void 0),e([l({readOnly:!0})],v.prototype,`displayParameters`,null),v=e([u(`esri.views.2d.layers.GeospatialPDFLayerView2D`)],v);function y(e,n,r){let i=e.createNeatline(r),a=new t({geometry:i,symbol:d});n.add(a)}const b=v;export{b as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import n from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import i from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import s from"../../../core/ReactiveMap.js";import{watch as c,syncAndInitial as l,on as u}from"../../../core/reactiveUtils.js";import{isScreenRect as d,isScreenPolygon as f}from"../../../core/screenUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import h from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as _}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as v,extentIntersectsPolygon as y}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as b}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../../webgl/UniformBufferLayout.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import x from"../tiling/TileQueue.js";import S from"../tiling/TileStrategy.js";import C from"../engine/webgl/Overlay.js";import w from"../engine/webgl/OverlayContainer.js";import{LayerView2D as T}from"./LayerView2D.js";import{getMapPointsFromScreen as E}from"../support/hitTestUtils.js";import D from"../../layers/MediaLayerView.js";import{TaskPriority as O}from"../../support/Scheduler.js";let k=class extends T(D){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new s,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([c(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){let{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import(`./support/MediaLayerInteraction.js`));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),c(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),c(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}isUpdating(){return this._interaction?.updating===!0||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([u(()=>this.layer.effectiveSource,`refresh`,()=>{let e=this.layer.effectiveSource;if(e)for(let{elementView:{element:t}}of this._elementReferences.values())e.hasElement(t)||this._removeElementReference(t);this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),u(()=>this.layer.effectiveSource,`change`,({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new w,this.container.addChild(this._overlayContainer),this._fetchQueue=new x({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:O.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new S({cachePolicy:`purge`,resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){let n=[],r=e.normalize(),i=[r.x,r.y],a=d(t),o=f(t),s=a||o;for(let{elementView:{normalizedCoords:r,element:a}}of this._elementReferences.values())if(s){let i=E(this.view,t).map(e=>[e.x,e.y]);r!=null&&v(i,r.rings)&&n.push({type:`media`,element:a,layer:this.layer,mapPoint:null,sourcePoint:a.toSource(e)})}else r!=null&&_(r.rings,i)&&n.push({type:`media`,element:a,layer:this.layer,mapPoint:e,sourcePoint:a.toSource(e)});return n.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){let t=new N(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{let[n,r]=e.setElements(t);this._referenceElements(e,n),this._dereferenceElements(e,r),this.requestUpdate()},e=>{o(e)||i.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){let n=this.layer.effectiveSource;if(n==null)return[];this.view.featuresTilingScheme.getTileBounds(A,e,!0);let r=new h({xmin:A[0],ymin:A[1],xmax:A[2],ymax:A[3],spatialReference:this.view.spatialReference});return n.queryElements(r,t)}_referenceElements(e,t){if(this.layer.source!=null)for(let n of t)this._referenceElement(e,n)}_referenceElement(e,t){a(this._elementReferences,t.uid,()=>{let e=new b({element:t,spatialReference:this.view.spatialReference}),r=new C(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{i.getLogger(`esri.views.2d.layers.MediaLayerView2D`).error(new n(`element-load-error`,`Element cannot be displayed`,{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(let n of t)this._dereferenceElement(e,n)}_dereferenceElement(e,t){let n=this._elementReferences.get(t.uid);n&&(n.tiles.delete(e),n.tiles.size||this._removeElementReference(t))}_removeElementReference(e){let t=this._elementReferences.get(e.uid);t&&(this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),this._debugGraphicsView?.graphics.remove(t.debugGraphic))}_elementUpdateHandler(e){if(!this.layer.effectiveSource?.hasElement(e))return;let t=this._elementReferences.get(e.uid);if(t){let n=t.elementView.normalizedCoords;if(n==null){this._removeElementReference(e);return}let r=[],i=[];for(let e of this._tileStrategy.tiles){let a=M(this.view.featuresTilingScheme,e,n);t.tiles.has(e)?a||i.push(e):a&&r.push(e)}for(let t of r)this._referenceElement(t,e);for(let t of i)this._dereferenceElement(t,e);t=this._elementReferences.get(e.uid),t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:`geometry`}));return}let n=new b({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(n!=null)for(let t of this._tileStrategy.tiles)M(this.view.featuresTilingScheme,t,n)&&this._referenceElement(t,e)}};e([p({readOnly:!0})],k.prototype,`elements`,void 0),k=e([m(`esri.views.2d.layers.MediaLayerView2D`)],k);const A=g(),j={xmin:0,ymin:0,xmax:0,ymax:0};function M(e,t,n){return e.getTileBounds(A,t.key,!0),j.xmin=A[0],j.ymin=A[1],j.xmax=A[2],j.ymax=A[3],y(j,n)}class N{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){let t=[],n=new Set(this.elements);this.elements=e;for(let r of e)n.has(r)?n.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(n)]}destroy(){}}const P=k;export{P as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import n from"../../../core/Error.js";import"../../../core/has.js";import{some as r}from"../../../core/iteratorUtils.js";import i from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import s from"../../../core/ReactiveMap.js";import{watch as c,syncAndInitial as l,on as u}from"../../../core/reactiveUtils.js";import{isScreenRect as d,isScreenPolygon as f}from"../../../core/screenUtils.js";import{property as p,subclass as m}from"../../../core/accessorSupport/decorators.js";import h from"../../../geometry/Extent.js";import{create as g}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as _}from"../../../geometry/support/contains.js";import{targetIntersectsPolygon as v,extentIntersectsPolygon as y}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as b}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../../core/memoryEstimations.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../../webgl/UniformBufferLayout.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import x from"../tiling/TileQueue.js";import S from"../tiling/TileStrategy.js";import C from"../engine/webgl/Overlay.js";import w from"../engine/webgl/OverlayContainer.js";import{LayerView2D as T}from"./LayerView2D.js";import{getMapPointsFromScreen as E}from"../support/hitTestUtils.js";import D from"../../layers/MediaLayerView.js";import{TaskPriority as O}from"../../support/Scheduler.js";let k=class extends T(D){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new s,this._debugGraphicsView=null,this._interaction=null,this.elements=new t}initialize(){this.addHandles([c(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){let{MediaLayerInteraction:e}=await this._updatingHandles.addPromise(import(`./support/MediaLayerInteraction.js`));if(this.destroyed)return;this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),c(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),c(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}isUpdating(){return this._interaction?.updating===!0||r(this._elementReferences.values(),({overlay:e})=>!e.isReady)}attach(){this.addAttachHandles([u(()=>this.layer.effectiveSource,`refresh`,()=>{let e=this.layer.effectiveSource;if(e)for(let{elementView:{element:t}}of this._elementReferences.values())e.hasElement(t)||this._removeElementReference(t);this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),u(()=>this.layer.effectiveSource,`change`,({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new w,this.container.addChild(this._overlayContainer),this._fetchQueue=new x({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:O.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new S({cachePolicy:`purge`,resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){let n=[],r=e.normalize(),i=[r.x,r.y],a=d(t),o=f(t),s=a||o;for(let{elementView:{normalizedCoords:r,element:a}}of this._elementReferences.values())if(s){let i=E(this.view,t).map(e=>[e.x,e.y]);r!=null&&v(i,r.rings)&&n.push({type:`media`,element:a,layer:this.layer,mapPoint:null,sourcePoint:a.toSource(e)})}else r!=null&&_(r.rings,i)&&n.push({type:`media`,element:a,layer:this.layer,mapPoint:e,sourcePoint:a.toSource(e)});return n.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){let t=new N(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.consumePromise(this._fetchQueue.push(e.key).then(t=>{let[n,r]=e.setElements(t);this._referenceElements(e,n),this._dereferenceElements(e,r),this.requestUpdate()},e=>{o(e)||i.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){let n=this.layer.effectiveSource;if(n==null)return[];this.view.featuresTilingScheme.getTileBounds(A,e,!0);let r=new h({xmin:A[0],ymin:A[1],xmax:A[2],ymax:A[3],spatialReference:this.view.spatialReference});return n.queryElements(r,t)}_referenceElements(e,t){if(this.layer.source!=null)for(let n of t)this._referenceElement(e,n)}_referenceElement(e,t){a(this._elementReferences,t.uid,()=>{let e=new b({element:t,spatialReference:this.view.spatialReference}),r=new C(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.consumePromise(t.load().catch(e=>{i.getLogger(`esri.views.2d.layers.MediaLayerView2D`).error(new n(`element-load-error`,`Element cannot be displayed`,{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(let n of t)this._dereferenceElement(e,n)}_dereferenceElement(e,t){let n=this._elementReferences.get(t.uid);n&&(n.tiles.delete(e),n.tiles.size||this._removeElementReference(t))}_removeElementReference(e){let t=this._elementReferences.get(e.uid);t&&(this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),this._debugGraphicsView?.graphics.remove(t.debugGraphic))}_elementUpdateHandler(e){if(!this.layer.effectiveSource?.hasElement(e))return;let t=this._elementReferences.get(e.uid);if(t){let n=t.elementView.normalizedCoords;if(n==null){this._removeElementReference(e);return}let r=[],i=[];for(let e of this._tileStrategy.tiles){let a=M(this.view.featuresTilingScheme,e,n);t.tiles.has(e)?a||i.push(e):a&&r.push(e)}for(let t of r)this._referenceElement(t,e);for(let t of i)this._dereferenceElement(t,e);t=this._elementReferences.get(e.uid),t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:`geometry`}));return}let n=new b({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(n!=null)for(let t of this._tileStrategy.tiles)M(this.view.featuresTilingScheme,t,n)&&this._referenceElement(t,e)}};e([p({readOnly:!0})],k.prototype,`elements`,void 0),k=e([m(`esri.views.2d.layers.MediaLayerView2D`)],k);const A=g(),j={xmin:0,ymin:0,xmax:0,ymax:0};function M(e,t,n){return e.getTileBounds(A,t.key,!0),j.xmin=A[0],j.ymin=A[1],j.xmax=A[2],j.ymax=A[3],y(j,n)}class N{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){let t=[],n=new Set(this.elements);this.elements=e;for(let r of e)n.has(r)?n.delete(r):t.push(r);return this.isReady=!0,[t,Array.from(n)]}destroy(){}}const P=k;export{P as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../core/handleUtils.js";import n from"../../../core/Logger.js";import{isAbortError as r,waitTick as i}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{equals as s}from"../../../geometry/support/spatialReferenceUtils.js";import c from"../../../layers/support/FeatureFilter.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/has.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import u from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../geometry/Polygon.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../../webgl/UniformBufferLayout.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as d}from"./BitmapTileLayerView2D.js";import{LayerView2D as f}from"./LayerView2D.js";import p from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as h}from"./support/imageUtils.js";import g from"../tiling/TileInfoView.js";import _ from"../tiling/TileKey.js";import v from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import b from"../../layers/LayerView.js";import{RefreshableLayerView as x}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as S}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as C,MapServiceLayerViewHelper as w}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as T}from"../../support/drapedUtils.js";import{getHighlightName as E}from"../../support/highlightOptionsUtils.js";import{TaskPriority as D}from"../../support/Scheduler.js";const O=[0,0];let k=class extends x(d(f(b))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!(`resampling`in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return`tilemapCache`in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){let e=`tileServers`in this.layer?this.layer.tileServers:null,t=this.tilemapCache;if(this._tileInfoView=new g(this.layer.tileInfo,this.layer.fullExtent,t?.effectiveMinLOD,t?.effectiveMaxLOD),this._fetchQueue=new v({tileInfoView:this._tileInfoView,concurrency:e&&e.length*10||10,process:(e,t)=>this.fetchTile(e,t),scheduler:this.scheduler,priority:D.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:`keep`,resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),C(this,this.layer)){let e=this._highlightView=new u({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new p(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new w({createFetchPopupFeaturesQueryGeometry:(e,t)=>T(e,t,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:t,property:n})=>e.graphicUpdateHandler({graphic:t,property:n}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtTarget(e,t,n){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtTarget(t,n):[]}highlight(e,n){let r=S(e);if(r.length===0)return t();let i=E(n),a=this._addHighlightGraphics(r,i);return t(()=>!this.destroyed&&this._removeHighlightGraphics(r,a))}_onHighlightChange(){let e=this._getHighlightFilterGroups();this._highlightView?.setHighlightFilters(e)}_addHighlightGraphics(e,t){return this._highlightGraphics.addMany(e),this._addHighlightFilter(new c({objectIds:e.map(e=>e.uid)}),t)}_removeHighlightGraphics(e,t){this._highlightGraphics.removeMany(e),this._removeHighlight(t)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return s(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){this.attached&&(this.suspended?(this._tileStrategy.clear(),this.requestUpdate()):(this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))))}acquireTile(e){let t=this._bitmapView.createTile(e),n=t.bitmap;return[n.x,n.y]=this._tileInfoView.getTileCoords(O,t.key),n.resolution=this._tileInfoView.getTileResolution(t.key),[n.width,n.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once(`detach`,()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,t):this._fetchTileWithoutTilemapCache(e,t)}async _fetchTileWithoutTilemapCache(e,t={}){let{signal:n,resamplingLevel:i=0}=t;try{return await this._fetchImage(e,n)}catch(n){if(r(n))throw n;if(!this.resampling)return m(this._tileInfoView.size);if(i<3){let n=this._tileInfoView.getTileParentId(e.id);if(n){let r=new _(n),a=await this._fetchTileWithoutTilemapCache(r,{...t,resamplingLevel:i+1});return h(this._tileInfoView,a,r,e)}}return m(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,t={}){let n=this.tilemapCache,{signal:a,resamplingLevel:o=0}=t,s=new _(0,0,0,0),c,l=null;try{if(l=await n.fetchAvailabilityUpsample(e.level,e.row,e.col,s,{signal:a}),!this.resampling&&s.level!==e.level)return await i(t),m(this._tileInfoView.size);c=await this._fetchImage(s,a)}catch(n){if(r(n))throw n;if(this.resampling&&l===`unknown`&&o<3){let n=this._tileInfoView.getTileParentId(e.id);if(n){s.set(n);try{c=await this._fetchTileWithTilemapCache(s,{...t,resamplingLevel:o+1})}catch{}}}}return c?this.resampling?h(this._tileInfoView,c,s,e):c:m(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{let t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once(`attach`,()=>this.requestUpdate()),e.once(`isReady`,()=>this.requestUpdate())}catch(e){r(e)||n.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t}).then(({bitmap:e})=>e)}};e([a()],k.prototype,`resampling`,null),e([a()],k.prototype,`tilemapCache`,null),k=e([o(`esri.views.2d.layers.TileLayerView2D`)],k);const A=k;export{A as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{makeHandle as t}from"../../../core/handleUtils.js";import n from"../../../core/Logger.js";import{isAbortError as r,waitTick as i}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{equals as s}from"../../../geometry/support/spatialReferenceUtils.js";import c from"../../../layers/support/FeatureFilter.js";import{GraphicsCollection as l}from"../../../support/GraphicsCollection.js";import"../engine/Stage.js";import"../../../Color.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../../geometry/Point.js";import"../../../chunks/pe.js";import"../../../core/has.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../core/RandomLCG.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../webgl/BufferObject.js";import"../../webgl/FramebufferObject.js";import"../../webgl/Program.js";import"../../webgl/Renderbuffer.js";import"../../webgl/Texture.js";import"../../../core/memoryEstimations.js";import"../../webgl/enums.js";import"../../webgl/Util.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import u from"./graphics/GraphicsView2D.js";import"../../../layers/effects/EffectView.js";import"../engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileInfo.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../../../geometry/Polygon.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/number.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/TileStencilShader.js";import"../../webgl/UniformBufferLayout.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../request.js";import"../../../core/asyncUtils.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../core/support/UpdatingHandles.js";import"../../../core/mathUtils.js";import"../../../core/urlUtils.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Polyline.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/spatialReferenceEllipsoidUtils.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as d}from"./BitmapTileLayerView2D.js";import{LayerView2D as f}from"./LayerView2D.js";import p from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as m,resampleImage as h}from"./support/imageUtils.js";import g from"../tiling/TileInfoView.js";import _ from"../tiling/TileKey.js";import v from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import b from"../../layers/LayerView.js";import{RefreshableLayerView as x}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as S}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as C,MapServiceLayerViewHelper as w}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as T}from"../../support/drapedUtils.js";import{getHighlightName as E}from"../../support/highlightOptionsUtils.js";import{TaskPriority as D}from"../../support/Scheduler.js";const O=[0,0];let k=class extends x(d(f(b))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new l,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!(`resampling`in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return`tilemapCache`in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){let e=`tileServers`in this.layer?this.layer.tileServers:null,t=this.tilemapCache;if(this._tileInfoView=new g(this.layer.tileInfo,this.layer.fullExtent,t?.effectiveMinLOD,t?.effectiveMaxLOD),this._fetchQueue=new v({tileInfoView:this._tileInfoView,concurrency:e&&e.length*10||10,process:(e,t)=>this.fetchTile(e,t),scheduler:this.scheduler,priority:D.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:`keep`,resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),C(this,this.layer)){let e=this._highlightView=new u({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new p(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new w({createFetchPopupFeaturesQueryGeometry:(e,t)=>T(e,t,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:t,property:n})=>e.graphicUpdateHandler({graphic:t,property:n}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtTarget(e,t,n){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtTarget(t,n):[]}highlight(e,n){let r=S(e);if(r.length===0)return t();let i=E(n),a=this._addHighlightGraphics(r,i);return t(()=>!this.destroyed&&this._removeHighlightGraphics(r,a))}_onHighlightChange(){let e=this._getHighlightFilterGroups();this._highlightView?.setHighlightFilters(e)}_addHighlightGraphics(e,t){return this._highlightGraphics.addMany(e),this._addHighlightFilter(new c({objectIds:e.map(e=>e.uid)}),t)}_removeHighlightGraphics(e,t){this._highlightGraphics.removeMany(e),this._removeHighlight(t)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return s(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){this.attached&&(this.suspended?(this._tileStrategy.clear(),this.requestUpdate()):(this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))))}acquireTile(e){let t=this._bitmapView.createTile(e),n=t.bitmap;return[n.x,n.y]=this._tileInfoView.getTileCoords(O,t.key),n.resolution=this._tileInfoView.getTileResolution(t.key),[n.width,n.height]=this._tileInfoView.size,this._updatingHandles.consumePromise(this._enqueueTileFetch(t)),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once(`detach`,()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,t):this._fetchTileWithoutTilemapCache(e,t)}async _fetchTileWithoutTilemapCache(e,t={}){let{signal:n,resamplingLevel:i=0}=t;try{return await this._fetchImage(e,n)}catch(n){if(r(n))throw n;if(!this.resampling)return m(this._tileInfoView.size);if(i<3){let n=this._tileInfoView.getTileParentId(e.id);if(n){let r=new _(n),a=await this._fetchTileWithoutTilemapCache(r,{...t,resamplingLevel:i+1});return h(this._tileInfoView,a,r,e)}}return m(this._tileInfoView.size)}}async _fetchTileWithTilemapCache(e,t={}){let n=this.tilemapCache,{signal:a,resamplingLevel:o=0}=t,s=new _(0,0,0,0),c,l=null;try{if(l=await n.fetchAvailabilityUpsample(e.level,e.row,e.col,s,{signal:a}),!this.resampling&&s.level!==e.level)return await i(t),m(this._tileInfoView.size);c=await this._fetchImage(s,a)}catch(n){if(r(n))throw n;if(this.resampling&&l===`unknown`&&o<3){let n=this._tileInfoView.getTileParentId(e.id);if(n){s.set(n);try{c=await this._fetchTileWithTilemapCache(s,{...t,resamplingLevel:o+1})}catch{}}}}return c?this.resampling?h(this._tileInfoView,c,s,e):c:m(this._tileInfoView.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{let t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.size[0],e.bitmap.height=this._tileInfoView.size[1],e.once(`attach`,()=>this.requestUpdate()),e.once(`isReady`,()=>this.requestUpdate())}catch(e){r(e)||n.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t}).then(({bitmap:e})=>e)}};e([a()],k.prototype,`resampling`,null),e([a()],k.prototype,`tilemapCache`,null),k=e([o(`esri.views.2d.layers.TileLayerView2D`)],k);const A=k;export{A as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{whenOnce as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import r from"../../../core/Logger.js";import{whenOnce as i,watch as a,sync as o}from"../../../core/reactiveUtils.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import{computeSrcResolutions as l,projectDatasetExtent as u}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{OutlineVisualElement as d}from"../interactive/visualElements/OutlineVisualElement.js";import{LayerView3D as f}from"./LayerView3D.js";import{TiledLayerView3D as p}from"./TiledLayerView3D.js";import{RasterTile as m}from"../terrain/RasterTile.js";import h from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as g}from"../../layers/RefreshableLayerView.js";let _=class extends g(p(f(h))){constructor(){super(...arguments),this._srcResolutions=[],this._hasRenderedFirstTile=!1,this.type=`imagery-tile-3d`,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){try{this._neatlineVisualElement=new d({view:this.view,geometry:this.layer.createNeatline(this.view.spatialReference),attached:!0,isDecoration:!0,isDraped:!0,visible:!0,color:[105/255,165/255,185/255,.8],width:4,innerWidth:2,innerColor:[105/255,170/255,190/255,.85],falloff:0})}catch(e){r.getLogger(this).error(e)}this.layer.increaseRasterJobHandlerUsage(),this.fullExtent??this.addResolvingPromise(Promise.reject(new t(`layerview:spatial-reference-incompatible`,`The layer extent cannot be projected to the view's spatial reference`,{layer:this.layer})));let e=i(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{let e=this.view.basemapTerrain.tilingScheme;this.tileInfo=e.toTileInfo(),this._srcResolutions=l(this.layer.serviceRasterInfo,this.tileInfo),this.addHandles([n(this._neatlineVisualElement),a(()=>[this.layer.clippedToNeatline],()=>this._updatingHandles.addPromise(this.doRefresh()),o)])});this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage()}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get imageFormatIsOpaque(){return!1}get hasMixedImageFormats(){return!1}get dataLevelRange(){let e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,n=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,n)}get visibleAtCurrentScale(){return this.tilesVisibleAtCurrentScale()}_getFullExtent(){return u(this.layer.serviceRasterInfo,this.view.groundView?.spatialReference??this.view.spatialReference)}async fetchTile(e,n){let r=this.tileInfo,i={tileInfo:r,requestRawData:this._canSymbolizeInWebGL(),signal:n.signal,srcResolution:this._srcResolutions[e[0]],noClip:!1},{layer:a}=this,[o,s,c]=e,l=await a.fetchTile(o,s,c,i);if(l instanceof HTMLImageElement||l instanceof ImageBitmap)throw new t(`layerview:unexpected-tile-data`,`Expected fetchTile to return raster data, but received an image element. This may indicate a problem with the layer's fetchTile implementation.`);let u=l?.pixelBlock;if(u==null)return null;let d=new m([o,s,c],u,r.size[0],r.size[1]);return d.transformGrid=l.transformGrid,d.interpolation=`bilinear`,this._hasRenderedFirstTile||(this._hasRenderedFirstTile=!0,this._updateNeatlineVisualElement()),d}async doRefresh(){this.suspended||this.emit(`data-changed`)}isUpdating(){return!1}_canSymbolizeInWebGL(){return!0}_updateNeatlineVisualElement(){this._neatlineVisualElement.visible=!this._hasRenderedFirstTile}get usedMemory(){return 0}};e([s()],_.prototype,`fullExtent`,null),e([s({readOnly:!0})],_.prototype,`imageFormatIsOpaque`,null),e([s({readOnly:!0})],_.prototype,`hasMixedImageFormats`,null),e([s({readOnly:!0})],_.prototype,`dataLevelRange`,null),e([s({readOnly:!0})],_.prototype,`visibleAtCurrentScale`,null),_=e([c(`esri.views.3d.layers.GeospatialPDFLayerView3D`)],_);const v=_;export{v as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as n,watch as r,sync as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{computeSrcResolutions as s,projectDatasetExtent as c}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{LayerView3D as l}from"./LayerView3D.js";import{TiledLayerView3D as u}from"./TiledLayerView3D.js";import d from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as f}from"../terrain/RasterTile.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import{whenOnce as n,watch as r,sync as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import{computeSrcResolutions as s,projectDatasetExtent as c}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{LayerView3D as l}from"./LayerView3D.js";import{TiledLayerView3D as u}from"./TiledLayerView3D.js";import d from"../support/flow/FlowSubViewTiles3D.js";import{RasterTile as f}from"../terrain/RasterTile.js";import p from"../../layers/ImageryTileLayerView.js";import{RefreshableLayerView as m}from"../../layers/RefreshableLayerView.js";import{createQueryGeometry as h}from"../../support/drapedUtils.js";import{getWebGLCapabilities as g}from"../../webgl/capabilities.js";let _=class extends m(u(l(p))){constructor(){super(...arguments),this._srcResolutions=[],this.type=`imagery-tile-3d`,this._isAlignedMapTile=!0,this._flowSubView=null,this.ignoresMemoryFactor=!1,this.unloadedMemory=0}initialize(){this.layer.increaseRasterJobHandlerUsage(),this.fullExtent??this.addResolvingPromise(Promise.reject(new t(`layerview:spatial-reference-incompatible`,`The layer extent cannot be projected to the view's spatial reference`,{layer:this.layer})));let e=n(()=>this.view?.basemapTerrain?.tilingSchemeLocked).then(()=>{let e=this.view.basemapTerrain.tilingScheme,t=this.layer.tileInfo;this._isAlignedMapTile=[`png`,`png24`,`png32`,`jpg`,`mixed`].includes(t.format)&&e.compatibleWith(t),this.tileInfo=this._isAlignedMapTile?t:e.toTileInfo(),this._srcResolutions=s(this.layer.serviceRasterInfo,this.tileInfo),this.addHandles([r(()=>this.layer.renderer,e=>{this._setSubView(e),this._updatingHandles.consumePromise(this.doRefresh())},i),r(()=>[this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this._updatingHandles.addPromise(this.doRefresh()),i)])});this._setSubView(this.layer.renderer),this.addResolvingPromise(e)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this._flowSubView?.destroy()}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}_setSubView(e){if(this.layer.type===`wcs`)return;let t=e?.type===`flow`,n=this._flowSubView;t&&n!=null||(n?.destroy(),this._flowSubView=t?new d({layerView:this}):null)}get _hasFlow(){return this._flowSubView!=null}get imageFormatIsOpaque(){return this.layer.tileInfo.format===`jpg`}get hasMixedImageFormats(){return this.layer.tileInfo.format===`mixed`}get dataLevelRange(){let e=this.layer.tileInfo,t=this.tileInfo.lodAt(0)?.scale,n=e.lodAt(e.lods.length-1)?.scale;return this.levelRangeFromScaleRange(t,n)}get visibleAtCurrentScale(){return this._flowSubView?.visibleAtCurrentScale??this.tilesVisibleAtCurrentScale()}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.groundView?.spatialReference??this.view.spatialReference)}async fetchTile(e,n){if(this._isAlignedMapTile)return this.layer.fetchImageBitmapTile(e[0],e[1],e[2],{...n,allowDeriveTypeFromData:!0,imageOrientation:`flipY`});let r=this.tileInfo,i=this._canSymbolizeInWebGL(),a={tileInfo:r,requestRawData:i&&!this._hasFlow,signal:n.signal,timeExtent:this.timeExtent,requestProjectedLocalDirections:this._hasFlow,srcResolution:this._srcResolutions[e[0]],noClip:!1},{layer:o}=this,[s,c,l]=e,u=await o.fetchTile(s,c,l,a);if(u instanceof HTMLImageElement||u instanceof ImageBitmap)throw new t(`layerview:unexpected-tile-data`,`Expected fetchTile to return raster data, but received an image element. This may indicate a problem with the layer's fetchTile implementation.`);let d=u?.pixelBlock;if(d==null||!i&&!this._hasFlow&&(d=await o.applyRenderer(u),d==null))return null;let p=new f([s,c,l],d,r.size[0],r.size[1]);return i?(p.symbolizerRenderer=o.symbolizer.rendererJSON,p.symbolizerParameters=o.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(s)),p.transformGrid=u.transformGrid,p.bandIds=o.bandIds):(p.isRenderedSource=!0,p.bandIds=null),p.interpolation=o.interpolation,p}_getSymbolizerOptions(e){let t=this.tileInfo.lodAt(e).resolution;return{pixelBlock:null,isGCS:this.view.groundView?.spatialReference==null?this.view.spatialReference.isGeographic:this.view.groundView.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(e){this._canSymbolizeInWebGL()&&JSON.stringify(e.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(e.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(e.lij[0])))}createFetchPopupFeaturesQueryGeometry(e,t){return h(e,t,this.view)}async doRefresh(){this.suspended||(this._flowSubView?.doRefresh(),this.emit(`data-changed`))}isUpdating(){return this._flowSubView?.updating??!1}_canSymbolizeInWebGL(){let e=g(),{symbolizer:t}=this.layer,n=t.lookup.colormapLut?.indexedColormap,r=!!this.layer.rasterFunction?.hasClipFunction,i=n&&n.length>(e.maxTextureSize||4096)*4;return t.canRenderInWebGL&&!i&&!r}get usedMemory(){return this._flowSubView?.usedMemory??0}get test(){}};e([a()],_.prototype,`fullExtent`,null),e([a()],_.prototype,`_hasFlow`,null),e([a({readOnly:!0})],_.prototype,`imageFormatIsOpaque`,null),e([a({readOnly:!0})],_.prototype,`hasMixedImageFormats`,null),e([a()],_.prototype,`_flowSubView`,void 0),e([a({readOnly:!0})],_.prototype,`dataLevelRange`,null),e([a({readOnly:!0})],_.prototype,`visibleAtCurrentScale`,null),_=e([o(`esri.views.3d.layers.ImageryTileLayerView3D`)],_);const v=_;export{v as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{Graphics3DStageObjectGraphicLayer as e}from"./Graphics3DStageObjectGraphicLayer.js";class t extends e{constructor(e,t,n,r,i){super(e,t,n,i),this.elevationAligner=r,this.type=`buffer`}updateMaterial(e){let{stageObject:
|
|
2
|
+
import{Graphics3DStageObjectGraphicLayer as e}from"./Graphics3DStageObjectGraphicLayer.js";class t extends e{constructor(e,t,n,r,i){super(e,t,n,i),this.elevationAligner=r,this.type=`buffer`}updateMaterial(e){let t=this.usedMemory;this._detachGeometryMemoryCallbacks();let{stageObject:n}=this,r=n.geometries.map(t=>t.instantiate(e));for(let e of r)n.removeGeometry(0),n.addGeometry(e);this._updateGeometryBufferMemory(t)}_alignWithElevation(e,t,n,r){this.elevationAligner!=null&&(this.alignedSampledElevation=this.elevationAligner(this.stageObject,this.elevationContext,e,t,n))}}export{t as Graphics3DBufferGraphicLayer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as o,removeMaybe as s,destroyMaybe as c}from"../../../../core/maybe.js";import{MinPriority as l}from"../../../../core/MemCache.js";import u from"../../../../core/PooledArray.js";import{throwIfAborted as d,ignoreAbortErrors as f,isAbortError as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/Queue.js";import{when as h,watch as g,on as ee,syncAndInitial as te,whenOnce as _}from"../../../../core/reactiveUtils.js";import{schedule as v}from"../../../../core/scheduling.js";import{property as y,subclass as ne}from"../../../../core/accessorSupport/decorators.js";import{diff as b,isEmpty as re}from"../../../../core/accessorSupport/diffUtils.js";import{runUntracked as x}from"../../../../core/accessorSupport/tracking.js";import{set as S,add as C,scale as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import ie from"../../../../geometry/Extent.js";import ae from"../../../../geometry/Point.js";import{canProjectWithoutEngine as oe}from"../../../../geometry/projectionUtils.js";import{projectBuffer as E}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as D}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as O}from"../../../../geometry/projection/projectXYZToVector.js";import{center as se,fromRect as ce,create as k,equals as le}from"../../../../geometry/support/aaBoundingBox.js";import{create as ue}from"../../../../geometry/support/aaBoundingRect.js";import{equals as de}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as fe}from"../../../../graphic/getPopupProvider.js";import pe from"../../../../layers/Layer.js";import{getObjectId as A,computeAABB as j,hasGeometry as M}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import P from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as F,validateTo3D as I}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as L}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as R}from"../../../../support/basemapUtils.js";import{loadArcade as z}from"../../../../support/loadArcade.js";import B from"../../../../symbols/LabelSymbol3D.js";import me from"../../../../symbols/TextSymbol.js";import he from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as ge}from"../../../../symbols/support/defaults3D.js";import{to3D as V}from"../../../../symbols/support/symbolConversion.js";import{aggregateSymbolComplexity as _e,defaultSymbolComplexity as ve}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as ye}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as be}from"./ElevationQuery.js";import{extractExpressionInfo as H,createContext as U}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as xe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as Se}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as Ce}from"./Graphics3DSymbolCreationContext.js";import{make as we}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as Te}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as Ee}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as De}from"./GraphicStateTracking.js";import{computeCentroid as Oe}from"./graphicUtils.js";import{placePointOnGeometry as ke}from"./pointUtils.js";import{SpatialIndex2D as Ae}from"./SpatialIndex2D.js";import{AggregateSymbolComplexity as je}from"./SymbolComplexity.js";import{StageLayerElevationProvider as Me}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Ne}from"../../support/extentUtils.js";import{affectsGeometry as Pe}from"../../webgl-engine/lib/affectsGeometry.js";import{GridLocalOriginFactory as Fe}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as W}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{WebGLLayer as Ie}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Le}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Re}from"../../../layers/support/popupUtils.js";import{PromiseQueue as G}from"../../../support/PromiseQueue.js";import{PropertiesPool as ze}from"../../../support/PropertiesPool.js";import{ImmediateTask as K,noBudget as Be,TaskPriority as Ve}from"../../../support/Scheduler.js";import{TextureCompressionTracker as He}from"../../../support/TextureCompressionTracker.js";import{Yield as Ue}from"../../../support/Yield.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";var J;const Y=T(),We=k();let X=class extends t{static{J=this}static{this.tmpVec=T()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new Ae({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return this.currentRenderer!=null&&this.currentRenderer.type===`dictionary`?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return x(()=>this.updating?this._pendingUpdates.size+(this._spatialIndex?.updatingRemaining||0)*.1+(this._elevationAlignment?.updatingRemaining||0)*.1:0)}get displayFeatureLimit(){let e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,n=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,i=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,o=Math.max(1,a?.verticesPerFeature??1),s=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:n,c=Math.ceil(i/o),l=Math.max(t,Math.min(n,c,s)),u=this._get(`displayFeatureLimit`);return u&&u.maximumTotalNumberOfVertices===i&&u.averageSymbolComplexity===a&&u.maximumNumberOfFeatures===l?u:new ye(i,l,a)}get averageSymbolComplexity(){return x(()=>{let e=this._averageSymbolComplexities,t=this._get(`averageSymbolComplexity`);return e.numComplexities===0||t!=null&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e})}get _averageSymbolComplexities(){let e=this._totalSymbolComplexities;return e.numComplexities>0&&(e.verticesPerFeature/=e.numComplexities,e.verticesPerCoordinate/=e.numComplexities,e.drawCallsPerFeature/=e.numComplexities,e.memory.bytesPerFeature/=e.numComplexities,e.memory.bytesPerFeatureLabel/=e.numComplexities,e.memory.resourceBytes/=e.numComplexities,e.memory.draped.bytesPerFeature/=e.numComplexities,e.memory.draped.bytesPerFeatureLabel/=e.numComplexities),e}get _totalSymbolComplexities(){let e=new je;return this._forEachSymbolComplexity(t=>_e(t,e)),e}get usedMemory(){let e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=0;if(this._forEachSymbolComplexityUsed(e=>t+=e?.memory.resourceBytes??0),this._symbolMaterials==null){this._symbolMaterials=[];for(let e of this._symbols.values())if(e!=null){for(let t of e.symbolLayers)if(t)for(let e of t.materials)e&&this._symbolMaterials.push(e)}}let n=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,i=this._symbolMaterials.reduce((e,t)=>e+((n.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+i}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){let e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(this.averageSymbolComplexity!=null){let e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}_forEachSymbolComplexity(e){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(e):this._forEachSymbolComplexityUsed(e)}get visible(){return this._visible}_getConvertedSymbol(e){let t=e;if(t.type===`web-style`)return t.clone();let n=this._symbolConversionCache.get(t.id);if(n!=null)return n;let r=V(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return a==null&&r.error&&i.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){let t=this.currentRenderer;if(t==null)return;let n=t.symbols,r=`backgroundFillSymbol`in t?t.backgroundFillSymbol:null;if(!r&&!n.length)return;let i=this._getSymbolComplexityUsedOrRenderer(r);i!=null&&e(i);for(let t of n){let n=this._getSymbolComplexityUsedOrRenderer(t);n!=null&&e(n)}}_getSymbolComplexityUsedOrRenderer(e){if(e==null)return null;let t=this._symbols.get(e.id);if(t!=null)return t.complexity;let n=this._getConvertedSymbol(e);return n==null?null:ve(n)}_forEachSymbolComplexityUsed(e){this._symbols.forEach(t=>{e(t?.complexity)})}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new ze({computedExtent:()=>new ie},this),this.computedExtent=null,this.currentRenderer=null,this.rendererRequiresHydratedGraphic=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTaskHandle=K,this._dataUpdateQueue=new G,this._updateQueue=new G,this._focusAreasGraphicsQueue=new m,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._elevationAlignment=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new He,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new u,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.reportGraphicSourceMemory=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache(`graphics-3d-unused-symbols`,e=>e.destroy()),this.symbolCreationContext=new Ce(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new xe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e),usedMemoryInvalidated:e=>{let t=e.updateUsedMemory(this.reportGraphicSourceMemory);this.graphics3DGraphics.get(e.graphic.uid)===e&&(this._usedMemory+=t)}});let e=(e,t,n)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,n),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(A(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(h(()=>this.owner.view.state.highlights,()=>{let{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){let e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new be(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);let n=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=n,this.currentRenderer!=null&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Fe(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e),this.symbolCreationContext.focusAreaStyle=t.map?.focusAreas.style??null;let r=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await U(r,this._viewSpatialReference,e,i.getLogger(this)),d(e),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,`drapeSourceType`in this.owner){let{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([g(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(f)),g(()=>W(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),g(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),g(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),g(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),g(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),g(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),g(()=>this.owner.view.timeZone,()=>{this.currentRenderer?.arcadeRequired&&this.recreateAllGraphics()}),g(()=>this.owner.view.map?.focusAreas.style,e=>{this.symbolCreationContext.focusAreaStyle=e??null,this.recreateAllGraphicsAndSymbols()}),h(()=>t.basemapTerrain?.tilingScheme,e=>{let n=t.groundView?.spatialReference;!e.spatialReference.equals(this.symbolCreationContext.overlaySR)&&n!=null&&(this.symbolCreationContext.overlaySR=n),this.hasHandles(`loaded-graphics`)?this.recreateAllGraphics():this.addHandles([ee(()=>this.owner?.loadedGraphics,`change`,e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],`loaded-graphics`)},{initial:!0}),g(()=>this.effectiveUpdatePolicy,e=>{this.stageLayer!=null&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===0,e===1&&this.runTask(Be)},te)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(Ve.GRAPHICS_CORE,this),this.layer&&`featureReduction`in this.layer&&this.addHandles(g(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange(`averageSymbolComplexity`),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=o(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=o(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=K,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=s(this._deconflictor),this._labeler=s(this._labeler),this._elevationAlignment=c(this._elevationAlignment),this._scaleVisibility=c(this._scaleVisibility),this._filterVisibility=c(this._filterVisibility),this._objectStates=c(this._objectStates),this.clear(),`drapeSourceType`in this.owner){let{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=c(this._featureStore),this._updatingPendingLoadedGraphicsChange=s(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=c(this._graphicStateTracking),this.stage&&=(this.stageLayer=c(this.stageLayer),null),this._set(`owner`,null);for(let e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new r(`graphic:layer-destroyed`,`Layer has been destroyed`));this._whenGraphics3DGraphicRequests=null,this._propertiesPool=c(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=c(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),this._graphicStateTracking!=null&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(c),this._symbols.clear(),this._symbolMaterials&&=(this._symbolMaterials.length=0,null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange(`dataUpdating`),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Ie(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);let n=this.stageLayer.events;n.on(`transformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`shaderTransformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`visibilityChanged`,e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),n.on(`geometryAdded`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`geometryRemoved`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`attributesChanged`,e=>Pe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){let e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*Ge,n=!this.suspendedOrOutsideOfView&&!t;n!==this._visible&&(this._visible=n,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){let e=this._visible&&(this.layer.opacity==null||this.layer.opacity>=q);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return e==null?void 0:this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return A(e,t)}get graphics3DGraphicsByObjectID(){let e=this.owner.layer?.objectIdField;if(!e)return;let t=new Map;return this.graphics3DGraphics.forEach(n=>{if(!n)return;let r=n.graphic,i=this._getGraphicObjectID(r,e);i!=null&&t.set(i,n)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){let t=this._deconflictor?.labelingInfoChange(e),n=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,n])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return`unknown`;let e=!1,t=!1;for(let[n,r]of this._symbols)if(r!=null)switch(r.getFastUpdateStatus()){case 3:return`unknown`;case 1:this._graphicsBySymbol.has(n)&&(t=!0);break;case 0:this._graphicsBySymbol.has(n)&&(e=!0);break;case 2:this._graphicsBySymbol.has(n)&&(t=e=!0)}return t?e?`mixed`:`fast`:e?`slow`:`mixed`}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange(`readyToRun`),this.readyToRun||this.notifyChange(`dataUpdating`),this.notifyChange(`updatingRemaining`),!e.hasProgressed)return Ue}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);let n=this._findGraphics3DGraphicByObjectId(e);n!=null&&this._updateUserVisibility(n)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(e==null)return!1;let t=e.graphic,n=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(n==null||!this._objectIdInvisibleSet.has(n));return e.setVisibilityFlag(1,1,r)}_whenGraphics3DGraphic(e){let t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);let n=this._whenGraphics3DGraphicRequests[e.uid];if(n)return n.promise;let r=Promise.withResolvers();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){let n=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,i=this.owner.view.groundView.spatialReference,a=(e,t,i)=>E(e,r,t,e,n,t,i),o=(e,t,r)=>E(e,i,t,e,n,t,r),s=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:t!=null&&!!t.useViewElevation,minDemResolution:t==null?null:t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,c=await e.getProjectedBoundingBox(a,o,s,t?.signal);if(!c)return null;let l=c.boundingBox;if(c.requiresDrapedElevation){let e=this.symbolCreationContext.elevationProvider;if(e){se(l,Y);let t=e.getElevation(Y[0],Y[1],0,n,`ground`)??0;l[2]=Math.min(l[2],t),l[5]=Math.max(l[5],t)}}return{boundingBox:l,screenSpaceObjects:c.screenSpaceObjects}}async whenGraphicBounds(e,t){await _(()=>this.owner?.loadedGraphics);let n=this.owner.layer?.objectIdField,i=this.owner.loadedGraphics.find(t=>t===e||n!=null&&t.attributes!=null&&e.attributes&&t.attributes[n]===e.attributes[n]);if(!i)throw new r(`internal:graphic-not-part-of-view`,`Graphic is not part of this view`);let a=await this._whenGraphics3DGraphic(i);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){let n=this.graphics3DGraphics.get(e.uid);if(!n)return null;let r=n.computeAttachmentOrigin();if(r.render.num===0&&r.draped.num===0)return null;S(Q,0,0,0);let i=0;if(r.render.num>0){if(!D(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,$,t))return null;C(Q,Q,$),i++}if(r.draped.num>0){let[e,n]=r.draped.origin,a=this.owner.view.groundView.spatialReference,o=this.owner.view.elevationProvider.getElevation(e,n,0,a,`ground`)??0;if(S($,e,n,o),!D($,a,$,t))return null;C(Q,Q,$),i++}return i>1&&w(Q,Q,1/i),new ae({x:Q[0],y:Q[1],z:Q[2],spatialReference:t})}getSymbolLayerSize(e,t){let n=this._symbols.get(e.id);if(n==null)throw new r(`internal:symbol-not-part-of-view`,`Symbol is not part of this view`);let i=e.symbolLayers.indexOf(t);if(i===-1)throw new r(`internal:missing-symbol-layer`,`Symbol layer is not in symbol`);let a=n.getSymbolLayerSize(i);if(a==null)throw new r(`internal:missing-size`,`Symbol layer has no valid size`);return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){let t=e.graphic.uid,n=this.graphics3DGraphics.get(t);if(n!=null||this._graphicsWithoutSymbol.get(t)!=null){switch(e.property){case`visible`:this._graphicUpdateVisibleHandler(n);break;case`geometry`:this._graphicUpdateGeometryHandler(n,e.graphic);break;case`symbol`:this._graphicUpdateSymbolHandler(n,e);break;case`attributes`:this.symbolCreationContext.featureExpressionInfoContext?.arcade?this._graphicUpdateGeometryHandler(n,e.graphic):this._usedMemory+=n?.updateUsedMemory(this.reportGraphicSourceMemory)??0;break;case`popupTemplate`:break;case`origin-transform`:this._graphicUpdateTransformHandler(n,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>e!=null&&e.graphics3DSymbol.updateGeometry(e)&&(this._labeler?.updateGraphicGeometry(e)??!0)?(this._labeler?.setDirty(),this._deconflictor?.setDirty(),this._usedMemory+=e.updateUsedMemory(this.reportGraphicSourceMemory),!0):!1);let n=t.geometry;n!=null&&this._expandComputedExtent(n)}_graphicUpdateTransformHandler(e,t){let n=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>t.newValue!=null&&e!=null&&n!=null&&e.graphics3DSymbol.updateTransform(e,n.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,n){if(t.geometry==null)this._recreateGraphic(t);else if(e==null){let e=t.symbol?.id;if(e){let t=this._symbols.get(e);if(t!=null&&t.loadStatus===0)return}this._recreateGraphic(t)}else if(!n()){let n=this._deconflictor?.getState(e);this._recreateGraphic(t);let r=this.graphics3DGraphics.get(t.uid);r&&n!=null&&this._deconflictor?.setState(r,n)}}_graphicUpdateSymbolHandler(e,t){let n=t.graphic,r=e==null?t.oldValue==null?null:this._symbols.get(t.oldValue.id):e.graphics3DSymbol;if(r==null||t.newValue==null){this._recreateGraphic(n);return}let i=r.symbol,a=this._getConvertedSymbol(t.newValue);if(a!=null&&(a.type!==i.type||a.type===`web-style`)||i.type===`web-style`){this._recreateGraphic(n);return}let o=this._graphicsBySymbol.get(i.id);if(o&&o.size!==1){this._recreateGraphic(n);return}let s=b(i,a);if(s==null){this._updateSymbolMapping(i.id,a);return}let c={diff:s,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(c),!re(c.diff)){this._recreateGraphic(n);return}let l=this._getRenderingInfo(n,!1);if(l==null){this._recreateGraphic(n);return}let u=r.extentPadding;for(let e of c.symbolStatePatches)e();if(u!==r.extentPadding&&this._recomputeExtentPadding(),e!=null)for(let t of c.graphics3DGraphicPatches)t(e,l);this._updateSymbolMapping(i.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===1&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){let t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),this._graphicsWaitingForSymbol.size===1&&this.notifyChange(`dataUpdating`),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`)))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{t!=null&&(e=Math.max(e,t.extentPadding))}),this._set(`extentPadding`,e)}_expandComputedExtent(e){let t=We,n=e.spatialReference;j(e,t);let r=this._viewSpatialReference,i=J.tmpVec;if(de(n,r)||O(t[0],t[1],0,n,i,r)&&(t[0]=i[0],t[1]=i[1],O(t[3],t[4],0,n,i,r),t[3]=i[0],t[4]=i[1]),!isFinite(t[0])||!isFinite(t[3])||!isFinite(t[1])||!isFinite(t[4]))return;let a=this.computedExtent,o=null,s=isFinite(t[2])&&isFinite(t[5]),c=s&&(a?.zmin==null||t[2]<a.zmin),l=s&&(a?.zmax==null||t[5]>a.zmax);a?(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||c||l)&&(o=this._propertiesPool.get(`computedExtent`),o.xmin=Math.min(t[0],a.xmin),o.ymin=Math.min(t[1],a.ymin),o.xmax=Math.max(t[3],a.xmax),o.ymax=Math.max(t[4],a.ymax),o.spatialReference=r):(o=this._propertiesPool.get(`computedExtent`),o.xmin=t[0],o.ymin=t[1],o.xmax=t[3],o.ymax=t[4],o.spatialReference=r),o&&(c&&(o.zmin=t[2]),l&&(o.zmax=t[5]),this._set(`computedExtent`,o))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&=(this._elevationInfoChangeAbortController.abort(),null)}async elevationInfoChange(){this._abortElevationInfoChange();let e=new AbortController;this._elevationInfoChangeAbortController=e;let t=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await U(t,this._viewSpatialReference,e.signal,i.getLogger(this)),d(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`elevationInfo`,t)?t?.forEach(e=>{let t=e.graphic,n=e.labelLayers;for(let e of n)e.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,e)}):this._recreateSymbol(n)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo?.mode===`relative-to-scene`||this._numberOfGraphicsProvidingElevation===0)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=c(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&this.layer.elevationInfo.mode!==`relative-to-scene`)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Me({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),this._filterVisibility!=null&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&=(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),c(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;let{loadedGraphics:t,view:n}=this.owner,r=n.basemapTerrain?.tilingScheme&&t?.length?t.toArray():null;(e||!r)&&this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set(`computedExtent`,null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){let t=this._graphicsBySymbol.get(e),n=[];t&&(t.forEach((e,t)=>{this._conditionalRemove(e,t),this._spatialIndex?.remove(e),n.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,e),this._updateLayerVisibility(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));let r=this._symbols.get(e);c(r),this._symbols.delete(e),this._symbolMaterials=null,c(this._unusedSymbolsCache.pop(e)),this.add(n)}_recreateGraphicsForSymbol(e){let t=this._graphicsBySymbol.get(e);if(t){let e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),this._graphicStateTracking!=null&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&e.length!==0&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(e)===0?this._addDelayed(e):this._addImmediate(e),this.notifyChange(`dataUpdating`)):i.getLogger(this).error(`#add()`,`Cannot add graphics before terrain surface has been initialized`))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===1&&(this.layer.geometryType===`mesh`||this.layer.geometryType==null)){for(let t of e)if(t.geometry!=null&&t.geometry.type===`mesh`&&!t.geometry.loaded)return 0}return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(let t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);n?n.add?n.state!==0&&n.abortController?.abort():this._pendingAdds++:(n=new Z,this._pendingAdds++,this._pendingUpdates.set(e,n)),n.add=t}this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}remove(e){this.effectiveUpdatePolicy===0?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange(`dataUpdating`)}_removeImmediate(e){for(let t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_removeDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);if(n)n.add&&(n.remove?n.add=null:this._pendingUpdates.delete(e),n.state===1&&n.abortController?.abort(),this._pendingAdds--);else{let n=new Z;n.remove=t,this._pendingUpdates.set(e,n),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}this._pendingUpdates.size===0&&this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&i.getLogger(this).warn(`pendingAdds/Removes in inconsistent state!`),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();let t=this._focusAreasGraphicsQueue.pop(),n=ke(t.graphic.geometry);if(n==null)continue;let r=this.stage.view.focusAreasView?.containsGeometry(n)??!0;t.layers.forEach(e=>{(e?.type===`object3d`||e?.type===`buffer`)&&e.stageObject.geometries.some(e=>e.material instanceof Le&&e.material.parameters.focusAreaStyle==null!==r)&&this.recreateGraphics([t.graphic])})}this._focusAreasGraphicsQueue.length===0&&this.notifyChange(`readyToRun`)}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,this._pendingUpdates.size===0&&this._spatialIndex?.updating)this._spatialIndex.update(),e.madeProgress();else{if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(let[t,n]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(n.remove&&!n.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,this._pendingUpdates.delete(t),this._pendingRemoves===0))break}}for(let[t,n]of this._pendingUpdates){if(e.done)break;n.add&&n.state===0&&this._processPendingUpdateNew(n);let r=this.effectiveUpdatePolicy;if(n.remove&&(!n.add||n.state===2)&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,r=1),n.add)switch(n.state){case 2:this._addGraphic(n.add,n.renderingInfo,r),n.add=null,this._pendingAdds--,e.madeProgress();break;case 3:n.add=null,this._pendingAdds--}n.remove==null&&n.add==null&&this._pendingUpdates.delete(t)}this._pendingUpdates.size===0&&(this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`dataUpdating`))}}_processPendingUpdateNew(e){if(!e.add){e.state=2;return}let t=e.add.geometry;t!=null&&t.type===`mesh`&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=1,e.abortController=new AbortController;let n=e.abortController.signal;try{await t.load({signal:n})}catch(t){return this._processPendingUpdateNewError(e,t)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,e.state=p(t)?0:3}async _processPendingUpdateNewRenderingInfo(e){if(this.layer.renderer==null||this.layer.renderer.type!==`dictionary`){e.renderingInfo=this._getRenderingInfo(e.add),e.state=2;return}e.state=1,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(t){e.abortController=null,e.state=p(t)?0:3;return}t?.symbol==null?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,n){if(this._graphicsWithoutSymbol.set(e.uid,e),t?.symbol==null||!M(e))return;let r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){let t=R(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(A(e,this._objectIdField),e.uid,this.layer.id,this.owner.layerViewUid,fe(this.layer)&&!!this.layer.popupEnabled&&!t&&Re(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}let i=t.symbol,a=this.getOrCreateGraphics3DSymbol(i,t.renderer);if(a==null)return;this._expandComputedExtent(e.geometry);let o=this._beginGraphicUpdate(e),s=new Se(e,t,this.layer),c=!1,l=e=>{e===a.symbol.id&&(c=!0)};this._whenSymbolRemoved.push(l);let u=()=>{if(--this._loadingSymbols,!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(l),this._graphicsWaitingForSymbol.get(e.uid)===o&&!c&&!a.destroyed&&(!this.graphicSymbolSupported||!e.symbol||e.symbol.id===a.symbol.id)){let t=this._createGraphics3DGraphic(a,s);this._spatialIndex&&t!=null&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}else--a.referenced,this._cleanupSymbols();this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()}},d=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),c||(p(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,n===0?a.load(()=>this._dataUpdateQueue.push(u,null).catch(f),e=>this._dataUpdateQueue.push(()=>d(e),null).catch(f)):a.load(u,d)}_removeGraphic(e){let t=e.uid,n=this.graphics3DGraphics.get(t);if(n){n.graphics3DSymbol.onRemoveGraphic(n);let e=n.isElevationSource;this._conditionalRemove(n,t),this._spatialIndex?.remove(n);let r=n.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(r)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,n,e),n.destroy(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`))}_hasLabelingContext(e){if(e instanceof B||e instanceof me){let t=this.symbolCreationContext.layer;return t.labelingInfo?t.labelingInfo.some(t=>t.symbol===e):!1}return!1}_hasValidSymbolCreationContext(e){return e instanceof B&&!this._hasLabelingContext(e)?(i.getLogger(this).error(`LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported.`),!1):!0}_getRenderingInfo(e,t=!0){let n=e.geometry;if(n==null)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!oe(n.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let r=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e,a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||this.currentRenderer!=null))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{let e=r.symbol||ge(r.geometry);a=new L(null,e)}return a?.symbol==null?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(e.geometry==null)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let n=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(n,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;let n=this._getConvertedSymbol(e);if(!n)return null;let r;if(t!=null&&`backgroundFillSymbol`in t&&t.backgroundFillSymbol){let e=V(t.backgroundFillSymbol,{ignoreDrivers:!0});e.symbol!=null&&(r=e.symbol.symbolLayers)}let i=we(n,this.symbolCreationContext,r);return i.load(()=>{let e=i.extentPadding;e>this.extentPadding&&this._set(`extentPadding`,e),this.notifyChange(`averageSymbolComplexity`)},()=>{}),i}getOrCreateGraphics3DSymbol(e,t){let n=this._symbols.get(e.id);return n===void 0&&(n=this._unusedSymbolsCache.pop(e.id)??(e instanceof he?new Te(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t)),this._symbols.set(e.id,n),this._symbolMaterials=null),n!=null&&++n.referenced,n}trackGraphicState(e){return this._graphicStateTracking??=new De(this),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){e.updateUsedMemory(this.reportGraphicSourceMemory),this._usedMemory+=e.usedMemory,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,n=!1){this._usedMemory-=t.usedMemory,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,n&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){let{graphic:n}=t;if(this._graphicsWithoutSymbol.delete(n.uid),!this._symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;let r=e.createGraphics3DGraphic(t);if(r==null)return null;this._addGraphics3DGraphic(r);let i=e.symbol.id;if(this._graphicsBySymbol.has(i)||this._graphicsBySymbol.set(i,new Map),this._graphicsBySymbol.get(i).set(n.uid,r),r.isDraped&&this._graphicsDrapedUids.add(n.uid),r.centroid=null,n.geometry!=null&&n.geometry.type!==`point`&&(r.centroid=Oe(n.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(r),this._filterVisibility!=null){let{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),this._graphicStateTracking!=null&&this._graphicStateTracking.addGraphic(r);let a=this._whenGraphics3DGraphicRequests[n.uid];return a&&(delete this._whenGraphics3DGraphicRequests[n.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=o(this._rendererChangeAbortController),e!==this.currentRenderer){if(this._validateRenderer(e),e??this._currentRendererChange(null,!1),!F(e))this._currentRendererChange(e,!1);else if(e?.arcadeRequired){let t=new AbortController;this._rendererChangeAbortController=t;let{arcadeUtils:n}=await this._ensureArcade();d(t);let r=n.hasGeometryOperations(e),i=r||await this._rendererUsesFieldsRequiringArcadeTypeConversion(e);d(t),r&&(await n.enableGeometryOperations(),d(t)),this.effectiveUpdatePolicy===0?await this._updateQueue.push(()=>this._currentRendererChange(e,i),t.signal):this._currentRendererChange(e,i),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===0){let t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1)}}async _ensureArcade(){return this._arcadeOnDemand??=await z(),this._arcadeOnDemand}async _rendererUsesFieldsRequiringArcadeTypeConversion(e){let{fieldsIndex:t}=this.layer;return t!=null&&(await e.getRequiredFields(t)).some(e=>{switch(t.get(e)?.type){case`date`:case`date-only`:case`time-only`:case`timestamp-offset`:return!0;default:return!1}})}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererRequiresHydratedGraphic=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;let n=this.symbolCreationContext.renderer;if(e===n)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),e==null){this.symbolCreationContext.renderer=null,this.recreateAllGraphicsAndSymbols();return}let r=b(n,e);this._updateUnchangedSymbolMappings(r,e,n),this.symbolCreationContext.renderer=e,r!=null&&(r.type===`complete`?this.recreateAllGraphicsAndSymbols():r.type===`partial`&&(this._applyRendererDiff(r,e,n)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange(`averageSymbolComplexity`))}_diffHasSymbolChange(e){for(let t in e.diff)switch(t){case`visualVariables`:case`defaultSymbol`:case`uniqueValueInfos`:break;case`uniqueValueGroups`:case`authoringInfo`:case`fieldDelimiter`:delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,n){e||=[],t||=[];let r=[];for(let i of t){let t=this._graphicsBySymbol.get(i.id);t&&t.forEach((a,o)=>{let s=a.graphic,c=this.layer instanceof pe?this.layer:null,l=this._arcadeOnDemand;if(i===n.defaultSymbol&&n.getSymbol(N(s,c,null),{arcade:l})===n.defaultSymbol)return;e.length||n.defaultSymbol?r.push(s):this._graphicsWithoutSymbol.set(o,s);let u=this.graphics3DGraphics.get(o);this._conditionalRemove(u,o),a.destroy(),t.delete(o),this._removeGraphics3DGraphic(o,u),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(i.id))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach(e=>r.push(e)),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){let i=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(i||a){let o=a?.changed,s=a?.unchanged;if(o&&s&&o.some(e=>s.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;let c=a?a.added.map(e=>e.symbol).filter(n):[],l=a?a.removed.map(e=>e.symbol).filter(n):[];if(o)for(let e=0;e<o.length;e++)c.push(o[e].newValue.symbol),l.push(o[e].oldValue.symbol);return i?(r.defaultSymbol&&l.push(r.defaultSymbol),t.defaultSymbol&&c.push(t.defaultSymbol)):r.defaultSymbol&&c.length&&l.push(t.defaultSymbol),this._applySymbolSetDiff(c,l,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,n){if(t?.type!==`unique-value`||n?.type!==`unique-value`||e!=null&&e.type!==`partial`)return[];let r=e=>e==null?null:e.id,i=e&&e.diff,a=i?.defaultSymbol,o=i&&i.uniqueValueInfos,s;if(o)s=o.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{s=[];for(let e of n.uniqueValueInfos??[]){let n=r(e.symbol),i=t.uniqueValueInfos?.find(t=>t.value===e.value);i&&n!==r(i.symbol)&&s.push({oldId:n,newId:r(i.symbol)})}}return!a&&n.defaultSymbol&&s.push({oldId:r(n.defaultSymbol),newId:r(t.defaultSymbol)}),s}_updateSymbolMapping(e,t){let n=t!=null&&t?typeof t==`string`?t:t.id:null;if(e==null||e===n)return;let r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),r!==void 0&&this._graphicsBySymbol.set(n,r);let i=this._symbols.get(e);if(i!==void 0&&(this._symbols.delete(e),this._symbols.set(n,i),this._symbolMaterials=null,i!=null)){let e=typeof t==`string`?null:t;e==null?i.symbol.id=n:i.symbol=e}}_updateUnchangedSymbolMappings(e,t,n){let r=this._calculateUnchangedSymbolMapping(e,t,n);for(let{oldId:e,newId:t}of r)this._updateSymbolMapping(e,t)}_applyRendererDiff(e,t,n){if(this._diffHasSymbolChange(e))return!1;if(t instanceof P&&n instanceof P&&this._applyUniqueValueRendererDiff(e,t,n)&&Object.keys(e.diff).length===0)return!0;for(let n of this._graphicsBySymbol.keys()){let r=this._symbols.get(n);if(r!=null)switch(r.applyRendererDiff(e,t)){case 0:this._recreateSymbol(n);break;case 1:this._recreateGraphicsForSymbol(n)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`opacity`,t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`screenSizePerspectiveEnabled`,t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`slicePlaneEnabled`,t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`physicalBasedRenderingEnabled`,t)||this._recreateSymbol(n)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`skipHighSymbolLods`,t)||this._recreateSymbol(n)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`pixelRatio`,t)||this._recreateSymbol(n)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=v(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){let n=this.symbolCreationContext.clippingExtent,r=ue();return Ne(e,r,t)?this.symbolCreationContext.clippingExtent=ce(k(),r):this.symbolCreationContext.clippingExtent=null,!le(this.symbolCreationContext.clippingExtent,n)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(n=>{e(n)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(let[t,n]of this._symbols){if(n==null)return;e(n,this._graphicsBySymbol.get(t)||Ke,t)}if(!t?.excludeUnused)for(let t of this._unusedSymbolsCache)e(t,void 0,t.symbol.id)}updateGraphicsVisibilities(){this._filterVisibility!=null&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{let t=this._updateUserVisibility(e),n=!!this._scaleVisibility?.updateVisibility(e);return t||n})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){let t=()=>`'${this.layer.title?`${this.layer.title}, `:``}id:${this.layer.id}'`,n=I(e,{geometryType:this.layer?.geometryType,logWarning:(e,n)=>i.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${n}`)});if(n){let e=`Renderer for layer ${t} is not supported in a SceneView`;i.getLogger(this).warn(e,n.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,n)=>{if(t==null||t.referenced>0)return;let r=this._graphicsBySymbol.get(n);r&&r.size!==0||(this._graphicsBySymbol.delete(n),this._symbols.delete(n),this._symbolMaterials=null,this._unusedSymbolsCache.put(n,t,l),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange(`averageSymbolComplexity`))}get test(){}get performanceInfo(){return new Ee(this.graphics3DGraphics.size,this.graphics3DGraphics.values().reduce((e,t)=>e+ +!!t.isVisible(),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([y({readOnly:!0})],X.prototype,`computedExtent`,void 0),e([y()],X.prototype,`currentRenderer`,void 0),e([y()],X.prototype,`rendererRequiresHydratedGraphic`,void 0),e([y()],X.prototype,`_frameTaskHandle`,void 0),e([y()],X.prototype,`_dataUpdateQueue`,void 0),e([y()],X.prototype,`_updateQueue`,void 0),e([y({readOnly:!0})],X.prototype,`_viewSpatialReference`,null),e([y()],X.prototype,`_rendererChangeAbortController`,void 0),e([y()],X.prototype,`_elevationInfoChangeAbortController`,void 0),e([y()],X.prototype,`_initializeAbortController`,void 0),e([y()],X.prototype,`_elevationAlignment`,void 0),e([y()],X.prototype,`_scaleVisibility`,void 0),e([y()],X.prototype,`_filterVisibility`,void 0),e([y()],X.prototype,`_initializePromise`,void 0),e([y()],X.prototype,`_spatialIndex`,void 0),e([y({readOnly:!0})],X.prototype,`extentPadding`,void 0),e([y()],X.prototype,`_updatingPendingLoadedGraphicsChange`,void 0),e([y()],X.prototype,`_featureStore`,void 0),e([y()],X.prototype,`_objectStates`,void 0),e([y()],X.prototype,`_loadingSymbols`,void 0),e([y({constructOnly:!0})],X.prototype,`compressionTracker`,void 0),e([y()],X.prototype,`preferredUpdatePolicy`,void 0),e([y()],X.prototype,`_forcedUpdatePolicy`,void 0),e([y({readOnly:!0})],X.prototype,`effectiveUpdatePolicy`,null),e([y({constructOnly:!0})],X.prototype,`elevationFeatureExpressionEnabled`,void 0),e([y({constructOnly:!0})],X.prototype,`owner`,void 0),e([y({constructOnly:!0})],X.prototype,`layer`,void 0),e([y({constructOnly:!0})],X.prototype,`graphicSymbolSupported`,void 0),e([y({constructOnly:!0})],X.prototype,`getRenderingInfoWithoutRenderer`,void 0),e([y({constructOnly:!0})],X.prototype,`componentFactories`,void 0),e([y({constructOnly:!0})],X.prototype,`setUidToIdOnAdd`,void 0),e([y({constructOnly:!0})],X.prototype,`reportGraphicSourceMemory`,void 0),e([y()],X.prototype,`featureStore`,null),e([y()],X.prototype,`initializePromise`,null),e([y()],X.prototype,`scaleVisibility`,null),e([y()],X.prototype,`elevationAlignment`,null),e([y()],X.prototype,`objectStates`,null),e([y()],X.prototype,`filterVisibility`,null),e([y({readOnly:!0})],X.prototype,`updating`,null),e([y({readOnly:!0})],X.prototype,`dataUpdating`,null),e([y({readOnly:!0})],X.prototype,`readyToRun`,null),e([y({readOnly:!0})],X.prototype,`suspendedOrOutsideOfView`,null),e([y({readOnly:!0})],X.prototype,`updatingRemaining`,null),e([y({readOnly:!0})],X.prototype,`displayFeatureLimit`,null),e([y({readOnly:!0})],X.prototype,`averageSymbolComplexity`,null),e([y({constructOnly:!0})],X.prototype,`hasZ`,void 0),e([y({constructOnly:!0})],X.prototype,`hasM`,void 0),e([y()],X.prototype,`_objectIdField`,null),X=J=e([ne(`esri.views.3d.layers.graphics.Graphics3DCore`)],X);class Z{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const Ge=10,Q=T(),$=T(),Ke=new Map;export{X as Graphics3DCore};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as n}from"../../../../core/arrayUtils.js";import r from"../../../../core/Error.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{findInMap as a}from"../../../../core/MapUtils.js";import{abortMaybe as o,removeMaybe as s,destroyMaybe as c}from"../../../../core/maybe.js";import{MinPriority as l}from"../../../../core/MemCache.js";import u from"../../../../core/PooledArray.js";import{throwIfAborted as d,ignoreAbortErrors as f,isAbortError as p}from"../../../../core/promiseUtils.js";import m from"../../../../core/Queue.js";import{when as h,watch as g,on as ee,syncAndInitial as te,whenOnce as _}from"../../../../core/reactiveUtils.js";import{schedule as v}from"../../../../core/scheduling.js";import{property as y,subclass as ne}from"../../../../core/accessorSupport/decorators.js";import{diff as b,isEmpty as re}from"../../../../core/accessorSupport/diffUtils.js";import{runUntracked as x}from"../../../../core/accessorSupport/tracking.js";import{set as S,add as C,scale as w}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as T}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import ie from"../../../../geometry/Extent.js";import ae from"../../../../geometry/Point.js";import{canProjectWithoutEngine as oe}from"../../../../geometry/projectionUtils.js";import{projectBuffer as E}from"../../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as D}from"../../../../geometry/projection/projectVectorToVector.js";import{projectXYZToVector as O}from"../../../../geometry/projection/projectXYZToVector.js";import{center as se,fromRect as ce,create as k,equals as le}from"../../../../geometry/support/aaBoundingBox.js";import{create as ue}from"../../../../geometry/support/aaBoundingRect.js";import{equals as de}from"../../../../geometry/support/spatialReferenceUtils.js";import{isPopupProvider as fe}from"../../../../graphic/getPopupProvider.js";import pe from"../../../../layers/Layer.js";import{getObjectId as A,computeAABB as j,hasGeometry as M}from"../../../../layers/graphics/dehydratedFeatures.js";import{hydrateGraphic as N}from"../../../../layers/graphics/hydratedFeatures.js";import P from"../../../../renderers/UniqueValueRenderer.js";import{isSupportedRenderer3D as F,validateTo3D as I}from"../../../../renderers/support/rendererConversion.js";import{RenderingInfo as L}from"../../../../renderers/support/RenderingInfo.js";import{isBasemapLayerView as R}from"../../../../support/basemapUtils.js";import{loadArcade as z}from"../../../../support/loadArcade.js";import B from"../../../../symbols/LabelSymbol3D.js";import me from"../../../../symbols/TextSymbol.js";import he from"../../../../symbols/WebStyleSymbol.js";import{getDefaultSymbol3D as ge}from"../../../../symbols/support/defaults3D.js";import{to3D as V}from"../../../../symbols/support/symbolConversion.js";import{aggregateSymbolComplexity as _e,defaultSymbolComplexity as ve}from"./defaultSymbolComplexity.js";import{DisplayFeatureLimit as ye}from"./DisplayFeatureLimit.js";import{ViewElevationProvider as be}from"./ElevationQuery.js";import{extractExpressionInfo as H,createContext as U}from"./featureExpressionInfoUtils.js";import{Graphics3DFeatureStore as xe}from"./Graphics3DFeatureStore.js";import{Graphics3DGraphicCreationContext as Se}from"./Graphics3DGraphicCreationContext.js";import{Graphics3DSymbolCreationContext as Ce}from"./Graphics3DSymbolCreationContext.js";import{make as we}from"./Graphics3DSymbolFactory.js";import{Graphics3DWebStyleSymbol as Te}from"./Graphics3DWebStyleSymbol.js";import{GraphicsCorePerformanceInfo as Ee}from"./GraphicsCorePerformanceInfo.js";import{GraphicStateTracking as De}from"./GraphicStateTracking.js";import{computeCentroid as Oe}from"./graphicUtils.js";import{placePointOnGeometry as ke}from"./pointUtils.js";import{SpatialIndex2D as Ae}from"./SpatialIndex2D.js";import{AggregateSymbolComplexity as je}from"./SymbolComplexity.js";import{StageLayerElevationProvider as Me}from"../support/StageLayerElevationProvider.js";import{toBoundingRect as Ne}from"../../support/extentUtils.js";import{affectsGeometry as Pe}from"../../webgl-engine/lib/affectsGeometry.js";import{GridLocalOriginFactory as Fe}from"../../webgl-engine/lib/GridLocalOriginFactory.js";import{isScreenSizePerspectiveEnabled as W}from"../../webgl-engine/lib/screenSizePerspectiveUtils.js";import{WebGLLayer as Ie}from"../../webgl-engine/lib/WebGLLayer.js";import{HUDMaterial as Le}from"../../webgl-engine/materials/HUDMaterial.js";import{hasPopupTemplate as Re}from"../../../layers/support/popupUtils.js";import{PromiseQueue as G}from"../../../support/PromiseQueue.js";import{PropertiesPool as ze}from"../../../support/PropertiesPool.js";import{ImmediateTask as K,noBudget as Be,TaskPriority as Ve}from"../../../support/Scheduler.js";import{TextureCompressionTracker as He}from"../../../support/TextureCompressionTracker.js";import{Yield as Ue}from"../../../support/Yield.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";var J;const Y=T(),We=k();let X=class extends t{static{J=this}static{this.tmpVec=T()}get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){return this._spatialIndex||(this._spatialIndex=new Ae({objectIdField:this.owner.layer?.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get deconflictor(){return this._deconflictor}get labeler(){return this._labeler}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return this.currentRenderer!=null&&this.currentRenderer.type===`dictionary`?0:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){return!!(this.dataUpdating||this._elevationAlignment?.updating||this._scaleVisibility?.updating||this._filterVisibility?.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._frameTaskHandle.updating||this._updateQueue.updating||this.readyToRun)}get dataUpdating(){return!!(this._graphicsWaitingForSymbol.size>0||this._pendingUpdates.size>0||this._spatialIndex?.updating||this._updatingPendingLoadedGraphicsChange||this._dataUpdateQueue.updating||this._loadingSymbols>0||this.compressionTracker.compressing)}get readyToRun(){return this._pendingUpdates.size>0||!!this._spatialIndex?.updating||this._dataUpdateQueue.readyToRun||this._updateQueue.readyToRun||this._focusAreasGraphicsQueue.length>0}get suspendedOrOutsideOfView(){return this.owner.suspended||!!this.owner.suspendInfo?.outsideOfView}get updatingRemaining(){return x(()=>this.updating?this._pendingUpdates.size+(this._spatialIndex?.updatingRemaining||0)*.1+(this._elevationAlignment?.updatingRemaining||0)*.1:0)}get displayFeatureLimit(){let e=this.owner&&this.owner.view&&this.owner.view.qualitySettings,t=e?.graphics3D.minTotalNumberOfFeatures??0,n=e?.graphics3D.maxTotalNumberOfFeatures??0,r=e?.graphics3D.maxNumberOfDrawCalls??0,i=e?.graphics3D.maxTotalNumberOfVertices??0,a=this.averageSymbolComplexity,o=Math.max(1,a?.verticesPerFeature??1),s=a&&a.drawCallsPerFeature>0&&r>0?r/a.drawCallsPerFeature:n,c=Math.ceil(i/o),l=Math.max(t,Math.min(n,c,s)),u=this._get(`displayFeatureLimit`);return u&&u.maximumTotalNumberOfVertices===i&&u.averageSymbolComplexity===a&&u.maximumNumberOfFeatures===l?u:new ye(i,l,a)}get averageSymbolComplexity(){return x(()=>{let e=this._averageSymbolComplexities,t=this._get(`averageSymbolComplexity`);return e.numComplexities===0||t!=null&&(e.estimated&&(t.verticesPerFeature>=e.verticesPerFeature||t.verticesPerCoordinate>=e.verticesPerCoordinate||t.drawCallsPerFeature>=e.drawCallsPerFeature)||t.verticesPerFeature===e.verticesPerFeature&&t.verticesPerCoordinate===e.verticesPerCoordinate&&t.drawCallsPerFeature===e.drawCallsPerFeature)?t:e})}get _averageSymbolComplexities(){let e=this._totalSymbolComplexities;return e.numComplexities>0&&(e.verticesPerFeature/=e.numComplexities,e.verticesPerCoordinate/=e.numComplexities,e.drawCallsPerFeature/=e.numComplexities,e.memory.bytesPerFeature/=e.numComplexities,e.memory.bytesPerFeatureLabel/=e.numComplexities,e.memory.resourceBytes/=e.numComplexities,e.memory.draped.bytesPerFeature/=e.numComplexities,e.memory.draped.bytesPerFeatureLabel/=e.numComplexities),e}get _totalSymbolComplexities(){let e=new je;return this._forEachSymbolComplexity(t=>_e(t,e)),e}get usedMemory(){let e=this.labelsEnabled?(this.averageSymbolComplexity?.memory.bytesPerFeatureLabel??0)*this._numberOfGraphics:0,t=0;if(this._forEachSymbolComplexityUsed(e=>t+=e?.memory.resourceBytes??0),this._symbolMaterials==null){this._symbolMaterials=[];for(let e of this._symbols.values())if(e!=null){for(let t of e.symbolLayers)if(t)for(let e of t.materials)e&&this._symbolMaterials.push(e)}}let n=this.owner.view.stage.renderer,r=this.owner.view.overlayManager.renderer,i=this._symbolMaterials.reduce((e,t)=>e+((n.getMaterialRenderer(t)||r.getMaterialRenderer(t))?.usedMemory??0),0);return this._usedMemory+e+t+i}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){let e=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*e}if(this.averageSymbolComplexity!=null){let e=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+e}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}_forEachSymbolComplexity(e){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(e):this._forEachSymbolComplexityUsed(e)}get visible(){return this._visible}_getConvertedSymbol(e){let t=e;if(t.type===`web-style`)return t.clone();let n=this._symbolConversionCache.get(t.id);if(n!=null)return n;let r=V(t,{geometryType:this.layer?.geometryType??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t),cimFallbackEnabled:!0}),a=r.symbol||null;return a==null&&r.error&&i.getLogger(this).error(r.error.message),this._symbolConversionCache.set(t.id,a),a}_getSymbolComplexitiesUsedOrRenderer(e){let t=this.currentRenderer;if(t==null)return;let n=t.symbols,r=`backgroundFillSymbol`in t?t.backgroundFillSymbol:null;if(!r&&!n.length)return;let i=this._getSymbolComplexityUsedOrRenderer(r);i!=null&&e(i);for(let t of n){let n=this._getSymbolComplexityUsedOrRenderer(t);n!=null&&e(n)}}_getSymbolComplexityUsedOrRenderer(e){if(e==null)return null;let t=this._symbols.get(e.id);if(t!=null)return t.complexity;let n=this._getConvertedSymbol(e);return n==null?null:ve(n)}_forEachSymbolComplexityUsed(e){this._symbols.forEach(t=>{e(t?.complexity)})}get _objectIdField(){return this.layer.objectIdField}constructor(e){super(e),this._propertiesPool=new ze({computedExtent:()=>new ie},this),this.computedExtent=null,this.currentRenderer=null,this.rendererRequiresHydratedGraphic=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTaskHandle=K,this._dataUpdateQueue=new G,this._updateQueue=new G,this._focusAreasGraphicsQueue=new m,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._elevationAlignment=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this.compressionTracker=new He,this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new u,this.preferredUpdatePolicy=1,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.reportGraphicSourceMemory=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this._notifyMemoryChange=e=>{this._usedMemory+=e},this._unusedSymbolsCache=e.owner.view.resourceController.memoryController.newCache(`graphics-3d-unused-symbols`,e=>e.destroy()),this.symbolCreationContext=new Ce(e.owner.view.resourceController.scheduler,(e,t)=>this._updateQueue.push(e,t),e.owner.layerViewUid,this.compressionTracker)}initialize(){this._featureStore=new xe({objectIdField:this.owner.layer?.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:e=>this.graphics3DGraphics.forEach(e)});let e=(e,t,n)=>this.spatialIndex.queryGraphicUIDsInExtent(e,t,n),{componentFactories:t}=this;this._elevationAlignment=t.elevationAlignment?.(this,e),this._scaleVisibility=t.scaleVisibility?.(this,e),this._filterVisibility=t.filterVisibility?.({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e(A(t.graphic,this._objectIdField)))),setAllFeaturesVisibility:e=>this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(1,4,e)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,4,!0))}),this._deconflictor=t.deconflictor?.(this),this._labeler=t.labeler?.(this,this._scaleVisibility),this._objectStates=t.objectStates?.(this),this._initializeAbortController=new AbortController,this.addHandles(h(()=>this.owner.view.state.highlights,()=>{let{highlightOrderMap:e}=this.owner.view.state;this.graphics3DGraphics.forEach(t=>t.updateHighlights(e))})),this._initializePromise=this._initializeAsync()}async _initializeAsync(){let e=this._initializeAbortController?.signal,t=this.owner.view;this._viewElevationProvider=new be(this._viewSpatialReference,t),this._initializeStage(t,this.owner.layerViewUid);let n=t.sharedSymbolResources;this.symbolCreationContext.sharedResources=n,this.currentRenderer!=null&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.renderCoordsHelper=t.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new Fe(t.renderSpatialReference),this.symbolCreationContext.elevationProvider=t.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=e=>this.notifyGraphicGeometryChanged(e),this.symbolCreationContext.notifyGraphicVisibilityChanged=e=>this.notifyGraphicVisibilityChanged(e),this.symbolCreationContext.focusAreaStyle=t.map?.focusAreas.style??null;let r=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await U(r,this._viewSpatialReference,e,i.getLogger(this)),d(e),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,this.symbolCreationContext.skipHighSymbolLods=!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,`drapeSourceType`in this.owner){let{owner:e}=this;this.symbolCreationContext.drapeSourceRenderer=t.overlayManager.registerGeometryDrapeSource(e)}this.addHandles([g(()=>this.suspendedOrOutsideOfView,()=>this._updateQueue.unshift(()=>this._updateLayerVisibility(),null).catch(f)),g(()=>W(this.layer?.screenSizePerspectiveEnabled),e=>{e!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=e,this._screenSizePerspectiveEnabledChange())}),g(()=>this.owner.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(!!e)),g(()=>this.owner.view.state?.rasterPixelRatio,()=>this._pixelRatioChange()),g(()=>!!this.owner.view.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._physicalBasedRenderingChange(e)),g(()=>!!this.owner.view.qualitySettings?.graphics3D?.skipHighSymbolLods,e=>this._skipHighSymbolLoDsChange(e)),g(()=>this.owner.view.focusAreasView?.polygons,()=>this._updateFocusedLabels()),g(()=>this.owner.view.timeZone,()=>{this.currentRenderer?.arcadeRequired&&this.recreateAllGraphics()}),g(()=>this.owner.view.map?.focusAreas.style,e=>{this.symbolCreationContext.focusAreaStyle=e??null,this.recreateAllGraphicsAndSymbols()}),h(()=>t.basemapTerrain?.tilingScheme,e=>{let n=t.groundView?.spatialReference;!e.spatialReference.equals(this.symbolCreationContext.overlaySR)&&n!=null&&(this.symbolCreationContext.overlaySR=n),this.hasHandles(`loaded-graphics`)?this.recreateAllGraphics():this.addHandles([ee(()=>this.owner?.loadedGraphics,`change`,e=>{this._graphicsCollectionChanged(e),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],`loaded-graphics`)},{initial:!0}),g(()=>this.effectiveUpdatePolicy,e=>{this.stageLayer!=null&&(this.stageLayer.updatePolicy=e),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===0,e===1&&this.runTask(Be)},te)]),this._frameTaskHandle=t.resourceController.scheduler.registerTask(Ve.GRAPHICS_CORE,this),this.layer&&`featureReduction`in this.layer&&this.addHandles(g(()=>this.layer.featureReduction,()=>this._deconflictor?.featureReductionChange())),this.notifyChange(`averageSymbolComplexity`),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController=o(this._initializeAbortController)}_updateFocusedLabels(){this._focusAreasGraphicsQueue.clear(),this.forEachGraphics3DSymbol((e,t)=>{t&&e.needsUpdateFocus&&t.forEach(e=>{this._focusAreasGraphicsQueue.push(e)})})}destroy(){if(this._unusedSymbolsCache.destroy(),this._abortInitialize(),this._rendererChangeAbortController=o(this._rendererChangeAbortController),this._abortElevationInfoChange(),this._frameTaskHandle.remove(),this._frameTaskHandle=K,this._dataUpdateQueue.cancelAll(),this._updateQueue.cancelAll(),this._deconflictor=s(this._deconflictor),this._labeler=s(this._labeler),this._elevationAlignment=c(this._elevationAlignment),this._scaleVisibility=c(this._scaleVisibility),this._filterVisibility=c(this._filterVisibility),this._objectStates=c(this._objectStates),this.clear(),`drapeSourceType`in this.owner){let{owner:e}=this;this.stage.view.overlayManager.unregisterDrapeSource(e)}this._featureStore=c(this._featureStore),this._updatingPendingLoadedGraphicsChange=s(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=c(this._graphicStateTracking),this.stage&&=(this.stageLayer=c(this.stageLayer),null),this._set(`owner`,null);for(let e in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[e].reject(new r(`graphic:layer-destroyed`,`Layer has been destroyed`));this._whenGraphics3DGraphicRequests=null,this._propertiesPool=c(this._propertiesPool),this._whenSymbolRemoved.prune(),this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=c(this._spatialIndex),this._symbolMaterials=null}clear(){this._objectStates?.allGraphicsDeleted(),this._graphicStateTracking!=null&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(e=>e.destroy()),this._spatialIndex?.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(c),this._symbols.clear(),this._symbolMaterials&&=(this._symbolMaterials.length=0,null),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange(`dataUpdating`),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}_initializeStage(e,t){this.stage=e.stage,this.stageLayer=new Ie(this.stage,{visible:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},t);let n=this.stageLayer.events;n.on(`transformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`shaderTransformationChanged`,e=>this.notifyGraphicGeometryChanged(e.graphicUid)),n.on(`visibilityChanged`,e=>this.notifyGraphicVisibilityChanged(e.graphicUid)),n.on(`geometriesChanged`,e=>this.notifyGraphicGeometryChanged(e.object.graphicUid)),n.on(`attributesChanged`,e=>Pe(e.attribute)&&this.notifyGraphicGeometryChanged(e.object.graphicUid))}notifyGraphicGeometryChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicGeometry(t)}notifyGraphicVisibilityChanged(e){if(this.owner.notifyContentGeometryUpdate?.(),this._graphicStateTracking==null||e==null)return;let t=this.graphics3DGraphics.get(e);t&&this._graphicStateTracking.updateGraphicVisibility(t)}_updateLayerVisibility(){let e=this.displayFeatureLimit.maximumNumberOfFeatures,t=this._numberOfGraphics>e*Ge,n=!this.suspendedOrOutsideOfView&&!t;n!==this._visible&&(this._visible=n,this._updateStageLayerVisibility())}_updateStageLayerVisibility(){let e=this._visible&&(this.layer.opacity==null||this.layer.opacity>=q);this.stageLayer.visible!==e&&(this.stageLayer.visible=e,e?this.updateGraphicsVisibilities():this._hideAllGraphics(),this.owner.notifyContentGeometryUpdate?.())}getGraphics3DGraphicById(e){return e==null?void 0:this.graphics3DGraphics.get(e)}getGraphics3DGraphicByObjectId(e){return this.owner.layer?.objectIdField?this._findGraphics3DGraphicByObjectId(e):null}_getGraphicObjectID(e,t=this.owner.layer?.objectIdField){return A(e,t)}get graphics3DGraphicsByObjectID(){let e=this.owner.layer?.objectIdField;if(!e)return;let t=new Map;return this.graphics3DGraphics.forEach(n=>{if(!n)return;let r=n.graphic,i=this._getGraphicObjectID(r,e);i!=null&&t.set(i,n)}),t}get labelsEnabled(){return!!this._labeler?.layerLabelsEnabled()}async updateLabelingInfo(e){let t=this._deconflictor?.labelingInfoChange(e),n=this._labeler?.labelingInfoChange(e);await Promise.allSettled([t,n])}updateVisibilityInfo(){this._deconflictor?.labelingInfoChange(),this._labeler?.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return`unknown`;let e=!1,t=!1;for(let[n,r]of this._symbols)if(r!=null)switch(r.getFastUpdateStatus()){case 3:return`unknown`;case 1:this._graphicsBySymbol.has(n)&&(t=!0);break;case 0:this._graphicsBySymbol.has(n)&&(e=!0);break;case 2:this._graphicsBySymbol.has(n)&&(t=e=!0)}return t?e?`mixed`:`fast`:e?`slow`:`mixed`}runTask(e){if(this._dataUpdateQueue.runTask(e),this._updateQueue.runTask(e),this._applyPendingUpdates(e),this._applyFocusAreasUpdates(e),this.notifyChange(`readyToRun`),this.readyToRun||this.notifyChange(`dataUpdating`),this.notifyChange(`updatingRemaining`),!e.hasProgressed)return Ue}setObjectIdVisibility(e,t){t?this._objectIdInvisibleSet.delete(e):this._objectIdInvisibleSet.add(e);let n=this._findGraphics3DGraphicByObjectId(e);n!=null&&this._updateUserVisibility(n)}_findGraphics3DGraphicByObjectId(e){return a(this.graphics3DGraphics,t=>this._getGraphicObjectID(t.graphic)===e)}_updateUserVisibility(e){if(e==null)return!1;let t=e.graphic,n=this._getGraphicObjectID(t),r=t.visible&&!this.owner.suspended&&this.stageLayer.visible&&(n==null||!this._objectIdInvisibleSet.has(n));return e.setVisibilityFlag(1,1,r)}_whenGraphics3DGraphic(e){let t=this.graphics3DGraphics.get(e.uid);if(t)return Promise.resolve(t);let n=this._whenGraphics3DGraphicRequests[e.uid];if(n)return n.promise;let r=Promise.withResolvers();return this._whenGraphics3DGraphicRequests[e.uid]=r,r.promise}async _boundsForGraphics3DGraphic(e,t){let n=this._viewSpatialReference,r=this.owner.view.renderSpatialReference,i=this.owner.view.groundView.spatialReference,a=(e,t,i)=>E(e,r,t,e,n,t,i),o=(e,t,r)=>E(e,i,t,e,n,t,r),s=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:t!=null&&!!t.useViewElevation,minDemResolution:t==null?null:t.minDemResolution,minDemResolutionForPoints:this.owner.view.resolution}:null,c=await e.getProjectedBoundingBox(a,o,s,t?.signal);if(!c)return null;let l=c.boundingBox;if(c.requiresDrapedElevation){let e=this.symbolCreationContext.elevationProvider;if(e){se(l,Y);let t=e.getElevation(Y[0],Y[1],0,n,`ground`)??0;l[2]=Math.min(l[2],t),l[5]=Math.max(l[5],t)}}return{boundingBox:l,screenSpaceObjects:c.screenSpaceObjects}}async whenGraphicBounds(e,t){await _(()=>this.owner?.loadedGraphics);let n=this.owner.layer?.objectIdField,i=this.owner.loadedGraphics.find(t=>t===e||n!=null&&t.attributes!=null&&e.attributes&&t.attributes[n]===e.attributes[n]);if(!i)throw new r(`internal:graphic-not-part-of-view`,`Graphic is not part of this view`);let a=await this._whenGraphics3DGraphic(i);return this._boundsForGraphics3DGraphic(a,t)}computeAttachmentOrigin(e,t){let n=this.graphics3DGraphics.get(e.uid);if(!n)return null;let r=n.computeAttachmentOrigin();if(r.render.num===0&&r.draped.num===0)return null;S(Q,0,0,0);let i=0;if(r.render.num>0){if(!D(r.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,$,t))return null;C(Q,Q,$),i++}if(r.draped.num>0){let[e,n]=r.draped.origin,a=this.owner.view.groundView.spatialReference,o=this.owner.view.elevationProvider.getElevation(e,n,0,a,`ground`)??0;if(S($,e,n,o),!D($,a,$,t))return null;C(Q,Q,$),i++}return i>1&&w(Q,Q,1/i),new ae({x:Q[0],y:Q[1],z:Q[2],spatialReference:t})}getSymbolLayerSize(e,t){let n=this._symbols.get(e.id);if(n==null)throw new r(`internal:symbol-not-part-of-view`,`Symbol is not part of this view`);let i=e.symbolLayers.indexOf(t);if(i===-1)throw new r(`internal:missing-symbol-layer`,`Symbol layer is not in symbol`);let a=n.getSymbolLayerSize(i);if(a==null)throw new r(`internal:missing-size`,`Symbol layer has no valid size`);return a}_graphicsCollectionChanged(e){this._startCreateGraphics&&(this.add(e.added),this.remove(e.removed))}graphicUpdateHandler(e){let t=e.graphic.uid,n=this.graphics3DGraphics.get(t);if(n!=null||this._graphicsWithoutSymbol.get(t)!=null){switch(e.property){case`visible`:this._graphicUpdateVisibleHandler(n);break;case`geometry`:this._graphicUpdateGeometryHandler(n,e.graphic);break;case`symbol`:this._graphicUpdateSymbolHandler(n,e);break;case`attributes`:this.symbolCreationContext.featureExpressionInfoContext?.arcade?this._graphicUpdateGeometryHandler(n,e.graphic):n?.updateAttributes();break;case`popupTemplate`:break;case`origin-transform`:this._graphicUpdateTransformHandler(n,e)}this.owner.notifyContentGeometryUpdate?.()}}_graphicUpdateGeometryHandler(e,t){this._graphicUpdateGeometryOrTransformHandler(e,t,()=>e!=null&&e.updateGeometry()&&(this._labeler?.updateGraphicGeometry(e)??!0)?(this._labeler?.setDirty(),this._deconflictor?.setDirty(),!0):!1);let n=t.geometry;n!=null&&this._expandComputedExtent(n)}_graphicUpdateTransformHandler(e,t){let n=t.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(e,t.graphic,()=>t.newValue!=null&&e!=null&&n!=null&&e.graphics3DSymbol.updateTransform(e,n.spatialReference,t.newValue,t.action))}_graphicUpdateGeometryOrTransformHandler(e,t,n){if(t.geometry==null)this._recreateGraphic(t);else if(e==null){let e=t.symbol?.id;if(e){let t=this._symbols.get(e);if(t!=null&&t.loadStatus===0)return}this._recreateGraphic(t)}else if(!n()){let n=this._deconflictor?.getState(e);this._recreateGraphic(t);let r=this.graphics3DGraphics.get(t.uid);r&&n!=null&&this._deconflictor?.setState(r,n)}}_graphicUpdateSymbolHandler(e,t){let n=t.graphic,r=e==null?t.oldValue==null?null:this._symbols.get(t.oldValue.id):e.graphics3DSymbol;if(r==null||t.newValue==null){this._recreateGraphic(n);return}let i=r.symbol,a=this._getConvertedSymbol(t.newValue);if(a!=null&&(a.type!==i.type||a.type===`web-style`)||i.type===`web-style`){this._recreateGraphic(n);return}let o=this._graphicsBySymbol.get(i.id);if(o&&o.size!==1){this._recreateGraphic(n);return}let s=b(i,a);if(s==null){this._updateSymbolMapping(i.id,a);return}let c={diff:s,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(r.prepareSymbolPatch(c),!re(c.diff)){this._recreateGraphic(n);return}let l=this._getRenderingInfo(n,!1);if(l==null){this._recreateGraphic(n);return}let u=r.extentPadding;for(let e of c.symbolStatePatches)e();if(u!==r.extentPadding&&this._recomputeExtentPadding(),e!=null)for(let t of c.graphics3DGraphicPatches)t(e,l);this._updateSymbolMapping(i.id,a)}_graphicUpdateVisibleHandler(e){this._updateUserVisibility(e)&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}recreateGraphics(e){this._suspendSymbolCleanup=!0,this.remove(e),this.add(e),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===1&&this._cleanupSymbols()}_recreateGraphic(e){this.recreateGraphics([e])}_beginGraphicUpdate(e){let t=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(e.uid,t),this._graphicsWaitingForSymbol.size===1&&this.notifyChange(`dataUpdating`),t}_endGraphicUpdate(e,t){e&&(t&&this._graphicStateTracking?.updateGraphicError(e,t),this._graphicsWaitingForSymbol.delete(e.uid),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`)))}_recomputeExtentPadding(){let e=0;this._symbols.forEach(t=>{t!=null&&(e=Math.max(e,t.extentPadding))}),this._set(`extentPadding`,e)}_expandComputedExtent(e){let t=We,n=e.spatialReference;j(e,t);let r=this._viewSpatialReference,i=J.tmpVec;if(de(n,r)||O(t[0],t[1],0,n,i,r)&&(t[0]=i[0],t[1]=i[1],O(t[3],t[4],0,n,i,r),t[3]=i[0],t[4]=i[1]),!isFinite(t[0])||!isFinite(t[3])||!isFinite(t[1])||!isFinite(t[4]))return;let a=this.computedExtent,o=null,s=isFinite(t[2])&&isFinite(t[5]),c=s&&(a?.zmin==null||t[2]<a.zmin),l=s&&(a?.zmax==null||t[5]>a.zmax);a?(t[0]<a.xmin||t[1]<a.ymin||t[3]>a.xmax||t[4]>a.ymax||c||l)&&(o=this._propertiesPool.get(`computedExtent`),o.xmin=Math.min(t[0],a.xmin),o.ymin=Math.min(t[1],a.ymin),o.xmax=Math.max(t[3],a.xmax),o.ymax=Math.max(t[4],a.ymax),o.spatialReference=r):(o=this._propertiesPool.get(`computedExtent`),o.xmin=t[0],o.ymin=t[1],o.xmax=t[3],o.ymax=t[4],o.spatialReference=r),o&&(c&&(o.zmin=t[2]),l&&(o.zmax=t[5]),this._set(`computedExtent`,o))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&=(this._elevationInfoChangeAbortController.abort(),null)}async elevationInfoChange(){this._abortElevationInfoChange();let e=new AbortController;this._elevationInfoChangeAbortController=e;let t=H(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await U(t,this._viewSpatialReference,e.signal,i.getLogger(this)),d(e.signal),this._elevationInfoChangeAbortController=null,this._labeler?.elevationInfoChange(),this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`elevationInfo`,t)?t?.forEach(e=>{let t=e.graphic,n=e.labelLayers;for(let e of n)e.graphics3DSymbolLayer.graphics3DGraphicLayerElevationInfoChanged(t,e)}):this._recreateSymbol(n)}),this.updateStageLayerElevationProvider(),this._elevationAlignment?.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo?.mode===`relative-to-scene`||this._numberOfGraphicsProvidingElevation===0)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=c(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&this.layer.elevationInfo.mode!==`relative-to-scene`)&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new Me({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register(2,this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){this.clear(),this._filterVisibility!=null&&this._filterVisibility.clear(),this._labeler?.reset(),this._deconflictor?.clear(),this._elevationAlignment?.clear(),this.stageLayer?.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&=(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),c(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(e=!1){if(!this._startCreateGraphics)return;let{loadedGraphics:t,view:n}=this.owner,r=n.basemapTerrain?.tilingScheme&&t?.length?t.toArray():null;(e||!r)&&this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=W(this.layer.screenSizePerspectiveEnabled),this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set(`computedExtent`,null),r&&(e?this.add(r):this.recreateGraphics(r))}_recreateSymbol(e){let t=this._graphicsBySymbol.get(e),n=[];t&&(t.forEach((e,t)=>{this._conditionalRemove(e,t),this._spatialIndex?.remove(e),n.push(e.graphic),e.destroy(),this._removeGraphics3DGraphic(t,e),this._updateLayerVisibility(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}),this._graphicsBySymbol.set(e,new Map));let r=this._symbols.get(e);c(r),this._symbols.delete(e),this._symbolMaterials=null,c(this._unusedSymbolsCache.pop(e)),this.add(n)}_recreateGraphicsForSymbol(e){let t=this._graphicsBySymbol.get(e);if(t){let e=[];t.forEach(t=>e.push(t.graphic)),this.recreateGraphics(e)}}_conditionalRemove(e,t){this._graphicsDrapedUids.delete(t),this._objectStates?.removeGraphic(e),this._labeler?.removeGraphic(e),this._deconflictor?.removeGraphic(e),this._graphicStateTracking!=null&&this._graphicStateTracking.removeGraphic(e)}add(e){e&&e.length!==0&&(this.owner.view.basemapTerrain?.tilingScheme?(this._updatePolicyForGraphics(e)===0?this._addDelayed(e):this._addImmediate(e),this.notifyChange(`dataUpdating`)):i.getLogger(this).error(`#add()`,`Cannot add graphics before terrain surface has been initialized`))}_updatePolicyForGraphics(e){if(this.effectiveUpdatePolicy===1&&(this.layer.geometryType===`mesh`||this.layer.geometryType==null)){for(let t of e)if(t.geometry!=null&&t.geometry.type===`mesh`&&!t.geometry.loaded)return 0}return this.effectiveUpdatePolicy}_addImmediate(e){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(let t of e)this._addGraphic(t,this._getRenderingInfo(t),1);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_addDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);n?n.add?n.state!==0&&n.abortController?.abort():this._pendingAdds++:(n=new Z,this._pendingAdds++,this._pendingUpdates.set(e,n)),n.add=t}this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}remove(e){this.effectiveUpdatePolicy===0?this._removeDelayed(e):this._removeImmediate(e),this.notifyChange(`dataUpdating`)}_removeImmediate(e){for(let t of e)this._removeGraphic(t);this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_removeDelayed(e){for(let t of e){let e=t.uid,n=this._pendingUpdates.get(e);if(n)n.add&&(n.remove?n.add=null:this._pendingUpdates.delete(e),n.state===1&&n.abortController?.abort(),this._pendingAdds--);else{let n=new Z;n.remove=t,this._pendingUpdates.set(e,n),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}this._pendingUpdates.size===0&&this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`updatingRemaining`),this.notifyChange(`dataUpdating`)}_finishPendingUpdates(){this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&i.getLogger(this).warn(`pendingAdds/Removes in inconsistent state!`),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyFocusAreasUpdates(e){for(;this._focusAreasGraphicsQueue.length>0&&!e.done;){e.madeProgress();let t=this._focusAreasGraphicsQueue.pop(),n=ke(t.graphic.geometry);if(n==null)continue;let r=this.stage.view.focusAreasView?.containsGeometry(n)??!0;t.layers.forEach(e=>{(e?.type===`object3d`||e?.type===`buffer`)&&e.stageObject.geometries.some(e=>e.material instanceof Le&&e.material.parameters.focusAreaStyle==null!==r)&&this.recreateGraphics([t.graphic])})}this._focusAreasGraphicsQueue.length===0&&this.notifyChange(`readyToRun`)}_applyPendingUpdates(e){if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,this._pendingUpdates.size===0&&this._spatialIndex?.updating)this._spatialIndex.update(),e.madeProgress();else{if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(let[t,n]of this._pendingUpdates){if(e.done){this._applyPendingRemovesFirst=!0;break}if(n.remove&&!n.add&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,this._pendingUpdates.delete(t),this._pendingRemoves===0))break}}for(let[t,n]of this._pendingUpdates){if(e.done)break;n.add&&n.state===0&&this._processPendingUpdateNew(n);let r=this.effectiveUpdatePolicy;if(n.remove&&(!n.add||n.state===2)&&(this._pendingRemoves--,e.madeProgress(),this._removeGraphic(n.remove),n.remove=null,r=1),n.add)switch(n.state){case 2:this._addGraphic(n.add,n.renderingInfo,r),n.add=null,this._pendingAdds--,e.madeProgress();break;case 3:n.add=null,this._pendingAdds--}n.remove==null&&n.add==null&&this._pendingUpdates.delete(t)}this._pendingUpdates.size===0&&(this._finishPendingUpdates(),this.notifyChange(`readyToRun`),this.notifyChange(`dataUpdating`))}}_processPendingUpdateNew(e){if(!e.add){e.state=2;return}let t=e.add.geometry;t!=null&&t.type===`mesh`&&!t.loaded?this._processPendingUpdateNewMesh(e,t):this._processPendingUpdateNewRenderingInfo(e)}async _processPendingUpdateNewMesh(e,t){e.state=1,e.abortController=new AbortController;let n=e.abortController.signal;try{await t.load({signal:n})}catch(t){return this._processPendingUpdateNewError(e,t)}e.abortController=null,this._processPendingUpdateNewRenderingInfo(e)}_processPendingUpdateNewError(e,t){e.abortController=null,e.state=p(t)?0:3}async _processPendingUpdateNewRenderingInfo(e){if(this.layer.renderer==null||this.layer.renderer.type!==`dictionary`){e.renderingInfo=this._getRenderingInfo(e.add),e.state=2;return}e.state=1,e.abortController=new AbortController;let t=null;try{t=await this._getRenderingInfoAsync(e.add,{signal:e.abortController.signal})}catch(t){e.abortController=null,e.state=p(t)?0:3;return}t?.symbol==null?(this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),e.renderingInfo=null):e.renderingInfo=t,e.state=2}_addGraphic(e,t,n){if(this._graphicsWithoutSymbol.set(e.uid,e),t?.symbol==null||!M(e))return;let r=this.stage.renderView.olidRenderHelper;if(r&&this.setUidToIdOnAdd){let t=R(this.owner.view,this.owner.layerViewUid);r.setUidToObjectAndLayerId(A(e,this._objectIdField),e.uid,this.layer.id,this.owner.layerViewUid,fe(this.layer)&&!!this.layer.popupEnabled&&!t&&Re(this.layer,this.owner.view.popup?.defaultPopupTemplateEnabled))}let i=t.symbol,a=this.getOrCreateGraphics3DSymbol(i,t.renderer);if(a==null)return;this._expandComputedExtent(e.geometry);let o=this._beginGraphicUpdate(e),s=new Se(e,t,this.layer,this.reportGraphicSourceMemory),c=!1,l=e=>{e===a.symbol.id&&(c=!0)};this._whenSymbolRemoved.push(l);let u=()=>{if(--this._loadingSymbols,!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(l),this._graphicsWaitingForSymbol.get(e.uid)===o&&!c&&!a.destroyed&&(!this.graphicSymbolSupported||!e.symbol||e.symbol.id===a.symbol.id)){let t=this._createGraphics3DGraphic(a,s);this._spatialIndex&&t!=null&&this._spatialIndex.add(t),--a.referenced,this._endGraphicUpdate(e)}else--a.referenced,this._cleanupSymbols();this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.(),this._labeler?.setDirty()}},d=t=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),c||(p(t)?this.add([e]):a.destroyed||this._endGraphicUpdate(e,t)))};++this._loadingSymbols,n===0?a.load(()=>this._dataUpdateQueue.push(u,null).catch(f),e=>this._dataUpdateQueue.push(()=>d(e),null).catch(f)):a.load(u,d)}_removeGraphic(e){let t=e.uid,n=this.graphics3DGraphics.get(t);if(n){n.graphics3DSymbol.onRemoveGraphic(n);let e=n.isElevationSource;this._conditionalRemove(n,t),this._spatialIndex?.remove(n);let r=n.graphics3DSymbol.symbol.id;this._graphicsBySymbol.get(r)?.delete(t),this._graphicsWithoutSymbol.delete(t),this._removeGraphics3DGraphic(t,n,e),n.destroy(),this._featureStore.events.emit(`changed`),this.owner.notifyContentGeometryUpdate?.()}else this._graphicsWithoutSymbol.delete(t),this._graphicsWaitingForSymbol.delete(t),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange(`dataUpdating`))}_hasLabelingContext(e){if(e instanceof B||e instanceof me){let t=this.symbolCreationContext.layer;return t.labelingInfo?t.labelingInfo.some(t=>t.symbol===e):!1}return!1}_hasValidSymbolCreationContext(e){return e instanceof B&&!this._hasLabelingContext(e)?(i.getLogger(this).error(`LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported.`),!1):!0}_getRenderingInfo(e,t=!0){let n=e.geometry;if(n==null)return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!oe(n.spatialReference,this._viewSpatialReference))return t&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let r=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e,a;if(this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||this.currentRenderer!=null))a=this.owner.getRenderingInfo(r,this.currentRenderer,this._arcadeOnDemand);else{let e=r.symbol||ge(r.geometry);a=new L(null,e)}return a?.symbol==null?(t&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):a}_getRenderingInfoAsync(e,t){if(e.geometry==null)return this._geometryWarningLogged||(this._geometryWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&e.symbol!=null)return this._symbolWarningLogged||(this._symbolWarningLogged=!0,i.getLogger(this).warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;let n=this.rendererRequiresHydratedGraphic?N(e,this.layer,null):e;return this.owner.getRenderingInfoAsync(n,this.currentRenderer,this._arcadeOnDemand,t)}_createGraphics3DSymbol(e,t){if(!this._hasValidSymbolCreationContext(e))return null;let n=this._getConvertedSymbol(e);if(!n)return null;let r;if(t!=null&&`backgroundFillSymbol`in t&&t.backgroundFillSymbol){let e=V(t.backgroundFillSymbol,{ignoreDrivers:!0});e.symbol!=null&&(r=e.symbol.symbolLayers)}let i=we(n,this.symbolCreationContext,r);return i.load(()=>{let e=i.extentPadding;e>this.extentPadding&&this._set(`extentPadding`,e),this.notifyChange(`averageSymbolComplexity`)},()=>{}),i}getOrCreateGraphics3DSymbol(e,t){let n=this._symbols.get(e.id);return n===void 0&&(n=this._unusedSymbolsCache.pop(e.id)??(e instanceof he?new Te(e,e=>this._dataUpdateQueue.push(e,null),e=>this._createGraphics3DSymbol(e,t)):this._createGraphics3DSymbol(e,t)),this._symbols.set(e.id,n),this._symbolMaterials=null),n!=null&&++n.referenced,n}trackGraphicState(e){return this._graphicStateTracking??=new De(this),this._graphicStateTracking.add(e)}_addGraphics3DGraphic(e){this._usedMemory+=e.usedMemory,e.notifyMemoryChange=this._notifyMemoryChange,this.graphics3DGraphics.set(e.graphic.uid,e),this._numberOfGraphics++,e.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(e,t,n=!1){t.notifyMemoryChange=void 0,this._usedMemory-=t.usedMemory,this.graphics3DGraphics.delete(e),this._numberOfGraphics--,n&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(e,t){let{graphic:n}=t;if(this._graphicsWithoutSymbol.delete(n.uid),!this._symbols.has(e.symbol.id))return this.add([n]),null;if(this.graphics3DGraphics.has(n.uid))return null;let r=e.createGraphics3DGraphic(t);if(r==null)return null;this._addGraphics3DGraphic(r);let i=e.symbol.id;if(this._graphicsBySymbol.has(i)||this._graphicsBySymbol.set(i,new Map),this._graphicsBySymbol.get(i).set(n.uid,r),r.isDraped&&this._graphicsDrapedUids.add(n.uid),r.centroid=null,n.geometry!=null&&n.geometry.type!==`point`&&(r.centroid=Oe(n.geometry,this._viewSpatialReference)),this._updateUserVisibility(r),this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(r),this._filterVisibility!=null){let{defaultVisibility:e}=this._filterVisibility;r.setVisibilityFlag(1,4,e),e||this._filterVisibility.reapply()}this._deconflictor?.addGraphic(r),this._labeler?.addGraphic(r),this._objectStates?.addGraphic(r),r.initialize(this.stageLayer),this._graphicStateTracking!=null&&this._graphicStateTracking.addGraphic(r);let a=this._whenGraphics3DGraphicRequests[n.uid];return a&&(delete this._whenGraphics3DGraphicRequests[n.uid],a.resolve(r)),this._symbolMaterials=null,r}async rendererChange(e){if(this._rendererChangeAbortController=o(this._rendererChangeAbortController),e!==this.currentRenderer){if(this._validateRenderer(e),e??this._currentRendererChange(null,!1),!F(e))this._currentRendererChange(e,!1);else if(e?.arcadeRequired){let t=new AbortController;this._rendererChangeAbortController=t;let{arcadeUtils:n}=await this._ensureArcade();d(t);let r=n.hasGeometryOperations(e),i=r||await this._rendererUsesFieldsRequiringArcadeTypeConversion(e);d(t),r&&(await n.enableGeometryOperations(),d(t)),this.effectiveUpdatePolicy===0?await this._updateQueue.push(()=>this._currentRendererChange(e,i),t.signal):this._currentRendererChange(e,i),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===0){let t=new AbortController;this._rendererChangeAbortController=t,await this._updateQueue.push(()=>this._currentRendererChange(e,!1),t.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(e,!1)}}async _ensureArcade(){return this._arcadeOnDemand??=await z(),this._arcadeOnDemand}async _rendererUsesFieldsRequiringArcadeTypeConversion(e){let{fieldsIndex:t}=this.layer;return t!=null&&(await e.getRequiredFields(t)).some(e=>{switch(t.get(e)?.type){case`date`:case`date-only`:case`time-only`:case`timestamp-offset`:return!0;default:return!1}})}_currentRendererChange(e,t){this.currentRenderer=e,this.rendererRequiresHydratedGraphic=t,this.symbolCreationContext.arcade=this._arcadeOnDemand;let n=this.symbolCreationContext.renderer;if(e===n)return;if(this._symbolConversionCache.clear(),this._unusedSymbolsCache.clear(),e==null){this.symbolCreationContext.renderer=null,this.recreateAllGraphicsAndSymbols();return}let r=b(n,e);this._updateUnchangedSymbolMappings(r,e,n),this.symbolCreationContext.renderer=e,r!=null&&(r.type===`complete`?this.recreateAllGraphicsAndSymbols():r.type===`partial`&&(this._applyRendererDiff(r,e,n)?this._labeler?.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange(`averageSymbolComplexity`))}_diffHasSymbolChange(e){for(let t in e.diff)switch(t){case`visualVariables`:case`defaultSymbol`:case`uniqueValueInfos`:break;case`uniqueValueGroups`:case`authoringInfo`:case`fieldDelimiter`:delete e.diff[t];break;default:return!0}return!1}_applySymbolSetDiff(e,t,n){e||=[],t||=[];let r=[];for(let i of t){let t=this._graphicsBySymbol.get(i.id);t&&t.forEach((a,o)=>{let s=a.graphic,c=this.layer instanceof pe?this.layer:null,l=this._arcadeOnDemand;if(i===n.defaultSymbol&&n.getSymbol(N(s,c,null),{arcade:l})===n.defaultSymbol)return;e.length||n.defaultSymbol?r.push(s):this._graphicsWithoutSymbol.set(o,s);let u=this.graphics3DGraphics.get(o);this._conditionalRemove(u,o),a.destroy(),t.delete(o),this._removeGraphics3DGraphic(o,u),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(e=>e(i.id))}(e.length||r.length)&&(this._graphicsWithoutSymbol.forEach(e=>r.push(e)),this._graphicsWithoutSymbol.clear(),this.add(r)),this._cleanupSymbols(),this._labeler?.setDirty(),this._deconflictor?.setDirty()}_applyUniqueValueRendererDiff(e,t,r){let i=e.diff.defaultSymbol,a=e.diff.uniqueValueInfos;if(i||a){let o=a?.changed,s=a?.unchanged;if(o&&s&&o.some(e=>s.some(t=>t.oldValue.symbol?.id===e.oldValue.symbol?.id)))return!1;let c=a?a.added.map(e=>e.symbol).filter(n):[],l=a?a.removed.map(e=>e.symbol).filter(n):[];if(o)for(let e=0;e<o.length;e++)c.push(o[e].newValue.symbol),l.push(o[e].oldValue.symbol);return i?(r.defaultSymbol&&l.push(r.defaultSymbol),t.defaultSymbol&&c.push(t.defaultSymbol)):r.defaultSymbol&&c.length&&l.push(t.defaultSymbol),this._applySymbolSetDiff(c,l,t),delete e.diff.defaultSymbol,delete e.diff.uniqueValueInfos,!0}return!1}_calculateUnchangedSymbolMapping(e,t,n){if(t?.type!==`unique-value`||n?.type!==`unique-value`||e!=null&&e.type!==`partial`)return[];let r=e=>e==null?null:e.id,i=e&&e.diff,a=i?.defaultSymbol,o=i&&i.uniqueValueInfos,s;if(o)s=o.unchanged.map(e=>({oldId:r(e.oldValue.symbol),newId:r(e.newValue.symbol)}));else{s=[];for(let e of n.uniqueValueInfos??[]){let n=r(e.symbol),i=t.uniqueValueInfos?.find(t=>t.value===e.value);i&&n!==r(i.symbol)&&s.push({oldId:n,newId:r(i.symbol)})}}return!a&&n.defaultSymbol&&s.push({oldId:r(n.defaultSymbol),newId:r(t.defaultSymbol)}),s}_updateSymbolMapping(e,t){let n=t!=null&&t?typeof t==`string`?t:t.id:null;if(e==null||e===n)return;let r=this._graphicsBySymbol.get(e);this._graphicsBySymbol.delete(e),r!==void 0&&this._graphicsBySymbol.set(n,r);let i=this._symbols.get(e);if(i!==void 0&&(this._symbols.delete(e),this._symbols.set(n,i),this._symbolMaterials=null,i!=null)){let e=typeof t==`string`?null:t;e==null?i.symbol.id=n:i.symbol=e}}_updateUnchangedSymbolMappings(e,t,n){let r=this._calculateUnchangedSymbolMapping(e,t,n);for(let{oldId:e,newId:t}of r)this._updateSymbolMapping(e,t)}_applyRendererDiff(e,t,n){if(this._diffHasSymbolChange(e))return!1;if(t instanceof P&&n instanceof P&&this._applyUniqueValueRendererDiff(e,t,n)&&Object.keys(e.diff).length===0)return!0;for(let n of this._graphicsBySymbol.keys()){let r=this._symbols.get(n);if(r!=null)switch(r.applyRendererDiff(e,t)){case 0:this._recreateSymbol(n);break;case 1:this._recreateGraphicsForSymbol(n)}}return!0}opacityChange(){this._updateStageLayerVisibility(),this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`opacity`,t))}_screenSizePerspectiveEnabledChange(){this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`screenSizePerspectiveEnabled`,t)),this._labeler?.screenSizePerspectiveEnabledChanged(),this._deconflictor?.screenSizePerspectiveEnabledChanged()}_slicePlaneEnabledChange(e){e!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=e,this.stageLayer.sliceable=e,this.forEachGraphics3DSymbol((e,t)=>e.globalPropertyChanged(`slicePlaneEnabled`,t)),this._deconflictor?.slicePlaneEnabledChange(),this._labeler?.slicePlaneEnabledChange())}_physicalBasedRenderingChange(e){this.symbolCreationContext.physicalBasedRenderingEnabled=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`physicalBasedRenderingEnabled`,t)||this._recreateSymbol(n)})}_skipHighSymbolLoDsChange(e){this.symbolCreationContext.skipHighSymbolLods=e,this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`skipHighSymbolLods`,t)||this._recreateSymbol(n)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((e,t,n)=>{e.globalPropertyChanged(`pixelRatio`,t)||this._recreateSymbol(n)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=v(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(e,t){let n=this.symbolCreationContext.clippingExtent,r=ue();return Ne(e,r,t)?this.symbolCreationContext.clippingExtent=ce(k(),r):this.symbolCreationContext.clippingExtent=null,!le(this.symbolCreationContext.clippingExtent,n)}modifyGraphics3DGraphicVisibilities(e){if(this.destroyed)return;let t=!1;this.graphics3DGraphics.forEach(n=>{e(n)&&(t=!0)}),t&&(this._labeler?.setDirty(),this._deconflictor?.setDirty())}forEachGraphics3DSymbol(e,t){for(let[t,n]of this._symbols){if(n==null)return;e(n,this._graphicsBySymbol.get(t)||Ke,t)}if(!t?.excludeUnused)for(let t of this._unusedSymbolsCache)e(t,void 0,t.symbol.id)}updateGraphicsVisibilities(){this._filterVisibility!=null&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(e=>{let t=this._updateUserVisibility(e),n=!!this._scaleVisibility?.updateVisibility(e);return t||n})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(e=>e.setVisibilityFlag(1,1,!1))}_validateRenderer(e){let t=()=>`'${this.layer.title?`${this.layer.title}, `:``}id:${this.layer.id}'`,n=I(e,{geometryType:this.layer?.geometryType,logWarning:(e,n)=>i.getLogger(this).warn(e,`Symbology conversion for layer ${t()}: ${n}`)});if(n){let e=`Renderer for layer ${t} is not supported in a SceneView`;i.getLogger(this).warn(e,n.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let e=!1;this._symbols.forEach((t,n)=>{if(t==null||t.referenced>0)return;let r=this._graphicsBySymbol.get(n);r&&r.size!==0||(this._graphicsBySymbol.delete(n),this._symbols.delete(n),this._symbolMaterials=null,this._unusedSymbolsCache.put(n,t,l),e=!0)}),e&&(this._recomputeExtentPadding(),this.notifyChange(`averageSymbolComplexity`))}get test(){}get performanceInfo(){return new Ee(this.graphics3DGraphics.size,this.graphics3DGraphics.values().reduce((e,t)=>e+ +!!t.isVisible(),0),this._graphicsWithoutSymbol.size,this._pendingUpdates.size)}};e([y({readOnly:!0})],X.prototype,`computedExtent`,void 0),e([y()],X.prototype,`currentRenderer`,void 0),e([y()],X.prototype,`rendererRequiresHydratedGraphic`,void 0),e([y()],X.prototype,`_frameTaskHandle`,void 0),e([y()],X.prototype,`_dataUpdateQueue`,void 0),e([y()],X.prototype,`_updateQueue`,void 0),e([y({readOnly:!0})],X.prototype,`_viewSpatialReference`,null),e([y()],X.prototype,`_rendererChangeAbortController`,void 0),e([y()],X.prototype,`_elevationInfoChangeAbortController`,void 0),e([y()],X.prototype,`_initializeAbortController`,void 0),e([y()],X.prototype,`_elevationAlignment`,void 0),e([y()],X.prototype,`_scaleVisibility`,void 0),e([y()],X.prototype,`_filterVisibility`,void 0),e([y()],X.prototype,`_initializePromise`,void 0),e([y()],X.prototype,`_spatialIndex`,void 0),e([y({readOnly:!0})],X.prototype,`extentPadding`,void 0),e([y()],X.prototype,`_updatingPendingLoadedGraphicsChange`,void 0),e([y()],X.prototype,`_featureStore`,void 0),e([y()],X.prototype,`_objectStates`,void 0),e([y()],X.prototype,`_loadingSymbols`,void 0),e([y({constructOnly:!0})],X.prototype,`compressionTracker`,void 0),e([y()],X.prototype,`preferredUpdatePolicy`,void 0),e([y()],X.prototype,`_forcedUpdatePolicy`,void 0),e([y({readOnly:!0})],X.prototype,`effectiveUpdatePolicy`,null),e([y({constructOnly:!0})],X.prototype,`elevationFeatureExpressionEnabled`,void 0),e([y({constructOnly:!0})],X.prototype,`owner`,void 0),e([y({constructOnly:!0})],X.prototype,`layer`,void 0),e([y({constructOnly:!0})],X.prototype,`graphicSymbolSupported`,void 0),e([y({constructOnly:!0})],X.prototype,`getRenderingInfoWithoutRenderer`,void 0),e([y({constructOnly:!0})],X.prototype,`componentFactories`,void 0),e([y({constructOnly:!0})],X.prototype,`setUidToIdOnAdd`,void 0),e([y({constructOnly:!0})],X.prototype,`reportGraphicSourceMemory`,void 0),e([y()],X.prototype,`featureStore`,null),e([y()],X.prototype,`initializePromise`,null),e([y()],X.prototype,`scaleVisibility`,null),e([y()],X.prototype,`elevationAlignment`,null),e([y()],X.prototype,`objectStates`,null),e([y()],X.prototype,`filterVisibility`,null),e([y({readOnly:!0})],X.prototype,`updating`,null),e([y({readOnly:!0})],X.prototype,`dataUpdating`,null),e([y({readOnly:!0})],X.prototype,`readyToRun`,null),e([y({readOnly:!0})],X.prototype,`suspendedOrOutsideOfView`,null),e([y({readOnly:!0})],X.prototype,`updatingRemaining`,null),e([y({readOnly:!0})],X.prototype,`displayFeatureLimit`,null),e([y({readOnly:!0})],X.prototype,`averageSymbolComplexity`,null),e([y({constructOnly:!0})],X.prototype,`hasZ`,void 0),e([y({constructOnly:!0})],X.prototype,`hasM`,void 0),e([y()],X.prototype,`_objectIdField`,null),X=J=e([ne(`esri.views.3d.layers.graphics.Graphics3DCore`)],X);class Z{constructor(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=0,this.abortController=null,this.remove=null}}const Ge=10,Q=T(),$=T(),Ke=new Map;export{X as Graphics3DCore};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as n,create as r,expandWithRect as i,center as a,set as o,toRect as s}from"../../../../geometry/support/aaBoundingBox.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as l}from"./graphicUtils.js";class
|
|
2
|
+
import{set as e}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as n,create as r,expandWithRect as i,center as a,set as o,toRect as s}from"../../../../geometry/support/aaBoundingBox.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{demResolutionForBoundingBox as l}from"./graphicUtils.js";import{computeGeometryBufferMemory as u}from"../../webgl-engine/lib/geometryMemoryUtils.js";class d{constructor(e,t,n,r){this.graphics3DSymbolLayer=e,this.renderGeometries=t,this.boundingBox=n,this._drapeSourceRenderer=r,this._visible=!1,this._addedToStage=!1,this.isElevationSource=!1,this._geometryBufferMemory=u(t.map(f))}initialize(e){this.stage=e.stage}get usedMemory(){return this.graphics3DSymbolLayer.usedMemory+this._geometryBufferMemory+this.renderGeometries.reduce((e,t)=>e+f(t).usedMemoryExcludingBuffers,0)}setNotifyMemoryChange(e){for(let t of this.renderGeometries)f(t).notifyMemoryChange=e}setVisibility(e){if(this.stage!=null&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)this._addedToStage=!0,this._drapeSourceRenderer.addGeometries(this.renderGeometries,0);else if(e||this._addedToStage){for(let e of this.renderGeometries)e.visible=this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,1)}}}destroy(){this.setNotifyMemoryChange(void 0),this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,2),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(n=t()){return e(n,0,0,0)}getBoundingBoxObjectSpace(e=r()){return n(e)}addObjectState(e){e.stateType===0&&(this.renderGeometries.forEach(t=>{let n=f(t).allocateIdAndHighlight(e.highlightName);e.addRenderGeometry(t,n,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,8))}removeObjectState(e){this.renderGeometries.forEach(t=>e.removeByObject(t))}updateHighlights(e){}removeRenderGeometryObjectState(e,t){t.channel===0&&(f(e).removeHighlight(t),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries([e],8))}computeAttachmentOrigin(e){for(let t of this.renderGeometries)f(t).computeAttachmentOrigin(h)&&(e.draped.origin[0]+=h[0],e.draped.origin[1]+=h[1],e.draped.num++)}async getProjectedBoundingBox(e,t,r,o,s){n(s);for(let t=0;t<this.renderGeometries.length;t++){let n=this.renderGeometries[t];this._getRenderGeometryProjectedBoundingRect(n,e,p,r),i(s,p)}if(t){a(s,h);let e,n=l(s,t.service.spatialReference,t);try{e=await t.service.queryElevation(h[0],h[1],o,n,`ground`)}catch{}e!=null&&(s[2]=Math.min(s[2],e),s[5]=Math.max(s[5],e))}return s}_getRenderGeometryProjectedBoundingRect(e,t,n,r){if(this.boundingBox)o(m,this.boundingBox);else{let{center:t,radius:n}=e.boundingSphere;m[0]=t[0]-n,m[1]=t[1]-n,m[2]=t[2]-n,m[3]=t[0]+n,m[4]=t[1]+n,m[5]=t[2]+n}return t(m,0,2),this.calculateRelativeScreenBounds&&r.push({location:a(m),screenSpaceBoundingRect:this.calculateRelativeScreenBounds()}),s(m,n)}}function f(e){return e.type===1?e:e.geometry}const p=c(),m=r(),h=t();export{d as Graphics3DDrapedGraphicLayerBase};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{clone as e}from"../../../../core/lang.js";import{getMetersPerVerticalUnitForSR as t}from"../../../../core/units.js";import{normalFromMat4 as n}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as i,invertOrIdentity as a}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as s,sub as c,cross as l,add as u,normalize as d,transformMat4 as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as p,create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as h,ZEROS as g}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as _}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as v,fromBuffer as y,intersectsClippingArea as b}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as x}from"../../../../geometry/support/Indices.js";import{t as S}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as C,SnappingCandidateEdge as w}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as T}from"../../../../renderers/support/renderingInfoUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as E}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as D,SampleElevationInfo as O}from"./elevationAlignmentUtils.js";import{extrudePolygon as ee}from"./extrudePolygon.js";import{Object3DEdgeState as k,Graphics3DObject3DGraphicLayer as A}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as j}from"./Graphics3DSymbolLayer.js";import{computeCentroid as M}from"./graphicUtils.js";import{addOlidAttribute as N}from"./olidUtils.js";import{geometryAsPolygon as P}from"./polygonUtils.js";import{createMaterial as te}from"../support/edgeUtils.js";import{encodeNaNUInt8 as F}from"../support/symbolColorUtils.js";import{debugFlags as I}from"../../support/debugFlags.js";import{SamplePosition as L}from"../../support/ElevationProvider.js";import{loadTessellationUtils as R,preloadedPolygonToRenderInfoElevationAligned as z}from"../../support/renderInfoUtils/polygon.js";import{Attribute as B}from"../../webgl-engine/lib/Attribute.js";import{Geometry as V}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as U,compressNormal as W}from"../../webgl-engine/lib/Normals.js";import{Object3D as G}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as K}from"../../webgl-engine/materials/DefaultMaterial.js";const q=[`polygon`,`extent`];class J extends j{constructor(e,t,n,r){super(e,t,n,r,E(t)),this.ensureDrapedStatus(!1)}async doLoad(){let e=this.symbolLayer,t=e?.material,n=this.symbolLayer.material?.color?.a,r=this._hasDrivenColorOrOpacity,i=this.needsDrivenTransparentPass||r&&n!=null&&n<1,a=t?.emissive,o=(a?.source===`color`?a?.strength:void 0)??0,s=!r&&(n==null||n===0),c=r?h:this._materialColor?.toUnitRGBA()??g,l={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:p,diffuse:p,externalColor:c,opacity:+!s,layerOpacity:this._getLayerOpacity(),drivenOpacity:i,hasSymbolColors:r,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},u=new K(l,this._context),d=new K({...l,cullFace:2},this._context);this._materials[0]=u,this._materials[1]=d,this._updateTransparentDepedentMaterialParameters(),await R()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,q,this.symbolLayer.type))return null;let n=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);F(n,n);let r=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,n,r,t.uid)}layerOpacityChanged(e,t){let n=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:n}),this._materials[1]?.setParameters({layerOpacity:n}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(n,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,D)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){let e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?T(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return`polygonIndexCount`in e&&`outlineIndexCount`in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return+!this._drivenPropertiesChanged(t)}async queryForSnapping(n,r,i,a){let o=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/t(r),{objectId:s,target:c}=n,l=e(c);switch(l.z=(l.z??0)+o,n.type){case`edge`:{let{start:t,end:r}=n,i=e(t),a=e(r);return i.z=(i.z??0)+o,a.z=(a.z??0)+o,[new w(s,l,1/0,i,a)]}case`vertex`:return[new C(s,l,1/0),new w(s,c,1/0,c,l)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,t,a,s,c){let l=P(e.geometry);if(l==null)return null;if(l.rings.length===0||!l.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(l.rings,`rings`,`ExtrudeSymbol3DLayer`),null;let u=z(l,this._context.elevationProvider,this._context.renderCoordsHelper,s,{outlineOutput:`tessellated-indices`,owner:this._context.layer});if(u==null)return;this._logGeometryCreationWarnings(u,l.rings,`rings`,`ExtrudeSymbol3DLayer`);let d=M(l);if(d==null)return null;let f=[],p=[],h=v(),g=o(),x=m(),C=this._context.renderCoordsHelper.viewingMode===1;C||this._context.renderCoordsHelper.worldUpAtPosition(null,x),_(l.spatialReference,[d.x,d.y,0],g,this._context.renderCoordsHelper.spatialReference);let w=o();i(w,g);let T=r();n(T,w);let E=new Map,O=this._materials[0];if(this._context.clippingExtent&&(y(u.mapPositions,h),!b(h,this._context.clippingExtent))||u.polygonIndexCount===0&&u.outlineIndexCount===0)return;let j=this._getExtrusionSize(t),N=ee(u,{height:j,worldUp:x,spherical:C,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(N==null)return;S(N.vertices,N.vertices,w);let F=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:c,layerViewUid:this._context.layerViewUid}),I=new le(N.vertices,N.elevation,U(N.normals),N.sizes),L=Y(O,N.indices,N.indices.length-N.bottomIndices.length,I,a,F),R=u.vertexCount,B=u.outlineSegmentCount*2,V=u.polygonIndexCount/3,H=new ue(R,B,V);if(Z(L,H,g),E.set(L,H),f.push(L),N.bottomIndices.length>0&&f.push(Y(this._materials[1],N.bottomIndices,0,I,a,F)),p.push(I.heights),f.length===0)return null;let W=new G({geometries:f,layerViewUid:this._context.layerViewUid,graphicUid:c,isElevationSource:!0});W.transformation=g;let K=te(this.symbolLayer,{opacity:this._getLayerOpacity()}),q=K?new k(this._materials[0],K,this._context.slicePlaneEnabled):null,J=new A(this,W,null,(e,t,n,r,i)=>re(e,t,n,r,i,p,E),s,q);return J.alignedSampledElevation=u.sampledElevation,J.needsElevationUpdates=D(s.mode),J}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){let e=this._materials[0];e&&e.setParameters({cullFace:e.transparent?0:2})}}function Y(e,t,n,r,i,a){let{attributeIndices:o,drawIndices:s}=ne(t),c=[[`position`,new B(r.positions,o,3,!0)],[`normalCompressed`,new B(r.normals,o,2,!0)]],l=null;return e.parameters.hasSymbolColors&&(l=x(o.length),c.push([`symbolColor`,new B(i,l,4,!0)])),a!=null&&(l??=x(o.length),N(c,a,l)),new V(e,c,r.elevation,n,null,s)}function ne(e){let t=[],n=new Map,r=[];for(let i=0;i<e.length;++i){let a=e[i],o=n.get(a);o??(o=t.length,t.push(a),n.set(a,o)),r.push(o)}return{attributeIndices:t,drawIndices:r}}const X=m();function re(e,t,n,r,i,c,l){let u=e.stageObject,d=u.geometries,p=d.length,m=t.mode!==`absolute-height`,h=0,g=u.transformation,_=a(o(),g);for(let e=0,t=0;e<p;++e){let a=d[e],o=l.get(a);if(!o||!H(a))continue;let p=a.getMutableAttribute(`position`).data,v=c[t++],y=new L(a.mapPositions),b=p.length/3,x=!1,S=0;{let e=0;for(let t=0;t<b;t++){X[0]=p[e],X[1]=p[e+1],X[2]=p[e+2],r(y,$),m&&(S+=$.sampledElevation),I.ENABLE_OPTIMIZATIONS?(s(Q,p[e],p[e+1],p[e+2]),f(Q,Q,g),i.setAltitude(Q,$.z+v[e/3]),f(Q,Q,_)):(s(Q,y.array[y.offset],y.array[y.offset+1],$.z+v[e/3]),n!=null&&i.toRenderCoords(Q,n,Q),f(Q,Q,_)),p[e]=Q[0],p[e+1]=Q[1],p[e+2]=Q[2];let t=ae/i.unitInMeters;(Math.abs(X[0]-p[e])>=t||Math.abs(X[1]-p[e+1])>=t||Math.abs(X[2]-p[e+2])>=t)&&(x=!0),y.offset+=3,e+=3}}if(x){Z(a,o,g),u.geometryVertexAttributeUpdated(d[e],`normalCompressed`),a.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(d[e],`position`);let t=d[e+1],n=!l.has(t);t&&n&&(t.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(t,`position`))}h+=S/b}return h/p}function Z(e,t,n){let r=e.getMutableAttribute(`normalCompressed`).data,i=e.readPrimitivePosition,{plateVertexCount:a,topFaceStart:o,topFaceCount:p}=t,m=o+p,h=oe,g=se,_=ce,v=ie,y=Q;s(y,0,0,0);let b=(e,t)=>{f(t,i(t,e),n)};for(let e=o;e<m;++e){let t=e*3;b(t,h[0]),b(t+1,h[1]),b(t+2,h[2]),c(g,h[1],h[0]),c(_,h[2],h[0]),l(v,g,_),u(y,y,v)}d(y,y);for(let e=0;e<a;++e){let t=y[0],n=y[1],i=y[2];W(r,e,-t,-n,-i),W(r,e+a,t,n,i)}}const Q=m(),ie=m(),$=new O,ae=.01,oe=[m(),m(),m()],se=m(),ce=m();class le{constructor(e,t,n,r){this.positions=e,this.elevation=t,this.normals=n,this.heights=r}}class ue{constructor(e,t,n){this.plateVertexCount=e,this.topFaceStart=t,this.topFaceCount=n}}export{J as Graphics3DExtrudeSymbolLayer};
|
|
2
|
+
import{clone as e}from"../../../../core/lang.js";import{estimateArrayMemory as t}from"../../../../core/memoryEstimations.js";import{getMetersPerVerticalUnitForSR as n}from"../../../../core/units.js";import{normalFromMat4 as r}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as a,invertOrIdentity as o}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as s}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{set as c,sub as l,cross as u,add as d,normalize as f,transformMat4 as p}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{ONES as m,create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g,ZEROS as _}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{computeTranslationToOriginAndRotation as v}from"../../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{create as y,fromBuffer as b,intersectsClippingArea as x}from"../../../../geometry/support/aaBoundingBox.js";import{getZeroIndexArray as S}from"../../../../geometry/support/Indices.js";import{t as C}from"../../../../chunks/vec3.js";import{SnappingCandidateVertex as w,SnappingCandidateEdge as T}from"../../../../layers/graphics/data/SnappingCandidate.js";import{getDriverAxisSizeValue as E}from"../../../../renderers/support/renderingInfoUtils.js";import{isDrivenOpacityFallbackAlwaysOpaque as D}from"../../../../renderers/visualVariables/support/visualVariableUtils.js";import{needsElevationUpdates3D as O,SampleElevationInfo as k}from"./elevationAlignmentUtils.js";import{extrudePolygon as A}from"./extrudePolygon.js";import{Object3DEdgeState as ee,Graphics3DObject3DGraphicLayer as j}from"./Graphics3DObject3DGraphicLayer.js";import{Graphics3DSymbolLayer as M}from"./Graphics3DSymbolLayer.js";import{computeCentroid as N}from"./graphicUtils.js";import{addOlidAttribute as P}from"./olidUtils.js";import{geometryAsPolygon as te}from"./polygonUtils.js";import{createMaterial as ne}from"../support/edgeUtils.js";import{encodeNaNUInt8 as F}from"../support/symbolColorUtils.js";import{debugFlags as I}from"../../support/debugFlags.js";import{SamplePosition as L}from"../../support/ElevationProvider.js";import{loadTessellationUtils as R,preloadedPolygonToRenderInfoElevationAligned as z}from"../../support/renderInfoUtils/polygon.js";import{Attribute as B}from"../../webgl-engine/lib/Attribute.js";import{Geometry as V}from"../../webgl-engine/lib/Geometry.js";import{isGeometryWithMapPositions as H}from"../../webgl-engine/lib/GeometryWithMapPositions.js";import{compressNormals as re,compressNormal as U}from"../../webgl-engine/lib/Normals.js";import{Object3D as ie}from"../../webgl-engine/lib/Object3D.js";import{DefaultMaterial as W}from"../../webgl-engine/materials/DefaultMaterial.js";const G=[`polygon`,`extent`];class K extends M{constructor(e,t,n,r){super(e,t,n,r,D(t)),this.ensureDrapedStatus(!1)}async doLoad(){let e=this.symbolLayer,t=e?.material,n=this.symbolLayer.material?.color?.a,r=this._hasDrivenColorOrOpacity,i=this.needsDrivenTransparentPass||r&&n!=null&&n<1,a=t?.emissive,o=(a?.source===`color`?a?.strength:void 0)??0,s=!r&&(n==null||n===0),c=r?g:this._materialColor?.toUnitRGBA()??_,l={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,useIndexing:!0,ambient:m,diffuse:m,externalColor:c,opacity:+!s,layerOpacity:this._getLayerOpacity(),drivenOpacity:i,hasSymbolColors:r,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:e.castShadows,emissiveStrengthFromSymbol:o,emissiveSource:1,offsetTransparentBackfaces:!0,normalType:1},u=new W(l,this._context),d=new W({...l,cullFace:2},this._context);this._materials[0]=u,this._materials[1]=d,this._updateTransparentDepedentMaterialParameters(),await R()}destroy(){super.destroy(),this._materials.length=0}createGraphics3DGraphic(e){let t=e.graphic;if(!this._validateGeometry(t.geometry,G,this.symbolLayer.type))return null;let n=this._getDrivenUInt8ColorWithNaNSupport(e.renderingInfo,this._materialColor,!1);F(n,n);let r=this.createElevationContextForGraphic(t);return this._createAs3DShape(t,e.renderingInfo,n,r,t.uid)}layerOpacityChanged(e,t){let n=this._getLayerOpacity();this._materials[0]?.setParameters({layerOpacity:n}),this._materials[1]?.setParameters({layerOpacity:n}),this._updateTransparentDepedentMaterialParameters(),e?.forEach(e=>t(e)?.layerOpacityChanged(n,this._context.isAsync))}layerScreenSizePerspectiveChanged(){}layerElevationInfoChanged(e,t){return this.updateGraphics3DGraphicElevationInfo(e,t,O)}slicePlaneEnabledChanged(e,t){return this._materials[0]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[1]?.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e?.forEach(e=>{t(e)?.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){let e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return this._materials[0]?.setParameters(e),this._materials[1]?.setParameters(e),!0}_getExtrusionSize(e){let t;return t=e.size&&this._drivenProperties.size?E(e.size.output,2)??0:this._getSymbolSize(),t/=this._context.renderCoordsHelper.unitInMeters,t}_containsRenderableGeometry(e){return`polygonIndexCount`in e&&`outlineIndexCount`in e?e.polygonIndexCount>0||e.outlineIndexCount>0:super._containsRenderableGeometry(e)}applyRendererDiff(e,t){return+!this._drivenPropertiesChanged(t)}async queryForSnapping(t,r,i,a){let o=this._getExtrusionSize(i)*this._context.renderCoordsHelper.unitInMeters/n(r),{objectId:s,target:c}=t,l=e(c);switch(l.z=(l.z??0)+o,t.type){case`edge`:{let{start:n,end:r}=t,i=e(n),a=e(r);return i.z=(i.z??0)+o,a.z=(a.z??0)+o,[new T(s,l,1/0,i,a)]}case`vertex`:return[new w(s,l,1/0),new T(s,c,1/0,c,l)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,n,o,c,l){let u=te(e.geometry);if(u==null)return null;if(u.rings.length===0||!u.rings.some(e=>e.length>0))return this._logGeometryValidationWarnings(u.rings,`rings`,`ExtrudeSymbol3DLayer`),null;let d=z(u,this._context.elevationProvider,this._context.renderCoordsHelper,c,{outlineOutput:`tessellated-indices`,owner:this._context.layer});if(d==null)return;this._logGeometryCreationWarnings(d,u.rings,`rings`,`ExtrudeSymbol3DLayer`);let f=N(u);if(f==null)return null;let p=[],m=[],g=y(),_=s(),S=h(),w=this._context.renderCoordsHelper.viewingMode===1;w||this._context.renderCoordsHelper.worldUpAtPosition(null,S),v(u.spatialReference,[f.x,f.y,0],_,this._context.renderCoordsHelper.spatialReference);let T=s();a(T,_);let E=i();r(E,T);let D=new Map,k=this._materials[0];if(this._context.clippingExtent&&(b(d.mapPositions,g),!x(g,this._context.clippingExtent))||d.polygonIndexCount===0&&d.outlineIndexCount===0)return;let M=this._getExtrusionSize(n),P=A(d,{height:M,worldUp:S,spherical:w,requireElevation:!0,requireNormals:!0,requireSizes:!0});if(P==null)return;C(P.vertices,P.vertices,T);let F=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerViewUid:this._context.layerViewUid}),I=new ue(P.vertices,P.elevation,re(P.normals),P.sizes),L=q(k,P.indices,P.indices.length-P.bottomIndices.length,I,o,F),R=d.vertexCount,B=d.outlineSegmentCount*2,V=d.polygonIndexCount/3,H=new de(R,B,V);if(X(L,H,_),D.set(L,H),p.push(L),P.bottomIndices.length>0&&p.push(q(this._materials[1],P.bottomIndices,0,I,o,F)),m.push(I.heights),p.length===0)return null;let U=new ie({geometries:p,layerViewUid:this._context.layerViewUid,graphicUid:l,isElevationSource:!0});U.transformation=_;let W=ne(this.symbolLayer,{opacity:this._getLayerOpacity()}),G=W?new ee(this._materials[0],W,this._context.slicePlaneEnabled):null,K=new j(this,U,null,(e,t,n,r,i)=>ae(e,t,n,r,i,m,D),c,G,m.reduce((e,n)=>e+t(n,8),0));return K.alignedSampledElevation=d.sampledElevation,K.needsElevationUpdates=O(c.mode),K}get _materialColor(){return this.symbolLayer.material?.color}_updateTransparentDepedentMaterialParameters(){let e=this._materials[0];e&&e.setParameters({cullFace:e.transparent?0:2})}}function q(e,t,n,r,i,a){let{attributeIndices:o,drawIndices:s}=J(t),c=[[`position`,new B(r.positions,o,3,!0)],[`normalCompressed`,new B(r.normals,o,2,!0)]],l=null;return e.parameters.hasSymbolColors&&(l=S(o.length),c.push([`symbolColor`,new B(i,l,4,!0)])),a!=null&&(l??=S(o.length),P(c,a,l)),new V(e,c,r.elevation,n,null,s)}function J(e){if(e.length===0)return{attributeIndices:[],drawIndices:[]};let t=new Map,n=Array(e.length).fill(0);for(let r=0;r<e.length;++r){let i=e[r],a=t.get(i);a??(a=t.size,t.set(i,a)),n[r]=a}let r=Array(t.size).fill(0);for(let[e,n]of t)r[n]=e;return{attributeIndices:r,drawIndices:n}}const Y=h();function ae(e,t,n,r,i,a,l){let u=e.stageObject,d=u.geometries,f=d.length,m=t.mode!==`absolute-height`,h=0,g=u.transformation,_=o(s(),g);for(let e=0,t=0;e<f;++e){let o=d[e],s=l.get(o);if(!s||!H(o))continue;let f=o.getMutableAttribute(`position`).data,v=a[t++],y=new L(o.mapPositions),b=f.length/3,x=!1,S=0;{let e=0;for(let t=0;t<b;t++){Y[0]=f[e],Y[1]=f[e+1],Y[2]=f[e+2],r(y,Q),m&&(S+=Q.sampledElevation),I.ENABLE_OPTIMIZATIONS?(c(Z,f[e],f[e+1],f[e+2]),p(Z,Z,g),i.setAltitude(Z,Q.z+v[e/3]),p(Z,Z,_)):(c(Z,y.array[y.offset],y.array[y.offset+1],Q.z+v[e/3]),n!=null&&i.toRenderCoords(Z,n,Z),p(Z,Z,_)),f[e]=Z[0],f[e+1]=Z[1],f[e+2]=Z[2];let t=se/i.unitInMeters;(Math.abs(Y[0]-f[e])>=t||Math.abs(Y[1]-f[e+1])>=t||Math.abs(Y[2]-f[e+2])>=t)&&(x=!0),y.offset+=3,e+=3}}if(x){X(o,s,g),u.geometryVertexAttributeUpdated(d[e],`normalCompressed`),o.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(d[e],`position`);let t=d[e+1],n=!l.has(t);t&&n&&(t.invalidateBoundingInfo(),u.geometryVertexAttributeUpdated(t,`position`))}h+=S/b}return h/f}function X(e,t,n){let r=e.getMutableAttribute(`normalCompressed`).data,i=e.readPrimitivePosition,{plateVertexCount:a,topFaceStart:o,topFaceCount:s}=t,m=o+s,h=ce,g=le,_=$,v=oe,y=Z;c(y,0,0,0);let b=(e,t)=>{p(t,i(t,e),n)};for(let e=o;e<m;++e){let t=e*3;b(t,h[0]),b(t+1,h[1]),b(t+2,h[2]),l(g,h[1],h[0]),l(_,h[2],h[0]),u(v,g,_),d(y,y,v)}f(y,y);for(let e=0;e<a;++e){let t=y[0],n=y[1],i=y[2];U(r,e,-t,-n,-i),U(r,e+a,t,n,i)}}const Z=h(),oe=h(),Q=new k,se=.01,ce=[h(),h(),h()],le=h(),$=h();class ue{constructor(e,t,n,r){this.positions=e,this.elevation=t,this.normals=n,this.heights=r}}class de{constructor(e,t,n){this.plateVertexCount=e,this.topFaceStart=t,this.topFaceCount=n}}export{K as Graphics3DExtrudeSymbolLayer,J as remapIndicesToAttributeSubset};
|