@arcgis/core 5.2.0-next.69 → 5.2.0-next.70

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 (639) hide show
  1. package/Basemap.js +1 -1
  2. package/Ground.js +1 -1
  3. package/WebDocument2D.js +1 -1
  4. package/WebScene.js +1 -1
  5. package/applications/Components/analysisUtils.js +1 -1
  6. package/applications/Components/arcadeEditorUtils.js +1 -1
  7. package/applications/Components/testUtils.js +1 -1
  8. package/applications/Urban/meshUtils.js +1 -1
  9. package/arcade/arcadeCompiler.js +1 -1
  10. package/arcade/functions/geomasync.js +1 -1
  11. package/arcade/functions/geomsync.js +1 -1
  12. package/arcade/functions/knowledgegraph.js +1 -1
  13. package/arcade/functions/track.js +1 -1
  14. package/arcade/geometry/operators.js +1 -1
  15. package/arcade/geometry/operatorsWorker.js +1 -1
  16. package/arcade/geometry/rotate.js +2 -0
  17. package/arcade/geometry/unitConversion.js +1 -1
  18. package/arcgisGlobal.d.ts +1 -0
  19. package/assets/components/assets/icon/loadConfiguration16.json +1 -0
  20. package/assets/components/assets/icon/loadConfiguration24.json +1 -0
  21. package/assets/components/assets/icon/loadConfiguration32.json +1 -0
  22. package/assets/esri/core/workers/RemoteClient.js +1 -1
  23. package/assets/esri/core/workers/chunks/{bece22668622a9a6bfe2.js → 011281fe918c4f0aec5d.js} +1 -1
  24. package/assets/esri/core/workers/chunks/01c92e68fb17cf2d0e08.js +1 -0
  25. package/assets/esri/core/workers/chunks/02dd79beb13eff6be85e.js +1 -0
  26. package/assets/esri/core/workers/chunks/0623acb2bd14a61b65c9.js +29 -0
  27. package/assets/esri/core/workers/chunks/065e3353124fc5ac44ce.js +1 -0
  28. package/assets/esri/core/workers/chunks/06c9aac75a01d3af6d54.js +1 -0
  29. package/assets/esri/core/workers/chunks/073f1d5f89875c6aefb1.js +1 -0
  30. package/assets/esri/core/workers/chunks/{d583bcea4d1a21da9147.js → 0846855843f85661e974.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{7a818499c1079906c2d7.js → 089f8c60e96d920a2cb2.js} +1 -1
  32. package/assets/esri/core/workers/chunks/09653bd2a31d293a10d9.js +2 -0
  33. package/assets/esri/core/workers/chunks/0ae0483b72f5e8d00d55.js +1 -0
  34. package/assets/esri/core/workers/chunks/0aedeb837399d3f92e4a.js +1 -0
  35. package/assets/esri/core/workers/chunks/0b18de5147d76b68896f.js +1 -0
  36. package/assets/esri/core/workers/chunks/{f5d809d30cbb56be852d.js → 0e333aced8b23aa49a0e.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{dad39ddf0f8dfb0bef47.js → 0eaa8265a4cd64297545.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{4e1b087453fc5e20e961.js → 118ccfa2d685764752ee.js} +1 -1
  39. package/assets/esri/core/workers/chunks/158d2ac0333d53556e33.js +1 -0
  40. package/assets/esri/core/workers/chunks/160b204cbf5bda2a29e9.js +1 -0
  41. package/assets/esri/core/workers/chunks/16cade1c2ddf44e336ee.js +1 -0
  42. package/assets/esri/core/workers/chunks/19233d0016e5b154c5ce.js +1 -0
  43. package/assets/esri/core/workers/chunks/19cb8963d5ec2246357b.js +1 -0
  44. package/assets/esri/core/workers/chunks/{0ae35b02dda9b9662560.js → 1ac8a7a129ba33e05a24.js} +1 -1
  45. package/assets/esri/core/workers/chunks/1b130af7d14eaae69d96.js +1 -0
  46. package/assets/esri/core/workers/chunks/1ca04ecf010e68863014.js +1 -0
  47. package/assets/esri/core/workers/chunks/1cc063aa2ddf44bbd515.js +1 -0
  48. package/assets/esri/core/workers/chunks/{c055c16379f5bb56e930.js → 1d92d53186debd52e753.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{37a8cfec11057947b45f.js → 1dba93abe84d30f05d8d.js} +1 -1
  50. package/assets/esri/core/workers/chunks/1e0140556c2e3fa72545.js +1 -0
  51. package/assets/esri/core/workers/chunks/1e5cb72830c7f32f2961.js +1 -0
  52. package/assets/esri/core/workers/chunks/{510acf2e8781be9b0dba.js → 1f888f026b004447772c.js} +1 -1
  53. package/assets/esri/core/workers/chunks/2033e6d42453e4e67048.js +1 -0
  54. package/assets/esri/core/workers/chunks/24006cea112d657f053a.js +1 -0
  55. package/assets/esri/core/workers/chunks/{7b531feba4fd662575f9.js → 28924f31f5ba8ebdc60a.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{893ffc38e1a43de5b63d.js → 28b09fe50b855a1d8a3f.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{b9c7aa04861f545a559c.js → 2bcb7e43578124538c3c.js} +1 -1
  58. package/assets/esri/core/workers/chunks/2bdb9b5365869081c936.js +1 -0
  59. package/assets/esri/core/workers/chunks/{df89bf05c18f0c8e418b.js → 2cfe6f41865ffb3a4645.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{63858dfcff1177e597e7.js → 2d1ae18a28491b00091d.js} +1 -1
  61. package/assets/esri/core/workers/chunks/2d3a18d56e2e5669c562.js +1 -0
  62. package/assets/esri/core/workers/chunks/2d45daacec0d5ed38782.js +1 -0
  63. package/assets/esri/core/workers/chunks/2f58e1f64df2da8259a2.js +1 -0
  64. package/assets/esri/core/workers/chunks/31669511cfddf116d991.js +1 -0
  65. package/assets/esri/core/workers/chunks/32f5112c848efec6c33b.js +1 -0
  66. package/assets/esri/core/workers/chunks/33e293836f5d28dc5d62.js +1 -0
  67. package/assets/esri/core/workers/chunks/{59a795eba31061dc357a.js → 359584a8fb5687a7d098.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{9c5dff4f13102871786e.js → 36171c72a3c04b0d13ef.js} +1 -1
  69. package/assets/esri/core/workers/chunks/38660a8cc3623c854d88.js +1 -0
  70. package/assets/esri/core/workers/chunks/3978f00a03e97645b276.js +1 -0
  71. package/assets/esri/core/workers/chunks/3b14ed3184743df336a6.js +1 -0
  72. package/assets/esri/core/workers/chunks/{f82cd34a79c8aa58d40c.js → 3b3a8a6167f2e1eeb828.js} +2 -2
  73. package/assets/esri/core/workers/chunks/3d6b2d5ae647e140abaf.js +1 -0
  74. package/assets/esri/core/workers/chunks/3dc71e03a630dd50b28e.js +1 -0
  75. package/assets/esri/core/workers/chunks/3de6e54b6ed0feae1940.js +1 -0
  76. package/assets/esri/core/workers/chunks/3dff36f6de181d9dcdc5.js +1 -0
  77. package/assets/esri/core/workers/chunks/3fd022df127af32782ce.js +1 -0
  78. package/assets/esri/core/workers/chunks/40693ee558a1eb1e93f4.js +1 -0
  79. package/assets/esri/core/workers/chunks/4344ab1250a1c550bf8b.js +1 -0
  80. package/assets/esri/core/workers/chunks/4491dc227c28e2ab4f8e.js +1 -0
  81. package/assets/esri/core/workers/chunks/{909e88c27d80777b047c.js → 463747a822499dd933ef.js} +1 -1
  82. package/assets/esri/core/workers/chunks/4695cd6120f60b234d5c.js +1 -0
  83. package/assets/esri/core/workers/chunks/4823e77515f451628fad.js +1 -0
  84. package/assets/esri/core/workers/chunks/484b3e2a220c440ccbb4.js +1 -0
  85. package/assets/esri/core/workers/chunks/4c2794687aea172775a0.js +1 -0
  86. package/assets/esri/core/workers/chunks/{b5b698008b8f3f4d5d61.js → 4ce57dd39075e8fb357c.js} +1 -1
  87. package/assets/esri/core/workers/chunks/4da993c79b373b9d304e.js +2 -0
  88. package/assets/esri/core/workers/chunks/4da993c79b373b9d304e.js.LICENSE.txt +4 -0
  89. package/assets/esri/core/workers/chunks/4e129b9f5772a06e580c.js +1 -0
  90. package/assets/esri/core/workers/chunks/50e0dd74795978468625.js +1 -0
  91. package/assets/esri/core/workers/chunks/{0a98a13418f53082ca7a.js → 5459ba8fdeb2370bb52b.js} +1 -1
  92. package/assets/esri/core/workers/chunks/582a1d468089b9986416.js +1 -0
  93. package/assets/esri/core/workers/chunks/5e3d5347223f0111f40f.js +1 -0
  94. package/assets/esri/core/workers/chunks/{bfb626805405646a0419.js → 5eb29f0068f1c839d05e.js} +1 -1
  95. package/assets/esri/core/workers/chunks/5f201c77a09ae0df29d6.js +1 -0
  96. package/assets/esri/core/workers/chunks/{6d5038d4351fe29e2718.js → 5fb76575575fe8cfb1f0.js} +1 -1
  97. package/assets/esri/core/workers/chunks/6072c63a5da4366e9942.js +1 -0
  98. package/assets/esri/core/workers/chunks/6080e46fc79127500283.js +1 -0
  99. package/assets/esri/core/workers/chunks/623d5518bca227f643bd.js +1 -0
  100. package/assets/esri/core/workers/chunks/62811bca7ad2100c023c.js +1 -0
  101. package/assets/esri/core/workers/chunks/6357c7cac401aee9fe77.js +1 -0
  102. package/assets/esri/core/workers/chunks/{91c543443cd6768ad6ff.js → 6525c925bb91facb3575.js} +1 -1
  103. package/assets/esri/core/workers/chunks/67d3ff7fcefaa7d5d27f.js +1 -0
  104. package/assets/esri/core/workers/chunks/{b5571e93bc136dac8ee1.js → 67ebde34377f98d17cda.js} +1 -1
  105. package/assets/esri/core/workers/chunks/687cf21e027f49b44d22.js +1 -0
  106. package/assets/esri/core/workers/chunks/{6b0acd1a7dd74a7367e0.js → 694371f51c52a7a94da4.js} +1 -1
  107. package/assets/esri/core/workers/chunks/6a9002fcba11e2cf3f2e.js +1 -0
  108. package/assets/esri/core/workers/chunks/{f4e813ead56d963b16b8.js → 6b208bac120bcfecd9e4.js} +1 -1
  109. package/assets/esri/core/workers/chunks/6cd6d0cfd313f0475d98.js +1 -0
  110. package/assets/esri/core/workers/chunks/6f58cb9dffe8016397a2.js +1 -0
  111. package/assets/esri/core/workers/chunks/7260e63252fa5452dc22.js +1 -0
  112. package/assets/esri/core/workers/chunks/72dcd4bd1a28bf8605c5.js +1 -0
  113. package/assets/esri/core/workers/chunks/73f77f5a6907cb8d9a35.js +1 -0
  114. package/assets/esri/core/workers/chunks/77df0bb35d2688729479.js +1 -0
  115. package/assets/esri/core/workers/chunks/{09c43bcb09aad02e83a9.js → 7a143ca61c0a70306185.js} +1 -1
  116. package/assets/esri/core/workers/chunks/7ca9c908432b1afa0367.js +1 -0
  117. package/assets/esri/core/workers/chunks/{ec2e0b2e31fd53b81d0a.js → 7ddf9b2718dd047f15e6.js} +1 -1
  118. package/assets/esri/core/workers/chunks/7f208ef75ef2ce0d7cf9.js +1 -0
  119. package/assets/esri/core/workers/chunks/7f4a592bcf4ecb55949a.js +1 -0
  120. package/assets/esri/core/workers/chunks/7f91e45156bbe88f9a62.js +1 -0
  121. package/assets/esri/core/workers/chunks/864691186c449ca2c3db.js +1 -0
  122. package/assets/esri/core/workers/chunks/869d292a60747c93dc84.js +1 -0
  123. package/assets/esri/core/workers/chunks/{7e2794705b4e679fcb3f.js → 86a4057572755b403548.js} +1 -1
  124. package/assets/esri/core/workers/chunks/{99772ce7e628364434fa.js → 8c1bddc88cc5f4251021.js} +1 -1
  125. package/assets/esri/core/workers/chunks/8c76f31a363dd0c3354d.js +1 -0
  126. package/assets/esri/core/workers/chunks/8eecc6df6511c8830f5d.js +1 -0
  127. package/assets/esri/core/workers/chunks/{0da4816c11b45b4a6289.js → 8fea514aada1195c8f30.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{7ebbb90d80600d9ba889.js → 913fb883455aeac8582b.js} +1 -1
  129. package/assets/esri/core/workers/chunks/927582ec15bff2acbb49.js +1 -0
  130. package/assets/esri/core/workers/chunks/{89132395eca329b9ab92.js → 9482a6d7baa24bbf5693.js} +1 -1
  131. package/assets/esri/core/workers/chunks/9684ab5e8254fdfcb7bb.js +1 -0
  132. package/assets/esri/core/workers/chunks/96d861265566854760cd.js +1 -0
  133. package/assets/esri/core/workers/chunks/98e6c1d035755a074d24.js +1 -0
  134. package/assets/esri/core/workers/chunks/9937920e7993814d0b2c.js +1 -0
  135. package/assets/esri/core/workers/chunks/{9d0bda096cdbd7e22f4b.js → 9bbff8237540409610b3.js} +1 -1
  136. package/assets/esri/core/workers/chunks/9dda9414104f585560a4.js +2 -0
  137. package/assets/esri/core/workers/chunks/{be291d920ebc68fde02b.js.LICENSE.txt → 9dda9414104f585560a4.js.LICENSE.txt} +0 -5
  138. package/assets/esri/core/workers/chunks/{1dc1bfb3425665f560e4.js → a486d99f9879f94151ba.js} +1 -1
  139. package/assets/esri/core/workers/chunks/{475c60ed8785d07911c6.js → a5c115fc53edb52ce1de.js} +1 -1
  140. package/assets/esri/core/workers/chunks/a62f1b8ed065b2a38f1a.js +1 -0
  141. package/assets/esri/core/workers/chunks/{830d1a7dee43422507ab.js → a739e617fc461014ad1f.js} +1 -1
  142. package/assets/esri/core/workers/chunks/aa21031c8f12ca438eaa.js +1 -0
  143. package/assets/esri/core/workers/chunks/ad27689b231e282b7620.js +1 -0
  144. package/assets/esri/core/workers/chunks/af6e8c961fd768fa7be3.js +1 -0
  145. package/assets/esri/core/workers/chunks/afeeb11b39e140303b5a.js +1 -0
  146. package/assets/esri/core/workers/chunks/b599b7dadce8b8bc88f6.js +1 -0
  147. package/assets/esri/core/workers/chunks/{873d8332e2149eb1b36a.js → b6c7b7b7f87dce5de811.js} +3 -3
  148. package/assets/esri/core/workers/chunks/b7d8817018b3d277c454.js +1 -0
  149. package/assets/esri/core/workers/chunks/{d90bc34d97bb21c29c40.js → b8cd81d8fcc78d272130.js} +1 -1
  150. package/assets/esri/core/workers/chunks/{450bc48a7389607bce1e.js → b984b808d383974ca3d8.js} +1 -1
  151. package/assets/esri/core/workers/chunks/b9953277d0cd4a01bdc6.js +1 -0
  152. package/assets/esri/core/workers/chunks/c02b3b8b71205f6ce290.js +1 -0
  153. package/assets/esri/core/workers/chunks/c03da138651ac53cadcb.js +2 -0
  154. package/assets/esri/core/workers/chunks/c21212c356f65244e34e.js +1 -0
  155. package/assets/esri/core/workers/chunks/{1fece9757de7c10d1e9f.js → c29df43817278f674707.js} +1 -1
  156. package/assets/esri/core/workers/chunks/{589b31cc5c663a288942.js → c6bf17b5ff6ec4b980a1.js} +1 -1
  157. package/assets/esri/core/workers/chunks/c715c585c42d8c2b86f5.js +1 -0
  158. package/assets/esri/core/workers/chunks/c7e9513f75b8ec205562.js +1 -0
  159. package/assets/esri/core/workers/chunks/c866b66ba72d96453899.js +1 -0
  160. package/assets/esri/core/workers/chunks/{5fde1234c5cccaee6763.js → c873383e7dae35dc1a61.js} +1 -1
  161. package/assets/esri/core/workers/chunks/c99dcc17fbd7acd2ad2e.js +1 -0
  162. package/assets/esri/core/workers/chunks/cae94d6805e0e8db3600.js +1 -0
  163. package/assets/esri/core/workers/chunks/cc5ec6e99aa09342c704.js +1 -0
  164. package/assets/esri/core/workers/chunks/cd4e5c948d1bfa9b9a2d.js +1 -0
  165. package/assets/esri/core/workers/chunks/{6501ee40bf25f9f75d02.js → ce481eeb27ea9c1782ae.js} +1 -1
  166. package/assets/esri/core/workers/chunks/{d214ac457ac970479536.js → cec1c87eb3749276ced4.js} +1 -1
  167. package/assets/esri/core/workers/chunks/cfe31b7d1c6c05fbd268.js +1 -0
  168. package/assets/esri/core/workers/chunks/d08f81d545930a79fb2e.js +1 -0
  169. package/assets/esri/core/workers/chunks/d0c1bc90e474f706211c.js +1 -0
  170. package/assets/esri/core/workers/chunks/d2faac81142586cf7509.js +1 -0
  171. package/assets/esri/core/workers/chunks/d607cf154218d20e4114.js +1 -0
  172. package/assets/esri/core/workers/chunks/{b94cd7eac5ff4a78dd5b.js → d7b6985984071e78c764.js} +1 -1
  173. package/assets/esri/core/workers/chunks/d901f8503a73277cfa58.js +1 -0
  174. package/assets/esri/core/workers/chunks/d93d0cb69f3a9a722510.js +1 -0
  175. package/assets/esri/core/workers/chunks/{9073b0f0ec93d6e243b9.js → da1c9257793c2817f40f.js} +1 -1
  176. package/assets/esri/core/workers/chunks/{94719ac469dadc4c05dc.js → dc0c3109b7558b4fe016.js} +1 -1
  177. package/assets/esri/core/workers/chunks/{dc7e4f7879debf557e46.js → de3d0973cff1e0858c52.js} +2 -2
  178. package/assets/esri/core/workers/chunks/{adce59e4111bae4225f7.js → e421dee5d8b030e79ffb.js} +1 -1
  179. package/assets/esri/core/workers/chunks/e602b91d8fdc36a92530.js +1 -0
  180. package/assets/esri/core/workers/chunks/{c13e55b9efb0b532f7ee.js → e61ab8ef30bbe788b9d7.js} +1 -1
  181. package/assets/esri/core/workers/chunks/e702abaeccef20b64a81.js +1 -0
  182. package/assets/esri/core/workers/chunks/{11a3aa43fb940c21f148.js → eb95464bd017fb839510.js} +1 -1
  183. package/assets/esri/core/workers/chunks/ebd619533be077059494.js +1 -0
  184. package/assets/esri/core/workers/chunks/ed564358cc7b3ee463a3.js +1 -0
  185. package/assets/esri/core/workers/chunks/ef2e0a014c982d9c7ca4.js +1 -0
  186. package/assets/esri/core/workers/chunks/f5cf338cecfc81f23128.js +1 -0
  187. package/assets/esri/core/workers/chunks/f6150b51a9430691a040.js +1 -0
  188. package/assets/esri/core/workers/chunks/{f4aed2b6e92bd0474069.js → f69329b85b362b349a8c.js} +1 -1
  189. package/assets/esri/core/workers/chunks/f721756a6c1593f96409.js +1 -0
  190. package/assets/esri/core/workers/chunks/fa19d5923276418096da.js +1 -0
  191. package/assets/esri/core/workers/chunks/fa5d27e47d47ff8fcb96.js +2 -0
  192. package/assets/esri/core/workers/chunks/fb12d3c63fcac8391e06.js +1 -0
  193. package/assets/esri/core/workers/chunks/fc9065d0cd6285fe0f0d.js +1 -0
  194. package/assets/esri/core/workers/chunks/{b526055794e64b0227ca.js → fd6107f95082e05f016a.js} +11 -11
  195. package/assets/esri/core/workers/chunks/fe10a95ebe1da2322af6.js +1 -0
  196. package/assets/esri/core/workers/chunks/fe71a0604f0928113419.js +1 -0
  197. package/assets/esri/core/workers/chunks/fec07a16b72cdcafc641.js +1 -0
  198. package/assets/esri/core/workers/chunks/fff23b2682590c4b21e3.js +1 -0
  199. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  200. package/chunks/Bufferer-CclWhXVb.js +1 -1
  201. package/chunks/ColorMaterial.glsl.js +18 -5
  202. package/chunks/Component.glsl.js +42 -34
  203. package/chunks/Envelope.js +1 -1
  204. package/chunks/GeodeticDistanceCalculator-zRp89-dW.js +1 -1
  205. package/chunks/Geometry.js +1 -1
  206. package/chunks/GeometryCleaner-CIE8Wfmb.js +1 -1
  207. package/chunks/MultiPathImpl.js +1 -1
  208. package/chunks/OperatorAffineTransform.js +2 -0
  209. package/chunks/OperatorCentroid2D.js +2 -0
  210. package/chunks/OperatorCrosses.js +1 -1
  211. package/chunks/OperatorCut.js +1 -1
  212. package/chunks/OperatorGeneralize.js +1 -1
  213. package/chunks/OperatorGeodesicBuffer.js +1 -1
  214. package/chunks/OperatorGeodeticLength.js +1 -1
  215. package/chunks/OperatorGraphicBuffer.js +1 -1
  216. package/chunks/OperatorIntersects.js +1 -1
  217. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  218. package/chunks/OperatorOverlaps.js +1 -1
  219. package/chunks/OperatorProximityGeodesic.js +1 -1
  220. package/chunks/OperatorShapePreservingLength.js +1 -1
  221. package/chunks/OperatorShapePreservingProject.js +1 -1
  222. package/chunks/OperatorSimplifyOGC.js +1 -1
  223. package/chunks/OperatorTouches.js +1 -1
  224. package/chunks/OperatorWithin.js +1 -1
  225. package/chunks/Point2D.js +1 -1
  226. package/chunks/SideCalculator2D-DX0718xq.js +1 -1
  227. package/chunks/SpatialReference.js +1 -1
  228. package/chunks/arcade.js +1 -1
  229. package/chunks/bundle.js +1 -1
  230. package/chunks/bundle2.js +1 -1
  231. package/chunks/centroidOperator.js +1 -1
  232. package/chunks/containsOperator.js +1 -1
  233. package/chunks/disjointOperator.js +1 -1
  234. package/chunks/equalsOperator.js +1 -1
  235. package/chunks/geodeticDistanceOperator.js +2 -0
  236. package/chunks/multiPartToSinglePartOperator.js +2 -0
  237. package/chunks/offsetOperator.js +2 -0
  238. package/config.js +1 -1
  239. package/core/imageUtils.js +1 -1
  240. package/core/workers/WorkerFallback.js +1 -1
  241. package/core/workers/registry.js +1 -1
  242. package/core/workers/workerFactory.js +1 -1
  243. package/core/workers/workers.js +1 -1
  244. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  245. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  246. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  247. package/editing/sharedTemplates/templateLoader.js +1 -1
  248. package/geometry/libtess.js +1 -1
  249. package/geometry/operators/affineTransformOperator.js +1 -1
  250. package/geometry/operators/centroidOperator.js +1 -1
  251. package/geometry/operators/geodeticDistanceOperator.js +1 -1
  252. package/geometry/operators/gx/operatorAffineTransform.js +1 -1
  253. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  254. package/geometry/operators/gx/operatorBuffer.js +1 -1
  255. package/geometry/operators/gx/operatorConvexHull.js +1 -1
  256. package/geometry/operators/gx/operatorDifference.js +1 -1
  257. package/geometry/operators/gx/operatorIntersection.js +1 -1
  258. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  259. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  260. package/geometry/operators/gx/operatorLocateBetween.js +1 -1
  261. package/geometry/operators/gx/operatorOffset.js +1 -1
  262. package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
  263. package/geometry/operators/gx/operatorUnion.js +1 -1
  264. package/geometry/operators/json/containsOperator.js +1 -1
  265. package/geometry/operators/json/disjointOperator.js +1 -1
  266. package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
  267. package/geometry/operators/offsetOperator.js +1 -1
  268. package/geometry/support/curves/densifyCurvedGeometry.js +1 -1
  269. package/geometry/support/meshUtils.js +1 -1
  270. package/interfaces.d.ts +3 -0
  271. package/kernel.js +1 -1
  272. package/layers/CSVLayer.js +1 -1
  273. package/layers/CatalogLayer.js +1 -1
  274. package/layers/ElevationLayer.js +1 -1
  275. package/layers/FeatureLayer.js +1 -1
  276. package/layers/GeoJSONLayer.js +1 -1
  277. package/layers/GroupLayer.js +1 -1
  278. package/layers/ImageryLayer.js +1 -1
  279. package/layers/ImageryTileLayer.js +1 -1
  280. package/layers/Layer.js +1 -1
  281. package/layers/MapImageLayer.js +1 -1
  282. package/layers/MediaLayer.js +1 -1
  283. package/layers/SceneLayer.js +1 -1
  284. package/layers/StreamLayer.js +1 -1
  285. package/layers/SubtypeGroupLayer.js +1 -1
  286. package/layers/WCSLayer.js +1 -1
  287. package/layers/WFSLayer.js +1 -1
  288. package/layers/graphics/data/QueryEngineResult.js +1 -1
  289. package/layers/graphics/data/queryUtils.js +1 -1
  290. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  291. package/layers/graphics/sources/MemorySource.js +1 -1
  292. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  293. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  294. package/layers/knowledgeGraph/cypherUtils.js +1 -1
  295. package/layers/mixins/ArcGISImageService.js +1 -1
  296. package/layers/mixins/PortalLayer.js +1 -1
  297. package/layers/mixins/TiledImagery.js +1 -1
  298. package/layers/raster/datasets/FunctionRaster.js +1 -1
  299. package/layers/raster/datasets/pixelReader.js +1 -1
  300. package/layers/raster/functions/clipUtils.js +1 -1
  301. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  302. package/layers/support/Sublayer.js +1 -1
  303. package/layers/support/arcgisLayers.js +1 -1
  304. package/layers/support/featureLayerUtils.js +1 -1
  305. package/layers/support/fromPortalItem.js +1 -1
  306. package/layers/support/layersLoader.js +1 -1
  307. package/layers/support/vectorTileLayerLoader.js +1 -1
  308. package/libs/basisu/BasisUEncoder.js +1 -1
  309. package/libs/basisu/BasisUTranscoder.js +1 -1
  310. package/libs/dracoMeshDecoder/dracoMeshDecoder.js +1 -1
  311. package/libs/dxtEncoder/DXTEncoder.js +1 -1
  312. package/libs/i3s/I3SModule.js +1 -1
  313. package/libs/parquet/loadParquetModule.js +1 -1
  314. package/libs/text/loadTextModule.js +1 -1
  315. package/networks/UtilityNetwork.js +1 -1
  316. package/networks/support/utils.js +1 -1
  317. package/package.json +3 -3
  318. package/popup/FeatureContentCollection.js +1 -1
  319. package/popup/Features.js +1 -1
  320. package/portal/Portal.js +1 -1
  321. package/portal/PortalItem.js +1 -1
  322. package/portal/PortalItemResource.js +1 -1
  323. package/portal/PortalUser.js +1 -1
  324. package/renderers/support/DictionaryLoader.js +1 -1
  325. package/request/process.js +1 -1
  326. package/request/queue.js +1 -1
  327. package/request.js +1 -1
  328. package/rest/geoprocessor/utils.js +1 -1
  329. package/rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js +1 -1
  330. package/rest/support/JobInfo.js +1 -1
  331. package/rest/utils.js +1 -1
  332. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  333. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  334. package/support/revision.js +1 -1
  335. package/support/tests/serviceMockDependencies.js +1 -1
  336. package/support/zipUtils.js +1 -1
  337. package/symbols/WebStyleSymbol.js +1 -1
  338. package/symbols/cim/CIMOperators.js +1 -1
  339. package/symbols/cim/cimAnalyzer.js +1 -1
  340. package/symbols/cim/defaultCIMValues.js +1 -1
  341. package/symbols/cim/effects/EffectCircularSector.js +2 -0
  342. package/symbols/cim/types.d.ts +42 -1
  343. package/symbols/cim/utils.js +1 -1
  344. package/symbols/support/symbolLayerUtils.js +1 -1
  345. package/symbols/support/symbolUtils.js +1 -1
  346. package/symbols/support/utils.js +1 -1
  347. package/undoredo/support/ServiceVersionInfo.js +1 -1
  348. package/versionManagement/VersionManagementService.js +1 -1
  349. package/views/2d/engine/Stage.js +1 -1
  350. package/views/2d/engine/vectorTiles/TileHandler.js +1 -1
  351. package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
  352. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  353. package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
  354. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  355. package/views/2d/engine/vectorTiles/WorkerTile.js +1 -1
  356. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  357. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSource.js +2 -0
  358. package/views/2d/engine/vectorTiles/style/GeoJSONVectorTileSourceWorker.js +2 -0
  359. package/views/2d/engine/vectorTiles/style/RemoteVectorTileSource.js +2 -0
  360. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  361. package/views/2d/engine/vectorTiles/style/VectorTilePbfWriter.js +2 -0
  362. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  363. package/views/2d/engine/vectorTiles/style/encodeVectorTileFeatures.js +2 -0
  364. package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
  365. package/views/2d/engine/webgl/GlyphSDFCreator.js +1 -1
  366. package/views/2d/engine/webgl/GlyphSource.js +1 -1
  367. package/views/2d/engine/webgl/GlyphWorker.js +2 -0
  368. package/views/2d/engine/webgl/Painter.js +1 -1
  369. package/views/2d/engine/webgl/TextureManager.js +1 -1
  370. package/views/2d/engine/webgl/mesh/factories/ResourceProxy.js +1 -1
  371. package/views/2d/engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js +1 -1
  372. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js +1 -1
  373. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  374. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  375. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  376. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  377. package/views/2d/layers/RouteLayerView2D.js +1 -1
  378. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  379. package/views/2d/layers/features/Processor.js +1 -1
  380. package/views/2d/layers/features/schema/processor/MatcherSchema.js +1 -1
  381. package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
  382. package/views/2d/layers/features/support/FeatureSetReaderVectorTileFeatureCursor.js +2 -0
  383. package/views/2d/layers/support/MediaLayerInteraction.js +1 -1
  384. package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
  385. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  386. package/views/3d/analysis/Viewshed/ViewshedObserverManipulatedObject3D.js +1 -1
  387. package/views/3d/analysis/Viewshed/ViewshedSnappingController.js +1 -1
  388. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  389. package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
  390. package/views/3d/interactive/manipulatorUtils.js +1 -1
  391. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  392. package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
  393. package/views/3d/layers/I3SMeshView3D.js +1 -1
  394. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  395. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  396. package/views/3d/layers/SceneLayerWorker.js +1 -1
  397. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  398. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  399. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  400. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  401. package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
  402. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  403. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  404. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  405. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  406. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  407. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  408. package/views/3d/layers/support/FlowTileTree3DDebugger.js +1 -1
  409. package/views/3d/layers/support/TerrainTileTree3DDebugger.js +1 -1
  410. package/views/3d/state/ViewStateManager.js +1 -1
  411. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  412. package/views/3d/support/CombinedElevationProvider.js +1 -1
  413. package/views/3d/support/viewpointUtils.js +1 -1
  414. package/views/3d/terrain/TerrainSurface.js +1 -1
  415. package/views/3d/terrain/TransparencyMode.js +2 -0
  416. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  417. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  418. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  419. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialInitParameters.js +1 -1
  420. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
  421. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  422. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
  423. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  424. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  425. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  426. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  427. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  428. package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
  429. package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
  430. package/views/PopupView.js +1 -1
  431. package/views/SceneView.js +1 -1
  432. package/views/VideoView.js +1 -1
  433. package/views/View.js +1 -1
  434. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  435. package/views/draw/PointDrawAction.js +1 -1
  436. package/views/draw/PolygonDrawAction.js +1 -1
  437. package/views/draw/PolylineDrawAction.js +1 -1
  438. package/views/draw/SegmentDrawAction.js +1 -1
  439. package/views/draw/support/createSnappingVisualizer.js +1 -1
  440. package/views/interactive/snapping/SnappingManager.js +1 -1
  441. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  442. package/views/layers/HighlightableLayerView.d.ts +2 -0
  443. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  444. package/views/selection/SelectionOperation.js +1 -1
  445. package/views/support/GeometryWorker.js +1 -1
  446. package/views/support/GroundElevationSampler.js +1 -1
  447. package/webdoc/support/resourceUtils.js +1 -1
  448. package/webdoc/support/webdocLoadUtils.js +1 -1
  449. package/webdoc/support/webdocSaveUtils.js +1 -1
  450. package/webscene/Slide.js +1 -1
  451. package/webscene/spec-certification/api.js +1 -1
  452. package/webscene/spec-certification/spec.js +1 -1
  453. package/webscene/support/analysisUtils.js +1 -1
  454. package/widgets/BasemapLayerList.js +1 -1
  455. package/widgets/BatchAttributeForm/ValueChangeTransaction.js +1 -1
  456. package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
  457. package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
  458. package/widgets/BatchAttributeForm/templates/support/textElementTemplateUtils.js +1 -1
  459. package/widgets/BatchAttributeForm.js +1 -1
  460. package/widgets/CatalogLayerList.js +1 -1
  461. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  462. package/widgets/Editor/UpdateWorkflow.js +1 -1
  463. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
  464. package/widgets/Editor/legacy/UpdateWorkflow.js +1 -1
  465. package/widgets/Editor/modelUploadUtils.js +1 -1
  466. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  467. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  468. package/widgets/Editor/workflowUtils.js +1 -1
  469. package/widgets/Editor.js +1 -1
  470. package/widgets/ElevationProfile/support/geometryUtils.js +1 -1
  471. package/widgets/ElevationProfile.js +1 -1
  472. package/widgets/Feature/FeatureMedia.js +1 -1
  473. package/widgets/Feature/FeatureRelationship/FeatureRelationshipViewModel.js +1 -1
  474. package/widgets/Feature/FeatureRelationship.js +1 -1
  475. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  476. package/widgets/Feature.js +1 -1
  477. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  478. package/widgets/FeatureForm/support/textManipulationUtils.js +1 -1
  479. package/widgets/FeatureForm.js +1 -1
  480. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  481. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  482. package/widgets/FeatureTable/Grid/types.d.ts +78 -4
  483. package/widgets/FeatureTable/support/FeatureStore.d.ts +675 -0
  484. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  485. package/widgets/FeatureTable/support/types.d.ts +28 -0
  486. package/widgets/Features/FeaturesViewModel.js +1 -1
  487. package/widgets/Features.js +1 -1
  488. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  489. package/widgets/LayerList/ListItemPanel.js +1 -1
  490. package/widgets/LayerList.js +1 -1
  491. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  492. package/widgets/Legend/support/colorRampUtils.js +1 -1
  493. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  494. package/widgets/Legend/support/utils.js +1 -1
  495. package/widgets/Measurement.js +1 -1
  496. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  497. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  498. package/widgets/OrientedImageryViewer/services/SuperimposeService.js +1 -1
  499. package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +1 -1
  500. package/widgets/OrientedImageryViewer.js +1 -1
  501. package/widgets/PanoramicVideoViewer.js +1 -1
  502. package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
  503. package/widgets/PanoramicViewer/support/importUtils.js +1 -1
  504. package/widgets/PanoramicViewer.js +1 -1
  505. package/widgets/Print.js +1 -1
  506. package/widgets/Search/SearchViewModel.js +1 -1
  507. package/widgets/Search/support/layerSearchUtils.js +1 -1
  508. package/widgets/Search/support/locatorUtils.js +1 -1
  509. package/widgets/Sketch/SketchViewModel.js +1 -1
  510. package/widgets/Sketch/support/PluginManager.js +1 -1
  511. package/widgets/Sketch.js +1 -1
  512. package/widgets/support/Selector2D/selectorUtils.js +1 -1
  513. package/widgets/support/SnappingControls.js +1 -1
  514. package/widgets/support/symbolPreviewUtils.js +1 -1
  515. package/arcade/geometry/offset.js +0 -2
  516. package/assets/esri/core/workers/chunks/067b00498ae85f635f60.js +0 -1
  517. package/assets/esri/core/workers/chunks/0b20f92bae2b4c40d299.js +0 -1
  518. package/assets/esri/core/workers/chunks/0c582abc8d25249eb530.js +0 -1
  519. package/assets/esri/core/workers/chunks/0d6776055e9b34c14151.js +0 -1
  520. package/assets/esri/core/workers/chunks/0e6b6fcc55cc43ede1fc.js +0 -1
  521. package/assets/esri/core/workers/chunks/126f1f6b355723db6c4f.js +0 -1
  522. package/assets/esri/core/workers/chunks/149284464115981694ff.js +0 -1
  523. package/assets/esri/core/workers/chunks/181f330314c1989f642f.js +0 -1
  524. package/assets/esri/core/workers/chunks/1840d74ebae777a0200b.js +0 -1
  525. package/assets/esri/core/workers/chunks/1bfbdec791e19f5a2534.js +0 -1
  526. package/assets/esri/core/workers/chunks/1d38a710cf799cb0e5b3.js +0 -1
  527. package/assets/esri/core/workers/chunks/1d8280f63a6698e74f20.js +0 -1
  528. package/assets/esri/core/workers/chunks/1f48438b3055afeb710f.js +0 -1
  529. package/assets/esri/core/workers/chunks/25999b6f96ec305a7679.js +0 -1
  530. package/assets/esri/core/workers/chunks/28565756f884d0851003.js +0 -1
  531. package/assets/esri/core/workers/chunks/2a5a165848413764381b.js +0 -1
  532. package/assets/esri/core/workers/chunks/2e7a5bb740281ef59199.js +0 -1
  533. package/assets/esri/core/workers/chunks/2f87a49bdd00f899d81d.js +0 -1
  534. package/assets/esri/core/workers/chunks/302d91b7c480c6c9304b.js +0 -1
  535. package/assets/esri/core/workers/chunks/30c53a7e1ad5aa52f2f3.js +0 -1
  536. package/assets/esri/core/workers/chunks/3b493e8043ec1a2a5d96.js +0 -1
  537. package/assets/esri/core/workers/chunks/3ddd717ea12d9823eee2.js +0 -1
  538. package/assets/esri/core/workers/chunks/3f84ade6285560b692d1.js +0 -1
  539. package/assets/esri/core/workers/chunks/4129b27fcd4103cdc499.js +0 -1
  540. package/assets/esri/core/workers/chunks/41f7f3615d3ecb87c59a.js +0 -1
  541. package/assets/esri/core/workers/chunks/465a050fd838ee8eddf3.js +0 -1
  542. package/assets/esri/core/workers/chunks/46d8a1d6f7341ad20749.js +0 -1
  543. package/assets/esri/core/workers/chunks/48a0dfaabb9b4bce4191.js +0 -1
  544. package/assets/esri/core/workers/chunks/4addea2e35b0c845743e.js +0 -1
  545. package/assets/esri/core/workers/chunks/4ae626868e14bedd7fc5.js +0 -1
  546. package/assets/esri/core/workers/chunks/529ee4670940720e888b.js +0 -1
  547. package/assets/esri/core/workers/chunks/538bdf02c4dfb5ec72fe.js +0 -1
  548. package/assets/esri/core/workers/chunks/59d1708ae13c6e7e6e55.js +0 -1
  549. package/assets/esri/core/workers/chunks/5adf16c034a590b5e9f5.js +0 -1
  550. package/assets/esri/core/workers/chunks/5fb0e8f89b885e5e3742.js +0 -1
  551. package/assets/esri/core/workers/chunks/60f9b37dd738d884c48d.js +0 -1
  552. package/assets/esri/core/workers/chunks/62c8413f3bbc1378273d.js +0 -1
  553. package/assets/esri/core/workers/chunks/632ab11cdd4b0d9a5cc5.js +0 -1
  554. package/assets/esri/core/workers/chunks/663cf8bff17c894cd5f8.js +0 -1
  555. package/assets/esri/core/workers/chunks/6cc1120554bcb1b4899b.js +0 -1
  556. package/assets/esri/core/workers/chunks/6d1371b521c7f94fd77e.js +0 -1
  557. package/assets/esri/core/workers/chunks/6f102c90908c9900cdaa.js +0 -1
  558. package/assets/esri/core/workers/chunks/7278fdf6bfcdffa10a7f.js +0 -1
  559. package/assets/esri/core/workers/chunks/73cb499d7d68c59ba34e.js +0 -1
  560. package/assets/esri/core/workers/chunks/76bccc318d7cc33829a7.js +0 -1
  561. package/assets/esri/core/workers/chunks/777eafdb86b26b35c803.js +0 -1
  562. package/assets/esri/core/workers/chunks/7821aeba3e414b318a75.js +0 -1
  563. package/assets/esri/core/workers/chunks/7ac47a9ad244100bc3b1.js +0 -1
  564. package/assets/esri/core/workers/chunks/7b0ed52363704cfce129.js +0 -1
  565. package/assets/esri/core/workers/chunks/7c57354d026e27e056d4.js +0 -1
  566. package/assets/esri/core/workers/chunks/7dd672c25beb8813cc75.js +0 -2
  567. package/assets/esri/core/workers/chunks/7eb94fc75926bc739233.js +0 -1
  568. package/assets/esri/core/workers/chunks/7f125963555dc1ce63ad.js +0 -1
  569. package/assets/esri/core/workers/chunks/805c97b875d3066fb8df.js +0 -1
  570. package/assets/esri/core/workers/chunks/86ed75b7169b8ee43025.js +0 -1
  571. package/assets/esri/core/workers/chunks/88c3b60b403e2454b56e.js +0 -1
  572. package/assets/esri/core/workers/chunks/894343e415639df88243.js +0 -1
  573. package/assets/esri/core/workers/chunks/8b4759cef5ae5e43253b.js +0 -1
  574. package/assets/esri/core/workers/chunks/8ba4175f5e9a24ffecf7.js +0 -1
  575. package/assets/esri/core/workers/chunks/8e1d4867406753c5483c.js +0 -1
  576. package/assets/esri/core/workers/chunks/8e38c5e63aae42bdf5a4.js +0 -29
  577. package/assets/esri/core/workers/chunks/8f785b722b1a131bf370.js +0 -1
  578. package/assets/esri/core/workers/chunks/8f8db62f126e4a8c1bf7.js +0 -1
  579. package/assets/esri/core/workers/chunks/8f9874f42f21a4cb3acd.js +0 -1
  580. package/assets/esri/core/workers/chunks/90f4b81c6034253b70d7.js +0 -1
  581. package/assets/esri/core/workers/chunks/93ab247ff34694ac60eb.js +0 -1
  582. package/assets/esri/core/workers/chunks/9954149def644c371894.js +0 -1
  583. package/assets/esri/core/workers/chunks/9dfb7d120195991e9672.js +0 -1
  584. package/assets/esri/core/workers/chunks/9ed5e6b06afea6c85330.js +0 -1
  585. package/assets/esri/core/workers/chunks/a108f276659d5f25352c.js +0 -1
  586. package/assets/esri/core/workers/chunks/a504fa17d83facf1c01f.js +0 -1
  587. package/assets/esri/core/workers/chunks/a5fdb02b1714e93fa69e.js +0 -1
  588. package/assets/esri/core/workers/chunks/a9f616f22042b0dce8b9.js +0 -1
  589. package/assets/esri/core/workers/chunks/afd63c18ce4656271c8e.js +0 -1
  590. package/assets/esri/core/workers/chunks/b059dabb1c732829487c.js +0 -1
  591. package/assets/esri/core/workers/chunks/b318823aefcefad6fad5.js +0 -1
  592. package/assets/esri/core/workers/chunks/b378e504a5b1afc8d0ce.js +0 -1
  593. package/assets/esri/core/workers/chunks/b5397dc03fa0bd654ba6.js +0 -1
  594. package/assets/esri/core/workers/chunks/b7bcb31737b01d7736d0.js +0 -1
  595. package/assets/esri/core/workers/chunks/ba030767cf935f967454.js +0 -1
  596. package/assets/esri/core/workers/chunks/be291d920ebc68fde02b.js +0 -2
  597. package/assets/esri/core/workers/chunks/c10a0eebd935472d8fae.js +0 -1
  598. package/assets/esri/core/workers/chunks/c16e83e448a32d13048f.js +0 -1
  599. package/assets/esri/core/workers/chunks/c2db773201adca204f95.js +0 -1
  600. package/assets/esri/core/workers/chunks/c4c83b5129c279c3615b.js +0 -1
  601. package/assets/esri/core/workers/chunks/c7e391df714839484cd1.js +0 -1
  602. package/assets/esri/core/workers/chunks/cca095f0c623e037002d.js +0 -1
  603. package/assets/esri/core/workers/chunks/cded485ad893a7dd2948.js +0 -1
  604. package/assets/esri/core/workers/chunks/cf03d391d50a4c7aca4f.js +0 -1
  605. package/assets/esri/core/workers/chunks/cf8ce63711488f2e677c.js +0 -1
  606. package/assets/esri/core/workers/chunks/d198ecb1fe3690d6092f.js +0 -2
  607. package/assets/esri/core/workers/chunks/d2a51c797b2966cb95f3.js +0 -2
  608. package/assets/esri/core/workers/chunks/d303621c902330be5035.js +0 -1
  609. package/assets/esri/core/workers/chunks/d4d385d19e62ef1c286f.js +0 -1
  610. package/assets/esri/core/workers/chunks/d4f005dadba75422b401.js +0 -1
  611. package/assets/esri/core/workers/chunks/d5e15021928e95c11463.js +0 -1
  612. package/assets/esri/core/workers/chunks/d6500f6b2ff115d9eb09.js +0 -1
  613. package/assets/esri/core/workers/chunks/d9c78c2db04a06ee83ed.js +0 -1
  614. package/assets/esri/core/workers/chunks/dccb46c7dce68528c72b.js +0 -1
  615. package/assets/esri/core/workers/chunks/df174346a7e9b629a392.js +0 -1
  616. package/assets/esri/core/workers/chunks/e08c64e4ae5a68eae2be.js +0 -1
  617. package/assets/esri/core/workers/chunks/e1492d2404c3ed82931e.js +0 -1
  618. package/assets/esri/core/workers/chunks/e34ed3b818b2eb4116c5.js +0 -1
  619. package/assets/esri/core/workers/chunks/e7149d23615fee31ab7e.js +0 -1
  620. package/assets/esri/core/workers/chunks/ec774f5d6ea5c29536e5.js +0 -1
  621. package/assets/esri/core/workers/chunks/ed71a4e353715db0a6e9.js +0 -1
  622. package/assets/esri/core/workers/chunks/f029c12f1afee0e9b2a1.js +0 -1
  623. package/assets/esri/core/workers/chunks/f4eda59ec1e816ecc827.js +0 -1
  624. package/assets/esri/core/workers/chunks/f54eba484f40d5eeb590.js +0 -1
  625. package/assets/esri/core/workers/chunks/f622b27ebdf1c918fd6d.js +0 -1
  626. package/assets/esri/core/workers/chunks/f6a13f07a5f7b781a9a8.js +0 -1
  627. package/assets/esri/core/workers/chunks/f6f1122bed931f1d960b.js +0 -1
  628. package/assets/esri/core/workers/chunks/f8b8d3d2710c83acccf3.js +0 -1
  629. package/assets/esri/core/workers/chunks/f98bb3885bfc7f18f26c.js +0 -1
  630. package/assets/esri/core/workers/chunks/fc827f58db3194922056.js +0 -1
  631. package/chunks/ShadedColorMaterial.glsl.js +0 -13
  632. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +0 -2
  633. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +0 -2
  634. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +0 -2
  635. package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +0 -2
  636. /package/assets/esri/core/workers/chunks/{d198ecb1fe3690d6092f.js.LICENSE.txt → 09653bd2a31d293a10d9.js.LICENSE.txt} +0 -0
  637. /package/assets/esri/core/workers/chunks/{f82cd34a79c8aa58d40c.js.LICENSE.txt → 3b3a8a6167f2e1eeb828.js.LICENSE.txt} +0 -0
  638. /package/assets/esri/core/workers/chunks/{d2a51c797b2966cb95f3.js.LICENSE.txt → c03da138651ac53cadcb.js.LICENSE.txt} +0 -0
  639. /package/assets/esri/core/workers/chunks/{7dd672c25beb8813cc75.js.LICENSE.txt → fa5d27e47d47ff8fcb96.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as r}from"../../../core/asyncUtils.js";import{cyclicalDegrees as a}from"../../../core/Cyclical.js";import o from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as u,add as f,distance as p,copy as g,subtract as y,set as h,transformMat3 as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectAsync as R,tryProject as z}from"../../../geometry/projectionUtils.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as S}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as B}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as M}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as Z}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,center as T,toRect as P,isPoint as A,empty as E,expandWithVec3 as U,expandWithAABB as V,width as O,height as k,depth as N}from"../../../geometry/support/aaBoundingBox.js";import{create as I,isPoint as C}from"../../../geometry/support/aaBoundingRect.js";import{polygonCentroidPoint as W}from"../../../geometry/support/centroid.js";import{intersectsPoint as Y}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as q}from"../../../geometry/support/scaleUtils.js";import{fromRenderCamera as D,toRenderCameraWithScale as J}from"../webgl.js";import{cameraOnContentAlongViewDirection as X}from"../camera/intersectionUtils.js";import{scaleToDistance as _,distanceToScale as H}from"./cameraScaleUtils.js";import{getViewSR as K,fromExtentAsync as L,fromCenterDistanceAsync as Q,fromExtentSync as $,fromCenterDistanceSync as tt,zoomToScale as et,fromCenterScale as nt}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";import{directionToHeadingTilt as at}from"./viewingModeUtils.js";const ot=.66;function it(t){return 360-a.normalize(t)}function st(t){return a.normalize(360-t)}function ct(t,e,n){const r=e.camera;if(null!=r)return mt(r,K(t));const{targetGeometry:a}=e;if(null==a)return null;const{camera:o,mode:i}=ft(t,e.rotation,n);if("point"===a.type)return pt(t,e,a,o,i);const s=a.extent;return null==s?null:$(t,s,o.heading,o.tilt,i)}async function lt(t,e,n,r){const a=e.camera;if(null!=a)return ut(a,K(t),r);const{targetGeometry:o}=e;if(null==o)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===o.type)return gt(t,e,o,i,s,r);const c=o.extent;if(null==c)throw new Error("Target geometry has no extent!");return L(t,c,i.heading,i.tilt,s,r)}function mt(t,e){const n=t.position,r=z(n,e);if(!r)return null;const a=t.clone();return a.position=r.clone(),a}async function ut(t,e,n){const r=t.position,a=await R(r,e,{signal:n});i(n);const o=t.clone();return o.position=a.clone(),o}function ft(t,e,n){const r=D(t,t.state.camera);let a=1;return null!=e&&(r.heading=it(e),a=0),null!=n&&(r.tilt=n),{camera:r,mode:a}}function pt(t,e,n,r,a){const o=t.spatialReference,i=z(n.clone(),o);if(!i)return null;const s=null!=e.scale?_(t,e.scale):t.state.camera.distance;return tt(t,i,s,r,a)}async function gt(t,e,n,r,a,o){const s=t.spatialReference,c=await R(n.clone(),s,{signal:o});i(o);const l=null!=e.scale?_(t,e.scale):t.state.camera.distance;return Q(t,c,l,r,a,o)}function yt(t,e,r=null){return null==r&&(r=new n),jt(t,null,e.clone(),r)}async function ht(e,r,a){const i=At(e,r);if(!i)throw new o("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return Et(await zt(e,i.target,i,a,c))}if(i.target instanceof t)return Et(await Gt(e,i.target,a,c,dt(e,i)));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return Et(l||t?await Bt(e,i,i.target.center,s,a,c):await Ft(e,i,i.target,s,a,c))}const m=new Vt,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,a),isFinite(m.boundingBox[0])){let t;if(T(m.boundingBox,Ot),Jt.x=Ot[0],Jt.y=Ot[1],Jt.z=Ot[2],Jt.spatialReference=e.spatialReference,isFinite(Jt.z)&&m.hasZ?t=A(m.boundingBox):(Jt.z=void 0,t=C(P(m.boundingBox,Ct))),l||t)return Et(await Bt(e,i,Jt,s,a,c));const n=Ut(e,m.screenSpaceObjects);return Et(await Pt(e,i,Jt,m.boundingBox,n,s,a,c))}return i.position?Et(await Mt(e,i,s,c,a)):Et(await Zt(e,i,s,a,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?et(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?q(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,r,a){const o=t.spatialReference||G.WGS84;if(e??=J(t,n,a),null==e)return r;const i=new b({spatialReference:o});return M(e.center,t.renderSpatialReference,i)?(r.targetGeometry=i,r.scale=a??H(t,e.distance),r.rotation=st(n.heading),r.camera=n,r):r}async function vt(t,e,n,r){const a=()=>new o("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw a();"mesh"===e.type&&(e=e.extent);const i=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":{const t=W(e);n=t?b.fromJSON(t):null;break}}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:r}),Ot[2]=rt(t.elevationProvider,n)??0):Ot[2]=0}const s=Xt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ot),0===c.length)throw a();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:r});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[o,f,p]of u.points)Ot[0]=o,Ot[1]=f,Ot[2]=p,U(n.boundingBox,Ot);else for(const[o,f]of u.points)Ot[0]=o,Ot[1]=f,U(n.boundingBox,Ot)}async function bt(t,e,n,a,o){const i=await r(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,a,o);const s=i.value,c=await r(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,a,o);const{screenSpaceObjects:l,boundingBox:m}=c.value;V(a.boundingBox,m),l&&l.forEach(t=>{a.screenSpaceObjects.push(t)}),isFinite(m[2])&&(a.hasZ=!0)}async function Rt(t,n,r,a,o){if(Array.isArray(n)&&2===n.length){const e=n[0],r=n[1];if("number"==typeof e&&"number"==typeof r)return Jt.x=e,Jt.y=r,Jt.z=void 0,Jt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,Jt,a,o)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map(e=>Rt(t,e,r,a,o))):n instanceof j?await vt(t,n,a,o):n instanceof e&&await bt(t,n,r,a,o)}async function zt(t,e,n,r,a){if(e.camera)return Gt(t,e.camera,r,a,dt(t,n)??e.scale);a.scale=e.scale,a.rotation=e.rotation,a.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,a.camera=null,null!=n.heading?a.rotation=st(n.heading):null!=n.rotation&&(a.rotation=n.rotation);const o=dt(t,n);return null!=o&&(a.scale=o),a.camera=await lt(t,a,n.tilt,r),a}async function Gt(t,e,n,r,a){const o=t.spatialReference,i=await R(e.position,o,{signal:n}),s=e.clone();return s.position=i,jt(t,null,s,r,a)}async function St(t,e,n,r,a,o,i){const s=t.renderSpatialReference;return await B(e,qt,s,{signal:i}),await B(n,Yt,s,{signal:i}),o.targetGeometry=new b(e),a.position=new b(n),y(Wt,qt,Yt),at(t,Yt,Wt,r.up,a),o.scale=H(t,p(Yt,qt)),o.rotation=st(a.heading),o.camera=a,o}async function Bt(t,e,n,r,a,o){o.targetGeometry=n.clone();const i=X(t);if(e.position)return St(t,o.targetGeometry,e.position,i,r,o,a);if(e.zoomFactor){const n=i.distance/e.zoomFactor,r=u(Ot,i.viewForward,-n);i.eye=f(Ot,i.center,r),o.scale=H(t,n)}D(t,i,r);const s=xt(r,e)?0:1;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await B(o.targetGeometry,Ot,t.renderSpatialReference,{signal:a});const e=Y(i.frustum,Ot)?p(i.eye,Ot):i.distance;o.camera=await Q(t,o.targetGeometry,e,r,s),o.scale=H(t,e)}else o.scale=n,o.camera=await nt(t,o.targetGeometry,o.scale,r,s,a)}return o}async function Mt(t,e,n,r,a){const o=X(t);g(Wt,o.viewForward),at(t,o.eye,Wt,o.up,Dt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:a});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Dt.heading,n.tilt=null!=e.tilt?e.tilt:Dt.tilt,jt(t,null,n,r,dt(t,e))}async function Zt(t,e,n,r,a){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const o=X(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return M(o.center,s,c)?Bt(t,e,c,n,r,a):a}return a.scale=t.scale,a.camera=t.camera.clone(),xt(a.camera,e),a}async function Ft(t,e,n,r,a,o){o.targetGeometry=n.clone();const i=X(t);D(t,i,r);const s=xt(r,e)?0:1;return o.camera=await L(t,n,r.heading,r.tilt,s,a),o}function Tt(t,e,n,r,a){let o=0;null!=n.z?o=n.z:t.basemapTerrain&&t.elevationProvider&&(o=rt(t.elevationProvider,n)),h(Ot,n.x,n.y,o),S(t.spatialReference,Ot,kt,t.renderSpatialReference),s(Nt,kt),c(Nt,Nt),E(It);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=r[e[2]];isFinite(n)||(n=o),h(Ot,r[e[0]],r[e[1]],n),Z(Ot,t.spatialReference,Ot,t.renderSpatialReference),U(It,d(Ot,Ot,Nt))}const l=O(It),m=k(It),u=N(It),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/a}async function Pt(t,e,n,r,a,o,i,s){s.targetGeometry=n.clone();const c=X(t),l=Tt(t,c,n,r,a);D(t,c,o);const m=xt(o,e)?0:1;return s.camera=await Q(t,s.targetGeometry,l,o,m,i),s.scale=H(t,l),s}function At(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function Et(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Ut(t,e){const n=ot;if(!e.length)return n;let r=Number.NEGATIVE_INFINITY;for(let a=0;a<e.length;a++){const t=e[a].screenSpaceBoundingRect;r=Math.max(r,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-r/Math.min(t.width,t.height)*2}class Vt{constructor(){this.hasZ=!1,this.boundingBox=E(),this.screenSpaceObjects=new Array}}const Ot=w(),kt=m(),Nt=l(),It=F(),Ct=I(),Wt=w(),Yt=w(),qt=w(),Dt={heading:0,tilt:0},Jt=new b,Xt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const r=t.hasZ;for(let a=0;a<t.rings.length;a++){const o=t.rings[a];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],r&&(n[2]=o[t][2]),e(n)}},polyline(t,e,n){const r=t.hasZ;for(let a=0;a<t.paths.length;a++){const o=t.paths[a];for(let t=0;t<o.length;t++)n[0]=o[t][0],n[1]=o[t][1],r&&(n[2]=o[t][2]),e(n)}},multipoint(t,e,n){const r=t.points,a=t.hasZ;for(let o=0;o<r.length;o++)n[0]=r[o][0],n[1]=r[o][1],a&&(n[2]=r[o][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
2
+ import t from"../../../Camera.js";import e from"../../../Graphic.js";import n from"../../../Viewpoint.js";import{result as r}from"../../../core/asyncUtils.js";import{cyclicalDegrees as o}from"../../../core/Cyclical.js";import a from"../../../core/Error.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{fromMat4 as s,transpose as c}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as l}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{scale as u,add as f,distance as p,copy as g,subtract as y,set as h,transformMat3 as d}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import x from"../../../geometry/Extent.js";import j from"../../../geometry/Geometry.js";import v from"../../../geometry/Multipoint.js";import b from"../../../geometry/Point.js";import{projectAsync as R,tryProject as z}from"../../../geometry/projectionUtils.js";import G from"../../../geometry/SpatialReference.js";import{computeTranslationToOriginAndRotation as S}from"../../../geometry/projection/computeTranslationToOriginAndRotation.js";import{projectPointToVectorAsync as B}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToPoint as M}from"../../../geometry/projection/projectVectorToPoint.js";import{projectVectorToVector as Z}from"../../../geometry/projection/projectVectorToVector.js";import{create as F,center as T,toRect as P,isPoint as V,empty as A,expandWithVec3 as E,expandWithAABB as U,width as O,height as k,depth as N}from"../../../geometry/support/aaBoundingBox.js";import{create as I,isPoint as C}from"../../../geometry/support/aaBoundingRect.js";import{polygonCentroidPoint as W}from"../../../geometry/support/centroid.js";import{intersectsPoint as Y}from"../../../geometry/support/frustum.js";import{getResolutionInMetersForScale as q}from"../../../geometry/support/scaleUtils.js";import{fromRenderCamera as D,toRenderCameraWithScale as J}from"../webgl.js";import{cameraOnContentAlongViewDirection as X}from"../camera/intersectionUtils.js";import{scaleToDistance as _,distanceToScale as H}from"./cameraScaleUtils.js";import{getViewSR as K,fromExtentAsync as L,fromCenterDistanceAsync as Q,fromExtentSync as $,fromCenterDistanceSync as tt,zoomToScale as et,fromCenterScale as nt}from"./cameraUtils.js";import{getElevationAtPoint as rt}from"./ElevationProvider.js";import{directionToHeadingTilt as ot}from"./viewingModeUtils.js";const at=.66;function it(t){return 360-o.normalize(t)}function st(t){return o.normalize(360-t)}function ct(t,e,n){const r=e.camera;if(null!=r)return mt(r,K(t));const{targetGeometry:o}=e;if(null==o)return null;const{camera:a,mode:i}=ft(t,e.rotation,n);if("point"===o.type)return pt(t,e,o,a,i);const s=o.extent;return null==s?null:$(t,s,a.heading,a.tilt,i)}async function lt(t,e,n,r){const o=e.camera;if(null!=o)return ut(o,K(t),r);const{targetGeometry:a}=e;if(null==a)throw new Error("Viewpoint has no targetGeometry!");const{camera:i,mode:s}=ft(t,e.rotation,n);if("point"===a.type)return gt(t,e,a,i,s,r);const c=a.extent;if(null==c)throw new Error("Target geometry has no extent!");return L(t,c,i.heading,i.tilt,s,r)}function mt(t,e){const n=t.position,r=z(n,e);if(!r)return null;const o=t.clone();return o.position=r.clone(),o}async function ut(t,e,n){const r=t.position,o=await R(r,e,{signal:n});i(n);const a=t.clone();return a.position=o.clone(),a}function ft(t,e,n){const r=D(t,t.state.camera);let o=1;return null!=e&&(r.heading=it(e),o=0),null!=n&&(r.tilt=n),{camera:r,mode:o}}function pt(t,e,n,r,o){const a=t.spatialReference,i=z(n.clone(),a);if(!i)return null;const s=null!=e.scale?_(t,e.scale):t.state.camera.distance;return tt(t,i,s,r,o)}async function gt(t,e,n,r,o,a){const s=t.spatialReference,c=await R(n.clone(),s,{signal:a});i(a);const l=null!=e.scale?_(t,e.scale):t.state.camera.distance;return Q(t,c,l,r,o,a)}function yt(t,e,r=null){return null==r&&(r=new n),jt(t,null,e.clone(),r)}async function ht(e,r,o){const i=Vt(e,r);if(!i)throw new a("viewpointutils-create:no-target","Missing target for creating viewpoint");const s=new t({fov:e.camera.fov}),c=new n({camera:s});if(i.target instanceof n){return At(await zt(e,i.target,i,o,c))}if(i.target instanceof t)return At(await Gt(e,i.target,o,c,dt(e,i)));const l=null!=i.scale||null!=i.zoom;if(i.target instanceof x){const t=i.target.xmin===i.target.xmax||i.target.ymin===i.target.ymax;return At(l||t?await Bt(e,i,i.target.center,s,o,c):await Ft(e,i,i.target,s,o,c))}const m=new Ut,u=l?wt(e,i):void 0;if(await Rt(e,i.target,u,m,o),isFinite(m.boundingBox[0])){let t;if(T(m.boundingBox,Ot),Jt.x=Ot[0],Jt.y=Ot[1],Jt.z=Ot[2],Jt.spatialReference=e.spatialReference,isFinite(Jt.z)&&m.hasZ?t=V(m.boundingBox):(Jt.z=void 0,t=C(P(m.boundingBox,Ct))),l||t)return At(await Bt(e,i,Jt,s,o,c));const n=Et(e,m.screenSpaceObjects);return At(await Pt(e,i,Jt,m.boundingBox,n,s,o,c))}return i.position?At(await Mt(e,i,s,c,o)):At(await Zt(e,i,s,o,c))}function dt(t,e){return null==e.scale&&null!=e.zoom?et(t,e.zoom):e.scale}function wt(t,e){const n=dt(t,e);return n?q(n):void 0}function xt(t,e){let n=!1;return null!=e.heading?(t.heading=e.heading,n=!0):null!=e.rotation&&(t.heading=it(e.rotation),n=!0),null!=e.tilt&&(t.tilt=e.tilt,n=!0),null!=e.fov&&(t.fov=e.fov),n}function jt(t,e,n,r,o){const a=t.spatialReference||G.WGS84;if(e??=J(t,n,o),null==e)return r;const i=new b({spatialReference:a});return M(e.center,t.renderSpatialReference,i)?(r.targetGeometry=i,r.scale=o??H(t,e.distance),r.rotation=st(n.heading),r.camera=n,r):r}async function vt(t,e,n,r){const o=()=>new a("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw o();"mesh"===e.type&&(e=e.extent);const i=t.groundView.spatialReference;if(!e.hasZ&&t.basemapTerrain){let n;switch(e.type){case"point":n=e;break;case"multipoint":case"polyline":n=e.extent?.center;break;case"extent":n=e.center;break;case"polygon":{const t=W(e);n=t?b.fromJSON(t):null;break}}null!=n&&i&&t.elevationProvider?(n=await R(n,i,{signal:r}),Ot[2]=rt(t.elevationProvider,n)??0):Ot[2]=0}const s=Xt[e.type],c=new Array;if(s(e,e.hasZ?t=>{c.push([t[0],t[1],t[2]])}:t=>{c.push([t[0],t[1]])},Ot),0===c.length)throw o();const l=e.spatialReference,m=t.spatialReference,u=await R(new v({spatialReference:l,hasZ:e.hasZ,hasM:!1,points:c}),m,{signal:r});if(e.hasZ&&(n.hasZ=!0),e.hasZ)for(const[a,f,p]of u.points)Ot[0]=a,Ot[1]=f,Ot[2]=p,E(n.boundingBox,Ot);else for(const[a,f]of u.points)Ot[0]=a,Ot[1]=f,E(n.boundingBox,Ot)}async function bt(t,e,n,o,a){const i=await r(t.whenViewForGraphic(e));if(!1===i.ok||null==i.value||!("whenGraphicBounds"in i.value))return void await vt(t,e.geometry,o,a);const s=i.value,c=await r(s.whenGraphicBounds(e,{minDemResolution:n}));if(!1===c.ok||!c.value)return void await vt(t,e.geometry,o,a);const{screenSpaceObjects:l,boundingBox:m}=c.value;U(o.boundingBox,m),l&&l.forEach(t=>{o.screenSpaceObjects.push(t)}),isFinite(m[2])&&(o.hasZ=!0)}async function Rt(t,n,r,o,a){if(Array.isArray(n)&&2===n.length){const e=n[0],r=n[1];if("number"==typeof e&&"number"==typeof r)return Jt.x=e,Jt.y=r,Jt.z=void 0,Jt.spatialReference=t.spatialReference?.isGeographic?t.spatialReference:G.WGS84,void await vt(t,Jt,o,a)}n&&"map"in n&&"function"==typeof n.map?await Promise.allSettled(n.map(e=>Rt(t,e,r,o,a))):n instanceof j?await vt(t,n,o,a):n instanceof e&&await bt(t,n,r,o,a)}async function zt(t,e,n,r,o){if(e.camera)return Gt(t,e.camera,r,o,dt(t,n)??e.scale);o.scale=e.scale,o.rotation=e.rotation,o.targetGeometry=null!=e.targetGeometry?e.targetGeometry.clone():null,o.camera=null,null!=n.heading?o.rotation=st(n.heading):null!=n.rotation&&(o.rotation=n.rotation);const a=dt(t,n);return null!=a&&(o.scale=a),o.camera=await lt(t,o,n.tilt,r),o}async function Gt(t,e,n,r,o){const a=t.spatialReference,i=await R(e.position,a,{signal:n}),s=e.clone();return s.position=i,jt(t,null,s,r,o)}async function St(t,e,n,r,o,a,i){const s=t.renderSpatialReference;return await B(e,qt,s,{signal:i}),await B(n,Yt,s,{signal:i}),a.targetGeometry=new b(e),o.position=new b(n),y(Wt,qt,Yt),ot(t,Yt,Wt,r.up,o),a.scale=H(t,p(Yt,qt)),a.rotation=st(o.heading),a.camera=o,a}async function Bt(t,e,n,r,o,a){a.targetGeometry=n.clone();const i=X(t);if(e.position)return St(t,a.targetGeometry,e.position,i,r,a,o);if(e.zoomFactor){const n=i.distance/e.zoomFactor,r=u(Ot,i.viewForward,-n);i.eye=f(Ot,i.center,r),a.scale=H(t,n)}D(t,i,r);const s=xt(r,e)?0:1;if(!e.zoomFactor){const n=dt(t,e);if(null==n){await B(a.targetGeometry,Ot,t.renderSpatialReference,{signal:o});const e=Y(i.frustum,Ot)?p(i.eye,Ot):i.distance;a.camera=await Q(t,a.targetGeometry,e,r,s),a.scale=H(t,e)}else a.scale=n,a.camera=await nt(t,a.targetGeometry,a.scale,r,s,o)}return a}async function Mt(t,e,n,r,o){const a=X(t);g(Wt,a.viewForward),ot(t,a.eye,Wt,a.up,Dt);const i=t.spatialReference,{position:s}=e;if(s){const t=await R(s,i,{signal:o});n.position=t}else n.position=new b;return n.heading=null!=e.heading?e.heading:Dt.heading,n.tilt=null!=e.tilt?e.tilt:Dt.tilt,jt(t,null,n,r,dt(t,e))}async function Zt(t,e,n,r,o){if(null!=e.heading||null!=e.rotation||null!=e.scale||null!=e.tilt||null!=e.zoom||null!=e.zoomFactor){const a=X(t),{spatialReference:i,renderSpatialReference:s}=t,c=new b({spatialReference:i});return M(a.center,s,c)?Bt(t,e,c,n,r,o):o}return o.scale=t.scale,o.camera=t.camera.clone(),xt(o.camera,e),o}async function Ft(t,e,n,r,o,a){a.targetGeometry=n.clone();const i=X(t);D(t,i,r);const s=xt(r,e)?0:1;return a.camera=await L(t,n,r.heading,r.tilt,s,o),a}function Tt(t,e,n,r,o){let a=0;null!=n.z?a=n.z:t.basemapTerrain&&t.elevationProvider&&(a=rt(t.elevationProvider,n)),h(Ot,n.x,n.y,a),S(t.spatialReference,Ot,kt,t.renderSpatialReference),s(Nt,kt),c(Nt,Nt),A(It);const i=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let s=0;s<i.length;s++){const e=i[s];let n=r[e[2]];isFinite(n)||(n=a),h(Ot,r[e[0]],r[e[1]],n),Z(Ot,t.spatialReference,Ot,t.renderSpatialReference),E(It,d(Ot,Ot,Nt))}const l=O(It),m=k(It),u=N(It),f=1/Math.tan(e.fovX/2),p=1/Math.tan(e.fovY/2),g=.5*Math.sqrt(l*l+u*u)*Math.max(p,f)+.5*m,y=.5*m*p+.5*Math.max(l,u);return Math.max(g,y)/o}async function Pt(t,e,n,r,o,a,i,s){s.targetGeometry=n.clone();const c=X(t),l=Tt(t,c,n,r,o);D(t,c,a);const m=xt(a,e)?0:1;return s.camera=await Q(t,s.targetGeometry,l,a,m,i),s.scale=H(t,l),s}function Vt(t,e){if(!e||!t.spatialReference)return null;const n={target:void 0};return"declaredClass"in e||Array.isArray(e)?n.target=e:(Object.assign(n,e),!n.target&&"center"in e&&e.center&&(n.target=e.center)),n}function At(t){return null!=t?.camera&&(t.rotation=st(t.camera.heading)),t}function Et(t,e){const n=at;if(!e.length)return n;let r=Number.NEGATIVE_INFINITY;for(let o=0;o<e.length;o++){const t=e[o].screenSpaceBoundingRect;r=Math.max(r,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2]),Math.abs(t[3]))}return n-r/Math.min(t.width,t.height)*2}class Ut{constructor(){this.hasZ=!1,this.boundingBox=A(),this.screenSpaceObjects=new Array}}const Ot=w(),kt=m(),Nt=l(),It=F(),Ct=I(),Wt=w(),Yt=w(),qt=w(),Dt={heading:0,tilt:0},Jt=new b,Xt={point(t,e,n){n[0]=t.x,n[1]=t.y,null!=t.z&&(n[2]=t.z),e(n)},polygon(t,e,n){const r=t.hasZ;for(let o=0;o<t.rings.length;o++){const a=t.rings[o];for(let t=0;t<a.length;t++)n[0]=a[t][0],n[1]=a[t][1],r&&(n[2]=a[t][2]),e(n)}},polyline(t,e,n){const r=t.hasZ;for(let o=0;o<t.paths.length;o++){const a=t.paths[o];for(let t=0;t<a.length;t++)n[0]=a[t][0],n[1]=a[t][1],r&&(n[2]=a[t][2]),e(n)}},multipoint(t,e,n){const r=t.points,o=t.hasZ;for(let a=0;a<r.length;a++)n[0]=r[a][0],n[1]=r[a][1],o&&(n[2]=r[a][2]),e(n)},extent(t,e,n){null!=t.zmin&&null!=t.zmax?(e(h(n,t.xmin,t.ymin,t.zmin)),e(h(n,t.xmax,t.ymin,t.zmin)),e(h(n,t.xmin,t.ymax,t.zmin)),e(h(n,t.xmax,t.ymax,t.zmin)),e(h(n,t.xmin,t.ymin,t.zmax)),e(h(n,t.xmax,t.ymin,t.zmax)),e(h(n,t.xmin,t.ymax,t.zmax)),e(h(n,t.xmax,t.ymax,t.zmax))):(e(h(n,t.xmin,t.ymin,n[2])),e(h(n,t.xmax,t.ymin,n[2])),e(h(n,t.xmin,t.ymax,n[2])),e(h(n,t.xmax,t.ymax,n[2])))}};export{ht as create,yt as fromCamera,lt as toCameraAsync,ct as toCameraSync};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Color.js";import{filterInPlace as i,difference as r}from"../../../core/arrayUtils.js";import s from"../../../core/CollectionFlattener.js";import{toConst as a}from"../../../core/compilerUtils.js";import{EventedAccessor as n}from"../../../core/Evented.js";import"../../../core/has.js";import l from"../../../core/Logger.js";import{clamp as o}from"../../../core/mathUtils.js";import{removeMaybe as h,destroyMaybe as d}from"../../../core/maybe.js";import{MemCachePool as p}from"../../../core/MemCachePool.js";import u from"../../../core/ObjectPool.js";import c from"../../../core/PooledArray.js";import{throwIfAborted as g,isAbortError as m,isAborted as _}from"../../../core/promiseUtils.js";import{watch as f,syncAndInitial as y,initial as T,sync as v}from"../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as w}from"../../../core/units.js";import{property as S,subclass as C}from"../../../core/accessorSupport/decorators.js";import{exactEquals as b,set as E,copy as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as U}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as L}from"../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as P,radiusModifier as R}from"../../../geometry/ellipsoidUtils.js";import M from"../../../geometry/SpatialReference.js";import{getProjector as D}from"../../../geometry/projection/projectors.js";import{projectPointToVector as j}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as I}from"../../../geometry/projection/projectVectorToVector.js";import{create as V,equals as A,intersection as k,intersectsSphere as B}from"../../../geometry/support/aaBoundingRect.js";import{copy as G,create as O}from"../../../geometry/support/frustum.js";import{createSpatialReferenceCyclical as q}from"../../../geometry/support/normalizeUtils.js";import{isPlateCarree as N}from"../../../geometry/support/spatialReferenceUtils.js";import{Sphere as F}from"../../../geometry/support/sphere.js";import{ElevationQueryTileCache as W}from"../../../layers/support/ElevationQueryTileCache.js";import{isBaseLayer as H}from"../../../layers/support/layerUtils.js";import{queueHighPriority as $}from"../../../request/queue.js";import{debugFlags as Q}from"../support/debugFlags.js";import{ElevationRange as z}from"../support/ElevationRange.js";import{ElevationUpdateEvent as Y}from"../support/ElevationUpdateEvent.js";import{calculateElevationUpdateExtents as X}from"../support/elevationUpdateExtentUtils.js";import{toBoundingRect as K}from"../support/extentUtils.js";import{updatingProgress as J}from"../support/updatingProperties.js";import{ElevationBounds as Z}from"./ElevationBounds.js";import{ElevationData as ee,sampleElevation as te}from"./ElevationData.js";import{create as ie}from"./ExtentHelper.js";import{LayerClasses as re}from"./LayerClass.js";import{OverlayManager as se}from"./OverlayManager.js";import{PlanarPatch as ae}from"./PlanarPatch.js";import{Queue as ne}from"./Queue.js";import{ScaleRangeQueries as le}from"./ScaleRangeQueries.js";import{SphericalPatch as oe}from"./SphericalPatch.js";import{SplitLimits as he}from"./SplitLimits.js";import{maxRootTiles as de,tooManyRootTilesAfterChangeError as pe,tooManyRootTilesForLayerError as ue,maxTileNeighborLevelDelta as ce,maxMemoryLodBias as ge}from"./TerrainConst.js";import{TerrainRenderer as me}from"./TerrainRenderer.js";import _e from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as fe,isVectorTileLayerView as ye,neighborEdgeIndices as Te,internalAssert as ve,oppositeEdge as we,isSurfaceLayerView as Se,isGroupLayerView as Ce,isMapTileLayerView as be,isBlendableLayerView as Ee,isElevationLayerView as xe,releaseTerrainData as Ue,enableTerrainInternalChecks as Le,oppositeCorner as Pe,enableWaterproofTests as Re,enableInternalTerrainChecks as Me,enableTerrainWaterproofChecks as De,neighborCornerIndices as je}from"./terrainUtils.js";import{Tile as Ie,lijEquals as Ve}from"./Tile.js";import{printAllocations as Ae}from"./TilePerLayerInfo.js";import{sortTiles as ke,IteratorPreorder as Be,IteratorPostorder as Ge,compareTilesByLij as Oe,hasLoadableSiblings as qe,sortTilesByPOI as Ne,traverseTilesPreorder as Fe}from"./tileUtils.js";import{TilingSchemeLogic as We}from"./TilingSchemeLogic.js";import{UpsampleInfo as He}from"./UpsampleInfo.js";import{isCompositeBlendMode as $e,blendModeFromString as Qe}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{hasLayerBasedScaleVisibility as ze}from"../../support/layerViewUtils.js";import{ImmediateTask as Ye,TaskPriority as Xe,noBudget as Ke}from"../../support/Scheduler.js";import{TextureCompressionTracker as Je}from"../../support/TextureCompressionTracker.js";import{Yield as Ze}from"../../support/Yield.js";var et;let tt=class extends n{static{et=this}get allTilesCreated(){return this._allTilesCreated}get allTiles(){return a(this._allTiles)}get renderedTiles(){return ke(i(this._allTiles.toArray(),e=>e.visible&&e.rendered))}get demResolution(){const{_allTiles:e,tilingScheme:t}=this;if(0===e.length)return{min:1,max:1};const i=w(t.spatialReference);let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(const a of e){const e=t.resolutionAtLevel(a.level)*i;r=Math.min(r,e),s=Math.max(s,e)}return{min:r,max:s}}constructor(e){super(e),this.terrainTextureCompressionTracker=new Je,this._iteratorPool=new u(()=>new Be,e=>e.remove=()=>this._iteratorPool.release(e)),this._postorderIterator=new Ge,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._allTilesCreated=!1,this._usedMemory=null,this._performanceInfo=new _e,this._viewChanged=!1,this.heading=0,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=U(),this._eyePosSurfaceSR=U(),this._splitLimits=new he,this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._updatingHandles=new L,this._poiWatchHandle=null,this._frameTask=Ye,this._allTiles=new c,this._upsampleInfoPool=new u(()=>new He),this._shouldEmitChangeEvent=!1,this._rootTilesExtent=V(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=M.WebMercator,this._elevationProjectorCache=new Map,this.visibleElevationRange=new z(1/0,-1/0),this._rootTileElevationRange=new z(1/0,-1/0),this._projectorCache=new Map,this._tilingSchemeSpatialReference=null,this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this._oneBatchPerFrameTask=!0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateCarree=!1,this.enabled=!0;const{view:t}=e;this.overlayManager=new se({...e,terrainSurface:this}),this._isGlobal=!t.state?.isLocal,this._isGeographic=this._spatialReference?.isGeographic??!1,this._tileConstructor=this._isGlobal?oe:ae,this._ellipsoid=P(t.spatialReference),this._renderer=new me(this.overlayManager.renderer,t.stage,this._allTiles,this.terrainTextureCompressionTracker,t.resourceController.memoryController),ze()||(this._scaleRangeQueries=new le)}initialize(){const{view:e}=this,{resourceController:t}=e,{memoryController:i}=t;this._tileCache=new p((e,t)=>i.newCache(e,t),"terrain-tile"),this._upsampleMapCache=i.newCache("terrain-upsample",({tile:e})=>e.unloadMapData()),this._elevationQueryCache=new W(i.newCache("elevation-query"));const r=this.overlayManager;this.addHandles([f(()=>r.renderer.isEmpty,()=>this._evaluateTransparency()),f(()=>this.renderer.visible,e=>this.suspended=!e),f(()=>this.heading,e=>{this._renderer.updateHeading(e),this._updateTileTextures(0)},y)],"overlayManager"),this._updatingHandles.add(()=>({heading:e.camera?.heading,state:e.state?.mode}),({heading:e,state:t})=>{if(null==e)return;if(this.isGlobal&&this.isGeographic||this.isWebMercatorOnPlateCarree)return void(this.heading=90*Math.round(e/90)%360);const i=Math.round(e)%360,r=Math.abs(i-this.heading);(2===t||Math.min(r,360-r)>=30)&&(this.heading=i)},T),this.addHandles([f(()=>this.baseOpacity,()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?1:2)},y),f(()=>this.hasCompositeBlendMode,()=>this._updateTileTextures(this._evaluateTransparency()?1:2),y),f(()=>this.backgroundColor,(e,t)=>{e?.equals(t)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(e))},v),f(()=>this.snapLevel,()=>this._viewChanged=!0,v),f(()=>this.view.pointsOfInterest,e=>{this._renderer.pointsOfInterest=e,this._poiWatchHandle=h(this._poiWatchHandle),e&&(this._poiWatchHandle=this._updatingHandles.add(()=>e.focus?.renderLocation,()=>this._allTilesSorted=!1,{equals:b}))}),f(()=>Q.TERRAIN_TILE_TREE_SHOW_TILES,t=>{t&&!this._treeDebugger?import("../layers/support/TerrainTileTree3DDebugger.js").then(({TerrainTileTree3DDebugger:t})=>{!this._treeDebugger&&Q.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new t({view:e}))}):t||(this._treeDebugger=d(this._treeDebugger))},T)]);const{spatialReference:a}=e;this._extentHelper=ie(this.viewingMode,{layers:e.map.allLayers,layerViews:e.allLayerViews,viewSpatialReference:a});const n=new s({getCollections:()=>e.defaultsFromMap?.mapCollections?.map(({layers:e})=>e),getChildrenFunction:e=>e&&"layers"in e?e.layers:null}),l=new We({layers:n,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:a});this._set("tilingSchemeLogic",l),this._updateTilingScheme();const o=t.scheduler;this._frameTask=o.registerTask(Xe.TERRAIN_SURFACE,this),this.addHandles([f(()=>this._extentHelper.stencilEnabledExtents,e=>this._renderer.setStencilEnabledLayerExtents(e),T),f(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),v),f(()=>this.groundExtent,()=>this._updateRootTiles(),T),e.on("resize",()=>this._viewChangeUpdate()),f(()=>{const t=e.state;return[this._lodBias,this.lodSnappingEnabled,e.quality,t.camera,t.contentCamera,t.fixedContentCamera]},()=>this._viewChangeUpdate(),y),f(()=>e.qualitySettings?.fadeDuration,e=>this._renderer.textureFadingEnabled=e>0,T),f(()=>e.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._renderer.pbrMode=e?5:0,T),f(()=>e.qualitySettings?.tiledSurface.elevationLevelDelta,()=>this._updateAllTileGeometries()),f(()=>this.userClippingExtent,()=>this._updateClippingExtent(),v)]),this.addHandles(e.allLayerViews.on("after-changes",()=>this._layerViewsDirty=!0)),this._layerViewsDirty=!0,this._handleLayerViewChanges(),this._renderer.updateTileBackground(this.backgroundColor)}clearHandles(){this._updatingHandles?.removeAll(),this.removeAllHandles(),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear()}destroy(){this._frameTask.remove(),this._frameTask=Ye,this._updatingHandles?.destroy(),this._removeAllTiles(),this._set("tilingSchemeLogic",d(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear(),this._set("overlayManager",d(this.overlayManager)),this._tileCache=d(this._tileCache),this._allTiles.prune(),Ie.prune(),this._treeDebugger=d(this._treeDebugger),this._renderer.destroyed||this._renderer.destroy(),this._renderer=null,this._iteratorPool=d(this._iteratorPool),this._upsampleMapCache=d(this._upsampleMapCache),this._elevationQueryCache=d(this._elevationQueryCache),this._set("view",null),this._extentHelper=d(this._extentHelper),this._upsampleInfoPool=d(this._upsampleInfoPool),Ae(),this._layerViews.forEach(e=>e.length=0),this._performanceInfo=null}get renderer(){return this._renderer}get frustum(){return this.view.state.camera.frustum}get snapLevel(){return this.lodSnappingEnabled?this.view.terrainLevel:null}get lodSnappingEnabled(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get hasStencilEnabledExtents(){return this._extentHelper.stencilEnabledExtents.length>0}get userClippingExtent(){const{spatialReference:e}=this,t=this.view?.clippingArea;if(null==t||null==e)return null;const i=V(),r=K(t,i,e)?i:null,s=this._get("userClippingExtent");return A(r,s)?s:r}get rootTilesExtent(){return this._rootTilesExtent}get groundExtent(){const e=k(this.fullGroundExtent,this.userClippingExtent,V()),t=this._get("groundExtent");return A(e,t)?t:e}get fullGroundExtent(){return null!=this._tilingSchemeExtent?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),this.enabled&&!!((this.readyToRun||this._updatingHandles?.updating||this._asyncWorkItems>0)&&this.ready&&!this.suspended||this.overlayManager?.updating||this.terrainTextureCompressionTracker.compressing)}get readyToRun(){return this.enabled&&(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._hasElevationSourceUpdates||this._layerViewsDirty||this._scaleRangeQueries?.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get _hasElevationSourceUpdates(){return this._allTiles.some(e=>e.needsElevationSourceUpdate())}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return!this.enabled||null!=this._rootTiles}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view?.map?.ground?.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??!1}get wireframe(){return this._renderer?.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}get opaque(){return 0===this._renderer.transparency}get invisible(){return 3===this._renderer.transparency}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}get fadeDuration(){return this.view.qualitySettings.fadeDuration??0}intersect(e,t,i,r){this._renderer.intersectRay(e,t,i,r)}getElevationLevelDelta(e){return e<4?3:this.view.qualitySettings.tiledSurface.elevationLevelDelta}get _xNormalizer(){return q(this._spatialReference)}getElevation(e,t,i,r){const s=this._rootTiles;if(!s?.length||!this.enabled)return null;if(0===s[0].layerInfo[0].length)return null;let a=this._elevationProjectorCache.get(r);if(void 0===a&&(a=D(r,this._spatialReference)??null,this._elevationProjectorCache.set(r,a)),null==a)return l.getLogger(this).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;const n=E(rt,e,t,i);a(n,0,n,0);return ot(s,this._xNormalizer?.normalize(n[0])??n[0],n[1])}getElevations(e,t,i){const r=this._rootTiles,s=r?r[0].layerInfo[0].length:0;if(r?.length&&0!==s&&this.enabled)for(let a=0;a<t;++a){const t=3*a;i(a,ot(r,e[t],e[t+1]))}else for(let a=0;a<t;++a)i(a,null)}getLayerIndexByUID(e,t){return this._layerIndexByUid[e].get(t)}getScale(e){if(!this.tilingScheme)return null;if(!j(e,rt,this.spatialReference))return l.getLogger(this).error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;const t=this._rootTiles;if(null!=t)for(const i of t)if(i?.containsPoint(rt)){let e=i;for(;e.children[0]&&!e.rendered;){const t=e.children[0].extent;let i=0;rt[0]>t[2]&&(i+=1),rt[1]<t[1]&&(i+=2),e=e.children[i]}return this._getLodBiasCorrectedScale(e.level)}return 1/0}_ensureProjector(e){const t=this._projectorCache.get(e);if(t)return t;const i=D(e,this._tilingSchemeSpatialReference)??null;return this._projectorCache.set(e,i),i}getSphereElevationRange(e,t){if(!this.enabled||null==this._rootTiles)return null;const i=this._ensureProjector(t);if(null==i)return l.getLogger(this).error("TerrainSurface.getSphereElevationRange(): could not project given point to tiling scheme coordinate system"),null;st.copyFrom(e),i(st.center,0,st.center,0);const r=new z,s=this._rootTiles;if(null!=s){const e=[];for(const i of s)e.push(i);let t=0;for(;t<e.length;){const i=e[t];if(++t,!B(i.extent,st))continue;const s=i.children;if(null==s[0]||i.rendered)r.expandElevationRangeValues(i.elevationBoundsMin,i.elevationBoundsMax);else for(const t of s)e.push(t)}}return r}getRootElevationRange(){return this.enabled&&null!=this._rootTiles?new z(this._rootTileElevationRange.minElevation,this._rootTileElevationRange.maxElevation):null}getLowerBoundRadius(){const e=(this._ellipsoid.radius+this.visibleElevationRange.minElevation)*R;return Math.min(e,this._ellipsoid.radius)}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!j(e,st.center,this.spatialReference))return l.getLogger(this).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;st.radius=t;let i=null;const r=e=>{if(e&&B(e.extent,st)){const t=e.children;if(t[0]&&!e.rendered)for(const e of t)r(e);else{const t=this._getLodBiasCorrectedScale(e.level);i=null==i?t:Math.min(i,t)}}},s=this._rootTiles;if(null!=s)for(const a of s)r(a);return i}queryVisibleScaleRange(e,t,i,r){if(!this._scaleRangeQueries)return;const s=t?this.tilingScheme.levelAtScale(t):0,a=i?this.tilingScheme.levelAtScale(i):1/0,n=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,s+n,a+n,r)}_evaluateTransparency(){const e=this.baseOpacity,t=this.overlayManager.renderer.isEmpty,i=this._renderer.transparency,r=this._isFullyTransparent?t?3:2:e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?0:1;return this._renderer.transparency=r,i!==r&&(this.notifyChange("opaque"),this.notifyChange("invisible"),!0)}_updateTilingScheme(){const{tilingScheme:e}=this.tilingSchemeLogic;if(!(e!==this.tilingScheme))return;fe(!!e,"tiling scheme cannot be reset to undefined"),this._isGlobal=!this.view?.state?.isLocal,this.tilingScheme&&this._removeAllTiles();const t=e?.spatialReference??M.WebMercator;this._spatialReference=t,this._isWebMercator=!!t?.isWebMercator,this._isWebMercatorOnPlateCarree=this._isWebMercator&&N(this.view?.renderSpatialReference),this._isGeographic=t?.isGeographic??!1,this._set("tilingScheme",e),this._tilingSchemeSpatialReference=this.tilingScheme?.spatialReference,this._projectorCache.clear(),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.tileSize=e.pixelSize,this.overlayManager.spatialReference=e.spatialReference,this._updateRootTiles())}static{this._tileMemcacheKey="TerrainTileMemcache"}_acquireTile(e,t,i,r){const s=this._tileCache.pop(et._tileMemcacheKey);return s?(s.init(e,t,i,r,this),s):new this._tileConstructor(e,t,i,r,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const{groundExtent:e,tilingScheme:t}=this;if(!t)return;if(!this.enabled)return void this._setRootTiles(null);const i=at;let s=t.rootTilesInExtent(e,i,5*de);if(null!=this._rootTiles){if(s.length>de)return void l.getLogger(this).warn(pe);const e=this._rootTiles.map(e=>e.lij),t=r(e,s,Ve);if(this._updatingRootTiles=!0,t.removed.length>0||t.added.length>0){const e=this._rootTiles.filter(e=>!(t.removed.findIndex(t=>Ve(t,e.lij))>-1)||(this._purgeTile(e),!1));t.added.forEach(t=>e.push(this._newRootTile(t))),this._setRootTiles(e)}}else this._updatingRootTiles=!0,s.length>de&&(l.getLogger(this).warn(ue),s=t.rootTilesInExtent(e,i,de)),this._setRootTiles(s.map(e=>this._newRootTile(e)));A(i,this._rootTilesExtent)||(this._rootTilesExtent=V(i)),this.renderer.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready"),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness()}_updateAllTileGeometries(){const e=this._allTiles.filter(e=>this._canUpdateTileGeometry(e));0!==e.length?(e.sort(Oe),e.forEach(e=>this._renderer.updateTileGeometryState(e)),e.forEach(e=>e.renderData.updateNeighborData()),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()):this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){const t=e.filter(e=>this._canUpdateTileGeometry(e));if(0===t.length)return;const i=this.renderer;for(const r of t)i.updateGeometryIfNeeded(r);for(const r of t)this._pendingTilesForElevationUpdateEvent.add(r)}_canUpdateTileGeometry(e){return e.loaded&&e.intersectsClippingArea&&e.hasGeometryState}_shouldSplit(e){return 1===e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)}_newRootTile(e){const t=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(t)&&t.setPendingUpdate(1),this._loadTile(t),this._markTileToUpdate(t),this._updateRootTileElevationRange(),t}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),null!=e){const t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles})}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this.renderer.visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.groundExtent)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(null==e)return;const t=qe(e),i=this.visibleElevationRange;let r=t?i.minElevation:1/0,s=t?i.maxElevation:-1/0;const a=this.groundExtent,n=this.view.state.contentCamera.viewProjectionMatrix;this.setTileTreeDirty(!1);const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const e=l.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e),e.computeVisibility(),e.updateScreenDepth(n),e.renderData&&(r=Math.min(e.elevationBoundsMin,r),s=Math.max(e.elevationBoundsMax,s))}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._updatePendingTileGeometries(),isFinite(r)&&isFinite(s)&&(i.minElevation!==r||i.maxElevation!==s)&&(this.visibleElevationRange=new Z(r,s))}_updateRootTileElevationRange(){let e=1/0,t=-1/0;const i=this._rootTiles;null!=i&&i.forEach(({elevationBoundsMin:i,elevationBoundsMax:r})=>{e=Math.min(e,i),t=Math.max(t,r)});const r=this._rootTileElevationRange;r.minElevation===e&&r.maxElevation===t||(this._rootTileElevationRange=new Z(e,t))}_updateViewDependentParameters(){const{camera:e,contentCamera:t}=this.view.state,i=Math.tan(.5*t.fovX),r=Math.tan(.5*t.fovY),s=this.tilingScheme.pixelSize,a=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?this._splitLimits.frustum=G(this._splitLimits.frustum??O(),t.frustum):this._splitLimits.frustum=null,x(this._eyePosRenderSR,t.eye),I(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateTileGeometryState(e){e.updateVisibility();const t=this._renderer.updateTileGeometryState(e);e.needsElevationSourceUpdate()&&(e.updateAgents(0),e.markElevationSourceUpdateRequested(),this.requestUpdate()),t&&this._markTileToUpdate(e),this.setMemoryDirty()}_markAllTileNeighborsForUpdate(e){e.forEachLoadedNeighbor(e=>{this._layerViews[1].some(ye)&&e.setPendingUpdate(32),this._pendingTilesToUpdate.add(e)})}_updateTileTexture(e,t){const i=e.resetPendingUpdate(32)?32:!!e.resetPendingUpdate(16)&&16;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=null,t.madeProgress())}_emitElevationUpdateEventForTiles(){if(!this._shouldEmitChangeEvent)return;const e=this._pendingTilesForElevationUpdateEvent;if(e.size>0){const t=new Float64Array(4*e.size);let i=0;for(const r of e)t.set(r.extent,4*i),++i;e.clear();for(const e of X(t,this.spatialReference)){const t=new Y(this.spatialReference,e,"ground");this.emit("elevation-change",t)}}this._shouldEmitChangeEvent=!1}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);const t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),this._updateElevation(e),this._updateElevationSources(e),this._updateTextures(e),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty();const i=this._pendingTilesToUpdate.size>0,r=i&&this._hasPendingGeometryWithoutIndices();if(e.done&&!r||this._updatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&(e.hasProgressed||i&&!r)&&this.requestUpdate(),this.notifyChange("updatingProgressValue"),Le&&this._checkTileInvariant(),!e.hasProgressed)return Ze}_checkTileInvariant(){const e=new Map;this._allTiles.forAll(t=>e.set(t,new Set)),this._allTiles.forAll(t=>{if(fe(t.rendered===t.leaf,` rendered ${t.rendered} != ${t.leaf} leaf`),!t.leaf){const e=e=>0===e.unmergableChildCount&&0===e.maxLevelDeltaNeighborCount,i=t.children.reduce((t,i)=>t+(e(i)?0:1),0);if(fe(t.unmergableChildCount===i,` Tile[${t.lij.toString()}] unmergeable child count mismatch: actual ${t.unmergableChildCount} vs ${i}`),t.hasPendingUpdate(4)){fe(!t.hasPendingUpdate(1),"Tile can be both split and merge at the same time");for(const e of t.children)fe(e.leaf||e.hasPendingUpdate(4),"Child of tile to merge must also merge")}}for(let i=0;i<4;++i){if(t.rendered){const e=t.renderData?.geometryState.edgePeerNeighbors[i];if(null!=e){{const r=t.level-e.level<=ce;r||(console.log(`tile level delta [${t.lij.toString()}] vs [${e.lij.toString()}] > ${ce} (edge[${i}])`),fe(r,`tile level delta [${t.level}] vs [${e.level}] > ${ce}`))}fe(t.level-e.level<=ce,`Max tile lod delta exceeded: [${t.lij.toString()}] vs [${e.lij.toString()}]`)}}const r=t.level-ce,s=e=>e.leaf||e.level===t.level,a=t.findNeighborTile(Te[i],s);if(null!=a){if(t.leaf&&t.level>=ce){let i=a;for(;t.level-i.level<ce;)i=i.parent;const s=[r,t.lij[1]>>ce,t.lij[2]>>ce];if(!Ve(s,i.lij)){const r=e.get(i);fe(!r.has(t),"Cannot already have neighbor"),r.add(t)}}fe(a.rendered||a.level===t.level,"Non-same-level-neighbor of rendered must be rendered"),fe(t.level-a.level<=ce,`Tile level delta [${t.level}] vs [${a.level}] > ${ce}`)}}}),this._allTiles.forAll(t=>{const i=t.maxLevelDeltaNeighborCount,r=e.get(t);fe(i===r.size,`Tile[${t.lij.toString()}] merge-blocker mismatch: actual ${i} vs ${r.size}`)})}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;let t=!1;const i=new ne(this._allTiles.length);i.pushAll(this._rootTiles);const r=this.snapLevel,s=this._splitLimits,a=this._eyePosRenderSR;this._allTiles.forAll(e=>{e.maxLevelDeltaNeighborCount=0,e.unmergableChildCount=0});const n=this.view.state.contentCamera.viewProjectionMatrix;for(;!i.empty;){const e=i.pop(),l=e.parent,o=l?.hasPendingUpdate(4),h=o?4:e.shouldSplit(s,a,r),d=1===h;e.leaf?ht(e,d):i.pushAll(e.children),o?(e.resetPendingUpdate(1),e.leaf||(e.setPendingUpdate(4),t=!0),this._updateClippingStatus(e),e.updateVisibility(),e.updateScreenDepth(n)):d?(e.resetPendingUpdate(4),e.leaf&&(e.setPendingUpdate(1),t=!0)):(e.resetPendingUpdate(1)&&e.updateAgentSuspension(),2===h&&e.updateAgents(0),e.leaf||(e.setPendingUpdate(4),e.resetPendingUpdate(1),t=!0))}this._allTilesDirty=t,this.requestUpdate(),(this._shortBatches||!this._oneBatchPerFrameTask)&&this._updatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||!this.view.pointsOfInterest?.focus||(Ne(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger?.update(),e.madeProgress())}_markTileToUpdate(e){ve(e.loaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForUpdate(e))}_hasPendingGeometryWithoutIndices(){for(const e of this._pendingTilesToUpdate)if(e.loaded&&e.intersectsClippingArea&&null==e.renderData?.vao?.indexBuffer)return!0;return!1}_updatePendingTileGeometries(){const e=this._pendingTilesToUpdate,t=[];if(e.forEach(e=>{this._canUpdateTileGeometry(e)&&t.push(e)}),0===t.length)return void e.clear();const i=(i,r)=>{!r||!this._canUpdateTileGeometry(r)||r.level<i.level||e.has(r)||(e.add(r),t.push(r),r.renderData.updateNeighborData())};t.sort(Oe);const r=t.length;for(let s=0;s<r;++s){const r=t[s];ve(r.loaded),ve(r.intersectsClippingArea);const a=r.renderData;if(!a?.geometryState)continue;a.updateNeighborData();const n=a.dirtyEdgeResolutions,l=a.geometryState,o=e=>{const t=je[e];i(r,l.cornerPeerNeighbors[e]?.findCorner(Pe(t),e=>e.loaded))};for(let t=0;t<4;++t)if(n&1<<t){const s=a.geometryState.edgePeerNeighbors[t];s&&s?.level>=r.level&&s.forAllSubtreeOnSide(we(Te[t]),t=>!!this._canUpdateTileGeometry(t)&&(ve(e.has(t)||Oe(r,t)<0),i(r,t),!0)),o((t+1)%4),o(t)}}e.clear(),this._updateTilesGeometries(t),this._shouldEmitChangeEvent=!0,Le&&Re&&this.checkAllTilesWaterproofness()}_mergeAndSplit(e,t){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=!1;const r=this.view.state.fixedContentCamera;let s=!1;for(;!e.done;){s=!0;let a=!1;const n=!this._allTiles.some(s=>{if(!i&&!r&&!s.visible)return e.done;let n=s;if(s.hasPendingUpdate(4)){if(!t||s.unmergableChildCount>0)return e.done;for(s.resetPendingUpdate(4);null!=n.parent&&0===n.parent.unmergableChildCount&&n.parent.resetPendingUpdate(4);)n=n.parent;this._mergeTile(n),a=!0,e.madeProgress()}else if(s.resetPendingUpdate(1)){let t=!0;const i=s.level;if(i>=ce){const e=e=>e.leaf||i-e.level<ce;for(let r=0;r<4;++r){const a=s.findNeighborTile(Te[r],e);null!=a&&i-a.level===ce&&(t=!1,Le&&(ve(a.leaf),ve(a.hasPendingUpdate(1))))}}t?(this._splitTile(s),e.madeProgress(),a=!0):s.setPendingUpdate(1)}return e.done});if(a&&(this._allTilesSorted=!1,this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries()),n){if(!i){i=!0;continue}if(!a)break}else this._allTilesDirty=!0}s?e.madeProgress():this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries(),this._allTilesCreated=!this.allTiles.some(e=>e.hasPendingUpdate(1)||e.hasPendingUpdate(4)&&0===e.unmergableChildCount),this._sortTiles(e)}_updateElevation(e){e.done||(this._allTiles.some(t=>(t.resetPendingUpdate(8)&&(this._updateTileGeometryState(t),e.madeProgress()),e.done)),!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries())}_updateElevationSources(e){e.done||this._allTiles.some(t=>(t.needsElevationSourceUpdate()&&(t.updateAgents(0),t.markElevationSourceUpdateRequested(),e.madeProgress()),e.done))}_updateTextures(e){e.done||this._allTiles.some(t=>(this._updateTileTexture(t,e),e.done))}_updateClippingExtent(){this.spatialReference&&(this.updateOverlayParameters(),this.requestRender(1),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){return this.view.qualitySettings.tiledSurface.lodBias-(1-this.view.quality)*ge}_getLodBiasCorrectedScale(e){const t=this.tilingScheme.levels,i=o(e-this._lodBias,0,t.length-1),r=i-Math.floor(i);return t[Math.floor(i)].scale*(1-r)+t[Math.ceil(i)].scale*r}_removeAllTiles(){this._pendingTilesToUpdate.clear(),this._pendingTilesForElevationUpdateEvent.clear(),null!=this._rootTiles&&(this._rootTiles.forEach(e=>this._purgeTile(e)),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles}),this.renderer.visible=!1}_purgeSubtree(e){const t=e.children;t[0]&&(this._purgeTile(t[0]),this._purgeTile(t[1]),this._purgeTile(t[2]),this._purgeTile(t[3]),e.clearChildren())}_purgeTile(e){e.leaf?pt(e):this._purgeSubtree(e),this._allTiles.removeUnordered(e),this._unloadTile(e),e.dispose(),this._tileCache.put(et._tileMemcacheKey,e),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles})}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload()}_splitTile(e){fe(e.leaf,"Tile that is already split should not be split again!"),fe(e.rendered,"Tile marked to split is not rendered"),pt(e);const t=e.createChildren();this._allTiles.pushArray(t),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles}),e.updateAgentSuspension(),fe(e.rendered,"parent should be rendered"),t.forEach(e=>this._loadTile(e)),t.forEach(e=>this._pendingTilesToUpdate.add(e)),this._unloadTile(e),this._markAllTileNeighborsForUpdate(e),this._emitTileScaleChange(e,e.level+1),this._allTilesDirty=!0,this._shortBatches&&this._updatePendingTileGeometries(),t.forEach(e=>ht(e,e.hasPendingUpdate(1))),++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){lt.spatialReference=this.spatialReference,lt.extent=e.extent,lt.scale=this._getLodBiasCorrectedScale(t),this.emit("scale-change",lt)}createTile(e,t,i,r){fe(!!r,"createTile sanity check");const s=this._acquireTile(e,t,i,r);return s.updateClippingStatus(this.groundExtent),s.updateScreenDepth(this.view.state.contentCamera.viewProjectionMatrix),this._shouldSplit(s)&&s.setPendingUpdate(1),s}get _shortBatches(){return 2!==this.view.state.mode}_mergeTile(e){fe(!e.hasPendingUpdate(1),"_mergeTile sanity check"),fe(!e.leaf,"Cannot merge a leaf"),e.leaf||(this._purgeSubtree(e),fe(!e.renderData,"Merging tile with existing render data?"),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this._shortBatches&&this._updatePendingTileGeometries(),ht(e,!1),this._allTilesDirty=!0,++this._performanceInfo.numMerged)}_loadTile(e){e.load(),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager?.hasOverlays&&e.updateOverlayParameters(this.overlayManager)}_handleLayerViewChanges(e=Ke){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1;const i=new Set;let r=-1;for(let s=this.view.allLayerViews.length-1;s>=0;s--){const e=this.view.allLayerViews.items[s];if(i.add(e.uid),Se(e)||Ce(e))if(this._basemapLayerViewHandles.has(e.uid)&&!Ce(e)){const i=this._layerClassFromLayerView(e),s=this.getLayerIndexByUID(i,e.uid);null!=s&&((s<r||null==r)&&(t=!0),r=s)}else this._registerTiledLayerView(e),e.layer.loaded&&(t=!0)}this._basemapLayerViewHandles.forEach((e,r)=>{i.has(r)||(this._unregisterTiledLayerView(r),t=!0)}),t&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}get _isFullyTransparent(){if(this.view.map?.ground?.opacity>0)return!1;for(const e of this.view.allLayerViews.items)if(be(e)&&!H(e.layer)&&0!==e.fullOpacity)return!1;return!0}_hasCompositeBlendMode(){for(const e of this.view.allLayerViews.items)if((Ee(e)||Ce(e))&&$e(Qe[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return xe(e)?0:1}_registerTiledLayerView(e){const t=[];if((Ee(e)||Ce(e))&&t.push(f(()=>e.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(2)})),!Ce(e)){const i=this._layerClassFromLayerView(e);t.push(f(()=>!e.destroyed&&e.suspended,()=>this._updateTiledLayers())),t.push(f(()=>!e.destroyed&&e.fullOpacity,()=>this._updateTileTextures(2)));const{layer:r}=e;"effectiveScaleRange"in r&&t.push(f(()=>!e.destroyed&&r.effectiveScaleRange,()=>this._restartAllAgents(i))),t.push(e.on("data-changed",()=>{const t=this.getLayerIndexByUID(i,e.uid);null!=t&&this._invalidateLayerData(t,i)}))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){const t=this._basemapLayerViewHandles.get(e);if(t){for(const e of t)e.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,t=[[],[]];let i=null;e.forEach(e=>{if(!e.layer||e.suspended||!Se(e)||!e.fullExtent)return;const r=this._layerClassFromLayerView(e);if(1===r){const t=e.displayLevelRange.maxLevel;t!==1/0&&(null===i||t>i)&&(i=t)}t[r].push(e)});for(const r of re){const e=this._layerViews[r],i=t[r];i.reverse();const s=i.length;let a=e.length!==s;const n=new Array(s),l=new Array(e.length);this._layerIndexByUid[r].clear();for(let t=0;t<s;t++){const s=i[t].uid;this._layerIndexByUid[r].set(s,t);const o=e.indexOf(i[t]);n[t]=o,t!==o&&(a=!0),o>-1&&(l[o]=t)}if(a){const e=this._postorderIterator;for(e.reset(this._rootTiles);!e.done;)e.next().modifyLayers(l,n,r);this._layerViews[r]=i,this._restartAllAgents(r),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&(this._viewChangeUpdate(),this.notifyChange("tilingScheme"))}_restartAllAgents(e){const t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;){const i=t.next();i.restartAgents(e),0===e&&i.computeElevationBounds()}this._updateRootTileElevationRange()}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll(t=>{t.updateAgents(1),1===e?this.renderer.updateTileTexture(t,16):t.updateRenderData(1,e)}),this._evaluateTransparency()}_invalidateLayerData(e,t){null!=this._rootTiles&&(Fe(this._rootTiles,i=>i.removeLayerAgent(e,t)),Fe(this._rootTiles,i=>{i.invalidateLayerData(e,t),i.restartAgents(t)}))}setTileTreeDirty(e){this._allTilesDirty=!0,e&&(this._allTilesCreated=!1)}requestRender(e=1){this.renderer.setNeedsRender(e)}requestUpdate(){1===++this._pendingUpdates&&(this._hasPendingUpdates=!0)}requestTileData(e,t,i,r){const s=this.layerViewByIndex(t,i),a=s.layer;return!a.tilemapCache||ye(s)?this._requestTileData(e,i,s,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.level,e.lij[1],e.lij[2],{...r,timeout:6e3}).catch(t=>{throw g(r),m(t)||this._dataMissing(e,i,s),t}).then(()=>this._frameTask.schedule(()=>this._requestTileData(e,i,s,r),r.signal)).finally(()=>--this._asyncWorkItems))}_requestTileData(e,t,i,r){if(this.destroying)return Promise.resolve();return 0===t?xe(i)?this._requestElevationTileData(e,i,r):Promise.reject():be(i)?this._requestMapTileData(e,i,r):Promise.reject()}_requestElevationTileData(e,t,i){++this._asyncWorkItems;const r=r=>{!_(i)&&r&&(this.setMemoryDirty(),this.requestUpdate(),this._elevationDataArrived(e,t,r))},s=i=>{m(i)||(l.getLogger(this).error(`Tile ${e.lij.toString()} layer 0/${t.uid} error ${i}`),this._dataMissing(e,0,t),this.requestUpdate())};return t.fetchElevationTile(e,{...$,...i}).then(e=>this._frameTask.schedule(()=>r(e)),s).finally(()=>--this._asyncWorkItems)}_elevationDataArrived(e,t,i){const r=this._layerIndexByUid[0].get(t.uid);if(null==r)return void l.getLogger(this).warn("TerrainSurface: received data from unknown layer %d %s",0,e.lij.toString());const s=new ee(e.lij,e.extent,i);e.dataArrived(r,0,s),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:0});const a=[e],n=e.level,o=this._iteratorPool.acquire();for(o.reset(a);!o.done;){const e=o.next();e.findElevationBoundsForLayer(r,n),e.computeElevationBounds()}0===n&&this._updateRootTileElevationRange(),o.remove(),this._updateTilesVisibility(a)}_requestMapTileData(e,t,i){++this._asyncWorkItems;const r=(r,s)=>{Ue(s),_(i)||(console.error(`Tile ${e.lij.toString()} layer 1/${t.uid} error ${r}`),this._dataMissing(e,1,t),this.requestUpdate())},s=e=>t=>r(t,e),a=r=>this._frameTask.schedule(()=>{this.requestUpdate(),_(i)?Ue(r):this._mapTileDataArrived(e,t,r)},i.signal,s(r)).catch(s(r)),n=(e,t=null)=>this._frameTask.schedule(()=>r(e,t));return t.fetchTile(e.lij,i).then(a,n).finally(()=>--this._asyncWorkItems)}_mapTileDataArrived(e,t,i){const r=this.getLayerIndexByUID(1,t.uid);if(null==r)return Ue(i),void l.getLogger(this).warn("TerrainSurface: received data from unknown layer");e.dataArrived(r,1,i),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:1})}_dataMissing(e,t,i){const r=this.getLayerIndexByUID(t,i.uid);null!=r?(e.dataMissing(r,t),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:t})):l.getLogger(this).warn("TerrainSurface: received data from unknown layer")}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll(t=>{t.leaf&&e.numLeaves++;const i=t.level;t.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))}),e}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this.tilingScheme?(null==this._usedMemory&&(this._usedMemory=this._recalculateUsedMemory()),this._usedMemory??0):0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((e,t)=>e+t.usedMemory,0)):null}getUsedMemoryForLayerView(e){let t=0;const i=this._layerClassFromLayerView(e),r=this.getLayerIndexByUID(i,e.uid);return null!=r&&this._allTiles.forAll(e=>t+=e.getUsedMemoryForLayer(i,r)),t}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){}checkAllTilesWaterproofness(){if(!Re)return;const e=this._rootTiles;if(null==e)return;const t=e=>e?.renderData?.geometry?.indices?.length>0,i=(e,i)=>{t(e)&&console.error("Tile[",e.lij,"] has geometry although parent[",i.lij,"] has geom")},r=e=>{if(e.intersectsClippingArea)if(e.renderData&&!e.renderData.geometryState&&console.error("Tile[",e.lij,"] has renderData but not geometryState"),e.renderData&&!e.renderData.geometry&&console.error("Tile[",e.lij,"] has renderData but not geometryInfo"),!e.renderData?.geometry||(e.renderData.geometry.indices?.length??0)>0||console.error("Tile[",e.lij,"] has renderData but no indices - geometryInfo: ",e.renderData.geometry),t(e)){e.checkGeometryWaterproofness();for(const t of e.children)i(t,e)}else if(e.leaf)console.error("Tile[",e.lij,"] has no geometry and no children, from root to leaf");else for(const t of e.children)r(t)},s=e=>{const t=e.parent?.visible??!0,i=e.visible;e.computeVisibility();const r=e.visible;if(i!==r&&t&&console.error(" Tile[",e.lij,"] has out of date visibility: ",i," instead of ",r),!e.leaf)for(const a of e.children)s(a)};for(const a of e)r(a),s(a)}get isGlobal(){return this._isGlobal}get isGeographic(){return this._isGeographic}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateCarree(){return this._isWebMercatorOnPlateCarree}isEastEndWrap(e){return this._isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this._isGlobal&&0===e[2]}lijEastEnd(e){return 1<<e+(this._isGeographic?1:0)}wrapEastWest(e){const t=this.lijEastEnd(e[0]),i=e[2];if(0<=i&&i<t)return e;if(!this._isGlobal)return null;const r=(i+(i<0?t:0))%t;return[e[0],e[1],r]}enableInternalChecks(e){Me(e)}enableWaterproofnessChecks(e){De(e)}static cleanupTerrainSurface(){nt.prune()}enable(e){e!==this.enabled&&(this._set("enabled",e),e?(this._updateRootTiles(),this.suspended=!1,this.view.elevationProvider.register(0,this)):(this.view.elevationProvider.unregister(this),this.suspended=!0,this._removeAllTiles(),this._setRootTiles(null)),this.notifyChange("ready"))}updateOverlayParameters(){const{overlayManager:e}=this;this.allTiles.forAll(t=>t.updateOverlayParameters(e))}};e([S()],tt.prototype,"_renderer",void 0),e([S({constructOnly:!0})],tt.prototype,"_scaleRangeQueries",void 0),e([S({constructOnly:!0})],tt.prototype,"view",void 0),e([S({constructOnly:!0})],tt.prototype,"overlayManager",void 0),e([S({constructOnly:!0})],tt.prototype,"terrainTextureCompressionTracker",void 0),e([S()],tt.prototype,"_hasPendingUpdates",void 0),e([S()],tt.prototype,"_asyncWorkItems",void 0),e([S()],tt.prototype,"_allTilesDirty",void 0),e([S()],tt.prototype,"_allTilesSorted",void 0),e([S()],tt.prototype,"allTilesCreated",null),e([S()],tt.prototype,"_allTilesCreated",void 0),e([S()],tt.prototype,"_viewChanged",void 0),e([S({type:Number})],tt.prototype,"heading",void 0),e([S()],tt.prototype,"_splitLimits",void 0),e([S()],tt.prototype,"_frameTask",void 0),e([S()],tt.prototype,"demResolution",null),e([S({readOnly:!0})],tt.prototype,"snapLevel",null),e([S({readOnly:!0})],tt.prototype,"lodSnappingEnabled",null),e([S({readOnly:!0})],tt.prototype,"userClippingExtent",null),e([S()],tt.prototype,"_rootTilesExtent",void 0),e([S({readOnly:!0})],tt.prototype,"groundExtent",null),e([S({readOnly:!0})],tt.prototype,"fullGroundExtent",null),e([S({readOnly:!0})],tt.prototype,"_tilingSchemeExtent",null),e([S({readOnly:!0})],tt.prototype,"updating",null),e([S({readOnly:!0})],tt.prototype,"readyToRun",null),e([S(J)],tt.prototype,"updatingProgress",void 0),e([S({readOnly:!0})],tt.prototype,"updatingProgressValue",null),e([S()],tt.prototype,"_maxNumUpdating",void 0),e([S()],tt.prototype,"baseOpacity",null),e([S()],tt.prototype,"hasCompositeBlendMode",void 0),e([S({readOnly:!0})],tt.prototype,"viewingMode",null),e([S()],tt.prototype,"maxTextureScale",void 0),e([S({readOnly:!0})],tt.prototype,"ready",null),e([S({readOnly:!0})],tt.prototype,"rootTiles",null),e([S()],tt.prototype,"_rootTiles",void 0),e([S({readOnly:!0})],tt.prototype,"spatialReference",null),e([S({type:t})],tt.prototype,"backgroundColor",null),e([S({value:!1})],tt.prototype,"slicePlaneEnabled",null),e([S({readOnly:!0})],tt.prototype,"tilingScheme",void 0),e([S({readOnly:!0})],tt.prototype,"tilingSchemeLocked",null),e([S({readOnly:!0})],tt.prototype,"tilingSchemeLogic",void 0),e([S()],tt.prototype,"wireframe",null),e([S()],tt.prototype,"opaque",null),e([S()],tt.prototype,"invisible",null),e([S({value:!1})],tt.prototype,"suspended",null),e([S()],tt.prototype,"fadeDuration",null),e([S()],tt.prototype,"_xNormalizer",null),e([S()],tt.prototype,"visibleElevationRange",void 0),e([S()],tt.prototype,"_rootTileElevationRange",void 0),e([S()],tt.prototype,"_layerViewsDirty",void 0),e([S()],tt.prototype,"renderPatchBorders",null),e([S()],tt.prototype,"renderingDisabled",null),e([S({readOnly:!0})],tt.prototype,"enabled",void 0),tt=et=e([C("esri.views.3d.terrain.TerrainSurface")],tt);const it=tt,rt=U(),st=new F,at=V(),nt=new c,lt={spatialReference:null,extent:null,scale:0};function ot(e,t,i){for(const r of e){if(!r.containsPointXY(t,i))continue;let e=r;for(;e&&!e.renderData;){const r=(t>e.extentMidX?1:0)+(i<e.extentMidY?2:0);e=e.children[r]}const s=e?.renderData?.geometryState.samplerData??null;return te(t,i,s)}return null}function ht(e,t){!e.leaf||e.level<ce||ct(e,e=>{t&&dt(e);const i=ut(e);if(e.maxLevelDeltaNeighborCount++,i){let t=e.parent;for(;t;){const e=ut(t);if(t.unmergableChildCount++,!e)break;t=t.parent}}})}function dt(e){if(e.hasPendingUpdate(1))return;let t=e.parent;for(;t?.resetPendingUpdate(4);)t=t.parent;e.resetPendingUpdate(4),e.leaf&&e.setPendingUpdate(1),e.level<ce||ct(e,e=>{dt(e)})}function pt(e){e.level<ce||ct(e,e=>{if(e.maxLevelDeltaNeighborCount--,0===e.maxLevelDeltaNeighborCount&&0===e.unmergableChildCount){let t=e.parent;for(;t&&(t.unmergableChildCount--,ut(t));)t=t.parent}})}function ut(e){return 0===e.maxLevelDeltaNeighborCount&&0===e.unmergableChildCount}function ct(e,t){if(e.level<ce)return;const i=e.level-ce,r=e.lij[1]>>ce,s=e.lij[2]>>ce,a=e=>e.leaf||e.level===i;for(let n=0;n<4;++n){const l=e.findNeighborTile(Te[n],a);if(!l||l.level!==i)continue;const o=l.lij;o[1]===r&&o[2]===s||t(l)}}export{it as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../Color.js";import{filterInPlace as i,difference as r}from"../../../core/arrayUtils.js";import s from"../../../core/CollectionFlattener.js";import{toConst as a}from"../../../core/compilerUtils.js";import{EventedAccessor as n}from"../../../core/Evented.js";import"../../../core/has.js";import l from"../../../core/Logger.js";import{clamp as o}from"../../../core/mathUtils.js";import{removeMaybe as h,destroyMaybe as d}from"../../../core/maybe.js";import{MemCachePool as p}from"../../../core/MemCachePool.js";import u from"../../../core/ObjectPool.js";import c from"../../../core/PooledArray.js";import{throwIfAborted as g,isAbortError as m,isAborted as _}from"../../../core/promiseUtils.js";import{watch as f,syncAndInitial as y,initial as T,sync as v}from"../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as w}from"../../../core/units.js";import{property as S,subclass as C}from"../../../core/accessorSupport/decorators.js";import{exactEquals as b,set as E,copy as x}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{create as U}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as L}from"../../../core/support/UpdatingHandles.js";import{getReferenceEllipsoid as P,radiusModifier as R}from"../../../geometry/ellipsoidUtils.js";import M from"../../../geometry/SpatialReference.js";import{getProjector as D}from"../../../geometry/projection/projectors.js";import{projectPointToVector as j}from"../../../geometry/projection/projectPointToVector.js";import{projectVectorToVector as I}from"../../../geometry/projection/projectVectorToVector.js";import{create as V,equals as A,intersection as k,intersectsSphere as B}from"../../../geometry/support/aaBoundingRect.js";import{copy as G,create as O}from"../../../geometry/support/frustum.js";import{createSpatialReferenceCyclical as q}from"../../../geometry/support/normalizeUtils.js";import{isPlateCarree as N}from"../../../geometry/support/spatialReferenceUtils.js";import{Sphere as F}from"../../../geometry/support/sphere.js";import{ElevationQueryTileCache as W}from"../../../layers/support/ElevationQueryTileCache.js";import{isBaseLayer as H}from"../../../layers/support/layerUtils.js";import{queueHighPriority as $}from"../../../request/queue.js";import{debugFlags as Q}from"../support/debugFlags.js";import{ElevationRange as z}from"../support/ElevationRange.js";import{ElevationUpdateEvent as Y}from"../support/ElevationUpdateEvent.js";import{calculateElevationUpdateExtents as X}from"../support/elevationUpdateExtentUtils.js";import{toBoundingRect as K}from"../support/extentUtils.js";import{updatingProgress as J}from"../support/updatingProperties.js";import{ElevationBounds as Z}from"./ElevationBounds.js";import{ElevationData as ee,sampleElevation as te}from"./ElevationData.js";import{create as ie}from"./ExtentHelper.js";import{LayerClasses as re}from"./LayerClass.js";import{OverlayManager as se}from"./OverlayManager.js";import{PlanarPatch as ae}from"./PlanarPatch.js";import{Queue as ne}from"./Queue.js";import{ScaleRangeQueries as le}from"./ScaleRangeQueries.js";import{SphericalPatch as oe}from"./SphericalPatch.js";import{SplitLimits as he}from"./SplitLimits.js";import{maxRootTiles as de,tooManyRootTilesAfterChangeError as pe,tooManyRootTilesForLayerError as ue,maxTileNeighborLevelDelta as ce,maxMemoryLodBias as ge}from"./TerrainConst.js";import{TerrainRenderer as me}from"./TerrainRenderer.js";import _e from"./TerrainSurfacePerformanceInfo.js";import{weakAssert as fe,isVectorTileLayerView as ye,neighborEdgeIndices as Te,internalAssert as ve,oppositeEdge as we,isSurfaceLayerView as Se,isGroupLayerView as Ce,isMapTileLayerView as be,isBlendableLayerView as Ee,isElevationLayerView as xe,releaseTerrainData as Ue,enableTerrainInternalChecks as Le,oppositeCorner as Pe,enableWaterproofTests as Re,enableInternalTerrainChecks as Me,enableTerrainWaterproofChecks as De,neighborCornerIndices as je}from"./terrainUtils.js";import{Tile as Ie,lijEquals as Ve}from"./Tile.js";import{printAllocations as Ae}from"./TilePerLayerInfo.js";import{sortTiles as ke,IteratorPreorder as Be,IteratorPostorder as Ge,compareTilesByLij as Oe,hasLoadableSiblings as qe,sortTilesByPOI as Ne,traverseTilesPreorder as Fe}from"./tileUtils.js";import{TilingSchemeLogic as We}from"./TilingSchemeLogic.js";import{getGroundTransparencyModeFromOpacity as He}from"./TransparencyMode.js";import{UpsampleInfo as $e}from"./UpsampleInfo.js";import{isCompositeBlendMode as Qe,blendModeFromString as ze}from"../webgl-engine/core/shaderLibrary/output/BlendOptions.js";import{hasLayerBasedScaleVisibility as Ye}from"../../support/layerViewUtils.js";import{ImmediateTask as Xe,TaskPriority as Ke,noBudget as Je}from"../../support/Scheduler.js";import{TextureCompressionTracker as Ze}from"../../support/TextureCompressionTracker.js";import{Yield as et}from"../../support/Yield.js";var tt;let it=class extends n{static{tt=this}get allTilesCreated(){return this._allTilesCreated}get allTiles(){return a(this._allTiles)}get renderedTiles(){return ke(i(this._allTiles.toArray(),e=>e.visible&&e.rendered))}get demResolution(){const{_allTiles:e,tilingScheme:t}=this;if(0===e.length)return{min:1,max:1};const i=w(t.spatialReference);let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(const a of e){const e=t.resolutionAtLevel(a.level)*i;r=Math.min(r,e),s=Math.max(s,e)}return{min:r,max:s}}constructor(e){super(e),this.terrainTextureCompressionTracker=new Ze,this._iteratorPool=new u(()=>new Be,e=>e.remove=()=>this._iteratorPool.release(e)),this._postorderIterator=new Ge,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._allTilesCreated=!1,this._usedMemory=null,this._performanceInfo=new _e,this._viewChanged=!1,this.heading=0,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=U(),this._eyePosSurfaceSR=U(),this._splitLimits=new he,this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._updatingHandles=new L,this._poiWatchHandle=null,this._frameTask=Xe,this._allTiles=new c,this._upsampleInfoPool=new u(()=>new $e),this._shouldEmitChangeEvent=!1,this._rootTilesExtent=V(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=M.WebMercator,this._elevationProjectorCache=new Map,this.visibleElevationRange=new z(1/0,-1/0),this._rootTileElevationRange=new z(1/0,-1/0),this._projectorCache=new Map,this._tilingSchemeSpatialReference=null,this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this._oneBatchPerFrameTask=!0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateCarree=!1,this.enabled=!0;const{view:t}=e;this.overlayManager=new se({...e,terrainSurface:this}),this._isGlobal=!t.state?.isLocal,this._isGeographic=this._spatialReference?.isGeographic??!1,this._tileConstructor=this._isGlobal?oe:ae,this._ellipsoid=P(t.spatialReference),this._renderer=new me(this.overlayManager.renderer,t.stage,this._allTiles,this.terrainTextureCompressionTracker,t.resourceController.memoryController),Ye()||(this._scaleRangeQueries=new le)}initialize(){const{view:e}=this,{resourceController:t}=e,{memoryController:i}=t;this._tileCache=new p((e,t)=>i.newCache(e,t),"terrain-tile"),this._upsampleMapCache=i.newCache("terrain-upsample",({tile:e})=>e.unloadMapData()),this._elevationQueryCache=new W(i.newCache("elevation-query"));const r=this.overlayManager;this.addHandles([f(()=>r.renderer.isEmpty,()=>this._evaluateTransparency()),f(()=>this.renderer.visible,e=>this.suspended=!e),f(()=>this.heading,e=>{this._renderer.updateHeading(e),this._updateTileTextures(0)},y)],"overlayManager"),this._updatingHandles.add(()=>({heading:e.camera?.heading,state:e.state?.mode}),({heading:e,state:t})=>{if(null==e)return;if(this.isGlobal&&this.isGeographic||this.isWebMercatorOnPlateCarree)return void(this.heading=90*Math.round(e/90)%360);const i=Math.round(e)%360,r=Math.abs(i-this.heading);(2===t||Math.min(r,360-r)>=30)&&(this.heading=i)},T),this.addHandles([f(()=>this.baseOpacity,()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?1:2)},y),f(()=>this.hasCompositeBlendMode,()=>this._updateTileTextures(this._evaluateTransparency()?1:2),y),f(()=>this.backgroundColor,(e,t)=>{e?.equals(t)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(e))},v),f(()=>this.snapLevel,()=>this._viewChanged=!0,v),f(()=>this.view.pointsOfInterest,e=>{this._renderer.pointsOfInterest=e,this._poiWatchHandle=h(this._poiWatchHandle),e&&(this._poiWatchHandle=this._updatingHandles.add(()=>e.focus?.renderLocation,()=>this._allTilesSorted=!1,{equals:b}))}),f(()=>Q.TERRAIN_TILE_TREE_SHOW_TILES,t=>{t&&!this._treeDebugger?import("../layers/support/TerrainTileTree3DDebugger.js").then(({TerrainTileTree3DDebugger:t})=>{!this._treeDebugger&&Q.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new t({view:e}))}):t||(this._treeDebugger=d(this._treeDebugger))},T)]);const{spatialReference:a}=e;this._extentHelper=ie(this.viewingMode,{layers:e.map.allLayers,layerViews:e.allLayerViews,viewSpatialReference:a});const n=new s({getCollections:()=>e.defaultsFromMap?.mapCollections?.map(({layers:e})=>e),getChildrenFunction:e=>e&&"layers"in e?e.layers:null}),l=new We({layers:n,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:a});this._set("tilingSchemeLogic",l),this._updateTilingScheme();const o=t.scheduler;this._frameTask=o.registerTask(Ke.TERRAIN_SURFACE,this),this.addHandles([f(()=>this._extentHelper.stencilEnabledExtents,e=>this._renderer.setStencilEnabledLayerExtents(e),T),f(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),v),f(()=>this.groundExtent,()=>this._updateRootTiles(),T),e.on("resize",()=>this._viewChangeUpdate()),f(()=>{const t=e.state;return[this._lodBias,this.lodSnappingEnabled,e.quality,t.camera,t.contentCamera,t.fixedContentCamera]},()=>this._viewChangeUpdate(),y),f(()=>e.qualitySettings?.fadeDuration,e=>this._renderer.textureFadingEnabled=e>0,T),f(()=>e.qualitySettings?.physicallyBasedRenderingEnabled,e=>this._renderer.pbrMode=e?5:0,T),f(()=>e.qualitySettings?.tiledSurface.elevationLevelDelta,()=>this._updateAllTileGeometries()),f(()=>this.userClippingExtent,()=>this._updateClippingExtent(),v)]),this.addHandles(e.allLayerViews.on("after-changes",()=>this._layerViewsDirty=!0)),this._layerViewsDirty=!0,this._handleLayerViewChanges(),this._renderer.updateTileBackground(this.backgroundColor)}clearHandles(){this._updatingHandles?.removeAll(),this.removeAllHandles(),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear()}destroy(){this._frameTask.remove(),this._frameTask=Xe,this._updatingHandles?.destroy(),this._removeAllTiles(),this._set("tilingSchemeLogic",d(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach((e,t)=>this._unregisterTiledLayerView(t)),this._basemapLayerViewHandles.clear(),this._set("overlayManager",d(this.overlayManager)),this._tileCache=d(this._tileCache),this._allTiles.prune(),Ie.prune(),this._treeDebugger=d(this._treeDebugger),this._renderer.destroyed||this._renderer.destroy(),this._renderer=null,this._iteratorPool=d(this._iteratorPool),this._upsampleMapCache=d(this._upsampleMapCache),this._elevationQueryCache=d(this._elevationQueryCache),this._set("view",null),this._extentHelper=d(this._extentHelper),this._upsampleInfoPool=d(this._upsampleInfoPool),Ae(),this._layerViews.forEach(e=>e.length=0),this._performanceInfo=null}get renderer(){return this._renderer}get frustum(){return this.view.state.camera.frustum}get snapLevel(){return this.lodSnappingEnabled?this.view.terrainLevel:null}get lodSnappingEnabled(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get hasStencilEnabledExtents(){return this._extentHelper.stencilEnabledExtents.length>0}get userClippingExtent(){const{spatialReference:e}=this,t=this.view?.clippingArea;if(null==t||null==e)return null;const i=V(),r=K(t,i,e)?i:null,s=this._get("userClippingExtent");return A(r,s)?s:r}get rootTilesExtent(){return this._rootTilesExtent}get groundExtent(){const e=k(this.fullGroundExtent,this.userClippingExtent,V()),t=this._get("groundExtent");return A(e,t)?t:e}get fullGroundExtent(){return null!=this._tilingSchemeExtent?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){return this.tilingSchemeLogic?.extent}get updating(){return this._hasPendingUpdates||(this._maxNumUpdating=1),this.enabled&&!!((this.readyToRun||this._updatingHandles?.updating||this._asyncWorkItems>0)&&this.ready&&!this.suspended||this.overlayManager?.updating||this.terrainTextureCompressionTracker.compressing)}get readyToRun(){return this.enabled&&(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._hasElevationSourceUpdates||this._layerViewsDirty||this._scaleRangeQueries?.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get _hasElevationSourceUpdates(){return this._allTiles.some(e=>e.needsElevationSourceUpdate())}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){return this.view?.map?.ground?.opacity??1}set baseOpacity(e){this.view.map.ground.opacity=e}get viewingMode(){return this.view.state.viewingMode}get ready(){return!this.enabled||null!=this._rootTiles}get rootTiles(){return this._rootTiles}get spatialReference(){return this.tilingScheme?.spatialReference??null}get backgroundColor(){return this.view?.map?.ground?.surfaceColor}set backgroundColor(e){this.view.map.ground.surfaceColor=e}set slicePlaneEnabled(e){this._renderer.slicePlaneEnabled=e,this._set("slicePlaneEnabled",e),this._evaluateTransparency()}get tilingSchemeLocked(){return this.tilingSchemeLogic?.tilingSchemeLocked??!1}get wireframe(){return this._renderer?.wireframe}set wireframe(e){e!==this._renderer.wireframe&&(this._renderer.wireframe=e,this._updateAllTileGeometries())}get opaque(){return 0===this._renderer.transparency}get invisible(){return 3===this._renderer.transparency}set suspended(e){this._set("suspended",e),this._viewChangeUpdate()}get fadeDuration(){return this.view.qualitySettings.fadeDuration??0}intersect(e,t,i,r){this._renderer.intersectRay(e,t,i,r)}getElevationLevelDelta(e){return e<4?3:this.view.qualitySettings.tiledSurface.elevationLevelDelta}get _xNormalizer(){return q(this._spatialReference)}getElevation(e,t,i,r){const s=this._rootTiles;if(!s?.length||!this.enabled)return null;if(0===s[0].layerInfo[0].length)return null;let a=this._elevationProjectorCache.get(r);if(void 0===a&&(a=D(r,this._spatialReference)??null,this._elevationProjectorCache.set(r,a)),null==a)return l.getLogger(this).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null;const n=E(st,e,t,i);a(n,0,n,0);return ht(s,this._xNormalizer?.normalize(n[0])??n[0],n[1])}getElevations(e,t,i){const r=this._rootTiles,s=r?r[0].layerInfo[0].length:0;if(r?.length&&0!==s&&this.enabled)for(let a=0;a<t;++a){const t=3*a;i(a,ht(r,e[t],e[t+1]))}else for(let a=0;a<t;++a)i(a,null)}getLayerIndexByUID(e,t){return this._layerIndexByUid[e].get(t)}getScale(e){if(!this.tilingScheme)return null;if(!j(e,st,this.spatialReference))return l.getLogger(this).error("TerrainSurface.getScale(): could not project given point to tiling scheme coordinate system"),null;const t=this._rootTiles;if(null!=t)for(const i of t)if(i?.containsPoint(st)){let e=i;for(;e.children[0]&&!e.rendered;){const t=e.children[0].extent;let i=0;st[0]>t[2]&&(i+=1),st[1]<t[1]&&(i+=2),e=e.children[i]}return this._getLodBiasCorrectedScale(e.level)}return 1/0}_ensureProjector(e){const t=this._projectorCache.get(e);if(t)return t;const i=D(e,this._tilingSchemeSpatialReference)??null;return this._projectorCache.set(e,i),i}getSphereElevationRange(e,t){if(!this.enabled||null==this._rootTiles)return null;const i=this._ensureProjector(t);if(null==i)return l.getLogger(this).error("TerrainSurface.getSphereElevationRange(): could not project given point to tiling scheme coordinate system"),null;at.copyFrom(e),i(at.center,0,at.center,0);const r=new z,s=this._rootTiles;if(null!=s){const e=[];for(const i of s)e.push(i);let t=0;for(;t<e.length;){const i=e[t];if(++t,!B(i.extent,at))continue;const s=i.children;if(null==s[0]||i.rendered)r.expandElevationRangeValues(i.elevationBoundsMin,i.elevationBoundsMax);else for(const t of s)e.push(t)}}return r}getRootElevationRange(){return this.enabled&&null!=this._rootTiles?new z(this._rootTileElevationRange.minElevation,this._rootTileElevationRange.maxElevation):null}getLowerBoundRadius(){const e=(this._ellipsoid.radius+this.visibleElevationRange.minElevation)*R;return Math.min(e,this._ellipsoid.radius)}getSphereScale(e,t){if(!this.tilingScheme)return null;if(!j(e,at.center,this.spatialReference))return l.getLogger(this).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;at.radius=t;let i=null;const r=e=>{if(e&&B(e.extent,at)){const t=e.children;if(t[0]&&!e.rendered)for(const e of t)r(e);else{const t=this._getLodBiasCorrectedScale(e.level);i=null==i?t:Math.min(i,t)}}},s=this._rootTiles;if(null!=s)for(const a of s)r(a);return i}queryVisibleScaleRange(e,t,i,r){if(!this._scaleRangeQueries)return;const s=t?this.tilingScheme.levelAtScale(t):0,a=i?this.tilingScheme.levelAtScale(i):1/0,n=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(e,s+n,a+n,r)}_evaluateTransparency(){const e=this.baseOpacity,t=this.overlayManager.renderer.isEmpty,i=this._renderer.transparency,r=this._isFullyTransparent?He(0,t):e>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?0:1;return this._renderer.transparency=r,i!==r&&(this.notifyChange("opaque"),this.notifyChange("invisible"),!0)}_updateTilingScheme(){const{tilingScheme:e}=this.tilingSchemeLogic;if(!(e!==this.tilingScheme))return;fe(!!e,"tiling scheme cannot be reset to undefined"),this._isGlobal=!this.view?.state?.isLocal,this.tilingScheme&&this._removeAllTiles();const t=e?.spatialReference??M.WebMercator;this._spatialReference=t,this._isWebMercator=!!t?.isWebMercator,this._isWebMercatorOnPlateCarree=this._isWebMercator&&N(this.view?.renderSpatialReference),this._isGeographic=t?.isGeographic??!1,this._set("tilingScheme",e),this._tilingSchemeSpatialReference=this.tilingScheme?.spatialReference,this._projectorCache.clear(),this._updateClippingExtent(),e&&(this._updateTiledLayers(),this._renderer.tileSize=e.pixelSize,this.overlayManager.spatialReference=e.spatialReference,this._updateRootTiles())}static{this._tileMemcacheKey="TerrainTileMemcache"}_acquireTile(e,t,i,r){const s=this._tileCache.pop(tt._tileMemcacheKey);return s?(s.init(e,t,i,r,this),s):new this._tileConstructor(e,t,i,r,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const{groundExtent:e,tilingScheme:t}=this;if(!t)return;if(!this.enabled)return void this._setRootTiles(null);const i=nt;let s=t.rootTilesInExtent(e,i,5*de);if(null!=this._rootTiles){if(s.length>de)return void l.getLogger(this).warn(pe);const e=this._rootTiles.map(e=>e.lij),t=r(e,s,Ve);if(this._updatingRootTiles=!0,t.removed.length>0||t.added.length>0){const e=this._rootTiles.filter(e=>!(t.removed.findIndex(t=>Ve(t,e.lij))>-1)||(this._purgeTile(e),!1));t.added.forEach(t=>e.push(this._newRootTile(t))),this._setRootTiles(e)}}else this._updatingRootTiles=!0,s.length>de&&(l.getLogger(this).warn(ue),s=t.rootTilesInExtent(e,i,de)),this._setRootTiles(s.map(e=>this._newRootTile(e)));A(i,this._rootTilesExtent)||(this._rootTilesExtent=V(i)),this.renderer.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready"),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness()}_updateAllTileGeometries(){const e=this._allTiles.filter(e=>this._canUpdateTileGeometry(e));0!==e.length?(e.sort(Oe),e.forEach(e=>this._renderer.updateTileGeometryState(e)),e.forEach(e=>e.renderData.updateNeighborData()),this._updateTilesGeometries(e),this._pendingTilesToUpdate.clear()):this._pendingTilesToUpdate.clear()}_updateTilesGeometries(e){const t=e.filter(e=>this._canUpdateTileGeometry(e));if(0===t.length)return;const i=this.renderer;for(const r of t)i.updateGeometryIfNeeded(r);for(const r of t)this._pendingTilesForElevationUpdateEvent.add(r)}_canUpdateTileGeometry(e){return e.loaded&&e.intersectsClippingArea&&e.hasGeometryState}_shouldSplit(e){return 1===e.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)}_newRootTile(e){const t=this._acquireTile(0,e[1],e[2],null);return this._shouldSplit(t)&&t.setPendingUpdate(1),this._loadTile(t),this._markTileToUpdate(t),this._updateRootTileElevationRange(),t}_setRootTiles(e){if(this._rootTiles=e,this._allTiles.clear(),null!=e){const t=this._iteratorPool.acquire();for(t.reset(e);!t.done;)this._allTiles.push(t.next());t.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(e),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles})}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this.renderer.visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(e){e.updateClippingStatus(this.groundExtent)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e)}_updateTilesVisibility(e){if(null==e)return;const t=qe(e),i=this.visibleElevationRange;let r=t?i.minElevation:1/0,s=t?i.maxElevation:-1/0;const a=this.groundExtent,n=this.view.state.contentCamera.viewProjectionMatrix;this.setTileTreeDirty(!1);const l=this._iteratorPool.acquire();for(l.reset(e);!l.done;){const e=l.next();e.updateClippingStatus(a)&&e.resetPendingUpdate(8)&&this._updateTileGeometryState(e),e.computeVisibility(),e.updateScreenDepth(n),e.renderData&&(r=Math.min(e.elevationBoundsMin,r),s=Math.max(e.elevationBoundsMax,s))}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._updatePendingTileGeometries(),isFinite(r)&&isFinite(s)&&(i.minElevation!==r||i.maxElevation!==s)&&(this.visibleElevationRange=new Z(r,s))}_updateRootTileElevationRange(){let e=1/0,t=-1/0;const i=this._rootTiles;null!=i&&i.forEach(({elevationBoundsMin:i,elevationBoundsMax:r})=>{e=Math.min(e,i),t=Math.max(t,r)});const r=this._rootTileElevationRange;r.minElevation===e&&r.maxElevation===t||(this._rootTileElevationRange=new Z(e,t))}_updateViewDependentParameters(){const{camera:e,contentCamera:t}=this.view.state,i=Math.tan(.5*t.fovX),r=Math.tan(.5*t.fovY),s=this.tilingScheme.pixelSize,a=2**-this._lodBias*e.pixelRatio;this._splitLimits.aboveGround=e.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=s/e.width*this.maxTextureScale*a,this._splitLimits.relativeHeightLimit=s/e.height*this.maxTextureScale*a,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?this._splitLimits.frustum=G(this._splitLimits.frustum??O(),t.frustum):this._splitLimits.frustum=null,x(this._eyePosRenderSR,t.eye),I(e.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateTileGeometryState(e){e.updateVisibility();const t=this._renderer.updateTileGeometryState(e);e.needsElevationSourceUpdate()&&(e.updateAgents(0),e.markElevationSourceUpdateRequested(),this.requestUpdate()),t&&this._markTileToUpdate(e),this.setMemoryDirty()}_markAllTileNeighborsForUpdate(e){e.forEachLoadedNeighbor(e=>{this._layerViews[1].some(ye)&&e.setPendingUpdate(32),this._pendingTilesToUpdate.add(e)})}_updateTileTexture(e,t){const i=e.resetPendingUpdate(32)?32:!!e.resetPendingUpdate(16)&&16;i&&(this._renderer.updateTileTexture(e,i),this._usedMemory=null,t.madeProgress())}_emitElevationUpdateEventForTiles(){if(!this._shouldEmitChangeEvent)return;const e=this._pendingTilesForElevationUpdateEvent;if(e.size>0){const t=new Float64Array(4*e.size);let i=0;for(const r of e)t.set(r.extent,4*i),++i;e.clear();for(const e of X(t,this.spatialReference)){const t=new Y(this.spatialReference,e,"ground");this.emit("elevation-change",t)}}this._shouldEmitChangeEvent=!1}runTask(e){this._handleLayerViewChanges(e),this._frameTask.processQueue(e),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,e),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(e),this._sortTiles(e);const t=!this.view.state.fixedContentCamera;this._mergeAndSplit(e,t),this._updateElevation(e),this._updateElevationSources(e),this._updateTextures(e),t||this._mergeAndSplit(e,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty();const i=this._pendingTilesToUpdate.size>0,r=i&&this._hasPendingGeometryWithoutIndices();if(e.done&&!r||this._updatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),e.done&&(e.hasProgressed||i&&!r)&&this.requestUpdate(),this.notifyChange("updatingProgressValue"),Le&&this._checkTileInvariant(),!e.hasProgressed)return et}_checkTileInvariant(){const e=new Map;this._allTiles.forAll(t=>e.set(t,new Set)),this._allTiles.forAll(t=>{if(fe(t.rendered===t.leaf,` rendered ${t.rendered} != ${t.leaf} leaf`),!t.leaf){const e=e=>0===e.unmergableChildCount&&0===e.maxLevelDeltaNeighborCount,i=t.children.reduce((t,i)=>t+(e(i)?0:1),0);if(fe(t.unmergableChildCount===i,` Tile[${t.lij.toString()}] unmergeable child count mismatch: actual ${t.unmergableChildCount} vs ${i}`),t.hasPendingUpdate(4)){fe(!t.hasPendingUpdate(1),"Tile can be both split and merge at the same time");for(const e of t.children)fe(e.leaf||e.hasPendingUpdate(4),"Child of tile to merge must also merge")}}for(let i=0;i<4;++i){if(t.rendered){const e=t.renderData?.geometryState.edgePeerNeighbors[i];if(null!=e){{const r=t.level-e.level<=ce;r||(console.log(`tile level delta [${t.lij.toString()}] vs [${e.lij.toString()}] > ${ce} (edge[${i}])`),fe(r,`tile level delta [${t.level}] vs [${e.level}] > ${ce}`))}fe(t.level-e.level<=ce,`Max tile lod delta exceeded: [${t.lij.toString()}] vs [${e.lij.toString()}]`)}}const r=t.level-ce,s=e=>e.leaf||e.level===t.level,a=t.findNeighborTile(Te[i],s);if(null!=a){if(t.leaf&&t.level>=ce){let i=a;for(;t.level-i.level<ce;)i=i.parent;const s=[r,t.lij[1]>>ce,t.lij[2]>>ce];if(!Ve(s,i.lij)){const r=e.get(i);fe(!r.has(t),"Cannot already have neighbor"),r.add(t)}}fe(a.rendered||a.level===t.level,"Non-same-level-neighbor of rendered must be rendered"),fe(t.level-a.level<=ce,`Tile level delta [${t.level}] vs [${a.level}] > ${ce}`)}}}),this._allTiles.forAll(t=>{const i=t.maxLevelDeltaNeighborCount,r=e.get(t);fe(i===r.size,`Tile[${t.lij.toString()}] merge-blocker mismatch: actual ${i} vs ${r.size}`)})}_updateAllTilesStatus(e){if(!this._viewChanged||!this._rootTiles||e.done)return;this._viewChanged=!1;let t=!1;const i=new ne(this._allTiles.length);i.pushAll(this._rootTiles);const r=this.snapLevel,s=this._splitLimits,a=this._eyePosRenderSR;this._allTiles.forAll(e=>{e.maxLevelDeltaNeighborCount=0,e.unmergableChildCount=0});const n=this.view.state.contentCamera.viewProjectionMatrix;for(;!i.empty;){const e=i.pop(),l=e.parent,o=l?.hasPendingUpdate(4),h=o?4:e.shouldSplit(s,a,r),d=1===h;e.leaf?dt(e,d):i.pushAll(e.children),o?(e.resetPendingUpdate(1),e.leaf||(e.setPendingUpdate(4),t=!0),this._updateClippingStatus(e),e.updateVisibility(),e.updateScreenDepth(n)):d?(e.resetPendingUpdate(4),e.leaf&&(e.setPendingUpdate(1),t=!0)):(e.resetPendingUpdate(1)&&e.updateAgentSuspension(),2===h&&e.updateAgents(0),e.leaf||(e.setPendingUpdate(4),e.resetPendingUpdate(1),t=!0))}this._allTilesDirty=t,this.requestUpdate(),(this._shortBatches||!this._oneBatchPerFrameTask)&&this._updatePendingTileGeometries(),e.madeProgress()}_sortTiles(e){e.done||this._allTilesSorted||!this.view.pointsOfInterest?.focus||(Ne(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger?.update(),e.madeProgress())}_markTileToUpdate(e){ve(e.loaded),e.intersectsClippingArea&&(this._pendingTilesToUpdate.add(e),this._markAllTileNeighborsForUpdate(e))}_hasPendingGeometryWithoutIndices(){for(const e of this._pendingTilesToUpdate)if(e.loaded&&e.intersectsClippingArea&&null==e.renderData?.vao?.indexBuffer)return!0;return!1}_updatePendingTileGeometries(){const e=this._pendingTilesToUpdate,t=[];if(e.forEach(e=>{this._canUpdateTileGeometry(e)&&t.push(e)}),0===t.length)return void e.clear();const i=(i,r)=>{!r||!this._canUpdateTileGeometry(r)||r.level<i.level||e.has(r)||(e.add(r),t.push(r),r.renderData.updateNeighborData())};t.sort(Oe);const r=t.length;for(let s=0;s<r;++s){const r=t[s];ve(r.loaded),ve(r.intersectsClippingArea);const a=r.renderData;if(!a?.geometryState)continue;a.updateNeighborData();const n=a.dirtyEdgeResolutions,l=a.geometryState,o=e=>{const t=je[e];i(r,l.cornerPeerNeighbors[e]?.findCorner(Pe(t),e=>e.loaded))};for(let t=0;t<4;++t)if(n&1<<t){const s=a.geometryState.edgePeerNeighbors[t];s&&s?.level>=r.level&&s.forAllSubtreeOnSide(we(Te[t]),t=>!!this._canUpdateTileGeometry(t)&&(ve(e.has(t)||Oe(r,t)<0),i(r,t),!0)),o((t+1)%4),o(t)}}e.clear(),this._updateTilesGeometries(t),this._shouldEmitChangeEvent=!0,Le&&Re&&this.checkAllTilesWaterproofness()}_mergeAndSplit(e,t){if(this.suspended||e.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=!1;const r=this.view.state.fixedContentCamera;let s=!1;for(;!e.done;){s=!0;let a=!1;const n=!this._allTiles.some(s=>{if(!i&&!r&&!s.visible)return e.done;let n=s;if(s.hasPendingUpdate(4)){if(!t||s.unmergableChildCount>0)return e.done;for(s.resetPendingUpdate(4);null!=n.parent&&0===n.parent.unmergableChildCount&&n.parent.resetPendingUpdate(4);)n=n.parent;this._mergeTile(n),a=!0,e.madeProgress()}else if(s.resetPendingUpdate(1)){let t=!0;const i=s.level;if(i>=ce){const e=e=>e.leaf||i-e.level<ce;for(let r=0;r<4;++r){const a=s.findNeighborTile(Te[r],e);null!=a&&i-a.level===ce&&(t=!1,Le&&(ve(a.leaf),ve(a.hasPendingUpdate(1))))}}t?(this._splitTile(s),e.madeProgress(),a=!0):s.setPendingUpdate(1)}return e.done});if(a&&(this._allTilesSorted=!1,this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries()),n){if(!i){i=!0;continue}if(!a)break}else this._allTilesDirty=!0}s?e.madeProgress():this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries(),this._allTilesCreated=!this.allTiles.some(e=>e.hasPendingUpdate(1)||e.hasPendingUpdate(4)&&0===e.unmergableChildCount),this._sortTiles(e)}_updateElevation(e){e.done||(this._allTiles.some(t=>(t.resetPendingUpdate(8)&&(this._updateTileGeometryState(t),e.madeProgress()),e.done)),!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries())}_updateElevationSources(e){e.done||this._allTiles.some(t=>(t.needsElevationSourceUpdate()&&(t.updateAgents(0),t.markElevationSourceUpdateRequested(),e.madeProgress()),e.done))}_updateTextures(e){e.done||this._allTiles.some(t=>(this._updateTileTexture(t,e),e.done))}_updateClippingExtent(){this.spatialReference&&(this.updateOverlayParameters(),this.requestRender(1),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){return this.view.qualitySettings.tiledSurface.lodBias-(1-this.view.quality)*ge}_getLodBiasCorrectedScale(e){const t=this.tilingScheme.levels,i=o(e-this._lodBias,0,t.length-1),r=i-Math.floor(i);return t[Math.floor(i)].scale*(1-r)+t[Math.ceil(i)].scale*r}_removeAllTiles(){this._pendingTilesToUpdate.clear(),this._pendingTilesForElevationUpdateEvent.clear(),null!=this._rootTiles&&(this._rootTiles.forEach(e=>this._purgeTile(e)),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles}),this.renderer.visible=!1}_purgeSubtree(e){const t=e.children;t[0]&&(this._purgeTile(t[0]),this._purgeTile(t[1]),this._purgeTile(t[2]),this._purgeTile(t[3]),e.clearChildren())}_purgeTile(e){e.leaf?ut(e):this._purgeSubtree(e),this._allTiles.removeUnordered(e),this._unloadTile(e),e.dispose(),this._tileCache.put(tt._tileMemcacheKey,e),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles})}_unloadTile(e){this._pendingTilesToUpdate.delete(e),this._pendingTilesForElevationUpdateEvent.delete(e),e.unload()}_splitTile(e){fe(e.leaf,"Tile that is already split should not be split again!"),fe(e.rendered,"Tile marked to split is not rendered"),ut(e);const t=e.createChildren();this._allTiles.pushArray(t),this.notifyChange("demResolution"),this.emit("tiles-changed",{allTiles:this.allTiles}),e.updateAgentSuspension(),fe(e.rendered,"parent should be rendered"),t.forEach(e=>this._loadTile(e)),t.forEach(e=>this._pendingTilesToUpdate.add(e)),this._unloadTile(e),this._markAllTileNeighborsForUpdate(e),this._emitTileScaleChange(e,e.level+1),this._allTilesDirty=!0,this._shortBatches&&this._updatePendingTileGeometries(),t.forEach(e=>dt(e,e.hasPendingUpdate(1))),++this._performanceInfo.numSplit}_emitTileScaleChange(e,t=e.level){ot.spatialReference=this.spatialReference,ot.extent=e.extent,ot.scale=this._getLodBiasCorrectedScale(t),this.emit("scale-change",ot)}createTile(e,t,i,r){fe(!!r,"createTile sanity check");const s=this._acquireTile(e,t,i,r);return s.updateClippingStatus(this.groundExtent),s.updateScreenDepth(this.view.state.contentCamera.viewProjectionMatrix),this._shouldSplit(s)&&s.setPendingUpdate(1),s}get _shortBatches(){return 2!==this.view.state.mode}_mergeTile(e){fe(!e.hasPendingUpdate(1),"_mergeTile sanity check"),fe(!e.leaf,"Cannot merge a leaf"),e.leaf||(this._purgeSubtree(e),fe(!e.renderData,"Merging tile with existing render data?"),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e),this._shortBatches&&this._updatePendingTileGeometries(),dt(e,!1),this._allTilesDirty=!0,++this._performanceInfo.numMerged)}_loadTile(e){e.load(),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager?.hasOverlays&&e.updateOverlayParameters(this.overlayManager)}_handleLayerViewChanges(e=Je){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let t=!1;const i=new Set;let r=-1;for(let s=this.view.allLayerViews.length-1;s>=0;s--){const e=this.view.allLayerViews.items[s];if(i.add(e.uid),Se(e)||Ce(e))if(this._basemapLayerViewHandles.has(e.uid)&&!Ce(e)){const i=this._layerClassFromLayerView(e),s=this.getLayerIndexByUID(i,e.uid);null!=s&&((s<r||null==r)&&(t=!0),r=s)}else this._registerTiledLayerView(e),e.layer.loaded&&(t=!0)}this._basemapLayerViewHandles.forEach((e,r)=>{i.has(r)||(this._unregisterTiledLayerView(r),t=!0)}),t&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),e.madeProgress()}get _isFullyTransparent(){if(this.view.map?.ground?.opacity>0)return!1;for(const e of this.view.allLayerViews.items)if(be(e)&&!H(e.layer)&&0!==e.fullOpacity)return!1;return!0}_hasCompositeBlendMode(){for(const e of this.view.allLayerViews.items)if((Ee(e)||Ce(e))&&Qe(ze[e.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(e){return xe(e)?0:1}_registerTiledLayerView(e){const t=[];if((Ee(e)||Ce(e))&&t.push(f(()=>e.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(2)})),!Ce(e)){const i=this._layerClassFromLayerView(e);t.push(f(()=>!e.destroyed&&e.suspended,()=>this._updateTiledLayers())),t.push(f(()=>!e.destroyed&&e.fullOpacity,()=>this._updateTileTextures(2)));const{layer:r}=e;"effectiveScaleRange"in r&&t.push(f(()=>!e.destroyed&&r.effectiveScaleRange,()=>this._restartAllAgents(i))),t.push(e.on("data-changed",()=>{const t=this.getLayerIndexByUID(i,e.uid);null!=t&&this._invalidateLayerData(t,i)}))}this._unregisterTiledLayerView(e.uid),this._basemapLayerViewHandles.set(e.uid,t)}_unregisterTiledLayerView(e){const t=this._basemapLayerViewHandles.get(e);if(t){for(const e of t)e.remove();this._basemapLayerViewHandles.delete(e)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const e=this.view.allLayerViews,t=[[],[]];let i=null;e.forEach(e=>{if(!e.layer||e.suspended||!Se(e)||!e.fullExtent)return;const r=this._layerClassFromLayerView(e);if(1===r){const t=e.displayLevelRange.maxLevel;t!==1/0&&(null===i||t>i)&&(i=t)}t[r].push(e)});for(const r of re){const e=this._layerViews[r],i=t[r];i.reverse();const s=i.length;let a=e.length!==s;const n=new Array(s),l=new Array(e.length);this._layerIndexByUid[r].clear();for(let t=0;t<s;t++){const s=i[t].uid;this._layerIndexByUid[r].set(s,t);const o=e.indexOf(i[t]);n[t]=o,t!==o&&(a=!0),o>-1&&(l[o]=t)}if(a){const e=this._postorderIterator;for(e.reset(this._rootTiles);!e.done;)e.next().modifyLayers(l,n,r);this._layerViews[r]=i,this._restartAllAgents(r),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&(this._viewChangeUpdate(),this.notifyChange("tilingScheme"))}_restartAllAgents(e){const t=this._postorderIterator;for(t.reset(this._rootTiles);!t.done;){const i=t.next();i.restartAgents(e),0===e&&i.computeElevationBounds()}this._updateRootTileElevationRange()}layerViewByIndex(e,t){return this._layerViews[t][e]}numLayers(e){return this._layerViews[e].length}_updateTileTextures(e){this._allTiles.forAll(t=>{t.updateAgents(1),1===e?this.renderer.updateTileTexture(t,16):t.updateRenderData(1,e)}),this._evaluateTransparency()}_invalidateLayerData(e,t){null!=this._rootTiles&&(Fe(this._rootTiles,i=>i.removeLayerAgent(e,t)),Fe(this._rootTiles,i=>{i.invalidateLayerData(e,t),i.restartAgents(t)}))}setTileTreeDirty(e){this._allTilesDirty=!0,e&&(this._allTilesCreated=!1)}requestRender(e=1){this.renderer.setNeedsRender(e)}requestUpdate(){1===++this._pendingUpdates&&(this._hasPendingUpdates=!0)}requestTileData(e,t,i,r){const s=this.layerViewByIndex(t,i),a=s.layer;return!a.tilemapCache||ye(s)?this._requestTileData(e,i,s,r):(++this._asyncWorkItems,a.tilemapCache.fetchAvailability(e.level,e.lij[1],e.lij[2],{...r,timeout:6e3}).catch(t=>{throw g(r),m(t)||this._dataMissing(e,i,s),t}).then(()=>this._frameTask.schedule(()=>this._requestTileData(e,i,s,r),r.signal)).finally(()=>--this._asyncWorkItems))}_requestTileData(e,t,i,r){if(this.destroying)return Promise.resolve();return 0===t?xe(i)?this._requestElevationTileData(e,i,r):Promise.reject():be(i)?this._requestMapTileData(e,i,r):Promise.reject()}_requestElevationTileData(e,t,i){++this._asyncWorkItems;const r=r=>{!_(i)&&r&&(this.setMemoryDirty(),this.requestUpdate(),this._elevationDataArrived(e,t,r))},s=i=>{m(i)||(l.getLogger(this).error(`Tile ${e.lij.toString()} layer 0/${t.uid} error ${i}`),this._dataMissing(e,0,t),this.requestUpdate())};return t.fetchElevationTile(e,{...$,...i}).then(e=>this._frameTask.schedule(()=>r(e)),s).finally(()=>--this._asyncWorkItems)}_elevationDataArrived(e,t,i){const r=this._layerIndexByUid[0].get(t.uid);if(null==r)return void l.getLogger(this).warn("TerrainSurface: received data from unknown layer %d %s",0,e.lij.toString());const s=new ee(e.lij,e.extent,i);e.dataArrived(r,0,s),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:0});const a=[e],n=e.level,o=this._iteratorPool.acquire();for(o.reset(a);!o.done;){const e=o.next();e.findElevationBoundsForLayer(r,n),e.computeElevationBounds()}0===n&&this._updateRootTileElevationRange(),o.remove(),this._updateTilesVisibility(a)}_requestMapTileData(e,t,i){++this._asyncWorkItems;const r=(r,s)=>{Ue(s),_(i)||(console.error(`Tile ${e.lij.toString()} layer 1/${t.uid} error ${r}`),this._dataMissing(e,1,t),this.requestUpdate())},s=e=>t=>r(t,e),a=r=>this._frameTask.schedule(()=>{this.requestUpdate(),_(i)?Ue(r):this._mapTileDataArrived(e,t,r)},i.signal,s(r)).catch(s(r)),n=(e,t=null)=>this._frameTask.schedule(()=>r(e,t));return t.fetchTile(e.lij,i).then(a,n).finally(()=>--this._asyncWorkItems)}_mapTileDataArrived(e,t,i){const r=this.getLayerIndexByUID(1,t.uid);if(null==r)return Ue(i),void l.getLogger(this).warn("TerrainSurface: received data from unknown layer");e.dataArrived(r,1,i),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:1})}_dataMissing(e,t,i){const r=this.getLayerIndexByUID(t,i.uid);null!=r?(e.dataMissing(r,t),this.emit("tile-data-changed",{tile:e,layerIndex:r,layerClass:t})):l.getLogger(this).warn("TerrainSurface: received data from unknown layer")}get performanceInfo(){const e=this._performanceInfo;return e.numNodes=this._allTiles.length,e.numLeaves=e.numVisible=e.numRendered=e.numLoadedPerLevel.length=e.numRenderedPerLevel.length=0,this._allTiles.forAll(t=>{t.leaf&&e.numLeaves++;const i=t.level;t.renderData&&(e.numLoadedPerLevel[i]=(e.numLoadedPerLevel[i]||0)+1),t.visible&&(e.numVisible++,t.rendered&&(e.numRenderedPerLevel[i]=(e.numRenderedPerLevel[i]||0)+1,e.numRendered++))}),e}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this.tilingScheme?(null==this._usedMemory&&(this._usedMemory=this._recalculateUsedMemory()),this._usedMemory??0):0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((e,t)=>e+t.usedMemory,0)):null}getUsedMemoryForLayerView(e){let t=0;const i=this._layerClassFromLayerView(e),r=this.getLayerIndexByUID(i,e.uid);return null!=r&&this._allTiles.forAll(e=>t+=e.getUsedMemoryForLayer(i,r)),t}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(e){this._renderer.renderPatchBorders=e}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(e){this._renderer.renderingDisabled=e}get test(){}checkAllTilesWaterproofness(){if(!Re)return;const e=this._rootTiles;if(null==e)return;const t=e=>e?.renderData?.geometry?.indices?.length>0,i=(e,i)=>{t(e)&&console.error("Tile[",e.lij,"] has geometry although parent[",i.lij,"] has geom")},r=e=>{if(e.intersectsClippingArea)if(e.renderData&&!e.renderData.geometryState&&console.error("Tile[",e.lij,"] has renderData but not geometryState"),e.renderData&&!e.renderData.geometry&&console.error("Tile[",e.lij,"] has renderData but not geometryInfo"),!e.renderData?.geometry||(e.renderData.geometry.indices?.length??0)>0||console.error("Tile[",e.lij,"] has renderData but no indices - geometryInfo: ",e.renderData.geometry),t(e)){e.checkGeometryWaterproofness();for(const t of e.children)i(t,e)}else if(e.leaf)console.error("Tile[",e.lij,"] has no geometry and no children, from root to leaf");else for(const t of e.children)r(t)},s=e=>{const t=e.parent?.visible??!0,i=e.visible;e.computeVisibility();const r=e.visible;if(i!==r&&t&&console.error(" Tile[",e.lij,"] has out of date visibility: ",i," instead of ",r),!e.leaf)for(const a of e.children)s(a)};for(const a of e)r(a),s(a)}get isGlobal(){return this._isGlobal}get isGeographic(){return this._isGeographic}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateCarree(){return this._isWebMercatorOnPlateCarree}isEastEndWrap(e){return this._isGlobal&&e[2]===this.lijEastEnd(e[0])-1}isWestEndWrap(e){return this._isGlobal&&0===e[2]}lijEastEnd(e){return 1<<e+(this._isGeographic?1:0)}wrapEastWest(e){const t=this.lijEastEnd(e[0]),i=e[2];if(0<=i&&i<t)return e;if(!this._isGlobal)return null;const r=(i+(i<0?t:0))%t;return[e[0],e[1],r]}enableInternalChecks(e){Me(e)}enableWaterproofnessChecks(e){De(e)}static cleanupTerrainSurface(){lt.prune()}enable(e){e!==this.enabled&&(this._set("enabled",e),e?(this._updateRootTiles(),this.suspended=!1,this.view.elevationProvider.register(0,this)):(this.view.elevationProvider.unregister(this),this.suspended=!0,this._removeAllTiles(),this._setRootTiles(null)),this.notifyChange("ready"))}updateOverlayParameters(){const{overlayManager:e}=this;this.allTiles.forAll(t=>t.updateOverlayParameters(e))}};e([S()],it.prototype,"_renderer",void 0),e([S({constructOnly:!0})],it.prototype,"_scaleRangeQueries",void 0),e([S({constructOnly:!0})],it.prototype,"view",void 0),e([S({constructOnly:!0})],it.prototype,"overlayManager",void 0),e([S({constructOnly:!0})],it.prototype,"terrainTextureCompressionTracker",void 0),e([S()],it.prototype,"_hasPendingUpdates",void 0),e([S()],it.prototype,"_asyncWorkItems",void 0),e([S()],it.prototype,"_allTilesDirty",void 0),e([S()],it.prototype,"_allTilesSorted",void 0),e([S()],it.prototype,"allTilesCreated",null),e([S()],it.prototype,"_allTilesCreated",void 0),e([S()],it.prototype,"_viewChanged",void 0),e([S({type:Number})],it.prototype,"heading",void 0),e([S()],it.prototype,"_splitLimits",void 0),e([S()],it.prototype,"_frameTask",void 0),e([S()],it.prototype,"demResolution",null),e([S({readOnly:!0})],it.prototype,"snapLevel",null),e([S({readOnly:!0})],it.prototype,"lodSnappingEnabled",null),e([S({readOnly:!0})],it.prototype,"userClippingExtent",null),e([S()],it.prototype,"_rootTilesExtent",void 0),e([S({readOnly:!0})],it.prototype,"groundExtent",null),e([S({readOnly:!0})],it.prototype,"fullGroundExtent",null),e([S({readOnly:!0})],it.prototype,"_tilingSchemeExtent",null),e([S({readOnly:!0})],it.prototype,"updating",null),e([S({readOnly:!0})],it.prototype,"readyToRun",null),e([S(J)],it.prototype,"updatingProgress",void 0),e([S({readOnly:!0})],it.prototype,"updatingProgressValue",null),e([S()],it.prototype,"_maxNumUpdating",void 0),e([S()],it.prototype,"baseOpacity",null),e([S()],it.prototype,"hasCompositeBlendMode",void 0),e([S({readOnly:!0})],it.prototype,"viewingMode",null),e([S()],it.prototype,"maxTextureScale",void 0),e([S({readOnly:!0})],it.prototype,"ready",null),e([S({readOnly:!0})],it.prototype,"rootTiles",null),e([S()],it.prototype,"_rootTiles",void 0),e([S({readOnly:!0})],it.prototype,"spatialReference",null),e([S({type:t})],it.prototype,"backgroundColor",null),e([S({value:!1})],it.prototype,"slicePlaneEnabled",null),e([S({readOnly:!0})],it.prototype,"tilingScheme",void 0),e([S({readOnly:!0})],it.prototype,"tilingSchemeLocked",null),e([S({readOnly:!0})],it.prototype,"tilingSchemeLogic",void 0),e([S()],it.prototype,"wireframe",null),e([S()],it.prototype,"opaque",null),e([S()],it.prototype,"invisible",null),e([S({value:!1})],it.prototype,"suspended",null),e([S()],it.prototype,"fadeDuration",null),e([S()],it.prototype,"_xNormalizer",null),e([S()],it.prototype,"visibleElevationRange",void 0),e([S()],it.prototype,"_rootTileElevationRange",void 0),e([S()],it.prototype,"_layerViewsDirty",void 0),e([S()],it.prototype,"renderPatchBorders",null),e([S()],it.prototype,"renderingDisabled",null),e([S({readOnly:!0})],it.prototype,"enabled",void 0),it=tt=e([C("esri.views.3d.terrain.TerrainSurface")],it);const rt=it,st=U(),at=new F,nt=V(),lt=new c,ot={spatialReference:null,extent:null,scale:0};function ht(e,t,i){for(const r of e){if(!r.containsPointXY(t,i))continue;let e=r;for(;e&&!e.renderData;){const r=(t>e.extentMidX?1:0)+(i<e.extentMidY?2:0);e=e.children[r]}const s=e?.renderData?.geometryState.samplerData??null;return te(t,i,s)}return null}function dt(e,t){!e.leaf||e.level<ce||gt(e,e=>{t&&pt(e);const i=ct(e);if(e.maxLevelDeltaNeighborCount++,i){let t=e.parent;for(;t;){const e=ct(t);if(t.unmergableChildCount++,!e)break;t=t.parent}}})}function pt(e){if(e.hasPendingUpdate(1))return;let t=e.parent;for(;t?.resetPendingUpdate(4);)t=t.parent;e.resetPendingUpdate(4),e.leaf&&e.setPendingUpdate(1),e.level<ce||gt(e,e=>{pt(e)})}function ut(e){e.level<ce||gt(e,e=>{if(e.maxLevelDeltaNeighborCount--,0===e.maxLevelDeltaNeighborCount&&0===e.unmergableChildCount){let t=e.parent;for(;t&&(t.unmergableChildCount--,ct(t));)t=t.parent}})}function ct(e){return 0===e.maxLevelDeltaNeighborCount&&0===e.unmergableChildCount}function gt(e,t){if(e.level<ce)return;const i=e.level-ce,r=e.lij[1]>>ce,s=e.lij[2]>>ce,a=e=>e.leaf||e.level===i;for(let n=0;n<4;++n){const l=e.findNeighborTile(Te[n],a);if(!l||l.level!==i)continue;const o=l.lij;o[1]===r&&o[2]===s||t(l)}}export{rt as default};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ function n(n,r){return n>0?n>=1?0:1:r?3:2}export{n as getGroundTransparencyModeFromOpacity};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{destroyMaybe as e}from"../../../../../core/maybe.js";import{set as t}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as r}from"../../../../../geometry/support/aaBoundingBox.js";import{encodeSymbolColor as o}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as i}from"../../../support/orientedBoundingBox.js";import{ComponentParametersUniform as s,ComponentParametersVarying as n}from"./ComponentDrawParameters.js";import{UniformComponentParameters as l}from"./UniformComponentParameters.js";import{olidEnabled as m}from"../../effects/geometry/olidUtils.js";import{defaultHighlightName as h}from"../../../../support/HighlightDefaults.js";class c{constructor(e,t,a,r,o,i){this._collection=e,this.transform=t,this.obb=a,this._componentData=r,this._renderable=o,this._intersectionGeometry=i,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}destroy(){this._collection.materials.release(this._renderable.material),this._intersectionGeometry=e(this._intersectionGeometry),this._renderable=e(this._renderable),this._componentData=e(this._componentData)}get componentData(){return this._componentData}get renderable(){return this._renderable}get intersectionGeometry(){return this._intersectionGeometry}get emissions(){return this.renderable.material.emissions}updateMaterial(e,t){const{_renderable:a}=this,r=a.material,{opacity:o,useFloatBlend:i,...s}=e,n=o??a.opacity,l=this._collection.materials.acquire({...r.parameters,...s,isObjectTransparent:n<1},a.geometry.parameters,t??a.drawParameters.componentParameters);this._collection.materials.release(r),l!==r&&a.updateMaterial(l)}get opacity(){return this.renderable.opacity}updateOpacity(e){this.opacity!==e&&(this._renderable.updateOpacity(e),this.updateMaterial({opacity:e}))}updateCameraDerivedParameters(e){const{eye:t}=e,{centerX:a,centerY:r,centerZ:o}=this.obb;this._renderable.meta.cameraDepthSquared=(t[0]-a)**2+(t[1]-r)**2+(t[2]-o)**2}setComponentData(e,t){const a=this._componentData,{materialDataBuffer:r,materialDataIndices:h}=a,c=new l,p=r.textureBuffer,u=p.getVec4Field("colorAndCastShadows"),f=p.getScalarField("elevationOffset"),b=p.getScalarField("emissiveStrength"),g=p.getScalarField("emissiveSourceMode"),y=p.getVec4Field("olidColor"),_=new Uint8Array(4),v=new Uint32Array(_.buffer);let M,w=0,C=0,x=0,S=0,D=0,O=a.verticalOffsets,P=1/0,j=-1/0,A=!1,I=!1,k=!1,B=0;for(let i=0;i<a.count;i++){e(i,c),w+=+(c.externalColor[3]<1),C+=+(3===c.externalColorMixMode&&1===c.externalColor[3]),S+=+(c.emissiveStrength>0),D+=+(1===c.emissiveSource),I||=1!==c.emissiveStrength,x+=+c.castShadows,o(c.externalColor,c.externalColorMixMode,_),_[2]=254&_[2]|+c.castShadows,u.setArray(h[i],_),A||=i>0&&B!==v[0],B=v[0],k||=0!==c.elevationOffset,k&&null==O&&(O=new Array(i).fill(0)),null!=O&&(O[i]=c.elevationOffset),P=Math.min(P,c.elevationOffset),j=Math.max(j,c.elevationOffset),f.set(h[i],c.elevationOffset),b.set(h[i],c.emissiveStrength),g.set(h[i],0===c.emissiveSource?0:255);const t=c.olidColor;null!=t&&y.setArray(h[i],t),c.pickable!==a.isPickable(i)&&a.updatePickabilityWithCount(i,c.pickable)}if(a.verticalOffsets=k?O:null,this.offsetObb=k?i(this.obb,P,j,t,this.offsetObb??this.obb.clone()):null,A||k||m()||(I||D>0)&&S>0){const{count:e}=a;M=new n(d(w,e),d(C,e),d(S,e),d(D,e),d(x,e)),p.updateTexture(),this._renderable.updateComponentParametersVarying(M,p)}else M=new s(c.externalColor,c.externalColorMixMode,c.emissiveStrength,c.emissiveSource,c.castShadows?0:2),this._renderable.updateComponentParametersUniform(M);this.updateMaterial({},M)}addHighlight(e,t){return this._componentData.addComponentHighlight(e,t)}removeHighlight(e,t){return this._componentData.removeComponentHighlight(e,t)}clearHighlights(){this._componentData.clearHighlights()}get aabbInWorldCoordinates(){let e=this._aabbInWorldCoordinates;return e||(e=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=e),e}_computeAabbInWorldCoordinates(){const e=r(),{positions:a}=this._intersectionGeometry;if(Math.floor(a.length/3)>0){const{transform:r}=this;let o=1/0,i=1/0,s=1/0,n=-1/0,l=-1/0,m=-1/0;const h=f;for(let e=0;e<a.length;e+=3)t(h,a[e+0],a[e+1],a[e+2]),r.applyVec3(h,h),o=Math.min(o,h[0]),i=Math.min(i,h[1]),s=Math.min(s,h[2]),n=Math.max(n,h[0]),l=Math.max(l,h[1]),m=Math.max(m,h[2]);e[0]=o,e[1]=i,e[2]=s,e[3]=n,e[4]=l,e[5]=m}return e}submit(e,t){const{componentData:a,renderable:r}=this;if(r.drawParameters.opacity<=0)return;const{geometry:o,drawParameters:i,material:s}=r,n=r.meta.cameraDepthSquared,{geometryRanges:l,highlightRangesMap:m,shadowmapRanges:c}=a,d=e=>e.submitDraw(s,i,o,l,n);switch(s.materialPass){case 0:d(e.opaque);break;case 1:d(e.transparent);break;case 2:d(e.opaque),d(e.transparent);break;case 3:d(e.integratedMesh),p(t)&&d(e.occludedGround),u(t)&&d(e.highlightIntegratedMesh);break;case 4:d(e.transparentIntegratedMesh)}if(i.castAnyShadows){if(null!=m)for(const t of m)t[0]===h&&e.highlightShadowMap.submitDraw(s,i,o,t[1],n,t[0]);null!=c&&e.defaultShadowMap.submitDraw(s,i,o,c,n),d(e.shadowMap)}if(null!=m)for(const h of m)e.highlight.submitDraw(s,i,o,h[1],n,h[0]);t.viewshedEnabled&&d(e.viewshedShadowMap)}}function d(e,t){return e===t?0:0===e?2:1}function p(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}function u(e){return null!=e.overlay?.getTexture(2)}const f=a();export{c as ComponentObject};
2
+ import{destroyMaybe as e}from"../../../../../core/maybe.js";import{set as t}from"../../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as r}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as a}from"../../../../../geometry/support/aaBoundingBox.js";import{encodeSymbolColor as o}from"../../../layers/support/symbolColorUtils.js";import{computeOffsetObb as i}from"../../../support/orientedBoundingBox.js";import{ComponentParametersUniform as s,ComponentParametersVarying as n}from"./ComponentDrawParameters.js";import{UniformComponentParameters as l}from"./UniformComponentParameters.js";import{olidEnabled as m}from"../../effects/geometry/olidUtils.js";import{defaultHighlightName as c}from"../../../../support/HighlightDefaults.js";class h{constructor(e,t,r,a,o,i){this._collection=e,this.transform=t,this.obb=r,this._componentData=a,this._renderable=o,this._intersectionGeometry=i,this.visible=!1,this.offsetObb=null,this._aabbInWorldCoordinates=null}destroy(){this._collection.materials.release(this._renderable.material),this._intersectionGeometry=e(this._intersectionGeometry),this._renderable=e(this._renderable),this._componentData=e(this._componentData)}get componentData(){return this._componentData}get renderable(){return this._renderable}get intersectionGeometry(){return this._intersectionGeometry}get emissions(){return this.renderable.material.emissions}updateMaterial(e,t){const{_renderable:r}=this,a=r.material,{opacity:o,useFloatBlend:i,...s}=e,n=o??r.opacity,l=this._collection.materials.acquire({...a.parameters,...s,groundTransparencyMode:e.groundTransparencyMode??a.parameters.groundTransparencyMode,isObjectTransparent:n<1},r.geometry.parameters,t??r.drawParameters.componentParameters);this._collection.materials.release(a),l!==a&&r.updateMaterial(l)}get opacity(){return this.renderable.opacity}updateOpacity(e,t){if(this.opacity===e){if(void 0===t||t===this.renderable.material.parameters.groundTransparencyMode)return}else this._renderable.updateOpacity(e);this.updateMaterial({opacity:e,groundTransparencyMode:t})}updateCameraDerivedParameters(e){const{eye:t}=e,{centerX:r,centerY:a,centerZ:o}=this.obb;this._renderable.meta.cameraDepthSquared=(t[0]-r)**2+(t[1]-a)**2+(t[2]-o)**2}setComponentData(e,t){const r=this._componentData,{materialDataBuffer:a,materialDataIndices:c}=r,h=new l,p=a.textureBuffer,u=p.getVec4Field("colorAndCastShadows"),f=p.getScalarField("elevationOffset"),g=p.getScalarField("emissiveStrength"),b=p.getScalarField("emissiveSourceMode"),y=p.getVec4Field("olidColor"),M=new Uint8Array(4),_=new Uint32Array(M.buffer);let v,w=0,C=0,x=0,S=0,D=0,O=r.verticalOffsets,P=1/0,j=-1/0,A=!1,I=!1,T=!1,k=0;for(let i=0;i<r.count;i++){e(i,h),w+=+(h.externalColor[3]<1),C+=+(3===h.externalColorMixMode&&1===h.externalColor[3]),S+=+(h.emissiveStrength>0),D+=+(1===h.emissiveSource),I||=1!==h.emissiveStrength,x+=+h.castShadows,o(h.externalColor,h.externalColorMixMode,M),M[2]=254&M[2]|+h.castShadows,u.setArray(c[i],M),A||=i>0&&k!==_[0],k=_[0],T||=0!==h.elevationOffset,T&&null==O&&(O=new Array(i).fill(0)),null!=O&&(O[i]=h.elevationOffset),P=Math.min(P,h.elevationOffset),j=Math.max(j,h.elevationOffset),f.set(c[i],h.elevationOffset),g.set(c[i],h.emissiveStrength),b.set(c[i],0===h.emissiveSource?0:255);const t=h.olidColor;null!=t&&y.setArray(c[i],t),h.pickable!==r.isPickable(i)&&r.updatePickabilityWithCount(i,h.pickable)}if(r.verticalOffsets=T?O:null,this.offsetObb=T?i(this.obb,P,j,t,this.offsetObb??this.obb.clone()):null,A||T||m()||(I||D>0)&&S>0){const{count:e}=r;v=new n(d(w,e),d(C,e),d(S,e),d(D,e),d(x,e)),p.updateTexture(),this._renderable.updateComponentParametersVarying(v,p)}else v=new s(h.externalColor,h.externalColorMixMode,h.emissiveStrength,h.emissiveSource,h.castShadows?0:2),this._renderable.updateComponentParametersUniform(v);this.updateMaterial({},v)}addHighlight(e,t){return this._componentData.addComponentHighlight(e,t)}removeHighlight(e,t){return this._componentData.removeComponentHighlight(e,t)}clearHighlights(){this._componentData.clearHighlights()}get aabbInWorldCoordinates(){let e=this._aabbInWorldCoordinates;return e||(e=this._computeAabbInWorldCoordinates(),this._aabbInWorldCoordinates=e),e}_computeAabbInWorldCoordinates(){const e=a(),{positions:r}=this._intersectionGeometry;if(Math.floor(r.length/3)>0){const{transform:a}=this;let o=1/0,i=1/0,s=1/0,n=-1/0,l=-1/0,m=-1/0;const c=f;for(let e=0;e<r.length;e+=3)t(c,r[e+0],r[e+1],r[e+2]),a.applyVec3(c,c),o=Math.min(o,c[0]),i=Math.min(i,c[1]),s=Math.min(s,c[2]),n=Math.max(n,c[0]),l=Math.max(l,c[1]),m=Math.max(m,c[2]);e[0]=o,e[1]=i,e[2]=s,e[3]=n,e[4]=l,e[5]=m}return e}submit(e,t){const{componentData:r,renderable:a}=this;if(a.drawParameters.opacity<=0)return;const{geometry:o,drawParameters:i,material:s}=a,n=a.meta.cameraDepthSquared,{geometryRanges:l,highlightRangesMap:m,shadowmapRanges:h}=r,d=e=>e.submitDraw(s,i,o,l,n);switch(s.materialPass){case 0:d(e.opaque);break;case 1:d(e.transparent);break;case 2:d(e.opaque),d(e.transparent);break;case 3:d(e.integratedMesh),p(t)&&d(e.occludedGround),u(t)&&d(e.highlightIntegratedMesh);break;case 4:d(e.transparentIntegratedMesh)}if(i.castAnyShadows){if(null!=m)for(const t of m)t[0]===c&&e.highlightShadowMap.submitDraw(s,i,o,t[1],n,t[0]);null!=h&&e.defaultShadowMap.submitDraw(s,i,o,h,n),d(e.shadowMap)}if(null!=m)for(const c of m)e.highlight.submitDraw(s,i,o,c[1],n,c[0]);t.viewshedEnabled&&d(e.viewshedShadowMap)}}function d(e,t){return e===t?0:0===e?2:1}function p(e){return null!=e.overlay?.getTexture(e.overlay?.allSourcesOccluders?1:4)}function u(e){return null!=e.overlay?.getTexture(2)}const f=r();export{h as ComponentObject};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import i from"../../../../../core/Logger.js";import n from"../../../../../core/PooledArray.js";import{watch as o,sync as s}from"../../../../../core/reactiveUtils.js";import{isTypedArray as r}from"../../../../../core/typedArrayUtil.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{clone as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as h}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as c}from"../../../../../geometry/support/Indices.js";import{d as m}from"../../../../../chunks/vec3.js";import{c as g}from"../../../../../chunks/vec32.js";import{ComponentData as p}from"./ComponentData.js";import{defaultComponentParameters as d,ComponentDrawParametersImplementation as f}from"./ComponentDrawParameters.js";import{ComponentObject as u}from"./ComponentObject.js";import{IntersectionGeometry as b}from"./IntersectionGeometry.js";import{RenderableMeta as _,Renderable as v}from"./Renderable.js";import{RenderGeometry as y}from"./RenderGeometry.js";import{RenderSubmitSystem as O}from"./RenderSubmitSystem.js";import{ComponentMaterialParameters as j}from"./Material/ComponentMaterialInitParameters.js";import{ComponentMaterialRepository as C}from"./Material/ComponentMaterialRepository.js";import{SamplerRepository as M}from"../../lib/SamplerRepository.js";import{VertexArrayObject as w}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as R}from"../../lib/verticalOffsetUtils.js";import{BufferManager as x}from"../../lib/TextureBackedBuffer/BufferManager.js";import{getComponentDataLayout as D,IndexGlLayout as H}from"../../materials/DefaultLayouts.js";import{BufferObject as A}from"../../../../webgl/BufferObject.js";import{PrimitiveType as I}from"../../../../webgl/enums.js";import{VertexBuffer as E}from"../../../../webgl/VertexBuffer.js";const B=()=>i.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");let P=class extends t{constructor(e,t,i){super({}),this._renderPassManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._highlightsInOrder=[],this._highlights=null,this._activeHighlightOptions=new Map,this._visible=new n,this._hidden=new n,this._renderSubmit=new O(this),this._renderPassManager.register(this._renderSubmit);const{rctx:r,bind:a}=e;this._componentBufferManager=new x(r,D());const l=2===this._viewingMode?0:i?1:2;this.materials=new C(a,l),this.samplers=new M(r.gl),this.addHandles(o(()=>a.useFloatBlend.value,()=>{this._visible.forAll(e=>e.updateMaterial(this.materials.globals)),this._hidden.forAll(e=>e.updateMaterial(this.materials.globals)),this._requestRender()},s))}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy(),this.samplers.dispose(),this.materials.destroy()}createObject(e,t){const{geometry:i}=e,n=new p(this._componentBufferManager,c(i.componentOffsets)),o=this._createRenderable(e,t,n),s=new b(this._viewingMode,i.positions,n,e.elevationAlignable),r=new u(this,e.transform,e.obb.clone(),n,o,s);return(r.visible?this._visible:this._hidden).push(r),r}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._requestRender()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._requestRender())}preSubmit(e){const{camera:t,highlights:i}=e;this._updateHighlightsInOrder(i),this._componentBufferManager.updateTextures(),this.visibleObjects.forAll(e=>e.updateCameraDerivedParameters(t))}getObjectOpacity(e){return e.renderable.drawParameters.opacity}updateObjectOpacity(e,t){const i=e;i.opacity!==t&&(i.updateOpacity(t),this._requestRender())}isSliceplaneEnabled(e){return e.renderable.material.slicePlaneEnabled}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._requestRender()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,{componentData:i}=t,n=i.visibility.componentCount;return{visible:n,invisible:i.count-n}}setComponentData(e,t){e.setComponentData(t,this._viewingMode),this._elevationRangeCacheVerticalOffset=NaN,this._requestRender()}getComponentAabb(e,t,i,n=!1){e.intersectionGeometry.getComponentAabb(t,i);const o=e,s=o.componentData.verticalOffsets;if(n||null==s)return i;const r=s[t];if(2===this._viewingMode||0===r)return i[2]+=r,i[5]+=r,i;const a=R(r);return a.localOrigin=o.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}_updateHighlightsInOrder(e){if(this._highlights===e)return;const{_highlightsInOrder:t}=this,i=Math.min(e.length,8);let n=t.length!==i;for(let o=0;o<i;++o)if(t[o]!==e[o].name){n=!0;break}if(this._highlights=e,n){t.length=i;for(let n=0;n<i;++n)t[n]=e[n].name;this._syncHighlightedObjectHighlightOrder()}}_syncHighlightedObjectHighlightOrder(){const e=this._highlightsInOrder,t=t=>{t.componentData.componentHighlights.size>0&&t.componentData.setHighlightsInOrder(e)};this._visible.forAll(t),this._hidden.forAll(t)}expandRangeWithComponentObjectElevationRange(e,t,i,n){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||n.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const o=e,{componentData:s}=o,r=s.count,{verticalOffsets:a}=s,{intersectionGeometry:l}=o,h=2===this._viewingMode,c=l.getComponentAabbs(),m=V;let g=1/0,p=-1/0;for(let d=0;d<r;d++){const e=6*d,s=a?.[d]??0;let r=1/0,l=-1/0;if(h)r=c[e+2]+s+t,l=c[e+5]+s+t;else{if(m[0]=c[e],m[1]=c[e+1],m[2]=c[e+2],m[3]=c[e+3],m[4]=c[e+4],m[5]=c[e+5],0!==s){const e=R(s);e.localOrigin=o.transform.position,e.applyToAabb(m)}const r=Math.max(Math.abs(m[3]),Math.abs(m[0])),a=Math.max(Math.abs(m[4]),Math.abs(m[1])),l=t+m[5]+i;n.expandElevationRangeValues(t+m[2],Math.sqrt(r*r+a*a+l*l)-i)}n.expandElevationRangeValues(r,l),g=Math.min(g,r),p=Math.max(p,l)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=g,this._elevationRangeCacheMax=p}intersectRay(e,t,i,n,o,s){const r=e,{transform:a,componentData:l,intersectionGeometry:h}=r;null!=n&&(n.localOrigin=a.position),h.intersectRay(t,i,n,l.verticalOffsets,a,o,s)}*intersectScreenPolygon(e,t,i,n,o){const s=e,{transform:r,componentData:a,intersectionGeometry:l}=s;null!=n&&(n.localOrigin=r.position),yield*l.intersectScreenPolygon(t,i,n,a.verticalOffsets,r,o)}addEdges(e,t,i,n,o){const s=e,{indices:r,positions:a}=s.intersectionGeometry,l=s.componentData.offsets;return t.addComponentObject(s,a,r,l,i,n,o)}async extractEdgeInformation(e,t,i){const n=e,o=n.componentData.visibility;if(o.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await import("../../lib/edgeRendering/edgeProcessing.js");return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:s,positions:r}=n.intersectionGeometry,a=n.componentData.offsets,{EdgeInputBufferLayout:h}=await import("../../lib/edgeRendering/bufferLayouts.js"),c=h.createBuffer(r.length/3);g(c.position.typedBuffer,r,c.position.typedBufferStride,3),m(c.position,c.position,n.transform.rotationScale),this._setComponentIndices(c.componentIndex,s,a);const p=c.count,d=this._computeVisibilityIndices(s,o,a,p);return{origin:l(n.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:d,indicesLength:d.length,skipDeduplicate:!0,data:c,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let n=0;for(let o=0;o<i.length-1;o++){const s=i[o],r=i[o+1];for(let i=s;i<r;i++){const o=t?t[i]:i;e.set(o,n)}n++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let o=0;t.forEachComponentRange((e,t)=>(o+=i[t]-i[e],!0));const s=r(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(o):new Uint32Array(o):new Array(o);let a=0;return t.forEachComponentRange((t,n)=>{const o=i[t],r=i[n];for(let i=o;i<r;i++)s[a++]=e?e[i]:i;return!0}),s}addHighlight(e,t,i){const n=e,o=this._activeHighlightOptions.get(i)??0;this._activeHighlightOptions.set(i,o+1),n.componentData.setHighlightsInOrder(this._highlightsInOrder);n.addHighlight(t,i)&&this._requestRender()}removeHighlight(e,t,i){const n=e.removeHighlight(t,i);"notfound"!==n&&(this._removeActiveHighlight(i),n&&this._requestRender())}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)B().warn(`Removing non-existing highlight "${e}".`);else{const n=i-t;n<0&&B().warn(`Removing non-existing highlight "${e}".`),n<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,n)}}clearHighlights(e){const t=e,{componentData:i}=t,{componentHighlights:n}=t.componentData;if(n.size>0){for(const e of n)this._removeActiveHighlight(e[0],e[1][i.count]);t.clearHighlights(),this._requestRender()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t,i){const n=this._renderPassManager.rctx,o=e.geometry,s=o.parameters.layout,{interleavedVertexData:r,indexData:a,vertexCount:l}=o.renderGeometryData,h=new E(n,s,r),c=a?A.createIndex(n,35044,a):null;let m=0;const g=[["geometry",h]];if(!t.isIntegratedMesh){const e=new Uint16Array(l);for(let n=0;n<i.count;n++){const t=i.offsets[n],o=i.offsets[n+1],s=i.materialDataIndices[n];if(null!=a)for(let i=t;i<o;i++){e[a[i]]=s}else for(let i=t;i<o;i++)e[i]=s}const t=new E(n,H,e.buffer);m+=t.usedMemory,g.push(["componentIndices",t])}const p=new w(n,new Map(g),c),u=a?.length??l,b=new y(p,I.TRIANGLES,o.parameters,null!=c,u),O=new j(t),C=this.materials.acquire(O,b.parameters,d),M=new _(h.usedMemory+m+(c?.usedMemory??0)),R=this.samplers.addFromTexture(t.baseColorTexture?.texture),x=new f(e,t,R);return new v(C,x,b,M)}_requestRender(){this._renderPassManager.requestRender()}};P=e([a("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection")],P);const V=h();export{P as ComponentObjectCollection};
2
+ import{__decorate as e}from"tslib";import t from"../../../../../core/Accessor.js";import"../../../../../core/has.js";import i from"../../../../../core/Logger.js";import n from"../../../../../core/PooledArray.js";import{watch as o,sync as r}from"../../../../../core/reactiveUtils.js";import{isTypedArray as s}from"../../../../../core/typedArrayUtil.js";import{subclass as a}from"../../../../../core/accessorSupport/decorators/subclass.js";import{clone as l}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as h}from"../../../../../geometry/support/aaBoundingBox.js";import{compactIndices as c}from"../../../../../geometry/support/Indices.js";import{d as m}from"../../../../../chunks/vec3.js";import{c as g}from"../../../../../chunks/vec32.js";import{ComponentData as p}from"./ComponentData.js";import{defaultComponentParameters as d,ComponentDrawParametersImplementation as f}from"./ComponentDrawParameters.js";import{ComponentObject as u}from"./ComponentObject.js";import{IntersectionGeometry as b}from"./IntersectionGeometry.js";import{RenderableMeta as _,Renderable as v}from"./Renderable.js";import{RenderGeometry as y}from"./RenderGeometry.js";import{RenderSubmitSystem as O}from"./RenderSubmitSystem.js";import{ComponentMaterialParameters as j}from"./Material/ComponentMaterialInitParameters.js";import{ComponentMaterialRepository as M}from"./Material/ComponentMaterialRepository.js";import{SamplerRepository as C}from"../../lib/SamplerRepository.js";import{VertexArrayObject as w}from"../../lib/VertexArrayObject.js";import{getVerticalOffsetI3S as R}from"../../lib/verticalOffsetUtils.js";import{BufferManager as x}from"../../lib/TextureBackedBuffer/BufferManager.js";import{getComponentDataLayout as D,IndexGlLayout as H}from"../../materials/DefaultLayouts.js";import{BufferObject as A}from"../../../../webgl/BufferObject.js";import{PrimitiveType as I}from"../../../../webgl/enums.js";import{VertexBuffer as E}from"../../../../webgl/VertexBuffer.js";const B=()=>i.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");let P=class extends t{constructor(e,t,i){super({}),this._renderPassManager=e,this._viewingMode=t,this._elevationRangeCacheVerticalOffset=NaN,this._elevationRangeCacheMin=NaN,this._elevationRangeCacheMax=NaN,this._highlightsInOrder=[],this._highlights=null,this._activeHighlightOptions=new Map,this._visible=new n,this._hidden=new n,this._renderSubmit=new O(this),this._renderPassManager.register(this._renderSubmit);const{rctx:s,bind:a}=e;this._componentBufferManager=new x(s,D());const l=2===this._viewingMode?0:i?1:2;this.materials=new M(a,l),this.samplers=new C(s.gl),this.addHandles(o(()=>a.useFloatBlend.value,()=>{this._visible.forAll(e=>e.updateMaterial(this.materials.globals)),this._hidden.forAll(e=>e.updateMaterial(this.materials.globals)),this._requestRender()},r))}destroy(){this._componentBufferManager.destroy(),this._componentBufferManager=null,this._visible.forAll(e=>e.destroy()),this._visible.prune(),this._hidden.forAll(e=>e.destroy()),this._hidden.prune(),this._renderSubmit.destroy(),this.samplers.dispose(),this.materials.destroy()}createObject(e,t){const{geometry:i}=e,n=new p(this._componentBufferManager,c(i.componentOffsets)),o=this._createRenderable(e,t,n),r=new b(this._viewingMode,i.positions,n,e.elevationAlignable),s=new u(this,e.transform,e.obb.clone(),n,o,r);return(s.visible?this._visible:this._hidden).push(s),s}destroyObject(e){const t=e;(t.visible?this._visible:this._hidden).removeUnordered(t),t.destroy(),this._requestRender()}setObjectVisibility(e,t){const i=e;t!==i.visible&&(t?(this._hidden.removeUnordered(i),this._visible.push(i)):(this._visible.removeUnordered(i),this._hidden.push(i)),i.visible=t,this._requestRender())}preSubmit(e){const{camera:t,highlights:i}=e;this._updateHighlightsInOrder(i),this._componentBufferManager.updateTextures(),this.visibleObjects.forAll(e=>e.updateCameraDerivedParameters(t))}getObjectOpacity(e){return e.renderable.drawParameters.opacity}updateObjectOpacity(e,t,i){const n=e;(n.opacity!==t||void 0!==i&&i!==n.renderable.material.parameters.groundTransparencyMode)&&(n.updateOpacity(t,i),this._requestRender())}isSliceplaneEnabled(e){return e.renderable.material.slicePlaneEnabled}setAllComponentVisibilities(e,t){const i=e;i.componentData.visibility.reset(t),i.componentData.markVisibilityDirty(),this._requestRender()}forEachVisibleComponent(e,t){return e.componentData.visibility.forEachComponent(t)}getComponentCount(e){const t=e,{componentData:i}=t,n=i.visibility.componentCount;return{visible:n,invisible:i.count-n}}setComponentData(e,t){e.setComponentData(t,this._viewingMode),this._elevationRangeCacheVerticalOffset=NaN,this._requestRender()}getComponentAabb(e,t,i,n=!1){e.intersectionGeometry.getComponentAabb(t,i);const o=e,r=o.componentData.verticalOffsets;if(n||null==r)return i;const s=r[t];if(2===this._viewingMode||0===s)return i[2]+=s,i[5]+=s,i;const a=R(s);return a.localOrigin=o.transform.position,a.applyToAabb(i)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,t,i){return e.intersectionGeometry.getComponentPositions(t,i)}_updateHighlightsInOrder(e){if(this._highlights===e)return;const{_highlightsInOrder:t}=this,i=Math.min(e.length,8);let n=t.length!==i;for(let o=0;o<i;++o)if(t[o]!==e[o].name){n=!0;break}if(this._highlights=e,n){t.length=i;for(let n=0;n<i;++n)t[n]=e[n].name;this._syncHighlightedObjectHighlightOrder()}}_syncHighlightedObjectHighlightOrder(){const e=this._highlightsInOrder,t=t=>{t.componentData.componentHighlights.size>0&&t.componentData.setHighlightsInOrder(e)};this._visible.forAll(t),this._hidden.forAll(t)}expandRangeWithComponentObjectElevationRange(e,t,i,n){Number.isNaN(this._elevationRangeCacheVerticalOffset)||this._elevationRangeCacheVerticalOffset!==t||n.expandElevationRangeValues(this._elevationRangeCacheMin,this._elevationRangeCacheMax);const o=e,{componentData:r}=o,s=r.count,{verticalOffsets:a}=r,{intersectionGeometry:l}=o,h=2===this._viewingMode,c=l.getComponentAabbs(),m=V;let g=1/0,p=-1/0;for(let d=0;d<s;d++){const e=6*d,r=a?.[d]??0;let s=1/0,l=-1/0;if(h)s=c[e+2]+r+t,l=c[e+5]+r+t;else{if(m[0]=c[e],m[1]=c[e+1],m[2]=c[e+2],m[3]=c[e+3],m[4]=c[e+4],m[5]=c[e+5],0!==r){const e=R(r);e.localOrigin=o.transform.position,e.applyToAabb(m)}const s=Math.max(Math.abs(m[3]),Math.abs(m[0])),a=Math.max(Math.abs(m[4]),Math.abs(m[1])),l=t+m[5]+i;n.expandElevationRangeValues(t+m[2],Math.sqrt(s*s+a*a+l*l)-i)}n.expandElevationRangeValues(s,l),g=Math.min(g,s),p=Math.max(p,l)}this._elevationRangeCacheVerticalOffset=t,this._elevationRangeCacheMin=g,this._elevationRangeCacheMax=p}intersectRay(e,t,i,n,o,r){const s=e,{transform:a,componentData:l,intersectionGeometry:h}=s;null!=n&&(n.localOrigin=a.position),h.intersectRay(t,i,n,l.verticalOffsets,a,o,r)}*intersectScreenPolygon(e,t,i,n,o){const r=e,{transform:s,componentData:a,intersectionGeometry:l}=r;null!=n&&(n.localOrigin=s.position),yield*l.intersectScreenPolygon(t,i,n,a.verticalOffsets,s,o)}addEdges(e,t,i,n,o){const r=e,{indices:s,positions:a}=r.intersectionGeometry,l=r.componentData.offsets;return t.addComponentObject(r,a,s,l,i,n,o)}async extractEdgeInformation(e,t,i){const n=e,o=n.componentData.visibility;if(o.allInvisible()){const{extractComponentsEdgeLocationsLayout:e}=await(import("../../lib/edgeRendering/edgeProcessing.js"));return{buffer:e.createBuffer(0),origin:[0,0,0]}}const{indices:r,positions:s}=n.intersectionGeometry,a=n.componentData.offsets,{EdgeInputBufferLayout:h}=await(import("../../lib/edgeRendering/bufferLayouts.js")),c=h.createBuffer(s.length/3);g(c.position.typedBuffer,s,c.position.typedBufferStride,3),m(c.position,c.position,n.transform.rotationScale),this._setComponentIndices(c.componentIndex,r,a);const p=c.count,d=this._computeVisibilityIndices(r,o,a,p);return{origin:l(n.transform.position),buffer:await t.extractComponentsEdgeLocations({indices:d,indicesLength:d.length,skipDeduplicate:!0,data:c,writerSettings:{reducedPrecision:!1,variants:0}},i)}}_setComponentIndices(e,t,i){let n=0;for(let o=0;o<i.length-1;o++){const r=i[o],s=i[o+1];for(let i=r;i<s;i++){const o=t?t[i]:i;e.set(o,n)}n++}}_computeVisibilityIndices(e,t,i,n){if(e&&t.allVisible())return e;let o=0;t.forEachComponentRange((e,t)=>(o+=i[t]-i[e],!0));const r=s(e)?2===e?.BYTES_PER_ELEMENT||n<=65536?new Uint16Array(o):new Uint32Array(o):new Array(o);let a=0;return t.forEachComponentRange((t,n)=>{const o=i[t],s=i[n];for(let i=o;i<s;i++)r[a++]=e?e[i]:i;return!0}),r}addHighlight(e,t,i){const n=e,o=this._activeHighlightOptions.get(i)??0;this._activeHighlightOptions.set(i,o+1),n.componentData.setHighlightsInOrder(this._highlightsInOrder);n.addHighlight(t,i)&&this._requestRender()}removeHighlight(e,t,i){const n=e.removeHighlight(t,i);"notfound"!==n&&(this._removeActiveHighlight(i),n&&this._requestRender())}_removeActiveHighlight(e,t=1){const i=this._activeHighlightOptions.get(e);if(void 0===i)B().warn(`Removing non-existing highlight "${e}".`);else{const n=i-t;n<0&&B().warn(`Removing non-existing highlight "${e}".`),n<=0?this._activeHighlightOptions.delete(e):this._activeHighlightOptions.set(e,n)}}clearHighlights(e){const t=e,{componentData:i}=t,{componentHighlights:n}=t.componentData;if(n.size>0){for(const e of n)this._removeActiveHighlight(e[0],e[1][i.count]);t.clearHighlights(),this._requestRender()}}hasHighlight(e){return this._activeHighlightOptions.has(e)}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._visible}_createRenderable(e,t,i){const n=this._renderPassManager.rctx,o=e.geometry,r=o.parameters.layout,{interleavedVertexData:s,indexData:a,vertexCount:l}=o.renderGeometryData,h=new E(n,r,s),c=a?A.createIndex(n,35044,a):null;let m=0;const g=[["geometry",h]];if(!t.isIntegratedMesh){const e=new Uint16Array(l);for(let n=0;n<i.count;n++){const t=i.offsets[n],o=i.offsets[n+1],r=i.materialDataIndices[n];if(null!=a)for(let i=t;i<o;i++){e[a[i]]=r}else for(let i=t;i<o;i++)e[i]=r}const t=new E(n,H,e.buffer);m+=t.usedMemory,g.push(["componentIndices",t])}const p=new w(n,new Map(g),c),u=a?.length??l,b=new y(p,I.TRIANGLES,o.parameters,null!=c,u),O=new j(t),M=this.materials.acquire(O,b.parameters,d),C=new _(h.usedMemory+m+(c?.usedMemory??0)),R=this.samplers.addFromTexture(t.baseColorTexture?.texture),x=new f(e,t,R);return new v(M,x,b,C)}_requestRender(){this._renderPassManager.requestRender()}};P=e([a("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection")],P);const V=h();export{P as ComponentObjectCollection};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class o extends s{constructor(e,s,r,a,i){super(),this.parameters=e,this.key=i;const o=h(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this._hasEmissions=0!==o,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}get emissions(){if(!this._hasEmissions)return 0;switch(this.materialPass){case 0:case 3:return 1;case 1:case 4:return 2;case 2:return 3}}acquireTechnique(t,s,r,a){const o=this._updateConfiguration(s,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){o.sphereDepthInterpolate=!1;const s=t.get(e,o,a.layout);o.sphereDepthInterpolate=!0;const n=t.get(e,o,a.layout);return i(r.camera,o)?n:s}return t.get(e,o,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.componentDataType=s.componentDataType,r.emissionSource=h(e,s)}_updateConfiguration(e,t){const s=this._configuration,{identifier:o}=e,n=0===o;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&i(t.camera,s),s.hasEmission=t.hasEmission,s.renderOccluded=9===t.slot;const l=this.isIntegratedMesh?c(t)?u(t)?3:2:1:0;s.integratedMeshMode=l,s.pbrMode=3===l?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:h}=this;s.transparent=n&&(1===h||2===h&&e.transparent||4===h)||s.isGroundSlice,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===h?e.transparent?2:1:0;const p=r(t.output);return s.receiveAmbientOcclusion=p&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=p&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function n(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:i,opaqueOverride:o}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a?4:3;if(n)return 1;if(0===o)return 0;if(l||0===s||3===s)return 1;switch(i){case 2:return 0;case 0:return 1;case 1:return 2}}function l(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function h(e,t){const s=e.hasEmissionTexture,{emissiveSourceOverride:r}=t,a=1===r,i=2===r;return 2!==t.emissiveOverride&&(l(e)||2!==r)?l(e)?i?s?4:2:a?s?5:7:6:a?7:6:0}function u(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{o as ComponentMaterial,n as computeMaterialPass,h as getEmissionSource};
2
+ import{ComponentTechnique as e}from"./ComponentTechnique.js";import{ComponentTechniqueConfiguration as t}from"./ComponentTechniqueConfiguration.js";import{MaterialBase as s}from"../../../core/material/MaterialBase.js";import{isColor as r}from"../../../core/shaderLibrary/ShaderOutput.js";import{hasShadowHighlights as a}from"../../../shaders/ReceiveShadowsConfiguration.js";import{isSphereDepthInterpolateActive as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class o extends s{constructor(e,s,r,a,i){super(),this.parameters=e,this.key=i;const o=u(e,r);this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.isIntegratedMesh=e.isIntegratedMesh,this.applySSAO=e.applySSAO,this._hasEmissions=0!==o,this.materialPass=n(e,r),this._configuration=new t(a),this._supportsSphereDepthInterpolate=e.sphereDepthInterpolate&&this._configuration.spherical,this._initializeMaterialConfiguration(e,s,r)}destroy(){}get emissions(){if(!this._hasEmissions)return 0;switch(this.materialPass){case 0:case 3:return 1;case 1:case 4:return 2;case 2:return 3}}acquireTechnique(t,s,r,a){const o=this._updateConfiguration(s,r);if(this._supportsSphereDepthInterpolate&&t.precompiling>0){o.sphereDepthInterpolate=!1;const s=t.get(e,o,a.layout);o.sphereDepthInterpolate=!0;const n=t.get(e,o,a.layout);return i(r.camera,o)?n:s}return t.get(e,o,a.layout)}_initializeMaterialConfiguration(e,t,s){const r=this._configuration;r.hasMetallicRoughnessTexture=e.hasMetallicRoughnessTexture,r.hasOcclusionTexture=e.hasOcclusionTexture,r.hasNormalTexture=e.hasNormalTexture,r.sphereDepthInterpolate=!1,r.ellipsoidMode=e.ellipsoidMode,r.doubleSidedMode=e.doubleSided?1:0,r.hasColorTexture=e.hasBaseColorTexture,r.cullFace=e.cullFace,r.alphaDiscardMode=e.alphaDiscardMode,r.hasVertexColors=t.hasVertexColors,r.textureCoordinateType=t.textureCoordinateType,r.shadeNormals=t.shadeNormals,r.normalType=t.hasNormals?1:2,r.polygonOffset=e.polygonOffset,r.vertexPositionRotationType=t.vertexPositionRotationType,r.componentDataType=s.componentDataType,r.emissionSource=u(e,s),r.groundTransparencyMode=e.groundTransparencyMode}_updateConfiguration(e,t){const s=this._configuration,{identifier:o}=e,n=0===o;s.output=t.output,s.enableOITOffset=t.enableOITOffset,s.sphereDepthInterpolate=this._supportsSphereDepthInterpolate&&i(t.camera,s),s.hasEmission=t.hasEmission,s.renderOccluded=9===t.slot;const l=this.isIntegratedMesh?c(t)?h(t)?3:2:1:0;s.integratedMeshMode=l,s.pbrMode=3===l?4:this.usePBR?this.hasParametersFromSource?0!==s.shadeNormals&&this.isIntegratedMesh?0:2:1:0,s.hasSlicePlane=null!=t.slicePlane&&this.slicePlaneEnabled,s.isGroundSlice=s.hasSlicePlane&&this.isGround;const{materialPass:u}=this;s.transparent=n&&(1===u||2===u&&e.transparent||4===u)||s.isGroundSlice,s.hasHighlightMixTexture=2===o&&null!=t.highlightMixTexture,s.snowCover=n&&t.snowCover>0,s.vertexDiscardMode=n&&2===u?e.transparent?2:1:0;const p=r(t.output);return s.receiveAmbientOcclusion=p&&this.applySSAO&&!s.renderOccluded&&null!=t.ssao?.getTexture(),s.receiveGlobalIllumination=p&&this.applySSAO&&!s.renderOccluded&&t.globalIlluminationEnabled,s.hasOccludees=p&&t.hasOccludees,s.receiveShadows=p&&t.shadowMap.ready,s.hasShadowHighlights=a(s,t),s.screenSpaceReflections=t.hasScreenSpaceReflections,s.cloudReflections=p&&null!=t.clouds.data?.cubeMap?.colorTexture,s}}function n(e,t){const{alphaDiscardMode:s,isIntegratedMesh:r,slicePlaneEnabled:a}=e,{transparent:i,opaqueOverride:o}=t,n=e.isObjectTransparent,l=e.hasBaseColorTransparency;if(r)return n||a?4:3;if(n)return 1;if(0===o)return 0;if(l||0===s||3===s)return 1;switch(i){case 2:return 0;case 0:return 1;case 1:return 2}}function l(e){return e.hasEmissionTexture||e.hasEmissiveBaseColor}function u(e,t){const s=e.hasEmissionTexture,{emissiveSourceOverride:r}=t,a=1===r,i=2===r;return 2!==t.emissiveOverride&&(l(e)||2!==r)?l(e)?i?s?4:2:a?s?5:7:6:a?7:6:0}function h(e){return null!=e.overlay?.getTexture(3)}function c(e){return null!=e.overlay?.getTexture(1)}export{o as ComponentMaterial,n as computeMaterialPass,u as getEmissionSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- class e{constructor(e){this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.sphereDepthInterpolate=e.sphereDepthInterpolate,this.doubleSided=e.doubleSided,this.cullFace=e.cullFace,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.alphaDiscardMode=e.alphaDiscardMode,this.isIntegratedMesh=e.isIntegratedMesh,this.polygonOffset=e.polygonOffset,this.ellipsoidMode=e.ellipsoidMode,this.applySSAO=e.applySSAO}}class s extends e{constructor(e){super(e),this.hasBaseColorTransparency=e.baseColor[3]<1,this.hasEmissiveBaseColor=0!==e.emissiveBaseColor[0]||0!==e.emissiveBaseColor[1]||0!==e.emissiveBaseColor[2],this.isObjectTransparent=e.opacity<1,this.hasBaseColorTexture=null!=e.baseColorTexture,this.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,this.hasNormalTexture=null!=e.normalTexture,this.hasOcclusionTexture=null!=e.occlusionTexture,this.hasEmissionTexture=null!=e.emissionTexture}}export{e as ComponentMaterialBaseParameters,s as ComponentMaterialParameters};
2
+ class e{constructor(e){this.usePBR=e.usePBR,this.hasParametersFromSource=e.hasParametersFromSource,this.sphereDepthInterpolate=e.sphereDepthInterpolate,this.doubleSided=e.doubleSided,this.cullFace=e.cullFace,this.isGround=e.isGround,this.slicePlaneEnabled=e.slicePlaneEnabled,this.alphaDiscardMode=e.alphaDiscardMode,this.isIntegratedMesh=e.isIntegratedMesh,this.polygonOffset=e.polygonOffset,this.ellipsoidMode=e.ellipsoidMode,this.applySSAO=e.applySSAO,this.groundTransparencyMode=e.groundTransparencyMode??1}}class s extends e{constructor(e){super(e),this.hasBaseColorTransparency=e.baseColor[3]<1,this.hasEmissiveBaseColor=0!==e.emissiveBaseColor[0]||0!==e.emissiveBaseColor[1]||0!==e.emissiveBaseColor[2],this.isObjectTransparent=e.opacity<1,this.hasBaseColorTexture=null!=e.baseColorTexture,this.hasMetallicRoughnessTexture=null!=e.metallicRoughnessTexture,this.hasNormalTexture=null!=e.normalTexture,this.hasOcclusionTexture=null!=e.occlusionTexture,this.hasEmissionTexture=null!=e.emissionTexture}}export{e as ComponentMaterialBaseParameters,s as ComponentMaterialParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as r,getEmissionSource as t}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as o}from"./ComponentMaterialGlobalParameters.js";class s{constructor(e,r){this._store=new Map,this.globals=new o(e,r)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(r,t,o){const s=this.globals,i=a(r,t,o,s),n=this._store.get(i);if(n)return n.refCount++,n.material.key,n.material;const l=new e(r,t,o,s,i);return this._store.set(i,{material:l,refCount:1}),l}release(e){const{key:r}=e,t=this._store.get(r);if(!t||t.refCount<1)throw new Error("Internal error in material repository");1===t.refCount?this._store.delete(r):t.refCount--}}function a(e,o,s,a){const i=r(e,s),n=t(e,s);return"|"+ +a.useFloatBlend+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}`+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+i}|${+s.componentDataType}|${+n}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+o.hasVertexColors}|${+o.textureCoordinateType}`+`|${+o.shadeNormals}|${+o.hasNormals}`+`|${e.polygonOffset}|${+o.vertexPositionRotationType}|`+ +e.hasBaseColorTexture+"|"+ +e.hasEmissionTexture+"|"+ +e.hasMetallicRoughnessTexture+"|"+ +e.hasOcclusionTexture+"|"+ +e.hasNormalTexture+"|"+ +s.emissiveOverride}export{s as ComponentMaterialRepository,a as makeMaterialKey};
2
+ import"../../../../../../core/has.js";import"../../../../../../core/Logger.js";import{ComponentMaterial as e,computeMaterialPass as r,getEmissionSource as t}from"./ComponentMaterial.js";import{ComponentMaterialGlobalParameters as o}from"./ComponentMaterialGlobalParameters.js";class s{constructor(e,r){this._store=new Map,this.globals=new o(e,r)}destroy(){this._store.forEach(({material:e})=>e.destroy()),this._store.clear()}acquire(r,t,o){const s=this.globals,i=a(r,t,o,s),n=this._store.get(i);if(n)return n.refCount++,n.material.key,n.material;const l=new e(r,t,o,s,i);return this._store.set(i,{material:l,refCount:1}),l}release(e){const{key:r}=e,t=this._store.get(r);if(!t||t.refCount<1)throw new Error("Internal error in material repository");1===t.refCount?this._store.delete(r):t.refCount--}}function a(e,o,s,a){const i=r(e,s),n=t(e,s);return"|"+ +a.useFloatBlend+`|${+e.usePBR}|${+e.hasParametersFromSource}|${+e.isGround}|`+ +e.groundTransparencyMode+`|${+e.slicePlaneEnabled}|${+e.isIntegratedMesh}|${+e.applySSAO}`+`|${+i}|${+s.componentDataType}|${+n}`+`|${+e.sphereDepthInterpolate}|${+e.ellipsoidMode}|${+e.doubleSided}`+`|${+e.cullFace}|${+e.alphaDiscardMode}`+`|${+o.hasVertexColors}|${+o.textureCoordinateType}`+`|${+o.shadeNormals}|${+o.hasNormals}`+`|${e.polygonOffset}|${+o.vertexPositionRotationType}|`+ +e.hasBaseColorTexture+"|"+ +e.hasEmissionTexture+"|"+ +e.hasMetallicRoughnessTexture+"|"+ +e.hasOcclusionTexture+"|"+ +e.hasNormalTexture+"|"+ +s.emissiveOverride}export{s as ComponentMaterialRepository,a as makeMaterialKey};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.transparent=!0,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:8})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o({count:5})],s.prototype,"polygonOffset",void 0),e([o({count:3})],s.prototype,"vertexPositionRotationType",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"emissionDimmingPass",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveGlobalIllumination",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"hasShadowHighlights",void 0),e([o()],s.prototype,"transparent",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"enableOITOffset",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
2
+ import{__decorate as e}from"tslib";import{isColorHighlightOrOLID as t}from"../../../core/shaderLibrary/ShaderOutput.js";import{parameter as o}from"../../../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{SphereDepthInterpolateConfiguration as i}from"../../../shaders/SphereDepthInterpolate.glsl.js";class s extends i{constructor(e){super(),this.output=0,this.textureCoordinateType=0,this.componentDataType=0,this.cullFace=2,this.vertexDiscardMode=0,this.doubleSidedMode=2,this.alphaDiscardMode=1,this.integratedMeshMode=0,this.pbrMode=0,this.normalType=0,this.emissionSource=0,this.shadeNormals=1,this.polygonOffset=0,this.vertexPositionRotationType=1,this.hasEmission=!1,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.isGroundSlice=!1,this.hasColorTexture=!1,this.hasHighlightMixTexture=!1,this.emissionDimmingPass=!1,this.receiveAmbientOcclusion=!0,this.receiveGlobalIllumination=!1,this.receiveShadows=!0,this.hasShadowHighlights=!1,this.transparent=!0,this.groundTransparencyMode=1,this.screenSpaceReflections=!1,this.hasMetallicRoughnessTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.hasNormalTextureTransform=!1,this.cloudReflections=!0,this.snowCover=!1,this.renderOccluded=!1,this.enableOITOffset=!1,this.sphereDepthInterpolate=!1,this.writeDepth=!0,this.oitPremultipliedAlpha=!1,this.occlusionPass=!1,this.bindType=2,this.useCustomDTRExponentForWater=!1,this.hasVertexTangents=!1,this.hasSliceTranslatedView=!1,this.rayMarchMaxReach=1,this.rayMarchMaxSteps=75,this.useProjectedRayLength=!1,this.clampRayToScreen=!0,this.instanced=!1,this.instancedDoublePrecision=!1,this.hasModelTransformation=!1,this.useFillLights=!0,this.draped=!1,this.useTransformationTexture=!0,this.sphericalSR=e.sphericalSR,this.useFloatBlend=e.useFloatBlend}get spherical(){return 0!==this.sphericalSR}get overlayEnabled(){return(2===this.integratedMeshMode||3===this.integratedMeshMode)&&t(this.output)}get hasWater(){return 3===this.pbrMode||4===this.pbrMode||6===this.pbrMode}}e([o()],s.prototype,"useFloatBlend",void 0),e([o({count:12})],s.prototype,"output",void 0),e([o({count:3})],s.prototype,"textureCoordinateType",void 0),e([o({count:2})],s.prototype,"componentDataType",void 0),e([o({count:3})],s.prototype,"cullFace",void 0),e([o({count:3})],s.prototype,"vertexDiscardMode",void 0),e([o({count:3})],s.prototype,"doubleSidedMode",void 0),e([o({count:4})],s.prototype,"alphaDiscardMode",void 0),e([o({count:4})],s.prototype,"integratedMeshMode",void 0),e([o({count:8})],s.prototype,"pbrMode",void 0),e([o({count:3})],s.prototype,"normalType",void 0),e([o({count:8})],s.prototype,"emissionSource",void 0),e([o({count:3})],s.prototype,"shadeNormals",void 0),e([o({count:5})],s.prototype,"polygonOffset",void 0),e([o({count:3})],s.prototype,"vertexPositionRotationType",void 0),e([o()],s.prototype,"hasEmission",void 0),e([o()],s.prototype,"hasVertexColors",void 0),e([o()],s.prototype,"hasSlicePlane",void 0),e([o()],s.prototype,"isGroundSlice",void 0),e([o()],s.prototype,"hasColorTexture",void 0),e([o()],s.prototype,"hasHighlightMixTexture",void 0),e([o()],s.prototype,"emissionDimmingPass",void 0),e([o()],s.prototype,"receiveAmbientOcclusion",void 0),e([o()],s.prototype,"receiveGlobalIllumination",void 0),e([o()],s.prototype,"receiveShadows",void 0),e([o()],s.prototype,"hasShadowHighlights",void 0),e([o()],s.prototype,"transparent",void 0),e([o({count:4})],s.prototype,"groundTransparencyMode",void 0),e([o()],s.prototype,"screenSpaceReflections",void 0),e([o()],s.prototype,"hasMetallicRoughnessTexture",void 0),e([o()],s.prototype,"hasOcclusionTexture",void 0),e([o()],s.prototype,"hasNormalTexture",void 0),e([o()],s.prototype,"hasOccludees",void 0),e([o()],s.prototype,"terrainDepthTest",void 0),e([o()],s.prototype,"cullAboveTerrain",void 0),e([o()],s.prototype,"hasNormalTextureTransform",void 0),e([o()],s.prototype,"cloudReflections",void 0),e([o()],s.prototype,"snowCover",void 0),e([o()],s.prototype,"renderOccluded",void 0),e([o()],s.prototype,"enableOITOffset",void 0),e([o()],s.prototype,"sphereDepthInterpolate",void 0);export{s as ComponentTechniqueConfiguration};
@@ -1,7 +1,7 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{isColor as l}from"../ShaderOutput.js";import{addMainLightDirection as a,addMainLightIntensity as i}from"../shading/MainLighting.glsl.js";import{WaterColor as c}from"../shading/WaterColor.glsl.js";import{Float4DrawUniform as s}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as v}from"../../shaderModules/FloatPassUniform.js";import{glsl as n}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../../shaderModules/Texture2DPassUniform.js";import{Texture2DUintPassUniform as u}from"../../shaderModules/Texture2DUintPassUniform.js";import{Uniform as x}from"../../../../../webgl/Uniform.js";function y(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.uniforms.add(new s("overlayTexOffset",(e,r)=>h(o.spherical,e,r)),new s("overlayTexScale",(e,r)=>O(o.spherical,e,r))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new d("ovColorTex",(e,o)=>f(e,o))),p(e,o)}function f(e,o){return 0===e.identifier&&l(o.output)?e.occludedGround?o.overlay?.allSourcesOccluders?o.overlay?.getTexture(1):o.overlay?.getTexture(4):o.overlay?.getTexture(1):0===e.identifier&&11===o.output?o.overlay?.getTexture(5):2===e.identifier?o.overlay?.getTexture(2):null}function m(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new V("overlayTexOffset"),new V("overlayTexScale")),t.uniforms.add(new v("overlayOpacity",e=>e.overlayOpacity)),10!==o.output&&t.uniforms.add(new d("ovColorTex",(e,o)=>o.overlay?.getTexture(e.overlayContent))),p(e,o)}function g(e,o){switch(e){case 0:case 1:case 2:return 9!==o.slot||o.overlay?.allSourcesOccluders?0:4;case 3:case 4:return 0;case 10:return 2;case 5:case 7:case 8:case 9:return null;case 11:return 5}return null}function p(e,o){const{hasWater:r,output:t}=o;r&&e.include(c,o);const{vertex:l,fragment:s,varyings:v}=e;v.add("vtcOverlay","vec4");const d=10===t;l.code.add(n`void setOverlayVTC(in vec2 uv) {
2
+ import{create as e}from"../../../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{hasArea as o,width as r,height as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{isColor as l}from"../ShaderOutput.js";import{addMainLightDirection as a,addMainLightIntensity as c}from"../shading/MainLighting.glsl.js";import{WaterColor as i}from"../shading/WaterColor.glsl.js";import{Float4DrawUniform as n}from"../../shaderModules/Float4DrawUniform.js";import{FloatPassUniform as s}from"../../shaderModules/FloatPassUniform.js";import{glsl as v}from"../../shaderModules/glsl.js";import{Texture2DPassUniform as d}from"../../shaderModules/Texture2DPassUniform.js";import{Texture2DUintPassUniform as u}from"../../shaderModules/Texture2DUintPassUniform.js";import{Uniform as x}from"../../../../../webgl/Uniform.js";function y(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new n("overlayTexOffset",(e,r)=>O(o.spherical,e,r)),new n("overlayTexScale",(e,r)=>T(o.spherical,e,r))),t.uniforms.add(new n("overlayTexOffset",(e,r)=>O(o.spherical,e,r)),new n("overlayTexScale",(e,r)=>T(o.spherical,e,r))),t.constants.add("overlayOpacity","float",1),t.uniforms.add(new d("ovColorTex",(e,o)=>f(e,o))),C(e,o)}function f(e,o){const r=m(e,o);return null!=r?o.overlay?.getTexture(r):null}function m(e,o){return 0===e.identifier?l(o.output)?!e.occludedGround||o.overlay?.allSourcesOccluders?1:4:3===o.output||4===o.output?1:11===o.output?5:null:2===e.identifier?2:null}function p(e,o){const{vertex:r,fragment:t}=e;r.uniforms.add(new w("overlayTexOffset"),new w("overlayTexScale")),t.uniforms.add(new s("overlayOpacity",e=>e.overlayOpacity)),10!==o.output&&t.uniforms.add(new d("ovColorTex",(e,o)=>o.overlay?.getTexture(e.overlayContent))),C(e,o)}function g(e,o){switch(e){case 0:case 1:case 2:return 9!==o.slot||o.overlay?.allSourcesOccluders?0:4;case 3:case 4:return 0;case 10:return 2;case 5:case 7:case 8:case 9:return null;case 11:return 5}return null}function C(e,o){const{hasWater:r,output:t}=o;r&&e.include(i,o);const{vertex:l,fragment:n,varyings:s}=e;s.add("vtcOverlay","vec4");const d=10===t;l.code.add(v`void setOverlayVTC(in vec2 uv) {
3
3
  vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset;
