@arcgis/core 4.33.0-next.20250408 → 4.33.0-next.20250410

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 (347) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/066844a51cd22cbef0e6.js +1 -0
  3. package/assets/esri/core/workers/chunks/067dda58592fbf4fb812.js +1 -0
  4. package/assets/esri/core/workers/chunks/{1595f3def0ba0c4f0fe7.js → 0eed612e82a279ac8d1e.js} +1 -1
  5. package/assets/esri/core/workers/chunks/1014513c0ec85f9414a4.js +1 -0
  6. package/assets/esri/core/workers/chunks/1072b4f37eacbbfda2c8.js +1 -0
  7. package/assets/esri/core/workers/chunks/{19eb465f91d07862926a.js → 1263391920fbb8926ced.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{49d6b56e21b1bc0d1948.js → 1b87fa15470cce26feea.js} +1 -1
  9. package/assets/esri/core/workers/chunks/23de8aeed5b82c682cbe.js +1 -0
  10. package/assets/esri/core/workers/chunks/{6f9a17f62786af04b74e.js → 25a686f00479ac12a1ca.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{f92d521ed3df3c9f737b.js → 26fcbe053194bd78fcc3.js} +1 -1
  12. package/assets/esri/core/workers/chunks/277b61af8982092a4c81.js +1 -0
  13. package/assets/esri/core/workers/chunks/{7b47b08f4a58898273b9.js → 2ab7d36409e9af3ac3da.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{c3c70dad8c8a93953237.js → 2cbab0c078d0b844934c.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{2679da0c93f05ae956c6.js → 358a3a9326615d5e6d3b.js} +1 -1
  16. package/assets/esri/core/workers/chunks/37e4f588a6896f98bce3.js +1 -0
  17. package/assets/esri/core/workers/chunks/3b7284516a0e34a9e85e.js +1 -0
  18. package/assets/esri/core/workers/chunks/3f6dc811b5d515c2725c.js +1 -0
  19. package/assets/esri/core/workers/chunks/{8ef755e6a7b2b71f46e6.js → 400f95295bbfced31076.js} +1 -1
  20. package/assets/esri/core/workers/chunks/4046ec636723c20d3e28.js +1 -0
  21. package/assets/esri/core/workers/chunks/4275dcec730a11173661.js +1 -0
  22. package/assets/esri/core/workers/chunks/{0747c9542172241b52ab.js → 436623d9bcf62b8dba47.js} +1 -1
  23. package/assets/esri/core/workers/chunks/4403b3f08907e88d0d91.js +1 -0
  24. package/assets/esri/core/workers/chunks/4523ba4a3c8987abca56.js +1 -0
  25. package/assets/esri/core/workers/chunks/47bbfc10c2a3b9e4bdd6.js +1 -0
  26. package/assets/esri/core/workers/chunks/4a15308b54734247f38e.js +1 -0
  27. package/assets/esri/core/workers/chunks/{d65c30cd787b287833fb.js → 4ba34124054752b363c0.js} +1 -1
  28. package/assets/esri/core/workers/chunks/4baef5262ce401bf81bb.js +1 -0
  29. package/assets/esri/core/workers/chunks/{3b2bda2e8c08f486de27.js → 4bbe6160eda3fb5d58ec.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{52b28aab40bb19e585bb.js → 566c2ce50af225e556ac.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{948a3c1419ae323cca10.js → 5c757e20c0543e6a49b3.js} +1 -1
  32. package/assets/esri/core/workers/chunks/5df4e73905c0ae75e37c.js +1 -0
  33. package/assets/esri/core/workers/chunks/626e33ece2c49d40f6cd.js +1 -0
  34. package/assets/esri/core/workers/chunks/66e90f7d473d1f688254.js +1 -0
  35. package/assets/esri/core/workers/chunks/72097a8247101018dcdf.js +1 -0
  36. package/assets/esri/core/workers/chunks/72b5e43741ce3a0da8f7.js +1 -0
  37. package/assets/esri/core/workers/chunks/72d7e45e7eb28f2cc0b0.js +1 -0
  38. package/assets/esri/core/workers/chunks/759c12b0715279e3c0f6.js +1 -0
  39. package/assets/esri/core/workers/chunks/796cf1c2ca9955595836.js +1 -0
  40. package/assets/esri/core/workers/chunks/{23cc33576da66b3c4366.js → 7ea5bbb52e84be9a608e.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{79036c5d7569c4e94abe.js → 7ef9bcd58af499a14a08.js} +1 -1
  42. package/assets/esri/core/workers/chunks/80427cd9f0c2e07f21c3.js +1 -0
  43. package/assets/esri/core/workers/chunks/80a5fd4fb79e90086538.js +1 -0
  44. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +1 -0
  45. package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +1 -0
  46. package/assets/esri/core/workers/chunks/{89e7cc489156ff0ebdb6.js → 8aae03e347ab18ae6ee2.js} +1 -1
  47. package/assets/esri/core/workers/chunks/8ddf1b85cff90c34f3e3.js +1 -0
  48. package/assets/esri/core/workers/chunks/{7f961954e59a232bfa88.js → 90442f47c9f31f26b453.js} +1 -1
  49. package/assets/esri/core/workers/chunks/9050dad7e4f093568026.js +1 -0
  50. package/assets/esri/core/workers/chunks/{aaf67ec3d580e1fee6c7.js → 90c893959145827961ac.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{238df0aee97315623638.js → 91439b59260b0fb04be9.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{4de3d692557120a4bbf7.js → 95379fdd6917c8a84c71.js} +1 -1
  53. package/assets/esri/core/workers/chunks/999a4f7ca581f28cc1c4.js +1 -0
  54. package/assets/esri/core/workers/chunks/a3421383e48379012c9c.js +1 -0
  55. package/assets/esri/core/workers/chunks/a91f2d1deb950f46ad09.js +1 -0
  56. package/assets/esri/core/workers/chunks/{a32e697547f8ac345dd7.js → af9fda47d02c51a2c7da.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{9a84ff99756c7247dd39.js → b308bef7ff08e0e635b5.js} +82 -82
  58. package/assets/esri/core/workers/chunks/{5c80452df87024fdaa75.js → b7a1185ac49480fc1410.js} +1 -1
  59. package/assets/esri/core/workers/chunks/bd0dbad694ce5531deab.js +1 -0
  60. package/assets/esri/core/workers/chunks/{6c65b966f4c952508fc1.js → c589d32f8efcca6bf712.js} +1 -1
  61. package/assets/esri/core/workers/chunks/c6580fdcdc33153008b0.js +1 -0
  62. package/assets/esri/core/workers/chunks/{86b4920f5a99576399fb.js → ccb289911e7445b17763.js} +2 -2
  63. package/assets/esri/core/workers/chunks/{6d15d953baabccbbee01.js → cda6ae4c5cb67e22b454.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{ac91bd1fee9ddadc270b.js → d2c7067bb6654c0e2793.js} +1 -1
  65. package/assets/esri/core/workers/chunks/d3b0117ad9232e36f785.js +1 -0
  66. package/assets/esri/core/workers/chunks/d46c82a55219b27c301b.js +1 -0
  67. package/assets/esri/core/workers/chunks/d89f105b8a0b13dd8e5f.js +1 -0
  68. package/assets/esri/core/workers/chunks/{14d1a970e927ebfed9c8.js → d9b2263e0a9f9068ab62.js} +1 -1
  69. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +1 -0
  70. package/assets/esri/core/workers/chunks/df1225a3e751a662c182.js +1 -0
  71. package/assets/esri/core/workers/chunks/e08bff9f8247909776a4.js +1 -0
  72. package/assets/esri/core/workers/chunks/e13caf9691f556071e31.js +1 -0
  73. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +1 -0
  74. package/assets/esri/core/workers/chunks/e5aff9b10877fb04d6de.js +1 -0
  75. package/assets/esri/core/workers/chunks/e64bc4533405af8554ae.js +1 -0
  76. package/assets/esri/core/workers/chunks/{2d5cb817e6e905103068.js → e6544e966f14fb410157.js} +1 -1
  77. package/assets/esri/core/workers/chunks/e792603b7cc3ddd133f3.js +1 -0
  78. package/assets/esri/core/workers/chunks/{69e606267dc5842ebf9d.js → ec83af4fb3bf59df7759.js} +1 -1
  79. package/assets/esri/core/workers/chunks/f5fcba6ca6f43bf1d65d.js +1 -0
  80. package/assets/esri/core/workers/chunks/f7d33d18bf1bd4db9df8.js +1 -0
  81. package/assets/esri/core/workers/chunks/f9396af9cbfd165e72e2.js +1 -0
  82. package/assets/esri/core/workers/chunks/{393fbd296817e813936c.js → fa9ef9e8eae505371965.js} +1 -1
  83. package/assets/esri/libs/dxtEncoder/dxt_encoder.wasm +0 -0
  84. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  85. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
  86. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
  87. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
  88. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
  89. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
  90. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
  91. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
  92. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
  93. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
  94. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
  95. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
  96. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
  97. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
  98. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
  99. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
  100. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
  101. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
  102. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
  103. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
  104. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
  105. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
  106. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
  107. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_no.json +1 -1
  108. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
  109. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
  110. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
  111. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
  112. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
  113. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
  114. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
  115. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
  116. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
  117. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
  118. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
  119. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
  120. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
  121. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
  122. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
  123. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
  124. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  125. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  126. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  127. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  128. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ar.json +1 -1
  129. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bg.json +1 -1
  130. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bs.json +1 -1
  131. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ca.json +1 -1
  132. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_cs.json +1 -1
  133. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_da.json +1 -1
  134. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_de.json +1 -1
  135. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_el.json +1 -1
  136. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_es.json +1 -1
  137. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_et.json +1 -1
  138. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fi.json +1 -1
  139. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fr.json +1 -1
  140. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_he.json +1 -1
  141. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hr.json +1 -1
  142. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hu.json +1 -1
  143. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_id.json +1 -1
  144. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_it.json +1 -1
  145. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ja.json +1 -1
  146. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ko.json +1 -1
  147. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lt.json +1 -1
  148. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lv.json +1 -1
  149. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_nl.json +1 -1
  150. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_no.json +1 -1
  151. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pl.json +1 -1
  152. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-BR.json +1 -1
  153. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-PT.json +1 -1
  154. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ro.json +1 -1
  155. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ru.json +1 -1
  156. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sk.json +1 -1
  157. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sl.json +1 -1
  158. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sr.json +1 -1
  159. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sv.json +1 -1
  160. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_th.json +1 -1
  161. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_tr.json +1 -1
  162. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_uk.json +1 -1
  163. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_vi.json +1 -1
  164. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-CN.json +1 -1
  165. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-HK.json +1 -1
  166. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-TW.json +1 -1
  167. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  168. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  169. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  170. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  171. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  172. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  173. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  174. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  175. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  176. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  177. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  178. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  179. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  180. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  181. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  182. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  183. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  184. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  185. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  186. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  187. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  188. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  189. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  190. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  191. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  192. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  193. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  194. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  195. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  196. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  197. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  198. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  199. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  200. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  201. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  202. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  203. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  204. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  205. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  206. package/assets/esri/widgets/LayerList/t9n/LayerList_ar.json +1 -1
  207. package/assets/esri/widgets/LayerList/t9n/LayerList_bg.json +1 -1
  208. package/assets/esri/widgets/LayerList/t9n/LayerList_bs.json +1 -1
  209. package/assets/esri/widgets/LayerList/t9n/LayerList_ca.json +1 -1
  210. package/assets/esri/widgets/LayerList/t9n/LayerList_cs.json +1 -1
  211. package/assets/esri/widgets/LayerList/t9n/LayerList_da.json +1 -1
  212. package/assets/esri/widgets/LayerList/t9n/LayerList_de.json +1 -1
  213. package/assets/esri/widgets/LayerList/t9n/LayerList_el.json +1 -1
  214. package/assets/esri/widgets/LayerList/t9n/LayerList_es.json +1 -1
  215. package/assets/esri/widgets/LayerList/t9n/LayerList_et.json +1 -1
  216. package/assets/esri/widgets/LayerList/t9n/LayerList_fi.json +1 -1
  217. package/assets/esri/widgets/LayerList/t9n/LayerList_fr.json +1 -1
  218. package/assets/esri/widgets/LayerList/t9n/LayerList_he.json +1 -1
  219. package/assets/esri/widgets/LayerList/t9n/LayerList_hr.json +1 -1
  220. package/assets/esri/widgets/LayerList/t9n/LayerList_hu.json +1 -1
  221. package/assets/esri/widgets/LayerList/t9n/LayerList_id.json +1 -1
  222. package/assets/esri/widgets/LayerList/t9n/LayerList_it.json +1 -1
  223. package/assets/esri/widgets/LayerList/t9n/LayerList_ja.json +1 -1
  224. package/assets/esri/widgets/LayerList/t9n/LayerList_ko.json +1 -1
  225. package/assets/esri/widgets/LayerList/t9n/LayerList_lt.json +1 -1
  226. package/assets/esri/widgets/LayerList/t9n/LayerList_lv.json +1 -1
  227. package/assets/esri/widgets/LayerList/t9n/LayerList_nl.json +1 -1
  228. package/assets/esri/widgets/LayerList/t9n/LayerList_no.json +1 -1
  229. package/assets/esri/widgets/LayerList/t9n/LayerList_pl.json +1 -1
  230. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-BR.json +1 -1
  231. package/assets/esri/widgets/LayerList/t9n/LayerList_pt-PT.json +1 -1
  232. package/assets/esri/widgets/LayerList/t9n/LayerList_ro.json +1 -1
  233. package/assets/esri/widgets/LayerList/t9n/LayerList_ru.json +1 -1
  234. package/assets/esri/widgets/LayerList/t9n/LayerList_sk.json +1 -1
  235. package/assets/esri/widgets/LayerList/t9n/LayerList_sl.json +1 -1
  236. package/assets/esri/widgets/LayerList/t9n/LayerList_sr.json +1 -1
  237. package/assets/esri/widgets/LayerList/t9n/LayerList_sv.json +1 -1
  238. package/assets/esri/widgets/LayerList/t9n/LayerList_th.json +1 -1
  239. package/assets/esri/widgets/LayerList/t9n/LayerList_tr.json +1 -1
  240. package/assets/esri/widgets/LayerList/t9n/LayerList_uk.json +1 -1
  241. package/assets/esri/widgets/LayerList/t9n/LayerList_vi.json +1 -1
  242. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-CN.json +1 -1
  243. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-HK.json +1 -1
  244. package/assets/esri/widgets/LayerList/t9n/LayerList_zh-TW.json +1 -1
  245. package/chunks/BlendLayers.glsl.js +1 -5
  246. package/chunks/Theme.js +1 -1
  247. package/chunks/bundle.js +5 -0
  248. package/chunks/dxt_encoder.js +1 -1
  249. package/interfaces.d.ts +15 -0
  250. package/layers/ParquetLayer.js +1 -1
  251. package/layers/graphics/data/QueryEngineResult.js +1 -1
  252. package/layers/graphics/data/executeQueryForSnapping.js +1 -1
  253. package/layers/mixins/ImageryTileMixin.js +1 -1
  254. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  255. package/layers/support/arcgisLayerUrl.js +1 -1
  256. package/layers/support/rasterDatasets/RawBlockCache.js +1 -1
  257. package/layers/support/rasterFunctions/RemapFunction.js +1 -1
  258. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  259. package/libs/parquet/loadParquetModule.js +5 -0
  260. package/libs/parquet/parquet.js +1 -1
  261. package/package.json +1 -1
  262. package/support/revision.js +1 -1
  263. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  264. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  265. package/views/3d/layers/ElevationLayerView3DModifications.js +5 -0
  266. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  267. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  268. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  269. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  270. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  271. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  272. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  273. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  274. package/views/3d/terrain/PriorityQueue.js +5 -0
  275. package/views/3d/terrain/TerrainRenderer.js +1 -1
  276. package/views/3d/terrain/TerrainSurface.js +1 -1
  277. package/views/3d/terrain/Tile.js +1 -1
  278. package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +7 -12
  279. package/views/3d/webgl-engine/core/shaderLibrary/util/BlendLayers.glsl.js +1 -1
  280. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  281. package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
  282. package/views/SceneView.js +1 -1
  283. package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
  284. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  285. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  286. package/views/interactive/snapping/snappingUtils.js +1 -1
  287. package/views/support/TextureCompressionWorker.js +1 -1
  288. package/views/support/TextureCompressionWorkerHandle.js +1 -1
  289. package/views/webgl/Texture.js +1 -1
  290. package/views/webgl/textureUtils.js +1 -1
  291. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  292. package/widgets/ElevationProfile.js +1 -1
  293. package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
  294. package/widgets/Feature/FeatureViewModel.js +1 -1
  295. package/widgets/Feature.js +1 -1
  296. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  297. package/widgets/Popup.js +1 -1
  298. package/assets/esri/core/workers/chunks/07236fe57d76b1134cd4.js +0 -1
  299. package/assets/esri/core/workers/chunks/0d37c6aa261c8d5e5b23.js +0 -1
  300. package/assets/esri/core/workers/chunks/0d7c1de47ae006277b76.js +0 -1
  301. package/assets/esri/core/workers/chunks/11b725421a823f6183a2.js +0 -1
  302. package/assets/esri/core/workers/chunks/11badb73d43059374ad8.js +0 -1
  303. package/assets/esri/core/workers/chunks/1c8cdae7736b6c907d95.js +0 -1
  304. package/assets/esri/core/workers/chunks/1cc4fc3353d217632a1b.js +0 -1
  305. package/assets/esri/core/workers/chunks/3a649aa78e25e3c8aa8c.js +0 -1
  306. package/assets/esri/core/workers/chunks/3e1bb914aceb3a9af898.js +0 -1
  307. package/assets/esri/core/workers/chunks/3ee77b601fb0f3567e87.js +0 -1
  308. package/assets/esri/core/workers/chunks/43a3b1b78d214aadaaad.js +0 -1
  309. package/assets/esri/core/workers/chunks/49d03bdaa9c4476b69d6.js +0 -1
  310. package/assets/esri/core/workers/chunks/4c765464288b6d096d08.js +0 -1
  311. package/assets/esri/core/workers/chunks/4cbd5303f5a5a5fff391.js +0 -1
  312. package/assets/esri/core/workers/chunks/55cc40d1b1853f779d82.js +0 -1
  313. package/assets/esri/core/workers/chunks/56e9dfd62102c32b9770.js +0 -1
  314. package/assets/esri/core/workers/chunks/576bed289aa7be03f319.js +0 -1
  315. package/assets/esri/core/workers/chunks/5ef6acd36629eae225da.js +0 -1
  316. package/assets/esri/core/workers/chunks/63ce66da1a52d6d07ccb.js +0 -1
  317. package/assets/esri/core/workers/chunks/6447d373a43ef6cd46cd.js +0 -1
  318. package/assets/esri/core/workers/chunks/64824ee75c643cee2aa9.js +0 -1
  319. package/assets/esri/core/workers/chunks/6a067a6ce0968d893142.js +0 -1
  320. package/assets/esri/core/workers/chunks/6a70b858e24d98845041.js +0 -1
  321. package/assets/esri/core/workers/chunks/6ecf2924f9f6aac61101.js +0 -1
  322. package/assets/esri/core/workers/chunks/77334c3fed1e3a06d307.js +0 -1
  323. package/assets/esri/core/workers/chunks/877f665c7edb26c147ea.js +0 -1
  324. package/assets/esri/core/workers/chunks/8c5619fdf125a459281d.js +0 -1
  325. package/assets/esri/core/workers/chunks/8e64687ee76e70deeb29.js +0 -1
  326. package/assets/esri/core/workers/chunks/8fe36b06a7eceeb874e9.js +0 -1
  327. package/assets/esri/core/workers/chunks/9fddd759c308d3d5801a.js +0 -1
  328. package/assets/esri/core/workers/chunks/a29e99328d75b6ceb74d.js +0 -1
  329. package/assets/esri/core/workers/chunks/a426152e7eb550b8f15f.js +0 -1
  330. package/assets/esri/core/workers/chunks/ae7c1e34ed1288773ec2.js +0 -1
  331. package/assets/esri/core/workers/chunks/ae9ebc0c0553e57e85ba.js +0 -1
  332. package/assets/esri/core/workers/chunks/b199508eef1eeee72854.js +0 -1
  333. package/assets/esri/core/workers/chunks/b715fa857391931c04b9.js +0 -1
  334. package/assets/esri/core/workers/chunks/c144e00dfe6d63eaa2b1.js +0 -1
  335. package/assets/esri/core/workers/chunks/c150cd2a82260495e9de.js +0 -1
  336. package/assets/esri/core/workers/chunks/c4425d5227f7e2379b0f.js +0 -1
  337. package/assets/esri/core/workers/chunks/c837379b36cf716d6215.js +0 -1
  338. package/assets/esri/core/workers/chunks/c849e3e151d78a061bf0.js +0 -1
  339. package/assets/esri/core/workers/chunks/cb83fcfff8731c88c108.js +0 -1
  340. package/assets/esri/core/workers/chunks/cc366e4df91cf516d1b9.js +0 -1
  341. package/assets/esri/core/workers/chunks/ccd3f9b52006cd7dd11e.js +0 -1
  342. package/assets/esri/core/workers/chunks/d72d44df7e117e26e717.js +0 -1
  343. package/assets/esri/core/workers/chunks/e22cdfce2a0583f3cc50.js +0 -1
  344. package/assets/esri/core/workers/chunks/f086993f8744209d761f.js +0 -1
  345. package/assets/esri/core/workers/chunks/fde544c090cc04581536.js +0 -1
  346. package/assets/esri/core/workers/chunks/fe2c48de24b25c45b3e7.js +0 -1
  347. package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{clamp as e}from"../../../core/mathUtils.js";import{abortMaybe as t}from"../../../core/maybe.js";import i from"../../../core/ObjectPool.js";import{d as s,k as n,f as r,h as a,g as l,l as o,c as h}from"../../../chunks/vec32.js";import{create as d,unitZ as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{create as g,equals as p}from"../../../geometry/support/aaBoundingRect.js";import{c as f,a as _}from"../../../chunks/sphere.js";import{isGroupLayer as m}from"../../../layers/support/layerUtils.js";import{ElevationBounds as y}from"./ElevationBounds.js";import{ElevationTileAgent as M,isElevationTileAgent as A}from"./ElevationTileAgent.js";import{TextureUpdate as v}from"./interfaces.js";import{LayerClasses as T,LayerClass as E}from"./LayerClass.js";import{MapTileAgent as D,isMapTileAgent as I}from"./MapTileAgent.js";import{NeighborIndex as L}from"./NeighborIndex.js";import{maxPatchTesselation as x}from"./TerrainConst.js";import{isVectorTile as O,isTileTexture as S,isRasterTile as N,isImageWithType as b}from"./TerrainData.js";import{weakAssert as U,isBlendableLayerView as j,oppositeCorner as P,internalAssert as B,enableTerrainInternalChecks as C,neighborEdgeIndices as R,oppositeEdge as w,neighborCornerIndices as V,isNorth as G,isSouth as q,isWest as F,isEast as H,almostEquals as W,enableWaterproofTests as k,isWestCorner as X,isNorthCorner as Y}from"./terrainUtils.js";import{tileAgentDone as z}from"./TileAgent.js";import{TileFrustumVisibility as J}from"./TileFrustumVisibility.js";import{TilePerLayerInfo as $}from"./TilePerLayerInfo.js";import{TileUpdate as Q}from"./TileUpdate.js";import{fallsWithinLayerView as K}from"./tileUtils.js";const Z=.1;class ee{constructor(){this._lij=[0,0,0],this._children=[null,null,null,null],this._pendingUpdates=0,this.renderData=null,this._dirty=!0,this._previouslyRendered=!1,this.extent=g(),this._elevationBoundsMin=NaN,this._elevationBoundsMax=0,this.layerInfo=[[],[]],this.extentInRadians=g(),this.centerAtSeaLevel=d(),this._center=[d(),f(),d()],this.up=u(),this._withinClippingArea=!0,this._intersectsClippingArea=!0,this._maxTesselation=0,this._usedMemory=0,this._rasterTileMemory=0,this._vectorTileMemory=0,this._mapDataRefCount=0,this.screenDepth=0,this.renderOrder=0,this._edgeLen=0,this._edgeLen2=0,this._curvatureHeight=0,this.onCompressionFinished=()=>{this.setPendingUpdate(Q.TEXTURE_NOFADING),this.setMemoryDirty()},this.extentMidX=0,this.extentMidY=0,this.distanceToPOI=-1,this._lastPOI=d(),this.maxLevelDeltaNeighborCount=0,this.unmergableChildCount=0}get lij(){return this._lij}get elevationLevelDelta(){return this._surface.getElevationLevelDelta(this.level)}static prune(){se.prune(0),ne.prune(0),$.prune()}get _cached(){return!this.leaf&&this._mapDataRefCount<=0}get withinClippingArea(){return this._withinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBoundsMin(){return this._elevationBoundsMin}get elevationBoundsMax(){return this._elevationBoundsMax}get level(){return this._lij[0]}get key(){return`${this._lij[0]}/${this._lij[1]}/${this._lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[ae.MIDDLE][3]}get visible(){return this._dirty&&this.computeVisibility(),this._visible}get frustumVisibility(){return this._dirty&&this.computeVisibility(),this._frustumVisibility}computeVisibility(){this._dirty=!1;const e=this.parent,t=e?.frustumVisibility??J.INTERSECTS;this._frustumVisibility=t===J.INSIDE?J.INSIDE:t===J.OUTSIDE?J.OUTSIDE:this._calculateFrustumVisibility(this.surface.frustum);const i=this._frustumVisibility!==J.OUTSIDE&&this._intersectsClippingArea;i!==this._visible&&(this._visible=i,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setDirty(),this.updateAgentSuspension())}get _loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const e=!!this.renderData;return e!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=e,this._surface.renderer.setDirty()),e}init(e,t,i,s,n){this._lij[0]=e,this._lij[1]=t,this._lij[2]=i,this.ellipsoid=c(n.tilingScheme.spatialReference),n.tilingScheme.getExtent(e,t,i,this.extent),n.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians),this.extentMidX=.5*(this.extent[0]+this.extent[2]),this.extentMidY=.5*(this.extent[1]+this.extent[3]),this._withinClippingArea=!0,this._intersectsClippingArea=!0,this._clippingArea=null,this._mapDataRefCount=0,n.upsampleMapCache.pop(this.key),this._edgeLen=0,this._edgeLen2=0,this._center[ae.MIDDLE][3]=0,this.elevationLevel=e,s&&!Number.isNaN(s.elevationBoundsMin)?(this._elevationBoundsMin=s.elevationBoundsMin,this._elevationBoundsMax=s.elevationBoundsMax):(this._elevationBoundsMin=0,this._elevationBoundsMax=0),this._pendingUpdates=0,this.renderData=null,this.screenDepth=0,this._visible=!1,this._previouslyRendered=!1,this._parent=s,this.clearChildren(),this._surface=n,this.updateVisibility(),this.maxLevelDeltaNeighborCount=0,this.unmergableChildCount=0;for(const r of T){const e=n.numLayers(r),t=this.layerInfo[r];for(const i of t)i.release();t.length=e;for(let i=0;i<e;i++)t[i]=$.acquire(this._surface.upsampleInfoPool),r===E.ELEVATION&&this.findElevationBoundsForLayer(i,-1)}this.computeElevationBounds(),this._maxTesselation=Math.min(n.tilingScheme.pixelSize,x)}dispose(){null!=this._surface&&(U(!this.renderData,"tile.renderData was not unloaded"),this._surface.upsampleMapCache.pop(this.key),this.layerInfo.forEach((e=>{e.forEach((e=>e.release())),e.length=0})),this._surface=this._parent=null,this.clearChildren(),this.setMemoryDirty())}refMapData(){++this._mapDataRefCount,this._cached||this._surface.upsampleMapCache.pop(this.key)}unrefMapData(){--this._mapDataRefCount,this._cached&&this.cachedMemory>0&&this._surface.upsampleMapCache.put(this.key,this)}setMemoryDirty(){this._usedMemory=0}get usedMemory(){return this._ensureUsedMemory()+(this._cached?0:this._mapTileMemory)}get cachedMemory(){return this._ensureUsedMemory(),null==this._surface?this.usedMemory:this._cached?this._mapTileMemory:0}get _mapTileMemory(){return this._rasterTileMemory+this._vectorTileMemory}get _cpuImageMemorySize(){const e=4,t=this._surface.tilingScheme.pixelSize;return t*t*e}_ensureUsedMemory(){if(this._usedMemory>0)return this._vectorTileMemory=this.layerInfo[E.MAP].reduce(((e,{data:t})=>e+(O(t)?t.usedMemoryPerReference:0)),0),this._usedMemory;this._usedMemory=this._baseUsedMemory,this._rasterTileMemory=0,this._vectorTileMemory=0;for(const{data:e}of this.layerInfo[E.MAP])O(e)?this._vectorTileMemory+=e.usedMemoryPerReference:this._rasterTileMemory+=this.getTerrainDataMemory(e);for(const e of this.layerInfo[E.ELEVATION])this._usedMemory+=e.data?this._cpuImageMemorySize:0;return this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._rasterTileMemory+=this.renderData.texture?.cachedMemory??0),this._cached&&this._surface.upsampleMapCache.updateSize(this.key,this),this._usedMemory}getUsedMemoryForLayer(e,t){const i=this.layerInfo[e][t];return i?.data?e===E.MAP?this._cached?0:this.getTerrainDataMemory(i.data):e===E.ELEVATION?this._cpuImageMemorySize:0:0}getTerrainDataMemory(e){return S(e)?e.texture.usedMemory:N(e)?e.memoryUsage:O(e)?e.usedMemoryPerReference:b(e)||e instanceof HTMLImageElement?this._cpuImageMemorySize:0}updateScreenDepth(e){const t=this._center[ae.MIDDLE],i=e,s=t[0],n=t[1],r=t[2],a=i[2]*s+i[6]*n+i[10]*r+i[14];this.screenDepth=a<0?0:a/(i[3]*s+i[7]*n+i[11]*r+i[15])}shouldSplit(e,t,i){if(!this.visible)return Q.NONE;if(e.frustum&&(!this._intersectsClippingArea||this._calculateFrustumVisibility(e.frustum)===J.OUTSIDE))return Q.NONE;const h=this.level;s(ce,_(this._center[ae.MIDDLE]),t);let d=n(ce),u=ce,c=_(this._center[ae.MIDDLE]);s(ge,this._center[ae.TOP],t);const g=n(ge);g<d&&(d=g,u=ge,c=this._center[ae.TOP]),s(pe,this._center[ae.BOTTOM],t);const p=n(pe);if(p<d&&(d=p,u=pe,c=this._center[ae.BOTTOM]),this._edgeLen2>d&&h<e.maxLod)return Q.SPLIT;const f=Math.sqrt(d),m=e.fovX*f*2,y=this._edgeLen/m,M=()=>{if(h<e.maxLod)return this.elevationLevel=h,Q.NONE;const t=h+Math.ceil(-Math.log2(e.relativeWidthLimit/y));return t!==this.elevationLevel?(this.elevationLevel=t,Q.ELEVATION):Q.NONE},A=null!=i?i-h:1/0;if(A<=.5)return M();const v=r(this.up,ce),T=this._elevationBoundsMax-this._elevationBoundsMin,E=T/this.edgeLen;if(e.aboveGround&&v>0&&E<.001){if(v/f-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-E>0)return Q.NONE}const D=null!=i?3-Math.min(A,2):1;if(y*D<e.relativeWidthLimit||h>=e.maxLod)return M();if(h<7)return Q.SPLIT;a(fe,this.up,v),s(fe,fe,u);const I=n(fe);if(I<=this.radius*this.radius)return Q.SPLIT;a(fe,fe,this.radius/Math.sqrt(I)),l(fe,fe,c),s(fe,t,fe);const L=Math.min(1,(Math.abs(r(fe,this.up))+.5*T+this._curvatureHeight)/o(fe)),x=Z/e.angledSplitBias,O=e.fovY*f*2;return L*(this._edgeLen/O*D)<x*e.relativeHeightLimit?Q.NONE:Q.SPLIT}createChildren(){const e=this._children,t=this.lij[0]+1,i=2*this.lij[1],s=2*this.lij[2];return e[0]=this.surface.createTile(t,i,s,this),e[1]=this.surface.createTile(t,i,s+1,this),e[2]=this.surface.createTile(t,i+1,s,this),e[3]=this.surface.createTile(t,i+1,s+1,this),e}clearChildren(){this._children[0]=this._children[1]=this._children[2]=this._children[3]=null}get loaded(){return this.renderData?.hasGeometry??!1}load(){this.refMapData();for(const e of T)this._createOrUpdateAgents(0,e);this.surface.renderer.loadTile(this)}unload(){this.renderData&&this.unrefMapData(),this.surface.renderer.unloadTile(this);for(const e of T){const t=this.layerInfo[e];for(const e of t)e.loadingAgent&&e.loadingAgent!==z&&(ie(e.loadingAgent),e.loadingAgent=null),e.pendingUpdates=0}this.resetPendingUpdate(Q.GEOMETRY),this.resetPendingUpdate(Q.TEXTURE_NOFADING),this.resetPendingUpdate(Q.TEXTURE_FADING)}unloadMapData(){const e=this.layerInfo[E.MAP];for(const t of e)t.loadingAgent&&t.loadingAgent!==z&&(ie(t.loadingAgent),t.loadingAgent=null),t.pendingUpdates=0,t.invalidateSourceData();this.renderData&&this.renderData.releaseTexture(),this.setMemoryDirty()}updateClippingStatus(e){if(p(e,this._clippingArea))return!1;const t=this._intersectsClippingArea,i=this._withinClippingArea;null!=e?(this._intersectsClippingArea=this.intersectsExtent(e),this._withinClippingArea=this._isWithinExtent(e)):(this._intersectsClippingArea=!0,this._withinClippingArea=!0),this._clippingArea=e,this.updateVisibility();const s=i&&this._withinClippingArea,n=!(i||t||this._withinClippingArea||this._intersectsClippingArea);return!this.renderData||s||n||this.setPendingUpdate(Q.GEOMETRY),!0}updateVisibility(){this._dirty=!0,this._surface.setTileTreeDirty()}getLayerInfo(e,t){return this.layerInfo[t][e]}hasLayerData(e,t){const i=this.layerInfo[t][e];return!(!i?.data||i.dataInvalidated)}get updating(){if(this.hasPendingUpdates)return!0;for(const e of T){const t=this.layerInfo[e];for(const e of t)if(e.loadingAgent&&e.loadingAgent!==z&&e.loadingAgent.updating)return!0}return!1}_isSuspended(e){return!!this.hasPendingUpdate(Q.SPLIT)||e!==E.ELEVATION&&!this._loadable}get hasPendingUpdates(){return 0!==this._pendingUpdates}hasPendingUpdate(e){return(this._pendingUpdates&e)===e}setPendingUpdate(e){const t=this._pendingUpdates;return this._pendingUpdates|=e,e===Q.SPLIT||e===Q.MERGE?this._surface.setTileTreeDirty():this._surface.requestUpdate(),t!==this._pendingUpdates}resetPendingUpdate(e){return!!this.hasPendingUpdate(e)&&(this._pendingUpdates&=~e,!0)}requestLayerData(e,i,s){const n=this.layerInfo[i][e];if(n.waitingAgents.has(s))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),s.tile.lij.toString(),i,e),!0;if(n.waitingAgents.push(s),n.data&&!n.dataInvalidated){console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),s.tile.lij.toString(),i,e);const t=O(n.data);return s.dataArrived(this,t),!0}if(n.requestPromise)return!0;t(n.requestAbort),n.requestAbort=new AbortController;const r=this._surface.requestTileData(this,e,i,n.requestAbort);if(!r)return n.requestAbort=null,!1;const a=()=>{n.requestPromise===r&&(n.requestPromise=null,n.requestAbort=null)};return n.requestPromise=r,r.then(a,a),!0}get leaf(){return null==this._children[0]}hasLij(e){return this._lij[0]===e[0]&&this._lij[1]===e[1]&&this._lij[2]===e[2]}findByLij(e){if(this.hasLij(e))return this;const t=this._children;if(!t[0])return null;return t[0].findByLij(e)||t[1].findByLij(e)||t[2].findByLij(e)||t[3].findByLij(e)}distanceToSquared(e){return n(s(fe,_(this._center[ae.MIDDLE]),e))}containsPoint(e){const t=this.extent;return e[0]>=t[0]&&e[1]>=t[1]&&e[0]<=t[2]&&e[1]<=t[3]}containsPointXY(e,t){const i=this.extent;return e>=i[0]&&t>=i[1]&&e<=i[2]&&t<=i[3]}unrequestLayerData(e,t,i){const s=this.layerInfo[t][e],n=s.waitingAgents,r=null!=n.removeUnordered(i);U(r,"agent has not requested this piece of map data"),n.length<1&&(s.abortRequest(),this.setMemoryDirty())}dataArrived(e,t,i){const s=O(i),n=this.layerInfo[t][e];n.data=i,n.dataInvalidated=!1,n.waitingAgents.forAll((e=>e.dataArrived(this,s))),n.waitingAgents.clear(),this.setMemoryDirty()}dataMissing(e,t){const i=this.layerInfo[t][e];i.dataMissing=!0,i.waitingAgents.forAll((e=>e.dataMissing())),i.waitingAgents.clear(),this.setMemoryDirty()}updateRenderData(e,t,i){switch(i&&this.forEachLoadedNeighbor((i=>i.updateRenderData(e,t))),e){case E.MAP:return this._updateTexture(t);case E.ELEVATION:return this._updateGeometry()}}_updateTexture(e){this.renderData&&(this.resetPendingUpdate(e===v.FADING?Q.TEXTURE_NOFADING:Q.TEXTURE_FADING),this.setPendingUpdate(e===v.FADING?Q.TEXTURE_FADING:Q.TEXTURE_NOFADING))}_updateGeometry(){this.setPendingUpdate(Q.GEOMETRY);for(const e of this.layerInfo[E.ELEVATION])e.pendingUpdates|=Q.GEOMETRY}invalidateLayerData(e,t){this.layerInfo[t][e].invalidateSourceData(),this.restartAgents(t)}computeElevationBounds(){const e=this._elevationBoundsMin,t=this._elevationBoundsMax;let i=1/0,s=-1/0;const n=this.layerInfo[E.ELEVATION];let r=!0;for(const a of n)null!=a.elevationBounds&&(i=Math.min(i,a.elevationBounds.min),s=Math.max(s,a.elevationBounds.max),a.elevationBounds.hasNoDataValues||(r=!1));r&&(i=Math.min(i,0),s=Math.max(s,0)),e===i&&t===s||(this._elevationBoundsMin=i,this._elevationBoundsMax=s,this.updateRadiusAndCenter(),this._surface.setTileTreeDirty())}_updateCenter(){const e=this._elevationBoundsMin,t=this._elevationBoundsMax,i=.5*(e+t),s=this._center;a(fe,this.up,i),l(_(s[ae.MIDDLE]),this.centerAtSeaLevel,fe),a(fe,this.up,e),l(s[ae.TOP],this.centerAtSeaLevel,fe),a(fe,this.up,t),l(s[ae.BOTTOM],this.centerAtSeaLevel,fe)}findElevationBoundsForLayer(e,t){const i=this.layerInfo[E.ELEVATION][e],s=this.elevationLevelDelta,n=Math.max(this.elevationLevel-s,0),r=i.elevationBounds;if(null!=r&&r.level>=t&&r.level<=n)return;const a=this._surface.layerViewByIndex(e,E.ELEVATION);if(!K(this,a))return;const l=re;let o=!1;const h=i.data;if(h&&h.level<=n){const e=i.data;l.min=e.samplerData.data.minValue,l.max=e.samplerData.data.maxValue,l.hasNoDataValues=e.samplerData.data.hasNoDataValues,l.level=this.level,o=!0}else{let t,i,r=0;for(let a=this._parent;a&&(!i||r<s)&&(r=this.elevationLevel-a.level,t=i||t,i=a.layerInfo[E.ELEVATION][e].data,!(!i&&t&&a.level<=n));a=a.parent);i=i||t,i&&(i.computeMinMaxValue(this._lij[0],this._lij[1],this._lij[2],l),l.min!==1/0&&(l.level=i.level,o=!0))}o&&(null==i.elevationBounds&&(i.elevationBounds=new y),i.elevationBounds.copyFrom(l))}modifyLayers(e,t,i){const s=this.layerInfo[i];for(const a of s)a.loadingAgent&&a.loadingAgent!==z&&(ie(a.loadingAgent),a.loadingAgent=null),a.waitingAgents.clear();for(let a=0;a<s.length;++a)void 0===e[a]&&s[a].release();const n=new Array(...s),r=t.length;s.length=r;for(let a=0;a<r;a++){const e=t[a];s[a]=e>-1?n[e]:$.acquire(this._surface.upsampleInfoPool)}this.setMemoryDirty()}restartAgents(e){this.renderData&&(this._createOrUpdateAgents(0,e),this.updateRenderData(e,v.FADING))}updateAgents(e){if(this.renderData){const t=this.layerInfo[e];for(const e of t)e.loadingAgent===z&&(e.loadingAgent=null);this._createOrUpdateAgents(0,e)}}updateAgentSuspension(){for(const e of T){const t=this._isSuspended(e);for(const i of this.layerInfo[e])i.loadingAgent&&i.loadingAgent!==z&&(i.loadingAgent.setSuspension(t),i.loadingAgent===z&&this.updateRenderData(e,v.FADING))}}removeLayerAgent(e,t){const i=this.layerInfo[t][e];i.loadingAgent&&i.loadingAgent!==z&&i.loadingAgent.dispose(),i.loadingAgent=null}agentDone(e,t){const i=this.layerInfo[t][e];i.loadingAgent=z,i.data||null!=i.upsampleInfo||this._createOrUpdateAgents(e+1,t)}_hasBlendableAncestor(e){return"normal"!==e.blendMode||m(e.parent)&&this._hasBlendableAncestor(e.parent)}_hasBlendModes(e,t,i){for(let s=e;s<t;++s){const e=this._surface.layerViewByIndex(s,i);if(j(e)&&"normal"!==e?.layer?.blendMode||m(e?.layer?.parent)&&this._hasBlendableAncestor(e?.layer?.parent))return!0}return!1}_createOrUpdateAgents(e,t){const i=this.layerInfo[t];if(0===i.length)return;const s=this._isSuspended(t);for(let n=e;n<i.length;++n){const r=i[n],a=this._surface.layerViewByIndex(n,t);let l=!1;if(r.loadingAgent?K(this,a)?(r.loadingAgent!==z&&r.loadingAgent.setSuspension(s),r.loadingAgent!==z&&(l=r.loadingAgent.update())):r.dispose():K(this,a)&&(r.loadingAgent=te(this,n,t,s),l=r.loadingAgent.startLoading(),l?r.loadingAgent===z&&this.setPendingUpdate(Q.GEOMETRY):(ie(r.loadingAgent),r.loadingAgent=z)),r.loadingAgent===z&&this.updateRenderData(t,v.FADING),!this._hasBlendModes(e,i.length,t)&&l&&a.isOpaque)return}}_isWithinExtent(e){const t=this.extent;return t[0]>=e[0]&&e[2]>=t[2]&&t[1]>=e[1]&&e[3]>=t[3]}intersectsExtent(e){const t=this.extent;return t[2]>=e[0]&&e[2]>=t[0]&&t[3]>=e[1]&&e[3]>=t[1]}getElevationVerticesPerSide(t){const i=this.elevationLevel-this.level,s=Math.max(this.level-t,this.elevationLevelDelta-i),n=e(1+(this._maxTesselation>>s),2,this._maxTesselation+1),r=this.minimumVerticesPerSide;return Math.max(n,r)}_findLIJ(e,t){if(!e)return null;const i=this.surface.rootTiles;if(null!=i)for(const s of i)if(le(s,e)){let i=s,n=e[0]-i.level-1;for(;n>=0&&!i.leaf&&!t(i);){const t=e[1]>>n&1,s=e[2]>>n&1;i=i.children[2*t+s],n--}return t(i)?i:null}return null}findNeighborTile(e,t){const i=this._lij,s=this._getNeighborLIJ(i,e);return s?oe(i,s)?t(this)?this:null:this._findLIJ(s,t):null}findCorner(e,t){const i=e===L.NORTH_EAST?1:e===L.NORTH_WEST?0:e===L.SOUTH_WEST?2:3;let s=this;for(;s.children[0]&&(!t||!t(s));)s=s.children[i];return s}findNeighborCornerTileExact(e,t){return this.findNeighborTile(e,(e=>t(e)||e.level===this.level))?.findCorner(P(e),t)||null}forAllSubtreeOnSide(e,t){const i=e===L.NORTH?[0,1]:e===L.NORTH_EAST?[1]:e===L.EAST?[1,3]:e===L.SOUTH_EAST?[3]:e===L.SOUTH?[2,3]:e===L.SOUTH_WEST?[2]:e===L.WEST?[0,2]:[0],s=e=>{const n=e.children;!t(e)&&n[0]&&i.forEach((e=>s(n[e])))};s(this)}getNeighborEdgeStartVertexIndex(e,t){if(!t)return 0;const i=this.level-t.level;if(B(!C||i>=0),0===i)return 0;const s=2**i,n=!(1&~e),r=n?0:1,a=t.lij[r+1]*s,l=this._lij[r+1],o=l-a,h=n?s-1-o:o;return C&&(B(a<=l&&l<a+s),B(0<=h&&h<s)),h}forEachLoadedNeighbor(e){const t=this.level,i=e=>e.level===t||e.loaded;R.forEach((t=>{const s=this.findNeighborTile(t,i);null!=s&&s!==this&&s.forAllSubtreeOnSide(w(t),(i=>!!i.loaded&&(e(i,t),!0)))})),V.forEach((t=>{const s=this.findNeighborTile(t,i)?.findCorner(P(t),(e=>e.loaded));B(!s||he(this,s,t)),s?.loaded&&e(s,t)}))}_getNeighborLIJ(e,t){const i=G(t)?-1:q(t)?1:0,s=F(t)?-1:H(t)?1:0,n=[e[0],e[1]+i,e[2]+s];return n[1]<0?null:this.surface.isGlobal?this._wrapLIJ(n):n[2]<0?null:n}_wrapLIJ(e){return!e||e[1]<0||e[1]>=2**e[0]?null:this.surface.wrapEastWest(e)}isEdgeNeighbor(e,t){if(null==e)return!1;if(0===this.level&&0===e.level){if(this._eastEnd&&e._westEnd&&t===L.EAST)return!0;if(this._westEnd&&e._eastEnd&&t===L.WEST)return!0}const i=Math.max(1e-6*(this.extent[2]-this.extent[0]),1);switch(t){case L.NORTH:return W(this.extent[3],e.extent[1],i);case L.SOUTH:return W(this.extent[1],e.extent[3],i);case L.EAST:return W(this.extent[2],e.extent[0],i)||W(this.extent[2],-e.extent[0],i);case L.WEST:return W(this.extent[0],e.extent[2],i)||W(this.extent[0],-e.extent[2],i)}}get _eastEnd(){return this._lij[2]===this.surface.lijEastEnd(this.level)-1}get _westEnd(){return 0===this._lij[2]}checkGeometryWaterproofness(){k&&(B(this.loaded),this.renderData?.checkGeometryWaterproofness())}shouldHaveNeighbor(e){const t=this.extent,i=this.surface.rootTilesExtent,s=.25*(t[2]-t[0]);if(G(e)&&t[3]+s>=i[3])return!1;if(q(e)&&t[1]-s<=i[1])return!1;const n=this.surface.isGlobal;return!(!n&&F(e)&&t[0]-s<=i[0])&&!(!n&&H(e)&&t[2]+s>=i[2])}updateDistanceToPOI(e){const t=this._lastPOI;if(this.distanceToPOI>=0&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2])return;h(this._lastPOI,e);const i=this._center[ae.MIDDLE],s=e[0]-i[0],n=e[1]-i[1],r=e[2]-i[2];this.distanceToPOI=s*s+n*n+r*r}}function te(e,t,i,s){const n=i===E.ELEVATION?ne.acquire():se.acquire();return n.init(e,t,i,s),n}function ie(e){e.dispose(),A(e)?ne.release(e):I(e)&&se.release(e)}const se=new i(D),ne=new i(M),re=new y;var ae;function le(e,t){const i=e.lij,s=t[0]-i[0];return!(s<0)&&(t[1]>>s===i[1]&&t[2]>>s===i[2])}function oe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function he(e,t,i){return null!=e&&null!=t&&t!==e&&(e.level>=t.level?de(e,t,i):de(t,e,P(i)))}function de(e,t,i){B(e.level>=t.level);const s=X(i),n=Y(i),r=e.extent,a=t.extent,l=[s?r[0]:r[2],n?r[3]:r[1]],o=[s?a[2]:a[0],n?a[1]:a[3]],h=1e-5*(r[2]-r[0]),d=W(l[0],o[0],h)||e.surface.isGlobal&&W(l[0],-o[0],h),u=W(l[1],o[1],h);if(d&&u)return!0;if(e.level===t.level)return B(!1),!1;if(!d&&!u)return B(!1),!1;const c=d?ue(a[1],a[3],r[1],r[3],h):ue(a[0],a[2],r[0],r[2],h);return B(c),c}function ue(e,t,i,s,n){return e-n<=i&&i<=s&&s<=t+n}!function(e){e[e.TOP=0]="TOP",e[e.MIDDLE=1]="MIDDLE",e[e.BOTTOM=2]="BOTTOM"}(ae||(ae={}));const ce=d(),ge=d(),pe=d(),fe=d();export{ae as CenterPosition,ee as Tile,he as isCornerNeighbor,oe as lijEquals};
5
+ import{clamp as e}from"../../../core/mathUtils.js";import{abortMaybe as t}from"../../../core/maybe.js";import i from"../../../core/ObjectPool.js";import{d as s,k as n,f as r,h as a,g as l,l as o,c as h}from"../../../chunks/vec32.js";import{create as d,unitZ as u}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as c}from"../../../geometry/ellipsoidUtils.js";import{create as g,equals as p}from"../../../geometry/support/aaBoundingRect.js";import{c as f,a as _}from"../../../chunks/sphere.js";import{isGroupLayer as m}from"../../../layers/support/layerUtils.js";import{ElevationBounds as y}from"./ElevationBounds.js";import{ElevationTileAgent as M,isElevationTileAgent as A}from"./ElevationTileAgent.js";import{TextureUpdate as v}from"./interfaces.js";import{LayerClasses as T,LayerClass as E}from"./LayerClass.js";import{MapTileAgent as D,isMapTileAgent as I}from"./MapTileAgent.js";import{NeighborIndex as L}from"./NeighborIndex.js";import{maxPatchTesselation as x}from"./TerrainConst.js";import{isVectorTile as S,isTileTexture as O,isRasterTile as N,isImageWithType as b}from"./TerrainData.js";import{weakAssert as U,isBlendableLayerView as j,oppositeCorner as P,internalAssert as B,enableTerrainInternalChecks as C,neighborEdgeIndices as R,oppositeEdge as w,neighborCornerIndices as V,isNorth as G,isSouth as q,isWest as F,isEast as H,almostEquals as W,enableWaterproofTests as k,isWestCorner as X,isNorthCorner as Y}from"./terrainUtils.js";import{tileAgentDone as z}from"./TileAgent.js";import{TileFrustumVisibility as J}from"./TileFrustumVisibility.js";import{TilePerLayerInfo as $}from"./TilePerLayerInfo.js";import{TileUpdate as Q}from"./TileUpdate.js";import{fallsWithinLayerView as K}from"./tileUtils.js";const Z=.1;class ee{constructor(){this._lij=[0,0,0],this._children=[null,null,null,null],this._pendingUpdates=0,this.renderData=null,this._dirty=!0,this._previouslyRendered=!1,this.extent=g(),this._elevationBoundsMin=NaN,this._elevationBoundsMax=0,this.layerInfo=[[],[]],this.extentInRadians=g(),this.centerAtSeaLevel=d(),this._center=[d(),f(),d()],this.up=u(),this._withinClippingArea=!0,this._intersectsClippingArea=!0,this._maxTesselation=0,this._usedMemory=0,this._rasterTileMemory=0,this._vectorTileMemory=0,this._mapDataRefCount=0,this.screenDepth=0,this.renderOrder=0,this._edgeLen=0,this._edgeLen2=0,this._curvatureHeight=0,this.onCompressionFinished=()=>{this.setPendingUpdate(Q.TEXTURE_NOFADING),this.setMemoryDirty()},this.extentMidX=0,this.extentMidY=0,this.distanceToPOI=-1,this._lastPOI=d(),this.maxLevelDeltaNeighborCount=0,this.unmergableChildCount=0}get lij(){return this._lij}get spatialReference(){return this._surface.spatialReference??this._surface.tilingScheme.spatialReference}get elevationLevelDelta(){return this._surface.getElevationLevelDelta(this.level)}static prune(){se.prune(0),ne.prune(0),$.prune()}get _cached(){return!this.leaf&&this._mapDataRefCount<=0}get withinClippingArea(){return this._withinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBoundsMin(){return this._elevationBoundsMin}get elevationBoundsMax(){return this._elevationBoundsMax}get level(){return this._lij[0]}get key(){return`${this._lij[0]}/${this._lij[1]}/${this._lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[ae.MIDDLE][3]}get visible(){return this._dirty&&this.computeVisibility(),this._visible}get frustumVisibility(){return this._dirty&&this.computeVisibility(),this._frustumVisibility}computeVisibility(){this._dirty=!1;const e=this.parent,t=e?.frustumVisibility??J.INTERSECTS;this._frustumVisibility=t===J.INSIDE?J.INSIDE:t===J.OUTSIDE?J.OUTSIDE:this._calculateFrustumVisibility(this.surface.frustum);const i=this._frustumVisibility!==J.OUTSIDE&&this._intersectsClippingArea;i!==this._visible&&(this._visible=i,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setDirty(),this.updateAgentSuspension())}get _loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const e=!!this.renderData;return e!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=e,this._surface.renderer.setDirty()),e}init(e,t,i,s,n){this._lij[0]=e,this._lij[1]=t,this._lij[2]=i,this.ellipsoid=c(n.tilingScheme.spatialReference),n.tilingScheme.getExtent(e,t,i,this.extent),n.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians),this.extentMidX=.5*(this.extent[0]+this.extent[2]),this.extentMidY=.5*(this.extent[1]+this.extent[3]),this._withinClippingArea=!0,this._intersectsClippingArea=!0,this._clippingArea=null,this._mapDataRefCount=0,n.upsampleMapCache.pop(this.key),this._edgeLen=0,this._edgeLen2=0,this._center[ae.MIDDLE][3]=0,this.elevationLevel=e,s&&!Number.isNaN(s.elevationBoundsMin)?(this._elevationBoundsMin=s.elevationBoundsMin,this._elevationBoundsMax=s.elevationBoundsMax):(this._elevationBoundsMin=0,this._elevationBoundsMax=0),this._pendingUpdates=0,this.renderData=null,this.screenDepth=0,this._visible=!1,this._previouslyRendered=!1,this._parent=s,this.clearChildren(),this._surface=n,this.updateVisibility(),this.maxLevelDeltaNeighborCount=0,this.unmergableChildCount=0;for(const r of T){const e=n.numLayers(r),t=this.layerInfo[r];for(const i of t)i.release();t.length=e;for(let i=0;i<e;i++)t[i]=$.acquire(this._surface.upsampleInfoPool),r===E.ELEVATION&&this.findElevationBoundsForLayer(i,-1)}this.computeElevationBounds(),this._maxTesselation=Math.min(n.tilingScheme.pixelSize,x)}dispose(){null!=this._surface&&(U(!this.renderData,"tile.renderData was not unloaded"),this._surface.upsampleMapCache.pop(this.key),this.layerInfo.forEach((e=>{e.forEach((e=>e.release())),e.length=0})),this._surface=this._parent=null,this.clearChildren(),this.setMemoryDirty())}refMapData(){++this._mapDataRefCount,this._cached||this._surface.upsampleMapCache.pop(this.key)}unrefMapData(){--this._mapDataRefCount,this._cached&&this.cachedMemory>0&&this._surface.upsampleMapCache.put(this.key,this)}setMemoryDirty(){this._usedMemory=0}get usedMemory(){return this._ensureUsedMemory()+(this._cached?0:this._mapTileMemory)}get cachedMemory(){return this._ensureUsedMemory(),null==this._surface?this.usedMemory:this._cached?this._mapTileMemory:0}get _mapTileMemory(){return this._rasterTileMemory+this._vectorTileMemory}get _cpuImageMemorySize(){const e=4,t=this._surface.tilingScheme.pixelSize;return t*t*e}_ensureUsedMemory(){if(this._usedMemory>0)return this._vectorTileMemory=this.layerInfo[E.MAP].reduce(((e,{data:t})=>e+(S(t)?t.usedMemoryPerReference:0)),0),this._usedMemory;this._usedMemory=this._baseUsedMemory,this._rasterTileMemory=0,this._vectorTileMemory=0;for(const{data:e}of this.layerInfo[E.MAP])S(e)?this._vectorTileMemory+=e.usedMemoryPerReference:this._rasterTileMemory+=this.getTerrainDataMemory(e);for(const e of this.layerInfo[E.ELEVATION])this._usedMemory+=e.data?this._cpuImageMemorySize:0;return this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._rasterTileMemory+=this.renderData.texture?.cachedMemory??0),this._cached&&this._surface.upsampleMapCache.updateSize(this.key,this),this._usedMemory}getUsedMemoryForLayer(e,t){const i=this.layerInfo[e][t];return i?.data?e===E.MAP?this._cached?0:this.getTerrainDataMemory(i.data):e===E.ELEVATION?this._cpuImageMemorySize:0:0}getTerrainDataMemory(e){return O(e)?e.texture.usedMemory:N(e)?e.memoryUsage:S(e)?e.usedMemoryPerReference:b(e)||e instanceof HTMLImageElement?this._cpuImageMemorySize:0}updateScreenDepth(e){const t=this._center[ae.MIDDLE],i=e,s=t[0],n=t[1],r=t[2],a=i[2]*s+i[6]*n+i[10]*r+i[14];this.screenDepth=a<0?0:a/(i[3]*s+i[7]*n+i[11]*r+i[15])}shouldSplit(e,t,i){if(!this.visible)return Q.NONE;if(e.frustum&&(!this._intersectsClippingArea||this._calculateFrustumVisibility(e.frustum)===J.OUTSIDE))return Q.NONE;const h=this.level;s(ce,_(this._center[ae.MIDDLE]),t);let d=n(ce),u=ce,c=_(this._center[ae.MIDDLE]);s(ge,this._center[ae.TOP],t);const g=n(ge);g<d&&(d=g,u=ge,c=this._center[ae.TOP]),s(pe,this._center[ae.BOTTOM],t);const p=n(pe);if(p<d&&(d=p,u=pe,c=this._center[ae.BOTTOM]),this._edgeLen2>d&&h<e.maxLod)return Q.SPLIT;const f=Math.sqrt(d),m=e.fovX*f*2,y=this._edgeLen/m,M=()=>{if(h<e.maxLod)return this.elevationLevel=h,Q.NONE;const t=h+Math.ceil(-Math.log2(e.relativeWidthLimit/y));return t!==this.elevationLevel?(this.elevationLevel=t,Q.ELEVATION):Q.NONE},A=null!=i?i-h:1/0;if(A<=.5)return M();const v=r(this.up,ce),T=this._elevationBoundsMax-this._elevationBoundsMin,E=T/this.edgeLen;if(e.aboveGround&&v>0&&E<.001){if(v/f-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-E>0)return Q.NONE}const D=null!=i?3-Math.min(A,2):1;if(y*D<e.relativeWidthLimit||h>=e.maxLod)return M();if(h<7)return Q.SPLIT;a(fe,this.up,v),s(fe,fe,u);const I=n(fe);if(I<=this.radius*this.radius)return Q.SPLIT;a(fe,fe,this.radius/Math.sqrt(I)),l(fe,fe,c),s(fe,t,fe);const L=Math.min(1,(Math.abs(r(fe,this.up))+.5*T+this._curvatureHeight)/o(fe)),x=Z/e.angledSplitBias,S=e.fovY*f*2;return L*(this._edgeLen/S*D)<x*e.relativeHeightLimit?Q.NONE:Q.SPLIT}createChildren(){const e=this._children,t=this.lij[0]+1,i=2*this.lij[1],s=2*this.lij[2];return e[0]=this.surface.createTile(t,i,s,this),e[1]=this.surface.createTile(t,i,s+1,this),e[2]=this.surface.createTile(t,i+1,s,this),e[3]=this.surface.createTile(t,i+1,s+1,this),e}clearChildren(){this._children[0]=this._children[1]=this._children[2]=this._children[3]=null}get loaded(){return this.renderData?.hasGeometry??!1}load(){this.refMapData();for(const e of T)this._createOrUpdateAgents(0,e);this.surface.renderer.loadTile(this)}unload(){this.renderData&&this.unrefMapData(),this.surface.renderer.unloadTile(this);for(const e of T){const t=this.layerInfo[e];for(const e of t)e.loadingAgent&&e.loadingAgent!==z&&(ie(e.loadingAgent),e.loadingAgent=null),e.pendingUpdates=0}this.resetPendingUpdate(Q.GEOMETRY),this.resetPendingUpdate(Q.TEXTURE_NOFADING),this.resetPendingUpdate(Q.TEXTURE_FADING)}unloadMapData(){const e=this.layerInfo[E.MAP];for(const t of e)t.loadingAgent&&t.loadingAgent!==z&&(ie(t.loadingAgent),t.loadingAgent=null),t.pendingUpdates=0,t.invalidateSourceData();this.renderData&&this.renderData.releaseTexture(),this.setMemoryDirty()}updateClippingStatus(e){if(p(e,this._clippingArea))return!1;const t=this._intersectsClippingArea,i=this._withinClippingArea;null!=e?(this._intersectsClippingArea=this.intersectsExtent(e),this._withinClippingArea=this._isWithinExtent(e)):(this._intersectsClippingArea=!0,this._withinClippingArea=!0),this._clippingArea=e,this.updateVisibility();const s=i&&this._withinClippingArea,n=!(i||t||this._withinClippingArea||this._intersectsClippingArea);return!this.renderData||s||n||this.setPendingUpdate(Q.GEOMETRY),!0}updateVisibility(){this._dirty=!0,this._surface.setTileTreeDirty()}getLayerInfo(e,t){return this.layerInfo[t][e]}hasLayerData(e,t){const i=this.layerInfo[t][e];return!(!i?.data||i.dataInvalidated)}get updating(){if(this.hasPendingUpdates)return!0;for(const e of T){const t=this.layerInfo[e];for(const e of t)if(e.loadingAgent&&e.loadingAgent!==z&&e.loadingAgent.updating)return!0}return!1}_isSuspended(e){return!!this.hasPendingUpdate(Q.SPLIT)||e!==E.ELEVATION&&!this._loadable}get hasPendingUpdates(){return 0!==this._pendingUpdates}hasPendingUpdate(e){return(this._pendingUpdates&e)===e}setPendingUpdate(e){const t=this._pendingUpdates;return this._pendingUpdates|=e,e===Q.SPLIT||e===Q.MERGE?this._surface.setTileTreeDirty():this._surface.requestUpdate(),t!==this._pendingUpdates}resetPendingUpdate(e){return!!this.hasPendingUpdate(e)&&(this._pendingUpdates&=~e,!0)}requestLayerData(e,i,s){const n=this.layerInfo[i][e];if(n.waitingAgents.has(s))return console.warn("agent already requested this piece of map data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),s.tile.lij.toString(),i,e),!0;if(n.waitingAgents.push(s),n.data&&!n.dataInvalidated){console.warn("agent requested existing data (tile %s, agent tile %s, layer: %d/%d)",this._lij.toString(),s.tile.lij.toString(),i,e);const t=S(n.data);return s.dataArrived(this,t),!0}if(n.requestPromise)return!0;t(n.requestAbort),n.requestAbort=new AbortController;const r=this._surface.requestTileData(this,e,i,n.requestAbort);if(!r)return n.requestAbort=null,!1;const a=()=>{n.requestPromise===r&&(n.requestPromise=null,n.requestAbort=null)};return n.requestPromise=r,r.then(a,a),!0}get leaf(){return null==this._children[0]}hasLij(e){return this._lij[0]===e[0]&&this._lij[1]===e[1]&&this._lij[2]===e[2]}findByLij(e){if(this.hasLij(e))return this;const t=this._children;if(!t[0])return null;return t[0].findByLij(e)||t[1].findByLij(e)||t[2].findByLij(e)||t[3].findByLij(e)}distanceToSquared(e){return n(s(fe,_(this._center[ae.MIDDLE]),e))}containsPoint(e){const t=this.extent;return e[0]>=t[0]&&e[1]>=t[1]&&e[0]<=t[2]&&e[1]<=t[3]}containsPointXY(e,t){const i=this.extent;return e>=i[0]&&t>=i[1]&&e<=i[2]&&t<=i[3]}unrequestLayerData(e,t,i){const s=this.layerInfo[t][e],n=s.waitingAgents,r=null!=n.removeUnordered(i);U(r,"agent has not requested this piece of map data"),n.length<1&&(s.abortRequest(),this.setMemoryDirty())}dataArrived(e,t,i){const s=S(i),n=this.layerInfo[t][e];n.data=i,n.dataInvalidated=!1,n.waitingAgents.forAll((e=>e.dataArrived(this,s))),n.waitingAgents.clear(),this.setMemoryDirty()}dataMissing(e,t){const i=this.layerInfo[t][e];i.dataMissing=!0,i.waitingAgents.forAll((e=>e.dataMissing())),i.waitingAgents.clear(),this.setMemoryDirty()}updateRenderData(e,t,i){switch(i&&this.forEachLoadedNeighbor((i=>i.updateRenderData(e,t))),e){case E.MAP:return this._updateTexture(t);case E.ELEVATION:return this._updateGeometry()}}_updateTexture(e){this.renderData&&(this.resetPendingUpdate(e===v.FADING?Q.TEXTURE_NOFADING:Q.TEXTURE_FADING),this.setPendingUpdate(e===v.FADING?Q.TEXTURE_FADING:Q.TEXTURE_NOFADING))}_updateGeometry(){this.setPendingUpdate(Q.GEOMETRY);for(const e of this.layerInfo[E.ELEVATION])e.pendingUpdates|=Q.GEOMETRY}invalidateLayerData(e,t){this.layerInfo[t][e].invalidateSourceData(),this.restartAgents(t)}computeElevationBounds(){const e=this._elevationBoundsMin,t=this._elevationBoundsMax;let i=1/0,s=-1/0;const n=this.layerInfo[E.ELEVATION];let r=!0;for(const a of n)null!=a.elevationBounds&&(i=Math.min(i,a.elevationBounds.min),s=Math.max(s,a.elevationBounds.max),a.elevationBounds.hasNoDataValues||(r=!1));r&&(i=Math.min(i,0),s=Math.max(s,0)),e===i&&t===s||(this._elevationBoundsMin=i,this._elevationBoundsMax=s,this.updateRadiusAndCenter(),this._surface.setTileTreeDirty())}_updateCenter(){const e=this._elevationBoundsMin,t=this._elevationBoundsMax,i=.5*(e+t),s=this._center;a(fe,this.up,i),l(_(s[ae.MIDDLE]),this.centerAtSeaLevel,fe),a(fe,this.up,e),l(s[ae.TOP],this.centerAtSeaLevel,fe),a(fe,this.up,t),l(s[ae.BOTTOM],this.centerAtSeaLevel,fe)}findElevationBoundsForLayer(e,t){const i=this.layerInfo[E.ELEVATION][e],s=this.elevationLevelDelta,n=Math.max(this.elevationLevel-s,0),r=i.elevationBounds;if(null!=r&&r.level>=t&&r.level<=n)return;const a=this._surface.layerViewByIndex(e,E.ELEVATION);if(!K(this,a))return;const l=re;let o=!1;const h=i.data;if(h&&h.level<=n){const e=i.data;l.min=e.samplerData.data.minValue,l.max=e.samplerData.data.maxValue,l.hasNoDataValues=e.samplerData.data.hasNoDataValues,l.level=this.level,o=!0}else{let t,i,r=0;for(let a=this._parent;a&&(!i||r<s)&&(r=this.elevationLevel-a.level,t=i||t,i=a.layerInfo[E.ELEVATION][e].data,!(!i&&t&&a.level<=n));a=a.parent);i=i||t,i&&(i.computeMinMaxValue(this._lij[0],this._lij[1],this._lij[2],l),l.min!==1/0&&(l.level=i.level,o=!0))}o&&(null==i.elevationBounds&&(i.elevationBounds=new y),i.elevationBounds.copyFrom(l))}modifyLayers(e,t,i){const s=this.layerInfo[i];for(const a of s)a.loadingAgent&&a.loadingAgent!==z&&(ie(a.loadingAgent),a.loadingAgent=null),a.waitingAgents.clear();for(let a=0;a<s.length;++a)void 0===e[a]&&s[a].release();const n=new Array(...s),r=t.length;s.length=r;for(let a=0;a<r;a++){const e=t[a];s[a]=e>-1?n[e]:$.acquire(this._surface.upsampleInfoPool)}this.setMemoryDirty()}restartAgents(e){this.renderData&&(this._createOrUpdateAgents(0,e),this.updateRenderData(e,v.FADING))}updateAgents(e){if(this.renderData){const t=this.layerInfo[e];for(const e of t)e.loadingAgent===z&&(e.loadingAgent=null);this._createOrUpdateAgents(0,e)}}updateAgentSuspension(){for(const e of T){const t=this._isSuspended(e);for(const i of this.layerInfo[e])i.loadingAgent&&i.loadingAgent!==z&&(i.loadingAgent.setSuspension(t),i.loadingAgent===z&&this.updateRenderData(e,v.FADING))}}removeLayerAgent(e,t){const i=this.layerInfo[t][e];i.loadingAgent&&i.loadingAgent!==z&&i.loadingAgent.dispose(),i.loadingAgent=null}agentDone(e,t){const i=this.layerInfo[t][e];i.loadingAgent=z,i.data||null!=i.upsampleInfo||this._createOrUpdateAgents(e+1,t)}_hasBlendableAncestor(e){return"normal"!==e.blendMode||m(e.parent)&&this._hasBlendableAncestor(e.parent)}_hasBlendModes(e,t,i){for(let s=e;s<t;++s){const e=this._surface.layerViewByIndex(s,i);if(j(e)&&"normal"!==e?.layer?.blendMode||m(e?.layer?.parent)&&this._hasBlendableAncestor(e?.layer?.parent))return!0}return!1}_createOrUpdateAgents(e,t){const i=this.layerInfo[t];if(0===i.length)return;const s=this._isSuspended(t);for(let n=e;n<i.length;++n){const r=i[n],a=this._surface.layerViewByIndex(n,t);let l=!1;if(r.loadingAgent?K(this,a)?(r.loadingAgent!==z&&r.loadingAgent.setSuspension(s),r.loadingAgent!==z&&(l=r.loadingAgent.update())):r.dispose():K(this,a)&&(r.loadingAgent=te(this,n,t,s),l=r.loadingAgent.startLoading(),l?r.loadingAgent===z&&this.setPendingUpdate(Q.GEOMETRY):(ie(r.loadingAgent),r.loadingAgent=z)),r.loadingAgent===z&&this.updateRenderData(t,v.FADING),!this._hasBlendModes(e,i.length,t)&&l&&a.isOpaque)return}}_isWithinExtent(e){const t=this.extent;return t[0]>=e[0]&&e[2]>=t[2]&&t[1]>=e[1]&&e[3]>=t[3]}intersectsExtent(e){const t=this.extent;return t[2]>=e[0]&&e[2]>=t[0]&&t[3]>=e[1]&&e[3]>=t[1]}getElevationVerticesPerSide(t){const i=this.elevationLevel-this.level,s=Math.max(this.level-t,this.elevationLevelDelta-i),n=e(1+(this._maxTesselation>>s),2,this._maxTesselation+1),r=this.minimumVerticesPerSide;return Math.max(n,r)}_findLIJ(e,t){if(!e)return null;const i=this.surface.rootTiles;if(null!=i)for(const s of i)if(le(s,e)){let i=s,n=e[0]-i.level-1;for(;n>=0&&!i.leaf&&!t(i);){const t=e[1]>>n&1,s=e[2]>>n&1;i=i.children[2*t+s],n--}return t(i)?i:null}return null}findNeighborTile(e,t){const i=this._lij,s=this._getNeighborLIJ(i,e);return s?oe(i,s)?t(this)?this:null:this._findLIJ(s,t):null}findCorner(e,t){const i=e===L.NORTH_EAST?1:e===L.NORTH_WEST?0:e===L.SOUTH_WEST?2:3;let s=this;for(;s.children[0]&&(!t||!t(s));)s=s.children[i];return s}findNeighborCornerTileExact(e,t){return this.findNeighborTile(e,(e=>t(e)||e.level===this.level))?.findCorner(P(e),t)||null}forAllSubtreeOnSide(e,t){const i=e===L.NORTH?[0,1]:e===L.NORTH_EAST?[1]:e===L.EAST?[1,3]:e===L.SOUTH_EAST?[3]:e===L.SOUTH?[2,3]:e===L.SOUTH_WEST?[2]:e===L.WEST?[0,2]:[0],s=e=>{const n=e.children;!t(e)&&n[0]&&i.forEach((e=>s(n[e])))};s(this)}getNeighborEdgeStartVertexIndex(e,t){if(!t)return 0;const i=this.level-t.level;if(B(!C||i>=0),0===i)return 0;const s=2**i,n=!(1&~e),r=n?0:1,a=t.lij[r+1]*s,l=this._lij[r+1],o=l-a,h=n?s-1-o:o;return C&&(B(a<=l&&l<a+s),B(0<=h&&h<s)),h}forEachLoadedNeighbor(e){const t=this.level,i=e=>e.level===t||e.loaded;R.forEach((t=>{const s=this.findNeighborTile(t,i);null!=s&&s!==this&&s.forAllSubtreeOnSide(w(t),(i=>!!i.loaded&&(e(i,t),!0)))})),V.forEach((t=>{const s=this.findNeighborTile(t,i)?.findCorner(P(t),(e=>e.loaded));B(!s||he(this,s,t)),s?.loaded&&e(s,t)}))}_getNeighborLIJ(e,t){const i=G(t)?-1:q(t)?1:0,s=F(t)?-1:H(t)?1:0,n=[e[0],e[1]+i,e[2]+s];return n[1]<0?null:this.surface.isGlobal?this._wrapLIJ(n):n[2]<0?null:n}_wrapLIJ(e){return!e||e[1]<0||e[1]>=2**e[0]?null:this.surface.wrapEastWest(e)}isEdgeNeighbor(e,t){if(null==e)return!1;if(0===this.level&&0===e.level){if(this._eastEnd&&e._westEnd&&t===L.EAST)return!0;if(this._westEnd&&e._eastEnd&&t===L.WEST)return!0}const i=Math.max(1e-6*(this.extent[2]-this.extent[0]),1);switch(t){case L.NORTH:return W(this.extent[3],e.extent[1],i);case L.SOUTH:return W(this.extent[1],e.extent[3],i);case L.EAST:return W(this.extent[2],e.extent[0],i)||W(this.extent[2],-e.extent[0],i);case L.WEST:return W(this.extent[0],e.extent[2],i)||W(this.extent[0],-e.extent[2],i)}}get _eastEnd(){return this._lij[2]===this.surface.lijEastEnd(this.level)-1}get _westEnd(){return 0===this._lij[2]}checkGeometryWaterproofness(){k&&(B(this.loaded),this.renderData?.checkGeometryWaterproofness())}shouldHaveNeighbor(e){const t=this.extent,i=this.surface.rootTilesExtent,s=.25*(t[2]-t[0]);if(G(e)&&t[3]+s>=i[3])return!1;if(q(e)&&t[1]-s<=i[1])return!1;const n=this.surface.isGlobal;return!(!n&&F(e)&&t[0]-s<=i[0])&&!(!n&&H(e)&&t[2]+s>=i[2])}updateDistanceToPOI(e){const t=this._lastPOI;if(this.distanceToPOI>=0&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2])return;h(this._lastPOI,e);const i=this._center[ae.MIDDLE],s=e[0]-i[0],n=e[1]-i[1],r=e[2]-i[2];this.distanceToPOI=s*s+n*n+r*r}}function te(e,t,i,s){const n=i===E.ELEVATION?ne.acquire():se.acquire();return n.init(e,t,i,s),n}function ie(e){e.dispose(),A(e)?ne.release(e):I(e)&&se.release(e)}const se=new i(D),ne=new i(M),re=new y;var ae;function le(e,t){const i=e.lij,s=t[0]-i[0];return!(s<0)&&(t[1]>>s===i[1]&&t[2]>>s===i[2])}function oe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function he(e,t,i){return null!=e&&null!=t&&t!==e&&(e.level>=t.level?de(e,t,i):de(t,e,P(i)))}function de(e,t,i){B(e.level>=t.level);const s=X(i),n=Y(i),r=e.extent,a=t.extent,l=[s?r[0]:r[2],n?r[3]:r[1]],o=[s?a[2]:a[0],n?a[1]:a[3]],h=1e-5*(r[2]-r[0]),d=W(l[0],o[0],h)||e.surface.isGlobal&&W(l[0],-o[0],h),u=W(l[1],o[1],h);if(d&&u)return!0;if(e.level===t.level)return B(!1),!1;if(!d&&!u)return B(!1),!1;const c=d?ue(a[1],a[3],r[1],r[3],h):ue(a[0],a[2],r[0],r[2],h);return B(c),c}function ue(e,t,i,s,n){return e-n<=i&&i<=s&&s<=t+n}!function(e){e[e.TOP=0]="TOP",e[e.MIDDLE=1]="MIDDLE",e[e.BOTTOM=2]="BOTTOM"}(ae||(ae={}));const ce=d(),ge=d(),pe=d(),fe=d();export{ae as CenterPosition,ee as Tile,he as isCornerNeighbor,oe as lijEquals};
@@ -2,30 +2,25 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{ReadShadowMapPassParameters as e}from"../shading/ReadShadowMap.glsl.js";import{BackgroundGrid as t}from"./BackgroundGrid.glsl.js";import{TileBlendInput as o}from"./TileBlendInput.js";import{glsl as r,If as c}from"../../shaderModules/glsl.js";import{Uniform as s}from"../../../../../webgl/Uniform.js";class a extends e{constructor(){super(...arguments),this.overlayOpacity=1}}function n(e,s){const{vertex:a,fragment:n,varyings:x}=e;x.add("vtc","vec2"),a.uniforms.add(new l("texOffsetAndScale")),n.uniforms.add(new u("tex")),n.uniforms.add(new p("premultiplyAlpha")),n.uniforms.add(new i("textureOpacities"));const f=s.textureFadingEnabled&&!s.renderOccluded;f&&(a.uniforms.add(new l("nextTexOffsetAndScale")),x.add("nvtc","vec2"),n.uniforms.add(new u("texNext")),n.uniforms.add(new i("nextTexOpacities")),n.uniforms.add(new d("fadeFactor")));const v=s.tileBlendInput===o.ColorComposite,m=s.tileBlendInput===o.GridComposite;m&&n.include(t),v&&n.uniforms.add(new i("backgroundColor")),a.code.add(r`
5
+ import{ReadShadowMapPassParameters as e}from"../shading/ReadShadowMap.glsl.js";import{BackgroundGrid as t}from"./BackgroundGrid.glsl.js";import{TileBlendInput as o}from"./TileBlendInput.js";import{glsl as r,If as c}from"../../shaderModules/glsl.js";import{Uniform as n}from"../../../../../webgl/Uniform.js";class s extends e{constructor(){super(...arguments),this.overlayOpacity=1}}function d(e,n){const{vertex:s,fragment:d,varyings:x}=e;x.add("vtc","vec2"),s.uniforms.add(new l("texOffsetAndScale")),d.uniforms.add(new u("tex")),d.uniforms.add(new i("textureOpacities"));const f=n.textureFadingEnabled&&!n.renderOccluded;f&&(s.uniforms.add(new l("nextTexOffsetAndScale")),x.add("nvtc","vec2"),d.uniforms.add(new u("texNext")),d.uniforms.add(new i("nextTexOpacities")),d.uniforms.add(new a("fadeFactor")));const v=n.tileBlendInput===o.ColorComposite,p=n.tileBlendInput===o.GridComposite;p&&d.include(t),v&&d.uniforms.add(new i("backgroundColor")),s.code.add(r`
6
6
  void forwardTextureCoordinatesWithTransform(in vec2 uv) {
7
7
  vtc = texOffsetAndScale.xy + uv * texOffsetAndScale.zw;
8
8
  ${c(f,"nvtc = nextTexOffsetAndScale.xy + uv * nextTexOffsetAndScale.zw;")}
9
- }`),n.code.add(r`
9
+ }`),d.code.add(r`
10
10
  vec4 getColor(vec4 color, vec2 uv, vec3 opacities) {
11
- ${c(m||v,r`if (opacities.y <= 0.0) {
11
+ ${c(p||v,r`if (opacities.y <= 0.0) {
12
12
  return color * opacities.z * opacities.x;
13
13
  }
14
14
  vec4 bg = vec4(${v?r`backgroundColor`:r`gridColor(uv)`} * opacities.y, opacities.y);
15
15
  vec4 layer = color * opacities.z;
16
- // we need to manually apply alpha premultiplication for compressed textures
17
- // since gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL is not supported for compressed formats
18
- if(premultiplyAlpha) {
19
- return (bg * (1.0 - layer.a) + layer * color.a) * opacities.x;
20
- }
21
- return (bg * (1.0 - layer.a) + layer) * opacities.x;`,"return color * color.a;")}
22
- }`),f?n.code.add(r`vec4 getTileColor() {
16
+ return (bg * (1.0 - layer.a) + layer) * opacities.x;`,"return color;")}
17
+ }`),f?d.code.add(r`vec4 getTileColor() {
23
18
  vec4 color = getColor(texture(tex, vtc), vtc, textureOpacities);
24
19
  if (fadeFactor >= 1.0) {
25
20
  return color;
26
21
  }
27
22
  vec4 nextColor = getColor(texture(texNext, nvtc), nvtc, nextTexOpacities);
28
23
  return mix(nextColor, color, fadeFactor);
29
- }`):n.code.add(r`vec4 getTileColor() {
24
+ }`):d.code.add(r`vec4 getTileColor() {
30
25
  return getColor(texture(tex, vtc), vtc, textureOpacities);
31
- }`)}class d extends s{constructor(e){super(e,"float")}}class i extends s{constructor(e){super(e,"vec3")}}class l extends s{constructor(e){super(e,"vec4")}}class u extends s{constructor(e){super(e,"sampler2D")}}class p extends s{constructor(e){super(e,"bool")}}export{p as BooleanUniform,i as Float3Uniform,a as OverlayTerrainPassParameters,n as TerrainTexture,u as Texture2DUniform};
26
+ }`)}class a extends n{constructor(e){super(e,"float")}}class i extends n{constructor(e){super(e,"vec3")}}class l extends n{constructor(e){super(e,"vec4")}}class u extends n{constructor(e){super(e,"sampler2D")}}export{i as Float3Uniform,s as OverlayTerrainPassParameters,d as TerrainTexture,u as Texture2DUniform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../terrain/BackgroundGrid.glsl.js";import"../terrain/BlendLayersOutput.js";import"../terrain/TileBackground.glsl.js";import"../terrain/TileComposite.glsl.js";import"../../shaderModules/BooleanPassUniform.js";import"../../shaderModules/Float3PassUniform.js";import"../../shaderModules/FloatPassUniform.js";import"../../shaderModules/glsl.js";import"../../shaderModules/Texture2DPassUniform.js";import"../../../../../webgl/ShaderBuilder.js";import"../../../../../webgl/textureUtils.js";export{a as BackgroundMode,b as build}from"../../../../../../chunks/BlendLayers.glsl.js";
5
+ import"../terrain/BackgroundGrid.glsl.js";import"../terrain/BlendLayersOutput.js";import"../terrain/TileBackground.glsl.js";import"../terrain/TileComposite.glsl.js";import"../../shaderModules/Float3PassUniform.js";import"../../shaderModules/FloatPassUniform.js";import"../../shaderModules/glsl.js";import"../../shaderModules/Texture2DPassUniform.js";import"../../../../../webgl/ShaderBuilder.js";export{a as BackgroundMode,b as build}from"../../../../../../chunks/BlendLayers.glsl.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{createResolver as e}from"../../../../core/promiseUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderRequestType as r}from"../lib/basicInterfaces.js";import{RendererTarget as s}from"../lib/rendererUtils.js";import{RenderState as i}from"../../../support/RenderState.js";import{resampleHermite as o}from"../../../support/screenshotUtils.js";import{PixelFormat as n,DataType as a}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as c}from"../../../webgl/FramebufferObject.js";import{createEmptyImageData as h}from"../../../../core/imageUtils.js";class l{constructor(e,t){this.parameters=e,this.fbos=t}}class d{constructor(e,t,r){this._rctx=e,this._renderFunctions=t,this._forceCameraHook=r,this.supersample=!0,this._screenshotQueue=new Array}destroy(){this._rctx=null}async takeScreenshot(t){await this._renderFunctions.prepareOverlay(),this._renderFunctions.requestRenderScene(r.BACKGROUND);const s=e();return this._screenshotQueue.push({settings:t,resolver:s}),s.promise}update(e,t){for(const r of this._screenshotQueue){if(null==this._rctx){r.resolver.reject();continue}const s={...r.settings,pixelRatio:r.settings.pixelRatio*e.parameters.camera.pixelRatio},i=this._renderScreenshot(e,s,t);r.resolver(i)}this._screenshotQueue.length=0}_renderScreenshotOverlay(e,t,r){e.width=t.width,e.height=t.height;const s=e.getContext("2d"),i=r.pixelRatio;return s.save(),s.translate(0,t.height),s.scale(1,-1),r.region&&s.translate(-r.region.x,-r.region.y),s.scale(i,i),t=this._renderFunctions.renderOverlay(e,r.disableDecorations,t),s.restore(),t}_readbackScreenshot(e,t){return e.resample?this._readbackScreenshotResampled({...e,resample:e.resample},t):this._readbackScreenshotImmediate(e,t)}_readbackScreenshotResampled(e,t){const{framebufferWidth:r,framebufferHeight:s,region:i,resample:c}=e,l=this._ensureScreenshotEncodeCanvas();let d=h(r,s,l);this._rctx.gl.readPixels(0,0,r,s,n.RGBA,a.UNSIGNED_BYTE,new Uint8Array(d.data.buffer)),t(),d=this._renderScreenshotOverlay(l,d,{...e,region:void 0});const f=h(i.width,i.height,l);return o(d,f,!0,c.region.x,s-(c.region.y+c.region.height),c.region.width,c.region.height)}_readbackScreenshotImmediate(e,t){const{framebufferHeight:r,region:s}=e,i=this._ensureScreenshotEncodeCanvas(),o=h(s.width,s.height,i);return this._rctx.gl.readPixels(s.x,r-(s.y+s.height),s.width,s.height,n.RGBA,a.UNSIGNED_BYTE,new Uint8Array(o.data.buffer)),t(),this._renderScreenshotOverlay(i,o,e)}_renderScreenshot(e,r,o){const n=e.parameters.camera,a={width:r.framebufferWidth,height:r.framebufferHeight};c(a,Math.min(this._rctx.parameters.maxTextureSize,this._rctx.parameters.maxRenderbufferSize));let h=!1;const l=a.width!==n.fullWidth||a.height!==n.fullHeight,d=r.ignorePadding&&n.pixelRatio!==r.pixelRatio,f=l||r.disableDecorations||d||r.objectAndLayerIdColor;let m=null,u=null;if(f){const e=n.clone();if(r.ignorePadding){const s=t(e.padding);for(let t=0;t<4;t++)s[t]=Math.round(s[t]/e.pixelRatio*r.pixelRatio);e.padding=s}e.fullWidth=a.width,e.fullHeight=a.height,e.pixelRatio=r.pixelRatio;const c=n.fovX-e.fovX,l=n.fovY-e.fovY;c<0&&c<l?e.fovX=n.fovX:l<0&&l<c&&(e.fovY=n.fovY);const d={camera:e,contentCamera:e,mode:i.IDLE,alignPixelEnabled:!0,contentPixelRatio:e.pixelRatio};this._forceCameraHook(d),h=!0;const f=this._renderFunctions.renderScene(d,o,r.objectAndLayerIdColor?s.ObjectAndLayerID:s.Screenshot,r.disableDecorations);u=f.screen,m=f.olid}const p=()=>{this._rctx.bindFramebuffer(null),u?.release()};this._rctx.bindFramebuffer(u?.fbo);const g=this._readbackScreenshot(r,p);let b=null;if(r.objectAndLayerIdColor){const e=()=>{this._rctx.bindFramebuffer(null),m?.release()};this._rctx.bindFramebuffer(m?.fbo),b=this._readbackScreenshot(r,e),this._rctx.bindFramebuffer(null)}if(f&&!this._rctx.contextAttributes.alpha)for(let t=3;t<g.data.length;t+=4)g.data[t]=255;if(b&&!this._rctx.contextAttributes.alpha)for(let t=3;t<b.data.length;t+=4)b.data[t]=255;return h&&this._forceCameraHook(e.parameters),[g,b]}_ensureScreenshotEncodeCanvas(){return this._screenshotEncodeCanvas??=document.createElement("canvas"),this._screenshotEncodeCanvas}}export{l as ScreenshotContext,d as ScreenshotManager};
5
+ import{createResolver as e}from"../../../../core/promiseUtils.js";import{clone as t}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{RenderRequestType as r}from"../lib/basicInterfaces.js";import{RendererTarget as s}from"../lib/rendererUtils.js";import{RenderState as i}from"../../../support/RenderState.js";import{resampleHermite as o}from"../../../support/screenshotUtils.js";import{PixelFormat as n,DataType as a}from"../../../webgl/enums.js";import{ensureAttachmentMaxSize as c}from"../../../webgl/FramebufferObject.js";import{createEmptyImageData as h}from"../../../../core/imageUtils.js";class l{constructor(e,t){this.parameters=e,this.fbos=t}}class d{constructor(e,t,r){this._rctx=e,this._renderFunctions=t,this._forceCameraHook=r,this.supersample=!0,this._screenshotQueue=new Array}destroy(){this._rctx=null}async takeScreenshot(t){await this._renderFunctions.prepareOverlay(),this._renderFunctions.requestRenderScene(r.BACKGROUND);const s=e();return this._screenshotQueue.push({settings:t,resolver:s}),s.promise}update(e,t){for(const r of this._screenshotQueue){if(null==this._rctx){r.resolver.reject();continue}const s={...r.settings,pixelRatio:r.settings.pixelRatio*e.parameters.camera.pixelRatio},i=this._renderScreenshot(e,s,t);r.resolver(i)}this._screenshotQueue.length=0}_renderScreenshotOverlay(e,t,r){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0}),i=r.pixelRatio;return s.save(),s.translate(0,t.height),s.scale(1,-1),r.region&&s.translate(-r.region.x,-r.region.y),s.scale(i,i),t=this._renderFunctions.renderOverlay(e,r.disableDecorations,t),s.restore(),t}_readbackScreenshot(e,t){return e.resample?this._readbackScreenshotResampled({...e,resample:e.resample},t):this._readbackScreenshotImmediate(e,t)}_readbackScreenshotResampled(e,t){const{framebufferWidth:r,framebufferHeight:s,region:i,resample:c}=e,l=this._ensureScreenshotEncodeCanvas();let d=h(r,s,l);this._rctx.gl.readPixels(0,0,r,s,n.RGBA,a.UNSIGNED_BYTE,new Uint8Array(d.data.buffer)),t(),d=this._renderScreenshotOverlay(l,d,{...e,region:void 0});const f=h(i.width,i.height,l);return o(d,f,!0,c.region.x,s-(c.region.y+c.region.height),c.region.width,c.region.height)}_readbackScreenshotImmediate(e,t){const{framebufferHeight:r,region:s}=e,i=this._ensureScreenshotEncodeCanvas(),o=h(s.width,s.height,i);return this._rctx.gl.readPixels(s.x,r-(s.y+s.height),s.width,s.height,n.RGBA,a.UNSIGNED_BYTE,new Uint8Array(o.data.buffer)),t(),this._renderScreenshotOverlay(i,o,e)}_renderScreenshot(e,r,o){const n=e.parameters.camera,a={width:r.framebufferWidth,height:r.framebufferHeight};c(a,Math.min(this._rctx.parameters.maxTextureSize,this._rctx.parameters.maxRenderbufferSize));let h=!1;const l=a.width!==n.fullWidth||a.height!==n.fullHeight,d=r.ignorePadding&&n.pixelRatio!==r.pixelRatio,f=l||r.disableDecorations||d||r.objectAndLayerIdColor;let u=null,m=null;if(f){const e=n.clone();if(r.ignorePadding){const s=t(e.padding);for(let t=0;t<4;t++)s[t]=Math.round(s[t]/e.pixelRatio*r.pixelRatio);e.padding=s}e.fullWidth=a.width,e.fullHeight=a.height,e.pixelRatio=r.pixelRatio;const c=n.fovX-e.fovX,l=n.fovY-e.fovY;c<0&&c<l?e.fovX=n.fovX:l<0&&l<c&&(e.fovY=n.fovY);const d={camera:e,contentCamera:e,mode:i.IDLE,alignPixelEnabled:!0,contentPixelRatio:e.pixelRatio};this._forceCameraHook(d),h=!0;const f=this._renderFunctions.renderScene(d,o,r.objectAndLayerIdColor?s.ObjectAndLayerID:s.Screenshot,r.disableDecorations);m=f.screen,u=f.olid}const p=()=>{this._rctx.bindFramebuffer(null),m?.release()};this._rctx.bindFramebuffer(m?.fbo);const g=this._readbackScreenshot(r,p);let b=null;if(r.objectAndLayerIdColor){const e=()=>{this._rctx.bindFramebuffer(null),u?.release()};this._rctx.bindFramebuffer(u?.fbo),b=this._readbackScreenshot(r,e),this._rctx.bindFramebuffer(null)}if(f&&!this._rctx.contextAttributes.alpha)for(let t=3;t<g.data.length;t+=4)g.data[t]=255;if(b&&!this._rctx.contextAttributes.alpha)for(let t=3;t<b.data.length;t+=4)b.data[t]=255;return h&&this._forceCameraHook(e.parameters),[g,b]}_ensureScreenshotEncodeCanvas(){return this._screenshotEncodeCanvas??=document.createElement("canvas"),this._screenshotEncodeCanvas}}export{l as ScreenshotContext,d as ScreenshotManager};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as i}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as l}from"../lib/OITPass.js";import{blending as s,oitDepthTest as n,depthWrite as o,getDrawBuffers as u,OITPolygonOffset as p}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as c}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as a,stencilToolMaskBaseParams as f,stencilBaseAllZerosParams as d,depthCompareAlways as T,stencilToolTransparentOccluderParams as h,stencilWriteMaskOff as m,stencilToolMaskOccluderParams as E,depthCompareLess as O}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as b,SpecialDrawBuffers as A}from"../../../webgl/enums.js";import{makePipelineState as g,defaultColorWrite as I,unpremultipliedAlphaToPremultipliedAlpha as N}from"../../../webgl/renderState.js";class S extends r{constructor(e,t){super(e,t,new i(R,(()=>import("./RibbonLine.glsl.js"))),_),this.primitiveType=t.wireframe?b.LINES:b.TRIANGLE_STRIP}_makePipelineState(i,r){const{oitPass:c,output:T,hasOccludees:h,hasPolygonOffset:m}=i,E=c===l.NONE,O=c===l.FrontFace;return g({blending:e(T)?s(c):null,depthTest:{func:n(c)},depthWrite:o(i),drawBuffers:T===t.Depth?{buffers:[A.NONE]}:u(c,T),colorWrite:I,stencilWrite:h?a:null,stencilTest:h?r?f:d:null,polygonOffset:E||O?m?L:null:p})}initializePipeline(e){if(e.occluder){const i=e.hasPolygonOffset?L:null;this._occluderPipelineTransparent=g({blending:N,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:I,stencilWrite:null,stencilTest:h,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null}),this._occluderPipelineOpaque=g({blending:N,polygonOffset:i,depthTest:T,depthWrite:null,colorWrite:I,stencilWrite:m,stencilTest:E,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null}),this._occluderPipelineMaskWrite=g({blending:null,polygonOffset:i,depthTest:O,depthWrite:null,colorWrite:null,stencilWrite:a,stencilTest:f,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case c.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case c.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const L={factor:0,units:-4},_=new Map([[P.POSITION,0],[P.PREVIOUSDELTA,1],[P.NEXTDELTA,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.SIZE,5],[P.SIZEFEATUREATTRIBUTE,5],[P.COLOR,6],[P.COLORFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{S as RibbonLineTechnique,_ as vertexAttributeLocations};
5
+ import"../../../../core/has.js";import{isColorOrColorEmission as e,ShaderOutput as t}from"../core/shaderLibrary/ShaderOutput.js";import{ReloadableShaderModule as l}from"../core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as i}from"../core/shaderTechnique/ShaderTechnique.js";import{OITPass as r}from"../lib/OITPass.js";import{blending as s,oitDepthTest as n,depthWrite as u,getDrawBuffers as o,OITPolygonOffset as c}from"../lib/OrderIndependentTransparency.js";import{RenderSlot as p}from"../lib/RenderSlot.js";import{stencilWriteMaskOn as a,stencilToolMaskBaseParams as d,stencilBaseAllZerosParams as f,depthCompareAlways as h,stencilToolTransparentOccluderParams as T,depthCompareLess as O,stencilWriteMaskOff as m,stencilToolMaskOccluderParams as E}from"../lib/StencilUtils.js";import{VertexAttribute as P}from"../lib/VertexAttribute.js";import{R}from"../../../../chunks/RibbonLine.glsl.js";import{PrimitiveType as b,SpecialDrawBuffers as A}from"../../../webgl/enums.js";import{makePipelineState as g,defaultColorWrite as I,unpremultipliedAlphaToPremultipliedAlpha as N}from"../../../webgl/renderState.js";class S extends i{constructor(e,t){super(e,t,new l(R,(()=>import("./RibbonLine.glsl.js"))),_),this.primitiveType=t.wireframe?b.LINES:b.TRIANGLE_STRIP}_makePipelineState(l,i){const{oitPass:p,output:h,hasOccludees:T,hasPolygonOffset:O}=l,m=p===r.NONE,E=p===r.FrontFace;return g({blending:e(h)?s(p):null,depthTest:{func:n(p)},depthWrite:u(l),drawBuffers:h===t.Depth?{buffers:[A.NONE]}:o(p,h),colorWrite:I,stencilWrite:T?a:null,stencilTest:T?i?d:f:null,polygonOffset:m||E?O?L:null:c})}initializePipeline(e){if(e.occluder){const l=e.hasPolygonOffset?L:null;this._occluderPipelineTransparent=g({blending:N,polygonOffset:l,depthTest:h,depthWrite:null,colorWrite:I,stencilWrite:null,stencilTest:e.hasOccludees?T:null,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null}),this._occluderPipelineOpaque=g({blending:N,polygonOffset:l,depthTest:e.hasOccludees?h:O,depthWrite:null,colorWrite:I,stencilWrite:e.hasOccludees?m:null,stencilTest:e.hasOccludees?E:null,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null}),this._occluderPipelineMaskWrite=g({blending:null,polygonOffset:l,depthTest:O,depthWrite:null,colorWrite:null,stencilWrite:e.hasOccludees?a:null,stencilTest:e.hasOccludees?d:null,drawBuffers:e.output===t.Depth?{buffers:[A.NONE]}:null})}return this._occludeePipeline=this._makePipelineState(e,!0),this._makePipelineState(e,!1)}getPipeline(e,t){if(e)return this._occludeePipeline;switch(t){case p.TRANSPARENT_OCCLUDER_MATERIAL:return this._occluderPipelineTransparent??super.getPipeline();case p.OCCLUDER_MATERIAL:return this._occluderPipelineOpaque??super.getPipeline();default:return this._occluderPipelineMaskWrite??super.getPipeline()}}}const L={factor:0,units:-4},_=new Map([[P.POSITION,0],[P.PREVIOUSDELTA,1],[P.NEXTDELTA,2],[P.U0,3],[P.LINEPARAMETERS,4],[P.SIZE,5],[P.SIZEFEATUREATTRIBUTE,5],[P.COLOR,6],[P.COLORFEATUREATTRIBUTE,6],[P.OPACITYFEATUREATTRIBUTE,7],[P.OLIDCOLOR,8]]);export{S as RibbonLineTechnique,_ as vertexAttributeLocations};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{ObservableChangesType as d}from"../core/ObservableChangesType.js";import{throwIfAborted as c}from"../core/promiseUtils.js";import{on as u,watch as g,initial as m,whenOnce as y,syncAndInitial as f,sync as w}from"../core/reactiveUtils.js";import{setFrameDuration as v}from"../core/scheduling.js";import{createScreenPoint as _,createScreenPointArray as b}from"../core/screenUtils.js";import{getMetersPerUnitForSR as M}from"../core/unitUtils.js";import{initialize as S}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as C,ensureClass as O}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as T}from"../core/accessorSupport/overrideDefaultsFrom.js";import{create as x}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{owningCollectionProperty as E}from"../core/support/OwningCollection.js";import L from"../geometry/Extent.js";import P from"../geometry/HeightModelInfo.js";import A from"../geometry/Point.js";import{canProjectWithoutEngine as I,project as H}from"../geometry/projection.js";import G from"../geometry/SpatialReference.js";import{projectBoundingRect as D}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as F}from"../geometry/projection/projectPointToVector.js";import{create as U,toExtent as W}from"../geometry/support/aaBoundingRect.js";import{B as q,a as k}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as B}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as N,isTiledLayer as Q,isVoxelLayer as Y,isIntegratedMeshLayer as Z}from"../layers/support/layerUtils.js";import{AnalysesCollection as $}from"../support/AnalysesCollection.js";import{BreakpointsOwner as J}from"./BreakpointsOwner.js";import{DOMContainer as K}from"./DOMContainer.js";import{FocusAreas as X}from"./FocusAreas.js";import ee from"./GroundView.js";import{PopupView as te}from"./PopupView.js";import ie from"./View.js";import re from"./ViewAnimation.js";import{ViewingMode as se,stringFromViewingMode as ne,viewingModeFromString as ae}from"./ViewingMode.js";import{layerView3DImporter as oe}from"./3d/layerViewModuleImportUtils.js";import le from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as pe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as he}from"./3d/environment/EnvironmentManager.js";import de from"./3d/environment/SceneViewEnvironment.js";import ce from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ge}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as me}from"./3d/layers/support/FeatureTileTree3D.js";import ye from"./3d/state/ViewState.js";import{ViewStateManager as fe}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as we}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as ve}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as _e}from"./3d/support/debugFlags.js";import be from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Me}from"./3d/support/ElevationProvider.js";import{toMap as Se,hitTest as Ve}from"./3d/support/hitTest.js";import{popupHitTest as je}from"./3d/support/popupHitTest.js";import Re from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ce}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Oe}from"./3d/support/ResourceController.js";import Te from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as xe}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Ee}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Le from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Pe,getTiledLayerInfo as Ae,checkIfTileInfoSupportedForView as Ie}from"./3d/terrain/terrainUtils.js";import{Stage as He}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Ge}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{defaultTolerance as De}from"./3d/webgl-engine/lib/Intersector.js";import{terrainId as Fe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{defaultHighlightName as Ue}from"./support/HighlightDefaults.js";import We from"./support/HighlightOptions.js";import{occludeesSupported as qe}from"./support/layerViewUtils.js";import{PropertiesPool as ke}from"./support/PropertiesPool.js";import{isSupportedScreenPointEvent as ze,createScreenPointFromSupportedEvent as Be}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Ne}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Qe,destroyTextureCompressionWorker as Ye}from"./support/TextureCompressionHelper.js";import{check as Ze}from"./support/WebGLRequirements.js";import $e from"./ui/DefaultUI.js";import Je from"./ui/3d/DefaultUI3D.js";import Ke from"../webscene/Environment.js";let Xe=class extends(J(te(K(ie)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new ke({slicePlane:q},this),this._resourceController=Oe(this),this.deconflictor=new ue({view:this}),this.labeler=new ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new $,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new pe,this.environment=new de,this.environmentManager=new he,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new le({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ye({view:this}),this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Je,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.focusAreas=new X({view:this}),S();const t=(e=null)=>{null!=e&&e.type===d.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([u((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),g((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new ce({view:this}),this.stateManager=new fe({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")){const e=Qe(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ee({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>v(e>0?1e3/Math.ceil(e):0)),m),this.addHandles(g((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),w))}destroy(){this.destroyed||(Ye(this),this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this._exitBasemapTerrain(),this.stage?.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof L?this.spatialReference&&(t=et(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===se.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:et(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||G.WGS84,i=et(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||G.WGS84;let t;const i=i=>{const r=et(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new L({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const s=this._get("_groundAndLayersExtent");return t.equals(s)?s:t}castEnvironment(e){return e?e instanceof de?e:e instanceof Ke?this.environment?.cloneWithWebsceneEnvironment(e)??de.fromWebsceneEnvironment(e):C(de,e):new de}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){be.isValidProfile(e)&&(be.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||be.getDefaultProfile()}set slicePlane(e){if(null!=this.stage&&(this.stage.renderer.slicePlane=e),null==e)return void this._set("slicePlane",null);const t=this._propertiesPool.get("slicePlane");k(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?B(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?P.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Pe(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._createGraphicsViewController||this.inputManager?.updating||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return ne(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?ne(this.defaultsFromMap.viewingMode):Ne(t,se.Global)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find((({name:e})=>e===Ue))??new We}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===Ue)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Te(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ze(e)?Be(this,e):e;return Se(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?Me(this.elevationProvider,e):null)??0;return F(e,tt,this.renderSpatialReference,t),this.state.camera.projectToScreen(tt,it),_(it[0],it[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;F(e,tt,i);const r=this.state.camera.computeScreenPixelSizeAt(tt);return t&&i!==t?r*M(i)/M(t):r}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e,(()=>this.pixelSizeAt(e))):1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ze(e)?Be(this,e):e;return Ve(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return je(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshotWithOID(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Ge())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);await this.whenReady();const r=await this.stage.renderView.takeScreenshotWithOID(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return oe.importLayerView(e)}hasLayerViewModule(e){return oe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Ze(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=e?ae(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,se.Local),s=this._validateSpatialReferenceForViewingMode(e,t,se.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,se.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,se.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Ne(e,i)&&(null==t||(!!N(t)||(!Q(t)||null!=Ae(t,e,i))&&(!Y(t)||i!==se.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(N(t)&&(r||s)){return!s||i===se.Local||null===Ie(t.tileInfo,t.fullExtent,e,se.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:G.WebMercator,viewingMode:i}]:[{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}return Q(t)||Y(t)||!r&&!s?Q(t)&&r&&i!==se.Global?[{spatialReference:e,viewingMode:i},{spatialReference:G.WGS84,viewingMode:se.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${ne(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&qe(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.filter((e=>"media-3d"!==e.type)).find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await y((()=>this.graphicsView)),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer):null}_initBasemapTerrain(){this._set("basemapTerrain",new Le({view:this})),this._set("elevationProvider",new ve({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Ee({view:this})),this._set("featureTiles",new me({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?H(W(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>_e.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&_e.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||_e.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),f),this.updatingHandles.add((()=>this.clippingArea),e,f),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,f)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.featureTiles&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this._set("featureTiles",p(this.featureTiles)),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ce.create(this.state.viewingMode,i)),t||this.addHandles(g((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!D(e,this.basemapTerrain.spatialReference,rt,t)||(this.renderCoordsHelper.extent=rt)}),w),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===d.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(g((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),w),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d");return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new we(this.state.viewingMode,(e=>this.stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new He({view:this,options:e,container:i}),this._stage.renderer.slicePlane=this.slicePlane,this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this.stage.renderer.setParameters({highQualityTransparency:e})),m),this.on("pointer-move",(()=>this.stage?.renderer.resetAnimation())),a(this.stage.renderView.canvas,"webglcontextlost",(e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)}))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new xe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;c(e),await y((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this,getGraphics:()=>this.graphics}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ae(this.viewingMode);e===se.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(u((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded();const t=this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties:null,i=t?.environment;i&&(this._overrideDefaultEnvironmentOnly?T(this.environment,i):this.environment=this.environment.cloneWithWebsceneEnvironment(i)),this.timeExtent=t?.timeExtent,this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(Fe);for(const t of this.allLayerViews)Z(t.layer.type)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(Fe);for(const t of this.allLayerViews)Z(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}};function et(e,t){return null!=e&&I(e.spatialReference,t)?H(e,t):null}e([V()],Xe.prototype,"_userClippingArea",void 0),e([V()],Xe.prototype,"_resourceController",void 0),e([V()],Xe.prototype,"_stage",void 0),e([V({readOnly:!0})],Xe.prototype,"deconflictor",void 0),e([V({readOnly:!0})],Xe.prototype,"labeler",void 0),e([V(E($,"analyses"))],Xe.prototype,"analyses",void 0),e([V({type:re,readOnly:!0})],Xe.prototype,"animation",null),e([V({readOnly:!0})],Xe.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],Xe.prototype,"elevationProvider",void 0),e([V()],Xe.prototype,"camera",null),e([V({type:t})],Xe.prototype,"contentCamera",null),e([V({readOnly:!0})],Xe.prototype,"canvas",void 0),e([V({type:A})],Xe.prototype,"center",null),e([V({type:L})],Xe.prototype,"clippingArea",null),e([V({type:pe})],Xe.prototype,"constraints",void 0),e([V({type:L,readOnly:!0})],Xe.prototype,"renderDataExtent",null),e([V({readOnly:!0})],Xe.prototype,"tileInfo",null),e([V({type:L,readOnly:!0})],Xe.prototype,"dataExtent",null),e([V({type:L,readOnly:!0})],Xe.prototype,"_groundAndLayersExtent",null),e([V({type:de})],Xe.prototype,"environment",void 0),e([j("environment")],Xe.prototype,"castEnvironment",null),e([V({readOnly:!0})],Xe.prototype,"environmentManager",void 0),e([V({type:L})],Xe.prototype,"extent",null),e([V({type:r})],Xe.prototype,"floors",void 0),e([V()],Xe.prototype,"screenCenter",null),e([V()],Xe.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],Xe.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],Xe.prototype,"graphicsView",void 0),e([V({readOnly:!0})],Xe.prototype,"analysisViewManager",void 0),e([V()],Xe.prototype,"groundView",void 0),e([V({type:Boolean})],Xe.prototype,"initialExtentRequired",null),e([V()],Xe.prototype,"defaultsFromMapSettings",null),e([V()],Xe.prototype,"interacting",null),e([V()],Xe.prototype,"stationary",null),e([V()],Xe.prototype,"navigating",null),e([V()],Xe.prototype,"map",void 0),e([V()],Xe.prototype,"padding",null),e([V({type:Ee,readOnly:!0})],Xe.prototype,"pointsOfInterest",void 0),e([V({type:me,readOnly:!0})],Xe.prototype,"featureTiles",void 0),e([V()],Xe.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],Xe.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],Xe.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],Xe.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],Xe.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],Xe.prototype,"state",void 0),e([V({readOnly:!0})],Xe.prototype,"inputManager",void 0),e([V({readOnly:!0})],Xe.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],Xe.prototype,"qualityProfile",null),e([V({type:Re,get(){let e=this._get("qualitySettings");return e||(e=new Re,be.apply(this.qualityProfile,e)),e}})],Xe.prototype,"qualitySettings",void 0),e([V()],Xe.prototype,"slicePlane",null),e([V({readOnly:!0})],Xe.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],Xe.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],Xe.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Xe.prototype,"resolution",null),e([V({type:Number})],Xe.prototype,"scale",null),e([V()],Xe.prototype,"heightModelInfo",null),e([V()],Xe.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],Xe.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],Xe.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],Xe.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],Xe.prototype,"type",void 0),e([V(),j((e=>e instanceof $e?e:O(Je,e)))],Xe.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Xe.prototype,"updating",null),e([V()],Xe.prototype,"_updatingObjects",null),e([V()],Xe.prototype,"_updatingObjectsWithProgress",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],Xe.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],Xe.prototype,"viewingMode",null),e([V({type:i})],Xe.prototype,"viewpoint",null),e([V({readOnly:!0})],Xe.prototype,"visibleArea",null),e([V({type:Number})],Xe.prototype,"zoom",null),e([V({type:We})],Xe.prototype,"highlightOptions",null),e([V({readOnly:!0})],Xe.prototype,"quality",null),e([V({readOnly:!0})],Xe.prototype,"resolutionScale",null),e([V()],Xe.prototype,"_defaultToMapOptions",null),e([V()],Xe.prototype,"_defaultHitTestOptions",null),Xe=e([R("esri.views.SceneView")],Xe);const tt=x(),it=b(),rt=U(),st=Xe;export{st as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{ObservableChangesType as d}from"../core/ObservableChangesType.js";import{throwIfAborted as c}from"../core/promiseUtils.js";import{on as u,watch as g,initial as m,whenOnce as y,syncAndInitial as f,sync as w}from"../core/reactiveUtils.js";import{setFrameDuration as v}from"../core/scheduling.js";import{createScreenPoint as _,createScreenPointArray as b}from"../core/screenUtils.js";import{getMetersPerUnitForSR as M}from"../core/unitUtils.js";import{initialize as S}from"../core/workers/workers.js";import{property as V}from"../core/accessorSupport/decorators/property.js";import{cast as j}from"../core/accessorSupport/decorators/cast.js";import"../core/RandomLCG.js";import{subclass as R}from"../core/accessorSupport/decorators/subclass.js";import{ensureType as C,ensureClass as O}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as T}from"../core/accessorSupport/overrideDefaultsFrom.js";import{create as x}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{owningCollectionProperty as E}from"../core/support/OwningCollection.js";import L from"../geometry/Extent.js";import P from"../geometry/HeightModelInfo.js";import A from"../geometry/Point.js";import{canProjectWithoutEngine as I,project as H}from"../geometry/projection.js";import G from"../geometry/SpatialReference.js";import{projectBoundingRect as D}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as F}from"../geometry/projection/projectPointToVector.js";import{create as U,toExtent as W}from"../geometry/support/aaBoundingRect.js";import{B as q,a as k}from"../chunks/boundedPlane.js";import{renderSRFromViewSR as z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as B}from"../geometry/support/scaleUtils.js";import{isImageryTileLayer as N,isTiledLayer as Q,isVoxelLayer as Y,isIntegratedMeshLayer as Z}from"../layers/support/layerUtils.js";import{AnalysesCollection as $}from"../support/AnalysesCollection.js";import{BreakpointsOwner as J}from"./BreakpointsOwner.js";import{DOMContainer as K}from"./DOMContainer.js";import{FocusAreas as X}from"./FocusAreas.js";import ee from"./GroundView.js";import{PopupView as te}from"./PopupView.js";import ie from"./View.js";import re from"./ViewAnimation.js";import{ViewingMode as se,stringFromViewingMode as ne,viewingModeFromString as ae}from"./ViewingMode.js";import{layerView3DImporter as oe}from"./3d/layerViewModuleImportUtils.js";import le from"./3d/analysis/AnalysisViewManager3D.js";import{Constraints as pe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as he}from"./3d/environment/EnvironmentManager.js";import de from"./3d/environment/SceneViewEnvironment.js";import ce from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as ue}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as ge}from"./3d/layers/graphics/Labeler.js";import{FeatureTileTree3D as me}from"./3d/layers/support/FeatureTileTree3D.js";import ye from"./3d/state/ViewState.js";import{ViewStateManager as fe}from"./3d/state/ViewStateManager.js";import{SceneIntersectionHelper as we}from"./3d/state/helpers/SceneIntersectionHelper.js";import{CombinedElevationProvider as ve}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as _e}from"./3d/support/debugFlags.js";import be from"./3d/support/DisplayQualityProfile.js";import{getElevationAtPoint as Me}from"./3d/support/ElevationProvider.js";import{toMap as Se,hitTest as Ve}from"./3d/support/hitTest.js";import{popupHitTest as je}from"./3d/support/popupHitTest.js";import Re from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as Ce}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as Oe}from"./3d/support/ResourceController.js";import Te from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as xe}from"./3d/support/SharedSymbolResources.js";import{PointsOfInterest as Ee}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Le from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Pe,getTiledLayerInfo as Ae,checkIfTileInfoSupportedForView as Ie}from"./3d/terrain/terrainUtils.js";import{Stage as He}from"./3d/webgl-engine/Stage.js";import{olidEnabled as Ge}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{defaultTolerance as De}from"./3d/webgl-engine/lib/Intersector.js";import{terrainId as Fe}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{defaultHighlightName as Ue}from"./support/HighlightDefaults.js";import We from"./support/HighlightOptions.js";import{occludeesSupported as qe}from"./support/layerViewUtils.js";import{PropertiesPool as ke}from"./support/PropertiesPool.js";import{isSupportedScreenPointEvent as ze,createScreenPointFromSupportedEvent as Be}from"./support/screenUtils.js";import{isSpatialReferenceSupported as Ne}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as Qe,destroyTextureCompressionWorker as Ye}from"./support/TextureCompressionHelper.js";import{check as Ze}from"./support/WebGLRequirements.js";import $e from"./ui/DefaultUI.js";import Je from"./ui/3d/DefaultUI3D.js";import Ke from"../webscene/Environment.js";let Xe=class extends(J(te(K(ie)))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new ke({slicePlane:q},this),this._resourceController=Oe(this),this.deconflictor=new ue({view:this}),this.labeler=new ge({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new $,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new pe,this.environment=new de,this.environmentManager=new he,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new le({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ye({view:this}),this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Je,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.focusAreas=new X({view:this}),S();const t=(e=null)=>{null!=e&&e.type===d.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach((async e=>{try{await e.when()}catch{}this._updatingChanged()})))};this.addHandles([u((()=>this.map?.allLayers),"after-changes",(e=>t(e)),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",(e=>this._updateUpdatingMonitors(e))),g((()=>this.map),(e=>{e&&"load"in e&&e.load&&e.load().catch((()=>{}))}))]),this.inputManager=new ce({view:this}),this.stateManager=new fe({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=Qe(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ee({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add((()=>this.qualitySettings.memoryLimit),(e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.additionalCacheMemory),(e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)}),m),this.updatingHandles.add((()=>this.qualitySettings.frameRate??0),(e=>v(e>0?1e3/Math.ceil(e):0)),m),this.addHandles(g((()=>this.spatialReference),(()=>this.notifyChange("clippingArea")),w))}destroy(){this.destroyed||(Ye(this),this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this._exitBasemapTerrain(),this.stage?.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get basemapSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof L?this.spatialReference&&(t=et(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===se.Global)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:et(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||G.WGS84,i=et(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||G.WGS84;let t;const i=i=>{const r=et(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},r=this.basemapTerrain;if(r?.spatialReference){const e=r.groundExtent;i(new L({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}if(this.map){const e=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};this.map.allLayers.forEach((t=>e(t)))}if(null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const s=this._get("_groundAndLayersExtent");return t.equals(s)?s:t}castEnvironment(e){return e?e instanceof de?e:e instanceof Ke?this.environment?.cloneWithWebsceneEnvironment(e)??de.fromWebsceneEnvironment(e):C(de,e):new de}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){be.isValidProfile(e)&&(be.apply(e,this.qualitySettings),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||be.getDefaultProfile()}set slicePlane(e){if(null!=this.stage&&(this.stage.renderer.slicePlane=e),null==e)return void this._set("slicePlane",null);const t=this._propertiesPool.get("slicePlane");k(e,t),this._set("slicePlane",t)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?B(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?P.deriveUnitFromSR(e,this.spatialReference):null}get updating(){if(this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach((r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Pe(r))return;++i,e+=r.updatingProgress}}else++i}));for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._createGraphicsViewController||this.inputManager?.updating||this.map?.allLayers?.some((e=>!e.isFulfilled()))),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return ne(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?ne(this.defaultsFromMap.viewingMode):Ne(t,se.Global)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find((({name:e})=>e===Ue))??new We}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===Ue)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Te(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ze(e)?Be(this,e):e;return Se(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const t=(null==e.z?Me(this.elevationProvider,e):null)??0;return F(e,tt,this.renderSpatialReference,t),this.state.camera.projectToScreen(tt,it),_(it[0],it[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;F(e,tt,i);const r=this.state.camera.computeScreenPixelSizeAt(tt);return t&&i!==t?r*M(i)/M(t):r}overlayPixelSizeInMapUnits(e){const t=this.basemapTerrain.overlayManager;return t?t.overlayPixelSizeInMapUnits(e,(()=>this.pixelSizeAt(e))):1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ze(e)?Be(this,e):e;return Ve(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return je(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t);return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);await this.whenReady();const i=await this.stage.renderView.takeScreenshotWithOID(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!Ge())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);await this.whenReady();const r=await this.stage.renderView.takeScreenshotWithOID(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return oe.importLayerView(e)}hasLayerViewModule(e){return oe.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}async validate(){let e=Ze(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties?.viewingMode:null)??null;return null!=e?ae(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,se.Local),s=this._validateSpatialReferenceForViewingMode(e,t,se.Global);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,se.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,t,se.Global)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!Ne(e,i)&&(null==t||(!!N(t)||(!Q(t)||null!=Ae(t,e,i))&&(!Y(t)||i!==se.Global)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(N(t)&&(r||s)){return!s||i===se.Local||null===Ie(t.tileInfo,t.fullExtent,e,se.Global)?[{spatialReference:e,viewingMode:i},{spatialReference:G.WebMercator,viewingMode:i}]:[{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}return Q(t)||Y(t)||!r&&!s?Q(t)&&r&&i!==se.Global?[{spatialReference:e,viewingMode:i},{spatialReference:G.WGS84,viewingMode:se.Local}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?G.WGS84:G.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${ne(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise((e=>{this.ready?e(this):this._resolveWhenReady.push(e)}))}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&qe(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then((e=>s(e)),(()=>{})).catch((()=>{})),o((()=>{r=!0,null!=i&&(i.remove(),i=null)}))}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter((e=>"media-3d"!==e.type)).find((t=>t.layer===e.layer)):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await y((()=>this.graphicsView)),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise(((t,i)=>{const r=this.map.allLayers.on("change",(s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))}))})):this.whenLayerView(e.layer):null}_initBasemapTerrain(){this._set("basemapTerrain",new Le({view:this})),this._set("elevationProvider",new ve({view:this})),this.elevationProvider.register("ground",this.basemapTerrain)}_exitBasemapTerrain(){this.basemapTerrain&&(this.elevationProvider.unregister(this.basemapTerrain),this.elevationProvider.destroy(),this._set("elevationProvider",null),this.basemapTerrain.destroy(),this._set("basemapTerrain",null))}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Ee({view:this})),this._set("featureTiles",new me({renderCoordsHelper:this.renderCoordsHelper,cameraOnSurface:this.pointsOfInterest.cameraOnSurface,focus:this.pointsOfInterest.focus,tilingSchemeOwner:this.basemapTerrain,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}));const e=()=>{const e=this.basemapTerrain?.extent;if(this.clippingArea||e)if(e&&this.basemapTerrain.spatialReference){const e=null!=this.basemapTerrain.extent&&null!=this.basemapTerrain.spatialReference?H(W(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea?this.featureTiles.filterExtent=this.clippingArea.intersection(e):this.featureTiles.filterExtent=e}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add((()=>_e.FEATURE_TILE_TREE_SHOW_TILES),(e=>{e&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then((({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&_e.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))})):e||!this._featureTreeDebugger||_e.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)}),f),this.updatingHandles.add((()=>this.clippingArea),e,f),this.updatingHandles.add((()=>this.basemapTerrain.extent),e,f)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.featureTiles&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this._set("featureTiles",p(this.featureTiles)),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",Ce.create(this.state.viewingMode,i)),t||this.addHandles(g((()=>this.basemapTerrain?.extent),(e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!D(e,this.basemapTerrain.spatialReference,rt,t)||(this.renderCoordsHelper.extent=rt)}),w),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&e.type===d.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach((e=>{e.destroyed||(this.addHandles(g((()=>[e.updating,e.updatingProgress]),(()=>this._updatingChanged()),w),"updatingMonitors"),e.when((()=>this._updatingChanged()),(()=>this._updatingChanged())))})),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new we(this.state.viewingMode,(e=>this.stage.layers.forAll(e)),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new He({view:this,options:e,container:i}),this._stage.renderer.slicePlane=this.slicePlane,this.addHandles([this.updatingHandles.add((()=>this.qualitySettings.highQualityTransparency),(e=>this.stage.renderer.setParameters({highQualityTransparency:e})),m),this.on("pointer-move",(()=>this.stage?.renderer.resetAnimation())),a(this.stage.renderView.canvas,"webglcontextlost",(e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)}))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(De/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new xe({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController)return;if(0===this.graphics.length)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const t=(await import("./3d/layers/GraphicsView3D.js")).default;c(e),await y((()=>this.basemapTerrain?.ready),e),this._set("graphicsView",new t({view:this,getGraphics:()=>this.graphics}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),null!=this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){const e=ae(this.viewingMode);e===se.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(u((()=>this.graphics),"after-changes",(()=>this._createGraphicsViewIfNeeded())),"graphics-view"),this._createGraphicsViewIfNeeded();const t=this.map&&"initialViewProperties"in this.map?this.map.initialViewProperties:null,i=t?.environment;i&&(this._overrideDefaultEnvironmentOnly?T(this.environment,i):this.environment=this.environment.cloneWithWebsceneEnvironment(i)),this.timeExtent=t?.timeExtent,this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const r=this._resolveWhenReady;this._resolveWhenReady=[],r.forEach((e=>e(this)))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(Fe);for(const t of this.allLayerViews)Z(t.layer.type)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(Fe);for(const t of this.allLayerViews)Z(t.layer.type)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}};function et(e,t){return null!=e&&I(e.spatialReference,t)?H(e,t):null}e([V()],Xe.prototype,"_userClippingArea",void 0),e([V()],Xe.prototype,"_resourceController",void 0),e([V()],Xe.prototype,"_stage",void 0),e([V({readOnly:!0})],Xe.prototype,"deconflictor",void 0),e([V({readOnly:!0})],Xe.prototype,"labeler",void 0),e([V(E($,"analyses"))],Xe.prototype,"analyses",void 0),e([V({type:re,readOnly:!0})],Xe.prototype,"animation",null),e([V({readOnly:!0})],Xe.prototype,"basemapTerrain",void 0),e([V({readOnly:!0})],Xe.prototype,"elevationProvider",void 0),e([V()],Xe.prototype,"camera",null),e([V({type:t})],Xe.prototype,"contentCamera",null),e([V({readOnly:!0})],Xe.prototype,"canvas",void 0),e([V({type:A})],Xe.prototype,"center",null),e([V({type:L})],Xe.prototype,"clippingArea",null),e([V({type:pe})],Xe.prototype,"constraints",void 0),e([V({type:L,readOnly:!0})],Xe.prototype,"renderDataExtent",null),e([V({readOnly:!0})],Xe.prototype,"tileInfo",null),e([V({type:L,readOnly:!0})],Xe.prototype,"dataExtent",null),e([V({type:L,readOnly:!0})],Xe.prototype,"_groundAndLayersExtent",null),e([V({type:de})],Xe.prototype,"environment",void 0),e([j("environment")],Xe.prototype,"castEnvironment",null),e([V({readOnly:!0})],Xe.prototype,"environmentManager",void 0),e([V({type:L})],Xe.prototype,"extent",null),e([V({type:r})],Xe.prototype,"floors",void 0),e([V()],Xe.prototype,"screenCenter",null),e([V()],Xe.prototype,"frustum",null),e([V({type:Number,readOnly:!0})],Xe.prototype,"fullOpacity",void 0),e([V({readOnly:!0})],Xe.prototype,"graphicsView",void 0),e([V({readOnly:!0})],Xe.prototype,"analysisViewManager",void 0),e([V()],Xe.prototype,"groundView",void 0),e([V({type:Boolean})],Xe.prototype,"initialExtentRequired",null),e([V()],Xe.prototype,"defaultsFromMapSettings",null),e([V()],Xe.prototype,"interacting",null),e([V()],Xe.prototype,"stationary",null),e([V()],Xe.prototype,"navigating",null),e([V()],Xe.prototype,"map",void 0),e([V()],Xe.prototype,"padding",null),e([V({type:Ee,readOnly:!0})],Xe.prototype,"pointsOfInterest",void 0),e([V({type:me,readOnly:!0})],Xe.prototype,"featureTiles",void 0),e([V()],Xe.prototype,"_featureTreeDebugger",void 0),e([V({type:Boolean})],Xe.prototype,"screenSizePerspectiveEnabled",void 0),e([V({constructOnly:!0})],Xe.prototype,"deactivatedWebGLExtensions",void 0),e([V({constructOnly:!0})],Xe.prototype,"debugWebGLExtensions",void 0),e([V({constructOnly:!0})],Xe.prototype,"renderCanvas",void 0),e([V({constructOnly:!0})],Xe.prototype,"state",void 0),e([V({readOnly:!0})],Xe.prototype,"inputManager",void 0),e([V({readOnly:!0})],Xe.prototype,"stateManager",void 0),e([V({type:["low","medium","high"]})],Xe.prototype,"qualityProfile",null),e([V({type:Re,get(){let e=this._get("qualitySettings");return e||(e=new Re,be.apply(this.qualityProfile,e)),e}})],Xe.prototype,"qualitySettings",void 0),e([V()],Xe.prototype,"slicePlane",null),e([V({readOnly:!0})],Xe.prototype,"typeSpecificPreconditionsReady",null),e([V({readOnly:!0})],Xe.prototype,"renderCoordsHelper",void 0),e([V({readOnly:!0})],Xe.prototype,"sceneIntersectionHelper",void 0),e([V({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Xe.prototype,"resolution",null),e([V({type:Number})],Xe.prototype,"scale",null),e([V()],Xe.prototype,"heightModelInfo",null),e([V()],Xe.prototype,"spatialReference",void 0),e([V({type:Boolean,constructOnly:!0})],Xe.prototype,"alphaCompositingEnabled",void 0),e([V({constructOnly:!0})],Xe.prototype,"preserveDrawingBufferEnabled",void 0),e([V({type:Boolean})],Xe.prototype,"supersampleScreenshotsEnabled",void 0),e([V({readOnly:!0})],Xe.prototype,"type",void 0),e([V(),j((e=>e instanceof $e?e:O(Je,e)))],Xe.prototype,"ui",void 0),e([V({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Xe.prototype,"updating",null),e([V()],Xe.prototype,"_updatingObjects",null),e([V()],Xe.prototype,"_updatingObjectsWithProgress",null),e([V({type:Number,readOnly:!0,dependsOn:["updating"]})],Xe.prototype,"updatingProgress",void 0),e([V({type:["global","local"]})],Xe.prototype,"viewingMode",null),e([V({type:i})],Xe.prototype,"viewpoint",null),e([V({readOnly:!0})],Xe.prototype,"visibleArea",null),e([V({type:Number})],Xe.prototype,"zoom",null),e([V({type:We})],Xe.prototype,"highlightOptions",null),e([V({readOnly:!0})],Xe.prototype,"quality",null),e([V({readOnly:!0})],Xe.prototype,"resolutionScale",null),e([V()],Xe.prototype,"_defaultToMapOptions",null),e([V()],Xe.prototype,"_defaultHitTestOptions",null),Xe=e([R("esri.views.SceneView")],Xe);const tt=x(),it=b(),rt=U(),st=Xe;export{st 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{memoize as i}from"../../../../core/memoize.js";import{throwIfAborted as r,whenOrAbort as n}from"../../../../core/promiseUtils.js";import{watch as o,on as a,initial as s}from"../../../../core/reactiveUtils.js";import{sqlAnd as l}from"../../../../core/sql.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{elevationContextAffectsAlignment as c}from"../../../../support/elevationInfoUtils.js";import{makeSnappingQuery as u}from"../snappingUtils.js";import{convertSnappingCandidate as g,makeGetGroundElevation as h}from"./queryEngineUtils.js";import{getSnappingCandidateElevationAligner as m}from"./snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as d}from"./snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as v}from"./symbologySnappingCandidates.js";let f=class extends t{get availability(){return 1}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,i=null!=e&&"3d"===e.type;if(!i||"subtype-group"===t.type)return m();const r=async(i,r)=>(await n(e.whenLayerView(t),r)).elevationAlignPointsInFeatures(i,r);return m(i,{elevationInfo:t.elevationInfo,alignPointsInFeatures:r})}get _snappingElevationFilter(){const{view:e}=this,t=null!=e&&"3d"===e.type&&"subtype-group"!==this.layerSource.layer.type;return d(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource;return null!=e&&"3d"===e.type&&"subtype-group"!==t.type?v(this._symbologySnappingSupported,(async(i,n)=>{const o=await e.whenLayerView(t);return r(n),o.queryForSymbologySnapping({candidates:i,spatialReference:e.spatialReference},n)})):v()}get _layerView(){const{view:e}=this;if(null==e)return null;const{layer:t}=this.layerSource;return e.allLayerViews.find((e=>e.layer===t))}get _layerView3D(){const{view:e}=this;return null==e||"2d"===e.type?null:this._layerView}get _symbologySnappingSupported(){return null!=this._layerView3D&&this._layerView3D.symbologySnappingSupported}initialize(){const{view:e}=this,{layer:t}=this.layerSource;null!=e&&"3d"===e.type&&"subtype-group"!==t.type&&this.addHandles([e.elevationProvider.on("elevation-change",(({context:e})=>{const{elevationInfo:i}=t;c(e,i)&&this._snappingElevationAligner.notifyElevationSourceChange()})),o((()=>t.elevationInfo),(()=>this._snappingElevationAligner.notifyElevationSourceChange()),s),o((()=>null!=this._layerView3D?this._layerView3D.layer?.renderer:null),(()=>this._symbologySnappingFetcher.notifySymbologyChange()),s),a((()=>this._layerView3D?.layer),["edits","apply-edits","graphic-update"],(()=>this._symbologySnappingFetcher.notifySymbologyChange()))])}constructor(e){super(e),this.view=null,this.updating=!1,this._memoizedMakeGetGroundElevation=i(h)}refresh(){}async fetchCandidates(e,t){const{layer:i}=this.layerSource,n=i.source;if(!n?.querySnapping)return[];const o=i.createQuery();this._layerView&&"effectiveDisplayFilter"in this._layerView&&(o.where=l(o.where,this._layerView.effectiveDisplayFilter?.where));const a=u(e,this.view?.type??"2d",o),s=await n.querySnapping(a,{signal:t});r(t);const p=e.coordinateHelper.spatialReference,y=await this._snappingElevationAligner.alignCandidates(s.candidates,p,t);r(t);const c=await this._symbologySnappingFetcher.fetch(y,t);r(t);const h=0===c.length?y:[...y,...c],m=this._snappingElevationFilter.filter(a,h),d=this._memoizedMakeGetGroundElevation(this.view,p);return m.map((e=>g(e,d)))}};e([p({constructOnly:!0})],f.prototype,"layerSource",void 0),e([p({constructOnly:!0})],f.prototype,"view",void 0),e([p()],f.prototype,"_snappingElevationAligner",null),e([p()],f.prototype,"_snappingElevationFilter",null),e([p()],f.prototype,"_symbologySnappingFetcher",null),e([p()],f.prototype,"_layerView",null),e([p()],f.prototype,"_layerView3D",null),e([p()],f.prototype,"_symbologySnappingSupported",null),f=e([y("esri.views.interactive.snapping.featureSources.FeatureCollectionSnappingSource")],f);export{f as FeatureCollectionSnappingSource};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{memoize as i}from"../../../../core/memoize.js";import{throwIfAborted as r,whenOrAbort as n}from"../../../../core/promiseUtils.js";import{watch as o,on as a,initial as s}from"../../../../core/reactiveUtils.js";import{sqlAnd as l}from"../../../../core/sql.js";import{property as p}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as y}from"../../../../core/accessorSupport/decorators/subclass.js";import{elevationContextAffectsAlignment as c}from"../../../../support/elevationInfoUtils.js";import{makeSnappingQuery as u}from"../snappingUtils.js";import{convertSnappingCandidate as g,makeGetGroundElevation as h}from"./queryEngineUtils.js";import{getSnappingCandidateElevationAligner as m}from"./snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as d}from"./snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as v}from"./symbologySnappingCandidates.js";let f=class extends t{get availability(){return 1}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,i=null!=e&&"3d"===e.type;if(!i||"subtype-group"===t.type)return m();const r=async(i,r)=>(await n(e.whenLayerView(t),r)).elevationAlignPointsInFeatures(i,r);return m(i,{elevationInfo:t.elevationInfo,alignPointsInFeatures:r})}get _snappingElevationFilter(){const{view:e}=this,t=null!=e&&"3d"===e.type&&"subtype-group"!==this.layerSource.layer.type;return d(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource;return null!=e&&"3d"===e.type&&"subtype-group"!==t.type?v(this._symbologySnappingSupported,(async(i,n)=>{const o=await e.whenLayerView(t);return r(n),o.queryForSymbologySnapping({candidates:i,spatialReference:e.spatialReference},n)})):v()}get _layerView(){const{view:e}=this;if(null==e)return null;const{layer:t}=this.layerSource;return e.allLayerViews.find((e=>e.layer===t))}get _layerView3D(){const{view:e}=this;return null==e||"2d"===e.type?null:this._layerView}get _symbologySnappingSupported(){return null!=this._layerView3D&&this._layerView3D.symbologySnappingSupported}initialize(){const{view:e}=this,{layer:t}=this.layerSource;null!=e&&"3d"===e.type&&"subtype-group"!==t.type&&this.addHandles([e.elevationProvider.on("elevation-change",(({context:e})=>{const{elevationInfo:i}=t;c(e,i)&&this._snappingElevationAligner.notifyElevationSourceChange()})),o((()=>t.elevationInfo),(()=>this._snappingElevationAligner.notifyElevationSourceChange()),s),o((()=>null!=this._layerView3D?this._layerView3D.layer?.renderer:null),(()=>this._symbologySnappingFetcher.notifySymbologyChange()),s),a((()=>this._layerView3D?.layer),["edits","apply-edits","graphic-update"],(()=>this._symbologySnappingFetcher.notifySymbologyChange()))])}constructor(e){super(e),this.view=null,this.updating=!1,this._memoizedMakeGetGroundElevation=i(h)}refresh(){}async fetchCandidates(e,t){const{layer:i}=this.layerSource,{source:n}=i;if(!n?.querySnapping)return[];const o=i.createQuery();this._layerView&&"effectiveDisplayFilter"in this._layerView&&(o.where=l(o.where,this._layerView.effectiveDisplayFilter?.where));const a="returnZ"in i?i.returnZ:void 0,s=u({parameters:e,mode:this.view?.type??"2d",returnZ:a,filter:o}),p=await n.querySnapping(s,{signal:t});r(t);const y=e.coordinateHelper.spatialReference,c=await this._snappingElevationAligner.alignCandidates(p.candidates,y,t);r(t);const h=await this._symbologySnappingFetcher.fetch(c,t);r(t);const m=0===h.length?c:[...c,...h],d=this._snappingElevationFilter.filter(s,m),v=this._memoizedMakeGetGroundElevation(this.view,y);return d.map((e=>g(e,v)))}};e([p({constructOnly:!0})],f.prototype,"layerSource",void 0),e([p({constructOnly:!0})],f.prototype,"view",void 0),e([p()],f.prototype,"_snappingElevationAligner",null),e([p()],f.prototype,"_snappingElevationFilter",null),e([p()],f.prototype,"_symbologySnappingFetcher",null),e([p()],f.prototype,"_layerView",null),e([p()],f.prototype,"_layerView3D",null),e([p()],f.prototype,"_symbologySnappingSupported",null),f=e([y("esri.views.interactive.snapping.featureSources.FeatureCollectionSnappingSource")],f);export{f as FeatureCollectionSnappingSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{removeUnordered as o}from"../../../../core/arrayUtils.js";import{createTask as s}from"../../../../core/asyncUtils.js";import{memoize as r}from"../../../../core/memoize.js";import{allSettledValues as i,throwIfAborted as n,whenOrAbort as a}from"../../../../core/promiseUtils.js";import{initial as p,watch as l,on as d}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import y from"../../../../geometry/Polygon.js";import{canProjectWithoutEngine as m,project as g,initializeProjection as f}from"../../../../geometry/projection.js";import{normalizeCentralMeridianForDisplay as _}from"../../../../geometry/support/normalizeUtilsSync.js";import{featureGeometryTypeKebabDictionary as v}from"../../../../geometry/support/typeUtils.js";import{convertFromGeometry as S}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as w}from"../../../../layers/graphics/OptimizedFeature.js";import{executeQueryForSnapping as j}from"../../../../layers/graphics/data/executeQueryForSnapping.js";import b from"../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as E}from"../../../../layers/graphics/data/QueryEngine.js";import k from"../../../../layers/support/FieldsIndex.js";import{elevationContextAffectsAlignment as F}from"../../../../support/elevationInfoUtils.js";import{symbolHasExtrudeSymbolLayer as C}from"../../../../symbols/support/utils.js";import{sortCandidatesInPlace as A,makeSnappingQuery as P}from"../snappingUtils.js";import{convertSnappingCandidate as I,makeGetGroundElevation as G}from"./queryEngineUtils.js";import{getSnappingCandidateElevationAligner as H}from"./snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as R}from"./snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as x}from"./symbologySnappingCandidates.js";import{TaskPriority as z}from"../../../support/Scheduler.js";const O="graphics-collections";let U=class extends t{get updating(){return this._updatingHandles.updating}get _hasZ(){const e=this.view;return null!=e&&"3d"===e.type&&"map-notes"!==this.layerSource.layer.type}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,o=null!=e&&"3d"===e.type;if(!o||"map-notes"===t.type)return H();const s=async(o,s)=>(await a(e.whenLayerView(t),s)).elevationAlignPointsInFeatures(o,s);return H(o,{elevationInfo:t.elevationInfo,alignPointsInFeatures:s})}get _snappingElevationFilter(){const{view:e}=this,t=null!=e&&"3d"===e.type&&"map-notes"!==this.layerSource.layer.type;return R(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource,o=null!=e&&"3d"===e.type,s=this._extrudedPolygonSymbolsCount>0;return o&&"map-notes"!==t.type&&s?x(s,(async(o,s)=>{const r=await e.whenLayerView(t);return n(s),r.queryForSymbologySnapping({candidates:o,spatialReference:e.spatialReference},s)})):x()}constructor(e){super(e),this.availability=1,this._sources={multipoint:null,point:null,polygon:null,polyline:null},this._loadedWkids=new Set,this._loadedWkts=new Set,this._pendingAdds=[],this._extrudedPolygonSymbolsCount=0,this._updatingHandles=new h,this._memoizedMakeGetGroundElevation=r(G)}destroy(){for(const e of this._pendingAdds)e.task.abort();this._pendingAdds.length=0,this._mapSources((e=>this._destroySource(e))),this._updatingHandles.destroy()}initialize(){this._updatingHandles.add((()=>this.getGraphicsLayers()),(e=>{this._updatingHandles.removeHandles(O);for(const t of e)this._addMany(t.graphics.toArray()),this.addHandles([t.on("graphic-update",(e=>this._onGraphicUpdate(e))),this._updatingHandles.addOnCollectionChange((()=>t.graphics),(e=>this._onGraphicsChanged(e)))],O)}),p);const{view:e}=this,{layer:t}=this.layerSource;null!=e&&"3d"===e.type&&"map-notes"!==t.type&&e.elevationProvider&&this.addHandles([e.elevationProvider.on("elevation-change",(({context:e})=>{F(e,t.elevationInfo)&&this._snappingElevationAligner.notifyElevationSourceChange()})),l((()=>t.elevationInfo),(()=>this._snappingElevationAligner.notifyElevationSourceChange()),p),d((()=>t),["edits","apply-edits","graphic-update"],(()=>this._symbologySnappingFetcher.notifySymbologyChange()))])}async fetchCandidates(e,t){const{point:o,coordinateHelper:{spatialReference:s}}=e,r=await i(this._mapSources((o=>this._fetchCandidatesForSource(o,e,t))));n(t);const a=this._memoizedMakeGetGroundElevation(this.view,s),p=r.flat().map((e=>I(e,a)));return A(o,p),p}async _fetchCandidatesForSource(e,t,o){const s=P(t,this.view?.type??"2d"),r=await j(e.queryEngine,s,o);n(o);const i=await this._snappingElevationAligner.alignCandidates(r.candidates,t.coordinateHelper.spatialReference,o);n(o);const a=await this._symbologySnappingFetcher.fetch(i,o);n(o);const p=0===a.length?i:[...i,...a];return this._snappingElevationFilter.filter(s,p)}refresh(){}_onGraphicUpdate(e){if(this.getGraphicsLayers().some((t=>t.graphics.includes(e.graphic))))switch(e.property){case"geometry":case"visible":this._remove(e.graphic),this._addMany([e.graphic])}}_onGraphicsChanged(e){for(const t of e.removed)this._remove(t);this._addMany(e.added)}_addMany(e){const t=[],o=new Map;for(const s of e)null!=s.geometry&&(this._needsInitializeProjection(s.geometry.spatialReference)?(t.push(s.geometry.spatialReference),o.set(s.uid,s)):this._add(s));this._createPendingAdd(t,o)}_createPendingAdd(e,t){if(!e.length)return;const r=s((async o=>{await f(e.map((e=>({source:e,dest:this.spatialReference}))),{signal:o}),this._markLoadedSpatialReferences(e);for(const e of t.values())this._add(e)}));this._updatingHandles.addPromise(r.promise);const i={task:r,graphics:t},n=()=>o(this._pendingAdds,i);r.promise.then(n,n),this._pendingAdds.push(i)}_markLoadedSpatialReferences(e){for(const t of e){null!=t.wkid&&this._loadedWkids.add(t.wkid);const e=t.wkt2||t.wkt;e&&this._loadedWkts.add(e)}}_add(e){if(null==e.geometry||!e.visible)return;let t=e.geometry;if("mesh"===t.type)return;"extent"===t.type&&(t=y.fromExtent(t));const o=this._ensureSource(t.type);if(null==o)return;const s=this._createOptimizedFeature(e.uid,t);null!=s&&(o.featureStore.add(s),C(e.symbol)&&this._extrudedPolygonSymbolsCount++)}_needsInitializeProjection(e){if(null!=e.wkid&&this._loadedWkids.has(e.wkid))return!1;const t=e.wkt2||e.wkt;return(!t||!this._loadedWkts.has(t))&&!m(e,this.spatialReference)}_createOptimizedFeature(e,t){const o=g(_(t),this.spatialReference);if(!o)return null;const s=this._ensureGeometryHasZ(o),r=S(s,this._hasZ,!1);return new w(r,{[Z]:e},null,e)}_ensureGeometryHasZ(e){if(!this._hasZ)return e;const t=e=>{for(;e.length<3;)e.push(0)},o=e.clone();switch(o.hasZ=!0,o.type){case"point":o.z=o.z??0;break;case"multipoint":o.points.forEach(t);break;case"polyline":o.paths.forEach((e=>e.forEach(t)));break;case"polygon":o.rings.forEach((e=>e.forEach(t)))}return o}_ensureSource(e){const t=this._sources[e];if(null!=t)return t;const o=this._createSource(e);return this._sources[e]=o,o}_createSource(e){const t=v.toJSON(e),o=this._hasZ,s=new b({geometryType:t,hasZ:o,hasM:!1});return{featureStore:s,queryEngine:new E({featureStore:s,fieldsIndex:k.fromLayerJSON({fields:[{name:Z,type:"esriFieldTypeOID",alias:Z}]}),geometryType:t,hasM:!1,hasZ:o,objectIdField:Z,spatialReference:this.spatialReference,priority:z.SNAPPING,scheduler:null!=this.view&&"3d"===this.view.type?this.view.resourceController.scheduler:null}),type:e}}_remove(e){this._mapSources((t=>this._removeFromSource(t,e)));for(const t of this._pendingAdds)t.graphics.delete(e.uid),0===t.graphics.size&&t.task.abort()}_removeFromSource(e,t){const o=t.uid;e.featureStore.has(o)&&(e.featureStore.removeById(t.uid),C(t.symbol)&&this._extrudedPolygonSymbolsCount--)}_destroySource(e){e.queryEngine.destroy(),this._sources[e.type]=null}_mapSources(e){const{point:t,polygon:o,polyline:s,multipoint:r}=this._sources,i=[];return null!=t&&i.push(e(t)),null!=o&&i.push(e(o)),null!=s&&i.push(e(s)),null!=r&&i.push(e(r)),i}};e([c()],U.prototype,"getGraphicsLayers",void 0),e([c({constructOnly:!0})],U.prototype,"layerSource",void 0),e([c({constructOnly:!0})],U.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],U.prototype,"view",void 0),e([c({readOnly:!0})],U.prototype,"updating",null),e([c({readOnly:!0})],U.prototype,"availability",void 0),e([c()],U.prototype,"_hasZ",null),e([c()],U.prototype,"_snappingElevationAligner",null),e([c()],U.prototype,"_snappingElevationFilter",null),e([c()],U.prototype,"_symbologySnappingFetcher",null),e([c()],U.prototype,"_extrudedPolygonSymbolsCount",void 0),U=e([u("esri.views.interactive.snapping.featureSources.GraphicsSnappingSource")],U);const Z="OBJECTID";export{U as GraphicsSnappingSource};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{removeUnordered as o}from"../../../../core/arrayUtils.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{memoize as s}from"../../../../core/memoize.js";import{allSettledValues as i,throwIfAborted as n,whenOrAbort as a}from"../../../../core/promiseUtils.js";import{initial as p,watch as l,on as d}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import y from"../../../../geometry/Polygon.js";import{canProjectWithoutEngine as m,project as g,initializeProjection as f}from"../../../../geometry/projection.js";import{normalizeCentralMeridianForDisplay as _}from"../../../../geometry/support/normalizeUtilsSync.js";import{featureGeometryTypeKebabDictionary as v}from"../../../../geometry/support/typeUtils.js";import{convertFromGeometry as S}from"../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as w}from"../../../../layers/graphics/OptimizedFeature.js";import{executeQueryForSnapping as j}from"../../../../layers/graphics/data/executeQueryForSnapping.js";import b from"../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as E}from"../../../../layers/graphics/data/QueryEngine.js";import k from"../../../../layers/support/FieldsIndex.js";import{elevationContextAffectsAlignment as F}from"../../../../support/elevationInfoUtils.js";import{symbolHasExtrudeSymbolLayer as C}from"../../../../symbols/support/utils.js";import{sortCandidatesInPlace as A,makeSnappingQuery as P}from"../snappingUtils.js";import{convertSnappingCandidate as I,makeGetGroundElevation as G}from"./queryEngineUtils.js";import{getSnappingCandidateElevationAligner as H}from"./snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as R}from"./snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as x}from"./symbologySnappingCandidates.js";import{TaskPriority as z}from"../../../support/Scheduler.js";const O="graphics-collections";let U=class extends t{get updating(){return this._updatingHandles.updating}get _hasZ(){const e=this.view;return null!=e&&"3d"===e.type&&"map-notes"!==this.layerSource.layer.type}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,o=null!=e&&"3d"===e.type;if(!o||"map-notes"===t.type)return H();const r=async(o,r)=>(await a(e.whenLayerView(t),r)).elevationAlignPointsInFeatures(o,r);return H(o,{elevationInfo:t.elevationInfo,alignPointsInFeatures:r})}get _snappingElevationFilter(){const{view:e}=this,t=null!=e&&"3d"===e.type&&"map-notes"!==this.layerSource.layer.type;return R(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource,o=null!=e&&"3d"===e.type,r=this._extrudedPolygonSymbolsCount>0;return o&&"map-notes"!==t.type&&r?x(r,(async(o,r)=>{const s=await e.whenLayerView(t);return n(r),s.queryForSymbologySnapping({candidates:o,spatialReference:e.spatialReference},r)})):x()}constructor(e){super(e),this.availability=1,this._sources={multipoint:null,point:null,polygon:null,polyline:null},this._loadedWkids=new Set,this._loadedWkts=new Set,this._pendingAdds=[],this._extrudedPolygonSymbolsCount=0,this._updatingHandles=new h,this._memoizedMakeGetGroundElevation=s(G)}destroy(){for(const e of this._pendingAdds)e.task.abort();this._pendingAdds.length=0,this._mapSources((e=>this._destroySource(e))),this._updatingHandles.destroy()}initialize(){this._updatingHandles.add((()=>this.getGraphicsLayers()),(e=>{this._updatingHandles.removeHandles(O);for(const t of e)this._addMany(t.graphics.toArray()),this.addHandles([t.on("graphic-update",(e=>this._onGraphicUpdate(e))),this._updatingHandles.addOnCollectionChange((()=>t.graphics),(e=>this._onGraphicsChanged(e)))],O)}),p);const{view:e}=this,{layer:t}=this.layerSource;null!=e&&"3d"===e.type&&"map-notes"!==t.type&&e.elevationProvider&&this.addHandles([e.elevationProvider.on("elevation-change",(({context:e})=>{F(e,t.elevationInfo)&&this._snappingElevationAligner.notifyElevationSourceChange()})),l((()=>t.elevationInfo),(()=>this._snappingElevationAligner.notifyElevationSourceChange()),p),d((()=>t),["edits","apply-edits","graphic-update"],(()=>this._symbologySnappingFetcher.notifySymbologyChange()))])}async fetchCandidates(e,t){const{point:o,coordinateHelper:{spatialReference:r}}=e,s=await i(this._mapSources((o=>this._fetchCandidatesForSource(o,e,t))));n(t);const a=this._memoizedMakeGetGroundElevation(this.view,r),p=s.flat().map((e=>I(e,a)));return A(o,p),p}async _fetchCandidatesForSource(e,t,o){const r=P({parameters:t,mode:this.view?.type??"2d"}),s=await j(e.queryEngine,r,o);n(o);const i=await this._snappingElevationAligner.alignCandidates(s.candidates,t.coordinateHelper.spatialReference,o);n(o);const a=await this._symbologySnappingFetcher.fetch(i,o);n(o);const p=0===a.length?i:[...i,...a];return this._snappingElevationFilter.filter(r,p)}refresh(){}_onGraphicUpdate(e){if(this.getGraphicsLayers().some((t=>t.graphics.includes(e.graphic))))switch(e.property){case"geometry":case"visible":this._remove(e.graphic),this._addMany([e.graphic])}}_onGraphicsChanged(e){for(const t of e.removed)this._remove(t);this._addMany(e.added)}_addMany(e){const t=[],o=new Map;for(const r of e)null!=r.geometry&&(this._needsInitializeProjection(r.geometry.spatialReference)?(t.push(r.geometry.spatialReference),o.set(r.uid,r)):this._add(r));this._createPendingAdd(t,o)}_createPendingAdd(e,t){if(!e.length)return;const s=r((async o=>{await f(e.map((e=>({source:e,dest:this.spatialReference}))),{signal:o}),this._markLoadedSpatialReferences(e);for(const e of t.values())this._add(e)}));this._updatingHandles.addPromise(s.promise);const i={task:s,graphics:t},n=()=>o(this._pendingAdds,i);s.promise.then(n,n),this._pendingAdds.push(i)}_markLoadedSpatialReferences(e){for(const t of e){null!=t.wkid&&this._loadedWkids.add(t.wkid);const e=t.wkt2||t.wkt;e&&this._loadedWkts.add(e)}}_add(e){if(null==e.geometry||!e.visible)return;let t=e.geometry;if("mesh"===t.type)return;"extent"===t.type&&(t=y.fromExtent(t));const o=this._ensureSource(t.type);if(null==o)return;const r=this._createOptimizedFeature(e.uid,t);null!=r&&(o.featureStore.add(r),C(e.symbol)&&this._extrudedPolygonSymbolsCount++)}_needsInitializeProjection(e){if(null!=e.wkid&&this._loadedWkids.has(e.wkid))return!1;const t=e.wkt2||e.wkt;return(!t||!this._loadedWkts.has(t))&&!m(e,this.spatialReference)}_createOptimizedFeature(e,t){const o=g(_(t),this.spatialReference);if(!o)return null;const r=this._ensureGeometryHasZ(o),s=S(r,this._hasZ,!1);return new w(s,{[Z]:e},null,e)}_ensureGeometryHasZ(e){if(!this._hasZ)return e;const t=e=>{for(;e.length<3;)e.push(0)},o=e.clone();switch(o.hasZ=!0,o.type){case"point":o.z=o.z??0;break;case"multipoint":o.points.forEach(t);break;case"polyline":o.paths.forEach((e=>e.forEach(t)));break;case"polygon":o.rings.forEach((e=>e.forEach(t)))}return o}_ensureSource(e){const t=this._sources[e];if(null!=t)return t;const o=this._createSource(e);return this._sources[e]=o,o}_createSource(e){const t=v.toJSON(e),o=this._hasZ,r=new b({geometryType:t,hasZ:o,hasM:!1});return{featureStore:r,queryEngine:new E({featureStore:r,fieldsIndex:k.fromLayerJSON({fields:[{name:Z,type:"esriFieldTypeOID",alias:Z}]}),geometryType:t,hasM:!1,hasZ:o,objectIdField:Z,spatialReference:this.spatialReference,priority:z.SNAPPING,scheduler:null!=this.view&&"3d"===this.view.type?this.view.resourceController.scheduler:null}),type:e}}_remove(e){this._mapSources((t=>this._removeFromSource(t,e)));for(const t of this._pendingAdds)t.graphics.delete(e.uid),0===t.graphics.size&&t.task.abort()}_removeFromSource(e,t){const o=t.uid;e.featureStore.has(o)&&(e.featureStore.removeById(t.uid),C(t.symbol)&&this._extrudedPolygonSymbolsCount--)}_destroySource(e){e.queryEngine.destroy(),this._sources[e.type]=null}_mapSources(e){const{point:t,polygon:o,polyline:r,multipoint:s}=this._sources,i=[];return null!=t&&i.push(e(t)),null!=o&&i.push(e(o)),null!=r&&i.push(e(r)),null!=s&&i.push(e(s)),i}};e([c()],U.prototype,"getGraphicsLayers",void 0),e([c({constructOnly:!0})],U.prototype,"layerSource",void 0),e([c({constructOnly:!0})],U.prototype,"spatialReference",void 0),e([c({constructOnly:!0})],U.prototype,"view",void 0),e([c({readOnly:!0})],U.prototype,"updating",null),e([c({readOnly:!0})],U.prototype,"availability",void 0),e([c()],U.prototype,"_hasZ",null),e([c()],U.prototype,"_snappingElevationAligner",null),e([c()],U.prototype,"_snappingElevationFilter",null),e([c()],U.prototype,"_symbologySnappingFetcher",null),e([c()],U.prototype,"_extrudedPolygonSymbolsCount",void 0),U=e([u("esri.views.interactive.snapping.featureSources.GraphicsSnappingSource")],U);const Z="OBJECTID";export{U as GraphicsSnappingSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import{createResolver as i,throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as s,whenOnce as a,sync as n}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 l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../../core/support/UpdatingHandles.js";import d from"../../../../../geometry/SpatialReference.js";import{fromJSON as c}from"../../../../../geometry/support/jsonUtils.js";import{executeQueryForSnapping as h}from"../../../../../layers/graphics/data/executeQueryForSnapping.js";import p from"../../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as f}from"../../../../../layers/graphics/data/QueryEngine.js";import m from"../../../../../layers/support/TileInfo.js";import g from"../../../../../rest/support/Query.js";import y from"../../../../../symbols/support/ElevationInfo.js";import{getSnappingCandidateElevationAligner as _}from"../snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as S}from"../snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as F}from"../symbologySnappingCandidates.js";import{FeatureServiceTiledFetcher as v}from"./FeatureServiceTiledFetcher.js";import{FeatureServiceTileStore as w}from"./FeatureServiceTileStore.js";let I=class extends t.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=i(),this._elevationAligner=_(),this._elevationFilter=S(),this._symbologyCandidatesFetcher=F(),this._updatingHandles=new u,this._alignPointsInFeatures=async(e,t)=>{const i={query:e},s=await this.remoteClient.invoke("alignElevation",i,{signal:t});return r(t),s},this._getSymbologyCandidates=async(e,t)=>{const i={candidates:e,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return r(t),s}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:i,timeInfo:r,fieldsIndex:a}=e.serviceInfo,{hasZ:o}=e,l=d.fromJSON(e.spatialReference);this._spatialReference=l,this._featureStore=new p({...e.serviceInfo,hasZ:o,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new f({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:a,hasZ:o,hasM:!1,objectIdField:i,timeInfo:r}),this._featureFetcher=new v({store:new w({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:l,sourceSpatialReference:d.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const u="3d"===e.configuration.viewType;return this._elevationAligner=_(u,{elevationInfo:null!=e.elevationInfo?y.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=S(u),this.addHandles([s((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),n),s((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),C}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.suspended=e,C}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.outFields=new Set(e??[]),C}async fetchCandidates(e,t){await this._whenSetup.promise,r(t);const i=b(e),s=t?.signal,a=await h(this._queryEngine,i,s);r(s);const n=await this._elevationAligner.alignCandidates(a.candidates,d.fromJSON(e.point.spatialReference)??d.WGS84,s);r(s);const o=await this._symbologyCandidatesFetcher.fetch(n,s);r(s);const l=0===o.length?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?m.fromJSON(e.tileInfo):null,C}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.refresh(),C}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await a((()=>!this.updating),t),r(t),C}async getDebugInfo(e,t){return r(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),r(t),C}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),C}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),C}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),C}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=F(e,this._getSymbologyCandidates),C}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?g.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};e([o({readOnly:!0})],I.prototype,"updating",null),e([o()],I.prototype,"_isInitializing",void 0),I=e([l("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],I);const j=I;function b(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:i,spatialRel:r,where:s,timeExtent:a,objectIds:n}=e.filter,o={geometry:e.filter.geometry?c(e.filter.geometry):void 0,distance:t,units:i,spatialRel:r,timeExtent:a,objectIds:n,where:s??"1=1"};return{...e,query:o}}const C={result:{}};export{j as default};
5
+ import{_ as e}from"../../../../../chunks/tslib.es6.js";import t from"../../../../../core/Evented.js";import{createResolver as i,throwIfAborted as r}from"../../../../../core/promiseUtils.js";import{watch as s,whenOnce as a,sync as n}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 l}from"../../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as u}from"../../../../../core/support/UpdatingHandles.js";import d from"../../../../../geometry/SpatialReference.js";import{fromJSON as c}from"../../../../../geometry/support/jsonUtils.js";import{executeQueryForSnapping as h}from"../../../../../layers/graphics/data/executeQueryForSnapping.js";import p from"../../../../../layers/graphics/data/FeatureStore.js";import{QueryEngine as f}from"../../../../../layers/graphics/data/QueryEngine.js";import m from"../../../../../layers/support/TileInfo.js";import g from"../../../../../rest/support/Query.js";import y from"../../../../../symbols/support/ElevationInfo.js";import{getSnappingCandidateElevationAligner as _}from"../snappingCandidateElevationAlignment.js";import{getSnappingCandidateElevationFilter as S}from"../snappingCandidateElevationFilter.js";import{getSymbologySnappingCandidatesFetcher as F}from"../symbologySnappingCandidates.js";import{FeatureServiceTiledFetcher as v}from"./FeatureServiceTiledFetcher.js";import{FeatureServiceTileStore as w}from"./FeatureServiceTileStore.js";let I=class extends t.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=i(),this._elevationAligner=_(),this._elevationFilter=S(),this._symbologyCandidatesFetcher=F(),this._updatingHandles=new u,this._alignPointsInFeatures=async(e,t)=>{const i={query:e},s=await this.remoteClient.invoke("alignElevation",i,{signal:t});return r(t),s},this._getSymbologyCandidates=async(e,t)=>{const i={candidates:e,spatialReference:this._spatialReference.toJSON()},s=await this.remoteClient.invoke("getSymbologyCandidates",i,{signal:t});return r(t),s}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:i,timeInfo:r,fieldsIndex:a}=e.serviceInfo,{hasZ:o}=e,l=d.fromJSON(e.spatialReference);this._spatialReference=l,this._featureStore=new p({...e.serviceInfo,hasZ:o,hasM:!1}),this._featureStore.estimateFeatureUsedMemory=e=>e.usedMemory,this._queryEngine=new f({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:a,hasZ:o,hasM:!1,objectIdField:i,timeInfo:r}),this._featureFetcher=new v({store:new w({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:l,sourceSpatialReference:d.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const u="3d"===e.configuration.viewType;return this._elevationAligner=_(u,{elevationInfo:null!=e.elevationInfo?y.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=S(u),this.addHandles([s((()=>this._featureFetcher.availability),(e=>this.emit("notify-availability",{availability:e})),n),s((()=>this.updating),(()=>this._notifyUpdating()))]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),C}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.suspended=e,C}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.outFields=new Set(e??[]),C}async fetchCandidates(e,t){await this._whenSetup.promise,r(t);const i=b(e,this._featureStore.hasZ),s=t?.signal,a=await h(this._queryEngine,i,s);r(s);const n=await this._elevationAligner.alignCandidates(a.candidates,d.fromJSON(e.point.spatialReference)??d.WGS84,s);r(s);const o=await this._symbologyCandidatesFetcher.fetch(n,s);r(s);const l=0===o.length?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(i,l)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=null!=e.tileInfo?m.fromJSON(e.tileInfo):null,C}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),this._featureFetcher.refresh(),C}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await a((()=>!this.updating),t),r(t),C}async getDebugInfo(e,t){return r(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),r(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),r(t),C}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),C}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),C}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),C}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=F(e,this._getSymbologyCandidates),C}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=null!=e.filter?g.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};e([o({readOnly:!0})],I.prototype,"updating",null),e([o()],I.prototype,"_isInitializing",void 0),I=e([l("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],I);const j=I;function b(e,t){const i=!!t||void 0;if(!e.filter)return{...e,query:{where:"1=1",returnZ:i}};const{distance:r,units:s,spatialRel:a,where:n,timeExtent:o,objectIds:l}=e.filter,u={geometry:e.filter.geometry?c(e.filter.geometry):void 0,distance:r,units:s,spatialRel:a,timeExtent:o,objectIds:l,returnZ:i,where:n??"1=1"};return{...e,query:u}}const C={result:{}};export{j 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";import{intersection as n}from"../../../core/SetUtils.js";import{sqlAnd as r}from"../../../core/sql.js";import{mergeTimeExtents as o}from"../../../core/timeUtils.js";import{s as i}from"../../../chunks/vec32.js";import{makeDehydratedPoint as s}from"../../../layers/graphics/dehydratedPoint.js";import a from"../../../rest/support/Query.js";import{ViewEventPriorities as l}from"../../input/InputManager.js";import{snappingKeys as p}from"../keybindings.js";import{fromAnyMapPoint as c}from"../sketch/normalizedPoint.js";import{isWebMap as m}from"../../../webmap/utils.js";const d=Symbol("grid-placement-graphic");function g(e,t){const n=e.length===t.length&&e[0]===t[0]&&e[1]===t[1];switch(e.length){case 2:return n;case 3:return n&&e[2]===t[2];case 4:return n&&e[2]===t[2]&&e[3]===t[3]}return!1}function u(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function f(e,t){return Math.sqrt(u(e,t))}function E(e,t){t.sort(((t,n)=>i(t.targetPoint,e)-i(n.targetPoint,e)))}var h;function y({point:e,distance:t,returnEdge:n,vertexMode:i,coordinateHelper:{spatialReference:l},filter:p},c,m){return m=null!=m?m.clone():new a({where:"1=1"}),p&&(m.geometry=p.geometry,m.distance=p.distance,m.spatialRelationship=p.spatialRelationship,m.where=r(m.where,p.where),m.timeExtent=o(m.timeExtent,p.timeExtent),m.objectIds=w(m.objectIds,p.objectIds)),{point:s(e[0],e[1],e[2],l.toJSON()),mode:c,distance:t,returnEdge:n,vertexMode:i,query:m.toJSON()}}function w(e,t){return e||t?t?e?Array.from(n(new Set(e),new Set(t))):t:e:null}function j(e,t,n){return{left:c(e.leftVertex.pos,t,n),right:c(e.rightVertex.pos,t,n)}}!function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"}(h||(h={}));const R=Symbol("snapping-toggle");function N(n,r=()=>{}){const o=e((()=>({view:n.view,snappingOptions:n.snappingOptions})),(({view:e,snappingOptions:t})=>{if(n.removeHandles(R),!e||!t)return;const o=l.TOOL,i=[e.on("key-down",(e=>{e.key!==p.toggle||e.repeat||(t.enabledToggled=!0,r())}),o),e.on("key-up",(e=>{e.key===p.toggle&&(t.enabledToggled=!1,r())}),o),e.on("pointer-move",(e=>{const n=e.native.ctrlKey;t.enabledToggled!==n&&(t.enabledToggled=n,r())}),o)];n.addHandles(i,R)}),t);n.addHandles(o)}function b(e){return m(e)&&"utilityNetworks"in e&&!!e.utilityNetworks?.length}export{h as LineSegmentHintType,j as editEdgeToSnappingEdge,d as gridPlacementGraphicSymbol,b as isUtilityNetworkWebMap,y as makeSnappingQuery,g as objectEqual,f as screenDistance,N as setupSnappingToggleHandles,E as sortCandidatesInPlace,u as squaredScreenDistance};
5
+ import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";import{intersection as n}from"../../../core/SetUtils.js";import{sqlAnd as r}from"../../../core/sql.js";import{mergeTimeExtents as o}from"../../../core/timeUtils.js";import{s as i}from"../../../chunks/vec32.js";import{makeDehydratedPoint as s}from"../../../layers/graphics/dehydratedPoint.js";import a from"../../../rest/support/Query.js";import{ViewEventPriorities as p}from"../../input/InputManager.js";import{snappingKeys as c}from"../keybindings.js";import{fromAnyMapPoint as l}from"../sketch/normalizedPoint.js";import{isWebMap as m}from"../../../webmap/utils.js";const d=Symbol("grid-placement-graphic");function u(e,t){const n=e.length===t.length&&e[0]===t[0]&&e[1]===t[1];switch(e.length){case 2:return n;case 3:return n&&e[2]===t[2];case 4:return n&&e[2]===t[2]&&e[3]===t[3]}return!1}function g(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function f(e,t){return Math.sqrt(g(e,t))}function E(e,t){t.sort(((t,n)=>i(t.targetPoint,e)-i(n.targetPoint,e)))}var h;function y({parameters:{point:e,distance:t,returnEdge:n,vertexMode:i,coordinateHelper:{spatialReference:p},filter:c},mode:l,returnZ:m,filter:d}){const u=d?.clone()??new a({where:"1=1"});return u.returnZ=m??"3d"===l,c&&(u.geometry=c.geometry,u.distance=c.distance,u.spatialRelationship=c.spatialRelationship,u.where=r(u.where,c.where),u.timeExtent=o(u.timeExtent,c.timeExtent),u.objectIds=w(u.objectIds,c.objectIds)),{point:s(e[0],e[1],e[2],p.toJSON()),mode:l,distance:t,returnEdge:n,vertexMode:i,query:u.toJSON()}}function w(e,t){return e||t?t?e?Array.from(n(new Set(e),new Set(t))):t:e:null}function j(e,t,n){return{left:l(e.leftVertex.pos,t,n),right:l(e.rightVertex.pos,t,n)}}!function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"}(h||(h={}));const R=Symbol("snapping-toggle");function N(n,r=()=>{}){const o=e((()=>({view:n.view,snappingOptions:n.snappingOptions})),(({view:e,snappingOptions:t})=>{if(n.removeHandles(R),!e||!t)return;const o=p.TOOL,i=[e.on("key-down",(e=>{e.key!==c.toggle||e.repeat||(t.enabledToggled=!0,r())}),o),e.on("key-up",(e=>{e.key===c.toggle&&(t.enabledToggled=!1,r())}),o),e.on("pointer-move",(e=>{const n=e.native.ctrlKey;t.enabledToggled!==n&&(t.enabledToggled=n,r())}),o)];n.addHandles(i,R)}),t);n.addHandles(o)}function b(e){return m(e)&&"utilityNetworks"in e&&!!e.utilityNetworks?.length}export{h as LineSegmentHintType,j as editEdgeToSnappingEdge,d as gridPlacementGraphicSymbol,b as isUtilityNetworkWebMap,y as makeSnappingQuery,u as objectEqual,f as screenDistance,N as setupSnappingToggleHandles,E as sortCandidatesInPlace,g as squaredScreenDistance};