@arcgis/core 5.1.0-next.106 → 5.1.0-next.108

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.
Files changed (396) hide show
  1. package/analysis/ShadowCastAnalysis.d.ts +2 -1
  2. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  3. package/arcgisGlobal.d.ts +5 -0
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/{b7a81fd4994eabba1869.js → 0c8e6ccb5a8174718d62.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{be817be7c81fb630122f.js → 17604cbd4d24158e2c16.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{065dd2fdc834146423c7.js → 33ec193e6d7a0cb9d8dd.js} +1 -1
  8. package/assets/esri/core/workers/chunks/4e13d639419ac64f7563.js +1 -0
  9. package/assets/esri/core/workers/chunks/4f9ea7544b2d0e88a05c.js +1 -0
  10. package/assets/esri/core/workers/chunks/{15920af0c4f46773b06e.js → 502c3da8c49bf885f51d.js} +1 -1
  11. package/assets/esri/core/workers/chunks/518046d2b95a7590a092.js +1 -0
  12. package/assets/esri/core/workers/chunks/{aaad0d3e82ed917d3886.js → 547dc6ccb989bd962661.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{bd59cb5abc67e46f1b2c.js → 55334ad3618899cdbf78.js} +2 -2
  14. package/assets/esri/core/workers/chunks/{d859c046a3ea42530bff.js → 56d9d3f108ff6e719dd4.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{770611659b38066a6228.js → 5a85cbc04c64091d7f46.js} +1 -1
  16. package/assets/esri/core/workers/chunks/75a7de23c05435ec7649.js +1 -0
  17. package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +1 -0
  18. package/assets/esri/core/workers/chunks/91c0de3950991d81b7f2.js +1 -0
  19. package/assets/esri/core/workers/chunks/9234a293d61e134f121f.js +1 -0
  20. package/assets/esri/core/workers/chunks/{a8ae00e06f98e04aee8e.js → ac408c62565e2c8b5975.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{f7fe17a22390a24d6df8.js → b69d1d528e271568cbd8.js} +2 -2
  22. package/assets/esri/core/workers/chunks/{0cc74bc3772be51cabc1.js → bbaf8baa3ca6195467e4.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{7ce60331f94ee0a5d674.js → beff5b4e15edee12bd4c.js} +33 -41
  24. package/assets/esri/core/workers/chunks/{b9850fe7dcdaed0c327c.js → cdb48d198145493f76f3.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{63ea4191d441efd2f146.js → d4014213c476bf8099af.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{740588250eaffb7301fd.js → e1340232962cf576d37e.js} +1 -1
  27. package/assets/esri/geometry/support/pe-wasm.wasm +0 -0
  28. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  29. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  30. package/assets/esri/themes/base/widgets/_Sketch.scss +1 -24
  31. package/assets/esri/themes/dark/main.css +1 -1
  32. package/assets/esri/themes/light/main.css +1 -1
  33. package/assets/esri/themes/light/view.css +1 -1
  34. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  35. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bg.json +1 -1
  36. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_bs.json +1 -1
  37. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ca.json +1 -1
  38. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_cs.json +1 -1
  39. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_da.json +1 -1
  40. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_de.json +1 -1
  41. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_el.json +1 -1
  42. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_es.json +1 -1
  43. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_et.json +1 -1
  44. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fi.json +1 -1
  45. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_fr.json +1 -1
  46. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_he.json +1 -1
  47. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hr.json +1 -1
  48. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_hu.json +1 -1
  49. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_id.json +1 -1
  50. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_it.json +1 -1
  51. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ja.json +1 -1
  52. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ko.json +1 -1
  53. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lt.json +1 -1
  54. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_lv.json +1 -1
  55. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_nl.json +1 -1
  56. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_no.json +1 -1
  57. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pl.json +1 -1
  58. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-BR.json +1 -1
  59. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_pt-PT.json +1 -1
  60. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ro.json +1 -1
  61. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ru.json +1 -1
  62. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sk.json +1 -1
  63. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sl.json +1 -1
  64. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sr.json +1 -1
  65. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_sv.json +1 -1
  66. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_th.json +1 -1
  67. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_tr.json +1 -1
  68. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_uk.json +1 -1
  69. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_vi.json +1 -1
  70. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-CN.json +1 -1
  71. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-HK.json +1 -1
  72. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_zh-TW.json +1 -1
  73. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
  74. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
  75. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
  76. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
  77. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
  78. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
  79. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
  80. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
  81. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
  82. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
  83. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
  84. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
  85. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
  86. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
  87. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
  88. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
  89. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
  90. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
  91. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
  92. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
  93. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
  94. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
  95. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
  96. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
  97. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
  98. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
  99. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
  100. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
  101. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
  102. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
  103. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
  104. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
  105. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
  106. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
  107. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
  108. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
  109. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
  110. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
  111. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  121. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  122. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  123. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  124. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  125. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  126. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  127. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  128. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  129. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  130. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  131. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  132. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  133. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  134. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  135. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  136. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  137. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  138. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  139. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  140. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  141. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  142. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  143. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  144. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  145. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  146. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  147. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  148. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  149. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  150. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  151. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  152. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  153. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
  154. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  155. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  156. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  157. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  158. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  159. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  160. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  161. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  162. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
  163. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  164. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  165. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  166. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  167. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  168. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  169. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  170. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  171. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  172. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  173. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  174. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  175. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  176. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  177. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  178. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  179. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  180. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  181. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  182. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  183. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  184. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  185. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  186. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  187. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  188. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  189. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  190. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  191. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  192. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  193. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  194. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  195. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  196. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  197. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  198. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  199. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  200. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  201. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  202. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  203. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  204. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  205. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  206. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  207. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  208. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  209. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  210. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  211. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  212. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  213. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  214. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  215. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  216. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  217. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  218. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  219. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  220. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  221. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  222. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  223. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  224. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  225. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  226. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  227. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  228. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  229. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  230. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  231. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  232. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  233. package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
  234. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  235. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  236. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  237. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  238. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  239. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  240. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  241. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  242. package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
  243. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  244. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  245. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  246. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  247. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  248. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  249. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  250. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  251. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  252. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  253. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  254. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  255. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  256. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  257. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  258. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  259. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  260. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  261. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  262. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  263. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  264. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  265. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  266. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  267. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  268. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  269. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  270. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  271. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  272. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  273. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  274. package/chunks/Fog.glsl.js +3 -3
  275. package/chunks/GlobalIllumination.glsl.js +12 -12
  276. package/chunks/GlowComposition.glsl.js +38 -56
  277. package/chunks/OITBlend.glsl.js +7 -7
  278. package/chunks/OITBlendEmission.glsl.js +4 -4
  279. package/chunks/OITDimOpaque.glsl.js +8 -3
  280. package/chunks/SimpleAtmosphere.glsl.js +3 -3
  281. package/chunks/lyr3DWorker.js +1 -1
  282. package/chunks/pe-wasm.js +1 -1
  283. package/config.js +1 -1
  284. package/core/workers/workers.js +1 -1
  285. package/geometry/support/WKIDUnitConversion.js +1 -1
  286. package/identity/IdentityManagerBase.js +1 -1
  287. package/kernel.js +1 -1
  288. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  289. package/layers/raster/datasets/MRFRaster.js +1 -1
  290. package/layers/video/VideoController.js +1 -1
  291. package/package.json +3 -3
  292. package/rest/networks/circuits/support/CircuitVerifyResult.js +1 -1
  293. package/rest/networks/circuits/support/VerifyCircuitsResult.js +1 -1
  294. package/support/revision.js +1 -1
  295. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  296. package/views/2d/layers/MapImageLayerView2D.js +1 -1
  297. package/views/2d/layers/RouteLayerView2D.js +1 -1
  298. package/views/2d/layers/TileLayerView2D.js +1 -1
  299. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  300. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  301. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  302. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  303. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  304. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  305. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  306. package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +3 -1
  307. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  308. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  309. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  310. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +2 -0
  311. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  312. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  313. package/views/3d/analysis/Viewshed/viewshedSubToolUtils.js +1 -1
  314. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  315. package/views/3d/environment/FoggyWeather.js +1 -1
  316. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  317. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  318. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  319. package/views/3d/layers/I3SMeshView3D.js +1 -1
  320. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  321. package/views/3d/layers/MapImageLayerView3D.js +1 -1
  322. package/views/3d/layers/TileLayerView3D.js +1 -1
  323. package/views/3d/layers/i3s/Intersector.js +1 -1
  324. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  325. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
  326. package/views/3d/support/ResourceController.js +1 -1
  327. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  328. package/views/3d/support/popupHitTest.js +1 -1
  329. package/views/3d/webgl-engine/collections/Component/ComponentDrawParameters.js +1 -1
  330. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  331. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  332. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  333. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  334. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -12
  335. package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
  336. package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
  337. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  338. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  339. package/views/3d/webgl-engine/effects/glow/GlowCompositionTechniqueConfiguration.js +1 -1
  340. package/views/3d/webgl-engine/effects/transparency/OITBlend.glsl.js +1 -1
  341. package/views/3d/webgl-engine/effects/transparency/OITBlendEmission.glsl.js +1 -1
  342. package/views/3d/webgl-engine/effects/transparency/OITDimOpaque.glsl.js +1 -1
  343. package/views/3d/webgl-engine/lib/RenderFeature.js +1 -1
  344. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  345. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  346. package/views/PopupView.js +1 -1
  347. package/views/SceneView.js +1 -1
  348. package/views/View2D.js +1 -1
  349. package/views/draw/DrawTool.d.ts +77 -0
  350. package/views/draw/support/editingSessionUtils.js +1 -1
  351. package/views/draw/support/managers/PluginLifecycleManager.d.ts +10 -0
  352. package/views/interactive/InteractiveToolBase.d.ts +11 -0
  353. package/views/interactive/editGeometry/interfaces.d.ts +8 -0
  354. package/views/interactive/interfaces.d.ts +20 -0
  355. package/views/layers/FeatureLikeLayerView.js +1 -1
  356. package/views/layers/ImageryLayerView.js +1 -1
  357. package/views/layers/ImageryTileLayerView.js +1 -1
  358. package/views/layers/WMSLayerView.js +1 -1
  359. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  360. package/views/webgl/capabilities/load.js +1 -1
  361. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +26 -1
  362. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  363. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  364. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  365. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +5 -44
  366. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  367. package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
  368. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  369. package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +2 -0
  370. package/widgets/BatchAttributeForm/types.d.ts +7 -0
  371. package/widgets/BatchAttributeForm.js +1 -1
  372. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +9 -1
  373. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  374. package/widgets/FeatureForm.js +1 -1
  375. package/widgets/FeatureTable/Grid/Column.js +1 -1
  376. package/widgets/FeatureTable/Grid/types.d.ts +21 -1
  377. package/widgets/FeatureTable.js +1 -1
  378. package/widgets/Sketch/SketchViewModel.d.ts +67 -2
  379. package/widgets/Sketch/SketchViewModel.js +1 -1
  380. package/widgets/Sketch/VisibleElements.d.ts +19 -1
  381. package/widgets/Sketch/VisibleElements.js +1 -1
  382. package/widgets/Sketch/support/OperationHandle.js +1 -1
  383. package/widgets/Sketch/support/PluginManager.d.ts +12 -0
  384. package/widgets/Sketch/support/PluginManager.js +1 -1
  385. package/widgets/Sketch.js +1 -1
  386. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +81 -0
  387. package/widgets/support/SelectionToolbar/types.d.ts +4 -0
  388. package/assets/esri/core/workers/chunks/2a2e97918524e0f436d7.js +0 -1
  389. package/assets/esri/core/workers/chunks/2b3a8a53cd68f666676b.js +0 -1
  390. package/assets/esri/core/workers/chunks/2ecb21c402cdd8c82533.js +0 -1
  391. package/assets/esri/core/workers/chunks/7e02e5c6979090fe3ea7.js +0 -1
  392. package/assets/esri/core/workers/chunks/dcba6c766eee8b90381a.js +0 -1
  393. package/assets/esri/core/workers/chunks/f9324420f2c6ac240f63.js +0 -1
  394. package/assets/esri/core/workers/chunks/fae2c8f053927559fff0.js +0 -1
  395. /package/assets/esri/core/workers/chunks/{bd59cb5abc67e46f1b2c.js.LICENSE.txt → 55334ad3618899cdbf78.js.LICENSE.txt} +0 -0
  396. /package/assets/esri/core/workers/chunks/{f7fe17a22390a24d6df8.js.LICENSE.txt → b69d1d528e271568cbd8.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as i,removeMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{initial as o,watch as a,when as n}from"../../../core/reactiveUtils.js";import{schedule as l}from"../../../core/scheduling.js";import{property as c,subclass as d}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as h,invert as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as m,IDENTITY as p}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as b}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as g,sub as y,dot as _,set as v}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w,freeze as x,clone as T,fromValues as j,ZEROS as C}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as O,clone as E,ONES as M}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as R,isMars as V,getReferenceEllipsoid as S,SphericalECEFSpatialReferenceLike as U}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as H}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as D}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as P}from"../../../geometry/projection/projectVectorToVector.js";import{create as I}from"../../../geometry/support/aaBoundingRect.js";import{isCGCS2000 as k}from"../../../geometry/support/spatialReferenceUtils.js";import{BufferViewVec4f as L,BufferViewVec4u8 as A,BufferViewVec4u16 as F,BufferViewVec3f as G,BufferViewVec3u8 as B,BufferViewVec3u16 as z,BufferViewVec2f as N,BufferViewUint32 as W,BufferViewUint16 as q}from"../../../geometry/support/buffer/BufferView.js";import $ from"../../../layers/support/SceneModification.js";import{getElevationOffsetInMeters as X}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as Z}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as J}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as Y}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as Q,removeLayerViewFromWasm as K,getLyr3DWasm as ee}from"./Lyr3DWasm.js";import{toWasmModification as te}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as ie}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as se}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as re,alphaModeConversion as oe,faceCullingConversion as ae,wrapModeConversion as ne}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as le}from"./support/makeScheduleFunction.js";import{Tiles3DMeshIntersectionHandler as ce}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as de}from"../state/Frustum.js";import{ElevationRange as he}from"../support/ElevationRange.js";import{toBoundingRect as ue}from"../support/extentUtils.js";import{Obb as me}from"../support/orientedBoundingBox.js";import{glLayout as pe}from"../support/buffer/glUtil.js";import{ComponentGeometryParameters as be,SourceGeometry as fe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as ge}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as ye}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as _e}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as ve}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as we}from"../webgl-engine/materials/pbrUtils.js";import xe from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Te,isInEffectiveScaleRange as je,validateScaleRange as Ce}from"../../support/layerViewUtils.js";import{TaskPriority as Oe}from"../../support/Scheduler.js";import{TextureCompressionTracker as Ee}from"../../support/TextureCompressionTracker.js";import{CompressedTextureFormat as Me,SizedPixelFormat as Re}from"../../webgl/enums.js";import{alphaCutoff as Ve}from"../../../webscene/support/AlphaCutoff.js";var Se;function Ue(e,t,i){if("image/vnd-ms.dds"===t)switch(i){case"Dxt1":return Me.COMPRESSED_RGB_S3TC_DXT1_EXT;case"Dxt5":return Me.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if("image/ktx2"===t)return null;switch(e){case 33319:return Re.RG8;case 6407:return Re.RGB8;case 6408:return Re.RGBA8;case 6403:return Re.R8;default:return null}}let He=class extends(J(xe)){static{Se=se}constructor(e){super(e),this[Se]=!0,this.type="integrated-mesh-3dtiles",this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this.drapeTargetType=1,this._replacesTerrain=!1,this._isUsedAsGroundLayer=!1,this._applySSAO=!has("disable-feature:im-ssao"),this._imShading=!!has("enable-feature:im-shading"),this._imVertexNormals=!!has("enable-feature:im-vertex-normals"),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._compressionTracker=new Ee,this._dbgFlags=new Set;const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._isUsedAsGroundLayer=e.layer.isUsedAsGroundLayer,this._frameTask=t.scheduler.registerTask(Oe.TILES3D,this),this._frustum=new de(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{r(t);const i=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=i}):null}canRecycleWith(e){return e.url===this.layer.url&&"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain===this._replacesTerrain&&e.isUsedAsGroundLayer===this._isUsedAsGroundLayer}initialize(){this._dbg(2,"Tiles3DLayerView3D initialize() called");const{view:e}=this;if(this._workerHandle=new Z(le(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),o),!this._canProjectWithoutEngine())throw Te("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);const t=Q(this).then(t=>{this._wasmLayerId=t,this._intersectionHandler=new ce(this),e.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),o),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),o),this._elevationProvider=new ie({view:e,layerElevationSource:this,intersectionHandler:this._intersectionHandler});const i=this._replacesTerrain?0:1;e.elevationProvider.register(i,this._elevationProvider),e.overlayManager.registerDrapeTarget(this),this.addHandles([a(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),n(()=>this.fullOpacity,()=>this._opacityChange()),a(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),o)])});this.layer.queryElevationCallback=(e,t)=>this._wasm.queryElevation(this,e,t),this.addResolvingPromise(t)}destroy(){this._dbg(2,"Tiles3DLayerView3D destroy() called"),this._workerHandle?.destroyContextAndSelf(this.uid),K(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(e=>this.forEachComponentObject(t=>e(t.obb))),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=s(this._visibleGeometryChangedSchedulerHandle)}get fullOpacity(){return this.layer.replacesTerrain?this.view.map.ground.opacity:1}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){const{fullOpacity:e}=this;this.forEachComponentObject(t=>this._collection.updateObjectOpacity(t,e))}_cameraChanged(){const e=this._frustum;e.update(this.view.state.contentCamera);const t=this._visibleObjects;let i=!1;this._loadedObjects.forEach(s=>{const r=s.obb?.intersectsFrustum(e)??!1;r!==s.isVisible&&(s.isVisible=r,r?t.add(s):t.delete(s),s.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,r)),i||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(r,s.elevationRange))}),i&&this._setVisibleElevationRangeDirty()}intersect(e,t,i,s){this._intersectionHandler.intersect(e,t,i,s,null,!1)}get ready(){return!this.layer.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){const e=this.layer.spatialReference,t=te(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=I();this._layerClippingArea=ue(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=l(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.layer.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,X(e))}get _wasm(){return ee(this.view)}get wasmLayerId(){return this._wasmLayerId}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get visibleAtCurrentScale(){return this.layer.isUsedAsGroundLayer||je(this.layer.effectiveScaleRange,this.view.scale)}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.layer.isUsedAsGroundLayer||Ce(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,i=0,s=0,r=0,o=0;return this._lyrHandleToObjects.forEach(a=>{a.isLoaded?(e+=a.textureMemoryUsage,t+=a.vboMemoryUsage,r++):(i+=a.textureMemoryUsage,s+=a.vboMemoryUsage,o++)}),new Y(this.usedMemory,r,o,Ie(t),Ie(e),Ie(s),Ie(i))}_canProjectWithoutEngine(){if(this.view.state.isLocal){const e=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1;if(3857!==e&&32662!==e)return!1}return!0}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return X(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new he(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){const e=new he;0===this._visibleObjects.size?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));const t=this._get("visibleElevationRange");return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange("visibleElevationRange")}_forEachRelevantVisibleTile(e){const{view:t}=this,{spatialReference:i}=t,s=i.isWGS84||i.isWebMercator||k(i)||R(i)||V(i);if(this.view.state.isGlobal||!s)return this.forEachVisibleTile(e);const r=S(i).radius,{eye:o,viewForward:a,near:n}=t.state.camera,l=g(w(),a),c=500,d=Math.max(o[2],c),h=d+r,u=Math.sqrt(h**2-r**2),m=Math.abs(Math.atan2(u,r))*r,p=d>.5*r?.5*Math.PI*r:m,b=w();this.forEachVisibleTile(t=>{const{mbsRadius:i,mbsCenter:s}=t;if(i<0)return;y(b,s,o);const r=_(b,l);Math.abs(r)<p&&r+i>n&&r-i<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(const t of this._visibleObjects)e(t)}forEachTile(e){for(const t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(const{componentObjects:i}of e)for(const e of i)t(e)}isUpdating(){const e=this._wasm;return this._wasmLayerId>=0&&null!=e&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy");const{meshData:t}=e;if(!Ge(t))throw new Error("meshData not valid");const i=new Map;let s;try{s=this._createPrimitiveTextureBundles(t,i)}catch(o){throw i.forEach(e=>this._stage.removeTexture(e)),o}let r=null;try{if(r=await this._createRenderableMain(t,s),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance");const{tileObb:o,componentObjects:a,elevationRange:n}=r;let l=0,c=0,d=0;for(const e of a){const{texture:t,textureMetallicRoughness:i,textureEmissive:s,textureOcclusion:r,textureNormal:o}=e.renderable.drawParameters;l+=(t?.usedMemory??0)+(i?.usedMemory??0)+(s?.usedMemory??0)+(r?.usedMemory??0)+(o?.usedMemory??0),c+=this._collection.getObjectGPUMemoryUsage(e),d+=e.intersectionGeometry.usedMemory}const h=Array.from(i.values()),u=new Pe(e.handle,a,h,d,c,l,o,e.stableNodeId,e.nodeDepth,n);this._lyrHandleToObjects.set(e.handle,u),this._memCache.put(Le(u.handle),u);const{usedMemory:m}=u;return this._cacheMemory+=m,{memUsageBytes:m}}catch(o){throw s.forEach(e=>e.cleanup()),r?.componentObjects.forEach(e=>this._collection.destroyObject(e)),i.forEach(e=>this._stage.removeTexture(e)),o}}_createPrimitiveTextureBundles(e,t){const i=new Array,s=e.desc.prims.length;try{const r=e.desc;for(let o=0;o<s;o++){const s=r.prims[o].materialId,a=r.materials&&null!=s?r.materials[s]:null;let n=Promise.resolve(Ae),l=null,c=null,d=null,h=null,u=null;if(a){const i="Pbr"===a.lightingModel;l=this._getTexture(a.baseColorTex,e,t),c=i?this._getTexture(a.metalTex,e,t):null,d=i?this._getTexture(a.emissiveTex,e,t):null,h=i?this._getTexture(a.occlusionTex,e,t):null,u=i?this._getTexture(a.normalTex,e,t):null;const s=[l,c,d,h,u].map(e=>e?.loadPromise??null);n=Promise.all(s)}i.push(new Fe(n,l,c,d,h,u))}}catch(r){throw i.forEach(e=>e.cleanup()),r}return i}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy");const i=new Array,s=e.desc,r=e.data.buffer,o=s.prims.length,a=x(...s.origin),n=this.view.basemapTerrain.spatialReference,l=this.view.state.isGlobal;let c=p;if(l){const e=b();H(U,a,e,n),c=h(m(),e)}if(null==s.obb)throw new Error("meshData.desc.obb undefined");const d=ke(s.obb),f=l?S(this.view.spatialReference).radius:0,g=new Array;try{for(let i=0;i<o;i++){const e=s.prims[i],o=t[i];this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(e));if(null==re[e.ptype]){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive."),o.cleanup();continue}const{positionView:a,normalsData:n,colorView:l,texCoord0Data:c,indicesView:d}=this.getBufferViews(e,r);if(null==a||null==d){o.cleanup();continue}const h=a.count,u=(e,t)=>null==e||e===h||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);u(null!=c?c.length/2:void 0,"numTexcoord")&&u(l?.count,"numColors")&&u(n?.length,"normals")?g.push({componentIndex:i,positionView:a,indicesView:d,texCoord0Data:c,colorView:l,normalsData:n}):o.cleanup()}const e=c!==p,h=e?u(m(),c)??p:p,{vertexProcessingOutputs:b,obbHalfSizeAccumulator:y,elevationRange:_}=await this._workerHandle.processTiles3DVertices(g,a,f,l,c,d,this._imVertexNormals);if(this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");const v=s.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");for(const r of b){const{componentIndex:o,positionView:l,indicesView:c,layout:u,textureCoordinateType:m,interleavedVertexData:p,indices:b}=r,f=s.prims[o],g=t[o],y=d.clone(),_=pe(u),x=new Uint32Array([0,c.typedBuffer.length]),T=new be(_,this._imShading?2:0,m,e?2:0,0),j=new fe({interleavedVertexData:p,vertexCount:p.byteLength/_[0].stride,indexData:b},{positions:l.typedBuffer,indices:c.typedBuffer},x,T),C=this.view.renderSpatialReference,E=w(),M=[1,1,1];D(a,C,M,n)||this._dbg(3,"Unsupported coordinate system for IM overlay"),P(a,C,E,n);const R=v&&null!=f.materialId?v[f.materialId]:null,V=this._createComponentMaterialInitParameters(R,g);V.baseColorTexture||this._dbg(3,"No colour texture 1");const S=this._collection.createObject({toMapSpace:O(E[0],E[1],M[0],M[1]),transform:new ge(a,h),obb:y,geometry:j,elevationAlignable:!1},V);i.push(S)}i.length>0&&d.setHalfSize(y[0],y[1],y[2]);const{fullExtent:x}=this.layer;return x?.hasZ&&x.zmax&&x.zmin&&(_.minElevation=Math.max(_.minElevation,x.zmin),_.maxElevation=Math.min(_.maxElevation,x.zmax)),{tileObb:d,componentObjects:i,elevationRange:_}}catch(y){throw i.forEach(e=>this._collection.destroyObject(e)),y}}_createComponentMaterialInitParameters(e,t){const i="Pbr"===(null!=e?e.lightingModel:"Unlit");let s=M,r=Ve,o=1,a=!1,n=2,l=j(0,0,0);const c=T(we),d=t.baseColorTexture,h=t.metallicRoughnessTexture,u=t.emissionTexture,m=t.occlusionTexture,p=t.normalTexture;return e&&(s=E(e.baseColorFactor),r=e.alphaCutoff??Ve,i&&(v(c,e.metallicFactor,e.roughnessFactor,0),e.emissiveFactor&&(l=e.emissiveFactor)),o=oe[e.alphaMode],a=e.isDoubleSided,n=ae[e.faceCulling??"NotSet"]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:r,mrrFactors:c,baseColorTexture:d,metallicRoughnessTexture:h,normalTexture:p,occlusionTexture:m,emissionTexture:u,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:o,doubleSided:a,cullFace:n,isGround:this.layer.replacesTerrain,emissiveBaseColor:l,usePBR:i,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this.fullOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){const t=Le(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,i){if(this.destroyed||this.destroying)return;const s=this._frustum,r=new Array;let o=!1,a=!1;for(let n=0;n<i;++n){if(!t[n])continue;const i=e[n],l=this._lyrHandleToObjects.get(i);if(l){if(l.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${l.stableNodeId}`);continue}o=!0,l.isLoaded=!0,this._loadedObjects.add(l),this._intersectionHandler.addTile(l),this._usedMemory+=l.usedMemory,this._cacheMemory-=l.usedMemory;const e=l.obb?.intersectsFrustum(s)??!0;l.isVisible=e,e&&(this._visibleObjects.add(l),a||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,l.elevationRange)),e&&l.obb&&r.push(l.obb),l.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(Le(i))}else this._dbg(3,`Tried to mark Non existent object ${i} as loaded`)}for(let n=0;n<i;++n){const i=e[n];if(t[n])continue;const s=this._lyrHandleToObjects.get(i);if(s){if(!s.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${s.stableNodeId}`);continue}const e=s.isVisible;this._visibleObjects.delete(s),s.isVisible=!1,s.isLoaded=!1,this._loadedObjects.delete(s),this._intersectionHandler.removeTile(s),e&&(this._visibleGeometryChanged(),a||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,s.elevationRange)),this._usedMemory-=s.usedMemory,this._cacheMemory+=s.usedMemory,e&&s.obb&&r.push(s.obb),s.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(Le(i),s)}else this._dbg(3,`Tried to mark Non existent object ${i} as not loaded`)}o&&this._visibleGeometryChanged(),this._elevationProvider.notifyObjectsChanged(r),a&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){const{visibleElevationRange:i}=this,{minElevation:s,maxElevation:r}=t;return e?s<i.minElevation||r>i.maxElevation:s===i.minElevation||r===i.maxElevation}_getTexture(e,t,i){const s=e&&t.desc?.images?.[e.imageId];if(!s||!t.data?.buffer)return null;const r=i.get(s)??this._createTexture(e,t,i);return r?new ye(this._stage.renderView.textures,r.id):null}_createTexture(e,t,i){const s=e&&t.desc?.images?.[e.imageId];if(!s||!t.data?.buffer)return null;const r=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=!!s.mipCount||r>1,a=ne[e.wrapMode??"None"];let n=s.alpha?6408:6407;const l=new Uint8Array(t.data.buffer,s.data.byteOffset,s.data.byteCount);let c=null,d=null,h=null;switch(s.format){case"Raw":"R8"===s.pixelFormat?(c=l,n=6403,d=""):"Rg8"===s.pixelFormat||"Ga8"===s.pixelFormat?(c=l,n=33319,d=""):"Rgb8"===s.pixelFormat?(c=l,n=6407,d=""):"Rgba8"===s.pixelFormat&&(c=l,n=6408,d="");break;case"Dxt1":c=l,n=6407,d="image/vnd-ms.dds";break;case"Dxt5":c=l,n=6408,d="image/vnd-ms.dds";break;case"Basis":c=l,n=6407,d="image/ktx2";break;case"Png":d="image/png",h=document.createElement("img");break;case"Jpeg":d="image/jpeg",h=document.createElement("img");break;case"Etc2":d="image/ktx",h=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(h&&d){const e=new Blob([l],{type:d});h.src=URL.createObjectURL(e),c=h}if(c&&null!=d){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker}:void 0,t=Ue(n,d,s.format),l=new _e(c,{mipmap:o,maxAnisotropy:r,encoding:d,wrap:a,pixelFormat:n,internalFormat:t??void 0,immutable:null!=t,compressionOptions:e,noUnpackFlip:!0,width:s.mip0Width,height:s.mip0Height});return this._stage.addTexture(l),i.set(s,l),l}return null}getBufferViews(e,t){let i,s,r,o,a;for(let l=0;l<e.atrbs.length;l++){const a=e.atrbs[l],{view:c}=a,d=void 0,h=c.byteOffset+c.byteCount;try{switch(a.sem){case"Position":3!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+c+")"):i=new G(t,c.byteOffset,d,h);break;case"Normal":if(3!==c.ncomp||"F32"!==c.type)this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+c+")");else{const e=new G(t,c.byteOffset,d,h);o=new Uint32Array(e.count),ve(e.typedBuffer,new Int16Array(o.buffer,o.byteOffset,2*o.length))}break;case"TexCoord":2!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+c+")"):void 0===r&&(r=new N(t,c.byteOffset,d,h).typedBuffer);break;case"Color":4===c.ncomp?("F32"===c.type&&(s=new L(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new A(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new F(t,c.byteOffset,d,h))):3===c.ncomp&&("F32"===c.type&&(s=new G(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new B(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new z(t,c.byteOffset,d,h))),null==s&&this._dbg(2,"[Unsupported Feature] Unsupported view for Color ("+c+")");break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+a.sem+"). Skipping vertex attribute.")}}catch(n){this._dbg(2,"Error Creating buffer ("+n+"). Skipping vertex attribute.")}}if(e.index){const i=e.index.view,s=void 0,r=i.byteOffset+i.byteCount;switch(e.index.view.type){case"U16":a=new q(t,i.byteOffset,s,r);break;case"U32":a=new W(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==a&&null!=i){const e=i.count;a=a=e<65535?new q(new Uint16Array(e).buffer):new W(new Uint32Array(e).buffer);for(let t=0;t<e;t++)a.set(t,t)}return{positionView:i,colorView:s,texCoord0Data:r,indicesView:a,normalsData:o}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.layer.isUsedAsGroundLayer&&"replace"!==e.type)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info("Ground layers only support replace modifications. Other modification types have been ignored.")},o),"modifications")}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([c()],He.prototype,"fullOpacity",null),e([c({readOnly:!0})],He.prototype,"ready",null),e([c({type:[$]})],He.prototype,"_modifications",void 0),e([c()],He.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([c()],He.prototype,"layer",void 0),e([c({readOnly:!0})],He.prototype,"visibleAtCurrentScale",null),e([c({readOnly:!0})],He.prototype,"_collection",null),e([c()],He.prototype,"elevationOffset",null),e([c({readOnly:!0})],He.prototype,"visibleElevationRange",null),He=e([d("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],He);const De=He;class Pe{constructor(e,t,i,s,r,o,a,n,l,c){this.handle=e,this.componentObjects=t,this.textures=i,this.cpuMemoryUsage=s,this.vboMemoryUsage=r,this.textureMemoryUsage=o,this.obb=a,this.stableNodeId=n,this.nodeDepth=l,this.elevationRange=c,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;const d=w();a?.getCenter(d),this._obbCenterX=d[0],this._obbCenterY=d[1],this._obbCenterZ=d[2];const h=a?.radius??-1;this._obbRadius=h,this._obbRadiusSquared=h*h;const u=a?.halfSize;this._obbShortestHalfsize=u?Math.min(u[0],u[1],u[2]):0,this._mbsCenter=a?T(a.center):C}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;const{_obbCenterX:i,_obbCenterY:s,_obbCenterZ:r}=this,o=i-e[0],a=s-e[1],n=r-e[2],l=o*t[0]+a*t[1]+n*t[2];return o*o+a*a+n*n-l*l<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){const t=this._obbRadius;if(t<0)return!0;const i=e.center,s=e.radius,r=t+s,o=this._obbCenterX-i[0];if(o>r)return!1;const a=this._obbCenterY-i[1];if(a>r)return!1;const n=this._obbCenterZ-i[2];if(n>r)return!1;const l=o*o+a*a+n*n;if(l>r*r)return!1;if(l<=(this._obbShortestHalfsize+s)**2)return!0;const c=s-t;return c>0&&l<=c*c||(this.obb?.intersectSphere(e)??!0)}}function Ie(e){return Math.round(e/1048.576)/1e3}function ke(e){return new me(e.center,e.halfSize,f(...e.quaternion))}function Le(e){return`${e}`}const Ae=new Array;class Fe{constructor(e,t,i,s,r,o){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=i,this.emissionTexture=s,this.occlusionTexture=r,this.normalTexture=o}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}function Ge(e){return null!=e.data&&("string"==typeof e.desc&&(e.desc=JSON.parse(e.desc)),null!=e.desc)}export{De as default};
2
+ import{__decorate as e}from"tslib";import has from"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as i,removeMaybe as s}from"../../../core/maybe.js";import{throwIfAborted as r}from"../../../core/promiseUtils.js";import{initial as o,watch as a,when as n}from"../../../core/reactiveUtils.js";import{schedule as l}from"../../../core/scheduling.js";import{property as c,subclass as d}from"../../../core/accessorSupport/decorators.js";import{fromMat4 as h,invert as u}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as m,IDENTITY as p}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as b}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromValues as f}from"../../../core/libs/gl-matrix-2/factories/quatf64.js";import{normalize as g,sub as y,dot as _,set as v}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w,freeze as x,clone as T,fromValues as j,ZEROS as C}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as O,clone as E,ONES as M}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isMoon as R,isMars as V,getReferenceEllipsoid as S,SphericalECEFSpatialReferenceLike as U}from"../../../geometry/ellipsoidUtils.js";import{computeTranslationToOriginAndRotation as H}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{localLinearScaleFactors as D}from"../../../geometry/projection/localLinearScaleFactors.js";import{projectVectorToVector as P}from"../../../geometry/projection/projectVectorToVector.js";import{create as I}from"../../../geometry/support/aaBoundingRect.js";import{isCGCS2000 as k}from"../../../geometry/support/spatialReferenceUtils.js";import{BufferViewVec4f as L,BufferViewVec4u8 as A,BufferViewVec4u16 as F,BufferViewVec3f as G,BufferViewVec3u8 as B,BufferViewVec3u16 as z,BufferViewVec2f as N,BufferViewUint32 as W,BufferViewUint16 as q}from"../../../geometry/support/buffer/BufferView.js";import $ from"../../../layers/support/SceneModification.js";import{getElevationOffsetInMeters as X}from"../../../support/elevationInfoUtils.js";import{IntegratedMesh3DTilesLayerWorkerHandle as Z}from"./IntegratedMesh3DTilesLayerWorkerHandle.js";import{LayerView3D as J}from"./LayerView3D.js";import{Lyr3DViewPerformanceInfo as Y}from"./Lyr3DViewPerformanceInfo.js";import{addLayerViewToWasm as Q,removeLayerViewFromWasm as K,getLyr3DWasm as ee}from"./Lyr3DWasm.js";import{toWasmModification as te}from"./SceneLayerWorkerHandle.js";import{LayerElevationProvider as ie}from"./i3s/LayerElevationProvider.js";import{IntegratedMesh3DTilesLayerView3DSymbol as se}from"./support/integratedMesh3DTilesLayerViewInstanceUtils.js";import{primTypeConversion as re,alphaModeConversion as oe,faceCullingConversion as ae,wrapModeConversion as ne}from"./support/lyr3dTypeConversions.js";import{makeScheduleFunction as le}from"./support/makeScheduleFunction.js";import{Tiles3DMeshIntersectionHandler as ce}from"./support/Tiles3DMeshIntersectionHandler.js";import{Frustum as de}from"../state/Frustum.js";import{ElevationRange as he}from"../support/ElevationRange.js";import{toBoundingRect as ue}from"../support/extentUtils.js";import{Obb as me}from"../support/orientedBoundingBox.js";import{glLayout as pe}from"../support/buffer/glUtil.js";import{ComponentGeometryParameters as be,SourceGeometry as fe}from"../webgl-engine/collections/Component/SourceGeometry.js";import{Transform as ge}from"../webgl-engine/collections/Component/Transform.js";import{RenderTexture as ye}from"../webgl-engine/core/material/RenderTexture.js";import{ManagedTexture as _e}from"../webgl-engine/lib/ManagedTexture.js";import{compressNormals as ve}from"../webgl-engine/lib/Normals.js";import{advancedMRRFactors as we}from"../webgl-engine/materials/pbrUtils.js";import xe from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as Te,isInEffectiveScaleRange as je,validateScaleRange as Ce}from"../../support/layerViewUtils.js";import{TaskPriority as Oe}from"../../support/Scheduler.js";import{TextureCompressionTracker as Ee}from"../../support/TextureCompressionTracker.js";import{CompressedTextureFormat as Me,SizedPixelFormat as Re}from"../../webgl/enums.js";import{alphaCutoff as Ve}from"../../../webscene/support/AlphaCutoff.js";var Se;function Ue(e,t,i){if("image/vnd-ms.dds"===t)switch(i){case"Dxt1":return Me.COMPRESSED_RGB_S3TC_DXT1_EXT;case"Dxt5":return Me.COMPRESSED_RGBA_S3TC_DXT5_EXT;default:return null}if("image/ktx2"===t)return null;switch(e){case 33319:return Re.RG8;case 6407:return Re.RGB8;case 6408:return Re.RGBA8;case 6403:return Re.R8;default:return null}}let He=class extends(J(xe)){static{Se=se}constructor(e){super(e),this[Se]=!0,this.type="integrated-mesh-3dtiles",this._modifications=new Array,this._visibleGeometryChangedSchedulerHandle=null,this._wasmLayerId=-1,this.ignoresMemoryFactor=!1,this._usedMemory=0,this._cacheMemory=0,this.drapeTargetType=1,this._replacesTerrain=!1,this._isUsedAsGroundLayer=!1,this._applySSAO=!has("disable-feature:im-ssao"),this._imShading=!!has("enable-feature:im-shading"),this._imVertexNormals=!!has("enable-feature:im-vertex-normals"),this._lyrHandleToObjects=new Map,this._visibleObjects=new Set,this._loadedObjects=new Set,this._compressionTracker=new Ee,this._dbgFlags=new Set;const t=e.view.resourceController;this._memCache=t.memoryController.newCache(`IM3DTiles-${this.uid}`,e=>this._deletePerObjectData(e)),this._replacesTerrain=e.layer.replacesTerrain,this._isUsedAsGroundLayer=e.layer.isUsedAsGroundLayer,this._frameTask=t.scheduler.registerTask(Oe.TILES3D,this),this._frustum=new de(e.view.renderCoordsHelper)}tryRecycleWith(e,t){return this.canRecycleWith(e)?e.load(t).then(()=>{r(t);const i=this.layer.queryElevationCallback;this.layer=e,this.layer.queryElevationCallback=i}):null}canRecycleWith(e){return e.url===this.layer.url&&"integrated-mesh-3dtiles"===e.type&&e.replacesTerrain===this._replacesTerrain&&e.isUsedAsGroundLayer===this._isUsedAsGroundLayer}initialize(){this._dbg(2,"Tiles3DLayerView3D initialize() called");const{view:e}=this;if(this._workerHandle=new Z(le(e.resourceController)),this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),o),!this._canProjectWithoutEngine())throw Te("layer",this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);const t=Q(this).then(t=>{this._wasmLayerId=t,this._intersectionHandler=new ce(this),e.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChange(e)),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged()),this._updatingHandles.add(()=>this.fullOpacity,()=>this._opacityChange()),this._updatingHandles.add(()=>e.clippingArea,()=>this._clippingAreaChanged(),o),this._updatingHandles.add(()=>e.state.contentCamera,()=>this._cameraChanged(),o),this._elevationProvider=new ie({view:e,layerElevationSource:this,intersectionHandler:this._intersectionHandler});const i=this._replacesTerrain?0:1;e.elevationProvider.register(i,this._elevationProvider),e.overlayManager.registerDrapeTarget(this),this.addHandles([a(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),n(()=>this.fullOpacity,()=>this._opacityChange()),a(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),o)])});this.layer.queryElevationCallback=(e,t)=>this._wasm.queryElevation(this,e,t),this.addResolvingPromise(t)}destroy(){this._dbg(2,"Tiles3DLayerView3D destroy() called"),this._workerHandle?.destroyContextAndSelf(this.uid),K(this),this.layer.queryElevationCallback=null,this._intersectionHandler&&(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler.destroy(),this._intersectionHandler=null),this._elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(e=>this.forEachComponentObject(t=>e(t.obb))),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this.view.overlayManager.unregisterDrapeTarget(this),this._lyrHandleToObjects.forEach(e=>this.freeObject(e)),this._lyrHandleToObjects.clear(),this._visibleObjects.clear(),this._loadedObjects.clear(),this._usedMemory=0,this._cacheMemory=0,this._memCache.destroy(),this._frameTask.remove(),this._updatingHandles=i(this._updatingHandles),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=s(this._visibleGeometryChangedSchedulerHandle)}get fullOpacity(){return this.layer.replacesTerrain?this.view.map.ground.opacity:1}get hasModifications(){return this._modifications&&this._modifications.length>0}_opacityChange(){const{fullOpacity:e}=this;this.forEachComponentObject(t=>this._collection.updateObjectOpacity(t,e))}_cameraChanged(){const e=this._frustum;e.update(this.view.state.contentCamera);const t=this._visibleObjects;let i=!1;this._loadedObjects.forEach(s=>{const r=s.obb?.intersectsFrustum(e)??!1;r!==s.isVisible&&(s.isVisible=r,r?t.add(s):t.delete(s),s.componentObjects.forEach(e=>this._collection.setObjectVisibility(e,r)),i||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(r,s.elevationRange))}),i&&this._setVisibleElevationRangeDirty()}intersect(e,t,i,s){this._intersectionHandler.intersect(e,t,i,s,null,!1)}get ready(){return!this.layer.replacesTerrain||!!this._wasm?.isTerrainReady}_modificationsChanged(){const e=this.layer.spatialReference,t=te(this._layerClippingArea,this._modifications,e);this._wasm?.setMeshModifications(this,t)}_clippingAreaChanged(){const e=this.layer.spatialReference,t=I();this._layerClippingArea=ue(this.view.clippingArea,t,e)?t:null,this._modificationsChanged()}_visibleGeometryChanged(){this._visibleGeometryChangedSchedulerHandle??=l(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e&&!this.layer.replacesTerrain),this.forEachComponentObject(t=>t.updateMaterial({slicePlaneEnabled:e}))}_elevationInfoChanged(e){this._wasm?.setLayerOffset(this,X(e))}get _wasm(){return ee(this.view)}get wasmLayerId(){return this._wasmLayerId}get usedMemory(){return this._usedMemory}get unloadedMemory(){return 0}get cachedMemory(){return this._cacheMemory}get visibleAtCurrentScale(){return this.layer.isUsedAsGroundLayer||je(this.layer.effectiveScaleRange,this.view.scale)}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&this.parent&&!this.parent.suspended&&this.view?.ready&&(this.layer.isUsedAsGroundLayer||Ce(e)&&this.visibleAtCurrentScale)&&this.visibleAtCurrentTimeExtent||!1}get performanceInfo(){let e=0,t=0,i=0,s=0,r=0,o=0;return this._lyrHandleToObjects.forEach(a=>{a.isLoaded?(e+=a.textureMemoryUsage,t+=a.vboMemoryUsage,r++):(i+=a.textureMemoryUsage,s+=a.vboMemoryUsage,o++)}),new Y(this.usedMemory,r,o,Ie(t),Ie(e),Ie(s),Ie(i))}_canProjectWithoutEngine(){if(this.view.state.isLocal){const e=this.view.renderSpatialReference?.isWebMercator?3857:this.view.renderSpatialReference?.wkid??-1;if(3857!==e&&32662!==e)return!1}return!0}get _stage(){return this.view.stage}get _collection(){return this._stage.renderView.componentObjectCollection}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return X(this.layer.elevationInfo)}get elevationRange(){const e=this.fullExtent;return e?.zmin&&e?.zmax?new he(e.zmin,e.zmax):null}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get visibleElevationRange(){const e=new he;0===this._visibleObjects.size?e.setElevationRangeValues(0,0):(e.setElevationRangeValues(1/0,-1/0),this._forEachRelevantVisibleTile(t=>e.expandElevationRange(t.elevationRange)),e.minElevation===1/0&&e.setElevationRangeValues(0,0));const t=this._get("visibleElevationRange");return t&&t.minElevation===e.minElevation&&t.maxElevation===e.maxElevation?t:e}_setVisibleElevationRangeDirty(){this.notifyChange("visibleElevationRange")}_forEachRelevantVisibleTile(e){const{view:t}=this,{spatialReference:i}=t,s=i.isWGS84||i.isWebMercator||k(i)||R(i)||V(i);if(this.view.state.isGlobal||!s)return this.forEachVisibleTile(e);const r=S(i).radius,{eye:o,viewForward:a,near:n}=t.state.camera,l=g(w(),a),c=500,d=Math.max(o[2],c),h=d+r,u=Math.sqrt(h**2-r**2),m=Math.abs(Math.atan2(u,r))*r,p=d>.5*r?.5*Math.PI*r:m,b=w();this.forEachVisibleTile(t=>{const{mbsRadius:i,mbsCenter:s}=t;if(i<0)return;y(b,s,o);const r=_(b,l);Math.abs(r)<p&&r+i>n&&r-i<p&&e(t)})}get fullExtent(){return this.layer.fullExtent}forEachComponentObject(e){this._forEachObject(this._lyrHandleToObjects.values(),e)}forEachVisibleTile(e){for(const t of this._visibleObjects)e(t)}forEachTile(e){for(const t of this._loadedObjects)e(t)}forEachVisibleComponentObject(e){this._forEachObject(this._visibleObjects,e)}_forEachObject(e,t){for(const{componentObjects:i}of e)for(const e of i)t(e)}isUpdating(){const e=this._wasm;return this._wasmLayerId>=0&&null!=e&&(e.isUpdating(this._wasmLayerId)||this._compressionTracker.compressing)}get readyToRun(){return!!this._frameTask?.readyToRun}runTask(e){this._frameTask.processQueue(e)}updatingFlagChanged(){this.notifyChange("updating")}async createRenderable(e){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy");const{meshData:t}=e;if(!Ge(t))throw new Error("meshData not valid");const i=new Map;let s;try{s=this._createPrimitiveTextureBundles(t,i)}catch(o){throw i.forEach(e=>this._stage?.removeTexture(e)),o}let r=null;try{if(r=await this._createRenderableMain(t,s),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderable aborted due to destroyed instance");const{tileObb:o,componentObjects:a,elevationRange:n}=r;let l=0,c=0,d=0;for(const e of a){const{texture:t,textureMetallicRoughness:i,textureEmissive:s,textureOcclusion:r,textureNormal:o}=e.renderable.drawParameters;l+=(t?.usedMemory??0)+(i?.usedMemory??0)+(s?.usedMemory??0)+(r?.usedMemory??0)+(o?.usedMemory??0),c+=this._collection.getObjectGPUMemoryUsage(e),d+=e.intersectionGeometry.usedMemory}const h=Array.from(i.values()),u=new Pe(e.handle,a,h,d,c,l,o,e.stableNodeId,e.nodeDepth,n);return this._lyrHandleToObjects.set(e.handle,u),()=>{this._memCache.put(Le(u.handle),u);const{usedMemory:e}=u;return this._cacheMemory+=e,{memUsageBytes:e}}}catch(o){throw s.forEach(e=>e.cleanup()),r?.componentObjects.forEach(e=>this._collection.destroyObject(e)),i.forEach(e=>this._stage?.removeTexture(e)),o}}_createPrimitiveTextureBundles(e,t){const i=new Array,s=e.desc.prims.length;try{const r=e.desc;for(let o=0;o<s;o++){const s=r.prims[o].materialId,a=r.materials&&null!=s?r.materials[s]:null;let n=Promise.resolve(Ae),l=null,c=null,d=null,h=null,u=null;if(a){const i="Pbr"===a.lightingModel;l=this._getTexture(a.baseColorTex,e,t),c=i?this._getTexture(a.metalTex,e,t):null,d=i?this._getTexture(a.emissiveTex,e,t):null,h=i?this._getTexture(a.occlusionTex,e,t):null,u=i?this._getTexture(a.normalTex,e,t):null;const s=[l,c,d,h,u].map(e=>e?.loadPromise??null);n=Promise.all(s)}i.push(new Fe(n,l,c,d,h,u))}}catch(r){throw i.forEach(e=>e.cleanup()),r}return i}async _createRenderableMain(e,t){if(this.destroyed||this.destroying)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain called after destroy");const i=new Array,s=e.desc,r=e.data.buffer,o=s.prims.length,a=x(...s.origin),n=this.view.basemapTerrain.spatialReference,l=this.view.state.isGlobal;let c=p;if(l){const e=b();H(U,a,e,n),c=h(m(),e)}if(null==s.obb)throw new Error("meshData.desc.obb undefined");const d=ke(s.obb),f=l?S(this.view.spatialReference).radius:0,g=new Array;try{for(let i=0;i<o;i++){const e=s.prims[i],o=t[i];this._dbgFlags.has(2)&&this._dbg(2,JSON.stringify(e));if(null==re[e.ptype]){this._dbg(2,"[Unsupported Feature] Unsupported primitive mode ("+e.ptype+"). Skipping primitive."),o.cleanup();continue}const{positionView:a,normalsData:n,colorView:l,texCoord0Data:c,indicesView:d}=this.getBufferViews(e,r);if(null==a||null==d){o.cleanup();continue}const h=a.count,u=(e,t)=>null==e||e===h||(this._dbg(3,`${t} !== numPos. Skipping primitive.`),!1);u(null!=c?c.length/2:void 0,"numTexcoord")&&u(l?.count,"numColors")&&u(n?.length,"normals")?g.push({componentIndex:i,positionView:a,indicesView:d,texCoord0Data:c,colorView:l,normalsData:n}):o.cleanup()}const e=c!==p,h=e?u(m(),c)??p:p,{vertexProcessingOutputs:b,obbHalfSizeAccumulator:y,elevationRange:_}=await this._workerHandle.processTiles3DVertices(g,a,f,l,c,d,this._imVertexNormals);if(this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");const v=s.materials;if(await Promise.all(t.map(e=>e.materialPromise)),this.destroyed)throw new Error("IntegratedMesh3DTilesLayerView3D: createRenderableMain aborted due to destroyed instance");for(const r of b){const{componentIndex:o,positionView:l,indicesView:c,layout:u,textureCoordinateType:m,interleavedVertexData:p,indices:b}=r,f=s.prims[o],g=t[o],y=d.clone(),_=pe(u),x=new Uint32Array([0,c.typedBuffer.length]),T=new be(_,this._imShading?2:0,m,e?2:0),j=new fe({interleavedVertexData:p,vertexCount:p.byteLength/_[0].stride,indexData:b},{positions:l.typedBuffer,indices:c.typedBuffer},x,T),C=this.view.renderSpatialReference,E=w(),M=[1,1,1];D(a,C,M,n)||this._dbg(3,"Unsupported coordinate system for IM overlay"),P(a,C,E,n);const R=v&&null!=f.materialId?v[f.materialId]:null,V=this._createComponentMaterialInitParameters(R,g);V.baseColorTexture||this._dbg(3,"No colour texture 1");const S=this._collection.createObject({toMapSpace:O(E[0],E[1],M[0],M[1]),transform:new ge(a,h),obb:y,geometry:j,elevationAlignable:!1},V);i.push(S)}i.length>0&&d.setHalfSize(y[0],y[1],y[2]);const{fullExtent:x}=this.layer;return x?.hasZ&&x.zmax&&x.zmin&&(_.minElevation=Math.max(_.minElevation,x.zmin),_.maxElevation=Math.min(_.maxElevation,x.zmax)),{tileObb:d,componentObjects:i,elevationRange:_}}catch(y){throw i.forEach(e=>this._collection.destroyObject(e)),y}}_createComponentMaterialInitParameters(e,t){const i="Pbr"===(null!=e?e.lightingModel:"Unlit");let s=M,r=Ve,o=1,a=!1,n=2,l=j(0,0,0);const c=T(we),d=t.baseColorTexture,h=t.metallicRoughnessTexture,u=t.emissionTexture,m=t.occlusionTexture,p=t.normalTexture;return e&&(s=E(e.baseColorFactor),r=e.alphaCutoff??Ve,i&&(v(c,e.metallicFactor,e.roughnessFactor,0),e.emissiveFactor&&(l=e.emissiveFactor)),o=oe[e.alphaMode],a=e.isDoubleSided,n=ae[e.faceCulling??"NotSet"]),{isIntegratedMesh:!0,baseColor:s,textureAlphaCutoff:r,mrrFactors:c,baseColorTexture:d,metallicRoughnessTexture:h,normalTexture:p,occlusionTexture:m,emissionTexture:u,hasParametersFromSource:!1,sphereDepthInterpolate:this.layer.hasGoogleUrl,alphaDiscardMode:o,doubleSided:a,cullFace:n,isGround:this.layer.replacesTerrain,emissiveBaseColor:l,usePBR:i,slicePlaneEnabled:this.slicePlaneEnabled,opacity:this.fullOpacity,polygonOffset:0,ellipsoidMode:1,applySSAO:this._applySSAO}}freeRenderable(e){const t=this._lyrHandleToObjects.get(e);t?(t.isLoaded?(this._loadedObjects.delete(t),this._visibleObjects.delete(t),this._intersectionHandler.removeTile(t),this._usedMemory-=t.usedMemory):this._cacheMemory-=t.usedMemory,this.freeObject(t),this._lyrHandleToObjects.delete(e)):this._dbg(3,`freeRendedrable on non-existent renderable ${e}`)}freeObject(e){const t=Le(e.handle);this._memCache.pop(t),e.textures.forEach(e=>this._stage.removeTexture(e)),e.componentObjects.forEach(e=>this._collection.destroyObject(e))}setRenderableVisibility(e,t,i){if(this.destroyed||this.destroying)return;const s=this._frustum,r=new Array;let o=!1,a=!1;for(let n=0;n<i;++n){if(!t[n])continue;const i=e[n],l=this._lyrHandleToObjects.get(i);if(l){if(l.isLoaded){this._dbg(3,`Already loaded object marked loaded again ${l.stableNodeId}`);continue}o=!0,l.isLoaded=!0,this._loadedObjects.add(l),this._intersectionHandler.addTile(l),this._usedMemory+=l.usedMemory,this._cacheMemory-=l.usedMemory;const e=l.obb?.intersectsFrustum(s)??!0;l.isVisible=e,e&&(this._visibleObjects.add(l),a||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(e,l.elevationRange)),e&&l.obb&&r.push(l.obb),l.componentObjects.forEach(t=>{this._collection.setObjectVisibility(t,e)}),this._memCache.pop(Le(i))}else this._dbg(3,`Tried to mark Non existent object ${i} as loaded`)}for(let n=0;n<i;++n){const i=e[n];if(t[n])continue;const s=this._lyrHandleToObjects.get(i);if(s){if(!s.isLoaded){this._dbg(3,`Tried to unload not-loaded object ${s.stableNodeId}`);continue}const e=s.isVisible;this._visibleObjects.delete(s),s.isVisible=!1,s.isLoaded=!1,this._loadedObjects.delete(s),this._intersectionHandler.removeTile(s),e&&(this._visibleGeometryChanged(),a||=this._isVisibileElevationRangeModifiedByChangedTileVisbility(!1,s.elevationRange)),this._usedMemory-=s.usedMemory,this._cacheMemory+=s.usedMemory,e&&s.obb&&r.push(s.obb),s.componentObjects.forEach(e=>{this._collection.setObjectVisibility(e,!1)}),this._memCache.put(Le(i),s)}else this._dbg(3,`Tried to mark Non existent object ${i} as not loaded`)}o&&this._visibleGeometryChanged(),this._elevationProvider.notifyObjectsChanged(r),a&&this._setVisibleElevationRangeDirty()}setLodPixelThreshold(e){this._wasm?.setLodPixelThreshold(this,e)}_isVisibileElevationRangeModifiedByChangedTileVisbility(e,t){const{visibleElevationRange:i}=this,{minElevation:s,maxElevation:r}=t;return e?s<i.minElevation||r>i.maxElevation:s===i.minElevation||r===i.maxElevation}_getTexture(e,t,i){const s=e&&t.desc?.images?.[e.imageId];if(!s||!t.data?.buffer)return null;const r=i.get(s)??this._createTexture(e,t,i);return r?new ye(this._stage.renderView.textures,r.id):null}_createTexture(e,t,i){const s=e&&t.desc?.images?.[e.imageId];if(!s||!t.data?.buffer)return null;const r=this._stage.renderView.renderingContext.parameters.maxMaxAnisotropy,o=!!s.mipCount||r>1,a=ne[e.wrapMode??"None"];let n=s.alpha?6408:6407;const l=new Uint8Array(t.data.buffer,s.data.byteOffset,s.data.byteCount);let c=null,d=null,h=null;switch(s.format){case"Raw":"R8"===s.pixelFormat?(c=l,n=6403,d=""):"Rg8"===s.pixelFormat||"Ga8"===s.pixelFormat?(c=l,n=33319,d=""):"Rgb8"===s.pixelFormat?(c=l,n=6407,d=""):"Rgba8"===s.pixelFormat&&(c=l,n=6408,d="");break;case"Dxt1":c=l,n=6407,d="image/vnd-ms.dds";break;case"Dxt5":c=l,n=6408,d="image/vnd-ms.dds";break;case"Basis":c=l,n=6407,d="image/ktx2";break;case"Png":d="image/png",h=document.createElement("img");break;case"Jpeg":d="image/jpeg",h=document.createElement("img");break;case"Etc2":d="image/ktx",h=document.createElement("img");break;case"Astc":this._dbg(3,"Astc texture not supported");break;case"Pvrtc":this._dbg(3,"Pvrtc texture not supported")}if(h&&d){const e=new Blob([l],{type:d});h.src=URL.createObjectURL(e),c=h}if(c&&null!=d){const e=has("enable-feature:esri-compress-IM-textures")?{compressionTracker:this._compressionTracker}:void 0,t=Ue(n,d,s.format),l=new _e(c,{mipmap:o,maxAnisotropy:r,encoding:d,wrap:a,pixelFormat:n,internalFormat:t??void 0,immutable:null!=t,compressionOptions:e,noUnpackFlip:!0,width:s.mip0Width,height:s.mip0Height});return this._stage.addTexture(l),i.set(s,l),l}return null}getBufferViews(e,t){let i,s,r,o,a;for(let l=0;l<e.atrbs.length;l++){const a=e.atrbs[l],{view:c}=a,d=void 0,h=c.byteOffset+c.byteCount;try{switch(a.sem){case"Position":3!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Position ("+c+")"):i=new G(t,c.byteOffset,d,h);break;case"Normal":if(3!==c.ncomp||"F32"!==c.type)this._dbg(3,"[Unsupported Feature] Unsupported view for Normal ("+c+")");else{const e=new G(t,c.byteOffset,d,h);o=new Uint32Array(e.count),ve(e.typedBuffer,new Int16Array(o.buffer,o.byteOffset,2*o.length))}break;case"TexCoord":2!==c.ncomp||"F32"!==c.type?this._dbg(3,"[Unsupported Feature] Unsupported view for Texcoord ("+c+")"):void 0===r&&(r=new N(t,c.byteOffset,d,h).typedBuffer);break;case"Color":4===c.ncomp?("F32"===c.type&&(s=new L(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new A(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new F(t,c.byteOffset,d,h))):3===c.ncomp&&("F32"===c.type&&(s=new G(t,c.byteOffset,d,h)),"U8"===c.type&&(s=new B(t,c.byteOffset,d,h)),"U16"===c.type&&(s=new z(t,c.byteOffset,d,h))),null==s&&this._dbg(2,"[Unsupported Feature] Unsupported view for Color ("+c+")");break;case"FeatureIndex":break;default:this._dbg(2,"[Unsupported Feature] Unsupported semantic ("+a.sem+"). Skipping vertex attribute.")}}catch(n){this._dbg(2,"Error Creating buffer ("+n+"). Skipping vertex attribute.")}}if(e.index){const i=e.index.view,s=void 0,r=i.byteOffset+i.byteCount;switch(e.index.view.type){case"U16":a=new q(t,i.byteOffset,s,r);break;case"U32":a=new W(t,i.byteOffset,s,r);break;default:this._dbg(3,"[Unsupported Feature] index type not supported ("+i.type+").")}}if(null==a&&null!=i){const e=i.count;a=a=e<65535?new q(new Uint16Array(e).buffer):new W(new Uint32Array(e).buffer);for(let t=0;t<e;t++)a.set(t,t)}return{positionView:i,colorView:s,texCoord0Data:r,indicesView:a,normalsData:o}}_loadModifications(){if(this.removeHandles("modifications"),null==this.layer.modifications)return void(this._modifications=[]);const e=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>e,()=>{this._modifications=e.filter(e=>!(this.layer.isUsedAsGroundLayer&&"replace"!==e.type)).toArray(),this._modifications.length<e.length&&t.getLogger(this).info("Ground layers only support replace modifications. Other modification types have been ignored.")},o),"modifications")}_deletePerObjectData(e){this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}_dbg(e,i){this._dbgFlags.has(e)&&(3===e?t.getLogger(this).error(i):t.getLogger(this).warn(i))}};e([c()],He.prototype,"fullOpacity",null),e([c({readOnly:!0})],He.prototype,"ready",null),e([c({type:[$]})],He.prototype,"_modifications",void 0),e([c()],He.prototype,"_visibleGeometryChangedSchedulerHandle",void 0),e([c()],He.prototype,"layer",void 0),e([c({readOnly:!0})],He.prototype,"visibleAtCurrentScale",null),e([c({readOnly:!0})],He.prototype,"_collection",null),e([c()],He.prototype,"elevationOffset",null),e([c({readOnly:!0})],He.prototype,"visibleElevationRange",null),He=e([d("esri.views.3d.layers.IntegratedMesh3DTilesLayerView3D")],He);const De=He;class Pe{constructor(e,t,i,s,r,o,a,n,l,c){this.handle=e,this.componentObjects=t,this.textures=i,this.cpuMemoryUsage=s,this.vboMemoryUsage=r,this.textureMemoryUsage=o,this.obb=a,this.stableNodeId=n,this.nodeDepth=l,this.elevationRange=c,this.bvhIntersectionGeneration=0,this.isLoaded=!1,this.isVisible=!1;const d=w();a?.getCenter(d),this._obbCenterX=d[0],this._obbCenterY=d[1],this._obbCenterZ=d[2];const h=a?.radius??-1;this._obbRadius=h,this._obbRadiusSquared=h*h;const u=a?.halfSize;this._obbShortestHalfsize=u?Math.min(u[0],u[1],u[2]):0,this._mbsCenter=a?T(a.center):C}get usedMemory(){return this.textureMemoryUsage+this.vboMemoryUsage+this.cpuMemoryUsage}get mbsRadius(){return this._obbRadius}get mbsCenter(){return this._mbsCenter}boundingVolumeIntersectsRay(e,t){if(!this.obb)return!0;const{_obbCenterX:i,_obbCenterY:s,_obbCenterZ:r}=this,o=i-e[0],a=s-e[1],n=r-e[2],l=o*t[0]+a*t[1]+n*t[2];return o*o+a*a+n*n-l*l<=this._obbRadiusSquared&&this.obb.intersectRay(e,t)}boundingVolumeIntersectsSphere(e){const t=this._obbRadius;if(t<0)return!0;const i=e.center,s=e.radius,r=t+s,o=this._obbCenterX-i[0];if(o>r)return!1;const a=this._obbCenterY-i[1];if(a>r)return!1;const n=this._obbCenterZ-i[2];if(n>r)return!1;const l=o*o+a*a+n*n;if(l>r*r)return!1;if(l<=(this._obbShortestHalfsize+s)**2)return!0;const c=s-t;return c>0&&l<=c*c||(this.obb?.intersectSphere(e)??!0)}}function Ie(e){return Math.round(e/1048.576)/1e3}function ke(e){return new me(e.center,e.halfSize,f(...e.quaternion))}function Le(e){return`${e}`}const Ae=new Array;class Fe{constructor(e,t,i,s,r,o){this.materialPromise=e,this.baseColorTexture=t,this.metallicRoughnessTexture=i,this.emissionTexture=s,this.occlusionTexture=r,this.normalTexture=o}cleanup(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}}function Ge(e){return null!=e.data&&("string"==typeof e.desc&&(e.desc=JSON.parse(e.desc)),null!=e.desc)}export{De as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{destroyHandle as i}from"../../../core/handleUtils.js";import{subclass as t}from"../../../core/accessorSupport/decorators.js";import s from"./DrapedSubView3D.js";import{DynamicLayerView3D as r}from"./DynamicLayerView3D.js";import{SublayerPopupHighlightHelper3D as p}from"./support/SublayerPopupHighlightHelper3D.js";import a from"../../layers/MapImageLayerView.js";let o=class extends(a(r)){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add(()=>this.exportImageVersion,()=>this._updatingHandles.addPromise(this.refreshDebounced())),this._popupHighlightHelper=new p({view:this.view,layerView:this,updatingHandles:this._updatingHandles}),this.addHandles(i(this._popupHighlightHelper))}fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i)}highlight(e,i){return this._popupHighlightHelper.highlight(e,i)}getFetchOptions(){return{timeExtent:this.timeExtent,scale:this.view.scale}}_initSubView(){this.subView=new s({layerView:this})}};o=e([t("esri.views.3d.layers.MapImageLayerView3D")],o);const h=o;export{h as default};
2
+ import{__decorate as e}from"tslib";import{destroyHandle as t}from"../../../core/handleUtils.js";import{subclass as i}from"../../../core/accessorSupport/decorators.js";import r from"./DrapedSubView3D.js";import{DynamicLayerView3D as s}from"./DynamicLayerView3D.js";import{SublayerPopupHighlightHelper3D as p}from"./support/SublayerPopupHighlightHelper3D.js";import a from"../../layers/MapImageLayerView.js";let h=class extends(a(s)){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add(()=>this.exportImageVersion,()=>this._updatingHandles.addPromise(this.refreshDebounced())),this._popupHighlightHelper=new p({view:this.view,layerView:this,updatingHandles:this._updatingHandles}),this.addHandles(t(this._popupHighlightHelper))}fetchPopupFeaturesAtTarget(e,t){return this._popupHighlightHelper.fetchPopupFeaturesAtTarget(e,t)}highlight(e,t){return this._popupHighlightHelper.highlight(e,t)}getFetchOptions(){return{timeExtent:this.timeExtent,scale:this.view.scale}}_initSubView(){this.subView=new r({layerView:this})}};h=e([i("esri.views.3d.layers.MapImageLayerView3D")],h);const o=h;export{o as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{destroyHandle as i,makeHandle as r}from"../../../core/handleUtils.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as a}from"../../../geometry/projectionUtils.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{SublayerPopupHighlightHelper3D as h}from"./support/SublayerPopupHighlightHelper3D.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as u}from"../../layers/support/MapServiceLayerViewHelper.js";let c=class extends(f(n(p(m)))){constructor(){super(...arguments),this.type="tile-3d"}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get tileInfo(){return this.layer.tileInfo}initialize(){if("web-tile"===this.layer.type){const e=this.layer.fullExtent?.spatialReference,i=this.layer.tileInfo?.spatialReference;if(null==e||null==i||!a(e,i)){const e="defaults"===this.layer.originOf("fullExtent")||null==this.layer.fullExtent?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new t("layerview:incompatible-fullextent",e)))}}if(u(this,this.layer)){const e=new h({view:this.view,layerView:this,updatingHandles:this._updatingHandles});this._popupHighlightHelper=e,this.addHandles(i(e))}this._addTilingSchemeMatchPromise()}async fetchTile([e,t,i],r){const o=await this.layer.fetchImageBitmapTile(e,t,i,{...r,allowDeriveTypeFromData:!0,imageOrientation:"flipY"});return s(r),o}async fetchPopupFeaturesAtLocation(e,t){return this._popupHighlightHelper?.fetchPopupFeaturesAtLocation(e,t)??[]}highlight(e,t){return this._popupHighlightHelper?.highlight(e,t)??r()}async doRefresh(){this.suspended||this.emit("data-changed")}};e([o()],c.prototype,"imageFormatIsOpaque",null),e([o()],c.prototype,"hasMixedImageFormats",null),e([o()],c.prototype,"layer",void 0),e([o()],c.prototype,"tileInfo",null),c=e([l("esri.views.3d.layers.TileLayerView3D")],c);const y=c;export{y as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{destroyHandle as i,makeHandle as r}from"../../../core/handleUtils.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{property as l,subclass as o}from"../../../core/accessorSupport/decorators.js";import{canProjectWithoutEngine as a}from"../../../geometry/projectionUtils.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as n}from"./TiledLayerView3D.js";import{SublayerPopupHighlightHelper3D as h}from"./support/SublayerPopupHighlightHelper3D.js";import m from"../../layers/LayerView.js";import{RefreshableLayerView as f}from"../../layers/RefreshableLayerView.js";import{isMapServiceLayerView as u}from"../../layers/support/MapServiceLayerViewHelper.js";let y=class extends(f(n(p(m)))){constructor(){super(...arguments),this.type="tile-3d"}get imageFormatIsOpaque(){return"jpg"===this.layer.tileInfo.format}get hasMixedImageFormats(){return"mixed"===this.layer.tileInfo.format}get tileInfo(){return this.layer.tileInfo}initialize(){if("web-tile"===this.layer.type){const e=this.layer.fullExtent?.spatialReference,i=this.layer.tileInfo?.spatialReference;if(null==e||null==i||!a(e,i)){const e="defaults"===this.layer.originOf("fullExtent")||null==this.layer.fullExtent?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new t("layerview:incompatible-fullextent",e)))}}if(u(this,this.layer)){const e=new h({view:this.view,layerView:this,updatingHandles:this._updatingHandles});this._popupHighlightHelper=e,this.addHandles(i(e))}this._addTilingSchemeMatchPromise()}async fetchTile([e,t,i],r){const l=await this.layer.fetchImageBitmapTile(e,t,i,{...r,allowDeriveTypeFromData:!0,imageOrientation:"flipY"});return s(r),l}async fetchPopupFeaturesAtTarget(e,t){return this._popupHighlightHelper?.fetchPopupFeaturesAtTarget(e,t)??[]}highlight(e,t){return this._popupHighlightHelper?.highlight(e,t)??r()}async doRefresh(){this.suspended||this.emit("data-changed")}};e([l()],y.prototype,"imageFormatIsOpaque",null),e([l()],y.prototype,"hasMixedImageFormats",null),e([l()],y.prototype,"layer",void 0),e([l()],y.prototype,"tileInfo",null),y=e([o("esri.views.3d.layers.TileLayerView3D")],y);const c=y;export{c as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isValidIntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as e,LayerTarget as r}from"../../webgl-engine/lib/IntersectorTarget.js";class s extends e{constructor(t,e){super(e,null),this.point=t}}function n(e){return t(e)&&0===e.intersector&&!!e.target}class i extends e{constructor(t,e,r,s){super(e,r),this.point=t,this.createGraphic=s}}function o(e){return t(e)&&6===e.intersector&&!!e.target}class c extends r{constructor(t,e,r,s,n){super(t),this.layerViewUid=t,this.sublayerId=e,this.nodeIndex=r,this.componentIndex=s,this.triangleNr=n}}class u extends e{constructor(t,e,r){super(e,null),this.point=t,this.createVoxelGraphic=r}}class l extends r{}function a(e){return t(e)&&2===e.intersector&&!!e.target}function p(e){return t(e)&&9===e.intersector&&!!e.target}export{s as GaussianSplatTarget,c as I3sTarget,i as PclTarget,l as Tiles3DTarget,u as VoxelTarget,n as isGaussianSplatIntersectorResult,a as isI3sIntersectorResult,o as isPclIntersectorResult,p as isVoxelIntersectorResult};
2
+ import{isValidIntersectorResult as t}from"../../webgl-engine/lib/IntersectorResult.js";import{Graphic3DTarget as e,LayerTarget as r}from"../../webgl-engine/lib/IntersectorTarget.js";class s extends e{constructor(t,e,r){super(r,null),this.point=t,this.outwardDirection=e}}function n(e){return t(e)&&0===e.intersector&&!!e.target}class i extends e{constructor(t,e,r,s){super(e,r),this.point=t,this.createGraphic=s}}function o(e){return t(e)&&6===e.intersector&&!!e.target}class c extends r{constructor(t,e,r,s,n){super(t),this.layerViewUid=t,this.sublayerId=e,this.nodeIndex=r,this.componentIndex=s,this.triangleNr=n}}class u extends e{constructor(t,e,r){super(e,null),this.point=t,this.createVoxelGraphic=r}}class a extends r{}function l(e){return t(e)&&2===e.intersector&&!!e.target}function h(e){return t(e)&&9===e.intersector&&!!e.target}export{s as GaussianSplatTarget,c as I3sTarget,i as PclTarget,a as Tiles3DTarget,u as VoxelTarget,n as isGaussianSplatIntersectorResult,l as isI3sIntersectorResult,o as isPclIntersectorResult,h as isVoxelIntersectorResult};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{unpackFieldNames as s,populateMissingFields as a}from"../../../../layers/support/fieldUtils.js";import{getFetchPopupTemplate as o,getRequiredFields as p}from"../../../layers/support/popupUtils.js";const i=i=>{const c=i;let n=class extends c{_validateFetchPopupFeatures(e){const{layer:r}=this,{popupEnabled:s}=r;if(!s)throw new t("scenelayerview3d:fetchPopupFeatures","Popups are disabled",{layer:r});if(!o(r,e))throw new t("scenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{layer:r})}async prepareFetchPopupFeatures(e){}async fetchPopupFeaturesFromGraphics(e,t){if(this._validateFetchPopupFeatures(t),0===e.length)return[];const r="scene"===this.layer.type&&null!=this.layer.associatedLayer?this.layer.associatedLayer:this.layer;let i=[];"fieldsIndex"in this.layer&&(i=s(this.layer.fieldsIndex,await p(r,o(this.layer,t)))),await this.prepareFetchPopupFeatures(i);const c=new Set,n=[],l=[];for(const s of e)a(s,i,c)?l.push(s):n.push(s);if(0===l.length)return n;const u=new Map;for(let s=0;s<e.length;s++)u.set(e[s].getObjectId()??0,s);const h=await this.whenGraphicAttributes(l,[...c]).catch(()=>l).then(e=>n.concat(e));return h.sort((e,t)=>{const r=e.getObjectId()??0,s=u.get(r)??0,a=t.getObjectId()??0;return s-(u.get(a)??0)}),h}};return n=e([r("esri.views.3d.layers.support.PopupSceneLayerView")],n),n};export{i as PopupSceneLayerView};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{unpackFieldNames as s,populateMissingFields as a}from"../../../../layers/support/fieldUtils.js";import{getFetchPopupTemplate as o,getRequiredFields as p}from"../../../layers/support/popupUtils.js";const i=i=>{const c=i;let n=class extends c{_validateFetchPopupFeatures(e){const{layer:r}=this,{popupEnabled:s}=r;if(!s)throw new t("scenelayerview3d:fetchPopupFeatures","Popups are disabled",{layer:r});if(!o(r,e))throw new t("scenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{layer:r})}async prepareFetchPopupFeatures(e){}async patchFeaturesForPopup(e,t){if(this._validateFetchPopupFeatures(t),0===e.length)return[];const r="scene"===this.layer.type&&null!=this.layer.associatedLayer?this.layer.associatedLayer:this.layer;let i=[];"fieldsIndex"in this.layer&&(i=s(this.layer.fieldsIndex,await p(r,o(this.layer,t)))),await this.prepareFetchPopupFeatures(i);const c=new Set,n=[],l=[];for(const s of e)a(s,i,c)?l.push(s):n.push(s);if(0===l.length)return n;const u=new Map;for(let s=0;s<e.length;s++)u.set(e[s].getObjectId()??0,s);const h=await this.whenGraphicAttributes(l,[...c]).catch(()=>l).then(e=>n.concat(e));return h.sort((e,t)=>{const r=e.getObjectId()??0,s=u.get(r)??0,a=t.getObjectId()??0;return s-(u.get(a)??0)}),h}};return n=e([r("esri.views.3d.layers.support.PopupSceneLayerView")],n),n};export{i as PopupSceneLayerView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as t}from"../../../../core/promiseUtils.js";import{when as s,initial as h,watch as p,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{property as o,subclass as l}from"../../../../core/accessorSupport/decorators.js";import{ImageHighlightHelper3D as g}from"./ImageHighlightHelper3D.js";import{MapServiceLayerViewHelper as c}from"../../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as d}from"../../../support/drapedUtils.js";let u=class extends i{constructor(e){super(e)}initialize(){this._highlightHelper=new g({layer:this.layerView.layer,view:this.view,updatingHandles:this.updatingHandles}),this._mapServiceLayerViewHelper=new c({createFetchPopupFeaturesQueryGeometry:(e,i)=>d(e,i,this.view),layerView:this.layerView,updatingHandles:this.updatingHandles,highlightGraphics:this._highlightHelper.graphics,highlightGraphicUpdated:e=>this._highlightHelper.graphicsView?.graphicChanged(e)}),this.addHandles([r(this._mapServiceLayerViewHelper),s(()=>this._mapServiceLayerViewHelper.highlightFeaturesActive&&this.view?.stationary,()=>t(this._mapServiceLayerViewHelper.updateHighlightedFeatures(this.view.resolution)),h),p(()=>this.layerView.suspended,e=>this._highlightHelper.suspended=e,a)])}fetchPopupFeaturesAtLocation(e,i){return this._highlightHelper.preload(),this._mapServiceLayerViewHelper.fetchPopupFeaturesAtLocation(e,i)}highlight(e,i){return this._highlightHelper.highlight(e,i)}};e([o()],u.prototype,"view",void 0),e([o()],u.prototype,"layerView",void 0),e([o()],u.prototype,"updatingHandles",void 0),u=e([l("esri.views.3d.layers.support.SublayerPopupHighlightHelper3D")],u);export{u as SublayerPopupHighlightHelper3D};
2
+ import{__decorate as e}from"tslib";import i from"../../../../core/Accessor.js";import{destroyHandle as r}from"../../../../core/handleUtils.js";import{ignoreAbortErrors as t}from"../../../../core/promiseUtils.js";import{when as s,initial as h,watch as p,syncAndInitial as a}from"../../../../core/reactiveUtils.js";import{property as l,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{ImageHighlightHelper3D as g}from"./ImageHighlightHelper3D.js";import{MapServiceLayerViewHelper as d}from"../../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as c}from"../../../support/drapedUtils.js";let u=class extends i{constructor(e){super(e)}initialize(){this._highlightHelper=new g({layer:this.layerView.layer,view:this.view,updatingHandles:this.updatingHandles}),this._mapServiceLayerViewHelper=new d({createFetchPopupFeaturesQueryGeometry:(e,i)=>c(e,i,this.view),layerView:this.layerView,updatingHandles:this.updatingHandles,highlightGraphics:this._highlightHelper.graphics,highlightGraphicUpdated:e=>this._highlightHelper.graphicsView?.graphicChanged(e)}),this.addHandles([r(this._mapServiceLayerViewHelper),s(()=>this._mapServiceLayerViewHelper.highlightFeaturesActive&&this.view?.stationary,()=>t(this._mapServiceLayerViewHelper.updateHighlightedFeatures(this.view.resolution)),h),p(()=>this.layerView.suspended,e=>this._highlightHelper.suspended=e,a)])}fetchPopupFeaturesAtTarget(e,i){return this._highlightHelper.preload(),this._mapServiceLayerViewHelper.fetchPopupFeaturesAtTarget(e,i)}highlight(e,i){return this._highlightHelper.highlight(e,i)}};e([l()],u.prototype,"view",void 0),e([l()],u.prototype,"layerView",void 0),e([l()],u.prototype,"updatingHandles",void 0),u=e([o("esri.views.3d.layers.support.SublayerPopupHighlightHelper3D")],u);export{u as SublayerPopupHighlightHelper3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{removeMaybe as s,destroyMaybe as i}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{signal as l}from"../../../core/signal.js";import{secondsFromMilliseconds as m}from"../../../core/time.js";import{property as n,subclass as d}from"../../../core/accessorSupport/decorators.js";import{newMemoryController as h}from"./MemoryController.js";import{ImmediateTask as u,newScheduler as p,TaskPriority as c}from"../../support/Scheduler.js";let _=class extends t{constructor(){super(...arguments),this.updating=!1}};function v(e){return new y({view:e})}function g(e,t){return t&&2===e?1:e}e([n({readOnly:!0})],_.prototype,"updating",void 0),_=e([d("esri.views.3d.support.ResourceController.ResourceControllerMain")],_);let y=class extends _{constructor(){super(...arguments),this._immediateTask=u,this._normalTask=u,this._updatingObjects=l([]),this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler=p(),this._memoryController=h(this.view),this.addHandles([o(()=>this.view.stationary,()=>this._stationaryChangedHandler())]),this._frameTask=a({update:e=>this._frame(e)}),this._immediateTask=this._scheduler.registerTask(c.RESOURCE_CONTROLLER_IMMEDIATE),this._normalTask=this._scheduler.registerTask(c.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove(),this._normalTask.remove(),this._frameTask=s(this._frameTask),this._memoryController=i(this._memoryController),this._scheduler=i(this._scheduler),this.view=null}get updating(){return!(!this._memoryController?.updating&&!this._immediateTask?.updating)||this._updatingObjects?.value.some(e=>e.updating)}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}addUpdatingObject(e){const t=this._updatingObjects;return t.value=[...t.value,e],r(()=>{t.value=t.value.filter(t=>t!==e)})}_frame(e){this.view.suspended||this.view.stateManager&&(this.view.stateManager.step(m(e.deltaTime)),!this._scheduler)||(this._memoryController.update(),this.view.state&&(this._scheduler.state=g(this.view.state.mode,this.view.state.fading),this.view.state.fading=!1),this._scheduler.frame(e))}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}};e([n()],y.prototype,"view",void 0),e([n()],y.prototype,"_scheduler",void 0),e([n()],y.prototype,"_memoryController",void 0),e([n()],y.prototype,"_immediateTask",void 0),e([n()],y.prototype,"_normalTask",void 0),e([n({readOnly:!0})],y.prototype,"updating",null),y=e([d("esri.views.3d.support.ResourceController")],y);export{g as applyFadingToSchedulerState,v as newResourceController};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{makeHandle as r}from"../../../core/handleUtils.js";import{removeMaybe as s,destroyMaybe as i}from"../../../core/maybe.js";import{watch as o}from"../../../core/reactiveUtils.js";import{addFrameTask as a}from"../../../core/scheduling.js";import{signal as l}from"../../../core/signal.js";import{secondsFromMilliseconds as m}from"../../../core/time.js";import{property as n,subclass as d}from"../../../core/accessorSupport/decorators.js";import{newMemoryController as h}from"./MemoryController.js";import{ImmediateTask as u,newScheduler as p,TaskPriority as c}from"../../support/Scheduler.js";let _=class extends t{constructor(){super(...arguments),this.updating=!1}};function v(e){return new y({view:e})}function g(e,t){return t&&2===e?1:e}e([n({readOnly:!0})],_.prototype,"updating",void 0),_=e([d("esri.views.3d.support.ResourceController.ResourceControllerMain")],_);let y=class extends _{constructor(){super(...arguments),this._immediateTask=u,this._normalTask=u,this._updatingObjects=l([]),this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler=p(),this._memoryController=h(this.view),this.addHandles([o(()=>this.view.stationary,()=>this._stationaryChangedHandler())]),this._frameTask=a({update:e=>this._frame(e)}),this._immediateTask=this._scheduler.registerTask(c.RESOURCE_CONTROLLER_IMMEDIATE),this._normalTask=this._scheduler.registerTask(c.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove(),this._normalTask.remove(),this._frameTask=s(this._frameTask),this._memoryController=i(this._memoryController),this._scheduler=i(this._scheduler),this.view=null}get updating(){return!!this._memoryController?.updating||!!this._immediateTask?.updating||!!this._normalTask?.updating||this._updatingObjects?.value.some(e=>e.updating)}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}addUpdatingObject(e){const t=this._updatingObjects;return t.value=[...t.value,e],r(()=>{t.value=t.value.filter(t=>t!==e)})}_frame(e){this.view.suspended||this.view.stateManager&&(this.view.stateManager.step(m(e.deltaTime)),!this._scheduler)||(this._memoryController.update(),this.view.state&&(this._scheduler.state=g(this.view.state.mode,this.view.state.fading),this.view.state.fading=!1),this._scheduler.frame(e))}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}};e([n()],y.prototype,"view",void 0),e([n()],y.prototype,"_scheduler",void 0),e([n()],y.prototype,"_memoryController",void 0),e([n()],y.prototype,"_immediateTask",void 0),e([n()],y.prototype,"_normalTask",void 0),e([n({readOnly:!0})],y.prototype,"updating",null),y=e([d("esri.views.3d.support.ResourceController")],y);export{g as applyFadingToSchedulerState,v as newResourceController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{subtract as t,length as i,scale as e,negate as s,dot as n,transformQuatValues as o,set as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as c}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{project as u}from"../../../../geometry/projectionUtils.js";import{intersects as d,contains as p}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as f}from"../../../../geometry/support/aaBoundingRect.js";import{create as h}from"../../../../geometry/support/plane.js";import{fromPoints as m}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as y}from"../../layers/i3s/Intersector.js";import{createTileBVH as g}from"../../layers/support/Tiles3DBVH.js";import{ElevationRange as b}from"../ElevationRange.js";import{IntersectorResult as w}from"../../webgl-engine/lib/IntersectorResult.js";class v{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this._ellipsoidLocalRayOrigin=l(),this._ellipsoidLocalRayDir=l(),this.intersectionNormal=l(),this.intersectionRayDir=l(),this.intersectionPlane=h(),this.layerViewUid=t.uid;const i=t.view.viewingMode,e=(t.useEsriCrs?t.fullExtentInLocalViewSpatialReference:t.layer.fullExtent?u(t.layer.fullExtent,t.view.renderSpatialReference):void 0)??t.view.extent,s=f(e);this._bvh=g(i,s)}destroy(){this._bvh.destroy()}addTile(t){this._bvh.addTile(t)}removeTile(t){this._bvh.removeTile(t)}intersect(o,l,u,f,h,g){const{intersectionRayDir:b,intersectionPlane:v,layerViewUid:_,intersectionNormal:j}=this,E=m(u,f);t(b,f,u);const M=1/i(b);e(b,b,M),s(j,b),c(v,b[0],b[1],b[2],-n(b,u));const S=new x,V=new x,k=o.options.store,T=0===k,q=2===k,B=1===k||q,D=q?new Array:null,P=(t,i,e,s,n)=>(t.point=t.point?r(t.point,e,s,n):a(e,s,n),t.dist=i,t.normal=j,t.layerViewUid=_,t),U=u[0],I=u[1],L=u[2],G=b[0],O=b[1],C=b[2],A=this.layerView.clippingBox,N=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:s,gaussianCount:n,obb:o,maxSplatMbsRadiusSquared:r}=t,a=o.centerX,c=o.centerY,d=o.centerZ;let p=-1;const h=A[0],m=A[1],y=A[2],g=A[3],b=A[4],w=A[5];for(let v=0,R=0;v<n;v++,R+=3){const t=i[R]+a,n=i[R+1]+c,o=i[R+2]+d;if(t<h||n<m||o<y||t>g||n>b||o>w)continue;const _=t-U,j=n-I,E=o-L,k=_*G+j*O+E*C;if(k<0&&k*k>r)continue;const A=k<0?0:k;if(_*_+j*j+E*E-A*A>r)continue;if(T&&null!=S.dist){p<0&&(p=Math.sqrt(r));if(Math.max(k-p,0)*M>=S.dist)continue}const N=this._intersectGaussianEllipsoid(_,j,E,G,O,C,e[v],s[v]);if(N<0)continue;const X=N*M;if(null!=l&&!l(u,f,X))continue;const Y=null==S.dist||X<S.dist,Z=B&&(null==V.dist||X>V.dist);if(!Y&&!Z&&!q)continue;const F=U+G*N,H=I+O*N,Q=L+C*N;if(Y&&P(S,X,F,H,Q),Z&&P(V,X,F,H,Q),q){const t=new x;D.push(P(t,X,F,H,Q))}}},X=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:s,gaussianCount:n,obb:o,maxSplatMbsRadiusSquared:r}=t,a=o.centerX,c=o.centerY,d=o.centerZ;let p=-1;const h=U-a,m=I-c,y=L-d;for(let g=0,b=0;g<n;g++,b+=3){const t=i[b]-h,n=i[b+1]-m,o=i[b+2]-y,a=t*G+n*O+o*C;if(a<0&&a*a>r)continue;const c=a<0?0:a;if(t*t+n*n+o*o-c*c>r)continue;if(T&&null!=S.dist){p<0&&(p=Math.sqrt(r));if(Math.max(a-p,0)*M>=S.dist)continue}const d=this._intersectGaussianEllipsoid(t,n,o,G,O,C,e[g],s[g]);if(d<0)continue;const w=d*M;if(null!=l&&!l(u,f,w))continue;const v=null==S.dist||w<S.dist,R=B&&(null==V.dist||w>V.dist);if(!v&&!R&&!q)continue;const _=U+G*d,j=I+O*d,E=L+C*d;if(v&&P(S,w,_,j,E),R&&P(V,w,_,j,E),q){const t=new x;D.push(P(t,w,_,j,E))}}},Y=(t,i)=>{const{min:e,max:s}=t.obb.signedDistanceRangePlane(v);if(s<0)return;const n=e*M;if(!(T&&null!=S.dist&&S.dist<n)){if(null!=S.dist&&null!=V.dist){const t=s*M;if(S.dist<n&&V.dist>t)return}i?N(t):X(t)}},Z=t=>{Y(t,!1)},F=t=>{const i=t.boundingBox;d(i,A)&&Y(t,!p(A,i))};this._bvh.forEachTileIntersectingRay(u,f,null!=A?F:Z,g);const H=(t,i)=>{const{layerViewUid:e}=i,s=new y(i.point,e);t.set(0,s,i.dist,i.normal)};if(R(S)){const t=o.results.min;(null==t.distance||S.dist<t.distance)&&H(t,S)}if(R(V)&&B){const t=o.results.max;(null==t.distance||V.dist>t.distance)&&H(t,V)}if(q&&D?.length)for(const t of D){const i=new w(E);H(i,t),o.results.all.push(i)}}_intersectGaussianEllipsoid(t,i,e,s,n,r,l,a){const c=l>>>30,u=1023&l,d=l>>>10&1023,p=l>>>20&1023,f=(u&_)*j*(1-2*(u>>>9&1)),h=(d&_)*j*(1-2*(d>>>9&1)),m=(p&_)*j*(1-2*(p>>>9&1));let y,g,b,w;const v=f*f+h*h+m*m,R=Math.sqrt(Math.max(0,1-v));switch(c){case 0:y=R,g=m,b=h,w=f;break;case 1:y=m,g=R,b=h,w=f;break;case 2:y=m,g=h,b=R,w=f;break;default:y=m,g=h,b=f,w=R}const x=this._ellipsoidLocalRayOrigin;x[0]=-t,x[1]=-i,x[2]=-e,o(x,x,-y,-g,-b,w);const M=this._ellipsoidLocalRayDir;M[0]=s,M[1]=n,M[2]=r,o(M,M,-y,-g,-b,w);const V=S[255&a],k=S[a>>>8&255],T=S[a>>>16],q=x[0]*V,B=x[1]*k,D=x[2]*T,P=q*q+B*B+D*D;if(P<=1)return 0;const U=M[0]*V,I=M[1]*k,L=M[2]*T,G=U*U+I*I+L*L,O=q*U+B*I+D*L;if(O>0)return E;const C=O*O-G*(P-1);return C<0?E:(-O-Math.sqrt(C))/G}getElevationRange(t){return this._bvh.getElevationRangeIntersectingSphere(t)??new b(0,0)}}function R(t){return null!=t.dist&&null!=t.point}class x{constructor(){this.point=null,this.dist=null,this.normal=null,this.layerViewUid=""}}const _=511,j=Math.SQRT1_2/_,E=-1,M=3,S=(()=>{const t=new Float64Array(256);for(let i=0;i<t.length;i++)t[i]=Math.exp(10-i/16)/M;return t})();export{v as GaussianSplatIntersectionHandler};
2
+ import{subtract as t,length as i,scale as e,negate as n,dot as s,transformQuatValues as o}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as l}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{project as a}from"../../../../geometry/projectionUtils.js";import{intersects as c,contains as u}from"../../../../geometry/support/aaBoundingBox.js";import{fromExtent as d}from"../../../../geometry/support/aaBoundingRect.js";import{create as p}from"../../../../geometry/support/plane.js";import{fromPoints as f}from"../../../../geometry/support/ray.js";import{GaussianSplatTarget as h}from"../../layers/i3s/Intersector.js";import{createTileBVH as m}from"../../layers/support/Tiles3DBVH.js";import{ElevationRange as y}from"../ElevationRange.js";import{IntersectorResult as g}from"../../webgl-engine/lib/IntersectorResult.js";class w{constructor(t){this.layerView=t,this.type=0,this.slicePlaneEnabled=!1,this.isGround=!1,this._ellipsoidLocalRayOrigin=r(),this._ellipsoidLocalRayDir=r(),this.intersectionNormal=r(),this.intersectionRayDir=r(),this.intersectionPlane=p(),this.layerViewUid=t.uid;const i=t.view.viewingMode,e=(t.useEsriCrs?t.fullExtentInLocalViewSpatialReference:t.layer.fullExtent?a(t.layer.fullExtent,t.view.renderSpatialReference):void 0)??t.view.extent,n=d(e);this._bvh=m(i,n)}destroy(){this._bvh.destroy()}addTile(t){this._bvh.addTile(t)}removeTile(t){this._bvh.removeTile(t)}intersect(o,a,d,p,m,y){const{intersectionRayDir:w,intersectionPlane:R,layerViewUid:x,intersectionNormal:_}=this,j=f(d,p);t(w,p,d);const M=1/i(w);e(w,w,M),n(_,w),l(R,w[0],w[1],w[2],-s(w,d));const E=new v,S=new v,D=o.options.store,V=0===D,k=2===D,q=1===D||k,T=k?new Array:null,B=(t,i,e,n,s,o,l,a)=>{const c=t.point??(t.point=r());c[0]=e,c[1]=n,c[2]=s,t.dist=i,t.normal=_;const u=t.outwardDirection??(t.outwardDirection=r()),d=o*o+l*l+a*a;if(d>0){const t=1/Math.sqrt(d);u[0]=o*t,u[1]=l*t,u[2]=a*t}else u[0]=_[0],u[1]=_[1],u[2]=_[2];return t.layerViewUid=x,t},P=d[0],U=d[1],I=d[2],L=w[0],G=w[1],O=w[2],C=this.layerView.clippingBox,A=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:n,gaussianCount:s,obb:o,maxSplatMbsRadiusSquared:r}=t,l=o.centerX,c=o.centerY,u=o.centerZ;let f=-1;const h=C[0],m=C[1],y=C[2],g=C[3],w=C[4],b=C[5];for(let R=0,x=0;R<s;R++,x+=3){const t=i[x]+l,s=i[x+1]+c,o=i[x+2]+u;if(t<h||s<m||o<y||t>g||s>w||o>b)continue;const _=t-P,j=s-U,D=o-I,C=_*L+j*G+D*O;if(C<0&&C*C>r)continue;const A=C<0?0:C;if(_*_+j*j+D*D-A*A>r)continue;if(V&&null!=E.dist){f<0&&(f=Math.sqrt(r));if(Math.max(C-f,0)*M>=E.dist)continue}const N=this._intersectGaussianEllipsoid(_,j,D,L,G,O,e[R],n[R]);if(N<0)continue;const X=N*M;if(null!=a&&!a(d,p,X))continue;const Y=null==E.dist||X<E.dist,Z=q&&(null==S.dist||X>S.dist);if(!Y&&!Z&&!k)continue;const F=L*N,H=G*N,Q=O*N,z=P+F,J=U+H,K=I+Q,W=F-_,$=H-j,tt=Q-D;if(Y&&B(E,X,z,J,K,W,$,tt),Z&&B(S,X,z,J,K,W,$,tt),k){const t=new v;T.push(B(t,X,z,J,K,W,$,tt))}}},N=t=>{const{relativePositions:i,packedRotations:e,packedOpacityScaledScales:n,gaussianCount:s,obb:o,maxSplatMbsRadiusSquared:r}=t,l=o.centerX,c=o.centerY,u=o.centerZ;let f=-1;const h=P-l,m=U-c,y=I-u;for(let g=0,w=0;g<s;g++,w+=3){const t=i[w]-h,s=i[w+1]-m,o=i[w+2]-y,l=t*L+s*G+o*O;if(l<0&&l*l>r)continue;const c=l<0?0:l;if(t*t+s*s+o*o-c*c>r)continue;if(V&&null!=E.dist){f<0&&(f=Math.sqrt(r));if(Math.max(l-f,0)*M>=E.dist)continue}const u=this._intersectGaussianEllipsoid(t,s,o,L,G,O,e[g],n[g]);if(u<0)continue;const b=u*M;if(null!=a&&!a(d,p,b))continue;const R=null==E.dist||b<E.dist,x=q&&(null==S.dist||b>S.dist);if(!R&&!x&&!k)continue;const _=L*u,j=G*u,D=O*u,C=P+_,A=U+j,N=I+D,X=_-t,Y=j-s,Z=D-o;if(R&&B(E,b,C,A,N,X,Y,Z),x&&B(S,b,C,A,N,X,Y,Z),k){const t=new v;T.push(B(t,b,C,A,N,X,Y,Z))}}},X=(t,i)=>{const{min:e,max:n}=t.obb.signedDistanceRangePlane(R);if(n<0)return;const s=e*M;if(!(V&&null!=E.dist&&E.dist<s)){if(null!=E.dist&&null!=S.dist){const t=n*M;if(E.dist<s&&S.dist>t)return}i?A(t):N(t)}},Y=t=>{X(t,!1)},Z=t=>{const i=t.boundingBox;c(i,C)&&X(t,!u(C,i))};this._bvh.forEachTileIntersectingRay(d,p,null!=C?Z:Y,y);const F=(t,i)=>{const{layerViewUid:e}=i,n=new h(i.point,i.outwardDirection,e);t.set(0,n,i.dist,i.normal)};if(b(E)){const t=o.results.min;(null==t.distance||E.dist<t.distance)&&F(t,E)}if(b(S)&&q){const t=o.results.max;(null==t.distance||S.dist>t.distance)&&F(t,S)}if(k&&T?.length)for(const t of T){const i=new g(j);F(i,t),o.results.all.push(i)}}_intersectGaussianEllipsoid(t,i,e,n,s,r,l,a){const c=l>>>30,u=1023&l,d=l>>>10&1023,p=l>>>20&1023,f=(u&R)*x*(1-2*(u>>>9&1)),h=(d&R)*x*(1-2*(d>>>9&1)),m=(p&R)*x*(1-2*(p>>>9&1));let y,g,w,b;const v=f*f+h*h+m*m,j=Math.sqrt(Math.max(0,1-v));switch(c){case 0:y=j,g=m,w=h,b=f;break;case 1:y=m,g=j,w=h,b=f;break;case 2:y=m,g=h,w=j,b=f;break;default:y=m,g=h,w=f,b=j}const E=this._ellipsoidLocalRayOrigin;E[0]=-t,E[1]=-i,E[2]=-e,o(E,E,-y,-g,-w,b);const S=this._ellipsoidLocalRayDir;S[0]=n,S[1]=s,S[2]=r,o(S,S,-y,-g,-w,b);const D=M[255&a],V=M[a>>>8&255],k=M[a>>>16],q=E[0]*D,T=E[1]*V,B=E[2]*k,P=q*q+T*T+B*B;if(P<=1)return 0;const U=S[0]*D,I=S[1]*V,L=S[2]*k,G=U*U+I*I+L*L,O=q*U+T*I+B*L;if(O>0)return _;const C=O*O-G*(P-1);return C<0?_:(-O-Math.sqrt(C))/G}getElevationRange(t){return this._bvh.getElevationRangeIntersectingSphere(t)??new y(0,0)}}function b(t){return null!=t.dist&&null!=t.point}class v{constructor(){this.point=null,this.dist=null,this.normal=null,this.outwardDirection=null,this.layerViewUid=""}}const R=511,x=Math.SQRT1_2/R,_=-1,j=3,M=(()=>{const t=new Float64Array(256);for(let i=0;i<t.length;i++)t[i]=Math.exp(10-i/16)/j;return t})();export{w as GaussianSplatIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{isIntegratedMeshLayer as e,isTiledLayer as a,isLayerWithFlowRenderer as r}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as t}from"../../support/hitTestSelectUtils.js";import{isScaleRangeActive as n,scaleBoundsPredicate as i}from"../../support/layerViewUtils.js";async function s(s,y){const{results:p,ground:f}=await t(s,y),u=(!f.layer||!e(f.layer))&&f.mapPoint,d=[],m=c(s),w=u?l(s,m):o;let g=0,h=0;const V=()=>{const e=w.layerViews[h++];if(!u||!e||!("fetchPopupFeaturesAtLocation"in e))return;const t=f.mapPoint,l=e.layer;if(a(l)&&"effectiveScaleRange"in l){const{minScale:e,maxScale:a}=l.effectiveScaleRange;if(n(e,a)){if(r(l)&&!i(s.scale,e,a))return;const n=s.basemapTerrain.getScale(t);if(!i(n,e,a))return}}d.push({mapPoint:t,layerView:e})};let S=null;for(;g<p.length||h<w.layerViews.length;){const e=p[g];if(e&&"graphic"!==e.type)++g;else if("scene"!==e?.layer?.type||e?.layer?.parent!==s?.map?.basemap)if(e){const a=e.layer?.uid,r=w.layerUids.has(a)&&e.distance===f.distance,t=m.get(e.layer?.uid);if(S??=e.mapPoint,h<w.layerViews.length&&(r||(e.distance??0)>f.distance)&&w.layerViews[h]!==t){V();continue}d.push({graphic:e.graphic,layerView:t}),++g}else V();else++g}return S??=f.mapPoint,{hits:d,location:S}}function l(e,a){const r=new Set,t=new Set;for(let i=e.basemapTerrain.numLayers(1)-1;i>=0;i--){const a=e.basemapTerrain.layerViewByIndex(i,1);r.add(a.layer.uid),t.add(a)}const n=e.overlayManager.renderer.layers;for(const{uid:i}of n){const e=a.get(i);e&&(r.add(i),t.add(e))}return{layerUids:r,layerViews:Array.from(t).reverse()}}const o={layerUids:new Set,layerViews:[]};function c(e){const a=new Map;for(const r of e.allLayerViews){const e=r.layer.uid;a.set(e,r)}return a}export{s as popupHitTest};
2
+ import{isIntegratedMeshLayer as e,isTiledLayer as r,isLayerWithFlowRenderer as a}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as t}from"../../support/hitTestSelectUtils.js";import{isScaleRangeActive as n,scaleBoundsPredicate as s}from"../../support/layerViewUtils.js";async function i(i,y){const{results:p,ground:f}=await t(i,y),u=(!f.layer||!e(f.layer))&&f.mapPoint,d=[],m=c(i),w=u?l(i,m):o;let g=0,h=0;const V=()=>{const e=w.layerViews[h++];if(!u||!e||!("fetchPopupFeaturesAtTarget"in e))return;const t=f.mapPoint,l=e.layer;if(r(l)&&"effectiveScaleRange"in l){const{minScale:e,maxScale:r}=l.effectiveScaleRange;if(n(e,r)){if(a(l)&&!s(i.scale,e,r))return;const n=i.basemapTerrain.getScale(t);if(!s(n,e,r))return}}d.push({geometry:t,layerView:e})};let S=null;for(;g<p.length||h<w.layerViews.length;){const e=p[g];if(e&&"graphic"!==e.type)++g;else if("scene"!==e?.layer?.type||e?.layer?.parent!==i?.map?.basemap)if(e){const r=e.layer?.uid,a=w.layerUids.has(r)&&e.distance===f.distance,t=m.get(e.layer?.uid);if(S??=e.mapPoint,h<w.layerViews.length&&(a||(e.distance??0)>f.distance)&&w.layerViews[h]!==t){V();continue}d.push({graphic:e.graphic,layerView:t}),++g}else V();else++g}return S??=f.mapPoint,{hits:d,location:S}}function l(e,r){const a=new Set,t=new Set;for(let s=e.basemapTerrain.numLayers(1)-1;s>=0;s--){const r=e.basemapTerrain.layerViewByIndex(s,1);a.add(r.layer.uid),t.add(r)}const n=e.overlayManager.renderer.layers;for(const{uid:s}of n){const e=r.get(s);e&&(a.add(s),t.add(e))}return{layerUids:a,layerViews:Array.from(t).reverse()}}const o={layerUids:new Set,layerViews:[]};function c(e){const r=new Map;for(const a of e.allLayerViews){const e=a.layer.uid;r.set(e,a)}return r}export{i as popupHitTest};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{invert as e,transpose as t}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{clone as r}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{ones as s,clone as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{VertexPositionDrawParameters as i}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{TwoVectorPosition as a}from"../../core/util/TwoVectorPosition.js";class n extends i{constructor(s,o,i){super(),this.baseColorTextureSampler=i,this._componentParameters=u;const{transform:n,toMapSpace:m}=s;this.toMapSpace=m;const l=r(n.rotationScale);e(l,l),t(l,l),this.transformNormalGlobalFromModel=l;const c=new a(n.position);this.transformWorldFromModelTL=c.low,this.transformWorldFromModelTH=c.high,this.transformWorldFromModelRS=n.rotationScale,this.useENUForGlobalOverlayUV=s.obb.radius<h,this.baseColor=o.baseColor,this.opacity=o.opacity,this.textureAlphaCutoff=o.textureAlphaCutoff,this.mrrFactors=o.mrrFactors,this.emissiveBaseColor=o.emissiveBaseColor,this.baseColorTexture=o.baseColorTexture,this.metallicRoughnessTexture=o.metallicRoughnessTexture,this.normalTexture=o.normalTexture,this.occlusionTexture=o.occlusionTexture,this.emissionTexture=o.emissionTexture;const x=new Float32Array(15);x.set(this.transformWorldFromModelTL,0),x.set(this.transformWorldFromModelTH,3),x.set(this.transformWorldFromModelRS,6),this.transformationFloats=x}destroy(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}setTransformationDrawId(e){this.transformationDrawId=e}get texture(){return this.baseColorTexture?.texture}get textureSampler(){return this.baseColorTextureSampler}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}get componentParameters(){return this._componentParameters}get emissiveStrength(){const e=this._componentParameters;return 0===e.componentDataType?e.emissiveStrength:void 0}updateComponentParameters(e,t){this._componentParameters=e,this.textureBackedBuffer=t}get castAnyShadows(){return 2!==this.componentParameters.castShadows}}class m{constructor(e,t,r,s,i){this.castShadows=i,this.componentDataType=0,this.externalColor=o(e),this.externalColorMixMode=t,this.emissiveStrength=r,this.emissiveSource=s}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}}class l{constructor(e,t,r,s,o){this.transparent=e,this.opaqueOverride=t,this.emissiveOverride=r,this.emissiveSourceOverride=s,this.castShadows=o,this.componentDataType=1}}const u=new m(s(),1,0,0,0),h=5e4;export{n as ComponentDrawParametersImplementation,m as ComponentParametersUniform,l as ComponentParametersVarying,u as defaultComponentParameters};
2
+ import{invert as e}from"../../../../../core/libs/gl-matrix-2/math/mat3.js";import{IDENTITY as t,create as r}from"../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{ones as s,clone as o}from"../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{VertexPositionDrawParameters as i}from"../../core/shaderLibrary/attributes/VertexPosition.glsl.js";import{TwoVectorPosition as a}from"../../core/util/TwoVectorPosition.js";class n extends i{constructor(s,o,i){super(),this.baseColorTextureSampler=i,this._componentParameters=h;const{transform:n,toMapSpace:m}=s;this.toMapSpace=m;const l=new a(n.position);switch(this.transformWorldFromModelTL=l.low,this.transformWorldFromModelTH=l.high,s.geometry.parameters.vertexPositionRotationType){case 0:this.transformWorldFromModelRS=t;break;case 1:this.transformWorldFromModelRS=n.rotationScale;break;case 2:this.transformWorldFromModelRS=e(r(),n.rotationScale)??t}this.useENUForGlobalOverlayUV=s.obb.radius<u,this.baseColor=o.baseColor,this.opacity=o.opacity,this.textureAlphaCutoff=o.textureAlphaCutoff,this.mrrFactors=o.mrrFactors,this.emissiveBaseColor=o.emissiveBaseColor,this.baseColorTexture=o.baseColorTexture,this.metallicRoughnessTexture=o.metallicRoughnessTexture,this.normalTexture=o.normalTexture,this.occlusionTexture=o.occlusionTexture,this.emissionTexture=o.emissionTexture;const c=new Float32Array(15);c.set(this.transformWorldFromModelTL,0),c.set(this.transformWorldFromModelTH,3),c.set(this.transformWorldFromModelRS,6),this.transformationFloats=c}destroy(){this.baseColorTexture?.dispose(),this.metallicRoughnessTexture?.dispose(),this.emissionTexture?.dispose(),this.occlusionTexture?.dispose(),this.normalTexture?.dispose()}setTransformationDrawId(e){this.transformationDrawId=e}get texture(){return this.baseColorTexture?.texture}get textureSampler(){return this.baseColorTextureSampler}get textureMetallicRoughness(){return this.metallicRoughnessTexture?.texture}get textureEmissive(){return this.emissionTexture?.texture}get textureOcclusion(){return this.occlusionTexture?.texture}get textureNormal(){return this.normalTexture?.texture}get componentParameters(){return this._componentParameters}get emissiveStrength(){const e=this._componentParameters;return 0===e.componentDataType?e.emissiveStrength:void 0}updateComponentParameters(e,t){this._componentParameters=e,this.textureBackedBuffer=t}get castAnyShadows(){return 2!==this.componentParameters.castShadows}}class m{constructor(e,t,r,s,i){this.castShadows=i,this.componentDataType=0,this.externalColor=o(e),this.externalColorMixMode=t,this.emissiveStrength=r,this.emissiveSource=s}get transparent(){return this.externalColor[3]<1?0:2}get opaqueOverride(){return 3===this.externalColorMixMode&&1===this.externalColor[3]?0:2}get emissiveOverride(){return this.emissiveStrength>0?0:2}get emissiveSourceOverride(){return 1===this.emissiveSource?0:2}}class l{constructor(e,t,r,s,o){this.transparent=e,this.opaqueOverride=t,this.emissiveOverride=r,this.emissiveSourceOverride=s,this.castShadows=o,this.componentDataType=1}}const h=new m(s(),1,0,0,0),u=5e4;export{n as ComponentDrawParametersImplementation,m as ComponentParametersUniform,l as ComponentParametersVarying,h as defaultComponentParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as o}from"../../../shaders/SphereDepthInterpolate.glsl.js";class i extends s{constructor(e,s,r,a,o){super(),this.parameters=e,this.key=o;const i=h(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=0!==i?3:0,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}acquireTechnique(t,s,r,a){const i=this._updateConfiguration(s,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){i.sphereDepthInterpolate=!1;const s=t.get(e,i,a.layout);i.sphereDepthInterpolate=!0;const n=t.get(e,i,a.layout);return o(r.camera,i)?n:s}return t.get(e,i,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.vertexNormalRotationType=t.vertexNormalRotationType,r.componentDataType=s.componentDataType,r.emissionSource=h(e,s)}_updateConfiguration(e,t){const s=this._configuration,{identifier:i}=e,n=0===i;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&o(t.camera,s),s.hasEmission=t.hasEmission&&n,s.renderOccluded=9===t.slot;const l=this.isIntegratedMesh?c(t)?u(t)?3:2:1:0;s.integratedMeshMode=l,s.pbrMode=3===l?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:h}=this;s.transparent=n&&(1===h||2===h&&e.transparent||4===h)||s.isGroundSlice,s.hasHighlightMixTexture=2===i&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===h?e.transparent?2:1:0;const p=r(t.output);return s.receiveAmbientOcclusion=p&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=p&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function n(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:o,opaqueOverride:i}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a?4:3;if(n)return 1;if(0===i)return 0;if(l||0===s||3===s)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function h(e,t){const s=e.hasEmissionTexture,{emissiveSourceOverride:r}=t,a=1===r,o=2===r;return 2!==t.emissiveOverride&&(l(e)||2!==r)?l(e)?o?s?4:2:a?s?5:7:6:a?7:6:0}function u(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{i as ComponentMaterial,n as computeMaterialPass,h as getEmissionSource};
2
+ import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as o}from"../../../shaders/SphereDepthInterpolate.glsl.js";class i extends s{constructor(e,s,r,a,o){super(),this.parameters=e,this.key=o;const i=h(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this.hasEmissions=0!==i?3:0,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}acquireTechnique(t,s,r,a){const i=this._updateConfiguration(s,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){i.sphereDepthInterpolate=!1;const s=t.get(e,i,a.layout);i.sphereDepthInterpolate=!0;const n=t.get(e,i,a.layout);return o(r.camera,i)?n:s}return t.get(e,i,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.componentDataType=s.componentDataType,r.emissionSource=h(e,s)}_updateConfiguration(e,t){const s=this._configuration,{identifier:i}=e,n=0===i;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&o(t.camera,s),s.hasEmission=t.hasEmission&&n,s.renderOccluded=9===t.slot;const l=this.isIntegratedMesh?c(t)?u(t)?3:2:1:0;s.integratedMeshMode=l,s.pbrMode=3===l?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:h}=this;s.transparent=n&&(1===h||2===h&&e.transparent||4===h)||s.isGroundSlice,s.hasHighlightMixTexture=2===i&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===h?e.transparent?2:1:0;const p=r(t.output);return s.receiveAmbientOcclusion=p&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=p&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function n(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:o,opaqueOverride:i}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a?4:3;if(n)return 1;if(0===i)return 0;if(l||0===s||3===s)return 1;switch(o){case 2:return 0;case 0:return 1;case 1:return 2}}function l(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function h(e,t){const s=e.hasEmissionTexture,{emissiveSourceOverride:r}=t,a=1===r,o=2===r;return 2!==t.emissiveOverride&&(l(e)||2!==r)?l(e)?o?s?4:2:a?s?5:7:6:a?7:6:0}function u(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{i as ComponentMaterial,n as computeMaterialPass,h as getEmissionSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as r,getEmissionSource as t}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as o}from"./ComponentMaterialGlobalParameters.js";class s{constructor(e,r){this._store=new Map,this.globals=new o(e,r)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(r,t,o){const s=this.globals,i=a(r,t,o,s),n=this._store.get(i);if(n)return n.refCount++,n.material.key,n.material;const l=new e(r,t,o,s,i);return this._store.set(i,{material:l,refCount:1}),l}release(e){const{key:r}=e,t=this._store.get(r);if(!t||t.refCount<1)throw new Error("Internal error in material repository");1===t.refCount?this._store.delete(r):t.refCount--}}function a(e,o,s,a){const i=r(e,s),n=t(e,s);return"|"+ +a.useFloatBlend+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}`+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+i}|${+s.componentDataType}|${+n}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+o.hasVertexColors}|${+o.textureCoordinateType}`+`|${+o.shadeNormals}|${+o.hasNormals}`+`|${e.polygonOffset}|${+o.vertexPositionRotationType}|${+o.vertexNormalRotationType}|`+ +e.hasBaseColorTexture+"|"+ +e.hasEmissionTexture+"|"+ +e.hasMetallicRoughnessTexture+"|"+ +e.hasOcclusionTexture+"|"+ +e.hasNormalTexture+"|"+ +s.emissiveOverride}export{s as ComponentMaterialRepository,a as makeMaterialKey};
2
+ import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as r,getEmissionSource as t}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as o}from"./ComponentMaterialGlobalParameters.js";class s{constructor(e,r){this._store=new Map,this.globals=new o(e,r)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(r,t,o){const s=this.globals,i=a(r,t,o,s),n=this._store.get(i);if(n)return n.refCount++,n.material.key,n.material;const l=new e(r,t,o,s,i);return this._store.set(i,{material:l,refCount:1}),l}release(e){const{key:r}=e,t=this._store.get(r);if(!t||t.refCount<1)throw new Error("Internal error in material repository");1===t.refCount?this._store.delete(r):t.refCount--}}function a(e,o,s,a){const i=r(e,s),n=t(e,s);return"|"+ +a.useFloatBlend+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}`+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+i}|${+s.componentDataType}|${+n}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+o.hasVertexColors}|${+o.textureCoordinateType}`+`|${+o.shadeNormals}|${+o.hasNormals}`+`|${e.polygonOffset}|${+o.vertexPositionRotationType}|`+ +e.hasBaseColorTexture+"|"+ +e.hasEmissionTexture+"|"+ +e.hasMetallicRoughnessTexture+"|"+ +e.hasOcclusionTexture+"|"+ +e.hasNormalTexture+"|"+ +s.emissiveOverride}export{s as ComponentMaterialRepository,a as makeMaterialKey};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.vertexNormalRotationType=0,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o({count:5})],s.prototype,"polygonOffset",void 0),e([o({count:3})],s.prototype,"vertexPositionRotationType",void 0),e([o({count:2})],s.prototype,"vertexNormalRotationType",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"emissionDimmingPass",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveGlobalIllumination",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"hasShadowHighlights",void 0),e([o()],s.prototype,"transparent",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"enableOITOffset",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.discardInvisibleFragments=!1,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:7})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o({count:5})],s.prototype,"polygonOffset",void 0),e([o({count:3})],s.prototype,"vertexPositionRotationType",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"emissionDimmingPass",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveGlobalIllumination",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"hasShadowHighlights",void 0),e([o()],s.prototype,"transparent",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"enableOITOffset",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{newLayout as e}from"../../../support/buffer/InterleavedLayout.js";import{NoParameters as t}from"../../../../webgl/NoParameters.js";class o{constructor(e,t,o,r){this.renderGeometryData=e,this.positions=t,this.componentOffsets=o,this.parameters=r}}class r extends t{constructor(e,t,o,r,s){super(),this.layout=e,this.shadeNormals=t,this.textureCoordinateType=o,this.vertexPositionRotationType=r,this.vertexNormalRotationType=s}get hasVertexColors(){return this.layout.some(({name:e})=>"color"===e)}get hasNormals(){return this.layout.some(({name:e})=>"normalCompressed"===e)}}class s extends t{constructor(e,t,o){super(),this.hasVertexColors=e,this.hasNormals=t,this.textureCoordinateType=o}}function a(t){const o=e().vec3f("position");return t.hasNormals&&o.vec2i16("normalCompressed",{glNormalized:!0}),1===t.textureCoordinateType?o.vec2f("uv0"):2===t.textureCoordinateType&&(o.vec2f("uv0"),o.vec4u16("uvRegion",{glNormalized:!0})),t.hasVertexColors&&o.vec4u8("color",{glNormalized:!0}),o.freeze()}export{r as ComponentGeometryParameters,o as SourceGeometry,s as VertexBufferLayoutCreationParameters,a as createVertexBufferLayout};
2
+ import{newLayout as e}from"../../../support/buffer/InterleavedLayout.js";import{NoParameters as t}from"../../../../webgl/NoParameters.js";class o{constructor(e,t,o,r){this.renderGeometryData=e,this.positions=t,this.componentOffsets=o,this.parameters=r}}class r extends t{constructor(e,t,o,r){super(),this.layout=e,this.shadeNormals=t,this.textureCoordinateType=o,this.vertexPositionRotationType=r}get hasVertexColors(){return this.layout.some(({name:e})=>"color"===e)}get hasNormals(){return this.layout.some(({name:e})=>"normalCompressed"===e)}}class s extends t{constructor(e,t,o){super(),this.hasVertexColors=e,this.hasNormals=t,this.textureCoordinateType=o}}function a(t){const o=e().vec3f("position");return t.hasNormals&&o.vec2i16("normalCompressed",{glNormalized:!0}),1===t.textureCoordinateType?o.vec2f("uv0"):2===t.textureCoordinateType&&(o.vec2f("uv0"),o.vec4u16("uvRegion",{glNormalized:!0})),t.hasVertexColors&&o.vec4u8("color",{glNormalized:!0}),o.freeze()}export{r as ComponentGeometryParameters,o as SourceGeometry,s as VertexBufferLayoutCreationParameters,a as createVertexBufferLayout};
@@ -1,13 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{NormalAttribute as a}from"./NormalAttribute.glsl.js";import{VertexPositionPassParameters as l,VertexPositionDrawParameters as m}from"./VertexPosition.glsl.js";import{glsl as e,If as s}from"../../shaderModules/glsl.js";import{Matrix3DrawUniform as t}from"../../shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as i}from"../../shaderModules/Matrix3PassUniform.js";function d(r,o){const{vertex:l,varyings:m}=r;switch(o.normalType){case 0:case 1:{r.include(a,o),m.add("vNormalWorld","vec3"),m.add("vNormalView","vec3"),l.uniforms.add(new i("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal));const{vertexNormalRotationType:d}=o,n=1===d;n&&l.uniforms.add(new t("transformNormalGlobalFromModel",r=>r.transformNormalGlobalFromModel)),l.code.add(e`
3
- ${s(n,e`
4
- mat3 normalModelTransformation() {
5
- return transformNormalGlobalFromModel;
6
- }
7
- `)}
8
-
9
- void forwardNormal() {
10
- vNormalWorld = ${s(n,e`normalModelTransformation() * `)}normalModel();
11
- vNormalView = transformNormalViewFromGlobal * vNormalWorld;
12
- }
13
- `);break}case 2:r.vertex.code.add(e`void forwardNormal() {}`);break;default:o.normalType;case 3:}}class n extends l{constructor(){super(...arguments),this.transformNormalViewFromGlobal=r()}}class f extends m{constructor(){super(...arguments),this.transformNormalGlobalFromModel=r(),this.toMapSpace=o()}}export{d as VertexNormal,f as VertexNormalDrawParameters,n as VertexNormalPassParameters};
2
+ import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{NormalAttribute as a}from"./NormalAttribute.glsl.js";import{VertexPositionPassParameters as e,VertexPositionDrawParameters as s}from"./VertexPosition.glsl.js";import{glsl as l}from"../../shaderModules/glsl.js";import{Matrix3PassUniform as m}from"../../shaderModules/Matrix3PassUniform.js";function t(r,o){const{vertex:e,varyings:s}=r;switch(o.normalType){case 0:case 1:r.include(a,o),s.add("vNormalWorld","vec3"),s.add("vNormalView","vec3"),e.uniforms.add(new m("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal)),e.code.add(l`void forwardNormal() {
3
+ vNormalWorld = normalModel();
4
+ vNormalView = transformNormalViewFromGlobal * vNormalWorld;
5
+ }`);break;case 2:r.vertex.code.add(l`void forwardNormal() {}`);break;default:o.normalType;case 3:}}class i extends e{constructor(){super(...arguments),this.transformNormalViewFromGlobal=r()}}class d extends s{constructor(){super(...arguments),this.toMapSpace=o()}}export{t as VertexNormal,d as VertexNormalDrawParameters,i as VertexNormalPassParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as t}from"../../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as e}from"../../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as i}from"../../shaders/CompositingTechniqueConfiguration.js";import{ColorAttachment0 as r}from"../../../../webgl/enums.js";class s{constructor(e,r=0){this._techniques=e,this._parameters=new t,this._configuration=new i,this._configuration.mode=r}precompile(){this._techniques.precompile(e,this._configuration)}toFramebuffer(t,e){this.blitTexture(t.getTexture(),e)}blitTexture(t,i,r,s,o=0){const n=this._rctx;n.temporaryBindFramebuffer(r,()=>{const r=this._configuration.mode;this._configuration.mode=s??this._configuration.mode,1!==this._configuration.mode&&2!==this._configuration.mode||(n.setClearColor(0,0,0,1),n.clear(16384)),this._parameters.texture=t,this._parameters.mipmapLevel=o;const a=this._techniques.get(e,this._configuration);n.bindTechnique(a,i,this._parameters),n.screen.draw(),this._configuration.mode=r})}blend(t,i,s,o=1){const n=this._techniques.getCompiled(e,this._configuration);if(!n)return!1;const a=this._rctx;return a.bindFramebuffer(i.fbo),this._parameters.texture=t.getTexture(),this._parameters.opacity=o,a.bindTechnique(n,s,this._parameters),a.setDrawBuffers([r]),a.screen.draw(),!0}get _rctx(){return this._techniques.context.rctx}}export{s as Blit};
2
+ import{a as t}from"../../../../../chunks/Compositing.glsl.js";import{CompositingTechnique as e}from"../../shaders/CompositingTechnique.js";import{CompositingTechniqueConfiguration as i}from"../../shaders/CompositingTechniqueConfiguration.js";import{ColorAttachment0 as r}from"../../../../webgl/enums.js";class s{constructor(e,r=0){this._techniques=e,this._parameters=new t,this._configuration=new i,this._configuration.mode=r}precompile(){this._techniques.precompile(e,this._configuration)}toFramebuffer(t,e){this.blitTexture(t.getTexture(),e)}blitTexture(t,i,r,s,o=0){const n=this._rctx;n.temporaryBindFramebuffer(r,()=>{const r=this._configuration.mode;this._configuration.mode=s??this._configuration.mode,1!==this._configuration.mode&&2!==this._configuration.mode||(n.setClearColor(0,0,0,1),n.clear(16384)),this._parameters.texture=t,this._parameters.mipmapLevel=o;const a=this._techniques.get(e,this._configuration);n.bindTechnique(a,i,this._parameters),n.screen.draw(),this._configuration.mode=r})}blend(t,i,s,o=1){const n=this._techniques.getCompiled(e,this._configuration);if(!n)return!1;const a=this._rctx;return a.bindFramebuffer(i.fbo),this._parameters.texture=t.getTexture(),this._parameters.opacity=o,a.bindTechnique(n,s,this._parameters),a.setDrawBuffers([r]),a.screen.draw(),this._parameters.opacity=1,!0}get _rctx(){return this._techniques.context.rctx}}export{s as Blit};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{copy as n,normalize as m,dot as h,scale as p,lerp as c,length as d}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as l,fromValues as _}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as g}from"../../../webgl.js";import{heightLimit as f}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{a as w}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as b}from"./FogTechnique.js";import{FogTechniqueConfiguration as v}from"./FogTechniqueConfiguration.js";import{DepthStencilAttachment as y,ColorAttachment1 as F}from"../../../../webgl/enums.js";const j=.95,E=1;let R=class extends P{constructor(e){super(e),this._configuration=new v,this._newParameters=new x,this._oldParameters=new x,this._fadedParameters=new x,this._parameters=this._newParameters,this._passParameters=new w;const t=u(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copyFrom(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const{weather:e,weatherAvailable:t}=this.view.environment,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength=t?e.fogOpacity:0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||n(this._newParameters.color,A),"rainy"===e.type&&n(this._newParameters.color,C),this._fadeFactor>=1&&this._oldParameters.copyFrom(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength}precompile(){this._configuration.useFloatBlend=this.bindParameters.useFloatBlend.value}render(e){const t=e.find(({name:e})=>e===g.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;if(this._update(),this._passParameters.amount<=0)return t;this._configuration.hasEmissive=this.bindParameters.hasEmission;const s=this.techniques.getCompiled(b,this._configuration);if(!s)return this.requestRender(1),t;const a=this.renderingContext,i=t.getAttachment(y);return this._passParameters.emission=t.obtainAttachment(F),t.attachDepth(null),a.bindFramebuffer(t.fbo),a.bindTechnique(s,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),this._passParameters.emission&&(t.attachColor(this._passParameters.emission,F),this._passParameters.emission=r(this._passParameters.emission)),t}_update(){const e=this.bindParameters.camera;m(T,e.eye);const s=Math.max(0,h(T,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.color;p(q,r,.1),c(this._passParameters.color,q,r,s);const a=d(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-t(j*f,E*f,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength}get test(){return{parameters:this._passParameters}}};R=e([o("esri.views.3d.webgl-engine.effects.fog.Fog")],R);class x{constructor(){this.color=l(),this.strength=0,this.amount=0}copyFrom(e){this.amount=e.amount,this.strength=e.strength,n(this.color,e.color)}lerp(e,t,r){this.amount=s(e.amount,t.amount,r),this.strength=s(e.strength,t.strength,r),c(this.color,e.color,t.color,r)}}const T=l(),q=l(),C=_(.5,.5,.5),A=_(1.5,1.5,1.5);export{R as Fog,x as FogParameters};
2
+ import{__decorate as e}from"tslib";import{smoothstep as t,lerp as s}from"../../../../../core/mathUtils.js";import{releaseMaybe as r}from"../../../../../core/maybe.js";import{watch as a,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{subclass as n}from"../../../../../core/accessorSupport/decorators.js";import{add as o,normalize as h,dot as m,scale as p,lerp as c,length as g}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as _,fromValues as d}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as l}from"../../../webgl.js";import{heightLimit as f}from"../../../environment/weather.js";import{TransparentEnvironment as P}from"../TransparentEnvironment.js";import{betaRayleigh as w,betaCombined as b}from"../atmosphere/atmosphereUtils.js";import{a as v}from"../../../../../chunks/Fog.glsl.js";import{FogTechnique as y}from"./FogTechnique.js";import{FogTechniqueConfiguration as j}from"./FogTechniqueConfiguration.js";import{DepthStencilAttachment as F,ColorAttachment1 as E}from"../../../../webgl/enums.js";const B=.95,R=1;let T=class extends P{constructor(e){super(e),this._configuration=new j,this._newParameters=new q,this._oldParameters=new q,this._fadedParameters=new q,this._parameters=this._newParameters,this._passParameters=new v;const t=u(e.view.spatialReference);this._planetRadius=t.radius,this._atmosphereRadius=t.radius+t.atmosphereHeight}initialize(){this.addHandles([a(()=>this.view.environment.atmosphereEnabled,()=>this._updateEnabled(),i),a(()=>this.view.environment.weather,()=>this._updateEnabled(),i),a(()=>this._updateFogParameters(),()=>{},i)]),this.addHandles(a(()=>this._fadeFactor,e=>this._fade(e),i))}_updateEnabled(){this.view.environment.atmosphereEnabled&&this.view.environment.weather?this._enable():this._disable()}get _fadeFactor(){return this.view.stage?.renderer.renderContext.bind.clouds.fadeFactor??1}_fade(e){const{_newParameters:t,_oldParameters:s}=this;e>=1?(this._parameters=t,this._oldParameters.copy(this._newParameters)):e<=0?this._parameters=s:(this._fadedParameters.lerp(s,t,e),this._parameters=this._fadedParameters)}_updateFogParameters(){const{weather:e,weatherAvailable:t}=this.view.environment,s="foggy"===e.type||"snowy"===e.type||"rainy"===e.type;this._newParameters.strength=t?e.fogOpacity:0,this._newParameters.amount=s?1:0,"foggy"!==e.type&&"snowy"!==e.type||(this._newParameters.fogBrightness=M),"rainy"===e.type&&(this._newParameters.fogBrightness=H),this._fadeFactor>=1&&this._oldParameters.copy(this._newParameters),this.requestRender(2)}get strength(){return this._parameters.strength}precompile(){this._update(),this._passParameters.amount>0&&this.techniques.precompile(y,this._configuration)}render(e){const t=e.find(({name:e})=>e===l.TRANSPARENT_ENVIRONMENT);if(0===this._parameters.amount)return t;const s=this._getTechnique();if(!s)return t;const a=this.renderingContext,i=t.getAttachment(F);return this._passParameters.emission=t.obtainAttachment(E),t.attachDepth(null),a.bindFramebuffer(t.fbo),a.bindTechnique(s,this.bindParameters,this._passParameters),a.screen.draw(),t.attachDepth(i),this._passParameters.emission&&(t.attachColor(this._passParameters.emission,E),this._passParameters.emission=r(this._passParameters.emission)),t}_getTechnique(){return this._update(),this._passParameters.amount>0?this.techniques.get(y,this._configuration):null}_update(){const e=this.bindParameters.camera;h(x,e.eye);const s=Math.max(0,m(x,this.bindParameters.lighting.mainLight.direction)),r=this._parameters.fogBrightness;p(this._passParameters.color,N,r),p(A,N,.1*r),c(this._passParameters.color,A,this._passParameters.color,s);const a=g(e.eye);this._passParameters.atmosphereC=a**2-this._atmosphereRadius**2,this._passParameters.amount=(1-t(B*f,R*f,Math.abs(a-this._planetRadius)))*this._parameters.amount,this._passParameters.strength=this._parameters.strength,this._configuration.useFloatBlend=this.view.environment.atmosphereEnabled&&this.bindParameters.useFloatBlend.value,this._configuration.hasEmissive=this.bindParameters.hasEmission}get test(){return{parameters:this._passParameters}}};T=e([n("esri.views.3d.webgl-engine.effects.fog.Fog")],T);class q{constructor(){this.fogBrightness=0,this.strength=0,this.amount=0}copy(e){this.fogBrightness=e.fogBrightness,this.strength=e.strength,this.amount=e.amount}lerp(e,t,r){this.fogBrightness=s(e.fogBrightness,t.fogBrightness,r),this.strength=s(e.strength,t.strength,r),this.amount=s(e.amount,t.amount,r)}}const x=_(),A=_(),C=d(3e-4,3e-4,3e-4),N=_();o(N,b,w),o(N,N,C),h(N,N);const U=N.reduce((e,t)=>e+t,0)/3,H=.5/U,M=1.5/U;export{T as Fog,q as FogParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as r,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as a,isAbortError as i}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as l}from"../../../../../core/reactiveUtils.js";import{property as n,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{set as m}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{requestImage as h}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import p from"../../../webgl/RenderNode.js";import{a as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{a as f}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as _}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as b}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as g}from"./GlobalIlluminationTechniqueConfiguration.js";import{a as w}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as x}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as P,ColorAttachment1 as T,SizedPixelFormat as I}from"../../../../webgl/enums.js";import C from"../../../../webgl/Texture.js";import{TextureDescriptor as q}from"../../../../webgl/TextureDescriptor.js";const j=1;let y=class extends p{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=c.AMBIENT_ILLUMINATION,this._passParameters=new d,this._drawParameters=new f,this._drawParametersUpscale=new w,this._maxFrames=255,this._lowQualityResolutionScale=.25,this._configuration=new g,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await import("./BlueNoise.js")).data;a(e),await this._loadBlueNoiseTexture(t,e),a(e)}catch(r){i(r)||t.getLogger(this).errorOnce("Failed to load blue noise texture:",r)}this.addHandles(o(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this.resetAccumulation(),this.requestRender(1)},l))}destroy(){this._abortController=r(this._abortController),this._passParameters.noiseTexture=s(this._passParameters.noiseTexture)}render(e){const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),s=t?.getTexture(P),a=this._mode;if(!r||!s)return this._emptyOutput;if(this.view.stage.renderView.updating&&this.resetAccumulation(),0===a)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this.requestRender(1),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=i.hasEmission;const o=this.techniques.getCompiled(b,this._configuration),l=this.techniques.getCompiled(_),n=1===a,u=n?this._lowQualityResolutionScale:1,h=n?this.techniques.getCompiled(x):null;if(!o||!l||n&&!h)return this.requestRender(1),this._emptyOutput;const p=this.renderingContext,{camera:d}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=s,this._passParameters.projScale=1/d.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=u;const{fullWidth:f,fullHeight:g}=d,w=Math.max(1,Math.floor(f*u)),I=Math.max(1,Math.floor(g*u)),C=this.fboCache.acquire(w,I,"global illumination input").acquireColor(T,0);p.bindFramebuffer(C.fbo),p.setViewport(0,0,w,I),p.bindTechnique(o,i,this._passParameters,this._drawParameters),p.screen.draw();const q=C.obtainAttachment(T),y=Math.max(1,Math.round(w/j)),F=Math.max(1,Math.round(I/j)),A=this.fboCache.acquire(y,F,"global illumination blur horizontal");p.bindFramebuffer(A.fbo),this._drawParameters.texture=C.getTexture(),this._drawParameters.weightTexture=q.attachment,m(this._drawParameters.blurSize,0,j/I),p.bindTechnique(l,i,this._passParameters,this._drawParameters),p.setViewport(0,0,y,F),p.screen.draw(),C.release();const B=n?"global illumination blur vertical":c.AMBIENT_ILLUMINATION,M=this.fboCache.acquire(y,F,B);p.bindFramebuffer(M.fbo),p.setViewport(0,0,y,F),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParameters.texture=A.getTexture(),this._drawParameters.weightTexture=q.attachment,m(this._drawParameters.blurSize,j/y,0),p.bindTechnique(l,i,this._passParameters,this._drawParameters),p.setViewport(0,0,y,F),p.screen.draw(),A.release(),M.attachColor(q,T),q.release();let N=M;return h&&(N=this.fboCache.acquire(f,g,c.AMBIENT_ILLUMINATION).acquireColor(T,0),p.bindFramebuffer(N.fbo),p.setViewport(0,0,f,g),p.setClearColor(1,1,1,0),p.clear(16384),this._drawParametersUpscale.colorTexture=M.getTexture(),this._drawParametersUpscale.weightTexture=M.getTexture(T),p.bindTechnique(h,i,this._passParameters,this._drawParametersUpscale),p.screen.draw(),M.release()),p.setViewport4fv(d.fullViewport),this._passParameters.frameCount=(this._passParameters.frameCount+1)%64,++this._passParameters.accumulatedFrames,this._passParameters.accumulatedFrames<this._maxFrames&&this.requestRender(1),N}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,s=this.fboCache.acquire(t,r,c.AMBIENT_ILLUMINATION).acquireColor(T,0);return e.bindFramebuffer(s.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),s}async _loadBlueNoiseTexture(e,t){a(t);const r=await h(e,{signal:t});if(a(t),!r)return;const s=new q;s.internalFormat=I.RGBA8,s.wrapMode=10497,s.isImmutable=!0,this._passParameters.noiseTexture=new C(this.renderingContext,s,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||!e.reprojection.lastFrameColor||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}resetAccumulation(){this._passParameters.accumulatedFrames=0}get test(){const e=this;return{passParameters:this._passParameters,configuration:this._configuration,get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},get mode(){return e._mode},restartAccumulation:()=>{this.resetAccumulation(),this._passParameters.frameCount=0,this._resetBuffer=!0,this.requestRender(1)}}}};e([n()],y.prototype,"consumes",void 0),e([n()],y.prototype,"produces",void 0),e([n()],y.prototype,"_abortController",void 0),y=e([u("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],y);export{y as GlobalIllumination,j as blurSizePixels};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Logger.js";import{abortMaybe as r,disposeMaybe as a,releaseMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as o}from"../../../../../core/promiseUtils.js";import{watch as l,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as m,subclass as u}from"../../../../../core/accessorSupport/decorators.js";import{set as h}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{requestImage as c}from"../../../../../request/image.js";import{InternalRenderCategory as p}from"../../../webgl.js";import _ from"../../../webgl/RenderNode.js";import{a as d}from"../../../../../chunks/GlobalIllumination.glsl.js";import{a as b}from"../../../../../chunks/GlobalIlluminationBlur.glsl.js";import{GlobalIlluminationBlurTechnique as f}from"./GlobalIlluminationBlurTechnique.js";import{GlobalIlluminationTechnique as g}from"./GlobalIlluminationTechnique.js";import{GlobalIlluminationTechniqueConfiguration as w}from"./GlobalIlluminationTechniqueConfiguration.js";import{a as I}from"../../../../../chunks/GlobalIlluminationUpscale.glsl.js";import{GlobalIlluminationUpscaleTechnique as x}from"./GlobalIlluminationUpscaleTechnique.js";import{DepthStencilAttachment as P,ColorAttachment1 as T,SizedPixelFormat as F}from"../../../../webgl/enums.js";import q from"../../../../webgl/Texture.js";import{TextureDescriptor as C}from"../../../../webgl/TextureDescriptor.js";const j=1;let y=class extends _{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=p.AMBIENT_ILLUMINATION,this._passParameters=new d,this._drawParameters=new b,this._drawParametersUpscale=new I,this._maxFrames=256,this._lowQualityResolutionScale=.25,this._configuration=new w,this._globalIllumination=null,this._isGlobalIlluminationUpdate=!1,this._resetBuffer=!1}async initialize(){this._abortController=new AbortController;const e=this._abortController.signal;try{const t=(await import("./BlueNoise.js")).data;i(e),await this._loadBlueNoiseTexture(t,e),i(e)}catch(r){o(r)||t.getLogger(this).errorOnce("Failed to load blue noise texture:",r)}this.addHandles(l(()=>this.view.stage.renderer.hasGlobalIllumination,()=>{this._resetAccumulatedFrames(),this._requestRender()},n))}destroy(){this._abortController=r(this._abortController),this._passParameters.noiseTexture=a(this._passParameters.noiseTexture),this._globalIllumination=s(this._globalIllumination)}resetAccumulatedFrames(){this._isGlobalIlluminationUpdate||this._resetAccumulatedFrames()}render(e){if(this._passParameters.accumulatedFrames>=this._maxFrames)return this._globalIllumination?.retain(),this._globalIllumination;const t=e.find(({name:e})=>"normals"===e),r=t?.getTexture(),a=t?.getTexture(P),s=this._mode;if(!r||!a)return this._emptyOutput;if(0===s)return this._resetBuffer=!1,this._emptyOutput;if(!this._canRender)return this._resetBuffer=!1,this._requestRender(),this._emptyOutput;const i=this.bindParameters;this._configuration.hasEmission=i.hasEmission;const o=this.techniques.getCompiled(g,this._configuration),l=this.techniques.getCompiled(f),n=1===s,m=n?this._lowQualityResolutionScale:1,u=n?this.techniques.getCompiled(x):null;if(!o||!l||n&&!u)return this._requestRender(),this._emptyOutput;const c=this.renderingContext,{camera:_}=i;this._passParameters.normalTexture=r,this._passParameters.depthTexture=a,this._passParameters.projScale=1/_.computeScreenPixelSizeAtDist(1),this._passParameters.scaleGlobalIllumination=m;const{fullWidth:d,fullHeight:b}=_,w=Math.max(1,Math.floor(d*m)),I=Math.max(1,Math.floor(b*m)),F=this.fboCache.acquire(w,I,"global illumination input").acquireColor(T,0);c.bindFramebuffer(F.fbo),c.setViewport(0,0,w,I),c.bindTechnique(o,i,this._passParameters,this._drawParameters),c.screen.draw();const q=F.obtainAttachment(T),C=Math.max(1,Math.round(w/j)),y=Math.max(1,Math.round(I/j)),G=this.fboCache.acquire(C,y,"global illumination blur horizontal");c.bindFramebuffer(G.fbo),this._drawParameters.texture=F.getTexture(),this._drawParameters.weightTexture=q.attachment,h(this._drawParameters.blurSize,0,j/I),c.bindTechnique(l,i,this._passParameters,this._drawParameters),c.setViewport(0,0,C,y),c.screen.draw(),F.release();const A=n?"global illumination blur vertical":p.AMBIENT_ILLUMINATION,B=this.fboCache.acquire(C,y,A);c.bindFramebuffer(B.fbo),c.setViewport(0,0,C,y),c.setClearColor(1,1,1,0),c.clear(16384),this._drawParameters.texture=G.getTexture(),this._drawParameters.weightTexture=q.attachment,h(this._drawParameters.blurSize,j/C,0),c.bindTechnique(l,i,this._passParameters,this._drawParameters),c.setViewport(0,0,C,y),c.screen.draw(),G.release(),B.attachColor(q,T),q.release();let M=B;return u&&(M=this.fboCache.acquire(d,b,p.AMBIENT_ILLUMINATION).acquireColor(T,0),c.bindFramebuffer(M.fbo),c.setViewport(0,0,d,b),c.setClearColor(1,1,1,0),c.clear(16384),this._drawParametersUpscale.colorTexture=B.getTexture(),this._drawParametersUpscale.weightTexture=B.getTexture(T),c.bindTechnique(u,i,this._passParameters,this._drawParametersUpscale),c.screen.draw(),B.release()),c.setViewport4fv(_.fullViewport),this._passParameters.temporalSampleFrame=(this._passParameters.temporalSampleFrame+1)%64,++this._passParameters.accumulatedFrames,this._cacheGlobalIllumination(M),this._passParameters.accumulatedFrames<this._maxFrames&&this._requestRender(),M}_requestRender(){this._isGlobalIlluminationUpdate=!0,this.requestRender(1),this._isGlobalIlluminationUpdate=!1}_cacheGlobalIllumination(e){this._globalIllumination!==e&&(this._globalIllumination=s(this._globalIllumination),this._globalIllumination=e,this._globalIllumination.retain())}get _emptyOutput(){const e=this.renderingContext,{fullWidth:t,fullHeight:r}=this.bindParameters.camera,a=this.fboCache.acquire(t,r,p.AMBIENT_ILLUMINATION).acquireColor(T,0);return e.bindFramebuffer(a.fbo),e.setViewport(0,0,t,r),e.clearBuffer(0,[0,0,0,1]),e.clearBuffer(1,[0,0,0,0]),a}async _loadBlueNoiseTexture(e,t){i(t);const r=await c(e,{signal:t});if(i(t),!r)return;const a=new C;a.internalFormat=F.RGBA8,a.wrapMode=10497,a.isImmutable=!0,this._passParameters.noiseTexture=new q(this.renderingContext,a,r)}get _canRender(){const e=this.bindParameters;return!(!this._passParameters.noiseTexture||!e.reprojection.lastFrameColor||e.hasEmission&&!e.reprojection.lastFrameEmission||!e.reprojection.lastFrameDepth||!e.globalIllumination||this._resetBuffer)}get _mode(){const{hasGlobalIlluminationHighQuality:e,hasGlobalIllumination:t}=this.view.stage.renderer;return e?2:t?1:0}_resetAccumulatedFrames(){this._passParameters.accumulatedFrames=0,this._globalIllumination=s(this._globalIllumination)}get test(){const e=this;return{passParameters:this._passParameters,configuration:this._configuration,get maxFrames(){return e._maxFrames},set maxFrames(t){e._maxFrames=t},get lowQualityResolutionScale(){return e._lowQualityResolutionScale},set lowQualityResolutionScale(t){e._lowQualityResolutionScale=t},get mode(){return e._mode},restartAccumulation:()=>{this._resetAccumulatedFrames(),this._passParameters.temporalSampleFrame=0,this._resetBuffer=!0,this._requestRender()}}}};e([m()],y.prototype,"consumes",void 0),e([m()],y.prototype,"produces",void 0),e([m()],y.prototype,"_abortController",void 0),y=e([u("esri.views.3d.webgl-engine.effects.globalIllumination.GlobalIllumination")],y);export{y as GlobalIllumination,j as blurSizePixels};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as i,syncAndInitial as r}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as h}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as l}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{a as u}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as p}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as _}from"./GlowBlurTechniqueConfiguration.js";import{b as d,a as g,m as b}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as P}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as C,DepthStencilAttachment as T}from"../../../../webgl/enums.js";let v=class extends c{constructor(t){super(t),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new _,this._blurVerticalConfiguration=new _,this._compositionConfiguration=new P,this._compositionParameters=new g,this._blurParameters=new u,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=l(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight,this._blurVerticalConfiguration.glowStage=1}initialize(){this.addHandles([i(()=>this._updateParameters(),()=>{},r)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}render(t){const i=t.find(({name:t})=>t===m.TRANSPARENT_ENVIRONMENT),r=i.getAttachment(C);if(!r?.attachment)return i;const s=i.getTexture(),o=i.getAttachment(T),a=this.fboCache,{fullWidth:h,fullHeight:l}=this.bindParameters.camera,c=this.renderingContext;if(this._compositionConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.distanceModifier=this.view.stage.renderView.fog?.strength??0,this._compositionParameters.color=s,this._compositionParameters.emission=r.attachment,this._compositionConfiguration.blurEnabled=2!==this._mode,!this._compositionConfiguration.blurEnabled){const t=this.techniques.getCompiled(f,this._compositionConfiguration);if(!t)return this.requestRender(1),i;const e=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(e,h,l),c.bindTechnique(t,this.bindParameters,this._compositionParameters),c.screen.draw(),e.attachDepth(o),e.attachColor(r,C),e}const u=this.techniques.getCompiled(p,this._blurHorizontalConfiguration),_=this.techniques.getCompiled(p,this._blurVerticalConfiguration),d=this.techniques.getCompiled(f,this._compositionConfiguration);if(!u||!_||!d)return this.requestRender(1),i;const g=this.camera,b=n(g.eye);this._compositionParameters.atmosphereC=b**2-this._atmosphereRadius**2,this._renderGlowMipMap(u,_);const P=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(C,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,h,l,!0),c.bindTechnique(d,this.bindParameters,this._compositionParameters),c.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const i=this.fboCache,{fullWidth:r,fullHeight:s}=this.camera,o=this.renderingContext,n=5;this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=w,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,a(this._blurParameters.size,.5*r,.5*s);let h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]);const m=i.acquire(h,l,"glow horizontal",8);for(this._compositionParameters.lodTexture=i.acquire(h,l,"glow mipmap",9);h>1&&l>1&&this._blurParameters.level<n;)this._setupFBO(m,h,l),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(`glow horizontal ${this._blurParameters.level}`,m.fbo),this._blurParameters.inputScale=1,this._blurParameters.input=m.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,h,l,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),i.debugCallback?.(this._compositionParameters.lodTexture.name,this._compositionParameters.lodTexture.fbo),a(this._blurParameters.size,.5*h,.5*l),h=Math.floor(this._blurParameters.size[0]),l=Math.floor(this._blurParameters.size[1]),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;m.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?b(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):b(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,i,r=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,i),o.setClearColor(0,0,0,0),o.clear(16384),r&&o.clearBuffer(1,h)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,setBlurLodCombination:t=>{this._compositionParameters.dispersionWeight=t},preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)},toggleTonemapping:t=>{this._compositionConfiguration.tonemappingEnabled=t,this.requestRender(1)}}}};t([s()],v.prototype,"consumes",void 0),t([s()],v.prototype,"produces",void 0),v=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],v);export{v as Glow};
2
+ import{__decorate as t}from"tslib";import{releaseMaybe as e}from"../../../../../core/maybe.js";import{watch as r,syncAndInitial as i}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as o}from"../../../../../core/accessorSupport/decorators.js";import{set as a}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{length as n}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{ZEROS as l}from"../../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{getReferenceEllipsoid as h}from"../../../../../geometry/ellipsoidUtils.js";import{InternalRenderCategory as m}from"../../../webgl.js";import{TransparentEnvironment as c}from"../TransparentEnvironment.js";import{a as u}from"../../../../../chunks/GlowBlur.glsl.js";import{GlowBlurTechnique as p}from"./GlowBlurTechnique.js";import{GlowBlurTechniqueConfiguration as _}from"./GlowBlurTechniqueConfiguration.js";import{b as d,a as g,m as b}from"../../../../../chunks/GlowComposition.glsl.js";import{GlowCompositionTechnique as f}from"./GlowCompositionTechnique.js";import{GlowCompositionTechniqueConfiguration as P}from"./GlowCompositionTechniqueConfiguration.js";import{floatBlendReductionFactor as w}from"../../shaders/oitResolution.glsl.js";import{ColorAttachment1 as C,DepthStencilAttachment as T}from"../../../../webgl/enums.js";let v=class extends c{constructor(t){super(t),this.consumes={required:[m.TRANSPARENT_ENVIRONMENT,"emissive"]},this.produces=m.TRANSPARENT_ENVIRONMENT,this._mode=0,this._intensity=.5,this._scatteringFactors={realistic:new d([32,16,8,4,2,1],1),cartographicMin:new d([.4,.18,.25,.12,.05,0],1),cartographicDefault:new d([1.17,1.08,.78,.4,.26,.11],4),cartographicMax:new d([3.59,3.9,2.46,1.4,.93,.44],13)},this._blurHorizontalConfiguration=new _,this._blurVerticalConfiguration=new _,this._compositeConfiguration=new P,this._compositionParameters=new g,this._blurParameters=new u,this._blurScalePerLod=3.06,this._logicalBlurRadius=.0037;const e=h(t.view.spatialReference);this._atmosphereRadius=e.radius+e.atmosphereHeight,this._blurVerticalConfiguration.glowStage=1}initialize(){this.addHandles([r(()=>this._updateParameters(),()=>{},i)])}_updateParameters(){const t=this.view.environment.lighting.glow;this._mode=null==t?this.view.environment.atmosphereEnabled?0:2:1,t&&(this._intensity=t.intensity),this._compositionParameters.minDisperse.preset=this._preset,this.requestRender(1)}render(t){const r=t.find(({name:t})=>t===m.TRANSPARENT_ENVIRONMENT),i=r.getAttachment(C);if(!i?.attachment)return r;const s=r.getTexture(),o=r.getAttachment(T),a=this.fboCache,{fullWidth:l,fullHeight:h}=this.bindParameters.camera,c=this.renderingContext;this._compositeConfiguration.useFloatBlend=this._blurHorizontalConfiguration.useFloatBlend=this._blurVerticalConfiguration.useFloatBlend=this.bindParameters.useFloatBlend.value,this._compositionParameters.fogOpacity=this.view.stage.renderView.fog?.strength??0,this._compositionParameters.color=s,this._compositionParameters.emission=i.attachment,this._compositeConfiguration.blurEnabled=2!==this._mode;const u=this.techniques.getCompiled(p,this._blurHorizontalConfiguration),_=this.techniques.getCompiled(p,this._blurVerticalConfiguration),d=this.techniques.getCompiled(f,this._compositeConfiguration);if(!u||!_||!d)return this.requestRender(1),r;if(!this._compositeConfiguration.blurEnabled){const t=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return this._setupFBO(t,l,h),c.bindTechnique(d,this.bindParameters,this._compositionParameters),c.screen.draw(),t.attachDepth(o),t.attachColor(i,C),t}const g=this.camera,b=n(g.eye);this._compositionParameters.atmosphereC=b**2-this._atmosphereRadius**2,this._renderGlowMipMap(u,_);const P=a.acquire(s.descriptor.width,s.descriptor.height,this.produces);return P.acquireColor(C,this.bindParameters.useFloatBlend.value?8:5,"emissive glow"),this._setupFBO(P,l,h,!0),c.bindTechnique(d,this.bindParameters,this._compositionParameters),c.screen.draw(),this._compositionParameters.lodTexture=e(this._compositionParameters.lodTexture),P.attachDepth(o),P}_renderGlowMipMap(t,e){const r=this.fboCache,{fullWidth:i,fullHeight:s}=this.camera,o=this.renderingContext,n=5;this._blurParameters.input=this._compositionParameters.emission,this._blurParameters.inputScale=w,this._blurParameters.level=0,this._blurParameters.blurRadius=this._logicalBlurRadius,a(this._blurParameters.size,.5*i,.5*s);let l=Math.floor(this._blurParameters.size[0]),h=Math.floor(this._blurParameters.size[1]);const m=r.acquire(l,h,"glow horizontal",8);for(this._compositionParameters.lodTexture=r.acquire(l,h,"glow mipmap",9);l>1&&h>1&&this._blurParameters.level<n;)this._setupFBO(m,l,h),o.bindTechnique(t,this.bindParameters,this._blurParameters),o.screen.draw(),r.debugCallback?.(`glow horizontal ${this._blurParameters.level}`,m.fbo),this._blurParameters.inputScale=1,this._blurParameters.input=m.getTexture(),this._setupFBO(this._compositionParameters.lodTexture,l,h,!1,this._blurParameters.level),o.bindTechnique(e,this.bindParameters,this._blurParameters),o.screen.draw(),r.debugCallback?.(this._compositionParameters.lodTexture.name,this._compositionParameters.lodTexture.fbo),a(this._blurParameters.size,.5*l,.5*h),l=Math.floor(this._blurParameters.size[0]),h=Math.floor(this._blurParameters.size[1]),this._blurParameters.input=this._compositionParameters.lodTexture.getTexture(),this._blurParameters.blurRadius*=this._blurScalePerLod,++this._blurParameters.level;m.release(),this._compositionParameters.lodTexture.fbo.level=0}get _preset(){return 0===this._mode?this._scatteringFactors.realistic.preset:this._intensity<=.5?b(this._scatteringFactors.cartographicMin.preset,this._scatteringFactors.cartographicDefault.preset,2*this._intensity):b(this._scatteringFactors.cartographicDefault.preset,this._scatteringFactors.cartographicMax.preset,2*(this._intensity-.5))}_setupFBO(t,e,r,i=!1,s=0){t.fbo.level=s;const o=this.renderingContext;o.bindFramebuffer(t.fbo),o.setViewport(0,0,e,r),o.setClearColor(0,0,0,0),o.clear(16384),i&&o.clearBuffer(1,l)}get test(){return{compositionParameters:this._compositionParameters,blurParameters:this._blurParameters,preset:this._preset,setMinDisperse:(t,e)=>{0===this._mode?this._scatteringFactors.realistic.preset[t]=e:(this._scatteringFactors.cartographicMin.preset[t]=e,this._scatteringFactors.cartographicMax.preset[t]=e)}}}};t([s()],v.prototype,"consumes",void 0),t([s()],v.prototype,"produces",void 0),v=t([o("esri.views.3d.webgl-engine.effects.glow.Glow")],v);export{v as Glow};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as t}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class r extends t{constructor(){super(...arguments),this.useFloatBlend=!0,this.blurEnabled=!1,this.tonemappingEnabled=!0}}e([o()],r.prototype,"useFloatBlend",void 0),e([o()],r.prototype,"blurEnabled",void 0),e([o()],r.prototype,"tonemappingEnabled",void 0);export{r as GlowCompositionTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{parameter as o,ShaderTechniqueConfiguration as r}from"../../core/shaderTechnique/ShaderTechniqueConfiguration.js";class t extends r{constructor(){super(...arguments),this.useFloatBlend=!0,this.blurEnabled=!1}}e([o()],t.prototype,"useFloatBlend",void 0),e([o()],t.prototype,"blurEnabled",void 0);export{t as GlowCompositionTechniqueConfiguration};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../../chunks/OITDimOpaque.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{a as OITBlendPassParameters,b as build}from"../../../../../chunks/OITBlend.glsl.js";
2
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../../chunks/OITDimOpaque.glsl.js";import"../../shaders/alphaCutoff.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{a as OITBlendPassParameters,b as build}from"../../../../../chunks/OITBlend.glsl.js";
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../../chunks/OITDimOpaque.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{a as OITBlendEmissionPassParameters,b as build}from"../../../../../chunks/OITBlendEmission.glsl.js";
2
+ import"../../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../../core/shaderModules/glsl.js";import"../../core/shaderModules/Texture2DPassUniform.js";import"../../../../../chunks/OITDimOpaque.glsl.js";import"../../shaders/alphaCutoff.glsl.js";import"../../shaders/oitResolution.glsl.js";import"../../../../webgl/ShaderBuilder.js";export{a as OITBlendEmissionPassParameters,b as build}from"../../../../../chunks/OITBlendEmission.glsl.js";