@arcgis/core 5.0.0-next.49 → 5.0.0-next.50

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 (558) hide show
  1. package/applications/Components/baUtils.js +1 -1
  2. package/arcade.js +1 -1
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/0000781c850b1b4828b3.js +1 -0
  5. package/assets/esri/core/workers/chunks/00f044370bf3bb6b24d7.js +1 -0
  6. package/assets/esri/core/workers/chunks/0136cd1a5da204b6daeb.js +1 -0
  7. package/assets/esri/core/workers/chunks/044a0ccd89741c1ae770.js +1 -0
  8. package/assets/esri/core/workers/chunks/090dad5579f0148d6486.js +1 -0
  9. package/assets/esri/core/workers/chunks/09bd9bd37a339802907a.js +1 -0
  10. package/assets/esri/core/workers/chunks/0bc01d71ed1ab8c3af3c.js +1 -0
  11. package/assets/esri/core/workers/chunks/0d9904ba62558686c289.js +1 -0
  12. package/assets/esri/core/workers/chunks/0fcb40204db8ee5571c3.js +1 -0
  13. package/assets/esri/core/workers/chunks/1065fd655bb7cee243fd.js +1 -0
  14. package/assets/esri/core/workers/chunks/11ab10668632648b2ba7.js +1 -0
  15. package/assets/esri/core/workers/chunks/13167bdd486b41163147.js +1 -0
  16. package/assets/esri/core/workers/chunks/{d8db2c51b2fb42f37b2a.js → 1363345f31f4f5051132.js} +1 -1
  17. package/assets/esri/core/workers/chunks/13be94357dcf5afc4fcb.js +1 -0
  18. package/assets/esri/core/workers/chunks/{e66bcdfd75e0113d1cec.js → 13ce8e8d45779b11ee12.js} +1 -1
  19. package/assets/esri/core/workers/chunks/1693f19f1c37e0a2087e.js +1 -0
  20. package/assets/esri/core/workers/chunks/18ab5959ebf8689f8fe8.js +1 -0
  21. package/assets/esri/core/workers/chunks/18c4cd160a4052b05831.js +1 -0
  22. package/assets/esri/core/workers/chunks/1bf4b5e5402790ccb450.js +1 -0
  23. package/assets/esri/core/workers/chunks/1db058f91a8e17b24db6.js +1 -0
  24. package/assets/esri/core/workers/chunks/1dc3ab52fcde7bff0f23.js +1 -0
  25. package/assets/esri/core/workers/chunks/{a7cd795042ebb8585906.js → 1f0c7ab33e466a37c7f9.js} +1 -1
  26. package/assets/esri/core/workers/chunks/224f01b11fdba9250b1e.js +1 -0
  27. package/assets/esri/core/workers/chunks/{a1a7b0e7ca488c895cb7.js → 22c115ec003351c7d8ee.js} +1 -1
  28. package/assets/esri/core/workers/chunks/24c35a46cf8ed11b774d.js +1 -0
  29. package/assets/esri/core/workers/chunks/27794d48c04a5875fd22.js +1 -0
  30. package/assets/esri/core/workers/chunks/294acaaebfedb05fe81e.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a66841243975cac3e3c.js +1 -0
  32. package/assets/esri/core/workers/chunks/2c12848e4934e9bb2bd0.js +1 -0
  33. package/assets/esri/core/workers/chunks/2d61b6efa17e8c5832da.js +1 -0
  34. package/assets/esri/core/workers/chunks/2d6fa00273a73d44297d.js +1 -0
  35. package/assets/esri/core/workers/chunks/2da13c2269ab90281143.js +1 -0
  36. package/assets/esri/core/workers/chunks/2dfaead2ec6434513d45.js +1 -0
  37. package/assets/esri/core/workers/chunks/2fae37f34b28a46841e3.js +1 -0
  38. package/assets/esri/core/workers/chunks/{3298e96d3f2e49e338d2.js → 308fb48d080e01499a26.js} +1 -1
  39. package/assets/esri/core/workers/chunks/30dd4a7c93b33988a270.js +1 -0
  40. package/assets/esri/core/workers/chunks/355c8d0eadfff9f62dfb.js +1 -0
  41. package/assets/esri/core/workers/chunks/35961e71f69ae1d24b9e.js +1 -0
  42. package/assets/esri/core/workers/chunks/36a04be40369111a633d.js +1 -0
  43. package/assets/esri/core/workers/chunks/36d9208895abd1ba4ff1.js +1 -0
  44. package/assets/esri/core/workers/chunks/395a0773ccafd1f24c4d.js +1 -0
  45. package/assets/esri/core/workers/chunks/{81a60dfa600b690098f9.js → 3a612f873e29348370b2.js} +1 -1
  46. package/assets/esri/core/workers/chunks/3b1471f908fdecec2815.js +1 -0
  47. package/assets/esri/core/workers/chunks/{da1e61f355fb943085dc.js → 3c66dd52ad156711a6a2.js} +1 -1
  48. package/assets/esri/core/workers/chunks/3dd0db77a05263000bd8.js +1 -0
  49. package/assets/esri/core/workers/chunks/{08c1ea29678da27136f3.js → 44fb1184eeed0636704a.js} +1 -1
  50. package/assets/esri/core/workers/chunks/46d430a6983b81ba7556.js +1 -0
  51. package/assets/esri/core/workers/chunks/472d290f8eb1c1a85724.js +1 -0
  52. package/assets/esri/core/workers/chunks/47338472f5a8e004a671.js +1 -0
  53. package/assets/esri/core/workers/chunks/48b3906ac3ec57253d90.js +1 -0
  54. package/assets/esri/core/workers/chunks/{2a41283bba2361afa1fd.js → 495af366ec1defd89a72.js} +1 -1
  55. package/assets/esri/core/workers/chunks/49b581782f63abb6dd9f.js +1 -0
  56. package/assets/esri/core/workers/chunks/49df576f0215618aa651.js +1 -0
  57. package/assets/esri/core/workers/chunks/4abe2c56aecc9e9b8e86.js +1 -0
  58. package/assets/esri/core/workers/chunks/4e01e509a761a9d00b52.js +1 -0
  59. package/assets/esri/core/workers/chunks/{9d0f0d055ec25af037e0.js → 51093e552e31344cefa5.js} +1 -1
  60. package/assets/esri/core/workers/chunks/521aac8a665e98e4ca78.js +1 -0
  61. package/assets/esri/core/workers/chunks/54666586754949bfa584.js +1 -0
  62. package/assets/esri/core/workers/chunks/549f4ab9e285deaf04fb.js +1 -0
  63. package/assets/esri/core/workers/chunks/553ca1e55e9f1359839c.js +1 -0
  64. package/assets/esri/core/workers/chunks/{6f3943bebe2d5f4994f7.js → 58242447b72cc60a5040.js} +1 -1
  65. package/assets/esri/core/workers/chunks/58419d362f24b35003c1.js +1 -0
  66. package/assets/esri/core/workers/chunks/5aa354854219361f722b.js +1 -0
  67. package/assets/esri/core/workers/chunks/{aab93e885b6c7c6aa76e.js → 5ce524e0060053f35592.js} +19 -19
  68. package/assets/esri/core/workers/chunks/5d244fcf5c075afccdc6.js +1 -0
  69. package/assets/esri/core/workers/chunks/5e9fdd4eff7189f45932.js +1 -0
  70. package/assets/esri/core/workers/chunks/60954ab810dbbf36e5e1.js +1 -0
  71. package/assets/esri/core/workers/chunks/62ed6b45482e39d67785.js +1 -0
  72. package/assets/esri/core/workers/chunks/63b8193ad90b2ebe6884.js +1 -0
  73. package/assets/esri/core/workers/chunks/63c91421a71ae3b3599e.js +1 -0
  74. package/assets/esri/core/workers/chunks/63cf702cde83692126be.js +1 -0
  75. package/assets/esri/core/workers/chunks/687d2b761dc5b5cf0c31.js +1 -0
  76. package/assets/esri/core/workers/chunks/6cfcfebe9a4c491e453a.js +1 -0
  77. package/assets/esri/core/workers/chunks/{88aa71f02f43bb069345.js → 7033fa18b7dd7bd3e49c.js} +1 -1
  78. package/assets/esri/core/workers/chunks/710b29729f252f11115d.js +1 -0
  79. package/assets/esri/core/workers/chunks/72a520802b8accfd4512.js +1 -0
  80. package/assets/esri/core/workers/chunks/{72fbee59d5d909615408.js → 73892ac79b24b05e6863.js} +1 -1
  81. package/assets/esri/core/workers/chunks/73c3ee2697265b0f7208.js +1 -0
  82. package/assets/esri/core/workers/chunks/73f9cbf0f919b6adc2d5.js +1 -0
  83. package/assets/esri/core/workers/chunks/75e9759290f0f67b2128.js +1 -0
  84. package/assets/esri/core/workers/chunks/7737e69da604d2521da8.js +1 -0
  85. package/assets/esri/core/workers/chunks/{8e8d5422f57269d8c8d2.js → 7891825d5cdca03d2db0.js} +1 -1
  86. package/assets/esri/core/workers/chunks/7cd0ab01933bfb2c6e43.js +1 -0
  87. package/assets/esri/core/workers/chunks/81c2cc77c275a5b555c0.js +1 -0
  88. package/assets/esri/core/workers/chunks/82ace0195b63790b22c9.js +1 -0
  89. package/assets/esri/core/workers/chunks/8892bf3d2367e35de001.js +1 -0
  90. package/assets/esri/core/workers/chunks/8a132d91077ecf849248.js +1 -0
  91. package/assets/esri/core/workers/chunks/8a6e50d95539b46f629c.js +1 -0
  92. package/assets/esri/core/workers/chunks/8d941204425571b656ec.js +1 -0
  93. package/assets/esri/core/workers/chunks/914746077017fa50933f.js +1 -0
  94. package/assets/esri/core/workers/chunks/{004c2a1a37b99a184b13.js → 91fba3bebd78cb956941.js} +1 -1
  95. package/assets/esri/core/workers/chunks/92ec96aa743cabc9475d.js +1 -0
  96. package/assets/esri/core/workers/chunks/{5b290d18de61789417f9.js → 9361834d2c3064eb41fc.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{44f036cc21e3a2308f69.js → 93b139be6488a1b4ba19.js} +1 -1
  98. package/assets/esri/core/workers/chunks/95057105f1b3bf805140.js +1 -0
  99. package/assets/esri/core/workers/chunks/968335b28b895e19913b.js +1 -0
  100. package/assets/esri/core/workers/chunks/973bf2ed34d57f299472.js +1 -0
  101. package/assets/esri/core/workers/chunks/9b6e2099aabf67b9f9f2.js +1 -0
  102. package/assets/esri/core/workers/chunks/{97b01803d0c38541aa08.js → 9c93eadbd19bef1191b4.js} +1 -1
  103. package/assets/esri/core/workers/chunks/a1594486177015e8a6c3.js +1 -0
  104. package/assets/esri/core/workers/chunks/{df458ad51be27df3d79d.js → a1f264abbd6354c333bf.js} +1 -1
  105. package/assets/esri/core/workers/chunks/a3407ca77b0ff62c0e75.js +1 -0
  106. package/assets/esri/core/workers/chunks/{8be61e13530fd0dc2fd1.js → a4f89568205d78d91cfe.js} +1 -1
  107. package/assets/esri/core/workers/chunks/a5e7c9517939f762c518.js +1 -0
  108. package/assets/esri/core/workers/chunks/a63ff3e9a9f3853d12f3.js +1 -0
  109. package/assets/esri/core/workers/chunks/a81a7cba815adb575c36.js +1 -0
  110. package/assets/esri/core/workers/chunks/{fe6fa1f2c2d54d41645e.js → a8dfd246c797f3b979f5.js} +1 -1
  111. package/assets/esri/core/workers/chunks/a8f7e44657083f6aa3fd.js +1 -0
  112. package/assets/esri/core/workers/chunks/a8fd635d1165db8616ab.js +1 -0
  113. package/assets/esri/core/workers/chunks/a92c1171314a68504c1b.js +1 -0
  114. package/assets/esri/core/workers/chunks/aa297e0931213341f51b.js +1 -0
  115. package/assets/esri/core/workers/chunks/aa7a1705266eec353cb6.js +1 -0
  116. package/assets/esri/core/workers/chunks/ab5e2f823960c33cefe4.js +1 -0
  117. package/assets/esri/core/workers/chunks/{f11453f24c0b728669d2.js → ac6f002cfad42e60de8f.js} +1 -1
  118. package/assets/esri/core/workers/chunks/b11c0e80e583f2b7c5de.js +1 -0
  119. package/assets/esri/core/workers/chunks/b14f9a46e583e1625a2b.js +1 -0
  120. package/assets/esri/core/workers/chunks/{8c271e9272e4eaf1325a.js → b1d3d2c93c189e215f67.js} +1 -1
  121. package/assets/esri/core/workers/chunks/b2425f6af7df6902dfc4.js +1 -0
  122. package/assets/esri/core/workers/chunks/b638ce18b93d3cfb9967.js +1 -0
  123. package/assets/esri/core/workers/chunks/b648a1e641cf5c772d67.js +1 -0
  124. package/assets/esri/core/workers/chunks/{1c58064ea80e6a4a4a3b.js → b907d16e82ac908bb896.js} +1 -1
  125. package/assets/esri/core/workers/chunks/b91c13f44f4d1bac5799.js +1 -0
  126. package/assets/esri/core/workers/chunks/ba7e97b1e324118b8156.js +1 -0
  127. package/assets/esri/core/workers/chunks/bb4aefaf9b0327dda738.js +1 -0
  128. package/assets/esri/core/workers/chunks/{9664d9e679abc41f6c42.js → bce81df760f5e34c01d7.js} +1 -1
  129. package/assets/esri/core/workers/chunks/be6a05d5375e80968877.js +1 -0
  130. package/assets/esri/core/workers/chunks/c02b09f16241db233103.js +1 -0
  131. package/assets/esri/core/workers/chunks/c09cba77ee60a3d765e2.js +1 -0
  132. package/assets/esri/core/workers/chunks/c0d6336c10b4081c4e32.js +1 -0
  133. package/assets/esri/core/workers/chunks/c27842a34e73ccb46116.js +1 -0
  134. package/assets/esri/core/workers/chunks/c7802c144959d60e774a.js +1 -0
  135. package/assets/esri/core/workers/chunks/c91201b37d1cb3875fb4.js +1 -0
  136. package/assets/esri/core/workers/chunks/cc4ae105e727d9211d82.js +1 -0
  137. package/assets/esri/core/workers/chunks/cd39a53ef74f47604977.js +1 -0
  138. package/assets/esri/core/workers/chunks/d22e0d733bfe821c0510.js +1 -0
  139. package/assets/esri/core/workers/chunks/{d7878fba02814adaf19f.js → d57577c02fb2932e8305.js} +1 -1
  140. package/assets/esri/core/workers/chunks/d62193323c67b379dee3.js +1 -0
  141. package/assets/esri/core/workers/chunks/d7a62504e00989202c45.js +1 -0
  142. package/assets/esri/core/workers/chunks/{adfe28c1c1619cdd3ca1.js → d8511e71c5108a0ba9eb.js} +2 -2
  143. package/assets/esri/core/workers/chunks/da922e861d5845ae0979.js +1 -0
  144. package/assets/esri/core/workers/chunks/dbe55d4731227d6e9571.js +1 -0
  145. package/assets/esri/core/workers/chunks/de05c59da6d67716795d.js +1 -0
  146. package/assets/esri/core/workers/chunks/de60421029fbcebe2950.js +1 -0
  147. package/assets/esri/core/workers/chunks/e00d56ae5e68267fe269.js +1 -0
  148. package/assets/esri/core/workers/chunks/{fecae7495e53bb05f282.js → e25be3b6b67ce6b03011.js} +1 -1
  149. package/assets/esri/core/workers/chunks/e2973e5626e5039209f9.js +1 -0
  150. package/assets/esri/core/workers/chunks/e2c7c269be93c552dc5b.js +1 -0
  151. package/assets/esri/core/workers/chunks/e4d593ddcbcf06010ab0.js +1 -0
  152. package/assets/esri/core/workers/chunks/e5ac9b048b16fef9840c.js +1 -0
  153. package/assets/esri/core/workers/chunks/{f7163048146ddaedfc36.js → e668ddc7332e5e560e78.js} +1 -1
  154. package/assets/esri/core/workers/chunks/e6bab7b739bfbb39f6cd.js +1 -0
  155. package/assets/esri/core/workers/chunks/{8b578ffc3a83089aa782.js → e7c08a03772f7fccd949.js} +1 -1
  156. package/assets/esri/core/workers/chunks/e8e4d48ab4024e17108d.js +1 -0
  157. package/assets/esri/core/workers/chunks/e9e0f1c355f963cbea74.js +1 -0
  158. package/assets/esri/core/workers/chunks/ec7e6427d99cf3148a61.js +1 -0
  159. package/assets/esri/core/workers/chunks/edd3cf415955309b4ca4.js +1 -0
  160. package/assets/esri/core/workers/chunks/ee361690b456c12c30d8.js +1 -0
  161. package/assets/esri/core/workers/chunks/efa95c50d1ed8e74219f.js +1 -0
  162. package/assets/esri/core/workers/chunks/f142c5cbdd16f1768275.js +1 -0
  163. package/assets/esri/core/workers/chunks/f286f13686f003c5eec5.js +1 -0
  164. package/assets/esri/core/workers/chunks/f379fd459a103f42d447.js +1 -0
  165. package/assets/esri/core/workers/chunks/{f2ba50eb29f93df885d6.js → f3d8d5fe15501220792d.js} +1 -1
  166. package/assets/esri/core/workers/chunks/f56906c443ce8ff68a27.js +1 -0
  167. package/assets/esri/core/workers/chunks/fb6670a929b7333f1764.js +1 -0
  168. package/assets/esri/core/workers/chunks/fbdf553253cf8f22c022.js +1 -0
  169. package/assets/esri/core/workers/chunks/fc10c738bae304721ab2.js +1 -0
  170. package/assets/esri/core/workers/chunks/ff79c2cb28db7e0a1fc4.js +1 -0
  171. package/assets/esri/core/workers/chunks/ffdf1cbc1e54414d0f96.js +1 -0
  172. package/assets/esri/themes/base/widgets/_Attribution.scss +7 -4
  173. package/assets/esri/themes/dark/main.css +1 -1
  174. package/assets/esri/themes/light/main.css +1 -1
  175. package/assets/esri/themes/light/view.css +1 -1
  176. package/chunks/Bufferer-Dw9Qi4T1.js +1 -1
  177. package/chunks/Distance2DCalculator-CXhBP-8I.js +1 -1
  178. package/chunks/Envelope.js +1 -1
  179. package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
  180. package/chunks/GeodeticUtils.js +1 -1
  181. package/chunks/Geometry.js +1 -1
  182. package/chunks/MultiPathImpl.js +1 -1
  183. package/chunks/OperatorCrosses.js +1 -1
  184. package/chunks/OperatorCut.js +1 -1
  185. package/chunks/OperatorGeodesicBuffer.js +1 -1
  186. package/chunks/OperatorGeodeticArea.js +1 -1
  187. package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
  188. package/chunks/OperatorGeodeticLength.js +1 -1
  189. package/chunks/OperatorIntersects.js +1 -1
  190. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  191. package/chunks/OperatorOverlaps.js +1 -1
  192. package/chunks/OperatorProject.js +1 -1
  193. package/chunks/OperatorProximity.js +1 -1
  194. package/chunks/OperatorProximityGeodesic.js +1 -1
  195. package/chunks/OperatorShapePreservingLength.js +1 -1
  196. package/chunks/OperatorShapePreservingProject.js +1 -1
  197. package/chunks/OperatorSimplifyOGC.js +1 -1
  198. package/chunks/OperatorTouches.js +1 -1
  199. package/chunks/OperatorWithin.js +1 -1
  200. package/chunks/Point2D.js +1 -1
  201. package/chunks/ProjectionTransformation.js +1 -1
  202. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  203. package/chunks/SpatialReference.js +1 -1
  204. package/chunks/boundedPlane.js +1 -1
  205. package/chunks/containsOperator.js +1 -1
  206. package/chunks/disjointOperator.js +1 -1
  207. package/chunks/equalsOperator.js +1 -1
  208. package/chunks/pe.js +1 -1
  209. package/chunks/relateOperator.js +1 -1
  210. package/config.js +1 -1
  211. package/core/units.js +1 -1
  212. package/core/workers/workerFactory.js +1 -1
  213. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  214. package/editing/sharedTemplates/executor/builders/support/offsetUtils.js +1 -1
  215. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  216. package/geometry/FlatGeometry.js +1 -1
  217. package/geometry/GeometryCursor.js +1 -1
  218. package/geometry/operators/containsOperator.js +1 -1
  219. package/geometry/operators/disjointOperator.js +1 -1
  220. package/geometry/operators/gx/geodeticUtils.js +1 -1
  221. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  222. package/geometry/operators/gx/operatorBuffer.js +1 -1
  223. package/geometry/operators/gx/operatorDifference.js +1 -1
  224. package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
  225. package/geometry/operators/gx/operatorGeodeticArea.js +1 -1
  226. package/geometry/operators/gx/operatorGeodeticDensify.js +1 -1
  227. package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
  228. package/geometry/operators/gx/operatorGeodeticLength.js +1 -1
  229. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  230. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  231. package/geometry/operators/gx/operatorIntersection.js +1 -1
  232. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  233. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  234. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  235. package/geometry/operators/gx/operatorProject.js +1 -1
  236. package/geometry/operators/gx/operatorProximityGeodesic.js +1 -1
  237. package/geometry/operators/gx/operatorShapePreservingProject.js +1 -1
  238. package/geometry/operators/gx/operatorSimplify.js +1 -1
  239. package/geometry/operators/gx/operatorSinglePartToMultiPart.js +1 -1
  240. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  241. package/geometry/operators/gx/operatorUnion.js +1 -1
  242. package/geometry/operators/json/containsOperator.js +1 -1
  243. package/geometry/operators/json/disjointOperator.js +1 -1
  244. package/geometry/operators/json/projectOperator.js +1 -1
  245. package/geometry/operators/projectOperator.js +1 -1
  246. package/geometry/operators/reshapeOperator.js +1 -1
  247. package/geometry/operators/support/geographicTransformationUtils.js +1 -1
  248. package/geometry/operators/support/initNoPeFactory.js +1 -1
  249. package/geometry/operators/support/jsonConverter.js +1 -1
  250. package/geometry/operators/support/projectionTransformation.js +1 -1
  251. package/geometry/operators/support/projectionZScaling.js +5 -0
  252. package/geometry/projection/projectPointToVector.js +1 -1
  253. package/geometry/projectionUtils.js +1 -1
  254. package/geometry/support/boundedPlane.js +1 -1
  255. package/geometry/support/jsonTypeUtils.js +5 -0
  256. package/geometry/support/jsonUtils.js +1 -1
  257. package/geometry/support/normalizeUtilsCommon.js +1 -1
  258. package/geometry/support/normalizeUtilsSync.js +1 -1
  259. package/geometry/support/quantizationUtils.js +1 -1
  260. package/geometry/support/zscale.js +1 -1
  261. package/interfaces.d.ts +84 -17
  262. package/kernel.js +1 -1
  263. package/layers/SceneLayer.js +1 -1
  264. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  265. package/layers/graphics/data/QueryEngine.js +1 -1
  266. package/layers/graphics/data/queryUtils.js +1 -1
  267. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  268. package/layers/graphics/featureConversionUtils.js +1 -1
  269. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  270. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  271. package/layers/graphics/sources/support/uploadAssets.js +1 -1
  272. package/layers/mixins/ArcGISMapService.js +1 -1
  273. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  274. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  275. package/layers/orientedImagery/transformations/utils.js +1 -1
  276. package/layers/support/ControlPointsGeoreference.js +1 -1
  277. package/layers/support/Sublayer.js +1 -1
  278. package/package.json +4 -4
  279. package/renderers/support/DictionaryLoader.js +1 -1
  280. package/renderers/support/pointCloud/PointSizeFixedSizeAlgorithm.js +1 -1
  281. package/renderers/support/pointCloud/PointSizeSplatAlgorithm.js +1 -1
  282. package/rest/geometryService/cut.js +1 -1
  283. package/rest/geometryService/difference.js +1 -1
  284. package/rest/geometryService/intersect.js +1 -1
  285. package/rest/geometryService/project.js +1 -1
  286. package/rest/geometryService/reshape.js +1 -1
  287. package/rest/geometryService/simplify.js +1 -1
  288. package/rest/geometryService/utils.js +1 -1
  289. package/rest/knowledgeGraph/DataModel.js +1 -1
  290. package/rest/operations/generalize.js +1 -1
  291. package/rest/operations/identify.js +1 -1
  292. package/rest/operations/offset.js +1 -1
  293. package/rest/operations/relation.js +1 -1
  294. package/rest/query/operations/queryAttributeBins.js +1 -1
  295. package/rest/query/operations/queryTopFeatures.js +1 -1
  296. package/rest/query/operations/queryUtils.js +1 -1
  297. package/rest/support/BaseImageMeasureResultValue.js +1 -1
  298. package/rest/support/BufferParameters.js +1 -1
  299. package/rest/support/DensifyParameters.js +1 -1
  300. package/rest/support/DistanceParameters.js +1 -1
  301. package/rest/support/FeatureSet.js +1 -1
  302. package/rest/support/IdentifyParameters.js +1 -1
  303. package/rest/support/ImageAreaParameters.js +1 -1
  304. package/rest/support/ImageDistanceParameters.js +1 -1
  305. package/rest/support/ImageGPSInfoParameters.js +1 -1
  306. package/rest/support/ImageHeightParameters.js +1 -1
  307. package/rest/support/ImageHistogramParameters.js +1 -1
  308. package/rest/support/ImageIdentifyParameters.js +1 -1
  309. package/rest/support/ImageMeasureResultAngleValue.js +1 -1
  310. package/rest/support/ImageMeasureResultAreaValue.js +1 -1
  311. package/rest/support/ImageMeasureResultLengthValue.js +1 -1
  312. package/rest/support/ImagePointParameters.js +1 -1
  313. package/rest/support/ImageSampleParameters.js +1 -1
  314. package/rest/support/ImageToMapMultirayParameters.js +1 -1
  315. package/rest/support/ImageToMapParameters.js +1 -1
  316. package/rest/support/ImageVolumeParameters.js +1 -1
  317. package/rest/support/MapToImageParameters.js +1 -1
  318. package/rest/support/MeasureFromImageParameters.js +1 -1
  319. package/rest/support/ProjectParameters.js +1 -1
  320. package/support/modeUtils.js +1 -1
  321. package/support/revision.js +1 -1
  322. package/support/tests/serviceMockDependencies.js +1 -1
  323. package/symbols/MarkerSymbol.js +1 -1
  324. package/symbols/PictureMarkerSymbol.js +1 -1
  325. package/symbols/SimpleFillSymbol.js +1 -1
  326. package/symbols/SimpleMarkerSymbol.js +1 -1
  327. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  328. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  329. package/symbols/cim/SDFHelper.js +1 -1
  330. package/symbols/cim/effects/EffectOffset.js +1 -1
  331. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  332. package/symbols/support/ObjectSymbol3DLayerResource.js +1 -1
  333. package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +1 -1
  334. package/views/2d/engine/webgl/shaderGraph/techniques/createTestMeshData.js +1 -1
  335. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  336. package/views/2d/interactive/editingTools/TransformTool.js +1 -1
  337. package/views/2d/interactive/editingTools/manipulations/ScaleManipulation.js +1 -1
  338. package/views/2d/layers/MediaLayerView2D.js +1 -1
  339. package/views/2d/layers/TileLayerView2D.js +1 -1
  340. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  341. package/views/2d/layers/graphics/GraphicStoreItem.js +1 -1
  342. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  343. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementPathHelper.js +1 -1
  344. package/views/3d/analysis/ShadowCast/analysisViewRegister.js +5 -0
  345. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  346. package/views/3d/analysis/Slice/SliceController.js +1 -1
  347. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  348. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  349. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  350. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +1 -1
  351. package/views/3d/analysis/support/projectionUtils.js +1 -1
  352. package/views/3d/interactive/editingTools/media/MediaElementControllerShape.js +1 -1
  353. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentRotate.js +1 -1
  354. package/views/3d/interactive/editingTools/transform/extentTransform/ExtentScale.js +1 -1
  355. package/views/3d/interactive/editingTools/transform/extentTransform/extentUtils.js +1 -1
  356. package/views/3d/layers/DynamicLayerView3D.js +1 -1
  357. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  358. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  359. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  360. package/views/3d/layers/RouteLayerView3D.js +1 -1
  361. package/views/3d/layers/graphics/Deconflictor.js +1 -1
  362. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  363. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  364. package/views/3d/layers/support/featureReference.js +1 -1
  365. package/views/3d/state/ScreenSizePerspective.js +1 -1
  366. package/views/3d/support/ViewSlice.js +1 -1
  367. package/views/3d/support/cameraUtils.js +1 -1
  368. package/views/3d/support/viewpointUtils.js +1 -1
  369. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
  370. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  371. package/views/3d/webgl-engine/lib/SliceHelper.js +1 -1
  372. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  373. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  374. package/views/Attribution.js +1 -1
  375. package/views/DOMContainer.js +1 -1
  376. package/views/PopupView.js +1 -1
  377. package/views/SceneView.js +1 -1
  378. package/views/VideoView.js +1 -1
  379. package/views/View.js +1 -1
  380. package/views/View2D.js +1 -1
  381. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  382. package/views/draw/DrawAction.js +1 -1
  383. package/views/interactive/editGeometry/support/editPlaneUtils.js +1 -1
  384. package/views/interactive/snapping/featureSources/featureServiceSource/tileUtils.js +1 -1
  385. package/views/layers/CatalogFootprintLayerView.js +1 -1
  386. package/views/layers/LayerView.js +1 -1
  387. package/views/support/attributionUtils.js +1 -1
  388. package/views/support/projectionUtils.js +1 -1
  389. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  390. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  391. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  392. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  393. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  394. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  395. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  396. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  397. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  398. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  399. package/widgets/OrientedImageryViewer/services/ImageMeasurementService.js +1 -1
  400. package/widgets/OrientedImageryViewer/support/NonPanoramicMedia.js +5 -0
  401. package/widgets/OrientedImageryViewer/support/NonPanoramicMediaCollection.js +5 -0
  402. package/widgets/OrientedImageryViewer/support/urlUtils.js +5 -0
  403. package/widgets/OrientedImageryViewer/utils.js +1 -1
  404. package/widgets/OrientedImageryViewer.js +1 -1
  405. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  406. package/widgets/PanoramicViewer/support/PanoramicMedia.js +1 -1
  407. package/widgets/PanoramicViewer/utils.js +1 -1
  408. package/widgets/PanoramicViewer.js +1 -1
  409. package/widgets/Slice.js +1 -1
  410. package/widgets/Swipe/SwipeViewModel.js +1 -1
  411. package/widgets/TimeSlider.js +1 -1
  412. package/widgets/Track.js +1 -1
  413. package/widgets/UtilityNetworkAssociations.js +1 -1
  414. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  415. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +1 -1
  416. package/widgets/Weather.js +1 -1
  417. package/widgets/support/GridControls.js +1 -1
  418. package/widgets/support/SnappingControls.js +1 -1
  419. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  420. package/assets/esri/core/workers/chunks/00ff4ca88c9d291d82c3.js +0 -1
  421. package/assets/esri/core/workers/chunks/0271a2ca4e9b1e4fd284.js +0 -1
  422. package/assets/esri/core/workers/chunks/02a65563779b4c64b2cf.js +0 -1
  423. package/assets/esri/core/workers/chunks/02d1c48e874dfd985bc4.js +0 -1
  424. package/assets/esri/core/workers/chunks/05b7720ab6bf0874f27c.js +0 -1
  425. package/assets/esri/core/workers/chunks/061def9163a09c804b5c.js +0 -1
  426. package/assets/esri/core/workers/chunks/06221ebadab32111e2c6.js +0 -1
  427. package/assets/esri/core/workers/chunks/063045ac5553e91c0c4c.js +0 -1
  428. package/assets/esri/core/workers/chunks/06d52a570d5d44f8c86e.js +0 -1
  429. package/assets/esri/core/workers/chunks/0a58b57e1777a8b0ea23.js +0 -1
  430. package/assets/esri/core/workers/chunks/0e4d0213d568f50c231f.js +0 -1
  431. package/assets/esri/core/workers/chunks/103153951ba312dc5e9e.js +0 -1
  432. package/assets/esri/core/workers/chunks/169be08394c5e7703628.js +0 -1
  433. package/assets/esri/core/workers/chunks/1a6f3531ef3d671e0289.js +0 -1
  434. package/assets/esri/core/workers/chunks/1c816aff8613d1e4bf38.js +0 -1
  435. package/assets/esri/core/workers/chunks/1e2d42e9984ed3437ba2.js +0 -1
  436. package/assets/esri/core/workers/chunks/2008b22f76071a2dde4e.js +0 -1
  437. package/assets/esri/core/workers/chunks/20e4243ea563d05a5256.js +0 -1
  438. package/assets/esri/core/workers/chunks/2107c93d1fe87f3b8dfa.js +0 -1
  439. package/assets/esri/core/workers/chunks/21f37a4b8d1857369203.js +0 -1
  440. package/assets/esri/core/workers/chunks/229e1ed4282005aa0b83.js +0 -1
  441. package/assets/esri/core/workers/chunks/22b8eaa6afab0e5ffc47.js +0 -1
  442. package/assets/esri/core/workers/chunks/231c0b583fa97f2ca675.js +0 -1
  443. package/assets/esri/core/workers/chunks/233f9eb617f3d72995b5.js +0 -1
  444. package/assets/esri/core/workers/chunks/2463cebf904a3c46c639.js +0 -1
  445. package/assets/esri/core/workers/chunks/249504f7d356be80d214.js +0 -1
  446. package/assets/esri/core/workers/chunks/2550d2ba935cfdf30236.js +0 -1
  447. package/assets/esri/core/workers/chunks/273ac1066095d63d6a6f.js +0 -1
  448. package/assets/esri/core/workers/chunks/28db329528def851efd7.js +0 -1
  449. package/assets/esri/core/workers/chunks/2de32649f8b0c6404d7c.js +0 -1
  450. package/assets/esri/core/workers/chunks/2e2867bc66c94aba7dc7.js +0 -1
  451. package/assets/esri/core/workers/chunks/30c4af16e3a2acc25589.js +0 -1
  452. package/assets/esri/core/workers/chunks/32d32d3c3b38a215d20d.js +0 -1
  453. package/assets/esri/core/workers/chunks/3386d4392f465b807b94.js +0 -1
  454. package/assets/esri/core/workers/chunks/34613b288cf174983f8b.js +0 -1
  455. package/assets/esri/core/workers/chunks/35f086a2ae0585348ae6.js +0 -1
  456. package/assets/esri/core/workers/chunks/37ea150dec5e491f691e.js +0 -1
  457. package/assets/esri/core/workers/chunks/3ac8de121a07c70bae0f.js +0 -1
  458. package/assets/esri/core/workers/chunks/3c94db7ecdcd38eeb1b1.js +0 -1
  459. package/assets/esri/core/workers/chunks/3f7749f06ae54a4437d9.js +0 -1
  460. package/assets/esri/core/workers/chunks/40a722933af28823953b.js +0 -1
  461. package/assets/esri/core/workers/chunks/444026d1938c1078ca97.js +0 -1
  462. package/assets/esri/core/workers/chunks/44f759d723ae05bb1b19.js +0 -1
  463. package/assets/esri/core/workers/chunks/456684b1c1417ed0e611.js +0 -1
  464. package/assets/esri/core/workers/chunks/48e2737182c75005fb8f.js +0 -1
  465. package/assets/esri/core/workers/chunks/48f805929fe6241952f5.js +0 -1
  466. package/assets/esri/core/workers/chunks/4a48b8ec5f3f2fd139b5.js +0 -1
  467. package/assets/esri/core/workers/chunks/4b084f985bc4100e7aec.js +0 -1
  468. package/assets/esri/core/workers/chunks/4b1de1fcd13677b615a8.js +0 -1
  469. package/assets/esri/core/workers/chunks/4d933de84afb2e3b7d18.js +0 -1
  470. package/assets/esri/core/workers/chunks/4f0de45a0a295d66d446.js +0 -1
  471. package/assets/esri/core/workers/chunks/4ff771942531fb2755c4.js +0 -1
  472. package/assets/esri/core/workers/chunks/513a4ef960e27500f986.js +0 -1
  473. package/assets/esri/core/workers/chunks/56b693baa376bb990925.js +0 -1
  474. package/assets/esri/core/workers/chunks/57fd5e1260269002d18a.js +0 -1
  475. package/assets/esri/core/workers/chunks/5b73c77587772120b209.js +0 -1
  476. package/assets/esri/core/workers/chunks/5fe40bb0e9ab333f6854.js +0 -1
  477. package/assets/esri/core/workers/chunks/61373d2fa7e7638d3395.js +0 -1
  478. package/assets/esri/core/workers/chunks/6202922b1c2637e9aaa5.js +0 -1
  479. package/assets/esri/core/workers/chunks/633368ae6fbb46373328.js +0 -1
  480. package/assets/esri/core/workers/chunks/6d0fe4db6b94f3d2c53a.js +0 -1
  481. package/assets/esri/core/workers/chunks/6d702cb26cef46a76963.js +0 -1
  482. package/assets/esri/core/workers/chunks/6e8925412fb90f88d688.js +0 -1
  483. package/assets/esri/core/workers/chunks/6e8c20ff1d28ef2fe72c.js +0 -1
  484. package/assets/esri/core/workers/chunks/708aba69a1870ea41a61.js +0 -1
  485. package/assets/esri/core/workers/chunks/74b1028e95f7cfff387b.js +0 -1
  486. package/assets/esri/core/workers/chunks/755ce019c97f5d527772.js +0 -1
  487. package/assets/esri/core/workers/chunks/780f60210878a8286633.js +0 -1
  488. package/assets/esri/core/workers/chunks/78fccea3445fb2f9120a.js +0 -1
  489. package/assets/esri/core/workers/chunks/7d3c2a063598bdd015e2.js +0 -1
  490. package/assets/esri/core/workers/chunks/7eab0bb42f9f062522ef.js +0 -1
  491. package/assets/esri/core/workers/chunks/804958f3f4ff47a4eff5.js +0 -1
  492. package/assets/esri/core/workers/chunks/82ba4140e30f083fbc87.js +0 -1
  493. package/assets/esri/core/workers/chunks/833fd2bc42c5cb459084.js +0 -1
  494. package/assets/esri/core/workers/chunks/83c8e5a92d8d6193cb32.js +0 -1
  495. package/assets/esri/core/workers/chunks/83da9ee6544ee9d3c124.js +0 -1
  496. package/assets/esri/core/workers/chunks/870022661376442411e4.js +0 -1
  497. package/assets/esri/core/workers/chunks/897ce6fc9cefb1e14a64.js +0 -1
  498. package/assets/esri/core/workers/chunks/898ab7db220e81e921c6.js +0 -1
  499. package/assets/esri/core/workers/chunks/8b75861196d1ce5cba63.js +0 -1
  500. package/assets/esri/core/workers/chunks/8c07396e9ea3007d6404.js +0 -1
  501. package/assets/esri/core/workers/chunks/8e26831f71634288f834.js +0 -1
  502. package/assets/esri/core/workers/chunks/8ec238b5b59ef18a1713.js +0 -1
  503. package/assets/esri/core/workers/chunks/90b8ccee883738917a6d.js +0 -1
  504. package/assets/esri/core/workers/chunks/90bc9c299ae0e8b8b5e5.js +0 -1
  505. package/assets/esri/core/workers/chunks/9100330ed4b4437c819d.js +0 -1
  506. package/assets/esri/core/workers/chunks/933dce4d4ff8b90219c8.js +0 -1
  507. package/assets/esri/core/workers/chunks/934bc1028b287f8df4aa.js +0 -1
  508. package/assets/esri/core/workers/chunks/94dc8b0fa129f1e168c4.js +0 -1
  509. package/assets/esri/core/workers/chunks/96055de47831e59a28bf.js +0 -1
  510. package/assets/esri/core/workers/chunks/963ba863e0f87abfca25.js +0 -1
  511. package/assets/esri/core/workers/chunks/987e19af8a525e77883f.js +0 -1
  512. package/assets/esri/core/workers/chunks/992e9bbdf9d3787ddb0e.js +0 -1
  513. package/assets/esri/core/workers/chunks/9aa8d60483ad905fe13b.js +0 -1
  514. package/assets/esri/core/workers/chunks/9c0efd06c9000ccbd62d.js +0 -1
  515. package/assets/esri/core/workers/chunks/9f1d3c0b53bef07e39bf.js +0 -1
  516. package/assets/esri/core/workers/chunks/9fed9946241bb2a5cfa4.js +0 -1
  517. package/assets/esri/core/workers/chunks/a2662e98857f0abf8e82.js +0 -1
  518. package/assets/esri/core/workers/chunks/a59dab47a58695c639da.js +0 -1
  519. package/assets/esri/core/workers/chunks/a5a9b0a35849b9f2e86d.js +0 -1
  520. package/assets/esri/core/workers/chunks/a60006c9ccf6817fc0d2.js +0 -1
  521. package/assets/esri/core/workers/chunks/a627b7eb94b7fca33210.js +0 -1
  522. package/assets/esri/core/workers/chunks/a651dc3b8f1fc1ab34cc.js +0 -1
  523. package/assets/esri/core/workers/chunks/a96742e678a506c461ab.js +0 -1
  524. package/assets/esri/core/workers/chunks/af663e81c851bcf142f1.js +0 -1
  525. package/assets/esri/core/workers/chunks/af8d6e6949930d0e6c7b.js +0 -1
  526. package/assets/esri/core/workers/chunks/b59be95949445ff5afab.js +0 -1
  527. package/assets/esri/core/workers/chunks/b6dec5dfdeca54bae88d.js +0 -1
  528. package/assets/esri/core/workers/chunks/b88dc7d8ae105747e6a4.js +0 -1
  529. package/assets/esri/core/workers/chunks/b90c786dd474ea1a409c.js +0 -1
  530. package/assets/esri/core/workers/chunks/b92e9e5df8154a128982.js +0 -1
  531. package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +0 -1
  532. package/assets/esri/core/workers/chunks/bff814d34b38ec80c44d.js +0 -1
  533. package/assets/esri/core/workers/chunks/c36d699a75b6e8fb93eb.js +0 -1
  534. package/assets/esri/core/workers/chunks/c50fdf723f2d4316862e.js +0 -1
  535. package/assets/esri/core/workers/chunks/c5e8ff4721b15ac3c6eb.js +0 -1
  536. package/assets/esri/core/workers/chunks/ca61077e0a598654f33f.js +0 -1
  537. package/assets/esri/core/workers/chunks/ca81be5bdb88ef557bf3.js +0 -1
  538. package/assets/esri/core/workers/chunks/ced12ad98f8f48d0dc00.js +0 -1
  539. package/assets/esri/core/workers/chunks/d0320ca67abca4f8b0d2.js +0 -1
  540. package/assets/esri/core/workers/chunks/d561624ddb9388732b25.js +0 -1
  541. package/assets/esri/core/workers/chunks/d5fd6d0eaf96edfab123.js +0 -1
  542. package/assets/esri/core/workers/chunks/d705410c369bd03b1875.js +0 -1
  543. package/assets/esri/core/workers/chunks/d82e17522ed946c2d809.js +0 -1
  544. package/assets/esri/core/workers/chunks/dc29cb16704e2e4d0a46.js +0 -1
  545. package/assets/esri/core/workers/chunks/dc5075b2326c79130baa.js +0 -1
  546. package/assets/esri/core/workers/chunks/dd105d6e0fcedee32644.js +0 -1
  547. package/assets/esri/core/workers/chunks/defc6b50df5018bd9e86.js +0 -1
  548. package/assets/esri/core/workers/chunks/e1148067ceae7d9eaaf8.js +0 -1
  549. package/assets/esri/core/workers/chunks/e5a6a646f27715152714.js +0 -1
  550. package/assets/esri/core/workers/chunks/e8c2e2fbe9cef4c8a8c6.js +0 -1
  551. package/assets/esri/core/workers/chunks/efc293c8bbc12156096d.js +0 -1
  552. package/assets/esri/core/workers/chunks/f693a4d97b2762d0e6ff.js +0 -1
  553. package/assets/esri/core/workers/chunks/f7f53567b0c5b35d6aea.js +0 -1
  554. package/assets/esri/core/workers/chunks/f92a78ce5510e0d0d0f7.js +0 -1
  555. package/assets/esri/core/workers/chunks/fb76b43181077c55a207.js +0 -1
  556. package/assets/esri/core/workers/chunks/fc61443546f21869f8ba.js +0 -1
  557. package/assets/esri/core/workers/chunks/fdaa10a588db394e2f65.js +0 -1
  558. package/chunks/UnitFactory.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../core/accessorSupport/decorators.js";import c from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as g}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as f}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../core/RandomLCG.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/Util.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/checkWebGLError.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import{MediaLayerViewMixin as v}from"../../layers/MediaLayerViewMixin.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),n(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),n(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}attach(){this.addAttachHandles([m(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),m(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new P(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new c({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,()=>{const e=new f({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=M(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new f({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){M(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([p("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function M(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],g(q,i)}class P{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;export{C as default};
5
+ import{__decorate as e}from"tslib";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../core/accessorSupport/decorators.js";import c from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as g}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as f}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../core/RandomLCG.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../geometry/Polygon.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/Util.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polyline.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/checkWebGLError.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import{MediaLayerViewMixin as v}from"../../layers/MediaLayerViewMixin.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),n(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),n(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}attach(){this.addAttachHandles([m(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),m(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new P(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new c({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,()=>{const e=new f({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=M(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new f({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){M(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([p("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function M(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],g(q,i)}class P{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/has.js";import"../../../core/scheduling.js";import"../../../core/RandomLCG.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/Util.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/checkWebGLError.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as G,MapServiceLayerViewHelper as T}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";import{TaskPriority as S}from"../../support/Scheduler.js";const P=[0,0];let I=class extends(b(n(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:S.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),G(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new T({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=V(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(P,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],I.prototype,"resampling",null),e([o()],I.prototype,"tilemapCache",null),I=e([l("esri.views.2d.layers.TileLayerView2D")],I);const v=I;export{v as default};
5
+ import{__decorate as e}from"tslib";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o,subclass as l}from"../../../core/accessorSupport/decorators.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/has.js";import"../../../core/scheduling.js";import"../../../core/RandomLCG.js";import"../../../Color.js";import"../../../core/mathUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../../../geometry/Polygon.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Accessor.js";import"../engine/transitions/FadeTransition.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/Program.js";import"../../webgl/Util.js";import"../../webgl/VertexAttributeLayouts.js";import"../../webgl/BufferObject.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../../webgl/Renderbuffer.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../core/sql/UnknownTimeZone.js";import"luxon";import"../../../intl/locale.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polyline.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/animations/instructions.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/checkWebGLError.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../../../core/units.js";import"../../../geometry/ellipsoidUtils.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import p from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtils.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/operators/support/GeographicTransformation.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../../../geometry/support/Ellipsoid.js";import{BitmapTileLayerView2D as n}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import{RefreshableLayerView as b}from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as G,MapServiceLayerViewHelper as T}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{getHighlightName as V}from"../../support/highlightOptionsUtils.js";import{TaskPriority as S}from"../../support/Scheduler.js";const P=[0,0];let I=class extends(b(n(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:S.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),G(this,this.layer)){const e=this._highlightView=new p({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new T({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=V(t);return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(P,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,p=null;try{if(p=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(n){if(s(n))throw n;if(this.resampling&&"unknown"===p&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],I.prototype,"resampling",null),e([o()],I.prototype,"tilemapCache",null),I=e([l("esri.views.2d.layers.TileLayerView2D")],I);const v=I;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as r,isGeometryWithZ as s,isGeometryWithM as i}from"../../../../../geometry/support/jsonUtils.js";import{convertFromGeometry as o,generalizeOptimizedGeometry as n,quantizeOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import u from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as c}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as d}from"./FeatureSetReader.js";class a extends d{static from(e,t,r){return new a(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const s=t.lod;s.wrap&&(this._wrappingInfo={worldSizeX:s.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return null!=this._current.attributes[e]}field(e){return this.readAttribute(e)}get geometryType(){const e=r(this._current.geometry);return"esriGeometryPoint"===e?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new a(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw new Error("InternalError: exceededTransferLimit not implemented for graphics.")}get hasZ(){return s(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw new Error("InternalError: Setting displayId not supported for graphics.")}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw new Error("InternalError: readGeometryArea not supported for graphics.")}_readGeometry(){if(!this._cachedGeometry){let e=o(this._current.projectedGeometry);if("esriGeometryPolyline"===this.geometryType&&(e=n(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=h(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;const{worldSizeX:t}=this._wrappingInfo;if(e.isPoint)return 1===t?(e.coords.push(c,0),e.coords.push(2*-c,0),void e.lengths.push(3)):2===t?(e.coords.push(2*c,0),e.coords.push(4*-c,0),void e.lengths.push(3)):void this._wrapVertex(e.coords,0,2,t);if("esriGeometryMultipoint"!==this.geometryType);else{if(1===t){const t=e.coords.slice();t[0]-=512;const r=e.coords.slice();r[0]+=512,e.coords.push(...t,...r);const s=e.lengths[0];return void e.lengths.push(s,s)}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,r,s){const i=t*r,o=e[i];o<-c*(s-2)?e[i]=o+c*s:o>c*(s-1)&&(e[i]=o-c*s)}_readX(){const e=this._readGeometry();return null!=e?e.coords[0]:0}_readY(){const e=this._readGeometry();return null!=e?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=t(this._current.projectedGeometry),r=new u([],e,this.hasZ,!1);return h(r,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const t=this._current.projectedGeometry,r=e(t.paths,this.hasZ),s=new u([],r,this.hasZ,!1);return h(s,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(void 0!==r)return r;const s=e.toLowerCase();for(const i in this._current.attributes)if(i.toLowerCase()===s)return this._current.attributes[i]}_readAttributes(){return this._current.attributes}}export{a as GraphicsReader};
5
+ import{ringsCentroid as e,polygonCentroid as t}from"../../../../../geometry/support/centroid.js";import{getJsonType as r,isGeometryWithZ as s,isGeometryWithM as i}from"../../../../../geometry/support/jsonTypeUtils.js";import{convertFromGeometry as o,generalizeOptimizedGeometry as n,quantizeOptimizedGeometry as h}from"../../../../../layers/graphics/featureConversionUtils.js";import u from"../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as c}from"../../../engine/webgl/definitions.js";import{FeatureSetReader as d}from"./FeatureSetReader.js";class a extends d{static from(e,t,r){return new a(e,t,r)}constructor(e,t,r){super(r),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const s=t.lod;s.wrap&&(this._wrappingInfo={worldSizeX:s.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return null!=this._current.attributes[e]}field(e){return this.readAttribute(e)}get geometryType(){const e=r(this._current.geometry);return"esriGeometryPoint"===e?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new a(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1<this._items.length}get exceededTransferLimit(){throw new Error("InternalError: exceededTransferLimit not implemented for graphics.")}get hasZ(){return s(this._current.projectedGeometry)}get hasM(){return i(this._current.projectedGeometry)}get usedMemory(){return this._current.usedMemory}getInTransform(){return this._tile.transform}getSize(){return this._items.length}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getObjectId(){return this._items[this._index].objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){throw new Error("InternalError: Setting displayId not supported for graphics.")}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(this._cachedGeometry=null;++this._index<this._items.length&&!this._getExists(););return this._index<this._items.length}readGeometryArea(){throw new Error("InternalError: readGeometryArea not supported for graphics.")}_readGeometry(){if(!this._cachedGeometry){let e=o(this._current.projectedGeometry);if("esriGeometryPolyline"===this.geometryType&&(e=n(e,this.geometryType,this._tile.transform.scale[0])),this._cachedGeometry=h(e,this.geometryType,this._tile.transform),!this._cachedGeometry)return null;this._wrapGeometry(this._cachedGeometry)}return this._cachedGeometry}_wrapGeometry(e){if(!this._wrappingInfo)return;const{worldSizeX:t}=this._wrappingInfo;if(e.isPoint)return 1===t?(e.coords.push(c,0),e.coords.push(2*-c,0),void e.lengths.push(3)):2===t?(e.coords.push(2*c,0),e.coords.push(4*-c,0),void e.lengths.push(3)):void this._wrapVertex(e.coords,0,2,t);if("esriGeometryMultipoint"!==this.geometryType);else{if(1===t){const t=e.coords.slice();t[0]-=512;const r=e.coords.slice();r[0]+=512,e.coords.push(...t,...r);const s=e.lengths[0];return void e.lengths.push(s,s)}this._wrapVertex(e.coords,0,2,t)}}_wrapVertex(e,t,r,s){const i=t*r,o=e[i];o<-c*(s-2)?e[i]=o+c*s:o>c*(s-1)&&(e[i]=o-c*s)}_readX(){const e=this._readGeometry();return null!=e?e.coords[0]:0}_readY(){const e=this._readGeometry();return null!=e?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=t(this._current.projectedGeometry),r=new u([],e,this.hasZ,!1);return h(r,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const t=this._current.projectedGeometry,r=e(t.paths,this.hasZ),s=new u([],r,this.hasZ,!1);return h(s,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const r=this._current.attributes[e];if(void 0!==r)return r;const s=e.toLowerCase();for(const i in this._current.attributes)if(i.toLowerCase()===s)return this._current.attributes[i]}_readAttributes(){return this._current.attributes}}export{a as GraphicsReader};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{estimateAttributesMemory as t}from"../../../../core/memoryEstimations.js";import{empty as e,width as i,height as s}from"../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as r}from"../../../../geometry/support/boundsUtils.js";import{closeRingsAndFixWinding as o}from"../../../../geometry/support/coordsUtils.js";import{isExtent as n}from"../../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridianForDisplay as m}from"../../../../geometry/support/normalizeUtilsSync.js";import{isCurvedGeometry as a}from"../../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as h}from"../../../../geometry/support/curves/densifyCurvedGeometry.js";import{estimateGeometryMemory as u}from"../../../../layers/graphics/dehydratedFeatures.js";import{checkProjectionSupport as y,project as c}from"../../../../layers/graphics/data/projectionSupport.js";import{getCoarseSegmentsPerCurve as p,getMinSegmentsPerCurve as l,getMaxDeviationInPixels as d,getApproximateMaxDensificationSegments as f}from"./densificationConstants.js";import{polygonFromExtent as g}from"./graphicsUtils.js";class v{static fromGraphic(t,e,i,s){return new v(t.geometry,e,t.attributes,t.visible,t.uid,t.version,i,s)}constructor(t,i,s,r,o,n,m,a){this.geometry=t,this.symbol=i,this.attributes=s,this.visible=r,this.objectId=o,this._version=n,this.zOrder=m,this.displayId=a,this.symbolBounds=e(),this.prevSymbolBounds=e(),this.size=[0,0,0,0],this.geometryBounds=e(),this._isDensificationDirty=!1,this._densificationDeviation=1/0}get projectedGeometry(){return this._projectedGeometry}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get usedMemory(){return 128+t(this.attributes)+u(this.geometry)}get hasAnimations(){const{linearCIM:t}=this;return!!t&&t.some(t=>"animationParams"in t&&!!t.animationParams)}get hasCurvedGeoemtry(){return null!=this.geometry&&"mesh"!==this.geometry.type&&a(this.geometry)}update(t,i,s){return(this._version!==t.version||this.zOrder!==s||this.symbol!==i)&&(this.prevSymbolBounds=this.symbolBounds,this.symbolBounds=e(),this.zOrder=s,this.geometry=t.geometry,this.attributes=t.attributes,this.symbol=i,this.visible=t.visible,this._version=t.version,this.symbolResource=null,this._projectedGeometry=null,e(this.geometryBounds),this._minDensificationDeviation=null,this._isDensificationDirty=!0,!0)}updateDensificationResolution(t){if(!this.hasCurvedGeoemtry)return!1;const e=Math.max(D(t),this._minDensificationDeviation??0);return e!==this._densificationDeviation&&(this._densificationDeviation=e,this._isDensificationDirty=!0,!0)}async projectAndNormalize(t){let e,o=this.geometry;if(o&&o.spatialReference&&"mesh"!==o.type&&("extent"===o.type&&(o=g(o)),e=a(o)?h(o,{maxSegmentLength:1/0,minSegmentsPerCurve:p()}):o.toJSON(),this._projectedGeometry=await j(e,o.spatialReference,t),r(this.geometryBounds,this._projectedGeometry),this.hasCurvedGeoemtry&&null!=this._projectedGeometry)){const t=i(this.geometryBounds),e=s(this.geometryBounds);this._minDensificationDeviation=b(t,e)}}async densifyCurvedGeometryForDisplay(t){if(!this.hasCurvedGeoemtry||!this._isDensificationDirty)return;this._isDensificationDirty=!1;const e=this.geometry;if(!e||!e.spatialReference||"mesh"===e.type)return;const i=t.metersPerUnit/e.spatialReference.metersPerUnit,s=this._densificationDeviation*i,r=h(e,{maxDeviation:s,minSegmentsPerCurve:l()});this._projectedGeometry=await j(r,e.spatialReference,t)}}async function j(t,e,i){await y(t.spatialReference,i);const s=m(t);if(!s)return;const r=c(s,e,i);return r&&o(r),n(r)?g(r):r}function D(t){return 2**Math.round(Math.log2(t))*d()}function b(t,e){if(t>0&&e>0){const i=Math.min(t,e)/2,s=2*Math.PI/f();return i*(1-Math.cos(s/2))}return null}export{v as GraphicStoreItem};
5
+ import{estimateAttributesMemory as t}from"../../../../core/memoryEstimations.js";import{empty as e,width as i,height as s}from"../../../../geometry/support/aaBoundingRect.js";import{getBoundsXY as r}from"../../../../geometry/support/boundsUtils.js";import{closeRingsAndFixWinding as o}from"../../../../geometry/support/coordsUtils.js";import{isExtent as n}from"../../../../geometry/support/jsonTypeUtils.js";import{normalizeCentralMeridianForDisplay as m}from"../../../../geometry/support/normalizeUtilsSync.js";import{isCurvedGeometry as a}from"../../../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as h}from"../../../../geometry/support/curves/densifyCurvedGeometry.js";import{estimateGeometryMemory as u}from"../../../../layers/graphics/dehydratedFeatures.js";import{checkProjectionSupport as y,project as c}from"../../../../layers/graphics/data/projectionSupport.js";import{getCoarseSegmentsPerCurve as p,getMinSegmentsPerCurve as l,getMaxDeviationInPixels as d,getApproximateMaxDensificationSegments as f}from"./densificationConstants.js";import{polygonFromExtent as g}from"./graphicsUtils.js";class v{static fromGraphic(t,e,i,s){return new v(t.geometry,e,t.attributes,t.visible,t.uid,t.version,i,s)}constructor(t,i,s,r,o,n,m,a){this.geometry=t,this.symbol=i,this.attributes=s,this.visible=r,this.objectId=o,this._version=n,this.zOrder=m,this.displayId=a,this.symbolBounds=e(),this.prevSymbolBounds=e(),this.size=[0,0,0,0],this.geometryBounds=e(),this._isDensificationDirty=!1,this._densificationDeviation=1/0}get projectedGeometry(){return this._projectedGeometry}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get usedMemory(){return 128+t(this.attributes)+u(this.geometry)}get hasAnimations(){const{linearCIM:t}=this;return!!t&&t.some(t=>"animationParams"in t&&!!t.animationParams)}get hasCurvedGeoemtry(){return null!=this.geometry&&"mesh"!==this.geometry.type&&a(this.geometry)}update(t,i,s){return(this._version!==t.version||this.zOrder!==s||this.symbol!==i)&&(this.prevSymbolBounds=this.symbolBounds,this.symbolBounds=e(),this.zOrder=s,this.geometry=t.geometry,this.attributes=t.attributes,this.symbol=i,this.visible=t.visible,this._version=t.version,this.symbolResource=null,this._projectedGeometry=null,e(this.geometryBounds),this._minDensificationDeviation=null,this._isDensificationDirty=!0,!0)}updateDensificationResolution(t){if(!this.hasCurvedGeoemtry)return!1;const e=Math.max(D(t),this._minDensificationDeviation??0);return e!==this._densificationDeviation&&(this._densificationDeviation=e,this._isDensificationDirty=!0,!0)}async projectAndNormalize(t){let e,o=this.geometry;if(o&&o.spatialReference&&"mesh"!==o.type&&("extent"===o.type&&(o=g(o)),e=a(o)?h(o,{maxSegmentLength:1/0,minSegmentsPerCurve:p()}):o.toJSON(),this._projectedGeometry=await j(e,o.spatialReference,t),r(this.geometryBounds,this._projectedGeometry),this.hasCurvedGeoemtry&&null!=this._projectedGeometry)){const t=i(this.geometryBounds),e=s(this.geometryBounds);this._minDensificationDeviation=b(t,e)}}async densifyCurvedGeometryForDisplay(t){if(!this.hasCurvedGeoemtry||!this._isDensificationDirty)return;this._isDensificationDirty=!1;const e=this.geometry;if(!e||!e.spatialReference||"mesh"===e.type)return;const i=t.metersPerUnit/e.spatialReference.metersPerUnit,s=this._densificationDeviation*i,r=h(e,{maxDeviation:s,minSegmentsPerCurve:l()});this._projectedGeometry=await j(r,e.spatialReference,t)}}async function j(t,e,i){await y(t.spatialReference,i);const s=m(t);if(!s)return;const r=c(s,e,i);return r&&o(r),n(r)?g(r):r}function D(t){return 2**Math.round(Math.log2(t))*d()}function b(t,e){if(t>0&&e>0){const i=Math.min(t,e)/2,s=2*Math.PI/f();return i*(1-Math.cos(s/2))}return null}export{v as GraphicStoreItem};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonUtils.js";import g from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as f,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as b,errorPolylineSymbol2D as w,errorPolygonSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as M}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as R}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createStorageSchema as j}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as x}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as U}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as C}from"../features/support/FeatureMetadata.js";import{GraphicsReader as q}from"../features/support/GraphicsReader.js";import G from"./GraphicStore.js";import{FeatureCommandQueue as k}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as P}from"../support/UpdateTracking2D.js";class F{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new F(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new F(e,s);for(const i of t)r.append(i);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||(this._reader=q.from(this.addedOrModified,this.tile,this.metadata)),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let O=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new P({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new k({process:e=>{if("update"===e.type)return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new U({spatialReference:this.view.spatialReference,fields:new g}),this._attributeStore=new x({isLocal:!0,update:e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=j(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=C.createGraphics(this.view.spatialReference),this._resourceProxy=new M({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([n(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new G(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return has("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:r}=this.view.state,i=this._graphicStore.hitTest(e.x,e.y,2,t,r),o=new Set(i),a=this.graphics.items.reduce((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e),new Map);return i.map(e=>a.get(e)).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:s,highlightFlags:r}of e){const e=this._graphicStore.getItem(s)?.displayId;t.push({objectId:s,highlightFlags:r,displayId:e})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{if(has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;const e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(const s of e.updated)this.container.restartAnimation(s.objectId);if(!e.hasAnyUpdate())return void this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){F.getOrCreate(r,t,this._metadata).append(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const i of e){F.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){F.getOrCreate(i,t,this._metadata).append(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){F.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _densifyItemsForDisplay(e){const t=new Map;for(const s of e)for(const e of s.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){const t={timeZone:null,timeExtent:null};for(const{tile:s,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${s.id}] GraphicsView fetchResources`,e);const i=r.getCursor();for(;i.next();)for(const e of i.getMeshWriters())e.enqueueRequest(this._resourceProxy,i,s.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){const t={timeZone:null,timeExtent:null},s=new T(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());for(const i of r.getMeshWriters())i.write(s,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(t),e.tile.level);s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id}}_setFilterState(e){const t=e.displayId,s=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,s|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter(e=>"text"===e.type);if(s.length>0){const r=await this._getTextResources(e,s);return void(e.symbolResource={symbolInfo:t,textInfo:r})}e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r)}}async _convertToCIMSymbol(e){const t=f(e);return"web-style"===t.type?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:["cim","web"]})):t}async _createLinearCIM(e){return await Promise.all(y.fetchResources(e.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const s=this.container.instanceStore,r=this.view.stage.meshWriterRegistry,i=await R(e,t,s);return Promise.all(i.map(e=>r.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.addPromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new v(e,s,t[0],t[3]);return this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=F.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return t?l(t)?w:p(t)||u(t)?S:this.defaultPointSymbolEnabled?b:null:this.defaultPointSymbolEnabled?b:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""}),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],O.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],O.prototype,"layerId",void 0),e([h({constructOnly:!0})],O.prototype,"requestUpdateCallback",void 0),e([h()],O.prototype,"container",void 0),e([h({constructOnly:!0})],O.prototype,"graphics",void 0),e([h()],O.prototype,"renderer",void 0),e([h()],O.prototype,"_updateTracking",void 0),e([h()],O.prototype,"updating",null),e([h()],O.prototype,"view",void 0),e([h()],O.prototype,"updateRequested",void 0),e([h()],O.prototype,"defaultPointSymbolEnabled",void 0),O=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],O);export{O as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{isSome as s}from"../../../../core/arrayUtils.js";import has from"../../../../core/has.js";import{IdentifiableMixin as r}from"../../../../core/Identifiable.js";import{assertIsSome as i}from"../../../../core/maybe.js";import{ignoreAbortErrors as o,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{property as h,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{create as c}from"../../../../geometry/support/aaBoundingRect.js";import{isPolyline as l,isPolygon as p,isExtent as u,getJsonType as m}from"../../../../geometry/support/jsonTypeUtils.js";import g from"../../../../layers/support/FieldsIndex.js";import{symbolToCIM as f,CIMSymbolHelper as y}from"../../../../symbols/cim/CIMSymbolHelper.js";import{OverrideHelper as _}from"../../../../symbols/cim/OverrideHelper.js";import{errorPointSymbol2D as b,errorPolylineSymbol2D as w,errorPolygonSymbol2D as S}from"../../../../symbols/support/defaults.js";import{filterFlag0 as I}from"../../engine/webgl/definitions.js";import{FeatureTile as v}from"../../engine/webgl/FeatureTile.js";import{MeshData as T}from"../../engine/webgl/mesh/MeshData.js";import{ResourceProxy as M}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{createGraphicSymbolMeshSchemas as R}from"../../engine/webgl/shaderGraph/techniques/createGraphicSymbolMeshSchemas.js";import{createStorageSchema as j}from"../features/schema/processor/StorageSchema.js";import{AttributeStore as x}from"../features/support/AttributeStore.js";import{ComputedAttributeStorage as U}from"../features/support/ComputedAttributeStorage.js";import{GraphicsMetadata as C}from"../features/support/FeatureMetadata.js";import{GraphicsReader as q}from"../features/support/GraphicsReader.js";import G from"./GraphicStore.js";import{FeatureCommandQueue as k}from"../support/FeatureCommandQueue.js";import{UpdateTracking2D as P}from"../support/UpdateTracking2D.js";class F{static getOrCreate(e,t,s){let r=t.get(e.id);return r||(r=new F(e,s),t.set(e.id,r)),r}static fromItems(e,t,s){const r=new F(e,s);for(const i of t)r.append(i);return r}constructor(e,t){this.tile=e,this.metadata=t,this.addedOrModified=[],this.removed=[],this.objectIdMap=null}get reader(){return this._reader||(this._reader=q.from(this.addedOrModified,this.tile,this.metadata)),this._reader}append(e){this.addedOrModified.push(e),e.hasAnimations&&(this.objectIdMap=this.objectIdMap||{},this.objectIdMap[e.displayId]=e.objectId)}}let O=class extends(r(t)){constructor(e){super(e),this._attached=!1,this._tiles=new Map,this._controller=new AbortController,this._hashToSymbolInfo=new Map,this._lastCleanup=performance.now(),this._cleanupRequired=!0,this.lastUpdateId=-1,this.renderer=null,this._updateTracking=new P({debugName:"GraphicsView2D"}),this.updateRequested=!1,this.defaultPointSymbolEnabled=!0,this._commandQueue=new k({process:e=>{if("update"===e.type)return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new U({spatialReference:this.view.spatialReference,fields:new g}),this._attributeStore=new x({isLocal:!0,update:e=>{has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const e=j(null,[]);this._attributeStore.update(e,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=C.createGraphics(this.view.spatialReference),this._resourceProxy=new M({fetch:e=>Promise.all(e.map(e=>this.view.stage.textureManager.rasterizeItem(e))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([n(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new G(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const e=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:e,removed:[]})}get _effectiveRenderer(){return"function"==typeof this.renderer?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const e=!this._attached||this._updateTracking.updating;return has("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${e}\n -> attaching ${!this._attached}\n -> updateTracking ${this._updateTracking.updating}`),e}hitTest(e){if(!this.view||this.view.suspended)return[];const{resolution:t,rotation:r}=this.view.state,i=this._graphicStore.hitTest(e.x,e.y,2,t,r),o=new Set(i),a=this.graphics.items.reduce((e,t)=>(o.has(t.uid)&&e.set(t.uid,t),e),new Map);return i.map(e=>a.get(e)).filter(s)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(e){this.updateRequested&&(this.updateRequested=!1,this.update(e))}viewChange(){this.requestUpdate()}setHighlight(e){const t=[];for(const{objectId:s,highlightFlags:r}of e){const e=this._graphicStore.getItem(s)?.displayId;t.push({objectId:s,highlightFlags:r,displayId:e})}this._attributeStore.setHighlight(t,e),this._pushUpdate()}graphicUpdateHandler(e){this._pushUpdate()}update(e){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(e.state.resolution)&&this.pushUpdate()}pushUpdate(){this._pushUpdate()}_pushUpdate(){o(this._commandQueue.push({type:"update"}))}async _update(){try{if(has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`),this.graphics.destroyed)return;const e=await this._graphicStore.update(this.graphics,e=>this._getSymbolForGraphic(e),e=>this._ensureSymbolResource(e));for(const s of e.updated)this.container.restartAnimation(s.objectId);if(!e.hasAnyUpdate())return void this._attributeStore.sendUpdates();e.removed.length&&(this._cleanupRequired=!0),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,e);const t=this._createTileMessages(e);await this._densifyItemsForDisplay(t),await this._fetchResources(t),this._write(t);for(const s of e.added)this._setFilterState(s);for(const s of e.updated)this._setFilterState(s);has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,e),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,e)}catch(e){}this._cleanupSharedResources()}_createTileMessages(e){const t=new Map;for(const s of e.added){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){F.getOrCreate(r,t,this._metadata).append(s)}}for(const s of e.updated){const e=this.view.graphicsTileStore.getIntersectingTiles(s.prevSymbolBounds),r=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const i of e){F.getOrCreate(i,t,this._metadata).removed.push(s.displayId)}for(const i of r){F.getOrCreate(i,t,this._metadata).append(s)}}for(const s of e.removed){const e=this.view.graphicsTileStore.getIntersectingTiles(s.symbolBounds);for(const r of e){F.getOrCreate(r,t,this._metadata).removed.push(s.displayId)}}return Array.from(t.values())}async _densifyItemsForDisplay(e){const t=new Map;for(const s of e)for(const e of s.addedOrModified)t.has(e)||t.set(e,e.densifyCurvedGeometryForDisplay(this.view.spatialReference));await Promise.all(t.values())}async _fetchResources(e){const t={timeZone:null,timeExtent:null};for(const{tile:s,reader:r}of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${s.id}] GraphicsView fetchResources`,e);const i=r.getCursor();for(;i.next();)for(const e of i.getMeshWriters())e.enqueueRequest(this._resourceProxy,i,s.createArcadeEvaluationOptions(t))}await this._resourceProxy.fetchEnqueuedResources()}_write(e){for(const t of e){has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView write`,t);const e=this._writeMeshes(t);let s=this._tiles.get(t.tile.key);s||(s=this._createFeatureTile(t.tile.key)),has("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${t.tile.id}] GraphicsView onTileData`,t),this.container.onTileData(s,{type:"update",modify:e,remove:t.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:t.objectIdMap}),this.container.requestRender()}}_writeMeshes(e){const t={timeZone:null,timeExtent:null},s=new T(e.tile.id),r=e.reader.getCursor();for(;r.next();){s.entityStart(r.getDisplayId(),r.getZOrder());for(const i of r.getMeshWriters())i.write(s,this._resourceProxy,r,e.tile.createArcadeEvaluationOptions(t),e.tile.level);s.entityEnd()}return{...s.serialize().message,tileId:e.tile.id}}_setFilterState(e){const t=e.displayId,s=this._attributeStore.getHighlightFlags(e.objectId);this._attributeStore.setData(t,0,0,s|(e.visible?I:0))}_getSymbolForGraphic(e){return null!=e.symbol?e.symbol:null!=this._effectiveRenderer?this._effectiveRenderer.getSymbol(e):this._getNullSymbol(e)}async _ensureSymbolResource(e){if(!e.symbol)return;const t=await this._getSymbolInfo(e.symbol);if(!t)return;const s=t.linearCIM.filter(e=>"text"===e.type);if(s.length>0){const r=await this._getTextResources(e,s);return void(e.symbolResource={symbolInfo:t,textInfo:r})}e.symbolResource={symbolInfo:t}}_getSymbolInfo(e){const t=e.hash();return this._hashToSymbolInfo.has(t)||this._hashToSymbolInfo.set(t,this._createSymbolInfo(t,e).catch(e=>null)),this._hashToSymbolInfo.get(t)}async _createSymbolInfo(e,t){const s=await this._convertToCIMSymbol(t),r=await this._createLinearCIM(s);return{hash:e,cimSymbol:s,linearCIM:r,meshWriters:await this._createMeshWriters(s,r)}}async _convertToCIMSymbol(e){const t=f(e);return"web-style"===t.type?this._convertToCIMSymbol(await t.fetchSymbol({acceptedFormats:["cim","web"]})):t}async _createLinearCIM(e){return await Promise.all(y.fetchResources(e.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(e,!1)}async _createMeshWriters(e,t){a(this._controller.signal);const s=this.container.instanceStore,r=this.view.stage.meshWriterRegistry,i=await R(e,t,s);return Promise.all(i.map(e=>r.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},e,null)))}_onTileUpdate(e){if(e.added&&e.added.length>0)for(const t of e.added)this._updateTracking.addPromise(this._addTile(t));if(e.removed&&e.removed.length>0)for(const t of e.removed)this._removeTile(t.key)}_createFeatureTile(e){const t=this.view.featuresTilingScheme.getTileBounds(c(),e),s=this.view.featuresTilingScheme.getTileResolution(e.level),r=new v(e,s,t[0],t[3]);return this._tiles.set(e,r),this.container.addChild(r),r}async _addTile(e){if(!this._attached)return;const t=this._graphicStore.queryItems(e);if(!t.length)return;const s=this._createFeatureTile(e.key),r=F.fromItems(e,t,this._metadata);await this._densifyItemsForDisplay([r]),await this._fetchResources([r]);const i=this._writeMeshes(r);s.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:r.objectIdMap})}_removeTile(e){if(!this._tiles.has(e))return;const t=this._tiles.get(e);this.container.removeChild(t),t.destroy(),this._tiles.delete(e)}_getNullSymbol(e){const t=e.geometry;return t?l(t)?w:p(t)||u(t)?S:this.defaultPointSymbolEnabled?b:null:this.defaultPointSymbolEnabled?b:null}async _getTextResources(e,t){const s=new Array,r=new Array;for(let i=0;i<t.length;i++){const o=t[i],{resource:a,overrides:n}=o.textRasterizationParam;if(n?.length>0){const t=_.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:n,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:a.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:a.symbol,textString:a.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},e,this.view.spatialReference,null,m(e.projectedGeometry),null,null);t.then(e=>{const t=e.symbolLayers[0],{textString:s}=t.markerGraphics[0];r.push({type:"cim-rasterization-info",resource:{type:"text",textString:s||"",font:a.font}}),o.text=a.textString=s||""}),s.push(t)}else r.push({type:"cim-rasterization-info",resource:a})}s.length>0&&await Promise.all(s);const o=r.map(e=>this.view.stage.textureManager.rasterizeItem(e)),a=await Promise.all(o);i(a);const n=new Map;for(let i=0;i<t.length;i++){const e=t[i];n.set(e.textRasterizationParam.resource.symbol,{text:e.text,glyphMosaicItems:a[i]})}return n}_cleanupSharedResources(){if(!this._cleanupRequired)return;const e=performance.now();if(e-this._lastCleanup<5e3)return;this._cleanupRequired=!1,this._lastCleanup=e;const t=new Set;for(const r of this._graphicStore.items()){const e=r.symbolResource?.symbolInfo.hash;t.add(e)}const s=new Set(this._hashToSymbolInfo.keys());for(const r of s.values())t.has(r)||this._hashToSymbolInfo.delete(r)}};e([h()],O.prototype,"_effectiveRenderer",null),e([h({constructOnly:!0})],O.prototype,"layerId",void 0),e([h({constructOnly:!0})],O.prototype,"requestUpdateCallback",void 0),e([h()],O.prototype,"container",void 0),e([h({constructOnly:!0})],O.prototype,"graphics",void 0),e([h()],O.prototype,"renderer",void 0),e([h()],O.prototype,"_updateTracking",void 0),e([h()],O.prototype,"updating",null),e([h()],O.prototype,"view",void 0),e([h()],O.prototype,"updateRequested",void 0),e([h()],O.prototype,"defaultPointSymbolEnabled",void 0),O=e([d("esri.views.2d.layers.graphics.GraphicsView2D")],O);export{O as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import r from"../../../../../core/Logger.js";import{watch as i,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import l from"../../../../../geometry/Point.js";import{tryProjectWithZConversion as a}from"../../../../../geometry/projectionUtils.js";import{empty as h,expandPointInPlace as m}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as u}from"../../support/projectionUtils.js";import{createCoordinateHelper as c}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as d}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as p}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let y=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=h()}set areaMeasurement(e){this._set("areaMeasurement",e),null!=e&&null!=this.view&&this._initialize(e,this.view)}set view(e){this._set("view",e),null!=e&&null!=this.areaMeasurement&&this._initialize(this.areaMeasurement,e)}get constructed(){return null!=this.areaMeasurement&&null!=this.view}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||0===this._editGeometry.parts.length}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){const e=h(this._extent);return this.forEachVertex(t=>{m(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(i(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},o)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let i=e.geometry;if(null!=i){const o=a(i,t.spatialReference);null==o&&u(e,i.spatialReference,r.getLogger(this)),i=o}this._editGeometryOperations=null!=i?p.fromGeometry(i,t.state.viewingMode):new p(new d("polygon",c(!0,!1,t.spatialReference)),t.state.viewingMode),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getFirstVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}get lastPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getLastVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;const t=this._editGeometry.parts[0].vertices[0];let r=t;do{if(r.index===e)return r;r=r.rightSegment.rightVertex}while(r!==t&&null!=r);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(const t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){const t=this._editGeometry.coordinateHelper;this.forEachVertex((r,i)=>{t.vectorToPoint(r.pos,g),e(g,i)})}clear(){null!=this.areaMeasurement&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;const t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e),this._editGeometry.parts.at(0));return this.emit("change"),t}close(){if(!this.constructed||0===this._editGeometry.parts.length)return null;const e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit("change"),e}ensureContains(e,t=""){let r=!1;if(this._editGeometry.parts.forEach(t=>{for(const i of t.iterateVertices())i===e&&(r=!0)}),!r)throw new Error(`vertex doesn't exist ${t}`);return r}setVertexPosition(e,t){if(!this.constructed)return null;const r=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),r}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((r,i)=>{const o=e.getVertexPositionAsPointFromIndex(i);r.equals(o)||(t=!1)}),!!t}};e([s({value:null})],y.prototype,"areaMeasurement",null),e([s({value:null})],y.prototype,"view",null),e([s()],y.prototype,"isEmptyPolygon",null),e([s()],y.prototype,"isValidPolygon",null),e([s()],y.prototype,"extent",null),e([s()],y.prototype,"spatialReference",null),e([s()],y.prototype,"numVertices",null),e([s()],y.prototype,"polygonIsClosed",null),y=e([n("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper")],y);const g=new l;export{y as AreaMeasurement3DPathHelper};
5
+ import{__decorate as e}from"tslib";import{EventedAccessor as t}from"../../../../../core/Evented.js";import r from"../../../../../core/Logger.js";import{watch as i,syncAndInitial as o}from"../../../../../core/reactiveUtils.js";import{property as s,subclass as n}from"../../../../../core/accessorSupport/decorators.js";import l from"../../../../../geometry/Point.js";import{tryProject as a}from"../../../../../geometry/projectionUtils.js";import{empty as h,expandPointInPlace as m}from"../../../../../geometry/support/aaBoundingRect.js";import{logFailedGeometryProjectionError as u}from"../../support/projectionUtils.js";import{createCoordinateHelper as c}from"../../../../interactive/coordinateHelper.js";import{EditGeometry as d}from"../../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as p}from"../../../../interactive/editGeometry/EditGeometryOperations.js";let y=class extends t{constructor(e={}){super(e),this._version=0,this._internalGeometryChange=!1,this._extent=h()}set areaMeasurement(e){this._set("areaMeasurement",e),null!=e&&null!=this.view&&this._initialize(e,this.view)}set view(e){this._set("view",e),null!=e&&null!=this.areaMeasurement&&this._initialize(this.areaMeasurement,e)}get constructed(){return null!=this.areaMeasurement&&null!=this.view}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||0===this._editGeometry.parts.length}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.parts[0]?.vertices.length){const e=h(this._extent);return this.forEachVertex(t=>{m(e,t.pos)}),e}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(e,t){this.removeAllHandles(),this.addHandles(i(()=>e.geometry,()=>{this._updateEditGeometryFromModelGeometry(e,t)},o)),this._makeDirty(!0)}_makeDirty(e=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),e&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(e,t){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let i=e.geometry;if(null!=i){const o=a(i,t.spatialReference);null==o&&u(e,i.spatialReference,r.getLogger(this)),i=o}this._editGeometryOperations=null!=i?p.fromGeometry(i,t.state.viewingMode):new p(new d("polygon",c(!0,!1,t.spatialReference)),t.state.viewingMode),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",t=>{this._makeDirty(null!=t.addedVertices||null!=t.removedVertices),this._internalGeometryChange=!0,e.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const e=[];return this.forEachVertex(t=>{e.push(t)}),e}get numVertices(){return this.constructed?this._editGeometry.parts[0]?.vertices.length??0:0}get polygonIsClosed(){return this._editGeometry.parts[0]?.isClosed()??!1}get firstPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getFirstVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}get lastPoint(){if(this.constructed){const{coordinateHelper:e,parts:t}=this._editGeometry,r=t[0]?.getLastVertex();if(null!=r)return e.vectorToPoint(r.pos)}return null}getVertex(e){if(!this.constructed||!this._editGeometry.parts[0]?.vertices.length)return null;const t=this._editGeometry.parts[0].vertices[0];let r=t;do{if(r.index===e)return r;r=r.rightSegment.rightVertex}while(r!==t&&null!=r);return null}getVertexPositionAsPoint(e){return this._editGeometry.coordinateHelper.vectorToPoint(e.pos)}getVertexPositionAsPointFromIndex(e){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(e).pos)}forEachVertex(e){if(this.constructed&&this._editGeometry.parts.length>0)for(const t of this._editGeometry.parts[0].iterateVertices())e(t,t.index)}forEachVertexPosition(e){const t=this._editGeometry.coordinateHelper;this.forEachVertex((r,i)=>{t.vectorToPoint(r.pos,g),e(g,i)})}clear(){null!=this.areaMeasurement&&(this.areaMeasurement.geometry=null)}add(e){if(!this.constructed)return null;const t=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(e),this._editGeometry.parts.at(0));return this.emit("change"),t}close(){if(!this.constructed||0===this._editGeometry.parts.length)return null;const e=this._editGeometryOperations.closePart(this._editGeometry.parts[0]);return this.emit("change"),e}ensureContains(e,t=""){let r=!1;if(this._editGeometry.parts.forEach(t=>{for(const i of t.iterateVertices())i===e&&(r=!0)}),!r)throw new Error(`vertex doesn't exist ${t}`);return r}setVertexPosition(e,t){if(!this.constructed)return null;const r=this._editGeometryOperations.setVertexPosition(e,this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),r}equals(e){if(this.numVertices!==e.numVertices)return!1;let t=!0;return this.forEachVertexPosition((r,i)=>{const o=e.getVertexPositionAsPointFromIndex(i);r.equals(o)||(t=!1)}),!!t}};e([s({value:null})],y.prototype,"areaMeasurement",null),e([s({value:null})],y.prototype,"view",null),e([s()],y.prototype,"isEmptyPolygon",null),e([s()],y.prototype,"isValidPolygon",null),e([s()],y.prototype,"extent",null),e([s()],y.prototype,"spatialReference",null),e([s()],y.prototype,"numVertices",null),e([s()],y.prototype,"polygonIsClosed",null),y=e([n("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementPathHelper")],y);const g=new l;export{y as AreaMeasurement3DPathHelper};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{makeHandle as e}from"../../../../core/handleUtils.js";import{getOrCreateMapValue as t}from"../../../../core/MapUtils.js";const o=new WeakMap;function n(n,r){return t(o,n,()=>new Set).add(r),e(()=>i(n,r))}function i(e,t){const n=o.get(e);n&&(n.delete(t),0===n.size&&o.delete(e))}function r(e,t){const n=o.get(e);if(n)for(const o of n)o!==t&&(o.visible=!1)}export{r as hideOtherAnalysisViews,n as registerAnalysisView,i as unregisterAnalysisView};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../Color.js";import{isSome as i}from"../../../core/arrayUtils.js";import{createTask as r}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{abortMaybe as s}from"../../../core/maybe.js";import{after as n,throwIfAborted as o}from"../../../core/promiseUtils.js";import{watch as a,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{createScreenPointArray as c,createRenderScreenPointArray as d}from"../../../core/screenUtils.js";import{offsetDateUTC as u,convertTime as h}from"../../../core/timeUtils.js";import{property as p,subclass as _}from"../../../core/accessorSupport/decorators.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{AnalysisView3D as f}from"./AnalysisView3D.js";import{longitudeToTimezone as g}from"../support/earthUtils.js";import{computeDirectionsOverTime as y}from"../support/sunUtils.js";import{breadthFirstBinaryPartitioning as v}from"../../../widgets/support/traversalUtils.js";let w=class extends f{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._stopPreviewingTask=null,this._forcePreview=!1,this._autoRestoreForcePreviewEnabled=!0}initialize(){this.addHandles([a(()=>this._forcePreviewDependencies,()=>{s(this._stopPreviewingTask),this._forcePreview=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=r(async e=>{await n(U,e),o(e),this._forcePreview=!1}))},l),a(()=>({renderer:this._renderer,parameters:this._visualizationParameters}),({renderer:e,parameters:t})=>P(e,t),l),a(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext}),({renderer:e,lightDirections:t,lightDirectionsContext:i})=>P(e,{lightDirections:t,lightDirectionsContext:i}),l),a(()=>({renderer:this._renderer,enabled:this.visible}),({renderer:e,enabled:t})=>P(e,{enabled:t}),l),a(()=>({renderer:this._renderer,previewing:this._previewing}),({renderer:e,previewing:t})=>P(e,{previewing:t}),l)])}destroy(){P(this._renderer,{enabled:!1})}get interactive(){return!1}set interactive(e){}get updating(){return!1}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,allLayerViews:i,graphicsView:r}=e;return this._forcePreview||!t||i.some(e=>C(e)&&e.updating)||!r?.suspended&&!!r?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?g(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=u(e,-e.getTimezoneOffset(),"minutes"),e=u(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return u(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return u(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/(O-1)):O}get _interval(){const e=this._durationInterval;switch(this.analysis.mode){case"threshold":case"duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,thresholdOptions:t}=this.analysis;return"threshold"===e&&t.contextEnabled?t.contextOptions.interval||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?b:this._referencePosition;if(null==i)return[];const r=y(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,O),s=r.length;z.length=0;const n=v(0,s,z),o=new Array(s);for(let a=0;a<s;++a)o[a]=r[n[a]];return o}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"threshold":return this._thresholdVisualizationParameters;case"duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){const{threshold:e,color:i}=this.analysis.thresholdOptions,r=this._duration;return{visualization:2,thresholdColor:t.toUnitRGBA(i),threshold:r>0?e/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){const{thresholdOptions:e}=this.analysis;return e.contextEnabled?{visualization:3,gradientColor:t.toUnitRGBA(e.contextOptions.color)}:{}}get _durationVisualizationParameters(){const{color:e,mode:i}=this.analysis.durationOptions,r=this._duration,s=r>0&&"hourly"===i?T/r:0,n=t.toUnitRGBA(e);return 0===s?{...this._discreteVisualizationParameters,gradientColor:n}:{bandedGradientColor:n,visualization:1,bandSize:s}}get _discreteVisualizationParameters(){return{gradientColor:t.toUnitRGBA(this.analysis.discreteOptions.color),visualization:0}}get _forcePreviewDependencies(){const{view:e}=this,t=e.slice.plane,r=e.allLayerViews.toArray().filter(C),s=r.map(e=>e.layer).filter(i),n=r.map(e=>e.suspended),o=s.map(e=>e.visible),a=s.map(e=>e.opacity),l=!!e.graphicsView?.suspended,c=s.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),d=r.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:t,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:n,graphicsViewSuspended:l,layerVisibilities:o,layerOpacities:a,filters:d,definitionExpressions:c}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){const{_renderer:t,_durationSampleCount:i}=this;if(null==t||0===i)return 0;const r=this.view.state.camera.screenToRender(c(e.x,e.y),d());return t.readAccumulatedShadow(r)*this._duration}};e([p({readOnly:!0,type:["shadow-cast-view-3d"]})],w.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],w.prototype,"analysis",void 0),e([p({readOnly:!0})],w.prototype,"updating",null),e([p()],w.prototype,"_stopPreviewingTask",void 0),e([p()],w.prototype,"_forcePreview",void 0),e([p()],w.prototype,"_autoRestoreForcePreviewEnabled",void 0),e([p()],w.prototype,"_previewing",null),e([p()],w.prototype,"_effectiveUtcOffset",null),e([p()],w.prototype,"_utcOffsetAuto",null),e([p()],w.prototype,"_dateUTCOffset",null),e([p()],w.prototype,"_startDateTimeUTC",null),e([p()],w.prototype,"_endDateTimeUTC",null),e([p()],w.prototype,"_referencePosition",null),e([p()],w.prototype,"_interval",null),e([p()],w.prototype,"_intervalContext",null),e([p()],w.prototype,"_durationSampleCount",null),e([p()],w.prototype,"_duration",null),e([p()],w.prototype,"_lightDirections",null),e([p()],w.prototype,"_lightDirectionsContext",null),e([p()],w.prototype,"_visualizationParameters",null),e([p()],w.prototype,"_thresholdVisualizationParameters",null),e([p()],w.prototype,"_thresholdDiscreteVisualizationParameters",null),e([p()],w.prototype,"_durationVisualizationParameters",null),e([p()],w.prototype,"_discreteVisualizationParameters",null),e([p()],w.prototype,"_forcePreviewDependencies",null),e([p()],w.prototype,"_renderer",null),w=e([_("esri.views.3d.analysis.ShadowCastAnalysisView3D")],w);const D=w;function P(e,t){null!=t&&e?.setParameters({shadowCast:t})}function C(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"graphics-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;default:return!1}}const T=h(1,"hours","milliseconds"),U=500,O=255,b=m(),z=[];export{D as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../Color.js";import{isSome as i}from"../../../core/arrayUtils.js";import{createTask as r}from"../../../core/asyncUtils.js";import"../../../core/has.js";import{abortMaybe as s}from"../../../core/maybe.js";import{after as n,throwIfAborted as o}from"../../../core/promiseUtils.js";import{watch as a,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{createScreenPointArray as c,createRenderScreenPointArray as d}from"../../../core/screenUtils.js";import{offsetDateUTC as u,convertTime as h}from"../../../core/timeUtils.js";import{property as p,subclass as _}from"../../../core/accessorSupport/decorators.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{AnalysisView3D as f}from"./AnalysisView3D.js";import{registerAnalysisView as v,hideOtherAnalysisViews as g}from"./ShadowCast/analysisViewRegister.js";import{longitudeToTimezone as y}from"../support/earthUtils.js";import{computeDirectionsOverTime as w}from"../support/sunUtils.js";import{breadthFirstBinaryPartitioning as D}from"../../../widgets/support/traversalUtils.js";let P=class extends f{constructor(e){super(e),this.type="shadow-cast-view-3d",this.analysis=null,this._stopPreviewingTask=null,this._forcePreview=!1,this._autoRestoreForcePreviewEnabled=!0}initialize(){this.addHandles([v(this.view,this),a(()=>this._forcePreviewDependencies,()=>{s(this._stopPreviewingTask),this._forcePreview=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=r(async e=>{await n(O,e),o(e),this._forcePreview=!1}))},l),a(()=>({renderer:this._renderer,visible:this.visible}),({renderer:e,visible:t})=>{t&&g(this.view,this),e?.setParameters({shadowCast:{enabled:t}})},l),a(()=>({renderer:this._renderer,parameters:this._visualizationParameters,visible:this.visible}),({renderer:e,parameters:t,visible:i})=>{b(e,i,t)},l),a(()=>({renderer:this._renderer,lightDirections:this._lightDirections,lightDirectionsContext:this._lightDirectionsContext,visible:this.visible}),({renderer:e,lightDirections:t,lightDirectionsContext:i,visible:r})=>{b(e,r,{lightDirections:t,lightDirectionsContext:i})},l),a(()=>({renderer:this._renderer,previewing:this._previewing,visible:this.visible}),({renderer:e,previewing:t,visible:i})=>{b(e,i,{previewing:t})},l)])}destroy(){this.visible&&b(this._renderer,!0,{enabled:!1})}get interactive(){return!1}set interactive(e){}get updating(){return!1}get visible(){return super.visible}set visible(e){super.visible=e}get _previewing(){const{view:e}=this;if(null==e?.allLayerViews)return!0;const{stationary:t,allLayerViews:i,graphicsView:r}=e;return this._forcePreview||!t||i.some(e=>T(e)&&e.updating)||!r?.suspended&&!!r?.updating}get _effectiveUtcOffset(){return this.analysis.utcOffset??this._utcOffsetAuto}get _utcOffsetAuto(){const e=this._referencePosition;return null!=e?y(e[0],!1):0}get _dateUTCOffset(){let e=this.analysis.date;return e=u(e,-e.getTimezoneOffset(),"minutes"),e=u(e,-this._effectiveUtcOffset,"hours"),e}get _startDateTimeUTC(){return u(this._dateUTCOffset,this.analysis.startTimeOfDay)}get _endDateTimeUTC(){return u(this._dateUTCOffset,this.analysis.endTimeOfDay)}get _referencePosition(){return this.view?.environmentManager?.referencePositionGeographic}get _durationInterval(){return this._duration>0?Math.floor(this._duration/(V-1)):V}get _interval(){const e=this._durationInterval;switch(this.analysis.mode){case"threshold":return this._duration>0?e:0;case"duration":return e;case"discrete":return this.analysis.discreteOptions.interval||e}}get _intervalContext(){const{mode:e,thresholdOptions:t}=this.analysis;return"threshold"===e&&t.contextEnabled?t.contextOptions.interval||this._durationInterval:-1}get _durationSampleCount(){return this._lightDirections.length}get _duration(){const{startTimeOfDay:e,endTimeOfDay:t}=this.analysis;return t-e}get _lightDirections(){return this._calculateLightDirections(this._interval)}get _lightDirectionsContext(){return this._calculateLightDirections(this._intervalContext)}_calculateLightDirections(e){const{view:t}=this;if(e<=0)return[];const i="global"===t.viewingMode?z:this._referencePosition;if(null==i)return[];const r=w(this._startDateTimeUTC,this._endDateTimeUTC,e,i,t.state.viewingMode,V),s=r.length;x.length=0;const n=D(0,s,x),o=new Array(s);for(let a=0;a<s;++a)o[a]=r[n[a]];return o}get _visualizationParameters(){if(!this.visible)return null;switch(this.analysis.mode){case"threshold":return this._thresholdVisualizationParameters;case"duration":return this._durationVisualizationParameters;case"discrete":return this._discreteVisualizationParameters}}get _thresholdVisualizationParameters(){const{threshold:e,color:i}=this.analysis.thresholdOptions,r=this._duration;return{visualization:2,thresholdColor:t.toUnitRGBA(i),threshold:r>0?e/this._duration:0,...this._thresholdDiscreteVisualizationParameters}}get _thresholdDiscreteVisualizationParameters(){const{thresholdOptions:e}=this.analysis;return e.contextEnabled?{visualization:3,gradientColor:t.toUnitRGBA(e.contextOptions.color)}:{}}get _durationVisualizationParameters(){const{color:e,mode:i}=this.analysis.durationOptions,r=this._duration,s=r>0&&"hourly"===i?U/r:0,n=t.toUnitRGBA(e);return 0===s?{...this._discreteVisualizationParameters,gradientColor:n}:{bandedGradientColor:n,visualization:1,bandSize:s}}get _discreteVisualizationParameters(){return{gradientColor:t.toUnitRGBA(this.analysis.discreteOptions.color),visualization:0}}get _forcePreviewDependencies(){const{view:e}=this,t=e.slice.plane,r=e.allLayerViews.toArray().filter(T),s=r.map(e=>e.layer).filter(i),n=r.map(e=>e.suspended),o=s.map(e=>e.visible),a=s.map(e=>e.opacity),l=!!e.graphicsView?.suspended,c=s.filter(e=>"definitionExpression"in e).map(e=>e.definitionExpression),d=r.filter(e=>"filter"in e).map(e=>e.filter);return{slicePlane:t,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewSuspended:n,graphicsViewSuspended:l,layerVisibilities:o,layerOpacities:a,filters:d,definitionExpressions:c}}get _renderer(){return this.view?.stage?.renderer}get testData(){}async getDurationAtScreen(e){const{_renderer:t,_durationSampleCount:i}=this;if(null==t||0===i)return 0;const r=this.view.state.camera.screenToRender(c(e.x,e.y),d());return t.readAccumulatedShadow(r)*this._duration}};e([p({readOnly:!0,type:["shadow-cast-view-3d"]})],P.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],P.prototype,"analysis",void 0),e([p({readOnly:!0})],P.prototype,"updating",null),e([p()],P.prototype,"_stopPreviewingTask",void 0),e([p()],P.prototype,"_forcePreview",void 0),e([p()],P.prototype,"_autoRestoreForcePreviewEnabled",void 0),e([p()],P.prototype,"_previewing",null),e([p()],P.prototype,"_effectiveUtcOffset",null),e([p()],P.prototype,"_utcOffsetAuto",null),e([p()],P.prototype,"_dateUTCOffset",null),e([p()],P.prototype,"_startDateTimeUTC",null),e([p()],P.prototype,"_endDateTimeUTC",null),e([p()],P.prototype,"_referencePosition",null),e([p()],P.prototype,"_interval",null),e([p()],P.prototype,"_intervalContext",null),e([p()],P.prototype,"_durationSampleCount",null),e([p()],P.prototype,"_duration",null),e([p()],P.prototype,"_lightDirections",null),e([p()],P.prototype,"_lightDirectionsContext",null),e([p()],P.prototype,"_visualizationParameters",null),e([p()],P.prototype,"_thresholdVisualizationParameters",null),e([p()],P.prototype,"_thresholdDiscreteVisualizationParameters",null),e([p()],P.prototype,"_durationVisualizationParameters",null),e([p()],P.prototype,"_discreteVisualizationParameters",null),e([p()],P.prototype,"_forcePreviewDependencies",null),e([p()],P.prototype,"_renderer",null),P=e([_("esri.views.3d.analysis.ShadowCastAnalysisView3D")],P);const C=P;function b(e,t,i){t&&null!=i&&e?.setParameters({shadowCast:i})}function T(e){if(e.suspended)return!1;switch(e.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"graphics-3d":case"integrated-mesh-3d":case"integrated-mesh-3dtiles":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":case"catalog-footprint-3d":return!0;default:return!1}}const U=h(1,"hours","milliseconds"),O=500,V=255,z=m(),x=[];export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import i from"../../../../analysis/SlicePlane.js";import t from"../../../../core/Accessor.js";import a from"../../../../core/Logger.js";import{watch as l,sync as s}from"../../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{a as o}from"../../../../chunks/boundedPlane.js";import c from"../../../../layers/Layer.js";import h from"../../../../layers/buildingSublayers/BuildingComponentSublayer.js";import{isBuildingSceneLayerView3D as u,projectAndElevationAlignShape as d,projectedShapeToPlane as p,planeToShape as y}from"./sliceToolUtils.js";import{logFailedGeometryProjectionError as w}from"../support/projectionUtils.js";import{isTerrainSurfaceLayer as v}from"../../terrain/isTerrainSurfaceLayer.js";let f=class extends t{constructor(e){super(e),this._internalChange=!1,this._currentSlicePlane=null}initialize(){this.addHandles(this.analysis.excludedLayers.on("before-add",e=>{const i=e.item;null!=i&&(i instanceof c||i instanceof h)?i instanceof c&&v(i)?(a.getLogger(this).error("excludedLayers",`Layer '${i.title}, id:${i.id}' of type '${i.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysis.excludedLayers.includes(i)&&e.preventDefault():(a.getLogger(this).error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())})),S(this.view,this),this.addHandles([l(()=>this.analysisViewData.plane,()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()},s),l(()=>this.analysis.excludeGroundSurface,()=>this._updateLayerViews(),s),this.analysis.excludedLayers.on("change",()=>this._updateLayerViews()),l(()=>[this.analysisViewData.active,this.analysisViewData.visible],()=>{this._updateActiveController(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()},s),l(()=>this._allLayerAndSubLayerViews,()=>this._updateLayerViews())]),this.addHandles([l(()=>this.analysis.shape,()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())},s),l(()=>"web-scene"!==this.analysis.origin?.type,()=>this._updateViewSlicePlaneDecoration(),s)],"analysis"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()}destroy(){this.analysisViewData.active&&(this.analysisViewData.active=!1,this.view.slice.plane=null,this._updateActiveController(),this._updateViewSlicePlane()),P(this.view,this),this.set("view",null)}get _allLayerAndSubLayerViews(){const e=this.view.allLayerViews.items;return e.concat(e.filter(u).flatMap(({sublayerViews:e})=>e.items))}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,t=this._currentSlicePlane;if(null==t&&null==e||null!=t&&null!=e&&e.equals(t))return;let l=null,s=null;if(null!=e?.position){const t=e.position.spatialReference,n=d(e,this.view);null==n&&w(this.analysis,t,a.getLogger(this)),l=p(n,this.view,{tiltEnabled:this.analysis.tiltEnabled},o()),null!=l&&(s=new i({heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height}))}this._currentSlicePlane=s,this._internalChange=!0,this.analysisViewData.plane=l,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisViewData.plane,t=y(e,this.view,this.view.spatialReference,new i);let a=null;null!=t&&(a=new i({heading:t.heading,tilt:t.tilt,position:t.position,width:t.width,height:t.height})),this._currentSlicePlane=a,this._internalChange=!0,this.analysis.shape=t,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(V)return;const e=b(this.view);if(!e)return;if(this.analysisViewData.active)null!=e.activeController&&e.activeController!==this?(V=!0,e.activeController.analysisViewData.active=!1,V=!1):null!=e.activeController&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(null!=e.activeController&&e.activeController!==this)return;null!=e.activeController&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){_(this.view)}_updateViewSlicePlaneDecoration(){m(this.view)}_updateLayerViews(){const e=null!=this.analysisViewData.plane&&this.analysisViewData.visible&&this.analysisViewData.active,i=[],t=e=>{"layers"in e?e.layers.forEach(t):i.push(e)};this.analysis.excludedLayers.forEach(t),this.view.allLayerViews.forEach(t=>{t.destroyed||("slicePlaneEnabled"in t&&(t.slicePlaneEnabled=e&&!i.includes(t.layer)),"sublayerViews"in t&&t.sublayerViews.forEach(t=>{t.slicePlaneEnabled=e&&!i.includes(t.sublayer)}))}),null!=this.view.basemapTerrain&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysis.excludeGroundSurface)}};e([n()],f.prototype,"view",void 0),e([n()],f.prototype,"analysis",void 0),e([n()],f.prototype,"analysisViewData",void 0),e([n()],f.prototype,"_allLayerAndSubLayerViews",null),f=e([r("esri.views.3d.analysis.Slice.SliceController")],f);const g=new Map;let V=!1;function _(e){const i=b(e),t=i?.activeController;null!=t?.analysisViewData.plane&&t.analysisViewData.visible?e.slice.plane=t.analysisViewData.plane:e.slice.plane=null}function m(e){const i=b(e),t=i?.activeController;e.slice.isDecoration="web-scene"!==t?.analysis.origin?.type}function S(e,i){g.has(e)||g.set(e,{all:[],activeController:null}),g.get(e)?.all.push(i)}function b(e){return g.get(e)}function P(e,i){if(!g.has(e))throw new Error("view expected in global slice register");const t=g.get(e),a=t?.all.lastIndexOf(i)??-1;if(!t||-1===a)throw new Error("controller expected in global slice register");t.all.splice(a,1),0===t.all.length&&g.delete(e)}export{f as SliceController};
5
+ import{__decorate as e}from"tslib";import i from"../../../../analysis/SlicePlane.js";import t from"../../../../core/Accessor.js";import a from"../../../../core/Logger.js";import{watch as l,sync as s}from"../../../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{d as o}from"../../../../chunks/boundedPlane.js";import c from"../../../../layers/Layer.js";import h from"../../../../layers/buildingSublayers/BuildingComponentSublayer.js";import{isBuildingSceneLayerView3D as u,projectAndElevationAlignShape as d,projectedShapeToPlane as p,planeToShape as y}from"./sliceToolUtils.js";import{logFailedGeometryProjectionError as w}from"../support/projectionUtils.js";import{isTerrainSurfaceLayer as v}from"../../terrain/isTerrainSurfaceLayer.js";let f=class extends t{constructor(e){super(e),this._internalChange=!1,this._currentSlicePlane=null}initialize(){this.addHandles(this.analysis.excludedLayers.on("before-add",e=>{const i=e.item;null!=i&&(i instanceof c||i instanceof h)?i instanceof c&&v(i)?(a.getLogger(this).error("excludedLayers",`Layer '${i.title}, id:${i.id}' of type '${i.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysis.excludedLayers.includes(i)&&e.preventDefault():(a.getLogger(this).error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())})),S(this.view,this),this.addHandles([l(()=>this.analysisViewData.plane,()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()},s),l(()=>this.analysis.excludeGroundSurface,()=>this._updateLayerViews(),s),this.analysis.excludedLayers.on("change",()=>this._updateLayerViews()),l(()=>[this.analysisViewData.active,this.analysisViewData.visible],()=>{this._updateActiveController(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()},s),l(()=>this._allLayerAndSubLayerViews,()=>this._updateLayerViews())]),this.addHandles([l(()=>this.analysis.shape,()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())},s),l(()=>"web-scene"!==this.analysis.origin?.type,()=>this._updateViewSlicePlaneDecoration(),s)],"analysis"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane(),this._updateViewSlicePlaneDecoration()}destroy(){this.analysisViewData.active&&(this.analysisViewData.active=!1,this.view.slice.plane=null,this._updateActiveController(),this._updateViewSlicePlane()),P(this.view,this),this.set("view",null)}get _allLayerAndSubLayerViews(){const e=this.view.allLayerViews.items;return e.concat(e.filter(u).flatMap(({sublayerViews:e})=>e.items))}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,t=this._currentSlicePlane;if(null==t&&null==e||null!=t&&null!=e&&e.equals(t))return;let l=null,s=null;if(null!=e?.position){const t=e.position.spatialReference,n=d(e,this.view);null==n&&w(this.analysis,t,a.getLogger(this)),l=p(n,this.view,{tiltEnabled:this.analysis.tiltEnabled},o()),null!=l&&(s=new i({heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height}))}this._currentSlicePlane=s,this._internalChange=!0,this.analysisViewData.plane=l,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisViewData.plane,t=y(e,this.view,this.view.spatialReference,new i);let a=null;null!=t&&(a=new i({heading:t.heading,tilt:t.tilt,position:t.position,width:t.width,height:t.height})),this._currentSlicePlane=a,this._internalChange=!0,this.analysis.shape=t,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(V)return;const e=b(this.view);if(!e)return;if(this.analysisViewData.active)null!=e.activeController&&e.activeController!==this?(V=!0,e.activeController.analysisViewData.active=!1,V=!1):null!=e.activeController&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(null!=e.activeController&&e.activeController!==this)return;null!=e.activeController&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){_(this.view)}_updateViewSlicePlaneDecoration(){m(this.view)}_updateLayerViews(){const e=null!=this.analysisViewData.plane&&this.analysisViewData.visible&&this.analysisViewData.active,i=[],t=e=>{"layers"in e?e.layers.forEach(t):i.push(e)};this.analysis.excludedLayers.forEach(t),this.view.allLayerViews.forEach(t=>{t.destroyed||("slicePlaneEnabled"in t&&(t.slicePlaneEnabled=e&&!i.includes(t.layer)),"sublayerViews"in t&&t.sublayerViews.forEach(t=>{t.slicePlaneEnabled=e&&!i.includes(t.sublayer)}))}),null!=this.view.basemapTerrain&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysis.excludeGroundSurface)}};e([n()],f.prototype,"view",void 0),e([n()],f.prototype,"analysis",void 0),e([n()],f.prototype,"analysisViewData",void 0),e([n()],f.prototype,"_allLayerAndSubLayerViews",null),f=e([r("esri.views.3d.analysis.Slice.SliceController")],f);const g=new Map;let V=!1;function _(e){const i=b(e),t=i?.activeController;null!=t?.analysisViewData.plane&&t.analysisViewData.visible?e.slice.plane=t.analysisViewData.plane:e.slice.plane=null}function m(e){const i=b(e),t=i?.activeController;e.slice.isDecoration="web-scene"!==t?.analysis.origin?.type}function S(e,i){g.has(e)||g.set(e,{all:[],activeController:null}),g.get(e)?.all.push(i)}function b(e){return g.get(e)}function P(e,i){if(!g.has(e))throw new Error("view expected in global slice register");const t=g.get(e),a=t?.all.lastIndexOf(i)??-1;if(!t||-1===a)throw new Error("controller expected in global slice register");t.all.splice(a,1),0===t.all.length&&g.delete(e)}export{f as SliceController};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{g as y,b as P,d as w,j as f,i as g,p as M,n as V,h as b}from"../../../../chunks/vec32.js";import{create as T,clone as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as k,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{a as x,d as S,n as C,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as z,getNormal as O}from"../../../../geometry/support/plane.js";import{create as G}from"../../../../geometry/support/ray.js";import{sv3d as U,sm4d as I,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getSliceableContainer as A}from"../../../../graphic/getSliceableContainer.js";import{getRotateHeadingTexture as F,getTiltRotateTexture as B}from"../images/Factory.js";import{ResizeManipulator as L}from"./ResizeManipulator.js";import{RotateManipulator as q}from"./RotateManipulator.js";import{getOutlineColor as N,planeColor as J}from"./settings.js";import{ShiftManipulator as Q}from"./ShiftManipulator.js";import{pointerMoveTimerMs as W,planePreviewOutlineWidth as X,forceVerticalModifier as Y,forceHorizontalModifier as Z,previewFadeDurationSeconds as $,previewFadeDotThreshold as tt,initialDepthOffsetFrac as et}from"./sliceToolConfig.js";import{createGridVisualElement as it,createOutlineVisualElement as at,planeToShape as st,createRotatePlane as nt,resizePlane as rt,calculatePlaneHalfSize as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as mt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as yt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as wt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as ft}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Mt}from"../../../support/screenUtils.js";var Vt;let bt=class extends wt{static{Vt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.multiTouchEnabled=!1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=W,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&S(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new Q(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new q(this.view,(t,e)=>F(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new q(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new L(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=it(this.view),this._previewPlaneOutlineVisualElement=at(this.view),this._previewPlaneOutlineVisualElement.width=X,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active&&(this._placingSlicePlane||"exclude"===this.mode)?"crosshair":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-move":this._onPointerMove(t);break;case"immediate-click":if(!Dt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Mt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=Mt(t),a=x();return!!this._pickPlane(i,!1,this._activeKeyModifiers,a)&&(S(a,this._startPlane),this.analysis.shape=st(a,this.view,this.view.spatialReference,new e),this.stop(),!0)}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(Mt(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=A(t.origin)??t.sourceLayer??t.layer;e&&"subtype-sublayer"!==e.type&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===Y||t.key===Z)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Y&&t.key!==Z||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,Et);S(this.analysisViewData.plane,this._startPlane),this.inputState=Tt(e,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(y(C(this.analysisViewData.plane),e.ray.direction)/P(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(U.get(),this._startPlane.origin),i=w(U.get(),C(this._startPlane));f(i,i,-t.depth),g(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,Et),a=T();z(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,Et),a=T();z(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=O(t.rotatePlane),a=mt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(I.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(U.get(),this._startPlane.basis1,e),a=M(U.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,Et),a=U.get();z(this.analysisViewData.plane.plane,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:D(a)})}_createResizeDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=S(this.analysisViewData.plane,x());e.next(yt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,S(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?S(i,kt):null,this._pickPlane(t,!0,e,a)){const t=tt;let e=!1;null!=i&&(e=y(O(i.plane),O(a.plane))<t||y(V(U.get(),i.basis1),V(U.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*$),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=U.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(U.get()),l=this.view.state.camera;y(r,l.viewForward)>0&&f(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*et,p=f(U.get(),r,h);g(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[Y]?2:i[Z]?1:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht},this._pointerMoveTimerMs)}_updateManipulators(){if(Vt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=pt(t,I.get());ut(this.shiftManipulator,e,t,this.view.state.camera),ct(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>_t(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(i||"place"===this._mode),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=pt(t,I.get()),i=b(U.get(),P(t.basis1),P(t.basis2),1),a=v(I.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=N(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=k(J);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=E}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function Tt(t,e,i){const a=vt(e,C(i),t.direction,R()),s=T();return z(a,t,s)?{type:"shift",shiftPlane:a,depth:0,startPoint:s}:null}function Dt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],bt.prototype,"_clock",void 0),t([c({constructOnly:!0})],bt.prototype,"view",void 0),t([c()],bt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],bt.prototype,"state",null),t([c({readOnly:!0})],bt.prototype,"cursor",null),t([c()],bt.prototype,"analysis",null),t([c()],bt.prototype,"multiTouchEnabled",void 0),t([c()],bt.prototype,"removeIncompleteOnCancel",void 0),t([c()],bt.prototype,"_mode",void 0),t([c()],bt.prototype,"mode",null),t([c({value:null})],bt.prototype,"inputState",null),t([c()],bt.prototype,"_placingSlicePlane",null),bt=Vt=t([d("esri.views.3d.analysis.Slice.SliceTool")],bt);const kt=x(),Et=G();export{bt as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../../analysis/SlicePlane.js";import{clock as i}from"../../../../core/clock.js";import{destroyMaybe as a,removeMaybe as s}from"../../../../core/maybe.js";import{watch as n,sync as r,when as l,syncAndInitial as o}from"../../../../core/reactiveUtils.js";import{addFrameTask as h}from"../../../../core/scheduling.js";import{createScreenPoint as p,screenPointObjectToArray as u}from"../../../../core/screenUtils.js";import{property as c,subclass as d}from"../../../../core/accessorSupport/decorators.js";import{fromRotation as _,fromScaling as v,multiply as m}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{g as y,b as P,d as w,j as f,i as g,p as M,n as V,h as b}from"../../../../chunks/vec32.js";import{create as T,clone as D}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{clone as k,ZEROS as E}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{d as x,c as S,n as C,f as j}from"../../../../chunks/boundedPlane.js";import{signedDistance as H,create as R,intersectRay as z,getNormal as O}from"../../../../geometry/support/plane.js";import{create as G}from"../../../../geometry/support/ray.js";import{sv3d as U,sm4d as I,sv2d as K}from"../../../../geometry/support/vectorStacks.js";import{getSliceableContainer as A}from"../../../../graphic/getSliceableContainer.js";import{getRotateHeadingTexture as F,getTiltRotateTexture as B}from"../images/Factory.js";import{ResizeManipulator as L}from"./ResizeManipulator.js";import{RotateManipulator as q}from"./RotateManipulator.js";import{getOutlineColor as N,planeColor as J}from"./settings.js";import{ShiftManipulator as Q}from"./ShiftManipulator.js";import{pointerMoveTimerMs as W,planePreviewOutlineWidth as X,forceVerticalModifier as Y,forceHorizontalModifier as Z,previewFadeDurationSeconds as $,previewFadeDotThreshold as tt,initialDepthOffsetFrac as et}from"./sliceToolConfig.js";import{createGridVisualElement as it,createOutlineVisualElement as at,planeToShape as st,createRotatePlane as nt,resizePlane as rt,calculatePlaneHalfSize as lt,createPlane as ot,DidPointerMoveRecentlyFlag as ht,calculateBoundedPlaneTranslateRotate as pt,updateShiftRestartHandle as ut,updateRotateHeadingHandle as ct,updateRotateTiltHandle as dt,updateResizeHandle as _t,createShiftPlane as vt}from"./sliceToolUtils.js";import{calculateInputRotationTransform as mt}from"../../interactive/manipulatorUtils.js";import{screenToRenderPlane as yt}from"../../interactive/editingTools/dragEventPipeline3D.js";import{fromScreenNormalized as Pt}from"../../support/geometryUtils/ray.js";import{AnalysisToolBase as wt}from"../../../interactive/AnalysisToolBase.js";import{createManipulatorDragEventPipeline as ft}from"../../../interactive/dragEventPipeline.js";import{newToolIntersector as gt}from"../../../interactive/ToolIntersector.js";import{createScreenPointFromEvent as Mt}from"../../../support/screenUtils.js";var Vt;let bt=class extends wt{static{Vt=this}constructor(t){super(t),this._clock=i,this._previewPlaneOpacity=1,this.multiTouchEnabled=!1,this.removeIncompleteOnCancel=!1,this._mode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=W,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=x(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=p(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=gt(t.view.state.viewingMode)}initialize(){if(null==this.analysis)throw new Error("SliceTool requires valid analysis, but null was provided.");const t=t=>{this._updateManipulatorsInteractive(t),t.grabbing||(null!=this.analysisViewData.plane&&S(this.analysisViewData.plane,this._startPlane),this.inputState=null)},e=new Q(this.view,1);this.shiftManipulator=e,this.manipulators.add(e),this.addHandles([this._createShiftDragPipeline(e),e.events.on("grab-changed",i=>{this._onShiftGrab(i),t(e)})]);const i=!this.view.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result,a=new q(this.view,(t,e)=>F(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",e=>{this._onRotateHeadingGrab(e),t(a)})]);const s=new q(this.view,(t,e)=>B(this.view.stage.textures,{accentColor:t,contrastColor:e,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",e=>{this._onRotateTiltGrab(e),t(s)})]),this.resizeManipulators=this._resizeHandles.map((e,i)=>{const a=new L(this.view,e);return this.addHandles([this._createResizeDragPipeline(a),a.events.on("grab-changed",e=>{this._onResizeGrab(e,i),t(a)})]),a}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=it(this.view),this._previewPlaneOutlineVisualElement=at(this.view),this._previewPlaneOutlineVisualElement.width=X,this.addHandles(n(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),r)),this.addHandles([l(()=>"sliced"===this.state,()=>{this.finishToolCreation(),this.stop()},o),n(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=a(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=a(this._previewPlaneGridVisualElement)}get state(){const t=!!this.analysisViewData.plane,e=!!this.inputState;return t?t&&e?"slicing":t&&!e?"sliced":"ready":"ready"}get cursor(){return this.active&&(this._placingSlicePlane||"exclude"===this.mode)?"crosshair":null}set analysis(t){if(null==t)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",t)}get mode(){return this._mode}static{this.disableEngineLayers=!1}get inputState(){return this._get("inputState")}set inputState(t){this._set("inputState",t),this.analysisViewData.showGrid=null!=t&&"resize"===t.type,this._updateMaterials()}get _placingSlicePlane(){return this.active&&!this.inputState&&"place"===this._mode}start(t){this._finishToolCreationIfValid(),this._mode=t,this.active||(this.view.activeTool=this)}stop(){this.active&&(this.view.activeTool=null)}onActivate(){this._finishToolCreationIfValid(),"none"===this._mode&&null==this.analysisViewData.plane&&(this._mode="place")}onDeactivate(){this._mode="none",this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(t){this._updateManipulators(),t||this._clearPointerMoveTimeout()}onInputEvent(t){switch(t.type){case"pointer-move":this._onPointerMove(t);break;case"immediate-click":if(!Dt(t))return;"exclude"===this._mode?t.defer(async()=>{await this._onClickExcludeLayer(t)&&t.stopPropagation()}):this._onClickPlacePlane(t)&&t.stopPropagation();break;case"drag":this.inputState&&t.stopPropagation();break;case"key-down":this._onKeyDown(t)&&t.stopPropagation();break;case"key-up":this._onKeyUp(t)&&t.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerMove(t){this._lastCursorPosition.x=t.x,this._lastCursorPosition.y=t.y,this._resetPointerMoveTimeout(),"touch"!==t.pointerType&&this._updatePreviewPlane(Mt(t),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onClickPlacePlane(t){if(!this._placingSlicePlane)return!1;const i=Mt(t),a=x();return!!this._pickPlane(i,!1,this._activeKeyModifiers,a)&&(S(a,this._startPlane),this.analysis.shape=st(a,this.view,this.view.spatialReference,new e),this.stop(),!0)}async _onClickExcludeLayer(t){if("exclude"!==this.mode)return!1;const e=await this.view.hitTest(Mt(t)),i=e.results.at(0);if(i){const t="graphic"===i.type&&i.graphic;if(t){const e=A(t.origin)??t.sourceLayer??t.layer;e&&"subtype-sublayer"!==e.type&&this.analysis.excludedLayers.push(e)}}else e.ground.layer?this.analysis.excludedLayers.push(e.ground.layer):this.analysis.excludeGroundSurface=!0;return this.stop(),!0}_onKeyDown(t){return(t.key===Y||t.key===Z)&&(this._activeKeyModifiers[t.key]=!0,null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(t){return!(t.key!==Y&&t.key!==Z||!this._activeKeyModifiers[t.key])&&(delete this._activeKeyModifiers[t.key],null!=this._previewPlane&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=Pt(this.view.state.camera,t.screenPoint,Et);S(this.analysisViewData.plane,this._startPlane),this.inputState=Tt(e,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"shift"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.shiftPlane)).next(this._shiftDragAdjustSensitivity(a)).next(this._shiftDragUpdatePlane(a)),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_shiftDragAdjustSensitivity(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=.001,a=Math.min((1-Math.abs(y(C(this.analysisViewData.plane),e.ray.direction)/P(e.ray.direction)))/i,1),s=-H(this._startPlane.plane,e.renderEnd),n=-H(this._startPlane.plane,t.startPoint);return t.depth=t.depth*(1-a)+s*a-n,e}}_shiftDragUpdatePlane(t){return()=>{if(null==this.analysisViewData.plane)return;const e=w(U.get(),this._startPlane.origin),i=w(U.get(),C(this._startPlane));f(i,i,-t.depth),g(i,i,e);const a=j(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,x());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,1,R()),i=Pt(this.view.state.camera,t.screenPoint,Et),a=T();z(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateHeadingDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_onRotateTiltGrab(t){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const e=nt(this.analysisViewData.plane,this.view.renderCoordsHelper,2,R()),i=Pt(this.view.state.camera,t.screenPoint,Et),a=T();z(e,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:e,startPoint:a})}_createRotateTiltDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"rotate"!==a.type)return;const s=null!=this.analysisViewData.plane?S(this.analysisViewData.plane,x()):null;e.next(yt(this.view,a.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(a)).next(this._rotateDragUpdatePlaneFromRotate()),i.next(()=>{null!=s&&this._updateBoundedPlane(s)})})}_rotateDragRenderPlaneToRotate(t){return e=>{if(null==this.analysisViewData.plane)return null;const i=O(t.rotatePlane),a=mt(t.startPoint,e.renderEnd,this.analysisViewData.plane.origin,i);return{...e,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return t=>{if(null==this.analysisViewData.plane)return;const e=_(I.get(),t.rotateAngle,t.rotateAxis);if(null==e)return;const i=M(U.get(),this._startPlane.basis1,e),a=M(U.get(),this._startPlane.basis2,e),s=j(this.analysisViewData.plane.origin,i,a,x());this._updateBoundedPlane(s)}}_onResizeGrab(t,e){if("start"!==t.action||null==this.analysisViewData.plane||!t.screenPoint)return;const i=Pt(this.view.state.camera,t.screenPoint,Et),a=U.get();z(this.analysisViewData.plane.plane,i,a)&&(S(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:e,startPoint:D(a)})}_createResizeDragPipeline(t){return ft(t,(t,e,i)=>{const a=this.inputState;if(null==a||"resize"!==a.type||null==this.analysisViewData.plane)return;const s=S(this.analysisViewData.plane,x());e.next(yt(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(a)),i.next(()=>{this._updateBoundedPlane(s)})})}_resizeDragUpdatePlane(t){return e=>{if(null==this.analysisViewData.plane)return;const i=this._resizeHandles[t.activeHandleIdx],a=rt(i,t.startPoint,e.renderEnd,this.view.state.camera,this._startPlane,S(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(t){const e=this.analysisViewData;if(null==e)throw new Error("valid internal object expected");e.plane=t}_updatePreviewPlane(t,e={}){if("exclude"===this.mode)return;let i=this._previewPlane;if(this._previewPlane=null,null==t)return this._removeFrameTask(),void this._updateManipulators();if(this.active){const a=null!=i?i:x();if(i=null!=i?S(i,kt):null,this._pickPlane(t,!0,e,a)){const t=tt;let e=!1;null!=i&&(e=y(O(i.plane),O(a.plane))<t||y(V(U.get(),i.basis1),V(U.get(),a.basis1))<t),e&&(this._previewPlaneOpacity=0),this._previewPlane=a}}null!=this._previewPlane&&null==this._frameTask&&0===this._previewPlaneOpacity?this._frameTask=h({update:({deltaTime:t})=>{this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+t/(1e3*$),1),this._updateManipulators(),1===this._previewPlaneOpacity&&this._removeFrameTask()}}):null==this._previewPlane&&null!=this._frameTask?this._removeFrameTask():null!=this._previewPlane&&this._updateManipulators()}_removeFrameTask(){this._frameTask=s(this._frameTask)}_pickMinResult(t){const e=u(t,K.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(e,this._intersector),this._intersector.results.min}_pickPlane(t,e,i,a){const s=this._pickMinResult(t),n=U.get();if(!s.getIntersectionPoint(n))return!1;const r=s.getTransformedNormal(U.get()),l=this.view.state.camera;y(r,l.viewForward)>0&&f(r,r,-1);const o=lt(n,l),h=(e?1:-1)*o*et,p=f(U.get(),r,h);g(p,p,n);const u=this.analysis.tiltEnabled?3:0,c=i[Y]?2:i[Z]?1:u;return ot(p,r,o,o,l,c,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=s(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=ht,this.rotateHeadingManipulator.state|=ht,this.rotateTiltManipulator.state|=ht,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~ht,this.rotateHeadingManipulator.state&=~ht,this.rotateTiltManipulator.state&=~ht},this._pointerMoveTimerMs)}_updateManipulators(){if(Vt.disableEngineLayers)return;let t,e,i=!1;if(null!=this.analysisViewData.plane)t=this.analysisViewData.plane,e=this._previewPlane??t,i=!1;else{if(null==this._previewPlane)return this._setManipulatorVisibility(!1),void this._setPreviewPlaneVisibility(!1);e=t=this._previewPlane,i=!0}if(this._setManipulatorVisibility(!i),!i){const e=pt(t,I.get());ut(this.shiftManipulator,e,t,this.view.state.camera),ct(this.rotateHeadingManipulator,e,t,this.view.renderCoordsHelper),dt(this.rotateTiltManipulator,e,t),this.resizeManipulators.forEach((i,a)=>_t(i,this._resizeHandles[a],e,t))}this._setPreviewPlaneVisibility(i||"place"===this._mode),this._updatePreviewPlaneTransform(e),this._updateMaterials()}_setManipulatorVisibility(t){this.shiftManipulator.available=t,this.rotateHeadingManipulator.available=t,this.rotateTiltManipulator.available=t&&this.analysis.tiltEnabled,this.resizeManipulators.forEach(e=>e.available=t)}_updatePreviewPlaneTransform(t){const e=pt(t,I.get()),i=b(U.get(),P(t.basis1),P(t.basis2),1),a=v(I.get(),i),s=m(a,e,a);this._previewPlaneOutlineVisualElement.transform=s,this._previewPlaneGridVisualElement.transform=s}_setPreviewPlaneVisibility(t){const e=this._previewPlaneOutlineVisualElement,i=this._previewPlaneGridVisualElement;t&&(e.attached=!0,i.attached=!0),e.visible=t,i.visible=t}_updateMaterials(){const t=N(this.view.effectiveTheme);t[3]*=this._previewPlaneOpacity;const e=k(J);e[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=t,this._previewPlaneGridVisualElement.backgroundColor=e,this._previewPlaneGridVisualElement.gridColor=E}_updateManipulatorsInteractive(t){if(!t.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===t,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===t,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===t,this.resizeManipulators.forEach(e=>{e.interactive=e===t})}_finishToolCreationIfValid(){this.analysis.valid&&this.finishToolCreation()}get test(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:t=>{this._pointerMoveTimerMs=t}}}};function Tt(t,e,i){const a=vt(e,C(i),t.direction,R()),s=T();return z(a,t,s)?{type:"shift",shiftPlane:a,depth:0,startPoint:s}:null}function Dt(t){return"mouse"!==t.pointerType||0===t.button}t([c()],bt.prototype,"_clock",void 0),t([c({constructOnly:!0})],bt.prototype,"view",void 0),t([c()],bt.prototype,"analysisViewData",void 0),t([c({readOnly:!0})],bt.prototype,"state",null),t([c({readOnly:!0})],bt.prototype,"cursor",null),t([c()],bt.prototype,"analysis",null),t([c()],bt.prototype,"multiTouchEnabled",void 0),t([c()],bt.prototype,"removeIncompleteOnCancel",void 0),t([c()],bt.prototype,"_mode",void 0),t([c()],bt.prototype,"mode",null),t([c({value:null})],bt.prototype,"inputState",null),t([c()],bt.prototype,"_placingSlicePlane",null),bt=Vt=t([d("esri.views.3d.analysis.Slice.SliceTool")],bt);const kt=x(),Et=G();export{bt as default};