4
- }`),s.code.add(n`bool isValid(vec2 uv, vec2 dxdy) {
4
+ }`),n.code.add(v`bool isValid(vec2 uv, vec2 dxdy) {
5
5
  return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y);
6
6
  }
7
7
  vec4 getOverlayColor(sampler2D ov0Tex, vec4 texCoords) {
@@ -10,7 +10,7 @@ vec4 color1 = texture(ov0Tex, vec2(texCoords.z * 0.5 + 0.5, texCoords.w));
10
10
  bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy));
11
11
  bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0));
12
12
  return mix(color1 * float(isValid1), color0, float(isValid0));
13
- }`),d?s.uniforms.add(new u("overlayHighlightTexture",(e,o)=>o.overlay?.getTexture(2))).code.add(n`uvec2 getAllOverlayHighlightValuesEncoded(vec4 texCoords) {
13
+ }`),d?n.uniforms.add(new u("overlayHighlightTexture",(e,o)=>o.overlay?.getTexture(2))).code.add(v`uvec2 getAllOverlayHighlightValuesEncoded(vec4 texCoords) {
14
14
  vec2 uvInner = texCoords.xy;
15
15
  vec2 uvOuter = texCoords.zw;
16
16
  bool isValidInner = isValid(uvInner, fwidth(uvInner));
@@ -27,12 +27,12 @@ uvec2(0);
27
27
  }
