@arcgis/core 4.34.0-next.87 → 4.34.0-next.89

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 (504) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/arcade/Dictionary.js +1 -1
  3. package/arcade/Feature.js +1 -1
  4. package/arcade/Pixel.js +1 -1
  5. package/arcade/Voxel.js +1 -1
  6. package/arcade/containerUtils.js +1 -1
  7. package/arcade/featureSetUtils.js +1 -1
  8. package/arcade/featureset/actions/GroupBy.js +1 -1
  9. package/arcade/featureset/actions/OrderBy.js +1 -1
  10. package/arcade/featureset/support/FeatureSet.js +1 -1
  11. package/arcade/functions/date.js +1 -1
  12. package/arcade/functions/feature.js +1 -1
  13. package/arcade/functions/featuresetbase.js +1 -1
  14. package/arcade/functions/featuresetstats.js +1 -1
  15. package/arcade/functions/featuresetstring.js +1 -1
  16. package/arcade/functions/fieldStats.js +1 -1
  17. package/arcade/functions/geometry.js +1 -1
  18. package/arcade/functions/maths.js +1 -1
  19. package/arcade/functions/string.js +1 -1
  20. package/arcade/languageUtils.js +1 -1
  21. package/assets/components/assets/accordion-item/t9n/messages.ar.json +1 -1
  22. package/assets/components/assets/accordion-item/t9n/messages.bg.json +1 -1
  23. package/assets/components/assets/accordion-item/t9n/messages.bs.json +1 -1
  24. package/assets/components/assets/accordion-item/t9n/messages.ca.json +1 -1
  25. package/assets/components/assets/accordion-item/t9n/messages.cs.json +1 -1
  26. package/assets/components/assets/accordion-item/t9n/messages.da.json +1 -1
  27. package/assets/components/assets/accordion-item/t9n/messages.de.json +1 -1
  28. package/assets/components/assets/accordion-item/t9n/messages.el.json +1 -1
  29. package/assets/components/assets/accordion-item/t9n/messages.es.json +1 -1
  30. package/assets/components/assets/accordion-item/t9n/messages.et.json +1 -1
  31. package/assets/components/assets/accordion-item/t9n/messages.fi.json +1 -1
  32. package/assets/components/assets/accordion-item/t9n/messages.fr.json +1 -1
  33. package/assets/components/assets/accordion-item/t9n/messages.he.json +1 -1
  34. package/assets/components/assets/accordion-item/t9n/messages.hr.json +1 -1
  35. package/assets/components/assets/accordion-item/t9n/messages.hu.json +1 -1
  36. package/assets/components/assets/accordion-item/t9n/messages.id.json +1 -1
  37. package/assets/components/assets/accordion-item/t9n/messages.it.json +1 -1
  38. package/assets/components/assets/accordion-item/t9n/messages.ja.json +1 -1
  39. package/assets/components/assets/accordion-item/t9n/messages.ko.json +1 -1
  40. package/assets/components/assets/accordion-item/t9n/messages.lt.json +1 -1
  41. package/assets/components/assets/accordion-item/t9n/messages.lv.json +1 -1
  42. package/assets/components/assets/accordion-item/t9n/messages.nl.json +1 -1
  43. package/assets/components/assets/accordion-item/t9n/messages.no.json +1 -1
  44. package/assets/components/assets/accordion-item/t9n/messages.pl.json +1 -1
  45. package/assets/components/assets/accordion-item/t9n/messages.pt-BR.json +1 -1
  46. package/assets/components/assets/accordion-item/t9n/messages.pt-PT.json +1 -1
  47. package/assets/components/assets/accordion-item/t9n/messages.ro.json +1 -1
  48. package/assets/components/assets/accordion-item/t9n/messages.ru.json +1 -1
  49. package/assets/components/assets/accordion-item/t9n/messages.sk.json +1 -1
  50. package/assets/components/assets/accordion-item/t9n/messages.sl.json +1 -1
  51. package/assets/components/assets/accordion-item/t9n/messages.sr.json +1 -1
  52. package/assets/components/assets/accordion-item/t9n/messages.sv.json +1 -1
  53. package/assets/components/assets/accordion-item/t9n/messages.th.json +1 -1
  54. package/assets/components/assets/accordion-item/t9n/messages.tr.json +1 -1
  55. package/assets/components/assets/accordion-item/t9n/messages.uk.json +1 -1
  56. package/assets/components/assets/accordion-item/t9n/messages.vi.json +1 -1
  57. package/assets/components/assets/accordion-item/t9n/messages.zh-CN.json +1 -1
  58. package/assets/components/assets/accordion-item/t9n/messages.zh-HK.json +1 -1
  59. package/assets/components/assets/accordion-item/t9n/messages.zh-TW.json +1 -1
  60. package/assets/components/assets/action-bar/t9n/messages.ar.json +1 -1
  61. package/assets/components/assets/action-bar/t9n/messages.bg.json +1 -1
  62. package/assets/components/assets/action-bar/t9n/messages.bs.json +1 -1
  63. package/assets/components/assets/action-bar/t9n/messages.ca.json +1 -1
  64. package/assets/components/assets/action-bar/t9n/messages.cs.json +1 -1
  65. package/assets/components/assets/action-bar/t9n/messages.da.json +1 -1
  66. package/assets/components/assets/action-bar/t9n/messages.de.json +1 -1
  67. package/assets/components/assets/action-bar/t9n/messages.el.json +1 -1
  68. package/assets/components/assets/action-bar/t9n/messages.es.json +1 -1
  69. package/assets/components/assets/action-bar/t9n/messages.et.json +1 -1
  70. package/assets/components/assets/action-bar/t9n/messages.fi.json +1 -1
  71. package/assets/components/assets/action-bar/t9n/messages.fr.json +1 -1
  72. package/assets/components/assets/action-bar/t9n/messages.he.json +1 -1
  73. package/assets/components/assets/action-bar/t9n/messages.hr.json +1 -1
  74. package/assets/components/assets/action-bar/t9n/messages.hu.json +1 -1
  75. package/assets/components/assets/action-bar/t9n/messages.id.json +1 -1
  76. package/assets/components/assets/action-bar/t9n/messages.it.json +1 -1
  77. package/assets/components/assets/action-bar/t9n/messages.ja.json +1 -1
  78. package/assets/components/assets/action-bar/t9n/messages.ko.json +1 -1
  79. package/assets/components/assets/action-bar/t9n/messages.lt.json +1 -1
  80. package/assets/components/assets/action-bar/t9n/messages.lv.json +1 -1
  81. package/assets/components/assets/action-bar/t9n/messages.nl.json +1 -1
  82. package/assets/components/assets/action-bar/t9n/messages.no.json +1 -1
  83. package/assets/components/assets/action-bar/t9n/messages.pl.json +1 -1
  84. package/assets/components/assets/action-bar/t9n/messages.pt-BR.json +1 -1
  85. package/assets/components/assets/action-bar/t9n/messages.pt-PT.json +1 -1
  86. package/assets/components/assets/action-bar/t9n/messages.ro.json +1 -1
  87. package/assets/components/assets/action-bar/t9n/messages.ru.json +1 -1
  88. package/assets/components/assets/action-bar/t9n/messages.sk.json +1 -1
  89. package/assets/components/assets/action-bar/t9n/messages.sl.json +1 -1
  90. package/assets/components/assets/action-bar/t9n/messages.sr.json +1 -1
  91. package/assets/components/assets/action-bar/t9n/messages.sv.json +1 -1
  92. package/assets/components/assets/action-bar/t9n/messages.th.json +1 -1
  93. package/assets/components/assets/action-bar/t9n/messages.tr.json +1 -1
  94. package/assets/components/assets/action-bar/t9n/messages.uk.json +1 -1
  95. package/assets/components/assets/action-bar/t9n/messages.vi.json +1 -1
  96. package/assets/components/assets/action-bar/t9n/messages.zh-CN.json +1 -1
  97. package/assets/components/assets/action-bar/t9n/messages.zh-HK.json +1 -1
  98. package/assets/components/assets/action-bar/t9n/messages.zh-TW.json +1 -1
  99. package/assets/components/assets/action-pad/t9n/messages.ar.json +1 -1
  100. package/assets/components/assets/action-pad/t9n/messages.bg.json +1 -1
  101. package/assets/components/assets/action-pad/t9n/messages.bs.json +1 -1
  102. package/assets/components/assets/action-pad/t9n/messages.ca.json +1 -1
  103. package/assets/components/assets/action-pad/t9n/messages.cs.json +1 -1
  104. package/assets/components/assets/action-pad/t9n/messages.da.json +1 -1
  105. package/assets/components/assets/action-pad/t9n/messages.de.json +1 -1
  106. package/assets/components/assets/action-pad/t9n/messages.el.json +1 -1
  107. package/assets/components/assets/action-pad/t9n/messages.es.json +1 -1
  108. package/assets/components/assets/action-pad/t9n/messages.et.json +1 -1
  109. package/assets/components/assets/action-pad/t9n/messages.fi.json +1 -1
  110. package/assets/components/assets/action-pad/t9n/messages.fr.json +1 -1
  111. package/assets/components/assets/action-pad/t9n/messages.he.json +1 -1
  112. package/assets/components/assets/action-pad/t9n/messages.hr.json +1 -1
  113. package/assets/components/assets/action-pad/t9n/messages.hu.json +1 -1
  114. package/assets/components/assets/action-pad/t9n/messages.id.json +1 -1
  115. package/assets/components/assets/action-pad/t9n/messages.it.json +1 -1
  116. package/assets/components/assets/action-pad/t9n/messages.ja.json +1 -1
  117. package/assets/components/assets/action-pad/t9n/messages.ko.json +1 -1
  118. package/assets/components/assets/action-pad/t9n/messages.lt.json +1 -1
  119. package/assets/components/assets/action-pad/t9n/messages.lv.json +1 -1
  120. package/assets/components/assets/action-pad/t9n/messages.nl.json +1 -1
  121. package/assets/components/assets/action-pad/t9n/messages.no.json +1 -1
  122. package/assets/components/assets/action-pad/t9n/messages.pl.json +1 -1
  123. package/assets/components/assets/action-pad/t9n/messages.pt-BR.json +1 -1
  124. package/assets/components/assets/action-pad/t9n/messages.pt-PT.json +1 -1
  125. package/assets/components/assets/action-pad/t9n/messages.ro.json +1 -1
  126. package/assets/components/assets/action-pad/t9n/messages.ru.json +1 -1
  127. package/assets/components/assets/action-pad/t9n/messages.sk.json +1 -1
  128. package/assets/components/assets/action-pad/t9n/messages.sl.json +1 -1
  129. package/assets/components/assets/action-pad/t9n/messages.sr.json +1 -1
  130. package/assets/components/assets/action-pad/t9n/messages.sv.json +1 -1
  131. package/assets/components/assets/action-pad/t9n/messages.th.json +1 -1
  132. package/assets/components/assets/action-pad/t9n/messages.tr.json +1 -1
  133. package/assets/components/assets/action-pad/t9n/messages.uk.json +1 -1
  134. package/assets/components/assets/action-pad/t9n/messages.vi.json +1 -1
  135. package/assets/components/assets/action-pad/t9n/messages.zh-CN.json +1 -1
  136. package/assets/components/assets/action-pad/t9n/messages.zh-HK.json +1 -1
  137. package/assets/components/assets/action-pad/t9n/messages.zh-TW.json +1 -1
  138. package/assets/components/assets/icon/layer3D16.json +1 -0
  139. package/assets/components/assets/icon/layer3D24.json +1 -0
  140. package/assets/components/assets/icon/layer3D32.json +1 -0
  141. package/assets/components/assets/sort-handle/t9n/messages.ar.json +1 -1
  142. package/assets/components/assets/sort-handle/t9n/messages.bg.json +1 -1
  143. package/assets/components/assets/sort-handle/t9n/messages.bs.json +1 -1
  144. package/assets/components/assets/sort-handle/t9n/messages.ca.json +1 -1
  145. package/assets/components/assets/sort-handle/t9n/messages.cs.json +1 -1
  146. package/assets/components/assets/sort-handle/t9n/messages.da.json +1 -1
  147. package/assets/components/assets/sort-handle/t9n/messages.de.json +1 -1
  148. package/assets/components/assets/sort-handle/t9n/messages.el.json +1 -1
  149. package/assets/components/assets/sort-handle/t9n/messages.es.json +1 -1
  150. package/assets/components/assets/sort-handle/t9n/messages.et.json +1 -1
  151. package/assets/components/assets/sort-handle/t9n/messages.fi.json +1 -1
  152. package/assets/components/assets/sort-handle/t9n/messages.fr.json +1 -1
  153. package/assets/components/assets/sort-handle/t9n/messages.he.json +1 -1
  154. package/assets/components/assets/sort-handle/t9n/messages.hr.json +1 -1
  155. package/assets/components/assets/sort-handle/t9n/messages.hu.json +1 -1
  156. package/assets/components/assets/sort-handle/t9n/messages.id.json +1 -1
  157. package/assets/components/assets/sort-handle/t9n/messages.it.json +1 -1
  158. package/assets/components/assets/sort-handle/t9n/messages.ja.json +1 -1
  159. package/assets/components/assets/sort-handle/t9n/messages.ko.json +1 -1
  160. package/assets/components/assets/sort-handle/t9n/messages.lt.json +1 -1
  161. package/assets/components/assets/sort-handle/t9n/messages.lv.json +1 -1
  162. package/assets/components/assets/sort-handle/t9n/messages.nl.json +1 -1
  163. package/assets/components/assets/sort-handle/t9n/messages.no.json +1 -1
  164. package/assets/components/assets/sort-handle/t9n/messages.pl.json +1 -1
  165. package/assets/components/assets/sort-handle/t9n/messages.pt-BR.json +1 -1
  166. package/assets/components/assets/sort-handle/t9n/messages.pt-PT.json +1 -1
  167. package/assets/components/assets/sort-handle/t9n/messages.ro.json +1 -1
  168. package/assets/components/assets/sort-handle/t9n/messages.ru.json +1 -1
  169. package/assets/components/assets/sort-handle/t9n/messages.sk.json +1 -1
  170. package/assets/components/assets/sort-handle/t9n/messages.sl.json +1 -1
  171. package/assets/components/assets/sort-handle/t9n/messages.sr.json +1 -1
  172. package/assets/components/assets/sort-handle/t9n/messages.sv.json +1 -1
  173. package/assets/components/assets/sort-handle/t9n/messages.th.json +1 -1
  174. package/assets/components/assets/sort-handle/t9n/messages.tr.json +1 -1
  175. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  176. package/assets/components/assets/sort-handle/t9n/messages.vi.json +1 -1
  177. package/assets/components/assets/sort-handle/t9n/messages.zh-CN.json +1 -1
  178. package/assets/components/assets/sort-handle/t9n/messages.zh-HK.json +1 -1
  179. package/assets/components/assets/sort-handle/t9n/messages.zh-TW.json +1 -1
  180. package/assets/esri/core/workers/RemoteClient.js +1 -1
  181. package/assets/esri/core/workers/chunks/{ed8863c3d334f438b625.js → 0037abf0a82d1ed32e91.js} +1 -1
  182. package/assets/esri/core/workers/chunks/{c6d4b8d683a34fc0d111.js → 0103b70126bc5dffc55e.js} +1 -1
  183. package/assets/esri/core/workers/chunks/{d7fc8ea2ff527a09f4b9.js → 0296ebe8e37e30af771c.js} +1 -1
  184. package/assets/esri/core/workers/chunks/{39a1f361bb69073af765.js → 04dbdaa63c950f32b8f0.js} +1 -1
  185. package/assets/esri/core/workers/chunks/05aac984cbbadb5f6aa0.js +1 -0
  186. package/assets/esri/core/workers/chunks/0fadd1defbb6743dacdc.js +1 -0
  187. package/assets/esri/core/workers/chunks/{0f05425954578ac796ec.js → 135142f3cbfaf24949bc.js} +1 -1
  188. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +2 -0
  189. package/assets/esri/core/workers/chunks/{268f5b233640a9dbbf89.js.LICENSE.txt → 24921d31efa8d222ad2d.js.LICENSE.txt} +1 -1
  190. package/assets/esri/core/workers/chunks/2b2f1fcd50dea017d891.js +1 -0
  191. package/assets/esri/core/workers/chunks/2e1cc11462846febb3b2.js +1 -0
  192. package/assets/esri/core/workers/chunks/300b96f0f8e34b4a5d8b.js +1 -0
  193. package/assets/esri/core/workers/chunks/37b5007660535f1c91c6.js +1 -0
  194. package/assets/esri/core/workers/chunks/{2dc88379ee94fabdaf52.js → 39a5863355cccaabd2d6.js} +1 -1
  195. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js +2 -0
  196. package/assets/esri/core/workers/chunks/{47e4f66c33bb697fbe6b.js.LICENSE.txt → 3a457e718a901a45902e.js.LICENSE.txt} +1 -1
  197. package/assets/esri/core/workers/chunks/{f3ee035fa7bf638c8e60.js → 3d68a650a1f944ec5171.js} +1 -1
  198. package/assets/esri/core/workers/chunks/46ef545d2b3b3f4e6d32.js +2 -0
  199. package/assets/esri/core/workers/chunks/{336b54144afec0c7d396.js.LICENSE.txt → 46ef545d2b3b3f4e6d32.js.LICENSE.txt} +1 -1
  200. package/assets/esri/core/workers/chunks/47c0c16c1e995a441ec2.js +1 -0
  201. package/assets/esri/core/workers/chunks/48913b944c28343816ac.js +1 -0
  202. package/assets/esri/core/workers/chunks/{4d4db6854aff7656f6e1.js → 4dd4b19c410026233999.js} +1 -1
  203. package/assets/esri/core/workers/chunks/4e77b9cc1d9437bcbb0c.js +1 -0
  204. package/assets/esri/core/workers/chunks/52121179d4f9833008ec.js +1 -0
  205. package/assets/esri/core/workers/chunks/58e2652810143f509fe1.js +1 -0
  206. package/assets/esri/core/workers/chunks/{97489bf16a1d327992b2.js → 595593dd03bcfba795c8.js} +11 -16
  207. package/assets/esri/core/workers/chunks/59e27818cb68f0285d54.js +1 -0
  208. package/assets/esri/core/workers/chunks/620a94b54be3ed78350d.js +1 -0
  209. package/assets/esri/core/workers/chunks/67d9cfe02613cb73ee37.js.LICENSE.txt +1 -1
  210. package/assets/esri/core/workers/chunks/6f29951f5a2da068b257.js +1 -0
  211. package/assets/esri/core/workers/chunks/71c6c0b26253c4ca1b68.js +1 -0
  212. package/assets/esri/core/workers/chunks/{1c1b0cc91fe9cb3fec61.js → 71df48968d6cdc736458.js} +1 -1
  213. package/assets/esri/core/workers/chunks/773d106f60f7dad1493d.js +1 -0
  214. package/assets/esri/core/workers/chunks/779ee975efebb838b5d6.js +1 -0
  215. package/assets/esri/core/workers/chunks/7a240ab31d9ff2d2c5af.js +1 -0
  216. package/assets/esri/core/workers/chunks/834985ec601623df34a1.js +1 -0
  217. package/assets/esri/core/workers/chunks/{5dee8c0c60ced791e57f.js → 84a556dafd583635ad5e.js} +1 -1
  218. package/assets/esri/core/workers/chunks/8be9fa12e854a83062c3.js +1 -0
  219. package/assets/esri/core/workers/chunks/8f4cfef97716c3502b0f.js +1 -0
  220. package/assets/esri/core/workers/chunks/{65ec21d29e8563fdbc55.js → 94c9d3094c93f7760433.js} +1 -1
  221. package/assets/esri/core/workers/chunks/{177840d5f0076c0de46b.js → 96de78f9994207aa7201.js} +1 -1
  222. package/assets/esri/core/workers/chunks/{366db86914a63e6d0c68.js → 978ffde9ebebf5c83aea.js} +1 -1
  223. package/assets/esri/core/workers/chunks/a1abe9865d66789bd5af.js +1 -0
  224. package/assets/esri/core/workers/chunks/{47e4f66c33bb697fbe6b.js → a8f998b8ec8c56150479.js} +2 -2
  225. package/assets/esri/core/workers/chunks/{f6e18668f728dfd8ba5e.js.LICENSE.txt → a8f998b8ec8c56150479.js.LICENSE.txt} +1 -1
  226. package/assets/esri/core/workers/chunks/{257fd65786feb5951b90.js → a96e58ed9a4a2329ee53.js} +1 -1
  227. package/assets/esri/core/workers/chunks/{0074f1836d7ff69ff6ec.js → aa778e5d7db40d9b9b4a.js} +1 -1
  228. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  229. package/assets/esri/core/workers/chunks/{c78de6dd6c10280cee69.js → baa48614d9567d5f240d.js} +1 -1
  230. package/assets/esri/core/workers/chunks/c1d75c48558ed23c5b2b.js +1 -0
  231. package/assets/esri/core/workers/chunks/c3010d783506f8410f99.js +1 -0
  232. package/assets/esri/core/workers/chunks/c55c096669677321a227.js +1 -0
  233. package/assets/esri/core/workers/chunks/c86ca87959f04075e834.js +1 -0
  234. package/assets/esri/core/workers/chunks/c954d281038f6bf80232.js +1 -0
  235. package/assets/esri/core/workers/chunks/{c50e8d5f554cf151865c.js → ce16489cf7eb0d78c741.js} +2 -2
  236. package/assets/esri/core/workers/chunks/{c50e8d5f554cf151865c.js.LICENSE.txt → ce16489cf7eb0d78c741.js.LICENSE.txt} +1 -1
  237. package/assets/esri/core/workers/chunks/{a48f980c1531805db73b.js → d1fc2c6e95fe2572d297.js} +1 -1
  238. package/assets/esri/core/workers/chunks/{fc5ac54aab66562c8463.js → d51aabb9b950f49df183.js} +1 -1
  239. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  240. package/assets/esri/core/workers/chunks/{639d856cd217914dfe1f.js → de34c21d3e6913befe5a.js} +1 -1
  241. package/assets/esri/core/workers/chunks/e99fc64b67bb0c71dc34.js +1 -0
  242. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  243. package/assets/esri/core/workers/chunks/f6806780ca2aa591475a.js +1 -0
  244. package/assets/esri/themes/dark/main.css +1 -1
  245. package/assets/esri/themes/light/main.css +1 -1
  246. package/assets/esri/themes/light/view.css +1 -1
  247. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ar.json +1 -0
  248. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bg.json +1 -0
  249. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bs.json +1 -0
  250. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ca.json +1 -0
  251. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_cs.json +1 -0
  252. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_da.json +1 -0
  253. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_de.json +1 -0
  254. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_el.json +1 -0
  255. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_en.json +1 -0
  256. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_es.json +1 -0
  257. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_et.json +1 -0
  258. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fi.json +1 -0
  259. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fr.json +1 -0
  260. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_he.json +1 -0
  261. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hr.json +1 -0
  262. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hu.json +1 -0
  263. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_id.json +1 -0
  264. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_it.json +1 -0
  265. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ja.json +1 -0
  266. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ko.json +1 -0
  267. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lt.json +1 -0
  268. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lv.json +1 -0
  269. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_nl.json +1 -0
  270. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_no.json +1 -0
  271. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pl.json +1 -0
  272. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-BR.json +1 -0
  273. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-PT.json +1 -0
  274. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ro.json +1 -0
  275. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ru.json +1 -0
  276. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sk.json +1 -0
  277. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sl.json +1 -0
  278. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sr.json +1 -0
  279. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sv.json +1 -0
  280. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_th.json +1 -0
  281. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_tr.json +1 -0
  282. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_uk.json +1 -0
  283. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_vi.json +1 -0
  284. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-CN.json +1 -0
  285. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-HK.json +1 -0
  286. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-TW.json +1 -0
  287. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  288. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  289. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  290. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  291. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  292. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  293. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  294. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  295. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  296. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  297. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  298. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  299. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  300. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  301. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  302. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  303. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  304. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  305. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  306. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  307. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  308. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  309. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  310. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  311. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  312. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  313. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  314. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  315. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  316. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  317. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  318. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  319. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  320. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  321. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  322. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  323. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  324. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  325. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  326. package/chunks/ComponentShader.glsl.js +15 -16
  327. package/chunks/DefaultMaterial.glsl.js +15 -16
  328. package/chunks/Path.glsl.js +12 -12
  329. package/chunks/RealisticTree.glsl.js +5 -6
  330. package/chunks/aiServices.js +1 -1
  331. package/chunks/array.js +1 -1
  332. package/chunks/languageUtils.js +1 -1
  333. package/config.js +1 -1
  334. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  335. package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
  336. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  337. package/editing/sharedTemplates/templateDefinitions/FeatureTemplateDefinition.js +1 -1
  338. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  339. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  340. package/editing/sharedTemplates/templateDefinitions/TemplateDefinitionBase.js +1 -1
  341. package/editing/sharedTemplates/templateDefinitions/parts/FeatureTemplateRelationshipPart.js +1 -1
  342. package/editing/sharedTemplates/templateDefinitions/parts/PresetTemplatePart.js +1 -1
  343. package/editing/sharedTemplates/templateDefinitions/parts/TemplatePartBase.js +1 -1
  344. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  345. package/interfaces.d.ts +106 -47
  346. package/kernel.js +1 -1
  347. package/layers/CSVLayer.js +1 -1
  348. package/layers/FeatureLayer.js +1 -1
  349. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  350. package/layers/OrientedImageryLayer.js +1 -1
  351. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  352. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  353. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  354. package/layers/support/BuildingFieldStatistics.js +5 -0
  355. package/layers/support/BuildingSummaryStatistics.js +1 -1
  356. package/layers/support/ControlPoint.js +5 -0
  357. package/layers/support/ControlPointsGeoreference.js +1 -1
  358. package/layers/support/DateTimeFieldFormat.js +1 -1
  359. package/layers/support/FieldConfiguration.js +1 -1
  360. package/layers/support/FieldFormat.js +1 -1
  361. package/layers/support/NumberFieldFormat.js +1 -1
  362. package/layers/support/Sublayer.js +1 -1
  363. package/layers/support/VideoFrame.js +1 -1
  364. package/layers/support/capabilities.js +1 -1
  365. package/layers/support/fieldConfigUtils.js +1 -1
  366. package/layers/support/fieldFormatUtils.js +5 -0
  367. package/layers/support/mediaUtils.js +1 -1
  368. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  369. package/layers/support/vectorTileLayerLoader.js +1 -1
  370. package/package.json +2 -2
  371. package/popup/FieldInfo.js +1 -1
  372. package/popup/content/FieldsContent.js +1 -1
  373. package/portal/Portal.js +1 -1
  374. package/portal/schemas/definitions.js +1 -1
  375. package/renderers/support/RasterSymbolizer.js +1 -1
  376. package/rest/sharedTemplates/addSharedTemplates.js +5 -0
  377. package/rest/sharedTemplates/querySharedTemplates.js +1 -1
  378. package/rest/sharedTemplates/utils.js +5 -0
  379. package/rest/support/imageMeasureUtils.js +1 -1
  380. package/support/ArcadeExpression.js +1 -1
  381. package/support/revision.js +1 -1
  382. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  383. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  384. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  385. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  386. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +1 -1
  387. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +1 -1
  388. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +1 -1
  389. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +1 -1
  390. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
  391. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
  392. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
  393. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/utils.js +1 -1
  394. package/views/2d/layers/BaseLayerView2D.js +1 -1
  395. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  396. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  397. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  398. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  399. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +1 -1
  400. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  401. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  402. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  403. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  404. package/views/3d/environment/CloudsComposition.js +1 -1
  405. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  406. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  407. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  408. package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +5 -0
  409. package/views/3d/layers/I3SMeshView3D.js +1 -1
  410. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  411. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  412. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  413. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  414. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  415. package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
  416. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  417. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  418. package/views/3d/state/ViewState.js +1 -1
  419. package/views/3d/state/ViewStateManager.js +1 -1
  420. package/views/3d/support/QualitySettings.js +1 -1
  421. package/views/3d/support/ResourceController.js +1 -1
  422. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  423. package/views/3d/support/orientedBoundingBox.js +1 -1
  424. package/views/3d/terrain/TerrainRenderer.js +1 -1
  425. package/views/3d/webgl/RenderNode.js +1 -1
  426. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  427. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  428. package/views/3d/webgl-engine/collections/Component/{ComponentObjectElevationAgnosticComponentBVH.js → ComponentObjectElevationAgnosticBVH.js} +1 -1
  429. package/views/3d/webgl-engine/collections/Component/ComponentObjectFixedBVH.js +5 -0
  430. package/views/3d/webgl-engine/collections/Component/IntersectionGeometry.js +1 -1
  431. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  432. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  433. package/views/3d/webgl-engine/collections/Component/ObjectParameters.js +1 -1
  434. package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
  435. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  436. package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
  437. package/views/3d/webgl-engine/effects/weather/SnowCover.glsl.js +0 -3
  438. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  439. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  440. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  441. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  442. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  443. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  444. package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
  445. package/views/GroundView.js +1 -1
  446. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +1 -1
  447. package/views/draw/input/DrawEvents.js +1 -1
  448. package/views/interactive/dragEventPipeline.js +1 -1
  449. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  450. package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
  451. package/views/layers/ImageryTileLayerView.js +1 -1
  452. package/views/support/Scheduler.js +1 -1
  453. package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
  454. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  455. package/widgets/Editor/EditorViewModel.js +1 -1
  456. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  457. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  458. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  459. package/widgets/Editor/UpdateWorkflow.js +1 -1
  460. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  461. package/widgets/Editor/components/FeatureList.js +1 -1
  462. package/widgets/Editor/workflowUtils.js +1 -1
  463. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  464. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  465. package/widgets/FeatureTable/support/templateUtils.js +1 -1
  466. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  467. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  468. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  469. package/widgets/OrientedImageryViewer.js +1 -1
  470. package/widgets/PanoramicVideoViewer.js +5 -0
  471. package/widgets/PanoramicViewer/PanoramicVideoViewerViewModel.js +5 -0
  472. package/widgets/ScaleRangeSlider.js +1 -1
  473. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  474. package/assets/esri/core/workers/chunks/09c2004126f4a5242b85.js +0 -1
  475. package/assets/esri/core/workers/chunks/0dd6b8b3e634bb5f0ca7.js +0 -1
  476. package/assets/esri/core/workers/chunks/0dfc2ca36014910457ef.js +0 -1
  477. package/assets/esri/core/workers/chunks/1c7fffb496af6f2540dd.js +0 -1
  478. package/assets/esri/core/workers/chunks/1fc6311d4f0d27e88737.js +0 -1
  479. package/assets/esri/core/workers/chunks/268f5b233640a9dbbf89.js +0 -2
  480. package/assets/esri/core/workers/chunks/2fe96bf7dedef11a3b63.js +0 -1
  481. package/assets/esri/core/workers/chunks/336b54144afec0c7d396.js +0 -2
  482. package/assets/esri/core/workers/chunks/36a006c55766f9540bfc.js +0 -1
  483. package/assets/esri/core/workers/chunks/4840bd93d8fe15c7aefd.js +0 -1
  484. package/assets/esri/core/workers/chunks/637a5293e36f4f7f2853.js +0 -1
  485. package/assets/esri/core/workers/chunks/7540b34e743a23e67729.js +0 -1
  486. package/assets/esri/core/workers/chunks/7be11a3ef1f49245089f.js +0 -1
  487. package/assets/esri/core/workers/chunks/804e3b3df375177e6c86.js +0 -1
  488. package/assets/esri/core/workers/chunks/819a8bc1f0a694017ee6.js +0 -1
  489. package/assets/esri/core/workers/chunks/88d8ff0140f5ea97c6b7.js +0 -1
  490. package/assets/esri/core/workers/chunks/8de11aab65d91e7f1a4d.js +0 -1
  491. package/assets/esri/core/workers/chunks/96740c75ad65d651cc43.js +0 -1
  492. package/assets/esri/core/workers/chunks/9971de3f38a55735cec9.js +0 -1
  493. package/assets/esri/core/workers/chunks/9e47f680b66320dcfd34.js +0 -1
  494. package/assets/esri/core/workers/chunks/a2652d10bb0bc41c9a8d.js +0 -1
  495. package/assets/esri/core/workers/chunks/a7fcb60d5a9d2d9560e4.js +0 -1
  496. package/assets/esri/core/workers/chunks/aa84775399420e35c6a5.js +0 -1
  497. package/assets/esri/core/workers/chunks/b0508c96338d7cf296c1.js +0 -1
  498. package/assets/esri/core/workers/chunks/b09b34f64a6bc2b49e0a.js +0 -1
  499. package/assets/esri/core/workers/chunks/c0ae186620b68d43b338.js +0 -1
  500. package/assets/esri/core/workers/chunks/cc579c94438f48a0dbab.js +0 -1
  501. package/assets/esri/core/workers/chunks/ce0bf0d0cd9e9a90093b.js +0 -1
  502. package/assets/esri/core/workers/chunks/d142a42755a78bb157ed.js +0 -1
  503. package/assets/esri/core/workers/chunks/f35003a90163847fe1e2.js +0 -1
  504. package/assets/esri/core/workers/chunks/f6e18668f728dfd8ba5e.js +0 -2
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as P,invert as C,multiply as w}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as S}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as E}from"../../../../chunks/vec42.js";import{ZEROS as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as A,ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as D}from"../../../../geometry/support/Indices.js";import{RenderCategory as I,InternalRenderCategory as R}from"../../webgl.js";import{innerAtmosphereFadeStart as O}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as v}from"../../state/NearFarHeuristic.js";import{debugFlags as F}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as M}from"../core/FBOCache.js";import{RenderPassManager as q}from"../core/renderPasses/RenderPassManager.js";import{isColorEmission as N,isColorOrColorEmission as G}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as L}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as V}from"../effects/RenderNodes.js";import{RenderPluginManager as U}from"../effects/RenderPluginManager.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as k}from"../effects/highlight/Highlight.js";import{OITBlend as z}from"../effects/transparency/OITBlend.js";import{AnimationTimer as Q}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{DepthRange as Z}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as K}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as X}from"./MainFramebuffer.js";import{RenderContext as $,defaultRenderOccludedMask as ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as re}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ae}from"./ShadowMap.js";import ne from"./SliceHelper.js";import{MergedRenderer as he}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as oe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as de,PerformanceCategory as le}from"../statistics/RendererPerformanceInfo.js";import{PixelType as _e,ColorAttachment1 as ue,ColorAttachment2 as pe}from"../../../webgl/enums.js";let me=class extends te{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new q,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ne,this._blit=null,this._oitblend=null,this.sceneDepthRange=c(Z.Infinite),this._state=c(2),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._releaseNormals=e=>{e.some(({name:e})=>"normals"===e)&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this._fboCache=new H(s),this._renderStateFeatures=c(re(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new X(this.fboCache),this._performanceInfo=new de(this._rctx),this._shadowMap=new ae(this.fboCache,e.viewingMode),this._shadowAccumulator=new se(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(4,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},n),this._renderContext=new $(this._rctx,this._shadowMap,r),this._nodes=new V(this._renderContext),this._plugins=new U({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_(()=>e.view.state.camera,()=>n(),u),_(()=>F.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},n()},p),_(()=>e.view.environment.background?.color,e=>{const t=e?i(e):y;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()},u),_(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=L,u),_(()=>this._bindParameters.clouds.fadeFactor,()=>this._bindParameters.fadeLighting(),m),_(()=>this._bindParameters.clouds.data?.state,()=>n(),m),_(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,n()},p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._blit=null,this._oitblend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,Y.prune(),he.prune(),D()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=re(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(i=>i.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(5))}get _hasHighlights(){return this._plugins.produces(9,2,4,18,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(9,13,14)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(4))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this.stage.view.qualitySettings.physicallyBasedRenderingEnabled}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(_(()=>r.updating,()=>this._requestRender(),m)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&P(this._bindParameters.ssr.reprojectionMatrix,T)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(0,...Ce),has.water=this._plugins.produces(3,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new Q(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new oe(this._pluginInput.get(I.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=K,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,m=2===e?r:i,c=s((u.tilt-h)/(o-h),0,1),g=s(((u.position.z??0)-d)/(l-d),0,1),f=a(a(1,m,c),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const P=t-this._lastFrameTime;this._lastFrameTime=t;const C=Math.max(1-r,Math.abs(r-i)),w=Math.min(C*P/p,n);w>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*w,this._requestRender())}_render(e,t,r,i){const s=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=s,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),l=this._nodes.produces(I.FINAL),_=this.hasEmitters,u=_?1:0;this._renderContext.time=t,this._renderContext.output=u,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const p=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=p?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(R.CUTFILL_DEPTH),this._renderOverlay(),a.setGLViewport(this._rctx);const m=this._framebuffer,c=m.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,_);this.hasReflections?(c?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=c):c?.release(),this._ensureBindParametersCamera(a,n),this._updateHUDOccludedFragmentOpacity(h,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const g=this._highQualityTransparency&&this._hasTransparentTerrain,f=this._plugins.produces(0,...be);this._precompilePrepasses(),this.performanceInfo.advance(le.PREPARE);const b=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,b),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(b,a,n,!s),this._ensureBindParametersSSR(t),this._precompileShaders(g,f,u),this._renderContext.output=u,m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._renderOpaque(g),this._renderTransparent(f,g,u),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(R.CUTFILL_DEPTH,this._renderCutFillDepth()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.CUTFILL_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(a,this._bindParameters.lighting.mainLight.direction,b);const P=2===r?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(I.COMPOSITE,e)),this._shadowMap.disposeOffscreenBuffers();const C=s&&!l&&!(d&&!i),w=this._pluginInput.get(I.COMPOSITE),T=C?M:this.fboCache.acquire(w.fbo.width,w.fbo.height,R.ANTIALIASING),S=this._nodes.produces(R.ANTIALIASING)?this._renderNodes(R.ANTIALIASING,T):this.blitFBO(w,T,!1);let E;this._pluginInput.set(R.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(1,S,u),E=this._renderNodes(R.HIGHLIGHTS,S)):(E=this._renderNodes(R.HIGHLIGHTS,S),this._renderHUD(1,E,u));const x=this._renderNodes(R.MAGNIFIER,E);return s&&d&&!i&&!l&&this.blitFBO(x),l?(x.attachDepth(m.depth),this.blitFBO(this._renderNodes(I.FINAL,x)),x.detachDepth()):this._pluginInput.set(I.FINAL,x),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),m.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),s||(this._releaseFBOs(),this._disposeOffscreenBuffers()),new oe(this._pluginInput.get(I.FINAL),P)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(R.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=2,this._plugins.precompile(6),this._plugins.precompile(7),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(6),this._plugins.precompile(7),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(R.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(12),this._plugins.precompile(15),this._precompileHUD(0),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(R.VIEWSHED,R.CUTFILL_DEPTH,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING,R.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(1),this._hasHighlights&&(i.highlights.forEach((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(9)}),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(I.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(le.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(le.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(y),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,_e.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,6408,_e.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._renderContext.output,i=this._framebufferSize,s=this.fboCache.acquire(i.width,i.height,"edges"),a=()=>t.render(this._bindParameters,e),n=this._bindParameters.geometryDepth;this.renderToTargets(a,s,n??this._framebuffer.depth,y),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,s.getTexture(),N(r)?1:0),s.release(),this.performanceInfo.advance(1===e?le.OPAQUE_EDGES:le.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(),this._bindParameters.overlay&&this.performanceInfo.advance(le.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(6,this._shadowMap),s.copySnapshot(1),this._renderShadowCascades(5,this._shadowMap)):this._renderShadowCascades(4),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(le.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(5,this._shadowMap),s.moveSnapshot(0),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(le.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(R.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(2)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(R.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(2),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(le.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"geometry depth",13);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1280),this.renderAllGeometry(2),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(le.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=2;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(2),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Z.Zero;const t=J(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<O)return void(this.sceneDepthRange.value=Z.Infinite);const t=e.clone();t.near=v,t.far=1e10;const r=J(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED,R.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(3),this._needsDepth&&this._precompileAllGeometry(2),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(5),this._precompileShadowCascades(6),this._precompileShadowCascades(5)):this._precompileShadowCascades(4)),this._shadowAccumulator.active&&this._precompileAllGeometry(4)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(y,!0,!0),this._renderGeometryWithNormals(3);const i=this._nodes.optional("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(le.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(R.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(le.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(6),this._plugins.precompile(7),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=ee}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(13)}precompileViewshedShadowMap(){this._precompileAllGeometry(7)}precompileCutFill(){const e=8,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,6),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(7),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=8,this._plugins.render(0,1),this._plugins.render(6),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(...ce),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ge)}_precompileOpaqueGeometry(){this._plugins.precompile(...fe),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...be)}get _hasTransparentTerrain(){return this._plugins.produces(0,6)}get _hasTransparentIntegratedMesh(){return this._plugins.produces(this._renderContext.output,7)}_renderTransparentTerrain(){const e=()=>this._plugins.render(6);if(!G(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,y),r}_renderTransparentIntegratedMesh(){const e=()=>this._plugins.render(7);if(!G(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent integrated mesh");return this.renderToTargets(e,r,this._framebuffer.depth,y),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,12)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(12),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(le.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(15),t=this._framebufferSize,r=this.fboCache.acquireDepth(12,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(15)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=9,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&G(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...Ce),this._bindParameters.oitPass=2,this._plugins.precompile(...Ce),this._bindParameters.oitPass=0):this._plugins.precompile(...Ce),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(1,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,0===e){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(12,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(12),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?le.HUD_OCCLUDED:le.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(5,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>B?3:1);a.acquireDepth(13),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=9,t.bindFramebuffer(a.fbo),k(t,e,i,r,()=>this._renderHighlightGeometries()),this.performanceInfo.advance(le.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,i){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,i)&&this.performanceInfo.advance(le.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&G(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...be),this._bindParameters.oitPass=2,this._plugins.precompile(...be),this._bindParameters.oitPass=0):this._plugins.precompile(...be)}_renderOIT(e,t,r=2){const i=1===e,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=1;const d=a?"oit hud color+alpha":"oit color+alpha",l=this.fboCache.acquire(s.width,s.height,d,8),_=1===t;_&&l.acquireColor(ue,8,"oit emissive"),l.acquireColor(_?pe:ue,7),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),_&&this._rctx.clearBuffer(1,x),n(),l.detachDepth(),h.oitPass=2;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return _&&u.acquireColor(ue,8,"oit emissive front"),a?u.acquireDepth(12):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(y,!!a),n(),u.detachDepth(),h.oitPass=0,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):this._framebuffer.bind(),this._oitblend??=new z(this._techniques),this._oitblend.blend(this._rctx,l,u,h,_),a?.detachDepth(),u.release(),l.release(),this._renderContext.output=o,a}_renderOpaque(e){const t=this.plugins.produces(0,...fe);if(t){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(R.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const r=this._framebuffer;r.update(e=>this._renderNodes(I.OPAQUE,e,t)),this.fboCache.debugCallback?.(I.OPAQUE,r.color.fbo),r.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,r.color.fbo),this._renderTerrainDepth(e),this._renderEdges(1)}_renderTransparent(e,t,r){const i=this._framebuffer;i.bind(),this._renderPlugins(20,le.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(0,r):this._renderTransparentGeometry()),i.update(t=>this._renderNodes(I.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(I.TRANSPARENT,i.color.fbo),this._renderGeometryDepth(t),this._renderHUDVisibility(),t||this._plugins.render(15),this._renderEdges(0);const s=this._hasTransparentTerrain?this._renderTransparentTerrain():null;s&&(this.performanceInfo.advance(le.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(t?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s.getTexture())),this._renderHUD(0,i.color,r))),this._bindParameters.cullAboveTerrain=!1,s&&(i.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s.getTexture()),s.release(),t&&(this._renderEdges(1),e&&(this._oitEnabled?this._renderOIT(0,r):this._renderTransparentGeometry(),this.performanceInfo.advance(le.TRANSPARENT)),this._renderEdges(0)));const a=this._hasTransparentIntegratedMesh?this._renderTransparentIntegratedMesh():null;a&&(i.bind(),this._compositingHelper.composite(this._bindParameters,a.getTexture(),N(r)?1:0),a.release()),this._bindParameters.ssao=d(this._bindParameters.ssao),t&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(le.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this.performanceInfo.advance(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}blitFBO(e,t=M,r=!0){return this._blit??=new j(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=T:(C(Se,this._bindParameters.camera.viewMatrix),C(Te,this._bindParameters.camera.projectionMatrix),w(Ee,Se,Te),w(Ee,this._renderContext.lastFrameCamera.viewMatrix,Ee),w(Ee,this._renderContext.lastFrameCamera.projectionMatrix,Ee),this._reprojectionMatrix=Ee);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=T,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};e([f({readOnly:!0})],me.prototype,"fullResolutionAtmosphere",null),e([f()],me.prototype,"_edgeView",void 0),e([f()],me.prototype,"updating",null),me=e([b("esri.views.3d.webgl-engine.lib.Renderer")],me);const ce=[0,1,2,4],ge=[3,5],fe=[0,1,2,3],be=[4,5],Pe=[2,4,8],Ce=[16,13,14],we=[4,5,2,3,6,0,1],Te=S(),Se=S(),Ee=S();function xe(e){return t=>e.immediate.schedule(t)}export{me as Renderer};
5
+ import{__decorate as e}from"tslib";import{update as t}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{unitRGBAFromColor as i}from"../../../../core/colorUtils.js";import has from"../../../../core/has.js";import{clamp as s,lerp as a}from"../../../../core/mathUtils.js";import{removeMaybe as n,abortMaybe as h,destroyMaybe as o,releaseMaybe as d}from"../../../../core/maybe.js";import{throwIfAborted as l}from"../../../../core/promiseUtils.js";import{watch as _,syncAndInitial as u,initial as p,sync as m}from"../../../../core/reactiveUtils.js";import{signal as c}from"../../../../core/signal.js";import{Milliseconds as g}from"../../../../core/time.js";import{property as f}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as b}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as P,invert as C,multiply as w}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as T,create as S}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{s as E}from"../../../../chunks/vec42.js";import{ZEROS as x}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import{fromValues as A,ZEROS as y}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{pruneIndexArrays as D}from"../../../../geometry/support/Indices.js";import{RenderCategory as I,InternalRenderCategory as R}from"../../webgl.js";import{innerAtmosphereFadeStart as O}from"../../environment/atmosphereUtils.js";import{minNearDistanceInMeters as v}from"../../state/NearFarHeuristic.js";import{debugFlags as F}from"../../support/debugFlags.js";import{FBOCache as H,defaultWebGLFBO as M}from"../core/FBOCache.js";import{RenderPassManager as q}from"../core/renderPasses/RenderPassManager.js";import{isColorEmission as N,isColorOrColorEmission as G}from"../core/shaderLibrary/ShaderOutput.js";import{distanceFadeEnd as L}from"../core/shaderLibrary/shading/ScreenSpaceConstants.js";import{RenderNodes as V}from"../effects/RenderNodes.js";import{RenderPluginManager as U}from"../effects/RenderPluginManager.js";import{Blit as j}from"../effects/blit/Blit.js";import{maxHighlightsPerChannel as B,renderHighlightBuffer as k}from"../effects/highlight/Highlight.js";import{OITBlend as z}from"../effects/transparency/OITBlend.js";import{AnimationTimer as Q}from"./AnimationTimer.js";import{AnimationTimeStep as W}from"./AnimationTimeStep.js";import{BoundingInfo as Y}from"./BoundingInfo.js";import{DepthRange as Z}from"./DepthRange.js";import{depthRangeFromScene as J}from"./depthRangeUtils.js";import{hudFragmentOpacityParameters as K}from"./hudFragmentOpacityParameters.js";import{MainFramebuffer as X}from"./MainFramebuffer.js";import{RenderContext as $,defaultRenderOccludedMask as ee}from"./RenderContext.js";import{RendererBase as te}from"./RendererBase.js";import{setupFeatureDefaults as re}from"./RenderFeature.js";import{RenderPluginInput as ie}from"./RenderPluginInput.js";import{ShadowAccumulator as se}from"./ShadowAccumulator.js";import{ShadowMap as ae}from"./ShadowMap.js";import ne from"./SliceHelper.js";import{MergedRenderer as he}from"../materials/renderers/MergedRenderer.js";import{RenderSceneResult as oe}from"../parts/renderUtils.js";import{RendererPerformanceInfo as de,PerformanceCategory as le}from"../statistics/RendererPerformanceInfo.js";import{PixelType as _e,ColorAttachment1 as ue,ColorAttachment2 as pe}from"../../../webgl/enums.js";let me=class extends te{constructor(e,t,r,s,a,n){super({stage:e}),this._techniques=r,this._rctx=s,this._compositingHelper=a,this._requestRender=n,this._pluginsHas={hudElements:!1,water:!1},this.renderPassManager=new q,this._isRendering=!1,this._inGlobeView=!1,this._backgroundColor=A(0,0,0,1),this._sliceHelper=new ne,this._blit=null,this._oitblend=null,this.sceneDepthRange=c(Z.Infinite),this._state=c(2),this._highQualityTransparencyEnabled=!0,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new W,this._loadEdgeViewTask=null,this._edgeViewCallbacks=[],this._reprojectionMatrixVersion=c(0),this._lastFrameTime=g(0),this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new ie,this._releaseNormals=e=>{e.some(({name:e})=>"normals"===e)&&this._pluginInput.release("normals")},this._debugNeedsDepth=!1,this._fboCache=new H(s),this._renderStateFeatures=c(re(!has("disable-feature:high-quality-idle"),e.view.qualityProfile)),this._framebuffer=new X(this.fboCache),this._performanceInfo=new de(this._rctx),this._shadowMap=new ae(this.fboCache,e.viewingMode),this._shadowAccumulator=new se(this.fboCache,r,e,e=>{const t=this.shadowsEnabled;this._shadowMap.enabled=!0,this._ensureBindParametersCamera(e.camera,e.contentCamera),this._plugins.prepareRender(),this._shadowMap.enabled=t},(t,r,i)=>{const s=e.view.qualitySettings.maximumPixelRatio;t.shadowMap.start(t.camera,r,i,!0,s),this._renderShadowCascades(4,t.shadowMap),t.shadowMap.finish(),t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.contentCamera)},n),this._renderContext=new $(this._rctx,this._shadowMap,r),this._nodes=new V(this._renderContext),this._plugins=new U({renderContext:this._renderContext,techniques:r,materials:t,requestRender:n,controller:e,fbos:this.fboCache,isFeatureEnabled:e=>this.isFeatureEnabled(e)}),this._plugins.add(this.renderPassManager),this.addHandles([_(()=>e.view.state.camera,()=>n(),u),_(()=>F.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,e=>{this._renderHiddenTransparentEdges=e?()=>this._renderEdges(0):()=>{},n()},p),_(()=>e.view.environment.background?.color,e=>{const t=e?i(e):y;E(this._backgroundColor,t[0]*t[3],t[1]*t[3],t[2]*t[3],t[3]),n()},u),_(()=>e.view.state.camera.relativeElevation,e=>this._inGlobeView=(e??1/0)>=L,u),_(()=>this._bindParameters.clouds.fadeFactor,()=>{this._bindParameters.fadeLighting(),this._requestRender(2)},m),_(()=>this._bindParameters.clouds.data?.state,()=>n(),m),_(()=>e.view.state.highlights,e=>{this._bindParameters.highlights=e,n()},p)])}destroy(){this._gpuTimerHandle=n(this._gpuTimerHandle),this._nodes.destroy(),this._framebuffer.dispose(),this._shadowMap.dispose(),this._shadowAccumulator.destroy(),this._shadowAccumulator=null,this._loadEdgeViewTask=h(this._loadEdgeViewTask),this._edgeView=o(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this._fboCache.destroy(),this._fboCache=null,this._plugins.destroy(),this._plugins=null,this._pluginInput=null,this._blit=null,this._oitblend=null,this._compositingHelper=null,this._nodes=null,this._framebuffer=null,this._shadowMap=null,this._renderContext=null,this._performanceInfo=null,Y.prune(),he.prune(),D()}get renderContext(){return this._renderContext}get _bindParameters(){return this._renderContext.bind}get _framebufferSize(){return this._framebuffer.size}get performanceInfo(){return this._performanceInfo}updateRenderFeatures(e=null,t=!has("disable-feature:high-quality-idle")){this._renderStateFeatures.value=re(t,e),this._requestRender()}isFeatureEnabled(e,t=this._state.value){return this._renderStateFeatures.value.get(t,e)??!1}setFeatureEnabled(e,t,r){this._renderStateFeatures.mutate(i=>i.set(t,e,r)),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(1)}get hasReflections(){return this._pluginsHas.water&&(this._ssrEnabled||this.isFeatureEnabled(5))}get _hasHighlights(){return this._plugins.produces(9,2,4,18,13,14)}hasHighlight(e){return this._plugins.hasHighlight(e)}get _hasHUDHighlights(){return this._plugins.produces(9,13,14)}get hasSSAO(){return(this.stage.view.qualitySettings.ambientOcclusion||this.isFeatureEnabled(4))&&!this._inGlobeView}get hasSMAA(){return this.stage.view.qualitySettings.antialiasingEnabled||this.isFeatureEnabled(0)}get hasEmitters(){return this._plugins.hasEmitters&&this.stage.view.qualitySettings.physicallyBasedRenderingEnabled}get fullResolutionAtmosphere(){return this.stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(3)}get fboCache(){return this._fboCache}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=d(this._bindParameters.ssr.lastFrameColor),this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth),this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth)}_disposeOffscreenBuffers(){this._framebuffer.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.depth=d(this._bindParameters.depth),this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility)}get updating(){return this._loadEdgeViewTask&&!this._loadEdgeViewTask.finished||this._edgeView?.updating||this._shadowAccumulator.readyToRun||this._plugins.updating||!this.isCameraFinal}loadEdgeView(){return this._loadEdgeViewTask||(this._loadEdgeViewTask=r(async e=>{const{EdgeView:t}=await import("./edgeRendering/EdgeView.js");l(e);const r=this._edgeView=new t({rctx:this._rctx,renderSR:this.stage.view.renderSpatialReference,viewingMode:this.stage.view.stage.viewingMode,techniques:this._techniques,setNeedsRender:()=>this._requestRender(),schedule:xe(this.stage.view.resourceController)});return this.addHandles(_(()=>r.updating,()=>this._requestRender(),m)),this._requestRender(),this._edgeViewCallbacks.forEach(e=>e(r)),this._edgeViewCallbacks.length=0,r})),this._loadEdgeViewTask.promise}withEdgeView(e){this.loadEdgeView(),null==this._edgeView?this._edgeViewCallbacks.push(e):e(this._edgeView)}get edgeView(){return this._edgeView}get isCameraFinal(){return this._reprojectionMatrixVersion.value>=0&&P(this._bindParameters.ssr.reprojectionMatrix,T)}set _reprojectionMatrix(e){t(this._bindParameters.ssr.reprojectionMatrix,e)&&this._reprojectionMatrixVersion.value++}get shadowsEnabled(){return!!this._shadowMap?.enabled}setParameters(e){const{_shadowMap:t,_bindParameters:r}=this;if(void 0!==e.qualitySettings?.reflections&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),void 0!==e.shadowMap&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),void 0!==e.shadowMapMaxCascades&&t.maxCascades!==e.shadowMapMaxCascades&&(t.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment){void 0!==e.environment.weather&&(this._bindParameters.weather=e.environment.weather);const t="virtual"!==e.environment.lighting.type;r.enableFillLights!==t&&(r.enableFillLights=t,this._requestRender())}void 0!==e.highQualityTransparency&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),void 0!==e.shadowCast&&this._shadowAccumulator.setOptions(e.shadowCast)}set slice(e){this._sliceHelper.update(e)&&this._requestRender()}get plugins(){return this._plugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}commit(e,t){return this._isRendering&&console.warn("Renderer.modify called while rendering"),!!super.commit(e,t,this._plugins.context)&&(this.updateHasFlags(),!0)}rendererAdded(e){this._plugins.add(e)}rendererRemoved(e){this._plugins.remove(e)}get occludedRequiresStencil(){return this.occludedRequiresOccludeeStencil||this.occludedRequiresIntegratedMeshStencil}get occludedRequiresOccludeeStencil(){return this._bindParameters.hasOccludees&&!!(8&this.plugins.renderOccludedFlags)}get occludedRequiresIntegratedMeshStencil(){return this._plugins.produces(0,0)&&this._plugins.produces(0,9)}updateHasFlags(){const has=this._pluginsHas;has.hudElements=this._plugins.produces(0,...Ce),has.water=this._plugins.produces(3,19),this._bindParameters.hasOccludees=this._plugins.hasOccludees,this._requestRender()}updateAnimation(e,t){this._animationTimer??=new Q(e.camera,t),this._animationTimer.advance(e.camera,t,this._animationTimeDilation);const r=this._hasAnimations;return this._hasAnimations=this._plugins.updateAnimation(this._animationTimer),this._hasAnimations=this._nodes.updateAnimation(this._animationTimer)||this._hasAnimations,this._hasAnimations!==r&&(this._gpuTimerHandle=r?n(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get _animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,t,r,i=!1){try{return this._isRendering=!0,this._render(e,t,r,i)}catch(s){console.error(`Exception during rendering: ${s}`)}finally{this._isRendering=!1}return new oe(this._pluginInput.get(I.FINAL),null)}_updateHUDOccludedFragmentOpacity(e,t){const{idleOpacity:r,navigatingOpacity:i,maxDelta:n,tiltFadeStart:h,tiltFadeEnd:o,altitudeStart:d,altitudeEnd:l}=K,_=this.stage.view,u=_.stateManager.camera,p=_.qualitySettings.fadeDuration,m=2===e?r:i,c=s((u.tilt-h)/(o-h),0,1),g=s(((u.position.z??0)-d)/(l-d),0,1),f=a(a(1,m,c),1,g),b=this._bindParameters.hudOccludedFragmentOpacity;if(p<=0||b===f||0===this._lastFrameTime||this._lastFrameTime>t)return this._bindParameters.hudOccludedFragmentOpacity=f,void(this._lastFrameTime=t);const P=t-this._lastFrameTime;this._lastFrameTime=t;const C=Math.max(1-r,Math.abs(r-i)),w=Math.min(C*P/p,n);w>=Math.abs(f-b)?this._bindParameters.hudOccludedFragmentOpacity=f:(this._bindParameters.hudOccludedFragmentOpacity=b+Math.sign(f-b)*w,this._requestRender())}_render(e,t,r,i){const s=0===r;this.performanceInfo.startFrame(),this.fboCache.frameStart(),this.fboCache.interactive=s,this._disposeBindBuffers();const{camera:a,contentCamera:n,mode:h,alignPixelEnabled:o}=e;this._state.value=h;const d=this._nodes.produces("magnifier-color"),l=this._nodes.produces(I.FINAL),_=this.hasEmitters,u=_?1:0;this._renderContext.time=t,this._renderContext.output=u,this._bindParameters.oitPass=0,this._bindParameters.alignPixelEnabled=o,this._bindParameters.decorations=!i,this._bindParameters.mainDepth=null;const p=!i||!this._sliceHelper.isDecoration;this._bindParameters.slicePlane=p?this._sliceHelper.plane:null,this._bindParameters.viewshedEnabled=this._nodes.produces(R.VIEWSHED),this._bindParameters.cutFillEnabled=this._nodes.produces(R.CUTFILL_DEPTH),this._renderOverlay(),a.setGLViewport(this._rctx);const m=this._framebuffer,c=m.initialize(a.fullWidth,a.fullHeight,this._backgroundColor,_);this.hasReflections?(c?.setName("last frame color"),this._bindParameters.ssr.lastFrameColor=c):c?.release(),this._ensureBindParametersCamera(a,n),this._updateHUDOccludedFragmentOpacity(h,t),this._plugins.prepareRender(),this._bindParameters.shadowHighlightsVisible=this._needsShadowHighlight&&!i;const g=this._highQualityTransparency&&this._hasTransparentTerrain,f=this._plugins.produces(0,...be);this._precompilePrepasses(),this.performanceInfo.advance(le.PREPARE);const b=this._computeShadowDepthRange(a);this._renderShadowMap(a,this._bindParameters.lighting.mainLight.direction,b),this._pluginInput.set("normals",this._renderNormals()),this._renderRemainingGeometryDepth(),this._renderShadowAccumulation(b,a,n,!s),this._ensureBindParametersSSR(t),this._precompileShaders(g,f,u),this._renderContext.output=u,m.bind(),this._bindParameters.mainDepth=m.depth.attachment,this._renderOpaque(g),this._renderTransparent(f,g,u),this._shadowMap.disposeMainBuffer(),this._pluginInput.set(R.FOCUSAREA,this._renderFocusAreaGeometry()),this._pluginInput.set(R.CUTFILL_DEPTH,this._renderCutFillDepth()),m.update(e=>this._renderNodes(R.TRANSPARENT_ENVIRONMENT,e)),m.update(e=>this._renderNodes(R.VIEWSHED,e)),m.update(e=>this._renderNodes(R.LASERLINES,e)),m.update(e=>this._renderNodes(R.FOCUSAREA_COLOR,e)),this._pluginInput.release(R.FOCUSAREA),this._pluginInput.release(R.CUTFILL_DEPTH),m.update(e=>this._renderNodes(R.OCCLUDED,e)),this._pluginInput.set("highlights",this._renderHighlightPrepass()),this._renderHighlightShadowMap(a,this._bindParameters.lighting.mainLight.direction,b);const P=2===r?this._renderObjectAndLayerIdColor():null;m.update(e=>this._renderNodes(I.COMPOSITE,e)),this._shadowMap.disposeOffscreenBuffers();const C=s&&!l&&!(d&&!i),w=this._pluginInput.get(I.COMPOSITE),T=C?M:this.fboCache.acquire(w.fbo.width,w.fbo.height,R.ANTIALIASING),S=this._nodes.produces(R.ANTIALIASING)?this._renderNodes(R.ANTIALIASING,T):this.blitFBO(w,T,!1);let E;this._pluginInput.set(R.ANTIALIASING,S),this._hasHUDHighlights?(this._renderHUD(1,S,u),E=this._renderNodes(R.HIGHLIGHTS,S)):(E=this._renderNodes(R.HIGHLIGHTS,S),this._renderHUD(1,E,u));const x=this._renderNodes(R.MAGNIFIER,E);return s&&d&&!i&&!l&&this.blitFBO(x),l?(x.attachDepth(m.depth),this.blitFBO(this._renderNodes(I.FINAL,x)),x.detachDepth()):this._pluginInput.set(I.FINAL,x),this._pluginInput.release("highlights"),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),m.releaseDepth(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this.fboCache.frameEnd(),this.performanceInfo.finishFrame(),s||(this._releaseFBOs(),this._disposeOffscreenBuffers()),new oe(this._pluginInput.get(I.FINAL),P)}_precompileShaders(e,t,r){++this._plugins.context.techniques.precompiling,this._renderContext.output=r,this._precompileOpaqueGeometry(),this._nodes.precompile(R.OPAQUE_ENVIRONMENT),this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,this._renderContext.output=2,this._plugins.precompile(6),this._plugins.precompile(7),e&&(this._precompileOpaqueGeometry(),this._precompileTransparentGeometry()),this._renderContext.output=r,this._plugins.precompile(6),this._plugins.precompile(7),t&&(this._precompileTransparentGeometry(),this._hasTransparentTerrain&&(this._bindParameters.cullAboveTerrain=!1,this._precompileTransparentGeometry(),this._bindParameters.cullAboveTerrain=e)),this._nodes.precompile(R.FOCUSAREA),this._needsHUDVisibility&&this._plugins.precompile(12),this._plugins.precompile(15),this._precompileHUD(0),this._bindParameters.terrainDepthTest=!1,this._bindParameters.cullAboveTerrain=!1,this._nodes.precompile(R.VIEWSHED,R.CUTFILL_DEPTH,R.CUTFILL_COLOR,R.LASERLINES,R.FOCUSAREA_COLOR,R.OCCLUDED,R.ANTIALIASING,R.HIGHLIGHTS);const i=this._bindParameters;i.highlightMixTexture=i.highlights.length>1?this._rctx.emptyTexture:null,this._precompileHUD(1),this._hasHighlights&&(i.highlights.forEach((e,t)=>{i.highlightLevel=t,this._precompileAllGeometry(9)}),i.highlightLevel=null),i.highlightMixTexture=null,this._nodes.precompile(I.COMPOSITE,R.MAGNIFIER),this._shadowAccumulator.precompile(),this._plugins.precompile(8),--this._plugins.context.techniques.precompiling}_renderFocusAreaGeometry(){const e=this._nodes.produce(R.FOCUSAREA,this._pluginInput);return e&&this.performanceInfo.advance(le.FOCUS_AREA_MASK),e}_renderObjectAndLayerIdColor(){if(!this._nodes.produces("olid"))return null;const e=this._renderContext.output;++this._techniques.precompiling;const t=this._framebufferSize;let r=this.fboCache.acquire(t.width,t.height,"olid");return r.acquireDepth(13),r=this._nodes.render(r,this._pluginInput),--this._techniques.precompiling,this.performanceInfo.advance(le.OBJECT_AND_LAYER_ID_COLOR),this._renderContext.output=e,r}finish(e){this._hasAnimations||this._animationTimestep.clear();const t=this.performanceInfo.gpuSamplingEnabled,r=0===e;if(r||t){const e=r?this.performanceInfo.elapsedTime:0;let i=0;t?i=this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.finish();const s=Math.max(e,i);this._animationTimestep.frame(s,r)}}readMainDepth(e,t){const{mainDepth:r,camera:i}=this._bindParameters;if(!r)return;const s=this.fboCache.acquire(this._framebufferSize.width,this._framebufferSize.height,"linear depth");this._rctx.bindFramebuffer(s.fbo),i.setGLViewport(this._rctx),this._rctx.setScissorRect(e[0],e[1],e[2],e[3]),this._rctx.setScissorTestEnabled(!0),this._rctx.clearFramebuffer(y),this._compositingHelper.blitDepthToLinearDepth(this._bindParameters,r),this._rctx.setScissorTestEnabled(!1),this._rctx.setScissorRect(0,0,this._rctx.gl.canvas.width,this._rctx.gl.canvas.width),s.fbo?.readPixels(e[0],e[1],e[2],e[3],6408,_e.UNSIGNED_BYTE,t),s.release()}readHUDVisibility(e,t,r,i,s){this._bindParameters.hudVisibility?.fbo?.readPixels(e,t,r,i,6408,_e.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_renderEdges(e){const t=this._edgeView;if(!t?.shouldRender())return;const r=this._renderContext.output,i=this._framebufferSize,s=this.fboCache.acquire(i.width,i.height,"edges"),a=()=>t.render(this._bindParameters,e),n=this._bindParameters.geometryDepth;this.renderToTargets(a,s,n??this._framebuffer.depth,y),this._framebuffer.bind(),this._compositingHelper.composite(this._bindParameters,s.getTexture(),N(r)?1:0),s.release(),this.performanceInfo.advance(1===e?le.OPAQUE_EDGES:le.TRANSPARENT_EDGES)}_renderOverlay(){this._bindParameters.overlay=this.overlay?.render(),this._bindParameters.overlay&&this.performanceInfo.advance(le.OVERLAY)}_renderShadowMap(e,t,r){if(!this.shadowsEnabled)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._needsShadowHighlight?(this._renderShadowCascades(6,this._shadowMap),s.copySnapshot(1),this._renderShadowCascades(5,this._shadowMap)):this._renderShadowCascades(4),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(le.SHADOW_MAP)}_renderHighlightShadowMap(e,t,r){if(!this.shadowsEnabled||!this._needsShadowHighlight)return;const{contentCamera:i}=this._bindParameters,s=this._shadowMap;s.start(e,t,r,this.isFeatureEnabled(6),this.stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(5,this._shadowMap),s.moveSnapshot(0),s.finish(),e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,i),this.performanceInfo.advance(le.SHADOW_MAP)}_renderCutFillDepth(){return this._nodes.produce(R.CUTFILL_DEPTH,this._pluginInput)}_precompileShadowCascades(e){for(const t of this._shadowMap.cascades)t.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(t.camera,t.camera),this._precompileAllGeometry(e)}_renderShadowCascades(e,t=this._shadowMap){t.bindFbo();for(const r of t.cascades)r.camera.setGLViewport(this._rctx),this._ensureBindParametersCamera(r.camera,r.camera),this.renderAllGeometry(e)}get _needsDepth(){return this._plugins.consumes(2)||this._nodes.requireGeometryDepth()||this.hasReflections||this._needsShadowHighlight||this._shadowAccumulator.active||this._debugNeedsDepth}_renderRemainingGeometryDepth(){const e=this._pluginInput.get("normals");e?(this._pluginInput.set(R.SSAO,this._renderSSAO()),this._needsDepth?(this._rctx.bindFramebuffer(e.fbo),this._rctx.clear(1024),this._renderGeometryWithoutNormals(2),d(this._bindParameters.depth),this._bindParameters.depth=e.obtainDepthTexture(),this.performanceInfo.advance(le.DEPTH)):(e.detachDepth(),this._bindParameters.depth=d(this._bindParameters.depth)),this.hasSSAO&&this._pluginInput.release("normals")):this._renderAllGeometryDepth()}_renderAllGeometryDepth(){if(!this._needsDepth)return void(this._bindParameters.depth=d(this._bindParameters.depth));const e=this._framebufferSize,t=this.fboCache.acquire(e.width,e.height,"geometry depth",13);this._rctx.bindFramebuffer(t.fbo),this._rctx.clear(1280),this.renderAllGeometry(2),d(this._bindParameters.depth),this._bindParameters.depth=t.obtainDepthTexture(),t.release(),this.performanceInfo.advance(le.DEPTH)}_renderTerrainDepth(e){if(this._bindParameters.terrainDepthTest=e,this._bindParameters.cullAboveTerrain=e,!e)return void(this._bindParameters.terrainDepth=d(this._bindParameters.terrainDepth));const t=this._renderContext.output;this._renderContext.output=2;const r=this._framebufferSize,i=this.fboCache.acquire(r.width,r.height,"terrain depth",13);this._rctx.bindFramebuffer(i.fbo),this._rctx.clear(1280),this._renderTransparentTerrain(),d(this._bindParameters.terrainDepth),this._bindParameters.terrainDepth=i.obtainDepthTexture(),this._renderContext.output=t,i.release()}_renderGeometryDepth(e){if(!e)return void(this._bindParameters.geometryDepth=d(this._bindParameters.geometryDepth));const t=this._renderContext.output,{width:r,height:i}=this._framebufferSize,s=this.fboCache.acquire(r,i,"geometry depth",13);this._rctx.bindFramebuffer(s.fbo),this._rctx.clear(1280),this._renderOpaqueAndTransparentGeometry(2),this._renderContext.output=t,d(this._bindParameters.geometryDepth),this._bindParameters.geometryDepth=s.obtainDepthTexture(),s.release()}get _needsShadowDepthRange(){return this._shadowMap.enabled||this._shadowAccumulator.active}_computeShadowDepthRange(e){if(!this._needsShadowDepthRange)return Z.Zero;const t=J(e,this._plugins.plugins,this.stage.layers,0);return t.union(this._plugins.queryDepthRange(e)),t.near=Math.max(e.near,t.near),t.far=Math.min(e.far,t.far),t}updateSceneDepthRange(e){if(!this.stage.view.state.isGlobal)return void(this.sceneDepthRange.value=Z.Infinite);if((this.stage.view.renderCoordsHelper?.getAltitude(e.eye)??0)<O)return void(this.sceneDepthRange.value=Z.Infinite);const t=e.clone();t.near=v,t.far=1e10;const r=J(t,this._plugins.plugins,this.stage.layers,1);r.union(this._plugins.queryDepthRange(t)),this.sceneDepthRange.value.equals(r)||(this.sceneDepthRange.value=r)}get _normalsRequired(){const e=this._nodes.require("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED,R.LASERLINES);return(this.hasSSAO?1:0)+e}_precompilePrepasses(){this._normalsRequired&&this._precompileAllGeometry(3),this._needsDepth&&this._precompileAllGeometry(2),this.shadowsEnabled&&(this._needsShadowHighlight?(this._precompileShadowCascades(5),this._precompileShadowCascades(6),this._precompileShadowCascades(5)):this._precompileShadowCascades(4)),this._shadowAccumulator.active&&this._precompileAllGeometry(4)}_renderNormals(){const e=this._normalsRequired;if(0===e)return;const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"normals",5);r.acquireDepth(13),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer(y,!0,!0),this._renderGeometryWithNormals(3);const i=this._nodes.optional("normals",I.FINAL,I.COMPOSITE,I.OPAQUE,I.TRANSPARENT,R.VIEWSHED);return r.retain(e+i-1),this.performanceInfo.advance(le.NORMALS),r}_renderSSAO(){const e=this._pluginInput.get("normals");if(!this.hasSSAO||!e)return;const t=this._nodes.produce(R.SSAO,this._pluginInput);return this._bindParameters.ssao=t,t&&this.performanceInfo.advance(le.SSAO),t}_precompileAllGeometry(e){const t=this._renderContext.output;this._renderContext.output=e,this._precompileOpaqueGeometry(),this._precompileTransparentGeometry(),this._plugins.precompile(6),this._plugins.precompile(7),this._renderContext.output=t}renderAllGeometry(e){this._renderContext.output=e,this._renderOpaqueAndTransparentGeometry(e),this._renderTransparentTerrain()}precompileSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.precompile(this._renderContext)}precompileOccludedSlots(e,t){for(const r of t)this._renderContext.renderOccludedMask=r,this.precompileSlots(e,...Pe);this._renderContext.renderOccludedMask=ee}renderSlots(e,...t){for(const r of t)this._bindParameters.slot=r,e.forAll(e=>{const t=e.acquireTechniques(this._renderContext);t&&e.render(this._renderContext,t)})}renderOccludedSlots(e,t){this._renderContext.renderOccludedMask=t,this.plugins.renderOccludedFlags>1&&this._plugins.render(9),this.renderSlots(e,...Pe),this._renderContext.renderOccludedMask=ee}renderHUD(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(13)}precompileViewshedShadowMap(){this._precompileAllGeometry(7)}precompileCutFill(){const e=8,t=this._renderContext.output;this._renderContext.output=e,this._plugins.precompile(0,1,6),this._renderContext.output=t}renderViewshedShadowMap(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this.renderAllGeometry(7),this._ensureBindParametersCamera(t,r),this._bindParameters.camera.setGLViewport(this._rctx),this._renderContext.output=i}renderCutFillReferenceDepth(e){const{camera:t,contentCamera:r}=this._bindParameters,i=this._renderContext.output;e.setGLViewport(this._rctx),this._ensureBindParametersCamera(e,e),this._renderContext.output=8,this._plugins.render(0,1),this._plugins.render(6),this._ensureBindParametersCamera(t,r),t.setGLViewport(this._rctx),this._renderContext.output=i}_renderOpaqueAndTransparentGeometry(e){this._renderContext.output=e,this._renderOpaqueGeometry(),this._renderTransparentGeometry()}_renderGeometryWithNormals(e){this._renderContext.output=e,this._plugins.render(...ce),this._renderTransparentTerrain()}_renderGeometryWithoutNormals(e){this._renderContext.output=e,this._plugins.render(...ge)}_precompileOpaqueGeometry(){this._plugins.precompile(...fe),this._nodes.precompile("opaque-color")}_renderOpaqueGeometry(){this._plugins.render(...fe)}_renderTransparentGeometry(){this._plugins.render(...be)}get _hasTransparentTerrain(){return this._plugins.produces(0,6)}get _hasTransparentIntegratedMesh(){return this._plugins.produces(this._renderContext.output,7)}_renderTransparentTerrain(){const e=()=>this._plugins.render(6);if(!G(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent terrain");return this.renderToTargets(e,r,this._framebuffer.depth,y),r}_renderTransparentIntegratedMesh(){const e=()=>this._plugins.render(7);if(!G(this._renderContext.output))return void e();const t=this._framebufferSize,r=this.fboCache.acquire(t.width,t.height,"transparent integrated mesh");return this.renderToTargets(e,r,this._framebuffer.depth,y),r}get _needsHUDVisibility(){return this._plugins.produces(this._renderContext.output,12)}_renderHUDVisibility(){if(!this._needsHUDVisibility)return void(this._bindParameters.hudVisibility=d(this._bindParameters.hudVisibility));const{width:e,height:t}=this._framebufferSize;let r=this._bindParameters.hudVisibility;r?.fbo?.width===e&&r?.fbo?.height===t||(r?.release(),r=this.fboCache.acquire(e,t,"hud visibility",4),this._bindParameters.hudVisibility=r);const i=this._bindParameters.geometryDepth;r.attachDepth(i||this._framebuffer.depth),this._rctx.bindFramebuffer(r.fbo),this._rctx.clearFramebuffer([0,1,0,1]),this._plugins.render(12),r.detachDepth(),this._framebuffer.bind(),this.performanceInfo.advance(le.HUD_VISIBILITY)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,0===e){const e=()=>this._plugins.render(15),t=this._framebufferSize,r=this.fboCache.acquireDepth(12,t.width,t.height,"line callouts");this.renderToTargets(e,this._framebuffer.color,r,void 0,!0,!0),r.release()}else this._plugins.render(15)}_precompileHUD(e){if(this._precompileHUDOutput(e),this._hasHighlights){const t=this._renderContext.output;this._renderContext.output=9,this._precompileHUDOutput(e),this._renderContext.output=t}}_precompileHUDOutput(e){const t=this._bindParameters.hudRenderStyle;this._bindParameters.hudRenderStyle=e,this._oitEnabled&&G(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...Ce),this._bindParameters.oitPass=2,this._plugins.precompile(...Ce),this._bindParameters.oitPass=0):this._plugins.precompile(...Ce),this._bindParameters.hudRenderStyle=t}_renderHUD(e,t,r){if(this._pluginsHas.hudElements){if(this._oitEnabled){const i=this._renderOIT(1,r,e);this._rctx.bindFramebuffer(t.fbo),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,i.getTexture()),i.release()}else if(this._renderContext.output=r,0===e){const t=()=>this._renderHUDElements(e),r=this._framebufferSize,i=this.fboCache.acquireDepth(12,r.width,r.height,"hud");this.renderToTargets(t,this._framebuffer.color,i,void 0,!0,!0),i.release()}else t.acquireDepth(12),this._rctx.bindFramebuffer(t.fbo),this._renderHUDElements(e),t.detachDepth();this.performanceInfo.advance(0===e?le.HUD_OCCLUDED:le.HUD)}}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._plugins.render(...Ce)}get _needsShadowHighlight(){return this.shadowsEnabled&&this._plugins.produces(5,2)}_renderHighlightPrepass(){if(!this._hasHighlights)return;const{fboCache:e,_rctx:t,_bindParameters:r}=this,i=this._framebufferSize,{highlights:s}=r,a=e.acquire(i.width,i.height,"highlights",s.length>B?3:1);a.acquireDepth(13),t.bindFramebuffer(a.fbo);const{gl:n}=t;return n.clearBufferuiv(n.COLOR,0,[0,0,0,0]),this._renderContext.output=9,t.bindFramebuffer(a.fbo),k(t,e,i,r,()=>this._renderHighlightGeometries()),this.performanceInfo.advance(le.HIGHLIGHTS),a}_renderHighlightGeometries(){this._plugins.render(...we),this._rctx.clear(256),this._renderHUDElements(2)}_renderShadowAccumulation(e,t,r,i){this._shadowAccumulator.updateDepthRange(e),this._shadowAccumulator.accumulating&&this._bindParameters.depth&&this._shadowAccumulator.renderAccumulation(this._bindParameters.depth,t,r,i)&&this.performanceInfo.advance(le.ACCUMULATED_SHADOWS)}_precompileTransparentGeometry(){this._oitEnabled&&G(this._renderContext.output)?(this._bindParameters.oitPass=1,this._plugins.precompile(...be),this._bindParameters.oitPass=2,this._plugins.precompile(...be),this._bindParameters.oitPass=0):this._plugins.precompile(...be)}_renderOIT(e,t,r=2){const i=1===e,s=this._framebufferSize,a=i?this.fboCache.acquire(s.width,s.height,"oit hud composite"):null,n=i?()=>this._renderHUDElements(r):()=>this._renderTransparentGeometry(),h=this._bindParameters,o=this._renderContext.output;this._renderContext.output=t,h.oitPass=1;const d=a?"oit hud color+alpha":"oit color+alpha",l=this.fboCache.acquire(s.width,s.height,d,8),_=1===t;_&&l.acquireColor(ue,8,"oit emissive"),l.acquireColor(_?pe:ue,7),a||l.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(l.fbo),this._rctx.clearFramebuffer([0,0,0,1]),_&&this._rctx.clearBuffer(1,x),n(),l.detachDepth(),h.oitPass=2;const u=this.fboCache.acquire(s.width,s.height,a?"oit hud front":"oit front");return _&&u.acquireColor(ue,8,"oit emissive front"),a?u.acquireDepth(12):u.attachDepth(this._framebuffer.depth),this._rctx.bindFramebuffer(u.fbo),this._rctx.clearFramebuffer(y,!!a),n(),u.detachDepth(),h.oitPass=0,a?(this._rctx.bindFramebuffer(a.fbo),this._rctx.setClearColor(0,0,0,1e-13),this._rctx.clear(16384)):this._framebuffer.bind(),this._oitblend??=new z(this._techniques),this._oitblend.blend(this._rctx,l,u,h,_),a?.detachDepth(),u.release(),l.release(),this._renderContext.output=o,a}_renderOpaque(e){const t=this.plugins.produces(0,...fe);if(t){this._plugins.render(0,1);const e=this._framebuffer;e.update(e=>this._renderNodes(R.CUTFILL_COLOR,e)),e.update(e=>this._renderNodes(R.OPAQUE_TERRAIN,e)),e.bind(),this._plugins.render(2,3)}const r=this._framebuffer;r.update(e=>this._renderNodes(I.OPAQUE,e,t)),this.fboCache.debugCallback?.(I.OPAQUE,r.color.fbo),r.update(e=>this._renderNodes(R.OPAQUE_ENVIRONMENT,e)),this.fboCache.debugCallback?.(R.OPAQUE_ENVIRONMENT,r.color.fbo),this._renderTerrainDepth(e),this._renderEdges(1)}_renderTransparent(e,t,r){const i=this._framebuffer;i.bind(),this._renderPlugins(20,le.VOXEL),this._renderHiddenTransparentEdges(),e&&(this._oitEnabled?this._renderOIT(0,r):this._renderTransparentGeometry()),i.update(t=>this._renderNodes(I.TRANSPARENT,t,e)),this.fboCache.debugCallback?.(I.TRANSPARENT,i.color.fbo),this._renderGeometryDepth(t),this._renderHUDVisibility(),t||this._plugins.render(15),this._renderEdges(0);const s=this._hasTransparentTerrain?this._renderTransparentTerrain():null;s&&(this.performanceInfo.advance(le.TRANSPARENT_TERRAIN),this._bindParameters.hudVisibility&&(t?this._renderLineCallouts(0):(this._rctx.bindFramebuffer(this._bindParameters.hudVisibility?.fbo),this._compositingHelper.compositeHUD(this._bindParameters,s.getTexture())),this._renderHUD(0,i.color,r))),this._bindParameters.cullAboveTerrain=!1,s&&(i.bind(),this._compositingHelper.compositePreMultipliedAlpha(this._bindParameters,s.getTexture()),s.release(),t&&(this._renderEdges(1),e&&(this._oitEnabled?this._renderOIT(0,r):this._renderTransparentGeometry(),this.performanceInfo.advance(le.TRANSPARENT)),this._renderEdges(0)));const a=this._hasTransparentIntegratedMesh?this._renderTransparentIntegratedMesh():null;a&&(i.bind(),this._compositingHelper.composite(this._bindParameters,a.getTexture(),N(r)?1:0),a.release()),this._bindParameters.ssao=d(this._bindParameters.ssao),t&&this._renderLineCallouts(1),this._bindParameters.terrainDepthTest=!1,this._renderTransparentEnvironment()}_renderTransparentEnvironment(){this._shadowAccumulator.render(this._bindParameters),this.performanceInfo.advance(le.APPLY_ACCUMULATED_SHADOWS),this._framebuffer.bind(),this._plugins.render(8),this.performanceInfo.advance(le.TRANSPARENT_MATERIAL_WITHOUT_DEPTH)}_renderPlugins(e,t){this._plugins.produces(this._renderContext.output,e)&&(this._plugins.render(e),this.performanceInfo.advance(t))}_renderNodes(e,t,r=!1){if(t.setName(e),this._pluginInput.set(e,t),!this._nodes.produces(e))return r&&this.performanceInfo.advance(e),t;const i=this._nodes.render(t,this._pluginInput,this._releaseNormals);return this.performanceInfo.advance(e),i}blitFBO(e,t=M,r=!0){return this._blit??=new j(this._techniques),this._blit.blit(this._rctx,e,t,this._bindParameters),this._pluginInput.set(e.name,t),r&&e.release(),t}_ensureBindParametersCamera(e,t){this._bindParameters.camera=e,this._bindParameters.contentCamera=t}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){null==this._ssrEnableTime&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=T:(C(Se,this._bindParameters.camera.viewMatrix),C(Te,this._bindParameters.camera.projectionMatrix),w(Ee,Se,Te),w(Ee,this._renderContext.lastFrameCamera.viewMatrix,Ee),w(Ee,this._renderContext.lastFrameCamera.projectionMatrix,Ee),this._reprojectionMatrix=Ee);const t=this.stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=t>0?Math.min(t,e-this._ssrEnableTime)/t:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=T,this._ssrEnableTime=null}addRenderNode(e){this._nodes.add(e),this._requestRender()}removeRenderNode(e){this._nodes.remove(e),this._requestRender()}updateLighting(e,t,r,i){this._bindParameters.updateLighting(e,t,r,i),this._requestRender(1)}get usedMemory(){return{fbos:this.fboCache.usedMemory,plugins:this._plugins.usedMemory,edges:this.edgeView?.usedMemory??0}}renderToTargets(e,t,r,i,s=!1,a=!1){t.attachDepth(r),this._rctx.bindFramebuffer(t.fbo),this._rctx.clearFramebuffer(i,s,a),e(),t.detachDepth()}get test(){}};e([f({readOnly:!0})],me.prototype,"fullResolutionAtmosphere",null),e([f()],me.prototype,"_edgeView",void 0),e([f()],me.prototype,"updating",null),me=e([b("esri.views.3d.webgl-engine.lib.Renderer")],me);const ce=[0,1,2,4],ge=[3,5],fe=[0,1,2,3],be=[4,5],Pe=[2,4,8],Ce=[16,13,14],we=[4,5,2,3,6,0,1],Te=S(),Se=S(),Ee=S();function xe(e){return t=>e.immediate.schedule(t)}export{me as Renderer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{q as e,i as r,c as t,n as s,d as a,l as i,g as o,e as n,o as l}from"../../../../chunks/vec32.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowRelatedOutput as p,isColorOrColorEmission as d,isColorEmission as T}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as f}from"../lib/GLTextureMaterial.js";import{Material as x}from"../lib/Material.js";import{OITPolygonOffsetLimit as g}from"../lib/OrderIndependentTransparency.js";import{intersectTriangleGeometry as v}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as S}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as M}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as b}from"./internal/MaterialUtil.js";import{getLayout as O,DefaultMaterialPassParameters as w,DefaultMaterialTechnique as C}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as y}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as R}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as P}from"../../../../webscene/support/AlphaCutoff.js";class D extends x{constructor(e,r){super(e,A),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[8,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=O(this.parameters),this._configuration=new y(r.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:r,opacity:t,externalColor:s}=this.parameters;return e*("replace"===r?1:t)*("ignore"===r||isNaN(s[3])?1:s[3])>=P}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,r){const{parameters:t,_configuration:s}=this,{treeRendering:a,doubleSided:i,doubleSidedType:o}=t;return super.getConfiguration(e,r,this._configuration),s.hasNormalTexture=t.hasNormalTexture,s.hasColorTexture=t.hasColorTexture,s.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,s.hasOcclusionTexture=t.hasOcclusionTexture,s.hasVertexTangents=!a&&t.hasVertexTangents,s.instanced=t.instanced,s.instancedDoublePrecision=t.instancedDoublePrecision,s.hasVVColor=!!t.vvColor,s.hasVVSize=!!t.vvSize,s.hasVerticalOffset=null!=t.verticalOffset,s.hasScreenSizePerspective=null!=t.screenSizePerspective,s.hasSlicePlane=t.hasSlicePlane,s.alphaDiscardMode=t.textureAlphaMode,s.normalType=a?0:t.normalType,s.transparent=this.transparent,s.writeDepth=t.writeDepth,s.customDepthTest=t.customDepthTest??0,s.hasOccludees=r.hasOccludees,s.cullFace=t.hasSlicePlane?0:t.cullFace,s.cullAboveTerrain=r.cullAboveTerrain,s.hasModelTransformation=!a&&null!=t.modelTransformation,s.hasVertexColors=t.hasVertexColors,s.hasSymbolColors=t.hasSymbolColors,s.doubleSidedMode=a?2:i&&"normal"===o?1:i&&"winding-order"===o?2:0,s.instancedFeatureAttribute=t.instancedFeatureAttribute,s.instancedColor=t.instancedColor,d(e)?(s.terrainDepthTest=r.terrainDepthTest,s.receiveShadows=t.receiveShadows,s.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=r.ssao):(s.terrainDepthTest=!1,s.receiveShadows=s.receiveAmbientOcclusion=!1),s.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,s.pbrMode=t.usePBR?t.isSchematic?2:1:0,s.emissionSource=t.emissionSource,s.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),s.oitPass=r.oitPass,s.enableOffset=r.camera.relativeElevation<g,s.snowCover=r.snowCover>0,s.hasGlow=T(e),s.hasColorTextureTransform=!!t.colorTextureTransformMatrix,s.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,s.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,s.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,s.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix,s}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;r(E,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(N,E);break;case 2:p=t(N,_)}let d=0;const T=a(q,E,e.eye),f=i(T),x=o(T,T,1/f);let g=null;this.parameters.screenSizePerspective&&(g=n(p,x)),d+=b(e,f,this.parameters.verticalOffset,g??0,this.parameters.screenSizePerspective,null),o(p,p,d),l(z,p,c.transform.inverseRotation),h=a(V,h,z),m=a(B,m,z)}v(e,c,h,m,S(c.verticalOffset),p)}createGLMaterial(e){return new j(e)}createBufferWriter(){return new M(this._layout)}get transparent(){return I(this.parameters)}}class j extends f{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const s=e.camera.viewInverseTransposeMatrix;return r(t.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?R:C,e)}}class A extends w{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function I(e){const{drivenOpacity:r,opacity:t,externalColor:s,layerOpacity:a,texture:i,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return r||t<1&&"replace"!==l||u<1&&"ignore"!==l||a<1||(null!=i||null!=o)&&1!==n&&2!==n&&"replace"!==l}const V=c(),B=c(),_=h(0,0,1),N=c(),z=c(),E=c(),q=c();export{j as DefaultGLMaterial,D as DefaultMaterial,A as DefaultMaterialParameters,I as isTransparent};
5
+ import{q as e,i as r,c as t,n as s,d as a,l as i,g as o,e as n,o as l}from"../../../../chunks/vec32.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowRelatedOutput as p,isColorOrColorEmission as d}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as T}from"../lib/GLTextureMaterial.js";import{Material as f}from"../lib/Material.js";import{OITPolygonOffsetLimit as x}from"../lib/OrderIndependentTransparency.js";import{intersectTriangleGeometry as g}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as v}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as S}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as M}from"./internal/MaterialUtil.js";import{getLayout as b,DefaultMaterialPassParameters as O,DefaultMaterialTechnique as C}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as w}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as y}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class P extends f{constructor(e,r){super(e,j),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[8,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(this.parameters),this._configuration=new w(r.spherical)}isVisibleForOutput(e){return 4!==e&&6!==e&&5!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:r,opacity:t,externalColor:s}=this.parameters;return e*("replace"===r?1:t)*("ignore"===r||isNaN(s[3])?1:s[3])>=R}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,r){const{parameters:t,_configuration:s}=this,{treeRendering:a,doubleSided:i,doubleSidedType:o}=t;return super.getConfiguration(e,r,this._configuration),s.hasNormalTexture=t.hasNormalTexture,s.hasColorTexture=t.hasColorTexture,s.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,s.hasOcclusionTexture=t.hasOcclusionTexture,s.hasVertexTangents=!a&&t.hasVertexTangents,s.instanced=t.instanced,s.instancedDoublePrecision=t.instancedDoublePrecision,s.hasVVColor=!!t.vvColor,s.hasVVSize=!!t.vvSize,s.hasVerticalOffset=null!=t.verticalOffset,s.hasScreenSizePerspective=null!=t.screenSizePerspective,s.hasSlicePlane=t.hasSlicePlane,s.alphaDiscardMode=t.textureAlphaMode,s.normalType=a?0:t.normalType,s.transparent=this.transparent,s.writeDepth=t.writeDepth,s.customDepthTest=t.customDepthTest??0,s.hasOccludees=r.hasOccludees,s.cullFace=t.hasSlicePlane?0:t.cullFace,s.cullAboveTerrain=r.cullAboveTerrain,s.hasModelTransformation=!a&&null!=t.modelTransformation,s.hasVertexColors=t.hasVertexColors,s.hasSymbolColors=t.hasSymbolColors,s.doubleSidedMode=a?2:i&&"normal"===o?1:i&&"winding-order"===o?2:0,s.instancedFeatureAttribute=t.instancedFeatureAttribute,s.instancedColor=t.instancedColor,d(e)?(s.terrainDepthTest=r.terrainDepthTest,s.receiveShadows=t.receiveShadows,s.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=r.ssao):(s.terrainDepthTest=!1,s.receiveShadows=s.receiveAmbientOcclusion=!1),s.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,s.pbrMode=t.usePBR?t.isSchematic?2:1:0,s.emissionSource=t.emissionSource,s.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),s.oitPass=r.oitPass,s.enableOffset=r.camera.relativeElevation<x,s.snowCover=r.snowCover>0,s.hasColorTextureTransform=!!t.colorTextureTransformMatrix,s.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,s.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,s.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,s.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix,s}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;r(z,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(_,z);break;case 2:p=t(_,B)}let d=0;const T=a(E,z,e.eye),f=i(T),x=o(T,T,1/f);let g=null;this.parameters.screenSizePerspective&&(g=n(p,x)),d+=M(e,f,this.parameters.verticalOffset,g??0,this.parameters.screenSizePerspective,null),o(p,p,d),l(N,p,c.transform.inverseRotation),h=a(I,h,N),m=a(V,m,N)}g(e,c,h,m,v(c.verticalOffset),p)}createGLMaterial(e){return new D(e)}createBufferWriter(){return new S(this._layout)}get transparent(){return A(this.parameters)}}class D extends T{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const s=e.camera.viewInverseTransposeMatrix;return r(t.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?y:C,e)}}class j extends O{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function A(e){const{drivenOpacity:r,opacity:t,externalColor:s,layerOpacity:a,texture:i,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return r||t<1&&"replace"!==l||u<1&&"ignore"!==l||a<1||(null!=i||null!=o)&&1!==n&&2!==n&&"replace"!==l}const I=c(),V=c(),B=h(0,0,1),_=c(),N=c(),z=c(),E=c();export{D as DefaultGLMaterial,P as DefaultMaterial,j as DefaultMaterialParameters,A as isTransparent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{isShadowRelatedOutput as r,is3DGeometryOutputMRT as a,isColorOrColorEmission as o,isColorEmission as n}from"../core/shaderLibrary/ShaderOutput.js";import h from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{isPathGeometry as p}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as u,intersectAabbInvDir as m}from"../lib/RayIntersections.js";import{DefaultBufferWriter as f}from"./DefaultBufferWriter.js";import{getLayout as l,PathPassParameters as d,PathTechnique as b}from"./PathTechnique.js";import{PathTechniqueConfiguration as g}from"./PathTechniqueConfiguration.js";import{alphaCutoff as _}from"../../../../webscene/support/AlphaCutoff.js";class S extends c{constructor(t,e){super(t,M),this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&r(t)||a(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&r(t)||a(t))&&this.transparent]]),this._configuration=new g(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,o(t)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?1:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?2:0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.hasGlow=n(t),this._configuration.oitPass=e.oitPass,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.snowCover=e.snowCover>0,this._configuration}isVisibleForOutput(t){return 4!==t&&6!==t&&5!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=_}intersect(t,e,i,s,r,a){this._intersect(t,i,s,r,a)}intersectDraped(t,e,i,s){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,s)}_intersect(i,r,a,o,n){const h=i;if(!p(h))return;const c=h.path,f=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:s,maxSize:r,fallback:a}=this.parameters.vvSize,o=c.sizeAttributeValue;Number.isNaN(o)?(f[0]*=a[0],f[1]*=a[2]):(f[0]*=t(e[0]+o*i[0],s[0],r[0]),f[1]*=t(e[2]+o*i[2],s[2],r[2]))}const l=new u(!1,r.options.normalRequired),d=Math.max(f[0],f[1]),b=i.boundingInfo;if(null==b)return void w(c,f,a,o,l,n);const g=s(b.bbMin[0]-d,b.bbMin[1]-d,b.bbMin[2]-d,b.bbMax[0]+d,b.bbMax[1]+d,b.bbMax[2]+d),_=[o[0]-a[0],o[1]-a[1],o[2]-a[2]],S=Math.sqrt(_[0]*_[0]+_[1]*_[1]+_[2]*_[2]),v=[S/_[0],S/_[1],S/_[2]];m(g,a,v,r.tolerance)&&w(c,f,a,o,l,n)}createBufferWriter(){return new f(l(this.parameters))}createGLMaterial(t){return new v(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class v extends h{beginSlot(t){return this.getTechnique(b,t)}}function w(t,e,i,s,r,a){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,s,r,a)}class M extends d{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{M as Parameters,S as PathMaterial};
5
+ import{clamp as t}from"../../../../core/mathUtils.js";import{clone as e}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{fromValues as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as s}from"../../../../geometry/support/aaBoundingBox.js";import{isShadowRelatedOutput as r,is3DGeometryOutputMRT as a,isColorOrColorEmission as o}from"../core/shaderLibrary/ShaderOutput.js";import n from"../lib/GLMaterial.js";import{Material as h}from"../lib/Material.js";import{isPathGeometry as c}from"../lib/PathGeometry.js";import{MeshIntersectionOptions as p,intersectAabbInvDir as u}from"../lib/RayIntersections.js";import{DefaultBufferWriter as m}from"./DefaultBufferWriter.js";import{getLayout as l,PathPassParameters as f,PathTechnique as d}from"./PathTechnique.js";import{PathTechniqueConfiguration as b}from"./PathTechniqueConfiguration.js";import{alphaCutoff as g}from"../../../../webscene/support/AlphaCutoff.js";class _ extends h{constructor(t,e){super(t,w),this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&r(t)||a(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&r(t)||a(t))&&this.transparent]]),this._configuration=new b(e.spherical)}get hasEmissions(){return this.parameters.emissiveStrength>0}getConfiguration(t,e){return super.getConfiguration(t,e,this._configuration),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=e.hasOccludees,o(t)?(this._configuration.doubleSidedMode=this.parameters.doubleSided&&"normal"===this.parameters.doubleSidedType?1:this.parameters.doubleSided&&"winding-order"===this.parameters.doubleSidedType?2:0,this._configuration.receiveShadows=e.shadowMap.enabled,this._configuration.receiveAmbientOcclusion=null!=e.ssao):this._configuration.receiveShadows=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.oitPass=e.oitPass,this._configuration.terrainDepthTest=e.terrainDepthTest,this._configuration.cullAboveTerrain=e.cullAboveTerrain,this._configuration.snowCover=e.snowCover>0,this._configuration}isVisibleForOutput(t){return 4!==t&&6!==t&&5!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=g}intersect(t,e,i,s,r,a){this._intersect(t,i,s,r,a)}intersectDraped(t,e,i,s){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersect(t,e,this._pp0,this._pp1,s)}_intersect(i,r,a,o,n){const h=i;if(!c(h))return;const m=h.path,l=e(this.parameters.size);if(this.parameters.vvSize){const{offset:e,factor:i,minSize:s,maxSize:r,fallback:a}=this.parameters.vvSize,o=m.sizeAttributeValue;Number.isNaN(o)?(l[0]*=a[0],l[1]*=a[2]):(l[0]*=t(e[0]+o*i[0],s[0],r[0]),l[1]*=t(e[2]+o*i[2],s[2],r[2]))}const f=new p(r.tolerance,!1,r.options.normalRequired),d=Math.max(l[0],l[1]),b=i.boundingInfo;if(null==b)return void v(m,l,a,o,f,n);const g=s(b.bbMin[0]-d,b.bbMin[1]-d,b.bbMin[2]-d,b.bbMax[0]+d,b.bbMax[1]+d,b.bbMax[2]+d),_=[o[0]-a[0],o[1]-a[1],o[2]-a[2]],S=Math.sqrt(_[0]*_[0]+_[1]*_[1]+_[2]*_[2]),w=[S/_[0],S/_[1],S/_[2]];u(g,a,w,r.tolerance)&&v(m,l,a,o,f,n)}createBufferWriter(){return new m(l(this.parameters))}createGLMaterial(t){return new S(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class S extends n{beginSlot(t){return this.getTechnique(d,t)}}function v(t,e,i,s,r,a){t.baked.size&&t.baked.size[0]===e[0]&&t.baked.size[1]===e[1]||t.baked.bake(e),t.baked.intersect(i,s,r,a)}class w extends f{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1}}export{w as Parameters,_ as PathMaterial};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"./DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.pbrMode=0,this.doubleSidedMode=0,this.emissionSource=0,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.transparent=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasGlow=!1,this.snowCover=!1,this.textureCoordinateType=0,this.occlusionPass=!1,this.hasVVInstancing=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.draped=!1,this.overlayEnabled=!1}get discardInvisibleFragments(){return this.transparent}}e([t({count:7})],i.prototype,"pbrMode",void 0),e([t({count:3})],i.prototype,"doubleSidedMode",void 0),e([t({count:8})],i.prototype,"emissionSource",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"hasVVSize",void 0),e([t()],i.prototype,"hasVVColor",void 0),e([t()],i.prototype,"hasVVOpacity",void 0),e([t()],i.prototype,"transparent",void 0),e([t()],i.prototype,"hasOccludees",void 0),e([t()],i.prototype,"terrainDepthTest",void 0),e([t()],i.prototype,"cullAboveTerrain",void 0),e([t()],i.prototype,"hasGlow",void 0),e([t()],i.prototype,"snowCover",void 0);export{i as PathTechniqueConfiguration};
5
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"./DefaultTechniqueConfiguration.js";class i extends o{constructor(e){super(),this.spherical=e,this.pbrMode=0,this.doubleSidedMode=0,this.emissionSource=0,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVVOpacity=!1,this.transparent=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.textureCoordinateType=0,this.occlusionPass=!1,this.hasVVInstancing=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.draped=!1,this.overlayEnabled=!1}get discardInvisibleFragments(){return this.transparent}}e([t({count:7})],i.prototype,"pbrMode",void 0),e([t({count:3})],i.prototype,"doubleSidedMode",void 0),e([t({count:8})],i.prototype,"emissionSource",void 0),e([t()],i.prototype,"receiveShadows",void 0),e([t()],i.prototype,"receiveAmbientOcclusion",void 0),e([t()],i.prototype,"hasVVSize",void 0),e([t()],i.prototype,"hasVVColor",void 0),e([t()],i.prototype,"hasVVOpacity",void 0),e([t()],i.prototype,"transparent",void 0),e([t()],i.prototype,"hasOccludees",void 0),e([t()],i.prototype,"terrainDepthTest",void 0),e([t()],i.prototype,"cullAboveTerrain",void 0),e([t()],i.prototype,"snowCover",void 0);export{i as PathTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as h,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../../core/scheduling.js";import{Milliseconds as d}from"../../../../core/time.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{isMoon as u,isMars as f}from"../../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as _}from"../../environment/ChapmanAtmosphere.js";import{CloudsComposition as g}from"../../environment/CloudsComposition.js";import{Fog as w}from"../../environment/Fog.js";import{LocalAtmosphere as x}from"../../environment/LocalAtmosphere.js";import{MarsAtmosphere as v}from"../../environment/MarsAtmosphere.js";import{ComponentObjectCollection as y}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as j}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as R}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ObjectAndLayerIDRenderNode as b}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as T}from"../effects/geometry/RenderOccludedRenderNode.js";import{GlowRenderNode as A}from"../effects/glow/GlowRenderNode.js";import{Haze as O}from"../effects/haze/Haze.js";import{Highlight as S}from"../effects/highlight/Highlight.js";import{ShadowHighlight as q}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as U}from"../effects/magnifier/Magnifier.js";import{SMAA as M}from"../effects/smaa/SMAA.js";import{SSAO as k}from"../effects/ssao/SSAO.js";import{Stars as L}from"../effects/stars/Stars.js";import D from"../lib/CompositingHelper.js";import{GLMaterialRepository as H}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as F}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as W}from"../lib/Renderer.js";import{RenderingContext as B}from"../lib/RenderingContext.js";import{RenderingContextOptions as E}from"../lib/RenderingContextOptions.js";import{TextureRepository as G}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as N}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as z}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as P}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as I}from"./contextCache.js";import{removeLoadedShaderModules as V}from"./renderUtils.js";import{ScreenshotManager as X,ScreenshotContext as Q}from"./ScreenshotManager.js";import{contextCache as J}from"./testUtils.js";import{noBudget as K}from"../../../support/Scheduler.js";import{checkWebGLError as Y}from"../../../webgl/checkWebGLError.js";let Z=class extends t{constructor(e){super(e),this._waterTextures=new P,this.olidRenderHelper=C()?new F:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.test=null;const t=e.stage;try{this._initializeContext(t)}catch(n){return void console.error("Failed to initialize context",n)}const{memoryController:r}=t.view.resourceController;this._stippleTextures=z(this._rctx,r),this.notifyChange("stippleTextures"),this._markerTextures=N(this._rctx,r),this.notifyChange("markerTextures"),this._techniques=new R(new j(this._rctx,t.viewingMode,this.stippleTextures,this.waterTextures,this.markerTextures)),this._textures=new G(t),this.addHandles(this._textures.events.on("changed",e=>this.requestRender(e)));const s=new H(this._textures,this._techniques,()=>this.requestRender(),()=>this.requestRender());this._compositingHelper=new D(this._rctx,this._techniques),this._renderer=new W(t,s,this._techniques,this._rctx,this._compositingHelper,e=>this.requestRender(e)),this.notifyChange("renderer"),this.addHandles([a(()=>t.view.ready,e=>{e&&this._createRenderNodes()},h),a(()=>this.waterTextures?.updating,()=>this.requestRender(),h),a(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),l)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new X(this._rctx,i,e=>t.view.overlayManager.updateOverlays(K,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this._techniques=o(this._techniques),this._componentObjectCollection=o(this._componentObjectCollection),this._set("componentObjectCollection",null),this._screenshotManager=o(this._screenshotManager),o(this.renderer),this._textures=o(this._textures),o(this.waterTextures),o(this.markerTextures),o(this.stippleTextures),this._waterTextures=null,this._markerTextures=null,this._stippleTextures=null,this._canvas=null,this._rctx=o(this._rctx),this._compositingHelper=null,this._renderer=null,this._set("renderer",null),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new L({view:e}),u(e.spatialReference)||(2===t?(new x({view:e}),this.glow=new A({view:e})):f(e.spatialReference)?(new v({view:e}),this.glow=new A({view:e})):(new _({view:e}),new g({view:e}),this.glow=new A({view:e}),new O({view:e}),this.fog=new w({view:e}))),new k({view:e,isEnabled:()=>this.renderer.hasSSAO}),new M({view:e,isEnabled:()=>this.renderer.hasSMAA}),new U({view:e}),new S({view:e}),new q({view:e,viewingMode:t}),new T({view:e}),C()&&new b({view:e})}requestRender(e=1){this._needsRender=!0,1===e&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get techniques(){return this._techniques}get compositingHelper(){return this._compositingHelper}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const l=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let p=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=l(4*s,h,i.nearFar);p>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(p=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&p>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(p=s)}return p===Number.MAX_VALUE?void 0:p}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){V(),await this._techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;(d(i-this._lastAnimationUpdate)>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e,0),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this._textures.update();const r=new Q(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=p(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");Y(n,!0),this._rctx=$(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stippleTextures(){return this._stippleTextures}get markerTextures(){return this._markerTextures}get waterTextures(){return this._waterTextures}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get renderer(){return this._renderer}get componentObjectCollection(){return null==this._componentObjectCollection&&(this._componentObjectCollection=new y(this.renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}updateQualitySettings(e){null!=this.test?.time&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=d(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.stage.view.qualitySettings.maxTexturePixels})}};function $(e,t){const r=new E(t);if(J.enabled){let t=ee.get(e);return t&&1===t.refCount?(t.configure(r),t.ref(),t):(t=new B(e,r),ee.set(e,t),t.ref(),t)}return new B(e,r)}e([c({type:Boolean,readOnly:!0})],Z.prototype,"updating",null),e([c({constructOnly:!0})],Z.prototype,"stage",void 0),e([c({readOnly:!0})],Z.prototype,"stippleTextures",null),e([c({readOnly:!0})],Z.prototype,"markerTextures",null),e([c({readOnly:!0})],Z.prototype,"waterTextures",null),e([c({readOnly:!0})],Z.prototype,"olidRenderHelper",void 0),e([c()],Z.prototype,"_textures",void 0),e([c({readOnly:!0})],Z.prototype,"renderer",null),e([c()],Z.prototype,"_screenshotManager",void 0),e([c()],Z.prototype,"componentObjectCollection",null),e([c()],Z.prototype,"_componentObjectCollection",void 0),e([c()],Z.prototype,"_needsUpdate",void 0),e([c()],Z.prototype,"_needsWaterReflectionUpdate",void 0),Z=e([m("esri.views.3d.webgl-engine.parts.RenderView")],Z);const ee=I();export{Z as RenderView};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as s}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{watch as a,initial as h,syncAndInitial as l}from"../../../../core/reactiveUtils.js";import{addFrameTask as p}from"../../../../core/scheduling.js";import{Milliseconds as d}from"../../../../core/time.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/RandomLCG.js";import{subclass as m}from"../../../../core/accessorSupport/decorators/subclass.js";import{isMoon as u,isMars as f}from"../../../../geometry/support/spatialReferenceUtils.js";import{ChapmanAtmosphere as _}from"../../environment/ChapmanAtmosphere.js";import{CloudsComposition as g}from"../../environment/CloudsComposition.js";import{Fog as w}from"../../environment/Fog.js";import{LocalAtmosphere as x}from"../../environment/LocalAtmosphere.js";import{MarsAtmosphere as v}from"../../environment/MarsAtmosphere.js";import{ComponentObjectCollection as y}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as j}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as R}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ObjectAndLayerIDRenderNode as b}from"../effects/geometry/ObjectAndLayerIDRenderNode.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccludedRenderNode as T}from"../effects/geometry/RenderOccludedRenderNode.js";import{GlowRenderNode as A}from"../effects/glow/GlowRenderNode.js";import{Haze as O}from"../effects/haze/Haze.js";import{Highlight as S}from"../effects/highlight/Highlight.js";import{ShadowHighlight as q}from"../effects/highlight/ShadowHighlight.js";import{Magnifier as U}from"../effects/magnifier/Magnifier.js";import{SMAA as M}from"../effects/smaa/SMAA.js";import{SSAO as k}from"../effects/ssao/SSAO.js";import{Stars as L}from"../effects/stars/Stars.js";import D from"../lib/CompositingHelper.js";import{GLMaterialRepository as H}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as F}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as W}from"../lib/Renderer.js";import{RenderingContext as B}from"../lib/RenderingContext.js";import{RenderingContextOptions as E}from"../lib/RenderingContextOptions.js";import{TextureRepository as G}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as N}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as z}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as P}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as I}from"./contextCache.js";import{removeLoadedShaderModules as V}from"./renderUtils.js";import{ScreenshotManager as X,ScreenshotContext as Q}from"./ScreenshotManager.js";import{contextCache as J}from"./testUtils.js";import{noBudget as K}from"../../../support/Scheduler.js";import{checkWebGLError as Y}from"../../../webgl/checkWebGLError.js";let Z=class extends t{constructor(e){super(e),this._waterTextures=new P,this.olidRenderHelper=C()?new F:null,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.test=null;const t=e.stage;try{this._initializeContext(t)}catch(n){return void console.error("Failed to initialize context",n)}const{memoryController:r}=t.view.resourceController;this._stippleTextures=z(this._rctx,r),this.notifyChange("stippleTextures"),this._markerTextures=N(this._rctx,r),this.notifyChange("markerTextures"),this._techniques=new R(new j(this._rctx,t.viewingMode,this.stippleTextures,this.waterTextures,this.markerTextures)),this._textures=new G(t),this.addHandles(this._textures.events.on("changed",e=>this.requestRender(e)));const s=new H(this._textures,this._techniques,()=>this.requestRender(),()=>this.requestRender());this._compositingHelper=new D(this._rctx,this._techniques),this._renderer=new W(t,s,this._techniques,this._rctx,this._compositingHelper,e=>this.requestRender(e)),this.notifyChange("renderer"),this.addHandles([a(()=>t.view.ready,e=>{e&&this._createRenderNodes()},h),a(()=>this.waterTextures?.updating,()=>this.requestRender(),h),a(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),l)]);const i={renderScene:(e,t,r,s)=>this.renderer.render(e,t,r,s),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,s)=>t.options.screenshot.renderOverlay(e,r,s)};this._screenshotManager=new X(this._rctx,i,e=>t.view.overlayManager.updateOverlays(K,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this._techniques=o(this._techniques),this._componentObjectCollection=o(this._componentObjectCollection),this._set("componentObjectCollection",null),this._screenshotManager=o(this._screenshotManager),o(this.renderer),this._textures=o(this._textures),o(this.waterTextures),o(this.markerTextures),o(this.stippleTextures),this._waterTextures=null,this._markerTextures=null,this._stippleTextures=null,this._canvas=null,this._rctx=o(this._rctx),this._compositingHelper=null,this._renderer=null,this._set("renderer",null),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new L({view:e}),u(e.spatialReference)||(2===t?(new x({view:e}),this.glow=new A({view:e})):f(e.spatialReference)?(new v({view:e}),this.glow=new A({view:e})):(new _({view:e}),new g({view:e}),this.glow=new A({view:e}),new O({view:e}),this.fog=new w({view:e}))),new k({view:e,isEnabled:()=>this.renderer.hasSSAO}),new M({view:e,isEnabled:()=>this.renderer.hasSMAA}),new U({view:e}),new S({view:e}),new q({view:e,viewingMode:t}),new T({view:e}),C()&&new b({view:e})}requestRender(e=1){switch(e){case 2:this.stage.view.state.fading=!0;case 1:this._needsUpdate=!0;case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textures.updating||this.waterTextures.updating}get textures(){return this._textures}get techniques(){return this._techniques}get compositingHelper(){return this._compositingHelper}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,n,o=n){const a=i.constrainWindowSize(t,r,n*i.pixelRatio,o*i.pixelRatio),h=this._ensureLinearDepthArrayBuffer(a);this.renderer.readMainDepth(a,h);const l=(e,t,r)=>s(t,e)*(r[1]-r[0])+r[0];let p=Number.MAX_VALUE;for(let s=0;s<a[2]*a[3];s++){const e=l(4*s,h,i.nearFar);p>e&&e!==i.nearFar[0]&&e!==i.nearFar[1]&&(p=e)}if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&p>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(p=s)}return p===Number.MAX_VALUE?void 0:p}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){V(),await this._techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,s=0,i=!1;const n={preRender:({time:i})=>{r=this.updating,s=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),i=this.test?.time??i;(d(i-this._lastAnimationUpdate)>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,i)&&this.requestRender(0),this._lastAnimationUpdate=i)},render:({time:e})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const r=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,e=this.test?.time??e,this.renderer.render(t,e,0),i=!0,r&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this._textures.update();const r=new Q(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{i&&(this.renderer.finish(2===t.mode?s:1),i=!1)}};this._frameTask=p(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const s={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",s);if(null==n)return void i.getLogger(this).error("A WebGL2 context could not be created.");Y(n,!0),this._rctx=$(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&i.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stippleTextures(){return this._stippleTextures}get markerTextures(){return this._markerTextures}get waterTextures(){return this._waterTextures}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get renderer(){return this._renderer}get componentObjectCollection(){return null==this._componentObjectCollection&&(this._componentObjectCollection=new y(this.renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}updateQualitySettings(e){null!=this.test?.time&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=d(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.stage.view.qualitySettings.maxTexturePixels})}};function $(e,t){const r=new E(t);if(J.enabled){let t=ee.get(e);return t&&1===t.refCount?(t.configure(r),t.ref(),t):(t=new B(e,r),ee.set(e,t),t.ref(),t)}return new B(e,r)}e([c({type:Boolean,readOnly:!0})],Z.prototype,"updating",null),e([c({constructOnly:!0})],Z.prototype,"stage",void 0),e([c({readOnly:!0})],Z.prototype,"stippleTextures",null),e([c({readOnly:!0})],Z.prototype,"markerTextures",null),e([c({readOnly:!0})],Z.prototype,"waterTextures",null),e([c({readOnly:!0})],Z.prototype,"olidRenderHelper",void 0),e([c()],Z.prototype,"_textures",void 0),e([c({readOnly:!0})],Z.prototype,"renderer",null),e([c()],Z.prototype,"_screenshotManager",void 0),e([c()],Z.prototype,"componentObjectCollection",null),e([c()],Z.prototype,"_componentObjectCollection",void 0),e([c()],Z.prototype,"_needsUpdate",void 0),e([c()],Z.prototype,"_needsWaterReflectionUpdate",void 0),Z=e([m("esri.views.3d.webgl-engine.parts.RenderView")],Z);const ee=I();export{Z as RenderView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{parameter as e}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class s extends o{constructor(t){super(),this.spherical=t,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasGlow=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}t([e({count:4})],s.prototype,"alphaDiscardMode",void 0),t([e({count:3})],s.prototype,"doubleSidedMode",void 0),t([e({count:7})],s.prototype,"pbrMode",void 0),t([e({count:3})],s.prototype,"cullFace",void 0),t([e({count:3})],s.prototype,"normalType",void 0),t([e({count:2})],s.prototype,"customDepthTest",void 0),t([e({count:8})],s.prototype,"emissionSource",void 0),t([e()],s.prototype,"hasVertexColors",void 0),t([e()],s.prototype,"hasSymbolColors",void 0),t([e()],s.prototype,"hasVerticalOffset",void 0),t([e()],s.prototype,"hasColorTexture",void 0),t([e()],s.prototype,"hasMetallicRoughnessTexture",void 0),t([e()],s.prototype,"hasOcclusionTexture",void 0),t([e()],s.prototype,"hasNormalTexture",void 0),t([e()],s.prototype,"hasScreenSizePerspective",void 0),t([e()],s.prototype,"hasVertexTangents",void 0),t([e()],s.prototype,"hasOccludees",void 0),t([e()],s.prototype,"instanced",void 0),t([e()],s.prototype,"instancedDoublePrecision",void 0),t([e()],s.prototype,"hasModelTransformation",void 0),t([e()],s.prototype,"offsetBackfaces",void 0),t([e()],s.prototype,"hasVVSize",void 0),t([e()],s.prototype,"hasVVColor",void 0),t([e()],s.prototype,"receiveShadows",void 0),t([e()],s.prototype,"receiveAmbientOcclusion",void 0),t([e()],s.prototype,"textureAlphaPremultiplied",void 0),t([e()],s.prototype,"instancedFeatureAttribute",void 0),t([e()],s.prototype,"instancedColor",void 0),t([e()],s.prototype,"writeDepth",void 0),t([e()],s.prototype,"transparent",void 0),t([e()],s.prototype,"enableOffset",void 0),t([e()],s.prototype,"terrainDepthTest",void 0),t([e()],s.prototype,"cullAboveTerrain",void 0),t([e()],s.prototype,"snowCover",void 0),t([e()],s.prototype,"hasGlow",void 0),t([e()],s.prototype,"hasColorTextureTransform",void 0),t([e()],s.prototype,"hasEmissionTextureTransform",void 0),t([e()],s.prototype,"hasNormalTextureTransform",void 0),t([e()],s.prototype,"hasOcclusionTextureTransform",void 0),t([e()],s.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{s as DefaultMaterialTechniqueConfiguration};
5
+ import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as o}from"../materials/DefaultTechniqueConfiguration.js";class s extends o{constructor(e){super(),this.spherical=e,this.alphaDiscardMode=1,this.doubleSidedMode=0,this.pbrMode=0,this.cullFace=0,this.normalType=0,this.customDepthTest=0,this.emissionSource=0,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1,this.occlusionPass=!1,this.useCustomDTRExponentForWater=!1,this.useFillLights=!0,this.draped=!1}get textureCoordinateType(){return this.hasTextures?1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}get hasVVInstancing(){return this.instanced}get discardInvisibleFragments(){return this.transparent}}e([t({count:4})],s.prototype,"alphaDiscardMode",void 0),e([t({count:3})],s.prototype,"doubleSidedMode",void 0),e([t({count:7})],s.prototype,"pbrMode",void 0),e([t({count:3})],s.prototype,"cullFace",void 0),e([t({count:3})],s.prototype,"normalType",void 0),e([t({count:2})],s.prototype,"customDepthTest",void 0),e([t({count:8})],s.prototype,"emissionSource",void 0),e([t()],s.prototype,"hasVertexColors",void 0),e([t()],s.prototype,"hasSymbolColors",void 0),e([t()],s.prototype,"hasVerticalOffset",void 0),e([t()],s.prototype,"hasColorTexture",void 0),e([t()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([t()],s.prototype,"hasOcclusionTexture",void 0),e([t()],s.prototype,"hasNormalTexture",void 0),e([t()],s.prototype,"hasScreenSizePerspective",void 0),e([t()],s.prototype,"hasVertexTangents",void 0),e([t()],s.prototype,"hasOccludees",void 0),e([t()],s.prototype,"instanced",void 0),e([t()],s.prototype,"instancedDoublePrecision",void 0),e([t()],s.prototype,"hasModelTransformation",void 0),e([t()],s.prototype,"offsetBackfaces",void 0),e([t()],s.prototype,"hasVVSize",void 0),e([t()],s.prototype,"hasVVColor",void 0),e([t()],s.prototype,"receiveShadows",void 0),e([t()],s.prototype,"receiveAmbientOcclusion",void 0),e([t()],s.prototype,"textureAlphaPremultiplied",void 0),e([t()],s.prototype,"instancedFeatureAttribute",void 0),e([t()],s.prototype,"instancedColor",void 0),e([t()],s.prototype,"writeDepth",void 0),e([t()],s.prototype,"transparent",void 0),e([t()],s.prototype,"enableOffset",void 0),e([t()],s.prototype,"terrainDepthTest",void 0),e([t()],s.prototype,"cullAboveTerrain",void 0),e([t()],s.prototype,"snowCover",void 0),e([t()],s.prototype,"hasColorTextureTransform",void 0),e([t()],s.prototype,"hasEmissionTextureTransform",void 0),e([t()],s.prototype,"hasNormalTextureTransform",void 0),e([t()],s.prototype,"hasOcclusionTextureTransform",void 0),e([t()],s.prototype,"hasMetallicRoughnessTextureTransform",void 0);export{s as DefaultMaterialTechniqueConfiguration};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../core/Accessor.js";import t from"../core/Collection.js";import{when as s,watch as i}from"../core/reactiveUtils.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{toExtent as a}from"./3d/support/cameraUtils.js";import{GroundElevationSampler as p}from"./support/GroundElevationSampler.js";import{IntegratedMeshElevationSampler as l}from"./support/IntegratedMeshElevationSampler.js";let d=class extends r{constructor(e){super(e),this.view=null,this.layerViews=new t}initialize(){this.addHandles(s(()=>this.view?.map?.ground,async e=>e.load())),"3d"===this.view.type&&this.addHandles([i(()=>this.view.map?.basemap,()=>this._groundLayersChanged(),{initial:!0}),i(()=>this.view.map?.basemap?.groundLayers,e=>{this._groundLayersChanged(),e?.on("after-changes",()=>this._groundLayersChanged())},{initial:!0}),s(()=>"3d"===this.view.type&&(this.view?.basemapTerrain??!1),async()=>{this._groundLayersChanged()})])}_groundLayersChanged(){const{view:e}=this;if(null!=e&&"3d"===e.type){const r=e.basemapTerrain;if(r){const t=e.map?.basemap?.groundLayers.some(e=>"replacesTerrain"in e&&e.replacesTerrain);r.enable(!t)}}}get ground(){return this.view?.map?.ground}destroy(){this._set("view",null),this.layerViews.destroyAll()}get elevationSampler(){return"3d"===this.view.type?new p({view:this.view}):null}get integratedMeshElevationSampler(){return this.view?new l({view:this.view}):null}get extent(){const{view:e}=this;return e?.ready?a(e,e.state.camera,e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return!this.suspended&&this.layerViews.some(({updating:e})=>e)}get suspended(){return this.view?.suspended??!0}};e([o({readOnly:!0})],d.prototype,"elevationSampler",null),e([o({readOnly:!0})],d.prototype,"integratedMeshElevationSampler",null),e([o({readOnly:!0})],d.prototype,"extent",null),e([o({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([o({constructOnly:!0})],d.prototype,"view",void 0),e([o({type:t,readOnly:!0})],d.prototype,"layerViews",void 0),e([o({readOnly:!0})],d.prototype,"suspended",null),d=e([n("esri.views.GroundView")],d);const u=d;export{u as default};
5
+ import{__decorate as e}from"tslib";import r from"../core/Accessor.js";import t from"../core/Collection.js";import{when as s,watch as i}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{toExtent as o}from"./3d/support/cameraUtils.js";import{GroundElevationSampler as p}from"./support/GroundElevationSampler.js";import{IntegratedMeshElevationSampler as l}from"./support/IntegratedMeshElevationSampler.js";let d=class extends r{constructor(e){super(e),this.view=null,this.layerViews=new t}initialize(){this.addHandles(s(()=>this.view?.map?.ground,async e=>e.load())),"3d"===this.view.type&&this.addHandles([i(()=>this.view.map?.basemap,()=>this._groundLayersChanged(),{initial:!0}),i(()=>this.view.map?.basemap?.groundLayers,e=>{this._groundLayersChanged(),e?.on("after-changes",()=>this._groundLayersChanged())},{initial:!0}),i(()=>this.view.basemapView?.groundLayerViews,e=>{this._groundLayersChanged(),e?.on("after-changes",()=>this._groundLayersChanged())},{initial:!0}),s(()=>"3d"===this.view.type&&(this.view?.basemapTerrain??!1),async()=>{this._groundLayersChanged()})])}_groundLayersChanged(){const{view:e}=this;if(null!=e&&"3d"===e.type){const r=e.basemapTerrain;if(r){const t=e.map?.basemap?.groundLayers.some(r=>!!e.basemapView?.groundLayerViews.find(e=>e.layer===r)&&"replacesTerrain"in r&&r.replacesTerrain);r.enable(!t)}}}get ground(){return this.view?.map?.ground}destroy(){this._set("view",null),this.layerViews.destroyAll()}get elevationSampler(){return"3d"===this.view.type?new p({view:this.view}):null}get integratedMeshElevationSampler(){return this.view?new l({view:this.view}):null}get extent(){const{view:e}=this;return e?.ready?o(e,e.state.camera,e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return!this.suspended&&this.layerViews.some(({updating:e})=>e)}get suspended(){return this.view?.suspended??!0}};e([a({readOnly:!0})],d.prototype,"elevationSampler",null),e([a({readOnly:!0})],d.prototype,"integratedMeshElevationSampler",null),e([a({readOnly:!0})],d.prototype,"extent",null),e([a({type:Boolean,readOnly:!0})],d.prototype,"updating",null),e([a({constructOnly:!0})],d.prototype,"view",void 0),e([a({type:t,readOnly:!0})],d.prototype,"layerViews",void 0),e([a({readOnly:!0})],d.prototype,"suspended",null),d=e([n("esri.views.GroundView")],d);const u=d;export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import e from"../../../core/Accessor.js";import t from"../../../core/Collection.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getInputGeometry as l}from"./elevationProfileGeometryUtils.js";import{ElevationProfileHoveredPointVisualization as a}from"./ElevationProfileHoveredPointVisualization.js";let p=class extends e{constructor(o){super(o),this._hoveredPoints=new t}initialize(){const{analysisViewData:o}=this,{analysis:e}=o;this.addHandles([r(()=>{const{hoveredPoints:t,visible:r,progress:i}=o;return r?i<1?null:t.map((o,t)=>{const r=e.profiles.at(t);return!0===r?.viewOptions.hoveredPointVisible&&null!=o?{hoveredPoint:o,color:r.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i),r(()=>l(e.input),()=>this._update([]),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}get updating(){return!1}_update(o){if(!o)return;const{view:e,_hoveredPoints:t}=this,r=o.length;for(;t.length>r;)t.pop()?.destroy();for(;t.length<r;){const o=new a({view:e});t.push(o)}for(let i=0;i<r;++i){const e=o[i],s=t.at(r-1-i);s.position=e.hoveredPoint,s.color=e.color}}};o([s()],p.prototype,"view",void 0),o([s()],p.prototype,"analysisViewData",void 0),o([s()],p.prototype,"_hoveredPoints",void 0),o([s()],p.prototype,"updating",null),p=o([n("esri.views.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],p);export{p as ElevationProfileHoveredPointsVisualization};
5
+ import{__decorate as o}from"tslib";import t from"../../../core/Accessor.js";import e from"../../../core/Collection.js";import{watch as r,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getInputGeometry as l}from"./elevationProfileGeometryUtils.js";import{ElevationProfileHoveredPointVisualization as a}from"./ElevationProfileHoveredPointVisualization.js";let p=class extends t{constructor(o){super(o),this._hoveredPoints=new e}initialize(){const{analysisViewData:o}=this,{analysis:t}=o;this.addHandles([r(()=>{const{hoveredPoints:e,visible:r,updating:i}=o;return r?i?null:e.map((o,e)=>{const r=t.profiles.at(e);return!0===r?.viewOptions.hoveredPointVisible&&null!=o?{hoveredPoint:o,color:r.color}:null}).filter(o=>!!o):[]},o=>this._update(o),i),r(()=>l(t.input),()=>this._update([]),i)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}get updating(){return!1}_update(o){if(!o)return;const{view:t,_hoveredPoints:e}=this,r=o.length;for(;e.length>r;)e.pop()?.destroy();for(;e.length<r;){const o=new a({view:t});e.push(o)}for(let i=0;i<r;++i){const t=o[i],s=e.at(r-1-i);s.position=t.hoveredPoint,s.color=t.color}}};o([s()],p.prototype,"view",void 0),o([s()],p.prototype,"analysisViewData",void 0),o([s()],p.prototype,"_hoveredPoints",void 0),o([s()],p.prototype,"updating",null),p=o([n("esri.views.analysis.ElevationProfile.ElevationProfileHoveredPointsVisualization")],p);export{p as ElevationProfileHoveredPointsVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- class e{constructor(e,t,s){this.view=e,this.vertexIndex=t,this.vertices=s,this.defaultPrevented=!1,this.type="vertex-add"}preventDefault(){this.defaultPrevented=!0}}class t{constructor(e,t,s){this.view=e,this.vertexIndex=t,this.vertices=s,this.defaultPrevented=!1,this.type="vertex-update"}preventDefault(){this.defaultPrevented=!0}}class s{constructor(e,t,s){this.view=e,this.vertexIndex=t,this.vertices=s,this.defaultPrevented=!1,this.type="vertex-remove"}preventDefault(){this.defaultPrevented=!0}}class i{constructor(e,t,s,i=null){this.view=e,this.vertexIndex=t,this.vertices=s,this.mapPoint=i,this.coordinates=null,this.defaultPrevented=!1,this.type="cursor-update",this.coordinates=1===s.length?s[0]:null}preventDefault(){this.defaultPrevented=!0}}class r{constructor(e){this.vertices=e,this.coordinates=null,this.defaultPrevented=!1,this.type="draw-complete",this.coordinates=1===e.length?e[0]:null}preventDefault(){this.defaultPrevented=!0}}export{i as CursorUpdateEvent,r as DrawCompleteEvent,e as VertexAddEvent,s as VertexRemoveEvent,t as VertexUpdateEvent};
5
+ class e{constructor(e,t,s){this.view=e,this.defaultPrevented=!1,this.type="vertex-add",this.vertexIndex=t,this.vertices=s}preventDefault(){this.defaultPrevented=!0}}class t{constructor(e,t,s){this.view=e,this.defaultPrevented=!1,this.type="vertex-update",this.vertexIndex=t,this.vertices=s}preventDefault(){this.defaultPrevented=!0}}class s{constructor(e,t,s){this.view=e,this.defaultPrevented=!1,this.type="vertex-remove",this.vertexIndex=t,this.vertices=s}preventDefault(){this.defaultPrevented=!0}}class i{constructor(e,t,s,i=null){this.view=e,this.coordinates=null,this.defaultPrevented=!1,this.type="cursor-update",this.coordinates=1===s.length?s[0]:null,this.vertexIndex=t,this.vertices=s,this.mapPoint=i}preventDefault(){this.defaultPrevented=!0}}class r{constructor(e){this.vertices=e,this.coordinates=null,this.defaultPrevented=!1,this.type="draw-complete",this.coordinates=1===e.length?e[0]:null}preventDefault(){this.defaultPrevented=!0}}export{i as CursorUpdateEvent,r as DrawCompleteEvent,e as VertexAddEvent,s as VertexRemoveEvent,t as VertexUpdateEvent};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as t}from"../../core/arrayUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{project as a}from"../../geometry/projectionUtils.js";import{isMeshWithRelativeVertexSpace as o}from"../../geometry/support/meshVertexSpaceUtils.js";import{clonePoint as l,hydratedSpatialReference as c}from"../../layers/graphics/hydratedFeatures.js";import{getZForElevationMode as s}from"../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"./editGeometry/EditGeometryOperations.js";function i(t,n){let e=null,r=null;return a=>{if("cancel"===a.action)return void(null!=r&&(r.execute({action:"cancel"}),e=null,r=null));const o={action:a.action,screenStart:a.start,screenEnd:a.screenPoint};"start"===a.action&&null==e&&(e=new w,r=new w,n(t,e,r,a.pointerType,o)),null!=e&&e.execute(o),"end"===a.action&&null!=e&&(e=null,r=null)}}function p(t,n){return t.events.on("drag",i(t,n))}function m(t,n){const e=[t.x,t.y,t.z??0],r=n,a=[Math.cos(r),Math.sin(r)],o=Math.sqrt(a[0]*a[0]+a[1]*a[1]);if(0===o)return null;a[0]/=o,a[1]/=o;const l=t=>{const n=(t.x-e[0])*a[0]+(t.y-e[1])*a[1];t.x=e[0]+n*a[0],t.y=e[1]+n*a[1]};return t=>(l(t.mapStart),l(t.mapEnd),{...t,axis:a})}function f(t){let n=null;return e=>{if("start"===e.action&&(n=y(t,e.mapStart.spatialReference)),null==n)return null;const r=e.mapEnd.x-e.mapStart.x,a=e.mapEnd.y-e.mapStart.y,o=(e.mapEnd.z??0)-(e.mapStart.z??0);return n.move(r,a,o,e.action),{...e,translationX:r,translationY:a,translationZ:o}}}function d(t,n){return null==t?null:t.spatialReference.equals(n)?t.clone():a(t,n)}function y(t,n){const e=t.operations;if(!e)return null;const r=e.data.geometry,l=c(n);if(r.spatialReference.equals(l))return x(t,e,()=>{});if("mesh"!==r.type){const n=d(r,l);if(null==n)return null;const o=r.spatialReference;return x(t,u.fromGeometry(n,e.viewingMode),()=>{const t=a(r,o);e.trySetGeometry(t)})}if(o(r)){const n=d(r.origin,l);if(!n)return null;const o=r.spatialReference,c=u.fromGeometry(n,e.viewingMode);return x(t,e,()=>{const t=a(c.data.geometry,o),n=t.x-r.origin.x,l=t.y-r.origin.y,s=(t.z??0)-(r.origin.z??0);e.move(n,l,s)})}return null}function x(t,n,e){let r=0,a=0,o=0;return{move:(l,c,s,u)=>{"start"===u&&(r=0,a=0,o=0);const i=l-r,p=c-a,m=s-o;n.move(i,p,m),r+=i,a+=p,o+=m,e(),"end"===u&&t.endInteraction?.()}}}function E(t,n=null,e){let r=null;const o=null==n||t.spatialReference?.equals(n)?t=>t:t=>null!=t?a(t,n):t,l={exclude:[],...e};return n=>{if("start"===n.action&&(r=o(t.toMap(n.screenStart,l))),null==r)return null;const e=o(t.toMap(n.screenEnd,l));return null!=e?{...n,mapStart:r,mapEnd:e}:null}}function S(n){const e=n.map(t=>f(t)).filter(t);return t=>{const n=t.mapEnd.x-t.mapStart.x,r=t.mapEnd.y-t.mapStart.y,a=t.mapEnd.z-t.mapStart.z;return e.forEach(n=>n(t)),{...t,translationX:n,translationY:r,translationZ:a}}}function h(t,e){const r=new Map;for(const a of e)r.set(a,n(t[a]));return n=>(r.forEach((n,e)=>{t[e]=n}),n)}function g(t){const n=t.operations?.createResetState();return t=>(n?.remove(),t)}function z(t){const n=t.map(t=>g(t)).filter(t=>null!=t);return t=>(n.forEach(n=>n(t)),t)}function v(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z);const a=r.mapEnd.x-t,o=r.mapEnd.y-n,l=r.mapEnd.z-e;return t=r.mapEnd.x,n=r.mapEnd.y,e=r.mapEnd.z,{...r,mapDeltaX:a,mapDeltaY:o,mapDeltaZ:l,mapDeltaSpatialReference:r.mapStart.spatialReference}}}function j(){let t=0,n=0;return e=>{"start"===e.action&&(t=e.screenStart.x,n=e.screenStart.y);const r=e.screenEnd.x-t,a=e.screenEnd.y-n;return t=e.screenEnd.x,n=e.screenEnd.y,{...e,screenDeltaX:r,screenDeltaY:a}}}function M(t,n){let a=null,o=0,l=0;return c=>{if("start"===c.action&&(a=t.toScreen?.(n),null!=a&&(a.x<0||a.x>t.width||a.y<0||a.y>t.height?a=null:(o=c.screenStart.x-a.x,l=c.screenStart.y-a.y))),null==a)return null;const s=e(c.screenEnd.x-o,0,t.width),u=e(c.screenEnd.y-l,0,t.height),i=r(s,u);return c.screenStart=a,c.screenEnd=i,c}}const R=()=>{};class w{constructor(){this.execute=R}next(t,n=new w){return null!=t&&(this.execute=e=>{const r=t(e);null!=r&&n.execute(r)}),n}}function D(t,n,e=[]){if("2d"===t.type)return t=>t;let r=null;return a=>{"start"===a.action&&(r=t.toMap(a.screenStart,{exclude:e}),null!=r&&(r.z=s(r,t,n)));const o=t.toMap(a.screenEnd,{exclude:e});null!=o&&(o.z=s(o,t,n));const l=null!=r&&null!=o?{sceneStart:r,sceneEnd:o}:null;return{...a,scenePoints:l}}}function U(t,n,e){const r=n.elevationProvider.getElevation(t.x,t.y,t.z??0,t.spatialReference,"scene")??0,a=l(t);return a.z=r,a.hasZ=!0,a.z=s(a,n,e),a}function G(t,n){if("2d"===t.type)return t=>t;let e=null;return r=>{"start"===r.action&&(e=U(r.mapStart,t,n));const a=U(r.mapEnd,t,n),o=null!=e&&null!=a?{sceneStart:e,sceneEnd:a}:null;return{...r,scenePoints:o}}}export{w as EventPipeline,v as addMapDelta,j as addScreenDelta,m as constrainToMapAxis,i as createDragEventPipelineCallback,p as createManipulatorDragEventPipeline,M as dragAtLocation,f as dragManipulatedObject,S as dragManipulatedObjectMany,g as resetManipulatedObject,z as resetManipulatedObjectMany,h as resetProperties,D as sceneSnappingAtLocation,G as sceneSnappingAtProjectedLocation,E as screenToMap};
5
+ import{isSome as t}from"../../core/arrayUtils.js";import"../../core/has.js";import{clone as n}from"../../core/lang.js";import{clamp as e}from"../../core/mathUtils.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{project as o}from"../../geometry/projectionUtils.js";import{isMeshWithRelativeVertexSpace as a}from"../../geometry/support/meshVertexSpaceUtils.js";import{clonePoint as l,hydratedSpatialReference as c}from"../../layers/graphics/hydratedFeatures.js";import{getZForElevationMode as s}from"../../support/elevationInfoUtils.js";import{EditGeometryOperations as u}from"./editGeometry/EditGeometryOperations.js";function i(t,n){let e=null,r=null;return o=>{if("cancel"===o.action)return void(null!=r&&(r.execute({action:"cancel"}),e=null,r=null));const a={action:o.action,screenStart:o.start,screenEnd:o.screenPoint};"start"===o.action&&null==e&&(e=new D,r=new D,n(t,e,r,o.pointerType,a)),null!=e&&e.execute(a),"end"===o.action&&null!=e&&(e=null,r=null)}}function p(t,n){return t.events.on("drag",i(t,n))}function m(t,n){const e=[t.x,t.y,t.z??0],r=n,o=[Math.cos(r),Math.sin(r)],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]);if(0===a)return null;o[0]/=a,o[1]/=a;const l=t=>{const n=(t.x-e[0])*o[0]+(t.y-e[1])*o[1];t.x=e[0]+n*o[0],t.y=e[1]+n*o[1]};return t=>(l(t.mapStart),l(t.mapEnd),{...t,axis:o})}function f(t){let n=null;const e=j();return r=>{if("start"===r.action&&(n=y(t,r.mapStart.spatialReference)),null==n)return null;const o=e(r);if(!o)return null;const{translationX:a,translationY:l,translationZ:c}=o;return n.move(a,l,c,r.action),o}}function d(t,n){return null==t?null:t.spatialReference.equals(n)?t.clone():o(t,n)}function y(t,n){const e=t.operations;if(!e)return null;const r=e.data.geometry,l=c(n);if(r.spatialReference.equals(l))return x(t,e,()=>{});if("mesh"!==r.type){const n=d(r,l);if(null==n)return null;const a=r.spatialReference;return x(t,u.fromGeometry(n,e.viewingMode),()=>{const t=o(r,a);e.trySetGeometry(t)})}if(a(r)){const n=d(r.origin,l);if(!n)return null;const a=r.spatialReference,c=u.fromGeometry(n,e.viewingMode);return x(t,e,()=>{const t=o(c.data.geometry,a),n=t.x-r.origin.x,l=t.y-r.origin.y,s=(t.z??0)-(r.origin.z??0);e.move(n,l,s)})}return null}function x(t,n,e){let r=0,o=0,a=0;return{move:(l,c,s,u)=>{"start"===u&&(r=0,o=0,a=0);const i=l-r,p=c-o,m=s-a;n.move(i,p,m),r+=i,o+=p,a+=m,e(),"end"===u&&t.endInteraction?.()}}}function E(t,n=null,e){let r=null;const a=null==n||t.spatialReference?.equals(n)?t=>t:t=>null!=t?o(t,n):t,l={exclude:[],...e};return n=>{if("start"===n.action&&(r=a(t.toMap(n.screenStart,l))),null==r)return null;const e=a(t.toMap(n.screenEnd,l));return null!=e?{...n,mapStart:r,mapEnd:e}:null}}function S(n){const e=n.map(t=>f(t)).filter(t),r=j();return t=>{const n=r(t);return e.forEach(n=>n(t)),n}}function h(t,e){const r=new Map;for(const o of e)r.set(o,n(t[o]));return n=>(r.forEach((n,e)=>{t[e]=n}),n)}function g(t){const n=t.operations?.createResetState();return t=>(n?.remove(),t)}function v(t){const n=t.map(t=>g(t)).filter(t=>null!=t);return t=>(n.forEach(n=>n(t)),t)}function z(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z??0);const o=r.mapEnd.x-t,a=r.mapEnd.y-n,l=(r.mapEnd.z??0)-e;return t=r.mapEnd.x,n=r.mapEnd.y,e=r.mapEnd.z,{...r,mapDeltaX:o,mapDeltaY:a,mapDeltaZ:l,mapDeltaSpatialReference:r.mapStart.spatialReference}}}function j(){let t=0,n=0,e=0;return r=>{"start"===r.action&&(t=r.mapStart.x,n=r.mapStart.y,e=r.mapStart.z??0);const o=r.mapEnd.x-t,a=r.mapEnd.y-n,l=(r.mapEnd.z??0)-e;return{...r,translationX:o,translationY:a,translationZ:l}}}function M(){let t=0,n=0;return e=>{"start"===e.action&&(t=e.screenStart.x,n=e.screenStart.y);const r=e.screenEnd.x-t,o=e.screenEnd.y-n;return t=e.screenEnd.x,n=e.screenEnd.y,{...e,screenDeltaX:r,screenDeltaY:o}}}function R(t,n){let o=null,a=0,l=0;return c=>{if("start"===c.action&&(o=t.toScreen?.(n),null!=o&&(o.x<0||o.x>t.width||o.y<0||o.y>t.height?o=null:(a=c.screenStart.x-o.x,l=c.screenStart.y-o.y))),null==o)return null;const s=e(c.screenEnd.x-a,0,t.width),u=e(c.screenEnd.y-l,0,t.height),i=r(s,u);return c.screenStart=o,c.screenEnd=i,c}}const w=()=>{};class D{constructor(){this.execute=w}next(t,n=new D){return null!=t&&(this.execute=e=>{const r=t(e);null!=r&&n.execute(r)}),n}}function U(t,n,e=[]){if("2d"===t.type)return t=>t;let r=null;return o=>{"start"===o.action&&(r=t.toMap(o.screenStart,{exclude:e}),null!=r&&(r.z=s(r,t,n)));const a=t.toMap(o.screenEnd,{exclude:e});null!=a&&(a.z=s(a,t,n));const l=null!=r&&null!=a?{sceneStart:r,sceneEnd:a}:null;return{...o,scenePoints:l}}}function G(t,n,e){const r=n.elevationProvider.getElevation(t.x,t.y,t.z??0,t.spatialReference,"scene")??0,o=l(t);return o.z=r,o.hasZ=!0,o.z=s(o,n,e),o}function q(t,n){if("2d"===t.type)return t=>t;let e=null;return r=>{"start"===r.action&&(e=G(r.mapStart,t,n));const o=G(r.mapEnd,t,n),a=null!=e&&null!=o?{sceneStart:e,sceneEnd:o}:null;return{...r,scenePoints:a}}}export{D as EventPipeline,z as addMapDelta,j as addMapTranslation,M as addScreenDelta,m as constrainToMapAxis,i as createDragEventPipelineCallback,p as createManipulatorDragEventPipeline,R as dragAtLocation,f as dragManipulatedObject,S as dragManipulatedObjectMany,g as resetManipulatedObject,v as resetManipulatedObjectMany,h as resetProperties,U as sceneSnappingAtLocation,q as sceneSnappingAtProjectedLocation,E as screenToMap};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{Evented as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{clone as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasCompatibleTopology as s}from"../../../geometry/support/coordsUtils.js";import{isMeshEditGeometry as i,Part as o,EditGeometry as a}from"./EditGeometry.js";import{AppendVertex as n}from"./operations/AppendVertex.js";import{UpdateVertices as p}from"./operations/UpdateVertices.js";import{RemoveVertices as d}from"./operations/RemoveVertices.js";import{SplitSegment as h}from"./operations/SplitSegment.js";import{SetVertexPosition as c}from"./operations/SetVertexPosition.js";import{ClosePart as u}from"./operations/ClosePart.js";import{MoveMesh as l}from"./operations/MoveMesh.js";import{MoveVertex as m}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as V}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as y}from"./operations/RotateVertex.js";import{ScaleVertex as f}from"./operations/ScaleVertex.js";import{SetAllVertexPositions as v}from"./operations/SetAllVertexPositions.js";import{UndoGroup as _}from"./operations/UndoGroup.js";class g extends e{constructor(e,t,r=!1){super(),this.data=e,this.viewingMode=t,this.allowCurves=r,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",e=>{e.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:e.updatedVertices,operation:e.operation})})}destroy(){super.destroy(),this._listener.remove()}splitSegment(e,t){return this._apply(new h(this.data,e,t))}updateVertices(e,t,r=1){return this._apply(new p(this.data,e,t),r)}move(e,t,r,s=1){return i(this.data)?this._apply(new l(this.data,e,t,r),s):this.moveVertices(this.data.allVerticesUnordered,e,t,r,s)}moveVertices(e,t,r,s,o=1){return i(this.data)?this._apply(new l(this.data,t,r,s),o):this.updateVertices(e,new m(this.data.coordinateHelper,t,r,s),o)}scale(e,t,r,s,i=1,o=0){return this.scaleVertices(this.data.allVerticesUnordered,e,t,r,s,i,o)}scaleVertices(e,t,r,s,i,o=1,a=0){return this.updateVertices(e,new f(t,r,s,i,a),o)}rotate(e,t,r=1,s=0){return this.rotateVertices(this.data.allVerticesUnordered,e,t,r,s)}rotateVertices(e,t,r,s=1,i=0){return this.updateVertices(e,new y(t,r,i),s)}removeVertices(e){return this._apply(new d(this.data,e,this._minNumVerticesPerType))}appendVertex(e,t){return t??=new o(this.data.spatialReference,this.viewingMode),this._apply(new n(this.data,t,e))}appendVertexToFirstPart(e){const t=this.data.parts.at(0);return t?this._apply(new n(this.data,t,e)):null}setVertexPosition(e,t){return this._apply(new c(this.data,e,t))}offsetEdge(e,t,r,s=1){return this.updateVertices([t.leftVertex,t.rightVertex],new V(this.data.coordinateHelper,e,t,r),s)}trySetGeometry(e,t=1){const{data:r}=this,{coordinateHelper:o}=r;if(r.type!==e.type||!r.spatialReference.equals(e.spatialReference)||o.hasZ()!==e.hasZ||o.hasM()!==e.hasM||!s(r.geometry,e)||i(r))return;const n=Array.from(a.fromGeometry(e,this.viewingMode,{allowCurves:this.allowCurves}).iterateVerticesUnordered(),e=>e.pos);return this.setVertexPositions(n,t)}setVertexPositions(e,t=1){return this._apply(new v(this.data,e),t)}createResetState(){if(i(this.data))return this._createResetStateMesh();const e=this.data.geometry.clone();return t(()=>this.trySetGeometry(e))}closePart(e){return this.data.parts.includes(e)?this._apply(new u(this.data,e)):null}canRemoveVertex(e){return e.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new _;return this._apply(e),t(()=>e.close())}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=1){return 0!==t&&null!=this.lastOperation&&this.lastOperation.accumulate(e)||(e.apply(),this._undoStack.push(e),this._redoStack=[]),e}_createResetStateMesh(){if(!i(this.data))return t();const e=this.data.geometry,{vertexSpace:s}=e;if(s.origin){const i=r(s.origin);return t(()=>{e.vertexSpace.origin=i})}const o=e.vertexAttributes.clonePositional();return t(()=>{e.vertexAttributes=o,e.vertexAttributesChanged()})}static fromGeometry(e,t,r){return new g(a.fromGeometry(e,t,r),t,!!r?.allowCurves)}}export{g as EditGeometryOperations};
5
+ import{Evented as e}from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{clone as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{hasCompatibleTopology as s}from"../../../geometry/support/coordsUtils.js";import{isMeshEditGeometry as i,Part as o,EditGeometry as a}from"./EditGeometry.js";import{AppendVertex as n}from"./operations/AppendVertex.js";import{UpdateVertices as p}from"./operations/UpdateVertices.js";import{RemoveVertices as d}from"./operations/RemoveVertices.js";import{SplitSegment as h}from"./operations/SplitSegment.js";import{SetVertexPosition as c}from"./operations/SetVertexPosition.js";import{ClosePart as u}from"./operations/ClosePart.js";import{MoveMesh as l}from"./operations/MoveMesh.js";import{MoveVertex as m}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as V}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as y}from"./operations/RotateVertex.js";import{ScaleVertex as f}from"./operations/ScaleVertex.js";import{SetAllVertexPositions as v}from"./operations/SetAllVertexPositions.js";import{UndoGroup as _}from"./operations/UndoGroup.js";class g extends e{constructor(e,t,r=!1){super(),this.data=e,this.viewingMode=t,this.allowCurves=r,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",e=>{e.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:e.updatedVertices,operation:e.operation})})}destroy(){super.destroy(),this._listener.remove()}splitSegment(e,t){return this._apply(new h(this.data,e,t))}updateVertices(e,t,r=1){return this._apply(new p(this.data,e,t),r)}move(e,t,r,s=1){return i(this.data)?this._apply(new l(this.data,e,t,r),s):this.moveVertices(this.data.allVerticesUnordered,e,t,r,s)}moveVertices(e,t,r,s,o=1){return i(this.data)?this._apply(new l(this.data,t,r,s),o):this.updateVertices(e,new m(this.data.coordinateHelper,t,r,s),o)}scale(e,t,r,s,i=1,o=0){return this.scaleVertices(this.data.allVerticesUnordered,e,t,r,s,i,o)}scaleVertices(e,t,r,s,i,o=1,a=0){return this.updateVertices(e,new f(t,r,s,i,a),o)}rotate(e,t,r=1,s=0){return this.rotateVertices(this.data.allVerticesUnordered,e,t,r,s)}rotateVertices(e,t,r,s=1,i=0){return this.updateVertices(e,new y(t,r,i),s)}removeVertices(e){return this._apply(new d(this.data,e,this._minNumVerticesPerType))}appendVertex(e,t){return t??=new o(this.data.spatialReference,this.viewingMode),this._apply(new n(this.data,t,e))}appendVertexToFirstPart(e){const t=this.data.parts.at(0);return t?this._apply(new n(this.data,t,e)):null}setVertexPosition(e,t){return this._apply(new c(this.data,e,t))}offsetEdge(e,t,r,s=1){return this.updateVertices([t.leftVertex,t.rightVertex],new V(this.data.coordinateHelper,e,t,r),s)}trySetGeometry(e,t=1){const{data:r}=this,{coordinateHelper:o}=r;if(r.type!==e.type||!r.spatialReference.equals(e.spatialReference)||o.hasZ()!==e.hasZ||o.hasM()!==e.hasM||!s(r.geometry,e)||i(r))return;const n=Array.from(a.fromGeometry(e,this.viewingMode,{allowCurves:this.allowCurves}).iterateVerticesUnordered(),e=>e.pos);return this.setVertexPositions(n,t)}setVertexPositions(e,t=1){return this._apply(new v(this.data,e),t)}createResetState(){if(i(this.data))return this._createResetStateMesh();const e=this.data.geometry.clone();return t(()=>this.trySetGeometry(e))}closePart(e){return this.data.parts.includes(e)?this._apply(new u(this.data,e)):null}canRemoveVertex(e){return e.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new _;return this._apply(e),t(()=>e.close())}recordUndo(e){this._undoStack.push(e),this._redoStack=[]}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=1){return 0!==t&&null!=this.lastOperation&&this.lastOperation.accumulate(e)||(e.apply(),this.recordUndo(e)),e}_createResetStateMesh(){if(!i(this.data))return t();const e=this.data.geometry,{vertexSpace:s}=e;if(s.origin){const i=r(s.origin);return t(()=>{e.vertexSpace.origin=i})}const o=e.vertexAttributes.clonePositional();return t(()=>{e.vertexAttributes=o,e.vertexAttributesChanged()})}static fromGeometry(e,t,r){return new g(a.fromGeometry(e,t,r),t,!!r?.allowCurves)}}export{g as EditGeometryOperations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as l}from"../../../core/quantityUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/unitUtils.js";import{u,g as c,G as p}from"../../../chunks/vec32.js";import{UNIT_Z as f,create as m,clone as d,ONES as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as U}from"../keybindings.js";import S from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new S(t());return o.addHandles(a(()=>t(),({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)})),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:l}=t,{transform:a}=o,s=T(a);e&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),e?(n.actual=i(G(a)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),P(t,n,e)}function D(t,o,e){const n=M(t.orientation.actual),r=q(o.rotationAxis);if(null==n||null==r)return;const i=o.rotationAngle,l=n*r,a=(n-i)*r;i!==l&&(e?.onRotateStart(0),o.rotationAngle=l,e?.onRotate(a),e?.onRotateStop(a))}function P(t,o,e){const n=t.scale.actual?.value,r=G(o);if(null==n||n===r)return;const{scale:i}=o;let l;if(0===r)l=d(g);else{const t=n/r;l=c(m(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=l,e?.onScale(l[0],l[1],l[2]),e?.onScaleStop(l[0],l[1],l[2])}function F(t,o){const{x:e,y:r,z:i}=o,{x:l,y:a,z:s}=E(t,o.spatialReference);return{dx:null==l||n(l,e)?0:l-e,dy:null==a||n(a,r)?0:a-r,dz:null==s||null==i||n(s,i)?0:s-i}}function E(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,I):null!=e?e=h(e,0,I)[0]:null!=n&&(n=h(0,n,I)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?l(r,i):void 0}}const I=[0,0];function T(t){if(!t)return 0;const o=q(t.rotationAxis);return null!=o?o*t.rotationAngle:null}function q(t){return p(t,f)?1:p(t,B)?-1:null}const B=u(m(),f);function G(t){return t?Math.max(...t.scale):1}function H(t,o){return!("key-down"!==t.type||t.key!==U.enterInputMode||!o||!O(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function O(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some(({name:t})=>"x"===t||"y"===t?n.coordinates:n[t])}function C(n,r){let i=null;return o([n.on("paste",o=>{i?.abort(),i=t(async()=>{y()||await v(),J(o,n.info,r)})}),t(()=>v()),e(()=>i?.abort())])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r(()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)})}else{const t=A(n);t&&r(()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)})}}export{C as connectPasteEvent,H as enterInputModeIfAvailable,F as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
5
+ import{createTask as t}from"../../../core/asyncUtils.js";import{handlesGroup as o,makeHandle as e}from"../../../core/handleUtils.js";import{floatEqualUlp as n}from"../../../core/mathUtils.js";import{createAngle as r,createScalar as i,valueInUnit as l}from"../../../core/quantityUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{verticalLengthUnitFromSpatialReference as s}from"../../../core/unitUtils.js";import{u,g as c,G as p}from"../../../chunks/vec32.js";import{UNIT_Z as f,create as m,clone as d,ONES as g}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{isLoaded as y,load as v}from"../../../geometry/coordinateFormatter.js";import j from"../../../geometry/support/MeshTransform.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isWebMercator as b}from"../../../geometry/support/spatialReferenceUtils.js";import{lngLatToXY as h}from"../../../geometry/support/webMercatorUtils.js";import{tooltipKeys as U}from"../keybindings.js";import S from"../Tooltip.js";import{parseLatitudeLongitude as w,parseXY as A}from"./fields/parsingAndFormattingUtils.js";import{getDegreesArithmetic as M,getDegreesGeographic as k}from"../../support/angularMeasurementUtils.js";function R(t){const o=new S(t());return o.addHandles(a(()=>t(),({view:t,options:e,info:n})=>{o.view=t,void 0!==e&&(o.options=e),void 0!==n&&(o.info=n)})),o}function V(t,o){const e=x(o.vertexSpace),{scale:n,orientation:l}=t,{transform:a}=o,s=T(a);e&&null!=s?(l.actual=r(s,"degrees","arithmetic"),l.visible=!0):(l.actual=null,l.visible=!1),e?(n.actual=i(G(a)),n.visible=!0):(n.actual=null,n.visible=!1)}function z(t,o,e){if(!o||!x(o.vertexSpace))return;const n=o.transform??=new j;D(t,n,e),P(t,n,e)}function D(t,o,e){const r=M(t.orientation.actual),i=q(o.rotationAxis);if(null==r||null==i)return;const l=r-90,a=o.rotationAngle,s=l*i,u=s-a;n(a,s)||(e?.onRotateStart(0),o.rotationAngle=s,e?.onRotate(u),e?.onRotateStop(u))}function P(t,o,e){const n=t.scale.actual?.value,r=G(o);if(null==n||n===r)return;const{scale:i}=o;let l;if(0===r)l=d(g);else{const t=n/r;l=c(m(),i,t)}e?.onScaleStart(i[0],i[1],i[2]),o.scale=l,e?.onScale(l[0],l[1],l[2]),e?.onScaleStop(l[0],l[1],l[2])}function F(t,o){const{x:e,y:r,z:i}=o,{x:l,y:a,z:s}=E(t,o.spatialReference);return{dx:null==l||n(l,e)?0:l-e,dy:null==a||n(a,r)?0:a-r,dz:null==s||null==i||n(s,i)?0:s-i}}function E(t,o){let e,n;t.geographic?(e=k(t.longitude.actual),n=k(t.latitude.actual),b(o)&&(null!=e&&null!=n?[e,n]=h(e,n,I):null!=e?e=h(e,0,I)[0]:null!=n&&(n=h(0,n,I)[1]))):(e=t.x.actual?.value,n=t.y.actual?.value);const r=t.elevation.actual,i=s(o);return{x:e,y:n,z:null!=i&&null!=r?l(r,i):void 0}}const I=[0,0];function T(t){const o=90;if(!t)return o;const e=q(t.rotationAxis)??1;return null!=e?o+e*t.rotationAngle:null}function q(t){return p(t,f)?1:p(t,B)?-1:null}const B=u(m(),f);function G(t){return t?Math.max(...t.scale):1}function H(t,o){return!("key-down"!==t.type||t.key!==U.enterInputMode||!o||!O(o.info))&&(o.enterInputMode(),t.preventDefault(),t.stopPropagation(),!0)}function O(t){const o=t?.sketchOptions;if(!o)return!1;const{inputEnabled:e,visibleElements:n}=o.tooltips;return e&&!0===t.editableFields.some(({name:t})=>"x"===t||"y"===t?n.coordinates:n[t])}function C(n,r){let i=null;return o([n.on("paste",o=>{i?.abort(),i=t(async()=>{y()||await v(),J(o,n.info,r)})}),t(()=>v()),e(()=>i?.abort())])}function J(t,o,e){if(!o||!("geographic"in o))return;const n=t.clipboardData?.getData("text");if(!n)return;const r=o=>{t.stopPropagation(),t.preventDefault(),e?.onBeforePaste(),o(),e?.onAfterPaste()};if(o.geographic){const t=w(n);t&&r(()=>{o.longitude.applyValue(t.longitude),o.latitude.applyValue(t.latitude)})}else{const t=A(n);t&&r(()=>{o.x.applyValue(t.x),o.y.applyValue(t.y)})}}export{C as connectPasteEvent,H as enterInputModeIfAvailable,F as getXYZDeltasFromTooltipInfo,R as makeTooltip,J as pasteLocation,z as updateMeshTransformFromTooltipInfo,V as updateTooltipInfoFromMeshTransform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{addMultidimensionalFieldValues as a,commonRasterFieldNames as o,rasterFieldPrefix as n}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as l}from"../../layers/support/timeSupport.js";import{isFunctionRaster as u}from"../../layers/support/rasterDatasets/datasetUtils.js";import{getDefaultDatumTransformationForDataset as p,projectDatasetExtent as c,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as y}from"./support/popupUtils.js";const f=f=>{const d=f;let h=class extends d{constructor(...e){super(...e),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return l(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?p(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(e){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,e)}catch{return!1}}async fetchPopupFeaturesAtLocation(e,i){const{layer:s}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:l}=s,p=y(s,i);if(!l||null==p)return[];const c=[],{value:m,magdirValue:f,processedValue:d}=await s.identify(e,{timeExtent:this.timeExtent,signal:i?.signal});let h="";if(m?.length){h="imagery-tile"===s.type&&s.hasStandardTime()&&null!=m[0]?m.map(e=>s.getStandardTimeValue(e)).join(", "):m.join(", ");const e={ObjectId:0};e[o.servicePixelValue]="imagery-tile"===s.type&&u(s.raster)?d?.join(", "):h,e[o.rawServicePixelValue]=h;const r=s.raster?.rasterInfo??s.serviceRasterInfo,i=r?.attributeTable;if(null!=i){const{fields:t,features:r}=i,s=t.find(({name:e})=>"value"===e.toLowerCase()),a=e[o.servicePixelValue],l=s?r.find(e=>String(e.attributes[s.name])===a):null;if(l)for(const i in l.attributes)if(l.attributes.hasOwnProperty(i)){e[n+i]=l.attributes[i]}}const l=r?.dataType;"vector-magdir"!==l&&"vector-uv"!==l||(e[o.magnitude]=f?.[0],e[o.direction]=f?.[1]);const{multidimensionalDefinition:p}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});a(s.rasterFields,e,p);const{graphicOrigin:y}=s,g=new t({geometry:this.fullExtent?.clone(),attributes:e,layer:s,origin:y,sourceLayer:s});c.push(g)}return c}async getSourceScale(){return await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return e([i()],h.prototype,"fullExtent",null),e([i()],h.prototype,"layer",void 0),e([i({readOnly:!0})],h.prototype,"timeExtent",null),e([i()],h.prototype,"tileInfo",void 0),e([i({readOnly:!0})],h.prototype,"hasTilingEffects",null),e([i()],h.prototype,"datumTransformation",null),h=e([s("esri.views.layers.ImageryTileLayerView")],h),h};export{f as default};
5
+ import{__decorate as t}from"tslib";import e from"../../Graphic.js";import r from"../../core/Error.js";import{property as i}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{addMultidimensionalFieldValues as a,commonRasterFieldNames as o,rasterFieldPrefix as n}from"../../layers/support/rasterFieldUtils.js";import{combineTimeExtent as l}from"../../layers/support/timeSupport.js";import{isFunctionRaster as u}from"../../layers/support/rasterDatasets/datasetUtils.js";import{getDefaultDatumTransformationForDataset as p,projectDatasetExtent as c,getSourceScale as m}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as y}from"./support/popupUtils.js";const f=f=>{const h=f;let d=class extends h{constructor(...t){super(...t),this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return l(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){const{renderer:t}=this.layer;return!!("raster-stretch"===t?.type&&t.dynamicRangeAdjustment&&!("min-max"===t.stretchType||"standard-deviation"===t.stretchType))}get datumTransformation(){try{return this.layer.loaded?p(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(t){try{return!this.layer.loaded||!!c(this.layer.serviceRasterInfo,t)}catch{return!1}}async fetchPopupFeaturesAtLocation(t,i){const{layer:s}=this;if(!t)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:l}=s,p=y(s,i);if(!l||null==p)return[];const c=[],{value:m,magdirValue:f,processedValue:h}=await s.identify(t,{timeExtent:this.timeExtent,signal:i?.signal});let d="";if(m?.length){d="imagery-tile"===s.type&&s.hasStandardTime()&&null!=m[0]?m.map(t=>s.getStandardTimeValue(t)).join(", "):m.join(", ");const t={ObjectId:0};t[o.servicePixelValue]="imagery-tile"===s.type&&u(s.raster)?h?.join(", "):d,t[o.rawServicePixelValue]=d;const r=s.raster?.rasterInfo??s.serviceRasterInfo,i=r?.attributeTable;if(null!=i){const{fields:e,features:r}=i,s=e.find(({name:t})=>"value"===t.toLowerCase()),a=t[o.servicePixelValue],l=s?r.find(t=>String(t.attributes[s.name])===a):null;if(l)for(const i in l.attributes)if(l.attributes.hasOwnProperty(i)){t[n+i]=l.attributes[i]}}const l=r?.dataType;"vector-magdir"!==l&&"vector-uv"!==l||(t[o.magnitude]=f?.[0],t[o.direction]=f?.[1]);const{multidimensionalDefinition:p}=this.layer.normalizeRasterFetchOptions({timeExtent:this.timeExtent});a(s.rasterFields,t,p);const{graphicOrigin:y}=s,g=new e({geometry:this.fullExtent?.clone(),attributes:t,layer:s,origin:y,sourceLayer:s});c.push(g)}return c}async getSourceScale(){return await this.layer.load(),m(this.layer.serviceRasterInfo,this.view.spatialReference)}_getFullExtent(){return c(this.layer.serviceRasterInfo,this.view.spatialReference)}};return t([i()],d.prototype,"fullExtent",null),t([i()],d.prototype,"layer",void 0),t([i({readOnly:!0})],d.prototype,"timeExtent",null),t([i()],d.prototype,"tileInfo",void 0),t([i({readOnly:!0})],d.prototype,"hasTilingEffects",null),t([i()],d.prototype,"datumTransformation",null),d=t([s("esri.views.layers.ImageryTileLayerView")],d),d};export{f as default};