@arcgis/core 5.1.0-next.64 → 5.1.0-next.66

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 (802) hide show
  1. package/Camera.d.ts +1 -1
  2. package/Ground.d.ts +7 -7
  3. package/PopupTemplate.d.ts +8 -8
  4. package/WebDocument2D.js +1 -1
  5. package/WebScene.d.ts +1 -1
  6. package/WebScene.js +1 -1
  7. package/analysis/AreaMeasurementAnalysis.d.ts +1 -1
  8. package/analysis/DirectLineMeasurementAnalysis.d.ts +1 -1
  9. package/analysis/LengthDimension.d.ts +4 -4
  10. package/analysis/ShadowCastAnalysis.d.ts +3 -3
  11. package/analysis/SliceAnalysis.d.ts +1 -1
  12. package/analysis/SlicePlane.d.ts +1 -1
  13. package/applications/Components/featureUtils.d.ts +24 -0
  14. package/applications/Components/featureUtils.js +1 -1
  15. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +11 -1
  16. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  17. package/applications/WebEditor/drawToolZSnapping.d.ts +17 -0
  18. package/applications/WebEditor/drawToolZSnapping.js +2 -0
  19. package/arcade/Dictionary.js +1 -1
  20. package/arcade/Feature.js +1 -1
  21. package/arcade/Pixel.js +1 -1
  22. package/arcade/Voxel.js +1 -1
  23. package/arcade/geometry/wkt.js +1 -1
  24. package/assets/esri/core/workers/RemoteClient.js +1 -1
  25. package/assets/esri/core/workers/chunks/01be1315c60810651783.js +1 -0
  26. package/assets/esri/core/workers/chunks/02e8fc598ee09cf1b678.js +1 -0
  27. package/assets/esri/core/workers/chunks/0d650b0d090a425c9c18.js +1 -0
  28. package/assets/esri/core/workers/chunks/0e90e9ea1ad587eb3495.js +1 -0
  29. package/assets/esri/core/workers/chunks/0f196ec93925dfefc69a.js +1 -0
  30. package/assets/esri/core/workers/chunks/12294f8c32c34788b6de.js +1 -0
  31. package/assets/esri/core/workers/chunks/13a8346abe5509167578.js +1 -0
  32. package/assets/esri/core/workers/chunks/1515824f11ef5ab95378.js +1 -0
  33. package/assets/esri/core/workers/chunks/151c2766a4cacc6adbd6.js +1 -0
  34. package/assets/esri/core/workers/chunks/155f57fe9886ef322e2a.js +1 -0
  35. package/assets/esri/core/workers/chunks/170f4d83555d238e365b.js +1 -0
  36. package/assets/esri/core/workers/chunks/171cca726a763c770469.js +1 -0
  37. package/assets/esri/core/workers/chunks/17445fd8048966617d49.js +1 -0
  38. package/assets/esri/core/workers/chunks/1761dc5799850ca7b66c.js +1 -0
  39. package/assets/esri/core/workers/chunks/17d54e77001ccb48a258.js +1 -0
  40. package/assets/esri/core/workers/chunks/19afacc9a741038e4bfb.js +1 -0
  41. package/assets/esri/core/workers/chunks/1d8777266fb1c5cfca55.js +1 -0
  42. package/assets/esri/core/workers/chunks/1f16bc8c02d8c4b2f693.js +1 -0
  43. package/assets/esri/core/workers/chunks/1f76c06af4682c85bc21.js +1 -0
  44. package/assets/esri/core/workers/chunks/{9eef3cd5f519c8ae88c0.js → 205e957ffd7e95f530f7.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{fa6e1ad099b43a6f5501.js → 21a8e2a11ffacc226e2b.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{811b378fa5bf8a4d3d66.js → 224461c1d9755966d0b6.js} +1 -1
  47. package/assets/esri/core/workers/chunks/27262083d37fe623ca9c.js +1 -0
  48. package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +1 -0
  49. package/assets/esri/core/workers/chunks/2a65bbe6c63c384cbf5f.js +1 -0
  50. package/assets/esri/core/workers/chunks/2fa69ca3ba8c442dd7d6.js +1 -0
  51. package/assets/esri/core/workers/chunks/314140e2e9b813191907.js +1 -0
  52. package/assets/esri/core/workers/chunks/32e22d6eee9fed1f70b0.js +1 -0
  53. package/assets/esri/core/workers/chunks/{af40e2e6eaf3d2226812.js → 3464a38e758c687a28d4.js} +1 -1
  54. package/assets/esri/core/workers/chunks/38816f95e801f1c5bbad.js +1 -0
  55. package/assets/esri/core/workers/chunks/3f8e8f83ebda07d29ca8.js +1 -0
  56. package/assets/esri/core/workers/chunks/41396724040180d2537f.js +1 -0
  57. package/assets/esri/core/workers/chunks/{66baacbef23291eab853.js → 413d2fa54508e6f42c74.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{32e9e92bbbd000fbbaf7.js → 4141a3a93732996601e8.js} +2 -2
  59. package/assets/esri/core/workers/chunks/41e59d75ccb51a238739.js +1 -0
  60. package/assets/esri/core/workers/chunks/44016e1176629c36bc11.js +1 -0
  61. package/assets/esri/core/workers/chunks/468c70e5fdb61dfaad80.js +1 -0
  62. package/assets/esri/core/workers/chunks/4d069a0ebadb9c53b550.js +1 -0
  63. package/assets/esri/core/workers/chunks/4e7b084f7104deea1ddb.js +1 -0
  64. package/assets/esri/core/workers/chunks/{9c72127de7afcbaafbaf.js → 51852ef71ac04954fdae.js} +1 -1
  65. package/assets/esri/core/workers/chunks/549a51dedcc49f366e53.js +1 -0
  66. package/assets/esri/core/workers/chunks/{42e084704dea6e4135b6.js → 54c0306082d30d59cba2.js} +1 -1
  67. package/assets/esri/core/workers/chunks/56036327e721f9c42b33.js +1 -0
  68. package/assets/esri/core/workers/chunks/57cdd5d4ae073d5ca725.js +1 -0
  69. package/assets/esri/core/workers/chunks/5b9257c5359fa05f4f28.js +1 -0
  70. package/assets/esri/core/workers/chunks/5d574079f0e96e883aab.js +1 -0
  71. package/assets/esri/core/workers/chunks/5d967bcf71c05ddb1ab6.js +1 -0
  72. package/assets/esri/core/workers/chunks/5fccb372b4d5ee2f64cc.js +1 -0
  73. package/assets/esri/core/workers/chunks/61778185d702da468b00.js +1 -0
  74. package/assets/esri/core/workers/chunks/61794a861a9209b72622.js +1 -0
  75. package/assets/esri/core/workers/chunks/61b49cdaf288f36f9288.js +1 -0
  76. package/assets/esri/core/workers/chunks/{8ea67b502f9355dab7e9.js → 621ea864e2774f160d1c.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{9d289cee96e7c7fe1029.js → 62a2da0ffc67f98445c1.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{254898b41cabe313b6ce.js → 62d96b012c2d6f601863.js} +1 -1
  79. package/assets/esri/core/workers/chunks/644dd906bee3ef465ec0.js +1 -0
  80. package/assets/esri/core/workers/chunks/66692d6edc1bd96645e2.js +1 -0
  81. package/assets/esri/core/workers/chunks/679086351352756b33c9.js +1 -0
  82. package/assets/esri/core/workers/chunks/681e97ebbf9c69c410c6.js +1 -0
  83. package/assets/esri/core/workers/chunks/69520cad347947b09f21.js +1 -0
  84. package/assets/esri/core/workers/chunks/{c86b15f6a18880f921cd.js → 6a567755b67c06d16f21.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{fdf4c1f202cfddf0f226.js → 6d11ec355e5474b2968b.js} +1 -1
  86. package/assets/esri/core/workers/chunks/6e7bb6d3e739527116a4.js +1 -0
  87. package/assets/esri/core/workers/chunks/751f3cfb000045ac78bb.js +1 -0
  88. package/assets/esri/core/workers/chunks/{64ad6130de549083caba.js → 789357e0f79823f145dd.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{b6d94cbd1c5adad2f247.js → 78fbfc03d9b827c3f767.js} +1 -1
  90. package/assets/esri/core/workers/chunks/79df97e3f5975b42dc4d.js +1 -0
  91. package/assets/esri/core/workers/chunks/{25e4568a3ff76f48ac5e.js → 7a56c836c89a8b978800.js} +1 -1
  92. package/assets/esri/core/workers/chunks/7e97684e851274efd11f.js +1 -0
  93. package/assets/esri/core/workers/chunks/7e9b790fe01b89acdf6d.js +1 -0
  94. package/assets/esri/core/workers/chunks/7fb9a5bc22d7581f1d20.js +1 -0
  95. package/assets/esri/core/workers/chunks/{5c1abb46b9937a050c32.js → 7ffcd308087c35adda04.js} +1 -1
  96. package/assets/esri/core/workers/chunks/84eb889b9cce35dac2e5.js +1 -0
  97. package/assets/esri/core/workers/chunks/891d97d0da6361d63679.js +1 -0
  98. package/assets/esri/core/workers/chunks/8a0f254d45d00b293479.js +1 -0
  99. package/assets/esri/core/workers/chunks/8ede12f54b215c52cf3c.js +1 -0
  100. package/assets/esri/core/workers/chunks/8fed6becd107d2ed9bbd.js +1 -0
  101. package/assets/esri/core/workers/chunks/90cef6f96df7dc27db39.js +1 -0
  102. package/assets/esri/core/workers/chunks/921c30b7f4dfc3e018d9.js +1 -0
  103. package/assets/esri/core/workers/chunks/927773ed23b1fc245bf7.js +1 -0
  104. package/assets/esri/core/workers/chunks/{b056b4c79bcd542dd1d2.js → 9622a83b29acb768fcb5.js} +1 -1
  105. package/assets/esri/core/workers/chunks/97062996e1e4196cfa7c.js +1 -0
  106. package/assets/esri/core/workers/chunks/97210bcb5e3cf3ac961b.js +1 -0
  107. package/assets/esri/core/workers/chunks/{f550fc8c078ebd47d7a3.js → 97e15e66e55d9149fd48.js} +1 -1
  108. package/assets/esri/core/workers/chunks/9c819ebdc98ed8b6afcf.js +1 -0
  109. package/assets/esri/core/workers/chunks/9dfd00972c12a4adc15d.js +1 -0
  110. package/assets/esri/core/workers/chunks/9fab410b9fa668dc498b.js +1 -0
  111. package/assets/esri/core/workers/chunks/a118de5a163ae42bee60.js +1 -0
  112. package/assets/esri/core/workers/chunks/a4b6fdbc995be03d2afb.js +1 -0
  113. package/assets/esri/core/workers/chunks/a59db907ec1e31002100.js +1 -0
  114. package/assets/esri/core/workers/chunks/a5b395e518e4c5fc95d0.js +1414 -0
  115. package/assets/esri/core/workers/chunks/a5d9dbb1fef8c4465943.js +1 -0
  116. package/assets/esri/core/workers/chunks/{62c2757f5dc4aaca2df8.js → a73e8b80760dc88f926f.js} +1 -1
  117. package/assets/esri/core/workers/chunks/a96692514dcaa50340dd.js +1 -0
  118. package/assets/esri/core/workers/chunks/b4fb4484fa39eede1f62.js +1 -0
  119. package/assets/esri/core/workers/chunks/b50a42a9f96515beb929.js +1 -0
  120. package/assets/esri/core/workers/chunks/b8acb6c2538053c01cc6.js +1 -0
  121. package/assets/esri/core/workers/chunks/b8bf3e8b8b870f69f231.js +1 -0
  122. package/assets/esri/core/workers/chunks/b8e85b7d5eed6e7c79b5.js +1 -0
  123. package/assets/esri/core/workers/chunks/{fd629a3ab558adf52617.js → bc2c7cb99e227ddbd3a6.js} +1 -1
  124. package/assets/esri/core/workers/chunks/bc85bb82cfcbc216fa31.js +1 -0
  125. package/assets/esri/core/workers/chunks/{354351ab3fc79dedf9a8.js → bcb8a25438c66815e37a.js} +1 -1
  126. package/assets/esri/core/workers/chunks/be1e4c3ec53fc92a26f1.js +1 -0
  127. package/assets/esri/core/workers/chunks/be4d13088a557b7de4b1.js +1 -0
  128. package/assets/esri/core/workers/chunks/bf758d57091fa534c1f8.js +1 -0
  129. package/assets/esri/core/workers/chunks/bfd516c37fb717e14d71.js +1 -0
  130. package/assets/esri/core/workers/chunks/c22945637a40355fbe61.js +1 -0
  131. package/assets/esri/core/workers/chunks/c25a58d9f94aaa96957d.js +1 -0
  132. package/assets/esri/core/workers/chunks/c4e936879c6cb25cf586.js +1 -0
  133. package/assets/esri/core/workers/chunks/c6a43f748dbf8bac4bb5.js +1 -0
  134. package/assets/esri/core/workers/chunks/cb9185ed31109781fe59.js +1 -0
  135. package/assets/esri/core/workers/chunks/d21fdd67477800101f3b.js +1 -0
  136. package/assets/esri/core/workers/chunks/d264aed5dbe09e34040f.js +1 -0
  137. package/assets/esri/core/workers/chunks/d315098b038a96084ff5.js +1 -0
  138. package/assets/esri/core/workers/chunks/d4465fd3319d0b6a26cc.js +1 -0
  139. package/assets/esri/core/workers/chunks/{13eb0162d95b4d27389c.js → d598d08dbf2796742e8c.js} +1 -1
  140. package/assets/esri/core/workers/chunks/d5c7ebfd5c2ca635a7a8.js +1 -0
  141. package/assets/esri/core/workers/chunks/{d4368e281c12fa7c17c5.js → d635f97b7b82a37482d6.js} +1 -1
  142. package/assets/esri/core/workers/chunks/d7b92bd9198dd3b27eb5.js +1 -0
  143. package/assets/esri/core/workers/chunks/d83ac66478a419e08af6.js +1 -0
  144. package/assets/esri/core/workers/chunks/d8dde0d1759e009b8373.js +1 -0
  145. package/assets/esri/core/workers/chunks/d94dfb2ce31e59b3306b.js +1 -0
  146. package/assets/esri/core/workers/chunks/{8166ad6bbd7d7a8f91cf.js → deddf6ae4498a3d0d0e5.js} +1 -1
  147. package/assets/esri/core/workers/chunks/{45f1e682668cffc00b44.js → e0df7554b1679168663d.js} +1 -1
  148. package/assets/esri/core/workers/chunks/e0fcb5fa0e9f21fde2b6.js +1 -0
  149. package/assets/esri/core/workers/chunks/e305ced975d885c28e7e.js +1 -0
  150. package/assets/esri/core/workers/chunks/e3c60b7df2740e600066.js +1 -0
  151. package/assets/esri/core/workers/chunks/e611cd03eee4fae7c413.js +1 -0
  152. package/assets/esri/core/workers/chunks/e64a92b6f4075616f40f.js +1 -0
  153. package/assets/esri/core/workers/chunks/e78b442417f6a903b9b1.js +1 -0
  154. package/assets/esri/core/workers/chunks/{ba72989749543122a6fe.js → e9f2b573f482718306e6.js} +1 -1
  155. package/assets/esri/core/workers/chunks/ea6d3b7c7d720aa7bc94.js +1 -0
  156. package/assets/esri/core/workers/chunks/eab1b45ab5a802e29f8c.js +1 -0
  157. package/assets/esri/core/workers/chunks/eb7392799a01c2a8497a.js +1 -0
  158. package/assets/esri/core/workers/chunks/{c17c3453d014dc73fe0b.js → ef013a77950c1902de11.js} +1 -1
  159. package/assets/esri/core/workers/chunks/ef0fe4e1a9e960a74c60.js +1 -0
  160. package/assets/esri/core/workers/chunks/efbbcf467b2a27a92b85.js +1 -0
  161. package/assets/esri/core/workers/chunks/f201edf9b68717a6106d.js +1 -0
  162. package/assets/esri/core/workers/chunks/f43a63094190d2074cd0.js +1 -0
  163. package/assets/esri/core/workers/chunks/f59f1db572be1f19887f.js +1 -0
  164. package/assets/esri/core/workers/chunks/{dc07dc1cd30edc0c4193.js → f62e42659b406435573d.js} +1 -1
  165. package/assets/esri/core/workers/chunks/fa160a2a5dc9f5a7c34b.js +1 -0
  166. package/assets/esri/core/workers/chunks/fa7ae035472540999721.js +1 -0
  167. package/assets/esri/core/workers/chunks/fe3b42eadcdd9ba54f05.js +1 -0
  168. package/assets/esri/core/workers/chunks/fee31d9297648219375d.js +1 -0
  169. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ar.json +1 -1
  170. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bg.json +1 -1
  171. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_bs.json +1 -1
  172. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ca.json +1 -1
  173. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_cs.json +1 -1
  174. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_da.json +1 -1
  175. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_de.json +1 -1
  176. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_el.json +1 -1
  177. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_es.json +1 -1
  178. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_et.json +1 -1
  179. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fi.json +1 -1
  180. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_fr.json +1 -1
  181. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_he.json +1 -1
  182. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hr.json +1 -1
  183. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_hu.json +1 -1
  184. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_id.json +1 -1
  185. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_it.json +1 -1
  186. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ja.json +1 -1
  187. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ko.json +1 -1
  188. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lt.json +1 -1
  189. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_lv.json +1 -1
  190. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_nl.json +1 -1
  191. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_no.json +1 -1
  192. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pl.json +1 -1
  193. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-BR.json +1 -1
  194. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_pt-PT.json +1 -1
  195. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ro.json +1 -1
  196. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_ru.json +1 -1
  197. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sk.json +1 -1
  198. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sl.json +1 -1
  199. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sr.json +1 -1
  200. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_sv.json +1 -1
  201. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_th.json +1 -1
  202. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_tr.json +1 -1
  203. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_uk.json +1 -1
  204. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_vi.json +1 -1
  205. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-CN.json +1 -1
  206. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-HK.json +1 -1
  207. package/assets/esri/views/interactive/tooltip/t9n/Tooltip_zh-TW.json +1 -1
  208. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  209. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  210. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  211. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  212. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  213. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  214. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  215. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  216. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  217. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  218. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  219. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  220. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  221. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  222. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  223. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  224. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  225. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  226. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  227. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  228. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  229. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  230. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
  231. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  232. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  233. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  234. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  235. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  236. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  237. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  238. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  239. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  240. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  241. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  242. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  243. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  244. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  245. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  246. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  247. package/chunks/ComponentShader.glsl.js +1 -1
  248. package/chunks/DefaultMaterial.glsl.js +1 -1
  249. package/chunks/GaussianSplat.glsl.js +14 -2
  250. package/chunks/OITDim.glsl.js +3 -2
  251. package/chunks/Path.glsl.js +1 -1
  252. package/chunks/RealisticTree.glsl.js +1 -1
  253. package/chunks/ShadowCastAccumulate.glsl.js +2 -2
  254. package/chunks/ShadowHighlight.glsl.js +3 -3
  255. package/chunks/ShadowHighlightBuffer.glsl.js +1 -1
  256. package/chunks/Terrain.glsl.js +1 -1
  257. package/chunks/Water.glsl.js +1 -1
  258. package/config.js +1 -1
  259. package/core/timeUtils.js +1 -1
  260. package/core/workers/Connection.js +1 -1
  261. package/effects/FocusAreas.d.ts +1 -1
  262. package/form/elements/FieldElement.d.ts +3 -3
  263. package/form/elements/GroupElement.d.ts +1 -1
  264. package/form/elements/TextElement.d.ts +1 -1
  265. package/form/elements/inputs/ComboBoxInput.d.ts +1 -1
  266. package/form/elements/inputs/DateTimeOffsetPickerInput.d.ts +1 -1
  267. package/form/elements/inputs/DateTimeOffsetPickerInput.js +1 -1
  268. package/form/elements/inputs/Input.d.ts +1 -1
  269. package/form/elements/inputs/RadioButtonsInput.d.ts +1 -1
  270. package/form/elements/inputs/SwitchInput.d.ts +1 -1
  271. package/form/elements/inputs/inputUtils.js +1 -1
  272. package/form/elements/inputs.js +1 -1
  273. package/geometry/Mesh.d.ts +7 -7
  274. package/geometry/operators/alphaShapeOperator.d.ts +1 -1
  275. package/geometry/operators/areaOperator.d.ts +1 -1
  276. package/geometry/operators/bufferOperator.d.ts +1 -1
  277. package/geometry/operators/centroidOperator.d.ts +1 -1
  278. package/geometry/operators/clipOperator.d.ts +1 -1
  279. package/geometry/operators/containsOperator.d.ts +1 -1
  280. package/geometry/operators/convexHullOperator.d.ts +1 -1
  281. package/geometry/operators/crossesOperator.d.ts +1 -1
  282. package/geometry/operators/cutOperator.d.ts +1 -1
  283. package/geometry/operators/densifyOperator.d.ts +1 -1
  284. package/geometry/operators/differenceOperator.d.ts +1 -1
  285. package/geometry/operators/disjointOperator.d.ts +1 -1
  286. package/geometry/operators/distanceOperator.d.ts +1 -1
  287. package/geometry/operators/generalizeOperator.d.ts +1 -1
  288. package/geometry/operators/geodesicProximityOperator.d.ts +1 -1
  289. package/geometry/operators/geodeticDistanceOperator.d.ts +1 -1
  290. package/geometry/operators/geodeticUtilsOperator.d.ts +2 -2
  291. package/geometry/operators/graphicBufferOperator.d.ts +1 -1
  292. package/geometry/operators/intersectionOperator.d.ts +1 -1
  293. package/geometry/operators/intersectsOperator.d.ts +1 -1
  294. package/geometry/operators/isNearOperator.d.ts +1 -1
  295. package/geometry/operators/lengthOperator.d.ts +1 -1
  296. package/geometry/operators/locateBetweenOperator.d.ts +1 -1
  297. package/geometry/operators/multiPartToSinglePartOperator.d.ts +1 -1
  298. package/geometry/operators/offsetOperator.d.ts +5 -5
  299. package/geometry/operators/overlapsOperator.d.ts +1 -1
  300. package/geometry/operators/proximityOperator.d.ts +1 -1
  301. package/geometry/operators/simplifyOGCOperator.d.ts +1 -1
  302. package/geometry/operators/simplifyOperator.d.ts +1 -1
  303. package/geometry/operators/support/Transformation.d.ts +6 -6
  304. package/geometry/operators/symmetricDifferenceOperator.d.ts +1 -1
  305. package/geometry/operators/touchesOperator.d.ts +1 -1
  306. package/geometry/operators/unionOperator.d.ts +1 -1
  307. package/geometry/operators/withinOperator.d.ts +1 -1
  308. package/geometry/support/MeshMaterialMetallicRoughness.d.ts +1 -1
  309. package/geometry/support/spatialReferenceUtils.js +1 -1
  310. package/geometry/support/vcsData.js +2 -0
  311. package/geometry/support/vcsLookup.js +2 -0
  312. package/interfaces.d.ts +4 -2
  313. package/intl.js +1 -1
  314. package/kernel.js +1 -1
  315. package/layers/BuildingSceneLayer.d.ts +4 -4
  316. package/layers/CSVLayer.d.ts +2 -2
  317. package/layers/CatalogLayer.d.ts +2 -2
  318. package/layers/ElevationLayer.d.ts +1 -1
  319. package/layers/FeatureLayer.d.ts +9 -2
  320. package/layers/FeatureLayer.js +1 -1
  321. package/layers/GeoJSONLayer.d.ts +2 -2
  322. package/layers/GeoRSSLayer.d.ts +1 -1
  323. package/layers/GraphicsLayer.d.ts +2 -2
  324. package/layers/ImageryLayer.d.ts +3 -3
  325. package/layers/ImageryTileLayer.d.ts +2 -2
  326. package/layers/IntegratedMesh3DTilesLayer.d.ts +6 -6
  327. package/layers/IntegratedMeshLayer.d.ts +7 -7
  328. package/layers/MapImageLayer.d.ts +1 -1
  329. package/layers/MediaLayer.d.ts +1 -1
  330. package/layers/OGCFeatureLayer.d.ts +2 -2
  331. package/layers/PointCloudLayer.d.ts +1 -1
  332. package/layers/SceneLayer.d.ts +9 -9
  333. package/layers/StreamLayer.d.ts +2 -2
  334. package/layers/SubtypeGroupLayer.js +1 -1
  335. package/layers/VectorTileLayer.d.ts +2 -2
  336. package/layers/VideoLayer.d.ts +1 -1
  337. package/layers/VoxelLayer.d.ts +8 -8
  338. package/layers/VoxelWasmPerSceneView.js +1 -1
  339. package/layers/WFSLayer.d.ts +6 -6
  340. package/layers/catalog/CatalogFootprintLayer.d.ts +1 -1
  341. package/layers/graphics/data/AttributesBuilder.js +1 -1
  342. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  343. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  344. package/layers/mixins/ArcGISImageService.js +1 -1
  345. package/layers/mixins/BlendLayer.d.ts +6 -6
  346. package/layers/pointCloudFilters/PointCloudReturnFilter.d.ts +1 -1
  347. package/layers/pointCloudFilters/PointCloudValueFilter.d.ts +1 -1
  348. package/layers/support/DimensionalDefinition.d.ts +2 -2
  349. package/layers/support/FeatureEffect.d.ts +4 -4
  350. package/layers/support/FeatureFilter.d.ts +17 -17
  351. package/layers/support/FeatureReductionBinning.d.ts +1 -1
  352. package/layers/support/FeatureReductionCluster.d.ts +9 -9
  353. package/layers/support/FeatureReductionSelection.d.ts +1 -1
  354. package/layers/support/LabelClass.d.ts +2 -2
  355. package/layers/support/RasterFunction.d.ts +1 -1
  356. package/layers/support/SceneFilter.d.ts +2 -2
  357. package/layers/support/SceneModification.d.ts +3 -3
  358. package/layers/support/SymbolLayerDrawing.d.ts +15 -0
  359. package/layers/support/SymbolLayerDrawing.js +2 -0
  360. package/layers/support/capabilities.js +1 -1
  361. package/layers/support/featureLayerUtils.js +1 -1
  362. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  363. package/layers/types.d.ts +6 -0
  364. package/networks/support/jsonTypes.d.ts +36 -11
  365. package/package.json +4 -4
  366. package/popup/Feature.d.ts +20 -10
  367. package/popup/Feature.js +1 -1
  368. package/popup/Features.d.ts +82 -227
  369. package/popup/Features.js +1 -1
  370. package/popup/content/AttachmentsContent.d.ts +1 -1
  371. package/popup/content/BarChartMediaInfo.d.ts +1 -1
  372. package/popup/content/ColumnChartMediaInfo.d.ts +1 -1
  373. package/popup/content/FieldsContent.d.ts +1 -1
  374. package/popup/content/ImageMediaInfo.d.ts +1 -1
  375. package/popup/content/LineChartMediaInfo.d.ts +1 -1
  376. package/popup/content/MediaContent.d.ts +1 -1
  377. package/popup/content/PieChartMediaInfo.d.ts +1 -1
  378. package/popup/content/RelationshipContent.d.ts +1 -1
  379. package/popup/content/TextContent.d.ts +1 -1
  380. package/popup/support/FeatureAbilities.d.ts +45 -9
  381. package/popup/support/featureUtils.js +1 -1
  382. package/popup/types.d.ts +126 -8
  383. package/portal/schemas/definitions.js +1 -1
  384. package/renderers/ClassBreaksRenderer.d.ts +1 -1
  385. package/renderers/DictionaryRenderer.d.ts +1 -1
  386. package/renderers/DotDensityRenderer.d.ts +3 -3
  387. package/renderers/FlowRenderer.d.ts +5 -5
  388. package/renderers/HeatmapRenderer.d.ts +3 -3
  389. package/renderers/PieChartRenderer.d.ts +1 -1
  390. package/renderers/RasterShadedReliefRenderer.d.ts +1 -1
  391. package/renderers/Renderer.d.ts +4 -4
  392. package/renderers/SimpleRenderer.d.ts +2 -2
  393. package/renderers/UniqueValueRenderer.d.ts +2 -2
  394. package/renderers/VectorFieldRenderer.d.ts +1 -1
  395. package/renderers/mixins/VisualVariablesMixin.d.ts +12 -12
  396. package/renderers/visualVariables/ColorVariable.d.ts +1 -1
  397. package/renderers/visualVariables/OpacityVariable.d.ts +1 -1
  398. package/renderers/visualVariables/RotationVariable.d.ts +1 -1
  399. package/renderers/visualVariables/SizeVariable.d.ts +1 -1
  400. package/renderers/visualVariables/VisualVariable.d.ts +1 -1
  401. package/rest/query/support/AttachmentInfo.d.ts +1 -1
  402. package/rest/support/AttributeBinsQuery.d.ts +8 -8
  403. package/rest/support/AutoIntervalBinParameters.d.ts +1 -1
  404. package/rest/support/DateBinParameters.d.ts +1 -1
  405. package/rest/support/FixedBoundariesBinParameters.d.ts +1 -1
  406. package/rest/support/FixedIntervalBinParameters.d.ts +1 -1
  407. package/rest/support/Query.d.ts +8 -8
  408. package/rest/support/TopFeaturesQuery.d.ts +8 -8
  409. package/smartMapping/labels/clusters.d.ts +1 -1
  410. package/smartMapping/popup/clusters.d.ts +2 -2
  411. package/smartMapping/popup/templates.d.ts +1 -1
  412. package/smartMapping/raster/renderers/flow.d.ts +2 -2
  413. package/smartMapping/renderers/color.d.ts +12 -12
  414. package/smartMapping/renderers/predominance.d.ts +3 -3
  415. package/smartMapping/renderers/relationship.d.ts +15 -15
  416. package/smartMapping/renderers/univariateColorSize.d.ts +4 -4
  417. package/smartMapping/statistics/support/utils.js +1 -1
  418. package/smartMapping/support/adapters/support/utils.js +1 -1
  419. package/smartMapping/symbology/color.d.ts +4 -4
  420. package/smartMapping/symbology/flow.d.ts +2 -2
  421. package/smartMapping/symbology/types.d.ts +18 -18
  422. package/support/actions/ActionButton.d.ts +1 -1
  423. package/support/basemapDefinitions.js +1 -1
  424. package/support/revision.js +1 -1
  425. package/symbols/CIMSymbol.d.ts +1 -1
  426. package/symbols/ExtrudeSymbol3DLayer.d.ts +1 -1
  427. package/symbols/FillSymbol3DLayer.d.ts +3 -3
  428. package/symbols/IconSymbol3DLayer.d.ts +1 -1
  429. package/symbols/LabelSymbol3D.d.ts +2 -2
  430. package/symbols/LineStyleMarker3D.d.ts +7 -7
  431. package/symbols/LineSymbol3D.d.ts +2 -2
  432. package/symbols/LineSymbol3DLayer.d.ts +7 -7
  433. package/symbols/LineSymbolMarker.d.ts +6 -6
  434. package/symbols/MarkerSymbol.d.ts +1 -1
  435. package/symbols/MeshSymbol3D.d.ts +2 -2
  436. package/symbols/ObjectSymbol3DLayer.d.ts +1 -1
  437. package/symbols/PathSymbol3DLayer.d.ts +14 -14
  438. package/symbols/PictureFillSymbol.d.ts +1 -1
  439. package/symbols/PictureMarkerSymbol.d.ts +1 -1
  440. package/symbols/PointSymbol3D.d.ts +3 -3
  441. package/symbols/PolygonSymbol3D.d.ts +5 -5
  442. package/symbols/SimpleFillSymbol.d.ts +8 -8
  443. package/symbols/SimpleLineSymbol.d.ts +20 -20
  444. package/symbols/SimpleMarkerSymbol.d.ts +7 -7
  445. package/symbols/Symbol3DLayer.d.ts +16 -16
  446. package/symbols/TextSymbol.d.ts +1 -1
  447. package/symbols/TextSymbol3DLayer.d.ts +1 -1
  448. package/symbols/WaterSymbol3DLayer.d.ts +3 -3
  449. package/symbols/WebStyleSymbol.d.ts +12 -12
  450. package/symbols/callouts/Callout3D.d.ts +1 -1
  451. package/symbols/callouts/LineCallout3D.d.ts +3 -3
  452. package/symbols/cim/cimAnalyzer.js +1 -1
  453. package/symbols/cim/types.d.ts +29 -23
  454. package/symbols/edges/Edges3D.d.ts +1 -1
  455. package/symbols/edges/SolidEdges3D.d.ts +1 -1
  456. package/symbols/patterns/LineStylePattern3D.d.ts +11 -11
  457. package/symbols/patterns/StylePattern3D.d.ts +8 -8
  458. package/symbols/support/ElevationInfo.d.ts +2 -2
  459. package/symbols/support/IconSymbol3DLayerResource.d.ts +6 -6
  460. package/symbols/support/ObjectSymbol3DLayerResource.d.ts +7 -7
  461. package/symbols/support/Symbol3DEmissive.d.ts +2 -2
  462. package/symbols/support/Symbol3DVerticalOffset.d.ts +2 -2
  463. package/views/2d/engine/Stage.js +1 -1
  464. package/views/2d/engine/flow/FlowStrategy.js +1 -1
  465. package/views/2d/engine/flow/styles/Imagery.js +1 -1
  466. package/views/2d/engine/flow/styles/Particles.js +1 -1
  467. package/views/2d/engine/flow/styles/Stack.js +1 -1
  468. package/views/2d/engine/flow/styles/Streamlines.js +1 -1
  469. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  470. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  471. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  472. package/views/2d/engine/webgl/FeatureDisplayList.js +1 -1
  473. package/views/2d/engine/webgl/Painter.js +1 -1
  474. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  475. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  476. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  477. package/views/2d/engine/webgl/effects/highlight/HighlightSurfaces.js +1 -1
  478. package/views/2d/engine/webgl/shaderGraph/techniques/FeatureInstanceStore.js +1 -1
  479. package/views/2d/engine/webgl/shaderGraph/techniques/GraphicInstanceStore.js +1 -1
  480. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  481. package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
  482. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
  483. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
  484. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  485. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  486. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
  487. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapResources.js +1 -1
  488. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  489. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
  490. package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
  491. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
  492. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/textureUtils.js +1 -1
  493. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  494. package/views/2d/layers/BaseLayerViewGL2D.d.ts +2 -2
  495. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  496. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  497. package/views/2d/layers/features/FeatureContainer.js +1 -1
  498. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  499. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  500. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  501. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  502. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  503. package/views/2d/layers/support/DisplayGL.js +1 -1
  504. package/views/2d/types.d.ts +3 -3
  505. package/views/3d/FocusAreasView.js +1 -1
  506. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  507. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  508. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  509. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  510. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  511. package/views/3d/environment/CloudyWeather.d.ts +1 -1
  512. package/views/3d/environment/Environment.d.ts +4 -4
  513. package/views/3d/environment/FoggyWeather.d.ts +1 -1
  514. package/views/3d/environment/RainyWeather.d.ts +1 -1
  515. package/views/3d/environment/SnowyWeather.d.ts +1 -1
  516. package/views/3d/environment/SunLighting.d.ts +1 -1
  517. package/views/3d/environment/SunnyWeather.d.ts +1 -1
  518. package/views/3d/environment/VirtualLighting.d.ts +1 -1
  519. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  520. package/views/3d/layers/graphics/extrudeUtils.js +1 -1
  521. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  522. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  523. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  524. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  525. package/views/3d/terrain/support/MultiSizeFramebuffer.js +1 -1
  526. package/views/3d/webgl/ManagedFBO.js +1 -1
  527. package/views/3d/webgl/RenderNode.d.ts +2 -2
  528. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  529. package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
  530. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +18 -5
  531. package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +2 -2
  532. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +2 -2
  533. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadowFromDepth.glsl.js +1 -1
  534. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  535. package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
  536. package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
  537. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  538. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  539. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  540. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  541. package/views/3d/webgl-engine/effects/transparency/OITDim.glsl.js +1 -1
  542. package/views/3d/webgl-engine/effects/transparency/OITDimTechniqueConfiguration.js +2 -0
  543. package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
  544. package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
  545. package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
  546. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  547. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  548. package/views/3d/webgl-engine/materials/PolygonOffset.js +1 -1
  549. package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
  550. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  551. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  552. package/views/3d/webgl.d.ts +1 -1
  553. package/views/Magnifier.d.ts +3 -3
  554. package/views/MapView.d.ts +7 -7
  555. package/views/SceneView.d.ts +16 -16
  556. package/views/View.d.ts +17 -3
  557. package/views/View.js +1 -1
  558. package/views/draw/DrawTool.js +1 -1
  559. package/views/draw/support/InteractiveHandle.js +1 -1
  560. package/views/draw/support/Reshape.js +1 -1
  561. package/views/draw/support/drawUtils.js +1 -1
  562. package/views/draw/support/reshapeTooltipUtils.js +1 -1
  563. package/views/draw/support/types.d.ts +9 -1
  564. package/views/interactive/sketch/SketchLabelOptions.d.ts +1 -1
  565. package/views/interactive/sketch/SketchTooltipOptions.d.ts +1 -1
  566. package/views/interactive/snapping/SnappingOptions.d.ts +7 -7
  567. package/views/layers/FeatureLikeLayerView.js +1 -1
  568. package/views/layers/LineOfSightLayerView.d.ts +3 -2
  569. package/views/support/HighlightOptions.d.ts +1 -1
  570. package/views/support/imageReprojection.js +1 -1
  571. package/views/types.d.ts +59 -2
  572. package/views/ui/DefaultUI.d.ts +2 -2
  573. package/views/webgl/FramebufferObject.js +1 -1
  574. package/views/webgl/RenderingContext.js +1 -1
  575. package/views/webgl/Texture.js +1 -1
  576. package/views/webgl/testFloatBufferBlend.js +1 -1
  577. package/views/webgl/testSVGPremultipliedAlpha.js +1 -1
  578. package/webscene/Environment.d.ts +10 -10
  579. package/webscene/Glow.d.ts +1 -1
  580. package/webscene/background/ColorBackground.d.ts +1 -1
  581. package/widgets/AreaMeasurement2D.d.ts +1 -1
  582. package/widgets/AreaMeasurement3D.d.ts +2 -2
  583. package/widgets/Attachments.d.ts +1 -1
  584. package/widgets/Attribution.d.ts +1 -1
  585. package/widgets/BasemapGallery.d.ts +1 -1
  586. package/widgets/BasemapLayerList.d.ts +3 -3
  587. package/widgets/BasemapToggle.d.ts +1 -1
  588. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  589. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  590. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  591. package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +1 -1
  592. package/widgets/Bookmarks.d.ts +2 -2
  593. package/widgets/BuildingExplorer.d.ts +1 -1
  594. package/widgets/CatalogLayerList.d.ts +3 -3
  595. package/widgets/Compass.d.ts +2 -2
  596. package/widgets/CoordinateConversion.d.ts +1 -1
  597. package/widgets/Daylight.d.ts +5 -5
  598. package/widgets/DirectLineMeasurement3D.d.ts +2 -2
  599. package/widgets/Directions.d.ts +4 -4
  600. package/widgets/DistanceMeasurement2D.d.ts +1 -1
  601. package/widgets/Editor/CreateFeaturesWorkflow.d.ts +1 -1
  602. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  603. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  604. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  605. package/widgets/Editor/UpdateWorkflow.js +1 -1
  606. package/widgets/Editor/Workflow.js +1 -1
  607. package/widgets/Editor.d.ts +8 -8
  608. package/widgets/ElevationProfile/ElevationProfileLineGround.d.ts +1 -1
  609. package/widgets/ElevationProfile/ElevationProfileLineInput.d.ts +1 -1
  610. package/widgets/ElevationProfile/ElevationProfileLineView.d.ts +1 -1
  611. package/widgets/ElevationProfile.d.ts +3 -3
  612. package/widgets/Expand.d.ts +1 -1
  613. package/widgets/Feature/FeatureViewModel.d.ts +14 -4
  614. package/widgets/Feature/FeatureViewModel.js +1 -1
  615. package/widgets/FeatureForm/FieldInput.js +1 -1
  616. package/widgets/FeatureForm.d.ts +1 -1
  617. package/widgets/FeatureTable/ActionColumn.d.ts +2 -2
  618. package/widgets/FeatureTable/AttachmentsColumn.d.ts +1 -1
  619. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +3 -3
  620. package/widgets/FeatureTable/Grid/GroupColumn.d.ts +1 -1
  621. package/widgets/FeatureTable/RelationshipColumn.d.ts +1 -1
  622. package/widgets/FeatureTable/VisibleElements.d.ts +1 -1
  623. package/widgets/FeatureTable.d.ts +10 -10
  624. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.d.ts +5 -5
  625. package/widgets/FeatureTemplates.d.ts +8 -8
  626. package/widgets/Features/FeaturesViewModel.d.ts +18 -7
  627. package/widgets/Features/FeaturesViewModel.js +1 -1
  628. package/widgets/Features/FeaturesVisibleElements.d.ts +2 -2
  629. package/widgets/Features.d.ts +1 -1
  630. package/widgets/Features.js +1 -1
  631. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  632. package/widgets/FloorFilter.d.ts +2 -2
  633. package/widgets/Histogram.d.ts +2 -2
  634. package/widgets/HistogramRangeSlider.d.ts +1 -1
  635. package/widgets/Home.d.ts +1 -1
  636. package/widgets/LayerList/ListItemPanel.d.ts +1 -1
  637. package/widgets/LayerList.d.ts +4 -4
  638. package/widgets/Legend.d.ts +8 -8
  639. package/widgets/LineOfSight.d.ts +1 -1
  640. package/widgets/Locate.d.ts +2 -2
  641. package/widgets/Measurement.d.ts +1 -1
  642. package/widgets/NavigationToggle/NavigationToggleViewModel.d.ts +1 -1
  643. package/widgets/NavigationToggle.d.ts +3 -3
  644. package/widgets/Popup/PopupViewModel.d.ts +2 -1
  645. package/widgets/Popup/PopupViewModel.js +1 -1
  646. package/widgets/Popup/PopupVisibleElements.d.ts +2 -2
  647. package/widgets/Popup.d.ts +18 -9
  648. package/widgets/Popup.js +1 -1
  649. package/widgets/Print/CustomTemplate.d.ts +1 -1
  650. package/widgets/Print/TemplateOptions.d.ts +4 -4
  651. package/widgets/ScaleRangeSlider.d.ts +1 -1
  652. package/widgets/Search/SearchViewModel.d.ts +4 -4
  653. package/widgets/Search.d.ts +5 -5
  654. package/widgets/ShadowCast.d.ts +3 -3
  655. package/widgets/Sketch/SketchViewModel.d.ts +39 -39
  656. package/widgets/Sketch.d.ts +43 -43
  657. package/widgets/Slice.d.ts +2 -2
  658. package/widgets/Slider/SliderViewModel.d.ts +2 -2
  659. package/widgets/Slider.d.ts +9 -9
  660. package/widgets/Swipe/SwipeViewModel.d.ts +1 -1
  661. package/widgets/Swipe.d.ts +2 -2
  662. package/widgets/TableList/ListItemPanel.d.ts +1 -1
  663. package/widgets/TableList.d.ts +1 -1
  664. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +10 -10
  665. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  666. package/widgets/TimeSlider/types.d.ts +1 -1
  667. package/widgets/TimeSlider.d.ts +13 -13
  668. package/widgets/Track.d.ts +2 -2
  669. package/widgets/UtilityNetworkAssociations.d.ts +3 -3
  670. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  671. package/widgets/UtilityNetworkTrace.d.ts +4 -4
  672. package/widgets/UtilityNetworkValidateTopology.d.ts +1 -1
  673. package/widgets/ValuePicker.d.ts +5 -5
  674. package/widgets/VideoPlayer.d.ts +1 -1
  675. package/widgets/smartMapping/ClassedColorSlider.d.ts +1 -1
  676. package/widgets/smartMapping/ClassedSizeSlider.d.ts +1 -1
  677. package/widgets/smartMapping/ColorSizeSlider.d.ts +2 -2
  678. package/widgets/smartMapping/ColorSlider.d.ts +1 -1
  679. package/widgets/smartMapping/HeatmapSlider.d.ts +1 -1
  680. package/widgets/smartMapping/OpacitySlider.d.ts +1 -1
  681. package/widgets/smartMapping/SizeSlider.d.ts +1 -1
  682. package/widgets/smartMapping/SmartMappingSliderBase.d.ts +4 -4
  683. package/widgets/smartMapping/SmartMappingSliderViewModel.d.ts +6 -6
  684. package/widgets/support/GridControls.d.ts +1 -1
  685. package/widgets/support/SnappingControls/VisibleElements.d.ts +1 -1
  686. package/widgets/support/SnappingControls.d.ts +6 -6
  687. package/assets/esri/core/workers/chunks/02aaeaa988e9e7d65a7f.js +0 -1
  688. package/assets/esri/core/workers/chunks/05c8d2c0362af4511d86.js +0 -1
  689. package/assets/esri/core/workers/chunks/06868e4f52de9d918255.js +0 -1
  690. package/assets/esri/core/workers/chunks/06c0b93e276cfc1fb7ac.js +0 -1
  691. package/assets/esri/core/workers/chunks/0888baa99c9007ad63bc.js +0 -1
  692. package/assets/esri/core/workers/chunks/0de66f13e84830a654fb.js +0 -1
  693. package/assets/esri/core/workers/chunks/0f597c690e5c60fe944b.js +0 -1
  694. package/assets/esri/core/workers/chunks/0f8736242544f9e9a57a.js +0 -1
  695. package/assets/esri/core/workers/chunks/0ff12fe9e358100668d9.js +0 -1
  696. package/assets/esri/core/workers/chunks/11a8541f3909f9ffb000.js +0 -1
  697. package/assets/esri/core/workers/chunks/13a009229c96ecb7b04f.js +0 -1
  698. package/assets/esri/core/workers/chunks/185f59f90070d5d6ac94.js +0 -1
  699. package/assets/esri/core/workers/chunks/190bc75254bc0542a6be.js +0 -1
  700. package/assets/esri/core/workers/chunks/1af247c86d1c4ae8fef3.js +0 -1
  701. package/assets/esri/core/workers/chunks/2339465190c9d5ede25f.js +0 -1
  702. package/assets/esri/core/workers/chunks/23eb204d3cb818adea32.js +0 -1
  703. package/assets/esri/core/workers/chunks/241ef4a1bea20b49d812.js +0 -1
  704. package/assets/esri/core/workers/chunks/2669a7195f1de21a9cf3.js +0 -1
  705. package/assets/esri/core/workers/chunks/2a2d5f9ea42cb2eee9c6.js +0 -1
  706. package/assets/esri/core/workers/chunks/2a7e7a497823e9f05aa3.js +0 -1
  707. package/assets/esri/core/workers/chunks/2aaeaf022af8493281dc.js +0 -1
  708. package/assets/esri/core/workers/chunks/2d92ba11781a3cfc3a78.js +0 -1
  709. package/assets/esri/core/workers/chunks/31e0bfc2cab055aebf9a.js +0 -1
  710. package/assets/esri/core/workers/chunks/32360a55d1836b2a737e.js +0 -1
  711. package/assets/esri/core/workers/chunks/330da3828eefd8d72d3f.js +0 -1
  712. package/assets/esri/core/workers/chunks/34acecd7a314fed12335.js +0 -1
  713. package/assets/esri/core/workers/chunks/34fe4570eef9e73839b8.js +0 -1
  714. package/assets/esri/core/workers/chunks/368b4c0a5eecbb06feac.js +0 -1
  715. package/assets/esri/core/workers/chunks/37729578a7c4cf15eded.js +0 -1
  716. package/assets/esri/core/workers/chunks/3af1e2f0b3d30c58d0c2.js +0 -1
  717. package/assets/esri/core/workers/chunks/3c155efd5768003a91eb.js +0 -1
  718. package/assets/esri/core/workers/chunks/3d4bb59ab2f644f4d675.js +0 -1
  719. package/assets/esri/core/workers/chunks/3f0d9fdd8c37605dd85d.js +0 -1
  720. package/assets/esri/core/workers/chunks/48eca6f51112ba80bd3b.js +0 -1
  721. package/assets/esri/core/workers/chunks/4b5737021a149aa786af.js +0 -1
  722. package/assets/esri/core/workers/chunks/55214e1d9f3d98fa7ed9.js +0 -1
  723. package/assets/esri/core/workers/chunks/55a0b69cf034ac32fc25.js +0 -1
  724. package/assets/esri/core/workers/chunks/576a1784e93c5406e657.js +0 -1
  725. package/assets/esri/core/workers/chunks/59289867cce97da74e39.js +0 -1
  726. package/assets/esri/core/workers/chunks/5a6d6082c5bcb1a80eda.js +0 -1
  727. package/assets/esri/core/workers/chunks/5a9620cb66c8e64e4668.js +0 -1
  728. package/assets/esri/core/workers/chunks/5c6e5f22450dd0583074.js +0 -1
  729. package/assets/esri/core/workers/chunks/5eeb6d3a7b815d41621e.js +0 -1
  730. package/assets/esri/core/workers/chunks/5f06a57b4f7d7de16bbf.js +0 -1
  731. package/assets/esri/core/workers/chunks/5f2e246ffcbdedea4de5.js +0 -1
  732. package/assets/esri/core/workers/chunks/5ff41f43e57be0557541.js +0 -1414
  733. package/assets/esri/core/workers/chunks/6b32b3f98872771ff81e.js +0 -1
  734. package/assets/esri/core/workers/chunks/6be9d00839002f24fafd.js +0 -1
  735. package/assets/esri/core/workers/chunks/6c72dbd5275bffde1583.js +0 -1
  736. package/assets/esri/core/workers/chunks/6c886f19875291d02407.js +0 -1
  737. package/assets/esri/core/workers/chunks/75f7c1f600c4051bc905.js +0 -1
  738. package/assets/esri/core/workers/chunks/77f6659e400064d38130.js +0 -1
  739. package/assets/esri/core/workers/chunks/78c7eace6ec3fa5c7413.js +0 -1
  740. package/assets/esri/core/workers/chunks/7cee28575fd57430cf02.js +0 -1
  741. package/assets/esri/core/workers/chunks/82e0691995d821137d5f.js +0 -1
  742. package/assets/esri/core/workers/chunks/8435b6bf356959009b76.js +0 -1
  743. package/assets/esri/core/workers/chunks/8677865189081e0b83bc.js +0 -1
  744. package/assets/esri/core/workers/chunks/86f70bd786d6d57fde69.js +0 -1
  745. package/assets/esri/core/workers/chunks/8878ab87ef7961fafae8.js +0 -1
  746. package/assets/esri/core/workers/chunks/8a893f23827769d42092.js +0 -1
  747. package/assets/esri/core/workers/chunks/8d1d0c3f0532aa98487d.js +0 -1
  748. package/assets/esri/core/workers/chunks/8e68b4628e9616356c34.js +0 -1
  749. package/assets/esri/core/workers/chunks/8edae79554843dd77ada.js +0 -1
  750. package/assets/esri/core/workers/chunks/9032c040b214b5af775b.js +0 -1
  751. package/assets/esri/core/workers/chunks/909ef35fa33be2b6da41.js +0 -1
  752. package/assets/esri/core/workers/chunks/90b7acc70adba193b215.js +0 -1
  753. package/assets/esri/core/workers/chunks/91718795fc4ca6516ac7.js +0 -1
  754. package/assets/esri/core/workers/chunks/92d4e962284e13ba2fc5.js +0 -1
  755. package/assets/esri/core/workers/chunks/94f80c46ccf5e19038b8.js +0 -1
  756. package/assets/esri/core/workers/chunks/979c2f52b6d6e1e8241b.js +0 -1
  757. package/assets/esri/core/workers/chunks/97f10efb0fe05bedcebd.js +0 -1
  758. package/assets/esri/core/workers/chunks/98f5bf1b91f3696b2fce.js +0 -1
  759. package/assets/esri/core/workers/chunks/9c52d4b54dfdb69dee29.js +0 -1
  760. package/assets/esri/core/workers/chunks/9de8149ae0a0726a4ab2.js +0 -1
  761. package/assets/esri/core/workers/chunks/9def5d17b94e5db71883.js +0 -1
  762. package/assets/esri/core/workers/chunks/9f272445c285ee9abb7b.js +0 -1
  763. package/assets/esri/core/workers/chunks/a10be7eb05a007fff1ed.js +0 -1
  764. package/assets/esri/core/workers/chunks/a32c87b89567a9fd1efc.js +0 -1
  765. package/assets/esri/core/workers/chunks/a3b29eca5807978fb2a3.js +0 -1
  766. package/assets/esri/core/workers/chunks/a446dff865332268625a.js +0 -1
  767. package/assets/esri/core/workers/chunks/a5bf2718c02a0e645013.js +0 -1
  768. package/assets/esri/core/workers/chunks/a6d166058e3025bb280e.js +0 -1
  769. package/assets/esri/core/workers/chunks/a8e111a5cfd6151d5dbb.js +0 -1
  770. package/assets/esri/core/workers/chunks/aed45f7e7eee154a21b8.js +0 -1
  771. package/assets/esri/core/workers/chunks/af3bd661b355eed3da21.js +0 -1
  772. package/assets/esri/core/workers/chunks/b0f2ce61d3cad413898e.js +0 -1
  773. package/assets/esri/core/workers/chunks/b2b77598048818c957b7.js +0 -1
  774. package/assets/esri/core/workers/chunks/b744b950999b92393e37.js +0 -1
  775. package/assets/esri/core/workers/chunks/b75165880704efccc47c.js +0 -1
  776. package/assets/esri/core/workers/chunks/ba9e107edc2027238be3.js +0 -1
  777. package/assets/esri/core/workers/chunks/bc3b22dc08c147b8d425.js +0 -1
  778. package/assets/esri/core/workers/chunks/c08e9914deb1dc62bc0f.js +0 -1
  779. package/assets/esri/core/workers/chunks/c0bb53d8d58ad18334d3.js +0 -1
  780. package/assets/esri/core/workers/chunks/c0d453f93af2d4a6ce64.js +0 -1
  781. package/assets/esri/core/workers/chunks/c9a42d86185a0ad35dd1.js +0 -1
  782. package/assets/esri/core/workers/chunks/cbb50415f7de8746ee1a.js +0 -1
  783. package/assets/esri/core/workers/chunks/d23dd7da45a7aa341540.js +0 -1
  784. package/assets/esri/core/workers/chunks/d2801df3fa44dee15ec8.js +0 -1
  785. package/assets/esri/core/workers/chunks/d53b31c9056f82831bc0.js +0 -1
  786. package/assets/esri/core/workers/chunks/d626e08d23330d84413b.js +0 -1
  787. package/assets/esri/core/workers/chunks/db6e03fe8dd316f5005f.js +0 -1
  788. package/assets/esri/core/workers/chunks/de79645e559a2d1ffa67.js +0 -1
  789. package/assets/esri/core/workers/chunks/e2779965db231fb666a5.js +0 -1
  790. package/assets/esri/core/workers/chunks/e4e2f059c52674dcae5b.js +0 -1
  791. package/assets/esri/core/workers/chunks/ec21311584e4fb13e510.js +0 -1
  792. package/assets/esri/core/workers/chunks/eca45cd479f7fd28ca6e.js +0 -1
  793. package/assets/esri/core/workers/chunks/ee8cd91c27e9cdfc3b2e.js +0 -1
  794. package/assets/esri/core/workers/chunks/efdd75896ca53eb6242f.js +0 -1
  795. package/assets/esri/core/workers/chunks/f1c348cf2a1e35da9b20.js +0 -1
  796. package/assets/esri/core/workers/chunks/f4053e4e2d6e678db48a.js +0 -1
  797. package/assets/esri/core/workers/chunks/f4d577ff61da7964e08a.js +0 -1
  798. package/assets/esri/core/workers/chunks/f7da652f8dab57677cc3.js +0 -1
  799. package/assets/esri/core/workers/chunks/fe92f54e45fd21ccd75f.js +0 -1
  800. package/assets/esri/core/workers/chunks/fee1d873127dca02459f.js +0 -1
  801. package/assets/esri/core/workers/chunks/ff31936236dd9b1acb24.js +0 -1
  802. /package/assets/esri/core/workers/chunks/{32e9e92bbbd000fbbaf7.js.LICENSE.txt → 4141a3a93732996601e8.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../request.js";import e from"../../geometry/Point.js";import{execute as r}from"../../geometry/operators/projectOperator.js";import{projectResolution as i,getProjectionOffsetGrid as a,load as s}from"../../layers/raster/functions/rasterProjectionHelper.js";import{isImageSource as n,rasterize as o}from"../2d/engine/Bitmap.js";import m from"../2d/engine/webgl/VertexStream.js";import{createProgramTemplate as c}from"../2d/engine/webgl/shaders/MaterialPrograms.js";import{PixelType as p}from"../webgl/enums.js";import{FramebufferObject as h}from"../webgl/FramebufferObject.js";import{createTransformTexture as x}from"../webgl/rasterUtils.js";import{RenderingContext as u}from"../webgl/RenderingContext.js";import{RenderingContextOptions as d}from"../webgl/RenderingContextOptions.js";import g from"../webgl/Texture.js";import{TextureDescriptor as _}from"../webgl/TextureDescriptor.js";class f{static{this._instanceRefCount=0}constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(f._instance)return f._instanceRefCount++,f._instance;f._instanceRefCount=1,f._instance=this,this._ownsRctx=!0;const t=document.createElement("canvas").getContext("webgl2");t.getExtension("OES_texture_float"),this._rctx=new u(t,new d)}this._quad=new m(this._rctx,[0,0,1,0,0,1,1,1]);const e=c("raster/reproject","raster/reproject",{applyProjection:!0,bilinear:!1,bicubic:!1});this._program=this._rctx.programCache.get(e.vertexShader,e.fragmentShader,this._quad.locations),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1)}reprojectTexture(t,s,n=!1){const o=r(t.extent,s),m=new e({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:c,y:u}=i(m,s,t.extent);let d=(c+u)/2;const g=Math.round((o.xmax-o.xmin)/d),f=Math.round((o.ymax-o.ymin)/d);d=(o.width/g+o.height/f)/2;const l=new e({x:d,y:d,spatialReference:o.spatialReference}),w=a({projectedExtent:o,srcBufferExtent:t.extent,pixelSize:l,hasWrapAround:!0,spacing:[16,16]}),b=x(this._rctx,w),j=new _(g,f);j.wrapMode=33071;const D=new h(this._rctx,j);this._rctx.bindFramebuffer(D),this._rctx.setViewport(0,0,g,f),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(b,1),this._quad.bind();const{width:R=0,height:y=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",R,y),this._program.setUniform2fv("u_transformSpacing",w.spacing),this._program.setUniform2fv("u_transformGridSize",w.size),this._program.setUniform2f("u_targetImageSize",g,f),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),b.dispose(),n){const{width:t,height:e}=D,r=new ImageData(t??0,e??0);D.readPixels(0,0,t??0,e??0,6408,p.UNSIGNED_BYTE,r.data);const i=D.detachColorTexture();return D.dispose(),{texture:i,extent:o,imageData:r}}const C=D.detachColorTexture();return D.dispose(),{texture:C,extent:o}}reprojectBitmapData(t,e){const r=n(t.bitmapData)?o(t.bitmapData):t.bitmapData,i=new _(t.bitmapData.width,t.bitmapData.height);i.wrapMode=33071;const a=new g(this._rctx,i,r),s=this.reprojectTexture({texture:a,extent:t.extent},e,!0);s.texture.dispose();const m=document.createElement("canvas"),c=s.imageData;m.width=c.width,m.height=c.height;return m.getContext("2d").putImageData(c,0,0),{bitmapData:m,extent:s.extent}}async loadAndReprojectBitmapData(e,r,i){const[a]=await Promise.all([t(e,{responseType:"image"}).then(t=>t.data),s()]),n=document.createElement("canvas");n.width=a.width,n.height=a.height;const o=n.getContext("2d");o.drawImage(a,0,0);const m=o.getImageData(0,0,n.width,n.height);if(r.spatialReference.equals(i))return{bitmapData:m,extent:r};const c=this.reprojectBitmapData({bitmapData:m,extent:r},i);return{bitmapData:c.bitmapData,extent:c.extent}}destroy(){this._ownsRctx?(f._instanceRefCount--,0===f._instanceRefCount&&(this._quad.dispose(),this._rctx.dispose(),f._instance=null)):this._quad.dispose()}}export{f as ImageReprojector};
2
+ import t from"../../request.js";import e from"../../geometry/Point.js";import{execute as r}from"../../geometry/operators/projectOperator.js";import{projectResolution as i,getProjectionOffsetGrid as a,load as s}from"../../layers/raster/functions/rasterProjectionHelper.js";import{isImageSource as n,rasterize as o}from"../2d/engine/Bitmap.js";import m from"../2d/engine/webgl/VertexStream.js";import{createProgramTemplate as c}from"../2d/engine/webgl/shaders/MaterialPrograms.js";import{PixelType as p}from"../webgl/enums.js";import{DisposableFramebufferObject as h}from"../webgl/FramebufferObject.js";import{createTransformTexture as x}from"../webgl/rasterUtils.js";import{RenderingContext as u}from"../webgl/RenderingContext.js";import{RenderingContextOptions as d}from"../webgl/RenderingContextOptions.js";import g from"../webgl/Texture.js";import{TextureDescriptor as _}from"../webgl/TextureDescriptor.js";class f{static{this._instanceRefCount=0}constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(f._instance)return f._instanceRefCount++,f._instance;f._instanceRefCount=1,f._instance=this,this._ownsRctx=!0;const t=document.createElement("canvas").getContext("webgl2");t.getExtension("OES_texture_float"),this._rctx=new u(t,new d)}this._quad=new m(this._rctx,[0,0,1,0,0,1,1,1]);const e=c("raster/reproject","raster/reproject",{applyProjection:!0,bilinear:!1,bicubic:!1});this._program=this._rctx.programCache.get(e.vertexShader,e.fragmentShader,this._quad.locations),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1)}reprojectTexture(t,s,n=!1){const o=r(t.extent,s),m=new e({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:c,y:u}=i(m,s,t.extent);let d=(c+u)/2;const g=Math.round((o.xmax-o.xmin)/d),f=Math.round((o.ymax-o.ymin)/d);d=(o.width/g+o.height/f)/2;const l=new e({x:d,y:d,spatialReference:o.spatialReference}),w=a({projectedExtent:o,srcBufferExtent:t.extent,pixelSize:l,hasWrapAround:!0,spacing:[16,16]}),b=x(this._rctx,w),j=new _(g,f);j.wrapMode=33071;const D=new h(this._rctx,j);this._rctx.bindFramebuffer(D),this._rctx.setViewport(0,0,g,f),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(b,1),this._quad.bind();const{width:R=0,height:y=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",R,y),this._program.setUniform2fv("u_transformSpacing",w.spacing),this._program.setUniform2fv("u_transformGridSize",w.size),this._program.setUniform2f("u_targetImageSize",g,f),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),b.dispose(),n){const{width:t,height:e}=D,r=new ImageData(t??0,e??0);D.readPixels(0,0,t??0,e??0,6408,p.UNSIGNED_BYTE,r.data);const i=D.detachColorTexture();return D.dispose(),{texture:i,extent:o,imageData:r}}const C=D.detachColorTexture();return D.dispose(),{texture:C,extent:o}}reprojectBitmapData(t,e){const r=n(t.bitmapData)?o(t.bitmapData):t.bitmapData,i=new _(t.bitmapData.width,t.bitmapData.height);i.wrapMode=33071;const a=new g(this._rctx,i,r),s=this.reprojectTexture({texture:a,extent:t.extent},e,!0);s.texture.dispose();const m=document.createElement("canvas"),c=s.imageData;m.width=c.width,m.height=c.height;return m.getContext("2d").putImageData(c,0,0),{bitmapData:m,extent:s.extent}}async loadAndReprojectBitmapData(e,r,i){const[a]=await Promise.all([t(e,{responseType:"image"}).then(t=>t.data),s()]),n=document.createElement("canvas");n.width=a.width,n.height=a.height;const o=n.getContext("2d");o.drawImage(a,0,0);const m=o.getImageData(0,0,n.width,n.height);if(r.spatialReference.equals(i))return{bitmapData:m,extent:r};const c=this.reprojectBitmapData({bitmapData:m,extent:r},i);return{bitmapData:c.bitmapData,extent:c.extent}}destroy(){this._ownsRctx?(f._instanceRefCount--,0===f._instanceRefCount&&(this._quad.dispose(),this._rctx.dispose(),f._instance=null)):this._quad.dispose()}}export{f as ImageReprojector};
package/views/types.d.ts CHANGED
@@ -7,14 +7,19 @@ import type Camera from "../Camera.js";
7
7
  import type Graphic from "../Graphic.js";
8
8
  import type Ground from "../Ground.js";
9
9
  import type Viewpoint from "../Viewpoint.js";
10
+ import type WebDocument2D from "../WebDocument2D.js";
11
+ import type WebScene from "../WebScene.js";
10
12
  import type Analysis from "../analysis/Analysis.js";
11
13
  import type Collection from "../core/Collection.js";
12
14
  import type Extent from "../geometry/Extent.js";
13
15
  import type Point from "../geometry/Point.js";
14
16
  import type Polygon from "../geometry/Polygon.js";
17
+ import type ImageryLayer from "../layers/ImageryLayer.js";
18
+ import type ImageryTileLayer from "../layers/ImageryTileLayer.js";
15
19
  import type Layer from "../layers/Layer.js";
16
20
  import type MediaLayer from "../layers/MediaLayer.js";
17
21
  import type RouteLayer from "../layers/RouteLayer.js";
22
+ import type WCSLayer from "../layers/WCSLayer.js";
18
23
  import type BuildingSublayer from "../layers/buildingSublayers/BuildingSublayer.js";
19
24
  import type SubtypeSublayer from "../layers/support/SubtypeSublayer.js";
20
25
  import type { ReadonlyArrayOrCollection } from "../core/Collection.js";
@@ -342,7 +347,7 @@ export interface FetchPopupFeaturesResult {
342
347
  *
343
348
  * @since 4.24
344
349
  */
345
- export type ViewHit = GraphicHit | MediaHit | RouteHit | LayerHit;
350
+ export type ViewHit = GraphicHit | MediaHit | RouteHit | LayerHit | RasterHit;
346
351
 
347
352
  /**
348
353
  * Object specification for the graphic hit result returned in [ViewHitTestResult](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ViewHitTestResult) of the [MapView.hitTest()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#hitTest) method.
@@ -463,6 +468,46 @@ export interface LayerHit {
463
468
  mapPoint: Point;
464
469
  }
465
470
 
471
+ /**
472
+ * Object specification for the raster hit results returned from [ImageryLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryLayer/), [ImageryTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ImageryTileLayer/), or [WCSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WCSLayer/) in [ViewHitTestResult](https://developers.arcgis.com/javascript/latest/references/core/views/types/#ViewHitTestResult) of the [MapView.hitTest()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#hitTest) method.
473
+ *
474
+ * @since 5.1
475
+ */
476
+ export interface RasterHit {
477
+ /** @since 5.1 */
478
+ type: "raster";
479
+ /**
480
+ * The raster layer that contains the element.
481
+ *
482
+ * @since 5.1
483
+ */
484
+ layer: ImageryTileLayer | ImageryLayer | WCSLayer;
485
+ /**
486
+ * The point geometry in the spatial reference of the view corresponding with the input screen coordinates.
487
+ *
488
+ * @since 5.1
489
+ */
490
+ mapPoint?: Point | null;
491
+ /**
492
+ * The pixel values at the hit location.
493
+ *
494
+ * @since 5.1
495
+ */
496
+ pixelValue: number[];
497
+ /**
498
+ * The band IDs corresponding to the pixel values.
499
+ *
500
+ * @since 5.1
501
+ */
502
+ bandIds: number[];
503
+ /**
504
+ * Indicates whether the pixel values represent magnitude and direction.
505
+ *
506
+ * @since 5.1
507
+ */
508
+ isMagnitudeAndDirection: boolean;
509
+ }
510
+
466
511
  /**
467
512
  * Object specification for the result of the [MapView.hitTest()](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#hitTest) method.
468
513
  *
@@ -979,4 +1024,16 @@ export interface AnalysisViewEvents {
979
1024
 
980
1025
  /** @since 5.0 */
981
1026
  export type SceneViewEventTypes = ViewEventTypes
982
- & AnalysisViewEvents;
1027
+ & AnalysisViewEvents;
1028
+
1029
+ /** @internal */
1030
+ export interface PersistableComponent {
1031
+ /**
1032
+ * Updates the web document (either a [WebDocument2D](https://developers.arcgis.com/javascript/latest/references/core/WebDocument2D/) or [WebScene](https://developers.arcgis.com/javascript/latest/references/core/WebScene/)) with the state of this component
1033
+ * so that it can be persisted as part of the web document.
1034
+ *
1035
+ * @param document - The web document to update with the state of this component.
1036
+ * @internal
1037
+ */
1038
+ updateWebDocument(document: WebDocument2D | WebScene): void;
1039
+ }
@@ -19,7 +19,7 @@ export interface DefaultUIProperties extends UIProperties, Partial<Pick<DefaultU
19
19
  * the upper region are stacked vertically, while widgets in the lower region are stacked horizontally.
20
20
  * The available positions are indicated in the image below.
21
21
  *
22
- * ![views-ui-layout](https://developers.arcgis.com/javascript/latest/assets/references/core/views/views-ui-layout.jpg)
22
+ * ![views-ui-layout](https://developers.arcgis.com/javascript/latest/assets/references/core/views/views-ui-layout.avif)
23
23
  *
24
24
  * Methods, such as [add()](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#add) and [move()](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#move) can be used to place widgets in specific
25
25
  * positions of the UI. In the image below, the [Search](https://developers.arcgis.com/javascript/latest/references/core/widgets/Search/) and
@@ -37,7 +37,7 @@ export interface DefaultUIProperties extends UIProperties, Partial<Pick<DefaultU
37
37
  * view.ui.add(bmToggleWidget, "bottom-right");
38
38
  * ```
39
39
  *
40
- * ![views-ui-demo](https://developers.arcgis.com/javascript/latest/assets/references/core/views/views-ui-demo.png)
40
+ * ![views-ui-demo](https://developers.arcgis.com/javascript/latest/assets/references/core/views/views-ui-demo.avif)
41
41
  *
42
42
  * If you dive into the doc of the methods [add()](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#add), [empty()](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#empty) and [move()](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/#move), you'll notice some of the
43
43
  * possible values include "leading" and "trailing". That's because the ArcGIS Maps SDK for JavaScript provides
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import e from"../../core/Logger.js";import{disposeMaybe as t}from"../../core/maybe.js";import{BufferObject as r}from"./BufferObject.js";import{webglDebugEnabled as i}from"./checkWebGLError.js";import{ResourceType as s,ColorAttachment0 as n,PixelType as h,StencilAttachment as o,SizedDepthStencilFormat as c,DepthStencilAttachment as a,SizedDepthFormat as f,DepthAttachment as u}from"./enums.js";import{Renderbuffer as l}from"./Renderbuffer.js";import _ from"./Texture.js";const d=()=>e.getLogger("esri.views.webgl.FramebufferObject");class m{constructor(e,t,r){if(this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(s.FramebufferObject,this),null!=t){const r=E(e,t);null!=r&&(this._colorAttachments.set(n,r),p(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(n)}if(null!=r)if(x(r))this._depthStencilTexture=p(r)?r:new _(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=T(r)?r:new l(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}dispose(){const{_colorAttachments:e,_glName:t}=this;if(0===e.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;const{_context:r}=this,i=r.getBoundFramebufferObject(),n=Array.from(e.values());this.detachColorTextures(...e.keys()),n.forEach(e=>e.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),r.gl.deleteFramebuffer(t),this._glName=null,r.bindFramebuffer(i===this?null:i),r.instanceCounter.decrement(s.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(n);return p(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(n)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(n)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&p(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=n){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=n){const t=this._colorAttachments.get(e);if(!t)return;const r=p(t);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._initialized){const t=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{e.forEach(e=>{p(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=n,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,0,r):this._framebufferTexture2D(i.glName,t,e,36160,0))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===h.UNSIGNED_INT_24_8?6402!==r||i===h.UNSIGNED_INT||i===h.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,D(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,D(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){const{_context:t}=this,r=t.getBoundFramebufferObject();t.bindFramebuffer(this);const{gl:i}=t,s=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,s,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebufferObject(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,s,n,h){(e<0||t<0||s<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const o=h.descriptor;3553!==h.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==o?.width||null==o?.height||e+r>this.width||t+i>this.height||s+r>o.width||n+i>o.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,a=c.bindTexture(h,_.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(_.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,s,n,e,t,r,i),c.bindTexture(a,_.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,s,n,h){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,s,n,h)}async readPixelsAsync(e,t,i,s,n,h,o){const{gl:c}=this._context,a=r.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(a);const f=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),c.readPixels(e,t,i,s,n,h,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(f),await a.getSubDataAsync(o),a.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(F(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(F(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),i())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((t,r)=>{if(p(t)){const i=A(t);35866===i?this._framebufferTextureLayer(t.glName,r,e,0,0):this._framebufferTexture2D(t.glName,r,i,e)}else if(T(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=D(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,A(this._depthStencilTexture),e)}if(i()){t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=n,r=3553,i=36160,s=0){this._context.gl.framebufferTexture2D(i,t,r,e,s)}_framebufferTextureLayer(e,t=n,r=36160,i=0,s=0){this._context.gl.framebufferTextureLayer(r,t,e,i,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=t(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,D(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=t(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),F(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){F(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case f.DEPTH_COMPONENT16:case f.DEPTH_COMPONENT24:case f.DEPTH_COMPONENT32F:return u;case c.DEPTH24_STENCIL8:case c.DEPTH32F_STENCIL8:return a;case 36168:return o;default:return n}}_validateColorAttachmentPoint(t){if(-1===m._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;m._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const r=t-n;r+1>m._MAX_COLOR_ATTACHMENTS&&e.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${m._MAX_COLOR_ATTACHMENTS} color attachments`)}}function p(e){return 1===S(e)}function T(e){return 2===S(e)}function x(e){return p(e)||b(e)}function b(e){return 0===S(e)}function g(e){return 3===S(e)||null!=e&&"samples"in e}function S(e){return null!=e&&"type"in e?e.type:null}function E(e,t){return p(t)||T(t)?t:b(t)?new _(e,t):g(t)?new l(e,t):null}function F(e,t){const r=Math.max(e.width,e.height);if(r>t){d().warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function A(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function D(e){return 6402===e?u:a}export{m as FramebufferObject,F as ensureAttachmentMaxSize};
2
+ import e from"../../core/Logger.js";import{disposeMaybe as t}from"../../core/maybe.js";import{BufferObject as r}from"./BufferObject.js";import{webglDebugEnabled as i}from"./checkWebGLError.js";import{ResourceType as s,ColorAttachment0 as n,PixelType as h,StencilAttachment as o,SizedDepthStencilFormat as c,DepthStencilAttachment as a,SizedDepthFormat as f,DepthAttachment as u}from"./enums.js";import{Renderbuffer as l}from"./Renderbuffer.js";import d from"./Texture.js";const _=()=>e.getLogger("esri.views.webgl.FramebufferObject");class m{constructor(e,t,r){if(this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(s.FramebufferObject,this),null!=t){const r=F(e,t);null!=r&&(this._colorAttachments.set(n,r),T(r)?this._validateTextureDescriptor(r.descriptor):this._validateRenderbufferDescriptor(r.descriptor)),this._validateColorAttachmentPoint(n)}if(null!=r)if(b(r))this._depthStencilTexture=T(r)?r:new d(e,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const t=x(r)?r:new l(e,r);this._depthStencilBuffer=t,this._validateRenderbufferDescriptor(t.descriptor)}}get glName(){return this._glName}get colorTexture(){const e=this._colorAttachments.get(n);return T(e)?e:null}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(n)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(n)??this._depthStencilTexture??this._depthStencilBuffer;return e?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((e,[t,r])=>e+r.usedMemory,this.depthStencil?.usedMemory??0)}static{this._MAX_COLOR_ATTACHMENTS=-1}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&T(t)?t:null}get colorAttachments(){return Array.from(this._colorAttachments.keys())}attachColorTexture(e,t=n){if(!e)return;this._validateColorAttachmentPoint(t);const{descriptor:r}=e;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._colorAttachments.set(t,e),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t))}detachColorTexture(e=n){const t=this._colorAttachments.get(e);if(!t)return;const r=T(t);return this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{if(r)this._framebufferTexture2D(null,e);else{const t=this._context.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)}}),this._colorAttachments.delete(e),r?t:void 0}detachColorTextures(...e){if(0!==e.length){if(this._initialized){const t=this._context.gl;this._context.temporaryBindFramebufferObject(this,()=>{e.forEach(e=>{T(this._colorAttachments.get(e))?this._framebufferTexture2D(null,e):t.framebufferRenderbuffer(t.FRAMEBUFFER,e,t.RENDERBUFFER,null)})})}e.forEach(e=>this._colorAttachments.delete(e))}}setColorTextureTarget(e,t=n,r=0){const i=this._colorAttachments.get(t);i&&(35866===e?this._framebufferTextureLayer(i.glName,t,36160,0,r):this._framebufferTexture2D(i.glName,t,e,36160,0))}attachDepthStencil(e){if(e)switch(e.type){case 1:return this._attachDepthStencilTexture(e);case 2:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const{descriptor:t}=e,{pixelFormat:r,dataType:i}=t;34041===r||6402===r?34041!==r||i===h.UNSIGNED_INT_24_8?6402!==r||i===h.UNSIGNED_INT||i===h.UNSIGNED_SHORT?(this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,R(r))),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e):console.error("Depth texture must have data type of UNSIGNED_INT or UNSIGNED_SHORT!"):console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"):console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!")}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&this._context.temporaryBindFramebufferObject(this,()=>{this._framebufferTexture2D(null,R(e.descriptor.pixelFormat))}),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderbufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const{gl:r}=this._context,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(36160,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){const{_context:t}=this,r=t.boundFramebuffer;t.bindFramebuffer(this);const{gl:i}=t,s=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(36160,s,i.RENDERBUFFER,null),t.bindFramebuffer(r)}return this._depthStencilBuffer=null,e}invalidateAttachments(e){const{_context:t}=this;t.temporaryBindFramebufferObject(this,()=>t.gl.invalidateFramebuffer(36160,e),!0)}copyToTexture(e,t,r,i,s,n,h){(e<0||t<0||s<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const o=h.descriptor;3553!==h.descriptor.target&&console.error("Texture target must be TEXTURE_2D!"),(null==o?.width||null==o?.height||e+r>this.width||t+i>this.height||s+r>o.width||n+i>o.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,a=c.bindTexture(h,d.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(d.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(3553,0,s,n,e,t,r,i),c.bindTexture(a,d.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,s,n,h){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,s,n,h)}async readPixelsAsync(e,t,i,s,n,h,o){const{gl:c}=this._context,a=r.createPixelPack(this._context,35041,o.byteLength);this._context.bindBuffer(a);const f=this._context.boundFramebuffer;this._context.bindFramebuffer(this),c.readPixels(e,t,i,s,n,h,0),this._context.unbindBuffer(35051),this._context.bindFramebuffer(f),await a.getSubDataAsync(o),a.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};if(A(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(e=>e.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(A(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),i())){const{gl:e}=this._context;e.checkFramebufferStatus(36160)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}}initializeAndBind(e=36160){const{gl:t}=this._context;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach((t,r)=>{if(T(t)){const i=D(t);35866===i?this._framebufferTextureLayer(t.glName,r,e,0,0):this._framebufferTexture2D(t.glName,r,i,e)}else if(x(t)){const i=this._context.gl;i.framebufferRenderbuffer(e,r,i.RENDERBUFFER,t.glName)}}),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else if(this._depthStencilTexture){const t=R(this._depthStencilTexture.descriptor.pixelFormat);this._framebufferTexture2D(this._depthStencilTexture.glName,t,D(this._depthStencilTexture),e)}if(i()){t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!")}this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=n,r=3553,i=36160,s=0){this._context.gl.framebufferTexture2D(i,t,r,e,s)}_framebufferTextureLayer(e,t=n,r=36160,i=0,s=0){this._context.gl.framebufferTextureLayer(r,t,e,i,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(36160,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=t(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,R(this._depthStencilTexture.descriptor.pixelFormat))),this._depthStencilTexture=t(this._depthStencilTexture))}_validateTextureDescriptor(e){3553!==e.target&&34067!==e.target&&35866!==e.target&&console.error("Texture type must be TEXTURE_2D, TEXTURE_2D_ARRAY or TEXTURE_CUBE_MAP!"),A(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderbufferDescriptor(e){A(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case f.DEPTH_COMPONENT16:case f.DEPTH_COMPONENT24:case f.DEPTH_COMPONENT32F:return u;case c.DEPTH24_STENCIL8:case c.DEPTH32F_STENCIL8:return a;case 36168:return o;default:return n}}_validateColorAttachmentPoint(t){if(-1===m._MAX_COLOR_ATTACHMENTS){const{gl:e}=this._context;m._MAX_COLOR_ATTACHMENTS=e.getParameter(e.MAX_COLOR_ATTACHMENTS)}const r=t-n;r+1>m._MAX_COLOR_ATTACHMENTS&&e.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${r+1}. Implementation supports up to ${m._MAX_COLOR_ATTACHMENTS} color attachments`)}}class p extends m{constructor(e,t,r){super(e,t,r)}dispose(){const{_colorAttachments:e,_glName:t,_context:r}=this;if(0===e.size&&!this._depthStencilBuffer&&!this._depthStencilTexture&&!t)return;const i=r.boundFramebuffer,n=Array.from(e.values());this.detachColorTextures(...e.keys()),n.forEach(e=>e.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),r.gl.deleteFramebuffer(t),this._glName=null,r.bindFramebuffer(i===this?null:i),r.instanceCounter.decrement(s.FramebufferObject,this)}}function T(e){return 1===E(e)}function x(e){return 2===E(e)}function b(e){return T(e)||g(e)}function g(e){return 0===E(e)}function S(e){return 3===E(e)||null!=e&&"samples"in e}function E(e){return null!=e&&"type"in e?e.type:null}function F(e,t){return T(t)||x(t)?t:g(t)?new d(e,t):S(t)?new l(e,t):null}function A(e,t){const r=Math.max(e.width,e.height);if(r>t){_().warnOnce(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function D(e){return 34067===e.descriptor.target?34069:35866===e.descriptor.target?35866:3553}function R(e){return 6402===e?u:a}export{p as DisposableFramebufferObject,m as FramebufferObject,A as ensureAttachmentMaxSize};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import has from"../../core/has.js";import t from"../../core/Logger.js";import{disposeMaybe as e}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{Milliseconds as i}from"../../core/time.js";import{webglDebugEnabled as a,checkWebGLError as r,getErrorMessage as n,webglValidateShadersEnabled as l}from"./checkWebGLError.js";import{ContextState as h}from"./ContextState.js";import{DrawBufferNone as f,DrawBufferBack as o,baseTextureUnit as u,ResourceType as c,ColorAttachment0 as d,PrimitiveType as _}from"./enums.js";import{InstanceCounter as b}from"./InstanceCounter.js";import{Parameters as g}from"./Parameters.js";import{ProgramCache as p}from"./ProgramCache.js";import{StateTracker as m}from"./renderState.js";import B from"./Texture.js";import{WebGLDriverTest as F}from"./WebGLDriverTest.js";import{Capabilities as T}from"./capabilities/Capabilities.js";const x=()=>t.getLogger("esri.views.webgl.RenderingContext");let k=class{constructor(t,e){this.gl=t,this.instanceCounter=new b,this._programCache=new p(this),this._transformFeedbackRequestInfo=null,this._state=new h,this._numOfDrawCalls=0,this._numOfTriangles=0,this._options=e,this.configure(e)}configure(t){this._options=t,this._capabilities=new T(this.gl,t),this._parameters=new g(this.gl,this._capabilities,t),B.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new h,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new m({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)}}),this.enforceState(),e(this._driverTest),this._driverTest=new F(this)}updateOptions(t){this._options={...this._options,...t},this._parameters=new g(this.gl,this._capabilities,this._options)}dispose(){this._driverTest=e(this._driverTest),this._programCache=e(this._programCache),this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663),this._state.textureUnitMap.length=0,this._state.textureUnitSamplerMap.length=0,this._state=null,this._capabilities=null,this._stateTracker=null;const t=this.instanceCounter.resourceInformation;a()&&t&&console.log(t)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}get programCache(){return this._programCache}setPipelineState(t){this._stateTracker.setPipeline(t)}getPipelineState(){return this._stateTracker.getPipelineState()}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s){const e=t[s];this._state.textureUnitMap[e]=null,this._state.textureUnitSamplerMap[e]=null}e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=1032,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){1032===this._state.stencilOperation.face&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=1032,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(u+t),this._state.activeTexture=t),s}setDrawBuffers(t){const{drawFramebuffer:e}=this._state,s=null===e,i=s?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(e)??[];if(i?.length===t.length&&i.every((e,s)=>e===t[s]))return i;if(t.length>this.parameters.maxDrawBuffers)return x().error(`Setting more active draw buffers (${t.length}) than GL.MAX_DRAW_BUFFERS allows ( ${this.parameters.maxDrawBuffers}).`),i;if(s){if(t.length>1)return x().error(`The default framebuffer can only have 1 active draw buffer but was requested with ${t.length}.`),i;if(t[0]!==o&&t[0]!==f)return x().error(`The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers but got ${t[0]}`),i}else if(t.includes(o))return x().error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTx or GL.NONE as draw buffers."),i;return this.gl.drawBuffers(t),r(this.gl),s?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(e,t),i}clear(t,e=255){t&&(16384&t&&this.setColorMask(!0,!0,!0,!0),256&t&&this.setDepthWriteEnabled(!0),1024&t&&this.setStencilWriteMask(e),this.gl.clear(t))}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=16384}e&&(i|=256),!1===s?s=0:(!0===s&&(s=255),i|=1024),i&&this.clear(i,s)}clearBuffer(t,e,s=6144,i){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=6144,i){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=6144,i){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(a()&&(this._numOfDrawCalls++,this._numOfTriangles+=E(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),r(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),r(this.gl)}drawElements(t,e,s,i){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(a()&&(this._numOfDrawCalls++,this._numOfTriangles+=E(t,e)),this.gl.drawElements(t,e,s,i),a()){const a=n(this.gl);if(a){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.buffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:i},o=n?.size??0,u=i+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";x().error(`drawElements: ${a}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,a){this.gl.drawElementsInstanced(t,e,s,i,a),r(this.gl)}logInfo(){a()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){a()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){if(this._state.program!==t){if(t&&null==t.glName&&l())throw new Error("Attempting to use disposed or invalid Program");this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null)}}bindTexture(t,e,s=!1,i=null){(e>=this.parameters.maxTextureImageUnits||e<0)&&x().error(`Input texture unit (${e}) is out of range of available units (0...${this.parameters.maxTextureImageUnits})\n `);const a=this._state.textureUnitMap[e],r=this._state.textureUnitSamplerMap[e],{gl:n}=this;return null==t?.glName?(null!=a&&(this.setActiveTexture(e,s),n.bindTexture(a.descriptor.target,null)),this._state.textureUnitMap[e]=null,null!=r&&(this._state.textureUnitSamplerMap[e]=null,n.bindSampler(e,null)),a):(r!==i&&(n.bindSampler(e,i?.glName??null),this._state.textureUnitSamplerMap[e]=i),s||a!==t?(this.setActiveTexture(e,s),n.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,a):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),a))}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){const s=S(t);if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(null==t)return this.gl.bindFramebuffer(36160,null),this._state.readFramebuffer=this._state.drawFramebuffer=null,void this.setDrawBuffers(s);t.initializeAndBind(36160),this._state.readFramebuffer=t,this._state.drawFramebuffer=t,this.setDrawBuffers(s)}else this.setDrawBuffers(s)}bindFramebufferSeparate(t,e,s=!1){const i=36008===e,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._state.drawFramebuffer=t??null,this.setDrawBuffers(S(t))))}blitFramebuffer(t,e,s=16384,i=9728,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,u=e.height){this.bindFramebufferSeparate(t,36008,!0),this.bindFramebufferSeparate(e,36009,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,u,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case 34962:this._state.vertexBuffer=w(this.gl,t,e,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=w(this.gl,t,e,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=w(this.gl,t,e,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=w(this.gl,t,e,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=w(this.gl,t,e,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=w(this.gl,t,e,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=w(this.gl,t,e,this._state.copyWriteBuffer);break;case 35982:this._state.transformFeedbackBuffer=w(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return x().error(`Uniform buffer binding point (${e}) is out of range (0...${this.parameters.maxUniformBufferBindings})\n `),null;const s=35345===t?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):x().error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,i){null!=e?(a()&&(i??e.byteLength)>this._parameters.maxUniformBlockSize&&x().error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==i?this.bindBufferRange(35345,t,e.buffer,s,i):this.bindBufferBase(35345,t,e.buffer)):this.bindBufferBase(35345,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(35345,e,null)}}unbindBuffer(t){switch(t){case 34962:this._state.vertexBuffer=w(this.gl,null,t,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=w(this.gl,null,t,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=w(this.gl,null,t,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=w(this.gl,null,t,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=w(this.gl,null,t,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=w(this.gl,null,t,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=w(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t,e){if(null==t)return this._state.vertexArrayObject?.unbind(),void(this._state.vertexArrayObject=null);this._state.vertexArrayObject!==t&&(t.bind(e),this._state.vertexArrayObject=t)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=i(10)){const{gl:e}=this,a=e.fenceSync(37143,0);if(!a)throw new Error("Client wait failed, could not create sync object");let r;this.instanceCounter.increment(c.Sync,a),e.flush();do{await s(t),r=e.clientWaitSync(a,0,0)}while(37147===r);if(this.instanceCounter.decrement(c.Sync,a),e.deleteSync(a),37149===r)throw new Error("Client wait failed")}getBoundFramebufferObject(t=36160){return 36008===t?this._state.readFramebuffer:this._state.drawFramebuffer}temporaryBindFramebufferObject(t,e,s=!1){const i=this.getBoundFramebufferObject();try{this.bindFramebuffer(t,s),e()}finally{this.bindFramebuffer(i,s)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(34962,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(34963,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(35345,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(35345,s,i.glName):t.bindBufferRange(35345,s,i.glName,a,r):t.bindBufferBase(35345,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(35051,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(35052,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(36662,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(36663,null),t.bindFramebuffer(36008,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(36008,this._state.readFramebuffer.glName),t.readBuffer(d)),t.bindFramebuffer(36009,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[o])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[d])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(u+s),t.bindTexture(3553,null),t.bindTexture(34067,null),t.bindTexture(32879,null),t.bindTexture(35866,null),t.bindSampler(s,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName);const i=this._state.textureUnitSamplerMap[s];null!=i&&t.bindSampler(s,i?.glName)}t.activeTexture(u+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function w(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function E(t,e){switch(t){case _.POINTS:return 2*e;case _.TRIANGLES:return e/3;case _.TRIANGLE_STRIP:case _.TRIANGLE_FAN:return e-2;default:return 0}}function S(t){return t?t.colorAttachments.length>0?t.colorAttachments:[f]:[o]}export{k as RenderingContext,S as getFramebufferDrawBuffers};
2
+ import has from"../../core/has.js";import t from"../../core/Logger.js";import{disposeMaybe as e}from"../../core/maybe.js";import{after as s}from"../../core/promiseUtils.js";import{Milliseconds as i}from"../../core/time.js";import{webglDebugEnabled as a,checkWebGLError as r,getErrorMessage as n,webglValidateShadersEnabled as l}from"./checkWebGLError.js";import{ContextState as h}from"./ContextState.js";import{DrawBufferNone as f,DrawBufferBack as o,baseTextureUnit as u,ResourceType as c,ColorAttachment0 as d,PrimitiveType as _}from"./enums.js";import{InstanceCounter as b}from"./InstanceCounter.js";import{Parameters as g}from"./Parameters.js";import{ProgramCache as p}from"./ProgramCache.js";import{StateTracker as m}from"./renderState.js";import B from"./Texture.js";import{WebGLDriverTest as F}from"./WebGLDriverTest.js";import{Capabilities as T}from"./capabilities/Capabilities.js";const x=()=>t.getLogger("esri.views.webgl.RenderingContext");let k=class{constructor(t,e){this.gl=t,this.instanceCounter=new b,this._programCache=new p(this),this._transformFeedbackRequestInfo=null,this._state=new h,this._numOfDrawCalls=0,this._numOfTriangles=0,this._options=e,this.configure(e)}configure(t){this._options=t,this._capabilities=new T(this.gl,t),this._parameters=new g(this.gl,this._capabilities,t),B.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new h,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new m({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)}}),this.enforceState(),e(this._driverTest),this._driverTest=new F(this)}updateOptions(t){this._options={...this._options,...t},this._parameters=new g(this.gl,this._capabilities,this._options)}dispose(){this._driverTest=e(this._driverTest),this._programCache=e(this._programCache),this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663),this._state.textureUnitMap.length=0,this._state.textureUnitSamplerMap.length=0,this._state=null,this._capabilities=null,this._stateTracker=null;const t=this.instanceCounter.resourceInformation;a()&&t&&console.log(t)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}get programCache(){return this._programCache}setPipelineState(t){this._stateTracker.setPipeline(t)}getPipelineState(){return this._stateTracker.getPipelineState()}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s){const e=t[s];this._state.textureUnitMap[e]=null,this._state.textureUnitSamplerMap[e]=null}e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=1032,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){1032===this._state.stencilOperation.face&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=1032,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(u+t),this._state.activeTexture=t),s}setDrawBuffers(t){const{drawFramebuffer:e}=this._state,s=null===e,i=s?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(e)??[];if(i?.length===t.length&&i.every((e,s)=>e===t[s]))return i;if(t.length>this.parameters.maxDrawBuffers)return x().error(`Setting more active draw buffers (${t.length}) than GL.MAX_DRAW_BUFFERS allows ( ${this.parameters.maxDrawBuffers}).`),i;if(s){if(t.length>1)return x().error(`The default framebuffer can only have 1 active draw buffer but was requested with ${t.length}.`),i;if(t[0]!==o&&t[0]!==f)return x().error(`The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers but got ${t[0]}`),i}else if(t.includes(o))return x().error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTx or GL.NONE as draw buffers."),i;return this.gl.drawBuffers(t),r(this.gl),s?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(e,t),i}clear(t,e=255){t&&(16384&t&&this.setColorMask(!0,!0,!0,!0),256&t&&this.setDepthWriteEnabled(!0),1024&t&&this.setStencilWriteMask(e),this.gl.clear(t))}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=16384}e&&(i|=256),!1===s?s=0:(!0===s&&(s=255),i|=1024),i&&this.clear(i,s)}clearBuffer(t,e,s=6144,i){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=6144,i){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=6144,i){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(a()&&(this._numOfDrawCalls++,this._numOfTriangles+=E(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),r(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),r(this.gl)}drawElements(t,e,s,i){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(a()&&(this._numOfDrawCalls++,this._numOfTriangles+=E(t,e)),this.gl.drawElements(t,e,s,i),a()){const a=n(this.gl);if(a){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.buffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:i},o=n?.size??0,u=i+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";x().error(`drawElements: ${a}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,a){this.gl.drawElementsInstanced(t,e,s,i,a),r(this.gl)}logInfo(){a()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){a()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){if(this._state.program!==t){if(t&&null==t.glName&&l())throw new Error("Attempting to use disposed or invalid Program");this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null)}}bindTexture(t,e,s=!1,i=null){(e>=this.parameters.maxTextureImageUnits||e<0)&&x().error(`Input texture unit (${e}) is out of range of available units (0...${this.parameters.maxTextureImageUnits})\n `);const a=this._state.textureUnitMap[e],r=this._state.textureUnitSamplerMap[e],{gl:n}=this;return null==t?.glName?(null!=a&&(this.setActiveTexture(e,s),n.bindTexture(a.descriptor.target,null)),this._state.textureUnitMap[e]=null,null!=r&&(this._state.textureUnitSamplerMap[e]=null,n.bindSampler(e,null)),a):(r!==i&&(n.bindSampler(e,i?.glName??null),this._state.textureUnitSamplerMap[e]=i),s||a!==t?(this.setActiveTexture(e,s),n.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,a):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),a))}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){const s=S(t);if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(null==t)return this.gl.bindFramebuffer(36160,null),this._state.readFramebuffer=this._state.drawFramebuffer=null,void this.setDrawBuffers(s);t.initializeAndBind(36160),this._state.readFramebuffer=t,this._state.drawFramebuffer=t,this.setDrawBuffers(s)}else this.setDrawBuffers(s)}bindFramebufferSeparate(t,e,s=!1){const i=36008===e,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._state.drawFramebuffer=t??null,this.setDrawBuffers(S(t))))}blitFramebuffer(t,e,s=16384,i=9728,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,u=e.height){this.bindFramebufferSeparate(t,36008,!0),this.bindFramebufferSeparate(e,36009,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,u,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case 34962:this._state.vertexBuffer=w(this.gl,t,e,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=w(this.gl,t,e,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=w(this.gl,t,e,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=w(this.gl,t,e,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=w(this.gl,t,e,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=w(this.gl,t,e,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=w(this.gl,t,e,this._state.copyWriteBuffer);break;case 35982:this._state.transformFeedbackBuffer=w(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return x().error(`Uniform buffer binding point (${e}) is out of range (0...${this.parameters.maxUniformBufferBindings})\n `),null;const s=35345===t?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):x().error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,i){null!=e?(a()&&(i??e.byteLength)>this._parameters.maxUniformBlockSize&&x().error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==i?this.bindBufferRange(35345,t,e.buffer,s,i):this.bindBufferBase(35345,t,e.buffer)):this.bindBufferBase(35345,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(35345,e,null)}}unbindBuffer(t){switch(t){case 34962:this._state.vertexBuffer=w(this.gl,null,t,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=w(this.gl,null,t,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=w(this.gl,null,t,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=w(this.gl,null,t,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=w(this.gl,null,t,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=w(this.gl,null,t,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=w(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t,e){if(null==t)return this._state.vertexArrayObject?.unbind(),void(this._state.vertexArrayObject=null);this._state.vertexArrayObject!==t&&(t.bind(e),this._state.vertexArrayObject=t)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=i(10)){const{gl:e}=this,a=e.fenceSync(37143,0);if(!a)throw new Error("Client wait failed, could not create sync object");let r;this.instanceCounter.increment(c.Sync,a),e.flush();do{await s(t),r=e.clientWaitSync(a,0,0)}while(37147===r);if(this.instanceCounter.decrement(c.Sync,a),e.deleteSync(a),37149===r)throw new Error("Client wait failed")}get boundFramebuffer(){return this._state.drawFramebuffer}temporaryBindFramebufferObject(t,e,s=!1){const i=this.boundFramebuffer;try{this.bindFramebuffer(t,s),e()}finally{this.bindFramebuffer(i,s)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(34962,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(34963,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(35345,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(35345,s,i.glName):t.bindBufferRange(35345,s,i.glName,a,r):t.bindBufferBase(35345,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(35051,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(35052,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(36662,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(36663,null),t.bindFramebuffer(36008,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(36008,this._state.readFramebuffer.glName),t.readBuffer(d)),t.bindFramebuffer(36009,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[o])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[d])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(u+s),t.bindTexture(3553,null),t.bindTexture(34067,null),t.bindTexture(32879,null),t.bindTexture(35866,null),t.bindSampler(s,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName);const i=this._state.textureUnitSamplerMap[s];null!=i&&t.bindSampler(s,i?.glName)}t.activeTexture(u+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function w(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function E(t,e){switch(t){case _.POINTS:return 2*e;case _.TRIANGLES:return e/3;case _.TRIANGLE_STRIP:case _.TRIANGLE_FAN:return e-2;default:return 0}}function S(t){return t?t.colorAttachments.length>0?t.colorAttachments:[f]:[o]}export{k as RenderingContext,S as getFramebufferDrawBuffers};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../core/Error.js";import has from"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{hasValue as r}from"../../core/object.js";import{throwIfAborted as s,isAbortError as o}from"../../core/promiseUtils.js";import{checkWebGLError as a}from"./checkWebGLError.js";import{ResourceType as n,CompressedTextureFormat as p}from"./enums.js";import{estimateMemory as l}from"./TextureDescriptor.js";import{isCompressedData as m,deriveInternalFormat as h,isTexImageSource as d,is3DTarget as c,validateTexture as _,isCompressedFormat as u,getDimensions as g,isSizedPixelFormat as x,isSizedDepthFormat as T,isSizedDepthStencilFormat as M,calcMipmapLevels as b}from"./textureUtils.js";import{ValidatedTextureDescriptor as f}from"./ValidatedTextureDescriptor.js";const w=!!has("esri-tests-disable-gpu-memory-measurements"),D=()=>e.getLogger("esri/views/webgl/Texture");class E{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=f.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return w?0:l(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null,this._descriptor=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!m(t)&&this._descriptor.internalFormat&&r(p,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!m(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(e,i,r,s,o,a,n=0){a||D().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||D().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=h(p);const{context:l,pixelFormat:c,dataType:_,target:u,isImmutable:g}=p;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const x=l.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES,!0);(i<0||r<0||i+s>p.width||r+o>p.height)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=l;n&&(s&&o||D().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,n)),d(a)?T.texSubImage2D(u,e,i,r,s,o,c,_,a):m(a)?T.compressedTexSubImage2D(u,e,i,r,s,o,p.internalFormat,a.levels[e]):T.texSubImage2D(u,e,i,r,s,o,c,_,a),n&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),l.bindTexture(x,E.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,i,r,s,o,a,n,p){p||D().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||D().error("An attempt to update an uninitialized texture!");const l=this._descriptor;l.internalFormat=h(l);const{context:d,pixelFormat:_,dataType:u,isImmutable:g,target:x}=l;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");c(x)||D().warn("Attempting to set 3D texture data on a non-3D texture");const T=d.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),(i<0||r<0||s<0||i+o>l.width||r+a>l.height||s+n>l.depth)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=d;if(m(p))p=p.levels[e],M.compressedTexSubImage3D(x,e,i,r,s,o,a,n,l.internalFormat,p);else{const t=p;M.texSubImage3D(x,e,i,r,s,o,a,n,_,u,t)}d.bindTexture(T,E.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,_(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const i=this._descriptor.context.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(i,E.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,_(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,_(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),_(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=i(this._compressionAbortController)}_setData(e,i){const r=this._descriptor,s=r.context?.gl;if(!s)return;a(s),this.hasWebGLTextureObject||(this._glName=s.createTexture(),r.context.instanceCounter.increment(n.Texture,this)),_(r);const o=r.context.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),a(s);const p=i??r.target,l=c(p);if(d(e))this._setDataFromTexImageSource(e,p);else{const{width:i,height:o,depth:n}=r;if(null==i||null==o)throw new t("texture:missing-size","Width and height must be specified!");if(l&&null==n)throw new t("texture:missing-depth","Depth must be specified!");if(r.internalFormat=h(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(p,r.internalFormat,r.hasMipmap,i,o,n),m(e)){if(!u(r.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,p)}else this._texImage(p,0,r.internalFormat,i,o,n,e),a(s),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),a(s),r.context.bindTexture(o,E.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=h(r);const s=c(e),{width:o,height:n,depth:p}=g(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=n),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,n,p),this._texImage(e,0,r.internalFormat,o,n,p,t),a(i),r.hasMipmap&&(this.generateMipmap(),a(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=b(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,l),this._forEachMipmapLevel((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)},l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!x(i)&&!T(i)&&!M(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?b(e,s,o,a):1;if(c(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:a,preMultiplyAlpha:n,hasMipmap:p}=this._descriptor,l=this._descriptor.compress?.compressionTracker,m=this._descriptor.compress?.compressionCallback,{compressedTextureETC:h,compressedTextureS3TC:d}=r.capabilities;if(!E.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!h&&!d)return;this.abortCompression();const c=new AbortController;let _;this._compressionAbortController=c,l?.increment();try{t instanceof Uint8Array?_=t.buffer:(_=await createImageBitmap(t,{imageOrientation:a?"flipY":"none"}),s(c));const r={data:_,width:e,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:p,hasETC:!!h,hasS3TC:!!d},o=await E.compressionWorkerHandle.invoke(r,c.signal,1);if(s(c),o.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=o.internalFormat,this._setData(o.compressedTexture),m?.(t-this.usedMemory)}}catch(u){o(u)||D().error("Texture compression failed!")}finally{l?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=32879===n;if(null==r||null==s||p&&null==o)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),a(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}export{E as default};
2
+ import t from"../../core/Error.js";import has from"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{hasValue as r}from"../../core/object.js";import{throwIfAborted as s,isAbortError as o}from"../../core/promiseUtils.js";import{checkWebGLError as a}from"./checkWebGLError.js";import{ResourceType as n,CompressedTextureFormat as p}from"./enums.js";import{estimateMemory as l}from"./TextureDescriptor.js";import{isCompressedData as m,deriveInternalFormat as h,isTexImageSource as d,is3DTarget as c,validateTexture as _,isCompressedFormat as u,getDimensions as g,isSizedPixelFormat as x,isSizedDepthFormat as T,isSizedDepthStencilFormat as M,calcMipmapLevels as b}from"./textureUtils.js";import{ValidatedTextureDescriptor as f}from"./ValidatedTextureDescriptor.js";const w=!!has("esri-tests-disable-gpu-memory-measurements"),D=()=>e.getLogger("esri/views/webgl/Texture");class E{static{this.TEXTURE_UNIT_FOR_UPDATES=0}static{this.compressionWorkerHandle=null}constructor(e,i=null,r=null){if(this.type=1,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._shadowFilterDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const r=f.validate(e,i);if(!r)throw new t("texture:invalid-descriptor","Texture descriptor invalid");this._descriptor=r}34067===this._descriptor.target?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return w?0:l(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty||this._shadowFilterDirty}get hasWebGLTextureObject(){return!!this._glName}dispose(){this.abortCompression(),this.hasWebGLTextureObject&&this._descriptor.context?.gl&&(this._descriptor.context.instanceCounter.decrement(n.Texture,this),this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}[Symbol.dispose](){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("texture:immutable-resize","Immutable textures can't be resized!");r.width=e,r.height=i,34067===this._descriptor.target?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.compress=t}disableCompression(){this._descriptor.compress=void 0}setData(t){this.abortCompression(),!m(t)&&this._descriptor.internalFormat&&r(p,this._descriptor.internalFormat)&&(this._descriptor.internalFormat=void 0),this._setData(t),!m(t)&&this._descriptor.compress&&this._compressOnWorker(t)}updateData(e,i,r,s,o,a,n=0){a||D().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||D().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=h(p);const{context:l,pixelFormat:c,dataType:_,target:u,isImmutable:g}=p;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");const x=l.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES,!0);(i<0||r<0||i+s>p.width||r+o>p.height)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:T}=l;n&&(s&&o||D().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),T.pixelStorei(T.UNPACK_SKIP_ROWS,n)),d(a)?T.texSubImage2D(u,e,i,r,s,o,c,_,a):m(a)?T.compressedTexSubImage2D(u,e,i,r,s,o,p.internalFormat,a.levels[e]):T.texSubImage2D(u,e,i,r,s,o,c,_,a),n&&T.pixelStorei(T.UNPACK_SKIP_ROWS,0),l.bindTexture(x,E.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,i,r,s,o,a,n,p){p||D().error("An attempt to use uninitialized data!"),this.hasWebGLTextureObject||D().error("An attempt to update an uninitialized texture!");const l=this._descriptor;l.internalFormat=h(l);const{context:d,pixelFormat:_,dataType:u,isImmutable:g,target:x}=l;if(g&&!this._wasImmutablyAllocated)throw new t("texture:uninitialized","Cannot update immutable texture before allocation!");c(x)||D().warn("Attempting to set 3D texture data on a non-3D texture");const T=d.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);d.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),(i<0||r<0||s<0||i+o>l.width||r+a>l.height||s+n>l.depth)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=d;if(m(p))p=p.levels[e],M.compressedTexSubImage3D(x,e,i,r,s,o,a,n,l.internalFormat,p);else{const t=p;M.texSubImage3D(x,e,i,r,s,o,a,n,_,u,t)}d.bindTexture(T,E.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(0===e.width||0===e.height)return;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,_(e)}9729===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9985):9728===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9984);const i=this._descriptor.context.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(i,E.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("texture:immutable-change","Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,_(e)}9985===e.samplingMode?(this._samplingModeDirty=!0,e.samplingMode=9729):9984===e.samplingMode&&(this._samplingModeDirty=!0,e.samplingMode=9728)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,_(this._descriptor),this._wrapModeDirty=!0)}setShadowFiltering(t){t!==this._descriptor.linearFilterDepth&&(this._descriptor.linearFilterDepth=this._descriptor.compareEnabled=t,this.setSamplingMode(t?9729:9728),_(this._descriptor),this._shadowFilterDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1),this._shadowFilterDirty&&(this._applyShadowMode(),this._shadowFilterDirty=!1)}abortCompression(){this._compressionAbortController=i(this._compressionAbortController)}_setData(e,i){const r=this._descriptor,s=r.context?.gl;if(!s)return;a(s),this.hasWebGLTextureObject||(this._glName=s.createTexture(),r.context.instanceCounter.increment(n.Texture,this)),_(r);const o=r.context.bindTexture(this,E.TEXTURE_UNIT_FOR_UPDATES);r.context.setActiveTexture(E.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),a(s);const p=i??r.target,l=c(p);if(d(e))this._setDataFromTexImageSource(e,p);else{const{width:i,height:o,depth:n}=r;if(null==i||null==o)throw new t("texture:missing-size","Width and height must be specified!");if(l&&null==n)throw new t("texture:missing-depth","Depth must be specified!");if(r.internalFormat=h(r),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(p,r.internalFormat,r.hasMipmap,i,o,n),m(e)){if(!u(r.internalFormat))throw new t("texture:format-mismatch","Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(e,r.internalFormat,p)}else this._texImage(p,0,r.internalFormat,i,o,n,e),a(s),r.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),this._applyShadowMode(),a(s),r.context.bindTexture(o,E.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=34069;e<=34074;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=h(r);const s=c(e),{width:o,height:n,depth:p}=g(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=n),s&&r.depth,s&&(r.depth=p),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,n,p),this._texImage(e,0,r.internalFormat,o,n,p,t),a(i),r.hasMipmap&&(this.generateMipmap(),a(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,p=b(i,s,o,a),l=Math.min(p,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,33085,l),this._forEachMipmapLevel((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)},l)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!x(i)&&!T(i)&&!M(i))throw new t("texture:missing-format","Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const p=r?b(e,s,o,a):1;if(c(e)){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");n.texStorage3D(e,p,i,s,o,a)}else n.texStorage2D(e,p,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e),{isImmutable:m,pixelFormat:h,dataType:d}=this._descriptor;if(m){if(null!=n){const r=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texSubImage3D(e,i,0,0,0,s,o,a,h,d,r)}else p.texSubImage2D(e,i,0,0,s,o,h,d,r)}}else{const m=n;if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.texImage3D(e,i,r,s,o,a,0,h,d,m)}else p.texImage2D(e,i,r,s,o,0,h,d,m)}}_compressedTexImage(e,i,r,s,o,a,n){const p=this._descriptor.context.gl,l=c(e);if(this._descriptor.isImmutable){if(null!=n)if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else p.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(l){if(null==a)throw new t("texture:missing-depth","Missing depth dimension for 3D texture upload");p.compressedTexImage3D(e,i,r,s,o,a,0,n)}else p.compressedTexImage2D(e,i,r,s,o,0,n)}async _compressOnWorker(t){const{width:e,height:i,context:r,flipped:a,preMultiplyAlpha:n,hasMipmap:p}=this._descriptor,l=this._descriptor.compress?.compressionTracker,m=this._descriptor.compress?.compressionCallback,{compressedTextureETC:h,compressedTextureS3TC:d}=r.capabilities;if(!E.compressionWorkerHandle?.isCompressible(t,this._descriptor)||!h&&!d)return;this.abortCompression();const c=new AbortController;let _;this._compressionAbortController=c,l?.increment();try{t instanceof Uint8Array?_=t.buffer:(_=await createImageBitmap(t,{imageOrientation:a?"flipY":"none"}),s(c));const r={data:_,width:e,height:i,needsFlip:t instanceof Uint8Array&&this.descriptor.flipped,components:6408===this._descriptor.pixelFormat?4:3,preMultiplyAlpha:n,hasMipmap:p,hasETC:!!h,hasS3TC:!!d},o=await E.compressionWorkerHandle.invoke(r,c.signal,1);if(s(c),o.compressedTexture&&this.hasWebGLTextureObject){const t=this.usedMemory;this._descriptor.internalFormat=o.internalFormat,this._setData(o.compressedTexture),m?.(t-this.usedMemory)}}catch(u){o(u)||D().error("Texture compression failed!")}finally{l?.decrement(),this._compressionAbortController?.signal.aborted&&(this._compressionAbortController=null),_ instanceof ImageBitmap&&_.close()}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=32879===n;if(null==r||null==s||p&&null==o)throw new t("texture:missing-size","Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;9985===i||9987===i?(i=9729,t.hasMipmap||(r=9729)):9984!==i&&9986!==i||(i=9728,t.hasMipmap||(r=9728)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyShadowMode(){const t=this._descriptor,e=t.context?.gl,i=t.compareEnabled?e.COMPARE_REF_TO_TEXTURE:e.NONE;e.texParameteri(t.target,e.TEXTURE_COMPARE_MODE,i),t.compareEnabled&&e.texParameteri(t.target,e.TEXTURE_COMPARE_FUNC,e.GREATER),a(e)}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}}export{E as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{PixelType as r,SizedPixelFormat as e,PrimitiveType as t}from"./enums.js";import{FramebufferObject as o}from"./FramebufferObject.js";import{makePipelineState as i,destinationTimesOneMinusSourceAlpha as n}from"./renderState.js";import{TextureDescriptor as s}from"./TextureDescriptor.js";import{VertexArrayObject as a}from"./VertexArrayObject.js";import{Pos2usLocations as p,Pos2us as c}from"./VertexAttributeLayouts.js";import{VertexBuffer as f}from"./VertexBuffer.js";import{WebGLDriverTestModule as l}from"./WebGLDriverTestModule.js";class m extends l{constructor(r){if(super(),this._rctx=r,!r.gl)return;if(!(r.capabilities.colorBufferFloat?.textureFloat&&r.capabilities.colorBufferFloat?.floatBlend))return;const e="\n precision highp float;\n attribute vec2 position;\n\n void main() {\n gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);\n }\n ",t="\n precision highp float;\n\n void main() {\n gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5);\n }\n ";this._program=r.programCache.get(e,t,p)}_test(p){const l=this._rctx,m=new s(1);m.wrapMode=33071,m.dataType=r.FLOAT,m.internalFormat=e.RGBA32F,m.samplingMode=9728;const u=new o(l,m),b=new f(l,c,new Uint16Array([0,0,1,0,0,1,1,1])),d=new a(l,b);l.gl.getError(),l.useProgram(p);const g=l.getBoundFramebufferObject(),{x:w,y:A,width:j,height:x}=l.getViewport();l.bindFramebuffer(u),l.setViewport(0,0,1,1),l.bindVAO(d),l.drawArrays(t.TRIANGLE_STRIP,0,4);const h=i({blending:n});l.setPipelineState(h),l.drawArrays(t.TRIANGLE_STRIP,0,4);const F=l.gl.getError();return l.setViewport(w,A,j,x),l.bindFramebuffer(g),d.dispose(),u.dispose(),F!==l.gl.INVALID_OPERATION||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}}export{m as FloatBufferBlend};
2
+ import{PixelType as r,SizedPixelFormat as e,PrimitiveType as t}from"./enums.js";import{DisposableFramebufferObject as o}from"./FramebufferObject.js";import{makePipelineState as i,destinationTimesOneMinusSourceAlpha as n}from"./renderState.js";import{TextureDescriptor as s}from"./TextureDescriptor.js";import{VertexArrayObject as a}from"./VertexArrayObject.js";import{Pos2usLocations as p,Pos2us as f}from"./VertexAttributeLayouts.js";import{VertexBuffer as l}from"./VertexBuffer.js";import{WebGLDriverTestModule as c}from"./WebGLDriverTestModule.js";class m extends c{constructor(r){if(super(),this._rctx=r,!r.gl)return;if(!(r.capabilities.colorBufferFloat?.textureFloat&&r.capabilities.colorBufferFloat?.floatBlend))return;const e="\n precision highp float;\n attribute vec2 position;\n\n void main() {\n gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);\n }\n ",t="\n precision highp float;\n\n void main() {\n gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5);\n }\n ";this._program=r.programCache.get(e,t,p)}_test(p){const c=this._rctx,m=new s(1);m.wrapMode=33071,m.dataType=r.FLOAT,m.internalFormat=e.RGBA32F,m.samplingMode=9728;const u=new o(c,m),b=new l(c,f,new Uint16Array([0,0,1,0,0,1,1,1])),d=new a(c,b);c.gl.getError(),c.useProgram(p);const g=c.boundFramebuffer,{x:w,y:A,width:x,height:h}=c.getViewport();c.bindFramebuffer(u),c.setViewport(0,0,1,1),c.bindVAO(d),c.drawArrays(t.TRIANGLE_STRIP,0,4);const j=i({blending:n});c.setPipelineState(j),c.drawArrays(t.TRIANGLE_STRIP,0,4);const F=c.gl.getError();return c.setViewport(w,A,x,h),c.bindFramebuffer(g),d.dispose(),u.dispose(),F!==c.gl.INVALID_OPERATION||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}}export{m as FloatBufferBlend};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{PrimitiveType as e,PixelType as r}from"./enums.js";import{FramebufferObject as t}from"./FramebufferObject.js";import i from"./Texture.js";import{TextureDescriptor as o}from"./TextureDescriptor.js";import{VertexArrayObject as n}from"./VertexArrayObject.js";import{Pos2usLocations as s,Pos2us as a}from"./VertexAttributeLayouts.js";import{VertexBuffer as m}from"./VertexBuffer.js";import{WebGLDriverTestModule as p}from"./WebGLDriverTestModule.js";class u extends p{constructor(e){super(),this._rctx=e;const r="\n precision highp float;\n\n attribute vec2 position;\n varying vec2 v_uv;\n\n void main() {\n v_uv = position;\n gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);\n }\n ",t="\n precision highp float;\n\n varying vec2 v_uv;\n\n uniform sampler2D u_texture;\n\n void main() {\n gl_FragColor = texture2D(u_texture, v_uv);\n }\n ";this._program=e.programCache.get(r,t,s)}dispose(){super.dispose()}_test(s){const p=this._rctx;if(!p.gl)return!0;const u=new o(1);u.wrapMode=33071,u.samplingMode=9728;const d=new t(p,u),g=new m(p,a,new Uint16Array([0,0,1,0,0,1,1,1])),f=new n(p,g),l=new o;l.samplingMode=9729,l.wrapMode=33071;const v=new i(p,l,c);p.useProgram(s),p.bindTexture(v,0),s.setUniform1i("u_texture",0);const w=p.getBoundFramebufferObject(),{x:h,y:x,width:b,height:_}=p.getViewport();p.bindFramebuffer(d),p.setViewport(0,0,1,1),p.setClearColor(0,0,0,0),p.setBlendingEnabled(!1),p.clear(16384),p.bindVAO(f),p.drawArrays(e.TRIANGLE_STRIP,0,4);const j=new Uint8Array(4);return d.readPixels(0,0,1,1,6408,r.UNSIGNED_BYTE,j),f.dispose(),d.dispose(),v.dispose(),p.setViewport(h,x,b,_),p.bindFramebuffer(w),255!==j[0]}}const c=new Image;c.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",c.width=5,c.height=5,c.decode();export{u as SVGPremultipliedAlpha};
2
+ import{PrimitiveType as e,PixelType as r}from"./enums.js";import{DisposableFramebufferObject as t}from"./FramebufferObject.js";import i from"./Texture.js";import{TextureDescriptor as o}from"./TextureDescriptor.js";import{VertexArrayObject as n}from"./VertexArrayObject.js";import{Pos2usLocations as s,Pos2us as a}from"./VertexAttributeLayouts.js";import{VertexBuffer as m}from"./VertexBuffer.js";import{WebGLDriverTestModule as p}from"./WebGLDriverTestModule.js";class u extends p{constructor(e){super(),this._rctx=e;const r="\n precision highp float;\n\n attribute vec2 position;\n varying vec2 v_uv;\n\n void main() {\n v_uv = position;\n gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0);\n }\n ",t="\n precision highp float;\n\n varying vec2 v_uv;\n\n uniform sampler2D u_texture;\n\n void main() {\n gl_FragColor = texture2D(u_texture, v_uv);\n }\n ";this._program=e.programCache.get(r,t,s)}dispose(){super.dispose()}_test(s){const p=this._rctx;if(!p.gl)return!0;const u=new o(1);u.wrapMode=33071,u.samplingMode=9728;const d=new t(p,u),g=new m(p,a,new Uint16Array([0,0,1,0,0,1,1,1])),f=new n(p,g),l=new o;l.samplingMode=9729,l.wrapMode=33071;const v=new i(p,l,c);p.useProgram(s),p.bindTexture(v,0),s.setUniform1i("u_texture",0);const w=p.boundFramebuffer,{x:h,y:x,width:b,height:_}=p.getViewport();p.bindFramebuffer(d),p.setViewport(0,0,1,1),p.setClearColor(0,0,0,0),p.setBlendingEnabled(!1),p.clear(16384),p.bindVAO(f),p.drawArrays(e.TRIANGLE_STRIP,0,4);const j=new Uint8Array(4);return d.readPixels(0,0,1,1,6408,r.UNSIGNED_BYTE,j),f.dispose(),d.dispose(),v.dispose(),p.setViewport(h,x,b,_),p.bindFramebuffer(w),255!==j[0]}}const c=new Image;c.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",c.width=5,c.height=5,c.decode();export{u as SVGPremultipliedAlpha};
@@ -27,11 +27,11 @@ export interface EnvironmentProperties extends Partial<Pick<Environment, "atmosp
27
27
  *
28
28
  * Known Value | Example
29
29
  * ------------|---------
30
- * [SunnyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunnyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-sunny.png)
31
- * [CloudyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/CloudyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-cloudy.png)
32
- * [RainyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/RainyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-rainy.png)
33
- * [SnowyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SnowyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-snowy.png)
34
- * [FoggyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/FoggyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-foggy.png)
30
+ * [SunnyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunnyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-sunny.avif)
31
+ * [CloudyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/CloudyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-cloudy.avif)
32
+ * [RainyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/RainyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-rainy.avif)
33
+ * [SnowyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SnowyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-snowy.avif)
34
+ * [FoggyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/FoggyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-foggy.avif)
35
35
  *
36
36
  * @default SunnyWeather
37
37
  */
@@ -83,11 +83,11 @@ export default class Environment extends JSONSupport {
83
83
  *
84
84
  * Known Value | Example
85
85
  * ------------|---------
86
- * [SunnyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunnyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-sunny.png)
87
- * [CloudyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/CloudyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-cloudy.png)
88
- * [RainyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/RainyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-rainy.png)
89
- * [SnowyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SnowyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-snowy.png)
90
- * [FoggyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/FoggyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-foggy.png)
86
+ * [SunnyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SunnyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-sunny.avif)
87
+ * [CloudyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/CloudyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-cloudy.avif)
88
+ * [RainyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/RainyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-rainy.avif)
89
+ * [SnowyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/SnowyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-snowy.avif)
90
+ * [FoggyWeather](https://developers.arcgis.com/javascript/latest/references/core/views/3d/environment/FoggyWeather/) | ![scene-atmosphere](https://developers.arcgis.com/javascript/latest/assets/references/core/views/scene-weather-foggy.avif)
91
91
  *
92
92
  * @default SunnyWeather
93
93
  */
@@ -16,7 +16,7 @@ export interface GlowProperties extends Partial<Pick<Glow, "intensity">> {}
16
16
  * materials with an emissive color or factor). See the [Visualization with light-emitting symbols](https://developers.arcgis.com/javascript/latest/sample-code/light-emitting-symbols/) sample to learn how
17
17
  * to use emissive materials and glow to highlight features and build nighttime scenes.
18
18
  *
19
- * |<img src="https://developers.arcgis.com/javascript/latest/assets/references/core/symbols/symbol3Dmaterial/emissiveStrength1.png" style="width:250px;"/>|<img src="https://developers.arcgis.com/javascript/latest/assets/references/core/symbols/symbol3Dmaterial/glow0.png" style="width:250px;"/>|<img src="https://developers.arcgis.com/javascript/latest/assets/references/core/symbols/symbol3Dmaterial/glow1.png" style="width:250px;"/>|
19
+ * |<img src="https://developers.arcgis.com/javascript/latest/assets/references/core/symbols/symbol3Dmaterial/emissiveStrength1.avif" style="width:250px;"/>|<img src="https://developers.arcgis.com/javascript/latest/assets/references/core/symbols/symbol3Dmaterial/glow0.avif" style="width:250px;"/>|<img src="https://developers.arcgis.com/javascript/latest/assets/references/core/symbols/symbol3Dmaterial/glow1.avif" style="width:250px;"/>|
20
20
  * | ---------- | ----------- | ----------- |
21
21
  * | `glow: null`|`glow: { intensity: 0 }`|`glow: { intensity: 1 }`|
22
22
  * | Without glow, emissive elements display with a bright, natural appearance. | Glow enables a more stylized look of emissive elements across the scene. `intensity:0` adds a subtle glow only. | `intensity:1` adds an exaggerated glow, helpful for strong emphasis of emissive elements.
@@ -23,7 +23,7 @@ export interface ColorBackgroundProperties extends BackgroundProperties {
23
23
  *
24
24
  * The default for ColorBackground is a fully opaque, black color. The example below shows how to change this:
25
25
  *
26
- * ![background-color](https://developers.arcgis.com/javascript/latest/assets/references/core/views/background-color.png)
26
+ * ![background-color](https://developers.arcgis.com/javascript/latest/assets/references/core/views/background-color.avif)
27
27
  *
28
28
  * ```js
29
29
  * const view = new SceneView({
@@ -86,7 +86,7 @@ export interface AreaMeasurement2DProperties extends WidgetProperties, Partial<P
86
86
  * * In geographic coordinate systems (GCS) and in Web Mercator, they are computed geodetically.
87
87
  * * In projected coordinate systems (PCS), apart from Web Mercator, they are computed in a Euclidean manner (in their respective PCS).
88
88
  *
89
- * [![measurement-area-2d](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/AreaMeasurement2D_widget.png)](https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement-2d/)
89
+ * [![measurement-area-2d](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/AreaMeasurement2D_widget.avif)](https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement-2d/)
90
90
  *
91
91
  * ### Undo / Redo
92
92
  *
@@ -76,7 +76,7 @@ export interface AreaMeasurement3DProperties extends WidgetProperties, Partial<P
76
76
  * The AreaMeasurement3D widget calculates and displays the area and perimeter of a polygon.
77
77
  * This widget can be used in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) to measure the area and perimeter of a polygon.
78
78
  *
79
- * [![measurement-line-3d](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/3D_AreaMeasurement_widget.png)](https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement-3d/)
79
+ * [![measurement-line-3d](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/3D_AreaMeasurement_widget.avif)](https://developers.arcgis.com/javascript/latest/sample-code/widgets-measurement-3d/)
80
80
  *
81
81
  * How the area and perimeter are computed depends on the scene's spatial reference and the length of the measured perimeter.
82
82
  *
@@ -95,7 +95,7 @@ export interface AreaMeasurement3DProperties extends WidgetProperties, Partial<P
95
95
  * 2. If the vertices have varying z-values and they create a **non-planar** surface, the visualization and the
96
96
  * measurements show the area and perimeter that are projected to a horizontal plane.
97
97
  *
98
- * ![area-measurement-3d-types](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/area-measurement-3d-types.png)
98
+ * ![area-measurement-3d-types](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/area-measurement-3d-types.avif)
99
99
  *
100
100
  * When the widget is active, a horizontal "laser" line is drawn which indicates the height at the current mouse position.
101
101
  * This line can help in analyzing the heights of objects relative to each other and the terrain.
@@ -81,7 +81,7 @@ export interface VisibleElements {
81
81
  * > Editing attachments is currently available using the [Editor](https://developers.arcgis.com/javascript/latest/references/core/widgets/Editor/) widget.
82
82
  *
83
83
  * The following image displays the various displays of the attachment widget.
84
- * ![attachments](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/attachments-merged.png)
84
+ * ![attachments](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/attachments-merged.avif)
85
85
  *
86
86
  * @deprecated since version 5.0. Use the [Popup](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-popup/) and [Editor](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-editor/) components to view and edit attachments instead. For information on widget deprecation, read about [Esri's move to web components](https://developers.arcgis.com/javascript/latest/components-transition-plan/).
87
87
  * @since 4.15
@@ -51,7 +51,7 @@ export interface AttributionProperties extends WidgetProperties, Partial<Pick<At
51
51
  * [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/) and [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/) by default.
52
52
  * See [DefaultUI](https://developers.arcgis.com/javascript/latest/references/core/views/ui/DefaultUI/) for more details.
53
53
  *
54
- * ![attribution](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/attribution.png)
54
+ * ![attribution](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/attribution.avif)
55
55
  *
56
56
  * > [!WARNING]
57
57
  * >
@@ -77,7 +77,7 @@ export interface BasemapGalleryProperties extends WidgetProperties, Partial<Pick
77
77
  * layers are removed and replaced with the basemap layers of the associated basemap selected in the gallery. By default,
78
78
  * the BasemapGallery widget looks like the following image.
79
79
  *
80
- * ![basemap-gallery](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/basemap-gallery.png)
80
+ * ![basemap-gallery](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/basemap-gallery.avif)
81
81
  *
82
82
  * When a [global API key](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-apiKey) is set, the default basemaps displayed in the BasemapGallery
83
83
  * widget will default to the basemaps defined by the [Portal.devBasemapGalleryGroupQuery](https://developers.arcgis.com/javascript/latest/references/core/portal/Portal/#devBasemapGalleryGroupQuery) property.
@@ -160,7 +160,7 @@ export default class BasemapLayerList extends BasemapLayerListSuperclass {
160
160
  * This list item will only be displayed when catalog layers are loaded in the map and will be displayed as a child of the catalog layer.
161
161
  * This property is useful for listening to the [CatalogLayerList.@trigger-action](https://developers.arcgis.com/javascript/latest/references/core/widgets/CatalogLayerList/#event-trigger-action) event and managing selections in catalog layers.
162
162
  *
163
- * ![CatalogLayerList](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/catalog-layer-list.png)
163
+ * ![CatalogLayerList](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/catalog-layer-list.avif)
164
164
  *
165
165
  * @since 4.30
166
166
  * @see [catalogOptions](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapLayerList/#catalogOptions)
@@ -392,8 +392,8 @@ export default class BasemapLayerList extends BasemapLayerListSuperclass {
392
392
  *
393
393
  * | Value | Description | Example |
394
394
  * | ----- | ----------- | ------- |
395
- * | default | Displays view icons on the far side. Icons are hidden except on hover or if they have keyboard focus. See [view-visible](https://developers.arcgis.com/calcite-design-system/icons/?icon=view-visible&library=Calcite%20UI&query=view) and [view-hide](https://developers.arcgis.com/calcite-design-system/icons/?icon=view-hide&library=Calcite%20UI&query=view) calcite icons. | ![visibilityAppearance-default](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/basemap-layer-list/visibilityAppearance-default.png) |
396
- * | checkbox | Displays checkbox icons on the near side. See [check-square-f](https://developers.arcgis.com/calcite-design-system/icons/?icon=check-square-f&library=Calcite%20UI&query=check) and [square](https://developers.arcgis.com/calcite-design-system/icons/?icon=square&library=Calcite%20UI&query=square) calcite icons. | ![visibilityAppearance-checkbox](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/basemap-layer-list/visibilityAppearance-checkbox.png) |
395
+ * | default | Displays view icons on the far side. Icons are hidden except on hover or if they have keyboard focus. See [view-visible](https://developers.arcgis.com/calcite-design-system/icons/?icon=view-visible&library=Calcite%20UI&query=view) and [view-hide](https://developers.arcgis.com/calcite-design-system/icons/?icon=view-hide&library=Calcite%20UI&query=view) calcite icons. | ![visibilityAppearance-default](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/basemap-layer-list/visibilityAppearance-default.avif) |
396
+ * | checkbox | Displays checkbox icons on the near side. See [check-square-f](https://developers.arcgis.com/calcite-design-system/icons/?icon=check-square-f&library=Calcite%20UI&query=check) and [square](https://developers.arcgis.com/calcite-design-system/icons/?icon=square&library=Calcite%20UI&query=square) calcite icons. | ![visibilityAppearance-checkbox](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/basemap-layer-list/visibilityAppearance-checkbox.avif) |
397
397
  *
398
398
  * @default "default"
399
399
  * @since 4.29
@@ -54,7 +54,7 @@ export interface VisibleElements {
54
54
  * two basemaps. The toggled basemap is set inside the [view's](https://developers.arcgis.com/javascript/latest/references/core/widgets/BasemapToggle/#view)
55
55
  * [View.map](https://developers.arcgis.com/javascript/latest/references/core/views/View/#map) object.
56
56
  *
57
- * ![basemap-toggle](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/basemap-toggle.png)
57
+ * ![basemap-toggle](https://developers.arcgis.com/javascript/latest/assets/references/core/widgets/basemap-toggle.avif)
58
58
  *
59
59
  * Starting with version 4.23, the BasemapToggle widget can have two basemaps with different spatial references.
60
60
  * Set the [MapView.spatialReferenceLocked](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#spatialReferenceLocked) property to `true`