@arcgis/core 5.1.0-next.38 → 5.1.0-next.39
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/applications/WebEditor/sketchUtils.js +1 -1
- package/arcade/batchExec.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{11058e660139c427c3e7.js → 01777e91cd4e0bf04fd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{666db81085bc97831b18.js → 02a0a58ca5916db1db19.js} +1 -1
- package/assets/esri/core/workers/chunks/{3d18b8c1c759c7240721.js → 03c8453ae72a4e190252.js} +1 -1
- package/assets/esri/core/workers/chunks/{828998d33a48be161782.js → 04981ae9d7728208ffce.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2cf19a28aa5c32a99e3.js → 04b04548d4eb0941a01e.js} +1 -1
- package/assets/esri/core/workers/chunks/{64870f555fefa85a5c59.js → 06003996a378c45bc605.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce063df750018024c9ed.js → 0601c316da0256a60538.js} +1 -1
- package/assets/esri/core/workers/chunks/{93bf908f596140ea4c61.js → 0d321b3496adc640d96a.js} +1 -1
- package/assets/esri/core/workers/chunks/0de66f13e84830a654fb.js +1 -0
- package/assets/esri/core/workers/chunks/{1ff40e6057916e8482b3.js → 0eb57ef4a1b387c951d6.js} +1 -1
- package/assets/esri/core/workers/chunks/{0554f310066937098099.js → 10941b50f5933d168df6.js} +1 -1
- package/assets/esri/core/workers/chunks/{22aeab5c363645c04806.js → 13a009229c96ecb7b04f.js} +1 -1
- package/assets/esri/core/workers/chunks/13d55e3c9aea04116eaa.js +1 -0
- package/assets/esri/core/workers/chunks/{3b86e8eb553122d3b68d.js → 167e4ff7cbc88b42db71.js} +1 -1
- package/assets/esri/core/workers/chunks/16a767cc5f3e2e0e49c2.js +1 -0
- package/assets/esri/core/workers/chunks/19cbaeda71486df01d0f.js +1 -0
- package/assets/esri/core/workers/chunks/{96132a37bc08c7fa8f2e.js → 1a6a77902dd8c84e059a.js} +1 -1
- package/assets/esri/core/workers/chunks/{00947268b6de12329146.js → 1f5d9e5d4ddc623fd511.js} +1 -1
- package/assets/esri/core/workers/chunks/{a2d045217a42ecc36308.js → 236b4ab3da0bc8f788a2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0a66a2b4aaab0774c34f.js → 23af269e88f9ac101ffb.js} +1 -1
- package/assets/esri/core/workers/chunks/{da60a6df2f7858a2910e.js → 244dd7a948ca8a7dc6ef.js} +1 -1
- package/assets/esri/core/workers/chunks/25946077568ab14c7bfc.js +1 -0
- package/assets/esri/core/workers/chunks/{bb7e0334f438daa665da.js → 26cafd20c8d03c274389.js} +1 -1
- package/assets/esri/core/workers/chunks/284ce99af7bdd73dc7e9.js +1 -0
- package/assets/esri/core/workers/chunks/{1d0153c7d65bd9ea7d39.js → 2b386374330d96387aec.js} +1 -1
- package/assets/esri/core/workers/chunks/2c12b1488819c038c6b1.js +1 -0
- package/assets/esri/core/workers/chunks/2d2c10c31cc1460dd96a.js +1 -0
- package/assets/esri/core/workers/chunks/{8bd24534ed185afcb124.js → 30cdb2d1d9f018f1642d.js} +1 -1
- package/assets/esri/core/workers/chunks/{5691c1624190abeaebea.js → 34484afe767d60f85982.js} +1 -1
- package/assets/esri/core/workers/chunks/35d115bde474c380c791.js +1 -0
- package/assets/esri/core/workers/chunks/{6a0c371ec3acd7529fe6.js → 36a0e48113ab59a4f21d.js} +1 -1
- package/assets/esri/core/workers/chunks/{cc3939983cf6f78f7243.js → 38c28189f273636e4017.js} +1 -1
- package/assets/esri/core/workers/chunks/{e00000468fb8ec2b3d43.js → 392941013107bbd96503.js} +1 -1
- package/assets/esri/core/workers/chunks/{43f60f41d353d3fc7c4b.js → 399fcea09dfb1ad6deaa.js} +1 -1
- package/assets/esri/core/workers/chunks/39d71e83261bff46f6bf.js +1 -0
- package/assets/esri/core/workers/chunks/{a52a8254577840a23aba.js → 3d4bb59ab2f644f4d675.js} +1 -1
- package/assets/esri/core/workers/chunks/3e2953ea62817e75d840.js +1 -0
- package/assets/esri/core/workers/chunks/{582d45a41e29005f6c63.js → 4005d37d03c834da7629.js} +1 -1
- package/assets/esri/core/workers/chunks/{285f3b07de852bfc1604.js → 427183ea93e759943a78.js} +1 -1
- package/assets/esri/core/workers/chunks/{4ceba469398ef55de8ea.js → 42b556d56013350c9d80.js} +1 -1
- package/assets/esri/core/workers/chunks/{446bc8461403ed1ac7b2.js → 4577df99c92c7ec0f9de.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a2dd3d85d31dce29d94.js → 49d6249e98f023344e0a.js} +1 -1
- package/assets/esri/core/workers/chunks/{6f3f7f785241edacdb8b.js → 4b5737021a149aa786af.js} +1 -1
- package/assets/esri/core/workers/chunks/{210ef3f1cc6ef8a831bf.js → 4b79ebfb3328f9483147.js} +1 -1
- package/assets/esri/core/workers/chunks/{305b2a8dc6438c5fd4aa.js → 4d378d4e021a33b0047e.js} +1 -1
- package/assets/esri/core/workers/chunks/{114aecdbd2bd92b24de2.js → 52175ff9e8c2c136f90a.js} +1 -1
- package/assets/esri/core/workers/chunks/{dfee98e7d1b206f33ba9.js → 54db91c0a3bd1946e026.js} +1 -1
- package/assets/esri/core/workers/chunks/{c79e8003812b789724af.js → 5b2fe488a461bc433f59.js} +1 -1
- package/assets/esri/core/workers/chunks/{1fa2bf0d6740092ec619.js → 5b70295da76d9227f64b.js} +1 -1
- package/assets/esri/core/workers/chunks/5e59ff96aecdf2adcb3b.js +1 -0
- package/assets/esri/core/workers/chunks/{cb482e20e10ab0f63617.js → 5e9595eb6ae6a40e7265.js} +1 -1
- package/assets/esri/core/workers/chunks/{de9fea9b6f2269ee0703.js → 604f9e7228a66b6cf2f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0d836502321e7a80e61.js → 60d0f8a949b130baff81.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2303b2771fcd75f298b.js → 6258ae3d991ce652d97f.js} +1 -1
- package/assets/esri/core/workers/chunks/{e0d6292aaa3f8a796de3.js → 65865c25487d23dd2e31.js} +1 -1
- package/assets/esri/core/workers/chunks/{d4b97ca16d79809ed6f2.js → 65ea5028eb12457a3aeb.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf100c80b75ba74b479c.js → 66a4d764937918a2779f.js} +1 -1
- package/assets/esri/core/workers/chunks/6ee956d5a92ca905f53f.js +1 -0
- package/assets/esri/core/workers/chunks/{14e05d37e10ebba8cf10.js → 6f58ec80abebb7bfbbb0.js} +1 -1
- package/assets/esri/core/workers/chunks/{5698098c3691b3b49283.js → 73d7337ac9efdbad14a4.js} +1 -1
- package/assets/esri/core/workers/chunks/{568d32ceee1409809e5a.js → 749c368f5cc2366716f1.js} +1 -1
- package/assets/esri/core/workers/chunks/{586bc903e2c285649bf2.js → 77769663cd712822d33e.js} +1 -1
- package/assets/esri/core/workers/chunks/{620965d2e1a9ccf81d43.js → 77f6659e400064d38130.js} +1 -1
- package/assets/esri/core/workers/chunks/{b8f624f8c975728d75e2.js → 78472f69053061a18967.js} +1 -1
- package/assets/esri/core/workers/chunks/{0e7d3f3479fcb366cc6f.js → 80a1ccabd4257cc61e0d.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d156e14fc34d0600fd5.js → 81b830f0d620587966ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cd548ea00b641d8e65d.js → 8333561a938bcdf6c2e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{283ce37403c5e7a76e95.js → 8677865189081e0b83bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{087403b53f15eb4d375c.js → 86f70bd786d6d57fde69.js} +1 -1
- package/assets/esri/core/workers/chunks/88c6cc90606409b5c884.js +1 -0
- package/assets/esri/core/workers/chunks/{8e10e4c25869af9da5ba.js → 8967a02f394a63f11030.js} +1 -1
- package/assets/esri/core/workers/chunks/{d2fa8bd3f4cd3cf6b436.js → 89dbea6f436d45a3b185.js} +1 -1
- package/assets/esri/core/workers/chunks/{8eed5b6cac937099102c.js → 8d5bc17557a31ed79ed8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d6165796af522858e56.js → 8e18ac7b22d8dca1e1e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{ae72c530d52a6d4461be.js → 8e3cb1c584951c3d1eb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{67f95c57c1679935570b.js → 92f6d637f4786ba0d3e3.js} +1 -1
- package/assets/esri/core/workers/chunks/93846f8b77fc802069a7.js +1 -0
- package/assets/esri/core/workers/chunks/{34f2e9d7466abc0919e7.js → 9639b1dd27ccc17ee21e.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ebd836b98d14c7d3ecf.js → 969f58a2de4ebe63619d.js} +1 -1
- package/assets/esri/core/workers/chunks/{9a3e5053e95db36f26dc.js → 9a95c28d4a3b3b4b2c50.js} +1 -1
- package/assets/esri/core/workers/chunks/{c3e4f8664988e50bda55.js → 9b365a6242b0287f8727.js} +1 -1
- package/assets/esri/core/workers/chunks/{e021b2f0e15aee5bf3ad.js → 9b80569819cd1c72a9ff.js} +1 -1
- package/assets/esri/core/workers/chunks/{3dcb4ee8b862689a141b.js → 9bd68abc6b5b07b2add3.js} +1 -1
- package/assets/esri/core/workers/chunks/{952ff668d202e80b43b0.js → a029db48079af4b5cccd.js} +1 -1
- package/assets/esri/core/workers/chunks/{9cc1b44c5a325a840307.js → a1f36240a31057f998da.js} +1 -1
- package/assets/esri/core/workers/chunks/{ff8de370abf661768380.js → a84d67c1a1008bca2075.js} +1 -1
- package/assets/esri/core/workers/chunks/{c6112dcd6b36e256d7b5.js → a90883ff02c0cc6450c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{0d196cf72cd8bef8d91d.js → abcb39ad1e2d54710766.js} +1 -1
- package/assets/esri/core/workers/chunks/{80f0810527743833b4b7.js → af804beb43d4d10c54d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{8c2e5b116bac21e7d577.js → b056b4c79bcd542dd1d2.js} +1 -1
- package/assets/esri/core/workers/chunks/{3b9de873f87f0feeb20b.js → b1ac09d8fa340d194aa2.js} +1 -1
- package/assets/esri/core/workers/chunks/{2f0e850ebea0ffd2708f.js → b1c5f69bd1400e66c635.js} +1 -1
- package/assets/esri/core/workers/chunks/{414a802b6365688d31cb.js → b6e63d8ce3c9ac9762f4.js} +1 -1
- package/assets/esri/core/workers/chunks/{d7229019876c0e4ff545.js → b86cb84c03b76e824213.js} +1 -1
- package/assets/esri/core/workers/chunks/bf9b83e020ff08c51ac1.js +1 -0
- package/assets/esri/core/workers/chunks/{623bfacf4b9c9a5387cc.js → c2f3fc1b34a6782b431f.js} +1 -1
- package/assets/esri/core/workers/chunks/c4f64195e44986644993.js +1 -0
- package/assets/esri/core/workers/chunks/{b7a3a7f7fb747f9689d7.js → c7799ba861ac5af08e6a.js} +1 -1
- package/assets/esri/core/workers/chunks/{9c6e96b1c2b0418a4f1c.js → ca1b0cb14ea9ae1bf2a3.js} +1 -1
- package/assets/esri/core/workers/chunks/cce2d2c60d136e1bac75.js +1 -0
- package/assets/esri/core/workers/chunks/{b98366d8a5bc6cc2b219.js → cda2e445eb2ac269abdf.js} +1 -1
- package/assets/esri/core/workers/chunks/{448620052233e51b496c.js → cf74d1605ad2f21699e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{f4301ea9a6cb3bcef906.js → d0983cc19d19c19c3478.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee582bbe7365b678ec54.js → d50e6681ecb9612e4528.js} +1 -1
- package/assets/esri/core/workers/chunks/{68abe4e70ea48e978642.js → d51c41c1944df0cbab3e.js} +1 -1
- package/assets/esri/core/workers/chunks/{b2f497339493926d4c9e.js → d53b31c9056f82831bc0.js} +1 -1
- package/assets/esri/core/workers/chunks/{ffc87a038712a4c9d2cb.js → d6eddb94f5f2e9759bd0.js} +1 -1
- package/assets/esri/core/workers/chunks/{6cdda5aa35fa12ea9345.js → d7439d357f68160844cb.js} +1 -1
- package/assets/esri/core/workers/chunks/{6c853fd89f0e9f102c6e.js → dba479176db0a23c8034.js} +1 -1
- package/assets/esri/core/workers/chunks/{6792e981a3c73063a3e6.js → dd26e3a29161ea411e41.js} +1 -1
- package/assets/esri/core/workers/chunks/{0337138d3702a1a52ce0.js → de79645e559a2d1ffa67.js} +1 -1
- package/assets/esri/core/workers/chunks/{2ddfd406b9044390e9f7.js → e47dd011c06ab42c18e0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d0da3a44f33f4d8e682b.js → e68d7aec0f095b6d743d.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca64867bc322a354be8e.js → e907acaec4c62adac2f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{9813f25192ea27084754.js → ea356a5b90ea44b5cbe1.js} +1 -1
- package/assets/esri/core/workers/chunks/{d30253b4990a76bfd72b.js → eab74d830c2eaa9d133b.js} +1 -1
- package/assets/esri/core/workers/chunks/{eef102e13fd8878eeb96.js → eb36417edc11fa80e312.js} +1 -1
- package/assets/esri/core/workers/chunks/{f5dbda08d7fd4bed1c62.js → eca45cd479f7fd28ca6e.js} +1 -1
- package/assets/esri/core/workers/chunks/{56f64df68bb11c0c74d2.js → f209a7076d67cbf4d205.js} +1 -1
- package/assets/esri/core/workers/chunks/{b81780e5e7cd9a1a010a.js → f36a234ef35faf8ca04d.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ae9e9a65cb08b12caeb.js → f45e4eb89db31d7a7640.js} +3 -3
- package/assets/esri/core/workers/chunks/{45d57e561fc993bc75ed.js → f9cde38cb56c547e87e5.js} +1 -1
- package/assets/esri/core/workers/chunks/{0efe90bd43ab29dab8ae.js → f9da5c81535eaffc8b9c.js} +1 -1
- package/assets/esri/core/workers/chunks/{c8ae8d1b456ace0b383b.js → fce8d4ff920baf8856e6.js} +1 -1
- package/assets/esri/core/workers/chunks/{5fa5a2fb69f84e9092ba.js → fd629a3ab558adf52617.js} +1 -1
- package/assets/esri/core/workers/chunks/{4bfc6f8c2d13ca4d2082.js → fdf4c1f202cfddf0f226.js} +1 -1
- package/assets/esri/core/workers/chunks/{5b12865ac53d984d8149.js → fe7dec83e40014c55a6b.js} +1 -1
- package/assets/esri/core/workers/chunks/{5f3b25b30acd7a07f5c0.js → ff31936236dd9b1acb24.js} +1 -1
- package/assets/esri/core/workers/chunks/{122ff8d0d428f31fc5d1.js → ff8ec6369c8a1bee9bb4.js} +1 -1
- package/chunks/GaussianSplatComposition.glsl.js +21 -3
- package/chunks/OITDim.glsl.js +3 -4
- package/config.js +1 -1
- package/core/Promise.js +1 -1
- package/core/QueueProcessor.js +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/scheduling.js +1 -1
- package/core/workers/Connection.js +1 -1
- package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/intl/messages.js +1 -1
- package/kernel.js +1 -1
- package/layers/graphics/data/projectionSupport.js +1 -1
- package/layers/graphics/editingSupport.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/mixins/EditBusLayer.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/transitions/FadeTransition.js +1 -1
- package/views/2d/engine/webgl/TextureUploadManager.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueDebugContainer.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/ElevationQuery.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/EmissionDimming.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/transparency/OITDim.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatComposition.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatCompositionTechniqueConfiguration.js +2 -0
- package/views/PopupView.js +1 -1
- package/views/ViewAnimation.js +1 -1
- package/views/analysis/ExclusiveOperationManager.js +1 -1
- package/views/interactive/InteractiveToolBase.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
- package/views/support/AnalysisViewManager.js +1 -1
- package/views/support/LayerLayerViewInfo.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/ScheduledQueueProcessor.js +1 -1
- package/views/support/waitForResources.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/Upload.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
- package/assets/esri/core/workers/chunks/1bf3e787eafec318bd2b.js +0 -1
- package/assets/esri/core/workers/chunks/1ee3d44e6d7add0b24cb.js +0 -1
- package/assets/esri/core/workers/chunks/34cdcee6d0ea595d7aed.js +0 -1
- package/assets/esri/core/workers/chunks/36f91b5c4345a179b8b1.js +0 -1
- package/assets/esri/core/workers/chunks/4d7f7b1e7663cf6088d1.js +0 -1
- package/assets/esri/core/workers/chunks/6997b4d5bcc9c4755375.js +0 -1
- package/assets/esri/core/workers/chunks/75664587bb80f4e187e1.js +0 -1
- package/assets/esri/core/workers/chunks/7975abb2162a82c88edb.js +0 -1
- package/assets/esri/core/workers/chunks/889835e61ea97f090082.js +0 -1
- package/assets/esri/core/workers/chunks/917474f9dd2039b82e9d.js +0 -1
- package/assets/esri/core/workers/chunks/bf668010f36179792592.js +0 -1
- package/assets/esri/core/workers/chunks/c7f27a84268a9b0d8cdb.js +0 -1
- package/assets/esri/core/workers/chunks/cd73d37ea0e66db46e45.js +0 -1
- package/assets/esri/core/workers/chunks/d456f06d0c6a5cc02be7.js +0 -1
- package/assets/esri/core/workers/chunks/dcef87f7d06c45cd928b.js +0 -1
- package/assets/esri/core/workers/chunks/e0344b45af88081fa186.js +0 -1
- package/assets/esri/core/workers/chunks/e16f5f089259988e8993.js +0 -1
- package/assets/esri/core/workers/chunks/fe21b2d31fbf83224e6b.js +0 -1
|
@@ -230,7 +230,7 @@ return fallOffFunction(vv, vn, 0.1);
|
|
|
230
230
|
vec2 uvOffset = uv + rf * blurSize;
|
|
231
231
|
blurFunction(uvOffset, rf, center_d, sharpness, w_total, b);
|
|
232
232
|
}
|
|
233
|
-
fragBlur = b / w_total;`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}))},43609(e,t,r){r.d(t,{a:()=>o,f:()=>s,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let s=0,a=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[s]=t[a],e[s+1]=t[a+1],s+=r,a+=n;return}const c=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[s]=Math.max(t[a]/c,-1),e[s+1]=Math.max(t[a+1]/c,-1),s+=r,a+=n;else for(let i=0;i<o;++i)e[s]=t[a]/c,e[s+1]=t[a+1]/c,s+=r,a+=n}function s(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,s=i?.count??e.count;let a=(i?.dstIndex??0)*o;for(let e=0;e<s;++e)n[a]=t,n[a+1]=r,a+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:s,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>c,c:()=>a,d:()=>o,e:()=>m,f:()=>h,l:()=>u,n:()=>f,t:()=>s});var i=r(40876),n=(r(44208),r(72727));function o(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),c=Math.min(s,a),l=r[0],u=r[1],h=r[2],d=r[4],m=r[5],f=r[6],p=r[8],g=r[9],v=r[10],_=r[12],x=r[13],y=r[14];let w=0,b=0;for(let r=0;r<c;r++){const r=t[w],n=t[w+1],s=t[w+2];e[b]=l*r+d*n+p*s+_,e[b+1]=u*r+m*n+g*s+x,e[b+2]=h*r+f*n+v*s+y,w+=o,b+=i}return e}function a(e,t,r){c(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function c(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),c=Math.min(s,a),l=r[0],u=r[1],h=r[2],d=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8];let _=0,x=0;for(let r=0;r<c;r++){const r=t[_],n=t[_+1],s=t[_+2];e[x]=l*r+d*n+p*s,e[x+1]=u*r+m*n+g*s,e[x+2]=h*r+f*n+v*s,_+=o,x+=i}}function l(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let s=0,a=0;for(let c=0;c<o;c++)e[a]=r*t[s],e[a+1]=r*t[s+1],e[a+2]=r*t[s+2],s+=n,a+=i;return e}function u(e,t,r,i){h(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function h(e,t,r,n,o=3,s=o){const a=Math.min(e.length/o,t.length/s);let c=0,l=0;const u=1/i.Tf;for(let i=0;i<a;i++)e[l]=n*(r*t[c])**u,e[l+1]=n*(r*t[c+1])**u,e[l+2]=n*(r*t[c+2])**u,c+=s,l+=o}function d(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),c=Math.min(s,a);let l=0,u=0;for(let n=0;n<c;n++)e[u]=t[l]+r[0],e[u+1]=t[l+1]+r[1],e[u+2]=t[l+2]+r[2],l+=o,u+=i;return e}function m(e,t){f(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function f(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,s=0;for(let a=0;a<n;a++){const n=t[o],a=t[o+1],c=t[o+2],l=n*n+a*a+c*c;if(l>0){const t=1/Math.sqrt(l);e[s]=t*n,e[s+1]=t*a,e[s+2]=t*c}o+=i,s+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:h,linearToSRGBView:u,normalize:f,normalizeView:m,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride;let c=0,l=0;for(let e=0;e<i;e++)n[l]=s[c]>>r,n[l+1]=s[c+1]>>r,n[l+2]=s[c+2]>>r,c+=a,l+=o},transformMat3:c,transformMat3View:a,transformMat4:s,transformMat4View:o,translate:d},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n,ie:()=>c,uC:()=>a});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+s(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=s(e,t-i):i>r&&(i-=s(e,i-r)),o&&i===r&&(i=t),i+n}function s(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const a=new n(0,2*Math.PI),c=(new n(-Math.PI,Math.PI),new n(0,360))},4341(e,t,r){r.d(t,{I:()=>n});var i=r(26390);class n{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,o));e++)this._items.push(this._allocator())}}const o=1024},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new n(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),s=/^\s*\d+\s*$/;if(!r?.match||!s.test(r))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o?.match||!s.test(o))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(r,10),c=parseInt(o,10);return new n(a,c,t)}}},61473(e,t,r){function i(e){return e=e||globalThis.location.hostname,l.some(t=>null!=e?.match(t))}function n(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(s)||null!=t.match(c)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,s=/^qaext\.arcgis\.com$/,a=/^[\w-]*\.mapsdevext\.arcgis\.com$/,c=/^[\w-]*\.mapsqa\.arcgis\.com$/,l=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,s,/^jsapps\.esri\.com$/,a,c]},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function s(){return n(1,1)}function a(){return n(1,0)}function c(){return n(0,1)}r.d(t,{Un:()=>u,fA:()=>n,uY:()=>l,vt:()=>i});const l=o(),u=s(),h=a(),d=c();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:h,UNIT_Y:d,ZEROS:l,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:s,unitX:a,unitY:c,zeros:o},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{Qf:()=>c,Qh:()=>s,RS:()=>n,Ul:()=>m,i5:()=>d,lM:()=>o,qK:()=>u});var i=r(34275);const n=16;function o(e){if(!e)return 0;let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function s(e){if(!e)return 0;if("number"==typeof e[0])return c(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=h;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?s(e):u;case"string":return function(e){return 32+e.length}(e);case"number":return n;case"boolean":return 4;default:return 8}}function c(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,n):0:0),0)}function l(e,t){return h+e.length*t}const u=32,h=16,d=145,m=64},65806(e,t,r){r.d(t,{g:()=>s});var i=r(51850),n=r(91218),o=r(9762);function s(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return a[0]=e.x,a[1]=e.y,a[2]=e.z??0,(0,o.projectBuffer)(a,e.spatialReference,0,t,r,0);const s=(0,n.tryProject)(e,r,i);return!!s&&(t[0]=s.x,t[1]=s.y,t[2]=s.z??0,!0)}const a=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>a});var i=r(91218),n=r(16930),o=r(9762),s=r(65806);function a(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(c.x=e[0],c.y=e[1],c.z=e[2],c.spatialReference=t,(0,s.g)(c,r,n)))}const c={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,my:()=>s,tM:()=>u,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<i.y9)return e}else if(e.length<i.y9)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return c;if(e<i.y9)return new Array(e).fill(0);if(e>d.length){const t=Math.max(2*d.length,e);d=new Uint8Array(t)}return new Uint8Array(d.buffer,0,e)}(e.length):n?u(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function s(e){return e<=i.y9?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let a=h(131072);const c=[0],l=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function u(e){return 1===e?c:e<i.y9?Array.from(new Uint16Array(l.buffer,0,e)):e<l.length?new Uint16Array(l.buffer,0,e):(e>a.length&&(a=h(Math.max(2*a.length,e))),new Uint32Array(a.buffer,0,e))}function h(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let d=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;const i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},90239(e,t,r){function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},82919(e,t,r){r.d(t,{DV:()=>v,C:()=>p,vt:()=>m,Qy:()=>f,ui:()=>g,ST:()=>y,bU:()=>w,pw:()=>x,m7:()=>_,c8:()=>T});var i=r(4341),n=r(58083),o=r(35522),s=r(51850),a=r(78955),c=r(91829),l=r(71351);function u(e){return e?{ray:(0,l.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,l.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>u());var h=r(27921),d=r(32114);function m(e){return e?[(0,h.vt)(e[0]),(0,h.vt)(e[1]),(0,h.vt)(e[2]),(0,h.vt)(e[3]),(0,h.vt)(e[4]),(0,h.vt)(e[5])]:[(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)()]}function f(){return[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()]}function p(e,t){for(let r=0;r<M;r++)(0,h.C)(e[r],t[r]);return e}function g(e,t,r,i=A){const s=(0,n.lw)(d.Rc.get(),t,e);(0,n.B8)(s,s);for(let e=0;e<S;++e){const t=(0,a.Z0)(d.Km.get(),C[e],s);(0,o.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}v(r,i)}function v(e,t){(0,h.Cr)(t[4],t[0],t[3],e[0]),(0,h.Cr)(t[1],t[5],t[6],e[1]),(0,h.Cr)(t[4],t[5],t[1],e[2]),(0,h.Cr)(t[3],t[2],t[6],e[3]),(0,h.Cr)(t[0],t[1],t[2],e[4]),(0,h.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<M;r++){const i=e[r];if(i[0]*t.center[0]+i[1]*t.center[1]+i[2]*t.center[2]+i[3]>=t.radius)return!1}return!0}function x(e,t){return b(e,function(e,t=u()){return(0,l.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function y(e,t,r){return b(e,function(e,t,r=u()){const i=(0,o.Bw)(e.vector);return(0,l.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function w(e,t){for(let r=0;r<M;r++)if((0,h.mN)(e[r],t)>0)return!1;return!0}function b(e,t){for(let r=0;r<M;r++)if(!(0,h.$Q)(e[r],t))return!1;return!0}const T={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},M=6,S=8,C=[(0,c.fA)(-1,-1,-1,1),(0,c.fA)(1,-1,-1,1),(0,c.fA)(1,1,-1,1),(0,c.fA)(-1,1,-1,1),(0,c.fA)(-1,-1,1,1),(0,c.fA)(1,-1,1,1),(0,c.fA)(1,1,1,1),(0,c.fA)(-1,1,1,1)],E=new i.I(u),A=f()},11964(e,t,r){r.d(t,{Cr:()=>u,LV:()=>l,_I:()=>h,vt:()=>c});var i=r(34727),n=r(4341),o=r(35522),s=r(51850),a=r(32114);function c(e){return e?{origin:(0,s.o8)(e.origin),vector:(0,s.o8)(e.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function l(e,t){const r=d.get();return r.origin=e,r.vector=t,r}function u(e,t,r=c()){return(0,o.C)(r.origin,e),(0,o.Re)(r.vector,t,e),r}function h(e,t,r){return function(e,t,r,n,s){const{vector:c,origin:l}=e,u=(0,o.Re)(a.rq.get(),t,l),h=(0,o.Om)(c,u)/(0,o.m3)(c);return(0,o.hs)(s,c,(0,i.qE)(h,0,1)),(0,o.WQ)(s,s,e.origin)}(e,t,0,0,r)}(0,s.vt)(),(0,s.vt)();const d=new n.I(()=>c())},17136(e,t,r){r.d(t,{Y_:()=>A,O7:()=>C,el:()=>S});var i=r(92602),n=r(69052),o=r(49186),s=r(53966),a=r(39829),c=r(82799),l=r(16930),u=r(80754),h=r(21325),d=r(28735),m=r(11254),f=r(60408),p=r(65864),g=r(2272),v=r(84952),_=r(92300);const x=()=>s.A.getLogger("esri.geometry.support.normalizeUtils");function y(e){return"polygon"===e[0].type}function w(e){return"polyline"===e[0].type}function b(e,t,r){if(t){const t=function(e,t){if(!(e instanceof c.A||e instanceof a.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new o.A("internal:geometry",e)}const r=(0,u.r8)(e),i=[];for(const e of r){const r=[];i.push(r),r.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],o=e[i][1],s=e[i+1][0],a=e[i+1][1],c=Math.sqrt((s-n)*(s-n)+(a-o)*(a-o)),l=(a-o)/c,u=(s-n)/c,h=c/t;if(h>1){for(let e=1;e<=h-1;e++){const i=e*t,s=u*i+n,a=l*i+o;r.push([s,a])}const e=(c+Math.floor(h-1)*t)/2,i=u*e+n,s=l*e+o;r.push([i,s])}r.push([s,a])}}return function(e){return"polygon"===e.type}(e)?new a.A({rings:i,spatialReference:e.spatialReference}):new c.A({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,d.ci)(t,!0)}return r&&(e=(0,u.kS)(e,r)),e}function T(e,t,r){if(Array.isArray(e)){const i=e[0];if(i>t){const r=(0,u.kd)(i,t);e[0]=i+r*(-2*t)}else if(i<r){const t=(0,u.kd)(i,r);e[0]=i+t*(-2*r)}}else{const i=e.x;if(i>t){const r=(0,u.kd)(i,t);e=e.clone().offset(r*(-2*t),0)}else if(i<r){const t=(0,u.kd)(i,r);e=e.clone().offset(t*(-2*r),0)}}return e}function M(e,t){let r=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],o=t.geometries[i],s=(0,u.r8)(o);for(let e=0;e<s.length;e++){const t=s[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const i=t[e][0];r=i>r?i:r}r=Number(r.toFixed(9));const i=-360*(0,u.kd)(r,180);for(let r=0;r<t.length;r++){const t=o.getPoint(e,r);o.setPoint(e,r,t.clone().offset(i,0))}return!0}})}if(n===r){if(y(e))for(const t of(0,u.r8)(o))e[n]=e[n].addRing(t);else if(w(e))for(const t of(0,u.r8)(o))e[n]=e[n].addPath(t)}else r=n,e[n]=o}return e}async function S(e,t,r){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.A.geometryServiceUrl;let o,s,l,y,w,C,E,A,R=0;const I=[],O=[];for(const t of e)if(null!=t)if(o||(o=t.spatialReference,s=(0,h.Vp)(o),l=o.isWebMercator,C=l?102100:4326,y=u.j7[C].maxX,w=u.j7[C].minX,E=u.j7[C].plus180Line,A=u.j7[C].minus180Line),s)if("mesh"===t.type)O.push(t);else if("point"===t.type)O.push(T(t.clone(),y,w));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>T(e,y,w)),O.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,s);O.push(e.rings?new a.A(e):e)}else if(t.extent){const e=t.extent,r=(0,u.kd)(e.xmin,w)*(2*y);let i=0===r?t.clone():(0,u.kS)(t.clone(),r);e.offset(r,0);let{xmin:n,xmax:o}=e;n=Number(n.toFixed(9)),o=Number(o.toFixed(9)),e.intersects(E)&&o!==y?(R=o>R?o:R,i=b(i,l),I.push(i),O.push("cut")):e.intersects(A)&&n!==w?(R=o*(2*y)>R?o*(2*y):R,i=b(i,l,360),I.push(i),O.push("cut")):O.push(i)}else O.push(t.clone());else O.push(t);else O.push(t);let F=(0,u.kd)(R,y),D=-90;const N=F,P=new c.A;for(;F>0;){const e=360*F-180;P.addPath([[e,D],[e,-1*D]]),D*=-1,F--}if(I.length>0&&N>0){const t=M(I,await async function(e,t,r,i){const n=(0,g.Dl)(e),o=t[0].spatialReference,s={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,h.YX)(o),target:JSON.stringify({geometryType:(0,f.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},a=await(0,m.A)(n.path+"/cut",s),{cutIndexes:c,geometries:l=[]}=a.data;return{cutIndexes:c,geometries:l.map(e=>{const t=(0,p.rS)(e);return t.spatialReference=o,t})}}(n,I,P,r)),i=[],o=[];for(let r=0;r<O.length;r++){const n=O[r];if("cut"!==n)o.push(n);else{const n=t.shift(),s=e[r];null!=s&&"polygon"===s.type&&s.rings&&s.rings.length>1&&n.rings.length>=s.rings.length?(i.push(n),o.push("simplify")):o.push(l?(0,d.Gh)(n):n)}}if(!i.length)return o;const s=await async function(e,t,r){const i="string"==typeof e?(0,v.An)(e):e,n=t[0].spatialReference,o=(0,f.$B)(t[0]),s={...r,query:{...i.query,f:"json",sr:(0,h.YX)(n),geometries:JSON.stringify((0,_.X)(t))}},{data:a}=await(0,m.A)(i.path+"/simplify",s);return(0,_.V)(a.geometries,o,n)}(n,i,r),a=[];for(let e=0;e<o.length;e++){const t=o[e];"simplify"!==t?a.push(t):a.push(l?(0,d.Gh)(s.shift()):s.shift())}return a}const B=[];for(let e=0;e<O.length;e++){const t=O[e];if("cut"!==t)B.push(t);else{const e=I.shift();B.push(!0===l?(0,d.Gh)(e):e)}}return B}function C(e,t,r){const i=(0,h.Vp)(r);if(null==i)return e;const[n,o]=i.valid,s=2*o;let a=0,c=0;t>o?a=Math.ceil(Math.abs(t-o)/s):t<n&&(a=-Math.ceil(Math.abs(t-n)/s)),e>o?c=Math.ceil(Math.abs(e-o)/s):e<n&&(c=-Math.ceil(Math.abs(e-n)/s));let l=e+(a-c)*s;const u=l-t;return u>o?l-=s:u<n&&(l+=s),l}function E(e){const t=(0,h.Vp)(e);if(null==t)return null;const[r,i]=t.valid;return new n.hr(r,i)}const A=E(l.A.WGS84);E(l.A.WebMercator)},80754(e,t,r){r.d(t,{j7:()=>s,kS:()=>c,kd:()=>a,r8:()=>l});var i=r(82799),n=r(16930),o=r(60408);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function c(e,t){const r=l(e);for(const e of r)for(const r of e)r[0]+=t;return e}function l(e){return(0,o.Bi)(e)?e.rings:e.paths}},71351(e,t,r){r.d(t,{C:()=>u,Cr:()=>h,LV:()=>l,fA:()=>d,oC:()=>m,vt:()=>a}),r(4576);var i=r(4341),n=(r(77690),r(29242)),o=r(35522),s=r(51850);function a(e){return e?c((0,s.o8)(e.origin),(0,s.o8)(e.direction)):c((0,s.vt)(),(0,s.vt)())}function c(e,t){return{origin:e,direction:t}}function l(e,t){const r=f.get();return r.origin=e,r.direction=t,r}function u(e,t=a()){return d(e.origin,e.direction,t)}function h(e,t,r=a()){return(0,o.C)(r.origin,e),(0,o.Re)(r.direction,t,e),r}function d(e,t,r=a()){return(0,o.C)(r.origin,e),(0,o.C)(r.direction,t),r}function m(e,t,r){const i=(0,o.Om)(e.direction,(0,o.Re)(r,t,e.origin));return(0,o.WQ)(r,e.origin,(0,o.hs)(r,e.direction,i)),r}r(32114);const f=new i.I(()=>a());(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,n.vt)()},94008(e,t,r){r.d(t,{iy:()=>m}),r(44208),r(53966);var i=r(34727),n=r(34304),o=r(58083),s=r(35522),a=r(51850),c=r(91829),l=r(34275);var u=r(71351),h=r(44280),d=r(32114);class m{constructor(e=0,t=0,r=0,i=0){this.radius=i,"number"==typeof e?this._center=(0,a.fA)(e,t,r):function(e){return t=e,(0,l.vZ)(t)&&t.length>=3||function(e){return((0,l.aI)(e)||Array.isArray(e))&&e.length>=3}(e);var t}(e)||function(e){return(t=e)instanceof Float32Array&&t.length>=4||function(e){return Array.isArray(e)&&e.length>=4}(e);var t}(e)?(this._center=(0,a.ci)(e),this.radius=4===e.length?e[3]:t):(this._center=(0,a.o8)(e.center),this.radius=e.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(e){(0,s.C)(this.center,e)}exactEquals(e){return(0,s.aI)(this._center,e.center)&&this.radius===e.radius}copyFrom(e){return e!==this&&((0,s.C)(this._center,e.center),this.radius=e.radius),this}clone(){return new m(this.center,this.radius)}toVec4(){return(0,c.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(e){return(0,s.hG)(this.center,e)<=this.radius**2}intersectRay(e,t){if(null==e)return!1;if(!this._intersect(e,f))return!1;let{t0:r,t1:i}=f;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(t){const{origin:i,direction:n}=e;t[0]=i[0]+n[0]*r,t[1]=i[1]+n[1]*r,t[2]=i[2]+n[2]*r}return!0}intersectLine(e,t){const r=(0,u.Cr)(e,t);if(!this._intersect(r,f))return[];const{origin:i,direction:o}=r,{t0:c,t1:l}=f,h=e=>{const t=(0,a.vt)();return(0,s.Ln)(t,i,o,e),this.projectPoint(t,t)};return Math.abs(c-l)<(0,n.FD)()?[h(c)]:[h(c),h(l)]}_intersect(e,t){const{origin:r,direction:i}=e,n=p;n[0]=r[0]-this.center[0],n[1]=r[1]-this.center[1],n[2]=r[2]-this.center[2];const o=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===o)return!1;const s=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),a=s*s-4*o*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-this.radius**2);if(a<0)return!1;const c=Math.sqrt(a);return t.t0=(-s-c)/(2*o),t.t1=(-s+c)/(2*o),!0}projectPoint(e,t){const r=(0,s.Re)(d.rq.get(),e,this.center),i=(0,s.hs)(d.rq.get(),r,this.radius/(0,s.Bw)(r));return(0,s.WQ)(t,i,this.center)}closestPointOnSilhouette(e,t){const r=d.rq.get(),i=d.Rc.get();(0,s.$A)(r,e.origin,e.direction),(0,s.$A)(t,r,e.origin),(0,s.hs)(t,t,1/(0,s.Bw)(t)*this.radius);const n=this._angleToSilhouette(e.origin),a=(0,h.g7)(e.origin,t);return(0,o.$0)(i,a+n,r),(0,s.Z0)(t,t,i),t}frustumCoverage(e,t,r){const i=this.radius,n=i*i,o=e+.5*Math.PI,s=t*t+n-2*Math.cos(o)*t*i,a=Math.sqrt(s),c=s-n;if(c<=0)return.5;const l=Math.sqrt(c),u=Math.acos(l/a)-Math.asin(i/(a/Math.sin(o)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const t=(0,s.Re)(d.rq.get(),e,this.center),r=(0,s.Bw)(t),n=this.radius,o=n+Math.abs(n-r);return(0,i.XM)(n/o)}union(e){const t=(0,s.Io)(this._center,e.center),r=this.radius,i=e.radius;return t+i<r?this:t+r<i?(this.copyFrom(e),this):((0,s.Cc)(this._center,this._center,e.center,(t+i-r)/(2*t)),this.radius=(t+r+i)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}new m;const f={t0:0,t1:0},p=(0,a.vt)();(0,a.vt)(),(0,a.vt)()},38969(e,t,r){r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},92300(e,t,r){r.d(t,{V:()=>s,X:()=>o});var i=r(60408),n=r(65864);function o(e){return{geometryType:(0,i.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function s(e,t,r){const i=(0,n.xD)(t);return e.map(e=>{const t=i.fromJSON(e);return t.spatialReference=r,t})}},21015(e,t,r){r.d(t,{R:()=>c});var i=r(11254),n=r(60999),o=r(49186),s=r(74887),a=r(84952);class c{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,a.DB)(e)?((0,s.Te)(t),(0,a.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const a=await(0,n.Ke)((0,i.A)(t,{responseType:e,...r}));if(a.ok)return a.value.data;throw(0,s.QP)(a.error),new o.A("gltf-loader-request-error",`Request for resource failed: ${a.error}`)}}},84498(e,t,r){r.d(t,{x:()=>s});var i=r(34275),n=r(97146),o=r(63907);function s(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],s=0;for(let t=0;t<r;++t){const r=e[t+2];i[s++]=n,i[s++]=o,i[s++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>s,Xi:()=>n,pn:()=>a,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function a(e,t){if("image/ktx2"===t)return new n(e);const r=new Blob([e],{type:t});let o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}const s=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{n(),e(s)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),s.removeEventListener("load",r),s.removeEventListener("error",i)};s.addEventListener("load",r),s.addEventListener("error",i),s.src=o});try{s.src=o,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(o),s}},23341(e,t,r){r.d(t,{fetch:()=>br});var i=r(40876),n=r(61473),o=r(34727),s=r(77690),a=r(29242),c=r(58083),l=r(9093),u=r(48163),h=r(35522),d=r(51850),m=r(70328),f=r(34275);function p(e,t=!1){return e<=f.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var g=r(13030),v=r(73354),_=r(50867),x=r(43609),y=r(21015),w=r(84498),b=r(51530),T=r(88340);function M(e){if(null==e)return null;const t=null!=e.offset?e.offset:T.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:T.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),o=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),c=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),l=(0,a.vt)();return(0,s.lw)(l,o,c),(0,s.lw)(l,n,l),l}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var E=r(11254),A=r(60999),R=r(49186),I=r(53966),O=r(69397);class F{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}copy(){const e=new F;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var D=r(74887),N=r(46140),P=r(97146);async function B(e,t){return(await(0,E.A)(e,{responseType:"image",...t})).data}var H=r(46610),L=r(20498);function z(e){if(e.length<f.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,f.LW)(e)?(0,L.pX)().from(e):(0,f.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var U=r(15142),G=r(620);class V{get center(){return(0,d.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,d.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,d.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,G.vA)(e.length>=1),(0,G.vA)(3===r.size||4===r.size);const{data:i,size:n,indices:o}=r;(0,G.vA)(o.length%this._numIndexPerPrimitive===0),(0,G.vA)(o.length>=e.length*this._numIndexPerPrimitive);const s=e.length;let a=n*o[this._numIndexPerPrimitive*e[0]];j.clear(),j.push(a);const c=(0,d.fA)(i[a],i[a+1],i[a+2]),l=(0,d.o8)(c);for(let t=0;t<s;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){a=n*o[r+e],j.push(a);let t=i[a];c[0]=Math.min(t,c[0]),l[0]=Math.max(t,l[0]),t=i[a+1],c[1]=Math.min(t,c[1]),l[1]=Math.max(t,l[1]),t=i[a+2],c[2]=Math.min(t,c[2]),l[2]=Math.max(t,l[2])}}for(let e=0;e<3;++e)this._data[4+e]=c[e],this._data[7+e]=l[e];const u=(0,h.Cc)((0,d.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-c[0],l[1]-c[1]),l[2]-c[2]),f=m*m;for(let e=0;e<j.length;++e){a=j.at(e);const t=i[a]-u[0],r=i[a+1]-u[1],n=i[a+2]-u[2],o=t*t+r*r+n*n;if(o<=f)continue;const s=Math.sqrt(o),c=.5*(s-m);m+=c,f=m*m;const l=c/s;u[0]+=t*l,u[1]+=r*l,u[2]+=n*l}this._data[3]=m;for(let e=0;e<3;++e)this._data[0+e]=u[e];j.clear()}getChildren(){if(this._children||(0,h.hG)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,h.Cc)((0,d.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:o,indices:s}=this.position;for(let a=0;a<t;++a){let t=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=o*s[c],u=n[l],h=n[l+1],d=n[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=o*s[c+e];const t=n[l],r=n[l+1],i=n[l+2];t<u&&(u=t),r<h&&(h=r),i<d&&(d=i)}u<e[0]&&(t|=1),h<e[1]&&(t|=2),d<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const c=new Array(8);for(let e=0;e<8;++e)c[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];c[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==c[e]&&this._children.push(new V(c[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){j.prune()}}const j=new U.A({deallocator:null});var k=r(24326);class W{constructor(e){this.id=(0,k.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,P.Dg)(r.indices)})}get attributes(){return this._attributes}}var $=r(4341),Z=r(11964);function q(e,t,r){return(0,h.Re)(Y,t,e),(0,h.Re)(X,r,e),.5*(0,h.Bw)((0,h.$A)(Y,Y,X))}r(32114),new $.I(Z.vt),new $.I(()=>{return e?{p0:(0,d.o8)(e.p0),p1:(0,d.o8)(e.p1),p2:(0,d.o8)(e.p2)}:{p0:(0,d.vt)(),p1:(0,d.vt)(),p2:(0,d.vt)()};var e});const Y=(0,d.vt)(),X=(0,d.vt)(),J=(0,d.vt)(),K=(0,d.vt)(),Q=(0,d.vt)(),ee=(0,d.vt)();class te{constructor(){this.uid=(0,k.c)()}}class re extends te{constructor(e){super(),this.highlightName=e,this.channel=0}}var ie=r(94656);class ne extends W{constructor(e,t,r=null,i=0,n=null,o=-1,s,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=s,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,G.vA)((e?.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(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,ie.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){const r=new Array;for(const i of e)r.push(t.indices[i]);this._vertexPositionIndicesCache=r}else this._vertexPositionIndicesCache=t?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this.drawIndices??this.positionAttribute?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,h.Z0)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t,r=t?.indices){if(!t||!r)return!1;const{size:i,data:n}=t;(0,h.hZ)(e,0,0,0),(0,h.hZ)(ee,0,0,0);let o=0,s=0;for(let t=0;t<r.length-2;t+=3){const a=r[t]*i,c=r[t+1]*i,l=r[t+2]*i;(0,h.hZ)(J,n[a],n[a+1],n[a+2]),(0,h.hZ)(K,n[c],n[c+1],n[c+2]),(0,h.hZ)(Q,n[l],n[l+1],n[l+2]);const u=q(J,K,Q);u?((0,h.WQ)(J,J,K),(0,h.WQ)(J,J,Q),(0,h.hs)(J,J,1/3*u),(0,h.WQ)(e,e,J),o+=u):((0,h.WQ)(ee,ee,J),(0,h.WQ)(ee,ee,K),(0,h.WQ)(ee,ee,Q),s+=3)}return!(0===s&&0===o||(0!==o?((0,h.hs)(e,e,1/o),0):0===s||((0,h.hs)(e,ee,1/s),0)))}(e,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(e){const t=this.positionAttribute,r=this.primitivePositionIndices;return function(e,t,r,i=t?.indices){if(!t||!i)return!1;(0,h.hZ)(e,0,0,0),(0,h.hZ)(ee,0,0,0);let n=0,o=0;const{size:s,data:a}=t,c=i.length-1,l=c+(r?2:0);for(let t=0;t<l;t+=2){const r=t<c?t+1:0,l=i[t<c?t:c]*s,u=i[r]*s;J[0]=a[l],J[1]=a[l+1],J[2]=a[l+2],K[0]=a[u],K[1]=a[u+1],K[2]=a[u+2],(0,h.hs)(J,(0,h.WQ)(J,J,K),.5);const d=(0,h.xg)(J,K);d>0?((0,h.WQ)(e,e,(0,h.hs)(J,J,d)),n+=d):0===n&&((0,h.WQ)(ee,ee,J),o++)}return 0!==n?((0,h.hs)(e,e,1/n),!0):0!==o&&((0,h.hs)(e,ee,1/o),!0)}(e,t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),r)}_computeAttachmentOriginPoints(e){return function(e,t,r=t?.indices){if(!t||!r)return!1;const{size:i,data:n}=t;(0,h.hZ)(e,0,0,0);let o=-1,s=0;for(let t=0;t<r.length;t++){const a=r[t]*i;o!==a&&(e[0]+=n[a],e[1]+=n[a+1],e[2]+=n[a+2],s++),o=a}return s>1&&(0,h.hs)(e,e,1/s),s>0}(e,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const e=this.positionAttribute,t=this.primitivePositionIndices;if(!e||!t||0===t.length)return null;const r=t===e.indices?e:new H.n(e.data,t,e.size,!1,e.stride),i=0===this.type?3:1;(0,G.vA)(t.length%i===0,"Indexing error: "+t.length+" not divisible by "+i);const n=(0,P.tM)(t.length/i);return new V(n,i,r)}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}get highlights(){return this._highlights||oe}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new re(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const oe=new Set;var se=r(65529),ae=r(97768),ce=r(84952),le=r(38969),ue=r(95117),he=r(2741);let de;var me=r(63907),fe=r(76284),pe=r(42293);let ge=null,ve=null;async function _e(){return null==ve&&(de??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,he.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),ve=de,ge=await ve),ve}function xe(e,t,r,i,n){const o=(0,pe.MW)(t?me.CQ.COMPRESSED_RGBA8_ETC2_EAC:me.CQ.COMPRESSED_RGB8_ETC2),s=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*s)}function ye(e){return e.getNumImages()>=1&&!e.isUASTC()}function we(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function be(e,t,r,i,n,o,s,a){const{compressedTextureETC:c,compressedTextureS3TC:l}=e.capabilities,[u,h]=c?i?[1,me.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,me.CQ.COMPRESSED_RGB8_ETC2]:l?i?[3,me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<d;e++)m.push(new Uint8Array(s(e,u))),a(e,u,m[e]);return t.internalFormat=h,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new fe.A(e,t,{type:"compressed",levels:m})}const Te=()=>I.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Me(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Se=Me("DXT1"),Ce=Me("DXT3"),Ee=Me("DXT5");function Ae(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function Re(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const s=Math.min(Math.sqrt(r/o),i/n);return[Ae(Math.round(e*s),i),Ae(Math.round(t*s),i)]}(e,t);return e.width===r&&e.height===i?e:Ie(e,r,i)}function Ie(e,t,r){if(e instanceof ImageData)return Ie(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new R.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}var Oe=r(67171);class Fe{constructor(e,t){this._data=e,this.id=(0,k.c)(),this.events=new se.bk,this._parameters={...Ne,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,ce.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,le.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,ce.DB)(e.src)||(0,ce.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Oe.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,f.mw)(e)||(0,f.mg)(e))return"image/ktx2"===t.encoding?function(e,t){if(null==ge)return e.byteLength;const r=new ge.KTX2File(new Uint8Array(e)),i=we(r)?xe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):"image/x.basis"===t.encoding?function(e,t){if(null==ge)return e.byteLength;const r=new ge.BasisFile(new Uint8Array(e)),i=ye(r)?xe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?De(e):t,n=t.pixelFormat??6408,o=(0,pe.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new fe.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,f.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,f.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,f.mw)(t)||(0,f.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,f.mw)(t)||(0,f.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,f.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,f.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return Te().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Te().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case Se:n=8,o=me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ee:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Te().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let s=1,a=r[4],c=r[3];(3&a||3&c)&&(Te().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const l=a,u=c;let h,d;131072&r[2]&&!1!==t&&(s=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const f=[];for(let t=0;t<s;++t)d=(a+3>>2)*(c+3>>2)*n,h=new Uint8Array(e.buffer,m,d),f.push(h),m+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:o,width:l,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:s,height:a}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=s,t.height=a,new fe.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==ge&&(ge=await _e());const i=new ge.KTX2File(new Uint8Array(r));if(!we(i))return null;i.startTranscoding();const n=be(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==ge&&(ge=await _e());const i=new ge.BasisFile(new Uint8Array(r));if(!ye(i))return null;i.startTranscoding();const n=be(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,G.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new fe.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await B(t,{signal:r});return(0,D.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,ue.y)(t,t.src,!1,r);return(0,D.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,n)=>{const o=()=>{t.removeEventListener("loadeddata",s),t.removeEventListener("error",a),(0,ae.xt)(c)},s=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(o(),i(this._loadFromImage(e,t)))},a=e=>{o(),n(e||new R.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",s),t.addEventListener("error",a);const c=(0,D.u7)(r,()=>a((0,D.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=Re(r,e.parameters));const i=De(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._texture=new fe.A(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,ae.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function De(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const Ne={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};var Pe=r(49255);class Be{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var He=r(65786);class Le extends Be{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,ae.Gz)(this._texture),this._textureNormal=(0,ae.Gz)(this._textureNormal),this._textureEmissive=(0,ae.Gz)(this._textureEmissive),this._textureOcclusion=(0,ae.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,ae.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new Ue(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,ae.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,D.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,ae.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class ze extends He.Y{constructor(e=null){super(),this.textureEmissive=e}}class Ue extends ze{constructor(e,t,r,i,n,o,s){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=s}}var Ge=r(5482),Ve=r(68317),je=r(51976);class ke extends Ve.Hz{constructor(){super(...arguments),this.oitPass=0,this.hasHighlightMixTexture=!1,this.hasFloatOit=!0,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,Ge.Cg)([(0,je.W)({count:3})],ke.prototype,"oitPass",void 0),(0,Ge.Cg)([(0,je.W)()],ke.prototype,"hasHighlightMixTexture",void 0),(0,Ge.Cg)([(0,je.W)()],ke.prototype,"hasFloatOit",void 0);var We=r(19245);class $e{constructor(e,t){this.id=(0,k.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,We.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,We.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return!1}getConfiguration(e,t,r=new ke){return r.output=e,r.hasEmission=t.hasEmission&&(0,Pe._o)(e),r.oitPass=t.oitPass,r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r.hasFloatOit=t.hasFloatOit,r}}He.Y;class Ze{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const qe=(0,m.vt)();function Ye(e,t,r,i,n,o){if(!e.visible)return;const s=(0,h.jb)(ct,i,r),a=(e,t,r)=>o(e,r,t),{tolerance:c}=t,l=new Ze(c,!1,t.options.normalRequired);if(e.boundingInfo)(0,G.vA)(0===e.type),Je(e.boundingInfo,r,s,c,n,l,a);else{const t=e.positionAttribute,i=e.primitivePositionIndices;!function(e,t,r,i,n,o,s,a,c,l){const u=t,d=lt,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),g=m>=f?m>=p?0:2:f>=p?1:2,v=g,_=u[v]<0?2:1,x=(g+_)%3,y=(g+(3-_))%3,w=u[x]/u[v],b=u[y]/u[v],T=1/u[v],M=Qe,S=et,C=tt,{normalRequired:E}=c;for(let t=r;t<i;++t){const r=3*t,i=s*n[r];(0,h.hZ)(d[0],o[i+0],o[i+1],o[i+2]);const c=s*n[r+1];(0,h.hZ)(d[1],o[c+0],o[c+1],o[c+2]);const u=s*n[r+2];(0,h.hZ)(d[2],o[u+0],o[u+1],o[u+2]),a&&((0,h.C)(d[0],a.applyToVertex(d[0][0],d[0][1],d[0][2],t)),(0,h.C)(d[1],a.applyToVertex(d[1][0],d[1][1],d[1][2],t)),(0,h.C)(d[2],a.applyToVertex(d[2][0],d[2][1],d[2][2],t))),(0,h.jb)(M,d[0],e),(0,h.jb)(S,d[1],e),(0,h.jb)(C,d[2],e);const m=M[x]-w*M[v],f=M[y]-b*M[v],p=S[x]-w*S[v],g=S[y]-b*S[v],_=C[x]-w*C[v],A=C[y]-b*C[v],R=_*g-A*p,I=m*A-f*_,O=p*f-g*m;if((R<0||I<0||O<0)&&(R>0||I>0||O>0))continue;const F=R+I+O;if(0===F)continue;const D=R*(T*M[v])+I*(T*S[v])+O*(T*C[v]);if(D*Math.sign(F)<0)continue;const N=D/F;N>=0&&l(N,t,E?it(d):null)}}(r,s,0,i.length/3,i,t.data,t.stride,n,l,a)}}const Xe=(0,d.vt)();function Je(e,t,r,i,n,o,s){if(null==e)return;const a=function(e,t){return(0,h.hZ)(t,1/e[0],1/e[1],1/e[2])}(r,Xe);if((0,m.Ne)(qe,e.bbMin),(0,m.vI)(qe,e.bbMax),null!=n&&n.applyToAabb(qe),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let s=Math.min(n,o),a=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(a=Math.min(a,Math.max(c,l)),a<0)return!1;if(s=Math.max(s,Math.min(c,l)),s>a)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return a=Math.min(a,Math.max(u,h)),!(a<0)&&(s=Math.max(s,Math.min(u,h)),!(s>a)&&s<1/0)}(e,t,r,i)}(qe,t,a,i)){const{primitiveIndices:a,position:c}=e,l=a?a.length:c.indices.length/3;if(l>st){const a=e.getChildren();if(void 0!==a){for(const e of a)Je(e,t,r,i,n,o,s);return}}!function(e,t,r,i,n,o,s,a,c,l,u){const h=e[0],d=e[1],m=e[2],f=t[0],p=t[1],g=t[2],{normalRequired:v}=l;for(let e=0;e<i;++e){const t=a[e],r=3*t,i=s*n[r];let l=o[i],_=o[i+1],x=o[i+2];const y=s*n[r+1];let w=o[y],b=o[y+1],T=o[y+2];const M=s*n[r+2];let S=o[M],C=o[M+1],E=o[M+2];null!=c&&([l,_,x]=c.applyToVertex(l,_,x,e),[w,b,T]=c.applyToVertex(w,b,T,e),[S,C,E]=c.applyToVertex(S,C,E,e));const A=w-l,R=b-_,I=T-x,O=S-l,F=C-_,D=E-x,N=p*D-F*g,P=g*O-D*f,B=f*F-O*p,H=A*N+R*P+I*B;if(Math.abs(H)<=at)continue;const L=h-l,z=d-_,U=m-x,G=L*N+z*P+U*B;if(H>0){if(G<0||G>H)continue}else if(G>0||G<H)continue;const V=z*I-R*U,j=U*A-I*L,k=L*R-A*z,W=f*V+p*j+g*k;if(H>0){if(W<0||G+W>H)continue}else if(W>0||G+W<H)continue;const $=(O*V+F*j+D*k)/H;$>=0&&u($,t,v?rt(A,R,I,O,F,D,Ke):null)}}(t,r,0,l,c.indices,c.data,c.stride,a,n,o,s)}}const Ke=(0,d.vt)();const Qe=(0,d.vt)(),et=(0,d.vt)(),tt=(0,d.vt)();function rt(e,t,r,i,n,o,s){return(0,h.hZ)(nt,e,t,r),(0,h.hZ)(ot,i,n,o),(0,h.$A)(s,nt,ot),(0,h.S8)(s,s),s}function it(e){return(0,h.jb)(nt,e[1],e[0]),(0,h.jb)(ot,e[2],e[0]),(0,h.$A)(Ke,nt,ot),(0,h.S8)(Ke,Ke),Ke}const nt=(0,d.vt)(),ot=(0,d.vt)(),st=1e3,at=1e-7,ct=(0,d.vt)(),lt=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()];var ut=r(16396);function ht(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length;r*=s;for(let e=0;e<a;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=s}}function dt(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,c=o.length;if(r*=a,1===i)for(let e=0;e<c;++e){const t=3*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}else for(let e=0;e<c;++e){const t=3*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}}function mt(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,c=o.length;if(r*=a,1===i)for(let e=0;e<c;++e){const t=4*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}else for(let e=0;e<c;++e){const t=4*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}}function ft(e,t,r,i,n=1){const o=t.typedBuffer,s=t.typedBufferStride;if(i*=s,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=s;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=s}function pt(e,t,r,i,n,o){switch(e){case"position":{(0,G.vA)(3===t.size);const i=n.getField(e,g.xs);(0,G.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void dt(e,r,i,n);const{data:o,indices:s}=e,a=r.typedBuffer,l=r.typedBufferStride,u=s.length,h=t[0],d=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],_=t[9],x=t[10],y=t[12],w=t[13],b=t[14];i*=l;let T=0,M=0,S=0;const C=(0,c.tZ)(t)?e=>{T=o[e]+y,M=o[e+1]+w,S=o[e+2]+b}:e=>{const t=o[e],r=o[e+1],i=o[e+2];T=h*t+f*r+v*i+y,M=d*t+p*r+_*i+w,S=m*t+g*r+x*i+b};if(1===n)for(let e=0;e<u;++e)C(3*s[e]),a[i]=T,a[i+1]=M,a[i+2]=S,i+=l;else for(let e=0;e<u;++e){C(3*s[e]);for(let e=0;e<n;++e)a[i]=T,a[i+1]=M,a[i+2]=S,i+=l}}(t,r,i,o);break}case"normal":{(0,G.vA)(3===t.size);const r=n.getField(e,g.xs);(0,G.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void dt(e,r,i,n);const{data:o,indices:s}=e,a=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,d=a[0],m=a[1],f=a[2],p=a[4],g=a[5],v=a[6],_=a[8],x=a[9],y=a[10],w=!(0,c.ut)(a),b=1e-6,T=1-b;i*=u;let M=0,S=0,C=0;const E=(0,c.tZ)(a)?e=>{M=o[e],S=o[e+1],C=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];M=d*t+p*r+_*i,S=m*t+g*r+x*i,C=f*t+v*r+y*i};if(1===n)if(w)for(let e=0;e<h;++e){E(3*s[e]);const t=M*M+S*S+C*C;if(t<T&&t>b){const e=1/Math.sqrt(t);l[i]=M*e,l[i+1]=S*e,l[i+2]=C*e}else l[i]=M,l[i+1]=S,l[i+2]=C;i+=u}else for(let e=0;e<h;++e)E(3*s[e]),l[i]=M,l[i+1]=S,l[i+2]=C,i+=u;else for(let e=0;e<h;++e){if(E(3*s[e]),w){const e=M*M+S*S+C*C;if(e<T&&e>b){const t=1/Math.sqrt(e);M*=t,S*=t,C*=t}}for(let e=0;e<n;++e)l[i]=M,l[i+1]=S,l[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,G.vA)(2===t.size);const r=n.getField(e,g.mJ);(0,G.vA)(!!r,`No buffer view for ${e}`),ht(t,r,o);break}case"uv0":{(0,G.vA)(2===t.size);const r=n.getField(e,g.ZD)??n.getField(e,g.gH);(0,G.vA)(!!r,`No buffer view for ${e}`),ht(t,r,o);break}case"uvi":{(0,G.vA)(2===t.size);const r=n.getField(e,g.mJ);(0,G.vA)(!!r,`No buffer view for ${e}`),ht(t,r,o);break}case"color":case"symbolColor":{const r=n.getField(e,g.XP);(0,G.vA)(!!r,`No buffer view for ${e}`),(0,G.vA)(3===t.size||4===t.size),function(e,t,r,i,n=1){const{data:o,indices:s}=e,a=r.typedBuffer,c=r.typedBufferStride,l=s.length;if(i*=c,t===o.length&&4===t){a[i]=o[0],a[i+1]=o[1],a[i+2]=o[2],a[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,s=e[i/=4];i+=t;const u=l*n;for(let r=1;r<u;++r)e[i]=s,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<l;++e){const t=3*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=c}}}(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=n.getField(e,g.Y$)??n.getField(e,g.Y$);(0,G.vA)(!!r,`No buffer view for ${e}`),(0,G.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length,c=i[0];r*=s;for(let e=0;e<a;++e)o[r]=c,r+=s}(t,r,o);break}case"tangent":{(0,G.vA)(4===t.size);const i=n.getField(e,g.Eq);(0,G.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void mt(e,r,i,n);const{data:o,indices:s}=e,a=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,d=a[0],m=a[1],f=a[2],p=a[4],g=a[5],v=a[6],_=a[8],x=a[9],y=a[10],w=!(0,c.ut)(a),b=1e-6,T=1-b;if(i*=u,1===n)for(let e=0;e<h;++e){const t=4*s[e],r=o[t],n=o[t+1],a=o[t+2],c=o[t+3];let h=d*r+p*n+_*a,M=m*r+g*n+x*a,S=f*r+v*n+y*a;if(w){const e=h*h+M*M+S*S;if(e<T&&e>b){const t=1/Math.sqrt(e);h*=t,M*=t,S*=t}}l[i]=h,l[i+1]=M,l[i+2]=S,l[i+3]=c,i+=u}else for(let e=0;e<h;++e){const t=4*s[e],r=o[t],a=o[t+1],c=o[t+2],h=o[t+3];let M=d*r+p*a+_*c,S=m*r+g*a+x*c,C=f*r+v*a+y*c;if(w){const e=M*M+S*S+C*C;if(e<T&&e>b){const t=1/Math.sqrt(e);M*=t,S*=t,C*=t}}for(let e=0;e<n;++e)l[i]=M,l[i+1]=S,l[i+2]=C,l[i+3]=h,i+=u}}(t,r,i,o);break}case"profileVertexAndNormal":{(0,G.vA)(4===t.size);const r=n.getField(e,g.jz)??n.getField(e,g.Eq);(0,G.vA)(!!r,`No buffer view for ${e}`),mt(t,r,o);break}case"profileAuxData":{(0,G.vA)(3===t.size);const r=n.getField(e,g.EC)??n.getField(e,g.xs);(0,G.vA)(!!r,`No buffer view for ${e}`),dt(t,r,o);break}}}(0,d.vt)();class gt{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return function(e,t,r,i,n,o,s){let a={numItems:0,numVerticesPerItem:0};for(const c of r.fields.keys()){const r=e.get(c),l=r?.indices;if(r&&l)"position"===c&&(a={numItems:1,numVerticesPerItem:l.length}),pt(c,r,i,n,o,s);else if("olidColor"===c&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;ft(t,o.getField(c,g.XP),e,s)}}}return a}(r,i,this.layout,e,t,n,o)}}var vt=r(91429),_t=r(91829),xt=r(4431),yt=r(1843),wt=r(72824),bt=r(13840),Tt=r(42958),Mt=r(16943),St=r(90644);const Ct=(0,St.p3)(1,0,1,771);function Et(e,t=!1){switch(e){case 0:return t?St.RC:St.T8;case 1:return Ct;case 2:case 3:return null}}function At(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?St.Uy:null;case 1:case 3:return null}}function Rt(e,t=513){return{func:0===e||2===e?t:515}}const It={factor:-1,units:-2};function Ot({oitPass:e,enableOffset:t}){return t&&1===e?It:null}const Ft={mask:255},Dt={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},Nt={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var Pt=r(4576);r(66289);var Bt=r(69622),Ht=r(32728);class Lt{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",g.Eq),this.color=e.getField("instanceColor",g.XP),this.olidColor=e.getField("instanceOlidColor",g.XP),this.state=e.getField("state",g.SL),this.lodLevel=e.getField("lodLevel",g.SL)}}let zt=class extends Bt.A{constructor(e,t){super(e),this.events=new se.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Gt(Ut.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=$t,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Lt(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,G.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,G.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=Vt,i=jt;t.localTransform.getMat(e,kt),t.globalTransform.getMat(e,Wt);const n=(0,c.lw)(Wt,Wt,kt);(0,h.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,s.z0)(i,n),t.model.setMat(e,i);const o=(0,Ht.wp)(Vt,n);o.sort(),t.modelScaleFactors.set(e,0,o[1]),t.modelScaleFactors.set(e,1,o[2]),(0,s.B8)(i,i),(0,s.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,jt),r.modelOrigin.getVec(e,Vt),t[0]=jt[0],t[1]=jt[1],t[2]=jt[2],t[3]=0,t[4]=jt[3],t[5]=jt[4],t[6]=jt[5],t[7]=0,t[8]=jt[6],t[9]=jt[7],t[10]=jt[8],t[11]=0,t[12]=Vt[0],t[13]=Vt[1],t[14]=Vt[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Vt,this,e),t*=Math.max(Vt[0],Vt[1],Vt[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Vt,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Vt[0],Vt[1],Vt[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max($t,Math.floor(this._capacity*Pt.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new Lt(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,Ge.Cg)([(0,vt.MZ)({constructOnly:!0})],zt.prototype,"shaderTransformation",void 0),(0,Ge.Cg)([(0,vt.MZ)()],zt.prototype,"_size",void 0),(0,Ge.Cg)([(0,vt.MZ)({readOnly:!0})],zt.prototype,"size",null),zt=(0,Ge.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],zt);const Ut=(0,yt.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Gt(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Mt.E)()&&e.vec4u8("instanceOlidColor"),e}const Vt=(0,d.vt)(),jt=(0,a.vt)(),kt=(0,l.vt)(),Wt=(0,l.vt)(),$t=64,Zt=(0,yt.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var qt=r(74810),Yt=r(28491),Xt=r(49788);class Jt extends wt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=qt.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=d.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,d.CN)(.2,.2,.2),this.diffuse=(0,d.CN)(.8,.8,.8),this.externalColor=(0,_t.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Xt.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}wt.gy;let Kt=class extends Tt.w{constructor(e,t){let i=(0,xt.U)(tr(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,xt.U)(function(e){return Gt(Zt.clone(),e)}(t)))),super(e,t,i),this.shader=new bt.r(Yt.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:o,customDepthTest:s,hasOccludees:a}=e;return(0,St.Ey)({blending:(0,Pe._o)(i)&&n?Et(r):null,culling:er(e)?(0,St.Xt)(o):null,depthTest:Rt(r,Qt(s)),depthWrite:At(e),colorWrite:St.kn,stencilWrite:a?Ft:null,stencilTest:a?t?Nt:Dt:null,polygonOffset:Ot(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function Qt(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function er(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function tr(e){const t=(0,yt.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Mt.E)()&&t.vec4u8("olidColor"),t}Kt=(0,Ge.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Kt);class rr extends ke{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,Ge.Cg)([(0,je.W)({count:4})],rr.prototype,"alphaDiscardMode",void 0),(0,Ge.Cg)([(0,je.W)({count:3})],rr.prototype,"doubleSidedMode",void 0),(0,Ge.Cg)([(0,je.W)({count:7})],rr.prototype,"pbrMode",void 0),(0,Ge.Cg)([(0,je.W)({count:3})],rr.prototype,"cullFace",void 0),(0,Ge.Cg)([(0,je.W)({count:3})],rr.prototype,"normalType",void 0),(0,Ge.Cg)([(0,je.W)({count:3})],rr.prototype,"customDepthTest",void 0),(0,Ge.Cg)([(0,je.W)({count:8})],rr.prototype,"emissionSource",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVertexColors",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasSymbolColors",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVerticalOffset",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasColorTexture",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasMetallicRoughnessTexture",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasOcclusionTexture",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasNormalTexture",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasScreenSizePerspective",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVertexTangents",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasOccludees",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"instanced",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"instancedDoublePrecision",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasModelTransformation",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"offsetBackfaces",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVVSize",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVVColor",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"receiveShadows",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"receiveAmbientOcclusion",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"textureAlphaPremultiplied",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"instancedFeatureAttribute",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"instancedColor",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"writeDepth",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"transparent",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"enableOffset",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"terrainDepthTest",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"cullAboveTerrain",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"snowCover",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasColorTextureTransform",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasEmissionTextureTransform",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasNormalTextureTransform",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasOcclusionTextureTransform",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasMetallicRoughnessTextureTransform",void 0);var ir=r(57323);let nr=class extends Kt{constructor(){super(...arguments),this.shader=new bt.r(ir.R,()=>r.e(2314).then(r.bind(r,39933)))}};nr=(0,Ge.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],nr);class or extends $e{constructor(e,t){super(e,ar),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,Pe.iq)(e)||(0,Pe.yT)(e))&&!this.transparent],[4,e=>((0,Pe.iq)(e)||(0,Pe.yT)(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>((0,Pe.iq)(e)||(0,Pe.yT)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=tr(this.parameters),this._configuration=new rr(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=Xt.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,h.t2)(this.parameters.emissiveBaseColor,d.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:o,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:o&&"normal"===s?1:o&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,Pe._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,i,n,o){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,h.hZ)(mr,t[12],t[13],t[14]);let o=null;switch(r.viewingMode){case 1:o=(0,h.S8)(hr,mr);break;case 2:o=(0,h.C)(hr,ur)}const s=(0,h.Re)(fr,mr,e.eye),a=(0,h.Bw)(s),c=(0,h.hs)(s,s,1/a);let l=null;this.parameters.screenSizePerspective&&(l=(0,h.Om)(o,c));const u=(0,We.kE)(e,a,this.parameters.verticalOffset,l??0,this.parameters.screenSizePerspective,null);(0,h.hs)(o,o,u),(0,h.ei)(dr,o,r.transform.inverseRotation),i=(0,h.Re)(cr,i,dr),n=(0,h.Re)(lr,n,dr)}Ye(e,r,i,n,(0,ut.ou)(r.verticalOffset),o)}createGLMaterial(e){return new sr(e)}createBufferWriter(){return new gt(this._layout)}get transparent(){return function(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:s,textureAlphaMode:a,colorMixMode:c}=e,l=i[3];return t||r<1&&"replace"!==c||l<1&&"ignore"!==c||n<1||(null!=o||null!=s)&&1!==a&&2!==a&&"replace"!==c}(this.parameters)}}class sr extends Le{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,h.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?nr:Kt,e)}}class ar extends Jt{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const cr=(0,d.vt)(),lr=(0,d.vt)(),ur=(0,d.fA)(0,0,1),hr=(0,d.vt)(),dr=(0,d.vt)(),mr=(0,d.vt)(),fr=(0,d.vt)(),pr=()=>I.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class gr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function vr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(pr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(pr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(pr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(pr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else pr().warn("Indexed geometries must specify faces"),i=!1;break}default:pr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(pr().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(pr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function _r(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&((0,m.iT)(t,r.bbMin),(0,m.iT)(t,r.bbMax))}),t}function xr(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function yr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const wr=new N.A(1,2,"wosr");async function br(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,A.Ke)((0,E.A)(e,t));if(r.ok)return r.value.data;(0,D.QP)(r.error),function(e){throw new R.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){pr().warn("Externally referenced texture data is not yet supported");continue}const s=n.encoding+";base64,"+o,a="/textureDefinitions/"+i,c="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",l={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==xr(c)},u=t?.disableTextures?Promise.resolve(null):B(s,t);r.push(u.then(e=>({refId:a,image:e,parameters:l,alphaChannelUsage:c})))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new gr(r,i,n+(0,O.Qh)(r))}(a.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new F,s=e.resource,a=N.A.parse(s.version||"1.0","wosr");wr.validate(a);const c=s.model.name,l=s.model.geometries,u=s.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<l.length;e++){const s=l[e];if(!vr(s))continue;const a=yr(s),c=s.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===s.params.topology)return null;const t=s.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=c.position,_=v.values.length/v.valuesPerElement;for(const e in c){const t=c[e],r=t.values,i=g(e)??(0,P.tM)(_);p.push([e,new H.n(r,i,t.valuesPerElement,!0)])}const x=a.texture,y=h&&h[x];if(y&&!f.has(x)){const{image:e,parameters:t}=y,r=new Fe(e,t);i.push(r),f.set(x,r)}const w=f.get(x),b=w?w.id:void 0,T=a.material;let M=o.get(T,x);if(null==M){const e=u[T.slice(T.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=y?xr(y.alphaChannelUsage):void 0,i={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:b,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),M=new or(i,t),o.set(T,x,M)}n.push(M);const S=new ne(M,p);m+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(S)}return{engineResources:[{name:c,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:s.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:_r(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let f;if(t.cache)f=await t.cache.loadGLTF(a.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));f=await e(new y.R,a.url,t,t.usePBR,t.useEmissive)}const{engineResources:T,referenceBoundingBox:S}=function(e,t,r){const n=e.model,a=e.meta,f=n.meta?.ESRI_proxyEllipsoid,y=a.isEsriSymbolResource&&null!=f&&"EsriRealisticTreesStyle"===a.ESRI_webstyle;y&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const n=e.model.lods[r];for(const o of n.parts){const n=o.attributes.normal;if(null==n)return;const s=o.attributes.position,a=s.count,u=(0,d.vt)(),m=(0,d.vt)(),f=(0,d.vt)(),p=new Float32Array(4*a),v=new Float32Array(3*a),_=(0,c.B8)((0,l.vt)(),o.transform);let x=0,y=0;for(let c=0;c<a;c++){s.getVec(c,m),n.getVec(c,u),(0,h.Z0)(m,m,o.transform),(0,h.Re)(f,m,t.center),(0,h.Qr)(f,f,t.radius);const a=f[2],l=(0,h.Bw)(f),d=Math.min(.45+.55*l*l,1)**i.Tf;(0,h.Qr)(f,f,t.radius),null!==_&&(0,h.Z0)(f,f,_),(0,h.S8)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,h.Cc)(f,f,u,a>-1?.2:Math.min(-4*a-3.8,1)),v[x]=f[0],v[x+1]=f[1],v[x+2]=f[2],x+=3,p[y]=d,p[y+1]=d,p[y+2]=d,p[y+3]=1,y+=4}o.attributes.normal=new g.xs(v.buffer),o.attributes.color=new g.Eq(p.buffer)}}}(e,f));const T=!!t.usePBR,S=a.isEsriSymbolResource?{usePBR:T,isSchematic:!1,treeRendering:y,mrrFactors:qt.SY}:{usePBR:T,isSchematic:!1,treeRendering:!1,mrrFactors:qt.mb},E={...t.materialParameters,treeRendering:y},A=new Array,R=new Map,I=new Map,O=n.lods.length,F=(0,m.Ie)();return n.lods.forEach((e,a)=>{const c=!0===t.skipHighLods&&(O>1&&0===a||O>3&&1===a)||!1===t.skipHighLods&&null!=r&&a!==r;if(c&&0!==a)return;const l=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=c?new or({},t):function(e,t,r,n,o,s,a,c,l){const h=e.materials.get(t.material);if(null==h)return null;const{normal:d,color:m,texCoord0:f,tangent:p}=t.attributes,g=t.material+(d?"_normal":"")+(m?"_color":"")+(f?"_texCoord0":"")+(p?"_tangent":""),v=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,x=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(h.alphaMode);if(!s.has(g)){if(v){const t=(t,r=!1,i=!1)=>{if(null!=t&&!a.has(t)){const n=e.textures.get(t);if(n){const e=n.data,o=r&&!(0,b.x3)(e)?c.compressionOptions:void 0;a.set(t,new Fe((0,b.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,b.x3)(e)&&i,encoding:(0,b.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==x&&!l;t(h.colorTexture,r,1!==x),t(h.normalTexture),t(h.occlusionTexture,!0),t(h.emissiveTexture),t(h.metallicRoughnessTexture,!0)}const r=(0,i.xV)(h.color[0]),d=(0,i.xV)(h.color[1]),m=(0,i.xV)(h.color[2]),f=null!=h.colorTexture&&v?a.get(h.colorTexture):null,p=(0,qt.Jr)(h),y=null!=h.normalTextureTransform?.scale?h.normalTextureTransform?.scale:u.Un;s.set(g,new or({...n,customDepthTest:1,textureAlphaMode:x,textureAlphaCutoff:h.alphaCutoff,diffuse:[r,d,m],ambient:[r,d,m],opacity:"OPAQUE"===h.alphaMode?1:h.opacity,doubleSided:h.doubleSided,doubleSidedType:"winding-order",cullFace:h.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:h.receiveShadows,receiveAmbientOcclusion:h.receiveAmbientOcclusion,textureId:null!=f?f.id:void 0,colorMixMode:h.colorMixMode,normalTextureId:null!=h.normalTexture&&v?a.get(h.normalTexture).id:void 0,textureAlphaPremultiplied:null!=f&&!!f.parameters.preMultiplyAlpha,occlusionTextureId:null!=h.occlusionTexture&&v?a.get(h.occlusionTexture).id:void 0,emissiveTextureId:null!=h.emissiveTexture&&v?a.get(h.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=h.metallicRoughnessTexture&&v?a.get(h.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[h.emissiveFactor[0],h.emissiveFactor[1],h.emissiveFactor[2]],emissiveStrengthKHR:null!=h.emissiveStrengthKHR?h.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=o.emissiveStrengthFromSymbol?o.emissiveStrengthFromSymbol:void 0,mrrFactors:p?qt.Bt:[h.metallicFactor,h.roughnessFactor,n.mrrFactors[2]],isSchematic:p,colorTextureTransformMatrix:M(h.colorTextureTransform),normalTextureTransformMatrix:M(h.normalTextureTransform),scale:[y[0],y[1]],occlusionTextureTransformMatrix:M(h.occlusionTextureTransform),emissiveTextureTransformMatrix:M(h.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(h.metallicRoughnessTextureTransform),...o},c))}const y=s.get(g);if(r.stageResources.materials.push(y),v){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(h.colorTexture),e(h.normalTexture),e(h.occlusionTexture),e(h.emissiveTexture),e(h.metallicRoughnessTexture)}return y}(n,e,l,S,E,R,I,t,y),{geometry:h,vertexCount:d}=function(e,t){const r=e.attributes.position.count,i=(0,w.x)(e.indices||r,e.primitiveType),n=p(3*r),{typedBuffer:a,typedBufferStride:c}=e.attributes.position;(0,v.t)(n,a,e.transform,3,c);const l=[["position",new H.n(n,i,3,!0)]];if(null!=e.attributes.normal){const t=p(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,s.Ge)(Tr,e.transform),(0,v.b)(t,n,Tr,3,a),(0,o.or)(Tr)&&(0,v.n)(t,t),l.push(["normal",new H.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=p(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,s.z0)(Tr,e.transform),(0,_.t)(t,n,Tr,4,a),(0,o.or)(Tr)&&(0,v.n)(t,t,4),l.push(["tangent",new H.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=p(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,x.a)(t,n,2,o),l.push(["uv0",new H.n(t,i,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof g.Eq?(0,_.b)(t,u,1,255):(u instanceof g.XP||u instanceof g.Uz)&&(0,_.b)(t,u,1/255,255):(t.fill(255),u instanceof g.xs?(0,v.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof g.eI||e.attributes.color instanceof g.nS)&&(0,v.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),l.push(["color",new H.n(t,i,4,!0)])}return{geometry:new ne(t,l),vertexCount:r}}(e,r??new or({},t)),f=h.boundingInfo;null!=f&&0===a&&((0,m.iT)(F,f.bbMin),(0,m.iT)(F,f.bbMax)),null!=r&&(l.stageResources.geometries.push(h),l.numberOfVertices+=d)}),c||A.push(l)}),{engineResources:A,referenceBoundingBox:F}}(f,t,a.specifiedLodIndex);return{lods:T,referenceBoundingBox:S,isEsriSymbolResource:f.meta.isEsriSymbolResource,isWosr:!1}}const Tr=(0,a.vt)()},1843(e,t,r){r.d(t,{BP:()=>h,l5:()=>d});var i=r(20498),n=r(13030),o=r(90239),s=r(4431),a=r(620),c=r(85079);class l{constructor(e,t,r=0){this.layout=e,this.byteOffset=r,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const i=e.fields.get(t);this[t]=new i.constructor(this.buffer,r+i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new l(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:p(e[1].constructor)})))}freeze(){return this}get locations(){return(0,c.Xk)((0,s.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}vec4i16(e,t){return this._appendField(e,n.E7,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new l(this,e)}createView(e,t){return new l(this,e,t)}clone(){const e=new u;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function h(){return new u}class d{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:f(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const m=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function f(e){return`${e.ElementType}_${e.ElementCount}`}function p(e){return g.get(e)}const g=new Map;m.forEach(e=>g.set(f(e),e))},4431(e,t,r){r.d(t,{U:()=>o});var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map(o=>{const s=e.fields.get(o),a=s.constructor.ElementCount,c=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(s.constructor.ElementType),l=s.offset,u=s.optional?.glNormalized??!1,h=s.optional?.integer??!1;return new n._(o,a,c,l,r,u,t,h)})}},26857(e,t,r){r.d(t,{b:()=>a});var i=r(5482),n=r(69622),o=r(91429);let s=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],s.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),s=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],s);const a=new s},46686(e,t,r){r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
|
|
233
|
+
fragBlur = b / w_total;`),e}const d=Object.freeze(Object.defineProperty({__proto__:null,build:h},Symbol.toStringTag,{value:"Module"}))},43609(e,t,r){r.d(t,{a:()=>o,f:()=>s,n:()=>n});var i=r(34275);function n(e,t){o(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function o(e,t,r=2,n=r){const o=t.length/2;let s=0,a=0;if(!(0,i.iu)(t)||(0,i.dk)(t)){for(let i=0;i<o;++i)e[s]=t[a],e[s+1]=t[a+1],s+=r,a+=n;return}const c=(0,i.a3)(t);if((0,i.JI)(t))for(let i=0;i<o;++i)e[s]=Math.max(t[a]/c,-1),e[s+1]=Math.max(t[a+1]/c,-1),s+=r,a+=n;else for(let i=0;i<o;++i)e[s]=t[a]/c,e[s+1]=t[a+1]/c,s+=r,a+=n}function s(e,t,r,i){const n=e.typedBuffer,o=e.typedBufferStride,s=i?.count??e.count;let a=(i?.dstIndex??0)*o;for(let e=0;e<s;++e)n[a]=t,n[a+1]=r,a+=o}Object.freeze(Object.defineProperty({__proto__:null,fill:s,normalizeIntegerBuffer:o,normalizeIntegerBufferView:n},Symbol.toStringTag,{value:"Module"}))},73354(e,t,r){r.d(t,{a:()=>d,b:()=>c,c:()=>a,d:()=>o,e:()=>m,f:()=>h,l:()=>u,n:()=>f,t:()=>s});var i=r(40876),n=(r(44208),r(72727));function o(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),c=Math.min(s,a),l=r[0],u=r[1],h=r[2],d=r[4],m=r[5],f=r[6],p=r[8],g=r[9],v=r[10],_=r[12],x=r[13],y=r[14];let w=0,b=0;for(let r=0;r<c;r++){const r=t[w],n=t[w+1],s=t[w+2];e[b]=l*r+d*n+p*s+_,e[b+1]=u*r+m*n+g*s+x,e[b+2]=h*r+f*n+v*s+y,w+=o,b+=i}return e}function a(e,t,r){c(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function c(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),c=Math.min(s,a),l=r[0],u=r[1],h=r[2],d=r[3],m=r[4],f=r[5],p=r[6],g=r[7],v=r[8];let _=0,x=0;for(let r=0;r<c;r++){const r=t[_],n=t[_+1],s=t[_+2];e[x]=l*r+d*n+p*s,e[x+1]=u*r+m*n+g*s,e[x+2]=h*r+f*n+v*s,_+=o,x+=i}}function l(e,t,r,i=3,n=i){const o=Math.min(e.length/i,t.length/n);let s=0,a=0;for(let c=0;c<o;c++)e[a]=r*t[s],e[a+1]=r*t[s+1],e[a+2]=r*t[s+2],s+=n,a+=i;return e}function u(e,t,r,i){h(e.typedBuffer,t.typedBuffer,r,i,e.typedBufferStride,t.typedBufferStride)}function h(e,t,r,n,o=3,s=o){const a=Math.min(e.length/o,t.length/s);let c=0,l=0;const u=1/i.Tf;for(let i=0;i<a;i++)e[l]=n*(r*t[c])**u,e[l+1]=n*(r*t[c+1])**u,e[l+2]=n*(r*t[c+2])**u,c+=s,l+=o}function d(e,t,r,i=3,o=i){const s=(0,n.k)(e.length,i,3),a=(0,n.k)(t.length,o,3),c=Math.min(s,a);let l=0,u=0;for(let n=0;n<c;n++)e[u]=t[l]+r[0],e[u+1]=t[l+1]+r[1],e[u+2]=t[l+2]+r[2],l+=o,u+=i;return e}function m(e,t){f(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function f(e,t,r=3,i=r){const n=Math.min(e.length/r,t.length/i);let o=0,s=0;for(let a=0;a<n;a++){const n=t[o],a=t[o+1],c=t[o+2],l=n*n+a*a+c*c;if(l>0){const t=1/Math.sqrt(l);e[s]=t*n,e[s+1]=t*a,e[s+2]=t*c}o+=i,s+=r}}Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:h,linearToSRGBView:u,normalize:f,normalizeView:m,scale:l,scaleView:function(e,t,r){l(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const i=Math.min(e.count,t.count),n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride;let c=0,l=0;for(let e=0;e<i;e++)n[l]=s[c]>>r,n[l+1]=s[c+1]>>r,n[l+2]=s[c+2]>>r,c+=a,l+=o},transformMat3:c,transformMat3View:a,transformMat4:s,transformMat4View:o,translate:d},Symbol.toStringTag,{value:"Module"}))},69052(e,t,r){r.d(t,{hr:()=>n,ie:()=>c,uC:()=>a});var i=r(34727);class n{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return o(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,i.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+s(this.range,e-t,r)}minimalMonotonic(e,t,r){return o(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,i=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(i)?r:i}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function o(e,t,r,i,n=0,o=!1){return(i-=n)<t?i+=s(e,t-i):i>r&&(i-=s(e,i-r)),o&&i===r&&(i=t),i+n}function s(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const a=new n(0,2*Math.PI),c=(new n(-Math.PI,Math.PI),new n(0,360))},4341(e,t,r){r.d(t,{I:()=>n});var i=r(26390);class n{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return 0===this._itemsPtr&&(0,i.d)(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*o);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;e<Math.max(8,Math.min(this._items.length,o));e++)this._items.push(this._allocator())}}const o=1024},46140(e,t,r){r.d(t,{A:()=>n});var i=r(49186);class n{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}toString(){return`${this.major}.${this.minor}`}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new i.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new n(this.major,this.minor,this._context)}static parse(e,t=""){const[r,o]=e.split("."),s=/^\s*\d+\s*$/;if(!r?.match||!s.test(r))throw new i.A((t&&t+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:e});if(!o?.match||!s.test(o))throw new i.A((t&&t+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:e});const a=parseInt(r,10),c=parseInt(o,10);return new n(a,c,t)}}},61473(e,t,r){function i(e){return e=e||globalThis.location.hostname,l.some(t=>null!=e?.match(t))}function n(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(o)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(s)||null!=t.match(c)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>n,b5:()=>i});const o=/^devext\.arcgis\.com$/,s=/^qaext\.arcgis\.com$/,a=/^[\w-]*\.mapsdevext\.arcgis\.com$/,c=/^[\w-]*\.mapsqa\.arcgis\.com$/,l=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,o,s,/^jsapps\.esri\.com$/,a,c]},88340(e,t,r){function i(){return new Float32Array(2)}function n(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function o(){return i()}function s(){return n(1,1)}function a(){return n(1,0)}function c(){return n(0,1)}r.d(t,{Un:()=>u,fA:()=>n,uY:()=>l,vt:()=>i});const l=o(),u=s(),h=a(),d=c();Object.freeze(Object.defineProperty({__proto__:null,ONES:u,UNIT_X:h,UNIT_Y:d,ZEROS:l,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:i,fromValues:n,ones:s,unitX:a,unitY:c,zeros:o},Symbol.toStringTag,{value:"Module"}))},69397(e,t,r){r.d(t,{Qf:()=>c,Qh:()=>s,RS:()=>n,Ul:()=>m,i5:()=>d,lM:()=>o,qK:()=>u});var i=r(34275);const n=16;function o(e){if(!e)return 0;let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r],!1));return t}function s(e){if(!e)return 0;if("number"==typeof e[0])return c(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return l(e,8);let r=h;for(let i=0;i<t;i++)r+=a(e[i]);return r}(e);let t=u;for(const r in e)e.hasOwnProperty(r)&&(t+=a(e[r]));return t}function a(e,t=!0){switch(typeof e){case"object":return t?s(e):u;case"string":return function(e){return 32+e.length}(e);case"number":return n;case"boolean":return 4;default:return 8}}function c(...e){return e.reduce((e,t)=>e+(t?(0,i.iu)(t)?t.byteLength+d:Array.isArray(t)?l(t,n):0:0),0)}function l(e,t){return h+e.length*t}const u=32,h=16,d=145,m=64},65806(e,t,r){r.d(t,{g:()=>s});var i=r(51850),n=r(91218),o=r(9762);function s(e,t,r,i){if((0,n.canProjectWithoutEngine)(e.spatialReference,r))return a[0]=e.x,a[1]=e.y,a[2]=e.z??0,(0,o.projectBuffer)(a,e.spatialReference,0,t,r,0);const s=(0,n.tryProject)(e,r,i);return!!s&&(t[0]=s.x,t[1]=s.y,t[2]=s.z??0,!0)}const a=(0,i.vt)()},27993(e,t,r){r.d(t,{F:()=>a});var i=r(91218),n=r(16930),o=r(9762),s=r(65806);function a(e,t,r,n){return!(null==t||null==n||e.length<2)&&((0,i.canProjectWithoutEngine)(t,n)?(0,o.projectBuffer)(e,t,0,r,n,0,1):(c.x=e[0],c.y=e[1],c.z=e[2],c.spatialReference=t,(0,s.g)(c,r,n)))}const c={x:0,y:0,z:0,hasZ:!0,hasM:!1,spatialReference:n.A.WGS84,type:"point"}},97146(e,t,r){r.d(t,{Dg:()=>o,my:()=>s,tM:()=>u,uW:()=>n});var i=r(34275);function n(e){return o(e,!0)}function o(e,t){if(Array.isArray(e)){if(e.length<i.y9)return e}else if(e.length<i.y9)return Array.from(e);let r=!0,n=!0;return e.some((e,t)=>(r=r&&0===e,n=n&&e===t,!r&&!n)),r?function(e){if(1===e)return c;if(e<i.y9)return new Array(e).fill(0);if(e>d.length){const t=Math.max(2*d.length,e);d=new Uint8Array(t)}return new Uint8Array(d.buffer,0,e)}(e.length):n?u(e.length):(0,i.iu)(e)&&e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT?e:function(e,t){for(const r of e){if(r>=65536)return(0,i.iu)(e)?e:new Uint32Array(e);r>=256&&(t=!1)}return t?new Uint8Array(e):new Uint16Array(e)}(e,!t)}function s(e){return e<=i.y9?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let a=h(131072);const c=[0],l=(()=>{const e=new Uint16Array(65536);for(let t=0;t<e.length;++t)e[t]=t;return e})();function u(e){return 1===e?c:e<i.y9?Array.from(new Uint16Array(l.buffer,0,e)):e<l.length?new Uint16Array(l.buffer,0,e):(e>a.length&&(a=h(Math.max(2*a.length,e))),new Uint32Array(a.buffer,0,e))}function h(e){const t=new Uint32Array(e);for(let e=0;e<t.length;e++)t[e]=e;return t}let d=new Uint8Array(65536)},72727(e,t,r){function i(e,t,r){if(t<=0)return 0;const i=e-r;return i<0?0:Math.floor(i/t)+1}r.d(t,{k:()=>i}),r(53966)},90239(e,t,r){function i(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>i})},82919(e,t,r){r.d(t,{DV:()=>v,C:()=>p,vt:()=>m,Qy:()=>f,ui:()=>g,ST:()=>y,bU:()=>w,pw:()=>x,m7:()=>_,c8:()=>T});var i=r(4341),n=r(58083),o=r(35522),s=r(51850),a=r(78955),c=r(91829),l=r(71351);function u(e){return e?{ray:(0,l.vt)(e.ray),c0:e.c0,c1:e.c1}:{ray:(0,l.vt)(),c0:0,c1:Number.MAX_VALUE}}new i.I(()=>u());var h=r(27921),d=r(32114);function m(e){return e?[(0,h.vt)(e[0]),(0,h.vt)(e[1]),(0,h.vt)(e[2]),(0,h.vt)(e[3]),(0,h.vt)(e[4]),(0,h.vt)(e[5])]:[(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)(),(0,h.vt)()]}function f(){return[(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,s.vt)()]}function p(e,t){for(let r=0;r<M;r++)(0,h.C)(e[r],t[r]);return e}function g(e,t,r,i=A){const s=(0,n.lw)(d.Rc.get(),t,e);(0,n.B8)(s,s);for(let e=0;e<S;++e){const t=(0,a.Z0)(d.Km.get(),C[e],s);(0,o.hZ)(i[e],t[0]/t[3],t[1]/t[3],t[2]/t[3])}v(r,i)}function v(e,t){(0,h.Cr)(t[4],t[0],t[3],e[0]),(0,h.Cr)(t[1],t[5],t[6],e[1]),(0,h.Cr)(t[4],t[5],t[1],e[2]),(0,h.Cr)(t[3],t[2],t[6],e[3]),(0,h.Cr)(t[0],t[1],t[2],e[4]),(0,h.Cr)(t[5],t[4],t[7],e[5])}function _(e,t){for(let r=0;r<M;r++){const i=e[r];if(i[0]*t.center[0]+i[1]*t.center[1]+i[2]*t.center[2]+i[3]>=t.radius)return!1}return!0}function x(e,t){return b(e,function(e,t=u()){return(0,l.C)(e,t.ray),t.c0=0,t.c1=Number.MAX_VALUE,t}(t,E.get()))}function y(e,t,r){return b(e,function(e,t,r=u()){const i=(0,o.Bw)(e.vector);return(0,l.fA)(e.origin,t,r.ray),r.c0=0,r.c1=i,r}(t,r,E.get()))}function w(e,t){for(let r=0;r<M;r++)if((0,h.mN)(e[r],t)>0)return!1;return!0}function b(e,t){for(let r=0;r<M;r++)if(!(0,h.$Q)(e[r],t))return!1;return!0}const T={bottom:[5,1,0,4],near:[0,1,2,3],far:[5,4,7,6],right:[1,5,6,2],left:[4,0,3,7],top:[7,3,2,6]},M=6,S=8,C=[(0,c.fA)(-1,-1,-1,1),(0,c.fA)(1,-1,-1,1),(0,c.fA)(1,1,-1,1),(0,c.fA)(-1,1,-1,1),(0,c.fA)(-1,-1,1,1),(0,c.fA)(1,-1,1,1),(0,c.fA)(1,1,1,1),(0,c.fA)(-1,1,1,1)],E=new i.I(u),A=f()},11964(e,t,r){r.d(t,{Cr:()=>u,LV:()=>l,_I:()=>h,vt:()=>c});var i=r(34727),n=r(4341),o=r(35522),s=r(51850),a=r(32114);function c(e){return e?{origin:(0,s.o8)(e.origin),vector:(0,s.o8)(e.vector)}:{origin:(0,s.vt)(),vector:(0,s.vt)()}}function l(e,t){const r=d.get();return r.origin=e,r.vector=t,r}function u(e,t,r=c()){return(0,o.C)(r.origin,e),(0,o.Re)(r.vector,t,e),r}function h(e,t,r){return function(e,t,r,n,s){const{vector:c,origin:l}=e,u=(0,o.Re)(a.rq.get(),t,l),h=(0,o.Om)(c,u)/(0,o.m3)(c);return(0,o.hs)(s,c,(0,i.qE)(h,0,1)),(0,o.WQ)(s,s,e.origin)}(e,t,0,0,r)}(0,s.vt)(),(0,s.vt)();const d=new n.I(()=>c())},17136(e,t,r){r.d(t,{Y_:()=>A,O7:()=>C,el:()=>S});var i=r(92602),n=r(69052),o=r(49186),s=r(53966),a=r(39829),c=r(82799),l=r(16930),u=r(80754),h=r(21325),d=r(28735),m=r(11254),f=r(60408),p=r(65864),g=r(2272),v=r(84952),_=r(92300);const x=()=>s.A.getLogger("esri.geometry.support.normalizeUtils");function y(e){return"polygon"===e[0].type}function w(e){return"polyline"===e[0].type}function b(e,t,r){if(t){const t=function(e,t){if(!(e instanceof c.A||e instanceof a.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new o.A("internal:geometry",e)}const r=(0,u.r8)(e),i=[];for(const e of r){const r=[];i.push(r),r.push([e[0][0],e[0][1]]);for(let i=0;i<e.length-1;i++){const n=e[i][0],o=e[i][1],s=e[i+1][0],a=e[i+1][1],c=Math.sqrt((s-n)*(s-n)+(a-o)*(a-o)),l=(a-o)/c,u=(s-n)/c,h=c/t;if(h>1){for(let e=1;e<=h-1;e++){const i=e*t,s=u*i+n,a=l*i+o;r.push([s,a])}const e=(c+Math.floor(h-1)*t)/2,i=u*e+n,s=l*e+o;r.push([i,s])}r.push([s,a])}}return function(e){return"polygon"===e.type}(e)?new a.A({rings:i,spatialReference:e.spatialReference}):new c.A({paths:i,spatialReference:e.spatialReference})}(e,1e6);e=(0,d.ci)(t,!0)}return r&&(e=(0,u.kS)(e,r)),e}function T(e,t,r){if(Array.isArray(e)){const i=e[0];if(i>t){const r=(0,u.kd)(i,t);e[0]=i+r*(-2*t)}else if(i<r){const t=(0,u.kd)(i,r);e[0]=i+t*(-2*r)}}else{const i=e.x;if(i>t){const r=(0,u.kd)(i,t);e=e.clone().offset(r*(-2*t),0)}else if(i<r){const t=(0,u.kd)(i,r);e=e.clone().offset(t*(-2*r),0)}}return e}function M(e,t){let r=-1;for(let i=0;i<t.cutIndexes.length;i++){const n=t.cutIndexes[i],o=t.geometries[i],s=(0,u.r8)(o);for(let e=0;e<s.length;e++){const t=s[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const i=t[e][0];r=i>r?i:r}r=Number(r.toFixed(9));const i=-360*(0,u.kd)(r,180);for(let r=0;r<t.length;r++){const t=o.getPoint(e,r);o.setPoint(e,r,t.clone().offset(i,0))}return!0}})}if(n===r){if(y(e))for(const t of(0,u.r8)(o))e[n]=e[n].addRing(t);else if(w(e))for(const t of(0,u.r8)(o))e[n]=e[n].addPath(t)}else r=n,e[n]=o}return e}async function S(e,t,r){if(!Array.isArray(e))return S([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const n="string"==typeof t?t:t?.url??i.A.geometryServiceUrl;let o,s,l,y,w,C,E,A,R=0;const I=[],O=[];for(const t of e)if(null!=t)if(o||(o=t.spatialReference,s=(0,h.Vp)(o),l=o.isWebMercator,C=l?102100:4326,y=u.j7[C].maxX,w=u.j7[C].minX,E=u.j7[C].plus180Line,A=u.j7[C].minus180Line),s)if("mesh"===t.type)O.push(t);else if("point"===t.type)O.push(T(t.clone(),y,w));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>T(e,y,w)),O.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,s);O.push(e.rings?new a.A(e):e)}else if(t.extent){const e=t.extent,r=(0,u.kd)(e.xmin,w)*(2*y);let i=0===r?t.clone():(0,u.kS)(t.clone(),r);e.offset(r,0);let{xmin:n,xmax:o}=e;n=Number(n.toFixed(9)),o=Number(o.toFixed(9)),e.intersects(E)&&o!==y?(R=o>R?o:R,i=b(i,l),I.push(i),O.push("cut")):e.intersects(A)&&n!==w?(R=o*(2*y)>R?o*(2*y):R,i=b(i,l,360),I.push(i),O.push("cut")):O.push(i)}else O.push(t.clone());else O.push(t);else O.push(t);let F=(0,u.kd)(R,y),D=-90;const N=F,P=new c.A;for(;F>0;){const e=360*F-180;P.addPath([[e,D],[e,-1*D]]),D*=-1,F--}if(I.length>0&&N>0){const t=M(I,await async function(e,t,r,i){const n=(0,g.Dl)(e),o=t[0].spatialReference,s={...i,responseType:"json",query:{...n.query,f:"json",sr:(0,h.YX)(o),target:JSON.stringify({geometryType:(0,f.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},a=await(0,m.A)(n.path+"/cut",s),{cutIndexes:c,geometries:l=[]}=a.data;return{cutIndexes:c,geometries:l.map(e=>{const t=(0,p.rS)(e);return t.spatialReference=o,t})}}(n,I,P,r)),i=[],o=[];for(let r=0;r<O.length;r++){const n=O[r];if("cut"!==n)o.push(n);else{const n=t.shift(),s=e[r];null!=s&&"polygon"===s.type&&s.rings&&s.rings.length>1&&n.rings.length>=s.rings.length?(i.push(n),o.push("simplify")):o.push(l?(0,d.Gh)(n):n)}}if(!i.length)return o;const s=await async function(e,t,r){const i="string"==typeof e?(0,v.An)(e):e,n=t[0].spatialReference,o=(0,f.$B)(t[0]),s={...r,query:{...i.query,f:"json",sr:(0,h.YX)(n),geometries:JSON.stringify((0,_.X)(t))}},{data:a}=await(0,m.A)(i.path+"/simplify",s);return(0,_.V)(a.geometries,o,n)}(n,i,r),a=[];for(let e=0;e<o.length;e++){const t=o[e];"simplify"!==t?a.push(t):a.push(l?(0,d.Gh)(s.shift()):s.shift())}return a}const B=[];for(let e=0;e<O.length;e++){const t=O[e];if("cut"!==t)B.push(t);else{const e=I.shift();B.push(!0===l?(0,d.Gh)(e):e)}}return B}function C(e,t,r){const i=(0,h.Vp)(r);if(null==i)return e;const[n,o]=i.valid,s=2*o;let a=0,c=0;t>o?a=Math.ceil(Math.abs(t-o)/s):t<n&&(a=-Math.ceil(Math.abs(t-n)/s)),e>o?c=Math.ceil(Math.abs(e-o)/s):e<n&&(c=-Math.ceil(Math.abs(e-n)/s));let l=e+(a-c)*s;const u=l-t;return u>o?l-=s:u<n&&(l+=s),l}function E(e){const t=(0,h.Vp)(e);if(null==t)return null;const[r,i]=t.valid;return new n.hr(r,i)}const A=E(l.A.WGS84);E(l.A.WebMercator)},80754(e,t,r){r.d(t,{j7:()=>s,kS:()=>c,kd:()=>a,r8:()=>l});var i=r(82799),n=r(16930),o=r(60408);const s={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new i.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator}),minus180Line:new i.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:n.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new i.A({paths:[[[180,-180],[180,180]]],spatialReference:n.A.WGS84}),minus180Line:new i.A({paths:[[[-180,-180],[-180,180]]],spatialReference:n.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function c(e,t){const r=l(e);for(const e of r)for(const r of e)r[0]+=t;return e}function l(e){return(0,o.Bi)(e)?e.rings:e.paths}},71351(e,t,r){r.d(t,{C:()=>u,Cr:()=>h,LV:()=>l,fA:()=>d,oC:()=>m,vt:()=>a}),r(4576);var i=r(4341),n=(r(77690),r(29242)),o=r(35522),s=r(51850);function a(e){return e?c((0,s.o8)(e.origin),(0,s.o8)(e.direction)):c((0,s.vt)(),(0,s.vt)())}function c(e,t){return{origin:e,direction:t}}function l(e,t){const r=f.get();return r.origin=e,r.direction=t,r}function u(e,t=a()){return d(e.origin,e.direction,t)}function h(e,t,r=a()){return(0,o.C)(r.origin,e),(0,o.Re)(r.direction,t,e),r}function d(e,t,r=a()){return(0,o.C)(r.origin,e),(0,o.C)(r.direction,t),r}function m(e,t,r){const i=(0,o.Om)(e.direction,(0,o.Re)(r,t,e.origin));return(0,o.WQ)(r,e.origin,(0,o.hs)(r,e.direction,i)),r}r(32114);const f=new i.I(()=>a());(0,s.vt)(),(0,s.vt)(),(0,s.vt)(),(0,n.vt)()},94008(e,t,r){r.d(t,{iy:()=>m}),r(44208),r(53966);var i=r(34727),n=r(34304),o=r(58083),s=r(35522),a=r(51850),c=r(91829),l=r(34275);var u=r(71351),h=r(44280),d=r(32114);class m{constructor(e=0,t=0,r=0,i=0){this.radius=i,"number"==typeof e?this._center=(0,a.fA)(e,t,r):function(e){return t=e,(0,l.vZ)(t)&&t.length>=3||function(e){return((0,l.aI)(e)||Array.isArray(e))&&e.length>=3}(e);var t}(e)||function(e){return(t=e)instanceof Float32Array&&t.length>=4||function(e){return Array.isArray(e)&&e.length>=4}(e);var t}(e)?(this._center=(0,a.ci)(e),this.radius=4===e.length?e[3]:t):(this._center=(0,a.o8)(e.center),this.radius=e.radius)}get isValid(){return this.radius>=0}invalidate(){this.radius=-1}get center(){return this._center}set center(e){(0,s.C)(this.center,e)}exactEquals(e){return(0,s.aI)(this._center,e.center)&&this.radius===e.radius}copyFrom(e){return e!==this&&((0,s.C)(this._center,e.center),this.radius=e.radius),this}clone(){return new m(this.center,this.radius)}toVec4(){return(0,c.fA)(this.center[0],this.center[1],this.center[2],this.radius)}contains(e){return(0,s.hG)(this.center,e)<=this.radius**2}intersectRay(e,t){if(null==e)return!1;if(!this._intersect(e,f))return!1;let{t0:r,t1:i}=f;if((r<0||i<r&&i>0)&&(r=i),r<0)return!1;if(t){const{origin:i,direction:n}=e;t[0]=i[0]+n[0]*r,t[1]=i[1]+n[1]*r,t[2]=i[2]+n[2]*r}return!0}intersectLine(e,t){const r=(0,u.Cr)(e,t);if(!this._intersect(r,f))return[];const{origin:i,direction:o}=r,{t0:c,t1:l}=f,h=e=>{const t=(0,a.vt)();return(0,s.Ln)(t,i,o,e),this.projectPoint(t,t)};return Math.abs(c-l)<(0,n.FD)()?[h(c)]:[h(c),h(l)]}_intersect(e,t){const{origin:r,direction:i}=e,n=p;n[0]=r[0]-this.center[0],n[1]=r[1]-this.center[1],n[2]=r[2]-this.center[2];const o=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(0===o)return!1;const s=2*(i[0]*n[0]+i[1]*n[1]+i[2]*n[2]),a=s*s-4*o*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-this.radius**2);if(a<0)return!1;const c=Math.sqrt(a);return t.t0=(-s-c)/(2*o),t.t1=(-s+c)/(2*o),!0}projectPoint(e,t){const r=(0,s.Re)(d.rq.get(),e,this.center),i=(0,s.hs)(d.rq.get(),r,this.radius/(0,s.Bw)(r));return(0,s.WQ)(t,i,this.center)}closestPointOnSilhouette(e,t){const r=d.rq.get(),i=d.Rc.get();(0,s.$A)(r,e.origin,e.direction),(0,s.$A)(t,r,e.origin),(0,s.hs)(t,t,1/(0,s.Bw)(t)*this.radius);const n=this._angleToSilhouette(e.origin),a=(0,h.g7)(e.origin,t);return(0,o.$0)(i,a+n,r),(0,s.Z0)(t,t,i),t}frustumCoverage(e,t,r){const i=this.radius,n=i*i,o=e+.5*Math.PI,s=t*t+n-2*Math.cos(o)*t*i,a=Math.sqrt(s),c=s-n;if(c<=0)return.5;const l=Math.sqrt(c),u=Math.acos(l/a)-Math.asin(i/(a/Math.sin(o)));return Math.min(1,(u+.5*r)/r)}_angleToSilhouette(e){const t=(0,s.Re)(d.rq.get(),e,this.center),r=(0,s.Bw)(t),n=this.radius,o=n+Math.abs(n-r);return(0,i.XM)(n/o)}union(e){const t=(0,s.Io)(this._center,e.center),r=this.radius,i=e.radius;return t+i<r?this:t+r<i?(this.copyFrom(e),this):((0,s.Cc)(this._center,this._center,e.center,(t+i-r)/(2*t)),this.radius=(t+r+i)/2,this)}toJSON(){return{center:this.center,radius:this.radius}}}new m;const f={t0:0,t1:0},p=(0,a.vt)();(0,a.vt)(),(0,a.vt)()},38969(e,t,r){r.d(t,{i:()=>n});var i=r(37955);function n(e,t){return new Promise((r,n)=>{e.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?r():(t((0,i.Oo)(e,"canplay",r)),t((0,i.Oo)(e,"error",n)))})}},92300(e,t,r){r.d(t,{V:()=>s,X:()=>o});var i=r(60408),n=r(65864);function o(e){return{geometryType:(0,i.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function s(e,t,r){const i=(0,n.xD)(t);return e.map(e=>{const t=i.fromJSON(e);return t.spatialReference=r,t})}},21015(e,t,r){r.d(t,{R:()=>c});var i=r(11254),n=r(60999),o=r(49186),s=r(17676),a=r(84952);class c{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,a.DB)(e)?((0,s.Te)(t),(0,a.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const a=await(0,n.Ke)((0,i.A)(t,{responseType:e,...r}));if(a.ok)return a.value.data;throw(0,s.QP)(a.error),new o.A("gltf-loader-request-error",`Request for resource failed: ${a.error}`)}}},84498(e,t,r){r.d(t,{x:()=>s});var i=r(34275),n=r(97146),o=r(63907);function s(e,t){switch(t){case o.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,n.tM)(e):(0,i.mg)(e)?new Uint16Array(e):e}(e);case o.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,i=(0,n.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(i[e++]=t,i[e++]=t+1,i[e++]=t+2):(i[e++]=t+1,i[e++]=t,i[e++]=t+2)}else{let t=0;for(let n=0;n<r;n+=1)n%2==0?(i[t++]=e[n],i[t++]=e[n+1],i[t++]=e[n+2]):(i[t++]=e[n+1],i[t++]=e[n],i[t++]=e[n+2])}return i}(e);case o.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,i=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)i[e++]=0,i[e++]=t+1,i[e++]=t+2;return i}const n=e[0];let o=e[1],s=0;for(let t=0;t<r;++t){const r=e[t+2];i[s++]=n,i[s++]=o,i[s++]=r,o=r}return i}(e)}}},51530(e,t,r){r.d(t,{KB:()=>s,Xi:()=>n,pn:()=>a,x3:()=>o});var i=r(44208);class n{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function o(e){return"encoded-mesh-texture"===e?.type}async function s(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function a(e,t){if("image/ktx2"===t)return new n(e);const r=new Blob([e],{type:t});let o=URL.createObjectURL(r);switch(t){case"image/jpeg":o+="#.jpg";break;case"image/png":o+="#.png"}const s=new Image;if((0,i.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{n(),e(s)},i=e=>{n(),t(e)},n=()=>{URL.revokeObjectURL(o),s.removeEventListener("load",r),s.removeEventListener("error",i)};s.addEventListener("load",r),s.addEventListener("error",i),s.src=o});try{s.src=o,await s.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(o),s}},23341(e,t,r){r.d(t,{fetch:()=>br});var i=r(40876),n=r(61473),o=r(34727),s=r(77690),a=r(29242),c=r(58083),l=r(9093),u=r(48163),h=r(35522),d=r(51850),m=r(70328),f=r(34275);function p(e,t=!1){return e<=f.y9?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}var g=r(13030),v=r(73354),_=r(50867),x=r(43609),y=r(21015),w=r(84498),b=r(51530),T=r(88340);function M(e){if(null==e)return null;const t=null!=e.offset?e.offset:T.uY,r=null!=e.rotation?e.rotation:0,i=null!=e.scale?e.scale:T.Un,n=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),o=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),c=(0,a.fA)(i[0],0,0,0,i[1],0,0,0,1),l=(0,a.vt)();return(0,s.lw)(l,o,c),(0,s.lw)(l,n,l),l}class S{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class C{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new S,this.numberOfVertices=0}}var E=r(11254),A=r(60999),R=r(49186),I=r(53966),O=r(69397);class F{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const i=this._outer.get(e);i?i.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,i]of t)yield[e,r,i]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,i)=>e(t,r,i)))}copy(){const e=new F;return this.forAll((t,r,i)=>e.set(r,i,t)),e}}var D=r(17676),N=r(46140),P=r(97146);async function B(e,t){return(await(0,E.A)(e,{responseType:"image",...t})).data}var H=r(46610),L=r(20498);function z(e){if(e.length<f.y9)return Array.from(e);if(Array.isArray(e))return Float64Array.from(e);if(!("BYTES_PER_ELEMENT"in e))return Array.from(e);switch(e.BYTES_PER_ELEMENT){case 1:return Uint8Array.from(e);case 2:return(0,f.LW)(e)?(0,L.pX)().from(e):(0,f.jq)(e)?Uint16Array.from(e):Int16Array.from(e);case 4:return Float32Array.from(e);default:return Float64Array.from(e)}}var U=r(15142),G=r(620);class V{get center(){return(0,d.fA)(this._data[0],this._data[1],this._data[2])}get radius(){return this._data[3]}get bbMin(){return(0,d.fA)(this._data[4],this._data[5],this._data[6])}get bbMax(){return(0,d.fA)(this._data[7],this._data[8],this._data[9])}constructor(e,t,r){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.position=r,this._data=[.1,0,0,0,0,0,0,0,0,0],this._children=void 0,(0,G.vA)(e.length>=1),(0,G.vA)(3===r.size||4===r.size);const{data:i,size:n,indices:o}=r;(0,G.vA)(o.length%this._numIndexPerPrimitive===0),(0,G.vA)(o.length>=e.length*this._numIndexPerPrimitive);const s=e.length;let a=n*o[this._numIndexPerPrimitive*e[0]];j.clear(),j.push(a);const c=(0,d.fA)(i[a],i[a+1],i[a+2]),l=(0,d.o8)(c);for(let t=0;t<s;++t){const r=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){a=n*o[r+e],j.push(a);let t=i[a];c[0]=Math.min(t,c[0]),l[0]=Math.max(t,l[0]),t=i[a+1],c[1]=Math.min(t,c[1]),l[1]=Math.max(t,l[1]),t=i[a+2],c[2]=Math.min(t,c[2]),l[2]=Math.max(t,l[2])}}for(let e=0;e<3;++e)this._data[4+e]=c[e],this._data[7+e]=l[e];const u=(0,h.Cc)((0,d.vt)(),this.bbMin,this.bbMax,.5);let m=.5*Math.max(Math.max(l[0]-c[0],l[1]-c[1]),l[2]-c[2]),f=m*m;for(let e=0;e<j.length;++e){a=j.at(e);const t=i[a]-u[0],r=i[a+1]-u[1],n=i[a+2]-u[2],o=t*t+r*r+n*n;if(o<=f)continue;const s=Math.sqrt(o),c=.5*(s-m);m+=c,f=m*m;const l=c/s;u[0]+=t*l,u[1]+=r*l,u[2]+=n*l}this._data[3]=m;for(let e=0;e<3;++e)this._data[0+e]=u[e];j.clear()}getChildren(){if(this._children||(0,h.hG)(this.bbMin,this.bbMax)<=1)return this._children;const e=(0,h.Cc)((0,d.vt)(),this.bbMin,this.bbMax,.5),t=this.primitiveIndices.length,r=new Uint8Array(t),i=new Array(8);for(let e=0;e<8;++e)i[e]=0;const{data:n,size:o,indices:s}=this.position;for(let a=0;a<t;++a){let t=0;const c=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=o*s[c],u=n[l],h=n[l+1],d=n[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=o*s[c+e];const t=n[l],r=n[l+1],i=n[l+2];t<u&&(u=t),r<h&&(h=r),i<d&&(d=i)}u<e[0]&&(t|=1),h<e[1]&&(t|=2),d<e[2]&&(t|=4),r[a]=t,++i[t]}let a=0;for(let e=0;e<8;++e)i[e]>0&&++a;if(a<2)return;const c=new Array(8);for(let e=0;e<8;++e)c[e]=i[e]>0?new Uint32Array(i[e]):void 0;for(let e=0;e<8;++e)i[e]=0;for(let e=0;e<t;++e){const t=r[e];c[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array;for(let e=0;e<8;++e)void 0!==c[e]&&this._children.push(new V(c[e],this._numIndexPerPrimitive,this.position));return this._children}static prune(){j.prune()}}const j=new U.A({deallocator:null});var k=r(24326);class W{constructor(e){this.id=(0,k.c)(),this._attributes=new Map;for(const[t,r]of e)this._attributes.set(t,{...r,indices:(0,P.Dg)(r.indices)})}get attributes(){return this._attributes}}var $=r(4341),Z=r(11964);function q(e,t,r){return(0,h.Re)(Y,t,e),(0,h.Re)(X,r,e),.5*(0,h.Bw)((0,h.$A)(Y,Y,X))}r(32114),new $.I(Z.vt),new $.I(()=>{return e?{p0:(0,d.o8)(e.p0),p1:(0,d.o8)(e.p1),p2:(0,d.o8)(e.p2)}:{p0:(0,d.vt)(),p1:(0,d.vt)(),p2:(0,d.vt)()};var e});const Y=(0,d.vt)(),X=(0,d.vt)(),J=(0,d.vt)(),K=(0,d.vt)(),Q=(0,d.vt)(),ee=(0,d.vt)();class te{constructor(){this.uid=(0,k.c)()}}class re extends te{constructor(e){super(),this.highlightName=e,this.channel=0}}var ie=r(94656);class ne extends W{constructor(e,t,r=null,i=0,n=null,o=-1,s,a){super(t),this.material=e,this.mapPositions=r,this.type=i,this.olidColor=n,this.edgeIndicesLength=o,this.baseGeometry=s,this.drawIndices=a,this._vertexPositionIndicesCache=void 0,this._highlights=null,this._highlightOptionsCounts=null,this.visible=!0,this._boundingInfo=null,(0,G.vA)((e?.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(e={}){const t=new ne(e.material||this.material,[],this.mapPositions,this.type,this.olidColor,this.edgeIndicesLength,this.baseGeometry,this.drawIndices);return this._attributes.forEach((e,r)=>{e.exclusive=!1,t._attributes.set(r,e)}),t._boundingInfo=this._boundingInfo,t.transformation=e.transformation||this.transformation,t}getMutableAttribute(e){let t=this._attributes.get(e);return t&&!t.exclusive&&(t={...t,exclusive:!0,data:z(t.data)},this._attributes.set(e,t)),t}setAttributeData(e,t){const r=this._attributes.get(e);r?this._attributes.set(e,{...r,exclusive:!0,data:t}):(0,ie.en)()&&console.warn(`Setting undefined attribute ${e} data`)}get primitivePositionIndices(){if(void 0!==this._vertexPositionIndicesCache)return this._vertexPositionIndicesCache;const{drawIndices:e}=this,t=this.positionAttribute;if(null!=e&&null!=t){const r=new Array;for(const i of e)r.push(t.indices[i]);this._vertexPositionIndicesCache=r}else this._vertexPositionIndicesCache=t?.indices??null;return this._vertexPositionIndicesCache}get positionAttribute(){return this.attributes.get("position")??this.baseGeometry?.attributes.get("position")}get indexCount(){const e=this.drawIndices??this.positionAttribute?.indices;return e?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo??=this._calculateBoundingInfo(),this._boundingInfo}computeAttachmentOrigin(e){return!!(0===this.type?this._computeAttachmentOriginTriangles(e):2===this.type?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(null!=this._transformation&&(0,h.Z0)(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){return function(e,t,r=t?.indices){if(!t||!r)return!1;const{size:i,data:n}=t;(0,h.hZ)(e,0,0,0),(0,h.hZ)(ee,0,0,0);let o=0,s=0;for(let t=0;t<r.length-2;t+=3){const a=r[t]*i,c=r[t+1]*i,l=r[t+2]*i;(0,h.hZ)(J,n[a],n[a+1],n[a+2]),(0,h.hZ)(K,n[c],n[c+1],n[c+2]),(0,h.hZ)(Q,n[l],n[l+1],n[l+2]);const u=q(J,K,Q);u?((0,h.WQ)(J,J,K),(0,h.WQ)(J,J,Q),(0,h.hs)(J,J,1/3*u),(0,h.WQ)(e,e,J),o+=u):((0,h.WQ)(ee,ee,J),(0,h.WQ)(ee,ee,K),(0,h.WQ)(ee,ee,Q),s+=3)}return!(0===s&&0===o||(0!==o?((0,h.hs)(e,e,1/o),0):0===s||((0,h.hs)(e,ee,1/s),0)))}(e,this.positionAttribute,this.primitivePositionIndices)}_computeAttachmentOriginLines(e){const t=this.positionAttribute,r=this.primitivePositionIndices;return function(e,t,r,i=t?.indices){if(!t||!i)return!1;(0,h.hZ)(e,0,0,0),(0,h.hZ)(ee,0,0,0);let n=0,o=0;const{size:s,data:a}=t,c=i.length-1,l=c+(r?2:0);for(let t=0;t<l;t+=2){const r=t<c?t+1:0,l=i[t<c?t:c]*s,u=i[r]*s;J[0]=a[l],J[1]=a[l+1],J[2]=a[l+2],K[0]=a[u],K[1]=a[u+1],K[2]=a[u+2],(0,h.hs)(J,(0,h.WQ)(J,J,K),.5);const d=(0,h.xg)(J,K);d>0?((0,h.WQ)(e,e,(0,h.hs)(J,J,d)),n+=d):0===n&&((0,h.WQ)(ee,ee,J),o++)}return 0!==n?((0,h.hs)(e,e,1/n),!0):0!==o&&((0,h.hs)(e,ee,1/o),!0)}(e,t,function(e,t){return!(!("isClosed"in e)||!e.isClosed)&&t.indices.length>2}(this.material.parameters,t),r)}_computeAttachmentOriginPoints(e){return function(e,t,r=t?.indices){if(!t||!r)return!1;const{size:i,data:n}=t;(0,h.hZ)(e,0,0,0);let o=-1,s=0;for(let t=0;t<r.length;t++){const a=r[t]*i;o!==a&&(e[0]+=n[a],e[1]+=n[a+1],e[2]+=n[a+2],s++),o=a}return s>1&&(0,h.hs)(e,e,1/s),s>0}(e,this.positionAttribute,this.primitivePositionIndices)}invalidateBoundingInfo(){this._boundingInfo=null,this._vertexPositionIndicesCache=void 0}_calculateBoundingInfo(){const e=this.positionAttribute,t=this.primitivePositionIndices;if(!e||!t||0===t.length)return null;const r=t===e.indices?e:new H.n(e.data,t,e.size,!1,e.stride),i=0===this.type?3:1;(0,G.vA)(t.length%i===0,"Indexing error: "+t.length+" not divisible by "+i);const n=(0,P.tM)(t.length/i);return new V(n,i,r)}get transformation(){return this._transformation??l.zK}set transformation(e){this._transformation=e&&e!==l.zK?(0,l.o8)(e):null}get highlights(){return this._highlights||oe}get hasHighlights(){return(this._highlightOptionsCounts?.size??0)>0}foreachHighlightOptions(e){this._highlightOptionsCounts?.forEach((t,r)=>e(r))}allocateIdAndHighlight(e){const t=new re(e);return this.addHighlight(t)}addHighlight(e){this._ensureHighlights().add(e);const{highlightName:t}=e,r=(this._highlightOptionsCounts?.get(t)??0)+1;return this._ensureHighlightOptionsCounts().set(t,r),e}_ensureHighlights(){let e=this._highlights;return e||(e=new Set,this._highlights=e),e}_ensureHighlightOptionsCounts(){let e=this._highlightOptionsCounts;return e||(e=new Map,this._highlightOptionsCounts=e),e}removeHighlight(e){if(this._highlights?.delete(e)){const{highlightName:t}=e,r=this._highlightOptionsCounts?.get(t)??0;r<=1?this._highlightOptionsCounts?.delete(t):this._ensureHighlightOptionsCounts().set(t,r-1)}}}const oe=new Set;var se=r(65529),ae=r(97768),ce=r(84952),le=r(38969),ue=r(95117),he=r(2741);let de;var me=r(63907),fe=r(76284),pe=r(42293);let ge=null,ve=null;async function _e(){return null==ve&&(de??=(async()=>{const e=await r.e(9321).then(r.bind(r,49321)),t=await e.default({locateFile:e=>(0,he.s)(`esri/libs/basisu/${e}`)});return t.initializeBasis(),t})(),ve=de,ge=await ve),ve}function xe(e,t,r,i,n){const o=(0,pe.MW)(t?me.CQ.COMPRESSED_RGBA8_ETC2_EAC:me.CQ.COMPRESSED_RGB8_ETC2),s=n&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*o*s)}function ye(e){return e.getNumImages()>=1&&!e.isUASTC()}function we(e){return e.getFaces()>=1&&(e.isETC1S()||e.isUASTC())}function be(e,t,r,i,n,o,s,a){const{compressedTextureETC:c,compressedTextureS3TC:l}=e.capabilities,[u,h]=c?i?[1,me.CQ.COMPRESSED_RGBA8_ETC2_EAC]:[0,me.CQ.COMPRESSED_RGB8_ETC2]:l?i?[3,me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[2,me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT]:[13,6408],d=t.hasMipmap?r:Math.min(1,r),m=[];for(let e=0;e<d;e++)m.push(new Uint8Array(s(e,u))),a(e,u,m[e]);return t.internalFormat=h,t.hasMipmap=m.length>1,t.samplingMode=t.hasMipmap?9987:9729,t.width=n,t.height=o,new fe.A(e,t,{type:"compressed",levels:m})}const Te=()=>I.A.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function Me(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const Se=Me("DXT1"),Ce=Me("DXT3"),Ee=Me("DXT5");function Ae(e,t){return t=16*Math.floor(t/16),Math.min(16*Math.round(e/16),t)}function Re(e,t){const[r,i]=function({width:e,height:t},{maxPreferredTexturePixels:r,maxTextureSize:i}){const n=Math.max(e,t),o=e*t;if(n<=i&&o<=r)return[e,t];const s=Math.min(Math.sqrt(r/o),i/n);return[Ae(Math.round(e*s),i),Ae(Math.round(t*s),i)]}(e,t);return e.width===r&&e.height===i?e:Ie(e,r,i)}function Ie(e,t,r){if(e instanceof ImageData)return Ie(function(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(null==r)throw new R.A("texture:context-failed","Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}var Oe=r(67171);class Fe{constructor(e,t){this._data=e,this.id=(0,k.c)(),this.events=new se.bk,this._parameters={...Ne,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.update=void 0}_startPreload(e){e instanceof HTMLVideoElement?(this.update=t=>this._update(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e)}_startPreloadVideoElement(e){if(!((0,ce.w8)(e.src)||"auto"===e.preload&&e.crossOrigin)&&(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src,e.paused&&e.autoplay)){const t=[];(0,le.i)(e,e=>t.push(e)).then(()=>{e.play()}).finally(()=>t.forEach(e=>e.remove()))}}_startPreloadImageElement(e){(0,ce.DB)(e.src)||(0,ce.w8)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new Oe.R;return t.wrapMode=this._parameters.wrap??10497,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?9987:9729,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t.dataType=this._parameters.dataType??t.dataType,t.pixelFormat=this._parameters.pixelFormat??t.pixelFormat,t.internalFormat=this._parameters.internalFormat??t.internalFormat,t}get texture(){return this._texture??this._emptyTexture}get loaded(){return null!=this._texture}get usedMemory(){return this._texture?.usedMemory||function(e,t){if(null==e)return 0;if((0,f.mw)(e)||(0,f.mg)(e))return"image/ktx2"===t.encoding?function(e,t){if(null==ge)return e.byteLength;const r=new ge.KTX2File(new Uint8Array(e)),i=we(r)?xe(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):"image/x.basis"===t.encoding?function(e,t){if(null==ge)return e.byteLength;const r=new ge.BasisFile(new Uint8Array(e)),i=ye(r)?xe(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?De(e):t,n=t.pixelFormat??6408,o=(0,pe.wH)(n);return(t.mipmap?4/3:1)*r*i*o||0}(this._data,this._parameters)}load(e){if(this._loadingPromise)return this._loadingPromise;if(this._texture)return this._texture;const t=this._data;return null==t?(this._texture=new fe.A(e,this._createDescriptor(e),null),this._texture):(this._emptyTexture=e.emptyTexture,this._parameters.reloadable||(this._data=void 0),"string"==typeof t?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):(0,f.mg)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,t):(0,f.mw)(t)&&"image/vnd-ms.dds"===this._parameters.encoding?this._loadFromDDSData(e,new Uint8Array(t)):((0,f.mw)(t)||(0,f.mg)(t))&&"image/ktx2"===this._parameters.encoding?this._loadFromKTX2(e,t):((0,f.mw)(t)||(0,f.mg)(t))&&"image/x.basis"===this._parameters.encoding?this._loadFromBasis(e,t):(0,f.mw)(t)?this._loadFromPixelData(e,new Uint8Array(t)):(0,f.iu)(t)?this._loadFromPixelData(e,t):null)}_update(e,t){return null==this._texture||e.readyState<HTMLMediaElement.HAVE_CURRENT_DATA||t===e.currentTime?t:(this._texture.setData(e),this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._parameters.updateCallback&&this._parameters.updateCallback(),e.currentTime)}_loadFromDDSData(e,t){return this._texture=function(e,t,r){const i=function(e,t){const r=new Int32Array(e.buffer,e.byteOffset,31);if(542327876!==r[0])return Te().error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return Te().error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let n,o;switch(i){case Se:n=8,o=me.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case Ce:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case Ee:n=16,o=me.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Te().error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let s=1,a=r[4],c=r[3];(3&a||3&c)&&(Te().warn("Rounding up compressed texture size to nearest multiple of 4."),a=a+3&-4,c=c+3&-4);const l=a,u=c;let h,d;131072&r[2]&&!1!==t&&(s=Math.max(1,r[7]));let m=e.byteOffset+r[1]+4;const f=[];for(let t=0;t<s;++t)d=(a+3>>2)*(c+3>>2)*n,h=new Uint8Array(e.buffer,m,d),f.push(h),m+=d,a=Math.max(1,a>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:f},internalFormat:o,width:l,height:u}}(r,t.hasMipmap??!1);if(null==i)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:o,width:s,height:a}=i;return t.samplingMode=n.levels.length>1?9987:9729,t.hasMipmap=n.levels.length>1,t.internalFormat=o,t.width=s,t.height=a,new fe.A(e,t,n)}(e,this._createDescriptor(e),t),this._emptyTexture=null,this._texture}_loadFromKTX2(e,t){return this._loadAsync(()=>async function(e,t,r){null==ge&&(ge=await _e());const i=new ge.KTX2File(new Uint8Array(r));if(!we(i))return null;i.startTranscoding();const n=be(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(e,t)=>i.getImageTranscodedSizeInBytes(e,0,0,t),(e,t,r)=>i.transcodeImage(r,e,0,0,t,0,-1,-1));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromBasis(e,t){return this._loadAsync(()=>async function(e,t,r){null==ge&&(ge=await _e());const i=new ge.BasisFile(new Uint8Array(r));if(!ye(i))return null;i.startTranscoding();const n=be(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(e,t)=>i.getImageTranscodedSizeInBytes(0,e,t),(e,t,r)=>i.transcodeImage(r,0,e,t,0,0));return i.close(),i.delete(),n}(e,this._createDescriptor(e),t).then(e=>(this._texture=e,e)))}_loadFromPixelData(e,t){(0,G.vA)(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return 6407!==r.pixelFormat&&6408!==r.pixelFormat||(r.compress=this._parameters.compressionOptions),r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._texture=new fe.A(e,r,t),this._texture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await B(t,{signal:r});return(0,D.Te)(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await(0,ue.y)(t,t.src,!1,r);return(0,D.Te)(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,n)=>{const o=()=>{t.removeEventListener("loadeddata",s),t.removeEventListener("error",a),(0,ae.xt)(c)},s=()=>{t.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA&&(o(),i(this._loadFromImage(e,t)))},a=e=>{o(),n(e||new R.A("texture:load-error","Failed to load video"))};t.addEventListener("loadeddata",s),t.addEventListener("error",a);const c=(0,D.u7)(r,()=>a((0,D.NK)()))}))}_loadFromImage(e,t){let r=t;r instanceof HTMLVideoElement||(r=Re(r,e.parameters));const i=De(r);this._parameters.width=i.width,this._parameters.height=i.height;const n=this._createDescriptor(e);return n.width=i.width,n.height=i.height,n.compress=this._parameters.compressionOptions,this._texture=new fe.A(e,n,r),this._emptyTexture=null,this.events.emit("loaded"),this._texture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null),this._emptyTexture=null};return r.then(i,i),r}unload(){if(this._texture=(0,ae.WD)(this._texture),this._emptyTexture=null,null!=this._loadingController){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}get parameters(){return this._parameters}}function De(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}const Ne={wrap:{s:10497,t:10497},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1};var Pe=r(49255);class Be{constructor(e){this._material=e.material,this._techniques=e.techniques,this._output=e.output}dispose(){}get _stippleTextures(){return this._techniques.context?.stippleTextures}get _markerTextures(){return this._techniques.context?.markerTextures}getTechnique(e,t){return this._techniques.get(e,this._material.getConfiguration(this._output,t))}ensureResources(e){return 2}}var He=r(65786);class Le extends Be{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textures=e.textures,this.updateTexture(e.textureId),this._acquire(e.normalTextureId,e=>this._textureNormal=e),this._acquire(e.emissiveTextureId,e=>this._textureEmissive=e),this._acquire(e.occlusionTextureId,e=>this._textureOcclusion=e),this._acquire(e.metallicRoughnessTextureId,e=>this._textureMetallicRoughness=e)}dispose(){super.dispose(),this._texture=(0,ae.Gz)(this._texture),this._textureNormal=(0,ae.Gz)(this._textureNormal),this._textureEmissive=(0,ae.Gz)(this._textureEmissive),this._textureOcclusion=(0,ae.Gz)(this._textureOcclusion),this._textureMetallicRoughness=(0,ae.Gz)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?2:1}get textureBindParameters(){return new Ue(this._texture?.texture??null,this._textureNormal?.texture??null,this._textureEmissive?.texture??null,this._textureOcclusion?.texture??null,this._textureMetallicRoughness?.texture??null)}updateTexture(e){null!=this._texture&&e===this._texture.id||(this._texture=(0,ae.Gz)(this._texture),this._acquire(e,e=>this._texture=e))}_acquire(e,t){if(null==e)return void t(null);const r=this._textures.acquire(e);if((0,D.$X)(r))return++this._numLoading,void r.then(e=>{if(this._disposed)return(0,ae.Gz)(e),void t(null);t(e)}).finally(()=>--this._numLoading);t(r)}}class ze extends He.Y{constructor(e=null){super(),this.textureEmissive=e}}class Ue extends ze{constructor(e,t,r,i,n,o,s){super(r),this.texture=e,this.textureNormal=t,this.textureOcclusion=i,this.textureMetallicRoughness=n,this.scale=o,this.normalTextureTransformMatrix=s}}var Ge=r(5482),Ve=r(68317),je=r(51976);class ke extends Ve.Hz{constructor(){super(...arguments),this.oitPass=0,this.hasHighlightMixTexture=!1,this.hasFloatOit=!0,this.bindType=1,this.instanced=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1}}(0,Ge.Cg)([(0,je.W)({count:3})],ke.prototype,"oitPass",void 0),(0,Ge.Cg)([(0,je.W)()],ke.prototype,"hasHighlightMixTexture",void 0),(0,Ge.Cg)([(0,je.W)()],ke.prototype,"hasFloatOit",void 0);var We=r(19245);class $e{constructor(e,t){this.id=(0,k.c)(),this.supportsEdges=!1,this._renderPriority=0,this._parameters=new t,(0,We.MB)(this._parameters,e),this.validateParameters(this._parameters)}get useIndexing(){return this.parameters.useIndexing??!1}get parameters(){return this._parameters}update(e){return!1}setParameters(e,t=!0){(0,We.MB)(this._parameters,e)&&(this.validateParameters(this._parameters),t&&this._parametersChanged())}validateParameters(e){}shouldRender(e){return this.visible&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bind.decorations)&&0!==(this.parameters.renderOccluded&e.renderOccludedMask)}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this._parametersChanged())}_parametersChanged(){this.repository?.materialChanged(this)}get renderOccludedFlags(){return this.visible?this.parameters.renderOccluded:0}get testsTransparentRenderOrder(){return this.parameters.testsTransparentRenderOrder}get hasEmissions(){return!1}getConfiguration(e,t,r=new ke){return r.output=e,r.hasEmission=t.hasEmission&&(0,Pe._o)(e),r.oitPass=t.oitPass,r.hasHighlightMixTexture=8===e&&null!=t.highlightMixTexture,r.hasFloatOit=t.hasFloatOit,r}}He.Y;class Ze{constructor(e=0,t=!1,r=!0){this.tolerance=e,this.isVerticalRay=t,this.normalRequired=r}}const qe=(0,m.vt)();function Ye(e,t,r,i,n,o){if(!e.visible)return;const s=(0,h.jb)(ct,i,r),a=(e,t,r)=>o(e,r,t),{tolerance:c}=t,l=new Ze(c,!1,t.options.normalRequired);if(e.boundingInfo)(0,G.vA)(0===e.type),Je(e.boundingInfo,r,s,c,n,l,a);else{const t=e.positionAttribute,i=e.primitivePositionIndices;!function(e,t,r,i,n,o,s,a,c,l){const u=t,d=lt,m=Math.abs(u[0]),f=Math.abs(u[1]),p=Math.abs(u[2]),g=m>=f?m>=p?0:2:f>=p?1:2,v=g,_=u[v]<0?2:1,x=(g+_)%3,y=(g+(3-_))%3,w=u[x]/u[v],b=u[y]/u[v],T=1/u[v],M=Qe,S=et,C=tt,{normalRequired:E}=c;for(let t=r;t<i;++t){const r=3*t,i=s*n[r];(0,h.hZ)(d[0],o[i+0],o[i+1],o[i+2]);const c=s*n[r+1];(0,h.hZ)(d[1],o[c+0],o[c+1],o[c+2]);const u=s*n[r+2];(0,h.hZ)(d[2],o[u+0],o[u+1],o[u+2]),a&&((0,h.C)(d[0],a.applyToVertex(d[0][0],d[0][1],d[0][2],t)),(0,h.C)(d[1],a.applyToVertex(d[1][0],d[1][1],d[1][2],t)),(0,h.C)(d[2],a.applyToVertex(d[2][0],d[2][1],d[2][2],t))),(0,h.jb)(M,d[0],e),(0,h.jb)(S,d[1],e),(0,h.jb)(C,d[2],e);const m=M[x]-w*M[v],f=M[y]-b*M[v],p=S[x]-w*S[v],g=S[y]-b*S[v],_=C[x]-w*C[v],A=C[y]-b*C[v],R=_*g-A*p,I=m*A-f*_,O=p*f-g*m;if((R<0||I<0||O<0)&&(R>0||I>0||O>0))continue;const F=R+I+O;if(0===F)continue;const D=R*(T*M[v])+I*(T*S[v])+O*(T*C[v]);if(D*Math.sign(F)<0)continue;const N=D/F;N>=0&&l(N,t,E?it(d):null)}}(r,s,0,i.length/3,i,t.data,t.stride,n,l,a)}}const Xe=(0,d.vt)();function Je(e,t,r,i,n,o,s){if(null==e)return;const a=function(e,t){return(0,h.hZ)(t,1/e[0],1/e[1],1/e[2])}(r,Xe);if((0,m.Ne)(qe,e.bbMin),(0,m.vI)(qe,e.bbMax),null!=n&&n.applyToAabb(qe),function(e,t,r,i){return function(e,t,r,i){const n=(e[0]-i-t[0])*r[0],o=(e[3]+i-t[0])*r[0];let s=Math.min(n,o),a=Math.max(n,o);const c=(e[1]-i-t[1])*r[1],l=(e[4]+i-t[1])*r[1];if(a=Math.min(a,Math.max(c,l)),a<0)return!1;if(s=Math.max(s,Math.min(c,l)),s>a)return!1;const u=(e[2]-i-t[2])*r[2],h=(e[5]+i-t[2])*r[2];return a=Math.min(a,Math.max(u,h)),!(a<0)&&(s=Math.max(s,Math.min(u,h)),!(s>a)&&s<1/0)}(e,t,r,i)}(qe,t,a,i)){const{primitiveIndices:a,position:c}=e,l=a?a.length:c.indices.length/3;if(l>st){const a=e.getChildren();if(void 0!==a){for(const e of a)Je(e,t,r,i,n,o,s);return}}!function(e,t,r,i,n,o,s,a,c,l,u){const h=e[0],d=e[1],m=e[2],f=t[0],p=t[1],g=t[2],{normalRequired:v}=l;for(let e=0;e<i;++e){const t=a[e],r=3*t,i=s*n[r];let l=o[i],_=o[i+1],x=o[i+2];const y=s*n[r+1];let w=o[y],b=o[y+1],T=o[y+2];const M=s*n[r+2];let S=o[M],C=o[M+1],E=o[M+2];null!=c&&([l,_,x]=c.applyToVertex(l,_,x,e),[w,b,T]=c.applyToVertex(w,b,T,e),[S,C,E]=c.applyToVertex(S,C,E,e));const A=w-l,R=b-_,I=T-x,O=S-l,F=C-_,D=E-x,N=p*D-F*g,P=g*O-D*f,B=f*F-O*p,H=A*N+R*P+I*B;if(Math.abs(H)<=at)continue;const L=h-l,z=d-_,U=m-x,G=L*N+z*P+U*B;if(H>0){if(G<0||G>H)continue}else if(G>0||G<H)continue;const V=z*I-R*U,j=U*A-I*L,k=L*R-A*z,W=f*V+p*j+g*k;if(H>0){if(W<0||G+W>H)continue}else if(W>0||G+W<H)continue;const $=(O*V+F*j+D*k)/H;$>=0&&u($,t,v?rt(A,R,I,O,F,D,Ke):null)}}(t,r,0,l,c.indices,c.data,c.stride,a,n,o,s)}}const Ke=(0,d.vt)();const Qe=(0,d.vt)(),et=(0,d.vt)(),tt=(0,d.vt)();function rt(e,t,r,i,n,o,s){return(0,h.hZ)(nt,e,t,r),(0,h.hZ)(ot,i,n,o),(0,h.$A)(s,nt,ot),(0,h.S8)(s,s),s}function it(e){return(0,h.jb)(nt,e[1],e[0]),(0,h.jb)(ot,e[2],e[0]),(0,h.$A)(Ke,nt,ot),(0,h.S8)(Ke,Ke),Ke}const nt=(0,d.vt)(),ot=(0,d.vt)(),st=1e3,at=1e-7,ct=(0,d.vt)(),lt=[(0,d.vt)(),(0,d.vt)(),(0,d.vt)()];var ut=r(16396);function ht(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length;r*=s;for(let e=0;e<a;++e){const t=2*n[e];o[r]=i[t],o[r+1]=i[t+1],r+=s}}function dt(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,c=o.length;if(r*=a,1===i)for(let e=0;e<c;++e){const t=3*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}else for(let e=0;e<c;++e){const t=3*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],r+=a}}function mt(e,t,r,i=1){const{data:n,indices:o}=e,s=t.typedBuffer,a=t.typedBufferStride,c=o.length;if(r*=a,1===i)for(let e=0;e<c;++e){const t=4*o[e];s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}else for(let e=0;e<c;++e){const t=4*o[e];for(let e=0;e<i;++e)s[r]=n[t],s[r+1]=n[t+1],s[r+2]=n[t+2],s[r+3]=n[t+3],r+=a}}function ft(e,t,r,i,n=1){const o=t.typedBuffer,s=t.typedBufferStride;if(i*=s,1===n)for(let t=0;t<r;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=s;else for(let t=0;t<r;++t)for(let t=0;t<n;++t)o[i]=e[0],o[i+1]=e[1],o[i+2]=e[2],o[i+3]=e[3],i+=s}function pt(e,t,r,i,n,o){switch(e){case"position":{(0,G.vA)(3===t.size);const i=n.getField(e,g.xs);(0,G.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void dt(e,r,i,n);const{data:o,indices:s}=e,a=r.typedBuffer,l=r.typedBufferStride,u=s.length,h=t[0],d=t[1],m=t[2],f=t[4],p=t[5],g=t[6],v=t[8],_=t[9],x=t[10],y=t[12],w=t[13],b=t[14];i*=l;let T=0,M=0,S=0;const C=(0,c.tZ)(t)?e=>{T=o[e]+y,M=o[e+1]+w,S=o[e+2]+b}:e=>{const t=o[e],r=o[e+1],i=o[e+2];T=h*t+f*r+v*i+y,M=d*t+p*r+_*i+w,S=m*t+g*r+x*i+b};if(1===n)for(let e=0;e<u;++e)C(3*s[e]),a[i]=T,a[i+1]=M,a[i+2]=S,i+=l;else for(let e=0;e<u;++e){C(3*s[e]);for(let e=0;e<n;++e)a[i]=T,a[i+1]=M,a[i+2]=S,i+=l}}(t,r,i,o);break}case"normal":{(0,G.vA)(3===t.size);const r=n.getField(e,g.xs);(0,G.vA)(!!r,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void dt(e,r,i,n);const{data:o,indices:s}=e,a=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,d=a[0],m=a[1],f=a[2],p=a[4],g=a[5],v=a[6],_=a[8],x=a[9],y=a[10],w=!(0,c.ut)(a),b=1e-6,T=1-b;i*=u;let M=0,S=0,C=0;const E=(0,c.tZ)(a)?e=>{M=o[e],S=o[e+1],C=o[e+2]}:e=>{const t=o[e],r=o[e+1],i=o[e+2];M=d*t+p*r+_*i,S=m*t+g*r+x*i,C=f*t+v*r+y*i};if(1===n)if(w)for(let e=0;e<h;++e){E(3*s[e]);const t=M*M+S*S+C*C;if(t<T&&t>b){const e=1/Math.sqrt(t);l[i]=M*e,l[i+1]=S*e,l[i+2]=C*e}else l[i]=M,l[i+1]=S,l[i+2]=C;i+=u}else for(let e=0;e<h;++e)E(3*s[e]),l[i]=M,l[i+1]=S,l[i+2]=C,i+=u;else for(let e=0;e<h;++e){if(E(3*s[e]),w){const e=M*M+S*S+C*C;if(e<T&&e>b){const t=1/Math.sqrt(e);M*=t,S*=t,C*=t}}for(let e=0;e<n;++e)l[i]=M,l[i+1]=S,l[i+2]=C,i+=u}}(t,i,r,o);break}case"normalCompressed":case"profileRight":case"profileUp":{(0,G.vA)(2===t.size);const r=n.getField(e,g.mJ);(0,G.vA)(!!r,`No buffer view for ${e}`),ht(t,r,o);break}case"uv0":{(0,G.vA)(2===t.size);const r=n.getField(e,g.ZD)??n.getField(e,g.gH);(0,G.vA)(!!r,`No buffer view for ${e}`),ht(t,r,o);break}case"uvi":{(0,G.vA)(2===t.size);const r=n.getField(e,g.mJ);(0,G.vA)(!!r,`No buffer view for ${e}`),ht(t,r,o);break}case"color":case"symbolColor":{const r=n.getField(e,g.XP);(0,G.vA)(!!r,`No buffer view for ${e}`),(0,G.vA)(3===t.size||4===t.size),function(e,t,r,i,n=1){const{data:o,indices:s}=e,a=r.typedBuffer,c=r.typedBufferStride,l=s.length;if(i*=c,t===o.length&&4===t){a[i]=o[0],a[i+1]=o[1],a[i+2]=o[2],a[i+3]=o[3];const e=new Uint32Array(r.typedBuffer.buffer,r.start),t=c/4,s=e[i/=4];i+=t;const u=l*n;for(let r=1;r<u;++r)e[i]=s,i+=t;return}if(1!==n)if(4!==t)for(let e=0;e<l;++e){const t=3*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=c}else for(let e=0;e<l;++e){const t=4*s[e];for(let e=0;e<n;++e)a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=c}else{if(4===t){for(let e=0;e<l;++e){const t=4*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=o[t+3],i+=c}return}for(let e=0;e<l;++e){const t=3*s[e];a[i]=o[t],a[i+1]=o[t+1],a[i+2]=o[t+2],a[i+3]=255,i+=c}}}(t,t.size,r,o);break}case"colorFeatureAttribute":case"opacityFeatureAttribute":case"sizeFeatureAttribute":{const r=n.getField(e,g.Y$)??n.getField(e,g.Y$);(0,G.vA)(!!r,`No buffer view for ${e}`),(0,G.vA)(1===t.size),function(e,t,r){const{data:i,indices:n}=e,o=t.typedBuffer,s=t.typedBufferStride,a=n.length,c=i[0];r*=s;for(let e=0;e<a;++e)o[r]=c,r+=s}(t,r,o);break}case"tangent":{(0,G.vA)(4===t.size);const i=n.getField(e,g.Eq);(0,G.vA)(!!i,`No buffer view for ${e}`),function(e,t,r,i,n=1){if(!t)return void mt(e,r,i,n);const{data:o,indices:s}=e,a=t,l=r.typedBuffer,u=r.typedBufferStride,h=s.length,d=a[0],m=a[1],f=a[2],p=a[4],g=a[5],v=a[6],_=a[8],x=a[9],y=a[10],w=!(0,c.ut)(a),b=1e-6,T=1-b;if(i*=u,1===n)for(let e=0;e<h;++e){const t=4*s[e],r=o[t],n=o[t+1],a=o[t+2],c=o[t+3];let h=d*r+p*n+_*a,M=m*r+g*n+x*a,S=f*r+v*n+y*a;if(w){const e=h*h+M*M+S*S;if(e<T&&e>b){const t=1/Math.sqrt(e);h*=t,M*=t,S*=t}}l[i]=h,l[i+1]=M,l[i+2]=S,l[i+3]=c,i+=u}else for(let e=0;e<h;++e){const t=4*s[e],r=o[t],a=o[t+1],c=o[t+2],h=o[t+3];let M=d*r+p*a+_*c,S=m*r+g*a+x*c,C=f*r+v*a+y*c;if(w){const e=M*M+S*S+C*C;if(e<T&&e>b){const t=1/Math.sqrt(e);M*=t,S*=t,C*=t}}for(let e=0;e<n;++e)l[i]=M,l[i+1]=S,l[i+2]=C,l[i+3]=h,i+=u}}(t,r,i,o);break}case"profileVertexAndNormal":{(0,G.vA)(4===t.size);const r=n.getField(e,g.jz)??n.getField(e,g.Eq);(0,G.vA)(!!r,`No buffer view for ${e}`),mt(t,r,o);break}case"profileAuxData":{(0,G.vA)(3===t.size);const r=n.getField(e,g.EC)??n.getField(e,g.xs);(0,G.vA)(!!r,`No buffer view for ${e}`),dt(t,r,o);break}}}(0,d.vt)();class gt{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,i,n,o){return function(e,t,r,i,n,o,s){let a={numItems:0,numVerticesPerItem:0};for(const c of r.fields.keys()){const r=e.get(c),l=r?.indices;if(r&&l)"position"===c&&(a={numItems:1,numVerticesPerItem:l.length}),pt(c,r,i,n,o,s);else if("olidColor"===c&&null!=t){const r=e.get("position")?.indices;if(r){const e=r.length;ft(t,o.getField(c,g.XP),e,s)}}}return a}(r,i,this.layout,e,t,n,o)}}var vt=r(91429),_t=r(91829),xt=r(4431),yt=r(1843),wt=r(72824),bt=r(13840),Tt=r(42958),Mt=r(16943),St=r(90644);const Ct=(0,St.p3)(1,0,1,771);function Et(e,t=!1){switch(e){case 0:return t?St.RC:St.T8;case 1:return Ct;case 2:case 3:return null}}function At(e){if(e.draped)return null;switch(e.oitPass){case 0:case 2:return e.writeDepth?St.Uy:null;case 1:case 3:return null}}function Rt(e,t=513){return{func:0===e||2===e?t:515}}const It={factor:-1,units:-2};function Ot({oitPass:e,enableOffset:t}){return t&&1===e?It:null}const Ft={mask:255},Dt={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:0}},Nt={function:{func:519,ref:2,mask:2},operation:{fail:7680,zFail:7680,zPass:7681}};var Pt=r(4576);r(66289);var Bt=r(69622),Ht=r(32728);class Lt{constructor(e){this.localTransform=e.localTransform,this.globalTransform=e.globalTransform,this.modelOrigin=e.modelOrigin,this.model=e.instanceModel,this.modelNormal=e.instanceModelNormal,this.modelScaleFactors=e.modelScaleFactors,this.boundingSphere=e.boundingSphere,this.featureAttribute=e.getField("instanceFeatureAttribute",g.Eq),this.color=e.getField("instanceColor",g.XP),this.olidColor=e.getField("instanceOlidColor",g.XP),this.state=e.getField("state",g.SL),this.lodLevel=e.getField("lodLevel",g.SL)}}let zt=class extends Bt.A{constructor(e,t){super(e),this.events=new se.bk,this._capacity=0,this._size=0,this._next=0,this._highlightOptionsMap=new Map,this._highlightOptionsMapPrev=new Map,this._layout=function(e){return Gt(Ut.clone(),e).u8("state").u8("lodLevel")}(t),this._capacity=$t,this._buffer=this._layout.createBuffer(this._capacity),this._view=new Lt(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,1),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const t=this._view.state;(0,G.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),this._getStateFlag(e,18)?this._setStateFlags(e,32):this.freeInstance(e),this.events.emit("instances-changed")}freeInstance(e){const t=this._view.state;(0,G.vA)(e>=0&&e<this._capacity&&!!(1&t.get(e)),"invalid instance handle"),t.set(e,0),this._size--}setLocalTransform(e,t,r=!0){this._view.localTransform.setMat(e,t),r&&this.updateModelTransform(e)}getLocalTransform(e,t){this._view.localTransform.getMat(e,t)}setGlobalTransform(e,t,r=!0){this._view.globalTransform.setMat(e,t),r&&this.updateModelTransform(e)}getGlobalTransform(e,t){this._view.globalTransform.getMat(e,t)}updateModelTransform(e){const t=this._view,r=Vt,i=jt;t.localTransform.getMat(e,kt),t.globalTransform.getMat(e,Wt);const n=(0,c.lw)(Wt,Wt,kt);(0,h.hZ)(r,n[12],n[13],n[14]),t.modelOrigin.setVec(e,r),(0,s.z0)(i,n),t.model.setMat(e,i);const o=(0,Ht.wp)(Vt,n);o.sort(),t.modelScaleFactors.set(e,0,o[1]),t.modelScaleFactors.set(e,1,o[2]),(0,s.B8)(i,i),(0,s.mg)(i,i),t.modelNormal.setMat(e,i),this._setStateFlags(e,64),this.events.emit("instance-transform-changed",{index:e})}getModelTransform(e,t){const r=this._view;r.model.getMat(e,jt),r.modelOrigin.getVec(e,Vt),t[0]=jt[0],t[1]=jt[1],t[2]=jt[2],t[3]=0,t[4]=jt[3],t[5]=jt[4],t[6]=jt[5],t[7]=0,t[8]=jt[6],t[9]=jt[7],t[10]=jt[8],t[11]=0,t[12]=Vt[0],t[13]=Vt[1],t[14]=Vt[2],t[15]=1}applyShaderTransformation(e,t){null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedModelTransform(e,t){return this.getModelTransform(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t),t}getCombinedLocalTransform(e,t){this._view.localTransform.getMat(e,t),null!=this.shaderTransformation&&this.shaderTransformation.applyTransform(this,e,t)}getCombinedMaxScaleFactor(e){let t=this._view.modelScaleFactors.get(e,1);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Vt,this,e),t*=Math.max(Vt[0],Vt[1],Vt[2])),t}getCombinedMedianScaleFactor(e){let t=this._view.modelScaleFactors.get(e,0);return null!=this.shaderTransformation&&(this.shaderTransformation.scaleFactor(Vt,this,e),t*=function(e,t,r){return Math.max(Math.min(e,t),Math.min(Math.max(e,t),r))}(Vt[0],Vt[1],Vt[2])),t}getModel(e,t){this._view.model.getMat(e,t)}setFeatureAttribute(e,t){this._view.featureAttribute?.setVec(e,t)}getFeatureAttribute(e,t){this._view.featureAttribute?.getVec(e,t)}setColor(e,t){this._view.color?.setVec(e,t)}setObjectAndLayerIdColor(e,t){this._view.olidColor?.setVec(e,t)}setVisible(e,t){t!==this.getVisible(e)&&(this._setStateFlag(e,4,t),this.events.emit("instance-visibility-changed",{index:e}))}getVisible(e){return this._getStateFlag(e,4)}setHighlight(e,t){const{_highlightOptionsMap:r}=this,i=r.get(e);t?t!==i&&(r.set(e,t),this._setStateFlag(e,8,!0),this.events.emit("instance-highlight-changed")):i&&(r.delete(e),this._setStateFlag(e,8,!1),this.events.emit("instance-highlight-changed"))}get highlightOptionsMap(){return this._highlightOptionsMap}getHighlightStateFlag(e){return this._getStateFlag(e,8)}geHighlightOptionsPrev(e){const t=this._highlightOptionsMapPrev.get(e)??null;return this._highlightOptionsMapPrev.delete(e),t}getHighlightName(e){const t=this.highlightOptionsMap.get(e)??null;return t?this._highlightOptionsMapPrev.set(e,t):this._highlightOptionsMapPrev.delete(e),t}getState(e){return this._view.state.get(e)}getLodLevel(e){return this._view.lodLevel.get(e)}countFlags(e){let t=0;for(let r=0;r<this._capacity;++r)this.getState(r)&e&&++t;return t}_setStateFlags(e,t){const r=this._view.state;t=r.get(e)|t,r.set(e,t)}_clearStateFlags(e,t){const r=this._view.state;t=r.get(e)&~t,r.set(e,t)}_setStateFlag(e,t,r){r?this._setStateFlags(e,t):this._clearStateFlags(e,t)}_getStateFlag(e,t){return!!(this._view.state.get(e)&t)}_grow(){this._capacity=Math.max($t,Math.floor(this._capacity*Pt.Ji)),this._buffer=this._layout.createBuffer(this._capacity).copyFrom(this._buffer),this._view=new Lt(this._buffer)}_findSlot(){const e=this._view.state;let t=this._next;for(;1&e.get(t);)t=t+1===this._capacity?0:t+1;return this._next=t+1===this._capacity?0:t+1,t}};(0,Ge.Cg)([(0,vt.MZ)({constructOnly:!0})],zt.prototype,"shaderTransformation",void 0),(0,Ge.Cg)([(0,vt.MZ)()],zt.prototype,"_size",void 0),(0,Ge.Cg)([(0,vt.MZ)({readOnly:!0})],zt.prototype,"size",null),zt=(0,Ge.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.lib.lodRendering.InstanceData")],zt);const Ut=(0,yt.BP)().mat4f64("localTransform").mat4f64("globalTransform").vec4f64("boundingSphere").vec3f64("modelOrigin").mat3f("instanceModel").mat3f("instanceModelNormal").vec2f("modelScaleFactors");function Gt(e,t){return t.instancedFeatureAttribute&&e.vec4f("instanceFeatureAttribute"),t.instancedColor&&e.vec4u8("instanceColor"),(0,Mt.E)()&&e.vec4u8("instanceOlidColor"),e}const Vt=(0,d.vt)(),jt=(0,a.vt)(),kt=(0,l.vt)(),Wt=(0,l.vt)(),$t=64,Zt=(0,yt.BP)().vec3f("instanceModelOriginHi").vec3f("instanceModelOriginLo").mat3f("instanceModel").mat3f("instanceModelNormal");var qt=r(74810),Yt=r(28491),Xt=r(49788);class Jt extends wt.Zo{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=qt.mb,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=d.uY,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=(0,d.CN)(.2,.2,.2),this.diffuse=(0,d.CN)(.8,.8,.8),this.externalColor=(0,_t.fA)(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=(0,d.vt)(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=Xt.Q,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.testsTransparentRenderOrder=0,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}wt.gy;let Kt=class extends Tt.w{constructor(e,t){let i=(0,xt.U)(tr(t));t.instanced&&t.instancedDoublePrecision&&(i=i.concat((0,xt.U)(function(e){return Gt(Zt.clone(),e)}(t)))),super(e,t,i),this.shader=new bt.r(Yt.D,()=>r.e(5141).then(r.bind(r,5141))),this.ignoreUnused=!0}_makePipeline(e,t){const{oitPass:r,output:i,transparent:n,cullFace:o,customDepthTest:s,hasOccludees:a}=e;return(0,St.Ey)({blending:(0,Pe._o)(i)&&n?Et(r):null,culling:er(e)?(0,St.Xt)(o):null,depthTest:Rt(r,Qt(s)),depthWrite:At(e),colorWrite:St.kn,stencilWrite:a?Ft:null,stencilTest:a?t?Nt:Dt:null,polygonOffset:Ot(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function Qt(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function er(e){return 0!==e.cullFace||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function tr(e){const t=(0,yt.BP)().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color",{glNormalized:!0}),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&(0,Mt.E)()&&t.vec4u8("olidColor"),t}Kt=(0,Ge.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],Kt);class rr extends ke{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}(0,Ge.Cg)([(0,je.W)({count:4})],rr.prototype,"alphaDiscardMode",void 0),(0,Ge.Cg)([(0,je.W)({count:3})],rr.prototype,"doubleSidedMode",void 0),(0,Ge.Cg)([(0,je.W)({count:7})],rr.prototype,"pbrMode",void 0),(0,Ge.Cg)([(0,je.W)({count:3})],rr.prototype,"cullFace",void 0),(0,Ge.Cg)([(0,je.W)({count:3})],rr.prototype,"normalType",void 0),(0,Ge.Cg)([(0,je.W)({count:3})],rr.prototype,"customDepthTest",void 0),(0,Ge.Cg)([(0,je.W)({count:8})],rr.prototype,"emissionSource",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVertexColors",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasSymbolColors",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVerticalOffset",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasColorTexture",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasMetallicRoughnessTexture",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasOcclusionTexture",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasNormalTexture",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasScreenSizePerspective",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVertexTangents",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasOccludees",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"instanced",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"instancedDoublePrecision",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasModelTransformation",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"offsetBackfaces",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVVSize",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasVVColor",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"receiveShadows",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"receiveAmbientOcclusion",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"textureAlphaPremultiplied",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"instancedFeatureAttribute",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"instancedColor",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"writeDepth",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"transparent",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"enableOffset",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"terrainDepthTest",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"cullAboveTerrain",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"snowCover",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasColorTextureTransform",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasEmissionTextureTransform",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasNormalTextureTransform",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasOcclusionTextureTransform",void 0),(0,Ge.Cg)([(0,je.W)()],rr.prototype,"hasMetallicRoughnessTextureTransform",void 0);var ir=r(57323);let nr=class extends Kt{constructor(){super(...arguments),this.shader=new bt.r(ir.R,()=>r.e(2314).then(r.bind(r,39933)))}};nr=(0,Ge.Cg)([(0,vt.$K)("esri.views.3d.webgl-engine.shaders.RealisticTreeTechnique")],nr);class or extends $e{constructor(e,t){super(e,ar),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>((0,Pe.iq)(e)||(0,Pe.yT)(e))&&!this.transparent],[4,e=>((0,Pe.iq)(e)||(0,Pe.yT)(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>((0,Pe.iq)(e)||(0,Pe.yT)(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=tr(this.parameters),this._configuration=new rr(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:i}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(i[3])?1:i[3])>=Xt.Q}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!(0,h.t2)(this.parameters.emissiveBaseColor,d.uY)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:i}=this,{treeRendering:n,doubleSided:o,doubleSidedType:s}=r;return super.getConfiguration(e,t,this._configuration),i.hasNormalTexture=r.hasNormalTexture,i.hasColorTexture=r.hasColorTexture,i.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,i.hasOcclusionTexture=r.hasOcclusionTexture,i.hasVertexTangents=!n&&r.hasVertexTangents,i.instanced=r.instanced,i.instancedDoublePrecision=r.instancedDoublePrecision,i.hasVVColor=!!r.vvColor,i.hasVVSize=!!r.vvSize,i.hasVerticalOffset=null!=r.verticalOffset,i.hasScreenSizePerspective=null!=r.screenSizePerspective,i.hasSlicePlane=r.hasSlicePlane,i.alphaDiscardMode=r.textureAlphaMode,i.normalType=n?0:r.normalType,i.transparent=this.transparent,i.writeDepth=r.writeDepth,i.customDepthTest=r.customDepthTest??0,i.hasOccludees=t.hasOccludees,i.cullFace=r.hasSlicePlane?0:r.cullFace,i.cullAboveTerrain=t.cullAboveTerrain,i.hasModelTransformation=!n&&null!=r.modelTransformation,i.hasVertexColors=r.hasVertexColors,i.hasSymbolColors=r.hasSymbolColors,i.doubleSidedMode=n?2:o&&"normal"===s?1:o&&"winding-order"===s?2:0,i.instancedFeatureAttribute=r.instancedFeatureAttribute,i.instancedColor=r.instancedColor,(0,Pe._o)(e)?(i.terrainDepthTest=t.terrainDepthTest,i.receiveShadows=r.receiveShadows,i.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(i.terrainDepthTest=!1,i.receiveShadows=i.receiveAmbientOcclusion=!1),i.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,i.pbrMode=r.usePBR?r.isSchematic?2:1:0,i.emissionSource=r.emissionSource,i.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),i.enableOffset=t.enableOffset,i.snowCover=t.snowCover>0,i.hasColorTextureTransform=!!r.colorTextureTransformMatrix,i.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,i.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,i.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,i.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,i}intersect(e,t,r,i,n,o){if(null!=this.parameters.verticalOffset){const e=r.camera;(0,h.hZ)(mr,t[12],t[13],t[14]);let o=null;switch(r.viewingMode){case 1:o=(0,h.S8)(hr,mr);break;case 2:o=(0,h.C)(hr,ur)}const s=(0,h.Re)(fr,mr,e.eye),a=(0,h.Bw)(s),c=(0,h.hs)(s,s,1/a);let l=null;this.parameters.screenSizePerspective&&(l=(0,h.Om)(o,c));const u=(0,We.kE)(e,a,this.parameters.verticalOffset,l??0,this.parameters.screenSizePerspective,null);(0,h.hs)(o,o,u),(0,h.ei)(dr,o,r.transform.inverseRotation),i=(0,h.Re)(cr,i,dr),n=(0,h.Re)(lr,n,dr)}Ye(e,r,i,n,(0,ut.ou)(r.verticalOffset),o)}createGLMaterial(e){return new sr(e)}createBufferWriter(){return new gt(this._layout)}get transparent(){return function(e){const{drivenOpacity:t,opacity:r,externalColor:i,layerOpacity:n,texture:o,textureId:s,textureAlphaMode:a,colorMixMode:c}=e,l=i[3];return t||r<1&&"replace"!==c||l<1&&"ignore"!==c||n<1||(null!=o||null!=s)&&1!==a&&2!==a&&"replace"!==c}(this.parameters)}}class sr extends Le{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const r=e.camera.viewInverseTransposeMatrix;return(0,h.hZ)(t.origin,r[3],r[7],r[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?nr:Kt,e)}}class ar extends Jt{constructor(){super(...arguments),this.treeRendering=!1,this.useIndexing=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:0===this.emissiveSource?2:1}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}const cr=(0,d.vt)(),lr=(0,d.vt)(),ur=(0,d.fA)(0,0,1),hr=(0,d.vt)(),dr=(0,d.vt)(),mr=(0,d.vt)(),fr=(0,d.vt)(),pr=()=>I.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class gr{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function vr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(pr().warn("Geometry must specify vertex attributes"),i=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(pr().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(pr().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(pr().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else pr().warn("Indexed geometries must specify faces"),i=!1;break}default:pr().warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(pr().warn("Geometry requires material"),i=!1);const n=e.params.vertexAttributes;for(const e in n)n[e].values||(pr().warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function _r(e){const t=(0,m.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&((0,m.iT)(t,r.bbMin),(0,m.iT)(t,r.bbMax))}),t}function xr(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function yr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const wr=new N.A(1,2,"wosr");async function br(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,n.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,A.Ke)((0,E.A)(e,t));if(r.ok)return r.value.data;(0,D.QP)(r.error),function(e){throw new R.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),i=await async function(e,t){const r=new Array;for(const i in e){const n=e[i],o=n.images[0].data;if(!o){pr().warn("Externally referenced texture data is not yet supported");continue}const s=n.encoding+";base64,"+o,a="/textureDefinitions/"+i,c="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",l={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==xr(c)},u=t?.disableTextures?Promise.resolve(null):B(s,t);r.push(u.then(e=>({refId:a,image:e,parameters:l,alphaChannelUsage:c})))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}(r.textureDefinitions??{},t);let n=0;for(const e in i)if(i.hasOwnProperty(e)){const t=i[e];n+=t?.image?t.image.width*t.image.height*4:0}return new gr(r,i,n+(0,O.Qh)(r))}(a.url,t)),{engineResources:r,referenceBoundingBox:i}=function(e,t){const r=new Array,i=new Array,n=new Array,o=new F,s=e.resource,a=N.A.parse(s.version||"1.0","wosr");wr.validate(a);const c=s.model.name,l=s.model.geometries,u=s.materialDefinitions??{},h=e.textures;let m=0;const f=new Map;for(let e=0;e<l.length;e++){const s=l[e];if(!vr(s))continue;const a=yr(s),c=s.params.vertexAttributes,p=[],g=e=>{if("PerAttributeArray"===s.params.topology)return null;const t=s.params.faces;for(const r in t)if(r===e)return t[r].values;return null},v=c.position,_=v.values.length/v.valuesPerElement;for(const e in c){const t=c[e],r=t.values,i=g(e)??(0,P.tM)(_);p.push([e,new H.n(r,i,t.valuesPerElement,!0)])}const x=a.texture,y=h&&h[x];if(y&&!f.has(x)){const{image:e,parameters:t}=y,r=new Fe(e,t);i.push(r),f.set(x,r)}const w=f.get(x),b=w?w.id:void 0,T=a.material;let M=o.get(T,x);if(null==M){const e=u[T.slice(T.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=y?xr(y.alphaChannelUsage):void 0,i={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:b,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(i,t.materialParameters),M=new or(i,t),o.set(T,x,M)}n.push(M);const S=new ne(M,p);m+=p.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(S)}return{engineResources:[{name:c,stageResources:{textures:i,materials:n,geometries:r},pivotOffset:s.model.pivotOffset,numberOfVertices:m,lodThreshold:null}],referenceBoundingBox:_r(r)}}(e,t);return{lods:r,referenceBoundingBox:i,isEsriSymbolResource:!1,isWosr:!0}}let f;if(t.cache)f=await t.cache.loadGLTF(a.url,t,!!t.usePBR,!!t.useEmissive);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));f=await e(new y.R,a.url,t,t.usePBR,t.useEmissive)}const{engineResources:T,referenceBoundingBox:S}=function(e,t,r){const n=e.model,a=e.meta,f=n.meta?.ESRI_proxyEllipsoid,y=a.isEsriSymbolResource&&null!=f&&"EsriRealisticTreesStyle"===a.ESRI_webstyle;y&&!e.customMeta.esriTreeRendering&&(e.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const n=e.model.lods[r];for(const o of n.parts){const n=o.attributes.normal;if(null==n)return;const s=o.attributes.position,a=s.count,u=(0,d.vt)(),m=(0,d.vt)(),f=(0,d.vt)(),p=new Float32Array(4*a),v=new Float32Array(3*a),_=(0,c.B8)((0,l.vt)(),o.transform);let x=0,y=0;for(let c=0;c<a;c++){s.getVec(c,m),n.getVec(c,u),(0,h.Z0)(m,m,o.transform),(0,h.Re)(f,m,t.center),(0,h.Qr)(f,f,t.radius);const a=f[2],l=(0,h.Bw)(f),d=Math.min(.45+.55*l*l,1)**i.Tf;(0,h.Qr)(f,f,t.radius),null!==_&&(0,h.Z0)(f,f,_),(0,h.S8)(f,f),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,h.Cc)(f,f,u,a>-1?.2:Math.min(-4*a-3.8,1)),v[x]=f[0],v[x+1]=f[1],v[x+2]=f[2],x+=3,p[y]=d,p[y+1]=d,p[y+2]=d,p[y+3]=1,y+=4}o.attributes.normal=new g.xs(v.buffer),o.attributes.color=new g.Eq(p.buffer)}}}(e,f));const T=!!t.usePBR,S=a.isEsriSymbolResource?{usePBR:T,isSchematic:!1,treeRendering:y,mrrFactors:qt.SY}:{usePBR:T,isSchematic:!1,treeRendering:!1,mrrFactors:qt.mb},E={...t.materialParameters,treeRendering:y},A=new Array,R=new Map,I=new Map,O=n.lods.length,F=(0,m.Ie)();return n.lods.forEach((e,a)=>{const c=!0===t.skipHighLods&&(O>1&&0===a||O>3&&1===a)||!1===t.skipHighLods&&null!=r&&a!==r;if(c&&0!==a)return;const l=new C(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const r=c?new or({},t):function(e,t,r,n,o,s,a,c,l){const h=e.materials.get(t.material);if(null==h)return null;const{normal:d,color:m,texCoord0:f,tangent:p}=t.attributes,g=t.material+(d?"_normal":"")+(m?"_color":"")+(f?"_texCoord0":"")+(p?"_tangent":""),v=null!=t.attributes.texCoord0,_=null!=t.attributes.normal,x=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(h.alphaMode);if(!s.has(g)){if(v){const t=(t,r=!1,i=!1)=>{if(null!=t&&!a.has(t)){const n=e.textures.get(t);if(n){const e=n.data,o=r&&!(0,b.x3)(e)?c.compressionOptions:void 0;a.set(t,new Fe((0,b.x3)(e)?e.data:e,{...n.parameters,preMultiplyAlpha:!(0,b.x3)(e)&&i,encoding:(0,b.x3)(e)?e.encoding:void 0,compressionOptions:o}))}}},r=1!==x&&!l;t(h.colorTexture,r,1!==x),t(h.normalTexture),t(h.occlusionTexture,!0),t(h.emissiveTexture),t(h.metallicRoughnessTexture,!0)}const r=(0,i.xV)(h.color[0]),d=(0,i.xV)(h.color[1]),m=(0,i.xV)(h.color[2]),f=null!=h.colorTexture&&v?a.get(h.colorTexture):null,p=(0,qt.Jr)(h),y=null!=h.normalTextureTransform?.scale?h.normalTextureTransform?.scale:u.Un;s.set(g,new or({...n,customDepthTest:1,textureAlphaMode:x,textureAlphaCutoff:h.alphaCutoff,diffuse:[r,d,m],ambient:[r,d,m],opacity:"OPAQUE"===h.alphaMode?1:h.opacity,doubleSided:h.doubleSided,doubleSidedType:"winding-order",cullFace:h.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:_?0:2,castShadows:!0,receiveShadows:h.receiveShadows,receiveAmbientOcclusion:h.receiveAmbientOcclusion,textureId:null!=f?f.id:void 0,colorMixMode:h.colorMixMode,normalTextureId:null!=h.normalTexture&&v?a.get(h.normalTexture).id:void 0,textureAlphaPremultiplied:null!=f&&!!f.parameters.preMultiplyAlpha,occlusionTextureId:null!=h.occlusionTexture&&v?a.get(h.occlusionTexture).id:void 0,emissiveTextureId:null!=h.emissiveTexture&&v?a.get(h.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=h.metallicRoughnessTexture&&v?a.get(h.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[h.emissiveFactor[0],h.emissiveFactor[1],h.emissiveFactor[2]],emissiveStrengthKHR:null!=h.emissiveStrengthKHR?h.emissiveStrengthKHR:1,emissiveStrengthFromSymbol:null!=o.emissiveStrengthFromSymbol?o.emissiveStrengthFromSymbol:void 0,mrrFactors:p?qt.Bt:[h.metallicFactor,h.roughnessFactor,n.mrrFactors[2]],isSchematic:p,colorTextureTransformMatrix:M(h.colorTextureTransform),normalTextureTransformMatrix:M(h.normalTextureTransform),scale:[y[0],y[1]],occlusionTextureTransformMatrix:M(h.occlusionTextureTransform),emissiveTextureTransformMatrix:M(h.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(h.metallicRoughnessTextureTransform),...o},c))}const y=s.get(g);if(r.stageResources.materials.push(y),v){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(h.colorTexture),e(h.normalTexture),e(h.occlusionTexture),e(h.emissiveTexture),e(h.metallicRoughnessTexture)}return y}(n,e,l,S,E,R,I,t,y),{geometry:h,vertexCount:d}=function(e,t){const r=e.attributes.position.count,i=(0,w.x)(e.indices||r,e.primitiveType),n=p(3*r),{typedBuffer:a,typedBufferStride:c}=e.attributes.position;(0,v.t)(n,a,e.transform,3,c);const l=[["position",new H.n(n,i,3,!0)]];if(null!=e.attributes.normal){const t=p(3*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.normal;(0,s.Ge)(Tr,e.transform),(0,v.b)(t,n,Tr,3,a),(0,o.or)(Tr)&&(0,v.n)(t,t),l.push(["normal",new H.n(t,i,3,!0)])}if(null!=e.attributes.tangent){const t=p(4*r),{typedBuffer:n,typedBufferStride:a}=e.attributes.tangent;(0,s.z0)(Tr,e.transform),(0,_.t)(t,n,Tr,4,a),(0,o.or)(Tr)&&(0,v.n)(t,t,4),l.push(["tangent",new H.n(t,i,4,!0)])}if(null!=e.attributes.texCoord0){const t=p(2*r),{typedBuffer:n,typedBufferStride:o}=e.attributes.texCoord0;(0,x.a)(t,n,2,o),l.push(["uv0",new H.n(t,i,2,!0)])}const u=e.attributes.color;if(null!=u){const t=new Uint8Array(4*r);4===u.elementCount?u instanceof g.Eq?(0,_.b)(t,u,1,255):(u instanceof g.XP||u instanceof g.Uz)&&(0,_.b)(t,u,1/255,255):(t.fill(255),u instanceof g.xs?(0,v.f)(t,u.typedBuffer,1,255,4,u.typedBufferStride):(e.attributes.color instanceof g.eI||e.attributes.color instanceof g.nS)&&(0,v.f)(t,u.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),l.push(["color",new H.n(t,i,4,!0)])}return{geometry:new ne(t,l),vertexCount:r}}(e,r??new or({},t)),f=h.boundingInfo;null!=f&&0===a&&((0,m.iT)(F,f.bbMin),(0,m.iT)(F,f.bbMax)),null!=r&&(l.stageResources.geometries.push(h),l.numberOfVertices+=d)}),c||A.push(l)}),{engineResources:A,referenceBoundingBox:F}}(f,t,a.specifiedLodIndex);return{lods:T,referenceBoundingBox:S,isEsriSymbolResource:f.meta.isEsriSymbolResource,isWosr:!1}}const Tr=(0,a.vt)()},1843(e,t,r){r.d(t,{BP:()=>h,l5:()=>d});var i=r(20498),n=r(13030),o=r(90239),s=r(4431),a=r(620),c=r(85079);class l{constructor(e,t,r=0){this.layout=e,this.byteOffset=r,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fields.keys()){const i=e.fields.get(t);this[t]=new i.constructor(this.buffer,r+i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.byteLength/this.stride}get byteLength(){return this.buffer.byteLength-this.byteOffset}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new l(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t=0,r=0,i=e.count){const n=this.stride;if(n%4==0){const o=new Uint32Array(e.buffer,t*n,i*n/4);new Uint32Array(this.buffer,r*n,i*n/4).set(o)}else{const o=new Uint8Array(e.buffer,t*n,i*n);new Uint8Array(this.buffer,r*n,i*n).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(e){this._stride=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:p(e[1].constructor)})))}freeze(){return this}get locations(){return(0,c.Xk)((0,s.U)(this))}vec2f16(e,t){return this._appendField(e,i.SX?n.ZD:n.gH,t),this}vec2f(e,t){return this._appendField(e,n.gH,t),this}vec2f64(e,t){return this._appendField(e,n.si,t),this}vec3f16(e,t){return this._appendField(e,i.SX?n.EC:n.xs,t),this}vec3f(e,t){return this._appendField(e,n.xs,t),this}vec3f64(e,t){return this._appendField(e,n.Xm,t),this}vec4f16(e,t){return this._appendField(e,i.SX?n.jz:n.Eq,t),this}vec4f(e,t){return this._appendField(e,n.Eq,t),this}vec4f64(e,t){return this._appendField(e,n.Aj,t),this}mat3f(e,t){return this._appendField(e,n.jZ,t),this}mat3f64(e,t){return this._appendField(e,n.j0,t),this}mat4f(e,t){return this._appendField(e,n.Sx,t),this}mat4f64(e,t){return this._appendField(e,n.E$,t),this}vec4u8(e,t){return this._appendField(e,n.XP,t),this}f16(e,t){return this._appendField(e,i.SX?n.XW:n.Y$,t),this}f32(e,t){return this._appendField(e,n.Y$,t),this}f64(e,t){return this._appendField(e,n.qB,t),this}u8(e,t){return this._appendField(e,n.SL,t),this}u16(e,t){return this._appendField(e,n.h,t),this}i8(e,t){return this._appendField(e,n.bf,t),this}vec2i8(e,t){return this._appendField(e,n.D6,t),this}vec2i16(e,t){return this._appendField(e,n.mJ,t),this}vec2u8(e,t){return this._appendField(e,n.LC,t),this}vec2u16(e,t){return this._appendField(e,n.Yi,t),this}vec4u16(e,t){return this._appendField(e,n.Uz,t),this}vec4i16(e,t){return this._appendField(e,n.E7,t),this}u32(e,t){return this._appendField(e,n.P,t),this}_appendField(e,t,r){this._fields.has(e)&&(0,a.vA)(!1,`${e} already added to vertex buffer layout`);const i=t.ElementCount*(0,o.GJ)(t.ElementType),n=this._stride;this._fields.set(e,{constructor:t,size:i,offset:n,optional:r}),this._alignFields()}_alignFields(){let e=0,t=1;this._fields.forEach(r=>{const i=(0,o.GJ)(r.constructor.ElementType);e=Math.floor((e+i-1)/i)*i,r.offset=e,e+=r.size,t=Math.max(t,i)}),e=Math.floor((e+t-1)/t)*t,this._stride=e}createBuffer(e){return new l(this,e)}createView(e,t){return new l(this,e,t)}clone(){const e=new u;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((t,r)=>e._fields.set(r,t)),e.BufferType=this.BufferType,e}get stride(){return this._stride}get fields(){return this._fields}}function h(){return new u}class d{constructor(e){this.fields=new Array,e.fields.forEach((e,t)=>{const r={...e,constructor:f(e.constructor)};this.fields.push([t,r])}),this.stride=e.stride}}const m=[n.Y$,n.gH,n.xs,n.Eq,n.jZ,n.Sx,n.qB,n.si,n.Xm,n.Aj,n.j0,n.E$,n.SL,n.LC,n.eI,n.XP,n.h,n.Yi,n.nS,n.Uz,n.P,n.An,n.H$,n.ml,n.bf,n.D6,n.m8,n.TX,n.Qt,n.mJ,n.Vp,n.E7,n.My,n.UL,n.zD,n.Y4];function f(e){return`${e.ElementType}_${e.ElementCount}`}function p(e){return g.get(e)}const g=new Map;m.forEach(e=>g.set(f(e),e))},4431(e,t,r){r.d(t,{U:()=>o});var i=r(63907),n=r(74038);function o(e,t=0){const r=e.stride;return Array.from(e.fields.keys()).map(o=>{const s=e.fields.get(o),a=s.constructor.ElementCount,c=function(e){switch(e){case"u8":return i.pe.UNSIGNED_BYTE;case"u16":return i.pe.UNSIGNED_SHORT;case"u32":return i.pe.UNSIGNED_INT;case"i8":return i.pe.BYTE;case"i16":return i.pe.SHORT;case"i32":return i.pe.INT;case"f16":return i.pe.HALF_FLOAT;case"f32":return i.pe.FLOAT;default:throw new Error("BufferType not supported in WebGL")}}(s.constructor.ElementType),l=s.offset,u=s.optional?.glNormalized??!1,h=s.optional?.integer??!1;return new n._(o,a,c,l,r,u,t,h)})}},26857(e,t,r){r.d(t,{b:()=>a});var i=r(5482),n=r(69622),o=r(91429);let s=class extends n.A{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.OCCLUSION_QUERY_DEBUG_PIXEL=!1,this.ENABLE_OPTIMIZATIONS=!0,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.FLOW_GLOBAL_SCALE_THRESHOLD=null}};(0,i.Cg)([(0,o.MZ)()],s.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DECONFLICTOR_SHOW_GRID",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LABELS_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BASELINE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TEXT_SHOW_BORDER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OVERLAY_SHOW_CENTER",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"SHOW_POI",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"OCCLUSION_QUERY_DEBUG_PIXEL",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"ENABLE_OPTIMIZATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"I3S_TREE_SHOW_TILES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"I3S_SHOW_MODIFICATIONS",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"LINE_WIREFRAMES",void 0),(0,i.Cg)([(0,o.MZ)()],s.prototype,"FLOW_GLOBAL_SCALE_THRESHOLD",void 0),s=(0,i.Cg)([(0,o.$K)("esri.views.3d.support.debugFlags")],s);const a=new s},46686(e,t,r){r.d(t,{o:()=>n});var i=r(31821);function n(e,t){t&&e.varyings.add("linearDepth","float",{invariant:!0}),e.vertex.code.add(i.H`
|
|
234
234
|
void forwardLinearDepth(float _linearDepth) { ${(0,i.If)(t,"linearDepth = _linearDepth;")} }
|
|
235
235
|
`)}},33120(e,t,r){r.d(t,{i$:()=>s,xJ:()=>o}),r(46686),r(62308);var i=r(77108),n=r(31821);function o(e){e.vertex.uniforms.add(new i.E("nearFar",e=>e.camera.nearFar))}function s(e){e.vertex.code.add(n.H`float calculateLinearDepth(vec2 nearFar,float z) {
|
|
236
236
|
return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]);
|
|
@@ -560,7 +560,7 @@ vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;`),v&&r.code.a
|
|
|
560
560
|
normalTextureTransformMatrix[1][0]/scale[0], normalTextureTransformMatrix[1][1]/scale[1], 0.0,
|
|
561
561
|
0.0, 0.0, 0.0 );
|
|
562
562
|
rawNormal.xy = (normalRotation * vec3(rawNormal.x, rawNormal.y, 1.0)).xy;`),r.code.add(c.H`return tangentSpace * rawNormal;
|
|
563
|
-
}`))}(e,t)}},43730(e,t,r){r.d(t,{n:()=>Ht});var i=r(31821),n=r(12791),o=r(5482),s=r(34727),a=r(97768),c=r(36708),l=r(78659),u=r(91429),h=r(37585),d=r(69540);let m=class extends d.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,o.Cg)([(0,u.$K)("esri.CameraLayout")],m);const f=m;var p=r(69052),g=r(25482),v=r(56507),_=r(86738),x=r(43937),y=r(36005);let w=class extends((0,d.OU)(g.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new f}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,v.GB)(e.x||0),n.y=(0,v.GB)(e.y||0),n.z=e.hasZ?(0,v.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,v.GB)(r.x||0),r.y=(0,v.GB)(r.y||0),r.z=r.hasZ?(0,v.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,u.MZ)({type:_.A,json:{write:{isRequired:!0}}})],w.prototype,"position",void 0),(0,o.Cg)([(0,x.K)("position")],w.prototype,"writePosition",null),(0,o.Cg)([(0,y.w)("position")],w.prototype,"readPosition",null),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,u.wg)(e=>p.ie.normalize((0,v.GB)(e)))],w.prototype,"heading",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,u.wg)(e=>(0,s.qE)((0,v.GB)(e),-180,180))],w.prototype,"tilt",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,u.wg)(e=>(0,s.qE)((0,v.GB)(e,55),1,170))],w.prototype,"fov",void 0),(0,o.Cg)([(0,u.MZ)({type:f,nonNullable:!0,json:{read:!1,write:!1}})],w.prototype,"layout",void 0),w=(0,o.Cg)([(0,u.$K)("esri.Camera")],w);var b=r(9093),T=r(35522),M=r(51850),S=r(16930),C=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),R=(r(19419),r(71351)),I=r(69622),O=r(53966),F=r(90629),D=r(58083),N=r(48163),P=r(78955),B=r(91829),H=r(82919),L=r(44280);function z(e,t,r){e.worldUpAtPosition(t,U),(0,T.Re)(G,r,t);const i=(0,T.Bw)(G);return 0===i?0:(0,s.XM)((0,T.Om)(G,U)/i)}const U=(0,M.vt)(),G=(0,M.vt)();var V;let j=V=class extends I.A{constructor(e){super(e),this._ray=(0,R.vt)(),this._viewport=(0,B.fA)(0,0,1,1),this._padding=(0,B.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,N.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,b.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,b.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,b.vt)(),this._frustumDirty=!0,this._frustum=(0,H.vt)(),this._fullViewport=(0,B.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,M.vt)(),this._up=(0,M.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,T.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,D.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,T.hZ)((0,M.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,T.hZ)((0,M.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,T.hZ)((0,M.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,P.hs)((0,B.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,P.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,P.hs)((0,B.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,P.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,P.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,P.C)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,D.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,D.B8)((0,b.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,b.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,T.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,D.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,D.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,s=-i/2+this.column*o,a=s+o,c=-r/2+this.row*n,l=c+n,u=(0,D.$h)((0,b.vt)(),s*(1+2*this._padding[3]/e),a*(1+2*this._padding[1]/e),c*(1+2*this._padding[2]/t),l*(1+2*this._padding[0]/t),this.near,this.far),h=this._get("projectionMatrix");return h&&(0,D.aI)(h,u)?h:u}copyFrom(e){(0,T.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,P.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,P.C)(this._padding,e.padding),this.notifyChange("_padding"),(0,h.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,D.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,H.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,D.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,P.C)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new V).copyFrom(this)}equals(e){return(0,T.t2)(this.eye,e.eye)&&(0,T.t2)(this.center,e.center)&&(0,T.t2)(this.up,e.up)&&(0,P.t2)(this._viewport,e.viewport)&&(0,P.t2)(this._padding,e.padding)&&(0,h.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,P.hG)(e.screenPadding,this.screenPadding)>=t||(0,P.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,T.jb)($,e.eye,e.center),(0,T.jb)(Z,this.eye,this.center);const r=(0,T.Om)($,Z),i=(0,T.uE)($),n=(0,T.uE)(Z),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,T.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,T.Re)($,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==k&&(0,T.C)(k,e),k[3]=1,(0,P.Z0)(k,k,this.projectionMatrix);const r=Math.abs(k[3]);(0,T.hs)(k,k,1/r);const i=this.fullViewport;t[0]=(0,s.Cc)(0,i[0]+i[2],.5+.5*k[0]),t[1]=(0,s.Cc)(0,i[1]+i[3],.5+.5*k[1]),t[2]=.5*(k[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;k[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],k[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],k[2]=(2*e[2]-1)*e[3],k[3]=e[3],null!=this.inverseProjectionMatrix&&((0,P.Z0)(k,k,this.inverseProjectionMatrix),t[0]=k[0],t[1]=k[1],t[2]=k[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,q),this.renderToScreen(q,t),t}projectToRenderScreen(e,t){if(k[0]=e[0],k[1]=e[1],k[2]=e[2],k[3]=1,(0,P.Z0)(k,k,this.viewProjectionMatrix),0===k[3])return null;const r=k;(0,T.hs)(r,r,1/Math.abs(k[3]));const i=this.fullViewport,n=(0,s.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,s.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,q),t)}unprojectFromRenderScreen(e,t){if((0,D.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,D.B8)(W,W))return null;const r=this.fullViewport;return k[0]=2*(e[0]-r[0])/r[2]-1,k[1]=2*(e[1]-r[1])/r[3]-1,k[2]=2*e[2]-1,k[3]=1,(0,P.Z0)(k,k,W),0===k[3]?null:(t[0]=k[0]/k[3],t[1]=k[1]/k[3],t[2]=k[2]/k[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,s=Math.max(n-r/2,0),a=Math.max(this.fullHeight-o-i/2,0),c=-Math.min(n-r/2,0),l=-Math.min(this.fullHeight-o-i/2,0),u=r-c- -Math.min(this.fullWidth-n-r/2,0),h=i-l- -Math.min(o-i/2,0);return[Math.round(s),Math.round(a),Math.round(u),Math.round(h)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,s=Math.abs(Math.PI/2-z(t,r,i));return e.frustumCoverage(s,n,o)}_computeUpGlobal(){(0,T.Re)($,this.center,this.eye);const e=(0,T.Bw)(this.center);e<1?(0,T.t2)(this._up,M.Cb)&&((0,T.C)(this._up,M.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,T.Om)($,this.center))>.9999*(0,T.Bw)($)*e||((0,T.$A)(Z,$,this.center),(0,T.$A)(Z,Z,$),(0,T.S8)(Z,Z),(0,T.t2)(this._up,Z)||((0,T.C)(this._up,Z),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,T.oW)($,this.eye,this.center),Math.abs($[2])<=.9999&&((0,T.hs)($,$,$[2]),(0,T.hZ)($,-$[0],-$[1],1-$[2]),(0,T.S8)($,$),(0,T.t2)(this._up,$)||((0,T.C)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,T.t2)(e,t)||((0,T.C)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):O.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,H.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,D.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,u.MZ)()],j.prototype,"_viewport",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_padding",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_fov",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_nearFar",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"pixelRatio",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"row",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"column",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_rows",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"rows",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_columns",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"columns",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"eye",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"center",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_center",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"up",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_up",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"viewMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"viewForward",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"viewUp",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"viewRight",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"nearFar",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"near",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"far",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"viewport",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"screenViewport",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"screenPadding",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"x",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"y",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"width",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"height",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fullWidth",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fullHeight",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"_aspect",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"padding",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"projectionMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fov",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fovX",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fovY",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"relativeElevation",void 0),j=V=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl.RenderCamera")],j);const k=(0,B.vt)(),W=(0,b.vt)(),$=(0,M.vt)(),Z=(0,M.vt)(),q=(0,F.r_)();r(49718),r(6867),r(16396),(0,M.vt)(),(0,M.vt)(),(0,M.vt)();var Y=r(5443),X=r(39829),J=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,s)=>{if(t[r]<i&&s[r]<i)return 1===n?0:1;if(t[r]>i&&s[r]>i)return 1===n?1:0;const a=(s[o]-t[o])/(s[r]-t[r]),c=t[o]+a*(i-t[r]);return e[r]=i,e[o]=c,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,N.o8)(ee));break;case 2:Q(e,(0,N.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,h.aI)(e.at(-1),t)||e.push(t)}const ee=(0,N.vt)();var te=r(11964),re=r(27921);const ie=(0,M.vt)(),ne=(0,M.vt)();function oe(){return{direction:(0,M.vt)(),up:(0,M.vt)()}}function se(e,t,r,i,n){let o=(0,T.S8)(ie,e),a=(0,T.Om)(o,i);const c=a>0;a=Math.abs(a),a>.99&&(a=Math.abs((0,T.Om)(t,i)),a<.99?((0,T.C)(o,t),c&&(0,T.hs)(o,o,-1)):o=null);let l=0;if(o){(0,T.hs)(ne,i,(0,T.Om)(i,o)),(0,T.Re)(o,o,ne);const e=(0,T.Om)(o,n)/((0,T.Bw)(o)*(0,T.Bw)(n));(0,T.$A)(ne,o,n),l=((0,T.Om)(ne,i)>0?1:-1)*(0,s.KJ)((0,s.XM)(e))}const u=(0,s.KJ)((0,s.XM)(-(0,T.Om)(i,e)/(0,T.Bw)(e)));return r?(r.heading=l,r.tilt=u,r):{heading:l,tilt:u}}function ae(e,t,r,i){(0,T.Re)(ce,r,t),(0,re.T7)(i,(0,te.LV)(t,ce),e)||e===r||(0,T.C)(e,r)}const ce=(0,M.vt)(),le=(0,M.fA)(0,1,0),ue=(0,M.fA)(0,0,1),he=(0,b.vt)(),de=(0,M.vt)(),me=(0,M.vt)();function fe(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,D.N9)(he,-(0,s.kU)(t)),(0,D.eL)(he,he,(0,s.kU)(r)),(0,T.Z0)(n,ue,he),(0,T.hs)(n,n,-1),(0,T.Z0)(o,le,he),i}function pe(e,t,r,i,n){const o=t.lines[11].direction,s=(n-r.getAltitude(i))/o[2];(0,T.Ln)(e,i,o,s)}const ge=(0,M.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return se(t,r,i,ue,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=fe(0,r,i),o=(0,M.vt)();return(0,T.hs)(o,n.direction,-t),(0,T.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,s.kU)(e)},headingTiltToDirectionUp:fe,lookAtTiltToEyeTilt:function(e){return(0,s.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,s=e.state.camera.eye,a=[],c=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,R.LV)(t.origin,t.direction),n,ge)||pe(ge,r,i,t.endpoint,n),ae(ge,s,ge,c),a.push((0,N.fA)(ge[0],ge[1]))}return function(e,t,r){const i=e.map(e=>((0,T.hZ)(ge,e[0],e[1],0),t.fromRenderCoords(ge,ge,r),[ge[0],ge[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(a,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,s=e.spatialReference??t.spatialReference;return(0,C.g)(t,de,o),(0,C.g)(t,me,o),de[0]-=r/2,me[0]+=r/2,de[1]-=i/2,me[1]+=i/2,(0,E.F)(de,o,de,s),(0,E.F)(me,o,me,s),n?(n.xmin=de[0],n.ymin=de[1],n.xmax=me[0],n.ymax=me[1],n.spatialReference=s):n=new Y.A(de[0],de[1],me[0],me[1],s),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),_e=r(17136),xe=r(94008),ye=r(28735);class we{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(e){this.renderCoordsHelper=e,this.frustum=(0,H.vt)(),this._points=(0,H.Qy)(),this.lines=new Array(12),this._origin=(0,M.vt)(),this._direction=(0,M.vt)(),this._boundingSphere=new xe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,M.vt)(),endpoint:null}}update(e){(0,H.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,T.C)(this._origin,e.eye),(0,T.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,T.C)(this._points[t],e[t]);(0,H.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,H.m7)(this.frustum,e)}intersectsRay(e){return(0,H.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,H.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,H.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=Me;(0,T.S8)(t,this.direction);const r=Te;(0,T.jb)(r,this.points[4],e);const i=.5*(0,T.Om)(r,r)/(0,T.Om)(t,r),n=this._boundingSphere,o=(0,T.Ln)(Se,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=H.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,T.oW)(e.direction,t,r)}const Te=(0,M.vt)(),Me=(0,M.vt)(),Se=(0,M.vt)();r(86211);const Ce=(0,M.fA)(5802e-9,13558e-9,331e-7),Ee=(0,M.fA)(65e-8*3,5643e-9,255e-9);(0,M.fA)(Ce[0]+Ee[0],Ce[1]+Ee[1],Ce[2]+Ee[2]);class Ae{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Ae(0,0)}static{this.Infinite=new Ae}}(0,M.vt)(),(0,M.vt)(),new xe.iy,(0,R.vt)(),new Y.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Re=r(32728);const Ie=(0,M.fA)(0,0,1),Oe=(0,T.S8)((0,M.vt)(),(0,M.fA)(1,1,1)),Fe=(0,b.vt)(),De=(0,M.vt)(),Ne=(0,M.vt)();function Pe(e,t,r,i=oe()){(0,T.$A)(De,e,Ie),0===(0,T.Om)(De,De)&&(0,T.$A)(De,e,Oe),(0,D.$0)(Fe,-(0,s.kU)(t),e),(0,D.e$)(Fe,Fe,-(0,s.kU)(r),De);const{up:n,direction:o}=i;return(0,T.$A)(n,De,e),(0,T.S8)(n,n),(0,T.Z0)(n,n,Fe),(0,T.S8)(o,e),(0,T.ze)(o,o),(0,T.Z0)(o,o,Fe),i}function Be(e){const t=e[1];e[1]=-e[2],e[2]=t}function He(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function Le(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const s=e[o],a=o===e.length-1?e[0]:e[o+1],c=(0,te.Cr)(s,a,$e),l=(0,re.vE)(t,c.origin,c.vector,0,ke);switch(l){case 2:r.push(s);break;case 3:i.push(s);break;case 0:case 1:{const[e,o,a]=0===l?[1,r,i]:[-1,i,r],c=(0,re.Qj)(t),u=(0,T.Ln)((0,M.vt)(),ke,c,e*n),h=(0,T.Ln)((0,M.vt)(),ke,c,e*-n);o.push(s),o.push(u),a.push(h)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const ze={minCurvature:(0,s.kU)(5),maxCurvature:(0,s.kU)(50),minSamples:1,maxSamples:6},Ue=(0,M.fA)(1,0,0),Ge=(0,M.fA)(0,1,0),Ve=(0,M.vt)(),je=(0,M.vt)(),ke=(0,M.vt)(),We=new xe.iy,$e=(0,te.vt)(),Ze=(0,B.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=De,o=Ne;return(0,T.S8)(n,e),(0,T.$A)(Ne,n,Ie),0===(0,T.Om)(Ne,Ne)&&(0,T.$A)(Ne,n,Oe),(0,T.$A)(o,Ne,n),se(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,M.vt)(),up:null,tilt:i,heading:r},o=De;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const a=t,c=(0,s.kU)(r),l=(0,s.kU)(i),u=Math.sin(c),h=Math.cos(c),d=Math.sin(l),m=Math.cos(l),f=(0,T.Bw)(o);let p;if(Math.abs(l)<1e-8)p=a+f;else{const e=f/d,t=(0,s.YN)(a/e),r=Math.PI-l-t;p=e*Math.sin(r)}const g=m*a,v=a*a*(d*d),_=h*h*v,x=p-g,y=x*x,w=_*(_+y-o[1]*o[1]);if(w<0)return(0,T.hs)(n.eye,o,p/f),n.tilt=0,He(n,e);const b=Math.sqrt(w),S=o[1]*x,C=_+y;let E;if(E=h>0?-b+S:b+S,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=a):(0,T.hs)(n.eye,o,p/f),n.tilt=0,Be(n.eye),He(n,e);n.eye[1]=E/C;const A=u*u*v,R=d*a,I=h*R*n.eye[1],O=n.eye[1]*n.eye[1],F=1-O,D=Math.sqrt(F),N=_*O+A-2*I*D*x+F*y;return Math.abs(N)<1e-8?((0,T.hs)(n.eye,o,p/f),n.tilt=0,Be(n.eye),He(n,e)):(n.eye[0]=(F*(p*o[0]-g*o[0])-R*D*(o[0]*n.eye[1]*h+o[2]*u))/N,n.eye[2]=(F*(p*o[2]-g*o[2])-R*D*(o[2]*n.eye[1]*h-o[0]*u))/N,(0,T.hs)(n.eye,n.eye,p),Be(n.eye),He(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,s.kU)(e),n=(0,T.Bw)(t);return(0,s.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,T.Bw)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,s.YN)(r/(n/Math.sin(e)));return(0,s.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);const o=r.getAltitude(t),a=e.spatialReference,c=r.referenceEllipsoid.radius,l=i.eye,u=1+(0,T.Io)(l,t)/(c+o),h=Math.sqrt(u*u-1),{minCurvature:d,maxCurvature:m,minSamples:f,maxSamples:p}=ze,g=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),v=(0,s.qE)((h-d)/(m-d),0,1),_=Math.round((0,s.Cc)(f,p,v)),x=i.aboveGround,y=n.planes[5],w=[],b=(0,re.O_)(M.uY,Ue,(0,re.vt)()),S=(0,re.O_)(M.uY,Ge,(0,re.vt)());(0,P.hZ)(Ze,0,0,0,0);const C=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-g:0,i=1===e&&x||3===e&&!x?g:1,a=n.lines[e],c=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const u=n/_,h=0===n?0:(0,s.Cc)(t,i,1===e?1-(1-u)**2:3===e?u**2:u),d=(0,T.Cc)(je,a.origin,c.origin,h),m=(0,Re.nu)(a.direction,c.direction,h,Ve);r.intersectManifoldClosestSilhouette((0,R.LV)(d,m),o,ke),ae(ke,l,ke,y),w.push((0,M.o8)(ke)),0!==w.length&&C((0,T.lo)(w.at(-1),ke));const f=((0,re.Tj)(b,ke)?1:0)|((0,re.Tj)(S,ke)?2:0);Ze[f]=1}}w.length>2&&(0,T.lo)(w[0],w.at(-1));const E=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const s of e)t.fromRenderCoords(s,ke,r),Math.abs(s[0])<i&&Math.abs(s[1])<i?(n.push([null,ke[1]]),n.push([null,ke[1]]),o=!0):n.push([ke[0],ke[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,P.m3)(Ze)>1?function(e,t){const r=[];for(const i of e)r.push(...Le(i,t));return r}(Le(w,b),S):[w],r,a);return new X.A({rings:E,spatialReference:a})},toExtent:function(e,t,r,i,n){let o,a,c,l;const u=t.latitude,h=(0,A.tO)(e.spatialReference).radius,d=t.longitude,m=function(e,t,r){const i=t/r,n=(0,s.kU)(e),o=Math.sin(i/2),a=Math.cos(n),c=2*(0,s.YN)(Math.sqrt(o*o/(a*a)));return(0,s.KJ)(c)}(u,r,h)/2;o=d-m,a=d+m;const f=(0,s.kU)(u),g=(1+Math.sin(f))/(1-Math.sin(f)),v=(g+1)*Math.tan(i/h/2),_=v*v;function x(e){const t=Math.PI/2;return(e=p.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(c=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*g+_))),l=c+i/h,c=x(c),l=x(l),l<c){const e=l;l=c,c=e}if(c=Math.max((0,s.KJ)(c),-90),l=Math.min((0,s.KJ)(l),90),a=_e.Y_.monotonic(o,a),a-o>180){const e=(a-o-180)/2;o+=e,a-=e}const y=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:S.A.WGS84;return n?(n.xmin=o,n.ymin=c,n.xmax=a,n.ymax=l,n.spatialReference=y):n=new Y.A(o,c,a,l,y),e.spatialReference&&e.spatialReference.isWebMercator&&(0,ye.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const qe="composite-color",Ye=["final-color",qe,"opaque-color","transparent-color"],Xe={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",PRE_TRANSPARENT:"pre-transparent-color",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserline-color",MAGNIFIER:"magnifier-color",OCCLUDED:"occluded-color",OPAQUE_ENVIRONMENT:"opaque-environment-color",SSAO:"ssao",TRANSPARENT_ENVIRONMENT:"transparent-environment-color",VIEWSHED:"viewshed-color"};Array.from(Object.values(Xe)).concat(Ye),(0,M.vt)();var Je=r(49186),Ke=r(10107),Qe=r(64108),et=r(44208),tt=(r(74887),r(94656)),rt=r(63907);r(93637),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,et.A)("esri-tests-disable-gpu-memory-measurements"),(0,tt.en)();(0,tt.en)();var it=r(90644),nt=r(76284),ot=r(48852),st=r(42293);const at=!!(0,et.A)("esri-tests-disable-gpu-memory-measurements");class ct{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(rt.vt.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:s}=t;s?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return at?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,st.MW)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(rt.vt.Renderbuffer,this),this._context=null)}}class lt{constructor(e,t,r){if(this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(rt.vt.FramebufferObject,this),null!=t){const r=function(e,t){return ut(t)||ht(t)?t:dt(t)?new nt.A(e,t):function(e){return 3===mt(e)||null!=e&&"samples"in e}(t)?new ct(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(rt.r6,r),ut(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(rt.r6)}if(null!=r)if(function(e){return ut(e)||dt(e)}(r))this._depthStencilTexture=ut(r)?r:new nt.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=ht(r)?r:new ct(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}dispose(){const{_colorAttachments:e,_glName:t}=this;if(0===e.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;const{_context:r}=this,i=r.getBoundFramebufferObject();e.forEach((e,t)=>this.detachColorTexture(t)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),r.gl.deleteFramebuffer(t),this._glName=null,r.bindFramebuffer(i===this?null:i),r.instanceCounter.decrement(rt.vt.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(rt.r6);return ut(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(rt.r6)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(rt.r6)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&ut(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=rt.r6){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=rt.r6){const t=this._colorAttachments.get(e);if(!t)return;const r=ut(t);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._initialized){const t=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{e.forEach(e=>{ut(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=rt.r6,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,0,r):this._framebufferTexture2D(i.glName,t,e,36160,0))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===rt.ld.UNSIGNED_INT_24_8?6402!==r||i===rt.ld.UNSIGNED_INT||i===rt.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,gt(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):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 e=this._depthStencilTexture;return e&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,gt(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){const{_context:t}=this,r=t.getBoundFramebufferObject();t.bindFramebuffer(this);const{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebufferObject(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,s){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const a=s.descriptor;3553!==s.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||e+r>this.width||t+i>this.height||n+r>a.width||o+i>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,l=c.bindTexture(s,nt.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(nt.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),c.bindTexture(l,nt.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,s){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),s||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,s)}async readPixelsAsync(e,t,r,i,n,o,s){const{gl:a}=this._context,c=ot.g.createPixelPack(this._context,35041,s.byteLength);this._context.bindBuffer(c);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),a.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(l),await c.getSubDataAsync(s),c.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(ft(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(ft(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,tt.en)())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((t,r)=>{if(ut(t)){const i=pt(t);35866===i?this._framebufferTextureLayer(t.glName,r,e,0,0):this._framebufferTexture2D(t.glName,r,i,e)}else if(ht(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=gt(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,pt(this._depthStencilTexture),e)}(0,tt.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=rt.r6,r=3553,i=36160,n=0){this._context.gl.framebufferTexture2D(i,t,r,e,n)}_framebufferTextureLayer(e,t=rt.r6,r=36160,i=0,n=0){this._context.gl.framebufferTextureLayer(r,t,e,i,n)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,gt(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,a.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),ft(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){ft(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case rt.SB.DEPTH_COMPONENT16:case rt.SB.DEPTH_COMPONENT24:case rt.SB.DEPTH_COMPONENT32F:return rt.xL;case rt.iE.DEPTH24_STENCIL8:case rt.iE.DEPTH32F_STENCIL8:return rt.nI;case 36168:return rt.uH;default:return rt.r6}}_validateColorAttachmentPoint(e){if(-1===lt._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;lt._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const t=e-rt.r6;t+1>lt._MAX_COLOR_ATTACHMENTS&&O.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${lt._MAX_COLOR_ATTACHMENTS} color attachments`)}}function ut(e){return 1===mt(e)}function ht(e){return 2===mt(e)}function dt(e){return 0===mt(e)}function mt(e){return null!=e&&"type"in e?e.type:null}function ft(e,t){const r=Math.max(e.width,e.height);if(r>t){O.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function pt(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function gt(e){return 6402===e?rt.xL:rt.nI}var vt=r(67171),_t=(r(21818),r(69397),r(85079)),xt=r(74038);const yt=[new xt._("position",2,rt.pe.UNSIGNED_SHORT,0,4)];new xt._("a_pos",2,rt.pe.BYTE,0,2),new xt._("a_pos",2,rt.pe.BYTE,0,4),new xt._("a_tex",2,rt.pe.BYTE,2,4),(0,_t.Xk)(yt),r(66289);const wt=new Image;wt.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",wt.width=5,wt.height=5,wt.decode();let bt=class extends I.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=qe,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,c.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},c.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Je.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){var t;e.initializeAndBind(),this.gl.drawBuffers((t=e)?t.colorAttachments.length>0?t.colorAttachments:[rt.$0]:[rt.C5])}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,Ke.MZ)({constructOnly:!0})],bt.prototype,"view",void 0),(0,o.Cg)([(0,Ke.MZ)({constructOnly:!0})],bt.prototype,"consumes",void 0),(0,o.Cg)([(0,Ke.MZ)()],bt.prototype,"produces",void 0),(0,o.Cg)([(0,Ke.MZ)({readOnly:!0})],bt.prototype,"techniques",null),bt=(0,o.Cg)([(0,Qe.$)("esri.views.3d.webgl.RenderNode")],bt);const Tt=bt;var Mt=r(15581),St=r(13840),Ct=r(42958),Et=r(95774);let At=class extends Ct.w{constructor(){super(...arguments),this.shader=new St.r(Et.S,()=>r.e(1285).then(r.bind(r,91285)))}initializePipeline(){return(0,it.Ey)({colorWrite:it.kn})}};At=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],At);var Rt=r(65786);class It extends Rt.Y{constructor(){super(...arguments),this.projScale=1}}class Ot extends It{constructor(){super(...arguments),this.intensity=1}}class Ft extends Rt.Y{}class Dt extends Ft{constructor(){super(...arguments),this.blurSize=(0,N.vt)()}}let Nt=class extends Ct.w{constructor(){super(...arguments),this.shader=new St.r(Mt.S,()=>r.e(6122).then(r.bind(r,86122)))}initializePipeline(){return(0,it.Ey)({colorWrite:it.kn})}};Nt=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],Nt);let Pt=class extends Tt{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=Xe.SSAO,this.isEnabled=()=>!1,this._enableTime=(0,l.l5)(0),this._passParameters=new Ot,this._drawParameters=new Dt}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new vt.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new nt.A(this.renderingContext,t,e),this.addHandles((0,c.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,l.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,a.WD)(this._passParameters.noiseTexture)}precompile(){this.techniques.precompile(Nt),this.techniques.precompile(At)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(rt.nI);if(!r||!i)return;const n=this.techniques.getCompiled(Nt),o=this.techniques.getCompiled(At);if(!n||!o)return this._enableTime=(0,l.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,l.l5)(performance.now()));const a=this.renderingContext,c=this.view.qualitySettings.fadeDuration,u=this.bindParameters,d=u.camera,m=d.relativeElevation,f=(0,s.qE)((5e5-m)/2e5,0,1),p=c>0?Math.min(c,performance.now()-this._enableTime)/c:1,g=p*f;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Bt/(0,Mt.g)(d)**6*g;const v=d.fullViewport[2],_=d.fullViewport[3],x=this.fboCache.acquire(v,_,"ssao input",2);a.bindFramebuffer(x.fbo),a.setViewport(0,0,v,_),a.bindTechnique(n,u,this._passParameters,this._drawParameters),a.screen.draw();const y=Math.round(v/2),w=Math.round(_/2),b=this.fboCache.acquire(y,w,"ssao blur",0);a.bindFramebuffer(b.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,h.hZ)(this._drawParameters.blurSize,0,2/_),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,y,w),a.screen.draw(),x.release();const T=this.fboCache.acquire(y,w,Xe.SSAO,0);return a.bindFramebuffer(T.fbo),a.setViewport(0,0,v,_),a.setClearColor(1,1,1,0),a.clear(16384),this._drawParameters.colorTexture=b.getTexture(),(0,h.hZ)(this._drawParameters.blurSize,2/v,0),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,y,w),a.screen.draw(),a.setViewport4fv(d.fullViewport),b.release(),p<1&&this.requestRender(2),T}};(0,o.Cg)([(0,u.MZ)()],Pt.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],Pt.prototype,"produces",void 0),(0,o.Cg)([(0,u.MZ)({constructOnly:!0})],Pt.prototype,"isEnabled",void 0),Pt=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],Pt);const Bt=.5;function Ht(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
563
|
+
}`))}(e,t)}},43730(e,t,r){r.d(t,{n:()=>Ht});var i=r(31821),n=r(12791),o=r(5482),s=r(34727),a=r(97768),c=r(36708),l=r(78659),u=r(91429),h=r(37585),d=r(69540);let m=class extends d.Pw{constructor(e){super(e),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(e){return null!=e&&this.row===e.row&&this.rows===e.rows&&this.column===e.column&&this.columns===e.columns}};(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"row",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"column",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"rows",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],m.prototype,"columns",void 0),m=(0,o.Cg)([(0,u.$K)("esri.CameraLayout")],m);const f=m;var p=r(69052),g=r(25482),v=r(56507),_=r(86738),x=r(43937),y=r(36005);let w=class extends((0,d.OU)(g.o)){constructor(...e){super(...e),this.position=new _.A([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new f}normalizeCtorArgs(e,t,r,i){if(e&&"object"==typeof e&&("x"in e||Array.isArray(e))){const n={position:e};return null!=t&&(n.heading=t),null!=r&&(n.tilt=r),null!=i&&(n.fov=i),n}return e}writePosition(e,t,r,i){const n=e.clone();n.x=(0,v.GB)(e.x||0),n.y=(0,v.GB)(e.y||0),n.z=e.hasZ?(0,v.GB)(e.z||0):e.z,t[r]=n.write({},i)}readPosition(e,t){const r=new _.A;return r.read(e,t),r.x=(0,v.GB)(r.x||0),r.y=(0,v.GB)(r.y||0),r.z=r.hasZ?(0,v.GB)(r.z||0):r.z,r}equals(e){return null!=e&&this.tilt===e.tilt&&this.heading===e.heading&&this.fov===e.fov&&this.position.equals(e.position)&&this.layout.equals(e.layout)}};(0,o.Cg)([(0,u.MZ)({type:_.A,json:{write:{isRequired:!0}}})],w.prototype,"position",void 0),(0,o.Cg)([(0,x.K)("position")],w.prototype,"writePosition",null),(0,o.Cg)([(0,y.w)("position")],w.prototype,"readPosition",null),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,u.wg)(e=>p.ie.normalize((0,v.GB)(e)))],w.prototype,"heading",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),(0,u.wg)(e=>(0,s.qE)((0,v.GB)(e),-180,180))],w.prototype,"tilt",void 0),(0,o.Cg)([(0,u.MZ)({type:Number,nonNullable:!0,json:{default:55,write:!0}}),(0,u.wg)(e=>(0,s.qE)((0,v.GB)(e,55),1,170))],w.prototype,"fov",void 0),(0,o.Cg)([(0,u.MZ)({type:f,nonNullable:!0,json:{read:!1,write:!1}})],w.prototype,"layout",void 0),w=(0,o.Cg)([(0,u.$K)("esri.Camera")],w);var b=r(9093),T=r(35522),M=r(51850),S=r(16930),C=(r(48353),r(9762),r(65806)),E=r(27993),A=r(73941),R=(r(19419),r(71351)),I=r(69622),O=r(53966),F=r(90629),D=r(58083),N=r(48163),P=r(78955),B=r(91829),H=r(82919),L=r(44280);function z(e,t,r){e.worldUpAtPosition(t,U),(0,T.Re)(G,r,t);const i=(0,T.Bw)(G);return 0===i?0:(0,s.XM)((0,T.Om)(G,U)/i)}const U=(0,M.vt)(),G=(0,M.vt)();var V;let j=V=class extends I.A{constructor(e){super(e),this._ray=(0,R.vt)(),this._viewport=(0,B.fA)(0,0,1,1),this._padding=(0,B.fA)(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=(0,N.fA)(1,1e3),this._viewDirty=!0,this._viewMatrix=(0,b.vt)(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=(0,b.vt)(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=(0,b.vt)(),this._frustumDirty=!0,this._frustum=(0,H.vt)(),this._fullViewport=(0,B.vt)(),this._pixelRatio=1,this.row=0,this.column=0,this._rows=1,this._columns=1,this._center=(0,M.vt)(),this._up=(0,M.vt)(),this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(e){this._pixelRatio=e>0?e:1}get rows(){return this._rows}set rows(e){this._rows=Math.max(1,e)}get columns(){return this._columns}set columns(e){this._columns=Math.max(1,e)}get eye(){return this._ray.origin}set eye(e){this._compareAndSetView(e,this._ray.origin)}get center(){return this._center}set center(e){this._compareAndSetView(e,this._center,"_center")}get ray(){return(0,T.Re)(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(e){this._compareAndSetView(e,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(e){(0,D.C)(this._viewMatrix,e),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),(0,T.hZ)((0,M.vt)(),-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10])}get viewUp(){return this._ensureViewClean(),(0,T.hZ)((0,M.vt)(),this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9])}get viewRight(){return this._ensureViewClean(),(0,T.hZ)((0,M.vt)(),this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8])}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(e){this._nearFar[0]!==e&&(this._nearFar[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(e){this._nearFar[1]!==e&&(this._nearFar[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(e){this.x=e[0],this.y=e[1],this.width=e[2],this.height=e[3]}get screenViewport(){if(1===this.pixelRatio)return this._viewport;const e=(0,P.hs)((0,B.vt)(),this._viewport,1/this.pixelRatio),t=this._get("screenViewport");return t&&(0,P.aI)(e,t)?t:e}get screenPadding(){if(1===this.pixelRatio)return this._padding;const e=(0,P.hs)((0,B.vt)(),this._padding,1/this.pixelRatio),t=this._get("screenPadding");return t&&(0,P.aI)(e,t)?t:e}get x(){return this._viewport[0]}set x(e){e+=this._padding[3],this._viewport[0]!==e&&(this._viewport[0]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(e){e+=this._padding[2],this._viewport[1]!==e&&(this._viewport[1]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(e){this._viewport[2]!==e&&(this._viewport[2]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(e){this._viewport[3]!==e&&(this._viewport[3]=e,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[1]+this._padding[3]}set fullWidth(e){this.width=e-(this._padding[1]+this._padding[3])}get fullHeight(){return this._viewport[3]+this._padding[0]+this._padding[2]}set fullHeight(e){this.height=e-(this._padding[0]+this._padding[2])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[3],this._fullViewport[1]=this._viewport[1]-this._padding[2],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(e){(0,P.t2)(this._padding,e)||(this._viewport[0]+=e[3]-this._padding[3],this._viewport[1]+=e[2]-this._padding[2],this._viewport[2]-=e[1]+e[3]-(this._padding[1]+this._padding[3]),this._viewport[3]-=e[0]+e[2]-(this._padding[0]+this._padding[2]),(0,P.C)(this._padding,e),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&((0,D.lw)(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){return this._projectionMatrixInternal}get inverseProjectionMatrix(){return(0,D.B8)((0,b.vt)(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||(0,b.vt)()}get fov(){return this._fov}set fov(e){this._fov=e,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(t*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovX(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/t)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return e=this._fov,t=this.width,r=this.height,2*Math.atan(r*Math.tan(.5*e)/Math.sqrt(t*t+r*r));var e,t,r}set fovY(e){this._fov=function(e,t,r){return 2*Math.atan(Math.sqrt(t*t+r*r)*Math.tan(.5*e)/r)}(e,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return(0,T.Io)(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&((0,D.B8)(this._viewInverseTransposeMatrix,this.viewMatrix),(0,D.mg)(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(e){const{near:t,far:r}=this;return 2*t*r/(r+t-e*(r-t))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return null!=this.relativeElevation&&this.relativeElevation>=0}get _projectionMatrixInternal(){const e=this.width,t=this.height,r=this.near*Math.tan(this.fovY/2)*2,i=r*this._aspect,n=r/this.rows,o=i/this.columns,s=-i/2+this.column*o,a=s+o,c=-r/2+this.row*n,l=c+n,u=(0,D.$h)((0,b.vt)(),s*(1+2*this._padding[3]/e),a*(1+2*this._padding[1]/e),c*(1+2*this._padding[2]/t),l*(1+2*this._padding[0]/t),this.near,this.far),h=this._get("projectionMatrix");return h&&(0,D.aI)(h,u)?h:u}copyFrom(e){(0,T.C)(this._ray.origin,e.eye),this.center=e.center,this.up=e.up,(0,P.C)(this._viewport,e.viewport),this.notifyChange("_viewport"),(0,P.C)(this._padding,e.padding),this.notifyChange("_padding"),(0,h.C)(this._nearFar,e.nearFar),this.notifyChange("_nearFar"),this._fov=e.fov,this.row=e.row,this.column=e.column,this.rows=e.rows,this.columns=e.columns,this.relativeElevation=e.relativeElevation;const t=e;return this._viewDirty=t._viewDirty,this._viewDirty||((0,D.C)(this._viewMatrix,e.viewMatrix),this.notifyChange("_viewMatrix")),this._viewProjectionDirty=!0,this._frustumDirty=t._frustumDirty,this._frustumDirty||((0,H.C)(this._frustum,e.frustum),this._frustumDirty=!1),t._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:((0,D.C)(this._viewInverseTransposeMatrix,e.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),(0,P.C)(this._fullViewport,e.fullViewport),this.pixelRatio=e.pixelRatio,this}copyViewFrom(e){this.eye=e.eye,this.center=e.center,this.up=e.up,this.fov=e.fov}clone(){return(new V).copyFrom(this)}equals(e){return(0,T.t2)(this.eye,e.eye)&&(0,T.t2)(this.center,e.center)&&(0,T.t2)(this.up,e.up)&&(0,P.t2)(this._viewport,e.viewport)&&(0,P.t2)(this._padding,e.padding)&&(0,h.t2)(this.nearFar,e.nearFar)&&this._fov===e.fov&&this.pixelRatio===e.pixelRatio&&this.relativeElevation===e.relativeElevation&&this.row===e.row&&this.column===e.column&&this.rows===e.rows&&this.columns===e.columns}almostEquals(e){const t=Math.max(1,1/this.pixelRatio,1/e.pixelRatio);if(Math.abs(e.fov-this._fov)>=.001||(0,P.hG)(e.screenPadding,this.screenPadding)>=t||(0,P.hG)(this.screenViewport,e.screenViewport)>=t||this.row!==e.row||this.column!==e.column||this.rows!==e.rows||this.columns!==e.columns)return!1;(0,T.jb)($,e.eye,e.center),(0,T.jb)(Z,this.eye,this.center);const r=(0,T.Om)($,Z),i=(0,T.uE)($),n=(0,T.uE)(Z),o=5e-4;return r*r>=(1-1e-10)*i*n&&(0,T.lo)(e.eye,this.eye)<Math.max(i,n)*o*o}computeRenderPixelSizeAt(e){return this.computeRenderPixelSizeAtDist(this._viewDirectionDistance(e))}computeRenderPixelSizeAtDist(e){return e*this.perRenderPixelRatio}computeScreenPixelSizeAt(e){return this.computeScreenPixelSizeAtDist(this._viewDirectionDistance(e))}_viewDirectionDistance(e){return Math.abs((0,L.gr)(this.viewForward,(0,T.Re)($,e,this.eye)))}computeScreenPixelSizeAtDist(e){return e*this.perScreenPixelRatio}computeDistanceFromRadius(e,t){return e/Math.tan(Math.min(this.fovX,this.fovY)/(2*(t||1)))}getScreenCenter(e=(0,F.gs)()){return e[0]=(this.padding[3]+this.width/2)/this.pixelRatio,e[1]=(this.padding[0]+this.height/2)/this.pixelRatio,e}getRenderCenter(e,t=.5,r=.5){return e[0]=this.padding[3]+this.width*t,e[1]=this.padding[2]+this.height*r,e[2]=.5,e}setGLViewport(e){const t=this.viewport,r=this.padding;e.setViewport(t[0]-r[3],t[1]-r[2],t[2]+r[1]+r[3],t[3]+r[0]+r[2])}applyProjection(e,t){e!==k&&(0,T.C)(k,e),k[3]=1,(0,P.Z0)(k,k,this.projectionMatrix);const r=Math.abs(k[3]);(0,T.hs)(k,k,1/r);const i=this.fullViewport;t[0]=(0,s.Cc)(0,i[0]+i[2],.5+.5*k[0]),t[1]=(0,s.Cc)(0,i[1]+i[3],.5+.5*k[1]),t[2]=.5*(k[2]+1),t[3]=r}unapplyProjection(e,t){const r=this.fullViewport;k[0]=(e[0]/(r[0]+r[2])*2-1)*e[3],k[1]=(e[1]/(r[1]+r[3])*2-1)*e[3],k[2]=(2*e[2]-1)*e[3],k[3]=e[3],null!=this.inverseProjectionMatrix&&((0,P.Z0)(k,k,this.inverseProjectionMatrix),t[0]=k[0],t[1]=k[1],t[2]=k[2])}projectToScreen(e,t){return this.projectToRenderScreen(e,q),this.renderToScreen(q,t),t}projectToRenderScreen(e,t){if(k[0]=e[0],k[1]=e[1],k[2]=e[2],k[3]=1,(0,P.Z0)(k,k,this.viewProjectionMatrix),0===k[3])return null;const r=k;(0,T.hs)(r,r,1/Math.abs(k[3]));const i=this.fullViewport,n=(0,s.Cc)(0,i[0]+i[2],.5+.5*r[0]),o=(0,s.Cc)(0,i[1]+i[3],.5+.5*r[1]);return"x"in t?(t.x=n,t.y=o):(t[0]=n,t[1]=o,t.length>2&&(t[2]=.5*(r[2]+1))),t}unprojectFromScreen(e,t){return this.unprojectFromRenderScreen(this.screenToRender(e,q),t)}unprojectFromRenderScreen(e,t){if((0,D.lw)(W,this.projectionMatrix,this.viewMatrix),!(0,D.B8)(W,W))return null;const r=this.fullViewport;return k[0]=2*(e[0]-r[0])/r[2]-1,k[1]=2*(e[1]-r[1])/r[3]-1,k[2]=2*e[2]-1,k[3]=1,(0,P.Z0)(k,k,W),0===k[3]?null:(t[0]=k[0]/k[3],t[1]=k[1]/k[3],t[2]=k[2]/k[3],t)}constrainWindowSize(e,t,r,i){const n=e*this.pixelRatio,o=t*this.pixelRatio,s=Math.max(n-r/2,0),a=Math.max(this.fullHeight-o-i/2,0),c=-Math.min(n-r/2,0),l=-Math.min(this.fullHeight-o-i/2,0),u=r-c- -Math.min(this.fullWidth-n-r/2,0),h=i-l- -Math.min(o-i/2,0);return[Math.round(s),Math.round(a),Math.round(u),Math.round(h)]}computeUp(e){1===e?this._computeUpGlobal():this._computeUpLocal()}screenToRender(e,t){const r=e[0]*this.pixelRatio,i=this.fullHeight-e[1]*this.pixelRatio;return t[0]=r,t[1]=i,t}renderToScreen(e,t){const r=e[0]/this.pixelRatio,i=(this.fullHeight-e[1])/this.pixelRatio;t[0]=r,t[1]=i}sphereFrustumCoverage(e,t){const{center:r,eye:i,distance:n,fovY:o}=this,s=Math.abs(Math.PI/2-z(t,r,i));return e.frustumCoverage(s,n,o)}_computeUpGlobal(){(0,T.Re)($,this.center,this.eye);const e=(0,T.Bw)(this.center);e<1?(0,T.t2)(this._up,M.Cb)&&((0,T.C)(this._up,M.Cb),this._markViewDirty(),this.notifyChange("_up")):Math.abs((0,T.Om)($,this.center))>.9999*(0,T.Bw)($)*e||((0,T.$A)(Z,$,this.center),(0,T.$A)(Z,Z,$),(0,T.S8)(Z,Z),(0,T.t2)(this._up,Z)||((0,T.C)(this._up,Z),this.notifyChange("_up"),this._markViewDirty()))}_computeUpLocal(){(0,T.oW)($,this.eye,this.center),Math.abs($[2])<=.9999&&((0,T.hs)($,$,$[2]),(0,T.hZ)($,-$[0],-$[1],1-$[2]),(0,T.S8)($,$),(0,T.t2)(this._up,$)||((0,T.C)(this._up,$),this.notifyChange("_up"),this._markViewDirty()))}_compareAndSetView(e,t,r=""){"number"==typeof e[0]&&isFinite(e[0])&&"number"==typeof e[1]&&isFinite(e[1])&&"number"==typeof e[2]&&isFinite(e[2])?(0,T.t2)(e,t)||((0,T.C)(t,e),this._markViewDirty(),r.length&&this.notifyChange(r)):O.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,H.ui)(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&((0,D.t5)(this._viewMatrix,this.eye,this.center,this.up),this.notifyChange("_viewMatrix"),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};(0,o.Cg)([(0,u.MZ)()],j.prototype,"_viewport",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_padding",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_fov",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_nearFar",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_viewDirty",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_viewMatrix",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_pixelRatio",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"pixelRatio",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"row",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"column",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_rows",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"rows",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_columns",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"columns",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"eye",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"center",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_center",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"up",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"_up",void 0),(0,o.Cg)([(0,u.MZ)()],j.prototype,"viewMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"viewForward",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"viewUp",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"viewRight",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"nearFar",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"near",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"far",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"viewport",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"screenViewport",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"screenPadding",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"x",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"y",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"width",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"height",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fullWidth",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fullHeight",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"_aspect",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"padding",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"projectionMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"inverseProjectionMatrix",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fov",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fovX",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"fovY",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"viewInverseTransposeMatrix",null),(0,o.Cg)([(0,u.MZ)({readOnly:!0})],j.prototype,"_projectionMatrixInternal",null),(0,o.Cg)([(0,u.MZ)()],j.prototype,"relativeElevation",void 0),j=V=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl.RenderCamera")],j);const k=(0,B.vt)(),W=(0,b.vt)(),$=(0,M.vt)(),Z=(0,M.vt)(),q=(0,F.r_)();r(49718),r(6867),r(16396),(0,M.vt)(),(0,M.vt)(),(0,M.vt)();var Y=r(5443),X=r(39829),J=r(95108);function K(e,t,r,i){const n=function(e,t){const r=0===t||2===t?0:1,i=e[t],n=0===t||1===t?1:-1,o=0===r?1:0;return(e,t,s)=>{if(t[r]<i&&s[r]<i)return 1===n?0:1;if(t[r]>i&&s[r]>i)return 1===n?1:0;const a=(s[o]-t[o])/(s[r]-t[r]),c=t[o]+a*(i-t[r]);return e[r]=i,e[o]=c,(t[r]<i?1:-1)*n>0?2:3}}(r,i);if(e.length=0,t.length){1===n(ee,t[0],t[0])&&Q(e,t[0]);for(let r=0;r<t.length;r++){const i=t[r===t.length-1?0:r+1];switch(n(ee,t[r],i)){case 1:Q(e,i);break;case 3:Q(e,(0,N.o8)(ee));break;case 2:Q(e,(0,N.o8)(ee)),Q(e,i)}}}}function Q(e,t){0!==e.length&&(0,h.aI)(e.at(-1),t)||e.push(t)}const ee=(0,N.vt)();var te=r(11964),re=r(27921);const ie=(0,M.vt)(),ne=(0,M.vt)();function oe(){return{direction:(0,M.vt)(),up:(0,M.vt)()}}function se(e,t,r,i,n){let o=(0,T.S8)(ie,e),a=(0,T.Om)(o,i);const c=a>0;a=Math.abs(a),a>.99&&(a=Math.abs((0,T.Om)(t,i)),a<.99?((0,T.C)(o,t),c&&(0,T.hs)(o,o,-1)):o=null);let l=0;if(o){(0,T.hs)(ne,i,(0,T.Om)(i,o)),(0,T.Re)(o,o,ne);const e=(0,T.Om)(o,n)/((0,T.Bw)(o)*(0,T.Bw)(n));(0,T.$A)(ne,o,n),l=((0,T.Om)(ne,i)>0?1:-1)*(0,s.KJ)((0,s.XM)(e))}const u=(0,s.KJ)((0,s.XM)(-(0,T.Om)(i,e)/(0,T.Bw)(e)));return r?(r.heading=l,r.tilt=u,r):{heading:l,tilt:u}}function ae(e,t,r,i){(0,T.Re)(ce,r,t),(0,re.T7)(i,(0,te.LV)(t,ce),e)||e===r||(0,T.C)(e,r)}const ce=(0,M.vt)(),le=(0,M.fA)(0,1,0),ue=(0,M.fA)(0,0,1),he=(0,b.vt)(),de=(0,M.vt)(),me=(0,M.vt)();function fe(e,t,r,i=oe()){const{direction:n,up:o}=i;return(0,D.N9)(he,-(0,s.kU)(t)),(0,D.eL)(he,he,(0,s.kU)(r)),(0,T.Z0)(n,ue,he),(0,T.hs)(n,n,-1),(0,T.Z0)(o,le,he),i}function pe(e,t,r,i,n){const o=t.lines[11].direction,s=(n-r.getAltitude(i))/o[2];(0,T.Ln)(e,i,o,s)}const ge=(0,M.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){return se(t,r,i,ue,le)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n=fe(0,r,i),o=(0,M.vt)();return(0,T.hs)(o,n.direction,-t),(0,T.WQ)(o,o,e),{up:n.up,eye:o,heading:r,tilt:i}},eyeTiltToLookAtTilt:function(e){return(0,s.kU)(e)},headingTiltToDirectionUp:fe,lookAtTiltToEyeTilt:function(e){return(0,s.KJ)(e)},toArea:function(e,t){const r=e.frustum,{renderCoordsHelper:i}=e,n=i.getAltitude(t),o=e.spatialReference,s=e.state.camera.eye,a=[],c=r.planes[5];for(let e=0;e<4;e++){const t=r.lines[e];i.intersectInfiniteManifold((0,R.LV)(t.origin,t.direction),n,ge)||pe(ge,r,i,t.endpoint,n),ae(ge,s,ge,c),a.push((0,N.fA)(ge[0],ge[1]))}return function(e,t,r){const i=e.map(e=>((0,T.hZ)(ge,e[0],e[1],0),t.fromRenderCoords(ge,ge,r),[ge[0],ge[1]]));return i.length<=2?new X.A({spatialReference:r}):(i.push(i[0].slice()),(0,J.$3)(i)||i.reverse(),new X.A({rings:[i],spatialReference:r}))}(function(e,t){const r=[],i=[];return K(r,e,t,0),K(i,r,t,1),K(r,i,t,2),K(i,r,t,3),i}(a,i.extent),i,o)},toExtent:function(e,t,r,i,n){const o=e.renderSpatialReference,s=e.spatialReference??t.spatialReference;return(0,C.g)(t,de,o),(0,C.g)(t,me,o),de[0]-=r/2,me[0]+=r/2,de[1]-=i/2,me[1]+=i/2,(0,E.F)(de,o,de,s),(0,E.F)(me,o,me,s),n?(n.xmin=de[0],n.ymin=de[1],n.xmax=me[0],n.ymax=me[1],n.spatialReference=s):n=new Y.A(de[0],de[1],me[0],me[1],s),n}},Symbol.toStringTag,{value:"Module"}));var ve=r(34304),_e=r(17136),xe=r(94008),ye=r(28735);class we{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(e){this.renderCoordsHelper=e,this.frustum=(0,H.vt)(),this._points=(0,H.Qy)(),this.lines=new Array(12),this._origin=(0,M.vt)(),this._direction=(0,M.vt)(),this._boundingSphere=new xe.iy,this._altitude=null,this._boundingSphereDirty=!0;for(let e=0;e<12;e++)this.lines[e]={origin:null,direction:(0,M.vt)(),endpoint:null}}update(e){(0,H.ui)(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),(0,T.C)(this._origin,e.eye),(0,T.C)(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines(),this._boundingSphereDirty=!0}updatePoints(e){for(let t=0;t<this._points.length;t++)(0,T.C)(this._points[t],e[t]);(0,H.DV)(this.frustum,this._points),this._updateLines()}get altitude(){return this._altitude}intersectsSphere(e){return(0,H.m7)(this.frustum,e)}intersectsRay(e){return(0,H.pw)(this.frustum,e)}intersectsLineSegment(e,t){return(0,H.ST)(this.frustum,e,t)}intersectsPoint(e){return(0,H.bU)(this.frustum,e)}_updateLines(){const e=this._points;for(let t=0;t<4;t++){const r=t+4;be(this.lines[t],e[t],e[r]),be(this.lines[t+4],e[t],3===t?e[0]:e[t+1]),be(this.lines[t+8],e[r],3===t?e[4]:e[r+1])}}_updateBoundingSphere(){const{origin:e}=this,t=Me;(0,T.S8)(t,this.direction);const r=Te;(0,T.jb)(r,this.points[4],e);const i=.5*(0,T.Om)(r,r)/(0,T.Om)(t,r),n=this._boundingSphere,o=(0,T.Ln)(Se,e,t,i);n.center=o,n.radius=i}static{this.planePointIndices=H.c8}static{this.nearFarLineIndices=[[0,4],[1,5],[2,6],[3,7]]}}function be(e,t,r){e.origin=t,e.endpoint=r,(0,T.oW)(e.direction,t,r)}const Te=(0,M.vt)(),Me=(0,M.vt)(),Se=(0,M.vt)();r(86211);const Ce=(0,M.fA)(5802e-9,13558e-9,331e-7),Ee=(0,M.fA)(65e-8*3,5643e-9,255e-9);(0,M.fA)(Ce[0]+Ee[0],Ce[1]+Ee[1],Ce[2]+Ee[2]);class Ae{constructor(e=1/0,t=-1/0){this.near=e,this.far=t}set(e,t){this.near=e,this.far=t}union(e){return null!=e&&(this.near=Math.min(this.near,e.near),this.far=Math.max(this.far,e.far)),this}within(e){return this.near<=e&&e<=this.far}equals(e){return this.near===e.near&&this.far===e.far}static{this.Zero=new Ae(0,0)}static{this.Infinite=new Ae}}(0,M.vt)(),(0,M.vt)(),new xe.iy,(0,R.vt)(),new Y.A({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0});var Re=r(32728);const Ie=(0,M.fA)(0,0,1),Oe=(0,T.S8)((0,M.vt)(),(0,M.fA)(1,1,1)),Fe=(0,b.vt)(),De=(0,M.vt)(),Ne=(0,M.vt)();function Pe(e,t,r,i=oe()){(0,T.$A)(De,e,Ie),0===(0,T.Om)(De,De)&&(0,T.$A)(De,e,Oe),(0,D.$0)(Fe,-(0,s.kU)(t),e),(0,D.e$)(Fe,Fe,-(0,s.kU)(r),De);const{up:n,direction:o}=i;return(0,T.$A)(n,De,e),(0,T.S8)(n,n),(0,T.Z0)(n,n,Fe),(0,T.S8)(o,e),(0,T.ze)(o,o),(0,T.Z0)(o,o,Fe),i}function Be(e){const t=e[1];e[1]=-e[2],e[2]=t}function He(e,t){const r=Pe(t,e.heading,e.tilt);return e.up=r.up,e}function Le(e,t){const r=[],i=[],n=(0,ve.FD)();for(let o=0;o<e.length;o++){const s=e[o],a=o===e.length-1?e[0]:e[o+1],c=(0,te.Cr)(s,a,$e),l=(0,re.vE)(t,c.origin,c.vector,0,ke);switch(l){case 2:r.push(s);break;case 3:i.push(s);break;case 0:case 1:{const[e,o,a]=0===l?[1,r,i]:[-1,i,r],c=(0,re.Qj)(t),u=(0,T.Ln)((0,M.vt)(),ke,c,e*n),h=(0,T.Ln)((0,M.vt)(),ke,c,e*-n);o.push(s),o.push(u),a.push(h)}}}const o=[];return r.length&&o.push(r),i.length&&o.push(i),o}const ze={minCurvature:(0,s.kU)(5),maxCurvature:(0,s.kU)(50),minSamples:1,maxSamples:6},Ue=(0,M.fA)(1,0,0),Ge=(0,M.fA)(0,1,0),Ve=(0,M.vt)(),je=(0,M.vt)(),ke=(0,M.vt)(),We=new xe.iy,$e=(0,te.vt)(),Ze=(0,B.vt)();Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:function(e,t,r,i){const n=De,o=Ne;return(0,T.S8)(n,e),(0,T.$A)(Ne,n,Ie),0===(0,T.Om)(Ne,Ne)&&(0,T.$A)(Ne,n,Oe),(0,T.$A)(o,Ne,n),se(t,r,i,n,o)},eyeForCenterWithHeadingTilt:function(e,t,r,i){const n={eye:(0,M.vt)(),up:null,tilt:i,heading:r},o=De;o[0]=e[0],o[1]=e[2],o[2]=-e[1];const a=t,c=(0,s.kU)(r),l=(0,s.kU)(i),u=Math.sin(c),h=Math.cos(c),d=Math.sin(l),m=Math.cos(l),f=(0,T.Bw)(o);let p;if(Math.abs(l)<1e-8)p=a+f;else{const e=f/d,t=(0,s.YN)(a/e),r=Math.PI-l-t;p=e*Math.sin(r)}const g=m*a,v=a*a*(d*d),_=h*h*v,x=p-g,y=x*x,w=_*(_+y-o[1]*o[1]);if(w<0)return(0,T.hs)(n.eye,o,p/f),n.tilt=0,He(n,e);const b=Math.sqrt(w),S=o[1]*x,C=_+y;let E;if(E=h>0?-b+S:b+S,Math.abs(C)<1e-8)return f<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=a):(0,T.hs)(n.eye,o,p/f),n.tilt=0,Be(n.eye),He(n,e);n.eye[1]=E/C;const A=u*u*v,R=d*a,I=h*R*n.eye[1],O=n.eye[1]*n.eye[1],F=1-O,D=Math.sqrt(F),N=_*O+A-2*I*D*x+F*y;return Math.abs(N)<1e-8?((0,T.hs)(n.eye,o,p/f),n.tilt=0,Be(n.eye),He(n,e)):(n.eye[0]=(F*(p*o[0]-g*o[0])-R*D*(o[0]*n.eye[1]*h+o[2]*u))/N,n.eye[2]=(F*(p*o[2]-g*o[2])-R*D*(o[2]*n.eye[1]*h-o[0]*u))/N,(0,T.hs)(n.eye,n.eye,p),Be(n.eye),He(n,e))},eyeTiltToLookAtTilt:function(e,t,r){const i=(0,s.kU)(e),n=(0,T.Bw)(t);return(0,s.YN)(r/(n/Math.sin(i)))+i},headingTiltToDirectionUp:Pe,lookAtTiltToEyeTilt:function(e,t,r){const i=(0,T.Bw)(t),n=Math.sqrt(r*r+i*i-2*r*i*Math.cos(Math.PI-e)),o=(0,s.YN)(r/(n/Math.sin(e)));return(0,s.KJ)(e-o)},toArea:function(e,t){const{renderCoordsHelper:r}=e,i=e.state.camera.clone(),n=new we(r);i.near=2,n.update(i);const o=r.getAltitude(t),a=e.spatialReference,c=r.referenceEllipsoid.radius,l=i.eye,u=1+(0,T.Io)(l,t)/(c+o),h=Math.sqrt(u*u-1),{minCurvature:d,maxCurvature:m,minSamples:f,maxSamples:p}=ze,g=function(e){const{renderCoordsHelper:t,state:r}=e,i=Math.abs(t.getAltitude(r.camera.center));return We.radius=t.referenceEllipsoid.radius+i,r.camera.sphereFrustumCoverage(We,t)}(e),v=(0,s.qE)((h-d)/(m-d),0,1),_=Math.round((0,s.Cc)(f,p,v)),x=i.aboveGround,y=n.planes[5],w=[],b=(0,re.O_)(M.uY,Ue,(0,re.vt)()),S=(0,re.O_)(M.uY,Ge,(0,re.vt)());(0,P.hZ)(Ze,0,0,0,0);const C=e=>{};for(let e=0;e<4;e++){const t=1===e&&!x||3===e&&x?1-g:0,i=1===e&&x||3===e&&!x?g:1,a=n.lines[e],c=n.lines[3===e?0:e+1];for(let n=0;n<_;n++){const u=n/_,h=0===n?0:(0,s.Cc)(t,i,1===e?1-(1-u)**2:3===e?u**2:u),d=(0,T.Cc)(je,a.origin,c.origin,h),m=(0,Re.nu)(a.direction,c.direction,h,Ve);r.intersectManifoldClosestSilhouette((0,R.LV)(d,m),o,ke),ae(ke,l,ke,y),w.push((0,M.o8)(ke)),0!==w.length&&C((0,T.lo)(w.at(-1),ke));const f=((0,re.Tj)(b,ke)?1:0)|((0,re.Tj)(S,ke)?2:0);Ze[f]=1}}w.length>2&&(0,T.lo)(w[0],w.at(-1));const E=function(e,t,r){const i=2*(0,ve.FD)();return e.map(e=>{const n=[];let o=!1;for(const s of e)t.fromRenderCoords(s,ke,r),Math.abs(s[0])<i&&Math.abs(s[1])<i?(n.push([null,ke[1]]),n.push([null,ke[1]]),o=!0):n.push([ke[0],ke[1]]);if(o)for(let e=0;e<n.length;e++){const t=n[e];if(null!=t[0])continue;const r=n[e+1],i=n.at(0===e?-1:e-1);t[0]=i[0],e++;const o=n.at(e===n.length-1?0:e+1);r[0]=o[0]}return n.push(n[0]),(0,J.$3)(n)||n.reverse(),n})}((0,P.m3)(Ze)>1?function(e,t){const r=[];for(const i of e)r.push(...Le(i,t));return r}(Le(w,b),S):[w],r,a);return new X.A({rings:E,spatialReference:a})},toExtent:function(e,t,r,i,n){let o,a,c,l;const u=t.latitude,h=(0,A.tO)(e.spatialReference).radius,d=t.longitude,m=function(e,t,r){const i=t/r,n=(0,s.kU)(e),o=Math.sin(i/2),a=Math.cos(n),c=2*(0,s.YN)(Math.sqrt(o*o/(a*a)));return(0,s.KJ)(c)}(u,r,h)/2;o=d-m,a=d+m;const f=(0,s.kU)(u),g=(1+Math.sin(f))/(1-Math.sin(f)),v=(g+1)*Math.tan(i/h/2),_=v*v;function x(e){const t=Math.PI/2;return(e=p.uC.normalize(e,-t))>t&&(e=Math.PI-e),e}if(c=1.5*Math.PI-2*Math.atan(.5*(v+Math.sqrt(4*g+_))),l=c+i/h,c=x(c),l=x(l),l<c){const e=l;l=c,c=e}if(c=Math.max((0,s.KJ)(c),-90),l=Math.min((0,s.KJ)(l),90),a=_e.Y_.monotonic(o,a),a-o>180){const e=(a-o-180)/2;o+=e,a-=e}const y=e.spatialReference&&e.spatialReference.isGeographic?e.spatialReference:S.A.WGS84;return n?(n.xmin=o,n.ymin=c,n.xmax=a,n.ymax=l,n.spatialReference=y):n=new Y.A(o,c,a,l,y),e.spatialReference&&e.spatialReference.isWebMercator&&(0,ye.Gh)(n,!1,n),n}},Symbol.toStringTag,{value:"Module"}));const qe="composite-color",Ye=["final-color",qe,"opaque-color","transparent-color"],Xe={ANTIALIASING:"aa-color",CUTFILL_COLOR:"cutfill-color",CUTFILL_COMPUTATION:"cutfill-computation",FOCUSAREA_COLOR:"focusarea-color",FOCUSAREA:"focusarea",PRE_TRANSPARENT:"pre-transparent-color",HIGHLIGHT_COLOR:"highlight-color",LASERLINES:"laserline-color",MAGNIFIER:"magnifier-color",OCCLUDED:"occluded-color",OPAQUE_ENVIRONMENT:"opaque-environment-color",SSAO:"ssao",TRANSPARENT_ENVIRONMENT:"transparent-environment-color",VIEWSHED:"viewshed-color"};Array.from(Object.values(Xe)).concat(Ye),(0,M.vt)();var Je=r(49186),Ke=r(10107),Qe=r(64108),et=r(44208),tt=(r(17676),r(94656)),rt=r(63907);r(93637),new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]),new Map,(0,et.A)("esri-tests-disable-gpu-memory-measurements"),(0,tt.en)();(0,tt.en)();var it=r(90644),nt=r(76284),ot=r(48852),st=r(42293);const at=!!(0,et.A)("esri-tests-disable-gpu-memory-measurements");class ct{constructor(e,t){this._context=e,this._descriptor=t,this.type=2,this._context.instanceCounter.increment(rt.vt.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:n,internalFormat:o,multisampled:s}=t;s?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,i,n):r.renderbufferStorage(r.RENDERBUFFER,o,i,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get usedMemory(){return at?0:(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,st.MW)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(rt.vt.Renderbuffer,this),this._context=null)}}class lt{constructor(e,t,r){if(this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(rt.vt.FramebufferObject,this),null!=t){const r=function(e,t){return ut(t)||ht(t)?t:dt(t)?new nt.A(e,t):function(e){return 3===mt(e)||null!=e&&"samples"in e}(t)?new ct(e,t):null}(e,t);null!=r&&(this._colorAttachments.set(rt.r6,r),ut(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(rt.r6)}if(null!=r)if(function(e){return ut(e)||dt(e)}(r))this._depthStencilTexture=ut(r)?r:new nt.A(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=ht(r)?r:new ct(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}dispose(){const{_colorAttachments:e,_glName:t}=this;if(0===e.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;const{_context:r}=this,i=r.getBoundFramebufferObject();e.forEach((e,t)=>this.detachColorTexture(t)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),r.gl.deleteFramebuffer(t),this._glName=null,r.bindFramebuffer(i===this?null:i),r.instanceCounter.decrement(rt.vt.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(rt.r6);return ut(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(rt.r6)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(rt.r6)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&ut(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=rt.r6){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=rt.r6){const t=this._colorAttachments.get(e);if(!t)return;const r=ut(t);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._initialized){const t=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{e.forEach(e=>{ut(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=rt.r6,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,0,r):this._framebufferTexture2D(i.glName,t,e,36160,0))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===rt.ld.UNSIGNED_INT_24_8?6402!==r||i===rt.ld.UNSIGNED_INT||i===rt.ld.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,gt(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):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 e=this._depthStencilTexture;return e&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,gt(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){const{_context:t}=this,r=t.getBoundFramebufferObject();t.bindFramebuffer(this);const{gl:i}=t,n=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,n,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebufferObject(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,n,o,s){(e<0||t<0||n<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const a=s.descriptor;3553!==s.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==a?.width||null==a?.height||e+r>this.width||t+i>this.height||n+r>a.width||o+i>a.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,l=c.bindTexture(s,nt.A.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(nt.A.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,n,o,e,t,r,i),c.bindTexture(l,nt.A.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,n,o,s){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),s||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,n,o,s)}async readPixelsAsync(e,t,r,i,n,o,s){const{gl:a}=this._context,c=ot.g.createPixelPack(this._context,35041,s.byteLength);this._context.bindBuffer(c);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),a.readPixels(e,t,r,i,n,o,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(l),await c.getSubDataAsync(s),c.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(ft(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(ft(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),(0,tt.en)())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((t,r)=>{if(ut(t)){const i=pt(t);35866===i?this._framebufferTextureLayer(t.glName,r,e,0,0):this._framebufferTexture2D(t.glName,r,i,e)}else if(ht(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=gt(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,pt(this._depthStencilTexture),e)}(0,tt.en)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=rt.r6,r=3553,i=36160,n=0){this._context.gl.framebufferTexture2D(i,t,r,e,n)}_framebufferTextureLayer(e,t=rt.r6,r=36160,i=0,n=0){this._context.gl.framebufferTextureLayer(r,t,e,i,n)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.WD)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,gt(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=(0,a.WD)(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),ft(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){ft(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case rt.SB.DEPTH_COMPONENT16:case rt.SB.DEPTH_COMPONENT24:case rt.SB.DEPTH_COMPONENT32F:return rt.xL;case rt.iE.DEPTH24_STENCIL8:case rt.iE.DEPTH32F_STENCIL8:return rt.nI;case 36168:return rt.uH;default:return rt.r6}}_validateColorAttachmentPoint(e){if(-1===lt._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;lt._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const t=e-rt.r6;t+1>lt._MAX_COLOR_ATTACHMENTS&&O.A.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${lt._MAX_COLOR_ATTACHMENTS} color attachments`)}}function ut(e){return 1===mt(e)}function ht(e){return 2===mt(e)}function dt(e){return 0===mt(e)}function mt(e){return null!=e&&"type"in e?e.type:null}function ft(e,t){const r=Math.max(e.width,e.height);if(r>t){O.A.getLogger("esri.views.webgl.FramebufferObject").warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function pt(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function gt(e){return 6402===e?rt.xL:rt.nI}var vt=r(67171),_t=(r(21818),r(69397),r(85079)),xt=r(74038);const yt=[new xt._("position",2,rt.pe.UNSIGNED_SHORT,0,4)];new xt._("a_pos",2,rt.pe.BYTE,0,2),new xt._("a_pos",2,rt.pe.BYTE,0,4),new xt._("a_tex",2,rt.pe.BYTE,2,4),(0,_t.Xk)(yt),r(66289);const wt=new Image;wt.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",wt.width=5,wt.height=5,wt.decode();let bt=class extends I.A{constructor(e){super(e),this.view=null,this.consumes={required:[]},this.produces=qe,this.requireGeometryDepth=!1,this._dirty=!0}initialize(){this.addHandles([(0,c.wB)(()=>this.view.ready,e=>{e&&this.view.stage?.renderer.addRenderNode(this)},c.Vh)])}destroy(){this.view.stage?.renderer?.removeRenderNode(this)}precompile(){}render(){throw new Je.A("RenderNode:render-function-not-implemented","render() is not implemented.")}get camera(){return this.view.state.camera.clone()}get sunLight(){return this.bindParameters.lighting.legacy}get gl(){return this.view.stage.renderView.renderingContext.gl}get techniques(){return this.view.stage.renderView.techniques}acquireOutputFramebuffer(){const e=this._frameBuffer?.getTexture()?.descriptor,t=this.view.stage.renderer.fboCache.acquire(e?.width??640,e?.height??480,this.produces);return this._bind(t),t}bindRenderTarget(){return this._bind(this._frameBuffer),this._frameBuffer}_bind({fbo:e}){var t;e.initializeAndBind(),this.gl.drawBuffers((t=e)?t.colorAttachments.length>0?t.colorAttachments:[rt.$0]:[rt.C5])}requestRender(e){switch(e){case 2:this.view.state.fading=!0;case 1:this.view.stage?.renderView.requestRender(e);case 0:case void 0:this._dirty=!0}}resetWebGLState(){this.renderingContext.resetState(),this.renderingContext.bindFramebuffer(this._frameBuffer?.fbo)}get fboCache(){return this.view.stage.renderer.fboCache}get bindParameters(){return this.renderContext.bind}get renderingContext(){return this.view.stage.renderView.renderingContext}get renderContext(){return this.view.stage?.renderer.renderContext}updateAnimation(e){return!!this._dirty&&(this._dirty=!1,!0)}doRender(e){this._frameBuffer=e.find(({name:e})=>e===this.produces);try{return this.render(e)}finally{this._frameBuffer=null}}};(0,o.Cg)([(0,Ke.MZ)({constructOnly:!0})],bt.prototype,"view",void 0),(0,o.Cg)([(0,Ke.MZ)({constructOnly:!0})],bt.prototype,"consumes",void 0),(0,o.Cg)([(0,Ke.MZ)()],bt.prototype,"produces",void 0),(0,o.Cg)([(0,Ke.MZ)({readOnly:!0})],bt.prototype,"techniques",null),bt=(0,o.Cg)([(0,Qe.$)("esri.views.3d.webgl.RenderNode")],bt);const Tt=bt;var Mt=r(15581),St=r(13840),Ct=r(42958),Et=r(95774);let At=class extends Ct.w{constructor(){super(...arguments),this.shader=new St.r(Et.S,()=>r.e(1285).then(r.bind(r,91285)))}initializePipeline(){return(0,it.Ey)({colorWrite:it.kn})}};At=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOBlurTechnique")],At);var Rt=r(65786);class It extends Rt.Y{constructor(){super(...arguments),this.projScale=1}}class Ot extends It{constructor(){super(...arguments),this.intensity=1}}class Ft extends Rt.Y{}class Dt extends Ft{constructor(){super(...arguments),this.blurSize=(0,N.vt)()}}let Nt=class extends Ct.w{constructor(){super(...arguments),this.shader=new St.r(Mt.S,()=>r.e(6122).then(r.bind(r,86122)))}initializePipeline(){return(0,it.Ey)({colorWrite:it.kn})}};Nt=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAOTechnique")],Nt);let Pt=class extends Tt{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=Xe.SSAO,this.isEnabled=()=>!1,this._enableTime=(0,l.l5)(0),this._passParameters=new Ot,this._drawParameters=new Dt}initialize(){const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),e=>e.charCodeAt(0)),t=new vt.R(32);t.wrapMode=33071,t.pixelFormat=6407,t.wrapMode=10497,t.hasMipmap=!0,this._passParameters.noiseTexture=new nt.A(this.renderingContext,t,e),this.addHandles((0,c.wB)(()=>this.isEnabled(),()=>this._enableTime=(0,l.l5)(0)))}destroy(){this._passParameters.noiseTexture=(0,a.WD)(this._passParameters.noiseTexture)}precompile(){this.techniques.precompile(Nt),this.techniques.precompile(At)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),i=t?.getTexture(rt.nI);if(!r||!i)return;const n=this.techniques.getCompiled(Nt),o=this.techniques.getCompiled(At);if(!n||!o)return this._enableTime=(0,l.l5)(performance.now()),void this.requestRender(1);0===this._enableTime&&(this._enableTime=(0,l.l5)(performance.now()));const a=this.renderingContext,c=this.view.qualitySettings.fadeDuration,u=this.bindParameters,d=u.camera,m=d.relativeElevation,f=(0,s.qE)((5e5-m)/2e5,0,1),p=c>0?Math.min(c,performance.now()-this._enableTime)/c:1,g=p*f;this._passParameters.normalTexture=r,this._passParameters.depthTexture=i,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Bt/(0,Mt.g)(d)**6*g;const v=d.fullViewport[2],_=d.fullViewport[3],x=this.fboCache.acquire(v,_,"ssao input",2);a.bindFramebuffer(x.fbo),a.setViewport(0,0,v,_),a.bindTechnique(n,u,this._passParameters,this._drawParameters),a.screen.draw();const y=Math.round(v/2),w=Math.round(_/2),b=this.fboCache.acquire(y,w,"ssao blur",0);a.bindFramebuffer(b.fbo),this._drawParameters.colorTexture=x.getTexture(),(0,h.hZ)(this._drawParameters.blurSize,0,2/_),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,y,w),a.screen.draw(),x.release();const T=this.fboCache.acquire(y,w,Xe.SSAO,0);return a.bindFramebuffer(T.fbo),a.setViewport(0,0,v,_),a.setClearColor(1,1,1,0),a.clear(16384),this._drawParameters.colorTexture=b.getTexture(),(0,h.hZ)(this._drawParameters.blurSize,2/v,0),a.bindTechnique(o,u,this._passParameters,this._drawParameters),a.setViewport(0,0,y,w),a.screen.draw(),a.setViewport4fv(d.fullViewport),b.release(),p<1&&this.requestRender(2),T}};(0,o.Cg)([(0,u.MZ)()],Pt.prototype,"consumes",void 0),(0,o.Cg)([(0,u.MZ)()],Pt.prototype,"produces",void 0),(0,o.Cg)([(0,u.MZ)({constructOnly:!0})],Pt.prototype,"isEnabled",void 0),Pt=(0,o.Cg)([(0,u.$K)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],Pt);const Bt=.5;function Ht(e,t){t.receiveAmbientOcclusion?(e.uniforms.add(new n.x("ssaoTex",e=>e.ssao?.getTexture())),e.constants.add("blurSizePixelsInverse","float",.5),e.code.add(i.H`float evaluateAmbientOcclusionInverse() {
|
|
564
564
|
vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
|
|
565
565
|
return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
|
|
566
566
|
}
|
|
@@ -1028,4 +1028,4 @@ return mix(mrr, vec3(0.0, 1.0, 0.04), snow);
|
|
|
1028
1028
|
calculateOcclusionAndOutputHighlight();
|
|
1029
1029
|
${(0,a.If)(_,"outputObjectAndLayerIdColor();")}
|
|
1030
1030
|
}
|
|
1031
|
-
`)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q)}},48852(e,t,r){r.d(t,{g:()=>h});var i=r(4576),n=r(44208),o=r(53966),s=r(34275),a=r(94656),c=r(63907);const l=()=>o.A.getLogger("esri.views.webgl.BufferObject"),u=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class h{static createIndex(e,t,r){return new h(e,34963,t,r)}static createUniform(e,t,r){return new h(e,35345,t,r)}static createPixelPack(e,t=35041,r){const i=new h(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new h(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){const i=new h(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(c.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),i&&this.setData(i)}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 u?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&&l().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case c.pe.UNSIGNED_SHORT:e*=2;break;case c.pe.UNSIGNED_INT:e*=4;case c.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;const t=e.byteLength;34963===this.bufferType&&((0,s.mg)(e)?this._indexType=c.pe.UNSIGNED_BYTE:(0,s.jq)(e)?this._indexType=c.pe.UNSIGNED_SHORT:(0,s.XJ)(e)&&(this._indexType=c.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,a.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,a.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;const o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&l().warn("Potential problem getting subdata: requested data exceeds buffer size!");const s=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),s.getBufferSubData(35982,t,e,r,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),s.getBufferSubData(36662,t,e,r,n),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i){await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)}}},65786(e,t,r){r.d(t,{Y:()=>i});const i=class{};new i},14113(e,t,r){r.d(t,{N5:()=>a});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class a extends s{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new d,this.varyings=new m,this.outputs=new f}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),s=n.code.generateSource(),a=n.main.generateSource(t),c=this.debugName?`// ${this.debugName}\n`:"",l="vertex"===e?v:g,u=n.constants.generateSource(),h=this.outputs.generateSource(e);return`#version 300 es\n${c}\n${l}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${h.join("\n")}\n${s.join("\n")}\n${a.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let s=0;s<i;++s)r[s](e,o,t,n)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class l{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new p(this)}get builder(){return this}}class d{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class f{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class p{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"uint":i=p._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${p._numberToUintStr(r[0])}, ${p._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${p._numberToUintStr(r[0])}, ${p._numberToUintStr(r[1])}, ${p._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${p._numberToUintStr(r[0])}, ${p._numberToUintStr(r[1])}, ${p._numberToUintStr(r[2])}, ${p._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>p._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#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(e,t,r){r.d(t,{A:()=>M});var i=r(49186),n=r(44208),o=r(53966),s=r(97768),a=r(93637),c=r(74887),l=r(94656),u=r(63907),h=r(67171);const d=()=>o.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&d().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(f(n)||p(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&d().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&d().error("Depth textures cannot sample mipmaps"):(9728!==i&&d().error("Depth textures without filtering must use NEAREST filtering"),r&&d().error("Depth textures without filtering cannot use compare function"))}}function f(e){return(0,a.a4)(u.SB,e)}function p(e){return(0,a.a4)(u.iE,e)}function g(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!g(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function y(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case 6408:return u.H0.RGBA32F;case 6407:return u.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return u.H0.RGBA8;case 6407:return u.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?u.iE.DEPTH24_STENCIL8:6402===t?u.SB.DEPTH_COMPONENT24:t,e.internalFormat}class w extends h.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R32F:case u.H0.R8_SNORM:case u.H0.R8:this.pixelFormat=6403;break;case u.H0.R8I:case u.H0.R8UI:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32I:case u.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new w(e,t)}}const b=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),T=()=>o.A.getLogger("esri/views/webgl/Texture");class M{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=w.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return b?0:(0,h.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(u.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!g(e)&&this._descriptor.internalFormat&&(0,a.a4)(u.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!g(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,n,o,s,a=0){s||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=y(c);const{context:l,pixelFormat:u,dataType:h,target:d,isImmutable:m}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=l.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+n>c.width||r+o>c.height)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:p}=l;a&&(n&&o||T().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),p.pixelStorei(p.UNPACK_SKIP_ROWS,a)),v(s)?p.texSubImage2D(d,e,t,r,n,o,u,h,s):g(s)?p.compressedTexSubImage2D(d,e,t,r,n,o,c.internalFormat,s.levels[e]):p.texSubImage2D(d,e,t,r,n,o,u,h,s),a&&p.pixelStorei(p.UNPACK_SKIP_ROWS,0),l.bindTexture(f,M.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,n,o,s,a,c){c||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update an uninitialized texture!");const l=this._descriptor;l.internalFormat=y(l);const{context:u,pixelFormat:h,dataType:d,isImmutable:m,target:f}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(f)||T().warn("Attempting to set 3D texture data on a non-3D texture");const p=u.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||n<0||t+o>l.width||r+s>l.height||n+a>l.depth)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=u;if(g(c))c=c.levels[e],v.compressedTexSubImage3D(f,e,t,r,n,o,s,a,l.internalFormat,c);else{const i=c;v.texSubImage3D(f,e,t,r,n,o,s,a,h,d,i)}u.bindTexture(p,M.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,M.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,s.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,n=r.context?.gl;if(!n)return;(0,l.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),r.context.instanceCounter.increment(u.vt.Texture,this)),m(r);const o=r.context.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,l.Y2)(n);const s=t??r.target,c=_(s);if(v(e))this._setDataFromTexImageSource(e,s);else{const{width:t,height:o,depth:h}=r;if(null==t||null==o)throw new i.A("texture:missing-size","Width and height must be specified!");if(c&&null==h)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=y(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,r.internalFormat,r.hasMipmap,t,o,h),g(e)){if(!function(e){return null!=e&&(0,a.a4)(u.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,s)}else this._texImage(s,0,r.internalFormat,t,o,h,e),(0,l.Y2)(n),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,l.Y2)(n),r.context.bindTexture(o,M.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=y(i);const n=_(t),{width:o,height:s,depth:a}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=s),n&&i.depth,n&&(i.depth=a),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,s,a),this._texImage(t,0,i.internalFormat,o,s,a,e),(0,l.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,l.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:s}=i,a=e.levels,c=x(r,n,o,s),l=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,l),this._forEachMipmapLevel((e,i,n,o)=>{const s=a[Math.min(e,a.length-1)];this._compressedTexImage(r,e,t,i,n,o,s)},l)}_texStorage(e,t,r,n,o,s){const{gl:a}=this._descriptor.context;if(!function(e){return u.XN.includes(e)}(t)&&!f(t)&&!p(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?x(e,n,o,s):1;if(_(e)){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(e,c,t,n,o,s)}else a.texStorage2D(e,c,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,s,a){const c=this._descriptor.context.gl,l=_(e),{isImmutable:u,pixelFormat:h,dataType:d}=this._descriptor;if(u){if(null!=a){const r=a;if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,n,o,s,h,d,r)}else c.texSubImage2D(e,t,0,0,n,o,h,d,r)}}else{const u=a;if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,n,o,s,0,h,d,u)}else c.texImage2D(e,t,r,n,o,0,h,d,u)}}_compressedTexImage(e,t,r,n,o,s,a){const c=this._descriptor.context.gl,l=_(e);if(this._descriptor.isImmutable){if(null!=a)if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,n,o,s,r,a)}else c.compressedTexSubImage2D(e,t,0,0,n,o,r,a)}else if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,n,o,s,0,a)}else c.compressedTexImage2D(e,t,r,n,o,0,a)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:n,preMultiplyAlpha:o,hasMipmap:s}=this._descriptor,a=this._descriptor.compress?.compressionTracker,l=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:h}=i.capabilities;if(!M.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!u&&!h)return;this.abortCompression();const d=new AbortController;let m;this._compressionAbortController=d,a?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(d));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:o,hasMipmap:s,hasETC:!!u,hasS3TC:!!h},a=await M.compressionWorkerHandle.invoke(i,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),l?.(e-this.usedMemory)}}catch(e){(0,c.zf)(e)||T().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:s,target:a}=this._descriptor;const c=32879===a;if(null==r||null==n||c&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),s&&(1!==r||1!==n||c&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),c&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,l.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},67171(e,t,r){r.d(t,{R:()=>o,e:()=>s});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.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 s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.MW)(e.internalFormat))*(34067===e.target?6:1))}},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},42293(e,t,r){r.d(t,{MW:()=>c,wH:()=>a,yu:()=>s});var i=r(94656),n=r(63907);const o=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function s(e,t,r,n=0){const s=e.gl;e.bindBuffer(r);for(const a of r.layout){const r=t.get(a.name);if(null==r){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&o.has(a.type)?s.vertexAttribIPointer(r,a.count,a.type,a.stride,a.offset+c):s.vertexAttribPointer(r,a.count,a.type,a.normalized,a.stride,a.offset+c),s.enableVertexAttribArray(r),a.divisor>0&&s.vertexAttribDivisor(r,a.divisor);else if(9===a.count)for(let e=0;e<3;e++)s.vertexAttribPointer(r+e,3,a.type,a.normalized,a.stride,a.offset+12*e+c),s.enableVertexAttribArray(r+e),a.divisor>0&&s.vertexAttribDivisor(r+e,a.divisor);else if(16===a.count)for(let e=0;e<4;e++)s.vertexAttribPointer(r+e,4,a.type,a.normalized,a.stride,a.offset+16*e+c),s.enableVertexAttribArray(r+e),a.divisor>0&&s.vertexAttribDivisor(r+e,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,i.en)()){const t=(0,i.u1)(e.gl);t&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,t,a)}}}function a(e){switch(e){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(e){switch(e){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},85079(e,t,r){r.d(t,{Sk:()=>s,Xk:()=>n,_u:()=>o});var i=r(21818);function n(e){let t=0;return(0,i.z)(new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i})))}function o(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}function s(e){return o(Array.from(e.values()).map(({layout:e})=>e))}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},74038(e,t,r){r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,s=0,a=!1){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=s,this.integer=a}}},94656(e,t,r){r.d(t,{Y2:()=>l,en:()=>c,u1:()=>s});var i=r(49186),n=r(44208),o=r(53966);function s(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.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 e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function l(e,t=c()){if(t){const t=s(e);if(t){const e=(new Error).stack;o.A.getLogger("esri.views.webgl.checkWebGLError").error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},63907(e,t,r){r.d(t,{$0:()=>d,C5:()=>h,CQ:()=>v,H0:()=>o,SB:()=>c,WR:()=>i,XN:()=>s,iE:()=>a,ld:()=>l,nI:()=>f,pe:()=>n,r6:()=>m,uH:()=>g,vt:()=>u,xL:()=>p});const i={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},o={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},s=Object.values(o),a={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},c={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},l={FLOAT:n.FLOAT,UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:n.BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,SHORT:n.SHORT,UNSIGNED_INT:n.UNSIGNED_INT,INT:n.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},u={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},h=1029,d=0,m=36064,f=33306,p=36096,g=36128,v={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},90644(e,t,r){function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}r.d(t,{Ey:()=>w,RC:()=>s,T8:()=>a,Uy:()=>h,Xt:()=>u,iD:()=>o,kn:()=>d,p3:()=>n}),r(4718);const o=i(0,771),s=(i(1,0),i(1,1),i(1,771)),a=n(770,1,771,771),c=(n(0,0,768,1),{face:1029,mode:2305}),l={face:1028,mode:2305},u=e=>2===e?c:1===e?l:null,h={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function m(e){return M.intern(e)}function f(e){return C.intern(e)}function p(e){return A.intern(e)}function g(e){return I.intern(e)}function v(e){return F.intern(e)}function _(e){return N.intern(e)}function x(e){return B.intern(e)}function y(e){return L.intern(e)}function w(e){return U.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function T(e){return"["+e.join(",")+"]"}const M=new b(S,e=>({__tag:"Blending",...e}));function S(e){return e?T([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const C=new b(E,e=>({__tag:"Culling",...e}));function E(e){return e?T([e.face,e.mode]):null}const A=new b(R,e=>({__tag:"PolygonOffset",...e}));function R(e){return e?T([e.factor,e.units]):null}const I=new b(O,e=>({__tag:"DepthTest",...e}));function O(e){return e?T([e.func]):null}const F=new b(D,e=>({__tag:"StencilTest",...e}));function D(e){return e?T([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const N=new b(P,e=>({__tag:"DepthWrite",...e}));function P(e){return e?T([e.zNear,e.zFar]):null}const B=new b(H,e=>({__tag:"ColorWrite",...e}));function H(e){return e?T([e.r,e.g,e.b,e.a]):null}const L=new b(z,e=>({__tag:"StencilWrite",...e}));function z(e){return e?T([e.mask]):null}const U=new b(function(e){return e?T([S(e.blending),E(e.culling),R(e.polygonOffset),O(e.depthTest),D(e.stencilTest),P(e.depthWrite),H(e.colorWrite),z(e.stencilWrite)]):null},e=>({blending:m(e.blending),culling:f(e.culling),polygonOffset:p(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:_(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:y(e.stencilWrite)}))},49788(e,t,r){r.d(t,{Q:()=>i});const i=1/255.5}}]);
|
|
1031
|
+
`)}},26934(e,t,r){r.d(t,{Q:()=>n});var i=r(49788);function n(e){e.constants.add("alphaCutoff","float",i.Q)}},48852(e,t,r){r.d(t,{g:()=>h});var i=r(4576),n=r(44208),o=r(53966),s=r(34275),a=r(94656),c=r(63907);const l=()=>o.A.getLogger("esri.views.webgl.BufferObject"),u=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements");class h{static createIndex(e,t,r){return new h(e,34963,t,r)}static createUniform(e,t,r){return new h(e,35345,t,r)}static createPixelPack(e,t=35041,r){const i=new h(e,35051,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=35040,r){return new h(e,35052,t,r)}static createTransformFeedback(e,t=35044,r){const i=new h(e,35982,t);return i.setSize(r),i}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._sizeBytes=-1,this._indexType=void 0,e.instanceCounter.increment(c.vt.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,a.Y2)(this._context.gl),i&&this.setData(i)}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 u?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&&l().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(34963===this.bufferType&&null!=t)switch(this._indexType=t,t){case c.pe.UNSIGNED_SHORT:e*=2;break;case c.pe.UNSIGNED_INT:e*=4;case c.pe.UNSIGNED_BYTE:}this._setBufferData(e)}setData(e){if(!e)return;const t=e.byteLength;34963===this.bufferType&&((0,s.mg)(e)?this._indexType=c.pe.UNSIGNED_BYTE:(0,s.jq)(e)?this._indexType=c.pe.UNSIGNED_SHORT:(0,s.XJ)(e)&&(this._indexType=c.pe.UNSIGNED_INT)),this._setBufferData(t,e)}setIndexType(e){34963===this.bufferType&&(this._indexType=e)}_setBufferData(e,t=null){this._sizeBytes=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,a.Y2)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;const n=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:o}=this._context;o.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r),(0,a.Y2)(o),this._isVAOAware&&this._context.bindVAO(n)}getSubData(e,t=0,r,n){if(r<0||n<0)return;const o=function(e){return(0,i.Xj)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(n??0))>e.byteLength)return;t+o*(n??0)>this.usedMemory&&l().warn("Potential problem getting subdata: requested data exceeds buffer size!");const s=this._context.gl;35982===this.bufferType?(this._context.bindBuffer(this,35982),s.getBufferSubData(35982,t,e,r,n),this._context.unbindBuffer(35982)):(this._context.bindBuffer(this,36662),s.getBufferSubData(36662,t,e,r,n),this._context.unbindBuffer(36662))}async getSubDataAsync(e,t=0,r,i){await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)}}},65786(e,t,r){r.d(t,{Y:()=>i});const i=class{};new i},14113(e,t,r){r.d(t,{N5:()=>a});var i=r(49186),n=(r(44208),r(53966));const o=()=>n.A.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class s{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class a extends s{constructor(){super(...arguments),this.vertex=new h,this.fragment=new h,this.attributes=new d,this.varyings=new m,this.outputs=new f}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),i=this.varyings.generateSource(e),n="vertex"===e?this.vertex:this.fragment,o=n.uniforms.generateSource(),s=n.code.generateSource(),a=n.main.generateSource(t),c=this.debugName?`// ${this.debugName}\n`:"",l="vertex"===e?v:g,u=n.constants.generateSource(),h=this.outputs.generateSource(e);return`#version 300 es\n${c}\n${l}\n${u.join("\n")}\n${o.join("\n")}\n${r.join("\n")}\n${i.join("\n")}\n${h.join("\n")}\n${s.join("\n")}\n${a.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return t=>{for(let n=0;n<i;++n)r[n](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n)=>{for(let o=0;o<i;++o)r[o](e,t,n)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),i=r.length;return(t,n,o)=>{for(let s=0;s<i;++s)r[s](e,o,t,n)}}}class c{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(e){if(null!=e){if(this._entries.has(e.name)&&!this._entries.get(e.name).equals(e))throw new i.A("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${e.name} for different uniform type`);this._entries.set(e.name,e)}else o().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class l{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(e){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(e)throw new i.A("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class u{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class h extends s{constructor(){super(...arguments),this.uniforms=new c(this),this.main=new l(this),this.code=new u(this),this.constants=new p(this)}get builder(){return this}}class d{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class m{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?o().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,i)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${i};`)),t}}class f{constructor(){this._entries=new Map}add(e,t,r=0){const i=this._entries.get(r);i?.name!==e||i?.type!==t?this._entries.set(r,{name:e,type:t}):o().warn(`Fragment shader output location ${r} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class p{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let i="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":i=p._numberToFloatStr(r);break;case"int":i=p._numberToIntStr(r);break;case"uint":i=p._numberToUintStr(r);break;case"bool":i=r.toString();break;case"vec2":i=`vec2(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])})`;break;case"vec3":i=`vec3(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])})`;break;case"vec4":i=`vec4(${p._numberToFloatStr(r[0])}, ${p._numberToFloatStr(r[1])}, ${p._numberToFloatStr(r[2])}, ${p._numberToFloatStr(r[3])})`;break;case"ivec2":i=`ivec2(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])})`;break;case"ivec3":i=`ivec3(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])})`;break;case"ivec4":i=`ivec4(${p._numberToIntStr(r[0])}, ${p._numberToIntStr(r[1])}, ${p._numberToIntStr(r[2])}, ${p._numberToIntStr(r[3])})`;break;case"uvec2":i=`uvec2(${p._numberToUintStr(r[0])}, ${p._numberToUintStr(r[1])})`;break;case"uvec3":i=`uvec3(${p._numberToUintStr(r[0])}, ${p._numberToUintStr(r[1])}, ${p._numberToUintStr(r[2])})`;break;case"uvec4":i=`uvec4(${p._numberToUintStr(r[0])}, ${p._numberToUintStr(r[1])}, ${p._numberToUintStr(r[2])}, ${p._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":i=`${t}(${Array.prototype.map.call(r,e=>p._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${i};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const g="#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(e,t,r){r.d(t,{A:()=>M});var i=r(49186),n=r(44208),o=r(53966),s=r(97768),a=r(93637),c=r(17676),l=r(94656),u=r(63907),h=r(67171);const d=()=>o.A.getLogger("esri/views/webgl/textureUtils");function m(e){const{width:t,height:r,depth:i}=e;(null!=t&&t<0||null!=r&&r<0||null!=i&&i<0)&&d().error("Negative dimension parameters are not allowed!");const{internalFormat:n}=e;if(n&&(f(n)||p(n))){const{linearFilterDepth:t,compareEnabled:r,samplingMode:i,hasMipmap:n}=e;n&&d().error("Depth textures cannot have mipmaps"),t?9729!==i&&9728!==i&&d().error("Depth textures cannot sample mipmaps"):(9728!==i&&d().error("Depth textures without filtering must use NEAREST filtering"),r&&d().error("Depth textures without filtering cannot use compare function"))}}function f(e){return(0,a.a4)(u.SB,e)}function p(e){return(0,a.a4)(u.iE,e)}function g(e){return null!=e&&"type"in e&&"compressed"===e.type}function v(e){return null!=e&&!g(e)&&!function(e){return null!=e&&"byteLength"in e}(e)}function _(e){return 32879===e||35866===e}function x(e,t,r,i=1){let n=Math.max(t,r);return 32879===e&&(n=Math.max(n,i)),Math.floor(Math.log2(n))+1}function y(e){if(null!=e.internalFormat)return e.internalFormat;switch(e.dataType){case u.ld.FLOAT:switch(e.pixelFormat){case 6408:return u.H0.RGBA32F;case 6407:return u.H0.RGB32F;default:throw new i.A("texture:unknown-format","Unable to derive format")}case u.ld.UNSIGNED_BYTE:switch(e.pixelFormat){case 6408:return u.H0.RGBA8;case 6407:return u.H0.RGB8}}const{pixelFormat:t}=e;return e.internalFormat=34041===t?u.iE.DEPTH24_STENCIL8:6402===t?u.SB.DEPTH_COMPONENT24:t,e.internalFormat}class w extends h.R{constructor(e,t){switch(super(),this.context=e,Object.assign(this,t),this.internalFormat){case u.H0.R16F:case u.H0.R32F:case u.H0.R8_SNORM:case u.H0.R8:this.pixelFormat=6403;break;case u.H0.R8I:case u.H0.R8UI:case u.H0.R16I:case u.H0.R16UI:case u.H0.R32I:case u.H0.R32UI:this.pixelFormat=36244}}static validate(e,t){return new w(e,t)}}const b=!!(0,n.A)("esri-tests-disable-gpu-memory-measurements"),T=()=>o.A.getLogger("esri/views/webgl/Texture");class M{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,t=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=t;else{const r=w.validate(e,t);if(!r)throw new i.A("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return b?0:(0,h.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(u.vt.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,t){const r=this._descriptor;if(r.width!==e||r.height!==t){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=t,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(e){this._descriptor.compress=e}disableCompression(){this._descriptor.compress=void 0}setData(e){this.abortCompression(),!g(e)&&this._descriptor.internalFormat&&(0,a.a4)(u.CQ,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(e),!g(e)&&this._descriptor.compress&&this._compressOnWorker(e)}updateData(e,t,r,n,o,s,a=0){s||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update uninitialized texture!");const c=this._descriptor;c.internalFormat=y(c);const{context:l,pixelFormat:u,dataType:h,target:d,isImmutable:m}=c;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");const f=l.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES,!0);(t<0||r<0||t+n>c.width||r+o>c.height)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:p}=l;a&&(n&&o||T().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),p.pixelStorei(p.UNPACK_SKIP_ROWS,a)),v(s)?p.texSubImage2D(d,e,t,r,n,o,u,h,s):g(s)?p.compressedTexSubImage2D(d,e,t,r,n,o,c.internalFormat,s.levels[e]):p.texSubImage2D(d,e,t,r,n,o,u,h,s),a&&p.pixelStorei(p.UNPACK_SKIP_ROWS,0),l.bindTexture(f,M.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,r,n,o,s,a,c){c||T().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||T().error("An attempt to update an uninitialized texture!");const l=this._descriptor;l.internalFormat=y(l);const{context:u,pixelFormat:h,dataType:d,isImmutable:m,target:f}=l;if(m&&!this._wasImmutablyAllocated)throw new i.A("texture:uninitialized","Cannot update immutable texture before allocation!");_(f)||T().warn("Attempting to set 3D texture data on a non-3D texture");const p=u.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),(t<0||r<0||n<0||t+o>l.width||r+s>l.height||n+a>l.depth)&&T().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:v}=u;if(g(c))c=c.levels[e],v.compressedTexSubImage3D(f,e,t,r,n,o,s,a,l.internalFormat,c);else{const i=c;v.texSubImage3D(f,e,t,r,n,o,s,a,h,d,i)}u.bindTexture(p,M.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,m(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const t=this._descriptor.context.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(t,M.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new i.A("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,m(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,m(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(e){e!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=e,this.setSamplingMode(e?9729:9728),m(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=(0,s.DC)(this._compressionAbortController)}_setData(e,t){const r=this._descriptor,n=r.context?.gl;if(!n)return;(0,l.Y2)(n),this.hasWebGLTextureObject||(this._glName=n.createTexture(),r.context.instanceCounter.increment(u.vt.Texture,this)),m(r);const o=r.context.bindTexture(this,M.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),(0,l.Y2)(n);const s=t??r.target,c=_(s);if(v(e))this._setDataFromTexImageSource(e,s);else{const{width:t,height:o,depth:h}=r;if(null==t||null==o)throw new i.A("texture:missing-size","Width and height must be specified!");if(c&&null==h)throw new i.A("texture:missing-depth","Depth must be specified!");if(r.internalFormat=y(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,r.internalFormat,r.hasMipmap,t,o,h),g(e)){if(!function(e){return null!=e&&(0,a.a4)(u.CQ,e)}(r.internalFormat))throw new i.A("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,s)}else this._texImage(s,0,r.internalFormat,t,o,h,e),(0,l.Y2)(n),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),(0,l.Y2)(n),r.context.bindTexture(o,M.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(e=null){for(let t=34069;t<=34074;t++)this._setData(e,t)}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:t,flipped:r,preMultiplyAlpha:i}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i?1:0)}_setDataFromTexImageSource(e,t){const{gl:r}=this._descriptor.context,i=this._descriptor;i.internalFormat=y(i);const n=_(t),{width:o,height:s,depth:a}=function(e){let t="width"in e?e.width:e.codedWidth,r="height"in e?e.height:e.codedHeight;return e instanceof HTMLVideoElement&&(t=e.videoWidth,r=e.videoHeight),{width:t,height:r,depth:1}}(e);i.width&&i.height,i.width||(i.width=o),i.height||(i.height=s),n&&i.depth,n&&(i.depth=a),i.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(t,i.internalFormat,i.hasMipmap,o,s,a),this._texImage(t,0,i.internalFormat,o,s,a,e),(0,l.Y2)(r),i.hasMipmap&&(this.generateMipmap(),(0,l.Y2)(r))}_setDataFromCompressedSource(e,t,r){const i=this._descriptor,{width:n,height:o,depth:s}=i,a=e.levels,c=x(r,n,o,s),l=Math.min(c,a.length)-1;this._descriptor.context.gl.texParameteri(i.target,33085,l),this._forEachMipmapLevel((e,i,n,o)=>{const s=a[Math.min(e,a.length-1)];this._compressedTexImage(r,e,t,i,n,o,s)},l)}_texStorage(e,t,r,n,o,s){const{gl:a}=this._descriptor.context;if(!function(e){return u.XN.includes(e)}(t)&&!f(t)&&!p(t))throw new i.A("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?x(e,n,o,s):1;if(_(e)){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");a.texStorage3D(e,c,t,n,o,s)}else a.texStorage2D(e,c,t,n,o);this._wasImmutablyAllocated=!0}_texImage(e,t,r,n,o,s,a){const c=this._descriptor.context.gl,l=_(e),{isImmutable:u,pixelFormat:h,dataType:d}=this._descriptor;if(u){if(null!=a){const r=a;if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texSubImage3D(e,t,0,0,0,n,o,s,h,d,r)}else c.texSubImage2D(e,t,0,0,n,o,h,d,r)}}else{const u=a;if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.texImage3D(e,t,r,n,o,s,0,h,d,u)}else c.texImage2D(e,t,r,n,o,0,h,d,u)}}_compressedTexImage(e,t,r,n,o,s,a){const c=this._descriptor.context.gl,l=_(e);if(this._descriptor.isImmutable){if(null!=a)if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexSubImage3D(e,t,0,0,0,n,o,s,r,a)}else c.compressedTexSubImage2D(e,t,0,0,n,o,r,a)}else if(l){if(null==s)throw new i.A("texture:missing-depth","Missing depth dimension for 3D texture upload");c.compressedTexImage3D(e,t,r,n,o,s,0,a)}else c.compressedTexImage2D(e,t,r,n,o,0,a)}async _compressOnWorker(e){const{width:t,height:r,context:i,flipped:n,preMultiplyAlpha:o,hasMipmap:s}=this._descriptor,a=this._descriptor.compress?.compressionTracker,l=this._descriptor.compress?.compressionCallback,{compressedTextureETC:u,compressedTextureS3TC:h}=i.capabilities;if(!M.compressionWorkerHandle?.isCompressible(e,this._descriptor)||!u&&!h)return;this.abortCompression();const d=new AbortController;let m;this._compressionAbortController=d,a?.increment();try{e instanceof Uint8Array?m=e.buffer:(m=await createImageBitmap(e,{imageOrientation:n?"flipY":"none"}),(0,c.Te)(d));const i={data:m,width:t,height:r,needsFlip:e instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:o,hasMipmap:s,hasETC:!!u,hasS3TC:!!h},a=await M.compressionWorkerHandle.invoke(i,d.signal,1);if((0,c.Te)(d),a.compressedTexture&&this.hasWebGLTextureObject){const e=this.usedMemory;this._descriptor.internalFormat=a.internalFormat,this._setData(a.compressedTexture),l?.(e-this.usedMemory)}}catch(e){(0,c.zf)(e)||T().error("Texture compression failed!")}finally{a?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),m instanceof ImageBitmap&&m.close()}}_forEachMipmapLevel(e,t=1/0){let{width:r,height:n,depth:o,hasMipmap:s,target:a}=this._descriptor;const c=32879===a;if(null==r||null==n||c&&null==o)throw new i.A("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let i=0;e(i,r,n,o),s&&(1!==r||1!==n||c&&1!==o)&&!(i>=t);++i)r=Math.max(1,r>>1),n=Math.max(1,n>>1),c&&(o=Math.max(1,o>>1))}_applySamplingMode(){const e=this._descriptor,t=e.context?.gl;let r=e.samplingMode,i=e.samplingMode;9985===r||9987===r?(r=9729,e.hasMipmap||(i=9729)):9984!==r&&9986!==r||(r=9728,e.hasMipmap||(i=9728)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,i)}_applyWrapMode(){const e=this._descriptor,t=e.context?.gl;"number"==typeof e.wrapMode?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}_applyShadowMode(){const e=this._descriptor,t=e.context?.gl,r=e.compareEnabled?t.COMPARE_REF_TO_TEXTURE:t.NONE;t.texParameteri(e.target,t.TEXTURE_COMPARE_MODE,r),e.compareEnabled&&t.texParameteri(e.target,t.TEXTURE_COMPARE_FUNC,t.GREATER),(0,l.Y2)(t)}_applyAnisotropicFilteringParameters(){const e=this._descriptor,t=e.context.capabilities.textureFilterAnisotropic;t&&e.context.gl.texParameterf(e.target,t.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}}},67171(e,t,r){r.d(t,{R:()=>o,e:()=>s});var i=r(63907),n=r(42293);class o{constructor(e=0,t=e){this.width=e,this.height=t,this.type=0,this.target=3553,this.pixelFormat=6408,this.dataType=i.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 s(e){return e.width<=0||e.height<=0||e.depth<=0?0:Math.round(e.width*e.height*e.depth*(e.hasMipmap?4/3:1)*(null==e.internalFormat?4:(0,n.MW)(e.internalFormat))*(34067===e.target?6:1))}},74333(e,t,r){r.d(t,{n:()=>i});class i{constructor(e,t,r,i,n=null){if(this.name=e,this.type=t,this.arraySize=n,this.bind={0:null,1:null,2:null},i)switch(r){case void 0:break;case 0:this.bind[0]=i;break;case 1:this.bind[1]=i;break;case 2:this.bind[2]=i}}equals(e){return this.type===e.type&&this.name===e.name&&this.arraySize===e.arraySize}}},42293(e,t,r){r.d(t,{MW:()=>c,wH:()=>a,yu:()=>s});var i=r(94656),n=r(63907);const o=new Set([n.pe.BYTE,n.pe.SHORT,n.pe.INT,n.pe.UNSIGNED_BYTE,n.pe.UNSIGNED_SHORT,n.pe.UNSIGNED_INT]);function s(e,t,r,n=0){const s=e.gl;e.bindBuffer(r);for(const a of r.layout){const r=t.get(a.name);if(null==r){console.warn(`There is no location for vertex attribute '${a.name}' defined.`);continue}const c=n*a.stride;if(a.count<=4)a.integer&&o.has(a.type)?s.vertexAttribIPointer(r,a.count,a.type,a.stride,a.offset+c):s.vertexAttribPointer(r,a.count,a.type,a.normalized,a.stride,a.offset+c),s.enableVertexAttribArray(r),a.divisor>0&&s.vertexAttribDivisor(r,a.divisor);else if(9===a.count)for(let e=0;e<3;e++)s.vertexAttribPointer(r+e,3,a.type,a.normalized,a.stride,a.offset+12*e+c),s.enableVertexAttribArray(r+e),a.divisor>0&&s.vertexAttribDivisor(r+e,a.divisor);else if(16===a.count)for(let e=0;e<4;e++)s.vertexAttribPointer(r+e,4,a.type,a.normalized,a.stride,a.offset+16*e+c),s.enableVertexAttribArray(r+e),a.divisor>0&&s.vertexAttribDivisor(r+e,a.divisor);else console.error("Unsupported vertex attribute element count: "+a.count);if((0,i.en)()){const t=(0,i.u1)(e.gl);t&&console.error(`Unable to bind vertex attribute "${a.name}" with baseInstanceOffset ${c}:`,t,a)}}}function a(e){switch(e){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(e){switch(e){case 6406:case 6409:case 6403:case 36244:case n.H0.R8:case n.H0.R8I:case n.H0.R8UI:case n.H0.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case n.H0.RGBA4:case n.H0.R16F:case n.H0.R16I:case n.H0.R16UI:case n.H0.RG8:case n.H0.RG8I:case n.H0.RG8UI:case n.H0.RG8_SNORM:case n.H0.RGB565:case n.H0.RGB5_A1:case n.SB.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case n.H0.RGB8:case n.H0.RGB8I:case n.H0.RGB8UI:case n.H0.RGB8_SNORM:case n.H0.SRGB8:case n.SB.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case n.H0.RGBA8:case n.H0.R32F:case n.H0.R11F_G11F_B10F:case n.H0.RG16F:case n.H0.R32I:case n.H0.R32UI:case n.H0.RG16I:case n.H0.RG16UI:case n.H0.RGBA8I:case n.H0.RGBA8UI:case n.H0.RGBA8_SNORM:case n.H0.SRGB8_ALPHA8:case n.H0.RGB9_E5:case n.H0.RGB10_A2UI:case n.H0.RGB10_A2:case n.SB.DEPTH_COMPONENT32F:case n.iE.DEPTH24_STENCIL8:return 4;case n.iE.DEPTH32F_STENCIL8:return 5;case n.H0.RGB16F:case n.H0.RGB16I:case n.H0.RGB16UI:return 6;case n.H0.RG32F:case n.H0.RG32I:case n.H0.RG32UI:case n.H0.RGBA16F:case n.H0.RGBA16I:case n.H0.RGBA16UI:return 8;case n.H0.RGB32F:case n.H0.RGB32I:case n.H0.RGB32UI:return 12;case n.H0.RGBA32F:case n.H0.RGBA32I:case n.H0.RGBA32UI:return 16;case n.CQ.COMPRESSED_RGB_S3TC_DXT1_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case n.CQ.COMPRESSED_RGBA_S3TC_DXT3_EXT:case n.CQ.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case n.CQ.COMPRESSED_R11_EAC:case n.CQ.COMPRESSED_SIGNED_R11_EAC:case n.CQ.COMPRESSED_RGB8_ETC2:case n.CQ.COMPRESSED_SRGB8_ETC2:case n.CQ.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case n.CQ.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case n.CQ.COMPRESSED_RG11_EAC:case n.CQ.COMPRESSED_SIGNED_RG11_EAC:case n.CQ.COMPRESSED_RGBA8_ETC2_EAC:case n.CQ.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}},85079(e,t,r){r.d(t,{Sk:()=>s,Xk:()=>n,_u:()=>o});var i=r(21818);function n(e){let t=0;return(0,i.z)(new Map(e.map(({name:e,count:r})=>{const i=[e,t];return 16===r?t+=4:9===r?t+=3:++t,i})))}function o(e){const t=new Map;let r=0;return e.forEach(e=>e.forEach(({name:e,count:i})=>{t.set(e,r),16===i?r+=4:9===i?r+=3:++r})),t}function s(e){return o(Array.from(e.values()).map(({layout:e})=>e))}},66289(e,t,r){r.d(t,{R:()=>n});var i=r(48852);class n extends i.g{constructor(e,t,r,i=35044){super(e,34962,i,r),this.layout=t}}},74038(e,t,r){r.d(t,{_:()=>i});class i{constructor(e,t,r,i,n,o=!1,s=0,a=!1){this.name=e,this.count=t,this.type=r,this.offset=i,this.stride=n,this.normalized=o,this.divisor=s,this.integer=a}}},94656(e,t,r){r.d(t,{Y2:()=>l,en:()=>c,u1:()=>s});var i=r(49186),n=r(44208),o=r(53966);function s(e){switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case e.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case e.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case e.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 e.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case e.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const a=!!(0,n.A)("enable-feature:webgl-debug");function c(){return a}function l(e,t=c()){if(t){const t=s(e);if(t){const e=(new Error).stack;o.A.getLogger("esri.views.webgl.checkWebGLError").error(new i.A("webgl-error","WebGL error occurred",{message:t,stack:e}))}}}},63907(e,t,r){r.d(t,{$0:()=>d,C5:()=>h,CQ:()=>v,H0:()=>o,SB:()=>c,WR:()=>i,XN:()=>s,iE:()=>a,ld:()=>l,nI:()=>f,pe:()=>n,r6:()=>m,uH:()=>g,vt:()=>u,xL:()=>p});const i={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},o={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},s=Object.values(o),a={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},c={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},l={FLOAT:n.FLOAT,UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:n.BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,SHORT:n.SHORT,UNSIGNED_INT:n.UNSIGNED_INT,INT:n.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},u={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},h=1029,d=0,m=36064,f=33306,p=36096,g=36128,v={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},90644(e,t,r){function i(e,t,r=32774,i=[0,0,0,0]){return{srcRgb:e,srcAlpha:e,dstRgb:t,dstAlpha:t,opRgb:r,opAlpha:r,color:{r:i[0],g:i[1],b:i[2],a:i[3]}}}function n(e,t,r,i,n=32774,o=32774,s=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:n,opAlpha:o,color:{r:s[0],g:s[1],b:s[2],a:s[3]}}}r.d(t,{Ey:()=>w,RC:()=>s,T8:()=>a,Uy:()=>h,Xt:()=>u,iD:()=>o,kn:()=>d,p3:()=>n}),r(4718);const o=i(0,771),s=(i(1,0),i(1,1),i(1,771)),a=n(770,1,771,771),c=(n(0,0,768,1),{face:1029,mode:2305}),l={face:1028,mode:2305},u=e=>2===e?c:1===e?l:null,h={zNear:0,zFar:1},d={r:!0,g:!0,b:!0,a:!0};function m(e){return M.intern(e)}function f(e){return C.intern(e)}function p(e){return A.intern(e)}function g(e){return I.intern(e)}function v(e){return F.intern(e)}function _(e){return N.intern(e)}function x(e){return B.intern(e)}function y(e){return L.intern(e)}function w(e){return U.intern(e)}class b{constructor(e,t){this._makeKey=e,this._makeRef=t,this._interns=new Map}intern(e){if(!e)return null;const t=this._makeKey(e),r=this._interns;return r.has(t)||r.set(t,this._makeRef(e)),r.get(t)??null}}function T(e){return"["+e.join(",")+"]"}const M=new b(S,e=>({__tag:"Blending",...e}));function S(e){return e?T([e.srcRgb,e.srcAlpha,e.dstRgb,e.dstAlpha,e.opRgb,e.opAlpha,e.color.r,e.color.g,e.color.b,e.color.a]):null}const C=new b(E,e=>({__tag:"Culling",...e}));function E(e){return e?T([e.face,e.mode]):null}const A=new b(R,e=>({__tag:"PolygonOffset",...e}));function R(e){return e?T([e.factor,e.units]):null}const I=new b(O,e=>({__tag:"DepthTest",...e}));function O(e){return e?T([e.func]):null}const F=new b(D,e=>({__tag:"StencilTest",...e}));function D(e){return e?T([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const N=new b(P,e=>({__tag:"DepthWrite",...e}));function P(e){return e?T([e.zNear,e.zFar]):null}const B=new b(H,e=>({__tag:"ColorWrite",...e}));function H(e){return e?T([e.r,e.g,e.b,e.a]):null}const L=new b(z,e=>({__tag:"StencilWrite",...e}));function z(e){return e?T([e.mask]):null}const U=new b(function(e){return e?T([S(e.blending),E(e.culling),R(e.polygonOffset),O(e.depthTest),D(e.stencilTest),P(e.depthWrite),H(e.colorWrite),z(e.stencilWrite)]):null},e=>({blending:m(e.blending),culling:f(e.culling),polygonOffset:p(e.polygonOffset),depthTest:g(e.depthTest),stencilTest:v(e.stencilTest),depthWrite:_(e.depthWrite),colorWrite:x(e.colorWrite),stencilWrite:y(e.stencilWrite)}))},49788(e,t,r){r.d(t,{Q:()=>i});const i=1/255.5}}]);
|