28
28
  uvec2 getAllOverlayHighlightValuesEncoded() {
29
29
  return getAllOverlayHighlightValuesEncoded(vtcOverlay);
30
- }`):(s.code.add(n`vec4 getCombinedOverlayColor(vec4 texCoords) {
30
+ }`):(n.code.add(v`vec4 getCombinedOverlayColor(vec4 texCoords) {
31
31
  return overlayOpacity * getOverlayColor(ovColorTex, texCoords);
32
32
  }
33
33
  vec4 getCombinedOverlayColor() {
34
34
  return getCombinedOverlayColor(vtcOverlay);
35
- }`),s.code.add(n`vec4 getOverlayColorTexel(vec4 texCoords) {
35
+ }`),n.code.add(v`vec4 getOverlayColorTexel(vec4 texCoords) {
36
36
  vec2 texDim = vec2(textureSize(ovColorTex, 0));
37
37
  vec4 color0 = texelFetch(ovColorTex, ivec2(vec2(texCoords.x * 0.5, texCoords.y) * texDim), 0);
38
38
  vec4 color1 = texelFetch(ovColorTex, ivec2(vec2(texCoords.z * 0.5 + 0.5, texCoords.w) * texDim), 0);
@@ -42,10 +42,10 @@ return mix(color1 * float(isValid1), color0, float(isValid0));
42
42
  }
