@arcgis/core 5.0.0-next.1 → 5.0.0-next.11

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 (974) hide show
  1. package/Map.js +1 -1
  2. package/PopupTemplate.js +1 -1
  3. package/analysis/ElevationProfileAnalysis.js +1 -1
  4. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.js +1 -1
  5. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +5 -0
  6. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  7. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +4 -0
  8. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +5 -0
  9. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +1 -0
  10. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  11. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +2 -0
  12. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  13. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  14. package/arcade/featureset/actions/Adapted.js +1 -1
  15. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  16. package/arcade/featureset/actions/GroupBy.js +1 -1
  17. package/arcade/featureset/actions/OrderBy.js +1 -1
  18. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  19. package/arcade/featureset/actions/Top.js +1 -1
  20. package/arcade/featureset/sources/Empty.js +1 -1
  21. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  22. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  23. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  24. package/arcade/featureset/support/FeatureSet.js +1 -1
  25. package/arcade/featureset/support/sqlUtils.js +1 -1
  26. package/arcade/featureset/support/stats.js +1 -1
  27. package/arcade/functions/featuresetbase.js +1 -1
  28. package/arcade/functions/featuresetstring.js +1 -1
  29. package/arcade/functions/knowledgegraph.js +1 -1
  30. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  31. package/assets/esri/core/workers/RemoteClient.js +1 -1
  32. package/assets/esri/core/workers/chunks/{1a713dcc9971e1935401.js → 0030d68d9edf42b4af57.js} +1 -1
  33. package/assets/esri/core/workers/chunks/00c77f03dd511c6dbff2.js +1 -0
  34. package/assets/esri/core/workers/chunks/01d460398f3ba6767a37.js +1 -0
  35. package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +1 -0
  36. package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +1 -0
  37. package/assets/esri/core/workers/chunks/{14ace5dc4b8984212a57.js → 042cd64e1f4eb326c30f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{66db5f77e09d25e33951.js → 063905fbf9a0c6586949.js} +1 -1
  39. package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +1 -0
  40. package/assets/esri/core/workers/chunks/092d72caf3269e696d1c.js +1 -0
  41. package/assets/esri/core/workers/chunks/{89027f6800e17fab8973.js → 0a5d74414dd02a2fb8e1.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{3815ffa13e7b439bca6e.js → 0d5212f59e9b62c16164.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{388482cea4b9fdeaf06e.js → 0f30a9514571c7be9978.js} +1 -1
  44. package/assets/esri/core/workers/chunks/0f735b0dec173142f3b6.js +2 -0
  45. package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
  46. package/assets/esri/core/workers/chunks/{e032f3d2ee19790f8c79.js → 11e96a312f1294d34c50.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{309c5f69ea06f3081d83.js → 1257c37bf04d39c27b62.js} +1 -1
  48. package/assets/esri/core/workers/chunks/125e71b0e29d1d132777.js +1 -0
  49. package/assets/esri/core/workers/chunks/{1e4e7aedf4b779241a02.js → 15c7c10ff9ac63f0e792.js} +1 -1
  50. package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +1 -0
  51. package/assets/esri/core/workers/chunks/18c5d79d5ee1136e0a57.js +1 -0
  52. package/assets/esri/core/workers/chunks/{f03635ddf56e2ef90e4c.js → 1d06fcae4c2f02fb1c95.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{8cea114168d849c38b1b.js → 20278683bddc8c2d8136.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{d84373a6ec94dcfec8c2.js → 24cd7b84cd0f3de4bff2.js} +1 -1
  56. package/assets/esri/core/workers/chunks/27e6a6c5610007ac6a54.js +1 -0
  57. package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +1 -0
  58. package/assets/esri/core/workers/chunks/{94c9d3094c93f7760433.js → 29286234be26680245f6.js} +1 -1
  59. package/assets/esri/core/workers/chunks/292daac70bb828e4923f.js +1 -0
  60. package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +1 -0
  61. package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +1 -0
  62. package/assets/esri/core/workers/chunks/{4f01be74dd26e639330f.js → 2f24017e72d41c259faa.js} +1 -1
  63. package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +1 -0
  64. package/assets/esri/core/workers/chunks/30e220f4f843681a4cdd.js +1 -0
  65. package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +1 -0
  66. package/assets/esri/core/workers/chunks/{5d3661d1fe46dd29aae9.js → 311b564e44ae637c960d.js} +1 -1
  67. package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +1 -0
  68. package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +1 -0
  69. package/assets/esri/core/workers/chunks/37c1f155da14de91565a.js +1 -0
  70. package/assets/esri/core/workers/chunks/37f2ef14399546e697e6.js +1 -0
  71. package/assets/esri/core/workers/chunks/38ee69125da60464d5a1.js +1 -0
  72. package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +1 -0
  73. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  74. package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 3ac7562ea90f91a9f30c.js} +1 -1
  75. package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +1 -0
  76. package/assets/esri/core/workers/chunks/4291681d067ebdf86e73.js +1 -0
  77. package/assets/esri/core/workers/chunks/{e9311386f58f3cb95c22.js → 42a1e71d09e8583a7327.js} +1 -1
  78. package/assets/esri/core/workers/chunks/442973ff4dda923def62.js +1 -0
  79. package/assets/esri/core/workers/chunks/443dfe7029ec208f670c.js +1 -0
  80. package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +1 -0
  81. package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +1 -0
  82. package/assets/esri/core/workers/chunks/{b75930d60449eceb0f1c.js → 4baf6f6e7ddedb25f806.js} +1 -1
  83. package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +1 -0
  84. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +1 -0
  85. package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +1 -0
  86. package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +1 -0
  87. package/assets/esri/core/workers/chunks/509392131ec473d6b988.js +1 -0
  88. package/assets/esri/core/workers/chunks/{2ea6985da4eb0107bb9d.js → 51ab2acac4ecc1ca9c34.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{fc4417d1260b717a9385.js → 52282f767bd0e99ddca0.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 53654edd766d9b4ef750.js} +1 -1
  91. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +1 -0
  92. package/assets/esri/core/workers/chunks/{ed8a85efbd90241512bb.js → 588533c3abe876f20f62.js} +1 -1
  93. package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +1 -0
  94. package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +1 -0
  95. package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +1 -0
  96. package/assets/esri/core/workers/chunks/{72846fb9c87c6642daf0.js → 5e2ce34def5e053913b2.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{b7a17927e14f502006b4.js → 5ea0c62016d56990787b.js} +1 -1
  98. package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +1 -0
  99. package/assets/esri/core/workers/chunks/{2ce4a0fe4fae63c43a81.js → 61d970ed75c2c358b1e9.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{7a6a96edc892d7060b7d.js → 629127877042ad784ad2.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{00aa85ae6419aad183ea.js → 6293e33f304c4952f88c.js} +1 -1
  102. package/assets/esri/core/workers/chunks/655beaf83e9845a02334.js +1 -0
  103. package/assets/esri/core/workers/chunks/664ae441617afe4b17ec.js +1 -0
  104. package/assets/esri/core/workers/chunks/67f03d042455cd0f7009.js +1 -0
  105. package/assets/esri/core/workers/chunks/{ec13053af1999701464a.js → 6826fe54562dcdc054d7.js} +1 -1
  106. package/assets/esri/core/workers/chunks/6cf391b5ed7351601a2a.js +1 -0
  107. package/assets/esri/core/workers/chunks/{8215015f11221a354273.js → 6d049182bec34a22abcd.js} +1 -1
  108. package/assets/esri/core/workers/chunks/6d9f2b113d6bde936a04.js +1 -0
  109. package/assets/esri/core/workers/chunks/{5132ca68e8c7af111a47.js → 6e22b02a9715c10578d0.js} +1 -1
  110. package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +1 -0
  111. package/assets/esri/core/workers/chunks/{deb2854bb7d082a26f52.js → 7005d956c990a04ee8b2.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{c73def15ccfb2a32afa8.js → 7290e7a819eb291b1df2.js} +4 -4
  113. package/assets/esri/core/workers/chunks/731f7b552dde0fb325cd.js +1 -0
  114. package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
  115. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
  116. package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +1 -0
  117. package/assets/esri/core/workers/chunks/773f2c6c9d38db76dfed.js +1 -0
  118. package/assets/esri/core/workers/chunks/7803495f8862d9025bcd.js +1 -0
  119. package/assets/esri/core/workers/chunks/79dbfa2b9b332ca0002f.js +1 -0
  120. package/assets/esri/core/workers/chunks/7a23ab84e1144f081c92.js +1 -0
  121. package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +1 -0
  122. package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +1 -0
  123. package/assets/esri/core/workers/chunks/826fa0dfb63df77bfd95.js +1 -0
  124. package/assets/esri/core/workers/chunks/8372f142c4d7a65c7954.js +1 -0
  125. package/assets/esri/core/workers/chunks/87921f3fa9001f5801ed.js +1 -0
  126. package/assets/esri/core/workers/chunks/8cd03b54b2859b52fb81.js +1 -0
  127. package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 8f3503b2fb6cd38757b9.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{e7638b9ab6674bc8a18f.js → 91dfd29e2dba200eab09.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{de1f75c907152df7e788.js → 9698f36c143953a975d4.js} +1 -1
  130. package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +1 -0
  131. package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +1 -0
  132. package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +1 -0
  133. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
  134. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
  135. package/assets/esri/core/workers/chunks/a091623bbfb3d771c8d8.js +1 -0
  136. package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +1 -0
  137. package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +1 -0
  138. package/assets/esri/core/workers/chunks/a470f662d73aa8d5d90f.js +1 -0
  139. package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +1 -0
  140. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  141. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +1 -0
  142. package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +1 -0
  143. package/assets/esri/core/workers/chunks/{135e270b4f03c4270870.js → af47272aaaef0ea57e71.js} +1 -1
  144. package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +1 -0
  145. package/assets/esri/core/workers/chunks/b193de09e005b0976a6a.js +1 -0
  146. package/assets/esri/core/workers/chunks/{bc3bcf88b252760e2574.js → b3028b1ff75eafd0c358.js} +1 -1
  147. package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +1 -0
  148. package/assets/esri/core/workers/chunks/{79968c183135281d2a6f.js → b3613a38178cad2ebc82.js} +1 -1
  149. package/assets/esri/core/workers/chunks/b6853c6a25eaabc9a7f6.js +1 -0
  150. package/assets/esri/core/workers/chunks/b8a3f1e60e24a13749c1.js +1 -0
  151. package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +1 -0
  152. package/assets/esri/core/workers/chunks/bb7976e2f883b544add6.js +1 -0
  153. package/assets/esri/core/workers/chunks/{56916e56c20465428dd4.js → be3b874f86f627f4fa98.js} +1 -1
  154. package/assets/esri/core/workers/chunks/c29486c4eeb3e72effff.js +1 -0
  155. package/assets/esri/core/workers/chunks/{2b94623cabc6ae0f86ce.js → c37f7756d48ff9af2656.js} +1 -1
  156. package/assets/esri/core/workers/chunks/{1c52999a6392370844a6.js → c4090a60d149a5962179.js} +1 -1
  157. package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +1 -0
  158. package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +1 -0
  159. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +1 -0
  160. package/assets/esri/core/workers/chunks/{73c1d43070b4fe1e5c1e.js → c8e686efe344a33a0258.js} +1 -1
  161. package/assets/esri/core/workers/chunks/{6bb5158de43c4b59107f.js → c9b16fd41cd59d452522.js} +1 -1
  162. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  163. package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +1 -0
  164. package/assets/esri/core/workers/chunks/d07f911d40bf05fc0306.js +1 -0
  165. package/assets/esri/core/workers/chunks/d1ca7c3a32ce00ed8b81.js +1 -0
  166. package/assets/esri/core/workers/chunks/{630efe10c871425b6a95.js → d1e97cce5047f1791e22.js} +1 -1
  167. package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +1 -0
  168. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → d391bfbaf0e790cd10d6.js} +2 -2
  169. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
  170. package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +1 -0
  171. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  172. package/assets/esri/core/workers/chunks/{d570c75a425aa29672c8.js → da24ad57747714ac5eda.js} +1 -1
  173. package/assets/esri/core/workers/chunks/{7e43c105f1cfc44b7bd0.js → dc51438b832551924a9e.js} +1 -1
  174. package/assets/esri/core/workers/chunks/dc66490520f97eef15bf.js +316 -0
  175. package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +1 -0
  176. package/assets/esri/core/workers/chunks/{cfa3164e7fa1884dc2b9.js → ddfd01bb9ba8577c3ffc.js} +1 -1
  177. package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +1 -0
  178. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  179. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +1 -0
  180. package/assets/esri/core/workers/chunks/dff2df259f140b7d97a9.js +1 -0
  181. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  182. package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +1 -0
  183. package/assets/esri/core/workers/chunks/{da573ecc68e6aa8f6da9.js → e767f83f9e2de6650f80.js} +1 -1
  184. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  185. package/assets/esri/core/workers/chunks/{91df8638b8b904e6d8c5.js → ead8d0cbcebd12dbfad7.js} +1 -1
  186. package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +1 -0
  187. package/assets/esri/core/workers/chunks/eb9c166db0db6fa60e95.js +1 -0
  188. package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +1 -0
  189. package/assets/esri/core/workers/chunks/{16d66770ef841564ee3f.js → ee5aa11750c51b220f1e.js} +1 -1
  190. package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
  191. package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +1 -0
  192. package/assets/esri/core/workers/chunks/{5875a51b97ee9bd438a0.js → f34e3fa0c5b28531e289.js} +1 -1
  193. package/assets/esri/core/workers/chunks/f57401a759f420596b2c.js +1 -0
  194. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  195. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  196. package/assets/esri/core/workers/chunks/{fa4411e0a5ac3fcba365.js → f65c0102af17390a50ac.js} +1 -1
  197. package/assets/esri/core/workers/chunks/f6c11c8ac687de3ef1ab.js +1 -0
  198. package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +1 -0
  199. package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +1 -0
  200. package/assets/esri/core/workers/chunks/f80f5dbf96c343ac4df6.js +1 -0
  201. package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +1 -0
  202. package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +1 -0
  203. package/assets/esri/core/workers/chunks/fbd8d2f61f8a15bcf3db.js +1 -0
  204. package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
  205. package/assets/esri/core/workers/chunks/{2f78861afe0e9037dd8d.js → fe49321dca22dc60d105.js} +1 -1
  206. package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +1 -0
  207. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  208. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  209. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  210. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  211. package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -0
  212. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
  213. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
  214. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
  215. package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
  216. package/assets/esri/themes/dark/main.css +1 -1
  217. package/assets/esri/themes/light/main.css +1 -1
  218. package/assets/esri/themes/light/view.css +1 -1
  219. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ar.json +1 -1
  220. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bg.json +1 -1
  221. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bs.json +1 -1
  222. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ca.json +1 -1
  223. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_cs.json +1 -1
  224. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_da.json +1 -1
  225. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_de.json +1 -1
  226. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_el.json +1 -1
  227. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_es.json +1 -1
  228. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_et.json +1 -1
  229. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fi.json +1 -1
  230. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fr.json +1 -1
  231. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_he.json +1 -1
  232. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hr.json +1 -1
  233. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hu.json +1 -1
  234. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_id.json +1 -1
  235. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_it.json +1 -1
  236. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ja.json +1 -1
  237. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ko.json +1 -1
  238. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lt.json +1 -1
  239. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lv.json +1 -1
  240. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_nl.json +1 -1
  241. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_no.json +1 -1
  242. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pl.json +1 -1
  243. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-BR.json +1 -1
  244. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-PT.json +1 -1
  245. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ro.json +1 -1
  246. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ru.json +1 -1
  247. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sk.json +1 -1
  248. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sl.json +1 -1
  249. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sr.json +1 -1
  250. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sv.json +1 -1
  251. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_th.json +1 -1
  252. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_tr.json +1 -1
  253. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_uk.json +1 -1
  254. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_vi.json +1 -1
  255. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-CN.json +1 -1
  256. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-HK.json +1 -1
  257. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-TW.json +1 -1
  258. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  259. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  260. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  261. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  262. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  263. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  264. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  265. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  266. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  267. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  268. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  269. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  270. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  271. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  272. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  273. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  274. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  275. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  276. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  277. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  278. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  279. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  280. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  281. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  282. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  283. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  284. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  285. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  286. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  287. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  288. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  289. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  290. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  291. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  292. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  293. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  294. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  295. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  296. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  297. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  298. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  299. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  300. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  301. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  302. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  303. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  304. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  305. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  306. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  307. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  308. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  309. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  310. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  311. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  312. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  313. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  314. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  315. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  316. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  317. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  318. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  319. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  320. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  321. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  322. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  323. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  324. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  325. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  326. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  327. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  328. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  329. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  330. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  331. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  332. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  333. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  334. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  335. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  336. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  337. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  338. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  339. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  340. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  341. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  342. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  343. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  344. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  345. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  346. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  347. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  348. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  349. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  350. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  351. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  352. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  353. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  354. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  355. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  356. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  357. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  358. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  359. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  360. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  361. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  362. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  363. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  364. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  365. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  366. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  367. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  368. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  369. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  370. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  371. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  372. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  373. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  374. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  375. package/chunks/ComponentShader.glsl.js +72 -39
  376. package/chunks/Envelope.js +1 -1
  377. package/chunks/Geometry.js +1 -1
  378. package/chunks/MultiPathImpl.js +1 -1
  379. package/chunks/OITBlend.glsl.js +3 -3
  380. package/chunks/Point2D.js +1 -1
  381. package/chunks/UnitFactory.js +1 -1
  382. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  383. package/chunks/arcgis-knowledge-client-core.js +1 -1
  384. package/chunks/bundle.js +1 -1
  385. package/chunks/containsOperator.js +1 -1
  386. package/chunks/densifyOperator.js +1 -1
  387. package/chunks/differenceOperator.js +1 -1
  388. package/chunks/intersectsOperator.js +1 -1
  389. package/chunks/persistableUrlUtils.js +1 -1
  390. package/config.js +1 -1
  391. package/core/Identifiable.js +1 -1
  392. package/core/MultiOriginJSONSupport.js +1 -1
  393. package/core/NumericIdentifiable.js +5 -0
  394. package/core/QueueProcessor.js +1 -1
  395. package/core/SetUtils.js +1 -1
  396. package/core/WriteableMultiOriginJSONMixin.js +5 -0
  397. package/core/dedupeResult.js +5 -0
  398. package/core/has.js +1 -1
  399. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  400. package/{views/3d/support/ImageWithType.js → core/performance.js} +1 -1
  401. package/core/sanitizerUtils.js +1 -1
  402. package/core/scheduling.js +1 -1
  403. package/core/unitUtils.js +1 -1
  404. package/core/workers/Connection.js +1 -1
  405. package/core/workers/WorkerHandle.js +1 -1
  406. package/core/workers/utils.js +1 -1
  407. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  408. package/form/FormTemplate.js +1 -1
  409. package/form/elements/Element.js +1 -1
  410. package/form/elements/FieldElement.js +1 -1
  411. package/form/elements/GroupElement.js +1 -1
  412. package/geohash/GeohashCell.js +1 -1
  413. package/geohash/geohashUtils.js +1 -1
  414. package/geometry/Extent.js +1 -1
  415. package/geometry/Geometry.js +1 -1
  416. package/geometry/GeometryCursor.js +1 -1
  417. package/geometry/Point.js +1 -1
  418. package/geometry/SpatialReference.js +1 -1
  419. package/geometry/ellipsoidUtils.js +1 -1
  420. package/geometry/geometryCursorCollectUtils.js +1 -1
  421. package/geometry/libtess.js +1 -1
  422. package/geometry/operators/gx/operatorOffset.js +1 -1
  423. package/geometry/operators/support/jsonConverter.js +1 -1
  424. package/geometry/support/MeshTransform.js +1 -1
  425. package/geometry/support/axisAngleDegrees.js +1 -1
  426. package/geometry/support/jsonUtils.js +1 -1
  427. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  428. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  429. package/geometry/support/meshUtils/rotate.js +1 -1
  430. package/geometry/support/meshUtils/scale.js +1 -1
  431. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  432. package/geometry/support/normalizeUtilsSync.js +1 -1
  433. package/geometry/support/plane.js +1 -1
  434. package/geometry/support/polygonUtils.js +1 -1
  435. package/geometry/support/triangulationUtils.js +1 -1
  436. package/identity/Credential.js +1 -1
  437. package/identity/IdentityManager.js +1 -1
  438. package/identity/IdentityManagerBase.js +1 -1
  439. package/interfaces.d.ts +2091 -462
  440. package/intl/date.js +1 -1
  441. package/intl.d.ts +2 -0
  442. package/intl.js +1 -1
  443. package/kernel.js +1 -1
  444. package/layers/FeatureLayer.js +1 -1
  445. package/layers/KnowledgeGraphLayer.js +1 -1
  446. package/layers/Layer.js +1 -1
  447. package/layers/LinkChartLayer.js +1 -1
  448. package/layers/MapNotesLayer.js +1 -1
  449. package/layers/OrientedImageryLayer.js +1 -1
  450. package/layers/SceneLayer.js +1 -1
  451. package/layers/graphics/OptimizedFeature.js +1 -1
  452. package/layers/graphics/OptimizedGeometry.js +1 -1
  453. package/layers/graphics/centroid.js +1 -1
  454. package/layers/graphics/contains.js +1 -1
  455. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  456. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  457. package/layers/graphics/data/AttributesBuilder.js +1 -1
  458. package/layers/graphics/data/FeatureStore.js +1 -1
  459. package/layers/graphics/data/QueryEngine.js +1 -1
  460. package/layers/graphics/data/QueryEngineResult.js +1 -1
  461. package/layers/graphics/data/geometryUtils.js +1 -1
  462. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  463. package/layers/graphics/featureConversionUtils.js +1 -1
  464. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  465. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  466. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  467. package/layers/graphics/sources/geojson/geojson.js +1 -1
  468. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  469. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  470. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  471. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  472. package/layers/knowledgeGraph/layerUtils.js +1 -1
  473. package/layers/mixins/ArcGISImageService.js +1 -1
  474. package/layers/mixins/ImageryTileMixin.js +1 -1
  475. package/layers/ogc/ogcFeatureUtils.js +1 -1
  476. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  477. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  478. package/layers/save/groupLayerUtils.js +1 -1
  479. package/layers/support/DateTimeFieldFormat.js +1 -1
  480. package/layers/support/FieldFormat.js +1 -1
  481. package/layers/support/MediaElementBase.js +1 -1
  482. package/layers/support/NumberFieldFormat.js +1 -1
  483. package/layers/support/PixelBlock.js +1 -1
  484. package/layers/support/RasterInfo.js +1 -1
  485. package/layers/support/RasterJobHandler.js +1 -1
  486. package/layers/support/RasterSensorInfo.js +1 -1
  487. package/layers/support/RasterStorageInfo.js +1 -1
  488. package/layers/support/RasterWorker.js +1 -1
  489. package/layers/support/Sublayer.js +1 -1
  490. package/layers/support/TitleCreator.js +1 -1
  491. package/layers/support/arcgisLayerUrl.js +1 -1
  492. package/layers/support/capabilities.js +1 -1
  493. package/layers/support/fieldConfigUtils.js +1 -1
  494. package/layers/support/fieldFormatUtils.js +1 -1
  495. package/layers/support/fieldUtils.js +1 -1
  496. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  497. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  498. package/layers/support/rasterFieldUtils.js +1 -1
  499. package/layers/support/rasterFunctions/pixelTransformUtils.js +5 -0
  500. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  501. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  502. package/layers/support/source/DataLayerSource.js +1 -1
  503. package/networks/CircuitManager.d.ts +4 -0
  504. package/networks/UnitIdentifierManager.d.ts +4 -0
  505. package/networks/support/Circuit.d.ts +4 -0
  506. package/networks/support/CircuitLocation.d.ts +4 -0
  507. package/networks/support/CircuitPath.d.ts +4 -0
  508. package/networks/support/CircuitPathConnectivityElement.d.ts +4 -0
  509. package/networks/support/CircuitSection.d.ts +4 -0
  510. package/networks/support/Subcircuit.d.ts +4 -0
  511. package/package.json +5 -5
  512. package/popup/ExpressionInfo.js +1 -1
  513. package/popup/FieldInfo.js +1 -1
  514. package/popup/content/AttachmentsContent.js +1 -1
  515. package/popup/content/BarChartMediaInfo.js +1 -1
  516. package/popup/content/ColumnChartMediaInfo.js +1 -1
  517. package/popup/content/Content.js +1 -1
  518. package/popup/content/CustomContent.js +1 -1
  519. package/popup/content/ExpressionContent.js +1 -1
  520. package/popup/content/FieldsContent.js +1 -1
  521. package/popup/content/ImageMediaInfo.js +1 -1
  522. package/popup/content/LineChartMediaInfo.js +1 -1
  523. package/popup/content/MediaContent.js +1 -1
  524. package/popup/content/PieChartMediaInfo.js +1 -1
  525. package/popup/content/RelationshipContent.js +1 -1
  526. package/popup/content/TextContent.js +1 -1
  527. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  528. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  529. package/popup/content/mixins/MediaInfo.js +1 -1
  530. package/popup/content.js +1 -1
  531. package/popup/support/FieldInfoFormat.js +1 -1
  532. package/processRequest.js +5 -0
  533. package/request.js +1 -1
  534. package/requestConfig.js +5 -0
  535. package/requestQueue.js +5 -0
  536. package/rest/geometryService/utils.js +1 -1
  537. package/rest/networks/circuits/support/CircuitTraceResult.d.ts +4 -0
  538. package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +4 -0
  539. package/rest/networks/support/TelecomNetworkElement.d.ts +4 -0
  540. package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +4 -0
  541. package/rest/print.js +1 -1
  542. package/rest/query/executeForCount.js +1 -1
  543. package/rest/query/executeForExtent.js +1 -1
  544. package/rest/query/executeForIds.js +1 -1
  545. package/rest/query/executeQueryJSON.js +1 -1
  546. package/rest/query/executeQueryPBF.js +1 -1
  547. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  548. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  549. package/rest/query/operations/query.js +1 -1
  550. package/rest/query/operations/queryZScale.js +1 -1
  551. package/rest/support/BaseImageMeasureResultValue.js +5 -0
  552. package/rest/support/ImageAreaResult.js +1 -1
  553. package/rest/support/ImageDistanceResult.js +1 -1
  554. package/rest/support/ImageHeightResult.js +1 -1
  555. package/rest/support/ImageMeasureResultAngleValue.js +5 -0
  556. package/rest/support/ImageMeasureResultAreaValue.js +5 -0
  557. package/rest/support/ImageMeasureResultLengthValue.js +5 -0
  558. package/rest/support/ImageWithType.js +5 -0
  559. package/rest/support/imageMeasureUtils.js +1 -1
  560. package/rest/versionManagement/getVersionInfos.js +1 -1
  561. package/smartMapping/renderers/size.js +1 -1
  562. package/smartMapping/statistics/histogram.js +1 -1
  563. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  564. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  565. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  566. package/smartMapping/support/adapters/support/utils.js +1 -1
  567. package/smartMapping/support/utils.js +1 -1
  568. package/support/basemapDefinitions.js +1 -1
  569. package/support/elevationInfoUtils.js +1 -1
  570. package/support/requestImageUtils.js +1 -1
  571. package/support/revision.js +1 -1
  572. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  573. package/symbols/support/utils.js +1 -1
  574. package/time/TimeExtent.js +1 -1
  575. package/undoredo/support/Services.js +1 -1
  576. package/views/2d/GoToManager.js +1 -1
  577. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  578. package/views/2d/constraints/GeometryConstraint.js +1 -1
  579. package/views/2d/constraints/RotationConstraint.js +1 -1
  580. package/views/2d/constraints/ZoomConstraint.js +1 -1
  581. package/views/2d/engine/Bitmap.js +1 -1
  582. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  583. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  584. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  585. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  586. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  587. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  588. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  589. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  590. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  591. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  592. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  593. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  594. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  595. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  596. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  597. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  598. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  599. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  600. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  601. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  602. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  603. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  604. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  605. package/views/2d/layers/features/schema/ExceedsLimitCache.js +5 -0
  606. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  607. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  608. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  609. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  610. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  611. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  612. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  613. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  614. package/views/2d/layers/features/sources/strategies/constants.js +5 -0
  615. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  616. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  617. package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
  618. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  619. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  620. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  621. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  622. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  623. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  624. package/views/3d/FocusAreasView.js +1 -1
  625. package/views/3d/GroundView3D.js +1 -1
  626. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  627. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  628. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  629. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  630. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  631. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  632. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +5 -0
  633. package/views/3d/environment/CloudsRenderer.js +1 -1
  634. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  635. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  636. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  637. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  638. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  639. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  640. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  641. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  642. package/views/3d/layers/FlowSubView3D.js +1 -1
  643. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  644. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  645. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  646. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  647. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  648. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  649. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  650. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  651. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  652. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  653. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  654. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  655. package/views/3d/layers/graphics/Labeler.js +1 -1
  656. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  657. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  658. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  659. package/views/3d/layers/graphics/pipeline/featureSet/PBFPointFeatureSetView.js +1 -1
  660. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  661. package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
  662. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  663. package/views/3d/layers/i3s/I3SDataRequester.js +5 -0
  664. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  665. package/views/3d/layers/i3s/I3SNode.js +1 -1
  666. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  667. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  668. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  669. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  670. package/views/3d/layers/support/FeatureTile.js +1 -1
  671. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  672. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  673. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  674. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  675. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  676. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +5 -0
  677. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  678. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  679. package/views/3d/layers/support/fetchTile.js +1 -1
  680. package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
  681. package/views/3d/state/ViewStateManager.js +1 -1
  682. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  683. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  684. package/views/3d/state/controllers/RotateController.js +1 -1
  685. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  686. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  687. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  688. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  689. package/views/3d/state/utils/navigationUtils.js +1 -1
  690. package/views/3d/support/DisplayQualityProfile.js +1 -1
  691. package/views/3d/support/QualitySettings.js +1 -1
  692. package/views/3d/support/ResourceController.js +1 -1
  693. package/views/3d/support/SharedSymbolResources.js +1 -1
  694. package/views/3d/support/StreamTextureCollection.js +1 -1
  695. package/views/3d/support/engineContent/line.js +1 -1
  696. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  697. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  698. package/views/3d/support/flow/FlowWorker.js +1 -1
  699. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  700. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  701. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  702. package/views/3d/support/flow/constants.js +1 -1
  703. package/views/3d/support/flow/geometryUtils.js +1 -1
  704. package/views/3d/support/hitTest.js +1 -1
  705. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  706. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  707. package/views/3d/terrain/OverlayRenderer.js +1 -1
  708. package/views/3d/terrain/TerrainSurface.js +1 -1
  709. package/views/3d/terrain/Tile.js +1 -1
  710. package/views/3d/terrain/TileOverlayData.js +1 -1
  711. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  712. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  713. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  714. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  715. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  716. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
  717. package/views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js +5 -0
  718. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConstructionContext.js +1 -1
  719. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  720. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  721. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  722. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  723. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  724. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  725. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  726. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  727. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  728. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  729. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +10 -4
  730. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  731. package/views/DOMContainer.js +1 -1
  732. package/views/SceneView.js +1 -1
  733. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  734. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  735. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  736. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  737. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  738. package/views/analysis/ElevationProfile/constants.js +1 -1
  739. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  740. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  741. package/views/analysis/ElevationProfile/elevationProfileLayerUtils.js +5 -0
  742. package/views/draw/DrawOperation.js +1 -1
  743. package/views/draw/MultipointDrawAction.js +1 -1
  744. package/views/draw/PointDrawAction.js +1 -1
  745. package/views/draw/PolygonDrawAction.js +1 -1
  746. package/views/draw/PolylineDrawAction.js +1 -1
  747. package/views/draw/SegmentDrawAction.js +1 -1
  748. package/views/draw/input/CursorUpdateEvents.js +5 -0
  749. package/views/draw/input/DrawCompleteEvent.js +5 -0
  750. package/views/draw/input/VertexAddEvent.js +5 -0
  751. package/views/draw/input/VertexRemoveEvent.js +5 -0
  752. package/views/draw/input/VertexUpdateEvent.js +5 -0
  753. package/views/draw/support/Reshape.js +1 -1
  754. package/views/draw/support/reshapeUtils.js +1 -1
  755. package/views/draw/support/tooltipUtils.js +1 -1
  756. package/views/interactive/dragEventPipeline.js +1 -1
  757. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +5 -0
  758. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  759. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +5 -0
  760. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  761. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  762. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  763. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  764. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  765. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  766. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  767. package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
  768. package/views/layers/FeatureLayerView.js +1 -1
  769. package/views/support/PromiseQueue.js +1 -1
  770. package/views/support/Scheduler.js +1 -1
  771. package/views/support/TextureCompressionWorker.js +1 -1
  772. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  773. package/views/webgl/ShaderBuilder.js +1 -1
  774. package/views/webgl/Texture.js +1 -1
  775. package/webdoc/support/webdocSaveUtils.js +1 -1
  776. package/webscene/spec-certification/api.js +1 -1
  777. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  778. package/widgets/BasemapLayerList.js +1 -1
  779. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  780. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  781. package/widgets/BatchAttributeForm.js +1 -1
  782. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  783. package/widgets/CoordinateConversion.js +1 -1
  784. package/widgets/Daylight/DaylightViewModel.js +1 -1
  785. package/widgets/Daylight.js +1 -1
  786. package/widgets/Directions/css.js +1 -1
  787. package/widgets/Directions.js +1 -1
  788. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  789. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  790. package/widgets/Editor/EditorViewModel.js +1 -1
  791. package/widgets/Editor/Edits.js +1 -1
  792. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
  793. package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
  794. package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
  795. package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
  796. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  797. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  798. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  799. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  800. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  801. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  802. package/widgets/Editor/UpdateWorkflow.js +1 -1
  803. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  804. package/widgets/Editor/components/FeatureList.js +1 -1
  805. package/widgets/Editor/components/UploadDetails.js +1 -1
  806. package/widgets/Editor/support/EditorItem.js +1 -1
  807. package/widgets/Editor/support/SketchController.js +1 -1
  808. package/widgets/Editor/support/errors.js +5 -0
  809. package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
  810. package/widgets/Editor/workflowUtils.js +1 -1
  811. package/widgets/Editor.js +1 -1
  812. package/widgets/Feature/FeatureExpression.js +1 -1
  813. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  814. package/widgets/Feature/FeatureFields.js +1 -1
  815. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  816. package/widgets/Feature/FeatureMedia.js +1 -1
  817. package/widgets/Feature/FeatureViewModel.js +1 -1
  818. package/widgets/Feature/support/featureUtils.js +1 -1
  819. package/widgets/Feature.js +1 -1
  820. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  821. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  822. package/widgets/FeatureForm/FieldInput.js +1 -1
  823. package/widgets/FeatureForm/InputBase.js +1 -1
  824. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  825. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  826. package/widgets/FeatureForm.js +1 -1
  827. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  828. package/widgets/FeatureTable/FieldColumn.js +1 -1
  829. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  830. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  831. package/widgets/LayerList.js +1 -1
  832. package/widgets/Legend/LegendViewModel.js +1 -1
  833. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  834. package/widgets/Legend.js +1 -1
  835. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  836. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  837. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  838. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  839. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  840. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  841. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  842. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  843. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  844. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  845. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  846. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  847. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  848. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  849. package/widgets/Print.js +1 -1
  850. package/widgets/Search/LayerSearchSource.js +1 -1
  851. package/widgets/Sketch/CreateToolVisibilityMap.js +5 -0
  852. package/widgets/Sketch/SelectionToolVisibilityMap.js +5 -0
  853. package/widgets/Sketch/VisibleElements.js +1 -1
  854. package/widgets/Sketch.js +1 -1
  855. package/widgets/TimeSlider.js +1 -1
  856. package/widgets/UtilityNetworkTrace.js +1 -1
  857. package/widgets/support/ColorPicker.js +1 -1
  858. package/widgets/support/FilterCondition.js +1 -1
  859. package/widgets/support/SelectionList/LayerItem.js +1 -1
  860. package/widgets/support/jsxWidgetSupport.js +1 -1
  861. package/assets/esri/core/workers/chunks/01642fe19e81bfa33eb5.js +0 -1
  862. package/assets/esri/core/workers/chunks/039ec0fbe3b4b398b8c6.js +0 -1
  863. package/assets/esri/core/workers/chunks/0429c1a3690f20647c9f.js +0 -1
  864. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  865. package/assets/esri/core/workers/chunks/065f2bbcaeef1f13fd48.js +0 -1
  866. package/assets/esri/core/workers/chunks/0731e588afd1f561ec3b.js +0 -1
  867. package/assets/esri/core/workers/chunks/09de8be660174a229efb.js +0 -1
  868. package/assets/esri/core/workers/chunks/0eaa4dccba0d844b9da3.js +0 -1
  869. package/assets/esri/core/workers/chunks/0f9bb3187306f89e3d63.js +0 -1
  870. package/assets/esri/core/workers/chunks/1019fa4818624ba292ef.js +0 -1
  871. package/assets/esri/core/workers/chunks/10fb29ba6f3f81353fbc.js +0 -1
  872. package/assets/esri/core/workers/chunks/147ad5fdd02f46b6da24.js +0 -1
  873. package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +0 -1
  874. package/assets/esri/core/workers/chunks/188272af9a6470ccfe31.js +0 -1
  875. package/assets/esri/core/workers/chunks/18da83afbc324fef9fd8.js +0 -316
  876. package/assets/esri/core/workers/chunks/1a9f544f20f643161a36.js +0 -1
  877. package/assets/esri/core/workers/chunks/1cfcadaa98ac528fea37.js +0 -1
  878. package/assets/esri/core/workers/chunks/1db0bf570a04687b3130.js +0 -1
  879. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +0 -1
  880. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  881. package/assets/esri/core/workers/chunks/24c14e4a1d2a2267097e.js +0 -1
  882. package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +0 -1
  883. package/assets/esri/core/workers/chunks/2a5f331c0f18d8574b4e.js +0 -1
  884. package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
  885. package/assets/esri/core/workers/chunks/31c6e951b99315e8e68a.js +0 -1
  886. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  887. package/assets/esri/core/workers/chunks/35491fbdd287470d40a4.js +0 -1
  888. package/assets/esri/core/workers/chunks/36247c6f6fc2891df2cf.js +0 -1
  889. package/assets/esri/core/workers/chunks/36fe6b8228e622407ec2.js +0 -1
  890. package/assets/esri/core/workers/chunks/3d22fe2f2c40abbc246e.js +0 -1
  891. package/assets/esri/core/workers/chunks/3d53307efbc3f07d7bf2.js +0 -1
  892. package/assets/esri/core/workers/chunks/3d65b8a2fbe1df050a25.js +0 -1
  893. package/assets/esri/core/workers/chunks/40b81d1c2d53cf598b8e.js +0 -1
  894. package/assets/esri/core/workers/chunks/42a72e1d963e4636323b.js +0 -1
  895. package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
  896. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  897. package/assets/esri/core/workers/chunks/4c4227b0ea21a5e429ab.js +0 -1
  898. package/assets/esri/core/workers/chunks/4eebd74ebc20579dade8.js +0 -1
  899. package/assets/esri/core/workers/chunks/500d09d2191127371081.js +0 -1
  900. package/assets/esri/core/workers/chunks/50864c1924030e62497d.js +0 -1
  901. package/assets/esri/core/workers/chunks/5707713c2f27588b9194.js +0 -1
  902. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  903. package/assets/esri/core/workers/chunks/5718cf135e105e1e026b.js +0 -1
  904. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
  905. package/assets/esri/core/workers/chunks/5d1d909354c90cb8eb60.js +0 -1
  906. package/assets/esri/core/workers/chunks/5ea03f53d4d64d9e7cae.js +0 -1
  907. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  908. package/assets/esri/core/workers/chunks/620a94b54be3ed78350d.js +0 -1
  909. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
  910. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +0 -1
  911. package/assets/esri/core/workers/chunks/64ee8d2acae2d6fce608.js +0 -1
  912. package/assets/esri/core/workers/chunks/650c94c0e8ab9721015e.js +0 -1
  913. package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +0 -1
  914. package/assets/esri/core/workers/chunks/6e5b3bbee054d072b594.js +0 -1
  915. package/assets/esri/core/workers/chunks/6f4bd0ee85e7e5a74340.js +0 -1
  916. package/assets/esri/core/workers/chunks/72ecf49d03bb24bf0998.js +0 -1
  917. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  918. package/assets/esri/core/workers/chunks/77a11d7d53325d108ed8.js +0 -1
  919. package/assets/esri/core/workers/chunks/7c5c272612198db83851.js +0 -1
  920. package/assets/esri/core/workers/chunks/7d9882ddfa6495f72baa.js +0 -1
  921. package/assets/esri/core/workers/chunks/7fffad8ff6878fa1fd56.js +0 -1
  922. package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +0 -1
  923. package/assets/esri/core/workers/chunks/85622fe99f4d08afe875.js +0 -1
  924. package/assets/esri/core/workers/chunks/8b16aa50d879b92a5375.js +0 -1
  925. package/assets/esri/core/workers/chunks/8bc64fc7c4b9eb8fca4d.js +0 -1
  926. package/assets/esri/core/workers/chunks/8eefa133c36a004c054c.js +0 -1
  927. package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +0 -1
  928. package/assets/esri/core/workers/chunks/929ece362604dc301229.js +0 -1
  929. package/assets/esri/core/workers/chunks/9834bc11586a2d8d6f35.js +0 -1
  930. package/assets/esri/core/workers/chunks/9a723d739ac44b45432c.js +0 -1
  931. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
  932. package/assets/esri/core/workers/chunks/a5a67216e0d0cee95a55.js +0 -1
  933. package/assets/esri/core/workers/chunks/a5f25104938ab33e7a85.js +0 -1
  934. package/assets/esri/core/workers/chunks/a7bd294996e6c8b8354a.js +0 -1
  935. package/assets/esri/core/workers/chunks/a87521ebe632bf783ef4.js +0 -1
  936. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
  937. package/assets/esri/core/workers/chunks/abf4f018c692c18c3320.js +0 -1
  938. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +0 -1
  939. package/assets/esri/core/workers/chunks/b0b2670596d6d8c32b5e.js +0 -1
  940. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
  941. package/assets/esri/core/workers/chunks/b2add7338258ca7c24dd.js +0 -1
  942. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
  943. package/assets/esri/core/workers/chunks/b62807c6fcfb70a87cd4.js +0 -1
  944. package/assets/esri/core/workers/chunks/b8339c1d60847a9eed3e.js +0 -1
  945. package/assets/esri/core/workers/chunks/bc6619307f312f9241bf.js +0 -1
  946. package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +0 -1
  947. package/assets/esri/core/workers/chunks/c0feec6e2f0e45900ae0.js +0 -1
  948. package/assets/esri/core/workers/chunks/c362fbbafec91c44eeb2.js +0 -1
  949. package/assets/esri/core/workers/chunks/c368a8e8d2f1535af446.js +0 -1
  950. package/assets/esri/core/workers/chunks/c55c096669677321a227.js +0 -1
  951. package/assets/esri/core/workers/chunks/c7a3a44cca5a7d52cca9.js +0 -1
  952. package/assets/esri/core/workers/chunks/c941d15190fc08523d0d.js +0 -1
  953. package/assets/esri/core/workers/chunks/cc70a4a915b0b2ccb2a0.js +0 -1
  954. package/assets/esri/core/workers/chunks/d121045cddbe55c2ecb2.js +0 -1
  955. package/assets/esri/core/workers/chunks/d2120a623b1bd91b9ed9.js +0 -1
  956. package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +0 -1
  957. package/assets/esri/core/workers/chunks/d48af7bc06b4bb176534.js +0 -1
  958. package/assets/esri/core/workers/chunks/d78c2833cdc4730a88a3.js +0 -1
  959. package/assets/esri/core/workers/chunks/dabc5a38a472c9719df9.js +0 -1
  960. package/assets/esri/core/workers/chunks/dc31865edea480f0ebba.js +0 -1
  961. package/assets/esri/core/workers/chunks/df438b62702007267798.js +0 -1
  962. package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
  963. package/assets/esri/core/workers/chunks/e6fc278e2390d2787345.js +0 -1
  964. package/assets/esri/core/workers/chunks/f4eb090bcc3eca64306a.js +0 -1
  965. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
  966. package/assets/esri/core/workers/chunks/f839b86bee15deaf84e4.js +0 -1
  967. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +0 -1
  968. package/assets/esri/core/workers/chunks/fa5c87889c2f0bef896b.js +0 -1
  969. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +0 -5
  970. package/views/3d/layers/i3s/I3SStreamDataController.js +0 -5
  971. package/views/3d/support/StreamDataLoader.js +0 -5
  972. package/views/3d/support/StreamDataRequester.js +0 -5
  973. package/views/3d/support/downloadSlots.js +0 -5
  974. package/views/draw/input/DrawEvents.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{colorGamma as e,delinearize as r}from"../../../../colorUtils.js";import{adjustStaticAGOUrl as t}from"../../../../core/devEnvironmentUtils.js";import{hasScaling as o}from"../../../../core/mathUtils.js";import{normalFromMat4 as s,fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{t as c,e as m,D as f,b as d,n as p,l as g}from"../../../../chunks/vec32.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as T,expandWithVec3 as b}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as h}from"../../../../geometry/support/FloatArray.js";import{BufferViewVec3f as y,BufferViewVec4f as w,BufferViewVec4u8 as v,BufferViewVec4u16 as R,BufferViewVec3u8 as B,BufferViewVec3u16 as j}from"../../../../geometry/support/buffer/BufferView.js";import{t as S,b as M,n as F,f as A}from"../../../../chunks/vec3.js";import{t as E,b as C}from"../../../../chunks/vec4.js";import{a as I}from"../../../../chunks/vec2.js";import{DefaultLoadingContext as L}from"../../glTF/DefaultLoadingContext.js";import{convertPrimitiveToTriangles as P}from"../../glTF/internal/indexUtils.js";import{isEncodedMeshTexture as U}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as O}from"../../glTF/internal/TextureTransformUtils.js";import{ProcessedObjectResource as k}from"./ProcessedObjectResource.js";import{load as D,processLoadResult as V}from"./wosrLoader.js";import{Attribute as _}from"../../webgl-engine/lib/Attribute.js";import{Geometry as G}from"../../webgl-engine/lib/Geometry.js";import{Texture as W}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as H}from"../../webgl-engine/materials/DefaultMaterial.js";import{useSchematicPBR as N,schematicMRRFactors as Q,esriSymbologyMRRFactors as $,advancedMRRFactors as q}from"../../webgl-engine/materials/pbrUtils.js";async function z(e,r){const o=K(t(e));if("wosr"===o.fileType){const e=await(r.cache?r.cache.loadWOSR(o.url,r):D(o.url,r)),{engineResources:t,referenceBoundingBox:s}=V(e,r);return{lods:t,referenceBoundingBox:s,isEsriSymbolResource:!1,isWosr:!0}}let s;if(r.cache)s=await r.cache.loadGLTF(o.url,r,!!r.usePBR);else{const{loadGLTF:e}=await import("../../glTF/loader.js");s=await e(new L(r.streamDataRequester),o.url,r,r.usePBR)}const i=s.model.meta?.ESRI_proxyEllipsoid,n=s.meta.isEsriSymbolResource&&null!=i&&"EsriRealisticTreesStyle"===s.meta.ESRI_webstyle;n&&!s.customMeta.esriTreeRendering&&(s.customMeta.esriTreeRendering=!0,re(s,i));const l=!!r.usePBR,a=s.meta.isEsriSymbolResource?{usePBR:l,isSchematic:!1,treeRendering:n,mrrFactors:$}:{usePBR:l,isSchematic:!1,treeRendering:!1,mrrFactors:q},u={...r.materialParameters,treeRendering:n},{engineResources:c,referenceBoundingBox:m}=J(s,a,u,r,o.specifiedLodIndex,n);return{lods:c,referenceBoundingBox:m,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}function K(e){const r=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(r)return{fileType:"gltf",url:r[1],specifiedLodIndex:null!=r[4]?Number(r[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function J(e,r,t,o,s,i){const n=e.model,l=new Array,a=new Map,u=new Map,c=n.lods.length,m=T();return n.lods.forEach((e,f)=>{const d=!0===o.skipHighLods&&(c>1&&0===f||c>3&&1===f)||!1===o.skipHighLods&&null!=s&&f!==s;if(d&&0!==f)return;const p=new k(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const s=d?new H({},o):X(n,e,p,r,t,a,u,o,i),{geometry:l,vertexCount:c}=Y(e,s??new H({},o)),g=l.boundingInfo;null!=g&&0===f&&(b(m,g.bbMin),b(m,g.bbMax)),null!=s&&(p.stageResources.geometries.push(l),p.numberOfVertices+=c)}),d||l.push(p)}),{engineResources:l,referenceBoundingBox:m}}function X(e,t,o,s,i,n,l,a,c){const m=e.materials.get(t.material);if(null==m)return null;const{normal:f,color:d,texCoord0:p,tangent:g}=t.attributes,x=t.material+(f?"_normal":"")+(d?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),T=null!=t.attributes.texCoord0,b=null!=t.attributes.normal,h=ee(m.alphaMode);if(!n.has(x)){if(T){const r=(r,t=!1,o=!1)=>{if(null!=r&&!l.has(r)){const s=e.textures.get(r);if(s){const e=s.data,i=t&&!U(e)?a.compressionOptions:void 0;l.set(r,new W(U(e)?e.data:e,{...s.parameters,preMultiplyAlpha:!U(e)&&o,encoding:U(e)?e.encoding:void 0,compressionOptions:i}))}}},t=1!==h&&!c;r(m.colorTexture,t,1!==h),r(m.normalTexture),r(m.occlusionTexture,!0),r(m.emissiveTexture),r(m.metallicRoughnessTexture,!0)}const o=r(m.color[0]),f=r(m.color[1]),d=r(m.color[2]),p=null!=m.colorTexture&&T?l.get(m.colorTexture):null,g=N(m),y=null!=m.normalTextureTransform?.scale?m.normalTextureTransform?.scale:u;n.set(x,new H({...s,customDepthTest:1,textureAlphaMode:h,textureAlphaCutoff:m.alphaCutoff,diffuse:[o,f,d],ambient:[o,f,d],opacity:"OPAQUE"===m.alphaMode?1:m.opacity,doubleSided:m.doubleSided,doubleSidedType:"winding-order",cullFace:m.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:b?0:2,castShadows:!0,receiveShadows:m.receiveShadows,receiveAmbientOcclusion:m.receiveAmbientOcclusion,textureId:null!=p?p.id:void 0,colorMixMode:m.colorMixMode,normalTextureId:null!=m.normalTexture&&T?l.get(m.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=m.occlusionTexture&&T?l.get(m.occlusionTexture).id:void 0,emissiveTextureId:null!=m.emissiveTexture&&T?l.get(m.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=m.metallicRoughnessTexture&&T?l.get(m.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[m.emissiveFactor[0],m.emissiveFactor[1],m.emissiveFactor[2]],mrrFactors:g?Q:[m.metallicFactor,m.roughnessFactor,s.mrrFactors[2]],isSchematic:g,colorTextureTransformMatrix:O(m.colorTextureTransform),normalTextureTransformMatrix:O(m.normalTextureTransform),scale:[y[0],y[1]],occlusionTextureTransformMatrix:O(m.occlusionTextureTransform),emissiveTextureTransformMatrix:O(m.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:O(m.metallicRoughnessTextureTransform),...i},a))}const y=n.get(x);if(o.stageResources.materials.push(y),T){const e=e=>{null!=e&&o.stageResources.textures.push(l.get(e))};e(m.colorTexture),e(m.normalTexture),e(m.occlusionTexture),e(m.emissiveTexture),e(m.metallicRoughnessTexture)}return y}function Y(e,r){const t=e.attributes.position.count,n=P(e.indices||t,e.primitiveType),l=h(3*t),{typedBuffer:a,typedBufferStride:u}=e.attributes.position;S(l,a,e.transform,3,u);const c=[["position",new _(l,n,3,!0)]];if(null!=e.attributes.normal){const r=h(3*t),{typedBuffer:i,typedBufferStride:l}=e.attributes.normal;s(Z,e.transform),M(r,i,Z,3,l),o(Z)&&F(r,r),c.push(["normal",new _(r,n,3,!0)])}if(null!=e.attributes.tangent){const r=h(4*t),{typedBuffer:s,typedBufferStride:l}=e.attributes.tangent;i(Z,e.transform),E(r,s,Z,4,l),o(Z)&&F(r,r,4),c.push(["tangent",new _(r,n,4,!0)])}if(null!=e.attributes.texCoord0){const r=h(2*t),{typedBuffer:o,typedBufferStride:s}=e.attributes.texCoord0;I(r,o,2,s),c.push(["uv0",new _(r,n,2,!0)])}const m=e.attributes.color;if(null!=m){const r=new Uint8Array(4*t);4===m.elementCount?m instanceof w?C(r,m,1,255):(m instanceof v||m instanceof R)&&C(r,m,1/255,255):(r.fill(255),m instanceof y?A(r,m.typedBuffer,1,255,4,m.typedBufferStride):(e.attributes.color instanceof B||e.attributes.color instanceof j)&&A(r,m.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new _(r,n,4,!0)])}return{geometry:new G(r,c),vertexCount:t}}const Z=n();function ee(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}function re(r,t){for(let o=0;o<r.model.lods.length;++o){const s=r.model.lods[o];for(const i of s.parts){const s=i.attributes.normal;if(null==s)return;const n=i.attributes.position,u=n.count,T=x(),b=x(),h=x(),v=new Float32Array(4*u),R=new Float32Array(3*u),B=l(a(),i.transform);let j=0,S=0;for(let l=0;l<u;l++){n.getVec(l,b),s.getVec(l,T),c(b,b,i.transform),m(h,b,t.center),f(h,h,t.radius);const a=h[2],u=d(h),x=Math.min(.45+.55*u*u,1)**e;f(h,h,t.radius),null!==B&&c(h,h,B),p(h,h),o+1!==r.model.lods.length&&r.model.lods.length>1&&g(h,h,T,a>-1?.2:Math.min(-4*a-3.8,1)),R[j]=h[0],R[j+1]=h[1],R[j+2]=h[2],j+=3,v[S]=x,v[S+1]=x,v[S+2]=x,v[S+3]=1,S+=4}i.attributes.normal=new y(R.buffer),i.attributes.color=new w(v.buffer)}}}export{z as fetch,K as parseUrl};
5
+ import{colorGamma as e,delinearize as r}from"../../../../colorUtils.js";import{adjustStaticAGOUrl as t}from"../../../../core/devEnvironmentUtils.js";import{hasScaling as o}from"../../../../core/mathUtils.js";import{normalFromMat4 as s,fromMat4 as i}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{invert as l}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ONES as u}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{t as c,e as m,D as f,b as d,n as p,l as g}from"../../../../chunks/vec32.js";import{create as x}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as T,expandWithVec3 as b}from"../../../../geometry/support/aaBoundingBox.js";import{newFloatArray as h}from"../../../../geometry/support/FloatArray.js";import{BufferViewVec3f as y,BufferViewVec4f as w,BufferViewVec4u8 as v,BufferViewVec4u16 as R,BufferViewVec3u8 as B,BufferViewVec3u16 as j}from"../../../../geometry/support/buffer/BufferView.js";import{t as S,b as M,n as F,f as A}from"../../../../chunks/vec3.js";import{t as E,b as C}from"../../../../chunks/vec4.js";import{a as I}from"../../../../chunks/vec2.js";import{DefaultLoadingContext as L}from"../../glTF/DefaultLoadingContext.js";import{convertPrimitiveToTriangles as P}from"../../glTF/internal/indexUtils.js";import{isEncodedMeshTexture as U}from"../../glTF/internal/resourceUtils.js";import{getTransformMatrix as O}from"../../glTF/internal/TextureTransformUtils.js";import{ProcessedObjectResource as k}from"./ProcessedObjectResource.js";import{load as V,processLoadResult as _}from"./wosrLoader.js";import{Attribute as D}from"../../webgl-engine/lib/Attribute.js";import{Geometry as G}from"../../webgl-engine/lib/Geometry.js";import{Texture as W}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as H}from"../../webgl-engine/materials/DefaultMaterial.js";import{useSchematicPBR as N,schematicMRRFactors as Q,esriSymbologyMRRFactors as $,advancedMRRFactors as z}from"../../webgl-engine/materials/pbrUtils.js";async function K(e,r){const o=q(t(e));if("wosr"===o.fileType){const e=await(r.cache?r.cache.loadWOSR(o.url,r):V(o.url,r)),{engineResources:t,referenceBoundingBox:s}=_(e,r);return{lods:t,referenceBoundingBox:s,isEsriSymbolResource:!1,isWosr:!0}}let s;if(r.cache)s=await r.cache.loadGLTF(o.url,r,!!r.usePBR);else{const{loadGLTF:e}=await import("../../glTF/loader.js");s=await e(new L,o.url,r,r.usePBR)}const i=s.model.meta?.ESRI_proxyEllipsoid,n=s.meta.isEsriSymbolResource&&null!=i&&"EsriRealisticTreesStyle"===s.meta.ESRI_webstyle;n&&!s.customMeta.esriTreeRendering&&(s.customMeta.esriTreeRendering=!0,re(s,i));const l=!!r.usePBR,a=s.meta.isEsriSymbolResource?{usePBR:l,isSchematic:!1,treeRendering:n,mrrFactors:$}:{usePBR:l,isSchematic:!1,treeRendering:!1,mrrFactors:z},u={...r.materialParameters,treeRendering:n},{engineResources:c,referenceBoundingBox:m}=J(s,a,u,r,o.specifiedLodIndex,n);return{lods:c,referenceBoundingBox:m,isEsriSymbolResource:s.meta.isEsriSymbolResource,isWosr:!1}}function q(e){const r=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);if(r)return{fileType:"gltf",url:r[1],specifiedLodIndex:null!=r[4]?Number(r[4]):null};return e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}function J(e,r,t,o,s,i){const n=e.model,l=new Array,a=new Map,u=new Map,c=n.lods.length,m=T();return n.lods.forEach((e,f)=>{const d=!0===o.skipHighLods&&(c>1&&0===f||c>3&&1===f)||!1===o.skipHighLods&&null!=s&&f!==s;if(d&&0!==f)return;const p=new k(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const s=d?new H({},o):X(n,e,p,r,t,a,u,o,i),{geometry:l,vertexCount:c}=Y(e,s??new H({},o)),g=l.boundingInfo;null!=g&&0===f&&(b(m,g.bbMin),b(m,g.bbMax)),null!=s&&(p.stageResources.geometries.push(l),p.numberOfVertices+=c)}),d||l.push(p)}),{engineResources:l,referenceBoundingBox:m}}function X(e,t,o,s,i,n,l,a,c){const m=e.materials.get(t.material);if(null==m)return null;const{normal:f,color:d,texCoord0:p,tangent:g}=t.attributes,x=t.material+(f?"_normal":"")+(d?"_color":"")+(p?"_texCoord0":"")+(g?"_tangent":""),T=null!=t.attributes.texCoord0,b=null!=t.attributes.normal,h=ee(m.alphaMode);if(!n.has(x)){if(T){const r=(r,t=!1,o=!1)=>{if(null!=r&&!l.has(r)){const s=e.textures.get(r);if(s){const e=s.data,i=t&&!U(e)?a.compressionOptions:void 0;l.set(r,new W(U(e)?e.data:e,{...s.parameters,preMultiplyAlpha:!U(e)&&o,encoding:U(e)?e.encoding:void 0,compressionOptions:i}))}}},t=1!==h&&!c;r(m.colorTexture,t,1!==h),r(m.normalTexture),r(m.occlusionTexture,!0),r(m.emissiveTexture),r(m.metallicRoughnessTexture,!0)}const o=r(m.color[0]),f=r(m.color[1]),d=r(m.color[2]),p=null!=m.colorTexture&&T?l.get(m.colorTexture):null,g=N(m),y=null!=m.normalTextureTransform?.scale?m.normalTextureTransform?.scale:u;n.set(x,new H({...s,customDepthTest:1,textureAlphaMode:h,textureAlphaCutoff:m.alphaCutoff,diffuse:[o,f,d],ambient:[o,f,d],opacity:"OPAQUE"===m.alphaMode?1:m.opacity,doubleSided:m.doubleSided,doubleSidedType:"winding-order",cullFace:m.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:b?0:2,castShadows:!0,receiveShadows:m.receiveShadows,receiveAmbientOcclusion:m.receiveAmbientOcclusion,textureId:null!=p?p.id:void 0,colorMixMode:m.colorMixMode,normalTextureId:null!=m.normalTexture&&T?l.get(m.normalTexture).id:void 0,textureAlphaPremultiplied:null!=p&&!!p.parameters.preMultiplyAlpha,occlusionTextureId:null!=m.occlusionTexture&&T?l.get(m.occlusionTexture).id:void 0,emissiveTextureId:null!=m.emissiveTexture&&T?l.get(m.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=m.metallicRoughnessTexture&&T?l.get(m.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[m.emissiveFactor[0],m.emissiveFactor[1],m.emissiveFactor[2]],mrrFactors:g?Q:[m.metallicFactor,m.roughnessFactor,s.mrrFactors[2]],isSchematic:g,colorTextureTransformMatrix:O(m.colorTextureTransform),normalTextureTransformMatrix:O(m.normalTextureTransform),scale:[y[0],y[1]],occlusionTextureTransformMatrix:O(m.occlusionTextureTransform),emissiveTextureTransformMatrix:O(m.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:O(m.metallicRoughnessTextureTransform),...i},a))}const y=n.get(x);if(o.stageResources.materials.push(y),T){const e=e=>{null!=e&&o.stageResources.textures.push(l.get(e))};e(m.colorTexture),e(m.normalTexture),e(m.occlusionTexture),e(m.emissiveTexture),e(m.metallicRoughnessTexture)}return y}function Y(e,r){const t=e.attributes.position.count,n=P(e.indices||t,e.primitiveType),l=h(3*t),{typedBuffer:a,typedBufferStride:u}=e.attributes.position;S(l,a,e.transform,3,u);const c=[["position",new D(l,n,3,!0)]];if(null!=e.attributes.normal){const r=h(3*t),{typedBuffer:i,typedBufferStride:l}=e.attributes.normal;s(Z,e.transform),M(r,i,Z,3,l),o(Z)&&F(r,r),c.push(["normal",new D(r,n,3,!0)])}if(null!=e.attributes.tangent){const r=h(4*t),{typedBuffer:s,typedBufferStride:l}=e.attributes.tangent;i(Z,e.transform),E(r,s,Z,4,l),o(Z)&&F(r,r,4),c.push(["tangent",new D(r,n,4,!0)])}if(null!=e.attributes.texCoord0){const r=h(2*t),{typedBuffer:o,typedBufferStride:s}=e.attributes.texCoord0;I(r,o,2,s),c.push(["uv0",new D(r,n,2,!0)])}const m=e.attributes.color;if(null!=m){const r=new Uint8Array(4*t);4===m.elementCount?m instanceof w?C(r,m,1,255):(m instanceof v||m instanceof R)&&C(r,m,1/255,255):(r.fill(255),m instanceof y?A(r,m.typedBuffer,1,255,4,m.typedBufferStride):(e.attributes.color instanceof B||e.attributes.color instanceof j)&&A(r,m.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),c.push(["color",new D(r,n,4,!0)])}return{geometry:new G(r,c),vertexCount:t}}const Z=n();function ee(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}function re(r,t){for(let o=0;o<r.model.lods.length;++o){const s=r.model.lods[o];for(const i of s.parts){const s=i.attributes.normal;if(null==s)return;const n=i.attributes.position,u=n.count,T=x(),b=x(),h=x(),v=new Float32Array(4*u),R=new Float32Array(3*u),B=l(a(),i.transform);let j=0,S=0;for(let l=0;l<u;l++){n.getVec(l,b),s.getVec(l,T),c(b,b,i.transform),m(h,b,t.center),f(h,h,t.radius);const a=h[2],u=d(h),x=Math.min(.45+.55*u*u,1)**e;f(h,h,t.radius),null!==B&&c(h,h,B),p(h,h),o+1!==r.model.lods.length&&r.model.lods.length>1&&g(h,h,T,a>-1?.2:Math.min(-4*a-3.8,1)),R[j]=h[0],R[j+1]=h[1],R[j+2]=h[2],j+=3,v[S]=x,v[S+1]=x,v[S+2]=x,v[S+3]=1,S+=4}i.attributes.normal=new y(R.buffer),i.attributes.color=new w(v.buffer)}}}export{K as fetch,q as parseUrl};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../../../core/Error.js";import{makeHandle as t}from"../../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{EsriPromise as i}from"../../../../../core/Promise.js";import{on as o,watch as a}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{FeatureLayerViewPerformanceInfo as l}from"../../FeatureLayerViewPerformanceInfo.js";import{Feature3DPipelineWorkerHandle as d}from"./Feature3DPipelineWorkerHandle.js";import{FeaturePipelineRenderManager as p}from"./rendering/FeaturePipelineRenderManager.js";import{emptyHighlightHandle as y}from"../../support/highlightUtils.js";import{LayerViewPerformanceInfo as c}from"../../support/LayerViewPerformanceInfo.js";let m=class extends i{constructor(e){super(e),this._renderer=null,this.graphicsQuery={queryForSymbologySnapping:(e,t)=>{throw new r("featurelayer:unsupported-symbology-snapping","Symbology snapping not supported")},executeQuery:async(e,r)=>await this._workerHandle.executeQuery(e,r),executeQueryForIds:async(e,r)=>await this._workerHandle.executeQueryForIds(e,r),executeQueryForCount:async(e,r)=>await this._workerHandle.executeQueryForCount(e,r),executeQueryForExtent:async(e,r)=>await this._workerHandle.executeQueryForExtent(e,r),executeQueryForLatestObservations:async(e,r)=>await this._workerHandle.executeQueryForLatestObservations(e,r),executeAttributeBinsQuery:async(e,r)=>this._workerHandle.executeAttributeBinsQuery(e,r)},this.maximumNumberOfFeatures=1e3}initialize(){if("point"!==this.layerView.layer.geometryType)throw new r("featurelayer:unsupported-geometry-type",`${this.layerView.layer.geometryType} is not supported`);this.addResolvingPromise(this.setup())}destroy(){this.removeAllHandles(),this._workerHandle.destroy(),n(this._renderer)}async setup(){const e=this.layerView,{layer:t,view:n,uid:i}=e,{spatialReference:s,renderSpatialReference:u,resourceController:l,renderCoordsHelper:y,elevationProvider:c}=n,m=n.state.viewingMode;if(this._renderer=new p({view:n,layerViewUid:i}),"feature"!==t.type)throw new r("featurelayer:unsupported-layertype","Only FeatureLayer is supported");const h=new d({schedule:e=>l.immediate.schedule(e),layer:t,layerView:e,viewSpatialReference:s,renderSpatialReference:u,viewingMode:m,renderer:this._renderer,elevationProvider:c,renderCoordsHelper:y});this._workerHandle=await h.when(),this.addHandles([this.layerView.view.enableFeatureTiles(),o(()=>this.layerView.view.featureTiles?.tiles,"change",e=>{this._workerHandle.onTileTreeChange(e.target)},{onListenerAdd:e=>this._workerHandle.onTileTreeChange(e),onListenerRemove:e=>this._workerHandle.onTileTreeChange(e)}),n.elevationProvider.on("elevation-change",e=>this._workerHandle.onElevationChange(e)),a(()=>this.layerView.fullOpacity,e=>this._workerHandle.onLayerViewOpacityChange(e),{sync:!1}),a(()=>t.renderer,e=>this._workerHandle.onRendererChange(e),{sync:!1})])}get legendEnabled(){return!1}get hasAllFeatures(){return!1}get hasAllFeaturesInView(){return!1}get hasFullGeometries(){return!1}get symbologySnappingSupported(){return!1}get scaleVisibilitySuspended(){return!1}get suspendInfo(){return{}}get updating(){return this._workerHandle.updating}get dataUpdating(){return!1}get updatePolicy(){return 0}get maximumNumberOfFeaturesExceeded(){return!1}get updatingProgressValue(){return 1}get usedMemory(){return this._renderer?.usedMemory??0}get unloadedMemory(){return 0}get ignoresMemoryFactor(){return!0}get totalFeatures(){return this._renderer?.totalFeatures??0}get performanceInfo(){const e=this.totalFeatures;return new l(new c(this.usedMemory,e,e,this.maximumNumberOfFeatures,0,null),e,e,this.maximumNumberOfFeaturesExceeded,"tiles","n/a")}get suspendResumeExtentMode(){return"computed"}forEachGraphic(e){}findGraphic(e){return null}highlightByObjectIds(e,r){return y}highlightByGraphics(e,r){return y}maskOccludee(e){return t()}async whenGraphicBounds(e,r){return null}computeAttachmentOrigin(e,r){return null}elevationAlignPointsInFeatures(e,t){throw new r("featurelayer:unsupported-elevation-alignment","Elevation alignment not supported")}async doRefresh(e){}setVisibility(e,r){}getMissingAttributesForFeature(e){return null}getHydratedGeometry(e){return null}};e([s()],m.prototype,"layerView",void 0),e([s()],m.prototype,"updating",null),e([s()],m.prototype,"totalFeatures",null),m=e([u("esri.views.3d.layers.graphics.pipeline.Feature3DPipeline")],m);export{m as Feature3DPipeline};
5
+ import{__decorate as e}from"tslib";import r from"../../../../../core/Error.js";import{makeHandle as t}from"../../../../../core/handleUtils.js";import{destroyMaybe as n}from"../../../../../core/maybe.js";import{EsriPromise as i}from"../../../../../core/Promise.js";import{on as o,watch as a}from"../../../../../core/reactiveUtils.js";import{property as s}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as u}from"../../../../../core/accessorSupport/decorators/subclass.js";import{FeatureLayerViewPerformanceInfo as l}from"../../FeatureLayerViewPerformanceInfo.js";import{Feature3DPipelineWorkerHandle as d}from"./Feature3DPipelineWorkerHandle.js";import{FeaturePipelineRenderManager as p}from"./rendering/FeaturePipelineRenderManager.js";import{emptyHighlightHandle as y}from"../../support/highlightUtils.js";import{LayerViewPerformanceInfo as c}from"../../support/LayerViewPerformanceInfo.js";let m=class extends i{constructor(e){super(e),this._renderer=null,this.graphicsQuery={queryForSymbologySnapping:(e,t)=>{throw new r("featurelayer:unsupported-symbology-snapping","Symbology snapping not supported")},executeQuery:async(e,r)=>await this._workerHandle.executeQuery(e,r),executeQueryForIds:async(e,r)=>await this._workerHandle.executeQueryForIds(e,r),executeQueryForCount:async(e,r)=>await this._workerHandle.executeQueryForCount(e,r),executeQueryForExtent:async(e,r)=>await this._workerHandle.executeQueryForExtent(e,r),executeQueryForLatestObservations:async(e,r)=>await this._workerHandle.executeQueryForLatestObservations(e,r),executeAttributeBinsQuery:async(e,r)=>this._workerHandle.executeAttributeBinsQuery(e,r)},this.maximumNumberOfFeatures=1e3}initialize(){if("point"!==this.layerView.layer.geometryType)throw new r("featurelayer:unsupported-geometry-type",`${this.layerView.layer.geometryType} is not supported`);this.addResolvingPromise(this.setup())}destroy(){this.removeAllHandles(),this._workerHandle.destroy(),n(this._renderer)}async setup(){const e=this.layerView,{layer:t,view:n,uid:i}=e,{spatialReference:s,renderSpatialReference:u,resourceController:l,renderCoordsHelper:y,elevationProvider:c}=n,m=n.state.viewingMode;if(this._renderer=new p({view:n,layerViewUid:i}),"feature"!==t.type)throw new r("featurelayer:unsupported-layertype","Only FeatureLayer is supported");const h=new d({schedule:e=>l.immediate.schedule(e),layer:t,layerView:e,viewSpatialReference:s,renderSpatialReference:u,viewingMode:m,renderer:this._renderer,elevationProvider:c,renderCoordsHelper:y});this._workerHandle=await h.when(),this.addHandles([this.layerView.view.enableFeatureTiles(),o(()=>this.layerView.view.featureTiles?.tiles,"change",e=>{this._workerHandle.onTileTreeChange(e.target)},{onListenerAdd:e=>this._workerHandle.onTileTreeChange(e),onListenerRemove:e=>this._workerHandle.onTileTreeChange(e)}),n.elevationProvider.on("elevation-change",e=>this._workerHandle.onElevationChange(e)),a(()=>this.layerView.fullOpacity,e=>this._workerHandle.onLayerViewOpacityChange(e),{sync:!1}),a(()=>t.renderer,e=>this._workerHandle.onRendererChange(e),{sync:!1})])}get legendEnabled(){return!1}get hasAllFeatures(){return!1}get hasAllFeaturesInView(){return!1}get hasFullGeometries(){return!1}get symbologySnappingSupported(){return!1}get scaleVisibilitySuspended(){return!1}get snappingComplexityExceeded(){return!1}get suspendInfo(){return{}}get updating(){return this._workerHandle.updating}get dataUpdating(){return!1}get updatePolicy(){return 0}get maximumNumberOfFeaturesExceeded(){return!1}get updatingProgressValue(){return 1}get usedMemory(){return this._renderer?.usedMemory??0}get unloadedMemory(){return 0}get ignoresMemoryFactor(){return!0}get totalFeatures(){return this._renderer?.totalFeatures??0}get performanceInfo(){const e=this.totalFeatures;return new l(new c(this.usedMemory,e,e,this.maximumNumberOfFeatures,0,null),e,e,this.maximumNumberOfFeaturesExceeded,"tiles","n/a")}get suspendResumeExtentMode(){return"computed"}forEachGraphic(e){}findGraphic(e){return null}highlightByObjectIds(e,r){return y}highlightByGraphics(e,r){return y}maskOccludee(e){return t()}async whenGraphicBounds(e,r){return null}computeAttachmentOrigin(e,r){return null}elevationAlignPointsInFeatures(e,t){throw new r("featurelayer:unsupported-elevation-alignment","Elevation alignment not supported")}async doRefresh(e){}setVisibility(e,r){}getMissingAttributesForFeature(e){return null}getHydratedGeometry(e){return null}};e([s()],m.prototype,"layerView",void 0),e([s()],m.prototype,"updating",null),e([s()],m.prototype,"totalFeatures",null),m=e([u("esri.views.3d.layers.graphics.pipeline.Feature3DPipeline")],m);export{m as Feature3DPipeline};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../../core/Error.js";import t from"../../../../../../core/pbf.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BBox as s}from"../../../../../../core/libs/rbush/PooledRBush.js";import{fromValues as n}from"../../../../../../geometry/support/aaBoundingBox.js";import{normalizeTransform as o}from"../../../../../../geometry/support/quantizationUtils.js";import i from"../../../../../../layers/graphics/OptimizedGeometry.js";import a from"../../../../../../layers/support/FieldsIndex.js";import{parseField as d,parseTransform as c}from"../../../../../../rest/query/operations/pbfFeatureServiceParser.js";class u{constructor(e){this._reader=new t(new Uint8Array(e),new DataView(e)),this._index=g(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:s}}=this,n=r.get(t)?.index;if(null==n)return;const o=s[e*r.fields.length+n],i=this._reader;return i.move(o),m(i)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,s=e*t.fields.length,n=this._reader,o={};for(const i of t.fields){const e=r[s+i.index];n.move(e),o[i.name]=m(n)}return o}getCoordinates(e,t,r=0){const s=this._reader,{transform:n,featureIndices:o}=this._index,{scale:i,translate:a}=n;s.move(o[e]),this._readCoordinates(i,a,t,r)}getOptimizedGeometry(e){const t=r();return this.getCoordinates(e,t),new i([],t)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,p);const[s,n,o]=p,a=[s,n];return t&&(a[3]=o),r&&(a[t?4:3]=0),new i([],a)}getBounds(e){this.getCoordinates(e,p);const[t,r]=p,n=new s;return n.minX=t,n.minY=r,n.maxX=t,n.maxY=r,n}getBoundingBox(e){this.getCoordinates(e,p);const[t,r,s]=p;return n(t,r,s,t,r,s)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const s=this._reader,{objectIdFieldName:n,attributeIndices:o,fieldsIndex:i}=this._index,a=i.get(n).index,d=i.fields.length;for(const c of t){const t=o[c*d+a];s.move(t),e[r++]=m(s)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const s=this._reader,{transform:n,featureIndices:o}=this._index,{scale:i,translate:a}=n;for(const d of t){const t=o[d];s.move(t),r=this._readCoordinates(i,a,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:s,fieldsIndex:n}=this._index,o=n.get(r).index,i=n.fields.length;for(const a of e){const e=s[a*i+o];t.move(e),yield m(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[s,n,o],i,a){const d=2,c=3,u=this._reader,g=u.getLength(),l=u.pos()+g;for(;u.pos()<l&&u.next();)switch(u.tag()){case d:{const d=u.getLength(),g=u.pos()+d;for(;u.pos()<g&&u.next();)if(u.tag()===c)u.getUInt32(),i[a++]=s+e*u.getSInt64(),i[a++]=n+t*u.getSInt64(),i[a++]=o+r*u.getSInt64();else u.skip();break}default:u.skip()}return a}}function g(e){const t=2;for(;e.next();){if(e.tag()===t)return l(e.getMessage());e.skip()}h()}function l(e){const t=1;for(;e.next();){if(e.tag()===t)return f(e.getMessage());e.skip()}h()}function f(e){const t=9,r=12,s=13,n=15,i=7,u=0,g=10,l=1,f=1;let m,p,x=!1,I=!1,b=0;const _=new Array,w=new Array,y=new Array;for(;e.next();)switch(e.tag()){case f:p=e.getString();break;case i:e.getEnum()!==u&&h();break;case t:x=e.getBool()??!1;break;case r:m=o(e.processMessage(c));break;case s:{const t=e.processMessage(d);t.index=b++,_.push(t);break}case n:{w.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)if(e.tag()===l)y.push(e.pos()),e.skip();else e.skip();break}case g:I=e.getBool()??!1;break;default:e.skip()}const j=new a(_);return null!=m&&I&&null!=p&&j.has(p)||h(),{transform:m,exceededTransferLimit:x,fieldsIndex:j,objectIdFieldName:p,featureIndices:w,attributeIndices:y}}function h(){const t=new e("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(t),t}function m(e){const t=1,r=2,s=3,n=4,o=5,i=6,a=7,d=8,c=9,u=e.getLength(),g=e.pos()+u;for(;e.pos()<g&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case o:return e.getUInt32();case i:return e.getInt64();case a:return e.getUInt64();case d:return e.getSInt64();case c:return e.getBool();default:return e.skip(),null}return null}const p=r();export{u as PBFPointFeatureSetView};
5
+ import e from"../../../../../../core/Error.js";import t from"../../../../../../core/pbf.js";import{create as r}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{BBox as s}from"../../../../../../core/libs/rbush/PooledRBush.js";import{fromValues as n}from"../../../../../../geometry/support/aaBoundingBox.js";import{normalizeTransform as o}from"../../../../../../geometry/support/quantizationUtils.js";import i from"../../../../../../layers/graphics/OptimizedGeometry.js";import a from"../../../../../../layers/support/FieldsIndex.js";import{parseField as d,parseTransform as c}from"../../../../../../rest/query/operations/pbfFeatureServiceParser.js";class u{constructor(e){this._reader=new t(new Uint8Array(e),new DataView(e)),this._index=g(this._reader)}get featureCount(){return this._index.featureIndices.length}get exceededTransferLimit(){return this._index.exceededTransferLimit}get usedMemory(){return this._reader.usedMemory}getObjectId(e){return this.getAttribute(e,this._index.objectIdFieldName)}getAttribute(e,t){const{_index:{fieldsIndex:r,attributeIndices:s}}=this,n=r.get(t)?.index;if(null==n)return;const o=s[e*r.fields.length+n],i=this._reader;return i.move(o),m(i)}getAttributeAsTimestamp(e,t){const r=this.getAttribute(e,t);return"string"==typeof r?new Date(r).getTime():"number"==typeof r||null==r?r:null}getAttributes(e){const{_index:{fieldsIndex:t,attributeIndices:r}}=this,s=e*t.fields.length,n=this._reader,o={};for(const i of t.fields){const e=r[s+i.index];n.move(e),o[i.name]=m(n)}return o}getCoordinates(e,t,r=0){const s=this._reader,{transform:n,featureIndices:o}=this._index,{scale:i,translate:a}=n;s.move(o[e]),this._readCoordinates(i,a,t,r)}getOptimizedGeometry(e){const t=r();return this.getCoordinates(e,t),new i([],t,!0,!1)}getCentroid(e,{hasZ:t,hasM:r}){this.getCoordinates(e,p);const[s,n,o]=p,a=[s,n];return t&&(a[3]=o),r&&(a[t?4:3]=0),new i([],a,t,r)}getBounds(e){this.getCoordinates(e,p);const[t,r]=p,n=new s;return n.minX=t,n.minY=r,n.maxX=t,n.maxY=r,n}getBoundingBox(e){this.getCoordinates(e,p);const[t,r,s]=p;return n(t,r,s,t,r,s)}getObjectIdsArray(e,t=this._allFeatureIndices(),r=0){const s=this._reader,{objectIdFieldName:n,attributeIndices:o,fieldsIndex:i}=this._index,a=i.get(n).index,d=i.fields.length;for(const c of t){const t=o[c*d+a];s.move(t),e[r++]=m(s)}return r}getCoordinatesArray(e,t=this._allFeatureIndices(),r=0){const s=this._reader,{transform:n,featureIndices:o}=this._index,{scale:i,translate:a}=n;for(const d of t){const t=o[d];s.move(t),r=this._readCoordinates(i,a,e,r)}return r}*objectIds(e=this._allFeatureIndices()){const t=this._reader,{objectIdFieldName:r,attributeIndices:s,fieldsIndex:n}=this._index,o=n.get(r).index,i=n.fields.length;for(const a of e){const e=s[a*i+o];t.move(e),yield m(t)}}*_allFeatureIndices(){const{featureCount:e}=this;for(let t=0;t<e;++t)yield t}_readCoordinates([e,t,r],[s,n,o],i,a){const d=2,c=3,u=this._reader,g=u.getLength(),l=u.pos()+g;for(;u.pos()<l&&u.next();)switch(u.tag()){case d:{const d=u.getLength(),g=u.pos()+d;for(;u.pos()<g&&u.next();)if(u.tag()===c)u.getUInt32(),i[a++]=s+e*u.getSInt64(),i[a++]=n+t*u.getSInt64(),i[a++]=o+r*u.getSInt64();else u.skip();break}default:u.skip()}return a}}function g(e){const t=2;for(;e.next();){if(e.tag()===t)return l(e.getMessage());e.skip()}h()}function l(e){const t=1;for(;e.next();){if(e.tag()===t)return f(e.getMessage());e.skip()}h()}function f(e){const t=9,r=12,s=13,n=15,i=7,u=0,g=10,l=1,f=1;let m,p,x=!1,I=!1,b=0;const _=new Array,w=new Array,y=new Array;for(;e.next();)switch(e.tag()){case f:p=e.getString();break;case i:e.getEnum()!==u&&h();break;case t:x=e.getBool()??!1;break;case r:m=o(e.processMessage(c));break;case s:{const t=e.processMessage(d);t.index=b++,_.push(t);break}case n:{w.push(e.pos());const t=e.getUInt32(),r=e.pos()+t;for(;e.pos()<r&&e.next();)if(e.tag()===l)y.push(e.pos()),e.skip();else e.skip();break}case g:I=e.getBool()??!1;break;default:e.skip()}const j=new a(_);return null!=m&&I&&null!=p&&j.has(p)||h(),{transform:m,exceededTransferLimit:x,fieldsIndex:j,objectIdFieldName:p,featureIndices:w,attributeIndices:y}}function h(){const t=new e("pbf-parsing-failed","Error while parsing PBF",new Error);throw console.error(t),t}function m(e){const t=1,r=2,s=3,n=4,o=5,i=6,a=7,d=8,c=9,u=e.getLength(),g=e.pos()+u;for(;e.pos()<g&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case o:return e.getUInt32();case i:return e.getInt64();case a:return e.getUInt64();case d:return e.getSInt64();case c:return e.getBool();default:return e.skip(),null}return null}const p=r();export{u as PBFPointFeatureSetView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{EventEmitter as t}from"../../../../../../core/Evented.js";import{baseObjectMemory as e,estimateNumberMemory as i}from"../../../../../../core/memoryEstimations.js";import{PooledRBush as r,BBox as s}from"../../../../../../core/libs/rbush/PooledRBush.js";import{getCentroidOptimizedGeometry as n}from"../../../../../../layers/graphics/centroid.js";import o from"../../../../../../layers/graphics/OptimizedGeometry.js";class u{constructor(t,e){this._index=t,this._view=e}get usedMemory(){return e+i}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(t){return this._view.getAttribute(this._index,t)}getAttributeAsTimestamp(t){return this._view.getAttributeAsTimestamp(this._index,t)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(t){return this._view.getCentroid(this._index,t)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(t){return new d(this._index,this._view,t)}}class d extends u{constructor(t,e,i){super(t,e),this._geometryOverride=i}getOptimizedGeometry(){return this._geometryOverride}getCentroid(t){return n(new o,this._geometryOverride,t.hasZ,t.hasM)}}class a{constructor(t,e){this.featureData=t,this.bounds=e}}class h{constructor(){this._tileBounds=new Map,this.events=new t,this.featureAdapter=m.shared}get usedMemory(){return e+e*this._tileBounds.size}addTile(t){const{featureCount:e}=t;if(0===e)return;const i=new r(9,e=>t.getBounds(e)),s=new Array;for(let r=0;r<e;++r)s[r]=r;i.load(s),this._tileBounds.set(t.id,new a(t,i)),this.events.emit("changed")}removeTile(t){this._tileBounds.delete(t),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(t){for(const{featureData:e,bounds:i}of this._tileBounds.values())i.all(i=>{e.getEnabled(i)&&t(new u(i,e))})}forEachInBounds(t,e){g.minX=t[0],g.minY=t[1],g.maxX=t[2],g.maxY=t[3];for(const{featureData:i,bounds:r}of this._tileBounds.values())r.search(g,t=>{i.getEnabled(t)&&e(new u(t,i))})}forEachBounds(t,e){for(const i of t)e(i.getBoundingBox())}getFullExtent(t){let e=1/0,i=1/0,r=-1/0,s=-1/0;for(const{bounds:n}of this._tileBounds.values()){const{minX:t,minY:o,maxX:u,maxY:d}=n.toJSON();e=Math.min(e,t),i=Math.min(i,o),r=Math.min(r,u),s=Math.min(s,d)}return{xmin:e,ymin:i,xmax:r,ymax:s,spatialReference:t}}}class m{static{this.shared=new m}getObjectId(t){return t.getObjectId()}getAttribute(t,e){return t.getAttribute(e)}getAttributeAsTimestamp(t,e){return t.getAttributeAsTimestamp(e)}getAttributes(t){return t.getAttributes()}getGeometry(t){return t.getOptimizedGeometry()}getCentroid(t,e){return t.getCentroid(e)}cloneWithGeometry(t,e){return t.cloneWithGeometry(e)}}const g=new s;export{u as FeatureHandle,h as TiledFeatureStore};
5
+ import{EventEmitter as t}from"../../../../../../core/Evented.js";import{baseObjectMemory as e,estimateNumberMemory as i}from"../../../../../../core/memoryEstimations.js";import{PooledRBush as r,BBox as s}from"../../../../../../core/libs/rbush/PooledRBush.js";import{getCentroidOptimizedGeometry as n}from"../../../../../../layers/graphics/centroid.js";class o{constructor(t,e){this._index=t,this._view=e}get usedMemory(){return e+i}getObjectId(){return this._view.getObjectId(this._index)}getAttribute(t){return this._view.getAttribute(this._index,t)}getAttributeAsTimestamp(t){return this._view.getAttributeAsTimestamp(this._index,t)}getAttributes(){return this._view.getAttributes(this._index)}getOptimizedGeometry(){return this._view.getOptimizedGeometry(this._index)}getCentroid(t){return this._view.getCentroid(this._index,t)}getBounds(){return this._view.getBounds(this._index)}getBoundingBox(){return this._view.getBoundingBox(this._index)}cloneWithGeometry(t){return new u(this._index,this._view,t)}}class u extends o{constructor(t,e,i){super(t,e),this._geometryOverride=i}getOptimizedGeometry(){return this._geometryOverride}getCentroid(t){return n(this._geometryOverride)}}class d{constructor(t,e){this.featureData=t,this.bounds=e}}class a{constructor(){this._tileBounds=new Map,this.events=new t,this.featureAdapter=h.shared}get usedMemory(){return e+e*this._tileBounds.size}addTile(t){const{featureCount:e}=t;if(0===e)return;const i=new r(9,e=>t.getBounds(e)),s=new Array;for(let r=0;r<e;++r)s[r]=r;i.load(s),this._tileBounds.set(t.id,new d(t,i)),this.events.emit("changed")}removeTile(t){this._tileBounds.delete(t),this.events.emit("changed")}clear(){this._tileBounds.clear(),this.events.emit("changed")}forEach(t){for(const{featureData:e,bounds:i}of this._tileBounds.values())i.all(i=>{e.getEnabled(i)&&t(new o(i,e))})}forEachInBounds(t,e){m.minX=t[0],m.minY=t[1],m.maxX=t[2],m.maxY=t[3];for(const{featureData:i,bounds:r}of this._tileBounds.values())r.search(m,t=>{i.getEnabled(t)&&e(new o(t,i))})}forEachBounds(t,e){for(const i of t)e(i.getBoundingBox())}getFullExtent(t){let e=1/0,i=1/0,r=-1/0,s=-1/0;for(const{bounds:n}of this._tileBounds.values()){const{minX:t,minY:o,maxX:u,maxY:d}=n.toJSON();e=Math.min(e,t),i=Math.min(i,o),r=Math.min(r,u),s=Math.min(s,d)}return{xmin:e,ymin:i,xmax:r,ymax:s,spatialReference:t}}}class h{static{this.shared=new h}getObjectId(t){return t.getObjectId()}getAttribute(t,e){return t.getAttribute(e)}getAttributeAsTimestamp(t,e){return t.getAttributeAsTimestamp(e)}getAttributes(t){return t.getAttributes()}getGeometry(t){return t.getOptimizedGeometry()}getCentroid(t,e){return t.getCentroid(e)}cloneWithGeometry(t,e){return t.cloneWithGeometry(e)}}const m=new s;export{o as FeatureHandle,a as TiledFeatureStore};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{throwIfAborted as e}from"../../../../../../core/promiseUtils.js";import{toExtent as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{executeQueryPBFBuffer as r}from"../../../../../../rest/query/operations/query.js";import{Tile as o}from"../Tile.js";import{PBFPointFeatureSetView as s}from"../featureSet/PBFPointFeatureSetView.js";const i=8e3,a=4,n=4;class c{constructor(e,t,r,o,s){this.spatialReference=e,this.url=r,this.objectIdField=o,this.capabilities=s;const{supportsMaxRecordCountFactor:n,maxRecordCount:c}=this.capabilities.query,u=n?a:1,p=(c??i)*u;this._pageSize=Math.min(i,p);const l=t.clone();l.cacheHint=!0,l.resultType="tile",l.outSpatialReference=e,l.returnGeometry=!0,l.returnZ=!0,l.maxRecordCountFactor=u,l.num=this._pageSize,l.outFields=[o],this._baseQuery=l}async fetch(r,s){const{spatialReference:i,_pageSize:a}=this,c=t(r.extent,i),u=this._baseQuery.clone();u.geometry=c;const p=new Array;let l=0,h=!1,m=1;for(;!h;){const t=[];for(let e=0;e<m;++e)t.push(this._fetchPage(u,l++,s));const r=await Promise.all(t);e(s);for(const e of r){const t=0!==e.featureCount;h||=!e.exceededTransferLimit||!t,t&&p.push(e)}m=Math.min(m+1,n)}return new o(r,p,a)}async _fetchPage(t,o,i){const a=t.clone();a.start=o*this._pageSize;const n=(await r(this.url,a,{signal:i})).data;return e(i),new s(n)}}export{c as Tile3DFetcher};
5
+ import{throwIfAborted as e}from"../../../../../../core/promiseUtils.js";import{toExtent as t}from"../../../../../../geometry/support/aaBoundingRect.js";import{executeQueryPBFBuffer as r}from"../../../../../../rest/query/operations/query.js";import{Tile as o}from"../Tile.js";import{PBFPointFeatureSetView as s}from"../featureSet/PBFPointFeatureSetView.js";const i=8e3,a=4,n=4;class c{constructor(e,t,r,o,s){this.spatialReference=e,this.url=r,this.objectIdField=o,this.capabilities=s;const{supportsMaxRecordCountFactor:n,maxRecordCount:c}=this.capabilities.query,u=n?a:1,p=(c??i)*u;this._pageSize=Math.min(i,p);const l=t.clone();l.cacheHint=!0,l.resultType="tile",l.outSpatialReference=e,l.returnGeometry=!0,l.returnZ=!0,l.maxRecordCountFactor=u,l.num=this._pageSize,l.outFields=[o],this._baseQuery=l}async fetch(r,s){const{spatialReference:i,_pageSize:a}=this,c=t(r.extent,i),u=this._baseQuery.clone();u.geometry=c;const p=new Array;let l=0,h=!1,m=1;for(;!h;){const t=[];for(let e=0;e<m;++e)t.push(this._fetchPage(u,l++,s));const r=await Promise.all(t);e(s);for(const e of r){const t=0!==e.featureCount;h||=!e.exceededTransferLimit||!t,t&&p.push(e)}m=Math.min(m+1,n)}return new o(r,p,a)}async _fetchPage(t,o,i){const a=t.clone();a.start=o*this._pageSize;const n=await r(this.url,a,{signal:i});return e(i),new s(n)}}export{c as Tile3DFetcher};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../request.js";import{result as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{estimateNestedObjectMemory as s}from"../../../../core/memoryEstimations.js";import{NestedMap as o}from"../../../../core/NestedMap.js";import{throwIfAbortError as a}from"../../../../core/promiseUtils.js";import{Version as i}from"../../../../core/Version.js";import{fromArray as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as u,expandWithVec3 as c}from"../../../../geometry/support/aaBoundingBox.js";import{getContinuousIndexArray as m}from"../../../../geometry/support/Indices.js";import{requestImage as p}from"../../../../support/requestImageUtils.js";import{Attribute as f}from"../../webgl-engine/lib/Attribute.js";import{Geometry as d}from"../../webgl-engine/lib/Geometry.js";import{Texture as g}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as y}from"../../webgl-engine/materials/DefaultMaterial.js";const w=()=>n.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class x{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}async function h(e,t){const r=await b(e,t),n=await U(r.textureDefinitions??{},t);let o=0;for(const s in n)if(n.hasOwnProperty(s)){const e=n[s];o+=e?.image?e.image.width*e.image.height*4:0}return new x(r,n,o+s(r))}async function b(r,n){const s=n?.streamDataRequester;if(s)return v(r,s,n);const o=await t(e(r,n));if(!0===o.ok)return o.value.data;a(o.error),A(o.error)}async function v(e,r,n){const s=await t(r.request(e,0,n));if(!0===s.ok)return s.value;a(s.error),A(s.error.details.url)}function A(e){throw new r("",`Request for object resource failed: ${e}`)}function j(e){const t=e.params,r=t.topology;let n=!0;switch(t.vertexAttributes||(w().warn("Geometry must specify vertex attributes"),n=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(w().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),n=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(w().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),n=!1)):(w().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),n=!1)}}else w().warn("Indexed geometries must specify faces"),n=!1;break}default:w().warn(`Unsupported topology '${r}'`),n=!1}e.params.material||(w().warn("Geometry requires material"),n=!1);const s=e.params.vertexAttributes;for(const o in s){s[o].values||(w().warn("Geometries with externally defined attributes are not yet supported"),n=!1)}return n}function M(e,t){const r=new Array,n=new Array,s=new Array,a=new o,u=e.resource,c=i.parse(u.version||"1.0","wosr");k.validate(c);const p=u.model.name,w=u.model.geometries,x=u.materialDefinitions??{},h=e.textures;let b=0;const v=new Map;for(let o=0;o<w.length;o++){const e=w[o];if(!j(e))continue;const i=E(e),u=e.params.vertexAttributes,c=[],p=t=>{if("PerAttributeArray"===e.params.topology)return null;const r=e.params.faces;for(const e in r)if(e===t)return r[e].values;return null},A=u.position,M=A.values.length/A.valuesPerElement;for(const t in u){const e=u[t],r=e.values,n=p(t)??m(M);c.push([t,new f(r,n,e.valuesPerElement,!0)])}const P=i.texture,U=h&&h[P];if(U&&!v.has(P)){const{image:e,parameters:t}=U,r=new g(e,t);n.push(r),v.set(P,r)}const k=v.get(P),T=k?k.id:void 0,q=i.material;let O=a.get(q,P);if(null==O){const e=x[q.slice(q.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=U?I(U.alphaChannelUsage):void 0,n={ambient:l(e.diffuse),diffuse:l(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:T,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:U?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),O=new y(n,t),a.set(q,P,O)}s.push(O);const C=new d(O,c);b+=c.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(C)}return{engineResources:[{name:p,stageResources:{textures:n,materials:s,geometries:r},pivotOffset:u.model.pivotOffset,numberOfVertices:b,lodThreshold:null}],referenceBoundingBox:P(r)}}function P(e){const t=u();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&(c(t,r.bbMin),c(t,r.bbMax))}),t}async function U(e,t){const r=new Array;for(const o in e){const n=e[o],s=n.images[0].data;if(!s){w().warn("Externally referenced texture data is not yet supported");continue}const a=n.encoding+";base64,"+s,i="/textureDefinitions/"+o,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",u={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==I(l)},c=t?.disableTextures?Promise.resolve(null):p(a,t);r.push(c.then(e=>({refId:i,image:e,parameters:u,alphaChannelUsage:l})))}const n=await Promise.all(r),s={};for(const o of n)s[o.refId]=o;return s}function I(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function E(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const k=new i(1,2,"wosr");export{x as LoaderResultWOSR,U as createTextureResources,h as load,M as processLoadResult};
5
+ import e from"../../../../request.js";import{result as t}from"../../../../core/asyncUtils.js";import r from"../../../../core/Error.js";import n from"../../../../core/Logger.js";import{estimateNestedObjectMemory as s}from"../../../../core/memoryEstimations.js";import{NestedMap as o}from"../../../../core/NestedMap.js";import{throwIfAbortError as a}from"../../../../core/promiseUtils.js";import{Version as i}from"../../../../core/Version.js";import{fromArray as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{empty as u,expandWithVec3 as c}from"../../../../geometry/support/aaBoundingBox.js";import{getContinuousIndexArray as m}from"../../../../geometry/support/Indices.js";import{requestImage as p}from"../../../../support/requestImageUtils.js";import{Attribute as f}from"../../webgl-engine/lib/Attribute.js";import{Geometry as d}from"../../webgl-engine/lib/Geometry.js";import{Texture as g}from"../../webgl-engine/lib/Texture.js";import{DefaultMaterial as y}from"../../webgl-engine/materials/DefaultMaterial.js";const w=()=>n.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class x{constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}async function h(e,t){const r=await b(e,t),n=await P(r.textureDefinitions??{},t);let o=0;for(const s in n)if(n.hasOwnProperty(s)){const e=n[s];o+=e?.image?e.image.width*e.image.height*4:0}return new x(r,n,o+s(r))}async function b(r,n){const s=await t(e(r,n));if(s.ok)return s.value.data;a(s.error),v(s.error)}function v(e){throw new r("",`Request for object resource failed: ${e}`)}function A(e){const t=e.params,r=t.topology;let n=!0;switch(t.vertexAttributes||(w().warn("Geometry must specify vertex attributes"),n=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(w().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),n=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(w().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),n=!1)):(w().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),n=!1)}}else w().warn("Indexed geometries must specify faces"),n=!1;break}default:w().warn(`Unsupported topology '${r}'`),n=!1}e.params.material||(w().warn("Geometry requires material"),n=!1);const s=e.params.vertexAttributes;for(const o in s){s[o].values||(w().warn("Geometries with externally defined attributes are not yet supported"),n=!1)}return n}function j(e,t){const r=new Array,n=new Array,s=new Array,a=new o,u=e.resource,c=i.parse(u.version||"1.0","wosr");E.validate(c);const p=u.model.name,w=u.model.geometries,x=u.materialDefinitions??{},h=e.textures;let b=0;const v=new Map;for(let o=0;o<w.length;o++){const e=w[o];if(!A(e))continue;const i=I(e),u=e.params.vertexAttributes,c=[],p=t=>{if("PerAttributeArray"===e.params.topology)return null;const r=e.params.faces;for(const e in r)if(e===t)return r[e].values;return null},j=u.position,M=j.values.length/j.valuesPerElement;for(const t in u){const e=u[t],r=e.values,n=p(t)??m(M);c.push([t,new f(r,n,e.valuesPerElement,!0)])}const P=i.texture,E=h&&h[P];if(E&&!v.has(P)){const{image:e,parameters:t}=E,r=new g(e,t);n.push(r),v.set(P,r)}const T=v.get(P),k=T?T.id:void 0,O=i.material;let C=a.get(O,P);if(null==C){const e=x[O.slice(O.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=E?U(E.alphaChannelUsage):void 0,n={ambient:l(e.diffuse),diffuse:l(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:k,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:E?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),C=new y(n,t),a.set(O,P,C)}s.push(C);const $=new d(C,c);b+=c.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push($)}return{engineResources:[{name:p,stageResources:{textures:n,materials:s,geometries:r},pivotOffset:u.model.pivotOffset,numberOfVertices:b,lodThreshold:null}],referenceBoundingBox:M(r)}}function M(e){const t=u();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&(c(t,r.bbMin),c(t,r.bbMax))}),t}async function P(e,t){const r=new Array;for(const o in e){const n=e[o],s=n.images[0].data;if(!s){w().warn("Externally referenced texture data is not yet supported");continue}const a=n.encoding+";base64,"+s,i="/textureDefinitions/"+o,l="rgba"===n.channels?n.alphaChannelUsage||"transparency":"none",u={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==U(l)},c=t?.disableTextures?Promise.resolve(null):p(a,t);r.push(c.then(e=>({refId:i,image:e,parameters:u,alphaChannelUsage:l})))}const n=await Promise.all(r),s={};for(const o of n)s[o.refId]=o;return s}function U(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function I(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const E=new i(1,2,"wosr");export{x as LoaderResultWOSR,P as createTextureResources,h as load,j as processLoadResult};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../../../request.js";import{isRequestQueueFull as t,queueAutoPriority as r}from"../../../../requestQueue.js";import{removeMaybe as o,abortMaybe as s}from"../../../../core/maybe.js";import{onAbortOrThrow as a}from"../../../../core/promiseUtils.js";class l{constructor(e,t){this._customParameters=e,this._apiKey=t,this._activeRequests=new Set}isFull(e){return t(e)}request(t,s,l){const i=new AbortController,n=a(l,()=>i.abort()),u={...r,signal:i.signal,responseType:s,query:{...this._customParameters,token:this._apiKey}},c=e(t,u),m={abortController:i,abortHandle:n};return this._activeRequests.add(m),c.then(({data:e})=>e).finally(()=>{m.abortController=null,m.abortHandle=o(m.abortHandle),this._activeRequests.delete(m)})}cancelAll(){this._activeRequests.forEach(e=>{e.abortController=s(e.abortController),e.abortHandle=o(e.abortHandle)}),this._activeRequests.clear()}}export{l as I3SDataRequester};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{isAbortError as t}from"../../../../core/promiseUtils.js";import{projectBoundingSphere as i}from"../../../../geometry/projection/projectBoundingSphere.js";import{j as n,m as s,c as o,z as r}from"../../../../chunks/sphere.js";import{NodeBase as a,Node as l,NodeTraversalState as d}from"./I3SNode.js";import{invalidateMbs as h,addWraparound as u}from"./I3SUtil.js";import{ValidatedNode as c}from"./ValidatedNode.js";import{ElevationRange as g}from"../../support/ElevationRange.js";import{Obb as _}from"../../support/orientedBoundingBox.js";class f{constructor(e,t,i,n,s){this.childOffset=e,this.childCount=t,this.visibilityCache=i,this._ref=n,this.node=s,this.useAsHole=0,this.filterImpact=2,this.traversalState=null,this.parent=-1}get ref(){return this._ref}destroy(){this._ref=null,this.node=null,this.traversalState=null}invalidateBounds(){this.node?.invalidateServiceBVsInRenderSR(),this.ref?.invalidateServiceBVsInRenderSR()}}class m{constructor(e=new Array,t=new Array){this._nodeInternals=e,this._children=t,this.lastTraversed=0,this.numNodesWithLoadedChildren=0}destroy(){for(const e of this._nodeInternals)e.destroy();this._nodeInternals.length=0,this._children.length=0}get nodes(){return this._nodeInternals}addNode(e){return this._nodeInternals.push(e),this._nodeInternals.length-1}setNodes(e,t){this._nodeInternals=e,this._children=t}get children(){return this._children}}class v{get _useNodePages(){return this._pageSize>0}constructor(t,i,n,s,o,r,a,l,d,h,u,c,g,_,f,m){this.viewingMode=t,this._layer=i,this._streamDataController=s,this._clientNodeLoader=o,this._viewportQueries=r,this._logger=a,this.holeFilling=l,this._isLoaded=d,this._isReloading=h,this._isSelected=u,this._enable=c,this._needsUpdate=g,this._canRequest=_,this._computeVisibilityObb=f,this._computeNodeFiltering=m,this._dirty=!0,this._nodePages=new Map,this._clientNodePage=null,this._pageSize=0,this._rootIndex=0,this._lodMetric=0,this._lodConversion=e=>e,this._isEditable=!1,this._urlPrefix="",this._loadingNodes=new Set,this._loadingPages=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._version=I(0),this._visibilityCacheVersion=I(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._missingPagesAndNodes=new e({deallocator:null}),this._prefetchNodes=new e({deallocator:null}),this._updates=new p(this._missingPagesAndNodes),this._imModificationUncategorized=new e({deallocator:null}),this.ignoreServiceObb=!1,this.progressiveLoadPenalty=0,this._pageQueue=new Array,this._newPages=new Array,this.needNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._frameNumber=0,this._traverseDescendantsQueue=[0],this._traverseDescendantsNestingLevel=0,this._isEditable=null!=i.associatedLayer?.infoFor3D,i.serviceUpdateTimeStamp?.lastUpdate&&(this._lastUpdate=`${i.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,this._init(n)}_init(e){if("page"===e.type){const t=e.rootPage;switch(this._urlPrefix=e.urlPrefix,this._pageSize=e.pageSize,e.lodMetric){case"maxScreenThreshold":this._lodMetric=1;break;case"maxScreenThresholdSQ":this._lodMetric=1,this._lodConversion=O}if(this._isEditable){this._rootIndex=-1;const i=S(e.rootIndex,e.pageSize),n=t.nodes[i],s={nodes:[{index:this._rootIndex,children:[e.rootIndex],mesh:void 0,obb:n.obb,lodThreshold:n.lodThreshold}]};this._addPage(R(this._rootIndex,this._pageSize),s),this.getNode(-1).serviceObbInIndexSR=void 0}else this._rootIndex=e.rootIndex;this._addPage(R(e.rootIndex,this._pageSize),t),this._updateParentsAndLevel()}else if("node"===e.type){this._urlPrefix=e.urlPrefix;const t=new m;if(this._nodePages.set(0,t),this._isEditable){this._clientNodePage=new m;const t={id:"-1",version:null,mbs:e.rootNode.mbs,obb:e.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",href:"../root",mbs:e.rootNode.mbs,obb:e.rootNode.obb}]};this._rootIndex=this._makeClientRefNode(new a(t.id,null),-1);const i=this._validateNode(t.id,t);i&&this._addNode(i,this._rootIndex)}else this._rootIndex=this._makeRefNode(new a(e.rootNode.id,null),-1);const i=this._validateNode(e.rootNode.id,e.rootNode);i&&this._addNode(i,0)}}addClientNodeToIndex(e,t){const i=-1,n=new a(e,t),s=this._makeClientRefNode(n,i);return this._linkChildToParentNode(i,s),this.requestUpdate(),s}removeClientNodeFromIndex(e,t,i){this._destroyClientRefNode(e,t,i),this.requestUpdate()}_loadPage(e){this._loadingPages.add(e);const i=this._urlPrefix+e;this._streamDataController.request(i,0).then(t=>{this._pageQueue.push({pageIndex:e,page:t})}).catch(i=>{this._loadingPages.delete(e),t(i)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._layer,`Error when loading page ${e}`,i))})}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:i}=this._pageQueue.shift();this._addPage(t,i),this._loadingPages.delete(t),e.madeProgress(),this.needNodeElevationRange&&this._newPages.push(t)}this._updateParentsAndLevel()}_invalidateElevationRangeForNewPages(e){if(this.needNodeElevationRange)for(;this._newPages.length>0&&!e.done;){const e=this._nodePages.get(this._newPages.shift());e?.nodes.forEach(e=>{let t=e.parent;for(;null!=t&&t!==this._rootIndex;){const e=this.getNode(t);e&&!Number.isNaN(e?.elevationRangeMin)&&(e.invalidateElevationRange(),this.invalidateBoundingVolumeCache(t)),t=this.getParentIndex(t)}})}}_addPage(e,t){const i=[],s=[],o=t.nodes.map((t,o)=>{const r=i.length,a=t.children?t.children.length:0;s.push(this._rootIndex);for(let e=0;e<a;e++)i.push(t.children[e]);const d=`${t.index}`,h=_.fromJSON(t.obb),u=n(h.center,h.radius),c=t.mesh?.attribute,g=t.mesh?.geometry,m=t.mesh?.material,v={hasSharedResource:!1,isEmpty:null==g,attributes:null!=c?.resource?`${c.resource}`:void 0,geometry:null!=g?.resource?`${g.resource}`:void 0,texture:null!=m?.resource?`${m.resource}`:void 0,geometryDefinition:g?g.definition:-1,materialDefinition:m?m.definition:-1},N=new l(d,C(o,e,this._pageSize),u,a,0,v,this._lastUpdate,this._lodMetric,this._lodConversion(t.lodThreshold),g?.featureCount??null);return N.serviceObbInIndexSR=h,N.visibilityObbInRenderSR=this._computeVisibilityObb(N),N.vertexCount=g?g.vertexCount:0,new f(r,a,b(this._visibilityCacheVersion),null,N)}),r=new m(o,i);-1===e?this._clientNodePage=r:this._nodePages.set(e,r)}_updateParentsAndLevel(){const e=new Array,t=(t,i,n)=>{const s=this._getPage(t);if(null!=s){const o=S(t,this._pageSize),r=s.nodes[o];r.parent=null!=i?i:-1;const a=r.node;null!=a&&(a.level=n,e.push(t))}};for(t(this._rootIndex,null,0);e.length;){const i=e.pop(),n=this.getNode(i);if(null!=n)for(let e=0;e<n.childCount;e++){t(this.getChildIndex(n.index,e),i,n.level+1),this._maxLevel=Math.max(this._maxLevel,n.level+1)}}}_getPage(e){const t=R(e,this._pageSize);return this._getPageFromPageIndex(t)}_getPageFromPageIndex(e){return e<0?this._clientNodePage:this._nodePages.get(e)}_getNodeInternal(e){const t=this._getPage(e);return null==t?null:(t.lastTraversed=this._frameNumber,t.nodes[S(e,this._pageSize)])}_addNode(e,t){e.children&&this.populateChildren(t,e.children);const i=this.getParent(t),n=null!=i?i.level+1:0;this._maxLevel=Math.max(this._maxLevel,e.children?n+1:n);const{lodMetric:s,maxError:o}=E(e.lodSelection),r=this._getNodeInternal(t),a=new l(e.id,t,e.mbs,r.childCount,n,e.resources,e.version,s,o,e.numFeatures);r.node=a,e.obb&&(a.serviceObbInIndexSR=_.fromJSON(e.obb)),a.visibilityObbInRenderSR=this._computeVisibilityObb(a);const d=r.ref;return null!=d&&(null==d.serviceMbsInIndexSR&&(d.serviceMbsInIndexSR=e.mbs),a.shareServiceBVsInRenderSRWith(d),d.visibilityObbInRenderSR=a.visibilityObbInRenderSR),a}_makeRefNode(e,t){const i=this._nodePages.get(0);if(t<-1)return this._makeClientRefNode(e,t);if(null==i)return-1;const n=i.nodes.length,s=new f(0,0,b(this._visibilityCacheVersion),e,null);return i.addNode(s),s.parent=t,e.invalidateServiceBVsInRenderSR(),n}_makeClientRefNode(e,t){const i=this._clientNodePage;if(null==i)return-1;if(t>=0)throw new Error("I3SIndex::client side nodes can not be made children of service side nodes.");const n=-(i.nodes.length+1),s=new f(0,0,b(this._visibilityCacheVersion),e,null);return i.addNode(s),s.parent=t,e.invalidateServiceBVsInRenderSR(),n}_linkChildToParentNode(e,t){const i=this._clientNodePage;if(null==i||e>=0)return;const n=S(e,this._pageSize),s=S(t,this._pageSize),o=i.nodes[n],r=o.childOffset;i.children.splice(o.childOffset+o.childCount,0,t);const a=1;o.childCount+=a,null!=o.node&&(o.node.childCount+=a);for(const l of i.nodes)l.childOffset>r&&(l.childOffset+=a);i.nodes[s].parent=e,this._updateParentBoundingInformation(e)}_destroyClientRefNode(e,t,i){const n=this._clientNodePage;if(null==n)return;const s=this.getParentIndex(e);if(null==s)return;const o=new Set,r=new Map,a=e=>{const i=S(e,this._pageSize),s=n.nodes[i];if(s.childCount>0)for(let t=s.childOffset;t<s.childOffset+s.childCount;++t)a(n.children[t]);const r=s.node?.id??s.ref?.id;if(null==r)throw new Error("Node has no id");t(r,e),o.add(s)};a(e);const l=n.nodes,d=n.children,h=n.nodes.map(()=>-1),u=[],c=[];for(let g=0;g<l.length;++g){const e=l[g];if(o.has(e))continue;const t=u.length,n=C(g,-1,this._pageSize),s=C(t,-1,this._pageSize);if(e.node&&(e.node.index=s),h[g]=s,u.push(e),n!==s){const t=e.node?.id??e.ref?.id;if(null==t)throw new Error("Node has no id");i(t,n,s),r.set(n,s)}}for(let g=0;g<u.length;++g){const e=C(g,-1,this._pageSize),t=u[g],i=c.length;for(let n=t.childOffset;n<t.childOffset+t.childCount;++n){const t=d[n];if(t>=0)c.push(t);else{const i=S(t,this._pageSize),n=l[i];if(o.has(n))continue;const s=h[i];c.push(s),n.parent=e}}t.childOffset=i,t.childCount=c.length-i,t.node&&(t.node.childCount=t.childCount)}n.setNodes(u,c),this._updateParentBoundingInformation(h[S(s,this._pageSize)])}_updateParentBoundingInformation(e){let t=e;do{let e=null;const n=this._clientNodeLoader.indexSR,a=this._clientNodeLoader.renderSR,l=this._getNodeInternal(t);if(null==l)return;for(let o=0;o<l.childCount;o++){const l=this.getChildIndex(t,o),d=this._getNodeInternal(l),h=null!=d?d.ref||d.node:null;if(null!=h&&h.serviceMbsInIndexSR[3]>0)if(null==e)e=s(h.serviceMbsInIndexSR,A);else{const t=L,s=F,o=z;i(h.serviceMbsInIndexSR,n,t,a),i(e,n,s,a),r(t,s,o),i(o,a,e,n)}}const d=t=>{null!=t&&(t.serviceObbInIndexSR=null,null!=e?(t.serviceMbsInIndexSR??=o(),s(e,t.serviceMbsInIndexSR)):h(t.serviceMbsInIndexSR),t.invalidateServiceBVsInRenderSR(),t.geometryObbInRenderSR=null)};d(l.ref),d(l.node),this.invalidateNodeVisibilityCacheInternal(l),t=this.getParentIndex(t)}while(null!=t)}populateChildren(e,t){const i=this._getNodeInternal(e),n=this._getPage(e);i.childOffset=n.children.length,i.childCount=t.length;for(let s=0;s<t.length;s++){const i=this._makeRefNode(t[s],e);n.children.push(i)}}getNode(e){const t=this._getNodeInternal(e);return null!=t?t.node:null}getIndexById(e){let t;return this._forAllNodes((i,n)=>{(null!=i.node&&i.node.id===e||null!=i.ref&&i.ref.id===e)&&(t=n)}),t}getNodeById(e){const t=this.getIndexById(e);return null!=t&&t>=0?this.getNode(t):null}getChildIndex(e,t){const i=this._getPage(e);if(null==i)return-1;const n=i.nodes[S(e,this._pageSize)];return i.children[n.childOffset+t]}getParentIndex(e){const t=this._getPage(e);return null!=t&&e!==this._rootIndex?t.nodes[S(e,this._pageSize)]?.parent:null}getParent(e){const t=this.getParentIndex(e);return null!=t?this.getNode(t):null}isLeaf(e){const t=this._getNodeInternal(e);return null!=t&&0===t.childCount}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(e=>{null!=e.node&&(e.node.geometryObbInRenderSR=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=I(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(e){const t=this._getNodeInternal(e);null!=t&&this.invalidateNodeVisibilityCacheInternal(t)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=b(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(e){const t=this._getNodeInternal(e);null!=t&&(t?.invalidateBounds(),this.invalidateNodeVisibilityCacheInternal(t))}updateElevationChanged(e){const t=this._getNodeInternal(e);if(null==t)return;if(!this.needNodeElevationRange)return void this.invalidateBoundingVolumeCache(e);const i=null!=t.node?t.node:t.ref;null!=i&&i.invalidateElevationRange()}invalidateGeometryVisibility(e){const t=this._getNodeInternal(e),i=t?.node;i&&(i.geometryObbInRenderSR=null,i.invalidateServiceBVsInRenderSR())}invalidateVisibilityObbs(){null!=this.rootNode&&this.traverse(this.rootNode,e=>(e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.geometryObbInRenderSR=null,!0))}_isElevationRangeUpToDate(e){if(!this.needNodeElevationRange)return!0;const t=e?.node??e?.ref;return!t||t.elevationRangeValid}updateElevationRange(e){this._updateElevationRangeInternal(e,null)}_updateElevationRangeInternal(e,t){const i=this._getNodeInternal(e);if(!i)return!1;const n=i?.node??i?.ref;if(!n)return!1;if(n.elevationRangeValid)return t?.expandElevationRange(n),!0;const s=new g;let o=!1;for(let l=0;l<i.childCount;l++){const t=this.getChildIndex(e,l),i=this._updateElevationRangeInternal(t,s);o=o||!i}if(0===i.childCount||o){const e=!i.node?.resources.isEmpty;this._viewportQueries.expandElevationRange(n,e,s)}s.elevationRangeMin!==1/0&&s.elevationRangeMax!==-1/0||s.expandElevationRangeValues(0,0);const r=n.elevationRangeMin,a=n.elevationRangeMax;return r===s.elevationRangeMin&&a===s.elevationRangeMax?(t?.expandElevationRange(n),!0):(i.node?.setElevationRange(s),i.ref?.setElevationRange(s),this.invalidateBoundingVolumeCache(e),t?.expandElevationRange(n),!0)}isNodeVisible(e){const t=this._getNodeInternal(e);if(null==t)return!0;const i=t.ref;if(null!=i&&!i.serviceMbsInIndexSR)return!0;if(this._isElevationRangeUpToDate(t)&&P(t.visibilityCache,this._visibilityCacheVersion))return x(t.visibilityCache);const n=t.node,s=this._viewportQueries;if(n){const e=s.ensureElevationAgnosticBoundingVolume(n),i=s.isElevationAgnosticBoundingVolumeVisible(e);let o=i;if(this.needNodeElevationRange&&i){const t=s.getNodeObbInRenderSRIndependentOfElevationOffset(n);null!=t&&(o=s.isObbVisibleIndependentOfElevation(e,t))}if(!o)return t.visibilityCache=y(!1,this._visibilityCacheVersion),!1}if(this._layerHasFilter&&this._computeNodeFiltering&&(null!=n||null!=i)&&2===t.filterImpact){const e=null!=n?n.serviceMbsInIndexSR:null!=i?i.serviceMbsInIndexSR:null;t.filterImpact=null!=e?this._computeNodeFiltering(e):0}const o=null!=n&&1===t.filterImpact;let r=!(null!=n&&2===n.imModificationImpact)&&!o;if(r){const t=!n||i&&!n.visibilityObbInRenderSR?i??null:n;if(null!=t){this.needNodeElevationRange&&this.updateElevationRange(e);r=s.isNodeVisible(t)}}return t.visibilityCache=y(r,this._visibilityCacheVersion),r}isGeometryVisible(e){if(!this.isNodeVisible(e))return!1;const t=this._getNodeInternal(e);return!!(null==t?.node?.geometryObbInRenderSR||this.layerHasModifications&&4===t.node.imModificationImpact)||this._viewportQueries.isGeometryVisible(t.node)}_traverseCoverage(e,t,i,n,s){const o=this._getPage(e);if(null==o||0===t.childCount)return;const r=t.childOffset+t.childCount,a=new Array;for(let l=t.childOffset;l<r;++l){const e=o.children[l],t=this._getNodeInternal(e);null!=t?.node&&this.isGeometryVisible(e)&&a.push(t)}n/=a.length;for(const l of a){const e=l.node.index;this._isLoaded(e)||this._isReloading(e)?(s.delta=Math.max(s.delta,i),s.coverage+=n):this._traverseCoverage(e,l,i+1,n,s)}}useNodeAsHole(e){if("off"===this.holeFilling)return!1;const t=this._getNodeInternal(e);if(null==t)return!1;if("always"===this.holeFilling)return!0;if(P(t.useAsHole,this._version))return x(t.useAsHole);const i={delta:0,coverage:0};this._traverseCoverage(e,t,0,1,i);const n=i.delta*i.coverage<=.5;return t.useAsHole=y(n,this._version),n}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.destroy(),this._nodePages.clear(),this._clientNodePage=null,this._layer=null,this._missingPagesAndNodes.prune(),this._prefetchNodes.prune(),this._imModificationUncategorized.prune()}requestUpdate(){this._dirty=!0,this._indexMissing=1,this._version=I(this._version)}imModificationsChanged(e){this.layerHasModifications=e,this._forAllNodes(({node:e})=>{null!=e&&(e.imModificationImpact=4,e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.hasModifications&&this.invalidateGeometryVisibility(e.index))}),this.invalidateVisibilityCache()}layerFilterChanged(e){this._layerHasFilter=e,this._forAllNodes(e=>{if(null!=e){e.filterImpact=2;const t=e.node;null!=t&&this.invalidateNodeVisibilityCache(t.index)}}),this.invalidateVisibilityCache()}update(e,t,i){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(t),this._invalidateElevationRangeForNewPages(t),this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._updates.reset(e),N.clear();let n=!0;const s=new M,o=new V,r=this._imModificationUncategorized;r.clear();const a=new Set;let l=0;const d=(a,d,h)=>{const u=R(a,this._pageSize);if(null==d){let e=this._entryPriority(a);return e===1/0&&(e=this._entryPriority(h)),N.set(u,Math.max(e,N.get(u)||0)),this._loadingPages.has(u)||this._failedPages.has(u)||(this._missingPagesAndNodes.push(u),++l),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const c=d.node;if(this._updateNodeFeatureEstimate(c,o),null==c){const e=this._entryPriority(a);return this._loadingNodes.has(a)||this._failedNodes.has(a)||(this._missingPagesAndNodes.push(a),N.set(a,e)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const g=this._getPage(a);if(0===this._missingPagesAndNodes.length&&!this._useNodePages)for(let e=0;e<d.childCount;e++){const t=g.children[d.childOffset+e],i=this._getNodeInternal(t);null!=i&&!i.node&&!this._loadingNodes.has(t)&&!this._failedNodes.has(t)&&t>=0&&(N.set(t,this._entryPriority(t)),this._prefetchNodes.push(t))}if(c.failed||c.resources.isEmpty)return void(n&&d.childCount>0&&this._isSelected(c)&&(n=!1));if(this._isLoaded(a)){if(s.known+=c.memory,++s.knownNodes,this._isSelected(c)?d.childCount>0&&(n=!1):(s.unremoved+=c.memory,n=!1),this._needsUpdate(c)){const e=this._entryPriority(a);N.set(a,e),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e),this._updates.update.push(a)}return}if(c.memory&&(s.known+=c.memory,++s.knownNodes),!this._isSelected(c))return void(this._isReloading(a)&&this._updates.remove.push(a));if(d.childCount>0&&(n=!1),c.memory?(s.missing+=c.memory,s.known+=c.memory,++s.knownNodes):++s.missingNodes,e.includes(c.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._entryPriority(a)),void(this._updates.cancel=this._updates.cancel.filter(e=>e!==c.index));if(!t.done&&this._enable(c))return void t.madeProgress();const _=this._entryPriority(a);N.set(a,_),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,_),this._updates.add.push(a),this.layerHasModifications&&i&&null!=c&&4===c.imModificationImpact&&r.push(a)};this.traverseVisible(d,a),this._frameNumber++,this._missingPagesAndNodes.sort((e,t)=>e-t),this._missingPagesAndNodes.filterInPlace((e,t)=>t<1||this._missingPagesAndNodes.data[t-1]!==e),this._missingPagesAndNodes.sort((e,t)=>N.get(e)-N.get(t)),this._missingPagesAndNodes.length>0&&(this._maxUnloadedPrio=N.get(this._missingPagesAndNodes.back()),this._prefetchNodes.clear()),this._removeUnusedNodePages(a,l);const h=this._updates.add;h.length>0&&this.layerHasModifications&&(r.length>0&&i?.(r),h.filterInPlace(e=>{const t=this._getNodeInternal(e),i=null==t?.node||2!==t.node.imModificationImpact;return i||this.invalidateNodeVisibilityCache(e),i})),this._unloadedMemoryEstimate=s.missing-s.unremoved,s.knownNodes>3&&s.missingNodes>0&&(this._unloadedMemoryEstimate+=s.known/s.knownNodes*s.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate),this._featureEstimate.estimate=this._computeFeatureEstimate(o),this._featureEstimate.leavesReached=n,this._updates.add.filterInPlace(e=>N.get(e)>=this._maxUnloadedPrio).sort((e,t)=>N.get(e)-N.get(t)),this._updates.update.sort((e,t)=>N.get(e)-N.get(t)),this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.length,this._dirty=this._indexMissing>0,N.clear()}checkFeatureTarget(e,t){const i=this._viewportQueries.updateScreenSpaceErrorBias(t);let n=t,s=t,o=i,r=10;for(;r--;){const i=new V;this._updateFeatureEstimate(n,i);if(this._computeFeatureEstimate(i)<=e){if(n>=t||i.missingNodes>0||0===r)break;o=n,n=.5*(n+s)}else s=n,n=.5*(n+o)}return this._version=I(this._version),this._viewportQueries.updateScreenSpaceErrorBias(i),Math.min(t,n)}_removeUnusedNodePages(e,t){if(!this._useNodePages)return;const i=e.size,n=this._nodePages,s=n.size+this._loadingPages.size+t;if(s>D&&s>i){const t=new Array;for(const[i,s]of n)0!==s.numNodesWithLoadedChildren||e.has(i)||t.push([s.lastTraversed,i]);t.sort((e,t)=>e[0]-t[0]).some(e=>{const t=e[1];return this._deleteNodePage(t),n.size<=D})}}_updateFeatureEstimate(e,t){this._version=I(this._version),this._viewportQueries.updateScreenSpaceErrorBias(e),this.traverseVisible((e,i)=>this._updateNodeFeatureEstimate(i?.node,t))}_updateNodeFeatureEstimate(e,t){null!=e&&!e.failed&&this._isSelected(e)&&(null!=e.numFeatures?(t.numFeatures+=e.numFeatures,++t.knownNodes):++t.missingNodes)}_computeFeatureEstimate(e){let t=e.numFeatures;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.numFeatures/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._missingPagesAndNodes)}prefetch(){return this._prefetchNodes.sort((e,t)=>N.get(e)-N.get(t)),this._load(this._prefetchNodes)}_load(e){if(0===e.length||!this._canRequest())return!1;for(;e.length>0&&this._canRequest();){const t=e.pop();this._useNodePages&&t>=0?this._loadPage(t):this._loadNode(t)}return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetchNodes.length>0}get indexLoading(){return this._loadingPages.size+this._loadingNodes.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(null==e)return null;const t=e.index,i=this._getNodeInternal(t);if(!i)return null;let n=i?.traversalState;if(n&&P(n.version,this._version))return n;const s=this._viewportQueries.getLodLevel(e),o=this._viewportQueries.hasLOD(e);let r=!0;if(o){const e=this.getParentIndex(t);if(null!=e){const t=this._getNodeInternal(e),i=t?.traversalState;r=!!i&&s>i.lodLevel}else r=s>0}else r=0===e.childCount;return n?(n.lodLevel=s,n.isChosen=r,n.version=y(!0,this._version),n):(n=new d(o,r,s,y(!0,this._version)),i.traversalState=n,n)}async _loadNode(e){this._loadingNodes.add(e);const i=this._getNodeInternal(e).ref;if(null==i)return void this._failedNodes.add(e);const n=i.id,s=this._urlPrefix+n,o=()=>{this._loadingNodes.delete(e),0===this._missingPagesAndNodes.length&&0===this._loadingNodes.size&&this.requestUpdate()};let r=null;try{r=e>=0?await this._streamDataController.request(s,0):await this._clientNodeLoader.loadNodeJSON(n)}catch(d){return o(),void(t(d)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+s),this._failedNodes.add(e)))}o();const a=this._validateNode(n,r);if(null==a)return;a.obb&&this.invalidateNodeVisibilityCache(e);const l=this._addNode(a,e);this.nodeTraversalState(l)}_validateNode(e,t){if(null==t||"object"!=typeof t||t.id!==e)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&"./shared"!==t.sharedResource.href&&"./shared/"!==t.sharedResource.href&&this._logger.warn("#validateNode()",this._layer,`Invalid shared resource href on node "${e}"`);const i=t.geometryData;null==i||Array.isArray(i)&&0===i.length||Array.isArray(i)&&1===i.length&&"./geometries/0"===i[0].href||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${e}"`);const n=t.attributeData,s=this._layer.attributeStorageInfo;null==n||Array.isArray(n)&&!n.some((e,t)=>e.href!==`./attributes/${s?.[t]?.key??`f_${t}`}/0`)||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._layer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const o=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:void 0,r=t.featureData&&1===t.featureData.length&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:void 0,l=t=>{if(null==t)return null;const i=t=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${e}: ${t}`);if("number"==typeof t.id)i(`id ${t.id} is a number instead of a string.`);else if("string"!=typeof t.id||!Array.isArray(t.mbs))return i("Missing or invalid id."),null;if(!Array.isArray(t.mbs))return i(`Invalid bounding volume on reference ${t.id}.`),null;t.href&&t.href!=="../"+t.id&&this._logger.error("#validateNode()",this._layer,`Invalid node href on node "${e}"`);const n=new a(`${t.id}`,t.mbs);return n.serviceObbInIndexSR=!this.ignoreServiceObb&&t.hasOwnProperty("obb")&&t.obb?_.fromJSON(t.obb):null,n.visibilityObbInRenderSR=this._computeVisibilityObb(n),n},d=Array.isArray(t.children)?t.children.map(l).filter(e=>null!=e):null,h=t.featureData?.length??!1,u=!0===t.isEmpty;return new c(e,t.mbs,o,"string"==typeof t.version?t.version:null,{isEmpty:!h&&u,hasSharedResource:null!=t.sharedResource,attributes:t.attributeData?e:void 0,texture:t.textureData&&t.textureData.length>0?e:void 0,geometry:null!=t.geometryData?e:void 0},d,Array.isArray(t.lodSelection)?t.lodSelection:null,r)}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes(e=>{null!=e.node&&(e.node.failed=!1)})}_entryPriority(e){const t=this._getNodeInternal(e),i=this.getParentIndex(e);if(null==t||null==i&&null==t.node)return null==i?1/0:this._entryPriority(i);let n=0;if(t.node&&null!=i){const e=this._getNodeInternal(i).traversalState;null!=e&&(n=e.lodLevel)}let s=this.progressiveLoadPenalty;for(let r=e;null!=r;r=this.getParentIndex(r))if(this._isLoaded(r)){s=0;break}const o=null!=t.ref?this._viewportQueries.distToPOI(t.ref):null!=t.node?this._viewportQueries.distToPOI(t.node):0;return-o-n*(o+this.progressiveLoadPenalty)+s}traverseVisible(e,t){const i=this._getNodeInternal(this._rootIndex);null!=i?this._traverseVisible(this._rootIndex,null,i,e,t):e(this._rootIndex,null,null)}_traverseVisible(e,t,i,n,s){const o=R(e,this._pageSize);if(s&&s.add(o),i.node&&0===i.childCount)return void(this.isGeometryVisible(e)&&n(e,i,t));if(!this.isNodeVisible(e))return;if(n(e,i,t),null==i.node)return;const r=this.nodeTraversalState(i.node);if(r?.nodeHasLOD&&r.lodLevel===this._maxLodLevel)return;const a=this._getPageFromPageIndex(o);for(let l=0;l<i.childCount;l++){const t=a.children[i.childOffset+l],o=this._getNodeInternal(t);if(o)this._traverseVisible(t,e,o,n,s);else{if(s){const e=R(t,this._pageSize);s.add(e)}n(t,null,e)}}}traverse(e,t){t(e)&&this.traverseDescendants(e,t)}traverseDescendants(e,t){++this._traverseDescendantsNestingLevel;const i=e.index,n=this._pageSize,s=R(i,n),o=this._getPageFromPageIndex(s);if(null==o)return;const r=this._frameNumber,a=this._nodePages,l=S(i,n),d=o.nodes[l],h=d.childCount;if(o.lastTraversed=r,0===h)return;const u=new Array,c=1===this._traverseDescendantsNestingLevel?this._traverseDescendantsQueue:[0];let g=0;{const{childOffset:e,childCount:t}=d,{children:i}=o;c.length=2**Math.ceil(Math.log2(g+t));for(let n=e;n<e+t;++n){const e=i[n];e>=0?(c[g]=e,++g):u.push(e)}}if(u.length>0){const e=this._clientNodePage;if(e){const i=e.children;let n=0;for(;n<u.length;){const s=u[n];++n;const o=-s-1,r=e.nodes[o],a=r.node;if(!a||!t(a))continue;const{childCount:l}=r;if(0===l)continue;const{childOffset:d}=r,h=d+l;for(let e=d;e<h;++e)u.push(i[e])}}}if(g>0){let e=0;if(n>0){let i=s*n,l=o,d=l.nodes;for(;e<g;){const s=c[e];let o;if(++e,i<=s&&s<i+n)o=l;else{const e=s/n|0,t=a.get(e);if(void 0===t)continue;o=t,o.lastTraversed=r,l=o,d=l.nodes,i=n*e}const h=d[s-i],u=h.node;if(null==u||!1===t(u))continue;const{childCount:_}=h;if(0===_)continue;const f=g+_;for(c.length<f&&(c.length=2**Math.ceil(Math.log2(g+_)));c.length<g+_;)c.length+=c.length;const m=o.children,{childOffset:v}=h,N=v+_;for(let e=v;e<N;++e)c[g]=m[e],++g}}else{const i=a.get(0);if(i)for(;e<g;){const n=c[e++],s=i.nodes[n],o=s.node;if(!o||!t(o))continue;const{childCount:r}=s;if(0===r)continue;c.length=Math.max(c.length,2**Math.ceil(Math.log2(g+r)));const a=i.children,{childOffset:l}=s,d=l+r;for(let e=l;e<d;++e)c[g]=a[e],++g}}}--this._traverseDescendantsNestingLevel}updateChildrenLoaded(e,t){let i=this.getNode(e);for(;null!=i;){const e=i.childrenLoaded,n=e+t;i.childrenLoaded=n;const s=0===e?1:0===n?-1:0,o=i.index;if(0!==s){this._getPage(o).numNodesWithLoadedChildren+=s}i=this.getParent(o)}}checkChildrenLoadedInvariant(){return!0}updateElevationInfo(e,t){this.needNodeElevationRange=t&&!!e&&("relative-to-ground"===e.mode||"relative-to-scene"===e.mode||"on-the-ground"===e.mode),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(e=>{e?.invalidateBounds(),e.node?.invalidateElevationRange(),e.ref?.invalidateElevationRange()})}_forAllNodes(e){if(null!=this._clientNodePage){const t=this._clientNodePage;for(let i=0;i<t.nodes.length;i++)e(t.nodes[i],-(i+1))}for(const[t,i]of this._nodePages){const n=t*this._pageSize;for(let t=0;t<i.nodes.length;t++)e(i.nodes[t],n+t)}}clearCaches(){if(this._useNodePages){const e=this._nodePages,t=new Set;this.traverseVisible(e=>t.add(R(e,this._pageSize)));for(const[i,n]of e)if(0!==n.numNodesWithLoadedChildren||t.has(i))for(const e of n.nodes)e.traversalState=null;else this._deleteNodePage(i)}}_deleteNodePage(e){const t=this._nodePages.get(e);this._nodePages.delete(e),t?.destroy()}get test(){}}const N=new Map;class p{constructor(t){this.missing=t,this.update=new e({deallocator:null}),this.add=new e({deallocator:null}),this.remove=new e({deallocator:null}),this.cancel=[]}destroy(){this.update.prune(),this.add.prune(),this.remove.prune(),this.cancel.length=0}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}}function b(e){return u(e,-2)}function I(e){return u(e,2)}function y(e,t){return t+(e?1:0)}function P(e,t){return(-2&e)===t}function x(e){return!(1&~e)}function R(e,t){return e<0?-1:t>0?e/t|0:0}function S(e,t){return e<0?-e-1:0===t?e:e%t}function C(e,t,i){return-1===t?-(e+1):0===i?e:t*i+e}const w=[["maxScreenThreshold",1],["screenSpaceRelative",2],["removedFeatureDiameter",3],["distanceRangeFromDefaultCamera",4]];function E(e){if(e)for(let t=0;t<e.length;t++)for(const i of w)if(i[0]===e[t].metricType)return{lodMetric:i[1],maxError:e[t].maxError};return{lodMetric:0,maxError:0}}class M{constructor(){this.known=0,this.knownNodes=0,this.missing=0,this.missingNodes=0,this.unremoved=0}}class V{constructor(){this.numFeatures=0,this.knownNodes=0,this.missingNodes=0}}function O(e){return Math.sqrt(e*(4/Math.PI))}const A=o(),L=o(),F=o(),z=o(),D=has("esri-mobile")?100:300;export{v as I3SIndex,E as selectErrorMetric};
5
+ import has from"../../../../core/has.js";import e from"../../../../core/PooledArray.js";import{isAbortError as t}from"../../../../core/promiseUtils.js";import{projectBoundingSphere as i}from"../../../../geometry/projection/projectBoundingSphere.js";import{j as s,m as n,c as o,z as r}from"../../../../chunks/sphere.js";import{NodeBoundingData as a,Node as d,NodeTraversalState as l}from"./I3SNode.js";import{invalidateMbs as h,addWraparound as u}from"./I3SUtil.js";import{ValidatedNode as c}from"./ValidatedNode.js";import{ElevationRange as g}from"../../support/ElevationRange.js";import{Obb as _}from"../../support/orientedBoundingBox.js";class f{constructor(e,t,i,s,n){this.childOffset=e,this.childCount=t,this.visibilityCache=i,this._boundingData=s,this.node=n,this.parentIndex=-1,this.useAsHole=0,this.filterImpact=2,this.traversalState=null}get nodeBoundingData(){return this._boundingData}destroy(){this._boundingData=null,this.node=null,this.traversalState=null}invalidateBounds(){this.node?.invalidateServiceBVsInRenderSR(),this.nodeBoundingData?.invalidateServiceBVsInRenderSR()}}class m{constructor(e=new Array,t=new Array){this._nodeDescriptors=e,this._children=t,this.lastTraversed=0,this.numNodesWithLoadedChildren=0}destroy(){for(const e of this._nodeDescriptors)e.destroy();this._nodeDescriptors.length=0,this._children.length=0}get nodes(){return this._nodeDescriptors}addNode(e){return this._nodeDescriptors.push(e),this._nodeDescriptors.length-1}setNodes(e,t){this._nodeDescriptors=e,this._children=t}get children(){return this._children}}class v{get _useNodePages(){return this._pageSize>0}constructor(t,i,s,n,o,r,d,l,h,u,c,g,_,f,v){if(this.viewingMode=t,this._layer=i,this._requester=n,this._clientNodeLoader=o,this._viewportQueries=r,this._logger=d,this.holeFilling=l,this._isLoaded=h,this._isReloading=u,this._shouldLoadNode=c,this._enable=g,this._needsUpdate=_,this._computeVisibilityObb=f,this._computeNodeFiltering=v,this._dirty=!0,this._nodePages=new Map,this._clientNodePage=null,this._pageSize=0,this._rootIndex=0,this._lodMetric=0,this._lodConversion=e=>e,this._isEditable=!1,this.urlPrefix="",this._loadingNodes=new Set,this._loadingPages=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._version=P(0),this._visibilityCacheVersion=P(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._missingPagesAndNodes=new e({deallocator:null}),this._prefetchNodes=new e({deallocator:null}),this._updates=new N(this._missingPagesAndNodes),this._imModificationUncategorized=new e({deallocator:null}),this.ignoreServiceObb=!1,this._pageQueue=new Array,this._newPages=new Array,this.needNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._frameNumber=0,this._traverseDescendantsQueue=[0],this._traverseDescendantsNestingLevel=0,this._isEditable=null!=i.associatedLayer?.infoFor3D,i.serviceUpdateTimeStamp?.lastUpdate&&(this._lastUpdate=`${i.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,"page"===s.type){const e=s.rootPage;switch(this.urlPrefix=s.urlPrefix,this._pageSize=s.pageSize,s.lodMetric){case"maxScreenThreshold":this._lodMetric=1;break;case"maxScreenThresholdSQ":this._lodMetric=1,this._lodConversion=A}if(this._isEditable){this._rootIndex=-1;const t=S(s.rootIndex,s.pageSize),i=e.nodes[t],n={nodes:[{index:this._rootIndex,children:[s.rootIndex],mesh:void 0,obb:i.obb,lodThreshold:i.lodThreshold}]};this._addPage(R(this._rootIndex,this._pageSize),n),this.getNode(-1).serviceObbInIndexSR=void 0}else this._rootIndex=s.rootIndex;this._addPage(R(s.rootIndex,this._pageSize),e),this._updateParentsAndLevel()}else if("node"===s.type){this.urlPrefix=s.urlPrefix;const e=new m;if(this._nodePages.set(0,e),this._isEditable){this._clientNodePage=new m;const e={id:"-1",version:null,mbs:s.rootNode.mbs,obb:s.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",href:"../root",mbs:s.rootNode.mbs,obb:s.rootNode.obb}]};this._rootIndex=this._makeClientRefNode(new a(e.id,null),-1);const t=this._validateNode(e.id,e);t&&this._addNode(t,this._rootIndex)}else this._rootIndex=this._makeRefNode(new a(s.rootNode.id,null),-1);const t=this._validateNode(s.rootNode.id,s.rootNode);t&&this._addNode(t,0)}}addClientNodeToIndex(e,t){const i=-1,s=new a(e,t),n=this._makeClientRefNode(s,i);return this._linkChildToParentNode(i,n),this.requestUpdate(),n}removeClientNodeFromIndex(e,t,i){this._destroyClientRefNode(e,t,i),this.requestUpdate()}_canRequest(e){return!this._requester.isFull(e)}_loadPage(e){this._loadingPages.add(e);const i=this.urlPrefix+e;this._requester.request(i,"json").then(t=>this._pageQueue.push({pageIndex:e,page:t})).catch(i=>{this._loadingPages.delete(e),t(i)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._layer,`Error when loading page ${e}`,i))})}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:i}=this._pageQueue.shift();this._addPage(t,i),this._loadingPages.delete(t),e.madeProgress(),this.needNodeElevationRange&&this._newPages.push(t)}this._updateParentsAndLevel()}_invalidateElevationRangeForNewPages(e){if(this.needNodeElevationRange)for(;this._newPages.length>0&&!e.done;){const e=this._nodePages.get(this._newPages.shift());e?.nodes.forEach(e=>{let t=e.parentIndex;for(;null!=t&&t!==this._rootIndex;){const e=this.getNode(t);e&&!Number.isNaN(e?.elevationRangeMin)&&(e.invalidateElevationRange(),this.invalidateBoundingVolumeCache(t)),t=this._getParentIndex(t)}})}}_addPage(e,t){const i=[],n=[],o=t.nodes.map((t,o)=>{const r=i.length,a=t.children?t.children.length:0;n.push(this._rootIndex);for(let e=0;e<a;e++)i.push(t.children[e]);const l=`${t.index}`,h=_.fromJSON(t.obb),u=s(h.center,h.radius),c=t.mesh?.attribute,g=t.mesh?.geometry,m=t.mesh?.material,v={hasSharedResource:!1,isEmpty:null==g,attributes:null!=c?.resource?`${c.resource}`:void 0,geometry:null!=g?.resource?`${g.resource}`:void 0,texture:null!=m?.resource?`${m.resource}`:void 0,geometryDefinition:g?g.definition:-1,materialDefinition:m?m.definition:-1},p=new d(l,C(o,e,this._pageSize),u,a,0,v,this._lastUpdate,this._lodMetric,this._lodConversion(t.lodThreshold),g?.featureCount??null);return p.serviceObbInIndexSR=h,p.visibilityObbInRenderSR=this._computeVisibilityObb(p),p.vertexCount=g?g.vertexCount:0,new f(r,a,b(this._visibilityCacheVersion),null,p)}),r=new m(o,i);-1===e?this._clientNodePage=r:this._nodePages.set(e,r)}_updateParentsAndLevel(){const e=new Array,t=(t,i,s)=>{const n=this._getPage(t);if(null!=n){const o=S(t,this._pageSize),r=n.nodes[o];r.parentIndex=null!=i?i:-1;const a=r.node;null!=a&&(a.level=s,e.push(t))}};for(t(this._rootIndex,null,0);e.length;){const i=e.pop(),s=this.getNode(i);if(null!=s)for(let e=0;e<s.childCount;e++){t(this.getChildIndex(s.index,e),i,s.level+1),this._maxLevel=Math.max(this._maxLevel,s.level+1)}}}_getPage(e){const t=R(e,this._pageSize);return this._getPageFromPageIndex(t)}_getPageFromPageIndex(e){return e<0?this._clientNodePage:this._nodePages.get(e)}_getNodeDescriptor(e){const t=this._getPage(e);return null==t?null:(t.lastTraversed=this._frameNumber,t.nodes[S(e,this._pageSize)])}_addNode(e,t){e.children&&this.populateChildren(t,e.children);const i=this.getParent(t),s=null!=i?i.level+1:0;this._maxLevel=Math.max(this._maxLevel,e.children?s+1:s);const{lodMetric:n,maxError:o}=E(e.lodSelection),r=this._getNodeDescriptor(t),a=new d(e.id,t,e.mbs,r.childCount,s,e.resources,e.version,n,o,e.numFeatures);r.node=a,e.obb&&(a.serviceObbInIndexSR=_.fromJSON(e.obb)),a.visibilityObbInRenderSR=this._computeVisibilityObb(a);const l=r.nodeBoundingData;return null!=l&&(null==l.serviceMbsInIndexSR&&(l.serviceMbsInIndexSR=e.mbs),a.shareServiceBVsInRenderSRWith(l),l.visibilityObbInRenderSR=a.visibilityObbInRenderSR),a}_makeRefNode(e,t){const i=this._nodePages.get(0);if(t<-1)return this._makeClientRefNode(e,t);if(null==i)return-1;const s=i.nodes.length,n=new f(0,0,b(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_makeClientRefNode(e,t){const i=this._clientNodePage;if(null==i)return-1;if(t>=0)throw new Error("I3SIndex::client side nodes can not be made children of service side nodes.");const s=-(i.nodes.length+1),n=new f(0,0,b(this._visibilityCacheVersion),e,null);return i.addNode(n),n.parentIndex=t,e.invalidateServiceBVsInRenderSR(),s}_linkChildToParentNode(e,t){const i=this._clientNodePage;if(null==i||e>=0)return;const s=S(e,this._pageSize),n=S(t,this._pageSize),o=i.nodes[s],r=o.childOffset;i.children.splice(o.childOffset+o.childCount,0,t);const a=1;o.childCount+=a,null!=o.node&&(o.node.childCount+=a);for(const d of i.nodes)d.childOffset>r&&(d.childOffset+=a);i.nodes[n].parentIndex=e,this._updateParentBoundingInformation(e)}_destroyClientRefNode(e,t,i){const s=this._clientNodePage;if(null==s)return;const n=this._getParentIndex(e);if(null==n)return;const o=new Set,r=new Map,a=e=>{const i=S(e,this._pageSize),n=s.nodes[i];if(n.childCount>0)for(let t=n.childOffset;t<n.childOffset+n.childCount;++t)a(s.children[t]);const r=n.node?.id??n.nodeBoundingData?.id;if(null==r)throw new Error("Node has no id");t(r,e),o.add(n)};a(e);const d=s.nodes,l=s.children,h=s.nodes.map(()=>-1),u=[],c=[];for(let g=0;g<d.length;++g){const e=d[g];if(o.has(e))continue;const t=u.length,s=C(g,-1,this._pageSize),n=C(t,-1,this._pageSize);if(e.node&&(e.node.index=n),h[g]=n,u.push(e),s!==n){const t=e.node?.id??e.nodeBoundingData?.id;if(null==t)throw new Error("Node has no id");i(t,s,n),r.set(s,n)}}for(let g=0;g<u.length;++g){const e=C(g,-1,this._pageSize),t=u[g],i=c.length;for(let s=t.childOffset;s<t.childOffset+t.childCount;++s){const t=l[s];if(t>=0)c.push(t);else{const i=S(t,this._pageSize),s=d[i];if(o.has(s))continue;const n=h[i];c.push(n),s.parentIndex=e}}t.childOffset=i,t.childCount=c.length-i,t.node&&(t.node.childCount=t.childCount)}s.setNodes(u,c),this._updateParentBoundingInformation(h[S(n,this._pageSize)])}_updateParentBoundingInformation(e){let t=e;do{let e=null;const s=this._clientNodeLoader.indexSR,a=this._clientNodeLoader.renderSR,d=this._getNodeDescriptor(t);if(null==d)return;for(let o=0;o<d.childCount;o++){const d=this.getChildIndex(t,o),l=this._getNodeDescriptor(d),h=null!=l?l.nodeBoundingData||l.node:null;if(null!=h&&h.serviceMbsInIndexSR[3]>0)if(null==e)e=n(h.serviceMbsInIndexSR,V);else{const t=O,n=L,o=B;i(h.serviceMbsInIndexSR,s,t,a),i(e,s,n,a),r(t,n,o),i(o,a,e,s)}}const l=t=>{null!=t&&(t.serviceObbInIndexSR=null,null!=e?(t.serviceMbsInIndexSR??=o(),n(e,t.serviceMbsInIndexSR)):h(t.serviceMbsInIndexSR),t.invalidateServiceBVsInRenderSR(),t.geometryObbInRenderSR=null)};l(d.nodeBoundingData),l(d.node),this.invalidateNodeVisibilityCacheInternal(d),t=this._getParentIndex(t)}while(null!=t)}populateChildren(e,t){const i=this._getNodeDescriptor(e),s=this._getPage(e);i.childOffset=s.children.length,i.childCount=t.length;for(let n=0;n<t.length;n++){const i=this._makeRefNode(t[n],e);s.children.push(i)}}getNode(e){const t=this._getNodeDescriptor(e);return null!=t?t.node:null}getIndexById(e){let t;return this._forAllNodes((i,s)=>{(null!=i.node&&i.node.id===e||null!=i.nodeBoundingData&&i.nodeBoundingData.id===e)&&(t=s)}),t}getNodeById(e){const t=this.getIndexById(e);return null!=t&&t>=0?this.getNode(t):null}getChildIndex(e,t){const i=this._getPage(e);if(null==i)return-1;const s=i.nodes[S(e,this._pageSize)];return i.children[s.childOffset+t]}_getParentIndex(e){const t=this._getPage(e);return null!=t&&e!==this._rootIndex?t.nodes[S(e,this._pageSize)]?.parentIndex:null}getParent(e){const t=this._getParentIndex(e);return null!=t?this.getNode(t):null}isLeaf(e){const t=this._getNodeDescriptor(e);return null!=t&&0===t.childCount}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(e=>{null!=e.node&&(e.node.geometryObbInRenderSR=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=P(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(e){const t=this._getNodeDescriptor(e);null!=t&&this.invalidateNodeVisibilityCacheInternal(t)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=b(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(e){const t=this._getNodeDescriptor(e);null!=t&&(t?.invalidateBounds(),this.invalidateNodeVisibilityCacheInternal(t))}updateElevationChanged(e){const t=this._getNodeDescriptor(e);if(null==t)return;if(!this.needNodeElevationRange)return void this.invalidateBoundingVolumeCache(e);const i=null!=t.node?t.node:t.nodeBoundingData;null!=i&&i.invalidateElevationRange()}invalidateGeometryVisibility(e){const t=this._getNodeDescriptor(e),i=t?.node;i&&(i.geometryObbInRenderSR=null,i.invalidateServiceBVsInRenderSR())}invalidateVisibilityObbs(){null!=this.rootNode&&this.traverse(this.rootNode,e=>(e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.geometryObbInRenderSR=null,!0))}_isElevationRangeUpToDate(e){if(!this.needNodeElevationRange)return!0;const t=e?.node??e?.nodeBoundingData;return!t||t.elevationRangeValid}_updateElevationRange(e,t){const i=this._getNodeDescriptor(e);if(!i)return!1;const s=i?.node??i?.nodeBoundingData;if(!s)return!1;if(s.elevationRangeValid)return t?.expandElevationRange(s),!0;const n=new g;let o=!1;for(let d=0;d<i.childCount;d++){const t=this.getChildIndex(e,d),i=this._updateElevationRange(t,n);o=o||!i}if(0===i.childCount||o){const e=!i.node?.resources.isEmpty;this._viewportQueries.expandElevationRange(s,e,n)}n.elevationRangeMin!==1/0&&n.elevationRangeMax!==-1/0||n.expandElevationRangeValues(0,0);const{elevationRangeMin:r,elevationRangeMax:a}=s;return r===n.elevationRangeMin&&a===n.elevationRangeMax?(t?.expandElevationRange(s),!0):(i.node?.setElevationRange(n),i.nodeBoundingData?.setElevationRange(n),this.invalidateBoundingVolumeCache(e),t?.expandElevationRange(s),!0)}isNodeVisible(e){const t=this._getNodeDescriptor(e);if(null==t)return!0;const i=t.nodeBoundingData;if(null!=i&&!i.serviceMbsInIndexSR)return!0;if(this._isElevationRangeUpToDate(t)&&I(t.visibilityCache,this._visibilityCacheVersion))return x(t.visibilityCache);const s=t.node,n=this._viewportQueries;if(s){const e=n.ensureElevationAgnosticBoundingVolume(s),i=n.isElevationAgnosticBoundingVolumeVisible(e);let o=i;if(this.needNodeElevationRange&&i){const t=n.getNodeObbInRenderSRIndependentOfElevationOffset(s);null!=t&&(o=n.isObbVisibleIndependentOfElevation(e,t))}if(!o)return t.visibilityCache=y(!1,this._visibilityCacheVersion),!1}if(this._layerHasFilter&&this._computeNodeFiltering&&(null!=s||null!=i)&&2===t.filterImpact){const e=null!=s?s.serviceMbsInIndexSR:null!=i?i.serviceMbsInIndexSR:null;t.filterImpact=null!=e?this._computeNodeFiltering(e):0}const o=null!=s&&1===t.filterImpact;let r=!(null!=s&&2===s.imModificationImpact)&&!o;if(r){const t=!s||i&&!s.visibilityObbInRenderSR?i??null:s;if(null!=t){this.needNodeElevationRange&&this._updateElevationRange(e);r=n.isNodeVisible(t)}}return t.visibilityCache=y(r,this._visibilityCacheVersion),r}isGeometryVisible(e){if(!this.isNodeVisible(e))return!1;const t=this._getNodeDescriptor(e);return!!(null==t?.node?.geometryObbInRenderSR||this.layerHasModifications&&4===t.node.imModificationImpact)||this._viewportQueries.isGeometryVisible(t.node)}_traverseCoverage(e,t,i,s,n){const o=this._getPage(e);if(null==o||0===t.childCount)return;const r=t.childOffset+t.childCount,a=new Array;for(let d=t.childOffset;d<r;++d){const e=o.children[d],t=this._getNodeDescriptor(e);null!=t?.node&&this.isGeometryVisible(e)&&a.push(t)}s/=a.length;for(const d of a){const e=d.node.index;this._isLoaded(e)||this._isReloading(e)?(n.delta=Math.max(n.delta,i),n.coverage+=s):this._traverseCoverage(e,d,i+1,s,n)}}useNodeAsHole(e){if("off"===this.holeFilling)return!1;const t=this._getNodeDescriptor(e);if(null==t)return!1;if("always"===this.holeFilling)return!0;if(I(t.useAsHole,this._version))return x(t.useAsHole);const i={delta:0,coverage:0};this._traverseCoverage(e,t,0,1,i);const s=i.delta*i.coverage<=.5;return t.useAsHole=y(s,this._version),s}get maxLevel(){return this._maxLevel}get dirty(){return this._dirty}destroy(){this._updates.destroy(),this._nodePages.clear(),this._clientNodePage=null,this._layer=null,this._missingPagesAndNodes.prune(),this._prefetchNodes.prune(),this._imModificationUncategorized.prune()}requestUpdate(){this._dirty=!0,this._indexMissing=1,this._version=P(this._version)}imModificationsChanged(e){this.layerHasModifications=e,this._forAllNodes(({node:e})=>{null!=e&&(e.imModificationImpact=4,e.visibilityObbInRenderSR=this._computeVisibilityObb(e),e.hasModifications&&this.invalidateGeometryVisibility(e.index))}),this.invalidateVisibilityCache()}layerFilterChanged(e){this._layerHasFilter=e,this._forAllNodes(e=>{if(null!=e){e.filterImpact=2;const t=e.node;null!=t&&this.invalidateNodeVisibilityCache(t.index)}}),this.invalidateVisibilityCache()}update(e,t,i){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(t),this._invalidateElevationRangeForNewPages(t),this.resetUpdateState(e);let s=!0;const n=new M,o=new D,r=this._imModificationUncategorized;r.clear();const a=new Set;let d=0;const l=(a,l,h)=>{const u=e=>{this._shouldLoadNode(e)&&e.childCount&&(s=!1)};if(!l){const e=R(a,this._pageSize);let t=this._getNodeLoadPriority(a);return t===1/0&&(t=this._getNodeLoadPriority(h)),p.set(e,Math.max(t,p.get(e)||0)),this._loadingPages.has(e)||this._failedPages.has(e)||(this._missingPagesAndNodes.push(e),++d),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,t))}const{node:c,childCount:g}=l;if(this._updateNodeFeatureEstimate(c,o),!c){const e=this._getNodeLoadPriority(a);return this._loadingNodes.has(a)||this._failedNodes.has(a)||(this._missingPagesAndNodes.push(a),p.set(a,e)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e))}const _=this._getPage(a);if(!this._useNodePages&&0===this._missingPagesAndNodes.length)for(let e=0;e<g;e++){const t=_.children[l.childOffset+e],i=this._getNodeDescriptor(t);null!=i&&!i.node&&!this._loadingNodes.has(t)&&!this._failedNodes.has(t)&&t>=0&&(p.set(t,this._getNodeLoadPriority(t)),this._prefetchNodes.push(t))}if(c.failed||c.resources.isEmpty)return void u(c);if(this._isLoaded(a)){if(n.known+=c.memory,++n.knownNodes,u(c),this._shouldLoadNode(c)||(n.unremoved+=c.memory),this._needsUpdate(c)){const e=this._getNodeLoadPriority(a);p.set(a,e),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,e),this._updates.update.push(a)}return}if(c.memory&&(n.known+=c.memory,++n.knownNodes),!this._shouldLoadNode(c))return void(this._isReloading(a)&&this._updates.remove.push(a));if(u(c),c.memory?(n.missing+=c.memory,n.known+=c.memory,++n.knownNodes):++n.missingNodes,e.includes(c.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._getNodeLoadPriority(a)),void(this._updates.cancel=this._updates.cancel.filter(e=>e!==c.index));if(!t.done&&this._enable(c))return void t.madeProgress();const f=this._getNodeLoadPriority(a);p.set(a,f),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,f),this._updates.add.push(a),this.layerHasModifications&&i&&null!=c&&4===c.imModificationImpact&&r.push(a)};this.traverseVisible(l,a),this._frameNumber++,this._finalizeMissingNodesAndPages(),this._removeUnusedNodePages(a,d),this._handleModifications(i,r),this._updateUnloadedMemoryEstimate(n),this._featureEstimate.estimate=this._computeFeatureEstimate(o),this._featureEstimate.leavesReached=s,this._updates.add.filterInPlace(e=>p.get(e)>=this._maxUnloadedPrio).sort((e,t)=>p.get(e)-p.get(t)),this._updates.update.sort((e,t)=>p.get(e)-p.get(t)),this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.length,this._dirty=this._indexMissing>0,p.clear()}_updateUnloadedMemoryEstimate(e){this._unloadedMemoryEstimate=e.missing-e.unremoved,e.knownNodes>3&&e.missingNodes>0&&(this._unloadedMemoryEstimate+=e.known/e.knownNodes*e.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate)}resetUpdateState(e){this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._updates.reset(e),p.clear()}_finalizeMissingNodesAndPages(){this._missingPagesAndNodes.sort((e,t)=>e-t),this._missingPagesAndNodes.filterInPlace((e,t)=>t<1||this._missingPagesAndNodes.data[t-1]!==e),this._missingPagesAndNodes.sort((e,t)=>p.get(e)-p.get(t)),this._missingPagesAndNodes.length>0&&(this._maxUnloadedPrio=p.get(this._missingPagesAndNodes.back()),this._prefetchNodes.clear())}_handleModifications(e,t){this.layerHasModifications&&0!==this._updates.add.length&&(t.length>0&&e?.(t),this._updates.add.filterInPlace(e=>{const t=this._getNodeDescriptor(e),i=null==t?.node||2!==t.node.imModificationImpact;return i||this.invalidateNodeVisibilityCache(e),i}))}checkFeatureTarget(e,t){const i=this._viewportQueries.updateScreenSpaceErrorBias(t);let s=t,n=t,o=i,r=10;for(;r--;){const i=new D;this._updateFeatureEstimate(s,i);if(this._computeFeatureEstimate(i)<=e){if(s>=t||i.missingNodes>0||0===r)break;o=s,s=.5*(s+n)}else n=s,s=.5*(s+o)}return this._version=P(this._version),this._viewportQueries.updateScreenSpaceErrorBias(i),Math.min(t,s)}_removeUnusedNodePages(e,t){if(!this._useNodePages)return;const i=e.size,s=this._nodePages,n=s.size+this._loadingPages.size+t;if(n>z&&n>i){const t=new Array;for(const[i,n]of s)0!==n.numNodesWithLoadedChildren||e.has(i)||t.push([n.lastTraversed,i]);t.sort((e,t)=>e[0]-t[0]).some(e=>{const t=e[1];return this._deleteNodePage(t),s.size<=z})}}_updateFeatureEstimate(e,t){this._version=P(this._version),this._viewportQueries.updateScreenSpaceErrorBias(e),this.traverseVisible((e,i)=>this._updateNodeFeatureEstimate(i?.node,t))}_updateNodeFeatureEstimate(e,t){null!=e&&!e.failed&&this._shouldLoadNode(e)&&(null!=e.numFeatures?(t.numFeatures+=e.numFeatures,++t.knownNodes):++t.missingNodes)}_computeFeatureEstimate(e){let t=e.numFeatures;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.numFeatures/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._missingPagesAndNodes)}prefetch(){return this._prefetchNodes.sort((e,t)=>p.get(e)-p.get(t)),this._load(this._prefetchNodes)}_load(e){if(0===e.length||!this._canRequest(this.urlPrefix))return!1;for(;e.length>0&&this._canRequest(this.urlPrefix);){const t=e.pop();this._useNodePages&&t>=0?this._loadPage(t):this._loadNode(t)}return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetchNodes.length>0}get indexLoading(){return this._loadingPages.size+this._loadingNodes.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(null==e)return null;const t=e.index,i=this._getNodeDescriptor(t);if(!i)return null;let s=i?.traversalState;if(s&&I(s.version,this._version))return s;const n=this._viewportQueries.getLodLevel(e),o=this._viewportQueries.hasLOD(e);let r=!0;if(o){const e=this._getParentIndex(t);if(null!=e){const t=this._getNodeDescriptor(e),i=t?.traversalState;r=!!i&&n>i.lodLevel}else r=n>0}else r=0===e.childCount;return s?(s.lodLevel=n,s.isChosen=r,s.version=y(!0,this._version),s):(s=new l(o,r,n,y(!0,this._version)),i.traversalState=s,s)}_loadNode(e){this._loadingNodes.add(e);const i=this._getNodeDescriptor(e).nodeBoundingData;if(null==i)return void this._failedNodes.add(e);const s=i.id,n=this.urlPrefix+s,o=()=>{this._loadingNodes.delete(e),0===this._missingPagesAndNodes.length&&0===this._loadingNodes.size&&this.requestUpdate()};(e>=0?this._requester.request(n,"json"):this._clientNodeLoader.loadNodeJSON(s)).catch(i=>{o(),t(i)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+n),this._failedNodes.add(e))}).then(t=>{o();const i=this._validateNode(s,t);if(null==i)return;i.obb&&this.invalidateNodeVisibilityCache(e);const n=this._addNode(i,e);this.nodeTraversalState(n)})}_validateNode(e,t){if(null==t||"object"!=typeof t||t.id!==e)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&"./shared"!==t.sharedResource.href&&"./shared/"!==t.sharedResource.href&&this._logger.warn("#validateNode()",this._layer,`Invalid shared resource href on node "${e}"`);const i=t.geometryData;null==i||Array.isArray(i)&&0===i.length||Array.isArray(i)&&1===i.length&&"./geometries/0"===i[0].href||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${e}"`);const s=t.attributeData,n=this._layer.attributeStorageInfo;null==s||Array.isArray(s)&&!s.some((e,t)=>e.href!==`./attributes/${n?.[t]?.key??`f_${t}`}/0`)||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._layer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const o=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:void 0,r=t.featureData&&1===t.featureData.length&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:void 0,d=t=>{if(null==t)return null;const i=t=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${e}: ${t}`);if("number"==typeof t.id)i(`id ${t.id} is a number instead of a string.`);else if("string"!=typeof t.id||!Array.isArray(t.mbs))return i("Missing or invalid id."),null;if(!Array.isArray(t.mbs))return i(`Invalid bounding volume on reference ${t.id}.`),null;t.href&&t.href!=="../"+t.id&&this._logger.error("#validateNode()",this._layer,`Invalid node href on node "${e}"`);const s=new a(`${t.id}`,t.mbs);return s.serviceObbInIndexSR=!this.ignoreServiceObb&&t.hasOwnProperty("obb")&&t.obb?_.fromJSON(t.obb):null,s.visibilityObbInRenderSR=this._computeVisibilityObb(s),s},l=Array.isArray(t.children)?t.children.map(d).filter(e=>null!=e):null,h=t.featureData?.length??!1,u=!0===t.isEmpty;return new c(e,t.mbs,o,"string"==typeof t.version?t.version:null,{isEmpty:!h&&u,hasSharedResource:null!=t.sharedResource,attributes:t.attributeData?e:void 0,texture:t.textureData&&t.textureData.length>0?e:void 0,geometry:null!=t.geometryData?e:void 0},l,Array.isArray(t.lodSelection)?t.lodSelection:null,r)}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes(e=>{null!=e.node&&(e.node.failed=!1)})}_getNodeLoadPriority(e){const t=this._getNodeDescriptor(e),i=this._getParentIndex(e);if(null==t||null==i&&null==t.node)return null==i?1/0:this._getNodeLoadPriority(i);let s=0;if(t.node&&null!=i){const e=this._getNodeDescriptor(i);s=e.traversalState?.lodLevel??0}const n=10,o=this._hasLoadedAncestor(e)?0:n*this._viewportQueries.distCameraToPOI();return-(this._viewportQueries.distToPOI(t.nodeBoundingData??t.node)*(1+s)+s*n*this._viewportQueries.distCameraToPOI())+o}_hasLoadedAncestor(e){let t=this._getParentIndex(e);for(;null!=t;){if(this._isLoaded(t))return!0;t=this._getParentIndex(t)}return!1}traverseVisible(e,t){const i=this._getNodeDescriptor(this._rootIndex);null!=i?this._traverseVisible(this._rootIndex,null,i,e,t):e(this._rootIndex,null,null)}_traverseVisible(e,t,i,s,n){const o=R(e,this._pageSize);if(n&&n.add(o),i.node&&0===i.childCount)return void(this.isGeometryVisible(e)&&s(e,i,t));if(!this.isNodeVisible(e))return;if(s(e,i,t),null==i.node)return;const r=this.nodeTraversalState(i.node);if(r?.nodeHasLOD&&r.lodLevel===this._maxLodLevel)return;const a=this._getPageFromPageIndex(o);for(let d=0;d<i.childCount;d++){const t=a.children[i.childOffset+d],o=this._getNodeDescriptor(t);if(o)this._traverseVisible(t,e,o,s,n);else{if(n){const e=R(t,this._pageSize);n.add(e)}s(t,null,e)}}}traverse(e,t){t(e)&&this.traverseDescendants(e,t)}traverseDescendants(e,t){++this._traverseDescendantsNestingLevel;const i=e.index,s=this._pageSize,n=R(i,s),o=this._getPageFromPageIndex(n);if(null==o)return;const r=this._frameNumber,a=this._nodePages,d=S(i,s),l=o.nodes[d],h=l.childCount;if(o.lastTraversed=r,0===h)return;const u=new Array,c=1===this._traverseDescendantsNestingLevel?this._traverseDescendantsQueue:[0];let g=0;{const{childOffset:e,childCount:t}=l,{children:i}=o;c.length=2**Math.ceil(Math.log2(g+t));for(let s=e;s<e+t;++s){const e=i[s];e>=0?(c[g]=e,++g):u.push(e)}}if(u.length>0){const e=this._clientNodePage;if(e){const i=e.children;let s=0;for(;s<u.length;){const n=u[s];++s;const o=-n-1,r=e.nodes[o],a=r.node;if(!a||!t(a))continue;const{childCount:d}=r;if(0===d)continue;const{childOffset:l}=r,h=l+d;for(let e=l;e<h;++e)u.push(i[e])}}}if(g>0){let e=0;if(s>0){let i=n*s,d=o,l=d.nodes;for(;e<g;){const n=c[e];let o;if(++e,i<=n&&n<i+s)o=d;else{const e=n/s|0,t=a.get(e);if(void 0===t)continue;o=t,o.lastTraversed=r,d=o,l=d.nodes,i=s*e}const h=l[n-i],u=h.node;if(null==u||!1===t(u))continue;const{childCount:_}=h;if(0===_)continue;const f=g+_;for(c.length<f&&(c.length=2**Math.ceil(Math.log2(g+_)));c.length<g+_;)c.length+=c.length;const m=o.children,{childOffset:v}=h,p=v+_;for(let e=v;e<p;++e)c[g]=m[e],++g}}else{const i=a.get(0);if(i)for(;e<g;){const s=c[e++],n=i.nodes[s],o=n.node;if(!o||!t(o))continue;const{childCount:r}=n;if(0===r)continue;c.length=Math.max(c.length,2**Math.ceil(Math.log2(g+r)));const a=i.children,{childOffset:d}=n,l=d+r;for(let e=d;e<l;++e)c[g]=a[e],++g}}}--this._traverseDescendantsNestingLevel}updateChildrenLoaded(e,t){let i=this.getNode(e);for(;null!=i;){const e=i.childrenLoaded,s=e+t;i.childrenLoaded=s;const n=0===e?1:0===s?-1:0,o=i.index;if(0!==n){this._getPage(o).numNodesWithLoadedChildren+=n}i=this.getParent(o)}}checkChildrenLoadedInvariant(){return!0}updateElevationInfo(e,t){this.needNodeElevationRange=t&&!!e&&("relative-to-ground"===e.mode||"relative-to-scene"===e.mode||"on-the-ground"===e.mode),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(e=>{e?.invalidateBounds(),e.node?.invalidateElevationRange(),e.nodeBoundingData?.invalidateElevationRange()})}_forAllNodes(e){if(null!=this._clientNodePage){const t=this._clientNodePage;for(let i=0;i<t.nodes.length;i++)e(t.nodes[i],-(i+1))}for(const[t,i]of this._nodePages){const s=t*this._pageSize;for(let t=0;t<i.nodes.length;t++)e(i.nodes[t],s+t)}}clearCaches(){if(this._useNodePages){const e=this._nodePages,t=new Set;this.traverseVisible(e=>t.add(R(e,this._pageSize)));for(const[i,s]of e)if(0!==s.numNodesWithLoadedChildren||t.has(i))for(const e of s.nodes)e.traversalState=null;else this._deleteNodePage(i)}}_deleteNodePage(e){const t=this._nodePages.get(e);this._nodePages.delete(e),t?.destroy()}get test(){}}const p=new Map;class N{constructor(t){this.missing=t,this.update=new e({deallocator:null}),this.add=new e({deallocator:null}),this.remove=new e({deallocator:null}),this.cancel=[]}destroy(){this.update.prune(),this.add.prune(),this.remove.prune(),this.cancel.length=0}reset(e){this.add.clear(),this.update.clear(),this.cancel=e}}function b(e){return u(e,-2)}function P(e){return u(e,2)}function y(e,t){return t+(e?1:0)}function I(e,t){return(-2&e)===t}function x(e){return!(1&~e)}function R(e,t){return e<0?-1:t>0?e/t|0:0}function S(e,t){return e<0?-e-1:0===t?e:e%t}function C(e,t,i){return-1===t?-(e+1):0===i?e:t*i+e}const w=[["maxScreenThreshold",1],["screenSpaceRelative",2],["removedFeatureDiameter",3],["distanceRangeFromDefaultCamera",4]];function E(e){if(e)for(let t=0;t<e.length;t++)for(const i of w)if(i[0]===e[t].metricType)return{lodMetric:i[1],maxError:e[t].maxError};return{lodMetric:0,maxError:0}}class M{constructor(){this.known=0,this.knownNodes=0,this.missing=0,this.missingNodes=0,this.unremoved=0}}class D{constructor(){this.numFeatures=0,this.knownNodes=0,this.missingNodes=0}}function A(e){return Math.sqrt(e*(4/Math.PI))}const V=o(),O=o(),L=o(),B=o(),z=has("esri-mobile")?100:300;export{v as I3SIndex,E as selectErrorMetric};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{f as e}from"../../../../chunks/sphere.js";import{invalidateMbs as s}from"./I3SUtil.js";import{ElevationRange as t}from"../../support/ElevationRange.js";class i extends t{constructor(s,t){super(NaN,NaN),this.id=s,this.serviceMbsInIndexSR=t,this.serviceMbsInRenderSR=e(0,0,0,-1)}invalidateServiceBVsInRenderSR(){s(this.serviceMbsInRenderSR),this.serviceObbInRenderSR?.invalidate()}shareServiceBVsInRenderSRWith(e){this.serviceObbInRenderSR=e.serviceObbInRenderSR,this.serviceMbsInRenderSR=e.serviceMbsInRenderSR}}class r extends i{constructor(e,s,t,i,r,n,h,d,o,c){super(e,t),this.index=s,this.childCount=i,this.level=r,this.resources=n,this.version=h,this.lodMetric=d,this.maxError=o,this.numFeatures=c,this.failed=!1,this.cacheState=0,this.vertexCount=0,this.memory=0,this.childrenLoaded=0,this.hasModifications=!1,this.imModificationImpact=4,this.elevationAgnosticBoundingVolume=new a}invalidateServiceBVsInRenderSR(){super.invalidateServiceBVsInRenderSR(),this.elevationAgnosticBoundingVolume.invalidate()}}class n{constructor(e,s,t,i){this.nodeHasLOD=e,this.isChosen=s,this.lodLevel=t,this.version=i}}class a{constructor(){this._data=[0,0,0,-1]}invalidate(){this._data[3]=-1}get valid(){return-1!==this._data[3]}get radius(){return this._data[3]}getAxis(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}set(e,s){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2],this._data[3]=s}}export{a as ElevationAgnosticBoundingVolume,r as Node,i as NodeBase,n as NodeTraversalState};
5
+ import{f as e}from"../../../../chunks/sphere.js";import{invalidateMbs as s}from"./I3SUtil.js";import{ElevationRange as t}from"../../support/ElevationRange.js";class i extends t{constructor(s,t){super(NaN,NaN),this.id=s,this.serviceMbsInIndexSR=t,this.serviceMbsInRenderSR=e(0,0,0,-1)}invalidateServiceBVsInRenderSR(){s(this.serviceMbsInRenderSR),this.serviceObbInRenderSR?.invalidate()}shareServiceBVsInRenderSRWith(e){this.serviceObbInRenderSR=e.serviceObbInRenderSR,this.serviceMbsInRenderSR=e.serviceMbsInRenderSR}}class r extends i{constructor(e,s,t,i,r,n,h,d,o,c){super(e,t),this.index=s,this.childCount=i,this.level=r,this.resources=n,this.version=h,this.lodMetric=d,this.maxError=o,this.numFeatures=c,this.failed=!1,this.cacheState=0,this.vertexCount=0,this.memory=0,this.childrenLoaded=0,this.hasModifications=!1,this.imModificationImpact=4,this.elevationAgnosticBoundingVolume=new a}invalidateServiceBVsInRenderSR(){super.invalidateServiceBVsInRenderSR(),this.elevationAgnosticBoundingVolume.invalidate()}}class n{constructor(e,s,t,i){this.nodeHasLOD=e,this.isChosen=s,this.lodLevel=t,this.version=i}}class a{constructor(){this._data=[0,0,0,-1]}invalidate(){this._data[3]=-1}get valid(){return-1!==this._data[3]}get radius(){return this._data[3]}getAxis(e){return e[0]=this._data[0],e[1]=this._data[1],e[2]=this._data[2],e}set(e,s){this._data[0]=e[0],this._data[1]=e[1],this._data[2]=e[2],this._data[3]=s}}export{a as ElevationAgnosticBoundingVolume,r as Node,i as NodeBoundingData,n as NodeTraversalState};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{result as e,assertResult as t}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{clone as r}from"../../../../core/lang.js";import{throwIfAbortError as i}from"../../../../core/promiseUtils.js";import{makeAbsolute as o}from"../../../../core/urlUtils.js";import{readBinaryAttribute as s,createGeometryDescriptor as n}from"./I3SBinaryReader.js";import{getMaterialAndTextures as a,getMaterialAndTexturesFromShared as u,selectEncoding as l}from"./I3SMaterialUtil.js";class f{constructor(e,t,r,i,o,s){if(this._streamDataController=t,this._logger=r,this._defaultGeometrySchema=i,this._requiredAttributes=o,this._options=s,this._logLayer=e,this._layerUrl=e.parsedUrl.path,this._geometryDefinitions=e.geometryDefinitions,e.materialDefinitions){const t=e.textureSetDefinitions;this._materialAndTextures=e.materialDefinitions.map(r=>a(t,r,"integrated-mesh"===e.type))}}_load(e,t,r){return this._streamDataController.request(e,t,r)}_loadAttribute(e,t,r){const i=`${this._layerUrl}/nodes/${e.resources.attributes}/attributes/${t.key}/0`;return this._load(i,1,r).then(e=>s(t,e))}async loadAttributes(e,t,r){const o=await Promise.allSettled(t.map(t=>this._loadAttribute(e,t.attributeStorageInfo,r))),s={};for(let n=0;n<t.length;++n){const r=o[n],a=t[n];if("fulfilled"===r.status){const e=r.value;s[a.name]=e}else{const t=r.reason;i(t),this._logger.error("#loadAttributes",this._logLayer,`Failed to load attributeData for '${a.name}' on node '${e.id}'`,t)}}return s}async loadNodeData(r,i){const o=null!=this._requiredAttributes&&r.resources.attributes?e(this.loadAttributes(r,this._requiredAttributes,i)):null,{bufferDefinition:s,bufferIndex:a}=g(this._geometryDefinitions,r),l=!!r.resources.geometry,f=l?e(this._loadGeometry(r.resources.geometry,a,i)):null,_=r.resources.hasSharedResource?await this._loadShared(r,i):null,y=r.resources.materialDefinition,D=this._materialAndTextures&&null!=y&&y>=0?this._materialAndTextures[y]:null!=_?u(_):null,b=D?.material,x=D?.textures??[],p=`${r.id}`,A=!l&&this._options.loadFeatureData,$=A?await this._loadFeatureData(p,i):null,T=A?c($):d(b),w=null==T?m($):null,I=x.length>0?e(this.loadTextures(r,x,i)):null;let U=null,j=null;if(f){U=t(await f);const e=h(this._defaultGeometrySchema,_);j=n(s,e)}const S=I?t(await I):null,q=o?t(await o):{},P=q?{attributeData:q,loadedAttributes:this._requiredAttributes}:null;if(null!=T)return{geometryData:T,attributeDataInfo:P,geometryBuffer:U,geometryDescriptor:j,requiredTextures:x,textureData:S};if(null!=w)return{pointData:w,attributeDataInfo:P,geometryBuffer:U,geometryDescriptor:j,requiredTextures:x,textureData:S};throw new Error}static _addAbsoluteHrefTexture(e,t){const r=e.textureDefinitions;if(null!=r)for(const i of Object.keys(r))for(const e of r[i].images)Array.isArray(e.href)?e.hrefConcat=e.href.map(e=>o(e,t)):e.hrefConcat=o(e.href,t)}static _fixTextureEncodings(e){const t=e.textureDefinitions;if(null!=t)for(const r in t){const e=t[r];if(Array.isArray(e.encoding))for(let t=0;t<e.encoding.length;t++){const r=e.encoding[t];r.startsWith("data:")&&(e.encoding[t]=r.slice(5))}else{const t=e.encoding;t.startsWith("data:")&&(e.encoding=t.slice(5))}}}async _loadShared(e,t){if(null==e.resources.geometry)return{};const r=`${this._layerUrl}/nodes/${e.resources.geometry}/shared`,i=await this._load(r,0,t);return f._fixTextureEncodings(i),f._addAbsoluteHrefTexture(i,r),i}_loadTexture(e,t,r,i,o){return 4===i||1===i||2===i?this._load(e,1,o).then(e=>({id:t,usage:r,data:e,encoding:i})):this._load(e,2,o).then(e=>({id:t,usage:r,data:e,encoding:i}))}loadTextures(e,t,r){const i=this._options.textureUsageMask;return Promise.all(t.map(t=>{if(0===(t.usage&i))return null;const o=l(t.encodings,this._options.textureEncodings);if(null==o)return this._logger.error("#loadTextures",this._logLayer,`No known encoding for texture found on node ${e.id}`),Promise.reject();const s=e.resources.texture||e.id,n=`${this._layerUrl}/nodes/${s}/textures/${o.name}`;return this._loadTexture(n,t.id,t.usage,o.encoding,r)}))}_loadFeatureData(e,t){const r=`${this._layerUrl}/nodes/${e}/features/0`;return this._load(r,0,t)}_loadGeometry(e,t,r){const i=`${this._layerUrl}/nodes/${e}/geometries/${t}`;return this._load(i,1,r)}}function d(e){return{featureIds:[],geometries:[{type:"ArrayBufferView",params:{material:e}}],featureDataPosition:[0,0,0]}}function c(e){if(!e)return null;for(const t of e.featureData){const e=t.geometries;if(null!=e)for(const r of e)return{featureIds:[t.id],featureDataPosition:t.position,geometries:[r]}}return null}function m(e){if(!e)return null;const t=new Array;for(const r of e.featureData)null!=r.position&&t.push({featureIds:[r.id],featureDataPosition:r.position,geometries:[]});return t}function h(e,t){if(!e||!t?.materialDefinitions)return e;const i=Object.keys(t.materialDefinitions)[0];return!t.materialDefinitions[i].params.vertexRegions&&e.vertexAttributes.region&&delete(e=r(e)).vertexAttributes.region,e}function g(e,t){const r={bufferDefinition:null,bufferIndex:0},i=t.resources.geometryDefinition;if(null==e||null==i||i<0)return r;const o=i>=0?e[i].geometryBuffers:null;if(null==o)return r;for(let s=0;s<o.length;s++){const e=o[s];if(null==e.compressedAttributes)r.bufferIndex=s,r.bufferDefinition=o[s];else if("draco"===e.compressedAttributes.encoding&&!has("disable-feature:i3s-draco"))return r.bufferIndex=s,r.bufferDefinition=e,r}return r}export{f as default};
5
+ import{result as e,assertResult as t}from"../../../../core/asyncUtils.js";import has from"../../../../core/has.js";import{clone as r}from"../../../../core/lang.js";import{throwIfAbortError as i}from"../../../../core/promiseUtils.js";import{makeAbsolute as s}from"../../../../core/urlUtils.js";import{readBinaryAttribute as o,createGeometryDescriptor as n}from"./I3SBinaryReader.js";import{getMaterialAndTextures as a,getMaterialAndTexturesFromShared as u,selectEncoding as l}from"./I3SMaterialUtil.js";class f{constructor(e,t,r,i,s,o){if(this._requester=t,this._logger=r,this._defaultGeometrySchema=i,this._requiredAttributes=s,this._options=o,this._logLayer=e,this._layerUrl=e.parsedUrl.path,this._geometryDefinitions=e.geometryDefinitions,e.materialDefinitions){const t=e.textureSetDefinitions;this._materialAndTextures=e.materialDefinitions.map(r=>a(t,r,"integrated-mesh"===e.type))}}_loadAttribute(e,t,r){const i=`${this._layerUrl}/nodes/${e.resources.attributes}/attributes/${t.key}/0`;return this._requester.request(i,"array-buffer",r).then(e=>o(t,e))}async loadAttributes(e,t,r){const s=await Promise.allSettled(t.map(t=>this._loadAttribute(e,t.attributeStorageInfo,r))),o={};for(let n=0;n<t.length;++n){const r=s[n],a=t[n];if("fulfilled"===r.status){const e=r.value;o[a.name]=e}else{const t=r.reason;i(t),this._logger.error("#loadAttributes",this._logLayer,`Failed to load attributeData for '${a.name}' on node '${e.id}'`,t)}}return o}async loadNodeData(r,i){const s=null!=this._requiredAttributes&&r.resources.attributes?e(this.loadAttributes(r,this._requiredAttributes,i)):null,{bufferDefinition:o,bufferIndex:a}=g(this._geometryDefinitions,r),l=!!r.resources.geometry,f=l?e(this._loadGeometry(r.resources.geometry,a,i)):null,_=r.resources.hasSharedResource?await this._loadShared(r,i):null,y=r.resources.materialDefinition,b=this._materialAndTextures&&null!=y&&y>=0?this._materialAndTextures[y]:null!=_?u(_):null,D=b?.material,x=b?.textures??[],p=`${r.id}`,A=!l&&this._options.loadFeatureData,q=A?await this._loadFeatureData(p,i):null,$=A?c(q):d(D),T=null==$?m(q):null,j=x.length>0?e(this.loadTextures(r,x,i)):null;let w=null,I=null;if(f){w=t(await f);const e=h(this._defaultGeometrySchema,_);I=n(o,e)}const U=j?t(await j):null,S=s?t(await s):{},P=S?{attributeData:S,loadedAttributes:this._requiredAttributes}:null;if(null!=$)return{geometryData:$,attributeDataInfo:P,geometryBuffer:w,geometryDescriptor:I,requiredTextures:x,textureData:U};if(null!=T)return{pointData:T,attributeDataInfo:P,geometryBuffer:w,geometryDescriptor:I,requiredTextures:x,textureData:U};throw new Error}static _addAbsoluteHrefTexture(e,t){const r=e.textureDefinitions;if(null!=r)for(const i of Object.keys(r))for(const e of r[i].images)Array.isArray(e.href)?e.hrefConcat=e.href.map(e=>s(e,t)):e.hrefConcat=s(e.href,t)}static _fixTextureEncodings(e){const t=e.textureDefinitions;if(null!=t)for(const r in t){const e=t[r];if(Array.isArray(e.encoding))for(let t=0;t<e.encoding.length;t++){const r=e.encoding[t];r.startsWith("data:")&&(e.encoding[t]=r.slice(5))}else{const t=e.encoding;t.startsWith("data:")&&(e.encoding=t.slice(5))}}}async _loadShared(e,t){if(null==e.resources.geometry)return{};const r=`${this._layerUrl}/nodes/${e.resources.geometry}/shared`,i=await this._requester.request(r,"json",t);return f._fixTextureEncodings(i),f._addAbsoluteHrefTexture(i,r),i}_loadTexture(e,t,r,i,s){return 4===i||1===i||2===i?this._requester.request(e,"array-buffer",s).then(e=>({id:t,usage:r,data:e,encoding:i})):this._requester.request(e,"image",s).then(e=>({id:t,usage:r,data:e,encoding:i}))}loadTextures(e,t,r){const i=this._options.textureUsageMask;return Promise.all(t.map(t=>{if(0===(t.usage&i))return null;const s=l(t.encodings,this._options.textureEncodings);if(null==s)return this._logger.error("#loadTextures",this._logLayer,`No known encoding for texture found on node ${e.id}`),Promise.reject();const o=e.resources.texture||e.id,n=`${this._layerUrl}/nodes/${o}/textures/${s.name}`;return this._loadTexture(n,t.id,t.usage,s.encoding,r)}))}_loadFeatureData(e,t){const r=`${this._layerUrl}/nodes/${e}/features/0`;return this._requester.request(r,"json",t)}_loadGeometry(e,t,r){const i=`${this._layerUrl}/nodes/${e}/geometries/${t}`;return this._requester.request(i,"array-buffer",r)}}function d(e){return{featureIds:[],geometries:[{type:"ArrayBufferView",params:{material:e}}],featureDataPosition:[0,0,0]}}function c(e){if(!e)return null;for(const t of e.featureData){const e=t.geometries;if(null!=e)for(const r of e)return{featureIds:[t.id],featureDataPosition:t.position,geometries:[r]}}return null}function m(e){if(!e)return null;const t=new Array;for(const r of e.featureData)null!=r.position&&t.push({featureIds:[r.id],featureDataPosition:r.position,geometries:[]});return t}function h(e,t){if(!e||!t?.materialDefinitions)return e;const i=Object.keys(t.materialDefinitions)[0];return!t.materialDefinitions[i].params.vertexRegions&&e.vertexAttributes.region&&delete(e=r(e)).vertexAttributes.region,e}function g(e,t){const r={bufferDefinition:null,bufferIndex:0},i=t.resources.geometryDefinition;if(null==e||null==i||i<0)return r;const s=i>=0?e[i].geometryBuffers:null;if(null==s)return r;for(let o=0;o<s.length;o++){const e=s[o];if(null==e.compressedAttributes)r.bufferIndex=o,r.bufferDefinition=s[o];else if("draco"===e.compressedAttributes.encoding&&!has("disable-feature:i3s-draco"))return r.bufferIndex=o,r.bufferDefinition=e,r}return r}export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../request.js";import r from"../../../../core/Accessor.js";import{splitIntoChunks as s}from"../../../../core/arrayUtils.js";import{createTask as i,resultOrAbort as o,result as n}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as d}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import c from"../../../../core/Logger.js";import{abortMaybe as h,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateStringMemory as u,estimateNumberMemory as m}from"../../../../core/memoryEstimations.js";import{whenOrAbort as p,createResolver as g}from"../../../../core/promiseUtils.js";import y from"../../../../core/ReactiveSet.js";import{watch as f,sync as _}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as O}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as j}from"../../../../intl/number.js";import{getMaximumQuerySize as C,queryAllJSON as w}from"../../../../layers/support/featureQueryAll.js";import{isTimeoutError as I}from"../../../../support/requestUtils.js";let F=class extends r{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=E,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new y,this._geometryChangedObjectIds=new y,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new x(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(f(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,this._pendingFetchChangedObjectIds||(this._applyGeometryOverridesTask=h(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=i(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise)},_)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})}destroy(){this._set("layer",null),this._memCache=l(this._memCache),this._pendingFetchAbortController=h(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return!!this.is3DOFL&&!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished)}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=this._interactiveEditingSessions,r=new A(e,()=>{t.remove(r)});return t.unshift(r),r}async applyAttributeOverrides(e,t,r,s=[]){if(this._pendingFetchChangedObjectIds&&await p(this._pendingFetchChangedObjectIds,r),null==t)return;const{attributeData:i,loadedAttributes:o}=t;if(null==o||null==i||0===this._attributeChangedObjectIds.size)return;const n=new Set;for(const d of o)n.add(d.index);for(const d of s)n.has(d.index)||(o.push(d),i[d.name]=new Array(e.length));const a=await this._lockFeatureIds(e);try{const t={attributeData:i,loadedAttributes:o},s=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds),{objectIds:n,fieldNames:a}=s;if(0===n.length||0===a.length)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(n,a,r);if(null==d)return;this._processOverridesFromAssociatedLayer(e,d,a,t)}finally{a.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const r=this._clientGeometryCache.get(e);if(null!=r&&(this.geometryOverrides.remove(r),this._clientGeometryCache.delete(e)),null!=t){const r={oid:e,mesh:t};this.geometryOverrides.add(r),this._clientGeometryCache.set(e,r)}}updateAttributeValue(e,t,r){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,r)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,r){this._memCache.put(e,t,r)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:r},s){const i=new Array;for(const a of t)i[a.index]=r[a.name];const o=new Set,n=new Set;for(let a=0;a<e.length;a++){const r=e[a];if(s.has(r))for(const e of t){const t=this._attributeFromCache(r,e.index);void 0===t?(o.add(r),n.add(e.name)):i[e.index][a]=t}}return{objectIds:Array.from(o),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const r=this._fromInteractiveEditingSession(e,t);return void 0!==r?r:this._memCache.get(e,t)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const r of this._interactiveEditingSessions){if(r.objectId!==e)continue;const s=r.getAttribute(t);if(void 0!==s)return s}}async _queryAttributeOverridesFromAssociatedLayer(e,t,r){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:s}=this.layer;if(null==s)return null;const i=s.createQuery(),{objectIdField:o}=s,n=[o,...t];i.where=this.layer.definitionExpression||"1=1",i.returnGeometry=!1,i.outFields=n,i.cacheHint=!0;const a=await this._executeBatchQuery(s,e,i,r),d=[];for(const c of a)if(c.ok)for(const e of c.value.features)d.push(e);return d}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL)return null;const r=this.layer.associatedLayer,s=r.infoFor3D,{spatialReference:i}=r,{state:{viewingMode:o},spatialReference:n}=this.view,a=1===o,d=i.isGeographic;if(a&&!d)return c.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,S(i,n,this.view.viewingMode,0)),null;if(!a&&d)return c.getLogger(this).warn("unsupported-gcs-edits-in-local-view",this.layer.title,S(i,n,this.view.viewingMode,0)),null;if(!(O(i,n)||a&&n.isWebMercator&&i.isWGS84))return c.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,S(i,n,this.view.viewingMode,1)),null;this._logWarningIfMaximumObjectsExceeded();const{objectIdField:h,globalIdField:l}=r,u=[h,...null!=l?[l]:[]],m=r.createQuery();m.where=this.layer.definitionExpression||"1=1",m.returnGeometry=!0,m.outFields=u,m.cacheHint=!0,m.returnZ=r.hasZ,m.returnM=r.hasM;const{assetMapFromAssetMapsJSON:p,extractMesh:g}=await import("../../../../rest/support/meshFeatureSet.js"),y=await this._executeBatchQuery(r,e,m,t),f=[];for(const c of y){if(!c.ok)continue;const e=c.value,{assetMaps:t,features:r,globalIdFieldName:o}=e;if(null==t)continue;const n=p(s,t);for(const a of r){const e=g(a,o,i,s,n),t=a;null!=e?(t.geometry=e,f.push(t)):t.geometry=null}}return f}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${j(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;e+=t?.loaded?` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:` (${this.layer.parsedUrl.path})`,c.getLogger(this).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,i){if(0===t.length)return[];const n=C(e);t=[...t].sort((e,t)=>e-t);const a=s(t,n).map(t=>{const s=r.clone();return s.objectIds=t,o(w(e,s,{signal:i}))});return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,r,{loadedAttributes:s,attributeData:i}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=r.map(t=>(t in i||(i[t]=new Array(e.length)),i[t])),d=new Map(s.map(e=>[e.name,e.index])),c=r.map(e=>d.get(e)),h=new Map(Array.from(e,(e,t)=>[e,t]));for(const l of t){const e=l.attributes[n];for(let t=0;t<r.length;t++){const s=c[t],i=h.get(e),o=l.attributes[r[t]];a[t][i]=o,this._cacheAttributeValue(e,s,o)}}}async _fetchChangedObjectIds(e){const r=this.layer;await r.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:s}=r;if(null==s||!s.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const o=s.layerId,a=this.is3DOFL,d={...s.customParameters,f:"json",returnIdsOnly:!0,layers:`[${o}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:o,serverGen:i}])};if(null!=s.apiKey&&(d.token=s.apiKey),a){const e=s.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await n(t(`${s.url}/extractChanges`,{method:"post",query:d,timeout:L,signal:e}));if(!h.ok&&I(h.error)){const e=this.layer.title;c.getLogger(this).warn("extractChanges:timeout",e,`${e} could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.`)}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],r=t?.objectIds,s=t?.fieldUpdates,i=r?.adds??[],o=r?.updates??[],n=r?.deletes??[],d=[...i,...o,...n],c=a?[...i,...s??o,...n]:[],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort((e,t)=>e-t);for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of c)this._geometryChangedObjectIds.add(e);for(;this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;const t=this.layer,{associatedLayer:r}=t;if(null!=r&&r.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp?.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t?.serverGens?.minServerGen?t.serverGens.minServerGen:null}async _lockFeatureIds(e){const t=this._featureIdLocks;let r=!0;for(;r;){const s=new Array;for(const r of e){const e=t.get(r);e&&s.push(e)}0===s.length?r=!1:await Promise.all(s)}const s=g(),i=s.promise;for(const o of e)t.set(o,i);return d(()=>{for(const r of e)t.delete(r);s.resolve()})}get test(){}};e([b({constructOnly:!0})],F.prototype,"view",void 0),e([b({constructOnly:!0})],F.prototype,"layer",void 0),e([b({readOnly:!0})],F.prototype,"is3DOFL",null),e([b()],F.prototype,"_interactiveEditingSessions",void 0),e([b({readOnly:!0})],F.prototype,"sortedGeometryChangedObjectIds",null),e([b({readOnly:!0})],F.prototype,"geometryOverrides",void 0),e([b()],F.prototype,"_clientGeometryCache",void 0),e([b()],F.prototype,"_associatedLayer",null),e([b({constructOnly:!0})],F.prototype,"memoryController",void 0),e([b()],F.prototype,"_attributeChangedObjectIds",void 0),e([b()],F.prototype,"_geometryChangedObjectIds",void 0),e([b()],F.prototype,"hasGeometryChanges",null),e([b()],F.prototype,"_pendingFetchChangedObjectIds",void 0),e([b()],F.prototype,"_pendingFetchAbortController",void 0),e([b()],F.prototype,"_applyGeometryOverridesTask",void 0),e([b()],F.prototype,"updating",null),e([b()],F.prototype,"isEmpty",null),F=e([v("esri.views.3d.layers.i3s.I3SOverrides")],F);class A{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class x{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,r){this._cache.put(this._getKey(e,t),new G(r))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class G{constructor(e){this.value=e,this.usedMemory="string"==typeof e?u(e):m}}const L=1e4,E=5e4;function S(e,t,r,s){return`Displaying the edits of a SceneLayer with a${0===s?e.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${e.wkid}) in ${r} viewing mode${1===s?` with spatial reference (wkid:${t.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${0===s?"viewing mode":"view spatial reference"} to display edits.`}export{F as I3SOverrides};
5
+ import{__decorate as e}from"tslib";import t from"../../../../request.js";import r from"../../../../core/Accessor.js";import{splitIntoChunks as s}from"../../../../core/arrayUtils.js";import{createTask as i,resultOrAbort as o,result as n}from"../../../../core/asyncUtils.js";import a from"../../../../core/Collection.js";import{makeHandle as d}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import c from"../../../../core/Logger.js";import{abortMaybe as h,destroyMaybe as l}from"../../../../core/maybe.js";import{estimateStringMemory as u,estimateNumberMemory as m}from"../../../../core/memoryEstimations.js";import{whenOrAbort as p,createResolver as g}from"../../../../core/promiseUtils.js";import y from"../../../../core/ReactiveSet.js";import{watch as f,sync as _}from"../../../../core/reactiveUtils.js";import{property as b}from"../../../../core/accessorSupport/decorators/property.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{equals as O}from"../../../../geometry/support/spatialReferenceUtils.js";import{formatNumber as j}from"../../../../intl/number.js";import{getMaximumQuerySize as C,queryAllJSON as w}from"../../../../layers/support/featureQueryAll.js";let I=class extends r{constructor(e){super(e),this._warnMaximumChangedObjectsExceeded=!1,this._maximumNumberOfEditOVerrides=L,this._definitionExpressionDirty=!0,this._interactiveEditingSessions=new a,this.geometryOverrides=new a,this._clientGeometryCache=new Map,this._attributeChangedObjectIds=new y,this._geometryChangedObjectIds=new y,this._pendingFetchChangedObjectIds=null,this._pendingFetchAbortController=new AbortController,this._applyGeometryOverridesTask=null,this._featureIdLocks=new Map}initialize(){this._memCache=new A(this.memoryController.newCache(`i3s-attribute-overrides-${this.layer.uid}`)),this.addHandles(f(()=>this.layer.definitionExpression,async()=>{this._definitionExpressionDirty=!0,this._pendingFetchChangedObjectIds||(this._applyGeometryOverridesTask=h(this._applyGeometryOverridesTask),this._applyGeometryOverridesTask=i(e=>this._queryAndAddGeometryOverrides(e)),await this._applyGeometryOverridesTask.promise)},_)),this._pendingFetchChangedObjectIds=this._fetchChangedObjectIds(this._pendingFetchAbortController?.signal),this._pendingFetchChangedObjectIds.finally(()=>{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null})}destroy(){this._set("layer",null),this._memCache=l(this._memCache),this._pendingFetchAbortController=h(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){return null!=this._associatedLayer?.infoFor3D}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((e,t)=>e-t):[]}get _associatedLayer(){return null==this.layer?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get updating(){return!!this.is3DOFL&&!!(this._pendingFetchChangedObjectIds||this._applyGeometryOverridesTask&&!this._applyGeometryOverridesTask.finished)}get isEmpty(){return null==this._pendingFetchChangedObjectIds&&0===this._attributeChangedObjectIds.size&&0===this._geometryChangedObjectIds.size}featureHasGeometryChanges(e){return this._geometryChangedObjectIds.has(e)}featureHasAttributeChanges(e){return this._attributeChangedObjectIds.has(e)}createInteractiveEditSession(e){this._attributeChangedObjectIds.add(e);const t=this._interactiveEditingSessions,r=new F(e,()=>{t.remove(r)});return t.unshift(r),r}async applyAttributeOverrides(e,t,r,s=[]){if(this._pendingFetchChangedObjectIds&&await p(this._pendingFetchChangedObjectIds,r),null==t)return;const{attributeData:i,loadedAttributes:o}=t;if(null==o||null==i||0===this._attributeChangedObjectIds.size)return;const n=new Set;for(const d of o)n.add(d.index);for(const d of s)n.has(d.index)||(o.push(d),i[d.name]=new Array(e.length));const a=await this._lockFeatureIds(e);try{const t={attributeData:i,loadedAttributes:o},s=this._getOverridesFromCache(e,t,this._attributeChangedObjectIds),{objectIds:n,fieldNames:a}=s;if(0===n.length||0===a.length)return;const d=await this._queryAttributeOverridesFromAssociatedLayer(n,a,r);if(null==d)return;this._processOverridesFromAssociatedLayer(e,d,a,t)}finally{a.remove()}}updateGeometry(e,t){this._geometryChangedObjectIds.add(e);const r=this._clientGeometryCache.get(e);if(null!=r&&(this.geometryOverrides.remove(r),this._clientGeometryCache.delete(e)),null!=t){const r={oid:e,mesh:t};this.geometryOverrides.add(r),this._clientGeometryCache.set(e,r)}}updateAttributeValue(e,t,r){this._attributeChangedObjectIds.add(e),this._cacheAttributeValue(e,t,r)}featureAdded(e){this.is3DOFL&&this._geometryChangedObjectIds.add(e),this._attributeChangedObjectIds.add(e)}_cacheAttributeValue(e,t,r){this._memCache.put(e,t,r)}_getOverridesFromCache(e,{loadedAttributes:t,attributeData:r},s){const i=new Array;for(const a of t)i[a.index]=r[a.name];const o=new Set,n=new Set;for(let a=0;a<e.length;a++){const r=e[a];if(s.has(r))for(const e of t){const t=this._attributeFromCache(r,e.index);void 0===t?(o.add(r),n.add(e.name)):i[e.index][a]=t}}return{objectIds:Array.from(o),fieldNames:Array.from(n)}}_attributeFromCache(e,t){const r=this._fromInteractiveEditingSession(e,t);return void 0!==r?r:this._memCache.get(e,t)}_fromInteractiveEditingSession(e,t){if(null!=this._interactiveEditingSessions)for(const r of this._interactiveEditingSessions){if(r.objectId!==e)continue;const s=r.getAttribute(t);if(void 0!==s)return s}}async _queryAttributeOverridesFromAssociatedLayer(e,t,r){if(0===e.length)return null;this._logWarningIfMaximumObjectsExceeded();const{associatedLayer:s}=this.layer;if(null==s)return null;const i=s.createQuery(),{objectIdField:o}=s,n=[o,...t];i.where=this.layer.definitionExpression||"1=1",i.returnGeometry=!1,i.outFields=n,i.cacheHint=!0;const a=await this._executeBatchQuery(s,e,i,r),d=[];for(const c of a)if(c.ok)for(const e of c.value.features)d.push(e);return d}async _queryGeometryOverridesFromAssociatedLayer(e,t){if(0===e.length||!this.is3DOFL)return null;const r=this.layer.associatedLayer,s=r.infoFor3D,{spatialReference:i}=r,{state:{viewingMode:o},spatialReference:n}=this.view,a=1===o,d=i.isGeographic;if(a&&!d)return c.getLogger(this).warn("unsupported-pcs-edits-in-global-view",this.layer.title,E(i,n,this.view.viewingMode,0)),null;if(!a&&d)return c.getLogger(this).warn("unsupported-gcs-edits-in-local-view",this.layer.title,E(i,n,this.view.viewingMode,0)),null;if(!(O(i,n)||a&&n.isWebMercator&&i.isWGS84))return c.getLogger(this).warn("unsupported-mismatched-spatial-reference-edits",this.layer.title,E(i,n,this.view.viewingMode,1)),null;this._logWarningIfMaximumObjectsExceeded();const{objectIdField:h,globalIdField:l}=r,u=[h,...null!=l?[l]:[]],m=r.createQuery();m.where=this.layer.definitionExpression||"1=1",m.returnGeometry=!0,m.outFields=u,m.cacheHint=!0,m.returnZ=r.hasZ,m.returnM=r.hasM;const{assetMapFromAssetMapsJSON:p,extractMesh:g}=await import("../../../../rest/support/meshFeatureSet.js"),y=await this._executeBatchQuery(r,e,m,t),f=[];for(const c of y){if(!c.ok)continue;const e=c.value,{assetMaps:t,features:r,globalIdFieldName:o}=e;if(null==t)continue;const n=p(s,t);for(const a of r){const e=g(a,o,i,s,n),t=a;null!=e?(t.geometry=e,f.push(t)):t.geometry=null}}return f}_logWarningIfMaximumObjectsExceeded(){if(!this._warnMaximumChangedObjectsExceeded)return;this._warnMaximumChangedObjectsExceeded=!1;let e=`The number of edited objects that are not yet cached in the scene service exceeds the maximum limit. Attribute changes will only be available for the first ${j(this._maximumNumberOfEditOVerrides)} objects. Please consider re-caching the scene service`;const t=this.layer.portalItem;e+=t?.loaded?` (${t.portal.url}/home/item.html?id=${t.id}#settings)`:` (${this.layer.parsedUrl.path})`,c.getLogger(this).warn("#queryOverrides()",this.layer.title,`${e}.`)}async _executeBatchQuery(e,t,r,i){if(0===t.length)return[];const n=C(e);t=[...t].sort((e,t)=>e-t);const a=s(t,n).map(t=>{const s=r.clone();return s.objectIds=t,o(w(e,s,{signal:i}))});return Promise.all(a)}_processOverridesFromAssociatedLayer(e,t,r,{loadedAttributes:s,attributeData:i}){const o=this._associatedLayer;if(null==o)return;const n=o.objectIdField,a=r.map(t=>(t in i||(i[t]=new Array(e.length)),i[t])),d=new Map(s.map(e=>[e.name,e.index])),c=r.map(e=>d.get(e)),h=new Map(Array.from(e,(e,t)=>[e,t]));for(const l of t){const e=l.attributes[n];for(let t=0;t<r.length;t++){const s=c[t],i=h.get(e),o=l.attributes[r[t]];a[t][i]=o,this._cacheAttributeValue(e,s,o)}}}async _fetchChangedObjectIds(e){const r=this.layer;await r.load({signal:e}),this._geometryChangedObjectIds.clear(),this._attributeChangedObjectIds.clear();const{associatedLayer:s}=r;if(null==s||!s.capabilities?.operations?.supportsChangeTracking)return;const i=this._getFetchChangedObjectIdsServerGen();if(null==i)return;const o=s.layerId,a=this.is3DOFL,d={...s.customParameters,f:"json",returnIdsOnly:!0,layers:`[${o}]`,returnUpdates:!0,returnDeletes:a,returnInserts:a,layerServerGens:JSON.stringify([{id:o,serverGen:i}])};if(null!=s.apiKey&&(d.token=s.apiKey),a){const e=s.infoFor3D;d.fieldsToCompare=JSON.stringify({fields:[...Object.values(e.transformFieldRoles),e.sourceHashField]})}const h=await n(t(`${s.url}/extractChanges`,{method:"post",query:d,timeout:G,signal:e}));if(!h.ok){const e=this.layer.title;c.getLogger(this).warn("extractChanges:timeout",e,": could not obtain edited features that are not cached in the scene service. Display of features may not be up to date with the latest edits. Consider re-caching the scene service.")}if(h.ok&&1===h.value.data?.edits?.length){const t=h.value.data.edits[0],r=t?.objectIds,s=t?.fieldUpdates,i=r?.adds??[],o=r?.updates??[],n=r?.deletes??[],d=[...i,...o,...n],c=a?[...i,...s??o,...n]:[],l=Math.min(this._maximumNumberOfEditOVerrides,d.length);l<d.length&&(this._warnMaximumChangedObjectsExceeded=!0);const u=d.sort((e,t)=>e-t);for(let e=0;e<l;++e){const t=u[e];this._attributeChangedObjectIds.add(t)}for(const e of c)this._geometryChangedObjectIds.add(e);for(;this._definitionExpressionDirty;)await this._queryAndAddGeometryOverrides(e)}}async _queryAndAddGeometryOverrides(e){this._definitionExpressionDirty=!1;const t=this.layer,{associatedLayer:r}=t;if(null!=r&&r.capabilities?.operations?.supportsChangeTracking&&this.is3DOFL&&this._geometryChangedObjectIds.size>0){const t=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),e);if(null!=t)for(const e of t)null!=e.geometry&&this.updateGeometry(e.attributes[r.objectIdField],e.geometry)}}_getFetchChangedObjectIdsServerGen(){const e=this.layer;if(null!=e.serviceUpdateTimeStamp?.lastUpdate)return e.serviceUpdateTimeStamp.lastUpdate;const t=e.associatedLayer;return null!=t?.serverGens?.minServerGen?t.serverGens.minServerGen:null}async _lockFeatureIds(e){const t=this._featureIdLocks;let r=!0;for(;r;){const s=new Array;for(const r of e){const e=t.get(r);e&&s.push(e)}0===s.length?r=!1:await Promise.all(s)}const s=g(),i=s.promise;for(const o of e)t.set(o,i);return d(()=>{for(const r of e)t.delete(r);s.resolve()})}get test(){}};e([b({constructOnly:!0})],I.prototype,"view",void 0),e([b({constructOnly:!0})],I.prototype,"layer",void 0),e([b({readOnly:!0})],I.prototype,"is3DOFL",null),e([b()],I.prototype,"_interactiveEditingSessions",void 0),e([b({readOnly:!0})],I.prototype,"sortedGeometryChangedObjectIds",null),e([b({readOnly:!0})],I.prototype,"geometryOverrides",void 0),e([b()],I.prototype,"_clientGeometryCache",void 0),e([b()],I.prototype,"_associatedLayer",null),e([b({constructOnly:!0})],I.prototype,"memoryController",void 0),e([b()],I.prototype,"_attributeChangedObjectIds",void 0),e([b()],I.prototype,"_geometryChangedObjectIds",void 0),e([b()],I.prototype,"hasGeometryChanges",null),e([b()],I.prototype,"_pendingFetchChangedObjectIds",void 0),e([b()],I.prototype,"_pendingFetchAbortController",void 0),e([b()],I.prototype,"_applyGeometryOverridesTask",void 0),e([b()],I.prototype,"updating",null),e([b()],I.prototype,"isEmpty",null),I=e([v("esri.views.3d.layers.i3s.I3SOverrides")],I);class F{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}class A{constructor(e){this._cache=e}destroy(){this._cache.destroy()}put(e,t,r){this._cache.put(this._getKey(e,t),new x(r))}get(e,t){return this._cache.get(this._getKey(e,t))?.value}_getKey(e,t){return`${e}-${t}`}}class x{constructor(e){this.value=e,this.usedMemory="string"==typeof e?u(e):m}}const G=1e4,L=5e4;function E(e,t,r,s){return`Displaying the edits of a SceneLayer with a${0===s?e.isGeographic?" geographic ":" projected ":" "}spatial reference (wkid:${e.wkid}) in ${r} viewing mode${1===s?` with spatial reference (wkid:${t.wkid}) `:" "}is not supported. No geometry edits will be displayed for this layer.\nPlease consider re-caching the scene service or changing the ${0===s?"viewing mode":"view spatial reference"} to display edits.`}export{I as I3SOverrides};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{create as t}from"../../../../geometry/support/aaBoundingBox.js";import{getCentroidOptimizedGeometry as e}from"../../../../layers/graphics/centroid.js";import r from"../../../../layers/graphics/OptimizedGeometry.js";import{getCachedAttributeValue as i}from"./I3SBinaryReader.js";class o{constructor(t){this._objectIdField=t.objectIdField,this._getFeatureExtent=t.getFeatureExtent}getObjectId(t){return t.id}getAttributes(t){const{meta:e,index:r}=t,o={};this._objectIdField&&(o[this._objectIdField]=t.id);const n=e.attributeInfo?.attributeData;if(null!=n)for(const s of Object.keys(n))o[s]=i(n[s],r);return o}getAttribute(t,e){if(e===this._objectIdField)return t.id;const{meta:r,index:o}=t,n=r.attributeInfo?.attributeData;return null!=n?i(n[e],o):null}getGeometry(t){if(t.geometry)return t.geometry;const[e,i,o,n,a,u]=this._getFeatureExtent(t,s);return new r([5,5],[e,i,o,n,i,o,n,a,o,e,a,o,e,i,o,e,i,u,n,i,u,n,a,u,e,a,u,e,i,u])}getCentroid(t,i){if(t.geometry)return e(new r,t.geometry,i.hasZ,i.hasM);const[o,n,a,u,d,c]=this._getFeatureExtent(t,s);return new r([0],[(o+u)/2,(n+d)/2,(a+c)/2])}cloneWithGeometry(t,e){const{id:r,index:i,meta:o}=t;return new n(r,i,o,e)}getMetadata(t){return t}}class n{constructor(t,e,r,i){this.id=t,this.index=e,this.meta=r,this.geometry=i}get usedMemory(){return 32+(this.geometry?.usedMemory??0)}}const s=t();export{n as I3SQueryFeature,o as I3SQueryFeatureAdapter};
5
+ import{create as t}from"../../../../geometry/support/aaBoundingBox.js";import{getCentroidOptimizedGeometry as e}from"../../../../layers/graphics/centroid.js";import r from"../../../../layers/graphics/OptimizedGeometry.js";import{getCachedAttributeValue as i}from"./I3SBinaryReader.js";class o{constructor(t){this._objectIdField=t.objectIdField,this._getFeatureExtent=t.getFeatureExtent}getObjectId(t){return t.id}getAttributes(t){const{meta:e,index:r}=t,o={};this._objectIdField&&(o[this._objectIdField]=t.id);const n=e.attributeInfo?.attributeData;if(null!=n)for(const s of Object.keys(n))o[s]=i(n[s],r);return o}getAttribute(t,e){if(e===this._objectIdField)return t.id;const{meta:r,index:o}=t,n=r.attributeInfo?.attributeData;return null!=n?i(n[e],o):null}getGeometry(t){if(t.geometry)return t.geometry;const[e,i,o,n,u,a]=this._getFeatureExtent(t,s);return new r([5,5],[e,i,o,n,i,o,n,u,o,e,u,o,e,i,o,e,i,a,n,i,a,n,u,a,e,u,a,e,i,a],!0,!1)}getCentroid(t,i){if(t.geometry)return e(t.geometry);const[o,n,u,a,d,c]=this._getFeatureExtent(t,s);return new r([],[(o+a)/2,(n+d)/2,(u+c)/2],!0,!1)}cloneWithGeometry(t,e){const{id:r,index:i,meta:o}=t;return new n(r,i,o,e)}getMetadata(t){return t}}class n{constructor(t,e,r,i){this.id=t,this.index=e,this.meta=r,this.geometry=i}get usedMemory(){return 32+(this.geometry?.usedMemory??0)}}const s=t();export{n as I3SQueryFeature,o as I3SQueryFeatureAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{n as e,a as t,f as i,c as s,d as n,H as r,x as o,h as a,F as c,s as u,k as l,b as h,m as d,e as m,g as _}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as g}from"../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingSphere as b}from"../../../../geometry/projection/projectBoundingSphere.js";import{getProjector as R}from"../../../../geometry/projection/projectors.js";import{create as S,fromMatrix as x,createPoints as M,intersectsSphere as C}from"../../../../geometry/support/frustum.js";import{getNormal as I,signedDistance as P}from"../../../../geometry/support/plane.js";import{isPlateCarree as E}from"../../../../geometry/support/spatialReferenceUtils.js";import{m as F,a as D}from"../../../../chunks/sphere.js";import{makeDehydratedPoint as O}from"../../../../layers/graphics/dehydratedPoint.js";import{evaluateElevationAlignmentAtPoint as A}from"../graphics/elevationAlignmentUtils.js";import{ElevationContext as B}from"../graphics/ElevationContext.js";import{createContextWithoutExpressionSupport as V,extractExpressionInfo as j}from"../graphics/featureExpressionInfoUtils.js";import{isValidMbs as L,intersectBoundingRectWithMbs as y}from"./I3SUtil.js";import{Obb as w,computeOffsetObb as U}from"../../support/orientedBoundingBox.js";const k=1e5;class q{get _frustumMbsCenter(){return this._frustumMbs}get _frustumMbsRadius(){return this._frustumMbs[3]}get _frustumPlanes(){return this._frustum}constructor(e,t,i,s,n,r,o,a,c={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=n,this._elevationProvider=r,this._viewingMode=o,this._options=c,this._frustum=S(),this._frustumMbs=f(),this._useFrustumCulling=!1,this._poi=p(),this._elevationContext=null,this.minDistance=1/0,this.maxDistance=0,this.maxLodLevel=2,this._tmpObb=new w,this._tmp1=p(),this._tmp2=p(),this._tmp3=p(),this._tmp0=p(),this._screenspaceErrorBias=c.screenspaceErrorBias||1,this._progressiveLoadFactor=c.progressiveLoadFactor||1,this.updateCamera(i,s);const u=this._renderCoordsHelper.spatialReference;this._renderSR=u,this._renderSRSphericalPCPF=g(u),this._isGlobalMode=u===this._renderSRSphericalPCPF,this.updateElevationInfo(a),this._tmpPoint=O(0,0,0,e),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(u.isWebMercator||E(u)),this._indexSREllipsoidRadius=v(this._indexSR).radius,this._indexSRSphericalPCPF=g(e),this._projectorIndexSRToIndexSRSphericalPCPF=R(this._indexSR,this._indexSRSphericalPCPF)}updateElevationInfo(e){null!=e?(this._elevationContext=B.fromElevationInfo(e),this._elevationContext.setFeatureExpressionInfoContext(V(j(e,!1)))):this._elevationContext=null}updateCamera(n,r){if(this._useFrustumCulling=r,r){x(n.viewMatrix,n.projectionMatrix,this._frustum,N);{const r=n.eye,o=G;e(o,n.viewForward);const a=T;t(a,N[4],r);const c=.5*i(a,a)/i(o,a),u=this._frustumMbs;s(u,r,o,c);const l=1+c;u[3]=l}}this._screenSizeFactor=1/(n.perScreenPixelRatio/2),this._camPos=n.eye,this.minDistance=1/0,this.maxDistance=0}setPointOfInterest(e){this._poi=e}updateScreenSpaceErrorBias(e){const t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}expandElevationRange(e,t,i){if(null==this._elevationContext)return;const s=e.serviceMbsInIndexSR;if(!s)return;const n="relative-to-scene"===this._elevationContext.mode?"scene":"ground";if(this._elevationProvider.getSphereElevationBounds){const e=this._elevationProvider.getSphereElevationBounds(s,this._indexSR,n);if(e)return void i.expandElevationRange(e)}const r=s[0],o=s[1],a=s[2],c=this._elevationProvider.getElevation(r,o,a,this._indexSR,n);c&&i.expandElevationRangeValues(c,c);const u=t?null:this._elevationProvider.getRootElevationBounds?.();u&&i.expandElevationRange(u)}getServiceMbsInRenderSR(e){const t=e.serviceMbsInRenderSR;if(L(t))return t;const{serviceMbsInIndexSR:i}=e;i&&F(i,t);const s=e.elevationRangeMin;if(this._elevationContext&&Number.isFinite(s)){let i=0,n=0;const r=e.elevationRangeMax;switch(this._elevationContext.mode){case"relative-to-ground":case"relative-to-scene":i=this._elevationContext.geometryZWithOffset(t[2],this._renderCoordsHelper)+s-t[2],n=r-s;break;case"on-the-ground":i=s-t[2],n=r-s}t[2]+=i+.5*n,t[3]+=.5*n}else this._elevationContext&&t[3]<k&&(this._tmpPoint.x=t[0],this._tmpPoint.y=t[1],this._tmpPoint.z=t[2],t[2]=A(this._tmpPoint,this._elevationProvider,this._elevationContext,this._renderCoordsHelper));return b(t,this._indexSR,t,this._renderSR),t}getAndUpdateVisibilityObbInRenderSR(e){{const t=e.visibilityObbInRenderSR;if(t)return t}const t=.01*this._indexSREllipsoidRadius,{serviceMbsInIndexSR:i,serviceObbInIndexSR:s}=e;if(null==s||!i||!s.isValid||this._isECEFOBBInLocalMode&&(s.halfSizeX>t||s.halfSizeY>t||s.halfSizeZ>t))return null;{let t=e.serviceObbInRenderSR;if(null==t)t=new w,e.serviceObbInRenderSR=t;else if(t.isValid)return t;const n=i[3];let r=0,o=0;const a=s.centerZ,c=this._renderCoordsHelper,u=this._elevationContext;if(u&&e.elevationRangeValid){const t=e.elevationRangeMin,i=e.elevationRangeMax;switch(u.mode){case"relative-to-ground":case"relative-to-scene":r=u.geometryZWithOffset(a,c)+t-a,o=i-t;break;case"on-the-ground":r=t-a,o=i-t}}else if(u&&n<k){const e=this._tmpPoint;e.x=s.centerX,e.y=s.centerY,e.z=a,r=A(e,this._elevationProvider,u,c)-a}const l=o>0,h=l?this._tmpObb:t;return s.transform(h,this._indexSR,this._renderSR,r,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),l&&U(h,0,o,this._viewingMode,t),t}}getNodeObbInRenderSRIndependentOfElevationOffset(e){{const t=e.visibilityObbInRenderSR??e.serviceObbInRenderSR??null;if(t?.isValid)return t}const t=e.serviceObbInIndexSR;return t?(t.transform(Y,this._indexSR,this._renderSR,void 0,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),Y):null}ensureElevationAgnosticBoundingVolume(e){return!e.elevationAgnosticBoundingVolume.valid&&e.level>0&&(1===this._viewingMode?this._updateElevationAgnosticBoundingVolumeGlobal(e):this._updateElevationAgnosticBoundingVolumeLocal(e)),e.elevationAgnosticBoundingVolume}_updateElevationAgnosticBoundingVolumeGlobal(t){const s=this.getNodeObbInRenderSRIndependentOfElevationOffset(t),o=t.elevationAgnosticBoundingVolume;let a,c=-1;if(s){const t=J;s.getCenter(t),e(t,t),a=t,s.getCorners(K);for(const s of K){e(s,s);const n=i(s,t);if(n<=0)return void o.invalidate();const r=Math.sqrt(1-n*n);c=Math.max(c,r)}}else{const i=t.serviceMbsInRenderSR;if(!L(i))return void o.invalidate();{const t=n(J,D(i)),s=i[3],u=r(t);if(u<s)return void o.invalidate();c=s/u,e(t,t),a=t}}const u=.001;o.set(a,c+u)}_updateElevationAgnosticBoundingVolumeLocal(e){const t=e.elevationAgnosticBoundingVolume,i=this.getNodeObbInRenderSRIndependentOfElevationOffset(e);if(i){const e=i.getCenter(J);e[2]=0;let s=0;const n=Q;i.getCorners(K);for(const t of K){t[2]=0;const e=o(n,t);s=Math.max(s,e)}t.set(e,Math.sqrt(s))}else{const i=e.serviceMbsInRenderSR;if(L(i)){const e=n(J,D(i));e[2]=0,t.set(e,i[3])}}}isNodeVisible(e){const t=this.getServiceMbsInRenderSR(e);if(!this._isMBSinClippingArea(t))return!1;if(!this._useFrustumCulling)return!0;const i=this.getAndUpdateVisibilityObbInRenderSR(e);return i?i.doesIntersectFrustumConservativeApproximation(this._frustum):C(this._frustum,t)}isElevationAgnosticBoundingVolumeVisible(e){return!this._useFrustumCulling||(!e.valid||(1===this._viewingMode?this._isConeVisibleInFrustum(e):this._isCylinderVisibleInFrustum(e)))}_isConeVisibleInFrustum(n){if(!this._isConeVisibleInFrustumMbs(n))return!1;const r=n.radius;if(-1===r||r>.9)return!0;const o=this._frustumPlanes,c=this._frustumMbsCenter,u=n.getAxis(ie),l=i(u,c),h=this._frustumMbsRadius,d=l-h,m=l+h;if(d<=0)return!0;const _=a(W,u,d),p=a(Z,u,m),f=r/Math.sqrt(1-r*r);for(const v of o){const n=I(v),r=e(X,n),o=i(r,u);if(Math.abs(1-o)<.01)continue;const c=$;a(c,u,o),t(c,c,r),e(c,c);const l=ee;s(l,_,c,d*f);if(P(v,l)<=0)continue;s(l,p,c,m*f);if(P(v,l)<=0)continue;return!1}return!0}_isConeVisibleInFrustumMbs(e){const t=e.radius;if(t>.9)return!0;const s=this._frustumMbsRadius,n=this._frustumMbsCenter,o=r(n);if(o<=s)return!0;const u=e.getAxis(ie),l=i(u,n);{const e=a(H,u,l);if(c(e,n)<s)return!0}const h=l/o;if(l<=0){return-h<s}const d=Math.sqrt(1-h*h);if(d<t)return!0;const m=s/o;return d*Math.sqrt(1-m*m)-m*h<t}isObbVisibleIndependentOfElevation(e,t){if(!this._useFrustumCulling)return!0;if(!e.valid)return!0;const s=this._frustumMbsRadius,n=this._frustumMbsCenter,r=this._frustumPlanes,o=K;if(t.getCorners(o),1===this._viewingMode){const t=e.getAxis(ie),c=i(t,n),u=c-s,l=c+s;if(u<=0)return!0;for(const e of r){let s=!0;for(const n of o){const r=i(n,t),o=te;if(a(o,n,u/r),P(e,o)<=0){s=!1;break}const c=te;if(a(c,n,l/r),P(e,c)<=0){s=!1;break}}if(s)return!1}}else{const e=n[2]-s,t=n[2]+s;for(const i of r){let s=!0;const n=I(i),r=n[0],a=n[1],c=n[2],u=i[3];for(const i of o){const n=r*i[0]+a*i[1]+u;if(n+c*e<=0||n+c*t<=0){s=!1;break}}if(s)return!1}}return!0}_isCylinderVisibleInFrustum(e){const t=this._frustumMbsCenter,i=this._frustumMbsRadius,s=n(H,t);s[2]=0;const r=e.radius,o=e.getAxis(ie);return c(s,o)<=r+i}isGeometryVisible(e){if(!this._useFrustumCulling)return!0;const t=e.geometryObbInRenderSR;return t?.doesIntersectFrustumConservativeApproximation(this._frustum)??this.isNodeVisible(e)}_isMBSinClippingArea(e){return null==this._clippingArea||0!==y(this._clippingArea,e)}_screenSpaceDiameterMbs(e,t){const i=this.getServiceMbsInRenderSR(e),s=Math.sqrt(u(D(i),this._camPos)),n=s-i[3];return this._updateMinMaxDistance(s),n<0?.5*Number.MAX_VALUE:t/n*this._screenSizeFactor}calcCameraDistance(e){return this.calcCameraDistanceToCenter(e)-this.getServiceMbsInRenderSR(e)[3]}calcCameraDistanceToCenter(e){const t=this.getServiceMbsInRenderSR(e),i=l(D(t),this._camPos);return this._updateMinMaxDistance(i),i}calcAngleDependentLoD(e){const t=this.getServiceMbsInRenderSR(e),i=t[3],s=(Math.abs(t[0]*(t[0]-this._camPos[0])+t[1]*(t[1]-this._camPos[1])+t[2]*(t[2]-this._camPos[2]))/h(D(t))+i)/l(D(t),this._camPos);return Math.min(1,s)}hasLOD(e){return 0!==e.lodMetric}_getDistanceGlobeMode(e,t){const s=h(D(t)),n=h(e)-s;a(this._tmp0,e,i(e,D(t))/d(e));const r=u(D(t),this._tmp0),o=t[3];if(r<=o*o)return Math.abs(n);{const r=a(this._tmp0,D(t),1/s),c=s,u=o*o/2/c,d=a(this._tmp1,r,c-u),p=e,f=m(this._tmp2,p,d),v=m(this._tmp2,f,a(this._tmp3,r,i(r,f))),g=_(this._tmp2,d,a(this._tmp2,v,o/h(v)));let b=l(p,g);if(n>=2e5){const e=m(this._tmp1,p,g);let t=i(e,r)/h(e);t<.08&&(t=1e-4),b/=t}return b}}_getDistance(e,t){return this._isGlobalMode?this._getDistanceGlobeMode(e,t):z(e,t)}_updateMinMaxDistance(e){e>0?(this.minDistance=Math.min(this.minDistance,e),this.maxDistance=Math.max(this.maxDistance,e)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-e))}getLodLevel(e){if(0===e.lodMetric)return 0;if(0===e.childCount)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){const t=this._progressiveLoadFactor*this._screenspaceErrorBias,i=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,i)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case 2:{const i=this.getServiceMbsInRenderSR(e),s=this._getDistance(this._camPos,i),n=2*s/this._screenSizeFactor,r=s+i[3];return this._updateMinMaxDistance(r),e.maxError*t<=n}case 1:{let i=this._screenSpaceDiameterMbs(e,e.serviceMbsInIndexSR[3]*t);return this._options.angleDependentLoD&&(i*=this.calcAngleDependentLoD(e)),i<e.maxError}case 3:return this._screenSpaceDiameterMbs(e,e.maxError)*t<10;case 4:return this.calcCameraDistance(e)>e.maxError*t}return!1}distToPOI(e){const t=this.getServiceMbsInRenderSR(e);return l(D(t),this._poi)-t[3]}distCameraToPOI(){return l(this._camPos,this._poi)}}function z(e,t){const i=e[0]-t[0],s=e[1]-t[1],n=e[2]-t[2],r=i*i+s*s,o=t[3];if(r<=o*o)return Math.abs(n);const a=Math.sqrt(r)-o;return Math.sqrt(n*n+a*a)}const G=p(),N=M(),T=p(),H=p(),W=p(),Z=p(),X=p(),Y=new w,J=p(),K=[p(),p(),p(),p(),p(),p(),p(),p()],Q=p(),$=p(),ee=p(),te=p(),ie=p();export{q as default};
5
+ import{n as e,a as t,f as i,c as s,d as n,H as r,x as o,h as a,F as c,s as u,k as l,b as h,m as d,e as m,g as _}from"../../../../chunks/vec32.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as v}from"../../../../geometry/ellipsoidUtils.js";import{getSphericalPCPF as g}from"../../../../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingSphere as b}from"../../../../geometry/projection/projectBoundingSphere.js";import{getProjector as R}from"../../../../geometry/projection/projectors.js";import{create as S,fromMatrix as x,createPoints as M,intersectsSphere as C}from"../../../../geometry/support/frustum.js";import{getNormal as I,signedDistance as P}from"../../../../geometry/support/plane.js";import{isPlateCarree as E}from"../../../../geometry/support/spatialReferenceUtils.js";import{m as F,a as D}from"../../../../chunks/sphere.js";import{makeDehydratedPoint as O}from"../../../../layers/graphics/dehydratedPoint.js";import{evaluateElevationAlignmentAtPoint as A}from"../graphics/elevationAlignmentUtils.js";import{ElevationContext as B}from"../graphics/ElevationContext.js";import{createContextWithoutExpressionSupport as V,extractExpressionInfo as j}from"../graphics/featureExpressionInfoUtils.js";import{isValidMbs as L,intersectBoundingRectWithMbs as y}from"./I3SUtil.js";import{Obb as w,computeOffsetObb as U}from"../../support/orientedBoundingBox.js";const k=1e5;class q{get _frustumMbsCenter(){return this._frustumMbs}get _frustumMbsRadius(){return this._frustumMbs[3]}get _frustumPlanes(){return this._frustum}constructor(e,t,i,s,n,r,o,a,c={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=n,this._elevationProvider=r,this._viewingMode=o,this._options=c,this._frustum=S(),this._frustumMbs=f(),this._useFrustumCulling=!1,this._poi=p(),this._elevationContext=null,this.minDistance=1/0,this.maxDistance=0,this.maxLodLevel=2,this._tmpObb=new w,this._tmp1=p(),this._tmp2=p(),this._tmp3=p(),this._tmp0=p(),this._screenspaceErrorBias=c.screenspaceErrorBias||1,this._progressiveLoadFactor=c.progressiveLoadFactor||1,this.updateCamera(i,s);const u=this._renderCoordsHelper.spatialReference;this._renderSR=u,this._renderSRSphericalPCPF=g(u),this._isGlobalMode=u===this._renderSRSphericalPCPF,this.updateElevationInfo(a),this._tmpPoint=O(0,0,0,e),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(u.isWebMercator||E(u)),this._indexSREllipsoidRadius=v(this._indexSR).radius,this._indexSRSphericalPCPF=g(e),this._projectorIndexSRToIndexSRSphericalPCPF=R(this._indexSR,this._indexSRSphericalPCPF)}updateElevationInfo(e){null!=e?(this._elevationContext=B.fromElevationInfo(e),this._elevationContext.setFeatureExpressionInfoContext(V(j(e,!1)))):this._elevationContext=null}updateCamera(n,r){if(this._useFrustumCulling=r,r){x(n.viewMatrix,n.projectionMatrix,this._frustum,N);{const r=n.eye,o=G;e(o,n.viewForward);const a=T;t(a,N[4],r);const c=.5*i(a,a)/i(o,a),u=this._frustumMbs;s(u,r,o,c);const l=1+c;u[3]=l}}this._screenSizeFactor=1/(n.perScreenPixelRatio/2),this._camPos=n.eye,this.minDistance=1/0,this.maxDistance=0}setPointOfInterest(e){this._poi=e}updateScreenSpaceErrorBias(e){const t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}expandElevationRange(e,t,i){if(null==this._elevationContext)return;const s=e.serviceMbsInIndexSR;if(!s)return;const n="relative-to-scene"===this._elevationContext.mode?"scene":"ground";if(this._elevationProvider.getSphereElevationBounds){const e=this._elevationProvider.getSphereElevationBounds(s,this._indexSR,n);if(e)return void i.expandElevationRange(e)}const r=s[0],o=s[1],a=s[2],c=this._elevationProvider.getElevation(r,o,a,this._indexSR,n);c&&i.expandElevationRangeValues(c,c);const u=t?null:this._elevationProvider.getRootElevationBounds?.();u&&i.expandElevationRange(u)}getServiceMbsInRenderSR(e){const t=e.serviceMbsInRenderSR;if(L(t))return t;const{serviceMbsInIndexSR:i}=e;i&&F(i,t);const s=e.elevationRangeMin;if(this._elevationContext&&Number.isFinite(s)){let i=0,n=0;const r=e.elevationRangeMax;switch(this._elevationContext.mode){case"relative-to-ground":case"relative-to-scene":i=this._elevationContext.geometryZWithOffset(t[2],this._renderCoordsHelper)+s-t[2],n=r-s;break;case"on-the-ground":i=s-t[2],n=r-s}t[2]+=i+.5*n,t[3]+=.5*n}else this._elevationContext&&t[3]<k&&(this._tmpPoint.x=t[0],this._tmpPoint.y=t[1],this._tmpPoint.z=t[2],t[2]=A(this._tmpPoint,this._elevationProvider,this._elevationContext,this._renderCoordsHelper));return b(t,this._indexSR,t,this._renderSR),t}getAndUpdateVisibilityObbInRenderSR(e){{const t=e.visibilityObbInRenderSR;if(t)return t}const t=.01*this._indexSREllipsoidRadius,{serviceMbsInIndexSR:i,serviceObbInIndexSR:s}=e;if(null==s||!i||!s.isValid||this._isECEFOBBInLocalMode&&(s.halfSizeX>t||s.halfSizeY>t||s.halfSizeZ>t))return null;{let t=e.serviceObbInRenderSR;if(null==t)t=new w,e.serviceObbInRenderSR=t;else if(t.isValid)return t;const n=i[3];let r=0,o=0;const a=s.centerZ,c=this._renderCoordsHelper,u=this._elevationContext;if(u&&e.elevationRangeValid){const t=e.elevationRangeMin,i=e.elevationRangeMax;switch(u.mode){case"relative-to-ground":case"relative-to-scene":r=u.geometryZWithOffset(a,c)+t-a,o=i-t;break;case"on-the-ground":r=t-a,o=i-t}}else if(u&&n<k){const e=this._tmpPoint;e.x=s.centerX,e.y=s.centerY,e.z=a,r=A(e,this._elevationProvider,u,c)-a}const l=o>0,h=l?this._tmpObb:t;return s.transform(h,this._indexSR,this._renderSR,r,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),l&&U(h,0,o,this._viewingMode,t),t}}getNodeObbInRenderSRIndependentOfElevationOffset(e){{const t=e.visibilityObbInRenderSR??e.serviceObbInRenderSR??null;if(t?.isValid)return t}const t=e.serviceObbInIndexSR;return t?(t.transform(Y,this._indexSR,this._renderSR,void 0,this._renderSRSphericalPCPF,this._indexSRSphericalPCPF,this._projectorIndexSRToIndexSRSphericalPCPF),Y):null}ensureElevationAgnosticBoundingVolume(e){return!e.elevationAgnosticBoundingVolume.valid&&e.level>0&&(1===this._viewingMode?this._updateElevationAgnosticBoundingVolumeGlobal(e):this._updateElevationAgnosticBoundingVolumeLocal(e)),e.elevationAgnosticBoundingVolume}_updateElevationAgnosticBoundingVolumeGlobal(t){const s=this.getNodeObbInRenderSRIndependentOfElevationOffset(t),o=t.elevationAgnosticBoundingVolume;let a,c=-1;if(s){const t=J;s.getCenter(t),e(t,t),a=t,s.getCorners(K);for(const s of K){e(s,s);const n=i(s,t);if(n<=0)return void o.invalidate();const r=Math.sqrt(1-n*n);c=Math.max(c,r)}}else{const i=t.serviceMbsInRenderSR;if(!L(i))return void o.invalidate();{const t=n(J,D(i)),s=i[3],u=r(t);if(u<s)return void o.invalidate();c=s/u,e(t,t),a=t}}const u=.001;o.set(a,c+u)}_updateElevationAgnosticBoundingVolumeLocal(e){const t=e.elevationAgnosticBoundingVolume,i=this.getNodeObbInRenderSRIndependentOfElevationOffset(e);if(i){const e=i.getCenter(J);e[2]=0;let s=0;const n=Q;i.getCorners(K);for(const t of K){t[2]=0;const e=o(n,t);s=Math.max(s,e)}t.set(e,Math.sqrt(s))}else{const i=e.serviceMbsInRenderSR;if(L(i)){const e=n(J,D(i));e[2]=0,t.set(e,i[3])}}}isNodeVisible(e){const t=this.getServiceMbsInRenderSR(e);if(!this._isMBSinClippingArea(t))return!1;if(!this._useFrustumCulling)return!0;const i=this.getAndUpdateVisibilityObbInRenderSR(e);return i?i.doesIntersectFrustumConservativeApproximation(this._frustum):C(this._frustum,t)}isElevationAgnosticBoundingVolumeVisible(e){return!this._useFrustumCulling||(!e.valid||(1===this._viewingMode?this._isConeVisibleInFrustum(e):this._isCylinderVisibleInFrustum(e)))}_isConeVisibleInFrustum(n){if(!this._isConeVisibleInFrustumMbs(n))return!1;const r=n.radius;if(-1===r||r>.9)return!0;const o=this._frustumPlanes,c=this._frustumMbsCenter,u=n.getAxis(ie),l=i(u,c),h=this._frustumMbsRadius,d=l-h,m=l+h;if(d<=0)return!0;const _=a(W,u,d),p=a(Z,u,m),f=r/Math.sqrt(1-r*r);for(const v of o){const n=I(v),r=e(X,n),o=i(r,u);if(Math.abs(1-o)<.01)continue;const c=$;a(c,u,o),t(c,c,r),e(c,c);const l=ee;s(l,_,c,d*f);if(P(v,l)<=0)continue;s(l,p,c,m*f);if(P(v,l)<=0)continue;return!1}return!0}_isConeVisibleInFrustumMbs(e){const t=e.radius;if(t>.9)return!0;const s=this._frustumMbsRadius,n=this._frustumMbsCenter,o=r(n);if(o<=s)return!0;const u=e.getAxis(ie),l=i(u,n);{const e=a(H,u,l);if(c(e,n)<s)return!0}const h=l/o;if(l<=0){return-h<s}const d=Math.sqrt(1-h*h);if(d<t)return!0;const m=s/o;return d*Math.sqrt(1-m*m)-m*h<t}isObbVisibleIndependentOfElevation(e,t){if(!this._useFrustumCulling)return!0;if(!e.valid)return!0;const s=this._frustumMbsRadius,n=this._frustumMbsCenter,r=this._frustumPlanes,o=K;if(t.getCorners(o),1===this._viewingMode){const t=e.getAxis(ie),c=i(t,n),u=c-s,l=c+s;if(u<=0)return!0;for(const e of r){let s=!0;for(const n of o){const r=i(n,t),o=te;if(a(o,n,u/r),P(e,o)<=0){s=!1;break}const c=te;if(a(c,n,l/r),P(e,c)<=0){s=!1;break}}if(s)return!1}}else{const e=n[2]-s,t=n[2]+s;for(const i of r){let s=!0;const n=I(i),r=n[0],a=n[1],c=n[2],u=i[3];for(const i of o){const n=r*i[0]+a*i[1]+u;if(n+c*e<=0||n+c*t<=0){s=!1;break}}if(s)return!1}}return!0}_isCylinderVisibleInFrustum(e){const t=this._frustumMbsCenter,i=this._frustumMbsRadius,s=n(H,t);s[2]=0;const r=e.radius,o=e.getAxis(ie);return c(s,o)<=r+i}isGeometryVisible(e){if(!this._useFrustumCulling)return!0;const t=e.geometryObbInRenderSR;return t?.doesIntersectFrustumConservativeApproximation(this._frustum)??this.isNodeVisible(e)}_isMBSinClippingArea(e){return null==this._clippingArea||0!==y(this._clippingArea,e)}_screenSpaceDiameterMbs(e,t){const i=this.getServiceMbsInRenderSR(e),s=Math.sqrt(u(D(i),this._camPos)),n=s-i[3];return this._updateMinMaxDistance(s),n<0?.5*Number.MAX_VALUE:t/n*this._screenSizeFactor}calcCameraDistance(e){return this.calcCameraDistanceToCenter(e)-this.getServiceMbsInRenderSR(e)[3]}calcCameraDistanceToCenter(e){const t=this.getServiceMbsInRenderSR(e),i=l(D(t),this._camPos);return this._updateMinMaxDistance(i),i}calcAngleDependentLoD(e){const t=this.getServiceMbsInRenderSR(e),i=t[3],s=(Math.abs(t[0]*(t[0]-this._camPos[0])+t[1]*(t[1]-this._camPos[1])+t[2]*(t[2]-this._camPos[2]))/h(D(t))+i)/l(D(t),this._camPos);return Math.min(1,s)}hasLOD(e){return 0!==e.lodMetric}_getDistanceGlobeMode(e,t){const s=h(D(t)),n=h(e)-s;a(this._tmp0,e,i(e,D(t))/d(e));const r=u(D(t),this._tmp0),o=t[3];if(r<=o*o)return Math.abs(n);{const r=a(this._tmp0,D(t),1/s),c=s,u=o*o/2/c,d=a(this._tmp1,r,c-u),p=e,f=m(this._tmp2,p,d),v=m(this._tmp2,f,a(this._tmp3,r,i(r,f))),g=_(this._tmp2,d,a(this._tmp2,v,o/h(v)));let b=l(p,g);if(n>=2e5){const e=m(this._tmp1,p,g);let t=i(e,r)/h(e);t<.08&&(t=1e-4),b/=t}return b}}_getDistance(e,t){return this._isGlobalMode?this._getDistanceGlobeMode(e,t):z(e,t)}_updateMinMaxDistance(e){e>0?(this.minDistance=Math.min(this.minDistance,e),this.maxDistance=Math.max(this.maxDistance,e)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-e))}getLodLevel(e){if(0===e.lodMetric)return 0;if(0===e.childCount)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){const t=this._progressiveLoadFactor*this._screenspaceErrorBias,i=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,i)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case 2:{const i=this.getServiceMbsInRenderSR(e),s=this._getDistance(this._camPos,i),n=2*s/this._screenSizeFactor,r=s+i[3];return this._updateMinMaxDistance(r),e.maxError*t<=n}case 1:{let i=this._screenSpaceDiameterMbs(e,e.serviceMbsInIndexSR[3]*t);return this._options.angleDependentLoD&&(i*=this.calcAngleDependentLoD(e)),i<e.maxError}case 3:return this._screenSpaceDiameterMbs(e,e.maxError)*t<10;case 4:return this.calcCameraDistance(e)>e.maxError*t}return!1}distToPOI(e){if(null==e)return 0;const t=this.getServiceMbsInRenderSR(e);return l(D(t),this._poi)-t[3]}distCameraToPOI(){return l(this._camPos,this._poi)}}function z(e,t){const i=e[0]-t[0],s=e[1]-t[1],n=e[2]-t[2],r=i*i+s*s,o=t[3];if(r<=o*o)return Math.abs(n);const a=Math.sqrt(r)-o;return Math.sqrt(n*n+a*a)}const G=p(),N=M(),T=p(),H=p(),W=p(),Z=p(),X=p(),Y=new w,J=p(),K=[p(),p(),p(),p(),p(),p(),p(),p()],Q=p(),$=p(),ee=p(),te=p(),ie=p();export{q as default};