@arcgis/core 4.23.0-next.20220106 → 4.23.0-next.20220118
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/components/assets/calcite-date-picker/nls/bg.json +31 -0
- package/assets/components/assets/calcite-icon/centerAlign16.json +1 -0
- package/assets/components/assets/calcite-icon/centerAlign24.json +1 -0
- package/assets/components/assets/calcite-icon/centerAlign32.json +1 -0
- package/assets/components/assets/calcite-icon/checkSquareF16.json +1 -0
- package/assets/components/assets/calcite-icon/checkSquareF24.json +1 -0
- package/assets/components/assets/calcite-icon/checkSquareF32.json +1 -0
- package/assets/components/assets/calcite-icon/convert16.json +1 -0
- package/assets/components/assets/calcite-icon/convert24.json +1 -0
- package/assets/components/assets/calcite-icon/convert32.json +1 -0
- package/assets/components/assets/calcite-icon/explore16.json +1 -0
- package/assets/components/assets/calcite-icon/explore24.json +1 -0
- package/assets/components/assets/calcite-icon/explore32.json +1 -0
- package/assets/components/assets/calcite-icon/formDropdown16.json +1 -0
- package/assets/components/assets/calcite-icon/formDropdown24.json +1 -0
- package/assets/components/assets/calcite-icon/formDropdown32.json +1 -0
- package/assets/components/assets/calcite-icon/language16.json +1 -0
- package/assets/components/assets/calcite-icon/language24.json +1 -0
- package/assets/components/assets/calcite-icon/language32.json +1 -0
- package/assets/components/assets/calcite-icon/languageTranslate16.json +1 -0
- package/assets/components/assets/calcite-icon/languageTranslate24.json +1 -0
- package/assets/components/assets/calcite-icon/languageTranslate32.json +1 -0
- package/assets/components/assets/calcite-icon/leftAlign16.json +1 -0
- package/assets/components/assets/calcite-icon/leftAlign24.json +1 -0
- package/assets/components/assets/calcite-icon/leftAlign32.json +1 -0
- package/assets/components/assets/calcite-icon/lineSolid4.json +1 -0
- package/assets/components/assets/calcite-icon/partlyCloudy16.json +1 -0
- package/assets/components/assets/calcite-icon/partlyCloudy24.json +1 -0
- package/assets/components/assets/calcite-icon/partlyCloudy32.json +1 -0
- package/assets/components/assets/calcite-icon/rightAlign16.json +1 -0
- package/assets/components/assets/calcite-icon/rightAlign24.json +1 -0
- package/assets/components/assets/calcite-icon/rightAlign32.json +1 -0
- package/assets/components/assets/calcite-icon/screenshotMode16.json +1 -0
- package/assets/components/assets/calcite-icon/screenshotMode24.json +1 -0
- package/assets/components/assets/calcite-icon/screenshotMode32.json +1 -0
- package/assets/components/assets/calcite-icon/squareF16.json +1 -0
- package/assets/components/assets/calcite-icon/squareF24.json +1 -0
- package/assets/components/assets/calcite-icon/squareF32.json +1 -0
- package/assets/components/assets/calcite-icon/terminal16.json +1 -0
- package/assets/components/assets/calcite-icon/terminal24.json +1 -0
- package/assets/components/assets/calcite-icon/terminal32.json +1 -0
- package/assets/components/assets/calcite-icon/touch16.json +1 -0
- package/assets/components/assets/calcite-icon/touch24.json +1 -0
- package/assets/components/assets/calcite-icon/touch32.json +1 -0
- package/assets/components/assets/calcite-icon/xHexagon16.json +1 -0
- package/assets/components/assets/calcite-icon/xHexagon24.json +1 -0
- package/assets/components/assets/calcite-icon/xHexagon32.json +1 -0
- package/assets/components/assets/calcite-icon/xHexagonF16.json +1 -0
- package/assets/components/assets/calcite-icon/xHexagonF24.json +1 -0
- package/assets/components/assets/calcite-icon/xHexagonF32.json +1 -0
- package/assets/components/assets/calcite-icon/xOctagonF16.json +1 -0
- package/assets/components/assets/calcite-icon/xOctagonF24.json +1 -0
- package/assets/components/assets/calcite-icon/xOctagonF32.json +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/01ef8de7f76a8c61b464.js +1 -0
- package/assets/esri/core/workers/chunks/09da224052976e290828.js +1 -0
- package/assets/esri/core/workers/chunks/{2c9af2ebd72d9b55329b.js → 0f254c3e91e8fee55f28.js} +1 -1
- package/assets/esri/core/workers/chunks/{ce5ca5e95b2378ec55b9.js → 1305ef8717da6e902a55.js} +1 -1
- package/assets/esri/core/workers/chunks/20411bb8e04703962ce6.js +1 -0
- package/assets/esri/core/workers/chunks/21a77eed1a4ef5b0ff08.js +1 -0
- package/assets/esri/core/workers/chunks/2416f8bf8bbd2ec786ab.js +1 -0
- package/assets/esri/core/workers/chunks/25a3e9bc0b4c7e0d3165.js +1 -0
- package/assets/esri/core/workers/chunks/{9c417740bf3707a0d465.js → 2c607d30ff8ca1b61286.js} +1 -1
- package/assets/esri/core/workers/chunks/2d947080a27db6ce0d75.js +1 -0
- package/assets/esri/core/workers/chunks/2e445a8735ea2adb641a.js +1 -0
- package/assets/esri/core/workers/chunks/3564e14010953def6df9.js +1 -0
- package/assets/esri/core/workers/chunks/37a7bd30352b1309b8f8.js +1 -0
- package/assets/esri/core/workers/chunks/390d9021169e65c10eb8.js +1 -0
- package/assets/esri/core/workers/chunks/{3d5169ea9810d10caf0d.js → 3a9740dccda6a733313c.js} +1 -1
- package/assets/esri/core/workers/chunks/403c7d64f12f00330d88.js +1 -0
- package/assets/esri/core/workers/chunks/4409d77c9734de4e82a7.js +1 -0
- package/assets/esri/core/workers/chunks/{f52b6d5037e4205b035c.js → 47395d225229d237f0ac.js} +1 -1
- package/assets/esri/core/workers/chunks/4b69129c0557852d9b3d.js +1 -0
- package/assets/esri/core/workers/chunks/4c301ca9c493b96df746.js +1 -0
- package/assets/esri/core/workers/chunks/57c67e260267a1dbc5e3.js +1 -0
- package/assets/esri/core/workers/chunks/5ac4c1d54b94c7d87835.js +1 -0
- package/assets/esri/core/workers/chunks/60371c0f750cde87656d.js +1 -0
- package/assets/esri/core/workers/chunks/631c5b514bb73782c570.js +1 -0
- package/assets/esri/core/workers/chunks/{3a2b2dc3e938d53faa30.js → 64276aacaafa4c8a15bd.js} +1 -1
- package/assets/esri/core/workers/chunks/{75466e0c8c8da499b150.js → 662d13f68cf3ec92439b.js} +1 -1
- package/assets/esri/core/workers/chunks/6c1e92ff4c732dfda756.js +1 -0
- package/assets/esri/core/workers/chunks/6cdfe175c965918b741b.js +1 -0
- package/assets/esri/core/workers/chunks/75d53b28afe732c459b2.js +1 -0
- package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js → 7a8764ae8a0041e1151d.js} +2 -2
- package/assets/esri/core/workers/chunks/{ea05f870dda27bca4fe8.js.LICENSE.txt → 7a8764ae8a0041e1151d.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{b4ed7856cd9c98434477.js → 7c9d2638693d5f798b23.js} +1 -1
- package/assets/esri/core/workers/chunks/7e596478507466953e65.js +1 -0
- package/assets/esri/core/workers/chunks/85b34d91cf07567d6873.js +1 -0
- package/assets/esri/core/workers/chunks/85e27fd949475f9a6bbc.js +1 -0
- package/assets/esri/core/workers/chunks/8967288145f8fbd20e7d.js +1 -0
- package/assets/esri/core/workers/chunks/89de05207744149fb58b.js +1 -0
- package/assets/esri/core/workers/chunks/8cbb04a9065aa3756638.js +1 -0
- package/assets/esri/core/workers/chunks/{9846098704ee38bf6350.js → 8fdd5bca3716816d359b.js} +1 -1
- package/assets/esri/core/workers/chunks/96ab518eb6ba11333dee.js +1 -0
- package/assets/esri/core/workers/chunks/987182b3a578fc7de251.js +1 -0
- package/assets/esri/core/workers/chunks/99a777693e4539f0b03b.js +1 -0
- package/assets/esri/core/workers/chunks/9d77467aa71d345fc1b6.js +1 -0
- package/assets/esri/core/workers/chunks/{4beba242e7540ee3182b.js → 9d9dffc8884d66a258e4.js} +1 -1
- package/assets/esri/core/workers/chunks/9f8b7b6b4e95f9a794fc.js +1 -0
- package/assets/esri/core/workers/chunks/{a721342a32541717324d.js → a28b53c61bddefb6616e.js} +1 -1
- package/assets/esri/core/workers/chunks/{9b7c51ff3d2b42aa62f5.js → a7b1b75643ed31489495.js} +1 -1
- package/assets/esri/core/workers/chunks/a8b13fb804bb775e4967.js +1 -0
- package/assets/esri/core/workers/chunks/a8c13529367c037cdd94.js +1 -0
- package/assets/esri/core/workers/chunks/a960074644c3722be71e.js +1 -0
- package/assets/esri/core/workers/chunks/ac8dca61ade28c542ae2.js +1 -0
- package/assets/esri/core/workers/chunks/ad081d8e49e7f90c3c26.js +1 -0
- package/assets/esri/core/workers/chunks/b10fcbe1393c812fc219.js +1 -0
- package/assets/esri/core/workers/chunks/{2a39d520b192b8e552b5.js → b2ae5fc4f787ea568b88.js} +1 -1
- package/assets/esri/core/workers/chunks/{b51261a9a9ab62388839.js → b99e69302ea701fff0ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{b87bc1481a49b38109f4.js → b9c177524b3e7de1ffd1.js} +1 -1
- package/assets/esri/core/workers/chunks/b9de831ac379cf1d2969.js +1 -0
- package/assets/esri/core/workers/chunks/ba615f118a3a8970ef25.js +1 -0
- package/assets/esri/core/workers/chunks/{7c1b9ae141112a63b446.js → ba6654a885be4b7a43f0.js} +1 -1
- package/assets/esri/core/workers/chunks/bc790b2f964144d10abe.js +1 -0
- package/assets/esri/core/workers/chunks/be2b7cce79fd41627931.js +1 -0
- package/assets/esri/core/workers/chunks/c13dfdd548dcb1bdb294.js +1 -0
- package/assets/esri/core/workers/chunks/c36f84daa7736878418d.js +1 -0
- package/assets/esri/core/workers/chunks/{b58eba403bd517a7bb15.js → c3eca92d02958732e141.js} +1 -1
- package/assets/esri/core/workers/chunks/c6f94b92e866b881d9b9.js +1 -0
- package/assets/esri/core/workers/chunks/cbb291412fd1a5261aa9.js +1 -0
- package/assets/esri/core/workers/chunks/d1454155ee1b8a421cbb.js +1 -0
- package/assets/esri/core/workers/chunks/{0cd583c3233573cb8468.js → d24c4fbc567486b1188f.js} +1 -1
- package/assets/esri/core/workers/chunks/d52108864136c5a8a618.js +1 -0
- package/assets/esri/core/workers/chunks/dd433c160f7a0c120b82.js +1 -0
- package/assets/esri/core/workers/chunks/de03439ca2c9782bf325.js +1 -0
- package/assets/esri/core/workers/chunks/e2d68bcd2f99a65387bf.js +1 -0
- package/assets/esri/core/workers/chunks/e59764ee8cf25d4f74e2.js +1 -0
- package/assets/esri/core/workers/chunks/{2f66fcb8670b108af549.js → ed0bcc66fb1e0ee75a4b.js} +1 -1
- package/assets/esri/core/workers/chunks/{6deac533bb455be4004b.js → ef8b75b92cf549e0507e.js} +1 -1
- package/assets/esri/core/workers/chunks/f7fc4c993536e62f7f3e.js +1 -0
- package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.svg +1 -0
- package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.ttf +0 -0
- package/assets/esri/themes/base/icons/fonts/CalciteWebCoreIcons.woff +0 -0
- package/assets/esri/themes/base/icons/selection.json +1 -1
- package/assets/esri/themes/base/icons/style.css +4 -0
- package/assets/esri/themes/base/icons/style.scss +6 -0
- package/assets/esri/themes/base/icons/variables.scss +1 -0
- package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/dark-blue/main.css +1 -1
- package/assets/esri/themes/dark-green/main.css +1 -1
- package/assets/esri/themes/dark-purple/main.css +1 -1
- package/assets/esri/themes/dark-red/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/themes/light-blue/main.css +1 -1
- package/assets/esri/themes/light-green/main.css +1 -1
- package/assets/esri/themes/light-purple/main.css +1 -1
- package/assets/esri/themes/light-red/main.css +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nb.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
- package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
- package/assets/esri/widgets/ElevationProfile/t9n/ElevationProfile_ja.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ar.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bg.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_bs.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ca.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_cs.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_da.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_de.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_el.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_es.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_et.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fi.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_fr.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_he.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hr.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_hu.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_id.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_it.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ja.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ko.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lt.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_lv.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nb.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_nl.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pl.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ro.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_ru.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sk.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sl.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sr.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_sv.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_th.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_tr.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_uk.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_vi.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTemplates/t9n/FeatureTemplates_zh-TW.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_cs.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_el.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_fr.json +1 -1
- package/assets/esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace_lv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
- package/chunks/Clouds.glsl.js +14 -14
- package/chunks/HUDMaterial.glsl.js +22 -21
- package/chunks/RibbonLine.glsl.js +10 -14
- package/chunks/persistableUrlUtils.js +1 -1
- package/chunks/vec32.js +1 -1
- package/chunks/vec42.js +1 -1
- package/core/typedArrayUtil.js +1 -1
- package/core/urlUtils.js +1 -1
- package/form/elements/FieldElement.js +1 -1
- package/geometry/support/buffer/math/common.js +1 -1
- package/interfaces.d.ts +99 -56
- package/layers/FeatureLayer.js +1 -1
- package/layers/SubtypeGroupLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/WMSLayer.js +1 -1
- package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
- package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
- package/layers/graphics/sources/OGCFeatureSource.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/ogc/crsUtils.js +5 -0
- package/layers/support/RasterFunction.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/rasterDatasets/WCSRaster.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/vectorTileLayerLoader.js +1 -1
- package/layers/support/wmsUtils.js +1 -1
- package/layers/support/wmtsUtils.js +1 -1
- package/package.json +5 -5
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/request.js +1 -1
- package/rest/print.js +1 -1
- package/rest/support/ImageIdentifyParameters.js +1 -1
- package/rest/support/StatisticDefinition.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
- package/support/featureFlags.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/ExtrudeSymbol3DLayer.js +1 -1
- package/symbols/Font.js +1 -1
- package/symbols/IconSymbol3DLayer.js +1 -1
- package/symbols/ObjectSymbol3DLayer.js +1 -1
- package/symbols/PathSymbol3DLayer.js +1 -1
- package/symbols/TextSymbol.js +1 -1
- package/symbols/TextSymbol3DLayer.js +1 -1
- package/symbols/support/Symbol3DHalo.js +1 -1
- package/symbols/support/Symbol3DMaterial.js +1 -1
- package/symbols/support/constants.js +5 -0
- package/symbols/support/utils.js +1 -1
- package/views/2d/engine/Stage.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTilesRequestManager.js +5 -0
- package/views/2d/engine/webgl/BitBlitRenderer.js +1 -1
- package/views/2d/engine/webgl/MaterialManager.js +1 -1
- package/views/2d/engine/webgl/alignmentUtils.js +1 -1
- package/views/2d/engine/webgl/effects/BlendEffect.js +1 -1
- package/views/2d/engine/webgl/materialKey/MaterialKey.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
- package/views/2d/engine/webgl/shaders/BlendPrograms.js +1 -1
- package/views/2d/engine/webgl/shaders/MaterialPrograms.js +1 -1
- package/views/2d/layers/BaseLayerView2D.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/GraphicsLayerView2D.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/LayerView2D.js +1 -1
- package/views/2d/layers/MapNotesLayerView2D.js +1 -1
- package/views/2d/layers/RouteLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/WMSLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/graphics/GraphicBoundsRenderer.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/2d/support/engineHelpers.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/environment/CloudyWeather.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/FoggyWeather.js +1 -1
- package/views/3d/environment/NoiseTextureAtlas.js +1 -1
- package/views/3d/environment/RainyWeather.js +1 -1
- package/views/3d/environment/Stars.js +1 -1
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImageryLayerView3D.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/MapImageLayerView3D.js +1 -1
- package/views/3d/layers/OGCFeatureLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/WMSLayerView3D.js +1 -1
- package/views/3d/layers/WMTSLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFeatureLikeLayerView.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicLikeLayerView.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/graphics/QueryEngine.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
- package/views/3d/state/controllers/RotateController.js +1 -1
- package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/global/ZoomController.js +1 -1
- package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
- package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
- package/views/3d/state/controllers/local/ZoomStepController.js +1 -1
- package/views/3d/support/debugFlags.js +1 -1
- package/views/3d/support/sunUtils.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +19 -14
- package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
- package/views/3d/webgl-engine/lib/InstanceParameters.js +5 -0
- package/views/3d/webgl-engine/lib/{localOrigin.js → LocalOriginFactory.js} +0 -0
- package/views/3d/webgl-engine/lib/Program.js +1 -1
- package/views/3d/webgl-engine/lib/RenderGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/RenderTargetHelper.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderParameters.js +1 -1
- package/views/3d/webgl-engine/lib/TextRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.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/HUDMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/layers/OGCFeatureLayerView.js +1 -1
- package/views/layers/RefreshableLayerView.js +1 -1
- package/views/overlay/ViewOverlay.js +1 -1
- package/views/support/WatchUpdatingTracking.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/views/webgl/BufferObject.js +1 -1
- package/views/webgl/ContextState.js +1 -1
- package/views/webgl/FramebufferObject.js +1 -1
- package/views/webgl/Program.js +1 -1
- package/views/webgl/ProgramCache.js +1 -1
- package/views/webgl/ProgramTemplate.js +1 -1
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/ShaderTranspiler.js +1 -1
- package/views/webgl/UniformBufferLayout.js +5 -0
- package/views/webgl/UniformBufferObject.js +5 -0
- package/views/webgl/enums.js +1 -1
- package/views/webgl/rasterUtils.js +1 -1
- package/views/webgl/storageLayouts.js +5 -0
- package/views/webgl/testDoublePrecisionArithmetic.js +1 -1
- package/views/webgl/testFloatBufferBlend.js +1 -1
- package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
- package/views/webgl/testSamplerPrecision.js +1 -1
- package/views/webgl/tests/SimpleDraw.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BuildingExplorer/BuildingDisciplinesViewModel.js +1 -1
- package/widgets/Editor/BatchCreateWorkflow.js +1 -1
- package/widgets/Editor/CreateWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/ElevationProfile/components/SettingsButton.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
- package/widgets/Feature/FeatureMedia.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/InputField.js +1 -1
- package/widgets/FeatureForm/InputFieldGroup.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/FloorFilter.js +1 -1
- package/widgets/LayerList/ListItemPanel.js +1 -1
- package/widgets/LayerList/support/layerListUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Weather/CoverageSlider.js +5 -0
- package/widgets/Weather/WeatherViewModel.js +1 -1
- package/widgets/Weather/css.js +1 -1
- package/widgets/Weather.js +1 -1
- package/assets/esri/core/workers/chunks/0881ce46b10362861f87.js +0 -1
- package/assets/esri/core/workers/chunks/0c0a02770eeeb3e28ea1.js +0 -1
- package/assets/esri/core/workers/chunks/0d2effbd84a9482eb639.js +0 -1
- package/assets/esri/core/workers/chunks/0f04246c1b591a3ac74d.js +0 -1
- package/assets/esri/core/workers/chunks/1ac6be0dc25e16c75d06.js +0 -1
- package/assets/esri/core/workers/chunks/1f8110ea12d65ca94b55.js +0 -1
- package/assets/esri/core/workers/chunks/2025d0fd61a64876c81b.js +0 -1
- package/assets/esri/core/workers/chunks/241859d74c0daac62e11.js +0 -1
- package/assets/esri/core/workers/chunks/331be347c1b1ca0be2d2.js +0 -1
- package/assets/esri/core/workers/chunks/39af317388ecebb4387d.js +0 -1
- package/assets/esri/core/workers/chunks/39be2893a7dbdecfd65a.js +0 -1
- package/assets/esri/core/workers/chunks/3a20f66b0b7d08064e34.js +0 -1
- package/assets/esri/core/workers/chunks/445099d037affd139ed0.js +0 -1
- package/assets/esri/core/workers/chunks/45848fecec88ed2da33d.js +0 -1
- package/assets/esri/core/workers/chunks/48d3a3abc53abe6a4017.js +0 -1
- package/assets/esri/core/workers/chunks/5005b8c1fdd5cb9a4c19.js +0 -1
- package/assets/esri/core/workers/chunks/52e4c367c72ea7cc3457.js +0 -1
- package/assets/esri/core/workers/chunks/5d8170f6207dbeb4de1b.js +0 -1
- package/assets/esri/core/workers/chunks/642c38ac00a962f35d44.js +0 -1
- package/assets/esri/core/workers/chunks/64459604505647e9c714.js +0 -1
- package/assets/esri/core/workers/chunks/653d1550dd1a4867a9fc.js +0 -1
- package/assets/esri/core/workers/chunks/65f73fbbc3c7c60c6d3d.js +0 -1
- package/assets/esri/core/workers/chunks/6db7081d344bea26ef64.js +0 -1
- package/assets/esri/core/workers/chunks/6e13dab8ec43f7494297.js +0 -1
- package/assets/esri/core/workers/chunks/7bd4c3ee43fb038b88d8.js +0 -1
- package/assets/esri/core/workers/chunks/803de5097a8a2c4b58a8.js +0 -1
- package/assets/esri/core/workers/chunks/8298231a0fd0129b0d5c.js +0 -1
- package/assets/esri/core/workers/chunks/8500c6c011400af1b7bd.js +0 -1
- package/assets/esri/core/workers/chunks/8b322a2a47dfdbb59b45.js +0 -1
- package/assets/esri/core/workers/chunks/8f83bebef9174c3f15da.js +0 -1
- package/assets/esri/core/workers/chunks/904332faa22bc0e876cb.js +0 -1
- package/assets/esri/core/workers/chunks/950565d1e682fc4072e1.js +0 -1
- package/assets/esri/core/workers/chunks/a247ddd84245c81112c8.js +0 -1
- package/assets/esri/core/workers/chunks/a9ffa806df20130ecfb6.js +0 -1
- package/assets/esri/core/workers/chunks/af13e534e4160636bd3d.js +0 -1
- package/assets/esri/core/workers/chunks/b2f62234ebb8b6158baa.js +0 -1
- package/assets/esri/core/workers/chunks/b5bb7cfa26b1f0cec67a.js +0 -1
- package/assets/esri/core/workers/chunks/b8666d1a4e4fff7a4703.js +0 -1
- package/assets/esri/core/workers/chunks/bea1da9e3f878e0e2c83.js +0 -1
- package/assets/esri/core/workers/chunks/c1b6c31fa3ec1542f996.js +0 -1
- package/assets/esri/core/workers/chunks/c32a4fbdc87225f84019.js +0 -1
- package/assets/esri/core/workers/chunks/c67fea81f69a60c0eaef.js +0 -1
- package/assets/esri/core/workers/chunks/d336afd5890dcdbf5341.js +0 -1
- package/assets/esri/core/workers/chunks/da69e3e5949fe1716e34.js +0 -1
- package/assets/esri/core/workers/chunks/daa9c450b2e2a5371249.js +0 -1
- package/assets/esri/core/workers/chunks/dd63ba77b7e4c3c9c594.js +0 -1
- package/assets/esri/core/workers/chunks/dfa57982d28c9aeb97b9.js +0 -1
- package/assets/esri/core/workers/chunks/e01812116b27874948f0.js +0 -1
- package/assets/esri/core/workers/chunks/e5c9d8482b913cf3580a.js +0 -1
- package/assets/esri/core/workers/chunks/eeadd92f0bede9fc8745.js +0 -1
- package/assets/esri/core/workers/chunks/fbb67cb6224aed2cce16.js +0 -1
- package/assets/esri/core/workers/chunks/feeaf61424336e9eac88.js +0 -1
- package/assets/esri/core/workers/chunks/ff02295329a8986d0568.js +0 -1
- package/views/2d/engine/webgl/mesh/templates/meshUtils.js +0 -5
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos);
|
|
157
157
|
${e.OITEnabled?"gl_FragColor = premultiplyAlpha(gl_FragColor);":""}
|
|
158
158
|
}
|
|
159
|
-
`)),t.include(v.s,e),t}const w=Object.freeze({__proto__:null,build:N})},21787:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>o,i:()=>c,t:()=>n});var i=r(46851);function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function n(e,t){if(e===t){const r=t[1],i=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=r[0],f=r[1],m=r[2],p=r[3],v=r[4],g=r[5],_=r[6],T=r[7],x=r[8];return e[0]=h*i+f*a+m*c,e[1]=h*o+f*s+m*d,e[2]=h*n+f*l+m*u,e[3]=p*i+v*a+g*c,e[4]=p*o+v*s+g*d,e[5]=p*n+v*l+g*u,e[6]=_*i+T*a+x*c,e[7]=_*o+T*s+x*d,e[8]=_*n+T*l+x*u,e}function s(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],u=t[9],h=t[10],f=t[11],m=t[12],p=t[13],v=t[14],g=t[15],_=r*s-i*a,T=r*l-o*a,x=r*c-n*a,b=i*l-o*s,A=i*c-n*s,E=o*c-n*l,S=d*p-u*m,M=d*v-h*m,C=d*g-f*m,R=u*v-h*p,O=u*g-f*p,y=h*g-f*v;let N=_*y-T*O+x*R+b*C-A*M+E*S;return N?(N=1/N,e[0]=(s*y-l*O+c*R)*N,e[1]=(l*C-a*y-c*M)*N,e[2]=(a*O-s*C+c*S)*N,e[3]=(o*O-i*y-n*R)*N,e[4]=(r*y-o*C+n*M)*N,e[5]=(i*C-r*O-n*S)*N,e[6]=(p*E-v*A+g*b)*N,e[7]=(v*x-m*E-g*T)*N,e[8]=(m*A-p*x+g*_)*N,e):null}function l(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function c(e){const t=i.E,r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(o*o+s*s+d*d))<=t&&Math.abs(1-(n*n+l*l+u*u))<=t}const d=a,u=l;Object.freeze({__proto__:null,fromMat4:o,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},set:function(e,t,r,i,o,n,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=o,e[4]=n,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:n,invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],u=d*a-s*c,h=-d*n+s*l,f=c*n-a*l;let m=r*u+i*h+o*f;return m?(m=1/m,e[0]=u*m,e[1]=(-d*i+o*c)*m,e[2]=(s*i-o*a)*m,e[3]=h*m,e[4]=(d*r-o*l)*m,e[5]=(-s*r+o*n)*m,e[6]=f*m,e[7]=(-c*r+i*l)*m,e[8]=(a*r-i*n)*m,e):null},adjoint:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8];return e[0]=a*d-s*c,e[1]=o*c-i*d,e[2]=i*s-o*a,e[3]=s*l-n*d,e[4]=r*d-o*l,e[5]=o*n-r*s,e[6]=n*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*n,e},determinant:function(e){const t=e[0],r=e[1],i=e[2],o=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*n-a*l)+r*(-c*o+a*s)+i*(l*o-n*s)},multiply:a,translate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=r[0],f=r[1];return e[0]=i,e[1]=o,e[2]=n,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+f*a+c,e[7]=h*o+f*s+d,e[8]=h*n+f*l+u,e},rotate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=Math.sin(r),f=Math.cos(r);return e[0]=f*i+h*a,e[1]=f*o+h*s,e[2]=f*n+h*l,e[3]=f*a-h*i,e[4]=f*s-h*o,e[5]=f*l-h*n,e[6]=c,e[7]=d,e[8]=u,e},scale:function(e,t,r){const i=r[0],o=r[1],n=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],o=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromQuat:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r+r,s=i+i,l=o+o,c=r*a,d=i*a,u=i*s,h=o*a,f=o*s,m=o*l,p=n*a,v=n*s,g=n*l;return e[0]=1-u-m,e[3]=d-g,e[6]=h+v,e[1]=d+g,e[4]=1-c-m,e[7]=f-p,e[2]=h-v,e[5]=f+p,e[8]=1-c-u,e},normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[4],a=t[5],s=t[6],l=t[8],c=t[9],d=t[10],u=d*a-s*c,h=-d*n+s*l,f=c*n-a*l,m=r*u+i*h+o*f;if(!m)return null;const p=1/m;return e[0]=u*p,e[1]=(-d*i+o*c)*p,e[2]=(s*i-o*a)*p,e[3]=h*p,e[4]=(d*r-o*l)*p,e[5]=(-s*r+o*n)*p,e[6]=f*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*n)*p,e},normalFromMat4:s,projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},subtract:l,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},equals:function(e,t){const r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=t[0],f=t[1],m=t[2],p=t[3],v=t[4],g=t[5],_=t[6],T=t[7],x=t[8];return Math.abs(r-h)<=i.E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-f)<=i.E*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(n-m)<=i.E*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(a-p)<=i.E*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-v)<=i.E*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-g)<=i.E*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-_)<=i.E*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(d-T)<=i.E*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(u-x)<=i.E*Math.max(1,Math.abs(u),Math.abs(x))},isOrthoNormal:c,mul:d,sub:u})},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function o(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>o,c:()=>i}),Object.freeze({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},fromValues:function(e,t,r,i,o,n,a,s,l){return[e,t,r,i,o,n,a,s,l]},createView:o})},13598:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}function n(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>a,a:()=>n,b:()=>o,c:()=>i});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze({__proto__:null,create:i,clone:o,fromValues:function(e,t,r,i,o,n,a,s,l,c,d,u,h,f,m,p){return[e,t,r,i,o,n,a,s,l,c,d,u,h,f,m,p]},createView:n,IDENTITY:a})},51305:(e,t,r)=>{r.d(t,{c:()=>f,g:()=>d,j:()=>O,k:()=>p,m:()=>u,s:()=>c});var i=r(46521),o=r(94961),n=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function d(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>a.E?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function u(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=r[0],l=r[1],c=r[2],d=r[3];return e[0]=i*d+a*s+o*c-n*l,e[1]=o*d+a*l+n*s-i*c,e[2]=n*d+a*c+i*l-o*s,e[3]=a*d-i*s-o*l-n*c,e}function h(e,t,r,i){const o=t[0],n=t[1],s=t[2],l=t[3];let c,d,u,h,f,m=r[0],p=r[1],v=r[2],g=r[3];return d=o*m+n*p+s*v+l*g,d<0&&(d=-d,m=-m,p=-p,v=-v,g=-g),1-d>a.E?(c=Math.acos(d),u=Math.sin(c),h=Math.sin((1-i)*c)/u,f=Math.sin(i*c)/u):(h=1-i,f=i),e[0]=h*o+f*m,e[1]=h*n+f*p,e[2]=h*s+f*v,e[3]=h*l+f*g,e}function f(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function m(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const o=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*o+n]-t[3*n+o])*i,e[o]=(t[3*o+r]+t[3*r+o])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function p(e,t,r,i){const o=.5*Math.PI/180;t*=o,r*=o,i*=o;const n=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),d=Math.cos(i);return e[0]=n*l*d-a*s*c,e[1]=a*s*d+n*l*c,e[2]=a*l*c-n*s*d,e[3]=a*l*d+n*s*c,e}const v=l.c,g=l.s,_=l.a,T=u,x=l.b,b=l.d,A=l.l,E=l.e,S=E,M=l.f,C=M,R=l.n,O=l.g,y=l.h,N=(0,n.c)(),w=(0,n.f)(1,0,0),P=(0,n.f)(0,1,0),D=(0,o.a)(),I=(0,o.a)(),L=(0,i.c)();Object.freeze({__proto__:null,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},setAxisAngle:c,getAxisAngle:d,multiply:u,rotateX:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=o*l+n*s,e[2]=n*l-o*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*s,e[1]=o*l+a*s,e[2]=n*l+i*s,e[3]=a*l-o*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=o*l-i*s,e[2]=n*l+a*s,e[3]=a*l-n*s,e},calculateW:function(e,t){const r=t[0],i=t[1],o=t[2];return e[0]=r,e[1]=i,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-o*o)),e},slerp:h,random:function(e){const t=(0,a.R)(),r=(0,a.R)(),i=(0,a.R)(),o=Math.sqrt(1-t),n=Math.sqrt(t);return e[0]=o*Math.sin(2*Math.PI*r),e[1]=o*Math.cos(2*Math.PI*r),e[2]=n*Math.sin(2*Math.PI*i),e[3]=n*Math.cos(2*Math.PI*i),e},invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r*r+i*i+o*o+n*n,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-o*s,e[3]=n*s,e},conjugate:f,fromMat3:m,fromEuler:p,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},copy:v,set:g,add:_,mul:T,scale:x,dot:b,lerp:A,length:E,len:S,squaredLength:M,sqrLen:C,normalize:R,exactEquals:O,equals:y,rotationTo:function(e,t,r){const i=(0,s.d)(t,r);return i<-.999999?((0,s.c)(N,w,t),(0,s.u)(N)<1e-6&&(0,s.c)(N,P,t),(0,s.n)(N,N),c(e,N,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.c)(N,t,r),e[0]=N[0],e[1]=N[1],e[2]=N[2],e[3]=1+i,R(e,e))},sqlerp:function(e,t,r,i,o,n){return h(D,t,o,n),h(I,r,i,n),h(e,D,I,2*n*(1-n)),e},setAxes:function(e,t,r,i){const o=L;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=i[0],o[4]=i[1],o[7]=i[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],R(e,m(e,o))}})},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function o(e){return[e[0],e[1],e[2],e[3]]}function n(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>a,a:()=>i,b:()=>o,c:()=>n});const a=[0,0,0,1];Object.freeze({__proto__:null,create:i,clone:o,fromValues:function(e,t,r,i){return[e,t,r,i]},createView:n,IDENTITY:a})},20773:(e,t,r)=>{r.d(t,{a:()=>n,b:()=>l,n:()=>s,s:()=>a,t:()=>o});var i=r(72220);function o(e,t,r){if(e.count!==t.count)return void i.k.error("source and destination buffers need to have the same number of elements");const o=e.count,n=r[0],a=r[1],s=r[2],l=r[4],c=r[5],d=r[6],u=r[8],h=r[9],f=r[10],m=r[12],p=r[13],v=r[14],g=e.typedBuffer,_=e.typedBufferStride,T=t.typedBuffer,x=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*_,r=e*x,i=T[r],o=T[r+1],b=T[r+2];g[t]=n*i+l*o+u*b+m,g[t+1]=a*i+c*o+h*b+p,g[t+2]=s*i+d*o+f*b+v}}function n(e,t,r){if(e.count!==t.count)return void i.k.error("source and destination buffers need to have the same number of elements");const o=e.count,n=r[0],a=r[1],s=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],m=e.typedBuffer,p=e.typedBufferStride,v=t.typedBuffer,g=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*p,r=e*g,i=v[r],o=v[r+1],_=v[r+2];m[t]=n*i+l*o+u*_,m[t+1]=a*i+c*o+h*_,m[t+2]=s*i+d*o+f*_}}function a(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*n,i=e*s;o[t]=r*a[i],o[t+1]=r*a[i+1],o[t+2]=r*a[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,o=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*o,r=e*a,s=n[r],l=n[r+1],c=n[r+2],d=Math.sqrt(s*s+l*l+c*c);if(d>0){const e=1/d;i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*n,i=e*s;o[t]=a[i]>>r,o[t+1]=a[i+1]>>r,o[t+2]=a[i+2]>>r}}Object.freeze({__proto__:null,transformMat4:o,transformMat3:n,scale:a,normalize:s,shiftRight:l})},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,o=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<s;++e)i[l]=n[c],i[l+1]=n[c+1],i[l+2]=n[c+2],l+=o,c+=a}function o(e,t,r,i,o){var n,a;const s=e.typedBuffer,l=e.typedBufferStride,c=null!=(n=null==o?void 0:o.count)?n:e.count;let d=(null!=(a=null==o?void 0:o.dstIndex)?a:0)*l;for(let e=0;e<c;++e)s[d]=t,s[d+1]=r,s[d+2]=i,d+=l}r.d(t,{c:()=>i,f:()=>o}),Object.freeze({__proto__:null,copy:i,fill:o})},72119:(e,t,r)=>{function i(){return new Float32Array(3)}function o(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function n(){return i()}function a(){return o(1,1,1)}function s(){return o(1,0,0)}function l(){return o(0,1,0)}function c(){return o(0,0,1)}r.d(t,{c:()=>i,f:()=>o});const d=n(),u=a(),h=s(),f=l(),m=c();Object.freeze({__proto__:null,create:i,clone:function(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:o,createView:function(e,t){return new Float32Array(e,t,3)},zeros:n,ones:a,unitX:s,unitY:l,unitZ:c,ZEROS:d,ONES:u,UNIT_X:h,UNIT_Y:f,UNIT_Z:m})},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>{var r;return null!=(null==(r=e)?void 0:r.match(t))}))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{pJ:()=>o,XO:()=>i});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{k:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},98833:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>Kr,gltfToEngineResources:()=>Qr,parseUrl:()=>Zr});var i=r(32243),o=r(70586),n=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),d=r(65617),u=r(60437),h=r(56481),f=r(20773),m=r(11077),p=r(8323),v=r(40270),g=r(88246),_=r(91911),T=r(3172),x=r(66643),b=r(20102),A=r(92604),E=r(95330),S=r(23670);async function M(e,t){const{data:r}=await(0,T.default)(e,{responseType:"image",...t});return r}var C=r(47026),R=r(44553),O=r(11726);class y{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,d.c)(),(0,O.hu)(e.length>=1),(0,O.hu)(r.length%this._numIndexPerPrimitive==0),(0,O.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,O.hu)(3===i.size||4===i.size);const{data:o,size:n}=i,a=e.length;let s=n*r[this._numIndexPerPrimitive*e[0]];N.clear(),N.push(s),this.bbMin=(0,d.f)(o[s],o[s+1],o[s+2]),this.bbMax=(0,d.a)(this.bbMin);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*r[i+e],N.push(s);let t=o[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=o[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=o[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.e)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<N.length;++e){s=N.getItemAt(e);const t=o[s]-this.center[0],r=o[s+1]-this.center[1],i=o[s+2]-this.center[2],n=t*t+r*r+i*i;if(n<=l)continue;const a=Math.sqrt(n),c=.5*(a-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const d=c/a;this.center[0]+=t*d,this.center[1]+=r*d,this.center[2]+=i*d}N.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.h)(this.bbMin,this.bbMax)>1){const e=(0,c.e)((0,d.c)(),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:o,size:n}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=n*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=n*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<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 s=new Array(8);for(let e=0;e<8;++e)s[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];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new y(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){N.prune()}}const N=new R.Z({deallocator:null});var w,P,D=r(99001);class I{constructor(){this.id=(0,D.D)()}unload(){}}(P=w||(w={}))[P.Layer=0]="Layer",P[P.Object=1]="Object",P[P.Geometry=2]="Geometry",P[P.Material=3]="Material",P[P.Texture=4]="Texture",P[P.COUNT=5]="COUNT";var L=r(64291);class F extends I{constructor(e,t=[],r=C.MX.Triangle,i=-1){super(),this._primitiveType=r,this.edgeIndicesLength=i,this.type=w.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,L.p)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,r]of t)r&&(this._indices.set(e,H(r)),e===C.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,o.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===C.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(C.T.POSITION),r=this.vertexAttributes.get(C.T.POSITION);return(0,L.cM)(r,t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(C.T.POSITION),r=this.vertexAttributes.get(C.T.POSITION);return(0,L.NO)(r,t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(C.T.POSITION);if(0===e.length)return null;const t=this.primitiveType===C.MX.Triangle?3:1;(0,O.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,L.p)(e.length/t),i=this.vertexAttributes.get(C.T.POSITION);return new y(r,t,e,i)}}function H(e){if(e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return e;for(const t of e)if(t>=65536)return e;return new Uint16Array(e)}var B=r(74085),U=r(32448),z=r(22021),V=r(1533),G=r(17452),W=r(85958),k=r(99880);let q;var $;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}($||($={}));var X=r(35371),j=r(75656);function Y(e,t,r,i,o=0){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=o*e.stride;if(e.count<=4)n.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),n.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)n.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)n.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function J(e,t,r,i){const o=e.gl,n=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)o.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(X.w0.ARRAY_BUFFER)}function K(e){switch(e){case X.VI.ALPHA:case X.VI.LUMINANCE:case X.Tg.STENCIL_INDEX8:return 1;case X.VI.LUMINANCE_ALPHA:case X.VI.RGBA4:case X.VI.R16F:case X.Tg.RGBA4:case X.Tg.DEPTH_COMPONENT16:return 2;case X.VI.RGB:case X.VI.DEPTH_COMPONENT:return 3;case X.VI.RGBA:case X.VI.DEPTH_STENCIL:case X.VI.R32F:case X.VI.R11F_G11F_B10F:case X.VI.RG16F:case X.Tg.DEPTH_STENCIL:return 4;case X.VI.RG32F:case X.VI.RGBA16F:return 8;case X.VI.RGB32F:return 12;case X.VI.RGBA32F:return 16;case X.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case X.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case X.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case X.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case X.q_.COMPRESSED_R11_EAC:case X.q_.COMPRESSED_SIGNED_R11_EAC:case X.q_.COMPRESSED_RGB8_ETC2:case X.q_.COMPRESSED_SRGB8_ETC2:case X.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case X.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case X.q_.COMPRESSED_RG11_EAC:case X.q_.COMPRESSED_SIGNED_RG11_EAC:case X.q_.COMPRESSED_RGBA8_ETC2_EAC:case X.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function Z(e){if((0,o.Wi)(e))return 0;if("descriptor"in e)return e.glName?Z(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return K(t)*i*r}r(80442);let Q=null,ee=null;async function te(){return(0,o.Wi)(ee)&&(ee=function(){if((0,o.Wi)(q)){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);q=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),Q=await ee),ee}function re(e,t,r,i,o){const n=K(t?X.q_.COMPRESSED_RGBA8_ETC2_EAC:X.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[$.ETC2_RGBA,X.q_.COMPRESSED_RGBA8_ETC2_EAC]:[$.ETC1_RGB,X.q_.COMPRESSED_RGB8_ETC2]:c?i?[$.BC3_RGBA,X.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[$.BC1_RGB,X.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[$.RGBA32,X.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,d))),s(e,d,f[e]);const m=f.length>1,p=m?X.cw.LINEAR_MIPMAP_LINEAR:X.cw.LINEAR,v={...t,samplingMode:p,hasMipmap:m,internalFormat:u,width:o,height:n};return new j.x(e,v,{type:"compressed",levels:f})}const ae=A.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function se(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const le=se("DXT1"),ce=se("DXT3"),de=se("DXT5");const ue=new Map([[C.T.POSITION,0],[C.T.NORMAL,1],[C.T.UV0,2],[C.T.COLOR,3],[C.T.SIZE,4],[C.T.TANGENT,4],[C.T.AUXPOS1,5],[C.T.SYMBOLCOLOR,5],[C.T.AUXPOS2,6],[C.T.FEATUREATTRIBUTE,6],[C.T.INSTANCEFEATUREATTRIBUTE,6],[C.T.INSTANCECOLOR,7],[C.T.MODEL,8],[C.T.MODELNORMAL,12],[C.T.MODELORIGINHI,11],[C.T.MODELORIGINLO,15]]);var he=r(21968);new he.G(C.T.POSITION,3,X.g.FLOAT,0,12),new he.G(C.T.POSITION,3,X.g.FLOAT,0,20),new he.G(C.T.UV0,2,X.g.FLOAT,12,20),new he.G(C.T.POSITION,3,X.g.FLOAT,0,32),new he.G(C.T.NORMAL,3,X.g.FLOAT,12,32),new he.G(C.T.UV0,2,X.g.FLOAT,24,32),new he.G(C.T.POSITION,3,X.g.FLOAT,0,16),new he.G(C.T.COLOR,4,X.g.UNSIGNED_BYTE,12,16);const fe=[new he.G(C.T.POSITION,2,X.g.FLOAT,0,8)],me=[new he.G(C.T.POSITION,2,X.g.FLOAT,0,16),new he.G(C.T.UV0,2,X.g.FLOAT,8,16)];var pe=r(49300);const ve=A.Z.getLogger("esri.views.webgl.BufferObject");class ge{constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(X._g.Buffer,this),this._glName=this._context.gl.createBuffer(),(0,pe.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new ge(e,X.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new ge(e,X.w0.ARRAY_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===X.w0.ARRAY_BUFFER?this._size:this._indexType===X.g.UNSIGNED_INT?4*this._size:2*this._size}dispose(){var e;null!=(e=this._context)&&e.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(X._g.Buffer,this),this._context=null):this._glName&&ve.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&ve.error("Buffer size needs to be positive!"),this.bufferType===X.w0.ELEMENT_ARRAY_BUFFER&&(0,o.pC)(t))switch(this._indexType=t,t){case X.g.UNSIGNED_SHORT:e*=2;break;case X.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;(0,V.Uc)(e)&&(t/=2,this._indexType=X.g.UNSIGNED_SHORT),(0,V.ZY)(e)&&(t/=4,this._indexType=X.g.UNSIGNED_INT),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;(0,o.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,pe.zu)(i),this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&ve.error("offset is out of range!");let o=t,n=r,a=i,s=e.byteLength;(0,V.Uc)(e)?(s/=2,o*=2,n*=2,a*=2):(0,V.ZY)(e)&&(s/=4,o*=4,n*=4,a*=4),void 0===i&&(i=s-1),r>=i&&ve.error("end must be bigger than start!"),t+r-i>this._size&&ve.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,d=ArrayBuffer.isView(e)?e.buffer:e,u=0===n&&a===e.byteLength?d:d.slice(n,a);c.bufferSubData(this.bufferType,o,u),(0,pe.zu)(c),this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&ve.error("offset is out of range!"),r>=i&&ve.error("end must be bigger than start!"),t+r-i>this._size&&ve.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl,a=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,a),(0,pe.zu)(n),this._context.bindVAO(o)}}const _e=A.Z.getLogger("esri.views.webgl.VertexArrayObject");class Te{constructor(e,t,r,i,o=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=o,this._glName=null,this._initialized=!1,e.instanceCounter.increment(X._g.VAO,this)}get glName(){return this._glName}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,o.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){var t,r;const e=null==(t=this._context)||null==(r=t.capabilities)?void 0:r.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):_e.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e].dispose(),delete this._buffers[e];this._indexBuffer=(0,o.O3)(this._indexBuffer)}this._context.instanceCounter.decrement(X._g.VAO,this),this._context=null}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&_e.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||_e.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||_e.error("Vertex buffer is uninitialized!");const o=t[r];o||_e.error("Vertex element descriptor is empty!"),Y(this._context,this._locations,i,o)}(0,o.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||_e.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||_e.error("Vertex buffer is uninitialized!");const o=t[r];J(this._context,this._locations,i,o)}(0,o.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}class xe{constructor(e,t){this._context=e,this._desc=t,this._context.instanceCounter.increment(X._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this),r.renderbufferStorage(r.RENDERBUFFER,t.internalFormat,t.width,t.height)}get descriptor(){return this._desc}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(X._g.Renderbuffer,this),this._context=null)}}const be=A.Z.getLogger("esri.views.webgl.FrameBufferObject");class Ae{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(X._g.Framebuffer,this),(0,o.pC)(r)){Array.isArray(r)||(r=[r]);for(let t=0;t<r.length;++t){var n,a;const i=r[t];let o;Ee(i)?(o=i.descriptor,this._colorAttachments.set(X.VY.COLOR_ATTACHMENT0+t,i)):(o=i,this._colorAttachments.set(X.VY.COLOR_ATTACHMENT0+t,new j.x(e,i))),(null==(n=this._desc)?void 0:n.colorTarget)!==X.Lm.TEXTURE&&(null==(a=this._desc)?void 0:a.colorTarget)!==X.Lm.CUBEMAP&&console.error("Framebuffer is initialized with a texture however the descriptor indicates using a renderbuffer color attachment!"),this._validateColorAttachmentPoint(X.VY.COLOR_ATTACHMENT0+t),this._validateTextureDimensions(o,this._desc)}}if(i instanceof xe){var s;const e=null!=(s=this._desc.depthStencilTarget)?s:X.OU.DEPTH_STENCIL_RENDER_BUFFER;e===X.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=i:e===X.OU.DEPTH_RENDER_BUFFER||e===X.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=i:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),Se(i.descriptor,this._desc)}else if((0,o.pC)(i)){let e;this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"),Ee(i)?(this._depthStencilTexture=i,e=i.descriptor):this._depthStencilTexture=new j.x(this._context,i),this._validateTextureDimensions(e,this._desc)}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(X._g.Framebuffer,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(X.VY.COLOR_ATTACHMENT0);return e&&Ee(e)?e:null}get colorAttachment(){return this._colorAttachments.get(X.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width}get height(){return this._desc.height}get gpuMemoryUsage(){return Z(this.colorAttachment)+Z(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&Ee(t)?t:null}framebufferTexture2D(e,t,r=X.VY.COLOR_ATTACHMENT0,i=X.No.TEXTURE_2D,o=0){t.framebufferTexture2D(t.FRAMEBUFFER,r,i,e,o)}attachColorTexture(e,t=X.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDimensions(r,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(e.glName,this._context.gl,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=X.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(Ee(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,e)),this._colorAttachments.delete(e),r}}attachDepthStencilTexture(e){if((0,o.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==X.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==X.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDimensions(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==X.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=X.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(e.glName,this._context.gl,X.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,X.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,o.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==X.Tg.DEPTH_STENCIL&&t.internalFormat!==X.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),Se(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===X.Tg.DEPTH_STENCIL?X.OU.DEPTH_STENCIL_RENDER_BUFFER:X.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===X.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(t.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===X.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this.detachColorTexture(),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=a.descriptor;a.descriptor.target!==X.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(e+r>s.width||t+i>s.height||o+r>l.width||n+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,d=c.bindTexture(a,j.x.TEXTURE_UNIT_FOR_UPDATES);c.bindFramebuffer(this),c.gl.copyTexSubImage2D(X.No.TEXTURE_2D,0,o,n,e,t,r,i),c.bindTexture(d,j.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=X.No.TEXTURE_2D){var t,r,i,o;const n=this._context.gl;if(this._initialized)return void n.bindFramebuffer(n.FRAMEBUFFER,this.glName);this._glName&&n.deleteFramebuffer(this._glName);const a=this._context,s=n.createFramebuffer(),l=this._desc,c=null!=(t=l.colorTarget)?t:X.Lm.RENDER_BUFFER,d=null!=(r=l.width)?r:1,u=null!=(i=l.height)?i:1;if(n.bindFramebuffer(n.FRAMEBUFFER,s),0===this._colorAttachments.size)if(c===X.Lm.TEXTURE)this._colorAttachments.set(X.VY.COLOR_ATTACHMENT0,function(e,t,r){return new j.x(e,{target:r,pixelFormat:X.VI.RGBA,dataType:X.Br.UNSIGNED_BYTE,samplingMode:X.cw.NEAREST,wrapMode:X.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(a,l,this.descriptor.colorTarget===X.Lm.CUBEMAP?X.No.TEXTURE_CUBE_MAP:X.No.TEXTURE_2D));else{const e=new xe(a,{internalFormat:X.Tg.RGBA4,width:d,height:u});this._colorAttachments.set(X.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((t,r)=>{t&&(Ee(t)?this.framebufferTexture2D(t.glName,n,r,e):n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,t.glName))}));const h=null!=(o=l.depthStencilTarget)?o:X.OU.NONE;switch(h){case X.OU.DEPTH_RENDER_BUFFER:case X.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new xe(a,{internalFormat:l.depthStencilTarget===X.OU.DEPTH_RENDER_BUFFER?X.Tg.DEPTH_COMPONENT16:X.Tg.DEPTH_STENCIL,width:d,height:u}));const e=h===X.OU.DEPTH_RENDER_BUFFER?n.DEPTH_ATTACHMENT:n.DEPTH_STENCIL_ATTACHMENT;n.framebufferRenderbuffer(n.FRAMEBUFFER,e,n.RENDERBUFFER,this._depthAttachment.glName);break}case X.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new xe(a,{internalFormat:X.Tg.STENCIL_INDEX8,width:d,height:u})),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.STENCIL_ATTACHMENT,n.RENDERBUFFER,this._stencilAttachment.glName);break;case X.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){a.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:X.No.TEXTURE_2D,pixelFormat:X.VI.DEPTH_STENCIL,dataType:X.Br.UNSIGNED_INT_24_8,samplingMode:X.cw.NEAREST,wrapMode:X.e8.CLAMP_TO_EDGE,width:d,height:u};this._depthStencilTexture=new j.x(a,e)}this.framebufferTexture2D(this._depthStencilTexture.glName,n,n.DEPTH_STENCIL_ATTACHMENT,e)}(0,pe.CG)()&&n.checkFramebufferStatus(n.FRAMEBUFFER)!==n.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=s,this._initialized=!0}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{if(Ee(e))this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,t)),e.dispose();else if(e instanceof WebGLRenderbuffer){const r=this._context.gl;this._initialized&&(this._context.bindFramebuffer(this),r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,null)),this._context.gl.deleteRenderbuffer(e)}})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===X.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,e,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateTextureDimensions(e,t){e.target!==X.No.TEXTURE_2D&&e.target!==X.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}_validateColorAttachmentPoint(e){if(-1===Ae._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Ae._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Ae._MAX_COLOR_ATTACHMENTS=1}const t=e-X.VY.COLOR_ATTACHMENT0;t+1>Ae._MAX_COLOR_ATTACHMENTS&&be.error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Ae._MAX_COLOR_ATTACHMENTS} color attachments`)}}function Ee(e){return"type"in e&&"texture"===e.type}function Se(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}Ae._MAX_COLOR_ATTACHMENTS=-1;var Me,Ce,Re=r(46314);class Oe extends I{constructor(e,t){super(),this.data=e,this.type=w.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new U.Z,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:X.e8.REPEAT,t:X.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||C.CE.STRETCH,this.estimatedTexMemRequired=Oe._estimateTexMemRequired(this.data,this.params),this._startPreload()}_startPreload(){const e=this.data;(0,o.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){(0,G.jc)(e.src)||"auto"===e.preload&&e.crossOrigin||(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src)}_startPreloadImageElement(e){(0,G.HK)(e.src)||(0,G.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,o.Wi)(e))return 0;if((0,V.eP)(e)||(0,V.lq)(e))return t.encoding===Oe.KTX2_ENCODING?function(e,t){if((0,o.Wi)(Q))return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===Oe.BASIS_ENCODING?function(e,t){if((0,o.Wi)(Q))return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(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?Oe._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this.data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){var t;return{target:X.No.TEXTURE_2D,pixelFormat:X.VI.RGBA,dataType:X.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?X.cw.LINEAR_MIPMAP_LINEAR:X.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:null!=(t=this.params.maxAnisotropy)?t:this.params.mipmap?e.parameters.maxMaxAnisotropy:1}}get glTexture(){return this._glTexture}load(e,t){if((0,o.pC)(this._glTexture))return this._glTexture;if((0,o.pC)(this._loadingPromise))return this._loadingPromise;const r=this.data;return(0,o.Wi)(r)?(this._glTexture=new j.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Oe.DDS_ENCODING?this._loadFromDDSData(e,r):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Oe.KTX2_ENCODING?this._loadFromKTX2(e,r):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===Oe.BASIS_ENCODING?this._loadFromBasis(e,r):(0,V.lq)(r)?this._loadFromPixelData(e,r):(0,V.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this.data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this.data instanceof HTMLVideoElement)||(0,o.Wi)(this._glTexture))return r;if(this.data.readyState<Me.HAVE_CURRENT_DATA||r===this.data.currentTime)return r;if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:o}=this._powerOfTwoStretchInfo;o.setData(this.data),this._drawStretchedTexture(e,t,r,i,o,this._glTexture)}else{const{width:e,height:t}=this.data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this.data):this._glTexture.setData(this.data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:o,width:n,height:a}=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return ae.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return ae.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case le:o=8,n=X.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ce:o=16,n=X.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case de:o=16,n=X.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return ae.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(ae.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7])),1===a||(0,z.wt)(s)&&(0,z.wt)(l)||(ae.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:n,width:c,height:d}}(r,t.hasMipmap);return t.samplingMode=i.levels.length>1?X.cw.LINEAR_MIPMAP_LINEAR:X.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=o,t.width=n,t.height=a,new j.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(Q)&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const n=ne(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._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(Q)&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const n=ne(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._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,O.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?X.VI.LUMINANCE:3===this.params.components?X.VI.RGB:X.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new j.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const o=await M(r,{signal:i});return(0,E.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const o=await(0,W.f)(r,r.src,!1,i);return(0,E.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Me.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((n,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,o.hw)(d)},l=()=>{r.readyState>=Me.HAVE_CURRENT_DATA&&(s(),n(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new b.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const d=(0,E.fu)(i,(()=>c((0,E.zE)())))}))))}_loadFromImage(e,t,r){const i=Oe._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this.params.components?X.VI.RGB:X.VI.RGBA,!this._requiresPowerOfTwo(e,o)||(0,z.wt)(i.width)&&(0,z.wt)(i.height)?(o.width=i.width,o.height=i.height,this._glTexture=new j.x(e,o,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,o,r),this._glTexture)}_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)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=X.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,Re.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,o){const{width:n,height:a}=r,s=(0,z.Sf)(n),l=(0,z.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case C.CE.PAD:i.textureCoordinateScaleFactor=[n/s,a/l],c=new j.x(e,i),c.updateData(0,0,0,n,a,t);break;case C.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,o());break;default:(0,B.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const o=new j.x(e,r),n=new Ae(e,{colorTarget:X.Lm.TEXTURE,depthStencilTarget:X.OU.NONE},o),a=new j.x(e,{target:X.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:X.Br.UNSIGNED_BYTE,wrapMode:X.e8.CLAMP_TO_EDGE,samplingMode:X.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=fe,r=ue,i=-1,o=1){let n=null;return n=t===me?new Float32Array([i,i,0,0,o,i,1,0,i,o,0,1,o,o,1,1]):new Float32Array([i,i,o,i,i,o,o,o]),new Te(e,r,{geometry:t},{geometry:ge.createVertex(e,X.l1.STATIC_DRAW,n)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,n,s,a,o),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:n}:(s.dispose(!0),a.dispose(),n.detachColorTexture(),n.dispose()),e.bindFramebuffer(l),o}_drawStretchedTexture(e,t,r,i,o,n){e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,n.descriptor.width,n.descriptor.height);const s=t.program;e.useProgram(s),s.setUniform4f("color",1,1,1,1),s.bindTexture(o,"tex"),e.bindVAO(i),t.bindPipelineState(e),e.drawArrays(X.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height)}unload(){if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,o.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,o.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}Oe.DDS_ENCODING="image/vnd-ms.dds",Oe.KTX2_ENCODING="image/ktx2",Oe.BASIS_ENCODING="image/x.basis",(Ce=Me||(Me={}))[Ce.HAVE_NOTHING=0]="HAVE_NOTHING",Ce[Ce.HAVE_METADATA=1]="HAVE_METADATA",Ce[Ce.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Ce[Ce.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Ce[Ce.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var ye,Ne=r(64822),we=r(65576),Pe=r(18361),De=r(19419),Ie=r(94124),Le=r(37782);class Fe extends I{constructor(e,t){super(),this.type=w.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=ue,this._parameters=(0,Le.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e){(0,Le.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleInPass(e.pass)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleInPass(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,o.pC)(this.repository)&&this.repository.materialChanged(this)}}!function(e){e[e.Occlude=1]="Occlude",e[e.Transparent=2]="Transparent",e[e.OccludeAndTransparent=4]="OccludeAndTransparent",e[e.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",e[e.Opaque=16]="Opaque"}(ye||(ye={}));const He={renderOccluded:ye.Occlude};function Be(e,t,r=X.db.ADD,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]}}}const Ue={face:X.LR.BACK,mode:X.Wf.CCW},ze={face:X.LR.FRONT,mode:X.Wf.CCW},Ve=e=>e===C.Vr.Back?Ue:e===C.Vr.Front?ze:null,Ge={zNear:0,zFar:1},We={r:!0,g:!0,b:!0,a:!0};function ke(e){return et.intern(e)}function qe(e){return rt.intern(e)}function $e(e){return ot.intern(e)}function Xe(e){return at.intern(e)}function je(e){return lt.intern(e)}function Ye(e){return dt.intern(e)}function Je(e){return ht.intern(e)}function Ke(e){return mt.intern(e)}class Ze{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)}}function Qe(e){return"["+e.join(",")+"]"}const et=new Ze(tt,(e=>({__tag:"Blending",...e})));function tt(e){return e?Qe([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 rt=new Ze(it,(e=>({__tag:"Culling",...e})));function it(e){return e?Qe([e.face,e.mode]):null}const ot=new Ze(nt,(e=>({__tag:"PolygonOffset",...e})));function nt(e){return e?Qe([e.factor,e.units]):null}const at=new Ze(st,(e=>({__tag:"DepthTest",...e})));function st(e){return e?Qe([e.func]):null}const lt=new Ze(ct,(e=>({__tag:"StencilTest",...e})));function ct(e){return e?Qe([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const dt=new Ze(ut,(e=>({__tag:"DepthWrite",...e})));function ut(e){return e?Qe([e.zNear,e.zFar]):null}const ht=new Ze(ft,(e=>({__tag:"ColorWrite",...e})));function ft(e){return e?Qe([e.r,e.g,e.b,e.a]):null}const mt=new Ze(pt,(e=>({__tag:"StencilWrite",...e})));function pt(e){return e?Qe([e.mask]):null}const vt=new Ze((function(e){return e?Qe([tt(e.blending),it(e.culling),nt(e.polygonOffset),st(e.depthTest),ct(e.stencilTest),ut(e.depthWrite),ft(e.colorWrite),pt(e.stencilWrite)]):null}),(e=>({blending:ke(e.blending),culling:qe(e.culling),polygonOffset:$e(e.polygonOffset),depthTest:Xe(e.depthTest),stencilTest:je(e.stencilTest),depthWrite:Ye(e.depthWrite),colorWrite:Je(e.colorWrite),stencilWrite:Ke(e.stencilWrite)}))),gt=function(e,t,r,i,o=X.db.ADD,n=X.db.ADD,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:n,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}(X.zi.SRC_ALPHA,X.zi.ONE,X.zi.ONE_MINUS_SRC_ALPHA,X.zi.ONE_MINUS_SRC_ALPHA),_t=Be(X.zi.ONE,X.zi.ONE),Tt=Be(X.zi.ZERO,X.zi.ONE_MINUS_SRC_ALPHA);const xt={factor:-1,units:-2};function bt(e){return e?xt:null}function At(e){return e===C.Am.NONE||e===C.Am.FrontFace?X.wb.LESS:X.wb.LEQUAL}var Et,St,Mt=r(50173),Ct=r(97995),Rt=r(51305),Ot=r(94961),yt=r(72119),Nt=r(88669),wt=r(98766);(St=Et||(Et={}))[St.X=0]="X",St[St.Y=1]="Y",St[St.Z=2]="Z",r(67676);var Pt=r(22807),Dt=r(12981);new Pt.x((function(){return{origin:null,direction:null}})),(0,d.c)(),(0,d.c)();const It=A.Z.getLogger("esri.geometry.support.sphere");function Lt(){return(0,Nt.c)()}function Ft(e,t=Lt()){return(0,wt.c)(t,e)}function Ht(e){return Array.isArray(e)?e[3]:e}function Bt(e){return Array.isArray(e)?e:Xt}function Ut(e,t,r){if((0,o.Wi)(t))return!1;const{origin:i,direction:n}=t,a=zt;a[0]=i[0]-e[0],a[1]=i[1]-e[1],a[2]=i[2]-e[2];const s=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],l=2*(n[0]*a[0]+n[1]*a[1]+n[2]*a[2]),c=l*l-4*s*(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-e[3]*e[3]);if(c<0)return!1;const d=Math.sqrt(c);let u=(-l-d)/(2*s);const h=(-l+d)/(2*s);return(u<0||h<u&&h>0)&&(u=h),!(u<0||(r&&(r[0]=i[0]+n[0]*u,r[1]=i[1]+n[1]*u,r[2]=i[2]+n[2]*u),0))}const zt=(0,d.c)();function Vt(e,t,r){const i=Dt.WM.get(),o=Dt.MP.get();(0,c.c)(i,t.origin,t.direction);const n=Ht(e);(0,c.c)(r,i,t.origin),(0,c.a)(r,r,1/(0,c.l)(r)*n);const a=Wt(e,t.origin),l=function(e,t){const r=(0,c.d)(e,t)/((0,c.l)(e)*(0,c.l)(t));return-(0,z.ZF)(r)}(t.origin,r);return(0,s.d)(o,l+a,i),(0,c.m)(r,r,o),r}function Gt(e,t,r){const i=(0,c.f)(Dt.WM.get(),t,Bt(e)),o=(0,c.a)(Dt.WM.get(),i,e[3]/(0,c.l)(i));return(0,c.b)(r,o,Bt(e))}function Wt(e,t){const r=(0,c.f)(Dt.WM.get(),t,Bt(e)),i=(0,c.l)(r),o=Ht(e),n=o+Math.abs(o-i);return(0,z.ZF)(o/n)}const kt=(0,d.c)();function qt(e,t,r,i){const o=(0,c.f)(kt,t,Bt(e));switch(r){case Et.X:{const e=(0,z.jE)(o,kt)[2];return(0,c.s)(i,-Math.sin(e),Math.cos(e),0)}case Et.Y:{const e=(0,z.jE)(o,kt),t=e[1],r=e[2],n=Math.sin(t);return(0,c.s)(i,-n*Math.cos(r),-n*Math.sin(r),Math.cos(t))}case Et.Z:return(0,c.n)(i,o);default:return}}function $t(e,t){const r=(0,c.f)(jt,t,Bt(e));return(0,c.l)(r)-e[3]}const Xt=(0,d.c)(),jt=(0,d.c)();Object.freeze({__proto__:null,create:Lt,copy:Ft,fromCenterAndRadius:function(e,t){return(0,Nt.f)(e[0],e[1],e[2],t)},wrap:function(e){return e},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},fromRadius:function(e){return e},getRadius:Ht,getCenter:Bt,fromValues:function(e,t,r,i){return(0,Nt.f)(e,t,r,i)},elevate:function(e,t,r){return e!==r&&(0,c.g)(r,e),r[3]=e[3]+t,r},setExtent:function(e,t,r){return It.error("sphere.setExtent is not yet supported"),e===r?r:Ft(e,r)},intersectRay:Ut,intersectsRay:function(e,t){return Ut(e,t,null)},intersectRayClosestSilhouette:function(e,t,r){if(Ut(e,t,r))return r;const i=Vt(e,t,Dt.WM.get());return(0,c.b)(r,t.origin,(0,c.a)(Dt.WM.get(),t.direction,(0,c.i)(t.origin,i)/(0,c.l)(t.direction))),r},closestPointOnSilhouette:Vt,closestPoint:function(e,t,r){return Ut(e,t,r)?r:(function(e,t,r){const i=(0,c.d)(e.direction,(0,c.f)(r,t,e.origin));(0,c.b)(r,e.origin,(0,c.a)(r,e.direction,i))}(t,Bt(e),r),Gt(e,r,r))},projectPoint:Gt,distanceToSilhouette:function(e,t){const r=(0,c.f)(Dt.WM.get(),t,Bt(e)),i=(0,c.p)(r),o=e[3]*e[3];return Math.sqrt(Math.abs(i-o))},angleToSilhouette:Wt,axisAt:qt,altitudeAt:$t,setAltitudeAt:function(e,t,r,i){const o=$t(e,t),n=qt(e,t,Et.Z,jt),a=(0,c.a)(jt,n,r-o);return(0,c.b)(i,t,a)}});const Yt=new class{constructor(e=0){this.offset=e,this.sphere=Lt(),this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],n=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+n*n+a*a);o+=o*s,n+=n*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*n+l[8]*a+l[12],this.tmpVertex[1]=l[1]*o+l[5]*n+l[9]*a+l[13],this.tmpVertex[2]=l[2]*o+l[6]*n+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.offset=e,this.componentLocalOriginLength=0,this.tmpVertex=(0,d.c)(),this.mbs=(0,Nt.c)(),this.obb={center:(0,d.c)(),halfSize:(0,yt.c)(),quaternion:null}}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,n=r+this.componentLocalOriginLength,a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],n=e[4],a=e[5]+this.componentLocalOriginLength,s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(o*o+n*n+a*a);return e[3]+=o*l,e[4]+=n*l,e[5]+=a*l,e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.mbs[0]=e[0]+e[0]*r,this.mbs[1]=e[1]+e[1]*r,this.mbs[2]=e[2]+e[2]*r,this.mbs[3]=e[3]+e[3]*this.offset/t,this.mbs}applyToObb(e){const t=e.center,r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.obb.center[0]=t[0]+t[0]*r,this.obb.center[1]=t[1]+t[1]*r,this.obb.center[2]=t[2]+t[2]*r,(0,c.q)(this.obb.halfSize,e.halfSize,e.quaternion),(0,c.b)(this.obb.halfSize,this.obb.halfSize,e.center);const i=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*i,this.obb.halfSize[1]+=this.obb.halfSize[1]*i,this.obb.halfSize[2]+=this.obb.halfSize[2]*i,(0,c.f)(this.obb.halfSize,this.obb.halfSize,e.center),(0,Rt.c)(Jt,e.quaternion),(0,c.q)(this.obb.halfSize,this.obb.halfSize,Jt),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=e.quaternion,this.obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],n=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){const t=e[0]+this.localOrigin[0],r=e[1]+this.localOrigin[1],i=e[2]+this.localOrigin[2],o=e[3]+this.localOrigin[0],n=e[4]+this.localOrigin[1],a=e[5]+this.localOrigin[2],s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(o*o+n*n+a*a);return e[3]+=o*l,e[4]+=n*l,e[5]+=a*l,e}};const Jt=(0,Ot.a)();function Kt(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Zt(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function Qt(e,t,r,i,o,n=1){if(!r)return void Zt(e,t,i,o,n);const a=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],d=r[1],u=r[2],h=r[4],f=r[5],m=r[6],p=r[8],v=r[9],g=r[10],_=r[12],T=r[13],x=r[14];if(o*=s,1===n)for(let r=0;r<l;++r){const i=3*e[r],n=t[i],l=t[i+1],b=t[i+2];a[o]=c*n+h*l+p*b+_,a[o+1]=d*n+f*l+v*b+T,a[o+2]=u*n+m*l+g*b+x,o+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+p*A+_,S=d*l+f*b+v*A+T,M=u*l+m*b+g*A+x;for(let e=0;e<n;++e)a[o]=E,a[o+1]=S,a[o+2]=M,o+=s}}function er(e,t,r,i,o,n=1){if(!r)return void Zt(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],v=a[6],g=a[8],_=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=3*e[r],n=t[i],a=t[i+1],s=t[i+2];let d=u*n+m*a+g*s,E=h*n+p*a+_*s,S=f*n+v*a+T*s;if(x){const e=d*d+E*E+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,E*=t,S*=t}}l[o+0]=d,l[o+1]=E,l[o+2]=S,o+=c}else for(let r=0;r<d;++r){const i=3*e[r],a=t[i],s=t[i+1],d=t[i+2];let E=u*a+m*s+g*d,S=h*a+p*s+_*d,M=f*a+v*s+T*d;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<n;++e)l[o+0]=E,l[o+1]=S,l[o+2]=M,o+=c}}function tr(e,t,r,i,o,n=1){if(!r)return void function(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],v=a[6],g=a[8],_=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let E=u*n+m*a+g*s,S=h*n+p*a+_*s,M=f*n+v*a+T*s;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}l[o+0]=E,l[o+1]=S,l[o+2]=M,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],E=t[i+3];let S=u*a+m*s+g*d,M=h*a+p*s+_*d,C=f*a+v*s+T*d;if(x){const e=S*S+M*M+C*C;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,M*=t,C*=t}}for(let e=0;e<n;++e)l[o+0]=S,l[o+1]=M,l[o+2]=C,l[o+3]=E,o+=c}}function rr(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,1===n){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}var ir=r(43697),or=r(51546),nr=r(47624),ar=r(64267),sr=r(135),lr=r(92555),cr=r(68853),dr=r(42001),ur=r(85504),hr=r(72303),fr=r(98401),mr=r(89243);const pr=(0,r(10937).c)();class vr{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}function gr(e={}){return(t,r)=>{var i,o;t._parameterNames=null!=(i=t._parameterNames)?i:[],t._parameterNames.push(r);const n=t._parameterNames.length-1,a=e.count||2,s=Math.ceil(Math.log2(a)),l=null!=(o=t._parameterBits)?o:[0];let c=0;for(;l[c]+s>16;)c++,c>=l.length&&l.push(0);t._parameterBits=l;const d=l[c],u=(1<<s)-1<<d;l[c]+=s,Object.defineProperty(t,r,{get(){return this[n]},set(e){if(this[n]!==e&&(this[n]=e,this._keyDirty=!0,this._parameterBits[c]=this._parameterBits[c]&~u|+e<<d&u,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}class _r{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new R.Z({deallocator:null}),this._glProgram=e.newProgram(t.generateSource("vertex"),t.generateSource("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this._fragmentUniforms=(0,pe.hZ)()?t.fragmentUniforms.entries:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2f(e,t,r){this._glProgram.setUniform2f(e,t,r)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3f(e,t,r,i){this._glProgram.setUniform3f(e,t,r,i)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4f(e,t,r,i,o){this._glProgram.setUniform4f(e,t,r,i,o)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if((0,o.Wi)(e)||null==e.glName){const e=this._textures.get(t);return e&&(this._context.bindTexture(null,e.unit),this._freeTextureUnit(e),this._textures.delete(t)),null}let r=this._textures.get(t);return null==r?(r=this._allocTextureUnit(e),this._textures.set(t,r)):r.texture=e,this._context.useProgram(this),this.setUniform1i(t,r.unit),this._context.bindTexture(e,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),(0,o.pC)(this._fragmentUniforms)&&this._fragmentUniforms.forEach((e=>{if(("sampler2D"===e.type||"samplerCube"===e.type)&&!this._textures.has(e.name))throw new Error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}X.wb.LESS,X.wb.ALWAYS;const Tr={mask:255},xr={function:{func:X.wb.ALWAYS,ref:C.hU.OutlineVisualElementMask,mask:C.hU.OutlineVisualElementMask},operation:{fail:X.xS.KEEP,zFail:X.xS.KEEP,zPass:X.xS.ZERO}},br={function:{func:X.wb.ALWAYS,ref:C.hU.OutlineVisualElementMask,mask:C.hU.OutlineVisualElementMask},operation:{fail:X.xS.KEEP,zFail:X.xS.KEEP,zPass:X.xS.REPLACE}};X.wb.EQUAL,C.hU.OutlineVisualElementMask,C.hU.OutlineVisualElementMask,X.xS.KEEP,X.xS.KEEP,X.xS.KEEP,X.wb.NOTEQUAL,C.hU.OutlineVisualElementMask,C.hU.OutlineVisualElementMask,X.xS.KEEP,X.xS.KEEP,X.xS.KEEP;var Ar=r(32078);class Er extends class{constructor(e,t,r=(()=>this.dispose())){this.release=r,t&&(this._config=t.snapshot()),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}dispose(){this._program=(0,o.O3)(this._program),this._pipeline=this._config=null}reload(e){(0,o.O3)(this._program),this._program=this.initializeProgram(e)}get program(){return this._program}get key(){return this._config.key}get configuration(){return this._config}bindPass(e,t){}bindMaterial(e,t){}bindDraw(e){}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return X.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}}{initializeProgram(e){const t=Er.shader.get(),r=this.configuration,i=t.build({OITEnabled:r.transparencyPassType===C.Am.Color,output:r.output,viewingMode:e.viewingMode,receiveShadows:r.receiveShadows,slicePlaneEnabled:r.slicePlaneEnabled,sliceHighlightDisabled:r.sliceHighlightDisabled,sliceEnabledForVertexPrograms:!1,symbolColor:r.symbolColors,vvSize:r.vvSize,vvColor:r.vvColor,vvInstancingEnabled:!0,instanced:r.instanced,instancedColor:r.instancedColor,instancedDoublePrecision:r.instancedDoublePrecision,pbrMode:r.usePBR?r.isSchematic?ur.f7.Schematic:ur.f7.Normal:ur.f7.Disabled,hasMetalnessAndRoughnessTexture:r.hasMetalnessAndRoughnessTexture,hasEmissionTexture:r.hasEmissionTexture,hasOcclusionTexture:r.hasOcclusionTexture,hasNormalTexture:r.hasNormalTexture,hasColorTexture:r.hasColorTexture,receiveAmbientOcclusion:r.receiveAmbientOcclusion,useCustomDTRExponentForWater:!1,normalType:r.normalsTypeDerivate?ar.O.Type.ScreenDerivative:ar.O.Type.Attribute,doubleSidedMode:r.doubleSidedMode,vertexTangents:r.vertexTangents,attributeTextureCoordinates:r.hasMetalnessAndRoughnessTexture||r.hasEmissionTexture||r.hasOcclusionTexture||r.hasNormalTexture||r.hasColorTexture?sr.D.AttributeType.Default:sr.D.AttributeType.None,textureAlphaPremultiplied:r.textureAlphaPremultiplied,attributeColor:r.vertexColors,screenSizePerspectiveEnabled:r.screenSizePerspective,verticalOffsetEnabled:r.verticalOffset,offsetBackfaces:r.offsetBackfaces,doublePrecisionRequiresObfuscation:(0,mr.I)(e.rctx),alphaDiscardMode:r.alphaDiscardMode,supportsTextureAtlas:!1,multipassTerrainEnabled:r.multipassTerrainEnabled,cullAboveGround:r.cullAboveGround});return new _r(e.rctx,i,ue)}bindPass(e,t){var r,i;!function(e,t){e.setUniformMatrix4fv("proj",t)}(this.program,t.camera.projectionMatrix);const o=this.configuration.output;(this.configuration.output===Pe.H.Depth||t.multipassTerrainEnabled||o===Pe.H.Shadow)&&this.program.setUniform2fv("cameraNearFar",t.camera.nearFar),t.multipassTerrainEnabled&&(this.program.setUniform2fv("inverseViewport",t.inverseViewport),(0,dr.p)(this.program,t)),o===Pe.H.Alpha&&(this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",Le.FZ[e.colorMixMode])),o===Pe.H.Color?(t.lighting.setUniforms(this.program,!1),this.program.setUniform3fv("ambient",e.ambient),this.program.setUniform3fv("diffuse",e.diffuse),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",Le.FZ[e.colorMixMode]),this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),this.configuration.usePBR&&(0,ur.nW)(this.program,e,this.configuration.isSchematic)):o===Pe.H.Highlight&&(0,cr.wW)(this.program,t),(0,fr.uj)(this.program,e),(0,lr.Mo)(this.program,e,t),(0,Le.bj)(e.screenSizePerspective,this.program,"screenSizePerspectiveAlignment"),e.textureAlphaMode!==C.JJ.Mask&&e.textureAlphaMode!==C.JJ.MaskBlend||this.program.setUniform1f("textureAlphaCutoff",e.textureAlphaCutoff),null==(r=t.shadowMap)||r.bind(this.program),null==(i=t.ssaoHelper)||i.bind(this.program,t.camera)}bindDraw(e){const t=this.configuration.instancedDoublePrecision?(0,d.f)(e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]):e.origin;(function(e,t,r){(0,s.j)(pr,r,t),e.setUniform3fv("localOrigin",t),e.setUniformMatrix4fv("view",pr)})(this.program,t,e.camera.viewMatrix),this.program.rebindTextures(),(this.configuration.output===Pe.H.Color||this.configuration.output===Pe.H.Alpha||this.configuration.output===Pe.H.Depth&&this.configuration.screenSizePerspective||this.configuration.output===Pe.H.Normal&&this.configuration.screenSizePerspective||this.configuration.output===Pe.H.Highlight&&this.configuration.screenSizePerspective)&&function(e,t,r){e.setUniform3f("camPos",r[3]-t[0],r[7]-t[1],r[11]-t[2])}(this.program,t,e.camera.viewInverseTransposeMatrix),this.configuration.output===Pe.H.Normal&&this.program.setUniformMatrix4fv("viewNormal",e.camera.viewInverseTransposeMatrix),this.configuration.instancedDoublePrecision&&(0,nr.d3)(this.program,t),(0,or.Vv)(this.program,this.configuration,e.slicePlane,t),this.configuration.output===Pe.H.Color&&(0,hr.vL)(this.program,e,t)}_setPipeline(e,t){const r=this.configuration,i=e===C.Am.NONE,o=e===C.Am.FrontFace;return function(e){return vt.intern(e)}({blending:r.output!==Pe.H.Color&&r.output!==Pe.H.Alpha||!r.transparent?null:i?gt:(n=e,n===C.Am.FrontFace?null:n===C.Am.Alpha?Tt:_t),culling:Sr(r)&&Ve(r.cullFace),depthTest:{func:At(e)},depthWrite:i||o?r.writeDepth&&Ge:null,colorWrite:We,stencilWrite:r.sceneHasOcludees?Tr:null,stencilTest:r.sceneHasOcludees?t?br:xr:null,polygonOffset:i||o?null:bt(r.enableOffset)});var n}initializePipeline(){return this._occludeePipelineState=this._setPipeline(this.configuration.transparencyPassType,!0),this._setPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function Sr(e){return e.cullFace?e.cullFace!==C.Vr.None:!e.slicePlaneEnabled&&!e.transparent&&!e.doubleSidedMode}Er.shader=new vr(Ar.D,(()=>r.e(9291).then(r.bind(r,79291))));class Mr extends class{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}{constructor(){super(...arguments),this.output=Pe.H.Color,this.alphaDiscardMode=C.JJ.Opaque,this.doubleSidedMode=De.k.DoubleSidedMode.None,this.isSchematic=!1,this.vertexColors=!1,this.offsetBackfaces=!1,this.symbolColors=!1,this.vvSize=!1,this.vvColor=!1,this.verticalOffset=!1,this.receiveShadows=!1,this.slicePlaneEnabled=!1,this.sliceHighlightDisabled=!1,this.receiveAmbientOcclusion=!1,this.screenSizePerspective=!1,this.textureAlphaPremultiplied=!1,this.hasColorTexture=!1,this.usePBR=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.instanced=!1,this.instancedColor=!1,this.instancedDoublePrecision=!1,this.vertexTangents=!1,this.normalsTypeDerivate=!1,this.writeDepth=!0,this.sceneHasOcludees=!1,this.transparent=!1,this.enableOffset=!0,this.cullFace=C.Vr.None,this.transparencyPassType=C.Am.NONE,this.multipassTerrainEnabled=!1,this.cullAboveGround=!1}}(0,ir._)([gr({count:Pe.H.COUNT})],Mr.prototype,"output",void 0),(0,ir._)([gr({count:C.JJ.COUNT})],Mr.prototype,"alphaDiscardMode",void 0),(0,ir._)([gr({count:De.k.DoubleSidedMode.COUNT})],Mr.prototype,"doubleSidedMode",void 0),(0,ir._)([gr()],Mr.prototype,"isSchematic",void 0),(0,ir._)([gr()],Mr.prototype,"vertexColors",void 0),(0,ir._)([gr()],Mr.prototype,"offsetBackfaces",void 0),(0,ir._)([gr()],Mr.prototype,"symbolColors",void 0),(0,ir._)([gr()],Mr.prototype,"vvSize",void 0),(0,ir._)([gr()],Mr.prototype,"vvColor",void 0),(0,ir._)([gr()],Mr.prototype,"verticalOffset",void 0),(0,ir._)([gr()],Mr.prototype,"receiveShadows",void 0),(0,ir._)([gr()],Mr.prototype,"slicePlaneEnabled",void 0),(0,ir._)([gr()],Mr.prototype,"sliceHighlightDisabled",void 0),(0,ir._)([gr()],Mr.prototype,"receiveAmbientOcclusion",void 0),(0,ir._)([gr()],Mr.prototype,"screenSizePerspective",void 0),(0,ir._)([gr()],Mr.prototype,"textureAlphaPremultiplied",void 0),(0,ir._)([gr()],Mr.prototype,"hasColorTexture",void 0),(0,ir._)([gr()],Mr.prototype,"usePBR",void 0),(0,ir._)([gr()],Mr.prototype,"hasMetalnessAndRoughnessTexture",void 0),(0,ir._)([gr()],Mr.prototype,"hasEmissionTexture",void 0),(0,ir._)([gr()],Mr.prototype,"hasOcclusionTexture",void 0),(0,ir._)([gr()],Mr.prototype,"hasNormalTexture",void 0),(0,ir._)([gr()],Mr.prototype,"instanced",void 0),(0,ir._)([gr()],Mr.prototype,"instancedColor",void 0),(0,ir._)([gr()],Mr.prototype,"instancedDoublePrecision",void 0),(0,ir._)([gr()],Mr.prototype,"vertexTangents",void 0),(0,ir._)([gr()],Mr.prototype,"normalsTypeDerivate",void 0),(0,ir._)([gr()],Mr.prototype,"writeDepth",void 0),(0,ir._)([gr()],Mr.prototype,"sceneHasOcludees",void 0),(0,ir._)([gr()],Mr.prototype,"transparent",void 0),(0,ir._)([gr()],Mr.prototype,"enableOffset",void 0),(0,ir._)([gr({count:C.Vr.COUNT})],Mr.prototype,"cullFace",void 0),(0,ir._)([gr({count:C.Am.COUNT})],Mr.prototype,"transparencyPassType",void 0),(0,ir._)([gr()],Mr.prototype,"multipassTerrainEnabled",void 0),(0,ir._)([gr()],Mr.prototype,"cullAboveGround",void 0);var Cr=r(41846);class Rr extends Er{initializeProgram(e){const t=Rr.shader.get(),r=this.configuration,i=t.build({OITEnabled:r.transparencyPassType===C.Am.Color,output:r.output,viewingMode:e.viewingMode,receiveShadows:r.receiveShadows,slicePlaneEnabled:r.slicePlaneEnabled,sliceHighlightDisabled:r.sliceHighlightDisabled,sliceEnabledForVertexPrograms:!1,symbolColor:r.symbolColors,vvSize:r.vvSize,vvColor:r.vvColor,vvInstancingEnabled:!0,instanced:r.instanced,instancedColor:r.instancedColor,instancedDoublePrecision:r.instancedDoublePrecision,pbrMode:r.usePBR?ur.f7.Normal:ur.f7.Disabled,hasMetalnessAndRoughnessTexture:!1,hasEmissionTexture:!1,hasOcclusionTexture:!1,hasNormalTexture:!1,hasColorTexture:r.hasColorTexture,receiveAmbientOcclusion:r.receiveAmbientOcclusion,useCustomDTRExponentForWater:!1,normalType:ar.O.Type.Attribute,doubleSidedMode:De.k.DoubleSidedMode.WindingOrder,vertexTangents:!1,attributeTextureCoordinates:r.hasColorTexture?sr.D.AttributeType.Default:sr.D.AttributeType.None,textureAlphaPremultiplied:r.textureAlphaPremultiplied,attributeColor:r.vertexColors,screenSizePerspectiveEnabled:r.screenSizePerspective,verticalOffsetEnabled:r.verticalOffset,offsetBackfaces:r.offsetBackfaces,doublePrecisionRequiresObfuscation:(0,mr.I)(e.rctx),alphaDiscardMode:r.alphaDiscardMode,supportsTextureAtlas:!1,multipassTerrainEnabled:r.multipassTerrainEnabled,cullAboveGround:r.cullAboveGround});return new _r(e.rctx,i,ue)}}Rr.shader=new vr(Cr.R,(()=>r.e(8625).then(r.bind(r,28625))));class Or extends Fe{constructor(e){super(e,Nr),this.supportsEdges=!0,this.techniqueConfig=new Mr,this.vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,we.U$)().vec3f(C.T.POSITION).vec3f(C.T.NORMAL);return e.vertexTangents&&r.vec4f(C.T.TANGENT),t&&r.vec2f(C.T.UV0),e.vertexColors&&r.vec4u8(C.T.COLOR),e.symbolColors&&r.vec4u8(C.T.SYMBOLCOLOR),r}(this.parameters),this.instanceBufferLayout=e.instanced?function(e){let t=(0,we.U$)();return t=e.instancedDoublePrecision?t.vec3f(C.T.MODELORIGINHI).vec3f(C.T.MODELORIGINLO).mat3f(C.T.MODEL).mat3f(C.T.MODELNORMAL):t.mat4f(C.T.MODEL).mat4f(C.T.MODELNORMAL),e.instanced&&e.instanced.indexOf("color")>-1&&(t=t.vec4f(C.T.INSTANCECOLOR)),e.instanced&&e.instanced.indexOf("featureAttribute")>-1&&(t=t.vec4f(C.T.INSTANCEFEATUREATTRIBUTE)),t}(this.parameters):null}isVisibleInPass(e){return e!==Mt.C.MATERIAL_DEPTH_SHADOWMAP_ALL&&e!==Mt.C.MATERIAL_DEPTH_SHADOWMAP_DEFAULT&&e!==Mt.C.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const t=e.instanced,r=e.vertexColors,i=e.symbolColors,o=!!t&&t.indexOf("color")>-1,n=e.vvColorEnabled,a="replace"===e.colorMixMode,s=e.opacity>0,l=e.externalColor&&e.externalColor[3]>0;return r&&(o||n||i)?!!a||s:r?a?l:s:o||n||i?!!a||s:a?l:s}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.hasNormalTexture=!!this.parameters.normalTextureId,this.techniqueConfig.hasColorTexture=!!this.parameters.textureId,this.techniqueConfig.vertexTangents=this.parameters.vertexTangents,this.techniqueConfig.instanced=!!this.parameters.instanced,this.techniqueConfig.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.verticalOffset=null!==this.parameters.verticalOffset,this.techniqueConfig.screenSizePerspective=null!==this.parameters.screenSizePerspective,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.sliceHighlightDisabled=this.parameters.sliceHighlightDisabled,this.techniqueConfig.alphaDiscardMode=this.parameters.textureAlphaMode,this.techniqueConfig.normalsTypeDerivate="screenDerivative"===this.parameters.normals,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.sceneHasOcludees=this.parameters.sceneHasOcludees,this.techniqueConfig.cullFace=this.parameters.slicePlaneEnabled?C.Vr.None:this.parameters.cullFace,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,e!==Pe.H.Color&&e!==Pe.H.Alpha||(this.techniqueConfig.vertexColors=this.parameters.vertexColors,this.techniqueConfig.symbolColors=this.parameters.symbolColors,this.parameters.treeRendering?this.techniqueConfig.doubleSidedMode=De.k.DoubleSidedMode.WindingOrder:this.techniqueConfig.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?De.k.DoubleSidedMode.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?De.k.DoubleSidedMode.WindingOrder:De.k.DoubleSidedMode.None,this.techniqueConfig.instancedColor=!!this.parameters.instanced&&this.parameters.instanced.indexOf("color")>-1,this.techniqueConfig.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this.techniqueConfig.receiveAmbientOcclusion=!!t.ssaoEnabled&&this.parameters.receiveSSAO,this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this.techniqueConfig.usePBR=this.parameters.usePBR,this.techniqueConfig.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this.techniqueConfig.hasEmissionTexture=!!this.parameters.emissiveTextureId,this.techniqueConfig.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this.techniqueConfig.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this.techniqueConfig.isSchematic=this.parameters.usePBR&&this.parameters.isSchematic,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<5e5),this.techniqueConfig}intersect(e,t,r,i,n,a,s){if(null!==this.parameters.verticalOffset){const e=i.camera;(0,c.s)(Hr,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case Ne.JY.Global:t=(0,c.n)(Lr,Hr);break;case Ne.JY.Local:t=(0,c.g)(Lr,Ir)}let o=0;if(null!==this.parameters.verticalOffset){const r=(0,c.f)(Br,Hr,e.eye),i=(0,c.l)(r),n=(0,c.a)(r,r,1/i);let a=null;this.parameters.screenSizePerspective&&(a=(0,c.d)(t,n)),o+=(0,Le.Hx)(e,i,this.parameters.verticalOffset,a,this.parameters.screenSizePerspective)}(0,c.a)(t,t,o),(0,c.t)(Fr,t,i.transform.inverseRotation),n=(0,c.f)(Pr,n,Fr),a=(0,c.f)(Dr,a,Fr)}var l;(0,Le.Bw)(e,t,i,n,a,(l=i.verticalOffset,(0,o.pC)(l)?(Yt.offset=l,Yt):null),s)}requiresSlot(e){return e===(this.parameters.transparent?this.parameters.writeDepth?Ct.r.TRANSPARENT_MATERIAL:Ct.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Ct.r.OPAQUE_MATERIAL)||e===Ct.r.DRAPED_MATERIAL}createGLMaterial(e){return e.output===Pe.H.Color||e.output===Pe.H.Alpha||e.output===Pe.H.Depth||e.output===Pe.H.Normal||e.output===Pe.H.Shadow||e.output===Pe.H.Highlight?new yr(e):null}createBufferWriter(){return new wr(this.vertexBufferLayout,this.instanceBufferLayout)}}class yr extends class extends class{constructor(e){this._material=e.material,this._techniqueRep=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRep.release(this._technique)}get technique(){return this._technique}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRep.releaseAndAcquire(e,this._material.getTechniqueConfig(r,t),this._technique),this._technique}ensureResources(e){return C.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),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(){this._texture=(0,o.RY)(this._texture),this._textureNormal=(0,o.RY)(this._textureNormal),this._textureEmissive=(0,o.RY)(this._textureEmissive),this._textureOcclusion=(0,o.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,o.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?C.Rw.LOADED:C.Rw.LOADING}updateTexture(e){((0,o.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,o.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}bindTextures(e){(0,o.pC)(this._texture)&&e.bindTexture(this._texture.glTexture,"tex"),(0,o.pC)(this._textureNormal)&&e.bindTexture(this._textureNormal.glTexture,"normalTexture"),(0,o.pC)(this._textureEmissive)&&e.bindTexture(this._textureEmissive.glTexture,"texEmission"),(0,o.pC)(this._textureOcclusion)&&e.bindTexture(this._textureOcclusion.glTexture,"texOcclusion"),(0,o.pC)(this._textureMetallicRoughness)&&e.bindTexture(this._textureMetallicRoughness.glTexture,"texMetallicRoughness")}bindTextureScale(e){const t=(0,o.pC)(this._texture)?this._texture.glTexture:null;(0,o.pC)(t)&&t.descriptor.textureCoordinateScaleFactor?e.setUniform2fv("textureCoordinateScaleFactor",t.descriptor.textureCoordinateScaleFactor):e.setUniform2f("textureCoordinateScaleFactor",1,1)}_acquire(e,t){if((0,o.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,E.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,o.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}{constructor(e){super({...e,...e.material.parameters})}updateParameters(e){const t=this._material.parameters;return this.updateTexture(t.textureId),this.ensureTechnique(t.treeRendering?Rr:Er,e)}_updateShadowState(e){e.shadowMappingEnabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMappingEnabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&this._material.setParameters({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return this._output!==Pe.H.Color&&this._output!==Pe.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.parameters,e),this.bindTextures(t.program)}}const Nr={textureId:void 0,initTextureTransparent:!1,isSchematic:!1,usePBR:!1,normalTextureId:void 0,vertexTangents:!1,occlusionTextureId:void 0,emissiveTextureId:void 0,metallicRoughnessTextureId:void 0,emissiveFactor:[0,0,0],mrrFactors:[0,1,.5],ambient:[.2,.2,.2],diffuse:[.8,.8,.8],externalColor:[1,1,1,1],colorMixMode:"multiply",opacity:1,layerOpacity:1,vertexColors:!1,symbolColors:!1,doubleSided:!1,doubleSidedType:"normal",cullFace:C.Vr.Back,instanced:void 0,instancedDoublePrecision:!1,normals:"default",receiveSSAO:!0,receiveShadows:!0,castShadows:!0,shadowMappingEnabled:!1,verticalOffset:null,screenSizePerspective:null,slicePlaneEnabled:!1,sliceHighlightDisabled:!1,offsetTransparentBackfaces:!1,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvSizeValue:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],vvSymbolAnchor:[0,0,0],vvSymbolRotationMatrix:(0,a.c)(),transparent:!1,writeDepth:!0,textureAlphaMode:C.JJ.Blend,textureAlphaCutoff:Ie.F,textureAlphaPremultiplied:!1,sceneHasOcludees:!1,...He};class wr{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(C.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,o,n){for(const a of t.fieldNames){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case C.T.POSITION:{(0,O.hu)(3===t.size);const e=o.getField(a,h.ct);e&&Qt(s,t.data,r,e,n);break}case C.T.NORMAL:{(0,O.hu)(3===t.size);const e=o.getField(a,h.ct);e&&er(s,t.data,i,e,n);break}case C.T.UV0:{(0,O.hu)(2===t.size);const e=o.getField(a,h.Eu);e&&Kt(s,t.data,e,n);break}case C.T.COLOR:{(0,O.hu)(3===t.size||4===t.size);const e=o.getField(a,h.mc);e&&rr(s,t.data,t.size,e,n);break}case C.T.SYMBOLCOLOR:{(0,O.hu)(3===t.size||4===t.size);const e=o.getField(a,h.mc);e&&rr(s,t.data,t.size,e,n);break}case C.T.TANGENT:{(0,O.hu)(4===t.size);const e=o.getField(a,h.ek);e&&tr(s,t.data,i,e,n);break}}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const Pr=(0,d.c)(),Dr=(0,d.c)(),Ir=(0,d.f)(0,0,1),Lr=(0,d.c)(),Fr=(0,d.c)(),Hr=(0,d.c)(),Br=(0,d.c)(),Ur=A.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function zr(e){throw new b.Z("",`Request for object resource failed: ${e}`)}function Vr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(Ur.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&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(Ur.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(Ur.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(Ur.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else Ur.warn("Indexed geometries must specify faces"),i=!1;break}default:Ur.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(Ur.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(Ur.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Gr(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,o.pC)(r)&&((0,u.pp)(t,r.getBBMin()),(0,u.pp)(t,r.getBBMax()))})),t}async function Wr(e,t){const r=[];for(const i in e){const n=e[i],a=n.images[0].data;if(!a){Ur.warn("Externally referenced texture data is not yet supported");continue}const s=n.encoding+";base64,"+a,l="/textureDefinitions/"+i,c="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",d={noUnpackFlip:!0,wrap:{s:X.e8.REPEAT,t:X.e8.REPEAT},preMultiplyAlpha:kr(c)!==C.JJ.Opaque},u=(0,o.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(u.then((e=>({refId:l,image:e,params:d,alphaChannelUsage:c}))))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}function kr(e){switch(e){case"mask":return C.JJ.Mask;case"maskAndTransparency":return C.JJ.MaskBlend;case"none":return C.JJ.Opaque;default:return C.JJ.Blend}}function qr(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const $r=new S.G(1,2,"wosr");var Xr=r(57758),jr=r(10816),Yr=r(75488),Jr=r(56067);async function Kr(e,t){const r=Zr((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,o.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,x.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,E.r9)(i.error),zr(i.error.details.url)}(e,r,t);const i=await(0,x.q6)((0,T.default)(e,(0,o.Wg)(t)));if(!0===i.ok)return i.value.data;(0,E.r9)(i.error),zr(i.error)}(e,t);return{resource:r,textures:await Wr(r.textureDefinitions,t)}}(r.url,t)),i=function(e,t){const r=[],i=[],n=[],a=[],s=e.resource,l=S.G.parse(s.version||"1.0","wosr");$r.validate(l);const c=s.model.name,u=s.model.geometries,h=s.materialDefinitions,f=e.textures;let m=0;const p=new Map;for(let e=0;e<u.length;e++){const s=u[e];if(!Vr(s))continue;const l=qr(s),c=s.params.vertexAttributes,v=[];for(const e in c){const t=c[e],r=t.values;v.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const g=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)g.push([t,new Uint32Array(e[t].values)])}const _=f&&f[l.texture];if(_&&!p.has(l.texture)){const{image:e,params:t}=_,r=new Oe(e,t);a.push(r),p.set(l.texture,r)}const T=p.get(l.texture),x=T?T.id:void 0;let b=n[l.material]?n[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,a=_?kr(_.alphaChannelUsage):void 0,s={ambient:(0,d.d)(e.diffuse),diffuse:(0,d.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:a,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:C.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!_&&!!_.params.preMultiplyAlpha};(0,o.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new Or(s),n[l.material]||(n[l.material]={}),n[l.material][l.texture]=b}i.push(b);const A=new F(v,g);m+=g.position?g.position.length:0,r.push(A)}return{name:c,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:Gr(r),numberOfVertices:m,lodThreshold:null}}(e,t);return{lods:[i],referenceBoundingBox:i.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,g.z)(new v.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,o.U2)(n.model.meta,"ESRI_proxyEllipsoid");n.meta.isEsriSymbolResource&&(0,o.pC)(a)&&-1!==n.meta.uri.indexOf("/RealisticTrees/")&&function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const n of i.parts){const i=n.attributes.normal;if((0,o.Wi)(i))return;const a=n.attributes.position,u=a.count,f=(0,d.c)(),m=(0,d.c)(),v=(0,d.c)(),g=(0,p.gS)(h.mc,u),_=(0,p.gS)(h.ct,u),T=(0,s.a)((0,l.c)(),n.transform);for(let o=0;o<u;o++){a.getVec(o,m),i.getVec(o,f),(0,c.m)(m,m,n.transform),(0,c.f)(v,m,t.center),(0,c.E)(v,v,t.radius);const s=v[2],l=(0,c.l)(v),d=Math.min(.45+.55*l*l,1);(0,c.E)(v,v,t.radius),(0,c.m)(v,v,T),(0,c.n)(v,v),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.e)(v,v,f,s>-1?.2:Math.min(-4*s-3.8,1)),_.setVec(o,v),g.set(o,0,255*d),g.set(o,1,255*d),g.set(o,2,255*d),g.set(o,3,255)}n.attributes.normal=_,n.attributes.color=g}}}(n,a);const u=n.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:n.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:n.customMeta.esriTreeRendering};if(null!=r.specifiedLodIndex){const e=Qr(n,u,f,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=Qr(n,u,f,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1,remove:n.remove}}const m=Qr(n,u,f);return{lods:m,referenceBoundingBox:m[0].boundingBox,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1,remove:n.remove}}function Zr(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}}function Qr(e,t,r,i){const s=e.model,l=(0,a.c)(),c=new Array,d=new Map,v=new Map;return s.lods.forEach(((e,a)=>{if(void 0!==i&&a!==i)return;const g={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,o.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,u.cS)()};c.push(g),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=s.materials.get(e.material),c=(0,o.pC)(e.attributes.texCoord0),T=(0,o.pC)(e.attributes.normal),x=function(e){switch(e){case"BLEND":return C.JJ.Blend;case"MASK":return C.JJ.Mask;case"OPAQUE":case null:case void 0:return C.JJ.Opaque}}(a.alphaMode);if(!d.has(i)){if(c){if((0,o.pC)(a.textureColor)&&!v.has(a.textureColor)){const e=s.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:x!==C.JJ.Opaque};v.set(a.textureColor,new Oe(e.data,t))}if((0,o.pC)(a.textureNormal)&&!v.has(a.textureNormal)){const e=s.textures.get(a.textureNormal);v.set(a.textureNormal,new Oe(e.data,e.parameters))}if((0,o.pC)(a.textureOcclusion)&&!v.has(a.textureOcclusion)){const e=s.textures.get(a.textureOcclusion);v.set(a.textureOcclusion,new Oe(e.data,e.parameters))}if((0,o.pC)(a.textureEmissive)&&!v.has(a.textureEmissive)){const e=s.textures.get(a.textureEmissive);v.set(a.textureEmissive,new Oe(e.data,e.parameters))}if((0,o.pC)(a.textureMetallicRoughness)&&!v.has(a.textureMetallicRoughness)){const e=s.textures.get(a.textureMetallicRoughness);v.set(a.textureMetallicRoughness,new Oe(e.data,e.parameters))}}const n=a.color[0]**(1/Xr.K),l=a.color[1]**(1/Xr.K),u=a.color[2]**(1/Xr.K),h=a.emissiveFactor[0]**(1/Xr.K),f=a.emissiveFactor[1]**(1/Xr.K),m=a.emissiveFactor[2]**(1/Xr.K),p=(0,o.pC)(a.textureColor)&&c?v.get(a.textureColor):null;d.set(i,new Or({...t,transparent:x===C.JJ.Blend,textureAlphaMode:x,textureAlphaCutoff:a.alphaCutoff,diffuse:[n,l,u],ambient:[n,l,u],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?C.Vr.None:C.Vr.Back,vertexColors:!!e.attributes.color,vertexTangents:!!e.attributes.tangent,normals:T?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:(0,o.pC)(p)?p.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:(0,o.pC)(a.textureNormal)&&c?v.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:(0,o.pC)(p)&&!!p.params.preMultiplyAlpha,occlusionTextureId:(0,o.pC)(a.textureOcclusion)&&c?v.get(a.textureOcclusion).id:void 0,emissiveTextureId:(0,o.pC)(a.textureEmissive)&&c?v.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,o.pC)(a.textureMetallicRoughness)&&c?v.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,m],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...r}))}const b=function(e,t){switch(t){case X.MX.TRIANGLES:return(0,_.nh)(e);case X.MX.TRIANGLE_STRIP:return(0,_.DA)(e);case X.MX.TRIANGLE_FAN:return(0,_.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),A=e.attributes.position.count,E=(0,p.gS)(h.ct,A);(0,f.t)(E,e.attributes.position,e.transform);const S=[[C.T.POSITION,{data:E.typedBuffer,size:E.elementCount,exclusive:!0}]],M=[[C.T.POSITION,b]];if((0,o.pC)(e.attributes.normal)){const t=(0,p.gS)(h.ct,A);(0,n.a)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([C.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([C.T.NORMAL,b])}if((0,o.pC)(e.attributes.tangent)){const t=(0,p.gS)(h.ek,A);(0,n.a)(l,e.transform),(0,m.t)(t,e.attributes.tangent,l),S.push([C.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([C.T.TANGENT,b])}if((0,o.pC)(e.attributes.texCoord0)){const t=(0,p.gS)(h.Eu,A);(0,jr.n)(t,e.attributes.texCoord0),S.push([C.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([C.T.UV0,b])}if((0,o.pC)(e.attributes.color)){const t=(0,p.gS)(h.mc,A);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,m.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,Yr.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,m.s)(t,e.attributes.color,1/256);else{(0,Yr.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,Jr.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([C.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([C.T.COLOR,b])}const R=new F(S,M);g.stageResources.geometries.push(R),g.stageResources.materials.push(d.get(i)),c&&((0,o.pC)(a.textureColor)&&g.stageResources.textures.push(v.get(a.textureColor)),(0,o.pC)(a.textureNormal)&&g.stageResources.textures.push(v.get(a.textureNormal)),(0,o.pC)(a.textureOcclusion)&&g.stageResources.textures.push(v.get(a.textureOcclusion)),(0,o.pC)(a.textureEmissive)&&g.stageResources.textures.push(v.get(a.textureEmissive)),(0,o.pC)(a.textureMetallicRoughness)&&g.stageResources.textures.push(v.get(a.textureMetallicRoughness))),g.numberOfVertices+=A;const O=R.boundingInfo;(0,o.pC)(O)&&((0,u.pp)(g.boundingBox,O.getBBMin()),(0,u.pp)(g.boundingBox,O.getBBMax()))}))})),c}},6206:(e,t,r)=>{var i,o;r.d(t,{a9:()=>i}),r(22021),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),o=r(79583);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const o=this.stride;if(o%4==0){const n=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(n)}else{const n=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(n)}}}class a{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,o.n1)(t.ElementType),n=this.stride;this.fields.set(e,{size:i,constructor:t,offset:n,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.indexOf(e)>=0}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new a;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new a}},1391:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(18361),o=r(74709);function n(e,t){t.output===i.H.Color&&t.receiveShadows?(e.varyings.add("linearDepth","float"),e.vertex.code.add(o.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`)):t.output===i.H.Depth||t.output===i.H.Shadow?(e.varyings.add("linearDepth","float"),e.vertex.uniforms.add("cameraNearFar","vec2"),e.vertex.code.add(o.H`void forwardLinearDepth() {
|
|
159
|
+
`)),t.include(v.s,e),t}const w=Object.freeze({__proto__:null,build:N})},21787:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>o,i:()=>c,t:()=>n});var i=r(46851);function o(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function n(e,t){if(e===t){const r=t[1],i=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=i,e[7]=o}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function a(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=r[0],f=r[1],m=r[2],p=r[3],v=r[4],g=r[5],_=r[6],T=r[7],x=r[8];return e[0]=h*i+f*a+m*c,e[1]=h*o+f*s+m*d,e[2]=h*n+f*l+m*u,e[3]=p*i+v*a+g*c,e[4]=p*o+v*s+g*d,e[5]=p*n+v*l+g*u,e[6]=_*i+T*a+x*c,e[7]=_*o+T*s+x*d,e[8]=_*n+T*l+x*u,e}function s(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],u=t[9],h=t[10],f=t[11],m=t[12],p=t[13],v=t[14],g=t[15],_=r*s-i*a,T=r*l-o*a,x=r*c-n*a,b=i*l-o*s,A=i*c-n*s,E=o*c-n*l,S=d*p-u*m,M=d*v-h*m,C=d*g-f*m,R=u*v-h*p,O=u*g-f*p,y=h*g-f*v;let N=_*y-T*O+x*R+b*C-A*M+E*S;return N?(N=1/N,e[0]=(s*y-l*O+c*R)*N,e[1]=(l*C-a*y-c*M)*N,e[2]=(a*O-s*C+c*S)*N,e[3]=(o*O-i*y-n*R)*N,e[4]=(r*y-o*C+n*M)*N,e[5]=(i*C-r*O-n*S)*N,e[6]=(p*E-v*A+g*b)*N,e[7]=(v*x-m*E-g*T)*N,e[8]=(m*A-p*x+g*_)*N,e):null}function l(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e}function c(e){const t=i.E,r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8];return Math.abs(1-(r*r+a*a+c*c))<=t&&Math.abs(1-(o*o+s*s+d*d))<=t&&Math.abs(1-(n*n+l*l+u*u))<=t}const d=a,u=l;Object.freeze({__proto__:null,fromMat4:o,copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},set:function(e,t,r,i,o,n,a,s,l,c){return e[0]=t,e[1]=r,e[2]=i,e[3]=o,e[4]=n,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},transpose:n,invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],u=d*a-s*c,h=-d*n+s*l,f=c*n-a*l;let m=r*u+i*h+o*f;return m?(m=1/m,e[0]=u*m,e[1]=(-d*i+o*c)*m,e[2]=(s*i-o*a)*m,e[3]=h*m,e[4]=(d*r-o*l)*m,e[5]=(-s*r+o*n)*m,e[6]=f*m,e[7]=(-c*r+i*l)*m,e[8]=(a*r-i*n)*m,e):null},adjoint:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8];return e[0]=a*d-s*c,e[1]=o*c-i*d,e[2]=i*s-o*a,e[3]=s*l-n*d,e[4]=r*d-o*l,e[5]=o*n-r*s,e[6]=n*c-a*l,e[7]=i*l-r*c,e[8]=r*a-i*n,e},determinant:function(e){const t=e[0],r=e[1],i=e[2],o=e[3],n=e[4],a=e[5],s=e[6],l=e[7],c=e[8];return t*(c*n-a*l)+r*(-c*o+a*s)+i*(l*o-n*s)},multiply:a,translate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=r[0],f=r[1];return e[0]=i,e[1]=o,e[2]=n,e[3]=a,e[4]=s,e[5]=l,e[6]=h*i+f*a+c,e[7]=h*o+f*s+d,e[8]=h*n+f*l+u,e},rotate:function(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=t[4],l=t[5],c=t[6],d=t[7],u=t[8],h=Math.sin(r),f=Math.cos(r);return e[0]=f*i+h*a,e[1]=f*o+h*s,e[2]=f*n+h*l,e[3]=f*a-h*i,e[4]=f*s-h*o,e[5]=f*l-h*n,e[6]=c,e[7]=d,e[8]=u,e},scale:function(e,t,r){const i=r[0],o=r[1],n=r[2];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e},scaleByVec2:function(e,t,r){const i=r[0],o=r[1];return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*t[5],e},fromTranslation:function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},fromRotation:function(e,t){const r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromScaling:function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},fromMat2d:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},fromQuat:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r+r,s=i+i,l=o+o,c=r*a,d=i*a,u=i*s,h=o*a,f=o*s,m=o*l,p=n*a,v=n*s,g=n*l;return e[0]=1-u-m,e[3]=d-g,e[6]=h+v,e[1]=d+g,e[4]=1-c-m,e[7]=f-p,e[2]=h-v,e[5]=f+p,e[8]=1-c-u,e},normalFromMat4Legacy:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[4],a=t[5],s=t[6],l=t[8],c=t[9],d=t[10],u=d*a-s*c,h=-d*n+s*l,f=c*n-a*l,m=r*u+i*h+o*f;if(!m)return null;const p=1/m;return e[0]=u*p,e[1]=(-d*i+o*c)*p,e[2]=(s*i-o*a)*p,e[3]=h*p,e[4]=(d*r-o*l)*p,e[5]=(-s*r+o*n)*p,e[6]=f*p,e[7]=(-c*r+i*l)*p,e[8]=(a*r-i*n)*p,e},normalFromMat4:s,projection:function(e,t,r){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/r,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},str:function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},frob:function(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)},add:function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e},subtract:l,multiplyScalar:function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e},multiplyScalarAndAdd:function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e},exactEquals:function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},equals:function(e,t){const r=e[0],o=e[1],n=e[2],a=e[3],s=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=t[0],f=t[1],m=t[2],p=t[3],v=t[4],g=t[5],_=t[6],T=t[7],x=t[8];return Math.abs(r-h)<=i.E*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(o-f)<=i.E*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(n-m)<=i.E*Math.max(1,Math.abs(n),Math.abs(m))&&Math.abs(a-p)<=i.E*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-v)<=i.E*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(l-g)<=i.E*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-_)<=i.E*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(d-T)<=i.E*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(u-x)<=i.E*Math.max(1,Math.abs(u),Math.abs(x))},isOrthoNormal:c,mul:d,sub:u})},46521:(e,t,r)=>{function i(){return[1,0,0,0,1,0,0,0,1]}function o(e,t){return new Float64Array(e,t,9)}r.d(t,{a:()=>o,c:()=>i}),Object.freeze({__proto__:null,create:i,clone:function(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},fromValues:function(e,t,r,i,o,n,a,s,l){return[e,t,r,i,o,n,a,s,l]},createView:o})},13598:(e,t,r)=>{function i(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}function n(e,t){return new Float64Array(e,t,16)}r.d(t,{I:()=>a,a:()=>n,b:()=>o,c:()=>i});const a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze({__proto__:null,create:i,clone:o,fromValues:function(e,t,r,i,o,n,a,s,l,c,d,u,h,f,m,p){return[e,t,r,i,o,n,a,s,l,c,d,u,h,f,m,p]},createView:n,IDENTITY:a})},51305:(e,t,r)=>{r.d(t,{c:()=>f,g:()=>d,j:()=>O,k:()=>p,m:()=>u,s:()=>c});var i=r(46521),o=r(94961),n=r(65617),a=r(46851),s=r(17896),l=r(98766);function c(e,t,r){r*=.5;const i=Math.sin(r);return e[0]=i*t[0],e[1]=i*t[1],e[2]=i*t[2],e[3]=Math.cos(r),e}function d(e,t){const r=2*Math.acos(t[3]),i=Math.sin(r/2);return i>a.E?(e[0]=t[0]/i,e[1]=t[1]/i,e[2]=t[2]/i):(e[0]=1,e[1]=0,e[2]=0),r}function u(e,t,r){const i=t[0],o=t[1],n=t[2],a=t[3],s=r[0],l=r[1],c=r[2],d=r[3];return e[0]=i*d+a*s+o*c-n*l,e[1]=o*d+a*l+n*s-i*c,e[2]=n*d+a*c+i*l-o*s,e[3]=a*d-i*s-o*l-n*c,e}function h(e,t,r,i){const o=t[0],n=t[1],s=t[2],l=t[3];let c,d,u,h,f,m=r[0],p=r[1],v=r[2],g=r[3];return d=o*m+n*p+s*v+l*g,d<0&&(d=-d,m=-m,p=-p,v=-v,g=-g),1-d>a.E?(c=Math.acos(d),u=Math.sin(c),h=Math.sin((1-i)*c)/u,f=Math.sin(i*c)/u):(h=1-i,f=i),e[0]=h*o+f*m,e[1]=h*n+f*p,e[2]=h*s+f*v,e[3]=h*l+f*g,e}function f(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function m(e,t){const r=t[0]+t[4]+t[8];let i;if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,i=.5/i,e[0]=(t[5]-t[7])*i,e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{let r=0;t[4]>t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);const o=(r+1)%3,n=(r+2)%3;i=Math.sqrt(t[3*r+r]-t[3*o+o]-t[3*n+n]+1),e[r]=.5*i,i=.5/i,e[3]=(t[3*o+n]-t[3*n+o])*i,e[o]=(t[3*o+r]+t[3*r+o])*i,e[n]=(t[3*n+r]+t[3*r+n])*i}return e}function p(e,t,r,i){const o=.5*Math.PI/180;t*=o,r*=o,i*=o;const n=Math.sin(t),a=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(i),d=Math.cos(i);return e[0]=n*l*d-a*s*c,e[1]=a*s*d+n*l*c,e[2]=a*l*c-n*s*d,e[3]=a*l*d+n*s*c,e}const v=l.c,g=l.s,_=l.a,T=u,x=l.b,b=l.d,A=l.l,E=l.e,S=E,M=l.f,C=M,R=l.n,O=l.g,y=l.h,N=(0,n.c)(),w=(0,n.f)(1,0,0),P=(0,n.f)(0,1,0),D=(0,o.a)(),I=(0,o.a)(),L=(0,i.c)();Object.freeze({__proto__:null,identity:function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},setAxisAngle:c,getAxisAngle:d,multiply:u,rotateX:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+a*s,e[1]=o*l+n*s,e[2]=n*l-o*s,e[3]=a*l-i*s,e},rotateY:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l-n*s,e[1]=o*l+a*s,e[2]=n*l+i*s,e[3]=a*l-o*s,e},rotateZ:function(e,t,r){r*=.5;const i=t[0],o=t[1],n=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=i*l+o*s,e[1]=o*l-i*s,e[2]=n*l+a*s,e[3]=a*l-n*s,e},calculateW:function(e,t){const r=t[0],i=t[1],o=t[2];return e[0]=r,e[1]=i,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-i*i-o*o)),e},slerp:h,random:function(e){const t=(0,a.R)(),r=(0,a.R)(),i=(0,a.R)(),o=Math.sqrt(1-t),n=Math.sqrt(t);return e[0]=o*Math.sin(2*Math.PI*r),e[1]=o*Math.cos(2*Math.PI*r),e[2]=n*Math.sin(2*Math.PI*i),e[3]=n*Math.cos(2*Math.PI*i),e},invert:function(e,t){const r=t[0],i=t[1],o=t[2],n=t[3],a=r*r+i*i+o*o+n*n,s=a?1/a:0;return e[0]=-r*s,e[1]=-i*s,e[2]=-o*s,e[3]=n*s,e},conjugate:f,fromMat3:m,fromEuler:p,str:function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},copy:v,set:g,add:_,mul:T,scale:x,dot:b,lerp:A,length:E,len:S,squaredLength:M,sqrLen:C,normalize:R,exactEquals:O,equals:y,rotationTo:function(e,t,r){const i=(0,s.d)(t,r);return i<-.999999?((0,s.c)(N,w,t),(0,s.u)(N)<1e-6&&(0,s.c)(N,P,t),(0,s.n)(N,N),c(e,N,Math.PI),e):i>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):((0,s.c)(N,t,r),e[0]=N[0],e[1]=N[1],e[2]=N[2],e[3]=1+i,R(e,e))},sqlerp:function(e,t,r,i,o,n){return h(D,t,o,n),h(I,r,i,n),h(e,D,I,2*n*(1-n)),e},setAxes:function(e,t,r,i){const o=L;return o[0]=r[0],o[3]=r[1],o[6]=r[2],o[1]=i[0],o[4]=i[1],o[7]=i[2],o[2]=-t[0],o[5]=-t[1],o[8]=-t[2],R(e,m(e,o))}})},94961:(e,t,r)=>{function i(){return[0,0,0,1]}function o(e){return[e[0],e[1],e[2],e[3]]}function n(e,t){return new Float64Array(e,t,4)}r.d(t,{I:()=>a,a:()=>i,b:()=>o,c:()=>n});const a=[0,0,0,1];Object.freeze({__proto__:null,create:i,clone:o,fromValues:function(e,t,r,i){return[e,t,r,i]},createView:n,IDENTITY:a})},20773:(e,t,r)=>{r.d(t,{a:()=>n,b:()=>l,n:()=>s,s:()=>a,t:()=>o});var i=r(72220);function o(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const o=e.count,n=r[0],a=r[1],s=r[2],l=r[4],c=r[5],d=r[6],u=r[8],h=r[9],f=r[10],m=r[12],p=r[13],v=r[14],g=e.typedBuffer,_=e.typedBufferStride,T=t.typedBuffer,x=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*_,r=e*x,i=T[r],o=T[r+1],b=T[r+2];g[t]=n*i+l*o+u*b+m,g[t+1]=a*i+c*o+h*b+p,g[t+2]=s*i+d*o+f*b+v}}function n(e,t,r){if(e.count!==t.count)return void i.c.error("source and destination buffers need to have the same number of elements");const o=e.count,n=r[0],a=r[1],s=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],m=e.typedBuffer,p=e.typedBufferStride,v=t.typedBuffer,g=t.typedBufferStride;for(let e=0;e<o;e++){const t=e*p,r=e*g,i=v[r],o=v[r+1],_=v[r+2];m[t]=n*i+l*o+u*_,m[t+1]=a*i+c*o+h*_,m[t+2]=s*i+d*o+f*_}}function a(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*n,i=e*s;o[t]=r*a[i],o[t+1]=r*a[i+1],o[t+2]=r*a[i+2]}}function s(e,t){const r=Math.min(e.count,t.count),i=e.typedBuffer,o=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride;for(let e=0;e<r;e++){const t=e*o,r=e*a,s=n[r],l=n[r+1],c=n[r+2],d=Math.sqrt(s*s+l*l+c*c);if(d>0){const e=1/d;i[t]=e*s,i[t+1]=e*l,i[t+2]=e*c}}}function l(e,t,r){const i=Math.min(e.count,t.count),o=e.typedBuffer,n=e.typedBufferStride,a=t.typedBuffer,s=t.typedBufferStride;for(let e=0;e<i;e++){const t=e*n,i=e*s;o[t]=a[i]>>r,o[t+1]=a[i+1]>>r,o[t+2]=a[i+2]>>r}}Object.freeze({__proto__:null,transformMat4:o,transformMat3:n,scale:a,normalize:s,shiftRight:l})},56067:(e,t,r)=>{function i(e,t,r){const i=e.typedBuffer,o=e.typedBufferStride,n=t.typedBuffer,a=t.typedBufferStride,s=r?r.count:t.count;let l=(r&&r.dstIndex?r.dstIndex:0)*o,c=(r&&r.srcIndex?r.srcIndex:0)*a;for(let e=0;e<s;++e)i[l]=n[c],i[l+1]=n[c+1],i[l+2]=n[c+2],l+=o,c+=a}function o(e,t,r,i,o){var n,a;const s=e.typedBuffer,l=e.typedBufferStride,c=null!=(n=null==o?void 0:o.count)?n:e.count;let d=(null!=(a=null==o?void 0:o.dstIndex)?a:0)*l;for(let e=0;e<c;++e)s[d]=t,s[d+1]=r,s[d+2]=i,d+=l}r.d(t,{c:()=>i,f:()=>o}),Object.freeze({__proto__:null,copy:i,fill:o})},72119:(e,t,r)=>{function i(){return new Float32Array(3)}function o(e,t,r){const i=new Float32Array(3);return i[0]=e,i[1]=t,i[2]=r,i}function n(){return i()}function a(){return o(1,1,1)}function s(){return o(1,0,0)}function l(){return o(0,1,0)}function c(){return o(0,0,1)}r.d(t,{c:()=>i,f:()=>o});const d=n(),u=a(),h=s(),f=l(),m=c();Object.freeze({__proto__:null,create:i,clone:function(e){const t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},fromValues:o,createView:function(e,t){return new Float32Array(e,t,3)},zeros:n,ones:a,unitX:s,unitY:l,unitZ:c,ZEROS:d,ONES:u,UNIT_X:h,UNIT_Y:f,UNIT_Z:m})},32243:(e,t,r)=>{function i(e){return e=e||globalThis.location.hostname,c.some((t=>{var r;return null!=(null==(r=e)?void 0:r.match(t))}))}function o(e,t){return e&&(t=t||globalThis.location.hostname)?null!=t.match(n)||null!=t.match(s)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(a)||null!=t.match(l)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e}r.d(t,{pJ:()=>o,XO:()=>i});const n=/^devext.arcgis.com$/,a=/^qaext.arcgis.com$/,s=/^[\w-]*\.mapsdevext.arcgis.com$/,l=/^[\w-]*\.mapsqa.arcgis.com$/,c=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,n,a,/^jsapps.esri.com$/,s,l]},72220:(e,t,r)=>{r.d(t,{c:()=>i});const i=r(92604).Z.getLogger("esri.views.3d.support.buffer.math")},98833:(e,t,r)=>{r.r(t),r.d(t,{fetch:()=>Zr,gltfToEngineResources:()=>ei,parseUrl:()=>Qr});var i=r(32243),o=r(70586),n=r(21787),a=r(46521),s=r(52138),l=r(13598),c=r(17896),d=r(65617),u=r(60437),h=r(56481),f=r(20773),m=r(11077),p=r(8323),v=r(40270),g=r(88246),_=r(91911),T=r(3172),x=r(66643),b=r(20102),A=r(92604),E=r(95330),S=r(23670);async function M(e,t){const{data:r}=await(0,T.default)(e,{responseType:"image",...t});return r}var C=r(47026),R=r(44553),O=r(11726);class y{constructor(e,t,r,i){this.primitiveIndices=e,this._numIndexPerPrimitive=t,this.indices=r,this.position=i,this.center=(0,d.c)(),(0,O.hu)(e.length>=1),(0,O.hu)(r.length%this._numIndexPerPrimitive==0),(0,O.hu)(r.length>=e.length*this._numIndexPerPrimitive),(0,O.hu)(3===i.size||4===i.size);const{data:o,size:n}=i,a=e.length;let s=n*r[this._numIndexPerPrimitive*e[0]];N.clear(),N.push(s),this.bbMin=(0,d.f)(o[s],o[s+1],o[s+2]),this.bbMax=(0,d.a)(this.bbMin);for(let t=0;t<a;++t){const i=this._numIndexPerPrimitive*e[t];for(let e=0;e<this._numIndexPerPrimitive;++e){s=n*r[i+e],N.push(s);let t=o[s];this.bbMin[0]=Math.min(t,this.bbMin[0]),this.bbMax[0]=Math.max(t,this.bbMax[0]),t=o[s+1],this.bbMin[1]=Math.min(t,this.bbMin[1]),this.bbMax[1]=Math.max(t,this.bbMax[1]),t=o[s+2],this.bbMin[2]=Math.min(t,this.bbMin[2]),this.bbMax[2]=Math.max(t,this.bbMax[2])}}(0,c.e)(this.center,this.bbMin,this.bbMax,.5),this.radius=.5*Math.max(Math.max(this.bbMax[0]-this.bbMin[0],this.bbMax[1]-this.bbMin[1]),this.bbMax[2]-this.bbMin[2]);let l=this.radius*this.radius;for(let e=0;e<N.length;++e){s=N.getItemAt(e);const t=o[s]-this.center[0],r=o[s+1]-this.center[1],i=o[s+2]-this.center[2],n=t*t+r*r+i*i;if(n<=l)continue;const a=Math.sqrt(n),c=.5*(a-this.radius);this.radius=this.radius+c,l=this.radius*this.radius;const d=c/a;this.center[0]+=t*d,this.center[1]+=r*d,this.center[2]+=i*d}N.clear()}getCenter(){return this.center}getBSRadius(){return this.radius}getBBMin(){return this.bbMin}getBBMax(){return this.bbMax}getChildren(){if(this._children)return this._children;if((0,c.h)(this.bbMin,this.bbMax)>1){const e=(0,c.e)((0,d.c)(),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:o,size:n}=this.position;for(let a=0;a<t;++a){let t=0;const s=this._numIndexPerPrimitive*this.primitiveIndices[a];let l=n*this.indices[s],c=o[l],d=o[l+1],u=o[l+2];for(let e=1;e<this._numIndexPerPrimitive;++e){l=n*this.indices[s+e];const t=o[l],r=o[l+1],i=o[l+2];t<c&&(c=t),r<d&&(d=r),i<u&&(u=i)}c<e[0]&&(t|=1),d<e[1]&&(t|=2),u<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 s=new Array(8);for(let e=0;e<8;++e)s[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];s[t][i[t]++]=this.primitiveIndices[e]}this._children=new Array(8);for(let e=0;e<8;++e)void 0!==s[e]&&(this._children[e]=new y(s[e],this._numIndexPerPrimitive,this.indices,this.position))}return this._children}static prune(){N.prune()}}const N=new R.Z({deallocator:null});var w,P,D=r(99001);class I{constructor(){this.id=(0,D.D)()}unload(){}}(P=w||(w={}))[P.Layer=0]="Layer",P[P.Object=1]="Object",P[P.Geometry=2]="Geometry",P[P.Material=3]="Material",P[P.Texture=4]="Texture",P[P.COUNT=5]="COUNT";var L=r(64291);class F extends I{constructor(e,t=[],r=C.MX.Triangle,i=-1){super(),this._primitiveType=r,this.edgeIndicesLength=i,this.type=w.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[t,r]of e)r&&this._vertexAttributes.set(t,{...r});if(null==t||0===t.length){const e=function(e){const t=e.values().next().value;return null==t?0:t.data.length/t.size}(this._vertexAttributes),t=(0,L.p)(e);this.edgeIndicesLength=this.edgeIndicesLength<0?e:this.edgeIndicesLength;for(const e of this._vertexAttributes.keys())this._indices.set(e,t)}else for(const[e,r]of t)r&&(this._indices.set(e,H(r)),e===C.T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(e).length:this.edgeIndicesLength))}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const t=this._vertexAttributes.get(e);return t&&!t.exclusive&&(t.data=Array.from(t.data),t.exclusive=!0),t}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return(0,o.Wi)(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===C.MX.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const t=this.indices.get(C.T.POSITION),r=this.vertexAttributes.get(C.T.POSITION);return(0,L.cM)(r,t,e)}_computeAttachmentOriginPoints(e){const t=this.indices.get(C.T.POSITION),r=this.vertexAttributes.get(C.T.POSITION);return(0,L.NO)(r,t,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(C.T.POSITION);if(0===e.length)return null;const t=this.primitiveType===C.MX.Triangle?3:1;(0,O.hu)(e.length%t==0,"Indexing error: "+e.length+" not divisible by "+t);const r=(0,L.p)(e.length/t),i=this.vertexAttributes.get(C.T.POSITION);return new y(r,t,e,i)}}function H(e){if(e.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return e;for(const t of e)if(t>=65536)return e;return new Uint16Array(e)}var B=r(74085),U=r(32448),z=r(22021),V=r(1533),G=r(17452),W=r(85958),k=r(99880);let q;var $;!function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"}($||($={}));var X=r(35371),j=r(75656);function Y(e,t,r,i,o=0){const n=e.gl,a=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);void 0===r&&console.error(`There is no location for vertex attribute '${e.name}' defined.`);const i=o*e.stride;if(e.count<=4)n.vertexAttribPointer(r,e.count,e.type,e.normalized,e.stride,e.offset+i),n.enableVertexAttribArray(r),e.divisor>0&&a&&a.vertexAttribDivisor(r,e.divisor);else if(9===e.count)for(let t=0;t<3;t++)n.vertexAttribPointer(r+t,3,e.type,e.normalized,e.stride,e.offset+12*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else if(16===e.count)for(let t=0;t<4;t++)n.vertexAttribPointer(r+t,4,e.type,e.normalized,e.stride,e.offset+16*t+i),n.enableVertexAttribArray(r+t),e.divisor>0&&a&&a.vertexAttribDivisor(r+t,e.divisor);else console.error("Unsupported vertex attribute element count: "+e.count)}}function K(e,t,r,i){const o=e.gl,n=e.capabilities.instancing;e.bindBuffer(r);for(const e of i){const r=t.get(e.name);if(e.count<=4)o.disableVertexAttribArray(r),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r,0);else if(9===e.count)for(let t=0;t<3;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r+t,0);else if(16===e.count)for(let t=0;t<4;t++)o.disableVertexAttribArray(r+t),e.divisor&&e.divisor>0&&n&&n.vertexAttribDivisor(r+t,0);else console.error("Unsupported vertex attribute element count: "+e.count)}e.unbindBuffer(X.w0.ARRAY_BUFFER)}function J(e){switch(e){case X.VI.ALPHA:case X.VI.LUMINANCE:case X.Tg.STENCIL_INDEX8:return 1;case X.VI.LUMINANCE_ALPHA:case X.VI.RGBA4:case X.VI.R16F:case X.Tg.RGBA4:case X.Tg.DEPTH_COMPONENT16:return 2;case X.VI.RGB:case X.VI.DEPTH_COMPONENT:return 3;case X.VI.RGBA:case X.VI.DEPTH_STENCIL:case X.VI.R32F:case X.VI.R11F_G11F_B10F:case X.VI.RG16F:case X.Tg.DEPTH_STENCIL:return 4;case X.VI.RG32F:case X.VI.RGBA16F:return 8;case X.VI.RGB32F:return 12;case X.VI.RGBA32F:return 16;case X.q_.COMPRESSED_RGB_S3TC_DXT1_EXT:case X.q_.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case X.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT:case X.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case X.q_.COMPRESSED_R11_EAC:case X.q_.COMPRESSED_SIGNED_R11_EAC:case X.q_.COMPRESSED_RGB8_ETC2:case X.q_.COMPRESSED_SRGB8_ETC2:case X.q_.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case X.q_.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case X.q_.COMPRESSED_RG11_EAC:case X.q_.COMPRESSED_SIGNED_RG11_EAC:case X.q_.COMPRESSED_RGBA8_ETC2_EAC:case X.q_.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function Z(e){if((0,o.Wi)(e))return 0;if("descriptor"in e)return e.glName?Z(e.descriptor):0;const t=e.internalFormat||"pixelFormat"in e&&e.pixelFormat;if(!t)return 0;const r="hasMipmap"in e&&e.hasMipmap?1.3:1,i=e.width*e.height;return J(t)*i*r}r(80442);let Q=null,ee=null;async function te(){return(0,o.Wi)(ee)&&(ee=function(){if((0,o.Wi)(q)){const e=e=>(0,k.V)(`esri/libs/basisu/${e}`);q=r.e(1421).then(r.bind(r,21421)).then((e=>e.b)).then((({default:t})=>t({locateFile:e}).then((e=>(e.initializeBasis(),delete e.then,e)))))}return q}(),Q=await ee),ee}function re(e,t,r,i,o){const n=J(t?X.q_.COMPRESSED_RGBA8_ETC2_EAC:X.q_.COMPRESSED_RGB8_ETC2),a=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*n*a)}function ie(e){return e.getNumImages()>=1&&!e.isUASTC()}function oe(e){return e.getFaces()>=1&&e.isETC1S()}function ne(e,t,r,i,o,n,a,s){const{compressedTextureETC:l,compressedTextureS3TC:c}=e.capabilities,[d,u]=l?i?[$.ETC2_RGBA,X.q_.COMPRESSED_RGBA8_ETC2_EAC]:[$.ETC1_RGB,X.q_.COMPRESSED_RGB8_ETC2]:c?i?[$.BC3_RGBA,X.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[$.BC1_RGB,X.q_.COMPRESSED_RGB_S3TC_DXT1_EXT]:[$.RGBA32,X.VI.RGBA],h=t.hasMipmap?r:Math.min(1,r),f=[];for(let e=0;e<h;e++)f.push(new Uint8Array(a(e,d))),s(e,d,f[e]);const m=f.length>1,p=m?X.cw.LINEAR_MIPMAP_LINEAR:X.cw.LINEAR,v={...t,samplingMode:p,hasMipmap:m,internalFormat:u,width:o,height:n};return new j.x(e,v,{type:"compressed",levels:f})}const ae=A.Z.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil");function se(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}const le=se("DXT1"),ce=se("DXT3"),de=se("DXT5");const ue=new Map([[C.T.POSITION,0],[C.T.NORMAL,1],[C.T.UV0,2],[C.T.COLOR,3],[C.T.SIZE,4],[C.T.TANGENT,4],[C.T.AUXPOS1,5],[C.T.SYMBOLCOLOR,5],[C.T.AUXPOS2,6],[C.T.FEATUREATTRIBUTE,6],[C.T.INSTANCEFEATUREATTRIBUTE,6],[C.T.INSTANCECOLOR,7],[C.T.MODEL,8],[C.T.MODELNORMAL,12],[C.T.MODELORIGINHI,11],[C.T.MODELORIGINLO,15]]);var he=r(21968);new he.G(C.T.POSITION,3,X.g.FLOAT,0,12),new he.G(C.T.POSITION,3,X.g.FLOAT,0,20),new he.G(C.T.UV0,2,X.g.FLOAT,12,20),new he.G(C.T.POSITION,3,X.g.FLOAT,0,32),new he.G(C.T.NORMAL,3,X.g.FLOAT,12,32),new he.G(C.T.UV0,2,X.g.FLOAT,24,32),new he.G(C.T.POSITION,3,X.g.FLOAT,0,16),new he.G(C.T.COLOR,4,X.g.UNSIGNED_BYTE,12,16);const fe=[new he.G(C.T.POSITION,2,X.g.FLOAT,0,8)],me=[new he.G(C.T.POSITION,2,X.g.FLOAT,0,16),new he.G(C.T.UV0,2,X.g.FLOAT,8,16)];var pe=r(49300),ve=r(54738);const ge=A.Z.getLogger("esri.views.webgl.BufferObject");class _e{constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(X._g.Buffer,this),this._glName=this._context.gl.createBuffer(),(0,pe.zu)(this._context.gl),i&&this.setData(i)}static createIndex(e,t,r){return new _e(e,X.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new _e(e,X.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){return new _e(e,X.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=X.l1.STREAM_READ,r){const i=new _e(e,X.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=X.l1.STREAM_DRAW,r){return new _e(e,X.w0.PIXEL_UNPACK_BUFFER,t,r)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===X.w0.ELEMENT_ARRAY_BUFFER?this._indexType===X.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===X.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===X.w0.ARRAY_BUFFER}dispose(){var e;null!=(e=this._context)&&e.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(X._g.Buffer,this),this._context=null):this._glName&&ge.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&ge.error("Buffer size needs to be positive!"),this.bufferType===X.w0.ELEMENT_ARRAY_BUFFER&&(0,o.pC)(t))switch(this._indexType=t,t){case X.g.UNSIGNED_SHORT:e*=2;break;case X.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===X.w0.ELEMENT_ARRAY_BUFFER&&((0,V.Uc)(e)&&(t/=2,this._indexType=X.g.UNSIGNED_SHORT),(0,V.ZY)(e)&&(t/=4,this._indexType=X.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;(0,o.pC)(t)?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,pe.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t=0,r=0,i=e.byteLength){if(!e)return;(t<0||t>=this._size)&&ge.error("offset is out of range!");let o=t,n=r,a=i,s=e.byteLength;this.bufferType===X.w0.ELEMENT_ARRAY_BUFFER&&((0,V.Uc)(e)?(s/=2,o*=2,n*=2,a*=2):(0,V.ZY)(e)&&(s/=4,o*=4,n*=4,a*=4)),void 0===i&&(i=s-1),r>=i&&ge.error("end must be bigger than start!"),t+r-i>this._size&&ge.error("An attempt to write beyond the end of the buffer!");const l=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl,d=ArrayBuffer.isView(e)?e.buffer:e,u=0===n&&a===e.byteLength?d:d.slice(n,a);c.bufferSubData(this.bufferType,o,u),(0,pe.zu)(c),this._isVAOAware&&this._context.bindVAO(l)}setSubDataFromView(e,t,r,i){if(!e)return;(t<0||t>=this._size)&&ge.error("offset is out of range!"),r>=i&&ge.error("end must be bigger than start!"),t+r-i>this._size&&ge.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===ve.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,pe.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==ve.zO.WEBGL2)return void ge.error("Get buffer subdata is only supported in WebGL2!");const o=this._context.gl;this._context.bindBuffer(this,X.w0.COPY_READ_BUFFER),o.getBufferSubData(X.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(X.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===ve.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):ge.error("Get buffer subdata is only supported in WebGL2!")}}const Te=A.Z.getLogger("esri.views.webgl.VertexArrayObject");class xe{constructor(e,t,r,i,o=null){this._context=e,this._locations=t,this._layout=r,this._buffers=i,this._indexBuffer=o,this._glName=null,this._initialized=!1,e.instanceCounter.increment(X._g.VAO,this)}get glName(){return this._glName}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce(((e,t)=>e+this._buffers[t].size),(0,o.pC)(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(e=!0){if(this._context){if(this._glName){var t,r;const e=null==(t=this._context)||null==(r=t.capabilities)?void 0:r.vao;e?(e.deleteVertexArray(this._glName),this._glName=null):Te.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),e){for(const e in this._buffers)this._buffers[e].dispose(),delete this._buffers[e];this._indexBuffer=(0,o.O3)(this._indexBuffer)}this._context.instanceCounter.decrement(X._g.VAO,this),this._context=null}else(this._glName||e&&Object.getOwnPropertyNames(this._buffers).length>0)&&Te.warn("Leaked WebGL VAO")}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const t=e.createVertexArray();e.bindVertexArray(t),this._bindLayout(),e.bindVertexArray(null),this._glName=t}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:t,_indexBuffer:r}=this;e||Te.error("Vertex buffer dictionary is empty!");const i=this._context.gl;for(const r in e){const i=e[r];i||Te.error("Vertex buffer is uninitialized!");const o=t[r];o||Te.error("Vertex element descriptor is empty!"),Y(this._context,this._locations,i,o)}(0,o.pC)(r)&&(this._context.capabilities.vao?i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:t}=this;e||Te.error("Vertex buffer dictionary is empty!");for(const r in e){const i=e[r];i||Te.error("Vertex buffer is uninitialized!");const o=t[r];K(this._context,this._locations,i,o)}(0,o.pC)(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}class be{constructor(e,t){this._context=e,this._desc=t,this._context.instanceCounter.increment(X._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this),r.renderbufferStorage(r.RENDERBUFFER,t.internalFormat,t.width,t.height)}get descriptor(){return this._desc}resize(e,t){const r=this._desc;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(X._g.Renderbuffer,this),this._context=null)}}const Ae=A.Z.getLogger("esri.views.webgl.FrameBufferObject");class Ee{constructor(e,t,r=null,i=null){if(this._context=e,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._initialized=!1,this._desc={...t},e.instanceCounter.increment(X._g.Framebuffer,this),(0,o.pC)(r)){Array.isArray(r)||(r=[r]);for(let t=0;t<r.length;++t){var n,a;const i=r[t];let o;Se(i)?(o=i.descriptor,this._colorAttachments.set(X.VY.COLOR_ATTACHMENT0+t,i)):(o=i,this._colorAttachments.set(X.VY.COLOR_ATTACHMENT0+t,new j.x(e,i))),(null==(n=this._desc)?void 0:n.colorTarget)!==X.Lm.TEXTURE&&(null==(a=this._desc)?void 0:a.colorTarget)!==X.Lm.CUBEMAP&&console.error("Framebuffer is initialized with a texture however the descriptor indicates using a renderbuffer color attachment!"),this._validateColorAttachmentPoint(X.VY.COLOR_ATTACHMENT0+t),this._validateTextureDimensions(o,this._desc)}}if(i instanceof be){var s;const e=null!=(s=this._desc.depthStencilTarget)?s:X.OU.DEPTH_STENCIL_RENDER_BUFFER;e===X.OU.STENCIL_RENDER_BUFFER?this._stencilAttachment=i:e===X.OU.DEPTH_RENDER_BUFFER||e===X.OU.DEPTH_STENCIL_RENDER_BUFFER?this._depthAttachment=i:console.error('If a Renderbuffer is provided, "depthStencilTarget" must be one of STENCIL_RENDER_BUFFER, DEPTH_RENDER_BUFFER or DEPTH_STENCIL_RENDER_BUFFER'),Me(i.descriptor,this._desc)}else if((0,o.pC)(i)){let e;this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!"),Se(i)?(this._depthStencilTexture=i,e=i.descriptor):this._depthStencilTexture=new j.x(this._context,i),this._validateTextureDimensions(e,this._desc)}}dispose(){if(!this._desc)return;const e=this._context.getBoundFramebufferObject();this._disposeColorAttachments(),this._disposeDepthStencilAttachments(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(X._g.Framebuffer,this),this._desc=null}get glName(){return this._glName}get descriptor(){return this._desc}get colorTexture(){const e=this._colorAttachments.get(X.VY.COLOR_ATTACHMENT0);return e&&Se(e)?e:null}get colorAttachment(){return this._colorAttachments.get(X.VY.COLOR_ATTACHMENT0)}get depthStencilAttachment(){return this._depthStencilTexture||this._depthAttachment||this._stencilAttachment}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._desc.width}get height(){return this._desc.height}get gpuMemoryUsage(){return Z(this.colorAttachment)+Z(this.depthStencilAttachment)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&Se(t)?t:null}framebufferTexture2D(e,t,r=X.VY.COLOR_ATTACHMENT0,i=X.No.TEXTURE_2D,o=0){t.framebufferTexture2D(t.FRAMEBUFFER,r,i,e,o)}attachColorTexture(e,t=X.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDimensions(r,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(e.glName,this._context.gl,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=X.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(Se(t)){const r=t;return this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,e)),this._colorAttachments.delete(e),r}}attachDepthStencilTexture(e){if((0,o.Wi)(e))return;const t=e.descriptor;t.pixelFormat!==X.VI.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==X.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDimensions(t,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==X.OU.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=X.OU.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(e.glName,this._context.gl,X.Lu)),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,X.Lu)),this._depthStencilTexture=null,e}attachDepthStencilBuffer(e){if((0,o.Wi)(e))return;const t=e.descriptor;if(t.internalFormat!==X.Tg.DEPTH_STENCIL&&t.internalFormat!==X.Tg.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),Me(t,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=t.internalFormat===X.Tg.DEPTH_STENCIL?X.OU.DEPTH_STENCIL_RENDER_BUFFER:X.OU.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._desc.depthStencilTarget===X.OU.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(t.FRAMEBUFFER,r,t.RENDERBUFFER,e.glName)}this._depthAttachment=e}detachDepthStencilBuffer(){const e=this._context.gl,t=this._depthAttachment;if(t&&this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===X.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}return this._depthAttachment=null,t}detachAll(){this.detachColorTexture(),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=this._desc,l=a.descriptor;a.descriptor.target!==X.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(e+r>s.width||t+i>s.height||o+r>l.width||n+i>l.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,d=c.bindTexture(a,j.x.TEXTURE_UNIT_FOR_UPDATES);c.bindFramebuffer(this),c.gl.copyTexSubImage2D(X.No.TEXTURE_2D,0,o,n,e,t,r,i),c.bindTexture(d,j.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==ve.zO.WEBGL2)return void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=_e.createPixelPack(this._context,X.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(X.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){const r=this._desc;if(r.width!==e||r.height!==t){if(!this._initialized)return r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),void(this._depthStencilTexture&&this._depthStencilTexture.resize(e,t));r.width=e,r.height=t,this._colorAttachments.forEach((r=>{r&&r.resize(e,t)})),null!=this._depthStencilTexture?this._depthStencilTexture.resize(e,t):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(e,t),this._stencilAttachment&&this._stencilAttachment.resize(e,t)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(e=X.No.TEXTURE_2D){var t,r,i,o;const n=this._context.gl;if(this._initialized)return void n.bindFramebuffer(n.FRAMEBUFFER,this.glName);this._glName&&n.deleteFramebuffer(this._glName);const a=this._context,s=n.createFramebuffer(),l=this._desc,c=null!=(t=l.colorTarget)?t:X.Lm.RENDER_BUFFER,d=null!=(r=l.width)?r:1,u=null!=(i=l.height)?i:1;if(n.bindFramebuffer(n.FRAMEBUFFER,s),0===this._colorAttachments.size)if(c===X.Lm.TEXTURE)this._colorAttachments.set(X.VY.COLOR_ATTACHMENT0,function(e,t,r){return new j.x(e,{target:r,pixelFormat:X.VI.RGBA,dataType:X.Br.UNSIGNED_BYTE,samplingMode:X.cw.NEAREST,wrapMode:X.e8.CLAMP_TO_EDGE,width:t.width,height:t.height})}(a,l,this.descriptor.colorTarget===X.Lm.CUBEMAP?X.No.TEXTURE_CUBE_MAP:X.No.TEXTURE_2D));else{const e=new be(a,{internalFormat:X.Tg.RGBA4,width:d,height:u});this._colorAttachments.set(X.VY.COLOR_ATTACHMENT0,e)}this._colorAttachments.forEach(((t,r)=>{t&&(Se(t)?this.framebufferTexture2D(t.glName,n,r,e):n.framebufferRenderbuffer(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.RENDERBUFFER,t.glName))}));const h=null!=(o=l.depthStencilTarget)?o:X.OU.NONE;switch(h){case X.OU.DEPTH_RENDER_BUFFER:case X.OU.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new be(a,{internalFormat:l.depthStencilTarget===X.OU.DEPTH_RENDER_BUFFER?X.Tg.DEPTH_COMPONENT16:X.Tg.DEPTH_STENCIL,width:d,height:u}));const e=h===X.OU.DEPTH_RENDER_BUFFER?n.DEPTH_ATTACHMENT:n.DEPTH_STENCIL_ATTACHMENT;n.framebufferRenderbuffer(n.FRAMEBUFFER,e,n.RENDERBUFFER,this._depthAttachment.glName);break}case X.OU.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new be(a,{internalFormat:X.Tg.STENCIL_INDEX8,width:d,height:u})),n.framebufferRenderbuffer(n.FRAMEBUFFER,n.STENCIL_ATTACHMENT,n.RENDERBUFFER,this._stencilAttachment.glName);break;case X.OU.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){a.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const e={target:X.No.TEXTURE_2D,pixelFormat:X.VI.DEPTH_STENCIL,dataType:X.Br.UNSIGNED_INT_24_8,samplingMode:X.cw.NEAREST,wrapMode:X.e8.CLAMP_TO_EDGE,width:d,height:u};this._depthStencilTexture=new j.x(a,e)}this.framebufferTexture2D(this._depthStencilTexture.glName,n,n.DEPTH_STENCIL_ATTACHMENT,e)}(0,pe.CG)()&&n.checkFramebufferStatus(n.FRAMEBUFFER)!==n.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=s,this._initialized=!0}_disposeColorAttachments(){this._colorAttachments.forEach(((e,t)=>{if(Se(e))this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,this._context.gl,t)),e.dispose();else if(e instanceof WebGLRenderbuffer){const r=this._context.gl;this._initialized&&(this._context.bindFramebuffer(this),r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,null)),this._context.gl.deleteRenderbuffer(e)}})),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const t=this._desc.depthStencilTarget===X.OU.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(e.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this.framebufferTexture2D(null,e,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateTextureDimensions(e,t){e.target!==X.No.TEXTURE_2D&&e.target!==X.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}_validateColorAttachmentPoint(e){if(-1===Ee._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;Ee._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else Ee._MAX_COLOR_ATTACHMENTS=1}const t=e-X.VY.COLOR_ATTACHMENT0;t+1>Ee._MAX_COLOR_ATTACHMENTS&&Ae.error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${Ee._MAX_COLOR_ATTACHMENTS} color attachments`)}}function Se(e){return"type"in e&&"texture"===e.type}function Me(e,t){void 0!==t.width&&t.width>=0&&void 0!==t.height&&t.height>=0?t.width===e.width&&t.height===e.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=e.width,t.height=e.height)}Ee._MAX_COLOR_ATTACHMENTS=-1;var Ce,Re,Oe=r(46314);class ye extends I{constructor(e,t){super(),this.data=e,this.type=w.Texture,this._glTexture=null,this._powerOfTwoStretchInfo=null,this._loadingPromise=null,this._loadingController=null,this.events=new U.Z,this.params=t||{},this.params.mipmap=!1!==this.params.mipmap,this.params.noUnpackFlip=this.params.noUnpackFlip||!1,this.params.preMultiplyAlpha=this.params.preMultiplyAlpha||!1,this.params.wrap=this.params.wrap||{s:X.e8.REPEAT,t:X.e8.REPEAT},this.params.powerOfTwoResizeMode=this.params.powerOfTwoResizeMode||C.CE.STRETCH,this.estimatedTexMemRequired=ye._estimateTexMemRequired(this.data,this.params),this._startPreload()}_startPreload(){const e=this.data;(0,o.Wi)(e)||(e instanceof HTMLVideoElement?this._startPreloadVideoElement(e):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){(0,G.jc)(e.src)||"auto"===e.preload&&e.crossOrigin||(e.preload="auto",e.crossOrigin="anonymous",e.src=e.src)}_startPreloadImageElement(e){(0,G.HK)(e.src)||(0,G.jc)(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}static _getDataDimensions(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}static _estimateTexMemRequired(e,t){if((0,o.Wi)(e))return 0;if((0,V.eP)(e)||(0,V.lq)(e))return t.encoding===ye.KTX2_ENCODING?function(e,t){if((0,o.Wi)(Q))return e.byteLength;const r=new Q.KTX2File(new Uint8Array(e)),i=oe(r)?re(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}(e,t.mipmap):t.encoding===ye.BASIS_ENCODING?function(e,t){if((0,o.Wi)(Q))return e.byteLength;const r=new Q.BasisFile(new Uint8Array(e)),i=ie(r)?re(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?ye._getDataDimensions(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}dispose(){this.data=void 0}get width(){return this.params.width}get height(){return this.params.height}_createDescriptor(e){var t;return{target:X.No.TEXTURE_2D,pixelFormat:X.VI.RGBA,dataType:X.Br.UNSIGNED_BYTE,wrapMode:this.params.wrap,flipped:!this.params.noUnpackFlip,samplingMode:this.params.mipmap?X.cw.LINEAR_MIPMAP_LINEAR:X.cw.LINEAR,hasMipmap:this.params.mipmap,preMultiplyAlpha:this.params.preMultiplyAlpha,maxAnisotropy:null!=(t=this.params.maxAnisotropy)?t:this.params.mipmap?e.parameters.maxMaxAnisotropy:1}}get glTexture(){return this._glTexture}load(e,t){if((0,o.pC)(this._glTexture))return this._glTexture;if((0,o.pC)(this._loadingPromise))return this._loadingPromise;const r=this.data;return(0,o.Wi)(r)?(this._glTexture=new j.x(e,this._createDescriptor(e),null),this._glTexture):"string"==typeof r?this._loadFromURL(e,t,r):r instanceof Image?this._loadFromImageElement(e,t,r):r instanceof HTMLVideoElement?this._loadFromVideoElement(e,t,r):r instanceof ImageData||r instanceof HTMLCanvasElement?this._loadFromImage(e,r,t):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===ye.DDS_ENCODING?this._loadFromDDSData(e,r):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===ye.KTX2_ENCODING?this._loadFromKTX2(e,r):((0,V.eP)(r)||(0,V.lq)(r))&&this.params.encoding===ye.BASIS_ENCODING?this._loadFromBasis(e,r):(0,V.lq)(r)?this._loadFromPixelData(e,r):(0,V.eP)(r)?this._loadFromPixelData(e,new Uint8Array(r)):null}get requiresFrameUpdates(){return this.data instanceof HTMLVideoElement}frameUpdate(e,t,r){if(!(this.data instanceof HTMLVideoElement)||(0,o.Wi)(this._glTexture))return r;if(this.data.readyState<Ce.HAVE_CURRENT_DATA||r===this.data.currentTime)return r;if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:r,vao:i,sourceTexture:o}=this._powerOfTwoStretchInfo;o.setData(this.data),this._drawStretchedTexture(e,t,r,i,o,this._glTexture)}else{const{width:e,height:t}=this.data,{width:r,height:i}=this._glTexture.descriptor;e!==r||t!==i?this._glTexture.updateData(0,0,0,Math.min(e,r),Math.min(t,i),this.data):this._glTexture.setData(this.data)}return this._glTexture.descriptor.hasMipmap&&this._glTexture.generateMipmap(),this.data.currentTime}_loadFromDDSData(e,t){return this._glTexture=function(e,t,r){const{textureData:i,internalFormat:o,width:n,height:a}=function(e,t){const r=new Int32Array(e,0,31);if(542327876!==r[0])return ae.error("Invalid magic number in DDS header"),null;if(!(4&r[20]))return ae.error("Unsupported format, must contain a FourCC code"),null;const i=r[21];let o,n;switch(i){case le:o=8,n=X.q_.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case ce:o=16,n=X.q_.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case de:o=16,n=X.q_.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return ae.error("Unsupported FourCC code:",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(i)),null}let a=1,s=r[4],l=r[3];0==(3&s)&&0==(3&l)||(ae.warn("Rounding up compressed texture size to nearest multiple of 4."),s=s+3&-4,l=l+3&-4);const c=s,d=l;let u,h;131072&r[2]&&!1!==t&&(a=Math.max(1,r[7])),1===a||(0,z.wt)(s)&&(0,z.wt)(l)||(ae.warn("Ignoring mipmaps of non power of two sized compressed texture."),a=1);let f=r[1]+4;const m=[];for(let t=0;t<a;++t)h=(s+3>>2)*(l+3>>2)*o,u=new Uint8Array(e,f,h),m.push(u),f+=h,s=Math.max(1,s>>1),l=Math.max(1,l>>1);return{textureData:{type:"compressed",levels:m},internalFormat:n,width:c,height:d}}(r,t.hasMipmap);return t.samplingMode=i.levels.length>1?X.cw.LINEAR_MIPMAP_LINEAR:X.cw.LINEAR,t.hasMipmap=i.levels.length>1,t.internalFormat=o,t.width=n,t.height=a,new j.x(e,t,i)}(e,this._createDescriptor(e),t),this._glTexture}_loadFromKTX2(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(Q)&&(Q=await te());const i=new Q.KTX2File(new Uint8Array(r));if(!oe(i))return null;i.startTranscoding();const n=ne(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._glTexture=e,e)))))}_loadFromBasis(e,t){return this._loadAsync((()=>async function(e,t,r){(0,o.Wi)(Q)&&(Q=await te());const i=new Q.BasisFile(new Uint8Array(r));if(!ie(i))return null;i.startTranscoding();const n=ne(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._glTexture=e,e)))))}_loadFromPixelData(e,t){(0,O.hu)(this.params.width>0&&this.params.height>0);const r=this._createDescriptor(e);return r.pixelFormat=1===this.params.components?X.VI.LUMINANCE:3===this.params.components?X.VI.RGB:X.VI.RGBA,r.width=this.params.width,r.height=this.params.height,this._glTexture=new j.x(e,r,t),this._glTexture}_loadFromURL(e,t,r){return this._loadAsync((async i=>{const o=await M(r,{signal:i});return(0,E.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromImageElement(e,t,r){return r.complete?this._loadFromImage(e,r,t):this._loadAsync((async i=>{const o=await(0,W.f)(r,r.src,!1,i);return(0,E.k_)(i),this._loadFromImage(e,o,t)}))}_loadFromVideoElement(e,t,r){return r.readyState>=Ce.HAVE_CURRENT_DATA?this._loadFromImage(e,r,t):this._loadFromVideoElementAsync(e,t,r)}_loadFromVideoElementAsync(e,t,r){return this._loadAsync((i=>new Promise(((n,a)=>{const s=()=>{r.removeEventListener("loadeddata",l),r.removeEventListener("error",c),(0,o.hw)(d)},l=()=>{r.readyState>=Ce.HAVE_CURRENT_DATA&&(s(),n(this._loadFromImage(e,r,t)))},c=e=>{s(),a(e||new b.Z("Failed to load video"))};r.addEventListener("loadeddata",l),r.addEventListener("error",c);const d=(0,E.fu)(i,(()=>c((0,E.zE)())))}))))}_loadFromImage(e,t,r){const i=ye._getDataDimensions(t);this.params.width=i.width,this.params.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=3===this.params.components?X.VI.RGB:X.VI.RGBA,!this._requiresPowerOfTwo(e,o)||(0,z.wt)(i.width)&&(0,z.wt)(i.height)?(o.width=i.width,o.height=i.height,this._glTexture=new j.x(e,o,t),this._glTexture):(this._glTexture=this._makePowerOfTwoTexture(e,t,i,o,r),this._glTexture)}_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)};return r.then(i,i),r}_requiresPowerOfTwo(e,t){const r=X.e8.CLAMP_TO_EDGE,i="number"==typeof t.wrapMode?t.wrapMode===r:t.wrapMode.s===r&&t.wrapMode.t===r;return!(0,Oe.Z)(e.gl)&&(t.hasMipmap||!i)}_makePowerOfTwoTexture(e,t,r,i,o){const{width:n,height:a}=r,s=(0,z.Sf)(n),l=(0,z.Sf)(a);let c;switch(i.width=s,i.height=l,this.params.powerOfTwoResizeMode){case C.CE.PAD:i.textureCoordinateScaleFactor=[n/s,a/l],c=new j.x(e,i),c.updateData(0,0,0,n,a,t);break;case C.CE.STRETCH:case null:case void 0:c=this._stretchToPowerOfTwo(e,t,i,o());break;default:(0,B.Bg)(this.params.powerOfTwoResizeMode)}return i.hasMipmap&&c.generateMipmap(),c}_stretchToPowerOfTwo(e,t,r,i){const o=new j.x(e,r),n=new Ee(e,{colorTarget:X.Lm.TEXTURE,depthStencilTarget:X.OU.NONE},o),a=new j.x(e,{target:X.No.TEXTURE_2D,pixelFormat:r.pixelFormat,dataType:X.Br.UNSIGNED_BYTE,wrapMode:X.e8.CLAMP_TO_EDGE,samplingMode:X.cw.LINEAR,flipped:!!r.flipped,maxAnisotropy:8,preMultiplyAlpha:r.preMultiplyAlpha},t),s=function(e,t=fe,r=ue,i=-1,o=1){let n=null;return n=t===me?new Float32Array([i,i,0,0,o,i,1,0,i,o,0,1,o,o,1,1]):new Float32Array([i,i,o,i,i,o,o,o]),new xe(e,r,{geometry:t},{geometry:_e.createVertex(e,X.l1.STATIC_DRAW,n)})}(e),l=e.getBoundFramebufferObject();return this._drawStretchedTexture(e,i,n,s,a,o),this.requiresFrameUpdates?this._powerOfTwoStretchInfo={vao:s,sourceTexture:a,framebuffer:n}:(s.dispose(!0),a.dispose(),n.detachColorTexture(),n.dispose()),e.bindFramebuffer(l),o}_drawStretchedTexture(e,t,r,i,o,n){e.bindFramebuffer(r);const a=e.getViewport();e.setViewport(0,0,n.descriptor.width,n.descriptor.height);const s=t.program;e.useProgram(s),s.setUniform4f("color",1,1,1,1),s.bindTexture(o,"tex"),e.bindVAO(i),t.bindPipelineState(e),e.drawArrays(X.MX.TRIANGLE_STRIP,0,function(e,t){return e.vertexBuffers[t].size/function(e){return e[0].stride}(e.layout[t])}(i,"geometry")),e.bindFramebuffer(null),e.setViewport(a.x,a.y,a.width,a.height)}unload(){if((0,o.pC)(this._powerOfTwoStretchInfo)){const{framebuffer:e,vao:t,sourceTexture:r}=this._powerOfTwoStretchInfo;t.dispose(!0),r.dispose(),e.dispose(),this._glTexture=null,this._powerOfTwoStretchInfo=null}if((0,o.pC)(this._glTexture)&&(this._glTexture.dispose(),this._glTexture=null),(0,o.pC)(this._loadingController)){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}}ye.DDS_ENCODING="image/vnd-ms.dds",ye.KTX2_ENCODING="image/ktx2",ye.BASIS_ENCODING="image/x.basis",(Re=Ce||(Ce={}))[Re.HAVE_NOTHING=0]="HAVE_NOTHING",Re[Re.HAVE_METADATA=1]="HAVE_METADATA",Re[Re.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",Re[Re.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",Re[Re.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA";var Ne,we=r(64822),Pe=r(65576),De=r(18361),Ie=r(19419),Le=r(94124),Fe=r(37782);class He extends I{constructor(e,t){super(),this.type=w.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._insertOrder=0,this._vertexAttributeLocations=ue,this._parameters=(0,Fe.Uf)(e,t),this.validateParameters(this._parameters)}dispose(){}get parameters(){return this._parameters}update(e){return!1}setParameters(e){(0,Fe.LO)(this._parameters,e)&&(this.validateParameters(this._parameters),this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleInPass(e.pass)&&0!=(this.renderOccluded&e.renderOccludedMask)}isVisibleInPass(e){return!0}get renderOccluded(){return this.parameters.renderOccluded}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get insertOrder(){return this._insertOrder}set insertOrder(e){e!==this._insertOrder&&(this._insertOrder=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){(0,o.pC)(this.repository)&&this.repository.materialChanged(this)}}!function(e){e[e.Occlude=1]="Occlude",e[e.Transparent=2]="Transparent",e[e.OccludeAndTransparent=4]="OccludeAndTransparent",e[e.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",e[e.Opaque=16]="Opaque"}(Ne||(Ne={}));const Be={renderOccluded:Ne.Occlude};function Ue(e,t,r=X.db.ADD,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]}}}const ze={face:X.LR.BACK,mode:X.Wf.CCW},Ve={face:X.LR.FRONT,mode:X.Wf.CCW},Ge=e=>e===C.Vr.Back?ze:e===C.Vr.Front?Ve:null,We={zNear:0,zFar:1},ke={r:!0,g:!0,b:!0,a:!0};function qe(e){return tt.intern(e)}function $e(e){return it.intern(e)}function Xe(e){return nt.intern(e)}function je(e){return st.intern(e)}function Ye(e){return ct.intern(e)}function Ke(e){return ut.intern(e)}function Je(e){return ft.intern(e)}function Ze(e){return pt.intern(e)}class Qe{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)}}function et(e){return"["+e.join(",")+"]"}const tt=new Qe(rt,(e=>({__tag:"Blending",...e})));function rt(e){return e?et([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 it=new Qe(ot,(e=>({__tag:"Culling",...e})));function ot(e){return e?et([e.face,e.mode]):null}const nt=new Qe(at,(e=>({__tag:"PolygonOffset",...e})));function at(e){return e?et([e.factor,e.units]):null}const st=new Qe(lt,(e=>({__tag:"DepthTest",...e})));function lt(e){return e?et([e.func]):null}const ct=new Qe(dt,(e=>({__tag:"StencilTest",...e})));function dt(e){return e?et([e.function.func,e.function.ref,e.function.mask,e.operation.fail,e.operation.zFail,e.operation.zPass]):null}const ut=new Qe(ht,(e=>({__tag:"DepthWrite",...e})));function ht(e){return e?et([e.zNear,e.zFar]):null}const ft=new Qe(mt,(e=>({__tag:"ColorWrite",...e})));function mt(e){return e?et([e.r,e.g,e.b,e.a]):null}const pt=new Qe(vt,(e=>({__tag:"StencilWrite",...e})));function vt(e){return e?et([e.mask]):null}const gt=new Qe((function(e){return e?et([rt(e.blending),ot(e.culling),at(e.polygonOffset),lt(e.depthTest),dt(e.stencilTest),ht(e.depthWrite),mt(e.colorWrite),vt(e.stencilWrite)]):null}),(e=>({blending:qe(e.blending),culling:$e(e.culling),polygonOffset:Xe(e.polygonOffset),depthTest:je(e.depthTest),stencilTest:Ye(e.stencilTest),depthWrite:Ke(e.depthWrite),colorWrite:Je(e.colorWrite),stencilWrite:Ze(e.stencilWrite)}))),_t=function(e,t,r,i,o=X.db.ADD,n=X.db.ADD,a=[0,0,0,0]){return{srcRgb:e,srcAlpha:t,dstRgb:r,dstAlpha:i,opRgb:o,opAlpha:n,color:{r:a[0],g:a[1],b:a[2],a:a[3]}}}(X.zi.SRC_ALPHA,X.zi.ONE,X.zi.ONE_MINUS_SRC_ALPHA,X.zi.ONE_MINUS_SRC_ALPHA),Tt=Ue(X.zi.ONE,X.zi.ONE),xt=Ue(X.zi.ZERO,X.zi.ONE_MINUS_SRC_ALPHA);const bt={factor:-1,units:-2};function At(e){return e?bt:null}function Et(e){return e===C.Am.NONE||e===C.Am.FrontFace?X.wb.LESS:X.wb.LEQUAL}var St,Mt,Ct=r(50173),Rt=r(97995),Ot=r(51305),yt=r(94961),Nt=r(72119),wt=r(88669),Pt=r(98766);(Mt=St||(St={}))[Mt.X=0]="X",Mt[Mt.Y=1]="Y",Mt[Mt.Z=2]="Z",r(67676);var Dt=r(22807),It=r(12981);new Dt.x((function(){return{origin:null,direction:null}})),(0,d.c)(),(0,d.c)();const Lt=A.Z.getLogger("esri.geometry.support.sphere");function Ft(){return(0,wt.c)()}function Ht(e,t=Ft()){return(0,Pt.c)(t,e)}function Bt(e){return Array.isArray(e)?e[3]:e}function Ut(e){return Array.isArray(e)?e:jt}function zt(e,t,r){if((0,o.Wi)(t))return!1;const{origin:i,direction:n}=t,a=Vt;a[0]=i[0]-e[0],a[1]=i[1]-e[1],a[2]=i[2]-e[2];const s=n[0]*n[0]+n[1]*n[1]+n[2]*n[2],l=2*(n[0]*a[0]+n[1]*a[1]+n[2]*a[2]),c=l*l-4*s*(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]-e[3]*e[3]);if(c<0)return!1;const d=Math.sqrt(c);let u=(-l-d)/(2*s);const h=(-l+d)/(2*s);return(u<0||h<u&&h>0)&&(u=h),!(u<0||(r&&(r[0]=i[0]+n[0]*u,r[1]=i[1]+n[1]*u,r[2]=i[2]+n[2]*u),0))}const Vt=(0,d.c)();function Gt(e,t,r){const i=It.WM.get(),o=It.MP.get();(0,c.c)(i,t.origin,t.direction);const n=Bt(e);(0,c.c)(r,i,t.origin),(0,c.a)(r,r,1/(0,c.l)(r)*n);const a=kt(e,t.origin),l=function(e,t){const r=(0,c.d)(e,t)/((0,c.l)(e)*(0,c.l)(t));return-(0,z.ZF)(r)}(t.origin,r);return(0,s.d)(o,l+a,i),(0,c.m)(r,r,o),r}function Wt(e,t,r){const i=(0,c.f)(It.WM.get(),t,Ut(e)),o=(0,c.a)(It.WM.get(),i,e[3]/(0,c.l)(i));return(0,c.b)(r,o,Ut(e))}function kt(e,t){const r=(0,c.f)(It.WM.get(),t,Ut(e)),i=(0,c.l)(r),o=Bt(e),n=o+Math.abs(o-i);return(0,z.ZF)(o/n)}const qt=(0,d.c)();function $t(e,t,r,i){const o=(0,c.f)(qt,t,Ut(e));switch(r){case St.X:{const e=(0,z.jE)(o,qt)[2];return(0,c.s)(i,-Math.sin(e),Math.cos(e),0)}case St.Y:{const e=(0,z.jE)(o,qt),t=e[1],r=e[2],n=Math.sin(t);return(0,c.s)(i,-n*Math.cos(r),-n*Math.sin(r),Math.cos(t))}case St.Z:return(0,c.n)(i,o);default:return}}function Xt(e,t){const r=(0,c.f)(Yt,t,Ut(e));return(0,c.l)(r)-e[3]}const jt=(0,d.c)(),Yt=(0,d.c)();Object.freeze({__proto__:null,create:Ft,copy:Ht,fromCenterAndRadius:function(e,t){return(0,wt.f)(e[0],e[1],e[2],t)},wrap:function(e){return e},clear:function(e){e[0]=e[1]=e[2]=e[3]=0},fromRadius:function(e){return e},getRadius:Bt,getCenter:Ut,fromValues:function(e,t,r,i){return(0,wt.f)(e,t,r,i)},elevate:function(e,t,r){return e!==r&&(0,c.g)(r,e),r[3]=e[3]+t,r},setExtent:function(e,t,r){return Lt.error("sphere.setExtent is not yet supported"),e===r?r:Ht(e,r)},intersectRay:zt,intersectsRay:function(e,t){return zt(e,t,null)},intersectRayClosestSilhouette:function(e,t,r){if(zt(e,t,r))return r;const i=Gt(e,t,It.WM.get());return(0,c.b)(r,t.origin,(0,c.a)(It.WM.get(),t.direction,(0,c.i)(t.origin,i)/(0,c.l)(t.direction))),r},closestPointOnSilhouette:Gt,closestPoint:function(e,t,r){return zt(e,t,r)?r:(function(e,t,r){const i=(0,c.d)(e.direction,(0,c.f)(r,t,e.origin));(0,c.b)(r,e.origin,(0,c.a)(r,e.direction,i))}(t,Ut(e),r),Wt(e,r,r))},projectPoint:Wt,distanceToSilhouette:function(e,t){const r=(0,c.f)(It.WM.get(),t,Ut(e)),i=(0,c.p)(r),o=e[3]*e[3];return Math.sqrt(Math.abs(i-o))},angleToSilhouette:kt,axisAt:$t,altitudeAt:Xt,setAltitudeAt:function(e,t,r,i){const o=Xt(e,t),n=$t(e,t,St.Z,Yt),a=(0,c.a)(Yt,n,r-o);return(0,c.b)(i,t,a)}});const Kt=new class{constructor(e=0){this.offset=e,this.sphere=Ft(),this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=this.objectTransform.transform;let o=i[0]*e+i[4]*t+i[8]*r+i[12],n=i[1]*e+i[5]*t+i[9]*r+i[13],a=i[2]*e+i[6]*t+i[10]*r+i[14];const s=this.offset/Math.sqrt(o*o+n*n+a*a);o+=o*s,n+=n*s,a+=a*s;const l=this.objectTransform.inverse;return this.tmpVertex[0]=l[0]*o+l[4]*n+l[8]*a+l[12],this.tmpVertex[1]=l[1]*o+l[5]*n+l[9]*a+l[13],this.tmpVertex[2]=l[2]*o+l[6]*n+l[10]*a+l[14],this.tmpVertex}applyToMinMax(e,t){const r=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*r,e[1]+=e[1]*r,e[2]+=e[2]*r;const i=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]+=t[0]*i,t[1]+=t[1]*i,t[2]+=t[2]*i}applyToAabb(e){const t=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*t,e[1]+=e[1]*t,e[2]+=e[2]*t;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.sphere[0]=e[0]+e[0]*r,this.sphere[1]=e[1]+e[1]*r,this.sphere[2]=e[2]+e[2]*r,this.sphere[3]=e[3]+e[3]*this.offset/t,this.sphere}};new class{constructor(e=0){this.offset=e,this.componentLocalOriginLength=0,this.tmpVertex=(0,d.c)(),this.mbs=(0,wt.c)(),this.obb={center:(0,d.c)(),halfSize:(0,Nt.c)(),quaternion:null}}set localOrigin(e){this.componentLocalOriginLength=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])}applyToVertex(e,t,r){const i=e,o=t,n=r+this.componentLocalOriginLength,a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){const t=e[0],r=e[1],i=e[2]+this.componentLocalOriginLength,o=e[3],n=e[4],a=e[5]+this.componentLocalOriginLength,s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(o*o+n*n+a*a);return e[3]+=o*l,e[4]+=n*l,e[5]+=a*l,e}applyToMbs(e){const t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]),r=this.offset/t;return this.mbs[0]=e[0]+e[0]*r,this.mbs[1]=e[1]+e[1]*r,this.mbs[2]=e[2]+e[2]*r,this.mbs[3]=e[3]+e[3]*this.offset/t,this.mbs}applyToObb(e){const t=e.center,r=this.offset/Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.obb.center[0]=t[0]+t[0]*r,this.obb.center[1]=t[1]+t[1]*r,this.obb.center[2]=t[2]+t[2]*r,(0,c.q)(this.obb.halfSize,e.halfSize,e.quaternion),(0,c.b)(this.obb.halfSize,this.obb.halfSize,e.center);const i=this.offset/Math.sqrt(this.obb.halfSize[0]*this.obb.halfSize[0]+this.obb.halfSize[1]*this.obb.halfSize[1]+this.obb.halfSize[2]*this.obb.halfSize[2]);return this.obb.halfSize[0]+=this.obb.halfSize[0]*i,this.obb.halfSize[1]+=this.obb.halfSize[1]*i,this.obb.halfSize[2]+=this.obb.halfSize[2]*i,(0,c.f)(this.obb.halfSize,this.obb.halfSize,e.center),(0,Ot.c)(Jt,e.quaternion),(0,c.q)(this.obb.halfSize,this.obb.halfSize,Jt),this.obb.halfSize[0]*=this.obb.halfSize[0]<0?-1:1,this.obb.halfSize[1]*=this.obb.halfSize[1]<0?-1:1,this.obb.halfSize[2]*=this.obb.halfSize[2]<0?-1:1,this.obb.quaternion=e.quaternion,this.obb}},new class{constructor(e=0){this.offset=e,this.tmpVertex=(0,d.c)()}applyToVertex(e,t,r){const i=e+this.localOrigin[0],o=t+this.localOrigin[1],n=r+this.localOrigin[2],a=this.offset/Math.sqrt(i*i+o*o+n*n);return this.tmpVertex[0]=e+i*a,this.tmpVertex[1]=t+o*a,this.tmpVertex[2]=r+n*a,this.tmpVertex}applyToAabb(e){const t=e[0]+this.localOrigin[0],r=e[1]+this.localOrigin[1],i=e[2]+this.localOrigin[2],o=e[3]+this.localOrigin[0],n=e[4]+this.localOrigin[1],a=e[5]+this.localOrigin[2],s=this.offset/Math.sqrt(t*t+r*r+i*i);e[0]+=t*s,e[1]+=r*s,e[2]+=i*s;const l=this.offset/Math.sqrt(o*o+n*n+a*a);return e[3]+=o*l,e[4]+=n*l,e[5]+=a*l,e}};const Jt=(0,yt.a)();function Zt(e,t,r,i){const o=r.typedBuffer,n=r.typedBufferStride,a=e.length;i*=n;for(let r=0;r<a;++r){const a=2*e[r];o[i]=t[a],o[i+1]=t[a+1],i+=n}}function Qt(e,t,r,i,o){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,null==o||1===o)for(let r=0;r<s;++r){const o=3*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],i+=a}else for(let r=0;r<s;++r){const s=3*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],i+=a}}function er(e,t,r,i,o,n=1){if(!r)return void Qt(e,t,i,o,n);const a=i.typedBuffer,s=i.typedBufferStride,l=e.length,c=r[0],d=r[1],u=r[2],h=r[4],f=r[5],m=r[6],p=r[8],v=r[9],g=r[10],_=r[12],T=r[13],x=r[14];if(o*=s,1===n)for(let r=0;r<l;++r){const i=3*e[r],n=t[i],l=t[i+1],b=t[i+2];a[o]=c*n+h*l+p*b+_,a[o+1]=d*n+f*l+v*b+T,a[o+2]=u*n+m*l+g*b+x,o+=s}else for(let r=0;r<l;++r){const i=3*e[r],l=t[i],b=t[i+1],A=t[i+2],E=c*l+h*b+p*A+_,S=d*l+f*b+v*A+T,M=u*l+m*b+g*A+x;for(let e=0;e<n;++e)a[o]=E,a[o+1]=S,a[o+2]=M,o+=s}}function tr(e,t,r,i,o,n=1){if(!r)return void Qt(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],v=a[6],g=a[8],_=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=3*e[r],n=t[i],a=t[i+1],s=t[i+2];let d=u*n+m*a+g*s,E=h*n+p*a+_*s,S=f*n+v*a+T*s;if(x){const e=d*d+E*E+S*S;if(e<A&&e>b){const t=1/Math.sqrt(e);d*=t,E*=t,S*=t}}l[o+0]=d,l[o+1]=E,l[o+2]=S,o+=c}else for(let r=0;r<d;++r){const i=3*e[r],a=t[i],s=t[i+1],d=t[i+2];let E=u*a+m*s+g*d,S=h*a+p*s+_*d,M=f*a+v*s+T*d;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}for(let e=0;e<n;++e)l[o+0]=E,l[o+1]=S,l[o+2]=M,o+=c}}function rr(e,t,r,i,o,n=1){if(!r)return void function(e,t,r,i,o=1){const n=r.typedBuffer,a=r.typedBufferStride,s=e.length;if(i*=a,1===o)for(let r=0;r<s;++r){const o=4*e[r];n[i]=t[o],n[i+1]=t[o+1],n[i+2]=t[o+2],n[i+3]=t[o+3],i+=a}else for(let r=0;r<s;++r){const s=4*e[r];for(let e=0;e<o;++e)n[i]=t[s],n[i+1]=t[s+1],n[i+2]=t[s+2],n[i+3]=t[s+3],i+=a}}(e,t,i,o,n);const a=r,l=i.typedBuffer,c=i.typedBufferStride,d=e.length,u=a[0],h=a[1],f=a[2],m=a[4],p=a[5],v=a[6],g=a[8],_=a[9],T=a[10],x=!(0,s.p)(a),b=1e-6,A=1-b;if(o*=c,1===n)for(let r=0;r<d;++r){const i=4*e[r],n=t[i],a=t[i+1],s=t[i+2],d=t[i+3];let E=u*n+m*a+g*s,S=h*n+p*a+_*s,M=f*n+v*a+T*s;if(x){const e=E*E+S*S+M*M;if(e<A&&e>b){const t=1/Math.sqrt(e);E*=t,S*=t,M*=t}}l[o+0]=E,l[o+1]=S,l[o+2]=M,l[o+3]=d,o+=c}else for(let r=0;r<d;++r){const i=4*e[r],a=t[i],s=t[i+1],d=t[i+2],E=t[i+3];let S=u*a+m*s+g*d,M=h*a+p*s+_*d,C=f*a+v*s+T*d;if(x){const e=S*S+M*M+C*C;if(e<A&&e>b){const t=1/Math.sqrt(e);S*=t,M*=t,C*=t}}for(let e=0;e<n;++e)l[o+0]=S,l[o+1]=M,l[o+2]=C,l[o+3]=E,o+=c}}function ir(e,t,r,i,o,n=1){const a=i.typedBuffer,s=i.typedBufferStride,l=e.length;if(o*=s,1===n){if(4===r)for(let r=0;r<l;++r){const i=4*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}else if(4===r)for(let r=0;r<l;++r){const i=4*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=t[i+3],o+=s}else if(3===r)for(let r=0;r<l;++r){const i=3*e[r];for(let e=0;e<n;++e)a[o]=t[i],a[o+1]=t[i+1],a[o+2]=t[i+2],a[o+3]=255,o+=s}}var or=r(43697),nr=r(51546),ar=r(47624),sr=r(64267),lr=r(135),cr=r(92555),dr=r(68853),ur=r(42001),hr=r(85504),fr=r(72303),mr=r(98401),pr=r(89243);const vr=(0,r(10937).c)();class gr{constructor(e,t){this._module=e,this._loadModule=t}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}}function _r(e={}){return(t,r)=>{var i,o;t._parameterNames=null!=(i=t._parameterNames)?i:[],t._parameterNames.push(r);const n=t._parameterNames.length-1,a=e.count||2,s=Math.ceil(Math.log2(a)),l=null!=(o=t._parameterBits)?o:[0];let c=0;for(;l[c]+s>16;)c++,c>=l.length&&l.push(0);t._parameterBits=l;const d=l[c],u=(1<<s)-1<<d;l[c]+=s,Object.defineProperty(t,r,{get(){return this[n]},set(e){if(this[n]!==e&&(this[n]=e,this._keyDirty=!0,this._parameterBits[c]=this._parameterBits[c]&~u|+e<<d&u,"number"!=typeof e&&"boolean"!=typeof e))throw"Configuration value for "+r+" must be boolean or number, got "+typeof e}})}}class Tr{constructor(e,t,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new R.Z({deallocator:null}),this._glProgram=e.programCache.acquire(t.generateSource("vertex"),t.generateSource("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this._fragmentUniforms=(0,pe.hZ)()?t.fragmentUniforms.entries:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}setUniform1i(e,t){this._glProgram.setUniform1i(e,t)}setUniform1f(e,t){this._glProgram.setUniform1f(e,t)}setUniform1fv(e,t){this._glProgram.setUniform1fv(e,t)}setUniform1iv(e,t){this._glProgram.setUniform1iv(e,t)}setUniform2f(e,t,r){this._glProgram.setUniform2f(e,t,r)}setUniform2fv(e,t){this._glProgram.setUniform2fv(e,t)}setUniform2iv(e,t){this._glProgram.setUniform2iv(e,t)}setUniform3f(e,t,r,i){this._glProgram.setUniform3f(e,t,r,i)}setUniform3fv(e,t){this._glProgram.setUniform3fv(e,t)}setUniform3iv(e,t){this._glProgram.setUniform3iv(e,t)}setUniform4f(e,t,r,i,o){this._glProgram.setUniform4f(e,t,r,i,o)}setUniform4fv(e,t){this._glProgram.setUniform4fv(e,t)}setUniform4iv(e,t){this._glProgram.setUniform4iv(e,t)}setUniformMatrix3fv(e,t){this._glProgram.setUniformMatrix3fv(e,t)}setUniformMatrix4fv(e,t){this._glProgram.setUniformMatrix4fv(e,t)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,t){if((0,o.Wi)(e)||null==e.glName){const e=this._textures.get(t);return e&&(this._context.bindTexture(null,e.unit),this._freeTextureUnit(e),this._textures.delete(t)),null}let r=this._textures.get(t);return null==r?(r=this._allocTextureUnit(e),this._textures.set(t,r)):r.texture=e,this._context.useProgram(this),this.setUniform1i(t,r.unit),this._context.bindTexture(e,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach(((e,t)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(t,e.unit)})),(0,o.pC)(this._fragmentUniforms)&&this._fragmentUniforms.forEach((e=>{if(("sampler2D"===e.type||"samplerCube"===e.type)&&!this._textures.has(e.name))throw new Error(`Texture sampler ${e.name} has no bound texture`)}))}_allocTextureUnit(e){return{texture:e,unit:0===this._freeTextureUnits.length?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}}X.wb.LESS,X.wb.ALWAYS;const xr={mask:255},br={function:{func:X.wb.ALWAYS,ref:C.hU.OutlineVisualElementMask,mask:C.hU.OutlineVisualElementMask},operation:{fail:X.xS.KEEP,zFail:X.xS.KEEP,zPass:X.xS.ZERO}},Ar={function:{func:X.wb.ALWAYS,ref:C.hU.OutlineVisualElementMask,mask:C.hU.OutlineVisualElementMask},operation:{fail:X.xS.KEEP,zFail:X.xS.KEEP,zPass:X.xS.REPLACE}};X.wb.EQUAL,C.hU.OutlineVisualElementMask,C.hU.OutlineVisualElementMask,X.xS.KEEP,X.xS.KEEP,X.xS.KEEP,X.wb.NOTEQUAL,C.hU.OutlineVisualElementMask,C.hU.OutlineVisualElementMask,X.xS.KEEP,X.xS.KEEP,X.xS.KEEP;var Er=r(32078);class Sr extends class{constructor(e,t,r=(()=>this.dispose())){this.release=r,t&&(this._config=t.snapshot()),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e)}dispose(){this._program=(0,o.O3)(this._program),this._pipeline=this._config=null}reload(e){(0,o.O3)(this._program),this._program=this.initializeProgram(e)}get program(){return this._program}get key(){return this._config.key}get configuration(){return this._config}bindPass(e,t){}bindMaterial(e,t){}bindDraw(e){}bindPipelineState(e,t=null,r){e.setPipelineState(this.getPipelineState(t,r))}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return X.MX.TRIANGLES}getPipelineState(e,t){return this._pipeline}}{initializeProgram(e){const t=Sr.shader.get(),r=this.configuration,i=t.build({OITEnabled:r.transparencyPassType===C.Am.Color,output:r.output,viewingMode:e.viewingMode,receiveShadows:r.receiveShadows,slicePlaneEnabled:r.slicePlaneEnabled,sliceHighlightDisabled:r.sliceHighlightDisabled,sliceEnabledForVertexPrograms:!1,symbolColor:r.symbolColors,vvSize:r.vvSize,vvColor:r.vvColor,vvInstancingEnabled:!0,instanced:r.instanced,instancedColor:r.instancedColor,instancedDoublePrecision:r.instancedDoublePrecision,pbrMode:r.usePBR?r.isSchematic?hr.f7.Schematic:hr.f7.Normal:hr.f7.Disabled,hasMetalnessAndRoughnessTexture:r.hasMetalnessAndRoughnessTexture,hasEmissionTexture:r.hasEmissionTexture,hasOcclusionTexture:r.hasOcclusionTexture,hasNormalTexture:r.hasNormalTexture,hasColorTexture:r.hasColorTexture,receiveAmbientOcclusion:r.receiveAmbientOcclusion,useCustomDTRExponentForWater:!1,normalType:r.normalsTypeDerivate?sr.O.Type.ScreenDerivative:sr.O.Type.Attribute,doubleSidedMode:r.doubleSidedMode,vertexTangents:r.vertexTangents,attributeTextureCoordinates:r.hasMetalnessAndRoughnessTexture||r.hasEmissionTexture||r.hasOcclusionTexture||r.hasNormalTexture||r.hasColorTexture?lr.D.AttributeType.Default:lr.D.AttributeType.None,textureAlphaPremultiplied:r.textureAlphaPremultiplied,attributeColor:r.vertexColors,screenSizePerspectiveEnabled:r.screenSizePerspective,verticalOffsetEnabled:r.verticalOffset,offsetBackfaces:r.offsetBackfaces,doublePrecisionRequiresObfuscation:(0,pr.I)(e.rctx),alphaDiscardMode:r.alphaDiscardMode,supportsTextureAtlas:!1,multipassTerrainEnabled:r.multipassTerrainEnabled,cullAboveGround:r.cullAboveGround});return new Tr(e.rctx,i,ue)}bindPass(e,t){var r,i;!function(e,t){e.setUniformMatrix4fv("proj",t)}(this.program,t.camera.projectionMatrix);const o=this.configuration.output;(this.configuration.output===De.H.Depth||t.multipassTerrainEnabled||o===De.H.Shadow)&&this.program.setUniform2fv("cameraNearFar",t.camera.nearFar),t.multipassTerrainEnabled&&(this.program.setUniform2fv("inverseViewport",t.inverseViewport),(0,ur.p)(this.program,t)),o===De.H.Alpha&&(this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",Fe.FZ[e.colorMixMode])),o===De.H.Color?(t.lighting.setUniforms(this.program,!1),this.program.setUniform3fv("ambient",e.ambient),this.program.setUniform3fv("diffuse",e.diffuse),this.program.setUniform4fv("externalColor",e.externalColor),this.program.setUniform1i("colorMixMode",Fe.FZ[e.colorMixMode]),this.program.setUniform1f("opacity",e.opacity),this.program.setUniform1f("layerOpacity",e.layerOpacity),this.configuration.usePBR&&(0,hr.nW)(this.program,e,this.configuration.isSchematic)):o===De.H.Highlight&&(0,dr.wW)(this.program,t),(0,mr.uj)(this.program,e),(0,cr.Mo)(this.program,e,t),(0,Fe.bj)(e.screenSizePerspective,this.program,"screenSizePerspectiveAlignment"),e.textureAlphaMode!==C.JJ.Mask&&e.textureAlphaMode!==C.JJ.MaskBlend||this.program.setUniform1f("textureAlphaCutoff",e.textureAlphaCutoff),null==(r=t.shadowMap)||r.bind(this.program),null==(i=t.ssaoHelper)||i.bind(this.program,t.camera)}bindDraw(e){const t=this.configuration.instancedDoublePrecision?(0,d.f)(e.camera.viewInverseTransposeMatrix[3],e.camera.viewInverseTransposeMatrix[7],e.camera.viewInverseTransposeMatrix[11]):e.origin;(function(e,t,r){(0,s.j)(vr,r,t),e.setUniform3fv("localOrigin",t),e.setUniformMatrix4fv("view",vr)})(this.program,t,e.camera.viewMatrix),this.program.rebindTextures(),(this.configuration.output===De.H.Color||this.configuration.output===De.H.Alpha||this.configuration.output===De.H.Depth&&this.configuration.screenSizePerspective||this.configuration.output===De.H.Normal&&this.configuration.screenSizePerspective||this.configuration.output===De.H.Highlight&&this.configuration.screenSizePerspective)&&function(e,t,r){e.setUniform3f("camPos",r[3]-t[0],r[7]-t[1],r[11]-t[2])}(this.program,t,e.camera.viewInverseTransposeMatrix),this.configuration.output===De.H.Normal&&this.program.setUniformMatrix4fv("viewNormal",e.camera.viewInverseTransposeMatrix),this.configuration.instancedDoublePrecision&&(0,ar.d3)(this.program,t),(0,nr.Vv)(this.program,this.configuration,e.slicePlane,t),this.configuration.output===De.H.Color&&(0,fr.vL)(this.program,e,t)}_setPipeline(e,t){const r=this.configuration,i=e===C.Am.NONE,o=e===C.Am.FrontFace;return function(e){return gt.intern(e)}({blending:r.output!==De.H.Color&&r.output!==De.H.Alpha||!r.transparent?null:i?_t:(n=e,n===C.Am.FrontFace?null:n===C.Am.Alpha?xt:Tt),culling:Mr(r)&&Ge(r.cullFace),depthTest:{func:Et(e)},depthWrite:i||o?r.writeDepth&&We:null,colorWrite:ke,stencilWrite:r.sceneHasOcludees?xr:null,stencilTest:r.sceneHasOcludees?t?Ar:br:null,polygonOffset:i||o?null:At(r.enableOffset)});var n}initializePipeline(){return this._occludeePipelineState=this._setPipeline(this.configuration.transparencyPassType,!0),this._setPipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,t){return t?this._occludeePipelineState:super.getPipelineState(e,t)}}function Mr(e){return e.cullFace?e.cullFace!==C.Vr.None:!e.slicePlaneEnabled&&!e.transparent&&!e.doubleSidedMode}Sr.shader=new gr(Er.D,(()=>r.e(9291).then(r.bind(r,79291))));class Cr extends class{constructor(){this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map((()=>0)):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,t={key:this.key};for(const r of e)t[r]=this[r];return t}}{constructor(){super(...arguments),this.output=De.H.Color,this.alphaDiscardMode=C.JJ.Opaque,this.doubleSidedMode=Ie.k.DoubleSidedMode.None,this.isSchematic=!1,this.vertexColors=!1,this.offsetBackfaces=!1,this.symbolColors=!1,this.vvSize=!1,this.vvColor=!1,this.verticalOffset=!1,this.receiveShadows=!1,this.slicePlaneEnabled=!1,this.sliceHighlightDisabled=!1,this.receiveAmbientOcclusion=!1,this.screenSizePerspective=!1,this.textureAlphaPremultiplied=!1,this.hasColorTexture=!1,this.usePBR=!1,this.hasMetalnessAndRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.instanced=!1,this.instancedColor=!1,this.instancedDoublePrecision=!1,this.vertexTangents=!1,this.normalsTypeDerivate=!1,this.writeDepth=!0,this.sceneHasOcludees=!1,this.transparent=!1,this.enableOffset=!0,this.cullFace=C.Vr.None,this.transparencyPassType=C.Am.NONE,this.multipassTerrainEnabled=!1,this.cullAboveGround=!1}}(0,or._)([_r({count:De.H.COUNT})],Cr.prototype,"output",void 0),(0,or._)([_r({count:C.JJ.COUNT})],Cr.prototype,"alphaDiscardMode",void 0),(0,or._)([_r({count:Ie.k.DoubleSidedMode.COUNT})],Cr.prototype,"doubleSidedMode",void 0),(0,or._)([_r()],Cr.prototype,"isSchematic",void 0),(0,or._)([_r()],Cr.prototype,"vertexColors",void 0),(0,or._)([_r()],Cr.prototype,"offsetBackfaces",void 0),(0,or._)([_r()],Cr.prototype,"symbolColors",void 0),(0,or._)([_r()],Cr.prototype,"vvSize",void 0),(0,or._)([_r()],Cr.prototype,"vvColor",void 0),(0,or._)([_r()],Cr.prototype,"verticalOffset",void 0),(0,or._)([_r()],Cr.prototype,"receiveShadows",void 0),(0,or._)([_r()],Cr.prototype,"slicePlaneEnabled",void 0),(0,or._)([_r()],Cr.prototype,"sliceHighlightDisabled",void 0),(0,or._)([_r()],Cr.prototype,"receiveAmbientOcclusion",void 0),(0,or._)([_r()],Cr.prototype,"screenSizePerspective",void 0),(0,or._)([_r()],Cr.prototype,"textureAlphaPremultiplied",void 0),(0,or._)([_r()],Cr.prototype,"hasColorTexture",void 0),(0,or._)([_r()],Cr.prototype,"usePBR",void 0),(0,or._)([_r()],Cr.prototype,"hasMetalnessAndRoughnessTexture",void 0),(0,or._)([_r()],Cr.prototype,"hasEmissionTexture",void 0),(0,or._)([_r()],Cr.prototype,"hasOcclusionTexture",void 0),(0,or._)([_r()],Cr.prototype,"hasNormalTexture",void 0),(0,or._)([_r()],Cr.prototype,"instanced",void 0),(0,or._)([_r()],Cr.prototype,"instancedColor",void 0),(0,or._)([_r()],Cr.prototype,"instancedDoublePrecision",void 0),(0,or._)([_r()],Cr.prototype,"vertexTangents",void 0),(0,or._)([_r()],Cr.prototype,"normalsTypeDerivate",void 0),(0,or._)([_r()],Cr.prototype,"writeDepth",void 0),(0,or._)([_r()],Cr.prototype,"sceneHasOcludees",void 0),(0,or._)([_r()],Cr.prototype,"transparent",void 0),(0,or._)([_r()],Cr.prototype,"enableOffset",void 0),(0,or._)([_r({count:C.Vr.COUNT})],Cr.prototype,"cullFace",void 0),(0,or._)([_r({count:C.Am.COUNT})],Cr.prototype,"transparencyPassType",void 0),(0,or._)([_r()],Cr.prototype,"multipassTerrainEnabled",void 0),(0,or._)([_r()],Cr.prototype,"cullAboveGround",void 0);var Rr=r(41846);class Or extends Sr{initializeProgram(e){const t=Or.shader.get(),r=this.configuration,i=t.build({OITEnabled:r.transparencyPassType===C.Am.Color,output:r.output,viewingMode:e.viewingMode,receiveShadows:r.receiveShadows,slicePlaneEnabled:r.slicePlaneEnabled,sliceHighlightDisabled:r.sliceHighlightDisabled,sliceEnabledForVertexPrograms:!1,symbolColor:r.symbolColors,vvSize:r.vvSize,vvColor:r.vvColor,vvInstancingEnabled:!0,instanced:r.instanced,instancedColor:r.instancedColor,instancedDoublePrecision:r.instancedDoublePrecision,pbrMode:r.usePBR?hr.f7.Normal:hr.f7.Disabled,hasMetalnessAndRoughnessTexture:!1,hasEmissionTexture:!1,hasOcclusionTexture:!1,hasNormalTexture:!1,hasColorTexture:r.hasColorTexture,receiveAmbientOcclusion:r.receiveAmbientOcclusion,useCustomDTRExponentForWater:!1,normalType:sr.O.Type.Attribute,doubleSidedMode:Ie.k.DoubleSidedMode.WindingOrder,vertexTangents:!1,attributeTextureCoordinates:r.hasColorTexture?lr.D.AttributeType.Default:lr.D.AttributeType.None,textureAlphaPremultiplied:r.textureAlphaPremultiplied,attributeColor:r.vertexColors,screenSizePerspectiveEnabled:r.screenSizePerspective,verticalOffsetEnabled:r.verticalOffset,offsetBackfaces:r.offsetBackfaces,doublePrecisionRequiresObfuscation:(0,pr.I)(e.rctx),alphaDiscardMode:r.alphaDiscardMode,supportsTextureAtlas:!1,multipassTerrainEnabled:r.multipassTerrainEnabled,cullAboveGround:r.cullAboveGround});return new Tr(e.rctx,i,ue)}}Or.shader=new gr(Rr.R,(()=>r.e(8625).then(r.bind(r,28625))));class yr extends He{constructor(e){super(e,wr),this.supportsEdges=!0,this.techniqueConfig=new Cr,this.vertexBufferLayout=function(e){const t=e.textureId||e.normalTextureId||e.metallicRoughnessTextureId||e.emissiveTextureId||e.occlusionTextureId,r=(0,Pe.U$)().vec3f(C.T.POSITION).vec3f(C.T.NORMAL);return e.vertexTangents&&r.vec4f(C.T.TANGENT),t&&r.vec2f(C.T.UV0),e.vertexColors&&r.vec4u8(C.T.COLOR),e.symbolColors&&r.vec4u8(C.T.SYMBOLCOLOR),r}(this.parameters),this.instanceBufferLayout=e.instanced?function(e){let t=(0,Pe.U$)();return t=e.instancedDoublePrecision?t.vec3f(C.T.MODELORIGINHI).vec3f(C.T.MODELORIGINLO).mat3f(C.T.MODEL).mat3f(C.T.MODELNORMAL):t.mat4f(C.T.MODEL).mat4f(C.T.MODELNORMAL),e.instanced&&e.instanced.indexOf("color")>-1&&(t=t.vec4f(C.T.INSTANCECOLOR)),e.instanced&&e.instanced.indexOf("featureAttribute")>-1&&(t=t.vec4f(C.T.INSTANCEFEATUREATTRIBUTE)),t}(this.parameters):null}isVisibleInPass(e){return e!==Ct.C.MATERIAL_DEPTH_SHADOWMAP_ALL&&e!==Ct.C.MATERIAL_DEPTH_SHADOWMAP_DEFAULT&&e!==Ct.C.MATERIAL_DEPTH_SHADOWMAP_HIGHLIGHT||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||0===e.layerOpacity)return!1;const t=e.instanced,r=e.vertexColors,i=e.symbolColors,o=!!t&&t.indexOf("color")>-1,n=e.vvColorEnabled,a="replace"===e.colorMixMode,s=e.opacity>0,l=e.externalColor&&e.externalColor[3]>0;return r&&(o||n||i)?!!a||s:r?a?l:s:o||n||i?!!a||s:a?l:s}getTechniqueConfig(e,t){return this.techniqueConfig.output=e,this.techniqueConfig.hasNormalTexture=!!this.parameters.normalTextureId,this.techniqueConfig.hasColorTexture=!!this.parameters.textureId,this.techniqueConfig.vertexTangents=this.parameters.vertexTangents,this.techniqueConfig.instanced=!!this.parameters.instanced,this.techniqueConfig.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this.techniqueConfig.vvSize=this.parameters.vvSizeEnabled,this.techniqueConfig.verticalOffset=null!==this.parameters.verticalOffset,this.techniqueConfig.screenSizePerspective=null!==this.parameters.screenSizePerspective,this.techniqueConfig.slicePlaneEnabled=this.parameters.slicePlaneEnabled,this.techniqueConfig.sliceHighlightDisabled=this.parameters.sliceHighlightDisabled,this.techniqueConfig.alphaDiscardMode=this.parameters.textureAlphaMode,this.techniqueConfig.normalsTypeDerivate="screenDerivative"===this.parameters.normals,this.techniqueConfig.transparent=this.parameters.transparent,this.techniqueConfig.writeDepth=this.parameters.writeDepth,this.techniqueConfig.sceneHasOcludees=this.parameters.sceneHasOcludees,this.techniqueConfig.cullFace=this.parameters.slicePlaneEnabled?C.Vr.None:this.parameters.cullFace,this.techniqueConfig.multipassTerrainEnabled=t.multipassTerrainEnabled,this.techniqueConfig.cullAboveGround=t.cullAboveGround,e!==De.H.Color&&e!==De.H.Alpha||(this.techniqueConfig.vertexColors=this.parameters.vertexColors,this.techniqueConfig.symbolColors=this.parameters.symbolColors,this.parameters.treeRendering?this.techniqueConfig.doubleSidedMode=Ie.k.DoubleSidedMode.WindingOrder:this.techniqueConfig.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?Ie.k.DoubleSidedMode.View:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?Ie.k.DoubleSidedMode.WindingOrder:Ie.k.DoubleSidedMode.None,this.techniqueConfig.instancedColor=!!this.parameters.instanced&&this.parameters.instanced.indexOf("color")>-1,this.techniqueConfig.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this.techniqueConfig.receiveAmbientOcclusion=!!t.ssaoEnabled&&this.parameters.receiveSSAO,this.techniqueConfig.vvColor=this.parameters.vvColorEnabled,this.techniqueConfig.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this.techniqueConfig.usePBR=this.parameters.usePBR,this.techniqueConfig.hasMetalnessAndRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this.techniqueConfig.hasEmissionTexture=!!this.parameters.emissiveTextureId,this.techniqueConfig.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this.techniqueConfig.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this.techniqueConfig.isSchematic=this.parameters.usePBR&&this.parameters.isSchematic,this.techniqueConfig.transparencyPassType=t.transparencyPassType,this.techniqueConfig.enableOffset=t.camera.relativeElevation<5e5),this.techniqueConfig}intersect(e,t,r,i,n,a,s){if(null!==this.parameters.verticalOffset){const e=i.camera;(0,c.s)(Br,r[12],r[13],r[14]);let t=null;switch(i.viewingMode){case we.JY.Global:t=(0,c.n)(Fr,Br);break;case we.JY.Local:t=(0,c.g)(Fr,Lr)}let o=0;if(null!==this.parameters.verticalOffset){const r=(0,c.f)(Ur,Br,e.eye),i=(0,c.l)(r),n=(0,c.a)(r,r,1/i);let a=null;this.parameters.screenSizePerspective&&(a=(0,c.d)(t,n)),o+=(0,Fe.Hx)(e,i,this.parameters.verticalOffset,a,this.parameters.screenSizePerspective)}(0,c.a)(t,t,o),(0,c.t)(Hr,t,i.transform.inverseRotation),n=(0,c.f)(Dr,n,Hr),a=(0,c.f)(Ir,a,Hr)}var l;(0,Fe.Bw)(e,t,i,n,a,(l=i.verticalOffset,(0,o.pC)(l)?(Kt.offset=l,Kt):null),s)}requiresSlot(e){return e===(this.parameters.transparent?this.parameters.writeDepth?Rt.r.TRANSPARENT_MATERIAL:Rt.r.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:Rt.r.OPAQUE_MATERIAL)||e===Rt.r.DRAPED_MATERIAL}createGLMaterial(e){return e.output===De.H.Color||e.output===De.H.Alpha||e.output===De.H.Depth||e.output===De.H.Normal||e.output===De.H.Shadow||e.output===De.H.Highlight?new Nr(e):null}createBufferWriter(){return new Pr(this.vertexBufferLayout,this.instanceBufferLayout)}}class Nr extends class extends class{constructor(e){this._material=e.material,this._techniqueRep=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRep.release(this._technique)}get technique(){return this._technique}ensureTechnique(e,t,r=this._output){return this._technique=this._techniqueRep.releaseAndAcquire(e,this._material.getTechniqueConfig(r,t),this._technique),this._technique}ensureResources(e){return C.Rw.LOADED}}{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRep,this._textureId=e.textureId,this._acquire(e.textureId,(e=>this._texture=e)),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(){this._texture=(0,o.RY)(this._texture),this._textureNormal=(0,o.RY)(this._textureNormal),this._textureEmissive=(0,o.RY)(this._textureEmissive),this._textureOcclusion=(0,o.RY)(this._textureOcclusion),this._textureMetallicRoughness=(0,o.RY)(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return 0===this._numLoading?C.Rw.LOADED:C.Rw.LOADING}updateTexture(e){((0,o.Wi)(this._texture)||e!==this._texture.id)&&(this._texture=(0,o.RY)(this._texture),this._textureId=e,this._acquire(this._textureId,(e=>this._texture=e)))}bindTextures(e){(0,o.pC)(this._texture)&&e.bindTexture(this._texture.glTexture,"tex"),(0,o.pC)(this._textureNormal)&&e.bindTexture(this._textureNormal.glTexture,"normalTexture"),(0,o.pC)(this._textureEmissive)&&e.bindTexture(this._textureEmissive.glTexture,"texEmission"),(0,o.pC)(this._textureOcclusion)&&e.bindTexture(this._textureOcclusion.glTexture,"texOcclusion"),(0,o.pC)(this._textureMetallicRoughness)&&e.bindTexture(this._textureMetallicRoughness.glTexture,"texMetallicRoughness")}bindTextureScale(e){const t=(0,o.pC)(this._texture)?this._texture.glTexture:null;(0,o.pC)(t)&&t.descriptor.textureCoordinateScaleFactor?e.setUniform2fv("textureCoordinateScaleFactor",t.descriptor.textureCoordinateScaleFactor):e.setUniform2f("textureCoordinateScaleFactor",1,1)}_acquire(e,t){if((0,o.Wi)(e))return void t(null);const r=this._textureRepository.acquire(e);if((0,E.y8)(r))return++this._numLoading,void r.then((e=>{if(this._disposed)return(0,o.RY)(e),void t(null);t(e)})).finally((()=>--this._numLoading));t(r)}}{constructor(e){super({...e,...e.material.parameters})}updateParameters(e){const t=this._material.parameters;return this.updateTexture(t.textureId),this.ensureTechnique(t.treeRendering?Or:Sr,e)}_updateShadowState(e){e.shadowMappingEnabled!==this._material.parameters.shadowMappingEnabled&&this._material.setParameters({shadowMappingEnabled:e.shadowMappingEnabled})}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.sceneHasOcludees&&this._material.setParameters({sceneHasOcludees:e.hasOccludees})}beginSlot(e){return this._output!==De.H.Color&&this._output!==De.H.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this.updateParameters(e)}bind(e,t){t.bindPass(this._material.parameters,e),this.bindTextures(t.program)}}const wr={textureId:void 0,initTextureTransparent:!1,isSchematic:!1,usePBR:!1,normalTextureId:void 0,vertexTangents:!1,occlusionTextureId:void 0,emissiveTextureId:void 0,metallicRoughnessTextureId:void 0,emissiveFactor:[0,0,0],mrrFactors:[0,1,.5],ambient:[.2,.2,.2],diffuse:[.8,.8,.8],externalColor:[1,1,1,1],colorMixMode:"multiply",opacity:1,layerOpacity:1,vertexColors:!1,symbolColors:!1,doubleSided:!1,doubleSidedType:"normal",cullFace:C.Vr.Back,instanced:void 0,instancedDoublePrecision:!1,normals:"default",receiveSSAO:!0,receiveShadows:!0,castShadows:!0,shadowMappingEnabled:!1,verticalOffset:null,screenSizePerspective:null,slicePlaneEnabled:!1,sliceHighlightDisabled:!1,offsetTransparentBackfaces:!1,vvSizeEnabled:!1,vvSizeMinSize:[1,1,1],vvSizeMaxSize:[100,100,100],vvSizeOffset:[0,0,0],vvSizeFactor:[1,1,1],vvSizeValue:[1,1,1],vvColorEnabled:!1,vvColorValues:[0,0,0,0,0,0,0,0],vvColorColors:[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],vvSymbolAnchor:[0,0,0],vvSymbolRotationMatrix:(0,a.c)(),transparent:!1,writeDepth:!0,textureAlphaMode:C.JJ.Blend,textureAlphaCutoff:Le.F,textureAlphaPremultiplied:!1,sceneHasOcludees:!1,...Be};class Pr{constructor(e,t){this.vertexBufferLayout=e,this.instanceBufferLayout=t}allocate(e){return this.vertexBufferLayout.createBuffer(e)}elementCount(e){return e.indices.get(C.T.POSITION).length}write(e,t,r,i){!function(e,t,r,i,o,n){for(const a of t.fieldNames){const t=e.vertexAttributes.get(a),s=e.indices.get(a);if(t&&s)switch(a){case C.T.POSITION:{(0,O.hu)(3===t.size);const e=o.getField(a,h.ct);e&&er(s,t.data,r,e,n);break}case C.T.NORMAL:{(0,O.hu)(3===t.size);const e=o.getField(a,h.ct);e&&tr(s,t.data,i,e,n);break}case C.T.UV0:{(0,O.hu)(2===t.size);const e=o.getField(a,h.Eu);e&&Zt(s,t.data,e,n);break}case C.T.COLOR:{(0,O.hu)(3===t.size||4===t.size);const e=o.getField(a,h.mc);e&&ir(s,t.data,t.size,e,n);break}case C.T.SYMBOLCOLOR:{(0,O.hu)(3===t.size||4===t.size);const e=o.getField(a,h.mc);e&&ir(s,t.data,t.size,e,n);break}case C.T.TANGENT:{(0,O.hu)(4===t.size);const e=o.getField(a,h.ek);e&&rr(s,t.data,i,e,n);break}}}}(t,this.vertexBufferLayout,e.transformation,e.invTranspTransformation,r,i)}}const Dr=(0,d.c)(),Ir=(0,d.c)(),Lr=(0,d.f)(0,0,1),Fr=(0,d.c)(),Hr=(0,d.c)(),Br=(0,d.c)(),Ur=(0,d.c)(),zr=A.Z.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");function Vr(e){throw new b.Z("",`Request for object resource failed: ${e}`)}function Gr(e){const t=e.params,r=t.topology;let i=!0;switch(t.vertexAttributes||(zr.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&&t.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(zr.warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),i=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(zr.warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),i=!1)):(zr.warn(`Indexed geometry does not specify face indices for '${r}' attribute`),i=!1)}}else zr.warn("Indexed geometries must specify faces"),i=!1;break}default:zr.warn(`Unsupported topology '${r}'`),i=!1}e.params.material||(zr.warn("Geometry requires material"),i=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(zr.warn("Geometries with externally defined attributes are not yet supported"),i=!1);return i}function Wr(e){const t=(0,u.cS)();return e.forEach((e=>{const r=e.boundingInfo;(0,o.pC)(r)&&((0,u.pp)(t,r.getBBMin()),(0,u.pp)(t,r.getBBMax()))})),t}async function kr(e,t){const r=[];for(const i in e){const n=e[i],a=n.images[0].data;if(!a){zr.warn("Externally referenced texture data is not yet supported");continue}const s=n.encoding+";base64,"+a,l="/textureDefinitions/"+i,c="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",d={noUnpackFlip:!0,wrap:{s:X.e8.REPEAT,t:X.e8.REPEAT},preMultiplyAlpha:qr(c)!==C.JJ.Opaque},u=(0,o.pC)(t)&&t.disableTextures?Promise.resolve(null):M(s,t);r.push(u.then((e=>({refId:l,image:e,params:d,alphaChannelUsage:c}))))}const i=await Promise.all(r),n={};for(const e of i)n[e.refId]=e;return n}function qr(e){switch(e){case"mask":return C.JJ.Mask;case"maskAndTransparency":return C.JJ.MaskBlend;case"none":return C.JJ.Opaque;default:return C.JJ.Blend}}function $r(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Xr=new S.G(1,2,"wosr");var jr=r(57758),Yr=r(10816),Kr=r(75488),Jr=r(56067);async function Zr(e,t){const r=Qr((0,i.pJ)(e));if("wosr"===r.fileType){const e=await(t.cache?t.cache.loadWOSR(r.url,t):async function(e,t){const r=await async function(e,t){const r=(0,o.pC)(t)&&t.streamDataRequester;if(r)return async function(e,t,r){const i=await(0,x.q6)(t.request(e,"json",r));if(!0===i.ok)return i.value;(0,E.r9)(i.error),Vr(i.error.details.url)}(e,r,t);const i=await(0,x.q6)((0,T.default)(e,(0,o.Wg)(t)));if(!0===i.ok)return i.value.data;(0,E.r9)(i.error),Vr(i.error)}(e,t);return{resource:r,textures:await kr(r.textureDefinitions,t)}}(r.url,t)),i=function(e,t){const r=[],i=[],n=[],a=[],s=e.resource,l=S.G.parse(s.version||"1.0","wosr");Xr.validate(l);const c=s.model.name,u=s.model.geometries,h=s.materialDefinitions,f=e.textures;let m=0;const p=new Map;for(let e=0;e<u.length;e++){const s=u[e];if(!Gr(s))continue;const l=$r(s),c=s.params.vertexAttributes,v=[];for(const e in c){const t=c[e],r=t.values;v.push([e,{data:r,size:t.valuesPerElement,exclusive:!0}])}const g=[];if("PerAttributeArray"!==s.params.topology){const e=s.params.faces;for(const t in e)g.push([t,new Uint32Array(e[t].values)])}const _=f&&f[l.texture];if(_&&!p.has(l.texture)){const{image:e,params:t}=_,r=new ye(e,t);a.push(r),p.set(l.texture,r)}const T=p.get(l.texture),x=T?T.id:void 0;let b=n[l.material]?n[l.material][l.texture]:null;if(!b){const e=h[l.material.substring(l.material.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=_&&_.alphaChannelUsage,i=e.transparency>0||"transparency"===r||"maskAndTransparency"===r,a=_?qr(_.alphaChannelUsage):void 0,s={ambient:(0,d.d)(e.diffuse),diffuse:(0,d.d)(e.diffuse),opacity:1-(e.transparency||0),transparent:i,textureAlphaMode:a,textureAlphaCutoff:.33,textureId:x,initTextureTransparent:!0,doubleSided:!0,cullFace:C.Vr.None,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:!!_&&!!_.params.preMultiplyAlpha};(0,o.pC)(t)&&t.materialParamsMixin&&Object.assign(s,t.materialParamsMixin),b=new yr(s),n[l.material]||(n[l.material]={}),n[l.material][l.texture]=b}i.push(b);const A=new F(v,g);m+=g.position?g.position.length:0,r.push(A)}return{name:c,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:s.model.pivotOffset,boundingBox:Wr(r),numberOfVertices:m,lodThreshold:null}}(e,t);return{lods:[i],referenceBoundingBox:i.boundingBox,isEsriSymbolResource:!1,isWosr:!0,remove:e.remove}}const n=await(t.cache?t.cache.loadGLTF(r.url,t,t.usePBR):(0,g.z)(new v.C(t.streamDataRequester),r.url,t,t.usePBR)),a=(0,o.U2)(n.model.meta,"ESRI_proxyEllipsoid");n.meta.isEsriSymbolResource&&(0,o.pC)(a)&&-1!==n.meta.uri.indexOf("/RealisticTrees/")&&function(e,t){for(let r=0;r<e.model.lods.length;++r){const i=e.model.lods[r];e.customMeta.esriTreeRendering=!0;for(const n of i.parts){const i=n.attributes.normal;if((0,o.Wi)(i))return;const a=n.attributes.position,u=a.count,f=(0,d.c)(),m=(0,d.c)(),v=(0,d.c)(),g=(0,p.gS)(h.mc,u),_=(0,p.gS)(h.ct,u),T=(0,s.a)((0,l.c)(),n.transform);for(let o=0;o<u;o++){a.getVec(o,m),i.getVec(o,f),(0,c.m)(m,m,n.transform),(0,c.f)(v,m,t.center),(0,c.E)(v,v,t.radius);const s=v[2],l=(0,c.l)(v),d=Math.min(.45+.55*l*l,1);(0,c.E)(v,v,t.radius),(0,c.m)(v,v,T),(0,c.n)(v,v),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,c.e)(v,v,f,s>-1?.2:Math.min(-4*s-3.8,1)),_.setVec(o,v),g.set(o,0,255*d),g.set(o,1,255*d),g.set(o,2,255*d),g.set(o,3,255)}n.attributes.normal=_,n.attributes.color=g}}}(n,a);const u=n.meta.isEsriSymbolResource?{usePBR:t.usePBR,isSchematic:!1,treeRendering:n.customMeta.esriTreeRendering,mrrFactors:[0,1,.2]}:{usePBR:t.usePBR,isSchematic:!1,mrrFactors:[0,1,.5]},f={...t.materialParamsMixin,treeRendering:n.customMeta.esriTreeRendering};if(null!=r.specifiedLodIndex){const e=ei(n,u,f,r.specifiedLodIndex);let t=e[0].boundingBox;return 0!==r.specifiedLodIndex&&(t=ei(n,u,f,0)[0].boundingBox),{lods:e,referenceBoundingBox:t,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1,remove:n.remove}}const m=ei(n,u,f);return{lods:m,referenceBoundingBox:m[0].boundingBox,isEsriSymbolResource:n.meta.isEsriSymbolResource,isWosr:!1,remove:n.remove}}function Qr(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}}function ei(e,t,r,i){const s=e.model,l=(0,a.c)(),c=new Array,d=new Map,v=new Map;return s.lods.forEach(((e,a)=>{if(void 0!==i&&a!==i)return;const g={name:e.name,stageResources:{textures:new Array,materials:new Array,geometries:new Array},lodThreshold:(0,o.pC)(e.lodThreshold)?e.lodThreshold:null,pivotOffset:[0,0,0],numberOfVertices:0,boundingBox:(0,u.cS)()};c.push(g),e.parts.forEach((e=>{const i=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),a=s.materials.get(e.material),c=(0,o.pC)(e.attributes.texCoord0),T=(0,o.pC)(e.attributes.normal),x=function(e){switch(e){case"BLEND":return C.JJ.Blend;case"MASK":return C.JJ.Mask;case"OPAQUE":case null:case void 0:return C.JJ.Opaque}}(a.alphaMode);if(!d.has(i)){if(c){if((0,o.pC)(a.textureColor)&&!v.has(a.textureColor)){const e=s.textures.get(a.textureColor),t={...e.parameters,preMultiplyAlpha:x!==C.JJ.Opaque};v.set(a.textureColor,new ye(e.data,t))}if((0,o.pC)(a.textureNormal)&&!v.has(a.textureNormal)){const e=s.textures.get(a.textureNormal);v.set(a.textureNormal,new ye(e.data,e.parameters))}if((0,o.pC)(a.textureOcclusion)&&!v.has(a.textureOcclusion)){const e=s.textures.get(a.textureOcclusion);v.set(a.textureOcclusion,new ye(e.data,e.parameters))}if((0,o.pC)(a.textureEmissive)&&!v.has(a.textureEmissive)){const e=s.textures.get(a.textureEmissive);v.set(a.textureEmissive,new ye(e.data,e.parameters))}if((0,o.pC)(a.textureMetallicRoughness)&&!v.has(a.textureMetallicRoughness)){const e=s.textures.get(a.textureMetallicRoughness);v.set(a.textureMetallicRoughness,new ye(e.data,e.parameters))}}const n=a.color[0]**(1/jr.K),l=a.color[1]**(1/jr.K),u=a.color[2]**(1/jr.K),h=a.emissiveFactor[0]**(1/jr.K),f=a.emissiveFactor[1]**(1/jr.K),m=a.emissiveFactor[2]**(1/jr.K),p=(0,o.pC)(a.textureColor)&&c?v.get(a.textureColor):null;d.set(i,new yr({...t,transparent:x===C.JJ.Blend,textureAlphaMode:x,textureAlphaCutoff:a.alphaCutoff,diffuse:[n,l,u],ambient:[n,l,u],opacity:a.opacity,doubleSided:a.doubleSided,doubleSidedType:"winding-order",cullFace:a.doubleSided?C.Vr.None:C.Vr.Back,vertexColors:!!e.attributes.color,vertexTangents:!!e.attributes.tangent,normals:T?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:(0,o.pC)(p)?p.id:void 0,colorMixMode:a.colorMixMode,normalTextureId:(0,o.pC)(a.textureNormal)&&c?v.get(a.textureNormal).id:void 0,textureAlphaPremultiplied:(0,o.pC)(p)&&!!p.params.preMultiplyAlpha,occlusionTextureId:(0,o.pC)(a.textureOcclusion)&&c?v.get(a.textureOcclusion).id:void 0,emissiveTextureId:(0,o.pC)(a.textureEmissive)&&c?v.get(a.textureEmissive).id:void 0,metallicRoughnessTextureId:(0,o.pC)(a.textureMetallicRoughness)&&c?v.get(a.textureMetallicRoughness).id:void 0,emissiveFactor:[h,f,m],mrrFactors:[a.metallicFactor,a.roughnessFactor,t.mrrFactors[2]],isSchematic:!1,...r}))}const b=function(e,t){switch(t){case X.MX.TRIANGLES:return(0,_.nh)(e);case X.MX.TRIANGLE_STRIP:return(0,_.DA)(e);case X.MX.TRIANGLE_FAN:return(0,_.jX)(e)}}(e.indices||e.attributes.position.count,e.primitiveType),A=e.attributes.position.count,E=(0,p.gS)(h.ct,A);(0,f.t)(E,e.attributes.position,e.transform);const S=[[C.T.POSITION,{data:E.typedBuffer,size:E.elementCount,exclusive:!0}]],M=[[C.T.POSITION,b]];if((0,o.pC)(e.attributes.normal)){const t=(0,p.gS)(h.ct,A);(0,n.a)(l,e.transform),(0,f.a)(t,e.attributes.normal,l),S.push([C.T.NORMAL,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([C.T.NORMAL,b])}if((0,o.pC)(e.attributes.tangent)){const t=(0,p.gS)(h.ek,A);(0,n.a)(l,e.transform),(0,m.t)(t,e.attributes.tangent,l),S.push([C.T.TANGENT,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([C.T.TANGENT,b])}if((0,o.pC)(e.attributes.texCoord0)){const t=(0,p.gS)(h.Eu,A);(0,Yr.n)(t,e.attributes.texCoord0),S.push([C.T.UV0,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([C.T.UV0,b])}if((0,o.pC)(e.attributes.color)){const t=(0,p.gS)(h.mc,A);if(4===e.attributes.color.elementCount)e.attributes.color instanceof h.ek?(0,m.s)(t,e.attributes.color,255):e.attributes.color instanceof h.mc?(0,Kr.c)(t,e.attributes.color):e.attributes.color instanceof h.v6&&(0,m.s)(t,e.attributes.color,1/256);else{(0,Kr.f)(t,255,255,255,255);const r=new h.ne(t.buffer,0,4);e.attributes.color instanceof h.ct?(0,f.s)(r,e.attributes.color,255):e.attributes.color instanceof h.ne?(0,Jr.c)(r,e.attributes.color):e.attributes.color instanceof h.mw&&(0,f.s)(r,e.attributes.color,1/256)}S.push([C.T.COLOR,{data:t.typedBuffer,size:t.elementCount,exclusive:!0}]),M.push([C.T.COLOR,b])}const R=new F(S,M);g.stageResources.geometries.push(R),g.stageResources.materials.push(d.get(i)),c&&((0,o.pC)(a.textureColor)&&g.stageResources.textures.push(v.get(a.textureColor)),(0,o.pC)(a.textureNormal)&&g.stageResources.textures.push(v.get(a.textureNormal)),(0,o.pC)(a.textureOcclusion)&&g.stageResources.textures.push(v.get(a.textureOcclusion)),(0,o.pC)(a.textureEmissive)&&g.stageResources.textures.push(v.get(a.textureEmissive)),(0,o.pC)(a.textureMetallicRoughness)&&g.stageResources.textures.push(v.get(a.textureMetallicRoughness))),g.numberOfVertices+=A;const O=R.boundingInfo;(0,o.pC)(O)&&((0,u.pp)(g.boundingBox,O.getBBMin()),(0,u.pp)(g.boundingBox,O.getBBMax()))}))})),c}},6206:(e,t,r)=>{var i,o;r.d(t,{a9:()=>i}),r(22021),(o=i||(i={}))[o.Multiply=1]="Multiply",o[o.Ignore=2]="Ignore",o[o.Replace=3]="Replace",o[o.Tint=4]="Tint"},65576:(e,t,r)=>{r.d(t,{U$:()=>s});var i=r(56481),o=r(79583);class n{constructor(e,t){this.layout=e,this.buffer="number"==typeof t?new ArrayBuffer(t*e.stride):t;for(const t of e.fieldNames){const r=e.fields.get(t);this[t]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const r=this[e];return r&&r.elementCount===t.ElementCount&&r.elementType===t.ElementType?r:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,r,i){const o=this.stride;if(o%4==0){const n=new Uint32Array(e.buffer,t*o,i*o/4);new Uint32Array(this.buffer,r*o,i*o/4).set(n)}else{const n=new Uint8Array(e.buffer,t*o,i*o);new Uint8Array(this.buffer,r*o,i*o).set(n)}}}class a{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,i.Eu,t),this}vec2f64(e,t){return this._appendField(e,i.q6,t),this}vec3f(e,t){return this._appendField(e,i.ct,t),this}vec3f64(e,t){return this._appendField(e,i.fP,t),this}vec4f(e,t){return this._appendField(e,i.ek,t),this}vec4f64(e,t){return this._appendField(e,i.Cd,t),this}mat3f(e,t){return this._appendField(e,i.gK,t),this}mat3f64(e,t){return this._appendField(e,i.ey,t),this}mat4f(e,t){return this._appendField(e,i.bj,t),this}mat4f64(e,t){return this._appendField(e,i.O1,t),this}vec4u8(e,t){return this._appendField(e,i.mc,t),this}f32(e,t){return this._appendField(e,i.ly,t),this}f64(e,t){return this._appendField(e,i.oS,t),this}u8(e,t){return this._appendField(e,i.D_,t),this}u16(e,t){return this._appendField(e,i.av,t),this}i8(e,t){return this._appendField(e,i.Hz,t),this}vec2i8(e,t){return this._appendField(e,i.Vs,t),this}vec2i16(e,t){return this._appendField(e,i.or,t),this}vec2u8(e,t){return this._appendField(e,i.xA,t),this}vec4u16(e,t){return this._appendField(e,i.v6,t),this}u32(e,t){return this._appendField(e,i.Nu,t),this}_appendField(e,t,r){const i=t.ElementCount*(0,o.n1)(t.ElementType),n=this.stride;this.fields.set(e,{size:i,constructor:t,offset:n,optional:r}),this.stride+=i,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.indexOf(e)>=0}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new a;return e.stride=this.stride,e.fields=new Map,this.fields.forEach(((t,r)=>e.fields.set(r,t))),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function s(){return new a}},1391:(e,t,r)=>{r.d(t,{q:()=>n});var i=r(18361),o=r(74709);function n(e,t){t.output===i.H.Color&&t.receiveShadows?(e.varyings.add("linearDepth","float"),e.vertex.code.add(o.H`void forwardLinearDepth() { linearDepth = gl_Position.w; }`)):t.output===i.H.Depth||t.output===i.H.Shadow?(e.varyings.add("linearDepth","float"),e.vertex.uniforms.add("cameraNearFar","vec2"),e.vertex.code.add(o.H`void forwardLinearDepth() {
|
|
160
160
|
linearDepth = (-position_view().z - cameraNearFar[0]) / (cameraNearFar[1] - cameraNearFar[0]);
|
|
161
161
|
}`)):e.vertex.code.add(o.H`void forwardLinearDepth() {}`)}},62707:(e,t,r)=>{r.d(t,{w:()=>o});var i=r(74709);function o(e){e.vertex.code.add(i.H`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) {
|
|
162
162
|
vec3 camToVert = posWorld - camPosWorld;
|