@arcgis/core 5.1.0-next.77 → 5.1.0-next.78
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/analysis/ElevationProfile/ElevationProfileGroup.d.ts +74 -0
- package/analysis/ElevationProfile/ElevationProfileGroup.js +2 -0
- package/analysis/ElevationProfileAnalysis.d.ts +29 -14
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/applications/Components/OrientedImageryViewer/ImageViewer/utils.d.ts +34 -0
- package/applications/Components/OrientedImageryViewer/ImageViewer/utils.js +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{537fe2522dff1e6ce03b.js → 11ea4be441a26134ce1f.js} +1 -1
- package/assets/esri/core/workers/chunks/17acbf40e7c1cb42d9bd.js +1 -0
- package/assets/esri/core/workers/chunks/1c7fd0a229a8112b0539.js +596 -0
- package/assets/esri/core/workers/chunks/{baeb96aef03d4c566af7.js → 1f53620f82cc7c3daabe.js} +1 -1
- package/assets/esri/core/workers/chunks/2387613b855771a3e537.js +1 -0
- package/assets/esri/core/workers/chunks/283d39dfb1625b5a74db.js +1 -0
- package/assets/esri/core/workers/chunks/{5e1b847b116d21908a54.js → 322c54081b25f1c53661.js} +1 -1
- package/assets/esri/core/workers/chunks/{330b47ac0759c3c35cc5.js → 34fe97bcacc0dfc5bce6.js} +1 -1
- package/assets/esri/core/workers/chunks/{14eb2cc8e2ad6d8d03fd.js → 3d9fcbe95dd22dbe730e.js} +1 -1
- package/assets/esri/core/workers/chunks/{e262c4864dc06c43b380.js → 3df8493b91aa3bce824d.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf8f603848bad4a7deb4.js → 4ccb56333de0247dcb6f.js} +1 -1
- package/assets/esri/core/workers/chunks/5b6f2bfdcdd207d8ae42.js +1 -0
- package/assets/esri/core/workers/chunks/{88b480a1d1fb01778798.js → 5ee4b630ad39c21d11db.js} +21 -26
- package/assets/esri/core/workers/chunks/{6b66fc32451433129a88.js → 8508f238d99021e87f71.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc75ab48f4c7609ef09d.js → 85d3475667c503ec4fc6.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d6491f996eeb0c646ed.js → 85d8c7cc7f8decbe975d.js} +1 -1
- package/assets/esri/core/workers/chunks/9b9916864b6575c42c8a.js +1 -0
- package/assets/esri/core/workers/chunks/{75d5ea0da181f9e7425f.js → a8ca5d8740cc7e39197b.js} +6 -6
- package/assets/esri/core/workers/chunks/{8d75f6f27c1c17c33992.js → b7bb7072dbee978f3ca3.js} +1 -1
- package/assets/esri/core/workers/chunks/bf7e019437a3b6036300.js +2 -0
- package/assets/esri/core/workers/chunks/{99c161fecae710b53b40.js → d304343a781acfa3ff96.js} +1 -1
- package/assets/esri/core/workers/chunks/dbb9bb28696ff9536678.js +2 -0
- package/assets/esri/core/workers/chunks/{34ea3ed78041437a8fc8.js → f81c6f6ccc201f584970.js} +1 -1
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_PluginSettingsControls.scss +29 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
- package/config.js +1 -1
- package/core/types.d.ts +28 -0
- package/form/elements/inputs/MultipleChoiceInput.d.ts +2 -2
- package/form/elements/inputs/MultipleChoiceInput.js +1 -1
- package/geometry/operators/types.d.ts +2 -2
- package/interfaces.d.ts +4 -7
- package/kernel.js +1 -1
- package/layers/ImageryLayer.d.ts +7 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.d.ts +7 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/WCSLayer.d.ts +7 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/networks/UnitIdentifierManager.d.ts +15 -15
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/support/jsonTypes.d.ts +125 -13
- package/package.json +3 -3
- package/popup/Features.d.ts +0 -1
- package/popup/Features.js +1 -1
- package/rest/networks/unitIdentifiers/reserve.js +2 -0
- package/rest/networks/unitIdentifiers/support/ReserveParameters.js +2 -0
- package/rest/networks/unitIdentifiers/support/ResizeParameters.js +1 -1
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +5 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/AFeatureTile.js +1 -1
- package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ShaderHittest.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/BaseLayerView2D.d.ts +3 -3
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +3 -3
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +5 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshNormals.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Renderable.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +1 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +1 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js +16 -21
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/BlackLevelLightSoftCompression.glsl.js +5 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +2 -2
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +6 -4
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
- package/views/draw/plugins/FreehandSegmentPlugin.js +1 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/draw/support/types.d.ts +21 -0
- package/views/draw/support/types.js +1 -1
- package/views/types.d.ts +2 -2
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView3D.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLine2D.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +5 -5
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +2 -0
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +2 -0
- package/widgets/OrientedImageryViewer/types.d.ts +10 -0
- package/widgets/OrientedImageryViewer.d.ts +17 -2
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch/support/SettingsManager.js +2 -0
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/SliderViewModel.d.ts +2 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.js +1 -1
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
- package/widgets/support/PluginSettingsControls.js +2 -0
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/analysis/ElevationProfile/elevationProfileLineTypes.js +0 -2
- package/assets/esri/core/workers/chunks/003476e950bd27a2f884.js +0 -596
- package/assets/esri/core/workers/chunks/07aca5ecad659d55e795.js +0 -2
- package/assets/esri/core/workers/chunks/7540f7df86620f067b5a.js +0 -1
- package/assets/esri/core/workers/chunks/76e34f81bb4a7b0e694c.js +0 -1
- package/assets/esri/core/workers/chunks/bfe575da727ce7c8d331.js +0 -2
- package/assets/esri/core/workers/chunks/cb45e5d4a4ef82cda583.js +0 -1
- package/assets/esri/core/workers/chunks/ea59b81299acaf0d85ee.js +0 -1
- package/assets/esri/core/workers/chunks/ef0eae13408cbf83a64f.js +0 -1
- package/rest/networks/unitIdentifiers/insertGap.js +0 -2
- package/rest/networks/unitIdentifiers/support/InsertGapParameters.js +0 -2
- /package/assets/esri/core/workers/chunks/{07aca5ecad659d55e795.js.LICENSE.txt → bf7e019437a3b6036300.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{bfe575da727ce7c8d331.js.LICENSE.txt → dbb9bb28696ff9536678.js.LICENSE.txt} +0 -0
|
@@ -47,7 +47,7 @@ return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0;
|
|
|
47
47
|
}
|
|
48
48
|
bool rejectBySlice(vec3 pos) {
|
|
49
49
|
return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos));
|
|
50
|
-
}`;function _(t,e,i){return t.instancedDoublePrecision?(0,o.hZ)(y,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]):e.slicePlaneLocalOrigin}function v(t,e){return null!=t?(0,o.Re)(w,e.origin,t):e.origin}function x(t,e,i){return t.hasSliceTranslatedView?null!=e?(0,s.Tl)(
|
|
50
|
+
}`;function _(t,e,i){return t.instancedDoublePrecision?(0,o.hZ)(y,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]):e.slicePlaneLocalOrigin}function v(t,e){return null!=t?(0,o.Re)(w,e.origin,t):e.origin}function x(t,e,i){return t.hasSliceTranslatedView?null!=e?(0,s.Tl)(A,i.camera.viewMatrix,e):i.camera.viewMatrix:null}function b(t,e,i,r){if(null==r||null==i.slicePlane)return a.uY;const s=_(t,e,i),n=v(s,i.slicePlane),c=x(t,s,i);return null!=c?((0,o.WQ)(T,r,n),(0,o.Z0)(w,n,c),(0,o.Z0)(T,T,c),(0,o.Re)(T,T,w)):r}const y=(0,a.vt)(),w=(0,a.vt)(),T=(0,a.vt)(),A=(0,n.vt)()},43519(t,e,i){i.d(e,{ML:()=>o,WD:()=>s,Y1:()=>n,oF:()=>a});var r=i(31821);function s(t){t.code.add(r.H`struct MaskedColor {
|
|
51
51
|
vec4 color;
|
|
52
52
|
bvec4 mask;
|
|
53
53
|
};`)}function n(t){t.include(s),t.code.add(r.H`
|
|
@@ -194,19 +194,17 @@ float rgb2v(vec3 c) {
|
|
|
194
194
|
return max(c.x, max(c.y, c.z));
|
|
195
195
|
}`)}},27950(t,e,i){i.d(e,{N:()=>n});var r=i(63365),s=i(31821);function n(t){t.include(r.a),t.code.add(s.H`
|
|
196
196
|
vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
vec3 internalMixed = internalColor * textureColor;
|
|
200
|
-
vec3 allMixed = internalMixed * externalColor;
|
|
201
|
-
|
|
202
|
-
if (mode == ${s.H.int(1)}) {
|
|
203
|
-
return allMixed;
|
|
197
|
+
if (mode == ${s.H.int(3)}) {
|
|
198
|
+
return externalColor;
|
|
204
199
|
}
|
|
200
|
+
|
|
201
|
+
vec3 internalMixed = internalColor * textureColor;
|
|
205
202
|
if (mode == ${s.H.int(2)}) {
|
|
206
203
|
return internalMixed;
|
|
207
204
|
}
|
|
208
|
-
|
|
209
|
-
|
|
205
|
+
|
|
206
|
+
if (mode == ${s.H.int(1)}) {
|
|
207
|
+
return internalMixed * externalColor;
|
|
210
208
|
}
|
|
211
209
|
|
|
212
210
|
// tint (or something invalid)
|
|
@@ -217,20 +215,17 @@ return max(c.x, max(c.y, c.z));
|
|
|
217
215
|
}
|
|
218
216
|
|
|
219
217
|
float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
float allMixed = internalMixed * externalOpacity;
|
|
218
|
+
if (mode == ${s.H.int(3)}) {
|
|
219
|
+
return externalOpacity;
|
|
220
|
+
}
|
|
224
221
|
|
|
222
|
+
float internalMixed = internalOpacity * textureOpacity;
|
|
225
223
|
if (mode == ${s.H.int(2)}) {
|
|
226
224
|
return internalMixed;
|
|
227
225
|
}
|
|
228
|
-
if (mode == ${s.H.int(3)}) {
|
|
229
|
-
return externalOpacity;
|
|
230
|
-
}
|
|
231
226
|
|
|
232
227
|
// multiply or tint (or something invalid)
|
|
233
|
-
return
|
|
228
|
+
return internalMixed * externalOpacity;
|
|
234
229
|
}
|
|
235
230
|
`)}},52587(t,e,i){i.d(e,{OH:()=>h,Y6:()=>a,pM:()=>c});var r=i(35522),s=i(51850),n=i(33079),o=i(31821);function a(t){t.vertex.code.add(o.H`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) {
|
|
236
231
|
return absCosAngle * absCosAngle * absCosAngle;
|
|
@@ -251,17 +246,17 @@ screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)
|
|
|
251
246
|
return size * clamp(mix(factor.x, 1.0, factor.y), factor.z, 1.0);
|
|
252
247
|
}`),t.vertex.code.add(o.H`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) {
|
|
253
248
|
return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params));
|
|
254
|
-
}`)}function c(t){t.uniforms.add(new n.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new n.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,s.vt)()},77949(t,e,i){i.d(e,{NB:()=>p,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),s=i(9093),n=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,n.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function p(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(f,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,n.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(f,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const f=(0,s.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,s)=>r.setUniform2fv(t,e(s),i))}}},68259(t,e,i){i.d(e,{t:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,s,n,o)=>r.setUniform2fv(t,e(s,n,o),i))}}},47286(t,e,i){i.d(e,{G:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,s,n)=>r.setUniform2fv(t,e(s,n),i))}}},23205(t,e,i){i.d(e,{d:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,s)=>r.setUniform3fv(t,e(s),i))}}},14314(t,e,i){i.d(e,{I:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,s)=>r.setUniform4fv(t,e(s),i))}}},71988(t,e,i){i.d(e,{E:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,s,n)=>r.setUniform4fv(t,e(s,n),i))}}},33094(t,e,i){i.d(e,{U:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"float",0,(r,s)=>r.setUniform1f(t,e(s),i))}}},44887(t,e,i){i.d(e,{x:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,s,n)=>e.setUniform1fv(t,i(s,n),r),e)}}},35818(t,e,i){i.d(e,{W:()=>s});var r=i(74333);class s extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>s});var r=i(74333);class s extends r.n{constructor(t,e){super(t,"int",1,(i,r,s)=>i.setUniform1i(t,e(r,s)))}}},35644(t,e,i){i.d(e,{k:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,s,n)=>r.setUniformMatrix3fv(t,e(s,n),i))}}},58029(t,e,i){i.d(e,{F:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,s)=>r.setUniformMatrix4fv(t,e(s),i))}}},97102(t,e,i){i.d(e,{S:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,s,n)=>r.setUniformMatrix4fv(t,e(s,n),i))}}},12791(t,e,i){i.d(e,{x:()=>s});var r=i(74333);class s extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>f});var r=i(5482),s=i(69622),n=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||n.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const s=r.unit;this.setUniform1i(t,s),this._context.bindTexture(e,s,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),p=i(85079);let f=class extends s.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,p.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void n.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};f=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},51976(t,e,i){i.d(e,{K:()=>a,W:()=>c});var r=i(49186),s=i(4576);class n{constructor(t){this._bits=[...t]}equals(t){return(0,s.aI)(this._bits,t.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var o=i(65786);class a extends o.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new n(this._parameterBits),this._key}decode(t=this.key){const e=this._parameterBits;this._parameterBits=[...t.bits];const i=this._parameterNames.map(t=>` ${t}: ${this[t]}`).join("\n");return this._parameterBits=e,i}}function c(t={}){return(e,i)=>{e.hasOwnProperty("_parameterNames")||Object.defineProperty(e,"_parameterNames",{value:e._parameterNames?.slice()??[],configurable:!0,writable:!0}),e.hasOwnProperty("_parameterBits")||Object.defineProperty(e,"_parameterBits",{value:e._parameterBits?.slice()??[0],configurable:!0,writable:!0}),e._parameterNames.push(i);const s=t.count||2,n=Math.ceil(Math.log2(s)),o=e._parameterBits;let a=0;for(;o[a]+n>16;)a++,a>=o.length&&o.push(0);const c=o[a],h=(1<<n)-1<<c;o[a]+=n,t.count?Object.defineProperty(e,i,{get(){return(this._parameterBits[a]&h)>>c},set(e){const s=this._parameterBits[a];if((s&h)>>c!==e){if(this._key=null,this._parameterBits[a]=s&~h|+e<<c&h,"number"!=typeof e)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must be a number, got ${typeof e}`);if(null==t.count)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must provide a count option`)}}}):Object.defineProperty(e,i,{get(){return!!((this._parameterBits[a]&h)>>c)},set(t){const e=this._parameterBits[a];if(!!((e&h)>>c)!==t&&(this._key=null,this._parameterBits[a]=e&~h|+t<<c,"boolean"!=typeof t))throw new r.A("internal:invalid-shader-configurationx",`Configuration value for ${i} must be boolean, got ${typeof t}`)}})}}},16943(t,e,i){i.d(e,{E:()=>s});var r=i(44208);function s(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){i.d(e,{lK:()=>a,wR:()=>o});var r=i(63907),s=i(85079),n=i(74038);const o=[],a=(new n._("position",3,r.pe.FLOAT,0,12),[new n._("position",2,r.pe.FLOAT,0,8)]);(0,s.Xk)(a),new n._("position",2,r.pe.FLOAT,0,12),new n._("uv0",2,r.pe.HALF_FLOAT,8,12),new n._("position",2,r.pe.FLOAT,0,16),new n._("uv0",2,r.pe.FLOAT,8,16)},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},63500(t,e,i){i.d(e,{V:()=>E});var r=i(9093),s=i(35522),n=i(97146),o=i(46610),a=i(34275),c=i(20498);function h(t){if(t.length<a.y9)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,a.LW)(t)?(0,c.pX)().from(t):(0,a.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return Float32Array.from(t);default:return Float64Array.from(t)}}var l=i(15142),u=i(51850),d=i(620);class p{get center(){return(0,u.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,u.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,u.fA)(this._data[7],this._data[8],this._data[9])}constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=i,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,d.vA)(t.length>=1),(0,d.vA)(3===i.size||4===i.size);const{data:r,size:n,indices:o}=i;(0,d.vA)(o.length%this._numIndexPerPrimitive===0),(0,d.vA)(o.length>=t.length*this._numIndexPerPrimitive);const a=t.length;let c=n*o[this._numIndexPerPrimitive*t[0]];f.clear(),f.push(c);const h=(0,u.fA)(r[c],r[c+1],r[c+2]),l=(0,u.o8)(h);for(let e=0;e<a;++e){const i=this._numIndexPerPrimitive*t[e];for(let t=0;t<this._numIndexPerPrimitive;++t){c=n*o[i+t],f.push(c);let e=r[c];h[0]=Math.min(e,h[0]),l[0]=Math.max(e,l[0]),e=r[c+1],h[1]=Math.min(e,h[1]),l[1]=Math.max(e,l[1]),e=r[c+2],h[2]=Math.min(e,h[2]),l[2]=Math.max(e,l[2])}}for(let t=0;t<3;++t)this._data[4+t]=h[t],this._data[7+t]=l[t];const p=(0,s.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-h[0],l[1]-h[1]),l[2]-h[2]),g=m*m;for(let t=0;t<f.length;++t){c=f.at(t);const e=r[c]-p[0],i=r[c+1]-p[1],s=r[c+2]-p[2],n=e*e+i*i+s*s;if(n<=g)continue;const o=Math.sqrt(n),a=.5*(o-m);m+=a,g=m*m;const h=a/o;p[0]+=e*h,p[1]+=i*h,p[2]+=s*h}this._data[3]=m;for(let t=0;t<3;++t)this._data[0+t]=p[t];f.clear()}getChildren(){if(this._children||(0,s.hG)(this.bbMin,this.bbMax)<=1)return this._children;const t=(0,s.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5),e=this.primitiveIndices.length,i=new Uint8Array(e),r=new Array(8);for(let t=0;t<8;++t)r[t]=0;const{data:n,size:o,indices:a}=this.position;for(let s=0;s<e;++s){let e=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[s];let h=o*a[c],l=n[h],u=n[h+1],d=n[h+2];for(let t=1;t<this._numIndexPerPrimitive;++t){h=o*a[c+t];const e=n[h],i=n[h+1],r=n[h+2];e<l&&(l=e),i<u&&(u=i),r<d&&(d=r)}l<t[0]&&(e|=1),u<t[1]&&(e|=2),d<t[2]&&(e|=4),i[s]=e,++r[e]}let c=0;for(let t=0;t<8;++t)r[t]>0&&++c;if(c<2)return;const h=new Array(8);for(let t=0;t<8;++t)h[t]=r[t]>0?new Uint32Array(r[t]):void 0;for(let t=0;t<8;++t)r[t]=0;for(let t=0;t<e;++t){const e=i[t];h[e][r[e]++]=this.primitiveIndices[t]}this._children=new Array;for(let t=0;t<8;++t)void 0!==h[t]&&this._children.push(new p(h[t],this._numIndexPerPrimitive,this.position));return this._children}static prune(){f.prune()}}const f=new l.A({deallocator:null});var m=i(24326);class g{constructor(t){this.id=(0,m.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,n.Dg)(i.indices)})}get attributes(){return this._attributes}}var _=i(4341),v=i(11964);function x(t,e,i){return(0,s.Re)(b,e,t),(0,s.Re)(y,i,t),.5*(0,s.Bw)((0,s.$A)(b,b,y))}i(32114),new _.I(v.vt),new _.I(()=>{return t?{p0:(0,u.o8)(t.p0),p1:(0,u.o8)(t.p1),p2:(0,u.o8)(t.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var t});const b=(0,u.vt)(),y=(0,u.vt)(),w=(0,u.vt)(),T=(0,u.vt)(),M=(0,u.vt)(),S=(0,u.vt)();var A=i(17478),C=i(94656);class E extends g{constructor(t,e,i=null,r=0,s=null,n=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=s,this.edgeIndicesLength=n,this.baseGeometry=o,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,d.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const c=this.positionAttribute;null!=c&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=c.indices.length)}instantiate(t={}){const e=new E(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:h(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const i=this._attributes.get(t);i?this._attributes.set(t,{...i,exclusive:!0,data:e}):(0,C.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);this._vertexPositionIndicesCache=i}else this._vertexPositionIndicesCache=e?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!(0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&(0,s.Z0)(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:n}=e;(0,s.hZ)(t,0,0,0),(0,s.hZ)(S,0,0,0);let o=0,a=0;for(let e=0;e<i.length-2;e+=3){const c=i[e]*r,h=i[e+1]*r,l=i[e+2]*r;(0,s.hZ)(w,n[c],n[c+1],n[c+2]),(0,s.hZ)(T,n[h],n[h+1],n[h+2]),(0,s.hZ)(M,n[l],n[l+1],n[l+2]);const u=x(w,T,M);u?((0,s.WQ)(w,w,T),(0,s.WQ)(w,w,M),(0,s.hs)(w,w,1/3*u),(0,s.WQ)(t,t,w),o+=u):((0,s.WQ)(S,S,w),(0,s.WQ)(S,S,T),(0,s.WQ)(S,S,M),a+=3)}return!(0===a&&0===o||(0!==o?((0,s.hs)(t,t,1/o),0):0===a||((0,s.hs)(t,S,1/a),0)))}(t,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(t){const e=this.positionAttribute,i=this.primitivePositionIndices;return function(t,e,i,r=e?.indices){if(!e||!r)return!1;(0,s.hZ)(t,0,0,0),(0,s.hZ)(S,0,0,0);let n=0,o=0;const{size:a,data:c}=e,h=r.length-1,l=h+(i?2:0);for(let e=0;e<l;e+=2){const i=e<h?e+1:0,l=r[e<h?e:h]*a,u=r[i]*a;w[0]=c[l],w[1]=c[l+1],w[2]=c[l+2],T[0]=c[u],T[1]=c[u+1],T[2]=c[u+2],(0,s.hs)(w,(0,s.WQ)(w,w,T),.5);const d=(0,s.xg)(w,T);d>0?((0,s.WQ)(t,t,(0,s.hs)(w,w,d)),n+=d):0===n&&((0,s.WQ)(S,S,w),o++)}return 0!==n?((0,s.hs)(t,t,1/n),!0):0!==o&&((0,s.hs)(t,S,1/o),!0)}(t,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}(this.material.parameters,e),i)}_computeAttachmentOriginPoints(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:n}=e;(0,s.hZ)(t,0,0,0);let o=-1,a=0;for(let e=0;e<i.length;e++){const s=i[e]*r;o!==s&&(t[0]+=n[s],t[1]+=n[s+1],t[2]+=n[s+2],a++),o=s}return a>1&&(0,s.hs)(t,t,1/a),a>0}(t,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.primitivePositionIndices;if(!t||!e||0===e.length)return null;const i=e===t.indices?t:new o.n(t.data,e,t.size,!1,t.stride),r=0===this.type?3:1;(0,d.vA)(e.length%r===0,"Indexing error: "+e.length+" not divisible by "+r);const s=(0,n.tM)(e.length/r);return new p(s,r,i)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||R}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new A.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const R=new Set},49718(t,e,i){i(51850),i(6867).i},6867(t,e,i){i.d(e,{i:()=>l});var r=i(58083),s=i(9093),n=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,n.hs)(d,this.ray.direction,this.distance),(0,n.Bw)(d))}withinDistance(t){return!!u(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!u(this)&&((0,n.hs)(d,this.ray.direction,this.distance),(0,n.WQ)(t,this.ray.origin,d),!0)}getTransformedNormal(t){return(0,n.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,n.C)(t,p),(0,n.S8)(t,t)}constructor(t){this.intersector=4,this.normal=(0,o.vt)(),this.transformation=(0,s.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this.intersector=t,this.distance=i,(0,n.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??s.zK),this.target=e,this.drapedLayerOrder=h,this.renderPriority=l}copy(t){(0,h.C)(t.ray,this._ray),this.intersector=t.intersector,this.distance=t.distance,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.renderPriority=t.renderPriority,(0,n.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function u(t){return null!=t?.distance}const d=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>B});var r=i(49186),s=i(65529),n=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),p=i(2741);let f;var m=i(63907),g=i(76284),_=i(42293);let v=null,x=null;async function b(){return null==x&&(f??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),x=f,v=await x),x}function y(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=M(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=S(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,s){const n=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=s&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*n*o)}function M(t){return t.getNumImages()>=1&&!t.isUASTC()}function S(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function A(t,e,i,r,s,n,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(o(t,l))),a(t,l,p[t]);return e.internalFormat=u,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=s,e.height=n,new g.A(t,e,{type:"compressed",levels:p})}var C=i(53966);const E=()=>C.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),O=R("DXT3"),D=R("DXT5");function F(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let s,n;switch(r){case I:s=8,n=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:s=16,n=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case D:s=16,n=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let p=t.byteOffset+i[1]+4;const f=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*s,u=new Uint8Array(t.buffer,p,d),f.push(u),p+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:h,height:l}}var P=i(78988),N=i(620),L=i(67171);class B{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new s.bk,this._parameters={...U,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new L.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?y(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,s=e.pixelFormat??6408,n=(0,_.wH)(s);return(e.mipmap?4/3:1)*i*r*n||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=F(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:s,internalFormat:n,width:o,height:a}=r;return e.samplingMode=s.levels.length>1?9987:9729,e.hasMipmap=s.levels.length>1,e.internalFormat=n,e.width=o,e.height=a,new g.A(t,e,s)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await b());const r=new v.KTX2File(new Uint8Array(i));if(!S(r))return null;r.startTranscoding();const s=A(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),s}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await b());const r=new v.BasisFile(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const s=A(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),s}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((s,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,n.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),s(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,P.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const s=this._createDescriptor(t);return s.width=r.width,s.height=r.height,s.compress=this._parameters.compressionOptions,this._texture=new g.A(t,s,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,n.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),s=i(49255),n=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,n.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,n.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,s._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value}}o.Y},17478(t,e,i){i.d(e,{h:()=>n,p:()=>o});var r=i(24326);class s{constructor(){this.uid=(0,r.c)()}}class n extends s{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends s{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>o,mt:()=>c,z5:()=>a});var r=i(49255),s=i(90644);const n=(0,s.p3)(1,0,1,771);function o(t,e=!1){switch(t){case 0:return e?s.RC:s.T8;case 1:return n;default:return null}}function a(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?s.Uy:null;case 1:return null}}function c(t,e=513){return{func:(0,r.Sp)(t)?515:e}}},56133(t,e,i){i.d(e,{I$:()=>h,a9:()=>c,m:()=>r,mK:()=>l,qh:()=>a,r8:()=>o,sf:()=>s,v0:()=>n});const r={func:513},s={func:519},n={mask:255},o={mask:0},a={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},c={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}},h={function:{func:514,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7680}},l={function:{func:517,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7680}}},77194(t,e,i){i.d(e,{PS:()=>s}),i(44208);var r=i(34727);class s{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:s}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),s,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>s,vM:()=>n});var r=i(49186);function s(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function n(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const n=Math.max(t,e),o=t*e;if(n<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/n);return[s(Math.round(t*a),r),s(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const s=document.createElement("canvas");return s.width=e,s.height=i,s.getContext("2d").drawImage(t,0,0,s.width,s.height),s}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),s=i(51850),n=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,s.vt)(),this._tmpSphere=new n.iy}applyToVertex(t,e,i){const s=this.objectTransform.transform,n=(0,r.hZ)(h,t,e,i),o=(0,r.Z0)(n,n,s),a=this.offset/(0,r.Bw)(o);(0,r.Ln)(o,o,o,a);const c=this.objectTransform.inverse;return(0,r.Z0)(this.tmpVertex,o,c),this.tmpVertex}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const s=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,s)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),s=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,s),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,s.vt)(),this._tmpMbs=new n.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i){const s=(0,r.hZ)(h,t,e,i),n=(0,r.hZ)(l,t,e,i+this.componentLocalOriginLength),o=this._totalOffset/(0,r.Bw)(n);return(0,r.Ln)(this._tmpVertex,s,n,o),this._tmpVertex}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],s=t[2]+e,n=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(s),u=Math.abs(n),d=Math.abs(o),p=Math.abs(a),f=.5*(1+Math.sign(i*n))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(s*a))*Math.min(l,p),_=Math.max(c,u),v=Math.max(h,d),x=Math.max(l,p),b=Math.sqrt(f*f+m*m+g*g),y=Math.sign(c+i),w=Math.sign(h+r),T=Math.sign(l+s),M=Math.sign(u+n),S=Math.sign(d+o),A=Math.sign(p+a),C=this._totalOffset;if(b<C)return t[0]-=(1-y)*C,t[1]-=(1-w)*C,t[2]-=(1-T)*C,t[3]+=M*C,t[4]+=S*C,t[5]+=A*C,t;const E=C/Math.sqrt(_*_+v*v+x*x),R=C/b,I=R-E,O=-I;return t[0]+=i*(y*O+R),t[1]+=r*(w*O+R),t[2]+=s*(T*O+R),t[3]+=n*(M*I+E),t[4]+=o*(S*I+E),t[5]+=a*(A*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),s=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,s),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,s.vt)()}applyToVertex(t,e,i){const s=(0,r.hZ)(h,t,e,i),n=(0,r.WQ)(l,s,this.localOrigin),o=this.offset/(0,r.Bw)(n);return(0,r.Ln)(this.tmpVertex,s,n,o),this.tmpVertex}applyToAabb(t){const e=u,i=d,r=p;for(let s=0;s<3;++s)e[s]=t[0+s]+this.localOrigin[s],i[s]=t[3+s]+this.localOrigin[s],r[s]=e[s];const s=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=s[e],t[e+3]=s[e];const n=e=>{const i=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let s=0;s<3;++s)r[s]=t&1<<s?i[s]:e[s];n(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let s=0;s<3;++s)r[s]=o&1<<s?0:t&1<<s?e[s]:i[s];n(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,s.vt)(),l=(0,s.vt)(),u=(0,s.vt)(),d=(0,s.vt)(),p=(0,s.vt)()},75497(t,e,i){i.d(e,{$p:()=>n,Qx:()=>o,e_:()=>a});var r=i(51850),s=i(37957);class n{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,s=1,n=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=s,this.environmentStrength=n}}class a{constructor(){this.r=s.P.create(),this.g=s.P.create(),this.b=s.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{TA:()=>b,uH:()=>x});var r=i(34727),s=i(35522),n=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,s.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],s=t[2],n=e||h.P.create();n[0]=l,n[1]=.4886025119*i,n[2]=.4886025119*s,n[3]=.4886025119*r,n[4]=1.09254843059*i*r,n[5]=1.09254843059*r*s,n[6]=.31539156525*(3*s*s-1),n[7]=1.09254843059*i*s,n[8]=.54627421529*(i*i-r*r)}(m,p),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(p,g),a(p,t.intensity[0],f),c(e.r,f),a(p,t.intensity[1],f),c(e.g,f),a(p,t.intensity[2],f),c(e.b,f)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const p=h.P.create(),f=h.P.create(),m=(0,n.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,n.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,n.vt)(),this.ambient=new _,this.diffuse=new _}}const x=.4;class b{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,n.vt)(),(0,n.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,s.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,s.C)(e.direction,t[0].direction),(0,s.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,s.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,s.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,s.C)(y,this._legacy.diffuse.color),(0,s.hs)(y,y,x*this.globalFactor),(0,s.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,y)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,s.C)(this._mainLight.direction,t.mainLight.direction),(0,s.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,s.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,s.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let s=0;s<e.sh.r.length;s++)this._sphericalHarmonics.r[s]=(0,r.Cc)(t.sh.r[s],e.sh.r[s],i),this._sphericalHarmonics.g[s]=(0,r.Cc)(t.sh.g[s],e.sh.g[s],i),this._sphericalHarmonics.b[s]=(0,r.Cc)(t.sh.b[s],e.sh.b[s],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const y=(0,n.vt)()},33442(t,e,i){i.d(e,{Tk:()=>_,b6:()=>p,sG:()=>u});var r=i(35522),s=i(51850),n=i(49255);const o=d(-1),a=d(1),c=o,h=new Array;h[0]=null,h[1]=a,h[2]=o,h[3]=d(-2),h[4]=d(-3);const l=h.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(c,t));function u({output:t,enableOITOffset:e,polygonOffset:i}){return(0,n.Sp)(t)&&e?l[i]:h[i]}function d(t){return{factor:1*t,units:2*t}}function p(t,e,i,s){const n=u(e);if(!n)return t;const o=m*n.units,a=(0,r.S8)(g,(0,r.jb)(g,s,i));return(e,i,s)=>{const c=(i?1-Math.abs((0,r.Om)(a,i)):0)*n.factor*f+o;return t(e+c,i,s)}}h[1]=a;const f=5e-5,m=5e-6,g=(0,s.vt)();function _(t){const e=u(t)??{factor:0,units:0};return{factor:e.factor+o.factor*t.polygonOffsetIndex,units:e.units+o.units*t.polygonOffsetIndex}}},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),s=i(51976),n=i(68317);class o extends n.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,s.W)()],o.prototype,"hasHighlightMixTexture",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,s.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,s.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,s.W)()],a.prototype,"enableOITOffset",void 0)},46606(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),s=(i(35522),i(51850)),n=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends n.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,s.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,Um:()=>h,kE:()=>o});var r=i(4576),s=i(34727),n=i(77194);function o(t,e,i,r,n,o){let a=i.screenLength*t.pixelRatio;null!=n&&(l.update(r,e,n,o),a=l.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,s.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const s=e[r];void 0!==s&&(Array.isArray(s)?Array.isArray(t[r])&&a(s,t[r])||(t[r]=s.slice(),i=!0):t[r]!==s&&(i=!0,t[r]=s))}return i}const h={multiply:1,ignore:2,replace:3,tint:4},l=new n.PS},59907(t,e,i){i.d(e,{Wu:()=>u,vJ:()=>f});var r=i(35522),s=i(51850),n=i(58083),o=i(13030),a=i(620);function c(t,e,i){const{data:r,indices:s}=t,n=e.typedBuffer,o=e.typedBufferStride,a=s.length;i*=o;for(let t=0;t<a;++t){const e=2*s[t];n[i]=r[e],n[i+1]=r[e+1],i+=o}}function h(t,e,i,r=1){const{data:s,indices:n}=t,o=e.typedBuffer,a=e.typedBufferStride,c=n.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=3*n[t];o[i]=s[e],o[i+1]=s[e+1],o[i+2]=s[e+2],i+=a}else for(let t=0;t<c;++t){const e=3*n[t];for(let t=0;t<r;++t)o[i]=s[e],o[i+1]=s[e+1],o[i+2]=s[e+2],i+=a}}function l(t,e,i,r=1){const{data:s,indices:n}=t,o=e.typedBuffer,a=e.typedBufferStride,c=n.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=4*n[t];o[i]=s[e],o[i+1]=s[e+1],o[i+2]=s[e+2],o[i+3]=s[e+3],i+=a}else for(let t=0;t<c;++t){const e=4*n[t];for(let t=0;t<r;++t)o[i]=s[e],o[i+1]=s[e+1],o[i+2]=s[e+2],o[i+3]=s[e+3],i+=a}}function u(t,e,i,s){(0,r.Re)(d,t,e);const n=Math.max(Math.sqrt((0,r.Bw)(d)),1e-4);(0,r.hs)(d,d,1/n),i[s++]=d[0],i[s++]=d[1],i[s++]=d[2],i[s++]=n}const d=(0,s.vt)();function p(t,e,i,r,s=1){const n=e.typedBuffer,o=e.typedBufferStride;if(r*=o,1===s)for(let e=0;e<i;++e)n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3],r+=o;else for(let e=0;e<i;++e)for(let e=0;e<s;++e)n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3],r+=o}function f(t,e,i,r,s,n,a){let c={numItems:0,numVerticesPerItem:0};for(const h of i.fields.keys()){const i=t.get(h),l=i?.indices;if(i&&l)"position"===h&&(c={numItems:1,numVerticesPerItem:l.length}),m(h,i,r,s,n,a);else if("olidColor"===h&&null!=e){const i=t.get("position")?.indices;if(i){const t=i.length;p(e,n.getField(h,o.XP),t,a)}}}return c}function m(t,e,i,r,s,u){switch(t){case"position":{(0,a.vA)(3===e.size);const r=s.getField(t,o.xs);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void h(t,i,r,s);const{data:o,indices:a}=t,c=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=e[0],p=e[1],f=e[2],m=e[4],g=e[5],_=e[6],v=e[8],x=e[9],b=e[10],y=e[12],w=e[13],T=e[14];r*=l;let M=0,S=0,A=0;const C=(0,n.tZ)(e)?t=>{M=o[t]+y,S=o[t+1]+w,A=o[t+2]+T}:t=>{const e=o[t],i=o[t+1],r=o[t+2];M=d*e+m*i+v*r+y,S=p*e+g*i+x*r+w,A=f*e+_*i+b*r+T};if(1===s)for(let t=0;t<u;++t)C(3*a[t]),c[r]=M,c[r+1]=S,c[r+2]=A,r+=l;else for(let t=0;t<u;++t){C(3*a[t]);for(let t=0;t<s;++t)c[r]=M,c[r+1]=S,c[r+2]=A,r+=l}}(e,i,r,u);break}case"normal":{(0,a.vA)(3===e.size);const i=s.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void h(t,i,r,s);const{data:o,indices:a}=t,c=e,l=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],x=c[8],b=c[9],y=c[10],w=!(0,n.ut)(c),T=1e-6,M=1-T;r*=u;let S=0,A=0,C=0;const E=(0,n.tZ)(c)?t=>{S=o[t],A=o[t+1],C=o[t+2]}:t=>{const e=o[t],i=o[t+1],r=o[t+2];S=p*e+g*i+x*r,A=f*e+_*i+b*r,C=m*e+v*i+y*r};if(1===s)if(w)for(let t=0;t<d;++t){E(3*a[t]);const e=S*S+A*A+C*C;if(e<M&&e>T){const t=1/Math.sqrt(e);l[r]=S*t,l[r+1]=A*t,l[r+2]=C*t}else l[r]=S,l[r+1]=A,l[r+2]=C;r+=u}else for(let t=0;t<d;++t)E(3*a[t]),l[r]=S,l[r+1]=A,l[r+2]=C,r+=u;else for(let t=0;t<d;++t){if(E(3*a[t]),w){const t=S*S+A*A+C*C;if(t<M&&t>T){const e=1/Math.sqrt(t);S*=e,A*=e,C*=e}}for(let t=0;t<s;++t)l[r]=S,l[r+1]=A,l[r+2]=C,r+=u}}(e,r,i,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===e.size);const i=s.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uv0":{(0,a.vA)(2===e.size);const i=s.getField(t,o.ZD)??s.getField(t,o.gH);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uvi":{(0,a.vA)(2===e.size);const i=s.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"color":case"symbolColor":{const i=s.getField(t,o.XP);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(3===e.size||4===e.size),function(t,e,i,r,s=1){const{data:n,indices:o}=t,a=i.typedBuffer,c=i.typedBufferStride,h=o.length;if(r*=c,e===n.length&&4===e){a[r]=n[0],a[r+1]=n[1],a[r+2]=n[2],a[r+3]=n[3];const t=new Uint32Array(i.typedBuffer.buffer,i.start),e=c/4,o=t[r/=4];r+=e;const l=h*s;for(let i=1;i<l;++i)t[r]=o,r+=e;return}if(1!==s)if(4!==e)for(let t=0;t<h;++t){const e=3*o[t];for(let t=0;t<s;++t)a[r]=n[e],a[r+1]=n[e+1],a[r+2]=n[e+2],a[r+3]=255,r+=c}else for(let t=0;t<h;++t){const e=4*o[t];for(let t=0;t<s;++t)a[r]=n[e],a[r+1]=n[e+1],a[r+2]=n[e+2],a[r+3]=n[e+3],r+=c}else{if(4===e){for(let t=0;t<h;++t){const e=4*o[t];a[r]=n[e],a[r+1]=n[e+1],a[r+2]=n[e+2],a[r+3]=n[e+3],r+=c}return}for(let t=0;t<h;++t){const e=3*o[t];a[r]=n[e],a[r+1]=n[e+1],a[r+2]=n[e+2],a[r+3]=255,r+=c}}}(e,e.size,i,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const i=s.getField(t,o.Y$)??s.getField(t,o.Y$);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(1===e.size),function(t,e,i){const{data:r,indices:s}=t,n=e.typedBuffer,o=e.typedBufferStride,a=s.length,c=r[0];i*=o;for(let t=0;t<a;++t)n[i]=c,i+=o}(e,i,u);break}case"tangent":{(0,a.vA)(4===e.size);const r=s.getField(t,o.Eq);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void l(t,i,r,s);const{data:o,indices:a}=t,c=e,h=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],x=c[8],b=c[9],y=c[10],w=!(0,n.ut)(c),T=1e-6,M=1-T;if(r*=u,1===s)for(let t=0;t<d;++t){const e=4*a[t],i=o[e],s=o[e+1],n=o[e+2],c=o[e+3];let l=p*i+g*s+x*n,d=f*i+_*s+b*n,S=m*i+v*s+y*n;if(w){const t=l*l+d*d+S*S;if(t<M&&t>T){const e=1/Math.sqrt(t);l*=e,d*=e,S*=e}}h[r]=l,h[r+1]=d,h[r+2]=S,h[r+3]=c,r+=u}else for(let t=0;t<d;++t){const e=4*a[t],i=o[e],n=o[e+1],c=o[e+2],l=o[e+3];let d=p*i+g*n+x*c,S=f*i+_*n+b*c,A=m*i+v*n+y*c;if(w){const t=d*d+S*S+A*A;if(t<M&&t>T){const e=1/Math.sqrt(t);d*=e,S*=e,A*=e}}for(let t=0;t<s;++t)h[r]=d,h[r+1]=S,h[r+2]=A,h[r+3]=l,r+=u}}(e,i,r,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===e.size);const i=s.getField(t,o.jz)??s.getField(t,o.Eq);(0,a.vA)(!!i,`No buffer view for ${t}`),l(e,i,u);break}case"profileAuxData":{(0,a.vA)(3===e.size);const i=s.getField(t,o.EC)??s.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),h(e,i,u);break}}}},73541(t,e,i){i.d(e,{D:()=>u});var r=i(49255),s=i(22911),n=i(3871),o=i(63365),a=i(31821),c=i(26934);function h(t,e){e.useFloatBlend?t.code.add(a.H`float ditherNoise(vec4 color) { return 0.0; }`):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}var l=i(66211);function u(t,e){t.include(n.Q,e),t.include(s.NL,e);const{fragment:i,outputs:u}=t;i.include(o.a);const{output:d,hasEmission:p,discardInvisibleFragments:f,oitPremultipliedAlpha:m,snowCover:g}=e,_=11===d,v=(0,r.Sp)(d),x=(0,r.Rb)(d),b=(0,r._o)(d)&&!v;let y=0;(b||v)&&u.add("fragColor","vec4",y++),p&&u.add("fragEmission","vec4",y++),v&&u.add("fragAlpha","float",y++),i.include(c.Q),i.include(l.H,e),i.include(h,e),i.code.add(a.H`
|
|
249
|
+
}`)}function c(t){t.uniforms.add(new n.t("screenSizePerspective",t=>l(t.screenSizePerspective,t.screenSizePerspectiveMinPixelReferenceSize)))}function h(t){t.uniforms.add(new n.t("screenSizePerspectiveAlignment",t=>l(t.screenSizePerspectiveAlignment||t.screenSizePerspective,t.screenSizePerspectiveAlignment?null:t.screenSizePerspectiveMinPixelReferenceSize)))}function l(t,e){const i=null!=e&&null!=t?Math.min(t.minPixelSize/e,1):0;return t?(0,r.hZ)(u,t.divisor,t.offset,i):(0,r.hZ)(u,0,0,0)}const u=(0,s.vt)()},77949(t,e,i){i.d(e,{NB:()=>p,Nz:()=>_,S7:()=>g,yu:()=>d});var r=i(58083),s=i(9093),n=i(35522),o=i(51850),a=i(23205),c=i(40710),h=i(33094),l=i(58029),u=i(97102);function d(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",o.uY):t.uniforms.add(new c.W("cameraPosition",(t,e)=>(0,n.hZ)(m,e.camera.viewInverseTransposeMatrix[3]-t.origin[0],e.camera.viewInverseTransposeMatrix[7]-t.origin[1],e.camera.viewInverseTransposeMatrix[11]-t.origin[2])))}function p(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new u.S("view",(t,e)=>(0,r.Tl)(f,e.camera.viewMatrix,t.origin)),new c.W("localOrigin",t=>t.origin));const i=({camera:t})=>(0,n.hZ)(m,t.viewInverseTransposeMatrix[3],t.viewInverseTransposeMatrix[7],t.viewInverseTransposeMatrix[11]);t.uniforms.add(new l.F("proj",t=>t.camera.projectionMatrix),new l.F("view",t=>(0,r.Tl)(f,t.camera.viewMatrix,i(t))),new a.d("localOrigin",t=>i(t)))}const f=(0,s.vt)(),m=(0,o.vt)();function g(t){t.uniforms.add(new l.F("viewNormal",t=>t.camera.viewInverseTransposeMatrix))}function _(t){t.uniforms.add(new h.U("pixelRatio",t=>t.camera.pixelRatio/t.overlayStretch))}},77108(t,e,i){i.d(e,{E:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec2",0,(r,s)=>r.setUniform2fv(t,e(s),i))}}},68259(t,e,i){i.d(e,{t:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec2",2,(r,s,n,o)=>r.setUniform2fv(t,e(s,n,o),i))}}},47286(t,e,i){i.d(e,{G:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec2",1,(r,s,n)=>r.setUniform2fv(t,e(s,n),i))}}},23205(t,e,i){i.d(e,{d:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec3",0,(r,s)=>r.setUniform3fv(t,e(s),i))}}},14314(t,e,i){i.d(e,{I:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec4",0,(r,s)=>r.setUniform4fv(t,e(s),i))}}},71988(t,e,i){i.d(e,{E:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"vec4",1,(r,s,n)=>r.setUniform4fv(t,e(s,n),i))}}},33094(t,e,i){i.d(e,{U:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"float",0,(r,s)=>r.setUniform1f(t,e(s),i))}}},44887(t,e,i){i.d(e,{x:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i,r){super(t,"float",1,(e,s,n)=>e.setUniform1fv(t,i(s,n),r),e)}}},35818(t,e,i){i.d(e,{W:()=>s});var r=i(74333);class s extends r.n{constructor(t,e){super(t,"int",0,(i,r)=>i.setUniform1i(t,e(r)))}}},93588(t,e,i){i.d(e,{c:()=>s});var r=i(74333);class s extends r.n{constructor(t,e){super(t,"int",1,(i,r,s)=>i.setUniform1i(t,e(r,s)))}}},35644(t,e,i){i.d(e,{k:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"mat3",1,(r,s,n)=>r.setUniformMatrix3fv(t,e(s,n),i))}}},58029(t,e,i){i.d(e,{F:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"mat4",0,(r,s)=>r.setUniformMatrix4fv(t,e(s),i))}}},97102(t,e,i){i.d(e,{S:()=>s});var r=i(74333);class s extends r.n{constructor(t,e,i){super(t,"mat4",2,(r,s,n)=>r.setUniformMatrix4fv(t,e(s,n),i))}}},12791(t,e,i){i.d(e,{x:()=>s});var r=i(74333);class s extends r.n{constructor(t,e){super(t,"sampler2D",0,(i,r)=>i.bindTexture(t,e(r)))}}},13840(t,e,i){i.d(e,{r:()=>r});class r{constructor(t,e){this._module=t,this._load=e}get(){return this._module}async reload(){return this._module=await this._load(),this._module}}},98958(t,e,i){i.d(e,{w:()=>f});var r=i(5482),s=i(69622),n=i(53966),o=i(91429),a=i(41976),c=(i(44208),i(26857)),h=i(94656);class l{constructor(t,e,i){this._context=t,this.locations=i,this._textures=new Map,this.source=(0,h.en)()?e:null,e.attributeNames.forEach(t=>{i.has(t)||n.A.getLogger("esri.views.3d.webgl-engine.lib.Program").error(`Missing VertexAttributeLocation for ${t} used in shader`)}),this._glProgram=t.programCache.get(e.generate("vertex",!0),e.generate("fragment",!0),i),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bind=e.generateBind(this),this.bindPass=e.generateBindPass(this),this.bindDraw=e.generateBindDraw(this)}get glName(){return this._glProgram.glName}get hasTransformFeedbackVaryings(){return this._glProgram.hasTransformFeedbackVaryings}get compiled(){return this._glProgram.compiled}setUniform1b(t,e){this._glProgram.setUniform1i(t,e?1:0)}setUniform1i(t,e){this._glProgram.setUniform1i(t,e)}setUniform1f(t,e,i){this._glProgram.setUniform1f(t,e,i)}setUniform2fv(t,e,i){this._glProgram.setUniform2fv(t,e,i)}setUniform3fv(t,e,i){this._glProgram.setUniform3fv(t,e,i)}setUniform4fv(t,e,i){this._glProgram.setUniform4fv(t,e,i)}setUniformMatrix3fv(t,e,i){this._glProgram.setUniformMatrix3fv(t,e,!1,i)}setUniformMatrix4fv(t,e,i){this._glProgram.setUniformMatrix4fv(t,e,!1,i)}setUniformMatrices4fv(t,e,i){this._glProgram.setUniformMatrices4fv(t,e,!1,i)}setUniform1fv(t,e,i){this._glProgram.setUniform1fv(t,e,i)}setUniform1iv(t,e){this._glProgram.setUniform1iv(t,e)}setUniform2iv(t,e){this._glProgram.setUniform2iv(t,e)}setUniform3iv(t,e){this._glProgram.setUniform3iv(t,e)}setUniform4iv(t,e){this._glProgram.setUniform4iv(t,e)}assertCompatibleVertexAttributeLocations(t,e){if(c.b.ENABLE_OPTIMIZATIONS)return;let i=t.locations;if(e){const t=new Map(i);e.forEach((e,r)=>t.set(r,i.size+e)),i=t}i.size!==this.locations.size&&console.error(`VertexAttributeLocations are incompatible: ${i}, ${this.locations}`),this.locations.forEach((t,e)=>{i.get(e)!==t&&console.error(`VertexAttributeLocations are incompatible: Program has ${e} at position ${t}, VAO has it at position ${i.get(e)}.`)})}stop(){this._textures.clear()}bindTexture(t,e,i){if(!e?.glName){const i=`Texture sampler ${t} in ${this._context.debugBoundTechnique} has no given Texture in ${(new Error).stack}`;(0,h.en)()&&console.error(i),e=this._context.emptyTexture}const r=this._ensureTextureUnit(t,e);this._context.useProgram(this);const s=r.unit;this.setUniform1i(t,s),this._context.bindTexture(e,s,!1,i)}_ensureTextureUnit(t,e){let i=this._textures.get(t);return null==i?(i={texture:e,unit:this._textures.size},this._textures.set(t,i)):i.texture=e,i}}var u=i(63907),d=i(90644),p=i(85079);let f=class extends s.A{constructor(t,e,i){super({}),this._context=t,this._configuration=e,this.primitiveType=u.WR.TRIANGLES,this._unused=!0,this.ignoreUnused=!1,this.key=e.key,this.locations=(0,p.Xk)(i??a.lK),this._pipeline=this.initializePipeline(e),this.reload=async i=>{if(i&&await this.shader.reload(),!this.key.equals(e.key))return void n.A.getLogger("esri.views.3d.webgl.ShaderTechnique").warn(`Configuration was changed after construction, cannot reload shader for ${this.declaredClass}.`);const r=this.shader.get().build(e);r.debugName=this.declaredClass,this._program=new l(t.rctx,r,this.locations),this._pipeline=this.initializePipeline(e)}}initialize(){const t=this.shader.get().build(this._configuration);t.debugName=this.declaredClass,this._program=new l(this._context.rctx,t,this.locations)}get program(){return this._unused=!1,this._program}get compiled(){return this._unused=!1,this.program.compiled}get unused(){return this._unused}ensureAttributeLocations(t){this.program.assertCompatibleVertexAttributeLocations(t)}getPipeline(t,e){return this._pipeline}initializePipeline(t){return(0,d.Ey)({blending:d.RC,colorWrite:d.kn})}};f=(0,r.Cg)([(0,o.$K)("esri.views.3d.webgl-engine.core.shaderTechnique.ShaderTechnique")],f)},51976(t,e,i){i.d(e,{K:()=>a,W:()=>c});var r=i(49186),s=i(4576);class n{constructor(t){this._bits=[...t]}equals(t){return(0,s.aI)(this._bits,t.bits)}get code(){return this._code??=String.fromCharCode(...this._bits),this._code}get bits(){return this._bits}}var o=i(65786);class a extends o.Y{constructor(){super(),this._parameterBits=this._parameterBits?.map(()=>0)??[],this._parameterNames??=[]}get key(){return this._key??=new n(this._parameterBits),this._key}decode(t=this.key){const e=this._parameterBits;this._parameterBits=[...t.bits];const i=this._parameterNames.map(t=>` ${t}: ${this[t]}`).join("\n");return this._parameterBits=e,i}}function c(t={}){return(e,i)=>{e.hasOwnProperty("_parameterNames")||Object.defineProperty(e,"_parameterNames",{value:e._parameterNames?.slice()??[],configurable:!0,writable:!0}),e.hasOwnProperty("_parameterBits")||Object.defineProperty(e,"_parameterBits",{value:e._parameterBits?.slice()??[0],configurable:!0,writable:!0}),e._parameterNames.push(i);const s=t.count||2,n=Math.ceil(Math.log2(s)),o=e._parameterBits;let a=0;for(;o[a]+n>16;)a++,a>=o.length&&o.push(0);const c=o[a],h=(1<<n)-1<<c;o[a]+=n,t.count?Object.defineProperty(e,i,{get(){return(this._parameterBits[a]&h)>>c},set(e){const s=this._parameterBits[a];if((s&h)>>c!==e){if(this._key=null,this._parameterBits[a]=s&~h|+e<<c&h,"number"!=typeof e)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must be a number, got ${typeof e}`);if(null==t.count)throw new r.A("internal:invalid-shader-configuration",`Configuration value for ${i} must provide a count option`)}}}):Object.defineProperty(e,i,{get(){return!!((this._parameterBits[a]&h)>>c)},set(t){const e=this._parameterBits[a];if(!!((e&h)>>c)!==t&&(this._key=null,this._parameterBits[a]=e&~h|+t<<c,"boolean"!=typeof t))throw new r.A("internal:invalid-shader-configurationx",`Configuration value for ${i} must be boolean, got ${typeof t}`)}})}}},16943(t,e,i){i.d(e,{E:()=>s});var r=i(44208);function s(){return!!(0,r.A)("enable-feature:objectAndLayerId-rendering")}},41976(t,e,i){i.d(e,{lK:()=>a,wR:()=>o});var r=i(63907),s=i(85079),n=i(74038);const o=[],a=(new n._("position",3,r.pe.FLOAT,0,12),[new n._("position",2,r.pe.FLOAT,0,8)]);(0,s.Xk)(a),new n._("position",2,r.pe.FLOAT,0,12),new n._("uv0",2,r.pe.HALF_FLOAT,8,12),new n._("position",2,r.pe.FLOAT,0,16),new n._("uv0",2,r.pe.FLOAT,8,16)},92130(t,e,i){i.d(e,{A:()=>r});class r{constructor(t){this._material=t.material,this._techniques=t.techniques}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(t,e){return this._techniques.get(t,this._material.getConfiguration(e))}ensureResources(t){return 2}}},63500(t,e,i){i.d(e,{V:()=>E});var r=i(9093),s=i(35522),n=i(97146),o=i(46610),a=i(34275),c=i(20498);function h(t){if(t.length<a.y9)return Array.from(t);if(Array.isArray(t))return Float64Array.from(t);if(!("BYTES_PER_ELEMENT"in t))return Array.from(t);switch(t.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(t);case 2:return(0,a.LW)(t)?(0,c.pX)().from(t):(0,a.jq)(t)?Uint16Array.from(t):Int16Array.from(t);case 4:return Float32Array.from(t);default:return Float64Array.from(t)}}var l=i(15142),u=i(51850),d=i(620);class p{get center(){return(0,u.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,u.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,u.fA)(this._data[7],this._data[8],this._data[9])}constructor(t,e,i){this.primitiveIndices=t,this._numIndexPerPrimitive=e,this.position=i,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,d.vA)(t.length>=1),(0,d.vA)(3===i.size||4===i.size);const{data:r,size:n,indices:o}=i;(0,d.vA)(o.length%this._numIndexPerPrimitive===0),(0,d.vA)(o.length>=t.length*this._numIndexPerPrimitive);const a=t.length;let c=n*o[this._numIndexPerPrimitive*t[0]];f.clear(),f.push(c);const h=(0,u.fA)(r[c],r[c+1],r[c+2]),l=(0,u.o8)(h);for(let e=0;e<a;++e){const i=this._numIndexPerPrimitive*t[e];for(let t=0;t<this._numIndexPerPrimitive;++t){c=n*o[i+t],f.push(c);let e=r[c];h[0]=Math.min(e,h[0]),l[0]=Math.max(e,l[0]),e=r[c+1],h[1]=Math.min(e,h[1]),l[1]=Math.max(e,l[1]),e=r[c+2],h[2]=Math.min(e,h[2]),l[2]=Math.max(e,l[2])}}for(let t=0;t<3;++t)this._data[4+t]=h[t],this._data[7+t]=l[t];const p=(0,s.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-h[0],l[1]-h[1]),l[2]-h[2]),g=m*m;for(let t=0;t<f.length;++t){c=f.at(t);const e=r[c]-p[0],i=r[c+1]-p[1],s=r[c+2]-p[2],n=e*e+i*i+s*s;if(n<=g)continue;const o=Math.sqrt(n),a=.5*(o-m);m+=a,g=m*m;const h=a/o;p[0]+=e*h,p[1]+=i*h,p[2]+=s*h}this._data[3]=m;for(let t=0;t<3;++t)this._data[0+t]=p[t];f.clear()}getChildren(){if(this._children||(0,s.hG)(this.bbMin,this.bbMax)<=1)return this._children;const t=(0,s.Cc)((0,u.vt)(),this.bbMin,this.bbMax,.5),e=this.primitiveIndices.length,i=new Uint8Array(e),r=new Array(8);for(let t=0;t<8;++t)r[t]=0;const{data:n,size:o,indices:a}=this.position;for(let s=0;s<e;++s){let e=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[s];let h=o*a[c],l=n[h],u=n[h+1],d=n[h+2];for(let t=1;t<this._numIndexPerPrimitive;++t){h=o*a[c+t];const e=n[h],i=n[h+1],r=n[h+2];e<l&&(l=e),i<u&&(u=i),r<d&&(d=r)}l<t[0]&&(e|=1),u<t[1]&&(e|=2),d<t[2]&&(e|=4),i[s]=e,++r[e]}let c=0;for(let t=0;t<8;++t)r[t]>0&&++c;if(c<2)return;const h=new Array(8);for(let t=0;t<8;++t)h[t]=r[t]>0?new Uint32Array(r[t]):void 0;for(let t=0;t<8;++t)r[t]=0;for(let t=0;t<e;++t){const e=i[t];h[e][r[e]++]=this.primitiveIndices[t]}this._children=new Array;for(let t=0;t<8;++t)void 0!==h[t]&&this._children.push(new p(h[t],this._numIndexPerPrimitive,this.position));return this._children}static prune(){f.prune()}}const f=new l.A({deallocator:null});var m=i(24326);class g{constructor(t){this.id=(0,m.c)(),this._attributes=new Map;for(const[e,i]of t)this._attributes.set(e,{...i,indices:(0,n.Dg)(i.indices)})}get attributes(){return this._attributes}}var _=i(4341),v=i(11964);function x(t,e,i){return(0,s.Re)(b,e,t),(0,s.Re)(y,i,t),.5*(0,s.Bw)((0,s.$A)(b,b,y))}i(32114),new _.I(v.vt),new _.I(()=>{return t?{p0:(0,u.o8)(t.p0),p1:(0,u.o8)(t.p1),p2:(0,u.o8)(t.p2)}:{p0:(0,u.vt)(),p1:(0,u.vt)(),p2:(0,u.vt)()};var t});const b=(0,u.vt)(),y=(0,u.vt)(),w=(0,u.vt)(),T=(0,u.vt)(),A=(0,u.vt)(),M=(0,u.vt)();var S=i(17478),C=i(94656);class E extends g{constructor(t,e,i=null,r=0,s=null,n=-1,o,a){super(e),this.material=t,this.mapPositions=i,this.type=r,this.olidColor=s,this.edgeIndicesLength=n,this.baseGeometry=o,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,d.vA)((t?.useIndexing??!1)===(null!=a),"Material index requirement and Geometry must match");const c=this.positionAttribute;null!=c&&this.edgeIndicesLength<0&&(this.edgeIndicesLength=c.indices.length)}instantiate(t={}){const e=new E(t.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((t,i)=>{t.exclusive=!1,e._attributes.set(i,t)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:h(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const i=this._attributes.get(t);i?this._attributes.set(t,{...i,exclusive:!0,data:e}):(0,C.en)()&&console.warn(`Setting undefined attribute ${t} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:t}=this,e=this.positionAttribute;if(null!=t&&null!=e){const i=new Array;for(const r of t)i.push(e.indices[r]);this._vertexPositionIndicesCache=i}else this._vertexPositionIndicesCache=e?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const t=this.drawIndices??this.positionAttribute?.indices;return t?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(t){return!!(0===this.type?this._computeAttachmentOriginTriangles(t):2===this.type?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(null!=this._transformation&&(0,s.Z0)(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:n}=e;(0,s.hZ)(t,0,0,0),(0,s.hZ)(M,0,0,0);let o=0,a=0;for(let e=0;e<i.length-2;e+=3){const c=i[e]*r,h=i[e+1]*r,l=i[e+2]*r;(0,s.hZ)(w,n[c],n[c+1],n[c+2]),(0,s.hZ)(T,n[h],n[h+1],n[h+2]),(0,s.hZ)(A,n[l],n[l+1],n[l+2]);const u=x(w,T,A);u?((0,s.WQ)(w,w,T),(0,s.WQ)(w,w,A),(0,s.hs)(w,w,1/3*u),(0,s.WQ)(t,t,w),o+=u):((0,s.WQ)(M,M,w),(0,s.WQ)(M,M,T),(0,s.WQ)(M,M,A),a+=3)}return!(0===a&&0===o||(0!==o?((0,s.hs)(t,t,1/o),0):0===a||((0,s.hs)(t,M,1/a),0)))}(t,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(t){const e=this.positionAttribute,i=this.primitivePositionIndices;return function(t,e,i,r=e?.indices){if(!e||!r)return!1;(0,s.hZ)(t,0,0,0),(0,s.hZ)(M,0,0,0);let n=0,o=0;const{size:a,data:c}=e,h=r.length-1,l=h+(i?2:0);for(let e=0;e<l;e+=2){const i=e<h?e+1:0,l=r[e<h?e:h]*a,u=r[i]*a;w[0]=c[l],w[1]=c[l+1],w[2]=c[l+2],T[0]=c[u],T[1]=c[u+1],T[2]=c[u+2],(0,s.hs)(w,(0,s.WQ)(w,w,T),.5);const d=(0,s.xg)(w,T);d>0?((0,s.WQ)(t,t,(0,s.hs)(w,w,d)),n+=d):0===n&&((0,s.WQ)(M,M,w),o++)}return 0!==n?((0,s.hs)(t,t,1/n),!0):0!==o&&((0,s.hs)(t,M,1/o),!0)}(t,e,function(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}(this.material.parameters,e),i)}_computeAttachmentOriginPoints(t){return function(t,e,i=e?.indices){if(!e||!i)return!1;const{size:r,data:n}=e;(0,s.hZ)(t,0,0,0);let o=-1,a=0;for(let e=0;e<i.length;e++){const s=i[e]*r;o!==s&&(t[0]+=n[s],t[1]+=n[s+1],t[2]+=n[s+2],a++),o=s}return a>1&&(0,s.hs)(t,t,1/a),a>0}(t,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const t=this.positionAttribute,e=this.primitivePositionIndices;if(!t||!e||0===e.length)return null;const i=e===t.indices?t:new o.n(t.data,e,t.size,!1,t.stride),r=0===this.type?3:1;(0,d.vA)(e.length%r===0,"Indexing error: "+e.length+" not divisible by "+r);const s=(0,n.tM)(e.length/r);return new p(s,r,i)}get transformation(){return this._transformation??r.zK}set transformation(t){this._transformation=t&&t!==r.zK?(0,r.o8)(t):null}get highlights(){return this._highlights||R}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(t){this._highlightOptionsCounts?.forEach((e,i)=>t(i))}allocateIdAndHighlight(t){const e=new S.h(t);return this.addHighlight(e)}addHighlight(t){this._ensureHighlights().add(t);const{highlightName:e}=t,i=(this._highlightOptionsCounts?.get(e)??0)+1;return this._ensureHighlightOptionsCounts().set(e,i),t}_ensureHighlights(){let t=this._highlights;return t||(t=new Set,this._highlights=t),t}_ensureHighlightOptionsCounts(){let t=this._highlightOptionsCounts;return t||(t=new Map,this._highlightOptionsCounts=t),t}removeHighlight(t){if(this._highlights?.delete(t)){const{highlightName:e}=t,i=this._highlightOptionsCounts?.get(e)??0;i<=1?this._highlightOptionsCounts?.delete(e):this._ensureHighlightOptionsCounts().set(e,i-1)}}}const R=new Set},49718(t,e,i){i(51850),i(6867).i},6867(t,e,i){i.d(e,{i:()=>l});var r=i(58083),s=i(9093),n=i(35522),o=i(51850),a=i(78955),c=i(91829),h=i(71351);class l{get ray(){return this._ray}get distanceInRenderSpace(){return null==this.distance?null:((0,n.hs)(d,this.ray.direction,this.distance),(0,n.Bw)(d))}withinDistance(t){return!!u(this)&&this.distanceInRenderSpace<=t}getIntersectionPoint(t){return!!u(this)&&((0,n.hs)(d,this.ray.direction,this.distance),(0,n.WQ)(t,this.ray.origin,d),!0)}getTransformedNormal(t){return(0,n.C)(p,this.normal),p[3]=0,(0,a.Z0)(p,p,this.transformation),(0,n.C)(t,p),(0,n.S8)(t,t)}constructor(t){this.intersector=4,this.normal=(0,o.vt)(),this.transformation=(0,s.vt)(),this._ray=(0,h.vt)(),this.init(t)}init(t){this.distance=this.target=this.drapedLayerOrder=this.renderPriority=null,this.intersector=4,(0,h.C)(t,this._ray)}set(t,e,i,a,c,h,l){this.intersector=t,this.distance=i,(0,n.C)(this.normal,a??o.Cb),(0,r.C)(this.transformation,c??s.zK),this.target=e,this.drapedLayerOrder=h,this.renderPriority=l}copy(t){(0,h.C)(t.ray,this._ray),this.intersector=t.intersector,this.distance=t.distance,this.target=t.target,this.drapedLayerOrder=t.drapedLayerOrder,this.renderPriority=t.renderPriority,(0,n.C)(this.normal,t.normal),(0,r.C)(this.transformation,t.transformation)}}function u(t){return null!=t?.distance}const d=(0,o.vt)(),p=(0,c.vt)()},18845(t,e,i){i.d(e,{h:()=>B});var r=i(49186),s=i(65529),n=i(97768),o=i(17676),a=i(34275),c=i(24326),h=i(84952),l=i(38969),u=i(31217),d=i(95117),p=i(2741);let f;var m=i(63907),g=i(76284),_=i(42293);let v=null,x=null;async function b(){return null==x&&(f??=(async()=>{const t=await i.e(9321).then(i.bind(i,49321)),e=await t.default({locateFile:t=>(0,p.s)(`esri/libs/basisu/${t}`)});return e.initializeBasis(),e})(),x=f,v=await x),x}function y(t,e){if(null==v)return t.byteLength;const i=new v.BasisFile(new Uint8Array(t)),r=A(i)?T(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function w(t,e){if(null==v)return t.byteLength;const i=new v.KTX2File(new Uint8Array(t)),r=M(i)?T(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function T(t,e,i,r,s){const n=(0,_.MW)(e?m.CQ.COMPRESSED_RGBA8_ETC2_EAC:m.CQ.COMPRESSED_RGB8_ETC2),o=s&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*n*o)}function A(t){return t.getNumImages()>=1&&!t.isUASTC()}function M(t){return t.getFaces()>=1&&(t.isETC1S()||t.isUASTC())}function S(t,e,i,r,s,n,o,a){const{compressedTextureETC:c,compressedTextureS3TC:h}=t.capabilities,[l,u]=c?r?[1,m.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,m.CQ.COMPRESSED_RGB8_ETC2]:h?r?[3,m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=e.hasMipmap?i:Math.min(1,i),p=[];for(let t=0;t<d;t++)p.push(new Uint8Array(o(t,l))),a(t,l,p[t]);return e.internalFormat=u,e.hasMipmap=p.length>1,e.samplingMode=e.hasMipmap?9987:9729,e.width=s,e.height=n,new g.A(t,e,{type:"compressed",levels:p})}var C=i(53966);const E=()=>C.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function R(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}const I=R("DXT1"),O=R("DXT3"),D=R("DXT5");function F(t,e){const i=new Int32Array(t.buffer,t.byteOffset,31);if(542327876!==i[0])return E().error("Invalid magic number in DDS header"),null;if(!(4&i[20]))return E().error("Unsupported format, must contain a FourCC code"),null;const r=i[21];let s,n;switch(r){case I:s=8,n=m.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case O:s=16,n=m.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case D:s=16,n=m.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return E().error("Unsupported FourCC code:",function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}(r)),null}let o=1,a=i[4],c=i[3];(3&a||3&c)&&(E().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const h=a,l=c;let u,d;131072&i[2]&&!1!==e&&(o=Math.max(1,i[7]));let p=t.byteOffset+i[1]+4;const f=[];for(let e=0;e<o;++e)d=(a+3>>2)*(c+3>>2)*s,u=new Uint8Array(t.buffer,p,d),f.push(u),p+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:n,width:h,height:l}}var P=i(78988),N=i(620),L=i(67171);class B{constructor(t,e){this._data=t,this.id=(0,c.c)(),this.events=new s.bk,this._parameters={...U,...e},this._startPreload(t)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(t){t instanceof HTMLVideoElement?(this.update=e=>this._update(t,e),this._startPreloadVideoElement(t)):t instanceof HTMLImageElement&&this._startPreloadImageElement(t)}_startPreloadVideoElement(t){if(!((0,h.w8)(t.src)||"auto"===t.preload&&t.crossOrigin)&&(t.preload="auto",t.crossOrigin="anonymous",t.src=t.src,t.paused&&t.autoplay)){const e=[];(0,l.i)(t,t=>e.push(t)).then(()=>{t.play()}).finally(()=>e.forEach(t=>t.remove()))}}_startPreloadImageElement(t){(0,h.DB)(t.src)||(0,h.w8)(t.src)||t.crossOrigin||(t.crossOrigin="anonymous",t.src=t.src)}_createDescriptor(t){const e=new L.R;return e.wrapMode=this._parameters.wrap??10497,e.flipped=!this._parameters.noUnpackFlip,e.samplingMode=this._parameters.mipmap?9987:9729,e.hasMipmap=!!this._parameters.mipmap,e.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,e.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?t.parameters.maxMaxAnisotropy:1),e.dataType=this._parameters.dataType??e.dataType,e.pixelFormat=this._parameters.pixelFormat??e.pixelFormat,e.internalFormat=this._parameters.internalFormat??e.internalFormat,e}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(t,e){if(null==t)return 0;if((0,a.mw)(t)||(0,a.mg)(t))return"image/ktx2"===e.encoding?w(t,!!e.mipmap):"image/x.basis"===e.encoding?y(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?H(t):e,s=e.pixelFormat??6408,n=(0,_.wH)(s);return(e.mipmap?4/3:1)*i*r*n||0}(this._data,this._parameters)}load(t){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const e=this._data;return null==e?(this._texture=new g.A(t,this._createDescriptor(t),null),this._texture):(this._emptyTexture=t.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof e?this._loadFromURL(t,e):e instanceof Image?this._loadFromImageElement(t,e):e instanceof HTMLVideoElement?this._loadFromVideoElement(t,e):e instanceof ImageData||e instanceof HTMLCanvasElement?this._loadFromImage(t,e):(0,a.mg)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,e):(0,a.mw)(e)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(t,new Uint8Array(e)):((0,a.mw)(e)||(0,a.mg)(e))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(t,e):((0,a.mw)(e)||(0,a.mg)(e))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(t,e):(0,a.mw)(e)?this._loadFromPixelData(t,new Uint8Array(e)):(0,a.iu)(e)?this._loadFromPixelData(t,e):null)}_update(t,e){return null==this._texture||t.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||e===t.currentTime?e:(this._texture.setData(t),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),t.currentTime)}_loadFromDDSData(t,e){return this._texture=function(t,e,i){const r=F(i,e.hasMipmap??!1);if(null==r)throw new Error("DDS texture data is null");const{textureData:s,internalFormat:n,width:o,height:a}=r;return e.samplingMode=s.levels.length>1?9987:9729,e.hasMipmap=s.levels.length>1,e.internalFormat=n,e.width=o,e.height=a,new g.A(t,e,s)}(t,this._createDescriptor(t),e),this._emptyTexture=null,this._texture}_loadFromKTX2(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await b());const r=new v.KTX2File(new Uint8Array(i));if(!M(r))return null;r.startTranscoding();const s=S(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(t,e)=>r.getImageTranscodedSizeInBytes(t,0,0,e),(t,e,i)=>r.transcodeImage(i,t,0,0,e,0,-1,-1));return r.close(),r.delete(),s}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromBasis(t,e){return this._loadAsync(()=>async function(t,e,i){null==v&&(v=await b());const r=new v.BasisFile(new Uint8Array(i));if(!A(r))return null;r.startTranscoding();const s=S(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(t,e)=>r.getImageTranscodedSizeInBytes(0,t,e),(t,e,i)=>r.transcodeImage(i,0,t,e,0,0));return r.close(),r.delete(),s}(t,this._createDescriptor(t),e).then(t=>(this._texture=t,t)))}_loadFromPixelData(t,e){(0,N.vA)(this._parameters.width>0&&this._parameters.height>0);const i=this._createDescriptor(t);return 6407!==i.pixelFormat&&6408!==i.pixelFormat||(i.compress=this._parameters.compressionOptions),i.width=this._parameters.width??0,i.height=this._parameters.height??0,this._texture=new g.A(t,i,e),this._texture}_loadFromURL(t,e){return this._loadAsync(async i=>{const r=await(0,u.D)(e,{signal:i});return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromImageElement(t,e){return e.complete?this._loadFromImage(t,e):this._loadAsync(async i=>{const r=await(0,d.y)(e,e.src,!1,i);return(0,o.Te)(i),this._loadFromImage(t,r)})}_loadFromVideoElement(t,e){return e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(t,e):this._loadFromVideoElementAsync(t,e)}_loadFromVideoElementAsync(t,e){return this._loadAsync(i=>new Promise((s,a)=>{const c=()=>{e.removeEventListener("loadeddata",h),e.removeEventListener("error",l),(0,n.xt)(u)},h=()=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(c(),s(this._loadFromImage(t,e)))},l=t=>{c(),a(t||new r.A("texture:load-error","Failed to load video"))};e.addEventListener("loadeddata",h),e.addEventListener("error",l);const u=(0,o.u7)(i,()=>l((0,o.NK)()))}))}_loadFromImage(t,e){let i=e;i instanceof HTMLVideoElement||(i=(0,P.vM)(i,t.parameters));const r=H(i);this._parameters.width=r.width,this._parameters.height=r.height;const s=this._createDescriptor(t);return s.width=r.width,s.height=r.height,s.compress=this._parameters.compressionOptions,this._texture=new g.A(t,s,i),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(t){const e=new AbortController;this._loadingController=e;const i=t(e.signal);this._loadingPromise=i;const r=()=>{this._loadingController===e&&(this._loadingController=null),this._loadingPromise===i&&(this._loadingPromise=null),this._emptyTexture=null};return i.then(r,r),i}unload(){if(this._texture=(0,n.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const t=this._loadingController;this._loadingController=null,this._loadingPromise=null,t.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function H(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}const U={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1}},11725(t,e,i){i.d(e,{i:()=>a});var r=i(24326),s=i(49255),n=i(43616),o=i(65786);class a{constructor(t,e){this.id=(0,r.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new e,(0,n.MB)(this._parameters,t),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(t){return!1}setParameters(t,e=!0){(0,n.MB)(this._parameters,t)&&(this.validateParameters(this._parameters),e&&this._parametersChanged())}validateParameters(t){}shouldRender(t){return this.visible&&this.isVisibleForOutput(t.output)&&(!this.parameters.isDecoration||t.bind.decorations)&&0!==(this.parameters.renderOccluded&t.renderOccludedMask)}isVisibleForOutput(t){return!0}get renderPriority(){return this._renderPriority}set renderPriority(t){t!==this._renderPriority&&(this._renderPriority=t,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return 0}getConfiguration(t){return this.updateConfiguration(t),this._configuration}updateConfiguration(t){this._configuration.output=t.output,this._configuration.hasEmission=t.hasEmission&&(0,s._o)(t.output),this._configuration.hasHighlightMixTexture=10===t.output&&null!=t.highlightMixTexture,this._configuration.useFloatBlend=t.useFloatBlend.value}}o.Y},17478(t,e,i){i.d(e,{h:()=>n,p:()=>o});var r=i(24326);class s{constructor(){this.uid=(0,r.c)()}}class n extends s{constructor(t){super(),this.highlightName=t,this.channel=0}}class o extends s{constructor(){super(...arguments),this.channel=1}}},33524(t,e,i){i.d(e,{Yf:()=>o,mt:()=>c,z5:()=>a});var r=i(49255),s=i(90644);const n=(0,s.p3)(1,0,1,771);function o(t,e=!1){switch(t){case 0:return e?s.RC:s.T8;case 1:return n;default:return null}}function a(t){if(t.draped)return null;switch(t.output){case 0:case 2:default:return t.writeDepth?s.Uy:null;case 1:return null}}function c(t,e=513){return{func:(0,r.Sp)(t)?515:e}}},56133(t,e,i){i.d(e,{I$:()=>h,a9:()=>c,m:()=>r,mK:()=>l,qh:()=>a,r8:()=>o,sf:()=>s,v0:()=>n});const r={func:513},s={func:519},n={mask:255},o={mask:0},a={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},c={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}},h={function:{func:514,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7680}},l={function:{func:517,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7680}}},77194(t,e,i){i.d(e,{PS:()=>s}),i(44208);var r=i(34727);class s{constructor(){this._scale=0,this._angleFactor=0,this._minScale=0}update(t,e,i,r){i?(this._scale=Math.min(i.divisor/(e-i.offset),1),this._angleFactor=function(t){return Math.abs(t)**3}(t),this._minScale=null!=r?Math.min(i.minPixelSize/r,1):0):(this._scale=1,this._minScale=1,this._angleFactor=1)}apply(t){const{_scale:e,_angleFactor:i,_minScale:s}=this;return t*(0,r.qE)((0,r.Cc)(e,1,i),s,1)}applyVec2(t,e){t[0]=this.apply(e[0]),t[1]=this.apply(e[1])}}},78988(t,e,i){i.d(e,{Mv:()=>s,vM:()=>n});var r=i(49186);function s(t,e){return e=16*Math.floor(e/16),Math.min(16*Math.round(t/16),e)}function n(t,e){const[i,r]=o(t,e);return t.width===i&&t.height===r?t:a(t,i,r)}function o({width:t,height:e},{maxPreferredTexturePixels:i,maxTextureSize:r}){const n=Math.max(t,e),o=t*e;if(n<=r&&o<=i)return[t,e];const a=Math.min(Math.sqrt(i/o),r/n);return[s(Math.round(t*a),r),s(Math.round(e*a),r)]}function a(t,e,i){if(t instanceof ImageData)return a(function(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(null==i)throw new r.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}(t),e,i);const s=document.createElement("canvas");return s.width=e,s.height=i,s.getContext("2d").drawImage(t,0,0,s.width,s.height),s}},16396(t,e,i){i.d(e,{ou:()=>c}),i(77690),i(29242),i(58083),i(9093);var r=i(35522),s=i(51850),n=i(94008),o=i(57005);const a=new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,s.vt)(),this._tmpSphere=new n.iy}applyToVertex(t,e,i){const s=this.objectTransform.transform,n=(0,r.hZ)(h,t,e,i),o=(0,r.Z0)(n,n,s),a=this.offset/(0,r.Bw)(o);(0,r.Ln)(o,o,o,a);const c=this.objectTransform.inverse;return(0,r.Z0)(this.tmpVertex,o,c),this.tmpVertex}applyToMinMax(t,e){const i=this.offset/(0,r.Bw)(t);(0,r.Ln)(t,t,t,i);const s=this.offset/(0,r.Bw)(e);(0,r.Ln)(e,e,e,s)}applyToAabb(t){const e=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*e,t[1]+=t[1]*e,t[2]+=t[2]*e;const i=this.offset/Math.sqrt(t[3]*t[3]+t[4]*t[4]+t[5]*t[5]);return t[3]+=t[3]*i,t[4]+=t[4]*i,t[5]+=t[5]*i,t}applyToBoundingSphere(t){const e=t.center,i=(0,r.Bw)(e),s=this.offset/i;return(0,r.Ln)(this._tmpSphere.center,e,e,s),this._tmpSphere.radius=t.radius+t.radius*this.offset/i,this._tmpSphere}};function c(t){return null!=t?(a.offset=t,a):null}new class{constructor(t=0){this.componentLocalOriginLength=0,this._totalOffset=0,this._offset=0,this._tmpVertex=(0,s.vt)(),this._tmpMbs=new n.iy,this._tmpObb=new o.ab,this._resetOffset(t)}_resetOffset(t){this._offset=t,this._totalOffset=t}set offset(t){this._resetOffset(t)}get offset(){return this._offset}set componentOffset(t){this._totalOffset=this._offset+t}set localOrigin(t){this.componentLocalOriginLength=(0,r.Bw)(t)}applyToVertex(t,e,i){const s=(0,r.hZ)(h,t,e,i),n=(0,r.hZ)(l,t,e,i+this.componentLocalOriginLength),o=this._totalOffset/(0,r.Bw)(n);return(0,r.Ln)(this._tmpVertex,s,n,o),this._tmpVertex}applyToAabb(t){const e=this.componentLocalOriginLength,i=t[0],r=t[1],s=t[2]+e,n=t[3],o=t[4],a=t[5]+e,c=Math.abs(i),h=Math.abs(r),l=Math.abs(s),u=Math.abs(n),d=Math.abs(o),p=Math.abs(a),f=.5*(1+Math.sign(i*n))*Math.min(c,u),m=.5*(1+Math.sign(r*o))*Math.min(h,d),g=.5*(1+Math.sign(s*a))*Math.min(l,p),_=Math.max(c,u),v=Math.max(h,d),x=Math.max(l,p),b=Math.sqrt(f*f+m*m+g*g),y=Math.sign(c+i),w=Math.sign(h+r),T=Math.sign(l+s),A=Math.sign(u+n),M=Math.sign(d+o),S=Math.sign(p+a),C=this._totalOffset;if(b<C)return t[0]-=(1-y)*C,t[1]-=(1-w)*C,t[2]-=(1-T)*C,t[3]+=A*C,t[4]+=M*C,t[5]+=S*C,t;const E=C/Math.sqrt(_*_+v*v+x*x),R=C/b,I=R-E,O=-I;return t[0]+=i*(y*O+R),t[1]+=r*(w*O+R),t[2]+=s*(T*O+R),t[3]+=n*(A*I+E),t[4]+=o*(M*I+E),t[5]+=a*(S*I+E),t}applyToMbs(t){const e=t.center,i=(0,r.Bw)(e),s=this._totalOffset/i;return(0,r.Ln)(this._tmpMbs.center,e,e,s),this._tmpMbs.radius=t.radius+t.radius*this._totalOffset/i,this._tmpMbs}applyToObb(t){return(0,o.gm)(t,this._totalOffset,this._totalOffset,1,this._tmpObb),this._tmpObb}},new class{constructor(t=0){this.offset=t,this.tmpVertex=(0,s.vt)()}applyToVertex(t,e,i){const s=(0,r.hZ)(h,t,e,i),n=(0,r.WQ)(l,s,this.localOrigin),o=this.offset/(0,r.Bw)(n);return(0,r.Ln)(this.tmpVertex,s,n,o),this.tmpVertex}applyToAabb(t){const e=u,i=d,r=p;for(let s=0;s<3;++s)e[s]=t[0+s]+this.localOrigin[s],i[s]=t[3+s]+this.localOrigin[s],r[s]=e[s];const s=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=s[e],t[e+3]=s[e];const n=e=>{const i=this.applyToVertex(e[0],e[1],e[2]);for(let e=0;e<3;++e)t[e]=Math.min(t[e],i[e]),t[e+3]=Math.max(t[e+3],i[e])};for(let t=1;t<8;++t){for(let s=0;s<3;++s)r[s]=t&1<<s?i[s]:e[s];n(r)}let o=0;for(let t=0;t<3;++t)e[t]*i[t]<0&&(o|=1<<t);if(0!==o&&7!==o)for(let t=0;t<8;++t)if(0===(o&t)){for(let s=0;s<3;++s)r[s]=o&1<<s?0:t&1<<s?e[s]:i[s];n(r)}for(let e=0;e<3;++e)t[e]-=this.localOrigin[e],t[e+3]-=this.localOrigin[e];return t}};const h=(0,s.vt)(),l=(0,s.vt)(),u=(0,s.vt)(),d=(0,s.vt)(),p=(0,s.vt)()},75497(t,e,i){i.d(e,{$p:()=>n,Qx:()=>o,e_:()=>a});var r=i(51850),s=i(37957);class n{constructor(t=(0,r.Ul)()){this.intensity=t}}class o{constructor(t=(0,r.Ul)(),e=(0,r.fA)(.57735,.57735,.57735),i=!0,s=1,n=1){this.intensity=t,this.direction=e,this.castShadows=i,this.specularStrength=s,this.environmentStrength=n}}class a{constructor(){this.r=s.P.create(),this.g=s.P.create(),this.b=s.P.create()}clear(){this.r.fill(0),this.g.fill(0),this.b.fill(0)}}},57226(t,e,i){i.d(e,{TA:()=>b,uH:()=>x});var r=i(34727),s=i(35522),n=i(51850),o=i(75497);function a(t,e,i){i.length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e;return i}function c(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]+e[r];return i}var h=i(37957);const l=.28209479177;function u(t,e){(0,s.ze)(m,t.direction),function(t,e){const i=t[0],r=t[1],s=t[2],n=e||h.P.create();n[0]=l,n[1]=.4886025119*i,n[2]=.4886025119*s,n[3]=.4886025119*r,n[4]=1.09254843059*i*r,n[5]=1.09254843059*r*s,n[6]=.31539156525*(3*s*s-1),n[7]=1.09254843059*i*s,n[8]=.54627421529*(i*i-r*r)}(m,p),function(t,e,i){(i=i||t).length=t.length;for(let r=0;r<t.length;r++)i[r]=t[r]*e[r]}(p,g),a(p,t.intensity[0],f),c(e.r,f),a(p,t.intensity[1],f),c(e.g,f),a(p,t.intensity[2],f),c(e.b,f)}function d(t,e){e.r[0]+=l*g[0]*t.intensity[0]*4*Math.PI,e.g[0]+=l*g[0]*t.intensity[1]*4*Math.PI,e.b[0]+=l*g[0]*t.intensity[2]*4*Math.PI}const p=h.P.create(),f=h.P.create(),m=(0,n.vt)(),g=[3.141593,2.094395,2.094395,2.094395,.785398,.785398,.785398,.785398,.785398];class _{constructor(){this.color=(0,n.vt)(),this.intensity=1}}class v{constructor(){this.direction=(0,n.vt)(),this.ambient=new _,this.diffuse=new _}}const x=.4;class b{constructor(){this._legacy=new v,this.globalFactor=.5,this.noonFactor=.5,this._sphericalHarmonics=new o.e_,this._mainLight=new o.Qx((0,n.vt)(),(0,n.fA)(1,0,0),!1)}get legacy(){return this._legacy}get sh(){return this._sphericalHarmonics}get mainLight(){return this._mainLight}set(t){(function(t,e,i){var r;i.clear(),(0,s.hZ)(e.intensity,0,0,0),r=t,Array.isArray(r)?Array.isArray(t)&&((0,s.C)(e.direction,t[0].direction),(0,s.C)(e.intensity,t[0].intensity),e.specularStrength=t[0].specularStrength,e.environmentStrength=t[0].environmentStrength,e.castShadows=t[0].castShadows,u(t[2],i),d(t[1],i)):d(t,i)})(t,this._mainLight,this._sphericalHarmonics),this.updateLegacy()}updateLegacy(){(0,s.C)(this._legacy.direction,this._mainLight.direction);const t=1/Math.PI;this._legacy.ambient.color[0]=.282095*this._sphericalHarmonics.r[0]*t,this._legacy.ambient.color[1]=.282095*this._sphericalHarmonics.g[0]*t,this._legacy.ambient.color[2]=.282095*this._sphericalHarmonics.b[0]*t,(0,s.hs)(this._legacy.diffuse.color,this._mainLight.intensity,t),(0,s.C)(y,this._legacy.diffuse.color),(0,s.hs)(y,y,x*this.globalFactor),(0,s.WQ)(this._legacy.ambient.color,this._legacy.ambient.color,y)}copyFrom(t){h.P.copy(this._sphericalHarmonics.r,t.sh.r),h.P.copy(this._sphericalHarmonics.g,t.sh.g),h.P.copy(this._sphericalHarmonics.b,t.sh.b),(0,s.C)(this._mainLight.direction,t.mainLight.direction),(0,s.C)(this._mainLight.intensity,t.mainLight.intensity),this._mainLight.castShadows=t.mainLight.castShadows,this._mainLight.specularStrength=t.mainLight.specularStrength,this._mainLight.environmentStrength=t.mainLight.environmentStrength,this.globalFactor=t.globalFactor,this.noonFactor=t.noonFactor}lerpLighting(t,e,i){if((0,s.Cc)(this._mainLight.intensity,t.mainLight.intensity,e.mainLight.intensity,i),this._mainLight.environmentStrength=(0,r.Cc)(t.mainLight.environmentStrength,e.mainLight.environmentStrength,i),this._mainLight.specularStrength=(0,r.Cc)(t.mainLight.specularStrength,e.mainLight.specularStrength,i),(0,s.C)(this._mainLight.direction,e.mainLight.direction),this._mainLight.castShadows=e.mainLight.castShadows,this.globalFactor=(0,r.Cc)(t.globalFactor,e.globalFactor,i),this.noonFactor=(0,r.Cc)(t.noonFactor,e.noonFactor,i),t.sh.r.length===e.sh.r.length)for(let s=0;s<e.sh.r.length;s++)this._sphericalHarmonics.r[s]=(0,r.Cc)(t.sh.r[s],e.sh.r[s],i),this._sphericalHarmonics.g[s]=(0,r.Cc)(t.sh.g[s],e.sh.g[s],i),this._sphericalHarmonics.b[s]=(0,r.Cc)(t.sh.b[s],e.sh.b[s],i);else for(let t=0;t<e.sh.r.length;t++)this._sphericalHarmonics.r[t]=e.sh.r[t],this._sphericalHarmonics.g[t]=e.sh.g[t],this._sphericalHarmonics.b[t]=e.sh.b[t];this.updateLegacy()}}const y=(0,n.vt)()},33442(t,e,i){i.d(e,{Tk:()=>_,b6:()=>p,sG:()=>u});var r=i(35522),s=i(51850),n=i(49255);const o=d(-1),a=d(1),c=o,h=new Array;h[0]=null,h[1]=a,h[2]=o,h[3]=d(-2),h[4]=d(-3);const l=h.map(t=>function(t,e){return e?{factor:t.factor+e.factor,units:t.units+e.units}:t}(c,t));function u({output:t,enableOITOffset:e,polygonOffset:i}){return(0,n.Sp)(t)&&e?l[i]:h[i]}function d(t){return{factor:1*t,units:2*t}}function p(t,e,i,s){const n=u(e);if(!n)return t;const o=m*n.units,a=(0,r.S8)(g,(0,r.jb)(g,s,i));return(e,i,s)=>{const c=(i?1-Math.abs((0,r.Om)(a,i)):0)*n.factor*f+o;return t(e+c,i,s)}}h[1]=a;const f=5e-5,m=5e-6,g=(0,s.vt)();function _(t){const e=u(t)??{factor:0,units:0};return{factor:e.factor+o.factor*t.polygonOffsetIndex,units:e.units+o.units*t.polygonOffsetIndex}}},47724(t,e,i){i.d(e,{L:()=>a});var r=i(5482),s=i(51976),n=i(68317);class o extends n.Hz{constructor(){super(...arguments),this.hasHighlightMixTexture=!1,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,r.Cg)([(0,s.W)()],o.prototype,"hasHighlightMixTexture",void 0);class a extends o{constructor(){super(...arguments),this.polygonOffset=0,this.transparent=!1,this.enableOITOffset=!0}}(0,r.Cg)([(0,s.W)({count:5})],a.prototype,"polygonOffset",void 0),(0,r.Cg)([(0,s.W)()],a.prototype,"transparent",void 0),(0,r.Cg)([(0,s.W)()],a.prototype,"enableOITOffset",void 0)},46606(t,e,i){i.d(e,{S:()=>a,p:()=>c}),i(34727),i(77690),i(29242),i(58083);var r=i(9093),s=(i(35522),i(51850)),n=(i(78955),i(91829),i(31756),i(26857),i(16943),i(65786));class o extends n.Y{constructor(t){super(),this.vvSize=t?.size??null,this.vvColor=t?.color??null,this.vvOpacity=t?.opacity??null}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}(0,r.vt)(),(0,s.vt)(),(0,r.vt)();class a extends o{constructor(){super(...arguments),this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}}const c=8},43616(t,e,i){i.d(e,{MB:()=>c,Um:()=>h,kE:()=>o});var r=i(4576),s=i(34727),n=i(77194);function o(t,e,i,r,n,o){let a=i.screenLength*t.pixelRatio;null!=n&&(l.update(r,e,n,o),a=l.apply(a));const c=a*Math.tan(.5*t.fovY)/(.5*t.fullHeight);return(0,s.qE)(c*e,i.minWorldLength,i.maxWorldLength)}const a=(0,r.VO)();function c(t,e){let i=!1;for(const r in e){const s=e[r];void 0!==s&&(Array.isArray(s)?Array.isArray(t[r])&&a(s,t[r])||(t[r]=s.slice(),i=!0):t[r]!==s&&(i=!0,t[r]=s))}return i}const h={multiply:1,ignore:2,replace:3,tint:4},l=new n.PS},59907(t,e,i){i.d(e,{Wu:()=>u,vJ:()=>f});var r=i(35522),s=i(51850),n=i(58083),o=i(13030),a=i(620);function c(t,e,i){const{data:r,indices:s}=t,n=e.typedBuffer,o=e.typedBufferStride,a=s.length;i*=o;for(let t=0;t<a;++t){const e=2*s[t];n[i]=r[e],n[i+1]=r[e+1],i+=o}}function h(t,e,i,r=1){const{data:s,indices:n}=t,o=e.typedBuffer,a=e.typedBufferStride,c=n.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=3*n[t];o[i]=s[e],o[i+1]=s[e+1],o[i+2]=s[e+2],i+=a}else for(let t=0;t<c;++t){const e=3*n[t];for(let t=0;t<r;++t)o[i]=s[e],o[i+1]=s[e+1],o[i+2]=s[e+2],i+=a}}function l(t,e,i,r=1){const{data:s,indices:n}=t,o=e.typedBuffer,a=e.typedBufferStride,c=n.length;if(i*=a,1===r)for(let t=0;t<c;++t){const e=4*n[t];o[i]=s[e],o[i+1]=s[e+1],o[i+2]=s[e+2],o[i+3]=s[e+3],i+=a}else for(let t=0;t<c;++t){const e=4*n[t];for(let t=0;t<r;++t)o[i]=s[e],o[i+1]=s[e+1],o[i+2]=s[e+2],o[i+3]=s[e+3],i+=a}}function u(t,e,i,s){(0,r.Re)(d,t,e);const n=Math.max(Math.sqrt((0,r.Bw)(d)),1e-4);(0,r.hs)(d,d,1/n),i[s++]=d[0],i[s++]=d[1],i[s++]=d[2],i[s++]=n}const d=(0,s.vt)();function p(t,e,i,r,s=1){const n=e.typedBuffer,o=e.typedBufferStride;if(r*=o,1===s)for(let e=0;e<i;++e)n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3],r+=o;else for(let e=0;e<i;++e)for(let e=0;e<s;++e)n[r]=t[0],n[r+1]=t[1],n[r+2]=t[2],n[r+3]=t[3],r+=o}function f(t,e,i,r,s,n,a){let c={numItems:0,numVerticesPerItem:0};for(const h of i.fields.keys()){const i=t.get(h),l=i?.indices;if(i&&l)"position"===h&&(c={numItems:1,numVerticesPerItem:l.length}),m(h,i,r,s,n,a);else if("olidColor"===h&&null!=e){const i=t.get("position")?.indices;if(i){const t=i.length;p(e,n.getField(h,o.XP),t,a)}}}return c}function m(t,e,i,r,s,u){switch(t){case"position":{(0,a.vA)(3===e.size);const r=s.getField(t,o.xs);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void h(t,i,r,s);const{data:o,indices:a}=t,c=i.typedBuffer,l=i.typedBufferStride,u=a.length,d=e[0],p=e[1],f=e[2],m=e[4],g=e[5],_=e[6],v=e[8],x=e[9],b=e[10],y=e[12],w=e[13],T=e[14];r*=l;let A=0,M=0,S=0;const C=(0,n.tZ)(e)?t=>{A=o[t]+y,M=o[t+1]+w,S=o[t+2]+T}:t=>{const e=o[t],i=o[t+1],r=o[t+2];A=d*e+m*i+v*r+y,M=p*e+g*i+x*r+w,S=f*e+_*i+b*r+T};if(1===s)for(let t=0;t<u;++t)C(3*a[t]),c[r]=A,c[r+1]=M,c[r+2]=S,r+=l;else for(let t=0;t<u;++t){C(3*a[t]);for(let t=0;t<s;++t)c[r]=A,c[r+1]=M,c[r+2]=S,r+=l}}(e,i,r,u);break}case"normal":{(0,a.vA)(3===e.size);const i=s.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void h(t,i,r,s);const{data:o,indices:a}=t,c=e,l=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],x=c[8],b=c[9],y=c[10],w=!(0,n.ut)(c),T=1e-6,A=1-T;r*=u;let M=0,S=0,C=0;const E=(0,n.tZ)(c)?t=>{M=o[t],S=o[t+1],C=o[t+2]}:t=>{const e=o[t],i=o[t+1],r=o[t+2];M=p*e+g*i+x*r,S=f*e+_*i+b*r,C=m*e+v*i+y*r};if(1===s)if(w)for(let t=0;t<d;++t){E(3*a[t]);const e=M*M+S*S+C*C;if(e<A&&e>T){const t=1/Math.sqrt(e);l[r]=M*t,l[r+1]=S*t,l[r+2]=C*t}else l[r]=M,l[r+1]=S,l[r+2]=C;r+=u}else for(let t=0;t<d;++t)E(3*a[t]),l[r]=M,l[r+1]=S,l[r+2]=C,r+=u;else for(let t=0;t<d;++t){if(E(3*a[t]),w){const t=M*M+S*S+C*C;if(t<A&&t>T){const e=1/Math.sqrt(t);M*=e,S*=e,C*=e}}for(let t=0;t<s;++t)l[r]=M,l[r+1]=S,l[r+2]=C,r+=u}}(e,r,i,u);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,a.vA)(2===e.size);const i=s.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uv0":{(0,a.vA)(2===e.size);const i=s.getField(t,o.ZD)??s.getField(t,o.gH);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"uvi":{(0,a.vA)(2===e.size);const i=s.getField(t,o.mJ);(0,a.vA)(!!i,`No buffer view for ${t}`),c(e,i,u);break}case"color":case"symbolColor":{const i=s.getField(t,o.XP);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(3===e.size||4===e.size),function(t,e,i,r,s=1){const{data:n,indices:o}=t,a=i.typedBuffer,c=i.typedBufferStride,h=o.length;if(r*=c,e===n.length&&4===e){a[r]=n[0],a[r+1]=n[1],a[r+2]=n[2],a[r+3]=n[3];const t=new Uint32Array(i.typedBuffer.buffer,i.start),e=c/4,o=t[r/=4];r+=e;const l=h*s;for(let i=1;i<l;++i)t[r]=o,r+=e;return}if(1!==s)if(4!==e)for(let t=0;t<h;++t){const e=3*o[t];for(let t=0;t<s;++t)a[r]=n[e],a[r+1]=n[e+1],a[r+2]=n[e+2],a[r+3]=255,r+=c}else for(let t=0;t<h;++t){const e=4*o[t];for(let t=0;t<s;++t)a[r]=n[e],a[r+1]=n[e+1],a[r+2]=n[e+2],a[r+3]=n[e+3],r+=c}else{if(4===e){for(let t=0;t<h;++t){const e=4*o[t];a[r]=n[e],a[r+1]=n[e+1],a[r+2]=n[e+2],a[r+3]=n[e+3],r+=c}return}for(let t=0;t<h;++t){const e=3*o[t];a[r]=n[e],a[r+1]=n[e+1],a[r+2]=n[e+2],a[r+3]=255,r+=c}}}(e,e.size,i,u);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const i=s.getField(t,o.Y$)??s.getField(t,o.Y$);(0,a.vA)(!!i,`No buffer view for ${t}`),(0,a.vA)(1===e.size),function(t,e,i){const{data:r,indices:s}=t,n=e.typedBuffer,o=e.typedBufferStride,a=s.length,c=r[0];i*=o;for(let t=0;t<a;++t)n[i]=c,i+=o}(e,i,u);break}case"tangent":{(0,a.vA)(4===e.size);const r=s.getField(t,o.Eq);(0,a.vA)(!!r,`No buffer view for ${t}`),function(t,e,i,r,s=1){if(!e)return void l(t,i,r,s);const{data:o,indices:a}=t,c=e,h=i.typedBuffer,u=i.typedBufferStride,d=a.length,p=c[0],f=c[1],m=c[2],g=c[4],_=c[5],v=c[6],x=c[8],b=c[9],y=c[10],w=!(0,n.ut)(c),T=1e-6,A=1-T;if(r*=u,1===s)for(let t=0;t<d;++t){const e=4*a[t],i=o[e],s=o[e+1],n=o[e+2],c=o[e+3];let l=p*i+g*s+x*n,d=f*i+_*s+b*n,M=m*i+v*s+y*n;if(w){const t=l*l+d*d+M*M;if(t<A&&t>T){const e=1/Math.sqrt(t);l*=e,d*=e,M*=e}}h[r]=l,h[r+1]=d,h[r+2]=M,h[r+3]=c,r+=u}else for(let t=0;t<d;++t){const e=4*a[t],i=o[e],n=o[e+1],c=o[e+2],l=o[e+3];let d=p*i+g*n+x*c,M=f*i+_*n+b*c,S=m*i+v*n+y*c;if(w){const t=d*d+M*M+S*S;if(t<A&&t>T){const e=1/Math.sqrt(t);d*=e,M*=e,S*=e}}for(let t=0;t<s;++t)h[r]=d,h[r+1]=M,h[r+2]=S,h[r+3]=l,r+=u}}(e,i,r,u);break}case"profileVertexAndNormal":{(0,a.vA)(4===e.size);const i=s.getField(t,o.jz)??s.getField(t,o.Eq);(0,a.vA)(!!i,`No buffer view for ${t}`),l(e,i,u);break}case"profileAuxData":{(0,a.vA)(3===e.size);const i=s.getField(t,o.EC)??s.getField(t,o.xs);(0,a.vA)(!!i,`No buffer view for ${t}`),h(e,i,u);break}}}},73541(t,e,i){i.d(e,{D:()=>u});var r=i(49255),s=i(22911),n=i(3871),o=i(63365),a=i(31821),c=i(26934);function h(t,e){e.useFloatBlend?t.code.add(a.H`float ditherNoise(vec4 color) { return 0.0; }`):t.code.add("\n float ditherNoise(vec4 color) {\n vec2 seed = color.rg + color.ba + gl_FragCoord.xy + gl_FragCoord.z;\n return (fract(52.9829189 * fract(dot(seed, vec2(0.06711056, 0.00583715)))) - 0.5) / 255.0;\n }")}var l=i(66211);function u(t,e){t.include(n.Q,e),t.include(s.NL,e);const{fragment:i,outputs:u}=t;i.include(o.a);const{output:d,hasEmission:p,discardInvisibleFragments:f,oitPremultipliedAlpha:m,snowCover:g,useFloatBlend:_}=e,v=11===d,x=(0,r.Sp)(d),b=(0,r.Rb)(d),y=(0,r._o)(d)&&!x;let w=0;(y||x)&&u.add("fragColor","vec4",w++),p&&u.add("fragEmission","vec4",w++),x&&u.add("fragAlpha","float",w++),i.include(c.Q),i.include(l.H,e),i.include(h,e),i.code.add(a.H`
|
|
255
250
|
void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${(0,a.If)(g,", float snow")}) {
|
|
256
|
-
${(0,a.If)(
|
|
251
|
+
${(0,a.If)(v,"finalColor.a = 1.0;")}
|
|
257
252
|
${(0,a.If)(f,"if (finalColor.a < alphaCutoff) { discard; }")}
|
|
258
|
-
${(0,a.If)(
|
|
253
|
+
${(0,a.If)(x||p,"float noise = ditherNoise(finalColor);")}
|
|
259
254
|
|
|
260
|
-
${(0,a.If)(
|
|
261
|
-
${(0,a.If)(
|
|
262
|
-
${(0,a.If)(
|
|
255
|
+
${(0,a.If)(x,`fragColor = ${(0,a.If)(m,"finalColor","premultiplyAlpha(finalColor)")};\n fragColor = vec4(fragColor.rgb * floatBlendOutputScale + noise, fragColor.a);\n float scaledAlpha = finalColor.a * floatBlendOutputScale;\n fragAlpha = scaledAlpha + noise;\n ${(0,a.If)(!_,"fragAlpha = fragAlpha < alphaCutoff ? scaledAlpha : fragAlpha;")}`)}
|
|
256
|
+
${(0,a.If)(b&&m&&f,"finalColor.rgb /= finalColor.a;")}
|
|
257
|
+
${(0,a.If)(y,"fragColor = finalColor;")}
|
|
263
258
|
${(0,a.If)(p,`fragEmission = ${(0,a.If)(g,"mix(finalColor.a * getEmissions(emissiveSymbolColor), vec4(0.0), snow);","finalColor.a * getEmissions(emissiveSymbolColor);")}\n fragEmission = vec4(fragEmission.rgb * floatBlendOutputScale + noise, fragEmission.a);`)}
|
|
264
259
|
calculateOcclusionAndOutputHighlight();
|
|
265
|
-
${(0,a.If)(
|
|
260
|
+
${(0,a.If)(v,"outputObjectAndLayerIdColor();")}
|
|
266
261
|
}
|
|
267
|
-
`)}},26934(t,e,i){i.d(e,{Q:()=>s});var r=i(49788);function s(t){t.constants.add("alphaCutoff","float",r.Q)}},2016(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>Rt});var r=i(5482),s=i(69540),n=i(91429);let o=class extends s.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,n.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let m=class extends((0,s.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const s={position:t};return null!=e&&(s.heading=e),null!=i&&(s.tilt=i),null!=r&&(s.fov=r),s}return t}writePosition(t,e,i,r){const s=t.clone();s.x=(0,u.GB)(t.x||0),s.y=(0,u.GB)(t.y||0),s.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=s.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,n.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,n.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,n.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,n.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),x=i(16930),b=(i(48353),i(9762),i(65806)),y=i(27993),w=i(73941),T=(i(19419),i(71351));i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var M=i(58083),S=i(48163),A=i(5443),C=i(39829),E=i(95108),R=i(37585);function I(t,e,i,r){const s=function(t,e){const i=0===e||2===e?0:1,r=t[e],s=0===e||1===e?1:-1,n=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===s?0:1;if(e[i]>r&&o[i]>r)return 1===s?1:0;const a=(o[n]-e[n])/(o[i]-e[i]),c=e[n]+a*(r-e[i]);return t[i]=r,t[n]=c,(e[i]<r?1:-1)*s>0?2:3}}(i,r);if(t.length=0,e.length){1===s(D,e[0],e[0])&&O(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(s(D,e[i],r)){case 1:O(t,r);break;case 3:O(t,(0,S.o8)(D));break;case 2:O(t,(0,S.o8)(D)),O(t,r)}}}}function O(t,e){0!==t.length&&(0,R.aI)(t.at(-1),e)||t.push(e)}const D=(0,S.vt)();var F=i(11964),P=i(27921);const N=(0,v.vt)(),L=(0,v.vt)();function B(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function H(t,e,i,r,s){let n=(0,_.S8)(N,t),o=(0,_.Om)(n,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(n,e),a&&(0,_.hs)(n,n,-1)):n=null);let c=0;if(n){(0,_.hs)(L,r,(0,_.Om)(r,n)),(0,_.Re)(n,n,L);const t=(0,_.Om)(n,s)/((0,_.Bw)(n)*(0,_.Bw)(s));(0,_.$A)(L,n,s),c=((0,_.Om)(L,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function U(t,e,i,r){(0,_.Re)(z,i,e),(0,P.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),V=(0,v.fA)(0,1,0),G=(0,v.fA)(0,0,1),k=(0,g.vt)(),W=(0,v.vt)(),$=(0,v.vt)();function Z(t,e,i,r=B()){const{direction:s,up:n}=r;return(0,M.N9)(k,-(0,l.kU)(e)),(0,M.eL)(k,k,(0,l.kU)(i)),(0,_.Z0)(s,G,k),(0,_.hs)(s,s,-1),(0,_.Z0)(n,V,k),r}function j(t,e,i,r,s){const n=e.lines[11].direction,o=(s-i.getAltitude(r))/n[2];(0,_.Ln)(t,r,n,o)}const X=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return H(e,i,r,G,V)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const s=Z(0,i,r),n=(0,v.vt)();return(0,_.hs)(n,s.direction,-e),(0,_.WQ)(n,n,t),{up:s.up,eye:n,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:Z,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,s=r.getAltitude(e),n=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,T.LV)(e.origin,e.direction),s,X)||j(X,i,r,e.endpoint,s),U(X,o,X,c),a.push((0,S.fA)(X[0],X[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(X,t[0],t[1],0),e.fromRenderCoords(X,X,i),[X[0],X[1]]));return r.length<=2?new C.A({spatialReference:i}):(r.push(r[0].slice()),(0,E.$3)(r)||r.reverse(),new C.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return I(i,t,e,0),I(r,i,e,1),I(i,r,e,2),I(r,i,e,3),r}(a,r.extent),r,n)},toExtent:function(t,e,i,r,s){const n=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,b.g)(e,W,n),(0,b.g)(e,$,n),W[0]-=i/2,$[0]+=i/2,W[1]-=r/2,$[1]+=r/2,(0,y.F)(W,n,W,o),(0,y.F)($,n,$,o),s?(s.xmin=W[0],s.ymin=W[1],s.xmax=$[0],s.ymax=$[1],s.spatialReference=o):s=new A.A(W[0],W[1],$[0],$[1],o),s}},Symbol.toStringTag,{value:"Module"}));var q=i(78955),Y=i(91829),Q=i(34304),K=i(17136),J=i(94008),tt=i(28735),et=i(82919);class it{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}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,et.vt)(),this._points=(0,et.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new J.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,et.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,et.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,et.m7)(this.frustum,t)}intersectsRay(t){return(0,et.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,et.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,et.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=nt;(0,_.S8)(e,this.direction);const i=st;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),s=this._boundingSphere,n=(0,_.Ln)(ot,t,e,r);s.center=n,s.radius=r}static{this.planePointIndices=et.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const st=(0,v.vt)(),nt=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new J.iy,(0,T.vt)(),new A.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,g.vt)(),ft=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=B()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,M.$0)(pt,-(0,l.kU)(e),t),(0,M.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:s,direction:n}=r;return(0,_.$A)(s,ft,t),(0,_.S8)(s,s),(0,_.Z0)(s,s,pt),(0,_.S8)(n,t),(0,_.ze)(n,n),(0,_.Z0)(n,n,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function xt(t,e){const i=[],r=[],s=(0,Q.FD)();for(let n=0;n<t.length;n++){const o=t[n],a=n===t.length-1?t[0]:t[n+1],c=(0,F.Cr)(o,a,Ct),h=(0,P.vE)(e,c.origin,c.vector,0,St);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,n,a]=0===h?[1,i,r]:[-1,r,i],c=(0,P.Qj)(e),l=(0,_.Ln)((0,v.vt)(),St,c,t*s),u=(0,_.Ln)((0,v.vt)(),St,c,t*-s);n.push(o),n.push(l),a.push(u)}}}const n=[];return i.length&&n.push(i),r.length&&n.push(r),n}const bt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},yt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),Mt=(0,v.vt)(),St=(0,v.vt)(),At=new J.iy,Ct=(0,F.vt)(),Et=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const s=ft,n=mt;return(0,_.S8)(s,t),(0,_.$A)(mt,s,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,s,dt),(0,_.$A)(n,mt,s),H(e,i,r,s,n)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const s={eye:(0,v.vt)(),up:null,tilt:r,heading:i},n=ft;n[0]=t[0],n[1]=t[2],n[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(n);let m;if(Math.abs(c)<1e-8)m=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=p*o,x=o*o*(d*d),b=u*u*x,y=m-g,w=y*y,T=b*(b+w-n[1]*n[1]);if(T<0)return(0,_.hs)(s.eye,n,m/f),s.tilt=0,vt(s,t);const M=Math.sqrt(T),S=n[1]*y,A=b+w;let C;if(C=u>0?-M+S:M+S,Math.abs(A)<1e-8)return f<1e-8?(s.eye[0]=0,s.eye[1]=0,s.eye[2]=o):(0,_.hs)(s.eye,n,m/f),s.tilt=0,_t(s.eye),vt(s,t);s.eye[1]=C/A;const E=h*h*x,R=d*o,I=u*R*s.eye[1],O=s.eye[1]*s.eye[1],D=1-O,F=Math.sqrt(D),P=b*O+E-2*I*F*y+D*w;return Math.abs(P)<1e-8?((0,_.hs)(s.eye,n,m/f),s.tilt=0,_t(s.eye),vt(s,t)):(s.eye[0]=(D*(m*n[0]-g*n[0])-R*F*(n[0]*s.eye[1]*u+n[2]*h))/P,s.eye[2]=(D*(m*n[2]-g*n[2])-R*F*(n[2]*s.eye[1]*u-n[0]*h))/P,(0,_.hs)(s.eye,s.eye,m),_t(s.eye),vt(s,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),s=(0,_.Bw)(e);return(0,l.YN)(i/(s/Math.sin(r)))+r},headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),s=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),n=(0,l.YN)(i/(s/Math.sin(t)));return(0,l.KJ)(t-n)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),s=new it(i);r.near=2,s.update(r);const n=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+n),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:m}=bt,g=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return At.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(At,e)}(t),x=(0,l.qE)((u-d)/(p-d),0,1),b=Math.round((0,l.Cc)(f,m,x)),y=r.aboveGround,w=s.planes[5],M=[],S=(0,P.O_)(v.uY,yt,(0,P.vt)()),A=(0,P.O_)(v.uY,wt,(0,P.vt)());(0,q.hZ)(Et,0,0,0,0);const R=t=>{};for(let t=0;t<4;t++){const e=1===t&&!y||3===t&&y?1-g:0,r=1===t&&y||3===t&&!y?g:1,o=s.lines[t],a=s.lines[3===t?0:t+1];for(let s=0;s<b;s++){const h=s/b,u=0===s?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(Mt,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,T.LV)(d,p),n,St),U(St,c,St,w),M.push((0,v.o8)(St)),0!==M.length&&R((0,_.lo)(M.at(-1),St));const f=((0,P.Tj)(S,St)?1:0)|((0,P.Tj)(A,St)?2:0);Et[f]=1}}M.length>2&&(0,_.lo)(M[0],M.at(-1));const I=function(t,e,i){const r=2*(0,Q.FD)();return t.map(t=>{const s=[];let n=!1;for(const o of t)e.fromRenderCoords(o,St,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(s.push([null,St[1]]),s.push([null,St[1]]),n=!0):s.push([St[0],St[1]]);if(n)for(let t=0;t<s.length;t++){const e=s[t];if(null!=e[0])continue;const i=s[t+1],r=s.at(0===t?-1:t-1);e[0]=r[0],t++;const n=s.at(t===s.length-1?0:t+1);i[0]=n[0]}return s.push(s[0]),(0,E.$3)(s)||s.reverse(),s})}((0,q.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(M,S),A):[M],i,o);return new C.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,s){let n,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,s=(0,l.kU)(t),n=Math.sin(r/2),o=Math.cos(s),a=2*(0,l.YN)(Math.sqrt(n*n/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;n=p-f,o=p+f;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function b(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=b(a),h=b(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=K.Y_.monotonic(n,o),o-n>180){const t=(o-n-180)/2;n+=t,o-=t}const y=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:x.A.WGS84;return s?(s.xmin=n,s.ymin=a,s.xmax=o,s.ymax=h,s.spatialReference=y):s=new A.A(n,a,o,h,y),t.spatialReference&&t.spatialReference.isWebMercator&&(0,tt.Gh)(s,!1,s),s}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"};Array.from(Object.values(Ot)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>S});var r=i(5482),s=i(69622),n=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),x=i(44280);function b(t,e,i){t.worldUpAtPosition(e,y),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,y)/r)}const y=(0,f.vt)(),w=(0,f.vt)();var T;let M=T=class extends s.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(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(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}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 t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,s=i/this.rows,n=r/this.columns,o=-r/2+this.column*n,a=o+n,c=-i/2+this.row*s,u=c+s,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.aI)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(E,t.eye,t.center),(0,p.jb)(R,this.eye,this.center);const i=(0,p.Om)(E,R),r=(0,p.uE)(E),s=(0,p.uE)(R),n=5e-4;return i*i>=(1-1e-10)*r*s&&(0,p.lo)(t.eye,this.eye)<Math.max(r,s)*n*n}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,x.gr)(this.viewForward,(0,p.Re)(E,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==A&&(0,p.C)(A,t),A[3]=1,(0,m.Z0)(A,A,this.projectionMatrix);const i=Math.abs(A[3]);(0,p.hs)(A,A,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*A[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*A[1]),e[2]=.5*(A[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;A[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],A[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],A[2]=(2*t[2]-1)*t[3],A[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(A,A,this.inverseProjectionMatrix),e[0]=A[0],e[1]=A[1],e[2]=A[2])}projectToScreen(t,e){return this.projectToRenderScreen(t,I),this.renderToScreen(I,e),e}projectToRenderScreen(t,e){if(A[0]=t[0],A[1]=t[1],A[2]=t[2],A[3]=1,(0,m.Z0)(A,A,this.viewProjectionMatrix),0===A[3])return null;const i=A;(0,p.hs)(i,i,1/Math.abs(A[3]));const r=this.fullViewport,s=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),n=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=s,e.y=n):(e[0]=s,e[1]=n,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,I),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return A[0]=2*(t[0]-i[0])/i[2]-1,A[1]=2*(t[1]-i[1])/i[3]-1,A[2]=2*t[2]-1,A[3]=1,(0,m.Z0)(A,A,C),0===A[3]?null:(e[0]=A[0]/A[3],e[1]=A[1]/A[3],e[2]=A[2]/A[3],e)}constrainWindowSize(t,e,i,r){const s=t*this.pixelRatio,n=e*this.pixelRatio,o=Math.max(s-i/2,0),a=Math.max(this.fullHeight-n-r/2,0),c=-Math.min(s-i/2,0),h=-Math.min(this.fullHeight-n-r/2,0),l=i-c- -Math.min(this.fullWidth-s-i/2,0),u=r-h- -Math.min(n-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:s,fovY:n}=this,o=Math.abs(Math.PI/2-b(e,i,r));return t.frustumCoverage(o,s,n)}_computeUpGlobal(){(0,p.Re)(E,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(E,this.center))>.9999*(0,p.Bw)(E)*t||((0,p.$A)(R,E,this.center),(0,p.$A)(R,R,E),(0,p.S8)(R,R),(0,p.t2)(this._up,R)||((0,p.C)(this._up,R),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(E,this.eye,this.center),Math.abs(E[2])<=.9999&&((0,p.hs)(E,E,E[2]),(0,p.hZ)(E,-E[0],-E[1],1-E[2]),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):n.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,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],M.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],M.prototype,"relativeElevation",void 0),M=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],M);const S=M,A=(0,g.vt)(),C=(0,l.vt)(),E=(0,f.vt)(),R=(0,f.vt)(),I=(0,a.r_)()},48375(t,e,i){i.d(e,{A:()=>F});var r=i(5482),s=i(69622),n=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(2016),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(76284),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:s,internalFormat:n,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,n,r,s):i.renderbufferStorage(i.RENDERBUFFER,n,r,s),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class b{constructor(t,e,i){if(this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return y(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===M(t)||null!=t&&"samples"in t}(e)?new x(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),y(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return y(t)||T(t)}(i))this._depthStencilTexture=y(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new x(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return y(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&y(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=y(e);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._initialized){const e=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{t.forEach(t=>{y(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,0,i):this._framebufferTexture2D(r.glName,e,t,36160,0))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,C(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,C(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,s=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,s,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebufferObject(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,s,n,o){(t<0||e<0||s<0||n<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||s+i>a.width||n+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,s,n,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,s,n,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,s,n,o)}async readPixelsAsync(t,e,i,r,s,n,o){const{gl:a}=this._context,c=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,s,n,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(S(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._initialized&&(S(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const i=e.createFramebuffer();if(e.bindFramebuffer(t,i),this._colorAttachments.forEach((e,i)=>{if(y(e)){const r=A(e);35866===r?this._framebufferTextureLayer(e.glName,i,t,0,0):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=C(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,A(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160,s=0){this._context.gl.framebufferTexture2D(r,e,i,t,s)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0,s=0){this._context.gl.framebufferTextureLayer(i,e,t,r,s)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,C(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),S(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){S(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===b._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;b._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>b._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${b._MAX_COLOR_ATTACHMENTS} color attachments`)}}function y(t){return 1===M(t)}function w(t){return 2===M(t)}function T(t){return 0===M(t)}function M(t){return null!=t&&"type"in t?t.type:null}function S(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function A(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function C(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let D=class extends s.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new n.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 t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);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(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D);const F=D},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}}},48852(t,e,i){i.d(e,{g:()=>u});var r=i(4576),s=i(44208),n=i(53966),o=i(34275),a=i(94656),c=i(63907);const h=()=>n.A.getLogger("esri.views.webgl.BufferObject"),l=!!(0,s.A)("esri-tests-disable-gpu-memory-measurements");class u{static createIndex(t,e,i){return new u(t,34963,e,i)}static createUniform(t,e,i){return new u(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new u(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new u(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new u(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(c.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case c.pe.UNSIGNED_INT:return this._sizeBytes/4;case c.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case c.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return l?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c.vt.BufferObject,this),this._context=null):this._glName&&h().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case c.pe.UNSIGNED_SHORT:t*=2;break;case c.pe.UNSIGNED_INT:t*=4;case c.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,o.mg)(t)?this._indexType=c.pe.UNSIGNED_BYTE:(0,o.jq)(t)?this._indexType=c.pe.UNSIGNED_SHORT:(0,o.XJ)(t)&&(this._indexType=c.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,a.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:n}=this._context;n.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,a.Y2)(n),this._isVAOAware&&this._context.bindVAO(s)}getSubData(t,e=0,i,s){if(i<0||s<0)return;const n=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(n*((i??0)+(s??0))>t.byteLength)return;e+n*(s??0)>this.usedMemory&&h().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,s),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,s),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){await this._context.clientWaitAsync(),this.getSubData(t,e,i,r)}}},65786(t,e,i){i.d(e,{Y:()=>r});const r=class{};new r},14113(t,e,i){i.d(e,{N5:()=>a});var r=i(49186),s=(i(44208),i(53966));const n=()=>s.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),s="vertex"===t?this.vertex:this.fragment,n=s.uniforms.generateSource(),o=s.code.generateSource(),a=s.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=s.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${n.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let s=0;s<r;++s)i[s](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,s)=>{for(let n=0;n<r;++n)i[n](t,e,s)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,s,n)=>{for(let o=0;o<r;++o)i[o](t,n,e,s)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){return this._entries}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?n().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):n().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#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",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},76284(t,e,i){i.d(e,{A:()=>M});var r=i(49186),s=i(44208),n=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171);const d=()=>n.A.getLogger("esri/views/webgl/textureUtils");function p(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&d().error("Negative dimension parameters are not allowed!");const{internalFormat:s}=t;if(s&&(f(s)||m(s))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:s}=t;s&&d().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&d().error("Depth textures cannot sample mipmaps"):(9728!==r&&d().error("Depth textures without filtering must use NEAREST filtering"),i&&d().error("Depth textures without filtering cannot use compare function"))}}function f(t){return(0,a.a4)(l.SB,t)}function m(t){return(0,a.a4)(l.iE,t)}function g(t){return null!=t&&"type"in t&&"compressed"===t.type}function _(t){return null!=t&&!g(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function v(t){return 32879===t||35866===t}function x(t,e,i,r=1){let s=Math.max(e,i);return 32879===t&&(s=Math.max(s,r)),Math.floor(Math.log2(s))+1}function b(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case l.ld.FLOAT:switch(t.pixelFormat){case 6408:return l.H0.RGBA32F;case 6407:return l.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case l.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return l.H0.RGBA8;case 6407:return l.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?l.iE.DEPTH24_STENCIL8:6402===e?l.SB.DEPTH_COMPONENT24:e,t.internalFormat}class y extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new y(t,e)}}const w=!!(0,s.A)("esri-tests-disable-gpu-memory-measurements"),T=()=>n.A.getLogger("esri/views/webgl/Texture");class M{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=y.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return w?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(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!g(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!g(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,s,n,o,a=0){o||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=b(c);const{context:h,pixelFormat:l,dataType:u,target:d,isImmutable:p}=c;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=h.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+s>c.width||i+n>c.height)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:m}=h;a&&(s&&n||T().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),m.pixelStorei(m.UNPACK_SKIP_ROWS,a)),_(o)?m.texSubImage2D(d,t,e,i,s,n,l,u,o):g(o)?m.compressedTexSubImage2D(d,t,e,i,s,n,c.internalFormat,o.levels[t]):m.texSubImage2D(d,t,e,i,s,n,l,u,o),a&&m.pixelStorei(m.UNPACK_SKIP_ROWS,0),h.bindTexture(f,M.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,s,n,o,a,c){c||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=b(h);const{context:l,pixelFormat:u,dataType:d,isImmutable:p,target:f}=h;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");v(f)||T().warn("Attempting to set 3D texture data on a non-3D texture");const m=l.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||s<0||e+n>h.width||i+o>h.height||s+a>h.depth)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=l;if(g(c))c=c.levels[t],_.compressedTexSubImage3D(f,t,e,i,s,n,o,a,h.internalFormat,c);else{const r=c;_.texSubImage3D(f,t,e,i,s,n,o,a,u,d,r)}l.bindTexture(m,M.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,p(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,M.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,p(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,p(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),p(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,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,s=i.context?.gl;if(!s)return;(0,h.Y2)(s),this.hasWebGLTextureObject||(this._glName=s.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),p(i);const n=i.context.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(s);const o=e??i.target,c=v(o);if(_(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:n,depth:u}=i;if(null==e||null==n)throw new r.A("texture:missing-size","Width and height must be specified!");if(c&&null==u)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=b(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,n,u),g(t)){if(!function(t){return null!=t&&(0,a.a4)(l.CQ,t)}(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,n,u,t),(0,h.Y2)(s),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(s),i.context.bindTexture(n,M.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=b(r);const s=v(e),{width:n,height:o,depth:a}=function(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}(t);r.width&&r.height,r.width||(r.width=n),r.height||(r.height=o),s&&r.depth,s&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,n,o,a),this._texImage(e,0,r.internalFormat,n,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:n,depth:o}=r,a=t.levels,c=x(i,s,n,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,s,n)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,s,n,o)},h)}_texStorage(t,e,i,s,n,o){const{gl:a}=this._descriptor.context;if(!function(t){return l.XN.includes(t)}(e)&&!f(e)&&!m(e))throw new r.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=i?x(t,s,n,o):1;if(v(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,s,n,o)}else a.texStorage2D(t,c,e,s,n);this._wasImmutablyAllocated=!0}_texImage(t,e,i,s,n,o,a){const c=this._descriptor.context.gl,h=v(t),{isImmutable:l,pixelFormat:u,dataType:d}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,s,n,o,u,d,i)}else c.texSubImage2D(t,e,0,0,s,n,u,d,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,s,n,o,0,u,d,l)}else c.texImage2D(t,e,i,s,n,0,u,d,l)}}_compressedTexImage(t,e,i,s,n,o,a){const c=this._descriptor.context.gl,h=v(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,s,n,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,s,n,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,s,n,o,0,a)}else c.compressedTexImage2D(t,e,i,s,n,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:s,preMultiplyAlpha:n,hasMipmap:o}=this._descriptor,a=this._descriptor.compress?.compressionTracker,h=this._descriptor.compress?.compressionCallback,{compressedTextureETC:l,compressedTextureS3TC:u}=r.capabilities;if(!M.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!l&&!u)return;this.abortCompression();const d=new AbortController;let p;this._compressionAbortController=d,a?.increment();try{t instanceof Uint8Array?p=t.buffer:(p=await createImageBitmap(t,{imageOrientation:s?"flipY":"none"}),(0,c.Te)(d));const r={data:p,width:e,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:o,hasETC:!!l,hasS3TC:!!u},a=await M.compressionWorkerHandle.invoke(r,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),h?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||T().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),p instanceof ImageBitmap&&p.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:s,depth:n,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==s||c&&null==n)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,s,n),o&&(1!==i||1!==s||c&&1!==n)&&!(r>=e);++r)i=Math.max(1,i>>1),s=Math.max(1,s>>1),c&&(n=Math.max(1,n>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>n,e:()=>o});var r=i(63907),s=i(42293);class n{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,s.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),s=i(63907);const n=new Set([s.pe.BYTE,s.pe.SHORT,s.pe.INT,s.pe.UNSIGNED_BYTE,s.pe.UNSIGNED_SHORT,s.pe.UNSIGNED_INT]);function o(t,e,i,s=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=s*a.stride;if(a.count<=4)a.integer&&n.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case s.H0.R8:case s.H0.R8I:case s.H0.R8UI:case s.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case s.H0.RGBA4:case s.H0.R16F:case s.H0.R16I:case s.H0.R16UI:case s.H0.RG8:case s.H0.RG8I:case s.H0.RG8UI:case s.H0.RG8_SNORM:case s.H0.RGB565:case s.H0.RGB5_A1:case s.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case s.H0.RGB8:case s.H0.RGB8I:case s.H0.RGB8UI:case s.H0.RGB8_SNORM:case s.H0.SRGB8:case s.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case s.H0.RGBA8:case s.H0.R32F:case s.H0.R11F_G11F_B10F:case s.H0.RG16F:case s.H0.R32I:case s.H0.R32UI:case s.H0.RG16I:case s.H0.RG16UI:case s.H0.RGBA8I:case s.H0.RGBA8UI:case s.H0.RGBA8_SNORM:case s.H0.SRGB8_ALPHA8:case s.H0.RGB9_E5:case s.H0.RGB10_A2UI:case s.H0.RGB10_A2:case s.SB.DEPTH_COMPONENT32F:case s.iE.DEPTH24_STENCIL8:return 4;case s.iE.DEPTH32F_STENCIL8:return 5;case s.H0.RGB16F:case s.H0.RGB16I:case s.H0.RGB16UI:return 6;case s.H0.RG32F:case s.H0.RG32I:case s.H0.RG32UI:case s.H0.RGBA16F:case s.H0.RGBA16I:case s.H0.RGBA16UI:return 8;case s.H0.RGB32F:case s.H0.RGB32I:case s.H0.RGB32UI:return 12;case s.H0.RGBA32F:case s.H0.RGBA32I:case s.H0.RGBA32UI:return 16;case s.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case s.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case s.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case s.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case s.CQ.COMPRESSED_R11_EAC:case s.CQ.COMPRESSED_SIGNED_R11_EAC:case s.CQ.COMPRESSED_RGB8_ETC2:case s.CQ.COMPRESSED_SRGB8_ETC2:case s.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case s.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case s.CQ.COMPRESSED_RG11_EAC:case s.CQ.COMPRESSED_SIGNED_RG11_EAC:case s.CQ.COMPRESSED_RGBA8_ETC2_EAC:case s.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),s=i(53966),n=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>s.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,s,n){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==s?new Map:"number"==typeof s?new Map([["geometry",s]]):s,this.locations=n??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,n.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>s});var r=i(48852);class s extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),s=i(44208),n=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,s.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;n.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)n[0]=t[r],e[r]=n[0];return e}function s(t,e){const i=t.length;for(let r=0;r<i;++r)n[0]=t[r],n[1]=t[r]-n[0],e[r]=n[1];return e}i.d(e,{Zo:()=>r,jA:()=>s});const n=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function s(t,e,i,r,s=32774,n=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:s,opAlpha:n,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>y,RC:()=>o,T8:()=>a,Uy:()=>u,Xt:()=>l,iD:()=>n,kn:()=>d,p3:()=>s}),i(4718);const n=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=s(770,1,771,771),c=(s(0,0,768,1),{face:1029,mode:2305}),h={face:1028,mode:2305},l=t=>2===t?c:1===t?h:null,u={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function p(t){return M.intern(t)}function f(t){return A.intern(t)}function m(t){return E.intern(t)}function g(t){return I.intern(t)}function _(t){return D.intern(t)}function v(t){return P.intern(t)}function x(t){return L.intern(t)}function b(t){return H.intern(t)}function y(t){return z.intern(t)}class w{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function T(t){return"["+t.join(",")+"]"}const M=new w(S,t=>({__tag:"Blending",...t}));function S(t){return t?T([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const A=new w(C,t=>({__tag:"Culling",...t}));function C(t){return t?T([t.face,t.mode]):null}const E=new w(R,t=>({__tag:"PolygonOffset",...t}));function R(t){return t?T([t.factor,t.units]):null}const I=new w(O,t=>({__tag:"DepthTest",...t}));function O(t){return t?T([t.func]):null}const D=new w(F,t=>({__tag:"StencilTest",...t}));function F(t){return t?T([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const P=new w(N,t=>({__tag:"DepthWrite",...t}));function N(t){return t?T([t.zNear,t.zFar]):null}const L=new w(B,t=>({__tag:"ColorWrite",...t}));function B(t){return t?T([t.r,t.g,t.b,t.a]):null}const H=new w(U,t=>({__tag:"StencilWrite",...t}));function U(t){return t?T([t.mask]):null}const z=new w(function(t){return t?T([S(t.blending),C(t.culling),R(t.polygonOffset),O(t.depthTest),F(t.stencilTest),N(t.depthWrite),B(t.colorWrite),U(t.stencilWrite)]):null},t=>({blending:p(t.blending),culling:f(t.culling),polygonOffset:m(t.polygonOffset),depthTest:g(t.depthTest),stencilTest:_(t.stencilTest),depthWrite:v(t.depthWrite),colorWrite:x(t.colorWrite),stencilWrite:b(t.stencilWrite)}))},49788(t,e,i){i.d(e,{Q:()=>r});const r=1/255.5}}]);
|
|
262
|
+
`)}},26934(t,e,i){i.d(e,{Q:()=>s});var r=i(49788);function s(t){t.constants.add("alphaCutoff","float",r.Q)}},2016(t,e,i){i.d(e,{OG:()=>Ot,gP:()=>Rt});var r=i(5482),s=i(69540),n=i(91429);let o=class extends s.Pw{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return null!=t&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"row",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"column",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"rows",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"columns",void 0),o=(0,r.Cg)([(0,n.$K)("esri.CameraLayout")],o);const a=o;var c=i(69052),h=i(25482),l=i(34727),u=i(56507),d=i(86738),p=i(43937),f=i(36005);let m=class extends((0,s.OU)(h.o)){constructor(...t){super(...t),this.position=new d.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new a}normalizeCtorArgs(t,e,i,r){if(t&&"object"==typeof t&&("x"in t||Array.isArray(t))){const s={position:t};return null!=e&&(s.heading=e),null!=i&&(s.tilt=i),null!=r&&(s.fov=r),s}return t}writePosition(t,e,i,r){const s=t.clone();s.x=(0,u.GB)(t.x||0),s.y=(0,u.GB)(t.y||0),s.z=t.hasZ?(0,u.GB)(t.z||0):t.z,e[i]=s.write({},r)}readPosition(t,e){const i=new d.A;return i.read(t,e),i.x=(0,u.GB)(i.x||0),i.y=(0,u.GB)(i.y||0),i.z=i.hasZ?(0,u.GB)(i.z||0):i.z,i}equals(t){return null!=t&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};(0,r.Cg)([(0,n.MZ)({type:d.A,json:{write:{isRequired:!0}}})],m.prototype,"position",void 0),(0,r.Cg)([(0,p.K)("position")],m.prototype,"writePosition",null),(0,r.Cg)([(0,f.w)("position")],m.prototype,"readPosition",null),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(t=>c.ie.normalize((0,u.GB)(t)))],m.prototype,"heading",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,n.wg)(t=>(0,l.qE)((0,u.GB)(t),-180,180))],m.prototype,"tilt",void 0),(0,r.Cg)([(0,n.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,n.wg)(t=>(0,l.qE)((0,u.GB)(t,55),1,170))],m.prototype,"fov",void 0),(0,r.Cg)([(0,n.MZ)({type:a,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"layout",void 0),m=(0,r.Cg)([(0,n.$K)("esri.Camera")],m);var g=i(9093),_=i(35522),v=i(51850),x=i(16930),b=(i(48353),i(9762),i(65806)),y=i(27993),w=i(73941),T=(i(19419),i(71351));i(91712),i(49718),i(6867),i(16396),(0,v.vt)(),(0,v.vt)(),(0,v.vt)();var A=i(58083),M=i(48163),S=i(5443),C=i(39829),E=i(95108),R=i(37585);function I(t,e,i,r){const s=function(t,e){const i=0===e||2===e?0:1,r=t[e],s=0===e||1===e?1:-1,n=0===i?1:0;return(t,e,o)=>{if(e[i]<r&&o[i]<r)return 1===s?0:1;if(e[i]>r&&o[i]>r)return 1===s?1:0;const a=(o[n]-e[n])/(o[i]-e[i]),c=e[n]+a*(r-e[i]);return t[i]=r,t[n]=c,(e[i]<r?1:-1)*s>0?2:3}}(i,r);if(t.length=0,e.length){1===s(D,e[0],e[0])&&O(t,e[0]);for(let i=0;i<e.length;i++){const r=e[i===e.length-1?0:i+1];switch(s(D,e[i],r)){case 1:O(t,r);break;case 3:O(t,(0,M.o8)(D));break;case 2:O(t,(0,M.o8)(D)),O(t,r)}}}}function O(t,e){0!==t.length&&(0,R.aI)(t.at(-1),e)||t.push(e)}const D=(0,M.vt)();var F=i(11964),P=i(27921);const N=(0,v.vt)(),L=(0,v.vt)();function B(){return{direction:(0,v.vt)(),up:(0,v.vt)()}}function H(t,e,i,r,s){let n=(0,_.S8)(N,t),o=(0,_.Om)(n,r);const a=o>0;o=Math.abs(o),o>.99&&(o=Math.abs((0,_.Om)(e,r)),o<.99?((0,_.C)(n,e),a&&(0,_.hs)(n,n,-1)):n=null);let c=0;if(n){(0,_.hs)(L,r,(0,_.Om)(r,n)),(0,_.Re)(n,n,L);const t=(0,_.Om)(n,s)/((0,_.Bw)(n)*(0,_.Bw)(s));(0,_.$A)(L,n,s),c=((0,_.Om)(L,r)>0?1:-1)*(0,l.KJ)((0,l.XM)(t))}const h=(0,l.KJ)((0,l.XM)(-(0,_.Om)(r,t)/(0,_.Bw)(t)));return i?(i.heading=c,i.tilt=h,i):{heading:c,tilt:h}}function U(t,e,i,r){(0,_.Re)(z,i,e),(0,P.T7)(r,(0,F.LV)(e,z),t)||t===i||(0,_.C)(t,i)}const z=(0,v.vt)(),V=(0,v.fA)(0,1,0),G=(0,v.fA)(0,0,1),k=(0,g.vt)(),W=(0,v.vt)(),$=(0,v.vt)();function Z(t,e,i,r=B()){const{direction:s,up:n}=r;return(0,A.N9)(k,-(0,l.kU)(e)),(0,A.eL)(k,k,(0,l.kU)(i)),(0,_.Z0)(s,G,k),(0,_.hs)(s,s,-1),(0,_.Z0)(n,V,k),r}function j(t,e,i,r,s){const n=e.lines[11].direction,o=(s-i.getAltitude(r))/n[2];(0,_.Ln)(t,r,n,o)}const X=(0,v.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){return H(e,i,r,G,V)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const s=Z(0,i,r),n=(0,v.vt)();return(0,_.hs)(n,s.direction,-e),(0,_.WQ)(n,n,t),{up:s.up,eye:n,heading:i,tilt:r}},eyeTiltToLookAtTilt:function(t){return(0,l.kU)(t)},headingTiltToDirectionUp:Z,lookAtTiltToEyeTilt:function(t){return(0,l.KJ)(t)},toArea:function(t,e){const i=t.frustum,{renderCoordsHelper:r}=t,s=r.getAltitude(e),n=t.spatialReference,o=t.state.camera.eye,a=[],c=i.planes[5];for(let t=0;t<4;t++){const e=i.lines[t];r.intersectInfiniteManifold((0,T.LV)(e.origin,e.direction),s,X)||j(X,i,r,e.endpoint,s),U(X,o,X,c),a.push((0,M.fA)(X[0],X[1]))}return function(t,e,i){const r=t.map(t=>((0,_.hZ)(X,t[0],t[1],0),e.fromRenderCoords(X,X,i),[X[0],X[1]]));return r.length<=2?new C.A({spatialReference:i}):(r.push(r[0].slice()),(0,E.$3)(r)||r.reverse(),new C.A({rings:[r],spatialReference:i}))}(function(t,e){const i=[],r=[];return I(i,t,e,0),I(r,i,e,1),I(i,r,e,2),I(r,i,e,3),r}(a,r.extent),r,n)},toExtent:function(t,e,i,r,s){const n=t.renderSpatialReference,o=t.spatialReference??e.spatialReference;return(0,b.g)(e,W,n),(0,b.g)(e,$,n),W[0]-=i/2,$[0]+=i/2,W[1]-=r/2,$[1]+=r/2,(0,y.F)(W,n,W,o),(0,y.F)($,n,$,o),s?(s.xmin=W[0],s.ymin=W[1],s.xmax=$[0],s.ymax=$[1],s.spatialReference=o):s=new S.A(W[0],W[1],$[0],$[1],o),s}},Symbol.toStringTag,{value:"Module"}));var q=i(78955),Y=i(91829),Q=i(34304),K=i(17136),J=i(94008),tt=i(28735),et=i(82919);class it{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}get boundingSphere(){return this._boundingSphereDirty&&this._updateBoundingSphere(),this._boundingSphere}constructor(t){this.renderCoordsHelper=t,this.frustum=(0,et.vt)(),this._points=(0,et.Qy)(),this.lines=new Array(12),this._origin=(0,v.vt)(),this._direction=(0,v.vt)(),this._boundingSphere=new J.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let t=0;t<12;t++)this.lines[t]={origin:null,direction:(0,v.vt)(),endpoint:null}}update(t){(0,et.ui)(t.viewMatrix,t.projectionMatrix,this.frustum,this._points),(0,_.C)(this._origin,t.eye),(0,_.C)(this._direction,t.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(t){for(let e=0;e<this._points.length;e++)(0,_.C)(this._points[e],t[e]);(0,et.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(t){return(0,et.m7)(this.frustum,t)}intersectsRay(t){return(0,et.pw)(this.frustum,t)}intersectsLineSegment(t,e){return(0,et.ST)(this.frustum,t,e)}intersectsPoint(t){return(0,et.bU)(this.frustum,t)}_updateLines(){const t=this._points;for(let e=0;e<4;e++){const i=e+4;rt(this.lines[e],t[e],t[i]),rt(this.lines[e+4],t[e],3===e?t[0]:t[e+1]),rt(this.lines[e+8],t[i],3===e?t[4]:t[i+1])}}_updateBoundingSphere(){const{origin:t}=this,e=nt;(0,_.S8)(e,this.direction);const i=st;(0,_.jb)(i,this.points[4],t);const r=.5*(0,_.Om)(i,i)/(0,_.Om)(e,i),s=this._boundingSphere,n=(0,_.Ln)(ot,t,e,r);s.center=n,s.radius=r}static{this.planePointIndices=et.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function rt(t,e,i){t.origin=e,t.endpoint=i,(0,_.oW)(t.direction,e,i)}const st=(0,v.vt)(),nt=(0,v.vt)(),ot=(0,v.vt)();i(86211);const at=(0,v.fA)(5802e-9,13558e-9,331e-7),ct=(0,v.fA)(65e-8*3,5643e-9,255e-9);(0,v.fA)(at[0]+ct[0],at[1]+ct[1],at[2]+ct[2]);class ht{constructor(t=1/0,e=-1/0){this.near=t,this.far=e}set(t,e){this.near=t,this.far=e}union(t){return null!=t&&(this.near=Math.min(this.near,t.near),this.far=Math.max(this.far,t.far)),this}within(t){return this.near<=t&&t<=this.far}equals(t){return this.near===t.near&&this.far===t.far}static{this.Zero=new ht(0,0)}static{this.Infinite=new ht}}(0,v.vt)(),(0,v.vt)(),new J.iy,(0,T.vt)(),new S.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var lt=i(32728);const ut=(0,v.fA)(0,0,1),dt=(0,_.S8)((0,v.vt)(),(0,v.fA)(1,1,1)),pt=(0,g.vt)(),ft=(0,v.vt)(),mt=(0,v.vt)();function gt(t,e,i,r=B()){(0,_.$A)(ft,t,ut),0===(0,_.Om)(ft,ft)&&(0,_.$A)(ft,t,dt),(0,A.$0)(pt,-(0,l.kU)(e),t),(0,A.e$)(pt,pt,-(0,l.kU)(i),ft);const{up:s,direction:n}=r;return(0,_.$A)(s,ft,t),(0,_.S8)(s,s),(0,_.Z0)(s,s,pt),(0,_.S8)(n,t),(0,_.ze)(n,n),(0,_.Z0)(n,n,pt),r}function _t(t){const e=t[1];t[1]=-t[2],t[2]=e}function vt(t,e){const i=gt(e,t.heading,t.tilt);return t.up=i.up,t}function xt(t,e){const i=[],r=[],s=(0,Q.FD)();for(let n=0;n<t.length;n++){const o=t[n],a=n===t.length-1?t[0]:t[n+1],c=(0,F.Cr)(o,a,Ct),h=(0,P.vE)(e,c.origin,c.vector,0,Mt);switch(h){case 2:i.push(o);break;case 3:r.push(o);break;case 0:case 1:{const[t,n,a]=0===h?[1,i,r]:[-1,r,i],c=(0,P.Qj)(e),l=(0,_.Ln)((0,v.vt)(),Mt,c,t*s),u=(0,_.Ln)((0,v.vt)(),Mt,c,t*-s);n.push(o),n.push(l),a.push(u)}}}const n=[];return i.length&&n.push(i),r.length&&n.push(r),n}const bt={minCurvature:(0,l.kU)(5),maxCurvature:(0,l.kU)(50),minSamples:1,maxSamples:6},yt=(0,v.fA)(1,0,0),wt=(0,v.fA)(0,1,0),Tt=(0,v.vt)(),At=(0,v.vt)(),Mt=(0,v.vt)(),St=new J.iy,Ct=(0,F.vt)(),Et=(0,Y.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(t,e,i,r){const s=ft,n=mt;return(0,_.S8)(s,t),(0,_.$A)(mt,s,ut),0===(0,_.Om)(mt,mt)&&(0,_.$A)(mt,s,dt),(0,_.$A)(n,mt,s),H(e,i,r,s,n)},eyeForCenterWithHeadingTilt:function(t,e,i,r){const s={eye:(0,v.vt)(),up:null,tilt:r,heading:i},n=ft;n[0]=t[0],n[1]=t[2],n[2]=-t[1];const o=e,a=(0,l.kU)(i),c=(0,l.kU)(r),h=Math.sin(a),u=Math.cos(a),d=Math.sin(c),p=Math.cos(c),f=(0,_.Bw)(n);let m;if(Math.abs(c)<1e-8)m=o+f;else{const t=f/d,e=(0,l.YN)(o/t),i=Math.PI-c-e;m=t*Math.sin(i)}const g=p*o,x=o*o*(d*d),b=u*u*x,y=m-g,w=y*y,T=b*(b+w-n[1]*n[1]);if(T<0)return(0,_.hs)(s.eye,n,m/f),s.tilt=0,vt(s,t);const A=Math.sqrt(T),M=n[1]*y,S=b+w;let C;if(C=u>0?-A+M:A+M,Math.abs(S)<1e-8)return f<1e-8?(s.eye[0]=0,s.eye[1]=0,s.eye[2]=o):(0,_.hs)(s.eye,n,m/f),s.tilt=0,_t(s.eye),vt(s,t);s.eye[1]=C/S;const E=h*h*x,R=d*o,I=u*R*s.eye[1],O=s.eye[1]*s.eye[1],D=1-O,F=Math.sqrt(D),P=b*O+E-2*I*F*y+D*w;return Math.abs(P)<1e-8?((0,_.hs)(s.eye,n,m/f),s.tilt=0,_t(s.eye),vt(s,t)):(s.eye[0]=(D*(m*n[0]-g*n[0])-R*F*(n[0]*s.eye[1]*u+n[2]*h))/P,s.eye[2]=(D*(m*n[2]-g*n[2])-R*F*(n[2]*s.eye[1]*u-n[0]*h))/P,(0,_.hs)(s.eye,s.eye,m),_t(s.eye),vt(s,t))},eyeTiltToLookAtTilt:function(t,e,i){const r=(0,l.kU)(t),s=(0,_.Bw)(e);return(0,l.YN)(i/(s/Math.sin(r)))+r},headingTiltToDirectionUp:gt,lookAtTiltToEyeTilt:function(t,e,i){const r=(0,_.Bw)(e),s=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),n=(0,l.YN)(i/(s/Math.sin(t)));return(0,l.KJ)(t-n)},toArea:function(t,e){const{renderCoordsHelper:i}=t,r=t.state.camera.clone(),s=new it(i);r.near=2,s.update(r);const n=i.getAltitude(e),o=t.spatialReference,a=i.referenceEllipsoid.radius,c=r.eye,h=1+(0,_.Io)(c,e)/(a+n),u=Math.sqrt(h*h-1),{minCurvature:d,maxCurvature:p,minSamples:f,maxSamples:m}=bt,g=function(t){const{renderCoordsHelper:e,state:i}=t,r=Math.abs(e.getAltitude(i.camera.center));return St.radius=e.referenceEllipsoid.radius+r,i.camera.sphereFrustumCoverage(St,e)}(t),x=(0,l.qE)((u-d)/(p-d),0,1),b=Math.round((0,l.Cc)(f,m,x)),y=r.aboveGround,w=s.planes[5],A=[],M=(0,P.O_)(v.uY,yt,(0,P.vt)()),S=(0,P.O_)(v.uY,wt,(0,P.vt)());(0,q.hZ)(Et,0,0,0,0);const R=t=>{};for(let t=0;t<4;t++){const e=1===t&&!y||3===t&&y?1-g:0,r=1===t&&y||3===t&&!y?g:1,o=s.lines[t],a=s.lines[3===t?0:t+1];for(let s=0;s<b;s++){const h=s/b,u=0===s?0:(0,l.Cc)(e,r,1===t?1-(1-h)**2:3===t?h**2:h),d=(0,_.Cc)(At,o.origin,a.origin,u),p=(0,lt.nu)(o.direction,a.direction,u,Tt);i.intersectManifoldClosestSilhouette((0,T.LV)(d,p),n,Mt),U(Mt,c,Mt,w),A.push((0,v.o8)(Mt)),0!==A.length&&R((0,_.lo)(A.at(-1),Mt));const f=((0,P.Tj)(M,Mt)?1:0)|((0,P.Tj)(S,Mt)?2:0);Et[f]=1}}A.length>2&&(0,_.lo)(A[0],A.at(-1));const I=function(t,e,i){const r=2*(0,Q.FD)();return t.map(t=>{const s=[];let n=!1;for(const o of t)e.fromRenderCoords(o,Mt,i),Math.abs(o[0])<r&&Math.abs(o[1])<r?(s.push([null,Mt[1]]),s.push([null,Mt[1]]),n=!0):s.push([Mt[0],Mt[1]]);if(n)for(let t=0;t<s.length;t++){const e=s[t];if(null!=e[0])continue;const i=s[t+1],r=s.at(0===t?-1:t-1);e[0]=r[0],t++;const n=s.at(t===s.length-1?0:t+1);i[0]=n[0]}return s.push(s[0]),(0,E.$3)(s)||s.reverse(),s})}((0,q.m3)(Et)>1?function(t,e){const i=[];for(const r of t)i.push(...xt(r,e));return i}(xt(A,M),S):[A],i,o);return new C.A({rings:I,spatialReference:o})},toExtent:function(t,e,i,r,s){let n,o,a,h;const u=e.latitude,d=(0,w.tO)(t.spatialReference).radius,p=e.longitude,f=function(t,e,i){const r=e/i,s=(0,l.kU)(t),n=Math.sin(r/2),o=Math.cos(s),a=2*(0,l.YN)(Math.sqrt(n*n/(o*o)));return(0,l.KJ)(a)}(u,i,d)/2;n=p-f,o=p+f;const m=(0,l.kU)(u),g=(1+Math.sin(m))/(1-Math.sin(m)),_=(g+1)*Math.tan(r/d/2),v=_*_;function b(t){const e=Math.PI/2;return(t=c.uC.normalize(t,-e))>e&&(t=Math.PI-t),t}if(a=1.5*Math.PI-2*Math.atan(.5*(_+Math.sqrt(4*g+v))),h=a+r/d,a=b(a),h=b(h),h<a){const t=h;h=a,a=t}if(a=Math.max((0,l.KJ)(a),-90),h=Math.min((0,l.KJ)(h),90),o=K.Y_.monotonic(n,o),o-n>180){const t=(o-n-180)/2;n+=t,o-=t}const y=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:x.A.WGS84;return s?(s.xmin=n,s.ymin=a,s.xmax=o,s.ymax=h,s.spatialReference=y):s=new S.A(n,a,o,h,y),t.spatialReference&&t.spatialReference.isWebMercator&&(0,tt.Gh)(s,!1,s),s}},Symbol.toStringTag,{value:"Module"}));const Rt={OPAQUE:"opaque-color",TRANSPARENT:"transparent-color",COMPOSITE:"composite-color",FINAL:"final-color"},It=[Rt.FINAL,Rt.COMPOSITE,Rt.OPAQUE,Rt.TRANSPARENT],Ot={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",GAUSSIAN_SPLAT:"gaussian",GROUND_DEPTH:"ground-depth",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserlines",MAGNIFIER:"magnifier",OCCLUDED:"occluded",OPAQUE_OCCLUSION_QUERY:"opaque-occlusion-query",OPAQUE_ENVIRONMENT:"opaque-environment",AMBIENT_ILLUMINATION:"ambient-illumination",SHADOW_HIGHLIGHT:"shadow-highlight",TRANSPARENT_ENVIRONMENT:"transparent-environment",VOXEL:"voxel",VIEWSHED:"viewshed"};Array.from(Object.values(Ot)).concat(It),(0,v.vt)()},91712(t,e,i){i.d(e,{A:()=>M});var r=i(5482),s=i(69622),n=i(53966),o=i(34727),a=i(90629),c=i(91429),h=i(58083),l=i(9093),u=i(37585),d=i(48163),p=i(35522),f=i(51850),m=i(78955),g=i(91829),_=i(82919),v=i(71351),x=i(44280);function b(t,e,i){t.worldUpAtPosition(e,y),(0,p.Re)(w,i,e);const r=(0,p.Bw)(w);return 0===r?0:(0,o.XM)((0,p.Om)(w,y)/r)}const y=(0,f.vt)(),w=(0,f.vt)();var T;let A=T=class extends s.A{constructor(t){super(t),this._ray=(0,v.vt)(),this._viewport=(0,g.fA)(0,0,1,1),this._padding=(0,g.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,d.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,l.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,l.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,l.vt)(),this._frustumDirty=!0,this._frustum=(0,_.vt)(),this._fullViewport=(0,g.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,f.vt)(),this._up=(0,f.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get rows(){return this._rows}set rows(t){this._rows=Math.max(1,t)}get columns(){return this._columns}set columns(t){this._columns=Math.max(1,t)}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return(0,p.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){(0,h.C)(this._viewMatrix,t),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,p.hZ)((0,f.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const t=(0,m.hs)((0,g.vt)(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&(0,m.aI)(t,e)?e:t}get screenPadding(){if(1===this.pixelRatio)return this._padding;const t=(0,m.hs)((0,g.vt)(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&(0,m.aI)(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[3],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[2],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(t){this.width=t-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(t){this.height=t-(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(t){(0,m.t2)(this._padding,t)||(this._viewport[0]+=t[3]-this._padding[3],this._viewport[1]+=t[2]-this._padding[2],this._viewport[2]-=t[1]+t[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=t[0]+t[2]-(this._padding[0]+this._padding[2]),(0,m.C)(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,h.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,h.B8)((0,l.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,l.vt)()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovX(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return t=this._fov,e=this.width,i=this.height,2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i));var t,e,i}set fovY(t){this._fov=function(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,p.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,h.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,h.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const{near:e,far:i}=this;return 2*e*i/(i+e-t*(i-e))}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 t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2)*2,r=i*this._aspect,s=i/this.rows,n=r/this.columns,o=-r/2+this.column*n,a=o+n,c=-i/2+this.row*s,u=c+s,d=(0,h.$h)((0,l.vt)(),o*(1+2*this._padding[3]/t),a*(1+2*this._padding[1]/t),c*(1+2*this._padding[2]/e),u*(1+2*this._padding[0]/e),this.near,this.far),p=this._get("projectionMatrix");return p&&(0,h.aI)(p,d)?p:d}copyFrom(t){(0,p.C)(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,(0,m.C)(this._viewport,t.viewport),this.notifyChange("_viewport"),(0,m.C)(this._padding,t.padding),this.notifyChange("_padding"),(0,u.C)(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.row=t.row,this.column=t.column,this.rows=t.rows,this.columns=t.columns,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||((0,h.C)(this._viewMatrix,t.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||((0,_.C)(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,h.C)(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,m.C)(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up,this.fov=t.fov}clone(){return(new T).copyFrom(this)}equals(t){return(0,p.t2)(this.eye,t.eye)&&(0,p.t2)(this.center,t.center)&&(0,p.t2)(this.up,t.up)&&(0,m.t2)(this._viewport,t.viewport)&&(0,m.t2)(this._padding,t.padding)&&(0,u.t2)(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation&&this.row===t.row&&this.column===t.column&&this.rows===t.rows&&this.columns===t.columns}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||(0,m.hG)(t.screenPadding,this.screenPadding)>=e||(0,m.hG)(this.screenViewport,t.screenViewport)>=e||this.row!==t.row||this.column!==t.column||this.rows!==t.rows||this.columns!==t.columns)return!1;(0,p.jb)(E,t.eye,t.center),(0,p.jb)(R,this.eye,this.center);const i=(0,p.Om)(E,R),r=(0,p.uE)(E),s=(0,p.uE)(R),n=5e-4;return i*i>=(1-1e-10)*r*s&&(0,p.lo)(t.eye,this.eye)<Math.max(r,s)*n*n}computeRenderPixelSizeAt(t){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(t))}computeRenderPixelSizeAtDist(t){return t*this.perRenderPixelRatio}computeScreenPixelSizeAt(t){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(t))}_viewDirectionDistance(t){return Math.abs((0,x.gr)(this.viewForward,(0,p.Re)(E,t,this.eye)))}computeScreenPixelSizeAtDist(t){return t*this.perScreenPixelRatio}computeDistanceFromRadius(t,e){return t/Math.tan(Math.min(this.fovX,this.fovY)/(2*(e||1)))}getScreenCenter(t=(0,a.gs)()){return t[0]=(this.padding[3]+this.width/2)/this.pixelRatio,t[1]=(this.padding[0]+this.height/2)/this.pixelRatio,t}getRenderCenter(t,e=.5,i=.5){return t[0]=this.padding[3]+this.width*e,t[1]=this.padding[2]+this.height*i,t[2]=.5,t}setGLViewport(t){const e=this.viewport,i=this.padding;t.setViewport(e[0]-i[3],e[1]-i[2],e[2]+i[1]+i[3],e[3]+i[0]+i[2])}applyProjection(t,e){t!==S&&(0,p.C)(S,t),S[3]=1,(0,m.Z0)(S,S,this.projectionMatrix);const i=Math.abs(S[3]);(0,p.hs)(S,S,1/i);const r=this.fullViewport;e[0]=(0,o.Cc)(0,r[0]+r[2],.5+.5*S[0]),e[1]=(0,o.Cc)(0,r[1]+r[3],.5+.5*S[1]),e[2]=.5*(S[2]+1),e[3]=i}unapplyProjection(t,e){const i=this.fullViewport;S[0]=(t[0]/(i[0]+i[2])*2-1)*t[3],S[1]=(t[1]/(i[1]+i[3])*2-1)*t[3],S[2]=(2*t[2]-1)*t[3],S[3]=t[3],null!=this.inverseProjectionMatrix&&((0,m.Z0)(S,S,this.inverseProjectionMatrix),e[0]=S[0],e[1]=S[1],e[2]=S[2])}projectToScreen(t,e){return this.projectToRenderScreen(t,I),this.renderToScreen(I,e),e}projectToRenderScreen(t,e){if(S[0]=t[0],S[1]=t[1],S[2]=t[2],S[3]=1,(0,m.Z0)(S,S,this.viewProjectionMatrix),0===S[3])return null;const i=S;(0,p.hs)(i,i,1/Math.abs(S[3]));const r=this.fullViewport,s=(0,o.Cc)(0,r[0]+r[2],.5+.5*i[0]),n=(0,o.Cc)(0,r[1]+r[3],.5+.5*i[1]);return"x"in e?(e.x=s,e.y=n):(e[0]=s,e[1]=n,e.length>2&&(e[2]=.5*(i[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,I),e)}unprojectFromRenderScreen(t,e){if((0,h.lw)(C,this.projectionMatrix,this.viewMatrix),!(0,h.B8)(C,C))return null;const i=this.fullViewport;return S[0]=2*(t[0]-i[0])/i[2]-1,S[1]=2*(t[1]-i[1])/i[3]-1,S[2]=2*t[2]-1,S[3]=1,(0,m.Z0)(S,S,C),0===S[3]?null:(e[0]=S[0]/S[3],e[1]=S[1]/S[3],e[2]=S[2]/S[3],e)}constrainWindowSize(t,e,i,r){const s=t*this.pixelRatio,n=e*this.pixelRatio,o=Math.max(s-i/2,0),a=Math.max(this.fullHeight-n-r/2,0),c=-Math.min(s-i/2,0),h=-Math.min(this.fullHeight-n-r/2,0),l=i-c- -Math.min(this.fullWidth-s-i/2,0),u=r-h- -Math.min(n-r/2,0);return[Math.round(o),Math.round(a),Math.round(l),Math.round(u)]}computeUp(t){1===t?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}sphereFrustumCoverage(t,e){const{center:i,eye:r,distance:s,fovY:n}=this,o=Math.abs(Math.PI/2-b(e,i,r));return t.frustumCoverage(o,s,n)}_computeUpGlobal(){(0,p.Re)(E,this.center,this.eye);const t=(0,p.Bw)(this.center);t<1?(0,p.t2)(this._up,f.Cb)&&((0,p.C)(this._up,f.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,p.Om)(E,this.center))>.9999*(0,p.Bw)(E)*t||((0,p.$A)(R,E,this.center),(0,p.$A)(R,R,E),(0,p.S8)(R,R),(0,p.t2)(this._up,R)||((0,p.C)(this._up,R),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,p.oW)(E,this.eye,this.center),Math.abs(E[2])<=.9999&&((0,p.hs)(E,E,E[2]),(0,p.hZ)(E,-E[0],-E[1],1-E[2]),(0,p.S8)(E,E),(0,p.t2)(this._up,E)||((0,p.C)(this._up,E),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(t,e,i=""){"number"==typeof t[0]&&isFinite(t[0])&&"number"==typeof t[1]&&isFinite(t[1])&&"number"==typeof t[2]&&isFinite(t[2])?(0,p.t2)(t,e)||((0,p.C)(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):n.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,_.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,h.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewport",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_padding",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_fov",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_nearFar",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewDirty",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_viewMatrix",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_pixelRatio",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"pixelRatio",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"row",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"column",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_rows",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"rows",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_columns",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"columns",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"eye",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"center",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_center",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"up",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"_up",void 0),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewForward",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewUp",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"viewRight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"nearFar",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"near",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"far",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenViewport",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"screenPadding",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"x",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"y",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"width",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"height",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullWidth",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fullHeight",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_aspect",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"padding",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"projectionMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"inverseProjectionMatrix",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fov",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovX",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"fovY",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"viewInverseTransposeMatrix",null),(0,r.Cg)([(0,c.MZ)({readOnly:!0})],A.prototype,"_projectionMatrixInternal",null),(0,r.Cg)([(0,c.MZ)()],A.prototype,"relativeElevation",void 0),A=T=(0,r.Cg)([(0,c.$K)("esri.views.3d.webgl.RenderCamera")],A);const M=A,S=(0,g.vt)(),C=(0,l.vt)(),E=(0,f.vt)(),R=(0,f.vt)(),I=(0,a.r_)()},48375(t,e,i){i.d(e,{A:()=>F});var r=i(5482),s=i(69622),n=i(49186),o=i(36708),a=i(10107),c=i(64108),h=i(2016),l=i(44208),u=i(53966),d=(i(17676),i(94656)),p=i(63907);i(93637),i(4576),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,l.A)("esri-tests-disable-gpu-memory-measurements"),(0,d.en)();(0,d.en)();i(90644);var f=i(76284),m=i(97768),g=i(48852),_=i(42293);const v=!!(0,l.A)("esri-tests-disable-gpu-memory-measurements");class x{constructor(t,e){this._context=t,this._descriptor=e,this.type=2,this._context.instanceCounter.increment(p.vt.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:s,internalFormat:n,multisampled:o}=e;o?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,n,r,s):i.renderbufferStorage(i.RENDERBUFFER,n,r,s),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const t=this._descriptor.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}get usedMemory(){return v?0:(t=this._descriptor).width<=0||t.height<=0||null==t.internalFormat?0:t.width*t.height*(0,_.MW)(t.internalFormat);var t}resize(t,e){const i=this._descriptor;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const r=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):r.renderbufferStorage(r.RENDERBUFFER,i.internalFormat,i.width,i.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.vt.Renderbuffer,this),this._context=null)}}class b{constructor(t,e,i){if(this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.vt.FramebufferObject,this),null!=e){const i=function(t,e){return y(e)||w(e)?e:T(e)?new f.A(t,e):function(t){return 3===A(t)||null!=t&&"samples"in t}(e)?new x(t,e):null}(t,e);null!=i&&(this._colorAttachments.set(p.r6,i),y(i)?this._validateTextureDescriptor(i.descriptor):this._validateRenderbufferDescriptor(i.descriptor)),this._validateColorAttachmentPoint(p.r6)}if(null!=i)if(function(t){return y(t)||T(t)}(i))this._depthStencilTexture=y(i)?i:new f.A(t,i),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=w(i)?i:new x(t,i);this._depthStencilBuffer=e,this._validateRenderbufferDescriptor(e.descriptor)}}get glName(){return this._glName}get colorTexture(){const t=this._colorAttachments.get(p.r6);return y(t)?t:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.width??0}get height(){const t=this._colorAttachments.get(p.r6)??this._depthStencilTexture??this._depthStencilBuffer;return t?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,i])=>t+i.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&y(e)?e:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(t,e=p.r6){if(!t)return;this._validateColorAttachmentPoint(e);const{descriptor:i}=t;this._validateTextureDescriptor(i),this.detachColorTexture(e)?.dispose(),this._colorAttachments.set(e,t),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e))}detachColorTexture(t=p.r6){const e=this._colorAttachments.get(t);if(!e)return;const i=y(e);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(i)this._framebufferTexture2D(null,t);else{const e=this._context.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}}),this._colorAttachments.delete(t),i?e:void 0}detachColorTextures(...t){if(0!==t.length){if(this._initialized){const e=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{t.forEach(t=>{y(this._colorAttachments.get(t))?this._framebufferTexture2D(null,t):e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)})})}t.forEach(t=>this._colorAttachments.delete(t))}}setColorTextureTarget(t,e=p.r6,i=0){const r=this._colorAttachments.get(e);r&&(35866===t?this._framebufferTextureLayer(r.glName,e,36160,0,i):this._framebufferTexture2D(r.glName,e,t,36160,0))}attachDepthStencil(t){if(t)switch(t.type){case 1:return this._attachDepthStencilTexture(t);case 2:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(null==t)return;const{descriptor:e}=t,{pixelFormat:i,dataType:r}=e;34041===i||6402===i?34041!==i||r===p.ld.UNSIGNED_INT_24_8?6402!==i||r===p.ld.UNSIGNED_INT||r===p.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,C(i))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,C(t.descriptor.pixelFormat))}),this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(null==t)return;const e=t.descriptor;if(this._validateRenderbufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:i}=this._context,r=this._getGLAttachmentPoint(e);i.framebufferRenderbuffer(36160,r,i.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const{_context:e}=this,i=e.boundFramebuffer;e.bindFramebuffer(this);const{gl:r}=e,s=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(36160,s,r.RENDERBUFFER,null),e.bindFramebuffer(i)}return this._depthStencilBuffer=null,t}invalidateAttachments(t){const{_context:e}=this;e.temporaryBindFramebufferObject(this,()=>e.gl.invalidateFramebuffer(36160,t),!0)}copyToTexture(t,e,i,r,s,n,o){(t<0||e<0||s<0||n<0)&&console.error("Offsets cannot be negative!"),(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!");const a=o.descriptor;3553!==o.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||t+i>this.width||e+r>this.height||s+i>a.width||n+r>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,h=c.bindTexture(o,f.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(f.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,s,n,t,e,i,r),c.bindTexture(h,f.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,r,s,n,o){(i<=0||r<=0)&&console.error("Copy width and height must be greater than zero!"),o||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,r,s,n,o)}async readPixelsAsync(t,e,i,r,s,n,o){const{gl:a}=this._context,c=g.g.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(c);const h=this._context.boundFramebuffer;this._context.bindFramebuffer(this),a.readPixels(t,e,i,r,s,n,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(h),await c.getSubDataAsync(o),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const i={width:t,height:e};if(M(i,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(t=>t.resize(i.width,i.height)),this._depthStencilTexture?.resize(i.width,i.height),this._initialized&&(M(i,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(i.width,i.height),(0,d.en)())){const{gl:t}=this._context;t.checkFramebufferStatus(36160)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(t=36160){const{gl:e}=this._context;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const i=e.createFramebuffer();if(e.bindFramebuffer(t,i),this._colorAttachments.forEach((e,i)=>{if(y(e)){const r=S(e);35866===r?this._framebufferTextureLayer(e.glName,i,t,0,0):this._framebufferTexture2D(e.glName,i,r,t)}else if(w(e)){const r=this._context.gl;r.framebufferRenderbuffer(t,i,r.RENDERBUFFER,e.glName)}}),this._depthStencilBuffer){const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,i,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const e=C(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,e,S(this._depthStencilTexture),t)}(0,d.en)()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=i,this._initialized=!0}_framebufferTexture2D(t,e=p.r6,i=3553,r=36160,s=0){this._context.gl.framebufferTexture2D(r,e,i,t,s)}_framebufferTextureLayer(t,e=p.r6,i=36160,r=0,s=0){this._context.gl.framebufferTextureLayer(i,e,t,r,s)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(36160,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=(0,m.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,C(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,m.WD)(this._depthStencilTexture))}_validateTextureDescriptor(t){3553!==t.target&&34067!==t.target&&35866!==t.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),M(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderbufferDescriptor(t){M(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case p.SB.DEPTH_COMPONENT16:case p.SB.DEPTH_COMPONENT24:case p.SB.DEPTH_COMPONENT32F:return p.xL;case p.iE.DEPTH24_STENCIL8:case p.iE.DEPTH32F_STENCIL8:return p.nI;case 36168:return p.uH;default:return p.r6}}_validateColorAttachmentPoint(t){if(-1===b._MAX_COLOR_ATTACHMENTS){const{gl:t}=this._context;b._MAX_COLOR_ATTACHMENTS=t.getParameter(t.MAX_COLOR_ATTACHMENTS)}const e=t-p.r6;e+1>b._MAX_COLOR_ATTACHMENTS&&u.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${b._MAX_COLOR_ATTACHMENTS} color attachments`)}}function y(t){return 1===A(t)}function w(t){return 2===A(t)}function T(t){return 0===A(t)}function A(t){return null!=t&&"type"in t?t.type:null}function M(t,e){const i=Math.max(t.width,t.height);if(i>e){u.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function S(t){return 34067===t.descriptor.target?34069:35866===t.descriptor.target?35866:3553}function C(t){return 6402===t?p.xL:p.nI}i(67171),i(79785);var E=i(85079),R=i(74038);const I=[new R._("position",2,p.pe.UNSIGNED_SHORT,0,4)];new R._("a_pos",2,p.pe.BYTE,0,2),new R._("a_pos",2,p.pe.BYTE,0,4),new R._("a_tex",2,p.pe.BYTE,2,4),(0,E.Xk)(I),i(66289);const O=new Image;O.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",O.width=5,O.height=5,O.decode();let D=class extends s.A{constructor(t){super(t),this.view=null,this.consumes={required:[]},this.produces=h.gP.COMPOSITE,this._dirty=!0}initialize(){this.addHandles([(0,o.wB)(()=>this.view.ready,t=>{t&&this.view.stage?.renderer.addRenderNode(this)},o.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new n.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 t=this._frameBuffer?.getTexture()?.descriptor,e=this.view.stage.renderer.fboCache.acquire(t?.width??640,t?.height??480,this.produces);return this._bind(e),e}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:t}){var e;t.initializeAndBind(),this.gl.drawBuffers((e=t)?e.colorAttachments.length>0?e.colorAttachments:[p.$0]:[p.C5])}requestRender(t){switch(t){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(t);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(t){return!!this._dirty&&(this._dirty=!1,!0)}doRender(t){this._frameBuffer=t.find(({name:t})=>t===this.produces);try{return this.render(t)}finally{this._frameBuffer=null}}get requireGeometryDepth(){return!1}};(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"view",void 0),(0,r.Cg)([(0,a.MZ)({constructOnly:!0})],D.prototype,"consumes",void 0),(0,r.Cg)([(0,a.MZ)()],D.prototype,"produces",void 0),(0,r.Cg)([(0,a.MZ)({readOnly:!0})],D.prototype,"techniques",null),D=(0,r.Cg)([(0,c.$)("esri.views.3d.webgl.RenderNode")],D);const F=D},37957(t,e,i){i.d(e,{P:()=>r});const r={create:()=>[0,0,0,0,0,0,0,0,0],copy(t,e){t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8]}}},48852(t,e,i){i.d(e,{g:()=>u});var r=i(4576),s=i(44208),n=i(53966),o=i(34275),a=i(94656),c=i(63907);const h=()=>n.A.getLogger("esri.views.webgl.BufferObject"),l=!!(0,s.A)("esri-tests-disable-gpu-memory-measurements");class u{static createIndex(t,e,i){return new u(t,34963,e,i)}static createUniform(t,e,i){return new u(t,35345,e,i)}static createPixelPack(t,e=35041,i){const r=new u(t,35051,e);return i&&r.setSize(i),r}static createPixelUnpack(t,e=35040,i){return new u(t,35052,e,i)}static createTransformFeedback(t,e=35044,i){const r=new u(t,35982,e);return r.setSize(i),r}constructor(t,e,i,r){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,t.instanceCounter.increment(c.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),r&&this.setData(r)}get glName(){return this._glName}get size(){if(34963===this.bufferType)switch(this._indexType){case c.pe.UNSIGNED_INT:return this._sizeBytes/4;case c.pe.UNSIGNED_SHORT:return this._sizeBytes/2;case c.pe.UNSIGNED_BYTE:case void 0:case null:break;default:this._indexType}return this._sizeBytes}get indexType(){return this._indexType}get sizeBytes(){return this._sizeBytes}get usedMemory(){return l?0:this.sizeBytes}get _isVAOAware(){return 34963===this.bufferType||34962===this.bufferType}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(c.vt.BufferObject,this),this._context=null):this._glName&&h().warn("Leaked WebGL buffer object")}setSize(t,e=null){if(34963===this.bufferType&&null!=e)switch(this._indexType=e,e){case c.pe.UNSIGNED_SHORT:t*=2;break;case c.pe.UNSIGNED_INT:t*=4;case c.pe.UNSIGNED_BYTE:}this._setBufferData(t)}setData(t){if(!t)return;const e=t.byteLength;34963===this.bufferType&&((0,o.mg)(t)?this._indexType=c.pe.UNSIGNED_BYTE:(0,o.jq)(t)?this._indexType=c.pe.UNSIGNED_SHORT:(0,o.XJ)(t)&&(this._indexType=c.pe.UNSIGNED_INT)),this._setBufferData(e,t)}setIndexType(t){34963===this.bufferType&&(this._indexType=t)}_setBufferData(t,e=null){this._sizeBytes=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const r=this._context.gl;null!=e?r.bufferData(this.bufferType,e,this.usage):r.bufferData(this.bufferType,t,this.usage),(0,a.Y2)(r),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,r){if(!t)return;const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:n}=this._context;n.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,r-i),(0,a.Y2)(n),this._isVAOAware&&this._context.bindVAO(s)}getSubData(t,e=0,i,s){if(i<0||s<0)return;const n=function(t){return(0,r.Xj)(t)}(t)?t.BYTES_PER_ELEMENT:1;if(n*((i??0)+(s??0))>t.byteLength)return;e+n*(s??0)>this.usedMemory&&h().warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),o.getBufferSubData(35982,e,t,i,s),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),o.getBufferSubData(36662,e,t,i,s),this._context.unbindBuffer(36662))}async getSubDataAsync(t,e=0,i,r){await this._context.clientWaitAsync(),this.getSubData(t,e,i,r)}}},65786(t,e,i){i.d(e,{Y:()=>r});const r=class{};new r},14113(t,e,i){i.d(e,{N5:()=>a});var r=i(49186),s=(i(44208),i(53966));const n=()=>s.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class o{constructor(){this._includedModules=new Map}include(t,e){this._includedModules.has(t)?this._includedModules.get(t):(this._includedModules.set(t,e),t(this.builder,e))}}class a extends o{constructor(){super(...arguments),this.vertex=new d,this.fragment=new d,this.attributes=new p,this.varyings=new f,this.outputs=new m}get attributeNames(){return this.attributes.names}get builder(){return this}generate(t,e=!1){const i=this.attributes.generateSource(t),r=this.varyings.generateSource(t),s="vertex"===t?this.vertex:this.fragment,n=s.uniforms.generateSource(),o=s.code.generateSource(),a=s.main.generateSource(e),c=this.debugName?`// ${this.debugName}\n`:"",h="vertex"===t?v:_,l=s.constants.generateSource(),u=this.outputs.generateSource(t);return`#version 300 es\n${c}\n${h}\n${l.join("\n")}\n${n.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${u.join("\n")}\n${o.join("\n")}\n${a.join("\n")}`}generateBind(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[0];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return e=>{for(let s=0;s<r;++s)i[s](t,e)}}generateBindPass(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[1];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,s)=>{for(let n=0;n<r;++n)i[n](t,e,s)}}generateBindDraw(t){const e=new Map;this.vertex.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)}),this.fragment.uniforms.entries.forEach(t=>{const i=t.bind[2];i&&e.set(t.name,i)});const i=Array.from(e.values()),r=i.length;return(e,s,n)=>{for(let o=0;o<r;++o)i[o](t,n,e,s)}}}class c{constructor(t){this._stage=t,this._entries=new Map}add(...t){for(const e of t)this._add(e);return this._stage}get(t){return this._entries.get(t)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new r.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else n().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:t,arraySize:e,type:i})=>null!=e?`uniform ${i} ${t}[${e}];`:`uniform ${i} ${t};`)}get entries(){return Array.from(this._entries.values())}}class h{constructor(){this._entries=new Map}add(t,e){if(this._entries.has(t))throw new r.A("shaderbuilder:duplicate-input",`Duplicate input for ${t}`);this._entries.set(t,e)}get(t){const e=this._entries.get(t);if(null==e)throw new r.A("shaderbuilder:input-resolver-error",`No resolver for input ${t} found.`);return e()}}class l{constructor(t){this._stage=t,this._bodies=new Array}add(t){return this._bodies.push(t),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new r.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(t){this._stage=t,this._entries=new Array}add(t){return this._entries.push(t),this._stage}generateSource(){return this._entries}}class d extends o{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new g(this),this.inputs=new h}get builder(){return this}}class p{constructor(){this._entries=new Array}add(t,e){this._entries.push([t,e])}generateSource(t){return"fragment"===t?[]:this._entries.map(t=>`in ${t[1]} ${t[0]};`)}get names(){return this._entries.map(([t])=>t)}}class f{constructor(){this._entries=new Map}add(t,e,i){this._entries.has(t)?n().warn(`Ignoring duplicate varying ${e} ${t}`):this._entries.set(t,{type:e,invariant:i?.invariant??!1})}generateSource(t){const e=new Array;return this._entries.forEach((i,r)=>e.push((i.invariant&&"vertex"===t?"invariant ":"")+("int"===i.type?"flat ":"")+("vertex"===t?"out":"in")+` ${i.type} ${r};`)),e}}class m{constructor(){this._entries=new Map}add(t,e,i=0){const r=this._entries.get(i);r?.name!==t||r?.type!==e?this._entries.set(i,{name:t,type:e}):n().warn(`Fragment shader output location ${i} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(t){if("vertex"===t)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const e=new Array;return this._entries.forEach((t,i)=>e.push(`layout(location = ${i}) out ${t.type} ${t.name};`)),e}}class g{constructor(t){this._stage=t,this._entries=new Set}add(t,e,i){let r="ERROR_CONSTRUCTOR_STRING";switch(e){case"float":r=g._numberToFloatStr(i);break;case"int":r=g._numberToIntStr(i);break;case"uint":r=g._numberToUintStr(i);break;case"bool":r=i.toString();break;case"vec2":r=`vec2(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])})`;break;case"vec3":r=`vec3(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])})`;break;case"vec4":r=`vec4(${g._numberToFloatStr(i[0])}, ${g._numberToFloatStr(i[1])}, ${g._numberToFloatStr(i[2])}, ${g._numberToFloatStr(i[3])})`;break;case"ivec2":r=`ivec2(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])})`;break;case"ivec3":r=`ivec3(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])})`;break;case"ivec4":r=`ivec4(${g._numberToIntStr(i[0])}, ${g._numberToIntStr(i[1])}, ${g._numberToIntStr(i[2])}, ${g._numberToIntStr(i[3])})`;break;case"uvec2":r=`uvec2(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])})`;break;case"uvec3":r=`uvec3(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])})`;break;case"uvec4":r=`uvec4(${g._numberToUintStr(i[0])}, ${g._numberToUintStr(i[1])}, ${g._numberToUintStr(i[2])}, ${g._numberToUintStr(i[3])})`;break;case"mat2":case"mat3":case"mat4":r=`${e}(${Array.prototype.map.call(i,t=>g._numberToFloatStr(t)).join(", ")})`}return this._entries.add(`const ${e} ${t} = ${r};`),this._stage}static _numberToIntStr(t){return t.toFixed(0)}static _numberToUintStr(t){return`${t.toFixed(0)}u`}static _numberToFloatStr(t){return Number.isInteger(t)?t.toFixed(1):t.toString()}generateSource(){return Array.from(this._entries)}}const _="#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",v="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n "},76284(t,e,i){i.d(e,{A:()=>A});var r=i(49186),s=i(44208),n=i(53966),o=i(97768),a=i(93637),c=i(17676),h=i(94656),l=i(63907),u=i(67171);const d=()=>n.A.getLogger("esri/views/webgl/textureUtils");function p(t){const{width:e,height:i,depth:r}=t;(null!=e&&e<0||null!=i&&i<0||null!=r&&r<0)&&d().error("Negative dimension parameters are not allowed!");const{internalFormat:s}=t;if(s&&(f(s)||m(s))){const{linearFilterDepth:e,compareEnabled:i,samplingMode:r,hasMipmap:s}=t;s&&d().error("Depth textures cannot have mipmaps"),e?9729!==r&&9728!==r&&d().error("Depth textures cannot sample mipmaps"):(9728!==r&&d().error("Depth textures without filtering must use NEAREST filtering"),i&&d().error("Depth textures without filtering cannot use compare function"))}}function f(t){return(0,a.a4)(l.SB,t)}function m(t){return(0,a.a4)(l.iE,t)}function g(t){return null!=t&&"type"in t&&"compressed"===t.type}function _(t){return null!=t&&!g(t)&&!function(t){return null!=t&&"byteLength"in t}(t)}function v(t){return 32879===t||35866===t}function x(t,e,i,r=1){let s=Math.max(e,i);return 32879===t&&(s=Math.max(s,r)),Math.floor(Math.log2(s))+1}function b(t){if(null!=t.internalFormat)return t.internalFormat;switch(t.dataType){case l.ld.FLOAT:switch(t.pixelFormat){case 6408:return l.H0.RGBA32F;case 6407:return l.H0.RGB32F;default:throw new r.A("texture:unknown-format","Unable to derive format")}case l.ld.UNSIGNED_BYTE:switch(t.pixelFormat){case 6408:return l.H0.RGBA8;case 6407:return l.H0.RGB8}}const{pixelFormat:e}=t;return t.internalFormat=34041===e?l.iE.DEPTH24_STENCIL8:6402===e?l.SB.DEPTH_COMPONENT24:e,t.internalFormat}class y extends u.R{constructor(t,e){switch(super(),this.context=t,Object.assign(this,e),this.internalFormat){case l.H0.R16F:case l.H0.R32F:case l.H0.R8_SNORM:case l.H0.R8:this.pixelFormat=6403;break;case l.H0.R8I:case l.H0.R8UI:case l.H0.R16I:case l.H0.R16UI:case l.H0.R32I:case l.H0.R32UI:this.pixelFormat=36244}}static validate(t,e){return new y(t,e)}}const w=!!(0,s.A)("esri-tests-disable-gpu-memory-measurements"),T=()=>n.A.getLogger("esri/views/webgl/Texture");class A{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(t,e=null,i=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in t)this._descriptor=t,i=e;else{const i=y.validate(t,e);if(!i)throw new r.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=i}34067===this._descriptor.target?this._setDataCubeMap(i):this.setData(i)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return w?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(l.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(t,e){const i=this._descriptor;if(i.width!==t||i.height!==e){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-resize","Immutable textures can't be resized!");i.width=t,i.height=e,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!g(t)&&this._descriptor.internalFormat&&(0,a.a4)(l.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!g(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(t,e,i,s,n,o,a=0){o||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=b(c);const{context:h,pixelFormat:l,dataType:u,target:d,isImmutable:p}=c;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=h.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES,!0);(e<0||i<0||e+s>c.width||i+n>c.height)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:m}=h;a&&(s&&n||T().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),m.pixelStorei(m.UNPACK_SKIP_ROWS,a)),_(o)?m.texSubImage2D(d,t,e,i,s,n,l,u,o):g(o)?m.compressedTexSubImage2D(d,t,e,i,s,n,c.internalFormat,o.levels[t]):m.texSubImage2D(d,t,e,i,s,n,l,u,o),a&&m.pixelStorei(m.UNPACK_SKIP_ROWS,0),h.bindTexture(f,A.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(t,e,i,s,n,o,a,c){c||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update an uninitialized texture!");const h=this._descriptor;h.internalFormat=b(h);const{context:l,pixelFormat:u,dataType:d,isImmutable:p,target:f}=h;if(p&&!this._wasImmutablyAllocated)throw new r.A("texture:uninitialized","Cannot update immutable texture before allocation!");v(f)||T().warn("Attempting to set 3D texture data on a non-3D texture");const m=l.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),(e<0||i<0||s<0||e+n>h.width||i+o>h.height||s+a>h.depth)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:_}=l;if(g(c))c=c.levels[t],_.compressedTexSubImage3D(f,t,e,i,s,n,o,a,h.internalFormat,c);else{const r=c;_.texSubImage3D(f,t,e,i,s,n,o,a,u,d,r)}l.bindTexture(m,A.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const t=this._descriptor;if(0===t.width||0===t.height)return;if(!t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");t.hasMipmap=!0,this._samplingModeDirty=!0,p(t)}9729===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9985):9728===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9984);const e=this._descriptor.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(t.target),this._descriptor.context.bindTexture(e,A.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const t=this._descriptor;if(t.hasMipmap){if(this._wasImmutablyAllocated)throw new r.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");t.hasMipmap=!1,this._samplingModeDirty=!0,p(t)}9985===t.samplingMode?(this._samplingModeDirty=!0,t.samplingMode=9729):9984===t.samplingMode&&(this._samplingModeDirty=!0,t.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,p(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),p(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,o.DC)(this._compressionAbortController)}_setData(t,e){const i=this._descriptor,s=i.context?.gl;if(!s)return;(0,h.Y2)(s),this.hasWebGLTextureObject||(this._glName=s.createTexture(),i.context.instanceCounter.increment(l.vt.Texture,this)),p(i);const n=i.context.bindTexture(this,A.TEXTURE_UNIT_FOR_UPDATES);i.context.setActiveTexture(A.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,h.Y2)(s);const o=e??i.target,c=v(o);if(_(t))this._setDataFromTexImageSource(t,o);else{const{width:e,height:n,depth:u}=i;if(null==e||null==n)throw new r.A("texture:missing-size","Width and height must be specified!");if(c&&null==u)throw new r.A("texture:missing-depth","Depth must be specified!");if(i.internalFormat=b(i),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,i.internalFormat,i.hasMipmap,e,n,u),g(t)){if(!function(t){return null!=t&&(0,a.a4)(l.CQ,t)}(i.internalFormat))throw new r.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(t,i.internalFormat,o)}else this._texImage(o,0,i.internalFormat,e,n,u,t),(0,h.Y2)(s),i.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,h.Y2)(s),i.context.bindTexture(n,A.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=b(r);const s=v(e),{width:n,height:o,depth:a}=function(t){let e="width"in t?t.width:t.codedWidth,i="height"in t?t.height:t.codedHeight;return t instanceof HTMLVideoElement&&(e=t.videoWidth,i=t.videoHeight),{width:e,height:i,depth:1}}(t);r.width&&r.height,r.width||(r.width=n),r.height||(r.height=o),s&&r.depth,s&&(r.depth=a),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,n,o,a),this._texImage(e,0,r.internalFormat,n,o,a,t),(0,h.Y2)(i),r.hasMipmap&&(this.generateMipmap(),(0,h.Y2)(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:n,depth:o}=r,a=t.levels,c=x(i,s,n,o),h=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,h),this._forEachMipmapLevel((t,r,s,n)=>{const o=a[Math.min(t,a.length-1)];this._compressedTexImage(i,t,e,r,s,n,o)},h)}_texStorage(t,e,i,s,n,o){const{gl:a}=this._descriptor.context;if(!function(t){return l.XN.includes(t)}(e)&&!f(e)&&!m(e))throw new r.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=i?x(t,s,n,o):1;if(v(t)){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(t,c,e,s,n,o)}else a.texStorage2D(t,c,e,s,n);this._wasImmutablyAllocated=!0}_texImage(t,e,i,s,n,o,a){const c=this._descriptor.context.gl,h=v(t),{isImmutable:l,pixelFormat:u,dataType:d}=this._descriptor;if(l){if(null!=a){const i=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(t,e,0,0,0,s,n,o,u,d,i)}else c.texSubImage2D(t,e,0,0,s,n,u,d,i)}}else{const l=a;if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(t,e,i,s,n,o,0,u,d,l)}else c.texImage2D(t,e,i,s,n,0,u,d,l)}}_compressedTexImage(t,e,i,s,n,o,a){const c=this._descriptor.context.gl,h=v(t);if(this._descriptor.isImmutable){if(null!=a)if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(t,e,0,0,0,s,n,o,i,a)}else c.compressedTexSubImage2D(t,e,0,0,s,n,i,a)}else if(h){if(null==o)throw new r.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(t,e,i,s,n,o,0,a)}else c.compressedTexImage2D(t,e,i,s,n,0,a)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:s,preMultiplyAlpha:n,hasMipmap:o}=this._descriptor,a=this._descriptor.compress?.compressionTracker,h=this._descriptor.compress?.compressionCallback,{compressedTextureETC:l,compressedTextureS3TC:u}=r.capabilities;if(!A.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!l&&!u)return;this.abortCompression();const d=new AbortController;let p;this._compressionAbortController=d,a?.increment();try{t instanceof Uint8Array?p=t.buffer:(p=await createImageBitmap(t,{imageOrientation:s?"flipY":"none"}),(0,c.Te)(d));const r={data:p,width:e,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:o,hasETC:!!l,hasS3TC:!!u},a=await A.compressionWorkerHandle.invoke(r,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),h?.(t-this.usedMemory)}}catch(t){(0,c.zf)(t)||T().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),p instanceof ImageBitmap&&p.close()}}_forEachMipmapLevel(t,e=1/0){let{width:i,height:s,depth:n,hasMipmap:o,target:a}=this._descriptor;const c=32879===a;if(null==i||null==s||c&&null==n)throw new r.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let r=0;t(r,i,s,n),o&&(1!==i||1!==s||c&&1!==n)&&!(r>=e);++r)i=Math.max(1,i>>1),s=Math.max(1,s>>1),c&&(n=Math.max(1,n>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),(0,h.Y2)(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;e&&t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}},67171(t,e,i){i.d(e,{R:()=>n,e:()=>o});var r=i(63907),s=i(42293);class n{constructor(t=0,e=t){this.width=t,this.height=e,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=r.ld.UNSIGNED_BYTE,this.samplingMode=9729,this.wrapMode=10497,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.compareEnabled=!1,this.linearFilterDepth=!1,this.depth=1,this.isImmutable=!1}}function o(t){return t.width<=0||t.height<=0||t.depth<=0?0:Math.round(t.width*t.height*t.depth*(t.hasMipmap?4/3:1)*(null==t.internalFormat?4:(0,s.MW)(t.internalFormat))*(34067===t.target?6:1))}},42293(t,e,i){i.d(e,{MW:()=>c,wH:()=>a,yu:()=>o});var r=i(94656),s=i(63907);const n=new Set([s.pe.BYTE,s.pe.SHORT,s.pe.INT,s.pe.UNSIGNED_BYTE,s.pe.UNSIGNED_SHORT,s.pe.UNSIGNED_INT]);function o(t,e,i,s=0){const o=t.gl;t.bindBuffer(i);for(const a of i.layout){const i=e.get(a.name);if(null==i){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=s*a.stride;if(a.count<=4)a.integer&&n.has(a.type)?o.vertexAttribIPointer(i,a.count,a.type,a.stride,a.offset+c):o.vertexAttribPointer(i,a.count,a.type,a.normalized,a.stride,a.offset+c),o.enableVertexAttribArray(i),a.divisor>0&&o.vertexAttribDivisor(i,a.divisor);else if(9===a.count)for(let t=0;t<3;t++)o.vertexAttribPointer(i+t,3,a.type,a.normalized,a.stride,a.offset+12*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else if(16===a.count)for(let t=0;t<4;t++)o.vertexAttribPointer(i+t,4,a.type,a.normalized,a.stride,a.offset+16*t+c),o.enableVertexAttribArray(i+t),a.divisor>0&&o.vertexAttribDivisor(i+t,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,r.en)()){const e=(0,r.u1)(t.gl);e&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,e,a)}}}function a(t){switch(t){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function c(t){switch(t){case 6406:case 6409:case 6403:case 36244:case s.H0.R8:case s.H0.R8I:case s.H0.R8UI:case s.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case s.H0.RGBA4:case s.H0.R16F:case s.H0.R16I:case s.H0.R16UI:case s.H0.RG8:case s.H0.RG8I:case s.H0.RG8UI:case s.H0.RG8_SNORM:case s.H0.RGB565:case s.H0.RGB5_A1:case s.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case s.H0.RGB8:case s.H0.RGB8I:case s.H0.RGB8UI:case s.H0.RGB8_SNORM:case s.H0.SRGB8:case s.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case s.H0.RGBA8:case s.H0.R32F:case s.H0.R11F_G11F_B10F:case s.H0.RG16F:case s.H0.R32I:case s.H0.R32UI:case s.H0.RG16I:case s.H0.RG16UI:case s.H0.RGBA8I:case s.H0.RGBA8UI:case s.H0.RGBA8_SNORM:case s.H0.SRGB8_ALPHA8:case s.H0.RGB9_E5:case s.H0.RGB10_A2UI:case s.H0.RGB10_A2:case s.SB.DEPTH_COMPONENT32F:case s.iE.DEPTH24_STENCIL8:return 4;case s.iE.DEPTH32F_STENCIL8:return 5;case s.H0.RGB16F:case s.H0.RGB16I:case s.H0.RGB16UI:return 6;case s.H0.RG32F:case s.H0.RG32I:case s.H0.RG32UI:case s.H0.RGBA16F:case s.H0.RGBA16I:case s.H0.RGBA16UI:return 8;case s.H0.RGB32F:case s.H0.RGB32I:case s.H0.RGB32UI:return 12;case s.H0.RGBA32F:case s.H0.RGBA32I:case s.H0.RGBA32UI:return 16;case s.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case s.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case s.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case s.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case s.CQ.COMPRESSED_R11_EAC:case s.CQ.COMPRESSED_SIGNED_R11_EAC:case s.CQ.COMPRESSED_RGB8_ETC2:case s.CQ.COMPRESSED_SRGB8_ETC2:case s.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case s.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case s.CQ.COMPRESSED_RG11_EAC:case s.CQ.COMPRESSED_SIGNED_RG11_EAC:case s.CQ.COMPRESSED_RGBA8_ETC2_EAC:case s.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},79785(t,e,i){i.d(e,{Z:()=>u});var r=i(21818),s=i(53966),n=i(97768),o=i(69397),a=i(63907),c=i(42293),h=i(85079);const l=()=>s.A.getLogger("esri.views.webgl.VertexArrayObject");let u=class t{constructor(t,e,i,s,n){this._context=t,this._indexBuffer=i,this._buffers=e instanceof Map?e:new Map([["geometry",e]]),this._baseInstances=null==s?new Map:"number"==typeof s?new Map([["geometry",s]]):s,this.locations=n??(0,r.z)((0,h.Sk)(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return(0,r.z)(this._buffers)}buffer(t="geometry"){return this.buffers.get(t)}mutableBuffer(t="geometry"){return this._buffers.get(t)}get indexBuffer(){return this._indexBuffer}getByteLength(t){return this.buffer(t)?.sizeBytes??0}vertexCount(t){const e=this.buffer(t);return e?e.sizeBytes/e.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*o.i5)}dispose(){this._context?(this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=(0,n.WD)(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&l().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(a.vt.VertexArrayObject,this)),this._context=null):this._glName&&l().warn("Leaked WebGL VAO")}bind(t=this.locations){const e=this._context.gl;this._glName?e.bindVertexArray(this._glName):(this._context.instanceCounter.increment(a.vt.VertexArrayObject,this),this._glName=e.createVertexArray(),e.bindVertexArray(this._glName),this._bindLayout(t))}_bindLayout(t){const{_buffers:e,_indexBuffer:i}=this;if(e||l().error("Vertex buffer dictionary is empty!"),e.forEach((e,i)=>(0,c.yu)(this._context,t,e,this._baseInstances.get(i)??0)),null!=i){const t=this._context.gl;this._context.gl.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}}},66289(t,e,i){i.d(e,{R:()=>s});var r=i(48852);class s extends r.g{constructor(t,e,i,r=35044){super(t,34962,r,i),this.layout=e}}},94656(t,e,i){i.d(e,{Y2:()=>h,en:()=>c,u1:()=>o});var r=i(49186),s=i(44208),n=i(53966);function o(t){switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,s.A)("enable-feature:webgl-debug");function c(){return a}function h(t,e=c()){if(e){const e=o(t);if(e){const t=(new Error).stack;n.A.getLogger("esri.views.webgl.checkWebGLError").error(new r.A("webgl-error","WebGL error occurred",{message:e,stack:t}))}}}},28449(t,e,i){function r(t,e){const i=t.length;for(let r=0;r<i;++r)n[0]=t[r],e[r]=n[0];return e}function s(t,e){const i=t.length;for(let r=0;r<i;++r)n[0]=t[r],n[1]=t[r]-n[0],e[r]=n[1];return e}i.d(e,{Zo:()=>r,jA:()=>s});const n=new Float32Array(2)},90644(t,e,i){function r(t,e,i=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function s(t,e,i,r,s=32774,n=32774,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:s,opAlpha:n,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}i.d(e,{Ey:()=>y,RC:()=>o,T8:()=>a,Uy:()=>u,Xt:()=>l,iD:()=>n,kn:()=>d,p3:()=>s}),i(4718);const n=r(0,771),o=(r(1,0),r(1,1),r(1,771)),a=s(770,1,771,771),c=(s(0,0,768,1),{face:1029,mode:2305}),h={face:1028,mode:2305},l=t=>2===t?c:1===t?h:null,u={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function p(t){return A.intern(t)}function f(t){return S.intern(t)}function m(t){return E.intern(t)}function g(t){return I.intern(t)}function _(t){return D.intern(t)}function v(t){return P.intern(t)}function x(t){return L.intern(t)}function b(t){return H.intern(t)}function y(t){return z.intern(t)}class w{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function T(t){return"["+t.join(",")+"]"}const A=new w(M,t=>({__tag:"Blending",...t}));function M(t){return t?T([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const S=new w(C,t=>({__tag:"Culling",...t}));function C(t){return t?T([t.face,t.mode]):null}const E=new w(R,t=>({__tag:"PolygonOffset",...t}));function R(t){return t?T([t.factor,t.units]):null}const I=new w(O,t=>({__tag:"DepthTest",...t}));function O(t){return t?T([t.func]):null}const D=new w(F,t=>({__tag:"StencilTest",...t}));function F(t){return t?T([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const P=new w(N,t=>({__tag:"DepthWrite",...t}));function N(t){return t?T([t.zNear,t.zFar]):null}const L=new w(B,t=>({__tag:"ColorWrite",...t}));function B(t){return t?T([t.r,t.g,t.b,t.a]):null}const H=new w(U,t=>({__tag:"StencilWrite",...t}));function U(t){return t?T([t.mask]):null}const z=new w(function(t){return t?T([M(t.blending),C(t.culling),R(t.polygonOffset),O(t.depthTest),F(t.stencilTest),N(t.depthWrite),B(t.colorWrite),U(t.stencilWrite)]):null},t=>({blending:p(t.blending),culling:f(t.culling),polygonOffset:m(t.polygonOffset),depthTest:g(t.depthTest),stencilTest:_(t.stencilTest),depthWrite:v(t.depthWrite),colorWrite:x(t.colorWrite),stencilWrite:b(t.stencilWrite)}))},49788(t,e,i){i.d(e,{Q:()=>r});const r=1/255.5}}]);
|