43
43
  vec4 getOverlayColorTexel() {
44
44
  return getOverlayColorTexel(vtcOverlay);
45
- }`)),r&&(a(s),i(s),s.code.add(n`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir,
45
+ }`)),r&&(a(n),c(n),n.code.add(v`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir,
46
46
  float shadow, vec3 localUp, mat3 tbn, vec3 position, vec3 positionWorld) {
47
47
  vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0)));
48
48
  vec3 v = vposEyeDir;
49
49
  vec3 final = getWaterColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld);
50
50
  return vec4(final, colorInput.w);
51
- }`))}function C(e,o){return e.overlay?.overlays[o]?.extent}function h(e,l,a){const i=T,c=e&&!l.useENUForGlobalOverlayUV,s=c?0:l.toMapSpace[0],v=c?0:l.toMapSpace[1],n=(e,l)=>{const c=C(a,l);o(c)&&(i[e+0]=(s-c[0])/r(c),i[e+1]=(v-c[1])/t(c))};return n(0,0),n(2,1),i}function O(e,l,a){const i=T,c=e&&!l.useENUForGlobalOverlayUV,s=c?1:l.toMapSpace[2],v=c?1:l.toMapSpace[3],n=(e,l)=>{const c=C(a,l);o(c)&&(i[e+0]=s/r(c),i[e+1]=v/t(c))};return n(0,0),n(2,1),i}const T=e();class V extends x{constructor(e){super(e,"vec4")}}export{y as OverlayIM,m as OverlayTerrain,f as getIMColorTexture,g as getOverlayContentForOutputTerrain};
51
+ }`))}function h(e,o){return e.overlay?.overlays[o]?.extent}function O(e,l,a){const c=V,i=e&&!l.useENUForGlobalOverlayUV,n=i?0:l.toMapSpace[0],s=i?0:l.toMapSpace[1],v=(e,l)=>{const i=h(a,l);o(i)&&(c[e+0]=(n-i[0])/r(i),c[e+1]=(s-i[1])/t(i))};return v(0,0),v(2,1),c}function T(e,l,a){const c=V,i=e&&!l.useENUForGlobalOverlayUV,n=i?1:l.toMapSpace[2],s=i?1:l.toMapSpace[3],v=(e,l)=>{const i=h(a,l);o(i)&&(c[e+0]=n/r(i),c[e+1]=s/t(i))};return v(0,0),v(2,1),c}const V=e();class w extends x{constructor(e){super(e,"vec4")}}export{y as OverlayIM,p as OverlayTerrain,f as getIMColorTexture,g as getOverlayContentForOutputTerrain};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../../../../../core/Logger.js";import{abortMaybe as t,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as a}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as h,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as d}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as p}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as b}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as f}from"./SMAAPassParameters.js";import T from"../../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../../webgl/TextureDescriptor.js";let _=class extends m{constructor(e){super(e),this.consumes={required:[c.ANTIALIASING]},this.produces="disabled",this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new f}initialize(){this.addHandles([o(()=>this.isEnabled(),e=>e?this.view.addUpdatingPromise(this.enable()):this.disable(),n)])}async enable(){if(this.destroyed)return;if(this.produces=c.ANTIALIASING,this.requestRender(1),this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await import("./SMAAData.js");i(e),await this._loadTextures(r,e),i(e),this.requestRender(1)}catch(t){a(t)||r.getLogger(this).errorOnce(t)}this._abortController=null}async _loadTextures(e,r){i(r);const[t,s]=await Promise.allSettled([u(e.areaTexture,{signal:r}),u(e.searchTexure,{signal:r})]);if(i(r),"fulfilled"!==t.status||"fulfilled"!==s.status)return;const a=this.renderingContext;this._areaTexture=g(a,9729,6407,t.value),this._searchTexture=g(a,9728,6409,s.value)}disable(){this.produces="disabled",this.requestRender(1)}destroy(){this._abortController=t(this._abortController),this._searchTexture=s(this._searchTexture),this._areaTexture=s(this._areaTexture)}render(){const e=this.input,r=this.techniques.getCompiled(b),t=this.techniques.getCompiled(d),s=this.techniques.getCompiled(p);if(!(this._areaTexture&&this._searchTexture&&r&&t&&s))return this.requestRender(1),e;const{width:i,height:a}=e.fbo,o=this.renderingContext;o.setViewport(0,0,i,a);const n=this.fboCache.acquire(i,a,"smaa edges",2);o.bindFramebuffer(n.fbo),o.setClearColor(0,0,0,1),o.clear(16384),this._smaaParameters.color=e.getTexture();const h=this.bindParameters;o.bindTechnique(r,h,this._smaaParameters),o.screen.draw();const l=this.fboCache.acquire(i,a,"smaa blend");o.bindFramebuffer(l.fbo),o.setClearColor(0,0,1,1),o.clear(16384),this._smaaParameters.inputTexture=n.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,o.bindTechnique(t,h,this._smaaParameters),o.screen.draw(),n.release();const u=this.fboCache.acquire(i,a,c.ANTIALIASING);return o.bindFramebuffer(u.fbo),o.setClearColor(0,1,0,1),o.clear(16384),this._smaaParameters.inputTexture=l.getTexture(),o.bindTechnique(s,h,this._smaaParameters),o.screen.draw(),l.release(),u.moveAttachments(e),u}};function g(e,r,t,s){const i=new x(s.width,s.height);return i.pixelFormat=t,i.wrapMode=33071,i.samplingMode=r,new T(e,i,s)}e([h()],_.prototype,"consumes",void 0),e([h()],_.prototype,"produces",void 0),e([h({constructOnly:!0})],_.prototype,"isEnabled",void 0),e([h()],_.prototype,"_abortController",void 0),_=e([l("esri.views.3d.webgl-engine.effects.smaa.SMAA")],_);export{_ as SMAA};
2
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Logger.js";import{abortMaybe as t,disposeMaybe as s}from"../../../../../core/maybe.js";import{throwIfAborted as i,isAbortError as a}from"../../../../../core/promiseUtils.js";import{watch as o,syncAndInitial as n}from"../../../../../core/reactiveUtils.js";import{property as h,subclass as l}from"../../../../../core/accessorSupport/decorators.js";import{requestImage as u}from"../../../../../request/image.js";import{InternalRenderCategory as c}from"../../../webgl.js";import m from"../../../webgl/RenderNode.js";import{SMAABlendWeightsTechnique as d}from"./SMAABlendWeightsTechnique.js";import{SMAABlurTechnique as p}from"./SMAABlurTechnique.js";import{SMAAEdgeDetectTechnique as b}from"./SMAAEdgeDetectTechnique.js";import{SMAAPassParameters as f}from"./SMAAPassParameters.js";import T from"../../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../../webgl/TextureDescriptor.js";let _=class extends m{constructor(e){super(e),this.consumes={required:[c.ANTIALIASING]},this.produces="disabled",this._areaTexture=null,this._searchTexture=null,this._smaaParameters=new f}initialize(){this.addHandles([o(()=>this.isEnabled(),e=>e?this.view.addUpdatingPromise(this.enable()):this.disable(),n)])}async enable(){if(this.destroyed)return;if(this.produces=c.ANTIALIASING,this.requestRender(1),this._abortController||this._areaTexture&&this._searchTexture)return;this._abortController=new AbortController;const e=this._abortController.signal;try{const r=await(import("./SMAAData.js"));i(e),await this._loadTextures(r,e),i(e),this.requestRender(1)}catch(t){a(t)||r.getLogger(this).errorOnce(t)}this._abortController=null}async _loadTextures(e,r){i(r);const[t,s]=await Promise.allSettled([u(e.areaTexture,{signal:r}),u(e.searchTexure,{signal:r})]);if(i(r),"fulfilled"!==t.status||"fulfilled"!==s.status)return;const a=this.renderingContext;this._areaTexture=g(a,9729,6407,t.value),this._searchTexture=g(a,9728,6409,s.value)}disable(){this.produces="disabled",this.requestRender(1)}destroy(){this._abortController=t(this._abortController),this._searchTexture=s(this._searchTexture),this._areaTexture=s(this._areaTexture)}render(){const e=this.input,r=this.techniques.getCompiled(b),t=this.techniques.getCompiled(d),s=this.techniques.getCompiled(p);if(!(this._areaTexture&&this._searchTexture&&r&&t&&s))return this.requestRender(1),e;const{width:i,height:a}=e.fbo,o=this.renderingContext;o.setViewport(0,0,i,a);const n=this.fboCache.acquire(i,a,"smaa edges",2);o.bindFramebuffer(n.fbo),o.setClearColor(0,0,0,1),o.clear(16384),this._smaaParameters.color=e.getTexture();const h=this.bindParameters;o.bindTechnique(r,h,this._smaaParameters),o.screen.draw();const l=this.fboCache.acquire(i,a,"smaa blend");o.bindFramebuffer(l.fbo),o.setClearColor(0,0,1,1),o.clear(16384),this._smaaParameters.inputTexture=n.getTexture(),this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,o.bindTechnique(t,h,this._smaaParameters),o.screen.draw(),n.release();const u=this.fboCache.acquire(i,a,c.ANTIALIASING);return o.bindFramebuffer(u.fbo),o.setClearColor(0,1,0,1),o.clear(16384),this._smaaParameters.inputTexture=l.getTexture(),o.bindTechnique(s,h,this._smaaParameters),o.screen.draw(),l.release(),u.moveAttachments(e),u}};function g(e,r,t,s){const i=new x(s.width,s.height);return i.pixelFormat=t,i.wrapMode=33071,i.samplingMode=r,new T(e,i,s)}e([h()],_.prototype,"consumes",void 0),e([h()],_.prototype,"produces",void 0),e([h({constructOnly:!0})],_.prototype,"isEnabled",void 0),e([h()],_.prototype,"_abortController",void 0),_=e([l("esri.views.3d.webgl-engine.effects.smaa.SMAA")],_);export{_ as SMAA};