@arcgis/core 5.2.0-next.125 → 5.2.0-next.127

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 (472) hide show
  1. package/analysis/ElevationProfile/ElevationProfileDisplayUnits.d.ts +3 -2
  2. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +1 -0
  3. package/applications/Components/basemapToggleUtils.d.ts +53 -0
  4. package/applications/Components/basemapToggleUtils.js +2 -0
  5. package/arcgisGlobal.d.ts +2 -0
  6. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  7. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/{e35eb93c0fb1f6de8db0.js → 00d9e41deecf5828975c.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{fe9582bc2244667e40ab.js → 05afa8c2b5929ce0545a.js} +1 -1
  11. package/assets/esri/core/workers/chunks/0a20f84b5f004a77a9f9.js +1 -0
  12. package/assets/esri/core/workers/chunks/{cfd56e0a716baf95e17b.js → 0a2b7c691a577cb3d189.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{6cf34cfdd063a1b6fe3e.js → 0ccd4200c5a2a5de6e16.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{ab8a1140bf31f46f8ebf.js → 1262918b2161d79851c0.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{bdf012e591a8476db467.js → 1406a884241809b62bff.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{d3ef23923424ad8c5048.js → 1c2723f9630e7d597843.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{378bdb4e5cd1ebada1f4.js → 1c33aa349beea9a3792f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/1d040aa8951fff3141d9.js +1 -0
  19. package/assets/esri/core/workers/chunks/{54eeb4cac4fa092359ab.js → 2226c20c38e20713bcb5.js} +2 -2
  20. package/assets/esri/core/workers/chunks/{54eeb4cac4fa092359ab.js.LICENSE.txt → 2226c20c38e20713bcb5.js.LICENSE.txt} +2 -2
  21. package/assets/esri/core/workers/chunks/26995de0c18bef8db590.js +1 -0
  22. package/assets/esri/core/workers/chunks/2c7fc24649d91552e68a.js +1 -0
  23. package/assets/esri/core/workers/chunks/{f05becec0952a61bc654.js → 2ebad7e588b26e74cefe.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{2f52ad525744b8793d49.js → 3b7dff15a0058ea29886.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{4716693eca44e8f89f5c.js → 3bf56c33876ba56c4b21.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3c6ee445e49da0076ac1.js +1 -0
  27. package/assets/esri/core/workers/chunks/3ef367c9b7bf1588307d.js +1 -0
  28. package/assets/esri/core/workers/chunks/{5b9b76e180cf206a8a0c.js → 4327d2c39a660bd89da7.js} +1 -1
  29. package/assets/esri/core/workers/chunks/4678a8170d8a3ccd1a7b.js +1 -0
  30. package/assets/esri/core/workers/chunks/474d9541d387b31ad275.js +1 -0
  31. package/assets/esri/core/workers/chunks/{26bc509a031788bfa678.js → 4f464047c6f6c9486efd.js} +1 -1
  32. package/assets/esri/core/workers/chunks/50c29d10ec53f0e48e8a.js +1 -0
  33. package/assets/esri/core/workers/chunks/{58528ccb7f72ae76d52b.js → 540f60e31b19d85e9371.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{44857a76be2c0ac65bb9.js → 55a560fd872f7463b33d.js} +1 -1
  35. package/assets/esri/core/workers/chunks/58fb92775d668cfd295c.js +1 -0
  36. package/assets/esri/core/workers/chunks/{f0901f9c7135b708434f.js → 5adf2792416b22cd602f.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{b013b70e40dfb6ce013e.js → 668ec0bdfb2095e90c9e.js} +1 -1
  38. package/assets/esri/core/workers/chunks/67678054342178b601cf.js +1 -0
  39. package/assets/esri/core/workers/chunks/67dcf9b873cb037b2647.js +1 -0
  40. package/assets/esri/core/workers/chunks/75879ae88fd87b089a87.js +1 -0
  41. package/assets/esri/core/workers/chunks/76548469fe1b9c3b2051.js +1 -0
  42. package/assets/esri/core/workers/chunks/7d6da4e89aa951e6523f.js +1 -0
  43. package/assets/esri/core/workers/chunks/7dd94567833386dc74de.js +1 -0
  44. package/assets/esri/core/workers/chunks/{24673aac70d6c949b6fa.js → 86d7a3ae672a51b75fcc.js} +1 -1
  45. package/assets/esri/core/workers/chunks/88e11b645a1361f1bdbe.js +1 -0
  46. package/assets/esri/core/workers/chunks/{f0709c48daca93e759c8.js → 8b0d6205ceeec1ab446f.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{1f55701d23a5e5a0c70c.js → 8cb216404a6254bc695c.js} +123 -122
  48. package/assets/esri/core/workers/chunks/9d6a96e4c7ccedcb0c13.js +1 -0
  49. package/assets/esri/core/workers/chunks/9ec04faad97be55309b8.js +1 -0
  50. package/assets/esri/core/workers/chunks/a08385ebf1715414c1a6.js +1 -0
  51. package/assets/esri/core/workers/chunks/{b96358d475dc98034aa4.js → a15ed056e7493ddf3b4c.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{25e212fe9a2ea37c9e81.js → a3a33ffa34f4d645ddfe.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{e22a013ec38989caf9de.js → a790fc6b22acf651574b.js} +1 -1
  54. package/assets/esri/core/workers/chunks/af0704494398f33aa315.js +1 -0
  55. package/assets/esri/core/workers/chunks/{813dd84933b407c8fe86.js → b34305474a861aaf6ccb.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{ce1ccf9ec90b786591e5.js → b396c4b4bb144200acc7.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{bbaaebe1774a22dba39b.js → bbfb80a6983574007ce5.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{3f082329a544c2c1d62d.js → bcf2e5cf6b9c6d0442bb.js} +1 -1
  59. package/assets/esri/core/workers/chunks/c35e9dee87937f483a3d.js +1 -0
  60. package/assets/esri/core/workers/chunks/c5b733c3a5b2680042a2.js +1 -0
  61. package/assets/esri/core/workers/chunks/{4f7e8e4ddf52b5245ea4.js → c77496c350004ee66eb2.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{85739ed6af0f0a3cb302.js → c94bdfed831c775e04c0.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{2e3fd81653dc0d86456c.js → cfeba0ffb7fdc2a9af05.js} +1 -1
  64. package/assets/esri/core/workers/chunks/d371d9279b30548efa02.js +1 -0
  65. package/assets/esri/core/workers/chunks/d5f0fed415b5b155d57c.js +1 -0
  66. package/assets/esri/core/workers/chunks/d6e914f6ed45ea59034e.js +1 -0
  67. package/assets/esri/core/workers/chunks/{0fba5c0e89b057da548d.js → dc92710a8fdfb9135e55.js} +1 -1
  68. package/assets/esri/core/workers/chunks/e0894a308c84d5c158b0.js +1 -0
  69. package/assets/esri/core/workers/chunks/{df79c00b5ddbef7148a0.js → eaa7cb3ffa8c11706a09.js} +1 -1
  70. package/assets/esri/core/workers/chunks/eebbc86a15ae3adb5f38.js +1 -0
  71. package/assets/esri/core/workers/chunks/f479b4a4cee4bb2e046c.js +1 -0
  72. package/assets/esri/core/workers/chunks/{78abd6c42f39e6f6ffbb.js → f983296b6f4a62a911eb.js} +1 -1
  73. package/assets/esri/images/portal/gaussiansplatlayer16.png +0 -0
  74. package/assets/esri/images/portal/knowledgegraphlayer16.png +0 -0
  75. package/assets/esri/images/portal/propresentation16.png +0 -0
  76. package/assets/esri/images/portal/urbanproject16.png +0 -0
  77. package/assets/esri/images/support/loading-throb.gif +0 -0
  78. package/assets/esri/layers/raster/formats/lerc-wasm.wasm +0 -0
  79. package/assets/esri/libs/pdfjs/pdf.worker.mjs +4 -63051
  80. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-arabic.woff2 +0 -0
  81. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-cyrillic.woff2 +0 -0
  82. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-ext.woff2 +0 -0
  83. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-georgian.woff2 +0 -0
  84. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-greek.woff2 +0 -0
  85. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-hebrew.woff2 +0 -0
  86. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-math.woff2 +0 -0
  87. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-thai.woff2 +0 -0
  88. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02-vietnamese.woff2 +0 -0
  89. package/assets/esri/themes/base/fonts/fonts/09ab0626-bb45-4650-acc8-0182d693df02.woff2 +0 -0
  90. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-arabic.woff2 +0 -0
  91. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-cyrillic.woff2 +0 -0
  92. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-ext.woff2 +0 -0
  93. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-georgian.woff2 +0 -0
  94. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-greek.woff2 +0 -0
  95. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-hebrew.woff2 +0 -0
  96. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-math.woff2 +0 -0
  97. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-thai.woff2 +0 -0
  98. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7-vietnamese.woff2 +0 -0
  99. package/assets/esri/themes/base/fonts/fonts/0c8a5d21-8a14-4451-8145-695071809cb7.woff2 +0 -0
  100. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-arabic.woff2 +0 -0
  101. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-cyrillic.woff2 +0 -0
  102. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-ext.woff2 +0 -0
  103. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-georgian.woff2 +0 -0
  104. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-greek.woff2 +0 -0
  105. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-hebrew.woff2 +0 -0
  106. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-math.woff2 +0 -0
  107. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-thai.woff2 +0 -0
  108. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688-vietnamese.woff2 +0 -0
  109. package/assets/esri/themes/base/fonts/fonts/12f4c786-0bef-4a48-b7c0-eebaa7591688.woff2 +0 -0
  110. package/assets/esri/themes/base/fonts/fonts/3ae1e25e-3aa6-4061-a016-a079159f9d65.woff2 +0 -0
  111. package/assets/esri/themes/base/fonts/fonts/41331c3c-3759-4462-8695-33c9a21b6a5b.woff2 +0 -0
  112. package/assets/esri/themes/base/fonts/fonts/94aa531e-7746-4df0-bb6e-349891f2eda5.woff2 +0 -0
  113. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-arabic.woff2 +0 -0
  114. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-cyrillic.woff2 +0 -0
  115. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-ext.woff2 +0 -0
  116. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-georgian.woff2 +0 -0
  117. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-greek.woff2 +0 -0
  118. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-hebrew.woff2 +0 -0
  119. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-math.woff2 +0 -0
  120. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-thai.woff2 +0 -0
  121. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939-vietnamese.woff2 +0 -0
  122. package/assets/esri/themes/base/fonts/fonts/b8b15cdf-85d1-4120-8daa-48863d803939.woff2 +0 -0
  123. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-cyrillic.woff2 +0 -0
  124. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-ext.woff2 +0 -0
  125. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-greek.woff2 +0 -0
  126. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-hebrew.woff2 +0 -0
  127. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-math.woff2 +0 -0
  128. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d-vietnamese.woff2 +0 -0
  129. package/assets/esri/themes/base/fonts/fonts/b9c5b839-db56-4419-8fcb-6ab661babb1d.woff2 +0 -0
  130. package/assets/esri/themes/base/fonts/fonts.scss +0 -0
  131. package/assets/esri/themes/base/icons/style.scss +0 -0
  132. package/assets/esri/themes/base/icons/variables.scss +0 -0
  133. package/assets/esri/themes/base/images/files/archive-32.svg +0 -0
  134. package/assets/esri/themes/base/images/files/cad-32.svg +0 -0
  135. package/assets/esri/themes/base/images/files/code-32.svg +0 -0
  136. package/assets/esri/themes/base/images/files/csv-32.svg +0 -0
  137. package/assets/esri/themes/base/images/files/excel-32.svg +0 -0
  138. package/assets/esri/themes/base/images/files/generic-32.svg +0 -0
  139. package/assets/esri/themes/base/images/files/gpx-32.svg +0 -0
  140. package/assets/esri/themes/base/images/files/image-32.svg +0 -0
  141. package/assets/esri/themes/base/images/files/pdf-32.svg +0 -0
  142. package/assets/esri/themes/base/images/files/report-32.svg +0 -0
  143. package/assets/esri/themes/base/images/files/sound-32.svg +0 -0
  144. package/assets/esri/themes/base/images/files/text-32.svg +0 -0
  145. package/assets/esri/themes/base/images/files/video-32.svg +0 -0
  146. package/assets/esri/themes/base/images/files/word-32.svg +0 -0
  147. package/assets/esri/themes/base/images/files/zip-32.svg +0 -0
  148. package/assets/esri/themes/base/images/loading-throb.gif +0 -0
  149. package/assets/esri/themes/base/widgets/_Bookmarks.scss +0 -0
  150. package/assets/esri/themes/base/widgets/_Tooltip.scss +37 -0
  151. package/assets/esri/themes/dark/main.css +1 -1
  152. package/assets/esri/themes/light/main.css +1 -1
  153. package/assets/esri/themes/light/view.css +1 -1
  154. package/assets/esri/views/interactive/tooltip/t9n/messages.en.json +1 -1
  155. package/assets/esri/widgets/Editor/t9n/messages.ar.json +1 -1
  156. package/assets/esri/widgets/Editor/t9n/messages.bg.json +1 -1
  157. package/assets/esri/widgets/Editor/t9n/messages.bs.json +1 -1
  158. package/assets/esri/widgets/Editor/t9n/messages.ca.json +1 -1
  159. package/assets/esri/widgets/Editor/t9n/messages.cs.json +1 -1
  160. package/assets/esri/widgets/Editor/t9n/messages.da.json +1 -1
  161. package/assets/esri/widgets/Editor/t9n/messages.de.json +1 -1
  162. package/assets/esri/widgets/Editor/t9n/messages.el.json +1 -1
  163. package/assets/esri/widgets/Editor/t9n/messages.es.json +1 -1
  164. package/assets/esri/widgets/Editor/t9n/messages.et.json +1 -1
  165. package/assets/esri/widgets/Editor/t9n/messages.fi.json +1 -1
  166. package/assets/esri/widgets/Editor/t9n/messages.fr.json +1 -1
  167. package/assets/esri/widgets/Editor/t9n/messages.he.json +1 -1
  168. package/assets/esri/widgets/Editor/t9n/messages.hr.json +1 -1
  169. package/assets/esri/widgets/Editor/t9n/messages.hu.json +1 -1
  170. package/assets/esri/widgets/Editor/t9n/messages.id.json +1 -1
  171. package/assets/esri/widgets/Editor/t9n/messages.it.json +1 -1
  172. package/assets/esri/widgets/Editor/t9n/messages.ja.json +1 -1
  173. package/assets/esri/widgets/Editor/t9n/messages.ko.json +1 -1
  174. package/assets/esri/widgets/Editor/t9n/messages.lt.json +1 -1
  175. package/assets/esri/widgets/Editor/t9n/messages.lv.json +1 -1
  176. package/assets/esri/widgets/Editor/t9n/messages.nl.json +1 -1
  177. package/assets/esri/widgets/Editor/t9n/messages.no.json +1 -1
  178. package/assets/esri/widgets/Editor/t9n/messages.pl.json +1 -1
  179. package/assets/esri/widgets/Editor/t9n/messages.pt-BR.json +1 -1
  180. package/assets/esri/widgets/Editor/t9n/messages.pt-PT.json +1 -1
  181. package/assets/esri/widgets/Editor/t9n/messages.ro.json +1 -1
  182. package/assets/esri/widgets/Editor/t9n/messages.ru.json +1 -1
  183. package/assets/esri/widgets/Editor/t9n/messages.sk.json +1 -1
  184. package/assets/esri/widgets/Editor/t9n/messages.sl.json +1 -1
  185. package/assets/esri/widgets/Editor/t9n/messages.sr.json +1 -1
  186. package/assets/esri/widgets/Editor/t9n/messages.sv.json +1 -1
  187. package/assets/esri/widgets/Editor/t9n/messages.th.json +1 -1
  188. package/assets/esri/widgets/Editor/t9n/messages.tr.json +1 -1
  189. package/assets/esri/widgets/Editor/t9n/messages.uk.json +1 -1
  190. package/assets/esri/widgets/Editor/t9n/messages.vi.json +1 -1
  191. package/assets/esri/widgets/Editor/t9n/messages.zh-CN.json +1 -1
  192. package/assets/esri/widgets/Editor/t9n/messages.zh-HK.json +1 -1
  193. package/assets/esri/widgets/Editor/t9n/messages.zh-TW.json +1 -1
  194. package/chunks/GlobalIllumination.glsl.js +10 -9
  195. package/chunks/GlobalIlluminationBlur.glsl.js +8 -8
  196. package/chunks/HeatmapDensity.glsl.js +5 -5
  197. package/chunks/Pattern.glsl.js +30 -30
  198. package/chunks/RibbonLine.glsl.js +19 -19
  199. package/config.js +1 -1
  200. package/core/Accessor.d.ts +1 -1
  201. package/core/accessorSupport/types.d.ts +5 -1
  202. package/core/lang.js +1 -1
  203. package/interfaces.d.ts +3 -0
  204. package/kernel.js +1 -1
  205. package/layers/ParquetLayer.d.ts +24 -15
  206. package/layers/ParquetLayer.js +1 -1
  207. package/layers/SceneLayer.js +1 -1
  208. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  209. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +2 -2
  210. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  211. package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
  212. package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
  213. package/layers/geospatialPDF/geospatialPDFParserUtils.js +2 -0
  214. package/layers/geospatialPDF/projectionToWKTUtils.js +2 -0
  215. package/layers/geospatialPDF/renderExtentUtils.js +1 -1
  216. package/layers/geospatialPDF/sharedUtils.js +1 -1
  217. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  218. package/layers/graphics/dehydratedFeatures.js +1 -1
  219. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  220. package/layers/orientedImagery/transformations/utils.js +1 -1
  221. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  222. package/layers/raster/types.d.ts +6 -0
  223. package/layers/support/TimeSeriesCalculation.d.ts +32 -0
  224. package/layers/support/TimeSeriesCalculation.js +2 -0
  225. package/layers/support/TimeSeriesInfo.d.ts +19 -0
  226. package/layers/support/TimeSeriesInfo.js +1 -1
  227. package/layers/support/commonProperties.js +1 -1
  228. package/layers/support/timeSeriesUtils.d.ts +25 -1
  229. package/layers/support/timeSeriesUtils.js +1 -1
  230. package/layers/types.d.ts +1 -0
  231. package/package.json +3 -3
  232. package/popup/FeatureContentCollection.d.ts +19 -26
  233. package/popup/FeatureContentCollection.js +1 -1
  234. package/popup/types.d.ts +14 -3
  235. package/portal/schemas/definitions.js +1 -1
  236. package/portal/schemas/sceneLayerItem.js +1 -1
  237. package/renderers/support/AuthoringInfo.d.ts +8 -1
  238. package/renderers/support/AuthoringInfo.js +1 -1
  239. package/renderers/support/AuthoringInfoVisualVariable.d.ts +8 -1
  240. package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
  241. package/rest/imageService/fetchRasterInfo.js +1 -1
  242. package/rest/knowledgeGraph/DataModel.js +1 -1
  243. package/smartMapping/renderers/color.d.ts +12 -0
  244. package/smartMapping/renderers/color.js +1 -1
  245. package/smartMapping/renderers/opacity.d.ts +6 -0
  246. package/smartMapping/renderers/opacity.js +1 -1
  247. package/smartMapping/renderers/size.d.ts +12 -0
  248. package/smartMapping/renderers/size.js +1 -1
  249. package/smartMapping/renderers/support/regenerateUtils.js +1 -1
  250. package/smartMapping/renderers/support/rendererUtils.js +1 -1
  251. package/smartMapping/renderers/support/timeSeriesUtils.js +1 -1
  252. package/smartMapping/renderers/type.d.ts +6 -0
  253. package/smartMapping/renderers/type.js +1 -1
  254. package/smartMapping/renderers/univariateColorSize.d.ts +6 -0
  255. package/smartMapping/renderers/univariateColorSize.js +1 -1
  256. package/support/revision.js +1 -1
  257. package/symbols/cim/callouts/calloutAnalysisUtils.js +2 -0
  258. package/symbols/cim/callouts/effects/BackgroundCallout.js +1 -1
  259. package/symbols/cim/callouts/effects/BalloonCallout.js +1 -1
  260. package/symbols/cim/callouts/effects/PointSymbolCallout.js +1 -1
  261. package/symbols/cim/callouts/effects/SimpleLineCallout.js +1 -1
  262. package/symbols/cim/callouts/effects/calloutUtils.js +1 -1
  263. package/symbols/cim/cimAnalyzer.js +1 -1
  264. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
  265. package/views/2d/analysis/AreaMeasurementAnalysisView2D.d.ts +8 -0
  266. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
  267. package/views/2d/analysis/DistanceMeasurement/DistanceMeasurementTool.js +1 -1
  268. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.d.ts +8 -0
  269. package/views/2d/analysis/DistanceMeasurementAnalysisView2D.js +1 -1
  270. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +3 -2
  271. package/views/2d/engine/webgl/ClipMesh.js +1 -1
  272. package/views/2d/engine/webgl/mesh/factories/CalloutMeshWriterCoordinator.js +1 -1
  273. package/views/2d/engine/webgl/mesh/factories/MeshWriterGroupCoordinator.js +1 -1
  274. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  275. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  276. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedPolyMeshWriters.js +1 -1
  277. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  278. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js +1 -1
  279. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js +1 -1
  280. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js +1 -1
  281. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js +1 -1
  282. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js +1 -1
  283. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  284. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js +1 -1
  285. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js +1 -1
  286. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js +1 -1
  287. package/views/2d/engine/webgl/shaderGraph/techniques/markers/ComputedMarkerParams.js +1 -1
  288. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  289. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/CalloutMeshWriterPolicy.js +1 -1
  290. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  291. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterReferences.js +1 -1
  292. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  293. package/views/2d/engine/webgl/util/AnnotationMatcher.js +1 -1
  294. package/views/2d/engine/webgl/util/Matcher.js +1 -1
  295. package/views/2d/layers/LayerView2D.js +1 -1
  296. package/views/2d/layers/support/annodime/MatcherGeometryOverride.js +1 -1
  297. package/views/2d/layers/support/annodime/PrivateMatcherGeometryOverrideEffect.js +1 -1
  298. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  299. package/views/3d/analysis/Dimension/DimensionController.js +1 -1
  300. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  301. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +3 -2
  302. package/views/3d/analysis/LineOfSight/LineOfSightAuthoringUtils.js +1 -1
  303. package/views/3d/analysis/LineOfSight/LineOfSightEditTool.js +1 -1
  304. package/views/3d/analysis/LineOfSight/LineOfSightItemManipulatedObject3D.js +1 -1
  305. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  306. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  307. package/views/3d/analysis/LineOfSight/LineOfSightRootPlugin.js +1 -1
  308. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  309. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  310. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +5 -3
  311. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  312. package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
  313. package/views/3d/analysis/Viewshed/ViewshedPlacementRootPlugin.js +1 -1
  314. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  315. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +1 -0
  316. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  317. package/views/3d/input/handlers/DragRotate.js +1 -1
  318. package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
  319. package/views/3d/input/handlers/ground/GroundDoubleClickMove.js +1 -1
  320. package/views/3d/input/handlers/ground/GroundNavigation.js +1 -1
  321. package/views/3d/interactive/editingTools/manipulatedObjectUtils.js +1 -1
  322. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  323. package/views/3d/interactive/editingTools/tooltipUtils3D.js +1 -1
  324. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  325. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  326. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  327. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  328. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  329. package/views/3d/layers/support/FeatureMemory.js +2 -0
  330. package/views/3d/layers/support/FeatureTile.js +1 -1
  331. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  332. package/views/3d/layers/support/featureReference.js +1 -1
  333. package/views/3d/navigation/modes/GroundNavigationMode3D.js +1 -1
  334. package/views/3d/state/Constraints.js +1 -1
  335. package/views/3d/state/controllers/GroundNavigationController.js +1 -1
  336. package/views/3d/state/controllers/RotateController.js +1 -1
  337. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  338. package/views/3d/state/utils/OffsetCorrectionController.js +1 -1
  339. package/views/3d/support/engineContent/line.js +1 -1
  340. package/views/3d/support/planarDistanceToGroundRatio.js +2 -0
  341. package/views/3d/support/popupHitTest.js +1 -1
  342. package/views/3d/terrain/OverlayManager.js +1 -1
  343. package/views/3d/terrain/OverlayRenderer.js +1 -1
  344. package/views/3d/terrain/TerrainSurface.js +1 -1
  345. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +13 -13
  346. package/views/3d/webgl-engine/core/shaderLibrary/shading/MarkerSizing.glsl.js +2 -2
  347. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.glsl.js +1 -1
  348. package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
  349. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  350. package/views/3d/webgl-engine/lib/GaussianSplatRenderUtils.js +1 -1
  351. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  352. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  353. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  354. package/views/3d/webgl-engine/materials/stippleTextureRepository.js +1 -1
  355. package/views/DOMContainer.d.ts +2 -2
  356. package/views/DOMContainer.js +1 -1
  357. package/views/PopupView.d.ts +1 -1
  358. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  359. package/views/analysis/LengthDimensionResult.d.ts +4 -1
  360. package/views/draw/support/managers/TooltipManager.js +1 -1
  361. package/views/interactive/options/SnappingOptions.d.ts +4 -2
  362. package/views/interactive/options/SnappingOptions.js +1 -1
  363. package/views/interactive/options/ViewOptions.d.ts +18 -0
  364. package/views/interactive/options/bindViewToolOptions.js +2 -0
  365. package/views/interactive/snapping/SnappingManagerPool.js +1 -1
  366. package/views/interactive/snapping/allLayerSnapping.js +1 -1
  367. package/views/interactive/tooltip/components/ElevationModeSelect.js +2 -0
  368. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  369. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  370. package/views/interactive/tooltip/infos/DynamicTooltipInfo.js +1 -1
  371. package/views/interactive/tooltip/infos/SketchTooltipInfo.js +1 -1
  372. package/views/overlay/FocusRegionOverlayItem.js +1 -1
  373. package/views/selection/SelectionOperation.d.ts +27 -1
  374. package/views/selection/types.d.ts +8 -20
  375. package/views/support/hitTestSelectUtils.js +1 -1
  376. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.d.ts +1 -0
  377. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  378. package/widgets/AreaMeasurement2D.js +1 -1
  379. package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -0
  380. package/widgets/BasemapLayerList.d.ts +1 -0
  381. package/widgets/BasemapToggle/BasemapToggleViewModel.d.ts +1 -0
  382. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  383. package/widgets/BasemapToggle.js +1 -1
  384. package/widgets/BatchAttributeForm/expressions/types.d.ts +1 -0
  385. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +9 -1
  386. package/widgets/BatchAttributeForm/types.d.ts +5 -1
  387. package/widgets/BatchAttributeForm.d.ts +1 -0
  388. package/widgets/Bookmarks/BookmarksViewModel.d.ts +1 -0
  389. package/widgets/Bookmarks.d.ts +1 -0
  390. package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +1 -0
  391. package/widgets/CatalogLayerList.d.ts +1 -0
  392. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +1 -0
  393. package/widgets/DirectionalPad/DirectionalPadViewModel.js +1 -1
  394. package/widgets/DirectionalPad.js +1 -1
  395. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.d.ts +1 -0
  396. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  397. package/widgets/DistanceMeasurement2D.js +1 -1
  398. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  399. package/widgets/Editor/legacy/UpdateFeatureWorkflow.js +1 -1
  400. package/widgets/Editor/workflowUtils.js +1 -1
  401. package/widgets/Editor.d.ts +1 -0
  402. package/widgets/FeatureForm.d.ts +1 -0
  403. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +14 -0
  404. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  405. package/widgets/FeatureTable/support/FeatureStore.d.ts +14 -0
  406. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  407. package/widgets/FeatureTable.d.ts +1 -0
  408. package/widgets/FeatureTemplates.d.ts +1 -0
  409. package/widgets/Features/FeaturesViewModel.d.ts +1 -0
  410. package/widgets/Features.d.ts +2 -1
  411. package/widgets/HistogramRangeSlider.d.ts +1 -0
  412. package/widgets/Home/HomeViewModel.d.ts +1 -0
  413. package/widgets/Home.d.ts +1 -0
  414. package/widgets/LayerList/LayerListViewModel.d.ts +1 -0
  415. package/widgets/LayerList.d.ts +1 -0
  416. package/widgets/Locate/LocateViewModel.d.ts +1 -0
  417. package/widgets/Locate.d.ts +1 -0
  418. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  419. package/widgets/OrientedImageryViewer/navigation/NavigationManagerPanoramic.js +1 -1
  420. package/widgets/OrientedImageryViewer/types.d.ts +4 -1
  421. package/widgets/OrientedImageryViewer.d.ts +4 -1
  422. package/widgets/Popup/types.d.ts +0 -7
  423. package/widgets/Popup.d.ts +8 -7
  424. package/widgets/Print/PrintViewModel.d.ts +1 -0
  425. package/widgets/Print.d.ts +1 -0
  426. package/widgets/Search.d.ts +1 -0
  427. package/widgets/Sketch.d.ts +1 -0
  428. package/widgets/Slider.d.ts +4 -0
  429. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +2 -0
  430. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  431. package/widgets/TimeSlider.d.ts +1 -0
  432. package/widgets/TimeSlider.js +1 -1
  433. package/widgets/Track/TrackViewModel.d.ts +1 -0
  434. package/widgets/Track.d.ts +1 -0
  435. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +1 -0
  436. package/widgets/UtilityNetworkTrace.d.ts +1 -0
  437. package/widgets/ValuePicker/types.d.ts +1 -0
  438. package/widgets/ValuePicker.d.ts +1 -0
  439. package/widgets/smartMapping/SmartMappingSliderBase.d.ts +1 -0
  440. package/widgets/support/SelectionList/types.d.ts +2 -0
  441. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +2 -1
  442. package/assets/esri/core/workers/chunks/0148cb611bf7c8c5fe8a.js +0 -1
  443. package/assets/esri/core/workers/chunks/0a4a5ed831a4e4d8e0fc.js +0 -1
  444. package/assets/esri/core/workers/chunks/0acc754907395e83bbc6.js +0 -1
  445. package/assets/esri/core/workers/chunks/0f8ff964461cf8e0673b.js +0 -1
  446. package/assets/esri/core/workers/chunks/1e46703cb566c25458ad.js +0 -1
  447. package/assets/esri/core/workers/chunks/25c90092def215949db9.js +0 -1
  448. package/assets/esri/core/workers/chunks/2a34760b3f0c134898ec.js +0 -1
  449. package/assets/esri/core/workers/chunks/38890ac5917942374ab8.js +0 -1
  450. package/assets/esri/core/workers/chunks/3b4ceaf21be540cb3499.js +0 -1
  451. package/assets/esri/core/workers/chunks/4c4ba466e23159991322.js +0 -1
  452. package/assets/esri/core/workers/chunks/5afc12671a9a1bb6c56c.js +0 -1
  453. package/assets/esri/core/workers/chunks/606ac9358f508bda94f2.js +0 -1
  454. package/assets/esri/core/workers/chunks/6c3535aa7250c08b9e5b.js +0 -1
  455. package/assets/esri/core/workers/chunks/6c4def0faaef861a09c9.js +0 -1
  456. package/assets/esri/core/workers/chunks/7285a37cd5359aa4bac5.js +0 -1
  457. package/assets/esri/core/workers/chunks/753d1ff177ecee8e2377.js +0 -1
  458. package/assets/esri/core/workers/chunks/8a8e94b5d7d153361b0b.js +0 -1
  459. package/assets/esri/core/workers/chunks/923c45ebcf45d9ce8ae0.js +0 -1
  460. package/assets/esri/core/workers/chunks/9af36ee6a0df224859bc.js +0 -1
  461. package/assets/esri/core/workers/chunks/a7ce5b958dfeb240c4a5.js +0 -1
  462. package/assets/esri/core/workers/chunks/aed479c14d93955f4798.js +0 -1
  463. package/assets/esri/core/workers/chunks/be52c319a0a81ce1ba36.js +0 -1
  464. package/assets/esri/core/workers/chunks/c0ec87800faf99cbd8bd.js +0 -1
  465. package/assets/esri/core/workers/chunks/ca5a4f62b09cc8579dc0.js +0 -1
  466. package/assets/esri/core/workers/chunks/d090baaa974e1e83fa44.js +0 -1
  467. package/assets/esri/core/workers/chunks/e9f8325a4cf89ae816cc.js +0 -1
  468. package/assets/esri/core/workers/chunks/ed7d4e8725aaa0ca4589.js +0 -1
  469. package/assets/esri/core/workers/chunks/f4572ad25712d204f258.js +0 -1
  470. package/layers/geospatialPDF/GeospatialPDFParserUtils.js +0 -2
  471. package/layers/geospatialPDF/Projection.js +0 -2
  472. package/views/2d/engine/webgl/mesh/bufcut.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{EsriPromise as i}from"../../../../core/Promise.js";import{initial as s,sync as o,watch as n,whenOnce as l}from"../../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{FeatureTileController3D as u}from"../../../../layers/graphics/controllers/FeatureTileController3D.js";import{symbolHasExtrudeSymbolLayer as d}from"../../../../symbols/support/utils.js";import{elevationAlignPointsInFeatures as c}from"./elevationAlignPointsInFeatures.js";import{Graphics3DFeatureProcessor as y}from"./Graphics3DFeatureProcessor.js";import{QueryEngine as g}from"./QueryEngine.js";import{QueryEngineContext as m}from"./QueryEngineContext.js";import{queryForSymbologySnapping as f}from"./queryForSymbologySnapping.js";import{HeatmapFeatureProcessor as w}from"../support/HeatmapFeatureProcessor.js";import{LayerViewPerformanceInfo as E}from"../support/LayerViewPerformanceInfo.js";import{hasLayerBasedScaleVisibility as b}from"../../../support/layerViewUtils.js";import{TaskPriority as V}from"../../../support/Scheduler.js";let F=class extends i{constructor(e){super(e),this._dataUpdatingState=0,this.graphicsQuery={queryForSymbologySnapping:async(e,t)=>this.symbologySnappingSupported?f(this.graphics3DProcessor,e,t):{candidates:[],sourceCandidateIndices:[]},executeQuery:(e,t)=>this.queryEngine.executeQuery(e,t),executeQueryForIds:(e,t)=>this.queryEngine.executeQueryForIds(e,t),executeQueryForCount:(e,t)=>this.queryEngine.executeQueryForCount(e,t),executeQueryForExtent:(e,t)=>this.queryEngine.executeQueryForExtent(e,t),executeQueryForLatestObservations:(e,t)=>this.queryEngine.executeQueryForLatestObservations(e,t),executeAttributeBinsQuery:(e,t)=>this.queryEngine.executeAttributeBinsQuery(e,t)},this.controller=null,this.updatingHandles=new h,this._controllerCreated=!1,this._pendingController=null}initialize(){this.addResolvingPromise(this._initializeController()),this.updatingHandles.add(()=>this.layer.renderer,e=>this._recreateProcessor(e),s),this.updatingHandles.add(()=>this.updatePolicy,e=>this.processor.preferredUpdatePolicy=e),this.updatingHandles.add(()=>this.layerView.availableFields,()=>this.queryEngine?.clear(),o);const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:n,resourceController:l}=t,a=new m(n,e,l,()=>this.processor.featureStore,i,r,()=>this.layerView.availableFields);this.queryEngine=new g({context:a,priority:V.FEATURE_QUERY_ENGINE})}destroy(){this.removeAllHandles(),this.updatingHandles.destroy(),this._destroyPendingController(),this.controller=r(this.controller),this.processor=r(this.processor),this.queryEngine=r(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=r(this._pendingController)}get updating(){return this.updatingHandles.updating||!this._controllerCreated||this.controller?.updating||this.processor?.updating}get legendEnabled(){return this.processor.legendEnabled}get layer(){return this.layerView.layer}get layerViewUid(){return this.layerView.uid}get view(){return this.layerView.view}get hasZ(){return this.layerView.hasZ}get hasM(){return this.layerView.hasM}get fullOpacity(){return this.layerView.fullOpacity}get suspended(){return this.layerView.suspended}get filter(){return"filter"in this.layerView?this.layerView.filter:null}get effectiveDisplayFilter(){return"effectiveDisplayFilter"in this.layerView?this.layerView.effectiveDisplayFilter:null}get highlightIds(){return"highlightIds"in this.layerView?this.layerView.highlightIds:null}get slicePlaneEnabled(){return this.layerView.slicePlaneEnabled}get featureSpatialReference(){return"featureSpatialReference"in this.layerView?this.layerView.featureSpatialReference:null}get graphics3DProcessor(){return"graphics-3d"===this.processor?.type?this.processor:null}get heatmapProcessor(){return"heatmap"===this.processor?.type?this.processor:null}get hasAllFeatures(){return!(!this.controller||!("hasAllFeatures"in this.controller))&&this.controller.hasAllFeatures}get hasAllFeaturesInView(){return!(!this.controller||!("hasAllFeaturesInView"in this.controller))&&this.controller.hasAllFeaturesInView}get hasFullGeometries(){return!(!this.controller||!("hasFullGeometries"in this.controller))&&this.controller.hasFullGeometries}get symbologySnappingSupported(){return this.layer?.renderer?.symbols?.some(d)??!1}get updatePolicy(){return 1}get scaleVisibilitySuspended(){return this.processor?.scaleVisibilitySuspended}get timeExtent(){return"timeExtent"in this.layerView?this.layerView.timeExtent:null}get dataUpdating(){return 0!==this._dataUpdatingState}get suspendInfo(){return this.processor?.suspendInfo??{}}forEachGraphic(e){this.loadedGraphics.forEach(e)}findGraphic(e){return this.loadedGraphics.find(e)}queryObjectIds(e,t){return this.layerView.queryObjectIds(e,t)}whenGraphicBounds(e,t){return this.processor?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,r){const i=this.graphics3DProcessor;if(null==i)throw new t("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return c(this.view,this.layer,e=>i.getGraphics3DGraphicByObjectId(e),e,r)}highlightByGraphics(e,t){return this.processor.highlightByGraphics(e,t)}highlightByObjectIds(e,t){return this.processor.highlightByObjectIds(e,this.layer.objectIdField,t)}maskOccludee(e){return this.processor.maskOccludee(e)}notifyContentGeometryUpdate(){this.layerView.emit("visible-geometry-changed")}async _initializeController(){const e=this.createController();this._pendingController=e,this._setupDataUpdating(e),await e.when(),this._setControllerWhenInitialized(e)}_setupDataUpdating(e){"dataUpdating"in e&&this.addHandles([n(()=>e.dataUpdating,e=>{e&&0===this._dataUpdatingState?this._dataUpdatingState=1:e||1!==this._dataUpdatingState||(this._dataUpdatingState=0)},o),n(()=>!!this.graphics3DProcessor?.dataUpdating,t=>{t&&1===this._dataUpdatingState?this._dataUpdatingState=2:t||2!==this._dataUpdatingState||(this._dataUpdatingState=e.dataUpdating?1:0)},o)])}async _setControllerWhenInitialized(e){try{await this.when()}catch(t){}this._controllerCreated=!0,this.isResolved()&&!this.destroyed?(await l(()=>this.view?.groundView?.ready),this.beforeSetController(e),this._pendingController=null,this.controller=e,this.loadedGraphics=e.graphics):this._destroyPendingController()}_recreateProcessor(e){const t="heatmap"===e?.type,r="heatmap"===this.processor?.type,i=this.processor;if(i&&t===r)return;const s=t?new w({owner:this}):new y({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!b(),filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this.processor=s,i?.destroy(),this.queryEngine?.clear(),this.addResolvingPromise(s.when())}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}get usedMemory(){return this.processor?.usedMemory??0}get performanceInfo(){const e=this.controller instanceof u?this.controller:null;return new E(this.usedMemory,this.loadedGraphics?.length,e?.serviceDataCount??-1,e?.maximumNumberOfFeatures??-1,0,this.processor.performanceInfo)}};e([a()],F.prototype,"updating",null),e([a()],F.prototype,"legendEnabled",null),e([a()],F.prototype,"layerView",void 0),e([a()],F.prototype,"layer",null),e([a()],F.prototype,"layerViewUid",null),e([a()],F.prototype,"view",null),e([a()],F.prototype,"hasZ",null),e([a()],F.prototype,"hasM",null),e([a()],F.prototype,"fullOpacity",null),e([a()],F.prototype,"suspended",null),e([a()],F.prototype,"filter",null),e([a()],F.prototype,"effectiveDisplayFilter",null),e([a()],F.prototype,"highlightIds",null),e([a()],F.prototype,"slicePlaneEnabled",null),e([a()],F.prototype,"featureSpatialReference",null),e([a()],F.prototype,"loadedGraphics",void 0),e([a()],F.prototype,"graphics3DProcessor",null),e([a()],F.prototype,"heatmapProcessor",null),e([a()],F.prototype,"hasAllFeatures",null),e([a()],F.prototype,"hasAllFeaturesInView",null),e([a()],F.prototype,"hasFullGeometries",null),e([a()],F.prototype,"symbologySnappingSupported",null),e([a()],F.prototype,"updatePolicy",null),e([a()],F.prototype,"scaleVisibilitySuspended",null),e([a()],F.prototype,"timeExtent",null),e([a()],F.prototype,"_dataUpdatingState",void 0),e([a({readOnly:!0})],F.prototype,"dataUpdating",null),e([a()],F.prototype,"controller",void 0),e([a()],F.prototype,"processor",void 0),e([a()],F.prototype,"updatingHandles",void 0),e([a()],F.prototype,"_controllerCreated",void 0),F=e([p("esri.views.3d.layers.graphics.Graphics3DGraphicsPipeline")],F);export{F as Graphics3DGraphicsPipeline};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Error.js";import{destroyMaybe as r}from"../../../../core/maybe.js";import{EsriPromise as i}from"../../../../core/Promise.js";import{initial as s,sync as o,watch as n,whenOnce as l}from"../../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../../core/accessorSupport/decorators.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{FeatureTileController3D as u}from"../../../../layers/graphics/controllers/FeatureTileController3D.js";import{symbolHasExtrudeSymbolLayer as d}from"../../../../symbols/support/utils.js";import{elevationAlignPointsInFeatures as c}from"./elevationAlignPointsInFeatures.js";import{Graphics3DFeatureProcessor as y}from"./Graphics3DFeatureProcessor.js";import{QueryEngine as g}from"./QueryEngine.js";import{QueryEngineContext as m}from"./QueryEngineContext.js";import{queryForSymbologySnapping as f}from"./queryForSymbologySnapping.js";import{HeatmapFeatureProcessor as w}from"../support/HeatmapFeatureProcessor.js";import{LayerViewPerformanceInfo as E}from"../support/LayerViewPerformanceInfo.js";import{hasLayerBasedScaleVisibility as b}from"../../../support/layerViewUtils.js";import{TaskPriority as V}from"../../../support/Scheduler.js";let F=class extends i{constructor(e){super(e),this._dataUpdatingState=0,this.graphicsQuery={queryForSymbologySnapping:async(e,t)=>this.symbologySnappingSupported?f(this.graphics3DProcessor,e,t):{candidates:[],sourceCandidateIndices:[]},executeQuery:(e,t)=>this.queryEngine.executeQuery(e,t),executeQueryForIds:(e,t)=>this.queryEngine.executeQueryForIds(e,t),executeQueryForCount:(e,t)=>this.queryEngine.executeQueryForCount(e,t),executeQueryForExtent:(e,t)=>this.queryEngine.executeQueryForExtent(e,t),executeQueryForLatestObservations:(e,t)=>this.queryEngine.executeQueryForLatestObservations(e,t),executeAttributeBinsQuery:(e,t)=>this.queryEngine.executeAttributeBinsQuery(e,t)},this.controller=null,this.updatingHandles=new h,this._controllerCreated=!1,this._pendingController=null}get reportGraphicSourceMemory(){return!0}initialize(){this.addResolvingPromise(this._initializeController()),this.updatingHandles.add(()=>this.layer.renderer,e=>this._recreateProcessor(e),s),this.updatingHandles.add(()=>this.updatePolicy,e=>this.processor.preferredUpdatePolicy=e),this.updatingHandles.add(()=>this.layerView.availableFields,()=>this.queryEngine?.clear(),o);const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:n,resourceController:l}=t,a=new m(n,e,l,()=>this.processor.featureStore,i,r,()=>this.layerView.availableFields);this.queryEngine=new g({context:a,priority:V.FEATURE_QUERY_ENGINE})}destroy(){this.removeAllHandles(),this.updatingHandles.destroy(),this._destroyPendingController(),this.controller=r(this.controller),this.processor=r(this.processor),this.queryEngine=r(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=r(this._pendingController)}get updating(){return this.updatingHandles.updating||!this._controllerCreated||this.controller?.updating||this.processor?.updating}get legendEnabled(){return this.processor.legendEnabled}get layer(){return this.layerView.layer}get layerViewUid(){return this.layerView.uid}get view(){return this.layerView.view}get hasZ(){return this.layerView.hasZ}get hasM(){return this.layerView.hasM}get fullOpacity(){return this.layerView.fullOpacity}get suspended(){return this.layerView.suspended}get filter(){return"filter"in this.layerView?this.layerView.filter:null}get effectiveDisplayFilter(){return"effectiveDisplayFilter"in this.layerView?this.layerView.effectiveDisplayFilter:null}get highlightIds(){return"highlightIds"in this.layerView?this.layerView.highlightIds:null}get slicePlaneEnabled(){return this.layerView.slicePlaneEnabled}get featureSpatialReference(){return"featureSpatialReference"in this.layerView?this.layerView.featureSpatialReference:null}get graphics3DProcessor(){return"graphics-3d"===this.processor?.type?this.processor:null}get heatmapProcessor(){return"heatmap"===this.processor?.type?this.processor:null}get hasAllFeatures(){return!(!this.controller||!("hasAllFeatures"in this.controller))&&this.controller.hasAllFeatures}get hasAllFeaturesInView(){return!(!this.controller||!("hasAllFeaturesInView"in this.controller))&&this.controller.hasAllFeaturesInView}get hasFullGeometries(){return!(!this.controller||!("hasFullGeometries"in this.controller))&&this.controller.hasFullGeometries}get symbologySnappingSupported(){return this.layer?.renderer?.symbols?.some(d)??!1}get updatePolicy(){return 1}get scaleVisibilitySuspended(){return this.processor?.scaleVisibilitySuspended}get timeExtent(){return"timeExtent"in this.layerView?this.layerView.timeExtent:null}get dataUpdating(){return 0!==this._dataUpdatingState}get suspendInfo(){return this.processor?.suspendInfo??{}}forEachGraphic(e){this.loadedGraphics.forEach(e)}findGraphic(e){return this.loadedGraphics.find(e)}queryObjectIds(e,t){return this.layerView.queryObjectIds(e,t)}whenGraphicBounds(e,t){return this.processor?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,r){const i=this.graphics3DProcessor;if(null==i)throw new t("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return c(this.view,this.layer,e=>i.getGraphics3DGraphicByObjectId(e),e,r)}highlightByGraphics(e,t){return this.processor.highlightByGraphics(e,t)}highlightByObjectIds(e,t){return this.processor.highlightByObjectIds(e,this.layer.objectIdField,t)}maskOccludee(e){return this.processor.maskOccludee(e)}notifyContentGeometryUpdate(){this.layerView.emit("visible-geometry-changed")}async _initializeController(){const e=this.createController();this._pendingController=e,this._setupDataUpdating(e),await e.when(),this._setControllerWhenInitialized(e)}_setupDataUpdating(e){"dataUpdating"in e&&this.addHandles([n(()=>e.dataUpdating,e=>{e&&0===this._dataUpdatingState?this._dataUpdatingState=1:e||1!==this._dataUpdatingState||(this._dataUpdatingState=0)},o),n(()=>!!this.graphics3DProcessor?.dataUpdating,t=>{t&&1===this._dataUpdatingState?this._dataUpdatingState=2:t||2!==this._dataUpdatingState||(this._dataUpdatingState=e.dataUpdating?1:0)},o)])}async _setControllerWhenInitialized(e){try{await this.when()}catch(t){}this._controllerCreated=!0,this.isResolved()&&!this.destroyed?(await l(()=>this.view?.groundView?.ready),this.beforeSetController(e),this._pendingController=null,this.controller=e,this.loadedGraphics=e.graphics):this._destroyPendingController()}_recreateProcessor(e){const t="heatmap"===e?.type,r="heatmap"===this.processor?.type,i=this.processor;if(i&&t===r)return;const s=t?new w({owner:this}):new y({owner:this,reportGraphicSourceMemory:this.reportGraphicSourceMemory,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!b(),filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:e=>this._updateClippingExtent(e)});this.processor=s,i?.destroy(),this.queryEngine?.clear(),this.addResolvingPromise(s.when())}_updateClippingExtent(e){if(this.clippingExtent=e,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=e,!0}}get usedMemory(){return this.processor?.usedMemory??0}get performanceInfo(){const e=this.controller instanceof u?this.controller:null;return new E(this.usedMemory,this.loadedGraphics?.length,e?.serviceDataCount??-1,e?.maximumNumberOfFeatures??-1,0,this.processor.performanceInfo)}};e([a()],F.prototype,"updating",null),e([a()],F.prototype,"legendEnabled",null),e([a()],F.prototype,"layerView",void 0),e([a()],F.prototype,"layer",null),e([a()],F.prototype,"layerViewUid",null),e([a()],F.prototype,"view",null),e([a()],F.prototype,"hasZ",null),e([a()],F.prototype,"hasM",null),e([a()],F.prototype,"fullOpacity",null),e([a()],F.prototype,"suspended",null),e([a()],F.prototype,"filter",null),e([a()],F.prototype,"effectiveDisplayFilter",null),e([a()],F.prototype,"highlightIds",null),e([a()],F.prototype,"slicePlaneEnabled",null),e([a()],F.prototype,"featureSpatialReference",null),e([a()],F.prototype,"loadedGraphics",void 0),e([a()],F.prototype,"graphics3DProcessor",null),e([a()],F.prototype,"heatmapProcessor",null),e([a()],F.prototype,"hasAllFeatures",null),e([a()],F.prototype,"hasAllFeaturesInView",null),e([a()],F.prototype,"hasFullGeometries",null),e([a()],F.prototype,"symbologySnappingSupported",null),e([a()],F.prototype,"updatePolicy",null),e([a()],F.prototype,"scaleVisibilitySuspended",null),e([a()],F.prototype,"timeExtent",null),e([a()],F.prototype,"_dataUpdatingState",void 0),e([a({readOnly:!0})],F.prototype,"dataUpdating",null),e([a()],F.prototype,"controller",void 0),e([a()],F.prototype,"processor",void 0),e([a()],F.prototype,"updatingHandles",void 0),e([a()],F.prototype,"_controllerCreated",void 0),F=e([p("esri.views.3d.layers.graphics.Graphics3DGraphicsPipeline")],F);export{F as Graphics3DGraphicsPipeline};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"../../../../core/has.js";import{estimateAttributesMemory as e}from"../../../../core/memoryEstimations.js";import{signal as t}from"../../../../core/signal.js";import{estimateGeometryMemory as r}from"../../../../layers/graphics/dehydratedFeatures.js";class s{constructor(){this._payloads=new Map,this._usedMemory=t(0),this._duplicatedMemory=t(0),this._referenceCount=t(0)}get usedMemory(){return this._usedMemory.value}get usedMemoryPerFeature(){return this._referenceCount.value>0?this._duplicatedMemory.value/this._referenceCount.value:0}ref(t){this._duplicatedMemory.value+=this._refPayload(t.geometry,r)+this._refPayload(t.attributes,e),this._referenceCount.value++}unref(e){this._duplicatedMemory.value-=this._unrefPayload(e.geometry)+this._unrefPayload(e.attributes),this._referenceCount.value--}_refPayload(e,t){if(null==e)return 0;const r=this._payloads.get(e);if(r)return r.count++,r.size;const s=t(e);return this._payloads.set(e,new o(s)),this._usedMemory.value+=s,s}_unrefPayload(e){if(null==e)return 0;const t=this._payloads.get(e);return 0===--t.count&&(this._payloads.delete(e),this._usedMemory.value-=t.size),t.size}get test(){}}class o{constructor(e){this.size=e,this.count=1}}export{s as FeatureMemory};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{shuffle as t}from"../../../../core/arrayUtils.js";import{baseObjectMemory as e}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{create as i,diameter as r}from"../../../../geometry/support/aaBoundingBox.js";import{create as a,fromExtent as u,intersects as h,copy as n,positiveInfinity as l,intersection as m}from"../../../../geometry/support/aaBoundingRect.js";import{numVertices as f,estimateSize as o,getObjectId as d,computeAABB as c}from"../../../../layers/graphics/dehydratedFeatures.js";import{computeMaxZ as _}from"../graphics/graphicUtils.js";import{SampledGeometryMaxDistanceRatio as g}from"./SampledGeometryMaxDistanceRatio.js";const F=16438;class p{constructor(t){this.descriptor=t,this._numVertices=0,this.exceededTransferLimit=s(!1),this._fetchFailed=s(!1),this._sorted=!1,this._numFeatures=s(y),this._emptyFeatureRatio=s(0),this._estimatedSize=-1,this._estimatedUnusedSize=0,this._estimatedUnusedSizeDirty=!1,this._sampledDensityEstimate=-1,this._displayingFeatures=null,this.alive=!0,this.filtered=!1,this._features=null,this._featuresLength=s(0),this._featureLimit=s(0),this._fetchStatus=0,this.fetchInformation=s(""),this.fetchingResolution=this.displayingResolution=t.resolution}get featuresMissing(){return this.fetchFailed||(this.hasPreciseFeatureCount?this._featuresLength.value<this.numFeatures:this.exceededTransferLimit.value)}get showsAllFeatures(){return!this.fetchFailed&&null!=this.displayingFeatures&&(this.hasPreciseFeatureCount?this.displayingFeatures.length===this.numFeatures:!this.exceededTransferLimit.value)}get missingAttributes(){return this._missingAttributes}get fetchFailed(){return this._fetchFailed.value}set fetchFailed(t){this._fetchFailed.value=t}get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(t){this._displayingFeatures=t,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){const t=this.isFetched&&this.featuresMissing;return!this.filtered&&(t||this.hasFeatureLimit)}get features(){return this._features}get featureLimit(){return this._featureLimit.value}set featureLimit(t){this._featureLimit.value!==t&&(this._featureLimit.value=t,this._estimatedUnusedSizeDirty=!0)}get hasFeatureLimit(){return this.featureLimit!==this._featuresLength.value}get availableFields(){return this._availableFields}setFeatures(t,e,s,i){this._availableFields=s,this._features=t,this._featuresLength.value=t?.length??0,this._sorted=!1,this._estimatedSize=-1,this._estimatedUnusedSizeDirty=!0,this._sampledDensityEstimate=-1,this._missingAttributes=i,t&&t.length>0?(this._emptyFeatureRatio.value=e/(t.length+e),this._numVertices=t.reduce((t,e)=>t+f(e.geometry),0)):(this._emptyFeatureRatio.value=0,this._numVertices=0)}computeZQuantizationFactor(){if(this._features&&this._features.length>0){const t=this._features.reduce((t,{geometry:e})=>Math.max(t,_(e)??0),0);return Math.floor(t/this.descriptor.planetRadius)+1}return 1}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures.value:this._features?this._featuresLength.value:0}set numFeatures(t){this._numFeatures.value=t}get hasPreciseFeatureCount(){return this._numFeatures.value>y}get needsFeatureCount(){return this._numFeatures.value===y}get numVertices(){return this._numVertices}get id(){return this.descriptor.id}get estimatedSize(){return this.updateEstimates(),this._estimatedSize}get sampledDensityEstimate(){return this._sampledDensityEstimate}get estimatedUnusedSize(){return this._estimatedUnusedSize}updateEstimates(){if(this._estimatedSize<0||this._sampledDensityEstimate<0){this._estimatedSize=0,this._estimatedUnusedSize=0,this._sampledDensityEstimate=0;const t=Math.floor(Math.sqrt(z));if(this._features){let e=null;const s=new g(z,R*this.fetchingResolution),i=this._features.length;for(let r=0;r<i;++r){const a=this._features[r],u=o(a);if(this._estimatedSize+=u,r>=this.featureLimit&&(this._estimatedUnusedSize+=u),!s.done){const u=i-r;if(r%Math.ceil(u/Math.max(1,Math.floor(Math.sqrt(s.numRemainingSamples))))===0){const i=Math.max(Math.floor(s.numRemainingSamples/u),t);s.sampleGeometry(a.geometry,e,i)}}e=a.geometry}s.numSamples>=x?this._sampledDensityEstimate=s.ratio:this._sampledDensityEstimate=0}return!0}if(this._estimatedUnusedSizeDirty){if(this._estimatedUnusedSize=0,this._estimatedUnusedSizeDirty=!1,this._features)for(let t=this.featureLimit;t<this._features.length;++t)this._estimatedUnusedSize+=o(this._features[t]);return!0}return!1}get fetchStatus(){return this._fetchStatus}requestFetch(){this._fetchStatus=0}requestRefetch(){this._fetchStatus=1}startFetch(){this._fetchStatus=this.needsRefetch?3:2}fetchDone(t){this._fetchStatus=t}get isFetching(){return 2===this._fetchStatus||3===this._fetchStatus}get isRefetching(){return 3===this._fetchStatus}get needsFetch(){return 0===this._fetchStatus||1===this._fetchStatus}get needsRefetch(){return 1===this._fetchStatus}get isFetched(){return 4===this._fetchStatus||5===this._fetchStatus}isFullyFetched(t){return!!this.features&&(this.features.length>=t||5===this.fetchStatus)}resetFetching(){this._fetchStatus=this.isRefetching?1:0}get needsDisplayUpdate(){return!!this._features&&!L(this._features,this.displayingFeatures,this.featureLimit)}intersects(t){return null==t||!this.descriptor.extent||(u(t,D),h(this.descriptor.extent,D))}intersectionIncludingBorrowed(t,e){const s=null!=this.extentIncludingBorrowedFeatures?this.extentIncludingBorrowedFeatures:this.descriptor.extent;return t||s?(null!=t?(u(t,e),m(e,s,e)):n(e,s),e):(n(e,l),e)}_shuffle(e){this._features?.sort((t,s)=>d(t,e)-d(s,e)),t(this._features,F)}_sortBySize(t){this._features?.sort((e,s)=>r(c(s.geometry,M))-r(c(e.geometry,M))||d(e,t)-d(s,t))}reduceFeatures(t,e,s,i){if(t<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let r=!1;this.featureLimit=Math.ceil(this.numFeatures*t),this.featureLimit>this._features.length&&4===this._fetchStatus&&this._features.length>0&&(this._fetchStatus=1,r=!0),!this._sorted&&t<1&&(1===i?this._shuffle(s):this._sortBySize(s),this._sorted=!0,this._estimatedUnusedSizeDirty=!0);const a=Math.max(this.featureLimit,Math.ceil(e*this.numFeatures));return this._features.length>a&&(this._features.length=this._featuresLength.value=a,this.exceededTransferLimit.value=!1,5===this._fetchStatus&&(this._fetchStatus=4)),r}get cache(){return new v(this,this._features,this._numFeatures.value,this._emptyFeatureRatio.value)}set cache(t){this.requestController=null,this._availableFields=t.availableFields,this._features=t.features,this._featuresLength.value=t.features?.length??0,this._numFeatures.value=t.numFeatures,this._emptyFeatureRatio.value=t.emptyFeatureRatio,this._fetchStatus=t.fetchStatus,this.exceededTransferLimit.value=t.exceededTransferLimit,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._estimatedUnusedSizeDirty=!0,this.fetchInformation.value=t.fetchInformation}}const y=-1,S=-2;class v{constructor(t,s,i,r){this.features=s,this.numFeatures=i,this.emptyFeatureRatio=r,this.usedMemory=e+t.estimatedSize,this.resolution=t.displayingResolution,this.availableFields=t.availableFields,this.fetchStatus=t.fetchStatus,this.exceededTransferLimit=t.exceededTransferLimit.value,this.fetchInformation=t.fetchInformation.value}}function L(t,e,s){if(null==e||null==t||s!==e.length||s>t.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}const z=150,x=100,R=2,D=a(),M=i();export{p as FeatureTile,v as FeatureTileCacheItem,S as failedFeatureCount};
2
+ import{shuffle as t}from"../../../../core/arrayUtils.js";import{baseObjectMemory as e}from"../../../../core/memoryEstimations.js";import{signal as s}from"../../../../core/signal.js";import{create as i,diameter as r}from"../../../../geometry/support/aaBoundingBox.js";import{create as a,fromExtent as h,intersects as u,copy as n,positiveInfinity as l,intersection as f}from"../../../../geometry/support/aaBoundingRect.js";import{numVertices as o,estimateSize as m,getObjectId as c,computeAABB as _}from"../../../../layers/graphics/dehydratedFeatures.js";import{computeMaxZ as d}from"../graphics/graphicUtils.js";import{SampledGeometryMaxDistanceRatio as g}from"./SampledGeometryMaxDistanceRatio.js";const F=16438;class p{constructor(t,e){this.descriptor=t,this._memory=e,this._numVertices=0,this.exceededTransferLimit=s(!1),this._fetchFailed=s(!1),this._sorted=!1,this._numFeatures=s(y),this._emptyFeatureRatio=s(0),this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._displayingFeatures=null,this.alive=!0,this.filtered=!1,this._features=null,this._featuresLength=s(0),this._featureLimit=s(0),this._fetchStatus=0,this.fetchInformation=s(""),this.fetchingResolution=this.displayingResolution=t.resolution}get featuresMissing(){return this.fetchFailed||(this.hasPreciseFeatureCount?this._featuresLength.value<this.numFeatures:this.exceededTransferLimit.value)}get showsAllFeatures(){return!this.fetchFailed&&null!=this.displayingFeatures&&(this.hasPreciseFeatureCount?this.displayingFeatures.length===this.numFeatures:!this.exceededTransferLimit.value)}get missingAttributes(){return this._missingAttributes}get fetchFailed(){return this._fetchFailed.value}set fetchFailed(t){this._fetchFailed.value=t}get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(t){this._displayingFeatures=t,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){const t=this.isFetched&&this.featuresMissing;return!this.filtered&&(t||this.hasFeatureLimit)}get features(){return this._features}get featureLimit(){return this._featureLimit.value}set featureLimit(t){this._featureLimit.value=t}get hasFeatureLimit(){return this.featureLimit!==this._featuresLength.value}get availableFields(){return this._availableFields}setFeatures(t,e,s,i){this._replaceFeatures(t),this._availableFields=s,this._featuresLength.value=t?.length??0,this._sorted=!1,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this._missingAttributes=i,t&&t.length>0?(this._emptyFeatureRatio.value=e/(t.length+e),this._numVertices=t.reduce((t,e)=>t+o(e.geometry),0)):(this._emptyFeatureRatio.value=0,this._numVertices=0)}computeZQuantizationFactor(){if(this._features&&this._features.length>0){const t=this._features.reduce((t,{geometry:e})=>Math.max(t,d(e)??0),0);return Math.floor(t/this.descriptor.planetRadius)+1}return 1}get emptyFeatureRatio(){return this._emptyFeatureRatio.value}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures.value:this._features?this._featuresLength.value:0}set numFeatures(t){this._numFeatures.value=t}get hasPreciseFeatureCount(){return this._numFeatures.value>y}get needsFeatureCount(){return this._numFeatures.value===y}get numVertices(){return this._numVertices}get id(){return this.descriptor.id}get estimatedSize(){return this.updateEstimates(),this._estimatedSize}get sampledDensityEstimate(){return this._sampledDensityEstimate}updateEstimates(){if(this._estimatedSize<0||this._sampledDensityEstimate<0){this._estimatedSize=0,this._sampledDensityEstimate=0;const t=Math.floor(Math.sqrt(x));if(this._features){let e=null;const s=new g(x,M*this.fetchingResolution),i=this._features.length;for(let r=0;r<i;++r){const a=this._features[r],h=m(a);if(this._estimatedSize+=h,!s.done){const h=i-r;if(r%Math.ceil(h/Math.max(1,Math.floor(Math.sqrt(s.numRemainingSamples))))===0){const i=Math.max(Math.floor(s.numRemainingSamples/h),t);s.sampleGeometry(a.geometry,e,i)}}e=a.geometry}s.numSamples>=R?this._sampledDensityEstimate=s.ratio:this._sampledDensityEstimate=0}return!0}return!1}get fetchStatus(){return this._fetchStatus}requestFetch(){this._fetchStatus=0}requestRefetch(){this._fetchStatus=1}startFetch(){this._fetchStatus=this.needsRefetch?3:2}fetchDone(t){this._fetchStatus=t}get isFetching(){return 2===this._fetchStatus||3===this._fetchStatus}get isRefetching(){return 3===this._fetchStatus}get needsFetch(){return 0===this._fetchStatus||1===this._fetchStatus}get needsRefetch(){return 1===this._fetchStatus}get isFetched(){return 4===this._fetchStatus||5===this._fetchStatus}isFullyFetched(t){return!!this.features&&(this.features.length>=t||5===this.fetchStatus)}resetFetching(){this._fetchStatus=this.isRefetching?1:0}get needsDisplayUpdate(){return!!this._features&&!L(this._features,this.displayingFeatures,this.featureLimit)}intersects(t){return null==t||!this.descriptor.extent||(h(t,z),u(this.descriptor.extent,z))}intersectionIncludingBorrowed(t,e){const s=null!=this.extentIncludingBorrowedFeatures?this.extentIncludingBorrowedFeatures:this.descriptor.extent;return t||s?(null!=t?(h(t,e),f(e,s,e)):n(e,s),e):(n(e,l),e)}_shuffle(e){this._features?.sort((t,s)=>c(t,e)-c(s,e)),t(this._features,F)}_sortBySize(t){this._features?.sort((e,s)=>r(_(s.geometry,E))-r(_(e.geometry,E))||c(e,t)-c(s,t))}reduceFeatures(t,e,s,i){if(t<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let r=!1;this.featureLimit=Math.ceil(this.numFeatures*t),this.featureLimit>this._features.length&&4===this._fetchStatus&&this._features.length>0&&(this._fetchStatus=1,r=!0),!this._sorted&&t<1&&(1===i?this._shuffle(s):this._sortBySize(s),this._sorted=!0);const a=Math.max(this.featureLimit,Math.ceil(e*this.numFeatures));if(this._features.length>a){for(let t=a;t<this._features.length;t++)this._memory.unref(this._features[t]);this._features.length=this._featuresLength.value=a,this._estimatedSize=-1,this.exceededTransferLimit.value=!1,5===this._fetchStatus&&(this._fetchStatus=4)}return r}get cache(){return new v(this,this._features,this._numFeatures.value,this._emptyFeatureRatio.value)}set cache(t){this._replaceFeatures(t.features),this.requestController=null,this._availableFields=t.availableFields,this._featuresLength.value=t.features?.length??0,this._numFeatures.value=t.numFeatures,this._emptyFeatureRatio.value=t.emptyFeatureRatio,this._fetchStatus=t.fetchStatus,this.exceededTransferLimit.value=t.exceededTransferLimit,this._estimatedSize=-1,this._sampledDensityEstimate=-1,this.fetchInformation.value=t.fetchInformation}_replaceFeatures(t){for(const e of t??[])this._memory.ref(e);for(const e of this._features??[])this._memory.unref(e);this._features=t}}const y=-1,S=-2;class v{constructor(t,s,i,r){this.features=s,this.numFeatures=i,this.emptyFeatureRatio=r,this.usedMemory=e+t.estimatedSize,this.resolution=t.displayingResolution,this.availableFields=t.availableFields,this.fetchStatus=t.fetchStatus,this.exceededTransferLimit=t.exceededTransferLimit.value,this.fetchInformation=t.fetchInformation.value}}function L(t,e,s){if(null==e||null==t||s!==e.length||s>t.length)return!1;for(let i=0;i<s;++i)if(t[i]!==e[i])return!1;return!0}const x=150,R=100,M=2,z=a(),E=i();export{p as FeatureTile,v as FeatureTileCacheItem,S as failedFeatureCount};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{filterInPlace as s}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{isAbortError as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import o from"../../../../core/ReactiveMap.js";import{on as l,watch as u}from"../../../../core/reactiveUtils.js";import{schedule as h}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{sqlAnd as c}from"../../../../core/sql.js";import{property as p,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{getEpsilon as _}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as m,equals as g,clone as y,expand as F,toExtent as T,width as x,height as v}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as R,hasVertices as E,computeAABR as b}from"../../../../layers/graphics/dehydratedFeatures.js";import C from"../../../../rest/support/QuantizationParameters.js";import D from"../../../../rest/support/Query.js";import{MultiFeatureReference as w,SingleFeatureReference as M}from"./featureReference.js";import{failedFeatureCount as U,FeatureTile as j}from"./FeatureTile.js";import{virtualDisplayFilterHighlightTileId as A,virtualSnapshotTileId as I}from"./FeatureTileDescriptor.js";import{tilesAreRelated as O}from"../../terrain/tileUtils.js";import{ImmediateTask as P,TaskPriority as z}from"../../../support/Scheduler.js";let q=class extends t{set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get readyToRun(){return this._dirty}get memoryForUnusedFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.estimatedUnusedSize),e}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}get showsAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(const e of this._featureTiles.values())if(!this.hasFullGeometries&&0!==e.emptyFeatureRatio||!e.showsAllFeatures)return!1;return!0}get hasFullGeometries(){if(!this._supportsResolution)return!0;const e=this.tileDescriptors?.some(Q);return e||!this.context.capabilities.supportsQuantization&&"polyline"!==this.context.geometryType}set filterExtent(e){if(null!=e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void i.getLogger(this).error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||null!=t&&e&&t.equals(e))return;const s=null!=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}_updateTileZQuantization(e){if(1===this.context.viewingMode){const t=e.computeZQuantizationFactor();this._zQuantizationFactor.value<t&&(this._zQuantizationFactor.value=t)}}get _tileZQuantization(){return this.context.isDraped?1:this._zQuantizationFactor.value}constructor(e){super(e),this._useTileCount=!1,this.dataUpdating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._zQuantizationFactor=d(1),this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._featureTiles=new o,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._dirty=!1,this._suspended=!0,this._pendingEdits=null,this._applyEditsTilesUpdated=!1,this.snappingComplexityExceeded=!0,this._isFetching=!1;const t=e.context;this._frameTask=t.scheduler?.registerTask(z.FEATURE_TILE_FETCHER,this)??P,this.FeatureReferenceClass=t.capabilities.supportsMultipleResolutions?w:M,this._objectIdField=t.objectIdField}initialize(){this.addHandles([l(()=>this.tileDescriptors,"change",()=>this._setDirty(),{onListenerAdd:()=>this._setDirty(),onListenerRemove:()=>this._setDirty()}),u(()=>this._tileZQuantization,()=>this.refetch())]),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._removeTile(e)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetchDisplayFilterHighlightTile(){const e=this._featureTiles.get(A);e&&(this._cancelFetchTile(e),this._resetFetchTile(e),this._setDirty())}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(e){for(const t of this._featureTiles.values()){const s=t.missingAttributes?.get(e);if(null!=s)return s}}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{null!=t.displayingFeatures&&0!==t.displayingFeatures.length&&(null==e?e=new Set(t.availableFields):e.forEach(s=>{t.availableFields?.has(s)||e.delete(s)}))}),null!=e?e:new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const s=t.edits.then(()=>e.result.catch(e=>{if(a(e))throw e;return null}).then(e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then(()=>e)):e).then(e=>(0===--t.count&&(this._pendingEdits===t&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause()),e)));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),r=new Set,a=this._objectIdField;e.forEach(({objectId:e,globalId:n})=>{(!e||e<0)&&t&&n&&(s||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(n,a,t)),null!=e&&e>=0&&r.add(e)}),this._featureTiles.forEach(e=>{if(!e.features)return;const t=e.features.filter(e=>!r.has(R(e,this._objectIdField)));t.length!==e.features.length&&(this._applyEditsTileUpdated(),e.setFeatures(t,0,e.availableFields,e.missingAttributes),this._updateTileZQuantization(e),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,s){if(null==e)return null;const i=this.features.find(t=>t.attributes?.[s]===e);return i?R(i,t):null}async _applyEditsAddUpdateFeatures(e,t,s){const{objectIdField:r,globalIdField:a}=this.context,n=a&&this.availableFields.has(a),o=new Set,l=new Set;for(const i of e){const e=i.objectId;null!=e&&o.add(e)}for(const{objectId:h,globalId:d}of t){let e=h;(null==e||e<0)&&a&&(n||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(d,r,a)),null!=e&&e>=0&&(o.add(e),l.add(e))}if(0===o.size)return;const u=[];this._featureTiles.forEach(e=>{const t=this._applyEditsAddUpdateTile(e,o,l,s);u.push(t)}),this._updated(),await Promise.allSettled(u)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;e.fetchingResolution=e.descriptor.resolution;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=Array.from(t);const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter(e=>!s.has(R(e,this._objectIdField)));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),this._applyEditsTileUpdated(),e.setFeatures(n,0,Z(e.availableFields,a.fields),V(e.missingAttributes,a.missingAttributes)),this._updateTileZQuantization(e),this._invalidateCounts())}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:J})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){const t=this._frameTask.processQueue(e);if(!this._dirty||!this.initialized)return t;this._dirty=!1;const s=this._featureTilesArray;if(this._markTilesNotAlive(s),!e.run(()=>this._addTiles(s,e))||!e.run(()=>this._filterExtentTiles(s,e))||!e.run(()=>this._removeTiles(s,e))||e.done)return void this._setDirty();const i=this._sortTiles(s);e.run(()=>this._showTiles(i,e))&&e.run(()=>this._fetchTiles(i,e))&&e.run(()=>this._updateMemoryEstimates(i,e))||this._setDirty(),this._updated(),this.updating||(this._updateMaximumNumberOfFeaturesExceeded(),this._updateSnappingComplexityExceeded(i))}_updateSnappingComplexityExceeded(e){let t=Y;for(const s of e){if(Q(s)||t<=0)break;if(!S(s)&&(t--,s.sampledDensityEstimate>W))return void(this.snappingComplexityExceeded=!0)}this.snappingComplexityExceeded=0===this._featureTiles.size}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!(this._suspended||!this.tileDescriptors)&&(this.tileDescriptors.forEach(s=>{const i=this._featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority),e}_showTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;e.reduceFeatures(t,this.memoryFactor,this._objectIdField,this._reduceMode)&&this._setDirty();const{numFeatures:i,fetchingResolution:r,descriptor:a,isFetched:n}=e;return this._supportsResolution&&i>0&&r!==a.resolution&&n&&(e.requestRefetch(),this._setDirty()),this._showTile(e)};for(const r of e)if(!t.run(()=>i(r))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let s=!1;for(const i of e){if(!i.needsFetch)continue;const e=null!=this.context.memoryCache?this.context.memoryCache.pop(i.id):null;if(e?.resolution!==i.displayingResolution){if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,()=>i.resetFetching(),()=>i.numFeatures=U),s=!0,t.madeProgress()}if(t.done)return!0}else i.cache=e,i.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(s)return t.hasProgressed;for(const r of e){if(!r.needsFetch)continue;const e=new AbortController,s=this._fetchTile(r,e.signal);if(this._handleRequest(r,s,e,e=>r.fetchDone(e),e=>{r.fetchFailed=!0,this.context.logFetchError(i.getLogger(this),e)}),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(e=>!t.run(()=>e.updateEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const s=new Array;this._featureTiles.forEach(i=>{null!=i.displayingFeatures&&0!==i.displayingFeatures.length&&(i.intersectionIncludingBorrowed(t,B),i.intersectionIncludingBorrowed(e,G),g(B,G)||s.push(i))}),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this._changes.updates;for(const i of e)if(null!=i.displayingFeatures)for(const e of i.displayingFeatures){const i=R(e,this._objectIdField);if(t.has(i))continue;t.add(i);const r=this._displayingFeatureReferences.get(i).feature;s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;if(this._paused||this._featureTiles.forEach(t=>t.isFetching?++e:0),this._isFetching=e>0,e>0||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set("dataUpdating",!1),this.updating){let t=0,s=0,i=0,r=0,a=0;const n=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=null!=e.displayingFeatures?e.displayingFeatures.length*n:0;a+=t-s}e.needsFetch?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)}),r+=e;let o=0,l=0;t?(l=t,o=Math.min(r*t/i,t)):(l=s,o=r),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set("updatingTotal",l),this._set("updatingRemaining",o),this._set("expectedFeatureDiff",a)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger?.update()}_updateMaximumNumberOfFeaturesExceeded(){for(const{perTileMaximumNumberOfFeaturesExceeded:e}of this._featureTiles.values())if(e)return void this._set("maximumNumberOfFeaturesExceeded",!0);this._set("maximumNumberOfFeaturesExceeded",!1)}_updateRatio(e){const t=L(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach(e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.isFullyFetched(t)||(this._cancelFetchTile(e),this._resetFetchTile(e))}),this._setDirty())}_addTile(e){const t=new j(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.displayingResolution;this._featureTiles.forEach(s=>{if(null!=s.displayingFeatures&&e!==s&&O(e.descriptor.lij,s.descriptor.lij)){null==e.displayingFeatures&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(e.extentIncludingBorrowedFeatures??=y(e.descriptor.extent),F(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i);const s=this._displayingFeatureReferences.get(R(i,this._objectIdField));s.ref(s.feature,t),this._numDisplayingFeatureReferences++}}})}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetch&&e.fetchDone(4):e.requestFetch()}_cancelFetchTile(e){const t=e.requestController;null!=t&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){e.numFeatures=await this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t}),this._updateRatio(this._featureTilesArray)}async _fetchTile(e,t){e.fetchFailed=!1;const s=this._maximumFeaturesForTile(e);if(s<=0)return e.hasPreciseFeatureCount&&0===e.numFeatures||(e.fetchFailed=!0),k(e),e.fetchInformation.value="Empty tile",4;const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(e.fetchingResolution=e.descriptor.resolution,N(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>D.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const a=this._createQuery(e);if(a.maxRecordCountFactor=r,e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}e.fetchInformation.value=`Single fetch\n${s} features`;const{features:o,exceededTransferLimit:l,fields:u,missingAttributes:h}=await this._queryFeatures(a,t),d=l||a.maxRecordCountFactor>=D.MAX_MAX_RECORD_COUNT_FACTOR||s===this._totalFeaturesForTile(e)?5:4,c=await this._frameTask.schedule(()=>{e.exceededTransferLimit.value=!!l;const t=this._removeEmptyFeatures(o,this._getEffectiveTileResolution(e));return e.fetchInformation.value=`Single fetch\n${o.length}/${s} features`,e.setFeatures(o,t,H(u),V(void 0,h)),this._updateTileZQuantization(e),this._maximumFeaturesForTile(e)>s?1:d},t);return n(t),this._invalidateCounts(),c}async _fetchPagedTile(e,t){let s,i=0,r=0,a=0,o=this._maximumFeaturesForTile(e)-a;const l=this._getMaxRecordCount(e);let u,h=null;for(;;){const d=this._createQuery(e),c=this._setPagingParameters(d,i,o,l);e.fetchInformation.value=`Paged fetch\n${e.features?.length}/${o} features`;const{features:p,exceededTransferLimit:f,fields:_,missingAttributes:m}=await this._queryFeatures(d,t);if(await this._frameTask.schedule(()=>{c&&(i+=d.num),a+=p.length,r+=this._removeEmptyFeatures(p,this._getEffectiveTileResolution(e)),e.exceededTransferLimit.value=!!f,s=s?.concat(p)??p,h=Z(h,_),u=V(u,m),e.setFeatures(s,r,h,u),this._updateTileZQuantization(e),this._invalidateCounts(),this._setDirty()},t),n(t),o=this._maximumFeaturesForTile(e)-(s?.length??0),!c||!f||o<=0)return f?4:5}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery();if(t.resultType=this._resultType(e),!N(e)&&e.descriptor.extent&&this.context.tilingScheme&&(t.geometry=T(e.descriptor.extent,this.context.tilingScheme.spatialReference)),this._setResolutionParams(t,e),"tile"!==t.resultType&&this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),S(e)){const{highlightIds:e}=this.context;e&&e.length>$&&i.getLogger(this).warn("highlight-too-many-features",`highlight is limited to ${$} features on large layers configured with a display filter to avoid performance issues`),t.objectIds=e?.slice(0,$)}else!Q(e)&&this.context.effectiveDisplayFilter&&(t.where=c(t.where,this.context.effectiveDisplayFilter.where));return t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(N(e)||!this._supportsResolution)return null;const t=1===this.context.viewingMode&&this.context.tilingScheme?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.fetchingResolution,t)/this.lodFactor/this._tileZQuantization}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new C({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e,t){const i=e.length;if(t&&this._supportsResolution){const i=t*(1+_());s(e,({geometry:e})=>!(!e||!E(e))&&(b(e,X),x(X)>i||v(X)>i))}else s(e,({geometry:e})=>E(e));return i-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!Q(e)}_getMaxRecordCount(e){switch(this._resultType(e)){case"tile":if(this.context.tileMaxRecordCount)return this.context.tileMaxRecordCount;break;case"standard":if(this.context.standardMaxRecordCount)return this.context.standardMaxRecordCount}return this.context.maxRecordCount||$}_resultType(e){if(this.context.capabilities.supportsResultType)return Q(e)?"standard":"tile"}get _reduceMode(){const e=this.context.geometryType;return"polygon"===e||"polyline"===e?0:1}_handleRequest(e,t,s,i,r){e.startFetch(),e.requestController=s;let n=!1;t.then(t=>{e.requestController=null,i(t)}).catch(t=>{e.requestController===s&&(e.requestController=null,e.fetchDone(4)),a(t)?n=!0:r(t)}).then(()=>{n||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(h(()=>{this.removeHandles("scheduleUpdated"),this._updated()}),"scheduleUpdated")}_showTile(e){if(e.displayingFeatures&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=null!=e.displayingFeatures&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.fetchingResolution,{adds:i,updates:r}=this._changes,a=Math.min(e.featureLimit,t.length);for(let n=0;n<a;++n){const e=t[n],a=R(e,this._objectIdField),o=this._displayingFeatureReferences.get(a);if(o){const{oldVersion:t,newVersion:i}=o.ref(e,s);t!==i&&(t&&r.removes.push(t),i&&r.adds.push(i))}else this._displayingFeatureReferences.set(a,new this.FeatureReferenceClass(e,s)),i.push(e);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),e.displayingResolution=e.fetchingResolution,this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(null==e.displayingFeatures)return;const{updates:t,removes:s}=this._changes;for(const i of e.displayingFeatures){const r=R(i,this._objectIdField),a=this._displayingFeatureReferences.get(r);if(!a)continue;const{oldVersion:n,newVersion:o}=a.unref(e.displayingResolution);this._numDisplayingFeatureReferences--,n!==o&&(null==o?(this._displayingFeatureReferences.delete(r),n&&s.push(n)):(t.adds.push(o),n&&t.removes.push(n)))}this._applyChanges(),e.displayingFeatures=null}_notifyDataUpdating(){this._get("dataUpdating")||this._set("dataUpdating",!0)}_applyChanges(){const e=this._changes.updates;e.removes.length>0&&(this._notifyDataUpdating(),this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this._notifyDataUpdating(),this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,s=this._changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+K,i);this._notifyDataUpdating(),this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&(this._notifyDataUpdating(),this.features.addMany(0===r?t:t.slice(r))),s.length>i&&(this._notifyDataUpdating(),this.features.removeMany(0===r?s:s.slice(r))),t.length=0,s.length=0}_clearTile(e){this._hideTile(e),e.features&&null!=this.context.memoryCache&&this.context.memoryCache.put(e.id,e.cache),e.setFeatures(null,0,null,void 0),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}get _featureTilesArray(){return Array.from(this._featureTiles.values())}get featureTiles(){return this._featureTiles}get storedFeatures(){return this._featureTilesArray.reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return this._featureTiles.values().reduce((e,t)=>e+(t.needsFetch||t.isFetching?1:0),0)}_totalFeaturesForTile(e){return e.hasPreciseFeatureCount?e.numFeatures:this.maximumNumberOfFeatures}_maximumFeaturesForTile(e){const t=this._totalFeaturesForTile(e),s=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(t*s/(1-e.emptyFeatureRatio)),t)}get test(){}};function Q(e){return e.id===I}function S(e){return e.id===A}function N(e){return Q(e)||S(e)}function L(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function k(e){e.setFeatures([],0,null,void 0)}function H(e){return null==e?new Set:new Set(e.map(e=>e.name))}function Z(e,t){if(null==e||null==t)return H(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}function V(e,t){if(!t?.length)return e;e??=new Map;const s=()=>new Set;for(const{objectId:i,attribute:a}of t)r(e,i,s).add(a);return e}e([p({constructOnly:!0})],q.prototype,"features",void 0),e([p({constructOnly:!0})],q.prototype,"context",void 0),e([p()],q.prototype,"tileDescriptors",void 0),e([p({value:1/0})],q.prototype,"maximumNumberOfFeatures",null),e([p({value:1})],q.prototype,"memoryFactor",null),e([p({value:1})],q.prototype,"lodFactor",null),e([p()],q.prototype,"useTileCount",null),e([p({readOnly:!0})],q.prototype,"updating",null),e([p({readOnly:!0})],q.prototype,"dataUpdating",void 0),e([p({readOnly:!0})],q.prototype,"updatingTotal",void 0),e([p({readOnly:!0})],q.prototype,"updatingRemaining",void 0),e([p({readOnly:!0})],q.prototype,"expectedFeatureDiff",void 0),e([p({readOnly:!0})],q.prototype,"memoryForUnusedFeatures",null),e([p({readOnly:!0})],q.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([p({readOnly:!0})],q.prototype,"totalVertices",null),e([p({readOnly:!0})],q.prototype,"totalFeatures",null),e([p({readOnly:!0})],q.prototype,"showsAllFeatures",null),e([p({readOnly:!0})],q.prototype,"hasFullGeometries",null),e([p()],q.prototype,"filterExtent",null),e([p()],q.prototype,"_dirty",void 0),e([p()],q.prototype,"_suspended",void 0),e([p()],q.prototype,"_pendingEdits",void 0),e([p()],q.prototype,"_applyEditsTilesUpdated",void 0),e([p()],q.prototype,"_paused",null),e([p()],q.prototype,"snappingComplexityExceeded",void 0),e([p()],q.prototype,"_isFetching",void 0),q=e([f("esri.views.3d.layers.support.FeatureTileFetcher3D")],q);const $=2e3,B=m(),G=m(),X=m(),J=6e5,K=200,W=.95,Y=10;export{q as FeatureTileFetcher3D};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{filterInPlace as s}from"../../../../core/arrayUtils.js";import"../../../../core/has.js";import i from"../../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../../core/MapUtils.js";import{isAbortError as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import o from"../../../../core/ReactiveMap.js";import{on as l,watch as u}from"../../../../core/reactiveUtils.js";import{schedule as h}from"../../../../core/scheduling.js";import{signal as d}from"../../../../core/signal.js";import{sqlAnd as c}from"../../../../core/sql.js";import{property as p,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{getEpsilon as m}from"../../../../core/libs/gl-matrix-2/math/common.js";import{create as _,equals as g,clone as y,expand as F,toExtent as T,width as x,height as v}from"../../../../geometry/support/aaBoundingRect.js";import{getObjectId as R,hasVertices as E,computeAABR as b}from"../../../../layers/graphics/dehydratedFeatures.js";import C from"../../../../rest/support/QuantizationParameters.js";import D from"../../../../rest/support/Query.js";import{FeatureMemory as M}from"./FeatureMemory.js";import{MultiFeatureReference as w,SingleFeatureReference as j}from"./featureReference.js";import{failedFeatureCount as U,FeatureTile as A}from"./FeatureTile.js";import{virtualDisplayFilterHighlightTileId as I,virtualSnapshotTileId as P}from"./FeatureTileDescriptor.js";import{tilesAreRelated as O}from"../../terrain/tileUtils.js";import{ImmediateTask as z,TaskPriority as q}from"../../../support/Scheduler.js";let Q=class extends t{set maximumNumberOfFeatures(e){e=e||1/0;const t=this._get("maximumNumberOfFeatures");e===t||e<1||(this._set("maximumNumberOfFeatures",e),this._maximumFeaturesUpdated(t,e))}set memoryFactor(e){this.memoryFactor!==e&&(this._set("memoryFactor",e),this._setDirty())}set lodFactor(e){this.lodFactor!==e&&(this._set("lodFactor",e),this._supportsResolution&&this.refetch())}get useTileCount(){return this._useTileCount&&null!=this.context.query.queryFeatureCount}set useTileCount(e){this._useTileCount=e,this.notifyChange("useTileCount")}get updating(){return this._dirty||!!this._pendingEdits||this._isFetching||(this.tileDescriptors?.updating??!1)}get readyToRun(){return this._dirty}get usedMemory(){return this._memory.usedMemory}get usedMemoryPerFeature(){return this._memory.usedMemoryPerFeature}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}get showsAllFeatures(){if(this._paused||this.dataUpdating)return!1;for(const e of this._featureTiles.values())if(!this.hasFullGeometries&&0!==e.emptyFeatureRatio||!e.showsAllFeatures)return!1;return!0}get hasFullGeometries(){if(!this._supportsResolution)return!0;const e=this.tileDescriptors?.some(S);return e||!this.context.capabilities.supportsQuantization&&"polyline"!==this.context.geometryType}set filterExtent(e){if(null!=e&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void i.getLogger(this).error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||null!=t&&e&&t.equals(e))return;const s=null!=e?e.clone():null;this._set("filterExtent",s),this._reclip(s,t)}_updateTileZQuantization(e){if(1===this.context.viewingMode){const t=e.computeZQuantizationFactor();this._zQuantizationFactor.value<t&&(this._zQuantizationFactor.value=t)}}get _tileZQuantization(){return this.context.isDraped?1:this._zQuantizationFactor.value}constructor(e){super(e),this._useTileCount=!1,this.dataUpdating=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._zQuantizationFactor=d(1),this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._featureTiles=new o,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._memory=new M,this._dirty=!1,this._suspended=!0,this._pendingEdits=null,this._applyEditsTilesUpdated=!1,this.snappingComplexityExceeded=!0,this._isFetching=!1;const t=e.context;this._frameTask=t.scheduler?.registerTask(q.FEATURE_TILE_FETCHER,this)??z,this.FeatureReferenceClass=t.capabilities.supportsMultipleResolutions?w:j,this._objectIdField=t.objectIdField}initialize(){this.addHandles([l(()=>this.tileDescriptors,"change",()=>this._setDirty(),{onListenerAdd:()=>this._setDirty(),onListenerRemove:()=>this._setDirty()}),u(()=>this._tileZQuantization,()=>this.refetch())]),this._setDirty()}destroy(){this._frameTask.remove(),this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._removeTile(e)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),this._pendingEdits?.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._setDirty()}refetchDisplayFilterHighlightTile(){const e=this._featureTiles.get(I);e&&(this._cancelFetchTile(e),this._resetFetchTile(e),this._setDirty())}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}getMissingAttributesForFeature(e){for(const t of this._featureTiles.values()){const s=t.missingAttributes?.get(e);if(null!=s)return s}}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||this._setDirty()}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{null!=t.displayingFeatures&&0!==t.displayingFeatures.length&&(null==e?e=new Set(t.availableFields):e.forEach(s=>{t.availableFields?.has(s)||e.delete(s)}))}),null!=e?e:new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const s=t.edits.then(()=>e.result.catch(e=>{if(a(e))throw e;return null}).then(e=>e?(this._applyEditsDeleteFeatures(e.deletedFeatures),this._applyEditsAddUpdateFeatures(e.addedFeatures,e.updatedFeatures,t.controller.signal).then(()=>e)):e).then(e=>(0===--t.count&&(this._pendingEdits===t&&(this._pendingEdits=null),null!=this.context.memoryCache&&this.context.memoryCache.clear(),this._applyEditsTilesUpdated=!1,this._unpause()),e)));return t.edits=s,this._updated(),s}_applyEditsDeleteFeatures(e){if(0===e.length)return;const t=this.context.globalIdField,s=t&&this.availableFields.has(t),r=new Set,a=this._objectIdField;e.forEach(({objectId:e,globalId:n})=>{(!e||e<0)&&t&&n&&(s||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(n,a,t)),null!=e&&e>=0&&r.add(e)}),this._featureTiles.forEach(e=>{if(!e.features)return;const t=e.features.filter(e=>!r.has(R(e,this._objectIdField)));t.length!==e.features.length&&(this._applyEditsTileUpdated(),e.setFeatures(t,0,e.availableFields,e.missingAttributes),this._updateTileZQuantization(e),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,s){if(null==e)return null;const i=this.features.find(t=>t.attributes?.[s]===e);return i?R(i,t):null}async _applyEditsAddUpdateFeatures(e,t,s){const{objectIdField:r,globalIdField:a}=this.context,n=a&&this.availableFields.has(a),o=new Set,l=new Set;for(const i of e){const e=i.objectId;null!=e&&o.add(e)}for(const{objectId:h,globalId:d}of t){let e=h;(null==e||e<0)&&a&&(n||i.getLogger(this).errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),e=this._objectIdFromGlobalId(d,r,a)),null!=e&&e>=0&&(o.add(e),l.add(e))}if(0===o.size)return;const u=[];this._featureTiles.forEach(e=>{const t=this._applyEditsAddUpdateTile(e,o,l,s);u.push(t)}),this._updated(),await Promise.allSettled(u)}async _applyEditsAddUpdateTile(e,t,s,i){if(!e.features)return;e.fetchingResolution=e.descriptor.resolution;const r=this._createQuery(e);r.resultType=void 0,r.cacheHint=!1,r.objectIds=Array.from(t);const a=await this._queryFeatures(r,i);let n=null;if(s.size>0){const t=e.features.filter(e=>!s.has(R(e,this._objectIdField)));t.length!==e.features.length&&(n=t)}if(a.features.length>0){n||(n=e.features.slice());for(const e of a.features)n.push(e)}n&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,n.length)),this._applyEditsTileUpdated(),e.setFeatures(n,0,V(e.availableFields,a.fields),$(e.missingAttributes,a.missingAttributes)),this._updateTileZQuantization(e),this._invalidateCounts())}_applyEditsTileUpdated(){this._applyEditsTilesUpdated||(this._applyEditsTilesUpdated=!0,this._updated())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:K})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){const t=this._frameTask.processQueue(e);if(!this._dirty||!this.initialized)return t;this._dirty=!1;const s=this._featureTilesArray;if(this._markTilesNotAlive(s),!e.run(()=>this._addTiles(s,e))||!e.run(()=>this._filterExtentTiles(s,e))||!e.run(()=>this._removeTiles(s,e))||e.done)return void this._setDirty();const i=this._sortTiles(s);e.run(()=>this._showTiles(i,e))&&e.run(()=>this._fetchTiles(i,e))&&e.run(()=>this._updateMemoryEstimates(i,e))||this._setDirty(),this._updated(),this.updating||(this._updateMaximumNumberOfFeaturesExceeded(),this._updateSnappingComplexityExceeded(i))}_updateSnappingComplexityExceeded(e){let t=ee;for(const s of e){if(S(s)||t<=0)break;if(!N(s)&&(t--,s.sampledDensityEstimate>Y))return void(this.snappingComplexityExceeded=!0)}this.snappingComplexityExceeded=0===this._featureTiles.size}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!(this._suspended||!this.tileDescriptors)&&(this.tileDescriptors.forEach(s=>{const i=this._featureTiles.get(s.id);i?i.alive=!0:t.done||(e.push(this._addTile(s)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(const s of e){if(t.done)break;s.alive&&(s.filtered=!s.intersects(this.filterExtent),s.filtered&&(this._clearTile(s),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let s=e.length-1;s>=0&&!t.done;s--){const i=e[s];i.alive||(this._removeTile(i),s!==e.length-1&&(e[s]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((e,t)=>e.descriptor.loadPriority-t.descriptor.loadPriority),e}_showTiles(e,t){const s=this._updateRatio(e),i=e=>{const t=this._fullRatio<1?s(e)*this._farRatio:1;e.reduceFeatures(t,this.memoryFactor,this._objectIdField,this._reduceMode)&&this._setDirty();const{numFeatures:i,fetchingResolution:r,descriptor:a,isFetched:n}=e;return this._supportsResolution&&i>0&&r!==a.resolution&&n&&(e.requestRefetch(),this._setDirty()),this._showTile(e)};for(const r of e)if(!t.run(()=>i(r))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let s=!1;for(const i of e){if(!i.needsFetch)continue;const e=null!=this.context.memoryCache?this.context.memoryCache.pop(i.id):null;if(e?.resolution!==i.displayingResolution){if(this._needsNumFeatures(i)){const e=new AbortController,r=this._fetchTileCount(i,e.signal);this._handleRequest(i,r,e,()=>i.resetFetching(),()=>i.numFeatures=U),s=!0,t.madeProgress()}if(t.done)return!0}else i.cache=e,i.numFeatures&&this._notifyDataUpdating(),this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(s)return t.hasProgressed;for(const r of e){if(!r.needsFetch)continue;const e=new AbortController,s=this._fetchTile(r,e.signal);if(this._handleRequest(r,s,e,e=>r.fetchDone(e),e=>{r.fetchFailed=!0,this.context.logFetchError(i.getLogger(this),e)}),t.madeProgress(),t.done)return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(e=>!t.run(()=>e.updateEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const s=new Array;this._featureTiles.forEach(i=>{null!=i.displayingFeatures&&0!==i.displayingFeatures.length&&(i.intersectionIncludingBorrowed(t,G),i.intersectionIncludingBorrowed(e,X),g(G,X)||s.push(i))}),this._refreshDisplayingFeatures(s),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,s=this._changes.updates;for(const i of e)if(null!=i.displayingFeatures)for(const e of i.displayingFeatures){const i=R(e,this._objectIdField);if(t.has(i))continue;t.add(i);const r=this._displayingFeatureReferences.get(i).feature;s.removes.push(r),s.adds.push(r)}this._applyChanges()}_updated(){let e=0;if(this._paused||this._featureTiles.forEach(t=>t.isFetching?++e:0),this._isFetching=e>0,e>0||this._applyEditsTilesUpdated?this._notifyDataUpdating():this._dirty||this._set("dataUpdating",!1),this.updating){let t=0,s=0,i=0,r=0,a=0;const n=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(e=>{if(++s,e.isFetching&&e.hasPreciseFeatureCount){const t=this._maximumFeaturesForTile(e)*(1-e.emptyFeatureRatio),s=null!=e.displayingFeatures?e.displayingFeatures.length*n:0;a+=t-s}e.needsFetch?++r:e.numFeatures>0&&(++i,t+=e.numFeatures)}),r+=e;let o=0,l=0;t?(l=t,o=Math.min(r*t/i,t)):(l=s,o=r),a=Math.min(this.maximumNumberOfFeatures-this.features.length,a),this._set("updatingTotal",l),this._set("updatingRemaining",o),this._set("expectedFeatureDiff",a)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger?.update()}_updateMaximumNumberOfFeaturesExceeded(){for(const{perTileMaximumNumberOfFeaturesExceeded:e}of this._featureTiles.values())if(e)return void this._set("maximumNumberOfFeaturesExceeded",!0);this._set("maximumNumberOfFeaturesExceeded",!1)}_updateRatio(e){const t=k(e),s=e=>1/(1<<Math.max(0,t-e.descriptor.lij[0]));let i=0,r=0;for(const a of e){const e=a.numFeatures;i+=e,r+=e*s(a)}return this._fullRatio=Math.min(1,this.maximumNumberOfFeatures/i),this._farRatio=this.maximumNumberOfFeatures/r,this._scheduleUpdated(),s}_maximumFeaturesUpdated(e,t){e!==t&&(t>e&&this._featureTiles.forEach(e=>{if(!e.featuresMissing)return;const t=this._maximumFeaturesForTile(e);e.isFullyFetched(t)||(this._cancelFetchTile(e),this._resetFetchTile(e))}),this._setDirty())}_addTile(e){const t=new A(e,this._memory);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.displayingResolution;this._featureTiles.forEach(s=>{if(null!=s.displayingFeatures&&e!==s&&O(e.descriptor.lij,s.descriptor.lij)){null==e.displayingFeatures&&(e.displayingFeatures=[]),e.descriptor.extent&&s.descriptor.extent&&(e.extentIncludingBorrowedFeatures??=y(e.descriptor.extent),F(e.extentIncludingBorrowedFeatures,s.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const i of s.displayingFeatures){e.displayingFeatures.push(i),this._memory.ref(i);const s=this._displayingFeatureReferences.get(R(i,this._objectIdField));s.ref(this._memory,s.feature,t),this._numDisplayingFeatureReferences++}}})}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetch&&e.fetchDone(4):e.requestFetch()}_cancelFetchTile(e){const t=e.requestController;null!=t&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){e.numFeatures=await this.context.query.queryFeatureCount(this._createFeatureCountQuery(e),{signal:t}),this._updateRatio(this._featureTilesArray)}async _fetchTile(e,t){e.fetchFailed=!1;const s=this._maximumFeaturesForTile(e);if(s<=0)return e.hasPreciseFeatureCount&&0===e.numFeatures||(e.fetchFailed=!0),H(e),e.fetchInformation.value="Empty tile",4;const i=this._getMaxRecordCount(e),r=Math.ceil(s/i);if(e.fetchingResolution=e.descriptor.resolution,L(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=s&&r>D.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const a=this._createQuery(e);if(a.maxRecordCountFactor=r,e.isRefetching&&e.features&&e.features.length>0){const t=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/i);a.maxRecordCountFactor=Math.max(t+1,a.maxRecordCountFactor)}e.fetchInformation.value=`Single fetch\n${s} features`;const{features:o,exceededTransferLimit:l,fields:u,missingAttributes:h}=await this._queryFeatures(a,t),d=l||a.maxRecordCountFactor>=D.MAX_MAX_RECORD_COUNT_FACTOR||s===this._totalFeaturesForTile(e)?5:4,c=await this._frameTask.schedule(()=>{e.exceededTransferLimit.value=!!l;const t=this._removeEmptyFeatures(o,this._getEffectiveTileResolution(e));return e.fetchInformation.value=`Single fetch\n${o.length}/${s} features`,e.setFeatures(o,t,Z(u),$(void 0,h)),this._updateTileZQuantization(e),this._maximumFeaturesForTile(e)>s?1:d},t);return n(t),this._invalidateCounts(),c}async _fetchPagedTile(e,t){let s,i=0,r=0,a=0,o=this._maximumFeaturesForTile(e)-a;const l=this._getMaxRecordCount(e);let u,h=null;for(;;){const d=this._createQuery(e),c=this._setPagingParameters(d,i,o,l);e.fetchInformation.value=`Paged fetch\n${e.features?.length}/${o} features`;const{features:p,exceededTransferLimit:f,fields:m,missingAttributes:_}=await this._queryFeatures(d,t);if(await this._frameTask.schedule(()=>{c&&(i+=d.num),a+=p.length,r+=this._removeEmptyFeatures(p,this._getEffectiveTileResolution(e)),e.exceededTransferLimit.value=!!f,s=s?.concat(p)??p,h=V(h,m),u=$(u,_),e.setFeatures(s,r,h,u),this._updateTileZQuantization(e),this._invalidateCounts(),this._setDirty()},t),n(t),o=this._maximumFeaturesForTile(e)-(s?.length??0),!c||!f||o<=0)return f?4:5}}_createFeatureCountQuery(e){const t=this._createQuery(e);return this.context.capabilities.supportsCacheHint&&(t.resultType=void 0,t.cacheHint=!0),t}_createQuery(e){const t=this.context.createQuery();if(t.resultType=this._resultType(e),!L(e)&&e.descriptor.extent&&this.context.tilingScheme&&(t.geometry=T(e.descriptor.extent,this.context.tilingScheme.spatialReference)),this._setResolutionParams(t,e),"tile"!==t.resultType&&this.context.capabilities.supportsCacheHint&&(t.cacheHint=!0),N(e)){const{highlightIds:e}=this.context;e&&e.length>B&&i.getLogger(this).warn("highlight-too-many-features",`highlight is limited to ${B} features on large layers configured with a display filter to avoid performance issues`),t.objectIds=e?.slice(0,B)}else!S(e)&&this.context.effectiveDisplayFilter&&(t.where=c(t.where,this.context.effectiveDisplayFilter.where));return t}_setPagingParameters(e,t,s,i){return!!this.context.capabilities.supportsPagination&&(e.start=t,s>0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(s/i),e.num=Math.min(e.maxRecordCountFactor*i,s)):e.num=Math.min(i),!0)}_getEffectiveTileResolution(e){if(L(e)||!this._supportsResolution)return null;const t=1===this.context.viewingMode&&this.context.tilingScheme?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.fetchingResolution,t)/this.lodFactor/this._tileZQuantization}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&"point"!==this.context.geometryType}_setResolutionParams(e,t){const s=this._getEffectiveTileResolution(t);null!=s&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new C({mode:"view",originPosition:"upper-left",tolerance:s,extent:this.context.fullExtent}):"polyline"===this.context.geometryType&&(e.maxAllowableOffset=s))}_removeEmptyFeatures(e,t){const i=e.length;if(t&&this._supportsResolution){const i=t*(1+m());s(e,({geometry:e})=>!(!e||!E(e))&&(b(e,J),x(J)>i||v(J)>i))}else s(e,({geometry:e})=>E(e));return i-e.length}_needsNumFeatures(e){return this.useTileCount&&e.needsFeatureCount&&!S(e)}_getMaxRecordCount(e){switch(this._resultType(e)){case"tile":if(this.context.tileMaxRecordCount)return this.context.tileMaxRecordCount;break;case"standard":if(this.context.standardMaxRecordCount)return this.context.standardMaxRecordCount}return this.context.maxRecordCount||B}_resultType(e){if(this.context.capabilities.supportsResultType)return S(e)?"standard":"tile"}get _reduceMode(){const e=this.context.geometryType;return"polygon"===e||"polyline"===e?0:1}_handleRequest(e,t,s,i,r){e.startFetch(),e.requestController=s;let n=!1;t.then(t=>{e.requestController=null,i(t)}).catch(t=>{e.requestController===s&&(e.requestController=null,e.fetchDone(4)),a(t)?n=!0:r(t)}).then(()=>{n||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(h(()=>{this.removeHandles("scheduleUpdated"),this._updated()}),"scheduleUpdated")}_showTile(e){if(e.displayingFeatures&&!e.needsDisplayUpdate)return!1;const t=e.features;if(0===e.featureLimit||!t){const t=null!=e.displayingFeatures&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],t}const s=e.fetchingResolution,{adds:i,updates:r}=this._changes,a=Math.min(e.featureLimit,t.length);for(let n=0;n<a;++n){const e=t[n],a=R(e,this._objectIdField),o=this._displayingFeatureReferences.get(a);if(this._memory.ref(e),o){const{oldVersion:t,newVersion:i}=o.ref(this._memory,e,s);t!==i&&(t&&r.removes.push(t),i&&r.adds.push(i))}else this._displayingFeatureReferences.set(a,new this.FeatureReferenceClass(e,s,this._memory)),i.push(e);this._numDisplayingFeatureReferences++}return this._hideTileFeatures(e),e.displayingResolution=e.fetchingResolution,this._applyChanges(),e.displayingFeatures=t.slice(0,a),!0}_hideTile(e){this._cancelFetchTile(e),this._hideTileFeatures(e)}_hideTileFeatures(e){if(null==e.displayingFeatures)return;const{updates:t,removes:s}=this._changes;for(const i of e.displayingFeatures){this._memory.unref(i);const r=R(i,this._objectIdField),a=this._displayingFeatureReferences.get(r);if(!a)continue;const{oldVersion:n,newVersion:o}=a.unref(this._memory,e.displayingResolution);this._numDisplayingFeatureReferences--,n!==o&&(null==o?(this._displayingFeatureReferences.delete(r),n&&s.push(n)):(t.adds.push(o),n&&t.removes.push(n)))}this._applyChanges(),e.displayingFeatures=null}_notifyDataUpdating(){this._get("dataUpdating")||this._set("dataUpdating",!0)}_applyChanges(){const e=this._changes.updates;e.removes.length>0&&(this._notifyDataUpdating(),this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this._notifyDataUpdating(),this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,s=this._changes.removes,i=Math.min(t.length,s.length);let r=0;for(;r<i;){const e=Math.min(r+W,i);this._notifyDataUpdating(),this.features.addMany(t.slice(r,e)),this.features.removeMany(s.slice(r,e)),r=e}t.length>i&&(this._notifyDataUpdating(),this.features.addMany(0===r?t:t.slice(r))),s.length>i&&(this._notifyDataUpdating(),this.features.removeMany(0===r?s:s.slice(r))),t.length=0,s.length=0}_clearTile(e){this._hideTile(e),e.features&&null!=this.context.memoryCache&&this.context.memoryCache.put(e.id,e.cache),e.setFeatures(null,0,null,void 0),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures")}get _featureTilesArray(){return Array.from(this._featureTiles.values())}get featureTiles(){return this._featureTiles}get storedFeatures(){return this._featureTilesArray.reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return this._featureTiles.values().reduce((e,t)=>e+(t.needsFetch||t.isFetching?1:0),0)}_totalFeaturesForTile(e){return e.hasPreciseFeatureCount?e.numFeatures:this.maximumNumberOfFeatures}_maximumFeaturesForTile(e){const t=this._totalFeaturesForTile(e),s=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(t*s/(1-e.emptyFeatureRatio)),t)}get test(){}};function S(e){return e.id===P}function N(e){return e.id===I}function L(e){return S(e)||N(e)}function k(e){let t=0;for(const s of e)s.features&&s.features.length>0&&s.alive&&(t=Math.max(t,s.descriptor.lij[0]));return t}function H(e){e.setFeatures([],0,null,void 0)}function Z(e){return null==e?new Set:new Set(e.map(e=>e.name))}function V(e,t){if(null==e||null==t)return Z(t);const s=new Set;for(const{name:i}of t)e.has(i)&&s.add(i);return s}function $(e,t){if(!t?.length)return e;e??=new Map;const s=()=>new Set;for(const{objectId:i,attribute:a}of t)r(e,i,s).add(a);return e}e([p({constructOnly:!0})],Q.prototype,"features",void 0),e([p({constructOnly:!0})],Q.prototype,"context",void 0),e([p()],Q.prototype,"tileDescriptors",void 0),e([p({value:1/0})],Q.prototype,"maximumNumberOfFeatures",null),e([p({value:1})],Q.prototype,"memoryFactor",null),e([p({value:1})],Q.prototype,"lodFactor",null),e([p()],Q.prototype,"useTileCount",null),e([p({readOnly:!0})],Q.prototype,"updating",null),e([p({readOnly:!0})],Q.prototype,"dataUpdating",void 0),e([p({readOnly:!0})],Q.prototype,"updatingTotal",void 0),e([p({readOnly:!0})],Q.prototype,"updatingRemaining",void 0),e([p({readOnly:!0})],Q.prototype,"expectedFeatureDiff",void 0),e([p()],Q.prototype,"usedMemory",null),e([p()],Q.prototype,"usedMemoryPerFeature",null),e([p({readOnly:!0})],Q.prototype,"maximumNumberOfFeaturesExceeded",void 0),e([p({readOnly:!0})],Q.prototype,"totalVertices",null),e([p({readOnly:!0})],Q.prototype,"totalFeatures",null),e([p({readOnly:!0})],Q.prototype,"showsAllFeatures",null),e([p({readOnly:!0})],Q.prototype,"hasFullGeometries",null),e([p()],Q.prototype,"filterExtent",null),e([p()],Q.prototype,"_dirty",void 0),e([p()],Q.prototype,"_suspended",void 0),e([p()],Q.prototype,"_pendingEdits",void 0),e([p()],Q.prototype,"_applyEditsTilesUpdated",void 0),e([p()],Q.prototype,"_paused",null),e([p()],Q.prototype,"snappingComplexityExceeded",void 0),e([p()],Q.prototype,"_isFetching",void 0),Q=e([f("esri.views.3d.layers.support.FeatureTileFetcher3D")],Q);const B=2e3,G=_(),X=_(),J=_(),K=6e5,W=200,Y=.95,ee=10;export{Q as FeatureTileFetcher3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Error.js";import"../../../../geometry/SpatialReference.js";import"../../../../geometry/support/aaBoundingBox.js";import"../../../../core/mathUtils.js";import"../../../../geometry/Extent.js";import"../../../../geometry/support/typeUtils.js";import"../../../../layers/support/Field.js";import"../../../../core/has.js";import{equals as t}from"../../../../layers/graphics/dehydratedFeatureComparison.js";class r{constructor(e,t){this.feature=e,this.resolution=t,this.refCount=1}}class s{get isReferenced(){return 0!==this.versions.length}get isSingle(){return 1===this.versions.length&&1===this.versions[0].refCount}constructor(e,t){this._highestResolutionVersion=null,this.versions=[],this.ref(e,t)}ref(e,s){const o=this.feature;n.oldVersion=o,o&&Object.defineProperty(e,"uid",{value:o.uid,configurable:!0});const i=this._highestResolutionVersion;for(const r of this.versions)if(r.resolution===s){r.refCount++;const s=i===r&&!t(e,r.feature);return(s||i!==r)&&(r.feature=e),n.newVersion=s?e:o,n}const u=new r(e,s);return this.versions.push(u),!i||s<i.resolution?(n.newVersion=e,this._highestResolutionVersion=u):n.newVersion=o,n}unref(t){const{versions:r}=this;for(let e=0;e<r.length;e++){const s=r[e];if(s.resolution===t)return s.refCount--,i.oldVersion=this.feature,0===s.refCount&&(r[e]=r[r.length-1],--r.length,this._highestResolutionVersion===s&&(this._recalculateHighestResolutionVersion(),i.oldVersion=s.feature)),i.newVersion=this.feature,i}const s=`Unref feature with no references: ${this.feature?.uid}`;throw new e(s,s,(new Error).stack?.slice(6))}get feature(){return this._highestResolutionVersion?.feature??null}_recalculateHighestResolutionVersion(){if(0===this.versions.length)return void(this._highestResolutionVersion=null);let e=this.versions[0];for(let t=1;t<this.versions.length;t++){const r=this.versions[t];r.resolution<e.resolution&&(e=r)}this._highestResolutionVersion=e}}class o{get isReferenced(){return 0!==this._refCount}get isSingle(){return 1===this._refCount}constructor(e){this._feature=e,this._refCount=1}ref(e){++this._refCount;const r=this._feature;return n.oldVersion=r,r&&Object.defineProperty(e,"uid",{value:r.uid,configurable:!0}),t(r,e)||(this._feature=e),n.newVersion=this._feature,n}unref(){i.oldVersion=this._feature;const t=this._refCount;if(!(t>0)){const t=`Unref feature with no references: ${this.feature?.uid}`;throw new e(t,t,(new Error).stack?.slice(6))}return this._refCount=t-1,1===t?(i.newVersion=null,i):(i.newVersion=this._feature,i)}get feature(){return this._feature}}const i={oldVersion:null,newVersion:null},n={oldVersion:null,newVersion:null};export{r as FeatureVersion,s as MultiFeatureReference,o as SingleFeatureReference};
2
+ import e from"../../../../core/Error.js";import"../../../../geometry/SpatialReference.js";import"../../../../geometry/support/aaBoundingBox.js";import"../../../../core/mathUtils.js";import"../../../../geometry/Extent.js";import"../../../../geometry/support/typeUtils.js";import"../../../../layers/support/Field.js";import"../../../../core/has.js";import{equals as t}from"../../../../layers/graphics/dehydratedFeatureComparison.js";class r{constructor(e,t){this.feature=e,this.resolution=t,this.refCount=1}}class s{get isReferenced(){return 0!==this.versions.length}get isSingle(){return 1===this.versions.length&&1===this.versions[0].refCount}constructor(e,t,r){this._highestResolutionVersion=null,this.versions=[],this.ref(r,e,t)}ref(e,s,o){const i=this.feature;n.oldVersion=i,i&&Object.defineProperty(s,"uid",{value:i.uid,configurable:!0});const u=this._highestResolutionVersion;for(const r of this.versions)if(r.resolution===o){r.refCount++;const o=u===r&&!t(s,r.feature);return(o||u!==r)&&(e.ref(s),e.unref(r.feature),r.feature=s),n.newVersion=o?s:i,n}const h=new r(s,o);return this.versions.push(h),e.ref(s),!u||o<u.resolution?(n.newVersion=s,this._highestResolutionVersion=h):n.newVersion=i,n}unref(t,r){const{versions:s}=this;for(let e=0;e<s.length;e++){const o=s[e];if(o.resolution===r)return o.refCount--,i.oldVersion=this.feature,0===o.refCount&&(t.unref(o.feature),s[e]=s[s.length-1],--s.length,this._highestResolutionVersion===o&&(this._recalculateHighestResolutionVersion(),i.oldVersion=o.feature)),i.newVersion=this.feature,i}const o=`Unref feature with no references: ${this.feature?.uid}`;throw new e(o,o,(new Error).stack?.slice(6))}get feature(){return this._highestResolutionVersion?.feature??null}_recalculateHighestResolutionVersion(){if(0===this.versions.length)return void(this._highestResolutionVersion=null);let e=this.versions[0];for(let t=1;t<this.versions.length;t++){const r=this.versions[t];r.resolution<e.resolution&&(e=r)}this._highestResolutionVersion=e}}class o{get isReferenced(){return 0!==this._refCount}get isSingle(){return 1===this._refCount}constructor(e,t,r){this._feature=e,this._refCount=1,r.ref(e)}ref(e,r,s){++this._refCount;const o=this._feature;return n.oldVersion=o,o&&Object.defineProperty(r,"uid",{value:o.uid,configurable:!0}),t(o,r)||(e.ref(r),e.unref(this._feature),this._feature=r),n.newVersion=this._feature,n}unref(t,r){i.oldVersion=this._feature;const s=this._refCount;if(!(s>0)){const t=`Unref feature with no references: ${this.feature?.uid}`;throw new e(t,t,(new Error).stack?.slice(6))}return this._refCount=s-1,1===s?(t.unref(this._feature),i.newVersion=null,i):(i.newVersion=this._feature,i)}get feature(){return this._feature}}const i={oldVersion:null,newVersion:null},n={oldVersion:null,newVersion:null};export{r as FeatureVersion,s as MultiFeatureReference,o as SingleFeatureReference};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../../core/Logger.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{NavigationMode3D as i}from"./NavigationMode3D.js";let n=class extends i{constructor(t){super(t),this.type="ground",this.nearOverride=.5,this.farOverride=1e4,this.include=null,this.exclude=null}attach(t){super.attach(t),this._warnIfOffsetIsBelowConstraints()}detach(){super.detach()}get offset(){const t=this._get("offset");return void 0!==t?t:1.8}set offset(t){this._set("offset",t),this._warnIfOffsetIsBelowConstraints()}_warnIfOffsetIsBelowConstraints(){if(null==this.view||null==this.offset)return;const t=this.view.state.constraints.altitude,o=this.view.state.constraints.collision;t&&this.offset<t.min&&e.getLogger(this).warn("offset-smaller-than-altitude-constraint",`The ground navigation offset of ${this.offset} is smaller than the view's min altitude constraint with a value of ${t.min}. Unexpected behaviour close to ground might occur. Adjust or remove constraints from view.constraints.altitude to address this.`),o?.enabled&&this.offset<o.elevationMargin&&e.getLogger(this).warn("offset-smaller-than-navigation-constraint",`The ground navigation offset of ${this.offset} is smaller than the value of ${o.elevationMargin} that is enforced by the view's navigation constraint. Unexpected behaviour close to ground might occur. Adjust or remove constraints from view.map.ground.navigationConstraint to address this.`)}};t([o()],n.prototype,"include",void 0),t([o()],n.prototype,"exclude",void 0),t([o()],n.prototype,"offset",null),n=t([s("esri.views.3d.navigation.modes.GroundNavigationMode3D")],n);export{n as GroundNavigationMode3D};
2
+ import{__decorate as t}from"tslib";import e from"../../../../core/Logger.js";import{property as o,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{NavigationMode3D as i}from"./NavigationMode3D.js";let r=class extends i{constructor(t){super(t),this.type="ground",this.nearOverride=.5,this.farOverride=1e4}attach(t){super.attach(t),this._warnIfOffsetIsBelowConstraints()}detach(){super.detach()}get offset(){const t=this._get("offset");return void 0!==t?t:1.8}set offset(t){this._set("offset",t),this._warnIfOffsetIsBelowConstraints()}_warnIfOffsetIsBelowConstraints(){if(null==this.view||null==this.offset)return;const t=this.view.state.constraints.altitude,o=this.view.state.constraints.collision;t&&this.offset<t.min&&e.getLogger(this).warn("offset-smaller-than-altitude-constraint",`The ground navigation offset of ${this.offset} is smaller than the view's min altitude constraint with a value of ${t.min}. Unexpected behaviour close to ground might occur. Adjust or remove constraints from view.constraints.altitude to address this.`),o?.enabled&&this.offset<o.elevationMargin&&e.getLogger(this).warn("offset-smaller-than-navigation-constraint",`The ground navigation offset of ${this.offset} is smaller than the value of ${o.elevationMargin} that is enforced by the view's navigation constraint. Unexpected behaviour close to ground might occur. Adjust or remove constraints from view.map.ground.navigationConstraint to address this.`)}};t([o()],r.prototype,"include",void 0),t([o()],r.prototype,"exclude",void 0),t([o()],r.prototype,"offset",null),r=t([s("esri.views.3d.navigation.modes.GroundNavigationMode3D")],r);export{r as GroundNavigationMode3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import i from"../../../core/Logger.js";import{clamp as o,deg2rad as s}from"../../../core/mathUtils.js";import{property as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import{earth as a}from"../../../geometry/support/Ellipsoid.js";import{makePiecewiseLinearFunction as l}from"../support/mathUtils.js";let m=class extends e{constructor(t){super(t),this.collision=new h,this.distance=1/0,this.minimumPoiDistance=4,this.tilt=null}get altitude(){return 2===this.mode?null:this._get("altitude")||null}set altitude(t){2!==this.mode?this._set("altitude",t):i.getLogger(this).warn("Altitude constraint is ignored in local scenes")}get mode(){return this.state.viewingMode}clampAltitude(t){return this.altitude?o(t,this.altitude.min,this.altitude.max):t}clampTilt(t,e){if(!this.tilt)return e;const i=this.tilt(t);return o(e,i.min,i.max)}clampDistance(t){return Math.min(t,this.distance)}createDefaultTilt(){return 2===this.mode?this._createDefaultTiltLocal():this._createDefaultTiltGlobal()}createConstantMaxTilt(t){return(e,i=p)=>(i.min=d.min,i.max=t,i)}_createDefaultTiltLocal(){const t=this.collision.enabled?l([[4e3,d.max],[1e4,s(88)],[6e6,s(88)]]):()=>d.max;return(e,i=p)=>(i.min=d.min,i.max=t(e),i)}_createDefaultTiltGlobal(){const t=this.collision.enabled?l([[4e3,d.max],[5e4,s(88)],[6e6,s(88)],[2e7,d.min]]):l([[3e5,d.max],[3e6,s(88)],[6e6,s(88)],[2e7,d.min]]);return(e,i=p)=>(i.min=d.min,i.max=t(e),i)}};function c(t){return{min:-2e5,max:4*t.radius}}t([r()],m.prototype,"altitude",null),t([r({readOnly:!0})],m.prototype,"collision",void 0),t([r()],m.prototype,"distance",void 0),t([r({readOnly:!0})],m.prototype,"minimumPoiDistance",void 0),t([r()],m.prototype,"tilt",void 0),t([r({constructOnly:!0})],m.prototype,"state",void 0),m=t([n("esri.views.3d.state.Constraints")],m);const u=c(a),d={min:s(.5),max:s(179.5)},p={min:0,max:0};let h=class extends e{constructor(){super(...arguments),this.enabled=!0,this.elevationMargin=5}};t([r({type:Boolean})],h.prototype,"enabled",void 0),t([r({type:Number})],h.prototype,"elevationMargin",void 0),h=t([n("esri.views.3d.state.Constraints.CollisionConstraint")],h);export{m as Constraints,d as TiltRange,u as earthAltitudeConstraint};
2
+ import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import i from"../../../core/Logger.js";import{clamp as o,deg2rad as s}from"../../../core/mathUtils.js";import{property as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import{earth as a}from"../../../geometry/support/Ellipsoid.js";import{makePiecewiseLinearFunction as l}from"../support/mathUtils.js";let m=class extends e{constructor(t){super(t),this.collision=new h,this.distance=1/0,this.minimumPoiDistance=4,this.tilt=null}get altitude(){return 2===this.mode?null:this._get("altitude")||null}set altitude(t){2!==this.mode?this._set("altitude",t):i.getLogger(this).warn("Altitude constraint is ignored in local scenes")}get mode(){return this.state.viewingMode}clampAltitude(t){return this.altitude?o(t,this.altitude.min,this.altitude.max):t}clampTilt(t,e){if(!this.tilt)return e;const i=this.tilt(t);return o(e,i.min,i.max)}clampDistance(t){return Math.min(t,this.distance)}createDefaultTilt(){return 2===this.mode?this._createDefaultTiltLocal():this._createDefaultTiltGlobal()}createConstantMaxTilt(t){return(e,i=p)=>(i.min=d.min,i.max=t,i)}_createDefaultTiltLocal(){const t=this.collision.enabled?l([[4e3,d.max],[1e4,s(88)],[6e6,s(88)]]):()=>d.max;return(e,i=p)=>(i.min=d.min,i.max=t(e),i)}_createDefaultTiltGlobal(){const t=this.collision.enabled?l([[4e3,d.max],[5e4,s(88)],[6e6,s(88)],[2e7,d.min]]):l([[3e5,d.max],[3e6,s(88)],[6e6,s(88)],[2e7,d.min]]);return(e,i=p)=>(i.min=d.min,i.max=t(e),i)}};function c(t){return{min:-2e5,max:4*t.radius}}t([r()],m.prototype,"altitude",null),t([r({readOnly:!0})],m.prototype,"collision",void 0),t([r()],m.prototype,"distance",void 0),t([r({readOnly:!0})],m.prototype,"minimumPoiDistance",void 0),t([r()],m.prototype,"tilt",void 0),t([r({constructOnly:!0})],m.prototype,"state",void 0),m=t([n("esri.views.3d.state.Constraints")],m);const u=c(a),d={min:s(.5),max:s(179.5)},p={min:0,max:0};let h=class extends e{constructor(){super(...arguments),this.enabled=!0,this.elevationMargin=1}};t([r({type:Boolean})],h.prototype,"enabled",void 0),t([r({type:Number})],h.prototype,"elevationMargin",void 0),h=t([n("esri.views.3d.state.Constraints.CollisionConstraint")],h);export{m as Constraints,d as TiltRange,u as earthAltitudeConstraint};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{prefersReducedMotion as i}from"../../../../core/a11yUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as n,distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as a,dot as h,crossAndNormalize as m,scale as l,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as d,fromPositionAndNormal as u}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as f}from"./InteractiveController.js";import{GroundNavigationMomentumController as P}from"./momentum/GroundNavigationMomentumController.js";import{groundNavigationConstants as w,findSphereHorizonY as z,computeHorizonPaddingLimits as S,findPlaneHorizonY as b,findGroundNavigationGrabLocation as j}from"../utils/groundNavigationUtils.js";import{OffsetCorrectionController as y}from"../utils/OffsetCorrectionController.js";import H from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as E}from"../../../navigation/GroundNavigationMomentumEstimator.js";let M=class extends f{constructor(t){super(t),this._drag=null,this._validState=!0,this._adjustedScenePoint=p(),this._momentumEstimator=new E,this._referenceSphere=new g,this._referencePlane=d(),this._tmp3d=p(),this._screenPointArray=e(),this._forwardRopeComponent=p(),this._sidewaysRopeComponent=p(),this._ropeTranslation=p(),this._beginScreenPoint=e(),this._screenPickPoint=e(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=d(),this._pointerOverHorizonVelocityAdjustment=1,this._beginCamera=new H,this._constraintOptions=new v(15,6,0,this._beginCamera)}initialize(){this._offsetCorrectionController=new y(this.view)}stepController(t,i){this._drag&&(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(this._drag,t),i.copyFrom(this.currentCamera),this._drag=null)}get isGlobalMode(){return 1===this.view.state.viewingMode}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!i()}begin(t){this.running&&(r(t.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),n(this._beginScreenPoint,this._screenPickPoint),this.startCamera.relativeElevation>w.maxElevation?this._validState=!1:(this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera)))}update(t){this.running&&this._validState&&(this._drag=t,this.updateInteractive())}end(t){return this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=_(this.view.spatialReference).radius,this._horizonY=z(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=null!=this._horizonY?S(this.startCamera,this._horizonY):null}_localInitHorizonValues(){const t=p();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=p();a(i,this.startCamera.eye,t,-this.startCamera.relativeElevation),u(i,t,this._referencePlane),this._horizonY=b(this.startCamera,this._referencePlane),this._horizonPadding=S(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio;if(!j({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint}))return void(this._validState=!1);const t=p();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=this.startCamera.viewRight,e=h(this._ropeTranslation,i),r=m(p(),t,i),o=h(this._ropeTranslation,r);l(this._forwardRopeComponent,r,o),l(this._sidewaysRopeComponent,i,e),u(this._adjustedScenePoint,t,this._ropePlane);const n=this._ropeScreenHeight-this._beginScreenPoint[1],s=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=Math.max(n/s,1)}_panningRopePull(t,i){if(!this._horizonY||!this._horizonPadding)return;const e=r(t.center,this._screenPointArray),o=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,n=(this._ropeScreenHeight-e[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),h=1-n,m=(e[0]-o)/(this._beginScreenPoint[0]-o),p=h*w.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,_=(h*w.xSpeedMultiplier+n*((1-m)*w.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;l(this._ropeTranslation,this._forwardRopeComponent,p),a(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,_),this.currentCamera.eye=c(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=c(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(e,this._ropeTranslation,.001*t.timestamp),this._constraintOptions.interactionFactor=C(s(this._beginScreenPoint,e)),this._constraintOptions.interactionDirection=this._ropeTranslation,this._offsetCorrectionController.smoothlyCorrectGroundElevation(this.currentCamera,i,this._constraintOptions),this._constraintOptions.interactionDirection=null}createMomentum(){const t=this.momentumEnabled&&this._momentumEstimator.createMomentum();return t?new P({view:this.view,momentum:t}):null}};M=t([o("esri.views.3d.state.controllers.GroundNavigationController")],M);export{M as GroundNavigationController};
2
+ import{__decorate as t}from"tslib";import{prefersReducedMotion as i}from"../../../../core/a11yUtils.js";import{createScreenPointArray as e,screenPointObjectToArray as r}from"../../../../core/screenUtils.js";import{subclass as o}from"../../../../core/accessorSupport/decorators.js";import{copy as n,distance as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{scaleAndAdd as a,dot as h,crossAndNormalize as m,scale as l,add as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as _}from"../../../../geometry/ellipsoidUtils.js";import{create as d,fromPositionAndNormal as u}from"../../../../geometry/support/plane.js";import{Sphere as g}from"../../../../geometry/support/sphere.js";import{pixelDistanceToInteractionFactor as C}from"../../camera/constraintUtils.js";import{ConstraintOptions as v}from"../../camera/constraintUtils/ConstraintOptions.js";import{InteractiveController as f}from"./InteractiveController.js";import{GroundNavigationMomentumController as P}from"./momentum/GroundNavigationMomentumController.js";import{groundNavigationConstants as w,findSphereHorizonY as z,computeHorizonPaddingLimits as S,findPlaneHorizonY as b,findGroundNavigationGrabLocation as j}from"../utils/groundNavigationUtils.js";import{OffsetCorrectionController as y}from"../utils/OffsetCorrectionController.js";import H from"../../webgl/RenderCamera.js";import{GroundNavigationMomentumEstimator as E}from"../../../navigation/GroundNavigationMomentumEstimator.js";let M=class extends f{constructor(t){super(t),this._drag=null,this._validState=!0,this._adjustedScenePoint=p(),this._momentumEstimator=new E,this._referenceSphere=new g,this._referencePlane=d(),this._tmp3d=p(),this._screenPointArray=e(),this._forwardRopeComponent=p(),this._sidewaysRopeComponent=p(),this._ropeTranslation=p(),this._beginScreenPoint=e(),this._screenPickPoint=e(),this._horizonY=null,this._horizonPadding=null,this._ropeScreenHeight=1,this._ropePlane=d(),this._pointerOverHorizonVelocityAdjustment=1,this._beginCamera=new H,this._constraintOptions=new v(15,6,0,this._beginCamera)}initialize(){this._offsetCorrectionController=new y(this.view)}stepController(t,i){this._drag&&(this.currentCamera.copyFrom(this.startCamera),this._panningRopePull(this._drag,t),i.copyFrom(this.currentCamera),this._drag=null)}get isGlobalMode(){return 1===this.view.state.viewingMode}get momentumEnabled(){return this.view.navigation.momentumEnabled&&this.view.animationsEnabled&&!i()}begin(t){this.running&&(r(t.center,this._screenPickPoint),Math.abs(this._screenPickPoint[0]-this.view.width/2)<.1&&(this._screenPickPoint[0]+=1),n(this._beginScreenPoint,this._screenPickPoint),this.startCamera.relativeElevation>w.maxElevation?this._validState=!1:(this._prepareGroundNavigation(),this._beginCamera.copyFrom(this.startCamera)))}update(t){this.running&&this._validState&&(this._drag=t,this.updateInteractive())}end(t){return this.finishController(),this.createMomentum()}_initHorizonValues(){this.isGlobalMode?this._globalInitHorizonValues():this._localInitHorizonValues()}_globalInitHorizonValues(){this._referenceSphere.radius=_(this.view.spatialReference).radius,this._horizonY=z(this.startCamera,this._referenceSphere,this._screenPickPoint),this._horizonPadding=null!=this._horizonY?S(this.startCamera,this._horizonY):null}_localInitHorizonValues(){const t=p();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=p();a(i,this.startCamera.eye,t,-this.startCamera.relativeElevation),u(i,t,this._referencePlane),this._horizonY=b(this.startCamera,this._referencePlane),this._horizonPadding=S(this.startCamera,this._horizonY)}_prepareGroundNavigation(){if(this._initHorizonValues(),!this._horizonY||!this._horizonPadding)return;this._momentumEstimator.reset(),this._ropeScreenHeight=this.startCamera.fullHeight/this.startCamera.pixelRatio;if(!j({view:this.view,originalScreenPoint:this._beginScreenPoint,horizonY:this._horizonY,horizonPadding:this._horizonPadding,outTranslation:this._ropeTranslation,outGrabLocation:this._adjustedScenePoint}))return void(this._validState=!1);const t=p();this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,t);const i=this.startCamera.viewRight,e=h(this._ropeTranslation,i),r=m(p(),t,i),o=h(this._ropeTranslation,r);l(this._forwardRopeComponent,r,o),l(this._sidewaysRopeComponent,i,e),u(this._adjustedScenePoint,t,this._ropePlane);const n=this._ropeScreenHeight-this._beginScreenPoint[1],s=this._ropeScreenHeight-this._horizonPadding[0];this._pointerOverHorizonVelocityAdjustment=0===s?1:Math.max(n/s,1)}_panningRopePull(t,i){if(!this._horizonY||!this._horizonPadding)return;const e=r(t.center,this._screenPointArray),o=this.startCamera.fullWidth/this.startCamera.pixelRatio*.5,n=(this._ropeScreenHeight-e[1])/(this._ropeScreenHeight-this._beginScreenPoint[1]),h=1-n,m=(e[0]-o)/(this._beginScreenPoint[0]-o),p=h*w.ySpeedMultiplier*this._pointerOverHorizonVelocityAdjustment,_=(h*w.xSpeedMultiplier+n*((1-m)*w.xSpeedMultiplier))*this._pointerOverHorizonVelocityAdjustment;l(this._ropeTranslation,this._forwardRopeComponent,p),a(this._ropeTranslation,this._ropeTranslation,this._sidewaysRopeComponent,_),this.currentCamera.eye=c(this._tmp3d,this.startCamera.eye,this._ropeTranslation),this.currentCamera.center=c(this._tmp3d,this.startCamera.center,this._ropeTranslation),this.momentumEnabled&&this._momentumEstimator.update(e,this._ropeTranslation,.001*t.timestamp),this._constraintOptions.interactionFactor=C(s(this._beginScreenPoint,e)),this._constraintOptions.interactionDirection=this._ropeTranslation,this._offsetCorrectionController.smoothlyCorrectGroundElevation(this.currentCamera,i,this._constraintOptions),this._constraintOptions.interactionDirection=null}createMomentum(){const t=this.momentumEnabled&&this._momentumEstimator.createMomentum();return t?new P({view:this.view,momentum:t}):null}};M=t([o("esri.views.3d.state.controllers.GroundNavigationController")],M);export{M as GroundNavigationController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as e,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as c,copy as l,subtract as _,length as v,normalize as P,add as f,scale as w,dot as u,cross as C,transformMat4 as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as x}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as j}from"../../layers/VoxelWasm.js";import{TiltRange as b}from"../Constraints.js";import{InteractiveController as R}from"./InteractiveController.js";import{excludeTerrain as M,normalizeCoordinate as V,getTiltScaleFactor as U,maxRotatePivotDistanceModifier as D,minRotatePivotDistance as O,inferNavigationMode as T,searchAreaSize as A}from"../utils/navigationUtils.js";let H=class extends R{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.pivot=0,this._rotScale=0,this._lastPoint=m(),this._tmpWorldUp=g(),this._tmpViewDir=g(),this._tmpRotCurPoint=m(),this._tmpTransf=h(),this._tmpAxis=g(),this._tmpPivotPoint=g(),this._pivotPos=g(),this._constraintOptions=new y(15,2,0,this.startCamera)}initialize(){this._rotScale=0===this.pivot?3:1.5}begin(t){if(this.running){switch(this.pivot){case 1:l(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=3,this._constraintOptions.tiltMode=1,this._constraintOptions.selection=0;break;case 0:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,this.view.groundView.invisible?M:{})&&!c(this.startCamera.eye,this._pivotPos);i||l(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(t,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=2,this._constraintOptions.tiltMode=0,this._constraintOptions.selection=11;break}}V(this.startCamera,t,this._lastPoint)}}_constrainPivotPoint(t,i){const s=this.startCamera,e=g();_(e,this._pivotPos,s.eye);const o=v(e),a=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(s.eye,F);let n=Math.max(U(F,s.viewForward,D)*a,O);i&&(n=Math.min(o,n));const h=r(s.width/s.pixelRatio*.5,s.height/s.pixelRatio*.5),p=T(this.startCamera,h,this.view.renderCoordsHelper,this.view.viewingMode);let m=this.view.stage.renderView.getMinimalDepthForArea(j(this.view),s.fullWidth/s.pixelRatio*.5,s.fullHeight/s.pixelRatio*.5,s,2.5*A,A),c=this.view.stage.renderView.getMinimalDepthForArea(j(this.view),t[0],t[1],s,A);null==m&&null==c||(m=m??c??0,c=null==c||1===p?m:c,n=m>c?c:m,n=i?Math.min(n,o):n),P(e,e),l(this._pivotPos,f(this._tmpPivotPoint,s.eye,w(this._tmpPivotPoint,e,n)))}update(t){if(this.running){switch(this.pivot){case 1:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this._pivotPos);break;case 0:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this._pivotPos)}x(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.running&&this.finishController()}_applyRotation(t,r,e,o){this.view.renderCoordsHelper.worldUpAtPosition(o,this._tmpWorldUp),V(t,r,this._tmpRotCurPoint);let h=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,m=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;_(this._tmpViewDir,e,o);const c=v(this._tmpViewDir),l=i(u(this._tmpViewDir,this._tmpWorldUp)/c);if(1===this.pivot){h*=-.5;const t=.5*Math.PI-l,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+l,b.min,b.max)-l,C(this._tmpAxis,t.up,this._tmpViewDir),0===this.pivot&&(m=-m),a(this._tmpTransf,m,this._tmpWorldUp),n(this._tmpTransf,this._tmpTransf,h,this._tmpAxis),d(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),t.up=d(W,t.up,this._tmpTransf),f(W,o,this._tmpViewDir),p(this._lastPoint,this._tmpRotCurPoint),W}};t([e()],H.prototype,"pivot",void 0),H=t([o("esri.views.3d.state.controllers.RotateController")],H);const W=g(),F=g();export{H as RotateController};
2
+ import{__decorate as t}from"tslib";import{acosClamped as i,clamp as s}from"../../../../core/mathUtils.js";import{createScreenPointArray as r}from"../../../../core/screenUtils.js";import{property as e,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as a,rotate as n}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{copy as p}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as m}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{exactEquals as c,copy as l,subtract as _,length as v,normalize as P,add as f,scale as w,dot as u,cross as C,transformMat4 as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as g}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{applyAll as x}from"../../camera/constraintUtils.js";import{ConstraintOptions as y}from"../../camera/constraintUtils/ConstraintOptions.js";import{getVoxelWasm as j}from"../../layers/VoxelWasm.js";import{TiltRange as b}from"../Constraints.js";import{InteractiveController as R}from"./InteractiveController.js";import{excludeTerrain as M,normalizeCoordinate as V,getTiltScaleFactor as U,maxRotatePivotDistanceModifier as D,minRotatePivotDistance as O,inferNavigationMode as T,searchAreaSize as A}from"../utils/navigationUtils.js";let H=class extends R{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(t){super(t),this.pivot=0,this._rotateScale=3,this._lastPoint=m(),this._tmpWorldUp=g(),this._tmpViewDir=g(),this._tmpRotCurPoint=m(),this._tmpTransf=h(),this._tmpAxis=g(),this._tmpPivotPoint=g(),this._pivotPos=g(),this._constraintOptions=new y(15,2,0,this.startCamera)}begin(t){if(this.running){switch(this.pivot){case 1:l(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=3,this._constraintOptions.tiltMode=1,this._constraintOptions.selection=0;break;case 0:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,this.view.groundView.invisible?M:{})&&!c(this.startCamera.eye,this._pivotPos);i||l(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(t,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=2,this._constraintOptions.tiltMode=0,this._constraintOptions.selection=11;break}}V(this.startCamera,t,this._lastPoint)}}_constrainPivotPoint(t,i){const s=this.startCamera,e=g();_(e,this._pivotPos,s.eye);const o=v(e),a=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(s.eye,F);let n=Math.max(U(F,s.viewForward,D)*a,O);i&&(n=Math.min(o,n));const h=r(s.width/s.pixelRatio*.5,s.height/s.pixelRatio*.5),p=T(this.startCamera,h,this.view.renderCoordsHelper,this.view.viewingMode);let m=this.view.stage.renderView.getMinimalDepthForArea(j(this.view),s.fullWidth/s.pixelRatio*.5,s.fullHeight/s.pixelRatio*.5,s,2.5*A,A),c=this.view.stage.renderView.getMinimalDepthForArea(j(this.view),t[0],t[1],s,A);null==m&&null==c||(m=m??c??0,c=null==c||1===p?m:c,n=m>c?c:m,n=i?Math.min(n,o):n),P(e,e),l(this._pivotPos,f(this._tmpPivotPoint,s.eye,w(this._tmpPivotPoint,e,n)))}update(t){if(this.running){switch(this.pivot){case 1:this.currentCamera.center=this._applyRotation(this.currentCamera,t,this.currentCamera.center,this._pivotPos);break;case 0:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,t,this.currentCamera.eye,this._pivotPos)}x(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.running&&this.finishController()}_applyRotation(t,r,e,o){this.view.renderCoordsHelper.worldUpAtPosition(o,this._tmpWorldUp),V(t,r,this._tmpRotCurPoint);let h=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotateScale,m=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotateScale;_(this._tmpViewDir,e,o);const c=v(this._tmpViewDir),l=i(u(this._tmpViewDir,this._tmpWorldUp)/c);if(1===this.pivot){h*=-.5;const t=.5*Math.PI-l,i=.5*Math.PI*.99;h=t-Math.max(-i,Math.min(i,t+h))}return h=s(h+l,b.min,b.max)-l,C(this._tmpAxis,t.up,this._tmpViewDir),0===this.pivot&&(m=-m),a(this._tmpTransf,m,this._tmpWorldUp),n(this._tmpTransf,this._tmpTransf,h,this._tmpAxis),d(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),t.up=d(W,t.up,this._tmpTransf),f(W,o,this._tmpViewDir),p(this._lastPoint,this._tmpRotCurPoint),W}};t([e()],H.prototype,"pivot",void 0),H=t([o("esri.views.3d.state.controllers.RotateController")],H);const W=g(),F=g();export{H as RotateController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{lerp as e}from"../../../../core/mathUtils.js";import t from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as r,createRenderScreenPointArray3 as n,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as s}from"../../../../core/units.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as c,normalize as a,dot as u,distance as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,copy as g,negativeInfinity as m,expandWithNestedArray as f}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as _}from"../../../../geometry/support/normalizeUtils.js";import{create as P}from"../../../../geometry/support/ray.js";import{sv3d as w}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as R}from"../../../../support/elevationInfoUtils.js";import{g as I}from"../../../../chunks/cameraUtilsSpherical.js";import{computeMapPointFromVec3d as v}from"../../support/hitTest.js";import{fromRenderAtEye as b,fromScreen as S}from"../../support/geometryUtils/ray.js";import{defaultTolerance as U,Intersector as j,defaultScreenPolygonPrimitiveProcessor as H}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as L,DrapedScreenPolygonIntersectionQuery as F}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as V}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as x,createSliceExtrusionHalfspacePlanes as M,clipPolygonAgainstSlicedAwayHalfspaces as T,sliceFilterPredicate as k}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as D}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";import{TaskPriority as E}from"../../../support/Scheduler.js";class C{constructor(e,r,n){this.viewingMode=e,this._forEachLayer=r,this._view=n,this._externalIntersectionHandlers=new t,this._tolerance=U,this._tmpRay=P(),this._tmpRegion=p(),this._validateHUDIntersector=new j(this.viewingMode),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(E.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),N(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,N(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,n){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,n),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,n=.5){return e.getRenderCenter(X,r,n),X[0]+=.0466,X[1]-=.0123,b(e,X,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,r)}async intersectIntersectorScreenPolygon(e,t,r){t.polygonResults.init();const n=this._view.state.camera,i=await D(n,e);null!=i&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(n,t,i,r,e))}*_intersectIntersectorScreenPolygon(e,t,r,n,i){const s=new Q(n,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!n||!("include"in n||"exclude"in n),t.camera=e,t.point=null,t.screenPolygonPrimitiveProcessor=H,yield*t.intersectScreenPolygon(s.layers,r);const o=this._view.slice.plane,l=o?new x(o):null;t.screenPolygonPrimitiveProcessor=l??H,yield*t.intersectScreenPolygon(s.sliceableLayers,r),t.screenPolygonPrimitiveProcessor=H,yield*this._intersectPolygonHandlersGenerator(t,s,r,null,l,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,s,r,n),yield*t.intersectHUDScreenPolygon(s.layers,r),t.screenPolygonPrimitiveProcessor=l??H,yield*t.intersectHUDScreenPolygon(s.sliceableLayers,r),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,r);const n=t.results.min;this._view.groundView.opaque||V(n)&&7!==n.intersector||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,r))}setTolerance(e=U){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}_getPickRay(e,t){const r=this._view.state.camera;return S(r,e,t)}_intersectRayFreePointLocal(e,t){return 2!==this.viewingMode||null==e||c(t,e.origin,a(w.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,n)}_intersectElevation(e,t,n=0,i=null){if(null==e)return null;const o=this._view,{renderCoordsHelper:l}=o,c=s(o.spatialReference),d=null!=t?t.mode:"absolute-height",y=R(t)/c,h=("on-the-ground"===d?0:y+n)*c/l.unitInMeters,{camera:p}=o.state;if("absolute-height"===d){const t=l?.getAltitude(p.eye),r=u(a(B,e.direction),l.worldUpAtPosition(p.eye,Y));if(t<h&&r<0||t>=h&&r>0)return null;if(l.intersectInfiniteManifold(e,h,B)){const e=v(o,B);return e.z??=0,e.z-=y,e}return null}const g=p.projectToRenderScreen(e.origin,r(w.get())),m=new Q(null,this._forEachLayer),f=o.slice.plane,_=f?k(f):null,P=new j(this.viewingMode);P.options.store=0,P.options.verticalOffset=h,P.options.normalRequired=!1;const I=this._createRayIntersectionQuery(e,g,!1);P.reset(I.beginPoint,I.endPoint,p),P.point=g;let b=null;if(i&&"type"in i&&"graphics"===i.type){const e=o.allLayerViews.find(e=>e.layer===i)?.uid;b=e?t=>t.layerViewUid===e:null}else i&&(b=e=>e.graphicUid!==i.uid);switch(d){case"relative-to-scene":{const e=e=>(!b||b(e))&&!!e.lastValidElevationBB;P.intersect(m.layers,I.screenPoint,this._tolerance,null,e),this._intersectRayHandlers(P,m,I,_,!1,e=>2===e.type||7===e.type||8===e.type,!1);break}case"on-the-ground":case"relative-to-ground":this._intersectRayHandlers(P,m,I,_,!1,e=>e.isGround,!1)}if(P.results.min.getIntersectionPoint(B)){const e=v(o,B);return e.z=n,e}return null}computeIntersection(e,t,n,i){if(null==e)return;const s=this._view.state.camera,o=s.projectToRenderScreen(e.origin,r(w.get())),l=new Q(i,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!i||!("include"in i||"exclude"in i);const c=this._createRayIntersectionQuery(e,o,n);t.reset(c.beginPoint,c.endPoint,s),t.intersect(l.layers,c.screenPoint,this._tolerance);const a=this._view.slice.plane,u=a?k(a):null;t.intersect(l.sliceableLayers,c.screenPoint,this._tolerance,u);const d=i&&(i.requiresGroundFeedback||i.enableDraped);this._intersectRayHandlers(t,l,c,u,!!d);const y=w.get(),h=this._view,p=h.groundView.spatialReference;if(i&&i.enableDraped&&null!=p&&t.results.ground.getIntersectionPoint(y)){const e=h.overlayManager.renderer,r=h.renderCoordsHelper.spatialReference,n=w.get();h.renderCoordsHelper.fromRenderCoords(y,n,p),n[2]=h.elevationProvider?.getElevation(y[0],y[1],y[2],r,"ground")??0,e.intersectRay(t,n,t.results.ground,e=>l.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){const t=e.results.hud;g(this._tmpRegion,m);const r=new Array,n=this._tmpRegion,i=e=>{r.push(new O(e))};e.sortResults(t.all),null!=t.min.distance&&i(t.min);for(const c of t.all)t.min.target.object!==c.target.object&&t.max.target.object!==c.target.object&&i(c);if(null!=t.max.distance&&t.max.target.object!==t.min.target.object&&i(t.max),!r.length)return;n[0]===n[2]&&(n[2]+=1),n[1]===n[3]&&(n[3]+=1);let s=!0;const o=null==e.results.max.distance;let l=0;for(const c of r)s&&(e.results.min.copy(c.result),s=!1),o&&e.results.max.copy(c.result),2===e.options.store&&e.results.all.splice(l++,0,c.result)}_createRayIntersectionQuery(e,t,r){return new L(e.origin,c(y(),e.origin,e.direction),t,r)}_intersectRayHandlers(e,t,r,n,i,s=()=>!0,o=!0){const{options:l}=e,c=l.isFiltered,a=l.filteredLayerViewUids;for(const{handler:u,filterPredicate:d,isFiltered:y,filteredLayerViewUids:h}of this._getFilteredIntersectionHandlers(t,n,null,s,o))(!y||u.isGround&&i)&&(l.isFiltered=y,l.filteredLayerViewUids=h,u.intersectRay(e,d,e.rayBegin,e.rayEnd,r.screenPoint,r.isVerticalRay));l.isFiltered=c,l.filteredLayerViewUids=a}*_intersectPolygonHandlersGenerator(e,t,r,n,i,s=()=>!0,o=!0,l){const{options:c}=e,a=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(const{handler:y,screenPolygonPrimitiveProcessor:h,isFiltered:p,filteredLayerViewUids:g}of this._getFilteredIntersectionHandlers(t,n,i,s,o))p||null==y.intersectScreenPolygon||(c.isFiltered=p,c.filteredLayerViewUids=g,e.screenPolygonPrimitiveProcessor=h??H,yield*y.intersectScreenPolygon(e,r,l));c.isFiltered=a,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,r,n){const{basemapTerrain:i,overlayManager:s}=this._view,o=null!=this._view.groundView.spatialReference&&!s.renderer.isEmpty;if(!e.options.selectionMode||!n?.enableDraped||!o)return;const l=yield*this._createDrapedPolygonIntersectionQueries(r,i.slicePlaneEnabled?this._view.slice.plane:null);null!=l&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,l,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(t,r){const{state:{camera:{eye:n}},pointsOfInterest:i}=this._view,s=this._view.groundView.spatialReference,c=new Array,a=r?new Array:null,u=I(this._view,i.focus.renderLocation),y=_(s);let p=Number.POSITIVE_INFINITY,g=null;const m=B,f=Y,P=e=>{if(!this._intersectDrapedScreenPolygonPoint(m,f,e))return!1;const t=null!=g&&y?g+y.shortestSignedDiff(g,m[0]):m[0];return g=t,c.push(l(t,m[1])),a&&a.push(h(f)),p=Math.min(p,d(n,f)),!0},{points:w}=t,{length:R}=w;for(let l=0;l<R;l++){const t=w[l],r=w[(l+1)%R];for(let n=0;n<u;n++){const i=n/u;if(!P(0===n?t:o(J,e(t[0],r[0],i),e(t[1],r[1],i))))return null;yield}}if(!Number.isFinite(p))return null;if(null==r||!a)return[z(c,p)];const v=this._clipDrapedScreenPolygonIntersectionQueries(a,r,y,n);return v.length>0?v:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,r,n){const i=new Array,s=M(t);for(const o of T(s,e)){const e=this._createDrapedQueryFromRenderPolygon(o,r,n);null!=e&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,t,r){const{renderCoordsHelper:n}=this._view,i=this._view.groundView.spatialReference,s=new Array;let o=Number.POSITIVE_INFINITY,c=null;for(const a of e){if(!n.fromRenderCoords(a,K,i))return null;const e=null!=c&&t?c+t.shortestSignedDiff(c,K[0]):K[0];c=e,s.push(l(e,K[1])),o=Math.min(o,d(r,a))}return s.length>=3&&Number.isFinite(o)?z(s,o):null}_intersectDrapedScreenPolygonPoint(e,t,r){const n=this._getPickRay(r,this._tmpRay);if(null==n)return!1;const{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,n,r)||i.intersectManifoldClosestSilhouette(n,0,t);const s=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,s)}_intersectGroundPoint(e,t,r){const n=this._view.state.camera,i=new Q(null,this._forEachLayer),s=new j(this.viewingMode);W[0]=r[0],W[1]=r[1],W[2]=0;const o=this._createRayIntersectionQuery(t,W,!1);return s.options.selectionMode=!0,s.options.store=0,s.options.normalRequired=!1,s.options.selectOpaqueTerrainOnly=!1,s.reset(o.beginPoint,o.endPoint,n),this._intersectRayHandlers(s,i,o,null,!0,e=>e.isGround,!1),s.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,r,n=()=>!0,i=!0){for(const s of this._externalIntersectionHandlers){if(!n(s))continue;let o=!1;const l=[];if(i){const t=s.layerViewUid,r=s.sublayerId,n=Array.isArray(t),i=n?t:[t];let c=!1;for(const s of i)e.filterLayerViewUid(s,r)?c=!0:n&&l.push(s);o=!c}yield new G(s,s.slicePlaneEnabled?t:null,s.slicePlaneEnabled?r:null,o,l)}}}class O{constructor(e){this.result=e,this.screenPoint=n()}}class G{constructor(e,t,r,n,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=r,this.isFiltered=n,this.filteredLayerViewUids=i}}let A;function N(e){return A&&A.viewingMode===e||(A=new j(e)),A}class Q{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){const{include:r,exclude:n}=this;if(null==e)return null==r&&null==n;const i=r instanceof Map?r.get(e)??!1:r?.has(e),s=n instanceof Map?n.get(e)??!1:n?.has(e);return(null==i||("boolean"==typeof i?i:null!=t&&i.has(t)))&&(null==s||!("boolean"==typeof s?s:null!=t&&s.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function q(e){return"object"==typeof e&&null!=e&&"intersectRay"in e}function z(e,t){return new F(e,f(p(m),e),t)}const B=y(),Y=y(),W=n(),J=i(),K=y(),X=n();export{C as SceneIntersectionHelper,q as isIntersectionHandler};
2
+ import{lerp as e}from"../../../../core/mathUtils.js";import t from"../../../../core/PooledArray.js";import{castRenderScreenPointArray3 as r,createRenderScreenPointArray3 as n,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{getMetersPerVerticalUnitForSR as s}from"../../../../core/units.js";import{set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{add as c,normalize as a,dot as u,distance as d}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as y,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,copy as g,negativeInfinity as m,expandWithNestedArray as f}from"../../../../geometry/support/aaBoundingRect.js";import{createSpatialReferenceCyclical as _}from"../../../../geometry/support/normalizeUtils.js";import{create as P}from"../../../../geometry/support/ray.js";import{sv3d as w}from"../../../../geometry/support/vectorStacks.js";import{getElevationOffsetInMeters as R}from"../../../../support/elevationInfoUtils.js";import{g as I}from"../../../../chunks/cameraUtilsSpherical.js";import{computeMapPointFromVec3d as v}from"../../support/hitTest.js";import{fromRenderAtEye as b,fromScreen as j}from"../../support/geometryUtils/ray.js";import{defaultTolerance as S,Intersector as U,defaultScreenPolygonPrimitiveProcessor as F}from"../../webgl-engine/lib/Intersector.js";import{RayIntersectionQuery as H,DrapedScreenPolygonIntersectionQuery as L}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{isValidIntersectorResult as V}from"../../webgl-engine/lib/IntersectorResult.js";import{SliceScreenPolygonPrimitiveProcessor as T,createSliceExtrusionHalfspacePlanes as x,clipPolygonAgainstSlicedAwayHalfspaces as M,sliceFilterPredicate as k}from"../../webgl-engine/lib/intersectorUtils.js";import{prepareScreenPolygonIntersectionQuery as D}from"../../webgl-engine/lib/screenPolygonIntersectionUtils.js";import{TaskPriority as E}from"../../../support/Scheduler.js";class C{constructor(e,r,n){this.viewingMode=e,this._forEachLayer=r,this._view=n,this._externalIntersectionHandlers=new t,this._tolerance=S,this._tmpRay=P(),this._tmpRegion=p(),this._validateHUDIntersector=new U(this.viewingMode),this._validateHUDIntersector.options.hud=!1,this._screenPolygonIntersectionTask=this._view.resourceController.scheduler.registerTask(E.SCREEN_POLYGON_INTERSECTION)}destroy(){this._screenPolygonIntersectionTask.remove(),this._externalIntersectionHandlers.prune()}get screenPolygonIntersectionTask(){return this._screenPolygonIntersectionTask}intersectScreen(e,t,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),N(this.viewingMode),t,r)}intersectScreenFreePointFallback(e,t,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),t,r)}intersectRayFreePointFallback(e,t,r){return this.intersectRay(e,N(this.viewingMode),t,r)||this._intersectRayFreePointLocal(e,t)}intersectRay(e,t,r,n){return t.options.selectionMode=!1,t.options.store=0,this.computeIntersection(e,t,!1,n),!!t.results.min&&t.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,t,r=.5,n=.5){return e.getRenderCenter(X,r,n),X[0]+=.0466,X[1]-=.0123,b(e,X,t)}intersectIntersectorScreen(e,t,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),t,!1,r)}async intersectIntersectorScreenPolygon(e,t,r){t.polygonResults.init();const n=this._view.state.camera,i=await D(n,e);null!=i&&await this._screenPolygonIntersectionTask.scheduleGenerator(e=>this._intersectIntersectorScreenPolygon(n,t,i,r,e))}*_intersectIntersectorScreenPolygon(e,t,r,n,i){const s=new Q(n,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!n||!("include"in n||"exclude"in n),t.camera=e,t.point=null,t.screenPolygonPrimitiveProcessor=F,yield*t.intersectScreenPolygon(s.layers,r);const o=this._view.slice.plane,l=o?new T(o):null;t.screenPolygonPrimitiveProcessor=l??F,yield*t.intersectScreenPolygon(s.sliceableLayers,r),t.screenPolygonPrimitiveProcessor=F,yield*this._intersectPolygonHandlersGenerator(t,s,r,null,l,void 0,!0,i),yield*this._intersectDrapedScreenPolygon(t,s,r,n),yield*t.intersectHUDScreenPolygon(s.layers,r),t.screenPolygonPrimitiveProcessor=l??F,yield*t.intersectHUDScreenPolygon(s.sliceableLayers,r),t.polygonResults.sortResults()}intersectToolIntersectorScreen(e,t,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,t,r)}intersectToolIntersectorRay(e,t,r){t.options.selectionMode=!0,this.computeIntersection(e,t,!1,r);const n=t.results.min;this._view.groundView.opaque||V(n)&&7!==n.intersector||(t.options.selectionMode=!1,this.computeIntersection(e,t,!1,r))}setTolerance(e=S){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}removeIntersectionHandler(e){null!=this._externalIntersectionHandlers.removeUnordered(e)&&this._externalIntersectionHandlers.sort((e,t)=>7===e.type?1:7===t.type?-1:0)}_getPickRay(e,t){const r=this._view.state.camera;return j(r,e,t)}_intersectRayFreePointLocal(e,t){return 2!==this.viewingMode||null==e||c(t,e.origin,a(w.get(),e.direction)),!1}intersectElevationFromScreen(e,t,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),t,r,n)}_intersectElevation(e,t,n=0,i=null){if(null==e)return null;const o=this._view,{renderCoordsHelper:l}=o,c=s(o.spatialReference),d=null!=t?t.mode:"absolute-height",y=R(t)/c,h=("on-the-ground"===d?0:y+n)*c/l.unitInMeters,{camera:p}=o.state;if("absolute-height"===d){const t=l?.getAltitude(p.eye),r=u(a(B,e.direction),l.worldUpAtPosition(p.eye,Y));if(t<h&&r<0||t>=h&&r>0)return null;if(l.intersectInfiniteManifold(e,h,B)){const e=v(o,B);return e.z??=0,e.z-=y,e}return null}const g=p.projectToRenderScreen(e.origin,r(w.get())),m=new Q(null,this._forEachLayer),f=o.slice.plane,_=f?k(f):null,P=new U(this.viewingMode);P.options.store=0,P.options.verticalOffset=h,P.options.normalRequired=!1;const I=this._createRayIntersectionQuery(e,g,!1);P.reset(I.beginPoint,I.endPoint,p),P.point=g;let b=null;if(i&&"type"in i&&"graphics"===i.type){const e=o.allLayerViews.find(e=>e.layer===i)?.uid;b=e?t=>t.layerViewUid===e:null}else i&&(b=e=>e.graphicUid!==i.uid);switch(d){case"relative-to-scene":{const e=e=>(!b||b(e))&&!!e.lastValidElevationBB;P.intersect(m.layers,I.screenPoint,this._tolerance,null,e),this._intersectRayHandlers(P,m,I,_,!1,e=>2===e.type||7===e.type||8===e.type,!1);break}case"on-the-ground":case"relative-to-ground":this._intersectRayHandlers(P,m,I,_,!1,e=>e.isGround,!1)}if(P.results.min.getIntersectionPoint(B)){const e=v(o,B);return e.z=n,e}return null}computeIntersection(e,t,n,i){if(null==e)return;const s=this._view.state.camera,o=s.projectToRenderScreen(e.origin,r(w.get())),l=new Q(i,this._forEachLayer);t.options.selectOpaqueTerrainOnly=!i||!("include"in i||"exclude"in i);const c=this._createRayIntersectionQuery(e,o,n);t.reset(c.beginPoint,c.endPoint,s),t.intersect(l.layers,c.screenPoint,this._tolerance,null,l.objectFilter);const a=this._view.slice.plane,u=a?k(a):null;t.intersect(l.sliceableLayers,c.screenPoint,this._tolerance,u,l.objectFilter);const d=i&&(i.requiresGroundFeedback||i.enableDraped);this._intersectRayHandlers(t,l,c,u,!!d,e=>null==l.allowedIntersectorTypes||l.allowedIntersectorTypes.has(e.type));const y=w.get(),h=this._view,p=h.groundView.spatialReference;if(i&&i.enableDraped&&null!=p&&t.results.ground.getIntersectionPoint(y)){const e=h.overlayManager.renderer,r=h.renderCoordsHelper.spatialReference,n=w.get();h.renderCoordsHelper.fromRenderCoords(y,n,p),n[2]=h.elevationProvider?.getElevation(y[0],y[1],y[2],r,"ground")??0,e.intersectRay(t,n,t.results.ground,e=>l.filterRenderGeometry(e))}t.sortResults(),this._processHUDResults(t)}_processHUDResults(e){const t=e.results.hud;g(this._tmpRegion,m);const r=new Array,n=this._tmpRegion,i=e=>{r.push(new O(e))};e.sortResults(t.all),null!=t.min.distance&&i(t.min);for(const c of t.all)t.min.target.object!==c.target.object&&t.max.target.object!==c.target.object&&i(c);if(null!=t.max.distance&&t.max.target.object!==t.min.target.object&&i(t.max),!r.length)return;n[0]===n[2]&&(n[2]+=1),n[1]===n[3]&&(n[3]+=1);let s=!0;const o=null==e.results.max.distance;let l=0;for(const c of r)s&&(e.results.min.copy(c.result),s=!1),o&&e.results.max.copy(c.result),2===e.options.store&&e.results.all.splice(l++,0,c.result)}_createRayIntersectionQuery(e,t,r){return new H(e.origin,c(y(),e.origin,e.direction),t,r)}_intersectRayHandlers(e,t,r,n,i,s=()=>!0,o=!0){const{options:l}=e,c=l.isFiltered,a=l.filteredLayerViewUids;for(const{handler:u,filterPredicate:d,isFiltered:y,filteredLayerViewUids:h}of this._getFilteredIntersectionHandlers(t,n,null,s,o))(!y||u.isGround&&i)&&(l.isFiltered=y,l.filteredLayerViewUids=h,u.intersectRay(e,d,e.rayBegin,e.rayEnd,r.screenPoint,r.isVerticalRay));l.isFiltered=c,l.filteredLayerViewUids=a}*_intersectPolygonHandlersGenerator(e,t,r,n,i,s=()=>!0,o=!0,l){const{options:c}=e,a=c.isFiltered,u=c.filteredLayerViewUids,d=e.screenPolygonPrimitiveProcessor;for(const{handler:y,screenPolygonPrimitiveProcessor:h,isFiltered:p,filteredLayerViewUids:g}of this._getFilteredIntersectionHandlers(t,n,i,s,o))p||null==y.intersectScreenPolygon||(c.isFiltered=p,c.filteredLayerViewUids=g,e.screenPolygonPrimitiveProcessor=h??F,yield*y.intersectScreenPolygon(e,r,l));c.isFiltered=a,c.filteredLayerViewUids=u,e.screenPolygonPrimitiveProcessor=d}*_intersectDrapedScreenPolygon(e,t,r,n){const{basemapTerrain:i,overlayManager:s}=this._view,o=null!=this._view.groundView.spatialReference&&!s.renderer.isEmpty;if(!e.options.selectionMode||!n?.enableDraped||!o)return;const l=yield*this._createDrapedPolygonIntersectionQueries(r,i.slicePlaneEnabled?this._view.slice.plane:null);null!=l&&(yield*this._view.overlayManager.renderer.intersectScreenPolygon(e,l,e=>t.filterRenderGeometry(e)))}*_createDrapedPolygonIntersectionQueries(t,r){const{state:{camera:{eye:n}},pointsOfInterest:i}=this._view,s=this._view.groundView.spatialReference,c=new Array,a=r?new Array:null,u=I(this._view,i.focus.renderLocation),y=_(s);let p=Number.POSITIVE_INFINITY,g=null;const m=B,f=Y,P=e=>{if(!this._intersectDrapedScreenPolygonPoint(m,f,e))return!1;const t=null!=g&&y?g+y.shortestSignedDiff(g,m[0]):m[0];return g=t,c.push(l(t,m[1])),a&&a.push(h(f)),p=Math.min(p,d(n,f)),!0},{points:w}=t,{length:R}=w;for(let l=0;l<R;l++){const t=w[l],r=w[(l+1)%R];for(let n=0;n<u;n++){const i=n/u;if(!P(0===n?t:o(J,e(t[0],r[0],i),e(t[1],r[1],i))))return null;yield}}if(!Number.isFinite(p))return null;if(null==r||!a)return[z(c,p)];const v=this._clipDrapedScreenPolygonIntersectionQueries(a,r,y,n);return v.length>0?v:null}_clipDrapedScreenPolygonIntersectionQueries(e,t,r,n){const i=new Array,s=x(t);for(const o of M(s,e)){const e=this._createDrapedQueryFromRenderPolygon(o,r,n);null!=e&&i.push(e)}return i.sort((e,t)=>e.distance-t.distance),i}_createDrapedQueryFromRenderPolygon(e,t,r){const{renderCoordsHelper:n}=this._view,i=this._view.groundView.spatialReference,s=new Array;let o=Number.POSITIVE_INFINITY,c=null;for(const a of e){if(!n.fromRenderCoords(a,K,i))return null;const e=null!=c&&t?c+t.shortestSignedDiff(c,K[0]):K[0];c=e,s.push(l(e,K[1])),o=Math.min(o,d(r,a))}return s.length>=3&&Number.isFinite(o)?z(s,o):null}_intersectDrapedScreenPolygonPoint(e,t,r){const n=this._getPickRay(r,this._tmpRay);if(null==n)return!1;const{renderCoordsHelper:i}=this._view;this._intersectGroundPoint(t,n,r)||i.intersectManifoldClosestSilhouette(n,0,t);const s=this._view.groundView.spatialReference;return!!i.fromRenderCoords(t,e,s)}_intersectGroundPoint(e,t,r){const n=this._view.state.camera,i=new Q(null,this._forEachLayer),s=new U(this.viewingMode);W[0]=r[0],W[1]=r[1],W[2]=0;const o=this._createRayIntersectionQuery(t,W,!1);return s.options.selectionMode=!0,s.options.store=0,s.options.normalRequired=!1,s.options.selectOpaqueTerrainOnly=!1,s.reset(o.beginPoint,o.endPoint,n),this._intersectRayHandlers(s,i,o,null,!0,e=>e.isGround,!1),s.results.ground.getIntersectionPoint(e)}*_getFilteredIntersectionHandlers(e,t,r,n=()=>!0,i=!0){for(const s of this._externalIntersectionHandlers){if(!n(s))continue;let o=!1;const l=[];if(i){const t=s.layerViewUid,r=s.sublayerId,n=Array.isArray(t),i=n?t:[t];let c=!1;for(const s of i)e.filterLayerViewUid(s,r)?c=!0:n&&l.push(s);o=!c}yield new G(s,s.slicePlaneEnabled?t:null,s.slicePlaneEnabled?r:null,o,l)}}}class O{constructor(e){this.result=e,this.screenPoint=n()}}class G{constructor(e,t,r,n,i){this.handler=e,this.filterPredicate=t,this.screenPolygonPrimitiveProcessor=r,this.isFiltered=n,this.filteredLayerViewUids=i}}let A;function N(e){return A&&A.viewingMode===e||(A=new U(e)),A}class Q{constructor(e,t){this.layers=new Array,this.sliceableLayers=new Array,this.include=e?.include,this.exclude=e?.exclude,this.objectFilter=e?.objectFilter,this.allowedIntersectorTypes=e?.allowedIntersectorTypes,t(e=>{e.pickable&&this.filterLayerViewUid(e.apiLayerViewUid)&&(e.sliceable?this.sliceableLayers:this.layers).push(e)})}filterLayerViewUid(e,t){const{include:r,exclude:n}=this;if(null==e)return null==r&&null==n;const i=r instanceof Map?r.get(e)??!1:r?.has(e),s=n instanceof Map?n.get(e)??!1:n?.has(e);return(null==i||("boolean"==typeof i?i:null!=t&&i.has(t)))&&(null==s||!("boolean"==typeof s?s:null!=t&&s.has(t)))}filterRenderGeometry(e){return this.filterLayerViewUid(e.layerViewUid)}}function q(e){return"object"==typeof e&&null!=e&&"intersectRay"in e}function z(e,t){return new L(e,f(p(m),e),t)}const B=y(),Y=y(),W=n(),J=i(),K=y(),X=n();export{C as SceneIntersectionHelper,q as isIntersectionHandler};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{clamp as t}from"../../../../core/mathUtils.js";import{dot as e,distance as i,subtract as r,scale as s,add as n,copy as o,normalize as a,cross as m,scaleAndAdd as c}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _}from"../../../../geometry/support/ray.js";import{applyConstraintsAndUpdateCenterRenderCamera as d}from"../../camera/constraintUtils.js";import{Intersector as u}from"../../webgl-engine/lib/Intersector.js";const l=.5,y=1e-5,f=5;class v{constructor(t){this._view=t,this._tmpRay=_(),this._tmpWorldUp=p(),this._tmpScaledUp=p(),this._tmpCorrectionOffset=p(),this._tmpUpdatedCameraPos=p(),this._tmpCenterDiff=p(),this._tmpMovementDelta=p(),this._tmpPerpendicularMovementDelta=p(),this._tmpGroundIntersections=[p(),p(),p()],this._tmpGroundIntersectionHits=[!1,!1,!1],this._tmpRayOrigins=[p(),p(),p()],this._tmpRayDirection=p(),this._previousCameraPosition=null,this._intersector=new u(this._view.state.viewingMode)}smoothlyCorrectGroundElevation(t,i,r,s){const n=this._prepareMode(s);if(!n)return 0;const o=this._view.renderCoordsHelper.worldUpAtPosition(t.eye,this._tmpWorldUp),a=this._prepareCameraAndPreviousIterationPosition(t,o,this._previousCameraPosition),m=this._prepareRays(t,o,a),c=this._intersectRays(n,o,m);if(!c.hasIntersection){const e=this._adjustCameraElevation(t,o,0,r);return this._previousCameraPosition=h(e),0}const p=this._filterRayResults(o,a,c),_=this._getSmoothedElevationCorrection(n,p,t,o,a,i),d=this._adjustCameraElevation(t,o,_,r);return this._previousCameraPosition=h(d),Math.abs(p-e(d,o))}immediatelyCorrectGroundElevation(t,s=Number.POSITIVE_INFINITY,n,o){const a=this._prepareMode(o);if(!a)return;const m=this._view.renderCoordsHelper.worldUpAtPosition(t.eye,this._tmpWorldUp),c=this._prepareRays(t,m),p=this._intersectRays(a,m,c),h=p.intersections[0];!p.hasIntersection||i(t.eye,h)>s?this._adjustCameraElevation(t,m,0,n):this._adjustCameraElevation(t,m,e(m,r(this._tmpCorrectionOffset,h,t.eye)),n)}_prepareMode(t){const e=t??this._view.navigation.mode;return"ground"===e.type&&e.offset?e:null}_prepareCameraAndPreviousIterationPosition(t,i,r){if(r){const o=e(i,t.eye),a=e(i,r);return s(this._tmpCorrectionOffset,i,a-o),t.eye=n(this._tmpUpdatedCameraPos,t.eye,this._tmpCorrectionOffset),t.center=n(this._tmpUpdatedCameraPos,t.center,this._tmpCorrectionOffset),r}return t.eye}_prepareRays(t,e,i){const r=s(this._tmpRayDirection,e,-1e5);if(o(this._tmpRayOrigins[0],t.eye),!i)return{origins:this._tmpRayOrigins,direction:r,count:1};const{forwardMovementDirection:n,rightMovementDirection:a}=this._getMovementDirections(t.eye,i,e);return this._getLeftRayOrigin(t.eye,n,a,this._tmpRayOrigins[1]),this._getRightRayOrigin(t.eye,n,a,this._tmpRayOrigins[2]),{origins:this._tmpRayOrigins,direction:r,count:this._tmpRayOrigins.length}}_getMovementDirections(t,i,n){const o=r(this._tmpMovementDelta,t,i);r(o,o,s(this._tmpScaledUp,n,e(n,o))),a(o,o);return{forwardMovementDirection:o,rightMovementDirection:m(this._tmpPerpendicularMovementDelta,o,n)}}_getLeftRayOrigin(t,e,i,r){return c(r,t,e,l),c(r,r,i,-l),r}_getRightRayOrigin(t,e,i,r){return c(r,t,e,l),c(r,r,i,l),r}_intersectRays(t,e,i){const r=t.offset,s=this._view.sceneIntersectionHelper,n=g(t);o(this._tmpRay.direction,i.direction);for(let m=0;m<i.count;m++)o(this._tmpRay.origin,i.origins[m]),this._tmpGroundIntersectionHits[m]=s.intersectRay(this._tmpRay,this._intersector,this._tmpGroundIntersections[m],n),this._tmpGroundIntersectionHits[m]&&c(this._tmpGroundIntersections[m],this._tmpGroundIntersections[m],e,r);const a=this._tmpGroundIntersectionHits.some((t,e)=>e<i.count&&t);return{intersections:this._tmpGroundIntersections,hits:this._tmpGroundIntersectionHits,count:i.count,hasIntersection:a}}_filterRayResults(t,i,r){const s=e(i,t);let n=null;for(let o=0;o<r.count;o++){if(!r.hits[o])continue;const i=r.intersections[o],a=e(i,t);(null==n||Math.abs(a-s)<Math.abs(n-s))&&(n=a)}return n}_getSmoothedElevationCorrection(i,r,s,n,o,a){const m=y**a,c=e(o,n)*m+r*(1-m),p=e(s.eye,n),h=f*a*(i.offset??0);return t(c-p,-h,h)}_adjustCameraElevation(t,e,i,s){return 0!==i&&(c(this._tmpUpdatedCameraPos,t.eye,e,i),r(this._tmpCenterDiff,t.center,t.eye),t.eye=this._tmpUpdatedCameraPos,t.center=n(this._tmpUpdatedCameraPos,this._tmpUpdatedCameraPos,this._tmpCenterDiff)),d(this._view,t,s),t.eye}}function g(t){const e=C(t.include)?t.include:void 0,i=C(t.exclude)?t.exclude:void 0;return e||i?{include:e,exclude:i}:void 0}function C(t){return null!=t&&t.size>0}export{v as OffsetCorrectionController};
2
+ import{clamp as t}from"../../../../core/mathUtils.js";import{dot as e,distance as i,subtract as r,scale as s,add as n,copy as o,normalize as a,cross as c,scaleAndAdd as m}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p,clone as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as _}from"../../../../geometry/support/ray.js";import{applyConstraintsAndUpdateCenterRenderCamera as u}from"../../camera/constraintUtils.js";import{Intersector as d}from"../../webgl-engine/lib/Intersector.js";const l=.5,y=1e-5,f=5,v=new Set([0,2,7,8]);class g{constructor(t){this._view=t,this._tmpRay=_(),this._tmpWorldUp=p(),this._tmpScaledUp=p(),this._tmpCorrectionOffset=p(),this._tmpUpdatedCameraPos=p(),this._tmpCenterDiff=p(),this._tmpMovementDelta=p(),this._tmpPerpendicularMovementDelta=p(),this._tmpGroundIntersections=[p(),p(),p()],this._tmpGroundIntersectionHits=[!1,!1,!1],this._tmpRayOrigins=[p(),p(),p()],this._tmpRayDirection=p(),this._previousCameraPosition=null,this._intersector=new d(this._view.state.viewingMode)}smoothlyCorrectGroundElevation(t,i,r,s){const n=this._prepareMode(s);if(!n)return 0;const o=this._view.renderCoordsHelper.worldUpAtPosition(t.eye,this._tmpWorldUp),a=this._prepareCameraAndPreviousIterationPosition(t,o,this._previousCameraPosition),c=this._prepareRays(t,o,a),m=this._intersectRays(n,o,c);if(!m.hasIntersection){const e=this._adjustCameraElevation(t,o,0,r);return this._previousCameraPosition=h(e),0}const p=this._filterRayResults(o,a,m),_=this._getSmoothedElevationCorrection(n,p,t,o,a,i),u=this._adjustCameraElevation(t,o,_,r);return this._previousCameraPosition=h(u),Math.abs(p-e(u,o))}immediatelyCorrectGroundElevation(t,s=Number.POSITIVE_INFINITY,n,o){const a=this._prepareMode(o);if(!a)return;const c=this._view.renderCoordsHelper.worldUpAtPosition(t.eye,this._tmpWorldUp),m=this._prepareRays(t,c),p=this._intersectRays(a,c,m),h=p.intersections[0];!p.hasIntersection||i(t.eye,h)>s?this._adjustCameraElevation(t,c,0,n):this._adjustCameraElevation(t,c,e(c,r(this._tmpCorrectionOffset,h,t.eye)),n)}_prepareMode(t){const e=t??this._view.navigation.mode;return"ground"===e.type&&e.offset?e:null}_prepareCameraAndPreviousIterationPosition(t,i,r){if(r){const o=e(i,t.eye),a=e(i,r);return s(this._tmpCorrectionOffset,i,a-o),t.eye=n(this._tmpUpdatedCameraPos,t.eye,this._tmpCorrectionOffset),t.center=n(this._tmpUpdatedCameraPos,t.center,this._tmpCorrectionOffset),r}return t.eye}_prepareRays(t,e,i){const r=s(this._tmpRayDirection,e,-1e5);if(o(this._tmpRayOrigins[0],t.eye),!i)return{origins:this._tmpRayOrigins,direction:r,count:1};const{forwardMovementDirection:n,rightMovementDirection:a}=this._getMovementDirections(t.eye,i,e);return this._getLeftRayOrigin(t.eye,n,a,this._tmpRayOrigins[1]),this._getRightRayOrigin(t.eye,n,a,this._tmpRayOrigins[2]),{origins:this._tmpRayOrigins,direction:r,count:this._tmpRayOrigins.length}}_getMovementDirections(t,i,n){const o=r(this._tmpMovementDelta,t,i);r(o,o,s(this._tmpScaledUp,n,e(n,o))),a(o,o);return{forwardMovementDirection:o,rightMovementDirection:c(this._tmpPerpendicularMovementDelta,o,n)}}_getLeftRayOrigin(t,e,i,r){return m(r,t,e,l),m(r,r,i,-l),r}_getRightRayOrigin(t,e,i,r){return m(r,t,e,l),m(r,r,i,l),r}_intersectRays(t,e,i){const r=t.offset,s=this._view.sceneIntersectionHelper,n=C(t);o(this._tmpRay.direction,i.direction);for(let c=0;c<i.count;c++)o(this._tmpRay.origin,i.origins[c]),this._tmpGroundIntersectionHits[c]=s.intersectRay(this._tmpRay,this._intersector,this._tmpGroundIntersections[c],n),this._tmpGroundIntersectionHits[c]&&m(this._tmpGroundIntersections[c],this._tmpGroundIntersections[c],e,r);const a=this._tmpGroundIntersectionHits.some((t,e)=>e<i.count&&t);return{intersections:this._tmpGroundIntersections,hits:this._tmpGroundIntersectionHits,count:i.count,hasIntersection:a}}_filterRayResults(t,i,r){const s=e(i,t);let n=null;for(let o=0;o<r.count;o++){if(!r.hits[o])continue;const i=r.intersections[o],a=e(i,t);(null==n||Math.abs(a-s)<Math.abs(n-s))&&(n=a)}return n}_getSmoothedElevationCorrection(i,r,s,n,o,a){const c=y**a,m=e(o,n)*c+r*(1-c),p=e(s.eye,n),h=f*a*(i.offset??0);return t(m-p,-h,h)}_adjustCameraElevation(t,e,i,s){return 0!==i&&(m(this._tmpUpdatedCameraPos,t.eye,e,i),r(this._tmpCenterDiff,t.center,t.eye),t.eye=this._tmpUpdatedCameraPos,t.center=n(this._tmpUpdatedCameraPos,this._tmpUpdatedCameraPos,this._tmpCenterDiff)),u(this._view,t,s),t.eye}}function C(t){return R(t.include)?{include:t.include,exclude:t.exclude}:{exclude:t.exclude,objectFilter:t=>!!t.lastValidElevationBB,allowedIntersectorTypes:v}}function R(t){return null!=t&&t.size>0}export{g as OffsetCorrectionController};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as t,dist as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ONES as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as n}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as u}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as s}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as c}from"../../layers/graphics/olidUtils.js";import{Attribute as p}from"../../webgl-engine/lib/Attribute.js";import{Geometry as f}from"../../webgl-engine/lib/Geometry.js";function m(t,e,r=null){const o=[],n=e.mapPositions,i=h(e,o),a=i.data,u=i.indices.length,s=l(u);return g(e,o,s),w(e,o,s),b(e,o,s),y(e,o,i.indices,s),d(e,o,i.indices,s),D(e,o),F(e,o,i.indices,s),j(e,o,a),null!=r&&c(o,r,s),new f(t,o,n)}function h(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:o}=t,n=r.length/3,i=n>2&&A(r)&&o,a=n-(i?1:0),u=new Array(2*(a-1)),s=i?r.slice(0,-3):r;let l=0;for(let p=0;p<a-1;p++)u[l++]=p,u[l++]=p+1;const c=new p(s,u,3,i);return e.push(["position",c]),c}function g(t,e,r){if(null!=t.attributeData.colorFeature)return;const n=t.attributeData.color;e.push(["color",new p(n??o,r,4)])}function b(t,e,r){t.attributeData.normal&&e.push(["normal",new p(t.attributeData.normal,r,3)])}function y(t,e,r,o){const n=t.attributeData.colorFeature;null!=n&&("number"==typeof n?e.push(["colorFeatureAttribute",new p([n],o,1,!0)]):e.push(["colorFeatureAttribute",new p(n,r,1,!0)]))}function w(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new p([t.attributeData.size??1],r,1,!0)])}function d(t,e,r,o){const n=t.attributeData.sizeFeature;null!=n&&("number"==typeof n?e.push(["sizeFeatureAttribute",new p([n],o,1,!0)]):e.push(["sizeFeatureAttribute",new p(n,r,1,!0)]))}function D(t,e){const{attributeData:{position:r,timeStamps:o}}=t;if(!o)return;const n=r.length/3,i=new Array(2*(n-1));let a=0;for(let u=0;u<n-1;u++)i[a++]=u,i[a++]=u+1;e.push(["timeStamps",new p(o,i,S,!0)])}function F(t,e,r,o){const n=t.attributeData.opacityFeature;null!=n&&("number"==typeof n?e.push(["opacityFeatureAttribute",new p([n],o,1,!0)]):e.push(["opacityFeatureAttribute",new p(n,r,1,!0)]))}function j({overlayInfo:r},o,s){if(null==r||1!==r.renderCoordsHelper.viewingMode||!r.spatialReference.isGeographic)return;const l=a(s.length),c=n(r.spatialReference);for(let t=0;t<l.length;t+=3)i(s,t,l,t,c);const f=s.length/3,m=u(f+1);let h=v,g=z,b=0,y=0;t(h,l[y++],l[y++]),y++,m[0]=0;for(let n=1;n<f+1;++n)n===f&&(y=0),t(g,l[y++],l[y++]),y++,b+=e(h,g),m[n]=b,[h,g]=[g,h];o.push(["distanceToStart",new p(m,o[0][1].indices,1,!0)])}function A(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}const v=r(),z=r(),S=4;function E(t,e,r,o,n){if(null==t||0===t.length)return[];const i=[];return t.forEach((t,u)=>{const s=t.length,l=a(3*s);t.forEach((t,e)=>{l[3*e]=t[0],l[3*e+1]=t[1],l[3*e+2]=t[2]});const c={attributeData:{position:l,normal:e,colorFeature:r?.[u],opacityFeature:o?.[u],sizeFeature:n?.[u]},removeDuplicateStartEnd:!1};i.push(c)}),i}function x(t,e,r,o,n,i){if(null==t||0===t.length)return[];const a=E(t,e,o,n,i);return t.forEach((t,e)=>{const o=r?.[e],n=null!=o?H(o.timeStamps,o.stage):void 0;a[e].attributeData.timeStamps=n}),a}function G(t,e=0,r=.01){const o=s(t.length);o[0]=0;for(let i=1;i<t.length;i++){const e=t[i-1],r=t[i],n=Math.sqrt((r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2);o[i]=o[i-1]+n}const n=o.map(t=>t*r);if(0!==e&&e<n.length){const t=n[e];for(let e=0;e<n.length;e++)n[e]-=t}return n}function H(t,e){const r=s(t.length*S),o=t[0],n=t[t.length-1];for(let i=0;i<t.length;i++)r[i*S]=t[i],r[i*S+1]=o,r[i*S+2]=n,r[i*S+3]=e+.5;return r}export{x as animatedLineStripsToParameters,m as createGeometry,G as getLinearTimeStamps,E as lineStripsToParameters,S as numTimeStampValuesPerVertex,H as timeStampsToAttribute};
2
+ import{set as t,dist as e}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{ONES as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{getReferenceEllipsoid as o}from"../../../../geometry/ellipsoidUtils.js";import{lonLatToWebMercatorComparable as i}from"../../../../geometry/projection/projectors.js";import{newDoubleArray as a}from"../../../../geometry/support/DoubleArray.js";import{newFloatArray as s}from"../../../../geometry/support/FloatArray.js";import{newHalfFloatArray as u}from"../../../../geometry/support/HalfFloatArray.js";import{getZeroIndexArray as l}from"../../../../geometry/support/Indices.js";import{addOlidAttribute as c}from"../../layers/graphics/olidUtils.js";import{getPlanarDistanceToGroundRatio as p}from"../planarDistanceToGroundRatio.js";import{Attribute as m}from"../../webgl-engine/lib/Attribute.js";import{Geometry as f}from"../../webgl-engine/lib/Geometry.js";import{isImagePattern as g}from"../../webgl-engine/materials/lineStippleUtils.js";function h(t,e,r=null){const n=[],o=e.mapPositions,i=b(e,n),a=i.data,s=i.indices.length,u=l(s);return w(e,n,u),D(e,n,u),y(e,n,u),d(e,n,i.indices,u),j(e,n,i.indices,u),F(e,n),A(e,n,i.indices,u),v(t,e,n,a),null!=r&&c(n,r,u),new f(t,n,o)}function b(t,e){const{attributeData:{position:r},removeDuplicateStartEnd:n}=t,o=r.length/3,i=o>2&&S(r)&&n,a=o-(i?1:0),s=new Array(2*(a-1)),u=i?r.slice(0,-3):r;let l=0;for(let p=0;p<a-1;p++)s[l++]=p,s[l++]=p+1;const c=new m(u,s,3,i);return e.push(["position",c]),c}function w(t,e,r){if(null!=t.attributeData.colorFeature)return;const o=t.attributeData.color;e.push(["color",new m(o??n,r,4)])}function y(t,e,r){t.attributeData.normal&&e.push(["normal",new m(t.attributeData.normal,r,3)])}function d(t,e,r,n){const o=t.attributeData.colorFeature;null!=o&&("number"==typeof o?e.push(["colorFeatureAttribute",new m([o],n,1,!0)]):e.push(["colorFeatureAttribute",new m(o,r,1,!0)]))}function D(t,e,r){null==t.attributeData.sizeFeature&&e.push(["size",new m([t.attributeData.size??1],r,1,!0)])}function j(t,e,r,n){const o=t.attributeData.sizeFeature;null!=o&&("number"==typeof o?e.push(["sizeFeatureAttribute",new m([o],n,1,!0)]):e.push(["sizeFeatureAttribute",new m(o,r,1,!0)]))}function F(t,e){const{attributeData:{position:r,timeStamps:n}}=t;if(!n)return;const o=r.length/3,i=new Array(2*(o-1));let a=0;for(let s=0;s<o-1;s++)i[a++]=s,i[a++]=s+1;e.push(["timeStamps",new m(n,i,P,!0)])}function A(t,e,r,n){const o=t.attributeData.opacityFeature;null!=o&&("number"==typeof o?e.push(["opacityFeatureAttribute",new m([o],n,1,!0)]):e.push(["opacityFeatureAttribute",new m(o,r,1,!0)]))}function v(r,{overlayInfo:n},u,l){const c=r.parameters;if(null==n||!z(c)||null==c.stipplePattern)return;const{renderCoordsHelper:f,spatialReference:h}=n,b=h.isGeographic&&1===f.viewingMode,w=c.worldSized||g(c.stipplePattern);if(!w&&!b)return;let y=l;if(b){const t=a(l.length),e=o(h);for(let r=0;r<t.length;r+=3)i(l,r,t,r,e);y=t}const d=l.length/3,D=s(d+1),j=1===f.viewingMode;let F=E,A=x,v=0,S=0,P=0;t(F,y[S++],y[S++]),S++,D[0]=0;for(let o=1;o<d+1;++o){o===d&&(S=0);const r=S;t(A,y[S++],y[S++]),S++;const n=(l[P+1]+l[r+1])/2,i=w?p(h,j,n):1;v+=e(F,A)*i,D[o]=v,[F,A]=[A,F],P=r}u.push(["distanceToStart",new m(D,u[0][1].indices,1,!0)])}function S(t){const e=t.length;return t[0]===t[e-3]&&t[1]===t[e-2]&&t[2]===t[e-1]}function z(t){return"stipplePattern"in t}const E=r(),x=r(),P=4;function G(t,e,r,n,o){if(null==t||0===t.length)return[];const i=[];return t.forEach((t,s)=>{const u=t.length,l=a(3*u);t.forEach((t,e)=>{l[3*e]=t[0],l[3*e+1]=t[1],l[3*e+2]=t[2]});const c={attributeData:{position:l,normal:e,colorFeature:r?.[s],opacityFeature:n?.[s],sizeFeature:o?.[s]},removeDuplicateStartEnd:!1};i.push(c)}),i}function M(t,e,r,n,o,i){if(null==t||0===t.length)return[];const a=G(t,e,n,o,i);return t.forEach((t,e)=>{const n=r?.[e],o=null!=n?H(n.timeStamps,n.stage):void 0;a[e].attributeData.timeStamps=o}),a}function U(t,e=0,r=.01){const n=u(t.length);n[0]=0;for(let i=1;i<t.length;i++){const e=t[i-1],r=t[i],o=Math.sqrt((r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2);n[i]=n[i-1]+o}const o=n.map(t=>t*r);if(0!==e&&e<o.length){const t=o[e];for(let e=0;e<o.length;e++)o[e]-=t}return o}function H(t,e){const r=u(t.length*P),n=t[0],o=t[t.length-1];for(let i=0;i<t.length;i++)r[i*P]=t[i],r[i*P+1]=n,r[i*P+2]=o,r[i*P+3]=e+.5;return r}export{M as animatedLineStripsToParameters,h as createGeometry,U as getLinearTimeStamps,G as lineStripsToParameters,P as numTimeStampValuesPerVertex,H as timeStampsToAttribute};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{deg2rad as e}from"../../../core/mathUtils.js";import{getReferenceEllipsoid as r}from"../../../geometry/ellipsoidUtils.js";import{y2lat as t}from"../../../geometry/support/webMercatorUtils.js";function o(o,i,s){const m=o.isGeographic&&i;let{metersPerUnit:p}=o,a=0;return m?(p=1,a=e(s)):o.isGeographic?p=r(o).metersPerDegree:o.isWebMercator&&(a=t(s)),p*Math.max(.2,Math.cos(a))}export{o as getPlanarDistanceToGroundRatio};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isScreenRect as e,createScreenPoint as r}from"../../../core/screenUtils.js";import{isIntegratedMeshLayer as t,isTiledLayer as a,isLayerWithFlowRenderer as s}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as i}from"../../support/hitTestSelectUtils.js";import{isScaleRangeActive as n,scaleBoundsPredicate as l}from"../../support/layerViewUtils.js";async function o(o,f){const u=await i(o,f),{results:d}=u,m=u.ground,w=e(f)?o.toMap(r(f.x+f.width/2,f.y+f.height/2)):m.mapPoint,g=(!m.layer||!t(m.layer))&&w,h=[],V=p(o),S=g?c(o,V):y;let U=0,T=0;const b=()=>{const e=S.layerViews[T++];if(!g||!e||!("fetchPopupFeaturesAtTarget"in e))return;const r=w,t=e.layer;if(a(t)&&"effectiveScaleRange"in t){const{minScale:e,maxScale:a}=t.effectiveScaleRange;if(n(e,a)){if(s(t)&&!l(o.scale,e,a))return;const i=o.basemapTerrain.getScale(r);if(!l(i,e,a))return}}h.push({geometry:r,layerView:e})};let j=null;for(;U<d.length||T<S.layerViews.length;){const e=d[U];if(e&&"graphic"!==e.type)++U;else if("scene"!==e?.layer?.type||e?.layer?.parent!==o?.map?.basemap)if(e){const r=e.layer?.uid,t=S.layerUids.has(r)&&e.distance===m.distance,a=V.get(e.layer?.uid);if(j??=e.mapPoint,T<S.layerViews.length&&(t||(e.distance??0)>m.distance)&&S.layerViews[T]!==a){b();continue}h.push({graphic:e.graphic,layerView:a}),++U}else b();else++U}return j??=w,{hits:h,location:j}}function c(e,r){const t=new Set,a=new Set;for(let i=e.basemapTerrain.numLayers(1)-1;i>=0;i--){const r=e.basemapTerrain.layerViewByIndex(i,1);t.add(r.layer.uid),a.add(r)}const s=e.overlayManager.renderer.layers;for(const{uid:i}of s){const e=r.get(i);e&&(t.add(i),a.add(e))}return{layerUids:t,layerViews:Array.from(a).reverse()}}const y={layerUids:new Set,layerViews:[]};function p(e){const r=new Map;for(const t of e.allLayerViews){const e=t.layer.uid;r.set(e,t)}return r}export{o as popupHitTest};
2
+ import{isScreenRect as e,createScreenPoint as r}from"../../../core/screenUtils.js";import{isTiledLayer as t,isLayerWithFlowRenderer as a}from"../../../layers/support/layerUtils.js";import{hitTestSelectSimilarDistance as s}from"../../support/hitTestSelectUtils.js";import{isScaleRangeActive as i,scaleBoundsPredicate as n}from"../../support/layerViewUtils.js";async function l(l,f){const p=await s(l,f),{results:u}=p,d=p.ground,m=e(f)?l.toMap(r(f.x+f.width/2,f.y+f.height/2)):d.mapPoint,w=null!=m,g=[],h=y(l),V=null==d.layer,S=w?o(l,h,V):c;let U=0,j=0;const v=()=>{const e=S.layerViews[j++];if(!w||!e||!("fetchPopupFeaturesAtTarget"in e))return;const r=m,s=e.layer;if(t(s)&&"effectiveScaleRange"in s){const{minScale:e,maxScale:t}=s.effectiveScaleRange;if(i(e,t)){if(a(s)&&!n(l.scale,e,t))return;const i=l.basemapTerrain.getScale(r);if(!n(i,e,t))return}}g.push({geometry:r,layerView:e})};let x=null;for(;U<u.length||j<S.layerViews.length;){const e=u[U];if(e&&"graphic"!==e.type)++U;else if("scene"!==e?.layer?.type||e?.layer?.parent!==l?.map?.basemap)if(e){const r=e.layer?.uid,t=S.layerUids.has(r)&&e.distance===d.distance,a=h.get(e.layer?.uid);if(x??=e.mapPoint,j<S.layerViews.length&&(t||(e.distance??0)>d.distance)&&S.layerViews[j]!==a){v();continue}g.push({graphic:e.graphic,layerView:a}),++U}else v();else++U}return x??=m,{hits:g,location:x}}function o(e,r,t){const a=new Set,s=new Set,i=e=>{e&&(a.add(e.layer.uid),s.add(e))};if(t){const{basemapTerrain:r}=e;for(let e=r.numLayers(1)-1;e>=0;e--)i(r.layerViewByIndex(e,1))}const n=e.overlayManager.renderer.layers;for(const{uid:l}of n)i(r.get(l));return{layerUids:a,layerViews:Array.from(s).reverse()}}const c={layerUids:new Set,layerViews:[]};function y(e){const r=new Map;for(const t of e.allLayerViews){const e=t.layer.uid;r.set(e,t)}return r}export{l as popupHitTest};