@arcgis/core 5.0.0-next.32 → 5.0.0-next.34
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/{9252854b512237b6a0ef.js → 0446562aee0639c61485.js} +1 -1
- package/assets/esri/core/workers/chunks/{b56c07c0b43cb1999070.js → 1fa55d4c4b092a98bdd7.js} +1 -1
- package/assets/esri/core/workers/chunks/22f745539ca54d8cd30d.js +1 -0
- package/assets/esri/core/workers/chunks/2613e482450b57f2d4f5.js +1 -0
- package/assets/esri/core/workers/chunks/{e7f4d135ef9665de1468.js → 33431e8131f6017de2f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{1dfca37f95f2b968aa54.js → 39d2b540738431adec98.js} +1 -1
- package/assets/esri/core/workers/chunks/{096e5f94eaa226814569.js → 4356274cfa477eb6d749.js} +1 -1
- package/assets/esri/core/workers/chunks/44b6b7418cbf7f778bef.js +1 -0
- package/assets/esri/core/workers/chunks/4675ed3ca3e0104d00bf.js +1 -0
- package/assets/esri/core/workers/chunks/{25fd0884dd14973c89f5.js → 486e69261aa2caf9ec3c.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c1e50c3505e5e7c946a.js → 4d5591c1b4ef37075921.js} +1 -1
- package/assets/esri/core/workers/chunks/4df7cc3477bc46fc39af.js +1 -0
- package/assets/esri/core/workers/chunks/52ecbaa2d32692d6d8df.js +1 -0
- package/assets/esri/core/workers/chunks/{3777b41b4fa2f1418402.js → 55818fe7a7aa1e5c8bbd.js} +1 -1
- package/assets/esri/core/workers/chunks/{d21ae4980741be98f948.js → 59889855d23baec1adf9.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e6fae3660e7a6a0fa16.js → 5f781ef46ce7c4048c2f.js} +1 -1
- package/assets/esri/core/workers/chunks/5f9e64f00329cb646f0c.js +1 -0
- package/assets/esri/core/workers/chunks/61cb30e2e8edd18ebbf0.js +1 -0
- package/assets/esri/core/workers/chunks/63933cbcb5c12df09715.js +1 -0
- package/assets/esri/core/workers/chunks/706423d801fa9cbf2e90.js +1 -0
- package/assets/esri/core/workers/chunks/{e6df4327ac1d9b65b80d.js → 71dd80231ea656a6380c.js} +1 -1
- package/assets/esri/core/workers/chunks/725819839434c59102f3.js +1 -0
- package/assets/esri/core/workers/chunks/{d786b17cc9062b1450ac.js → 726a797f5df7eeee0b3d.js} +1 -1
- package/assets/esri/core/workers/chunks/72cebf18da5ec5eeb666.js +1 -0
- package/assets/esri/core/workers/chunks/{bd58c027408dc858f23c.js → 77b45957cfe42523c1c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2cee5ac0d4df0108425.js → 82cc758bddd9f8397b9f.js} +1 -1
- package/assets/esri/core/workers/chunks/852de585a72d902344a6.js +1 -0
- package/assets/esri/core/workers/chunks/871dd5e1f016a04b8d98.js +1 -0
- package/assets/esri/core/workers/chunks/892c417f5130b003889d.js +1 -0
- package/assets/esri/core/workers/chunks/907083c427d7fb4354e9.js +1 -0
- package/assets/esri/core/workers/chunks/{433d249c35c56bf15806.js → 97650ee3d0eecb69ccbb.js} +3 -3
- package/assets/esri/core/workers/chunks/{add17e95f47e6904bf6d.js → a59dab47a58695c639da.js} +1 -1
- package/assets/esri/core/workers/chunks/{f441fc74451330384fb0.js → abb05a903440d97a6a74.js} +1 -1
- package/assets/esri/core/workers/chunks/{3bacd904cd93c8013f6a.js → ae793d814cf32db9fbde.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0b70652da4a7f672cfc.js → b21cf62652ca772108c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{5baef729beef0199c3d9.js → b536fdb655ad293d9024.js} +1 -1
- package/assets/esri/core/workers/chunks/{1d4ea8db272655c0608c.js → c7c721de93bc8688e13c.js} +1 -1
- package/assets/esri/core/workers/chunks/c82a974c8448407885e6.js +1 -0
- package/assets/esri/core/workers/chunks/c8d2cce4a426c72ab173.js +1 -0
- package/assets/esri/core/workers/chunks/c9c2e00fed979c21e2f0.js +1 -0
- package/assets/esri/core/workers/chunks/{94005916d321c879bea1.js → cb500d673ca7ec1ef945.js} +1 -1
- package/assets/esri/core/workers/chunks/{14feb12826e0c8ba7fb8.js → d14bd320f72d8e8a0ad8.js} +1 -1
- package/assets/esri/core/workers/chunks/d239a4ef60e348cfb05a.js +1 -0
- package/assets/esri/core/workers/chunks/{4b6a44c6265c8959abd8.js → d3db7244fac7398cc700.js} +1 -1
- package/assets/esri/core/workers/chunks/d6d03f22c91f528b97e5.js +1 -0
- package/assets/esri/core/workers/chunks/{4ab89c990a82c745c0fd.js → d764b6273974f4bca31b.js} +1 -1
- package/assets/esri/core/workers/chunks/d86e59da76eea888ba86.js +1 -0
- package/assets/esri/core/workers/chunks/dc3a4ad62bc041a4f899.js +1 -0
- package/assets/esri/core/workers/chunks/{7aa730e5ac7b268e3c98.js → dd34d56caafa38d4b8e4.js} +1 -1
- package/assets/esri/core/workers/chunks/df458ad51be27df3d79d.js +1 -0
- package/assets/esri/core/workers/chunks/{01b8e680befff83e7d3e.js → e093e745708f722bc1b9.js} +1 -1
- package/assets/esri/core/workers/chunks/e3a994587f9b2e88db85.js +1 -0
- package/assets/esri/core/workers/chunks/ea5bf896acfcc3106bf5.js +1 -0
- package/assets/esri/core/workers/chunks/{a74e6d505a55ed27f004.js → f11453f24c0b728669d2.js} +1 -1
- package/assets/esri/core/workers/chunks/f2ebd6471e1259a6eac0.js +1 -0
- package/assets/esri/core/workers/chunks/f3c232fc56a29d51196a.js +1 -0
- package/assets/esri/core/workers/chunks/{2a17991923abc64c84c6.js → f55328aabf84770c8e6a.js} +1 -1
- package/assets/esri/core/workers/chunks/fa01d1813fa78034526e.js +1 -0
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/chunks/ComponentShader.glsl.js +19 -21
- package/chunks/Envelope.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/Geometry.js +1 -1
- package/chunks/GlowComposition.glsl.js +5 -5
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/Terrain.glsl.js +9 -11
- package/chunks/UnitFactory.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/lyr3DMain.js +1 -1
- package/chunks/vec32.js +1 -1
- package/config.js +1 -1
- package/core/deprecate.js +1 -1
- package/core/has.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/geometry/SpatialReference.js +1 -1
- package/geometry/operators/integrateOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +1 -1
- package/geometry/operators/support/jsonConverter.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/spatialReferenceUtils.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +522 -5
- package/intl/locale.js +1 -1
- package/kernel.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/catalog/CatalogDynamicGroupLayer.js +1 -1
- package/layers/graphics/data/AttributesBuilder.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/layerOriginUtils.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +3 -3
- package/portal/schemas/definitions.js +1 -1
- package/request/config.js +1 -1
- package/request/process.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/support/LocateSetting.d.ts +4 -0
- package/rest/support/LocateSetting.js +5 -0
- package/rest/support/LocateSettingBase.d.ts +4 -0
- package/rest/support/LocateSettingBase.js +5 -0
- package/rest/support/LocateSettingSource.d.ts +4 -0
- package/rest/support/LocateSettingSource.js +5 -0
- package/rest/support/LocateSettings.d.ts +4 -0
- package/rest/support/LocateSettings.js +5 -0
- package/rest/support/LocateSettingsOverrides.d.ts +4 -0
- package/rest/support/LocateSettingsOverrides.js +5 -0
- package/rest/support/RouteParameters.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
- package/views/3d/support/CombinedElevationProvider.js +1 -1
- package/views/3d/support/ElevationRange.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +5 -0
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/ElevationBounds.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +57 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentDataConstants.js +5 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentShader.glsl.js +5 -0
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/{shader/DecodeSymbolColor.glsl.js → DecodeSymbolColor.glsl.js} +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -13
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +7 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowCompositionTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFields.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +24 -31
- package/views/Attribution.js +1 -1
- package/views/DOMContainer.js +1 -1
- package/views/SelectionManager.js +1 -1
- package/views/View.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/GroundElevationSampler.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/views/support/selectionUtils.js +1 -1
- package/widgets/Attachments/AttachmentsViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
- package/widgets/BuildingExplorer.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/ShadowCast/DiscreteOptions.js +1 -1
- package/widgets/ShadowCast/DurationOptions.js +1 -1
- package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
- package/widgets/ShadowCast/ThresholdOptions.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0a1df5a724fe253b3866.js +0 -1
- package/assets/esri/core/workers/chunks/155d74b9c0ef31dc2316.js +0 -1
- package/assets/esri/core/workers/chunks/2c8c48433b380da59831.js +0 -1
- package/assets/esri/core/workers/chunks/31b5747a254d13acc58e.js +0 -1
- package/assets/esri/core/workers/chunks/3ac84e324d212815e252.js +0 -1
- package/assets/esri/core/workers/chunks/41a00c77e6f7ce61e476.js +0 -1
- package/assets/esri/core/workers/chunks/45729d006db6a569715f.js +0 -1
- package/assets/esri/core/workers/chunks/50cf3cbcad2be1c1e210.js +0 -1
- package/assets/esri/core/workers/chunks/565358ea8d1bdc4d1ebc.js +0 -1
- package/assets/esri/core/workers/chunks/592afe1a41bed3b0cc31.js +0 -1
- package/assets/esri/core/workers/chunks/5aeda8a1f2ccabfdf40f.js +0 -1
- package/assets/esri/core/workers/chunks/657d9e5145da1306ace8.js +0 -1
- package/assets/esri/core/workers/chunks/7f7a81ed8893ab649af7.js +0 -1
- package/assets/esri/core/workers/chunks/7ffef8a19166f6b564d8.js +0 -1
- package/assets/esri/core/workers/chunks/819781a209608dcdd678.js +0 -1
- package/assets/esri/core/workers/chunks/8d57e3a0e5687ce15557.js +0 -1
- package/assets/esri/core/workers/chunks/8e9a5d38da40702def80.js +0 -1
- package/assets/esri/core/workers/chunks/aac313257a8b1ae75b75.js +0 -1
- package/assets/esri/core/workers/chunks/be06c8a58c217a17451b.js +0 -1
- package/assets/esri/core/workers/chunks/d56548a994753b08403c.js +0 -1
- package/assets/esri/core/workers/chunks/dd95e679618b7b21a7b1.js +0 -1
- package/assets/esri/core/workers/chunks/e08a1934d98e7324776d.js +0 -1
- package/assets/esri/core/workers/chunks/e5deb72df8b2505fd325.js +0 -1
- package/assets/esri/core/workers/chunks/e689a4849f5af3f2f641.js +0 -1
- package/assets/esri/core/workers/chunks/f259ad785ce3aa970792.js +0 -1
- package/assets/esri/core/workers/chunks/f3127bdf28a1d9b8db27.js +0 -1
- package/assets/esri/core/workers/chunks/f4919950a9a3703d9da3.js +0 -1
- package/assets/esri/core/workers/chunks/f6ce485c082d0d640b01.js +0 -1
- package/assets/esri/core/workers/chunks/fd9ef4b8c969962cf72b.js +0 -1
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +0 -57
- package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +0 -5
|
@@ -8,7 +8,7 @@ smoothstep(0.0, 0.1, dot(shadingNormal, groundNormal)));
|
|
|
8
8
|
return snow * snowCover;
|
|
9
9
|
}`),e.code.add(o.H`vec3 applySnowToMRR(vec3 mrr, float snow) {
|
|
10
10
|
return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
11
|
-
}`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),o=r(49255),n=r(2451),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,o._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},12791:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const n=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${n.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):n().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>mt});var i=r(31821),o=r(12791),n=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,n.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){const o=e.clone();o.x=(0,g.GB)(e.x||0),o.y=(0,g.GB)(e.y||0),o.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,n.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,n.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,n.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,n.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,n.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(69622)),R=r(53966),F=r(90629),O=r(58083),P=r(48163),D=r(87317),H=r(91829),N=r(82919),z=r(71351),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var G;let U=G=class extends I.A{constructor(e){super(e),this._ray=(0,z.vt)(),this._viewport=(0,H.fA)(0,0,1,1),this._padding=(0,H.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,P.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,N.vt)(),this._fullViewport=(0,H.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,O.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,D.c)((0,H.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,D.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,D.c)((0,H.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,D.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,D.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,D.d)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,O.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,O.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.C)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,O.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,O.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,s=a+n,l=-r/2+this.row*o,c=l+o,d=(0,O.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,O.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,D.d)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,D.d)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,O.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,N.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,O.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,D.d)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new G).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,D.a)(this._viewport,e.viewport)&&(0,D.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,D.f)(e.screenPadding,this.screenPadding)>=t||(0,D.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.w)(k),o=(0,M.w)($),n=5e-4;return r*r>=(1-1e-10)*i*o&&(0,M.v)(e.eye,this.eye)<Math.max(i,o)*n*n}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,D.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,D.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,D.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,o=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),n=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=n):(t[0]=o,t[1]=n,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,O.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,O.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,D.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const o=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(o-r/2,0),s=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-o-r/2,0),u=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:o,fovY:n}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,o,n)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.D)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):R.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,N.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,O.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewport",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_padding",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_fov",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_nearFar",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewDirty",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewMatrix",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_pixelRatio",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"pixelRatio",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_rows",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"rows",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_columns",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"columns",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"eye",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"center",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_center",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"up",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_up",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewForward",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewUp",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewRight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"nearFar",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"near",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"far",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"screenViewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"screenPadding",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"x",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"y",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"width",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"height",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fullWidth",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fullHeight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"_aspect",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"padding",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"projectionMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"inverseProjectionMatrix",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fov",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fovX",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fovY",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewInverseTransposeMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"_projectionMatrixInternal",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"relativeElevation",void 0),U=G=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],U);const j=(0,H.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,F.r_)();class q{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new q(0,0)}static{this.Infinite=new q}}r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),new WeakMap;var Y=r(5443),X=r(39829),K=r(95108);function J(e,t,r,i){const o=function(e,t){const r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,n=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===o?0:1;if(t[r]>i&&a[r]>i)return 1===o?1:0;const s=(a[n]-t[n])/(a[r]-t[r]),l=t[n]+s*(i-t[r]);return e[r]=i,e[n]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(o(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,P.o8)(ee));break;case 2:Q(e,(0,P.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const ee=(0,P.vt)();var te=r(11964),re=r(27921);const ie=(0,T.vt)(),oe=(0,T.vt)();function ne(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function ae(e,t,r,i,o){let n=(0,M.n)(ie,e),s=(0,M.g)(n,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(n,t),l&&(0,M.j)(n,n,-1)):n=null);let c=0;if(n){(0,M.j)(oe,i,(0,M.g)(i,n)),(0,M.e)(n,n,oe);const e=(0,M.g)(n,o)/((0,M.b)(n)*(0,M.b)(o));(0,M.f)(oe,n,o),c=((0,M.g)(oe,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function se(e,t,r,i){(0,M.e)(le,r,t),(0,re.T7)(i,(0,te.LV)(t,le),e)||e===r||(0,M.d)(e,r)}const le=(0,T.vt)(),ce=(0,T.fA)(0,1,0),de=(0,T.fA)(0,0,1),ue=(0,y.vt)(),he=(0,T.vt)(),me=(0,T.vt)();function pe(e,t,r,i=ne()){const{direction:o,up:n}=i;return(0,O.N9)(ue,-(0,a.kU)(t)),(0,O.eL)(ue,ue,(0,a.kU)(r)),(0,M.p)(o,de,ue),(0,M.j)(o,o,-1),(0,M.p)(n,ce,ue),i}function fe(e,t,r,i,o){const n=t.lines[11].direction,a=(o-r.getAltitude(i))/n[2];(0,M.c)(e,i,n,a)}const ve=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o=pe(0,r,i),n=(0,T.vt)();return(0,M.j)(n,o.direction,-t),(0,M.i)(n,n,e),{up:o.up,eye:n,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),n=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,z.LV)(t.origin,t.direction),o,ve)||fe(ve,r,i,t.endpoint,o),se(ve,a,ve,l),s.push((0,P.fA)(ve[0],ve[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(ve,e[0],e[1],0),t.fromRenderCoords(ve,ve,r),[ve[0],ve[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,K.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return J(r,e,t,0),J(i,r,t,1),J(r,i,t,2),J(i,r,t,3),i}(s,i.extent),i,n)},toExtent:function(e,t,r,i,o){const n=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,he,n),(0,S.g)(t,me,n),he[0]-=r/2,me[0]+=r/2,he[1]-=i/2,me[1]+=i/2,(0,E.F)(he,n,he,a),(0,E.F)(me,n,me,a),o?(o.xmin=he[0],o.ymin=he[1],o.xmax=me[0],o.ymax=me[1],o.spatialReference=a):o=new Y.A(he[0],he[1],me[0],me[1],a),o}},Symbol.toStringTag,{value:"Module"}));var ge=r(34304),_e=r(17136),xe=r(94008),we=r(28735);class be{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,N.vt)(),this._points=(0,N.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,N.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,N.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,N.m7)(this.frustum,e)}intersectsRay(e){return(0,N.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,N.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,N.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ye(this.lines[t],e[t],e[r]),ye(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ye(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=N.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ye(e,t,r){e.origin=t,e.endpoint=r,(0,M.D)(e.direction,t,r)}r(86211);const Me=(0,T.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Te=(0,T.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,T.fA)(parseFloat(Number(Me[0]+Te[0]).toFixed(6)),parseFloat(Number(Me[1]+Te[1]).toFixed(6)),parseFloat(Number(Me[2]+Te[2]).toFixed(6)));(0,T.vt)(),(0,T.vt)(),new xe.iy,(0,z.vt)();var Ce=r(32728);const Se=(0,T.fA)(0,0,1),Ee=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Ae=(0,y.vt)(),Ie=(0,T.vt)(),Re=(0,T.vt)();function Fe(e,t,r,i=ne()){(0,M.f)(Ie,e,Se),0===(0,M.g)(Ie,Ie)&&(0,M.f)(Ie,e,Ee),(0,O.$0)(Ae,-(0,a.kU)(t),e),(0,O.e$)(Ae,Ae,-(0,a.kU)(r),Ie);const{up:o,direction:n}=i;return(0,M.f)(o,Ie,e),(0,M.n)(o,o),(0,M.p)(o,o,Ae),(0,M.n)(n,e),(0,M.q)(n,n),(0,M.p)(n,n,Ae),i}function Oe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Pe(e,t){const r=Fe(t,e.heading,e.tilt);return e.up=r.up,e}function De(e,t){const r=[],i=[],o=(0,ge.FD)();for(let n=0;n<e.length;n++){const a=e[n],s=n===e.length-1?e[0]:e[n+1],l=(0,te.Cr)(a,s,Ue),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,n,s]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),d=(0,M.c)((0,T.vt)(),Ve,l,e*o),u=(0,M.c)((0,T.vt)(),Ve,l,e*-o);n.push(a),n.push(d),s.push(u)}}}const n=[];return r.length&&n.push(r),i.length&&n.push(i),n}const He={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Ne=(0,T.fA)(1,0,0),ze=(0,T.fA)(0,1,0),Le=(0,T.vt)(),Be=(0,T.vt)(),Ve=(0,T.vt)(),Ge=new xe.iy,Ue=(0,te.vt)(),je=(0,H.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const o=Ie,n=Re;return(0,M.n)(o,e),(0,M.f)(Re,o,Se),0===(0,M.g)(Re,Re)&&(0,M.f)(Re,o,Ee),(0,M.f)(n,Re,o),ae(t,r,i,o,n)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o={eye:(0,T.vt)(),up:null,tilt:i,heading:r},n=Ie;n[0]=e[0],n[1]=e[2],n[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(n);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-n[1]*n[1]);if(b<0)return(0,M.j)(o.eye,n,f/p),o.tilt=0,Pe(o,e);const y=Math.sqrt(b),C=n[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=s):(0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e);o.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*o.eye[1],F=o.eye[1]*o.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+A-2*R*P*x+O*w;return Math.abs(D)<1e-8?((0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e)):(o.eye[0]=(O*(f*n[0]-v*n[0])-I*P*(n[0]*o.eye[1]*u+n[2]*d))/D,o.eye[2]=(O*(f*n[2]-v*n[2])-I*P*(n[2]*o.eye[1]*u-n[0]*d))/D,(0,M.j)(o.eye,o.eye,f),Oe(o.eye),Pe(o,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),o=(0,M.b)(t);return(0,a.YN)(r/(o/Math.sin(i)))+i},headingTiltToDirectionUp:Fe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),n=(0,a.YN)(r/(o/Math.sin(e)));return(0,a.KJ)(e-n)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new be(r);i.near=2,o.update(i);const n=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.C)(c,t)/(l+n),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=He,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return Ge.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(Ge,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=o.planes[5],b=[],y=(0,re.O_)(T.uY,Ne,(0,re.vt)()),C=(0,re.O_)(T.uY,ze,(0,re.vt)());(0,D.s)(je,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=o.lines[e],l=o.lines[3===e?0:e+1];for(let o=0;o<_;o++){const d=o/_,u=0===o?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Be,s.origin,l.origin,u),m=(0,Ce.nu)(s.direction,l.direction,u,Le);r.intersectManifoldClosestSilhouette((0,z.LV)(h,m),n,Ve),se(Ve,c,Ve,w),b.push((0,T.o8)(Ve)),0!==b.length&&S((0,M.v)(b.at(-1),Ve));const p=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(C,Ve)?2:0);je[p]=1}}b.length>2&&(0,M.v)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ge.FD)();return e.map(e=>{const o=[];let n=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(o.push([null,Ve[1]]),o.push([null,Ve[1]]),n=!0):o.push([Ve[0],Ve[1]]);if(n)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],i=o.at(0===e?-1:e-1);t[0]=i[0],e++;const n=o.at(e===o.length-1?0:e+1);r[0]=n[0]}return o.push(o[0]),(0,K.$3)(o)||o.reverse(),o})}((0,D.b)(je)>1?function(e,t){const r=[];for(const i of e)r.push(...De(i,t));return r}(De(b,y),C):[b],r,s);return new X.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,o){let n,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,o=(0,a.kU)(e),n=Math.sin(i/2),s=Math.cos(o),l=2*(0,a.YN)(Math.sqrt(n*n/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;n=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=_e.Y_.monotonic(n,s),s-n>180){const e=(s-n-180)/2;n+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return o?(o.xmin=n,o.ymin=l,o.xmax=s,o.ymax=c,o.spatialReference=w):o=new Y.A(n,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,we.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const We="ssao";(0,T.vt)(),r(44208);var ke=r(49186),$e=r(10107),Ze=r(64108);let qe=class extends I.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new ke.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"view",void 0),(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"consumes",void 0),(0,n.Cg)([(0,$e.MZ)()],qe.prototype,"produces",void 0),(0,n.Cg)([(0,$e.MZ)({readOnly:!0})],qe.prototype,"techniques",null),qe=(0,n.Cg)([(0,Ze.$)("esri.views.3d.webgl.RenderNode")],qe);var Ye=r(13840),Xe=r(42958),Ke=r(95774),Je=r(90644);let Qe=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(Ke.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};Qe=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],Qe);var et=r(65786);class tt extends et.Y{constructor(){super(...arguments),this.projScale=1}}class rt extends tt{constructor(){super(...arguments),this.intensity=1}}class it extends et.Y{}class ot extends it{constructor(){super(...arguments),this.blurSize=(0,P.vt)()}}var nt=r(15581);let at=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(nt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};at=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],at);var st=r(63907),lt=r(76284),ct=r(67171);const dt=2;let ut=class extends qe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=We,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new rt,this._drawParameters=new ot}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ct.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new lt.g(this.renderingContext,t,e),this.techniques.precompile(at),this.techniques.precompile(Qe),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(st.nI);if(!r||!i)return;const o=this.techniques.get(at),n=this.techniques.get(Qe);if(!o.compiled||!n.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ht/(0,nt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/dt),b=Math.round(_/dt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,dt/_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,We,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,dt/g,0),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,n.Cg)([(0,d.MZ)()],ut.prototype,"consumes",void 0),(0,n.Cg)([(0,d.MZ)()],ut.prototype,"produces",void 0),(0,n.Cg)([(0,d.MZ)({constructOnly:!0})],ut.prototype,"isEnabled",void 0),ut=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ut);const ht=.5;function mt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new o.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/dt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
11
|
+
}`))}},11725:(e,t,r)=>{r.d(t,{i:()=>l});var i=r(24326),o=r(49255),n=r(2451),a=r(43616),s=r(65786);class l{constructor(e,t){this.id=(0,i.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,a.MB)(this._parameters,e),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,a.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get hasEmissions(){return!1}getConfiguration(e,t,r=new n.E){return r.output=e,r.hasEmission=t.hasEmission&&(0,o._o)(e),r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r}}s.Y},12791:(e,t,r)=>{r.d(t,{x:()=>o});var i=r(74333);class o extends i.n{constructor(e,t){super(e,"sampler2D",0,(r,i)=>r.bindTexture(e,t(i)))}}},13840:(e,t,r)=>{r.d(t,{r:()=>i});class i{constructor(e,t){this._module=e,this._load=t}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},14113:(e,t,r)=>{r.d(t,{N5:()=>s});var i=r(49186),o=(r(44208),r(53966));const n=()=>o.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class a{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends a{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new h,this.varyings=new m,this.outputs=new p}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),o="vertex"===e?this.vertex:this.fragment,n=o.uniforms.generateSource(),a=o.code.generateSource(),s=o.main.generateSource(t),l=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?g:v,d=o.constants.generateSource(),u=this.outputs.generateSource(e);return`#version 300 es\n${l}\n${c}\n${d.join("\n")}\n${n.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${u.join("\n")}\n${a.join("\n")}\n${s.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let o=0;o<i;++o)r[o](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o)=>{for(let n=0;n<i;++n)r[n](e,t,o)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,o,n)=>{for(let a=0;a<i;++a)r[a](e,n,t,o)}}}class l{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class c{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class d{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends a{constructor(){super(...arguments),this.uniforms=new l(this),this.main=new c(this),this.code=new d(this),this.constants=new f(this)}get builder(){return this}}class h{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class p{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):n().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:p.DEFAULT_NAME,type:p.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class f{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=f._numberToFloatStr(r);break;case"int":i=f._numberToIntStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${f._numberToFloatStr(r[0])}, ${f._numberToFloatStr(r[1])}, ${f._numberToFloatStr(r[2])}, ${f._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])})`;break;case"uvec3":i=`uvec3(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])})`;break;case"uvec4":i=`uvec4(${f._numberToIntStr(r[0])}, ${f._numberToIntStr(r[1])}, ${f._numberToIntStr(r[2])}, ${f._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>f._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const v="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",g="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},14314:(e,t,r)=>{r.d(t,{I:()=>o});var i=r(74333);class o extends i.n{constructor(e,t,r){super(e,"vec4",0,(i,o)=>i.setUniform4fv(e,t(o),r))}}},14527:(e,t,r)=>{r.d(t,{n:()=>mt});var i=r(31821),o=r(12791),n=r(31635),a=r(34727),s=r(97768),l=r(36708),c=r(78659),d=r(91429),u=r(37585),h=r(69540);let m=class extends h.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,n.Cg)([(0,d.$K)("esri.CameraLayout")],m);const p=m;var f=r(69052),v=r(25482),g=r(56507),_=r(86738),x=r(43937),w=r(36005);let b=class extends((0,h.OU)(v.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new p}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const o={position:e};return null!=t&&(o.heading=t),null!=r&&(o.tilt=r),null!=i&&(o.fov=i),o}return e}writePosition(e,t,r,i){const o=e.clone();o.x=(0,g.GB)(e.x||0),o.y=(0,g.GB)(e.y||0),o.z=e.hasZ?(0,g.GB)(e.z||0):e.z,t[r]=o.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,g.GB)(r.x||0),r.y=(0,g.GB)(r.y||0),r.z=r.hasZ?(0,g.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,n.Cg)([(0,d.MZ)({type:_.A,json:{write:{isRequired:!0}}})],b.prototype,"position",void 0),(0,n.Cg)([(0,x.K)("position")],b.prototype,"writePosition",null),(0,n.Cg)([(0,w.w)("position")],b.prototype,"readPosition",null),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>f.ie.normalize((0,g.GB)(e)))],b.prototype,"heading",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e),-180,180))],b.prototype,"tilt",void 0),(0,n.Cg)([(0,d.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,d.wg)(e=>(0,a.qE)((0,g.GB)(e,55),1,170))],b.prototype,"fov",void 0),(0,n.Cg)([(0,d.MZ)({type:p,nonNullable:!0,json:{read:!1,write:!1}})],b.prototype,"layout",void 0),b=(0,n.Cg)([(0,d.$K)("esri.Camera")],b);var y=r(9093),M=r(38954),T=r(51850),C=r(16930),S=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),I=(r(19419),r(69622)),R=r(53966),F=r(90629),O=r(58083),P=r(48163),D=r(87317),H=r(91829),N=r(82919),z=r(71351),L=r(44280);const B=(0,T.vt)(),V=(0,T.vt)();var G;let U=G=class extends I.A{constructor(e){super(e),this._ray=(0,z.vt)(),this._viewport=(0,H.fA)(0,0,1,1),this._padding=(0,H.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,P.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,y.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,y.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,y.vt)(),this._frustumDirty=!0,this._frustum=(0,N.vt)(),this._fullViewport=(0,H.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,T.vt)(),this._up=(0,T.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,M.e)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,O.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,M.h)((0,T.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,D.c)((0,H.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,D.e)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,D.c)((0,H.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,D.e)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,D.a)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,D.d)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,O.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,O.B8)((0,y.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,y.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,M.D)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,O.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,O.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,o=r/this.rows,n=i/this.columns,a=-i/2+this.column*n,s=a+n,l=-r/2+this.row*o,c=l+o,d=(0,O.$h)((0,y.vt)(),a*(1+2*this._padding[3]/e),s*(1+2*this._padding[1]/e),l*(1+2*this._padding[2]/t),c*(1+2*this._padding[0]/t),this.near,this.far),u=this._get("projectionMatrix");return u&&(0,O.aI)(u,d)?u:d}copyFrom(e){(0,M.d)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,D.d)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,D.d)(this._padding,e.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,O.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,N.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,O.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,D.d)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new G).copyFrom(this)}equals(e){return(0,M.m)(this.eye,e.eye)&&(0,M.m)(this.center,e.center)&&(0,M.m)(this.up,e.up)&&(0,D.a)(this._viewport,e.viewport)&&(0,D.a)(this._padding,e.padding)&&(0,u.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,D.f)(e.screenPadding,this.screenPadding)>=t||(0,D.f)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,M.a)(k,e.eye,e.center),(0,M.a)($,this.eye,this.center);const r=(0,M.g)(k,$),i=(0,M.w)(k),o=(0,M.w)($),n=5e-4;return r*r>=(1-1e-10)*i*o&&(0,M.v)(e.eye,this.eye)<Math.max(i,o)*n*n}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,M.e)(k,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==j&&(0,M.d)(j,e),j[3]=1,(0,D.t)(j,j,this.projectionMatrix);const r=Math.abs(j[3]);(0,M.j)(j,j,1/r);const i=this.fullViewport;t[0]=(0,a.Cc)(0,i[0]+i[2],.5+.5*j[0]),t[1]=(0,a.Cc)(0,i[1]+i[3],.5+.5*j[1]),t[2]=.5*(j[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;j[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],j[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],j[2]=(2*e[2]-1)*e[3],j[3]=e[3],null!=this.inverseProjectionMatrix&&((0,D.t)(j,j,this.inverseProjectionMatrix),t[0]=j[0],t[1]=j[1],t[2]=j[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,Z),this.renderToScreen(Z,t),t}projectToRenderScreen(e,t){if(j[0]=e[0],j[1]=e[1],j[2]=e[2],j[3]=1,(0,D.t)(j,j,this.viewProjectionMatrix),0===j[3])return null;const r=j;(0,M.j)(r,r,1/Math.abs(j[3]));const i=this.fullViewport,o=(0,a.Cc)(0,i[0]+i[2],.5+.5*r[0]),n=(0,a.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=o,t.y=n):(t[0]=o,t[1]=n,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,Z),t)}unprojectFromRenderScreen(e,t){if((0,O.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,O.B8)(W,W))return null;const r=this.fullViewport;return j[0]=2*(e[0]-r[0])/r[2]-1,j[1]=2*(e[1]-r[1])/r[3]-1,j[2]=2*e[2]-1,j[3]=1,(0,D.t)(j,j,W),0===j[3]?null:(t[0]=j[0]/j[3],t[1]=j[1]/j[3],t[2]=j[2]/j[3],t)}constrainWindowSize(e,t,r,i){const o=e*this.pixelRatio,n=t*this.pixelRatio,a=Math.max(o-r/2,0),s=Math.max(this.fullHeight-n-i/2,0),l=-Math.min(o-r/2,0),c=-Math.min(this.fullHeight-n-i/2,0),d=r-l- -Math.min(this.fullWidth-o-r/2,0),u=i-c- -Math.min(n-i/2,0);return[Math.round(a),Math.round(s),Math.round(d),Math.round(u)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:o,fovY:n}=this,s=Math.abs(Math.PI/2-function(e,t,r){e.worldUpAtPosition(t,B),(0,M.e)(V,r,t);const i=(0,M.b)(V);return 0===i?0:(0,a.XM)((0,M.g)(V,B)/i)}(t,r,i));return e.frustumCoverage(s,o,n)}_computeUpGlobal(){(0,M.e)(k,this.center,this.eye);const e=(0,M.b)(this.center);e<1?(0,M.m)(this._up,T.Cb)&&((0,M.d)(this._up,T.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,M.g)(k,this.center))>.9999*(0,M.b)(k)*e||((0,M.f)($,k,this.center),(0,M.f)($,$,k),(0,M.n)($,$),(0,M.m)(this._up,$)||((0,M.d)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,M.E)(k,this.eye,this.center),Math.abs(k[2])<=.9999&&((0,M.j)(k,k,k[2]),(0,M.h)(k,-k[0],-k[1],1-k[2]),(0,M.n)(k,k),(0,M.m)(this._up,k)||((0,M.d)(this._up,k),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,M.m)(e,t)||((0,M.d)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):R.A.getLogger("esri.views.3d.webgl-engine.lib.RenderCamera").warn("RenderCamera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&((0,N.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,O.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewport",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_padding",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_fov",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_nearFar",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewDirty",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_viewMatrix",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_pixelRatio",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"pixelRatio",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"row",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"column",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_rows",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"rows",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_columns",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"columns",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"eye",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"center",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_center",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"up",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"_up",void 0),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewForward",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewUp",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"viewRight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"nearFar",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"near",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"far",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"screenViewport",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"screenPadding",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"x",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"y",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"width",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"height",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fullWidth",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fullHeight",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"_aspect",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"padding",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"projectionMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"inverseProjectionMatrix",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fov",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fovX",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"fovY",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"viewInverseTransposeMatrix",null),(0,n.Cg)([(0,d.MZ)({readOnly:!0})],U.prototype,"_projectionMatrixInternal",null),(0,n.Cg)([(0,d.MZ)()],U.prototype,"relativeElevation",void 0),U=G=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl.RenderCamera")],U);const j=(0,H.vt)(),W=(0,y.vt)(),k=(0,T.vt)(),$=(0,T.vt)(),Z=(0,F.r_)();class q{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new q(0,0)}static{this.Infinite=new q}}r(49718),r(6867),r(16396),(0,T.vt)(),(0,T.vt)(),(0,T.vt)(),new WeakMap;var Y=r(5443),X=r(39829),K=r(95108);function J(e,t,r,i){const o=function(e,t){const r=0===t||2===t?0:1,i=e[t],o=0===t||1===t?1:-1,n=0===r?1:0;return(e,t,a)=>{if(t[r]<i&&a[r]<i)return 1===o?0:1;if(t[r]>i&&a[r]>i)return 1===o?1:0;const s=(a[n]-t[n])/(a[r]-t[r]),l=t[n]+s*(i-t[r]);return e[r]=i,e[n]=l,(t[r]<i?1:-1)*o>0?2:3}}(r,i);if(e.length=0,t.length){1===o(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(o(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,P.o8)(ee));break;case 2:Q(e,(0,P.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,u.aI)(e.at(-1),t)||e.push(t)}const ee=(0,P.vt)();var te=r(11964),re=r(27921);const ie=(0,T.vt)(),oe=(0,T.vt)();function ne(){return{direction:(0,T.vt)(),up:(0,T.vt)()}}function ae(e,t,r,i,o){let n=(0,M.n)(ie,e),s=(0,M.g)(n,i);const l=s>0;s=Math.abs(s),s>.99&&(s=Math.abs((0,M.g)(t,i)),s<.99?((0,M.d)(n,t),l&&(0,M.j)(n,n,-1)):n=null);let c=0;if(n){(0,M.j)(oe,i,(0,M.g)(i,n)),(0,M.e)(n,n,oe);const e=(0,M.g)(n,o)/((0,M.b)(n)*(0,M.b)(o));(0,M.f)(oe,n,o),c=((0,M.g)(oe,i)>0?1:-1)*(0,a.KJ)((0,a.XM)(e))}const d=(0,a.KJ)((0,a.XM)(-(0,M.g)(i,e)/(0,M.b)(e)));return r?(r.heading=c,r.tilt=d,r):{heading:c,tilt:d}}function se(e,t,r,i){(0,M.e)(le,r,t),(0,re.T7)(i,(0,te.LV)(t,le),e)||e===r||(0,M.d)(e,r)}const le=(0,T.vt)(),ce=(0,T.fA)(0,1,0),de=(0,T.fA)(0,0,1),ue=(0,y.vt)(),he=(0,T.vt)(),me=(0,T.vt)();function pe(e,t,r,i=ne()){const{direction:o,up:n}=i;return(0,O.N9)(ue,-(0,a.kU)(t)),(0,O.eL)(ue,ue,(0,a.kU)(r)),(0,M.p)(o,de,ue),(0,M.j)(o,o,-1),(0,M.p)(n,ce,ue),i}function fe(e,t,r,i,o){const n=t.lines[11].direction,a=(o-r.getAltitude(i))/n[2];(0,M.c)(e,i,n,a)}const ve=(0,T.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return ae(t,r,i,de,ce)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o=pe(0,r,i),n=(0,T.vt)();return(0,M.j)(n,o.direction,-t),(0,M.i)(n,n,e),{up:o.up,eye:n,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,a.kU)(e)},headingTiltToDirectionUp:pe,lookAtTiltToEyeTilt:function(e){return(0,a.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,o=i.getAltitude(t),n=e.spatialReference,a=e.state.camera.eye,s=[],l=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,z.LV)(t.origin,t.direction),o,ve)||fe(ve,r,i,t.endpoint,o),se(ve,a,ve,l),s.push((0,P.fA)(ve[0],ve[1]))}return function(e,t,r){const i=e.map(e=>((0,M.h)(ve,e[0],e[1],0),t.fromRenderCoords(ve,ve,r),[ve[0],ve[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,K.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return J(r,e,t,0),J(i,r,t,1),J(r,i,t,2),J(i,r,t,3),i}(s,i.extent),i,n)},toExtent:function(e,t,r,i,o){const n=e.renderSpatialReference,a=e.spatialReference??t.spatialReference;return(0,S.g)(t,he,n),(0,S.g)(t,me,n),he[0]-=r/2,me[0]+=r/2,he[1]-=i/2,me[1]+=i/2,(0,E.F)(he,n,he,a),(0,E.F)(me,n,me,a),o?(o.xmin=he[0],o.ymin=he[1],o.xmax=me[0],o.ymax=me[1],o.spatialReference=a):o=new Y.A(he[0],he[1],me[0],me[1],a),o}},Symbol.toStringTag,{value:"Module"}));var ge=r(34304),_e=r(17136),xe=r(94008),we=r(28735);class be{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}get origin(){return this._origin}constructor(e){this.renderCoordsHelper=e,this.frustum=(0,N.vt)(),this._points=(0,N.Qy)(),this.lines=new Array(12),this._origin=(0,T.vt)(),this._direction=(0,T.vt)(),this._altitude=null;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,T.vt)(),endpoint:null}}update(e){(0,N.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,M.d)(this._origin,e.eye),(0,M.d)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,M.d)(this._points[t],e[t]);(0,N.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,N.m7)(this.frustum,e)}intersectsRay(e){return(0,N.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,N.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,N.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;ye(this.lines[t],e[t],e[r]),ye(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),ye(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}static{this.planePointIndices=N.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function ye(e,t,r){e.origin=t,e.endpoint=r,(0,M.E)(e.direction,t,r)}r(86211);const Me=(0,T.fA)(parseFloat(Number(5802e-9).toFixed(6)),parseFloat(Number(13558e-9).toFixed(6)),parseFloat(Number(331e-7).toFixed(6))),Te=(0,T.fA)(3*parseFloat(Number(65e-8).toFixed(6)),3*parseFloat(Number(1881e-9).toFixed(6)),3*parseFloat(Number(85e-9).toFixed(6)));(0,T.fA)(parseFloat(Number(Me[0]+Te[0]).toFixed(6)),parseFloat(Number(Me[1]+Te[1]).toFixed(6)),parseFloat(Number(Me[2]+Te[2]).toFixed(6)));(0,T.vt)(),(0,T.vt)(),new xe.iy,(0,z.vt)();var Ce=r(32728);const Se=(0,T.fA)(0,0,1),Ee=(0,M.n)((0,T.vt)(),(0,T.fA)(1,1,1)),Ae=(0,y.vt)(),Ie=(0,T.vt)(),Re=(0,T.vt)();function Fe(e,t,r,i=ne()){(0,M.f)(Ie,e,Se),0===(0,M.g)(Ie,Ie)&&(0,M.f)(Ie,e,Ee),(0,O.$0)(Ae,-(0,a.kU)(t),e),(0,O.e$)(Ae,Ae,-(0,a.kU)(r),Ie);const{up:o,direction:n}=i;return(0,M.f)(o,Ie,e),(0,M.n)(o,o),(0,M.p)(o,o,Ae),(0,M.n)(n,e),(0,M.q)(n,n),(0,M.p)(n,n,Ae),i}function Oe(e){const t=e[1];e[1]=-e[2],e[2]=t}function Pe(e,t){const r=Fe(t,e.heading,e.tilt);return e.up=r.up,e}function De(e,t){const r=[],i=[],o=(0,ge.FD)();for(let n=0;n<e.length;n++){const a=e[n],s=n===e.length-1?e[0]:e[n+1],l=(0,te.Cr)(a,s,Ue),c=(0,re.vE)(t,l.origin,l.vector,0,Ve);switch(c){case 2:r.push(a);break;case 3:i.push(a);break;case 0:case 1:{const[e,n,s]=0===c?[1,r,i]:[-1,i,r],l=(0,re.Qj)(t),d=(0,M.c)((0,T.vt)(),Ve,l,e*o),u=(0,M.c)((0,T.vt)(),Ve,l,e*-o);n.push(a),n.push(d),s.push(u)}}}const n=[];return r.length&&n.push(r),i.length&&n.push(i),n}const He={minCurvature:(0,a.kU)(5),maxCurvature:(0,a.kU)(50),minSamples:1,maxSamples:6},Ne=(0,T.fA)(1,0,0),ze=(0,T.fA)(0,1,0),Le=(0,T.vt)(),Be=(0,T.vt)(),Ve=(0,T.vt)(),Ge=new xe.iy,Ue=(0,te.vt)(),je=(0,H.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const o=Ie,n=Re;return(0,M.n)(o,e),(0,M.f)(Re,o,Se),0===(0,M.g)(Re,Re)&&(0,M.f)(Re,o,Ee),(0,M.f)(n,Re,o),ae(t,r,i,o,n)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const o={eye:(0,T.vt)(),up:null,tilt:i,heading:r},n=Ie;n[0]=e[0],n[1]=e[2],n[2]=-e[1];const s=t,l=(0,a.kU)(r),c=(0,a.kU)(i),d=Math.sin(l),u=Math.cos(l),h=Math.sin(c),m=Math.cos(c),p=(0,M.b)(n);let f;if(Math.abs(c)<1e-8)f=s+p;else{const e=p/h,t=(0,a.YN)(s/e),r=Math.PI-c-t;f=e*Math.sin(r)}const v=m*s,g=s*s*(h*h),_=u*u*g,x=f-v,w=x*x,b=_*(_+w-n[1]*n[1]);if(b<0)return(0,M.j)(o.eye,n,f/p),o.tilt=0,Pe(o,e);const y=Math.sqrt(b),C=n[1]*x,S=_+w;let E;if(E=u>0?-y+C:y+C,Math.abs(S)<1e-8)return p<1e-8?(o.eye[0]=0,o.eye[1]=0,o.eye[2]=s):(0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e);o.eye[1]=E/S;const A=d*d*g,I=h*s,R=u*I*o.eye[1],F=o.eye[1]*o.eye[1],O=1-F,P=Math.sqrt(O),D=_*F+A-2*R*P*x+O*w;return Math.abs(D)<1e-8?((0,M.j)(o.eye,n,f/p),o.tilt=0,Oe(o.eye),Pe(o,e)):(o.eye[0]=(O*(f*n[0]-v*n[0])-I*P*(n[0]*o.eye[1]*u+n[2]*d))/D,o.eye[2]=(O*(f*n[2]-v*n[2])-I*P*(n[2]*o.eye[1]*u-n[0]*d))/D,(0,M.j)(o.eye,o.eye,f),Oe(o.eye),Pe(o,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,a.kU)(e),o=(0,M.b)(t);return(0,a.YN)(r/(o/Math.sin(i)))+i},headingTiltToDirectionUp:Fe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,M.b)(t),o=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),n=(0,a.YN)(r/(o/Math.sin(e)));return(0,a.KJ)(e-n)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),o=new be(r);i.near=2,o.update(i);const n=r.getAltitude(t),s=e.spatialReference,l=r.referenceEllipsoid.radius,c=i.eye,d=1+(0,M.D)(c,t)/(l+n),u=Math.sqrt(d*d-1),{minCurvature:h,maxCurvature:m,minSamples:p,maxSamples:f}=He,v=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return Ge.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(Ge,t)}(e),g=(0,a.qE)((u-h)/(m-h),0,1),_=Math.round((0,a.Cc)(p,f,g)),x=i.aboveGround,w=o.planes[5],b=[],y=(0,re.O_)(T.uY,Ne,(0,re.vt)()),C=(0,re.O_)(T.uY,ze,(0,re.vt)());(0,D.s)(je,0,0,0,0);const S=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-v:0,i=1===e&&x||3===e&&!x?v:1,s=o.lines[e],l=o.lines[3===e?0:e+1];for(let o=0;o<_;o++){const d=o/_,u=0===o?0:(0,a.Cc)(t,i,1===e?1-(1-d)**2:3===e?d**2:d),h=(0,M.l)(Be,s.origin,l.origin,u),m=(0,Ce.nu)(s.direction,l.direction,u,Le);r.intersectManifoldClosestSilhouette((0,z.LV)(h,m),n,Ve),se(Ve,c,Ve,w),b.push((0,T.o8)(Ve)),0!==b.length&&S((0,M.v)(b.at(-1),Ve));const p=((0,re.Tj)(y,Ve)?1:0)|((0,re.Tj)(C,Ve)?2:0);je[p]=1}}b.length>2&&(0,M.v)(b[0],b.at(-1));const E=function(e,t,r){const i=2*(0,ge.FD)();return e.map(e=>{const o=[];let n=!1;for(const a of e)t.fromRenderCoords(a,Ve,r),Math.abs(a[0])<i&&Math.abs(a[1])<i?(o.push([null,Ve[1]]),o.push([null,Ve[1]]),n=!0):o.push([Ve[0],Ve[1]]);if(n)for(let e=0;e<o.length;e++){const t=o[e];if(null!=t[0])continue;const r=o[e+1],i=o.at(0===e?-1:e-1);t[0]=i[0],e++;const n=o.at(e===o.length-1?0:e+1);r[0]=n[0]}return o.push(o[0]),(0,K.$3)(o)||o.reverse(),o})}((0,D.b)(je)>1?function(e,t){const r=[];for(const i of e)r.push(...De(i,t));return r}(De(b,y),C):[b],r,s);return new X.A({rings:E,spatialReference:s})},toExtent:function(e,t,r,i,o){let n,s,l,c;const d=t.latitude,u=(0,A.tO)(e.spatialReference).radius,h=t.longitude,m=function(e,t,r){const i=t/r,o=(0,a.kU)(e),n=Math.sin(i/2),s=Math.cos(o),l=2*(0,a.YN)(Math.sqrt(n*n/(s*s)));return(0,a.KJ)(l)}(d,r,u)/2;n=h-m,s=h+m;const p=(0,a.kU)(d),v=(1+Math.sin(p))/(1-Math.sin(p)),g=(v+1)*Math.tan(i/u/2),_=g*g;function x(e){const t=Math.PI/2;return(e=f.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(l=1.5*Math.PI-2*Math.atan(.5*(g+Math.sqrt(4*v+_))),c=l+i/u,l=x(l),c=x(c),c<l){const e=c;c=l,l=e}if(l=Math.max((0,a.KJ)(l),-90),c=Math.min((0,a.KJ)(c),90),s=_e.Y_.monotonic(n,s),s-n>180){const e=(s-n-180)/2;n+=e,s-=e}const w=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:C.A.WGS84;return o?(o.xmin=n,o.ymin=l,o.xmax=s,o.ymax=c,o.spatialReference=w):o=new Y.A(n,l,s,c,w),e.spatialReference&&e.spatialReference.isWebMercator&&(0,we.Gh)(o,!1,o),o}},Symbol.toStringTag,{value:"Module"}));const We="ssao";(0,T.vt)(),r(44208);var ke=r(49186),$e=r(10107),Ze=r(64108);let qe=class extends I.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces="composite-color",this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,l.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},l.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new ke.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return t.fbo?.initializeAndBind(),t}bindRenderTarget(){return this._frameBuffer?.fbo?.initializeAndBind(),this._frameBuffer}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"view",void 0),(0,n.Cg)([(0,$e.MZ)({constructOnly:!0})],qe.prototype,"consumes",void 0),(0,n.Cg)([(0,$e.MZ)()],qe.prototype,"produces",void 0),(0,n.Cg)([(0,$e.MZ)({readOnly:!0})],qe.prototype,"techniques",null),qe=(0,n.Cg)([(0,Ze.$)("esri.views.3d.webgl.RenderNode")],qe);var Ye=r(13840),Xe=r(42958),Ke=r(95774),Je=r(90644);let Qe=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(Ke.S,()=>r.e(9384).then(r.bind(r,59384)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};Qe=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],Qe);var et=r(65786);class tt extends et.Y{constructor(){super(...arguments),this.projScale=1}}class rt extends tt{constructor(){super(...arguments),this.intensity=1}}class it extends et.Y{}class ot extends it{constructor(){super(...arguments),this.blurSize=(0,P.vt)()}}var nt=r(15581);let at=class extends Xe.w{constructor(){super(...arguments),this.shader=new Ye.r(nt.S,()=>r.e(191).then(r.bind(r,90191)))}initializePipeline(){return(0,Je.Ey)({colorWrite:Je.kn})}};at=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],at);var st=r(63907),lt=r(76284),ct=r(67171);const dt=2;let ut=class extends qe{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=We,this.isEnabled=()=>!1,this._enableTime=(0,c.l5)(0),this._passParameters=new rt,this._drawParameters=new ot}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new ct.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new lt.g(this.renderingContext,t,e),this.techniques.precompile(at),this.techniques.precompile(Qe),this.addHandles((0,l.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,c.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,s.WD)(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(st.nI);if(!r||!i)return;const o=this.techniques.get(at),n=this.techniques.get(Qe);if(!o.compiled||!n.compiled)return this._enableTime=(0,c.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,c.l5)(performance.now()));const s=this.renderingContext,l=this.view.qualitySettings.fadeDuration,d=this.bindParameters,h=d.camera,m=h.relativeElevation,p=(0,a.qE)((5e5-m)/2e5,0,1),f=l>0?Math.min(l,performance.now()-this._enableTime)/l:1,v=f*p;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/h.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*ht/(0,nt.g)(h)**6*v;const g=h.fullViewport[2],_=h.fullViewport[3],x=this.fboCache.acquire(g,_,"ssao input",2);s.bindFramebuffer(x.fbo),s.setViewport(0,0,g,_),s.bindTechnique(o,d,this._passParameters,this._drawParameters),s.screen.draw();const w=Math.round(g/dt),b=Math.round(_/dt),y=this.fboCache.acquire(w,b,"ssao blur",0);s.bindFramebuffer(y.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,0,dt/_),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),x.release();const M=this.fboCache.acquire(w,b,We,0);return s.bindFramebuffer(M.fbo),s.setViewport(0,0,g,_),s.setClearColor(1,1,1,0),s.clear(16384),this._drawParameters.colorTexture=y.getTexture(),(0,u.hZ)(this._drawParameters.blurSize,dt/g,0),s.bindTechnique(n,d,this._passParameters,this._drawParameters),s.setViewport(0,0,w,b),s.screen.draw(),s.setViewport4fv(h.fullViewport),y.release(),f<1&&this.requestRender(2),M}};(0,n.Cg)([(0,d.MZ)()],ut.prototype,"consumes",void 0),(0,n.Cg)([(0,d.MZ)()],ut.prototype,"produces",void 0),(0,n.Cg)([(0,d.MZ)({constructOnly:!0})],ut.prototype,"isEnabled",void 0),ut=(0,n.Cg)([(0,d.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ut);const ht=.5;function mt(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new o.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",1/dt),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
12
12
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
13
13
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
14
14
|
}
|
|
@@ -746,7 +746,7 @@ return color;
|
|
|
746
746
|
}`)}const w=(0,s.vt)()},72824:(e,t,r)=>{r.d(t,{Mh:()=>u,Zo:()=>h,gy:()=>m});var i=r(21818),o=r(29242),n=r(91829),a=r(96336),s=r(33752),l=r(31821),c=r(98353),d=r(35644);function u(e,t){switch(t.normalType){case 0:case 1:e.include(a.Y,t),e.varyings.add("vNormalWorld","vec3"),e.varyings.add("vNormalView","vec3"),e.vertex.uniforms.add(new c.h("transformNormalGlobalFromModel",e=>e.transformNormalGlobalFromModel),new d.k("transformNormalViewFromGlobal",e=>e.transformNormalViewFromGlobal)).code.add(l.H`void forwardNormal() {
|
|
747
747
|
vNormalWorld = transformNormalGlobalFromModel * normalModel();
|
|
748
748
|
vNormalView = transformNormalViewFromGlobal * vNormalWorld;
|
|
749
|
-
}`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,o.vt)(),this.toMapSpace=(0,n.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>l,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.m)(s,o.uY))&&null==l&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),l=(0,o.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),o=r(44208),n=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>n.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:o}=e;if(o&&(p(o)||f(o))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:o}=e;o&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function v(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!v(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let o=Math.max(t,r);return 32879===e&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const y=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>n.A.getLogger("esri/views/webgl/Texture");class T{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!v(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!v(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,o,n,a,s=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=w(l);const{context:c,pixelFormat:d,dataType:u,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+o>l.width||r+n>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;s&&(o&&n||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,s)),g(a)?f.texSubImage2D(h,e,t,r,o,n,d,u,a):v(a)?f.compressedTexSubImage2D(h,e,t,r,o,n,l.internalFormat,a.levels[e]):f.texSubImage2D(h,e,t,r,o,n,d,u,a),s&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,T.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||M().warn("Attempting to set 3D texture data on a non-3D texture");const f=d.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||t+n>c.width||r+a>c.height||o+s>c.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=d;if(v(l))l=l.levels[e],g.compressedTexSubImage3D(p,e,t,r,o,n,a,s,c.internalFormat,l);else{const i=l;g.texSubImage3D(p,e,t,r,o,n,a,s,u,h,i)}d.bindTexture(f,T.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,T.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,o=r.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),r.context.instanceCounter.increment(d.vt.Texture,this)),m(r);const n=r.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const a=t??r.target,l=_(a);if(g(e))this._setDataFromTexImageSource(e,a);else{const{width:t,height:n,depth:u}=r;if(null==t||null==n)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==u)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=w(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,r.internalFormat,r.hasMipmap,t,n,u),v(e)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,a)}else this._texImage(a,0,r.internalFormat,t,n,u,e),(0,c.Y2)(o),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),r.context.bindTexture(n,T.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const o=_(t),{width:n,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,s),this._texImage(t,0,i.internalFormat,n,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,l=x(r,o,n,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)},c)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,o,n,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,o,n,a)}else s.texStorage2D(e,l,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,n,a,u,h,r)}else l.texSubImage2D(e,t,0,0,o,n,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,n,a,0,u,h,d)}else l.texImage2D(e,t,r,o,n,0,u,h,d)}}_compressedTexImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,n,a,0,s)}else l.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:o,preMultiplyAlpha:n,hasMipmap:a}=this._descriptor,s=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:u}=i.capabilities;if(!T.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!d&&!u)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,s?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:a,hasETC:!!d,hasS3TC:!!u},s=await T.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),s.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=s.internalFormat,this._setData(s.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{s?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==o||l&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||l&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),l&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
|
|
749
|
+
}`);break;case 2:e.vertex.code.add(l.H`void forwardNormal() {}`);break;default:(0,i.Xb)(t.normalType);case 3:}}class h extends s.dO{constructor(){super(...arguments),this.transformNormalViewFromGlobal=(0,o.vt)()}}class m extends s.EM{constructor(){super(...arguments),this.transformNormalGlobalFromModel=(0,o.vt)(),this.toMapSpace=(0,n.vt)()}}},74333:(e,t,r)=>{r.d(t,{n:()=>i}),r(44208);class i{constructor(e,t,r,i,o=null){if(this.name=e,this.type=t,this.arraySize=o,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},74810:(e,t,r)=>{r.d(t,{Bt:()=>s,Jr:()=>n,SY:()=>l,mb:()=>a});var i=r(38954),o=r(51850);function n({normalTexture:e,metallicRoughnessTexture:t,metallicFactor:r,roughnessFactor:n,emissiveTexture:a,emissiveFactor:s,occlusionTexture:l}){return null==e&&null==t&&null==a&&(null==s||(0,i.m)(s,o.uY))&&null==l&&(null==n||1===n)&&(null==r||1===r)}const a=(0,o.CN)(1,1,.5),s=(0,o.CN)(0,.6,.2),l=(0,o.CN)(0,1,.2)},76284:(e,t,r)=>{r.d(t,{g:()=>T});var i=r(49186),o=r(44208),n=r(53966),a=r(97768),s=r(93637),l=r(74887),c=r(94656),d=r(63907),u=r(67171);const h=()=>n.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&h().error("Negative dimension parameters are not allowed!");const{internalFormat:o}=e;if(o&&(p(o)||f(o))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:o}=e;o&&h().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&h().error("Depth textures cannot sample mipmaps"):(9728!==i&&h().error("Depth textures without filtering must use NEAREST filtering"),r&&h().error("Depth textures without filtering cannot use compare function"))}}function p(e){return(0,s.a4)(d.SB,e)}function f(e){return(0,s.a4)(d.iE,e)}function v(e){return null!=e&&"type"in e&&"compressed"===e.type}function g(e){return null!=e&&!v(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let o=Math.max(t,r);return 32879===e&&(o=Math.max(o,i)),Math.floor(Math.log2(o))+1}function w(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case d.ld.FLOAT:switch(e.pixelFormat){case 6408:return d.H0.RGBA32F;case 6407:return d.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case d.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return d.H0.RGBA8;case 6407:return d.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?d.iE.DEPTH24_STENCIL8:6402===t?d.SB.DEPTH_COMPONENT24:t,e.internalFormat}class b extends u.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case d.H0.R16F:case d.H0.R32F:case d.H0.R8_SNORM:case d.H0.R8:this.pixelFormat=6403;break;case d.H0.R8I:case d.H0.R8UI:case d.H0.R16I:case d.H0.R16UI:case d.H0.R32I:case d.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new b(e,t)}}const y=!!(0,o.A)("esri-tests-disable-gpu-memory-measurements"),M=()=>n.A.getLogger("esri/views/webgl/Texture");class T{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=b.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return y?0:(0,u.e)(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(d.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!v(e)&&this._descriptor.internalFormat&&(0,s.a4)(d.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!v(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,o,n,a,s=0){a||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update uninitialized texture!");const l=this._descriptor;l.internalFormat=w(l);const{context:c,pixelFormat:d,dataType:u,target:h,isImmutable:m}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const p=c.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+o>l.width||r+n>l.height)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:f}=c;s&&(o&&n||M().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),f.pixelStorei(f.UNPACK_SKIP_ROWS,s)),g(a)?f.texSubImage2D(h,e,t,r,o,n,d,u,a):v(a)?f.compressedTexSubImage2D(h,e,t,r,o,n,l.internalFormat,a.levels[e]):f.texSubImage2D(h,e,t,r,o,n,d,u,a),s&&f.pixelStorei(f.UNPACK_SKIP_ROWS,0),c.bindTexture(p,T.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,o,n,a,s,l){l||M().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||M().error("An attempt to update an uninitialized texture!");const c=this._descriptor;c.internalFormat=w(c);const{context:d,pixelFormat:u,dataType:h,isImmutable:m,target:p}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(p)||M().warn("Attempting to set 3D texture data on a non-3D texture");const f=d.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||o<0||t+n>c.width||r+a>c.height||o+s>c.depth)&&M().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:g}=d;if(v(l))l=l.levels[e],g.compressedTexSubImage3D(p,e,t,r,o,n,a,s,c.internalFormat,l);else{const i=l;g.texSubImage3D(p,e,t,r,o,n,a,s,u,h,i)}d.bindTexture(f,T.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,T.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,a.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,o=r.context?.gl;if(!o)return;(0,c.Y2)(o),this.hasWebGLTextureObject||(this._glName=o.createTexture(),r.context.instanceCounter.increment(d.vt.Texture,this)),m(r);const n=r.context.bindTexture(this,T.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(T.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,c.Y2)(o);const a=t??r.target,l=_(a);if(g(e))this._setDataFromTexImageSource(e,a);else{const{width:t,height:n,depth:u}=r;if(null==t||null==n)throw new i.A("texture:missing-size","Width and height must be specified!");if(l&&null==u)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=w(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(a,r.internalFormat,r.hasMipmap,t,n,u),v(e)){if(!function(e){return null!=e&&(0,s.a4)(d.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,a)}else this._texImage(a,0,r.internalFormat,t,n,u,e),(0,c.Y2)(o),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,c.Y2)(o),r.context.bindTexture(n,T.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=w(i);const o=_(t),{width:n,height:a,depth:s}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=n),i.height||(i.height=a),o&&i.depth,o&&(i.depth=s),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,n,a,s),this._texImage(t,0,i.internalFormat,n,a,s,e),(0,c.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,c.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:o,height:n,depth:a}=i,s=e.levels,l=x(r,o,n,a),c=Math.min(l,s.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,c),this._forEachMipmapLevel((e,i,o,n)=>{const a=s[Math.min(e,s.length-1)];this._compressedTexImage(r,e,t,i,o,n,a)},c)}_texStorage(e,t,r,o,n,a){const{gl:s}=this._descriptor.context;if(!function(e){return d.XN.includes(e)}(t)&&!p(t)&&!f(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?x(e,o,n,a):1;if(_(e)){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");s.texStorage3D(e,l,t,o,n,a)}else s.texStorage2D(e,l,t,o,n);this._wasImmutablyAllocated=!0}_texImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e),{isImmutable:d,pixelFormat:u,dataType:h}=this._descriptor;if(d){if(null!=s){const r=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,o,n,a,u,h,r)}else l.texSubImage2D(e,t,0,0,o,n,u,h,r)}}else{const d=s;if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.texImage3D(e,t,r,o,n,a,0,u,h,d)}else l.texImage2D(e,t,r,o,n,0,u,h,d)}}_compressedTexImage(e,t,r,o,n,a,s){const l=this._descriptor.context.gl,c=_(e);if(this._descriptor.isImmutable){if(null!=s)if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,o,n,a,r,s)}else l.compressedTexSubImage2D(e,t,0,0,o,n,r,s)}else if(c){if(null==a)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,r,o,n,a,0,s)}else l.compressedTexImage2D(e,t,r,o,n,0,s)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:o,preMultiplyAlpha:n,hasMipmap:a}=this._descriptor,s=this._descriptor.compress?.compressionTracker,c=this._descriptor.compress?.compressionCallback,{compressedTextureETC:d,compressedTextureS3TC:u}=i.capabilities;if(!T.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!d&&!u)return;this.abortCompression();const h=new AbortController;let m;this._compressionAbortController=h,s?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:o?"flipY":"none"}),(0,l.Te)(h));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:a,hasETC:!!d,hasS3TC:!!u},s=await T.compressionWorkerHandle.invoke(i,h.signal,1);if((0,l.Te)(h),s.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=s.internalFormat,this._setData(s.compressedTexture),c?.(e-this.usedMemory)}}catch(e){(0,l.zf)(e)||M().error("Texture compression failed!")}finally{s?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:o,depth:n,hasMipmap:a,target:s}=this._descriptor;const l=32879===s;if(null==r||null==o||l&&null==n)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,o,n),a&&(1!==r||1!==o||l&&1!==n)&&!(i>=t);++i)r=Math.max(1,r>>1),o=Math.max(1,o>>1),l&&(n=Math.max(1,n>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,c.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},76591:(e,t,r)=>{r.d(t,{HQ:()=>c,rA:()=>d});var i=r(58083),o=r(9093),n=r(38954),a=r(51850),s=r(40710),l=(r(33079),r(31821));function c(e,t){!function(e,t,...r){e.constants.add("groundSliceOpacity","float",.2),h(e,t,...r),t.hasSlicePlane?e.code.add("\n void discardBySlice(vec3 pos) {\n if (sliceByPlane(pos)) {\n discard;\n }\n }\n\n vec4 applySliceOutline(vec4 color, vec3 pos) {\n SliceFactors factors = calculateSliceFactors(pos);\n\n factors.front /= 2.0 * fwidth(factors.front);\n factors.side0 /= 2.0 * fwidth(factors.side0);\n factors.side1 /= 2.0 * fwidth(factors.side1);\n factors.side2 /= 2.0 * fwidth(factors.side2);\n factors.side3 /= 2.0 * fwidth(factors.side3);\n\n // return after calling fwidth, to avoid aliasing caused by discontinuities in the input to fwidth\n if (sliceByFactors(factors)) {\n return color;\n }\n\n float outlineFactor = (1.0 - step(0.5, factors.front))\n * (1.0 - step(0.5, factors.side0))\n * (1.0 - step(0.5, factors.side1))\n * (1.0 - step(0.5, factors.side2))\n * (1.0 - step(0.5, factors.side3));\n\n return mix(color, vec4(vec3(0.0), color.a), outlineFactor * 0.3);\n }\n\n vec4 applySlice(vec4 color, vec3 pos) {\n return sliceEnabled() ? applySliceOutline(color, pos) : color;\n }\n "):e.code.add(l.H`void discardBySlice(vec3 pos) { }
|
|
750
750
|
vec4 applySlice(vec4 color, vec3 pos) { return color; }`)}(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}function d(e,t){h(e,t,new s.W("slicePlaneOrigin",(e,r)=>v(t,e,r)),new s.W("slicePlaneBasis1",(e,r)=>g(t,e,r,r.slicePlane?.basis1)),new s.W("slicePlaneBasis2",(e,r)=>g(t,e,r,r.slicePlane?.basis2)))}r(65786).Y;const u=l.H`struct SliceFactors {
|
|
751
751
|
float front;
|
|
752
752
|
float side0;
|
|
@@ -820,7 +820,7 @@ rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.co
|
|
|
820
820
|
}`))}},78662:(e,t,r)=>{r.d(t,{Gd:()=>l,VC:()=>c}),r(44208);var i=r(34727),o=(r(77690),r(29242),r(58083),r(9093)),n=r(38954),a=r(51850),s=(r(87317),r(91829),r(31756),r(26857),r(16943),r(65786));class l extends s.Y{constructor(e){super(),this.vvSize=e?.size??null,this.vvColor=e?.color??null,this.vvOpacity=e?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}function c(e,t,r){if(!t.vvSize)return(0,n.h)(e,1,1,1),e;if(Number.isNaN(r[0]))return(0,n.d)(e,t.vvSize.fallback);for(let o=0;o<3;++o){const n=t.vvSize.offset[o]+r[0]*t.vvSize.factor[o];e[o]=(0,i.qE)(n,t.vvSize.minSize[o],t.vvSize.maxSize[o])}return e}(0,o.vt)(),(0,a.vt)(),(0,o.vt)()},78754:(e,t,r)=>{r.d(t,{F:()=>n});var i=r(24326),o=r(97146);class n{constructor(e){this.id=(0,i.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,o.Dg)(r.indices)})}get attributes(){return this._attributes}}},82048:(e,t,r)=>{r.d(t,{c:()=>o});var i=r(31821);function o(e,t=!0){e.attributes.add("position","vec2"),t&&e.varyings.add("uv","vec2"),e.vertex.main.add(i.H`
|
|
821
821
|
gl_Position = vec4(position, 0.0, 1.0);
|
|
822
822
|
${t?i.H`uv = position * 0.5 + vec2(0.5);`:""}
|
|
823
|
-
`)}},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),o=r(38954),n=r(97146),a=r(57917),s=r(29920),l=r(78754),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.e)(m,t,e),(0,o.e)(p,r,e),.5*(0,o.b)((0,o.f)(m,m,p))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const m=(0,c.vt)(),p=(0,c.vt)(),f=(0,c.vt)(),v=(0,c.vt)(),g=(0,c.vt)(),_=(0,c.vt)();var x=r(24326);class w{constructor(){this.uid=(0,x.c)()}}class b extends w{constructor(e){super(),this.highlightName=e,this.channel=0}}var y=r(620),M=r(94656);class T extends l.F{constructor(e,t,r=null,i=0,o=null,n=-1,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=o,this.edgeIndicesLength=n,this.baseGeometry=a,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null;const s=this.positionAttribute;null!=s&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=s.indices.length)}instantiate(e={}){const t=new T(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.p)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0),(0,o.h)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,d=n[e+2]*r;(0,o.h)(f,i[l],i[l+1],i[l+2]),(0,o.h)(v,i[c],i[c+1],i[c+2]),(0,o.h)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,o.i)(f,f,v),(0,o.i)(f,f,g),(0,o.j)(f,f,1/3*u),(0,o.i)(t,t,f),a+=u):((0,o.i)(_,_,f),(0,o.i)(_,_,v),(0,o.i)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.j)(t,t,1/a),0):0===s||((0,o.j)(t,_,1/s),0)))}(this.positionAttribute,e)}_computeAttachmentOriginLines(e){const t=this.positionAttribute;return function(e,t,r){if(!e)return!1;(0,o.h)(r,0,0,0),(0,o.h)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,o.j)(f,(0,o.i)(f,f,v),.5);const h=(0,o.
|
|
823
|
+
`)}},87170:(e,t,r)=>{r.d(t,{V:()=>T});var i=r(9093),o=r(38954),n=r(97146),a=r(57917),s=r(29920),l=r(78754),c=r(51850),d=r(4341),u=r(11964);function h(e,t,r){return(0,o.e)(m,t,e),(0,o.e)(p,r,e),.5*(0,o.b)((0,o.f)(m,m,p))}r(32114),new d.I(u.vt),new d.I(()=>function(e){return e?{p0:(0,c.o8)(e.p0),p1:(0,c.o8)(e.p1),p2:(0,c.o8)(e.p2)}:{p0:(0,c.vt)(),p1:(0,c.vt)(),p2:(0,c.vt)()}}());const m=(0,c.vt)(),p=(0,c.vt)(),f=(0,c.vt)(),v=(0,c.vt)(),g=(0,c.vt)(),_=(0,c.vt)();var x=r(24326);class w{constructor(){this.uid=(0,x.c)()}}class b extends w{constructor(e){super(),this.highlightName=e,this.channel=0}}var y=r(620),M=r(94656);class T extends l.F{constructor(e,t,r=null,i=0,o=null,n=-1,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=o,this.edgeIndicesLength=n,this.baseGeometry=a,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null;const s=this.positionAttribute;null!=s&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=s.indices.length)}instantiate(e={}){const t=new T(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:(0,a.S)(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,M.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this._attributes.values().next().value?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,o.p)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0),(0,o.h)(_,0,0,0);let a=0,s=0;for(let e=0;e<n.length-2;e+=3){const l=n[e]*r,c=n[e+1]*r,d=n[e+2]*r;(0,o.h)(f,i[l],i[l+1],i[l+2]),(0,o.h)(v,i[c],i[c+1],i[c+2]),(0,o.h)(g,i[d],i[d+1],i[d+2]);const u=h(f,v,g);u?((0,o.i)(f,f,v),(0,o.i)(f,f,g),(0,o.j)(f,f,1/3*u),(0,o.i)(t,t,f),a+=u):((0,o.i)(_,_,f),(0,o.i)(_,_,v),(0,o.i)(_,_,g),s+=3)}return!(0===s&&0===a||(0!==a?((0,o.j)(t,t,1/a),0):0===s||((0,o.j)(t,_,1/s),0)))}(this.positionAttribute,e)}_computeAttachmentOriginLines(e){const t=this.positionAttribute;return function(e,t,r){if(!e)return!1;(0,o.h)(r,0,0,0),(0,o.h)(_,0,0,0);let i=0,n=0;const{size:a,data:s,indices:l}=e,c=l.length-1,d=c+(t?2:0);for(let e=0;e<d;e+=2){const t=e<c?e+1:0,d=l[e<c?e:c]*a,u=l[t]*a;f[0]=s[d],f[1]=s[d+1],f[2]=s[d+2],v[0]=s[u],v[1]=s[u+1],v[2]=s[u+2],(0,o.j)(f,(0,o.i)(f,f,v),.5);const h=(0,o.H)(f,v);h>0?((0,o.i)(r,r,(0,o.j)(f,f,h)),i+=h):0===i&&((0,o.i)(_,_,f),n++)}return 0!==i?((0,o.j)(r,r,1/i),!0):0!==n&&((0,o.j)(r,_,1/n),!0)}(t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),e)}_computeAttachmentOriginPoints(e){return function(e,t){if(!e)return!1;const{size:r,data:i,indices:n}=e;(0,o.h)(t,0,0,0);let a=-1,s=0;for(let e=0;e<n.length;e++){const o=n[e]*r;a!==o&&(t[0]+=i[o],t[1]+=i[o+1],t[2]+=i[o+2],s++),a=o}return s>1&&(0,o.j)(t,t,1/s),s>0}(this.positionAttribute,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.positionAttribute;if(!e||0===e.indices.length)return null;const t=0===this.type?3:1;(0,y.vA)(e.indices.length%t===0,"Indexing error: "+e.indices.length+" not divisible by "+t);const r=(0,n.tM)(e.indices.length/t);return new s.j(r,t,e)}get transformation(){return this._transformation??i.zK}set transformation(e){this._transformation=e&&e!==i.zK?(0,i.o8)(e):null}get highlights(){return this._highlights||C}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new b(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const C=new Set},89390:(e,t,r)=>{r.d(t,{kA:()=>C,a8:()=>M,eU:()=>T});var i=r(40876),o=(r(44208),r(38954)),n=r(51850),a=r(87317),s=r(91829),l=r(23205),c=r(14314),d=r(31821);function u(e,t){const r=e.fragment,i=void 0!==t.lightingSphericalHarmonicsOrder?t.lightingSphericalHarmonicsOrder:2;0===i?(r.uniforms.add(new l.d("lightingAmbientSH0",({lighting:e})=>(0,o.h)(h,e.sh.r[0],e.sh.g[0],e.sh.b[0]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|
|
824
824
|
vec3 ambientLight = 0.282095 * lightingAmbientSH0;
|
|
825
825
|
return ambientLight * (1.0 - ambientOcclusion);
|
|
826
826
|
}`)):1===i?(r.uniforms.add(new c.I("lightingAmbientSH_R",({lighting:e})=>(0,a.s)(m,e.sh.r[0],e.sh.r[1],e.sh.r[2],e.sh.r[3])),new c.I("lightingAmbientSH_G",({lighting:e})=>(0,a.s)(m,e.sh.g[0],e.sh.g[1],e.sh.g[2],e.sh.g[3])),new c.I("lightingAmbientSH_B",({lighting:e})=>(0,a.s)(m,e.sh.b[0],e.sh.b[1],e.sh.b[2],e.sh.b[3]))),r.code.add(d.H`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) {
|