@arcgis/core 5.0.0-next.10 → 5.0.0-next.12

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 (414) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/analysis/AreaMeasurementAnalysis.js +1 -1
  3. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +1 -1
  4. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +1 -1
  5. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  6. package/arcade/functions/geomasync.js +1 -1
  7. package/arcade/functions/geomsync.js +1 -1
  8. package/arcade/functions/knowledgegraph.js +1 -1
  9. package/arcade/geometry/nearestVertex.js +5 -0
  10. package/arcade/geometry/operators.js +1 -1
  11. package/arcade/geometry/operatorsWorker.js +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/{af47272aaaef0ea57e71.js → 00ea3052170e831c6bc8.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{91dfd29e2dba200eab09.js → 0105d814fb51c366d1da.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{125e71b0e29d1d132777.js → 02a22dd6d208a925cc5a.js} +1 -1
  16. package/assets/esri/core/workers/chunks/02e7359162cf974b41b6.js +1 -0
  17. package/assets/esri/core/workers/chunks/{ead8d0cbcebd12dbfad7.js → 04211fba145d9f06b3ec.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0441ea7c89266a68b6f0.js +1 -0
  19. package/assets/esri/core/workers/chunks/07f2a75431dd8fc502ef.js +1 -0
  20. package/assets/esri/core/workers/chunks/092d72caf3269e696d1c.js +1 -0
  21. package/assets/esri/core/workers/chunks/{d1e97cce5047f1791e22.js → 0ac13de43438f572f59c.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{629127877042ad784ad2.js → 0c8aeb6262e9ec7c87d0.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{d07f911d40bf05fc0306.js → 1008e3d64f5880e3dbf2.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{c29486c4eeb3e72effff.js → 110429583b28c28c36ee.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{61d970ed75c2c358b1e9.js → 14d601e0fe7a0538c7c1.js} +1 -1
  26. package/assets/esri/core/workers/chunks/18474c017ddacd1d3d2c.js +1 -0
  27. package/assets/esri/core/workers/chunks/{1257c37bf04d39c27b62.js → 1c3bee704bafb64bba70.js} +1 -1
  28. package/assets/esri/core/workers/chunks/1d07846bcaac47df0644.js +1 -0
  29. package/assets/esri/core/workers/chunks/{509392131ec473d6b988.js → 1dfca37f95f2b968aa54.js} +1 -1
  30. package/assets/esri/core/workers/chunks/2132ccc45da90f6208b2.js +1 -0
  31. package/assets/esri/core/workers/chunks/2166238a7ad63a2d43c7.js +1 -0
  32. package/assets/esri/core/workers/chunks/2214d3b1f11658a85d0f.js +1 -0
  33. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +1 -0
  34. package/assets/esri/core/workers/chunks/22ca80f491e070b2a5e7.js +1 -0
  35. package/assets/esri/core/workers/chunks/{f80f5dbf96c343ac4df6.js → 24d8922ac9cd48621357.js} +1 -1
  36. package/assets/esri/core/workers/chunks/257f17b3836a623a9dbe.js +1 -0
  37. package/assets/esri/core/workers/chunks/2b27499fa9de22970b7a.js +1 -0
  38. package/assets/esri/core/workers/chunks/2e76fbd3c874300fc4a7.js +1 -0
  39. package/assets/esri/core/workers/chunks/31b5900119dd7cd9e7d3.js +1 -0
  40. package/assets/esri/core/workers/chunks/34bb4852ebef0f529c96.js +1 -0
  41. package/assets/esri/core/workers/chunks/{9698f36c143953a975d4.js → 353d447f3745942c88a8.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{52282f767bd0e99ddca0.js → 3545dce74bb6b0354cb7.js} +1 -1
  43. package/assets/esri/core/workers/chunks/36b1f47d70b57d79df7b.js +1 -0
  44. package/assets/esri/core/workers/chunks/38810e3f298e8a0b64a6.js +1 -0
  45. package/assets/esri/core/workers/chunks/{7290e7a819eb291b1df2.js → 38fa50336983265c73a4.js} +3 -3
  46. package/assets/esri/core/workers/chunks/{fe49321dca22dc60d105.js → 3b1982bf7b44ff897a35.js} +1 -1
  47. package/assets/esri/core/workers/chunks/3bacd904cd93c8013f6a.js +1 -0
  48. package/assets/esri/core/workers/chunks/{588533c3abe876f20f62.js → 3d5b157bd9060b07670b.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{06e60fc7715d08ede59d.js → 3edffdb0e282ed562ac7.js} +1 -1
  50. package/assets/esri/core/workers/chunks/3fa15d4ee5fab8fff76e.js +1 -0
  51. package/assets/esri/core/workers/chunks/487e1c592f1b6fd03a7d.js +1 -0
  52. package/assets/esri/core/workers/chunks/{ee5aa11750c51b220f1e.js → 4bcb83119481453dbb90.js} +1 -1
  53. package/assets/esri/core/workers/chunks/4ca5d58117e7a5f73e1e.js +1 -0
  54. package/assets/esri/core/workers/chunks/{826fa0dfb63df77bfd95.js → 4f0016111fd84c612f41.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{24cd7b84cd0f3de4bff2.js → 4f14fed0ec885c3c33d5.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{4baf6f6e7ddedb25f806.js → 5299ec59c86022ca37e2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/53a9c34cb3f6ac06cd50.js +1 -0
  58. package/assets/esri/core/workers/chunks/5415fbcc7ed203fc5575.js +1 -0
  59. package/assets/esri/core/workers/chunks/54c49a768147720c3c56.js +1 -0
  60. package/assets/esri/core/workers/chunks/558822b700e8bd844052.js +1 -0
  61. package/assets/esri/core/workers/chunks/{da24ad57747714ac5eda.js → 55adbd7481f8dfb1067e.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{7803495f8862d9025bcd.js → 56e06c9c1120bea2c641.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{dc66490520f97eef15bf.js → 57806a01f33074b601e7.js} +24 -24
  64. package/assets/esri/core/workers/chunks/{67f03d042455cd0f7009.js → 57b410198d83bf0ab708.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{0a5d74414dd02a2fb8e1.js → 5bc4140333d0db904949.js} +1 -1
  66. package/assets/esri/core/workers/chunks/5e08b19e6d7202ea38d7.js +1 -0
  67. package/assets/esri/core/workers/chunks/{0d5212f59e9b62c16164.js → 5f6df4a3376b52ead53f.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{15c7c10ff9ac63f0e792.js → 5fb2edf942b1cd8d7336.js} +1 -1
  69. package/assets/esri/core/workers/chunks/600e2e6b51e2fb9c598c.js +1 -0
  70. package/assets/esri/core/workers/chunks/{dc51438b832551924a9e.js → 6238ca7541800eb2566b.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{731f7b552dde0fb325cd.js → 62c2bd082a0c669bc857.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{b8a3f1e60e24a13749c1.js → 631fb2e62e48f8be4051.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{c8e686efe344a33a0258.js → 6490bc392a4b4f9e24f9.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{e767f83f9e2de6650f80.js → 6581b94e796781c0ad4a.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{53654edd766d9b4ef750.js → 658cd45b5fb304fd840a.js} +1 -1
  76. package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +1 -0
  77. package/assets/esri/core/workers/chunks/6922351c001fdb4cb757.js +1 -0
  78. package/assets/esri/core/workers/chunks/{6e22b02a9715c10578d0.js → 69cca5d3f715876c6b32.js} +1 -1
  79. package/assets/esri/core/workers/chunks/6c13c01c47abc1939f96.js +1 -0
  80. package/assets/esri/core/workers/chunks/{c37f7756d48ff9af2656.js → 736035c0069ccb03bee6.js} +1 -1
  81. package/assets/esri/core/workers/chunks/7c14f99e6cfff2a8ef4a.js +1 -0
  82. package/assets/esri/core/workers/chunks/812f2ccc01f44e3cfd41.js +1 -0
  83. package/assets/esri/core/workers/chunks/82338cdd56aa1de28db3.js +1 -0
  84. package/assets/esri/core/workers/chunks/{51ab2acac4ecc1ca9c34.js → 86830fcb5475502dac65.js} +1 -1
  85. package/assets/esri/core/workers/chunks/{11e96a312f1294d34c50.js → 881df4fd1dc594576457.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{d1ca7c3a32ce00ed8b81.js → 8be16b03caa947ac7631.js} +1 -1
  87. package/assets/esri/core/workers/chunks/8cd03b54b2859b52fb81.js +1 -0
  88. package/assets/esri/core/workers/chunks/8d9ccc9a43a315cb6b04.js +1 -0
  89. package/assets/esri/core/workers/chunks/{042cd64e1f4eb326c30f.js → 8fc82fe1fcbcedf35400.js} +1 -1
  90. package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +1 -0
  91. package/assets/esri/core/workers/chunks/{fbd8d2f61f8a15bcf3db.js → 9595aabbaf411eceea1e.js} +1 -1
  92. package/assets/esri/core/workers/chunks/9978ec6c67e87dc08a1d.js +1 -0
  93. package/assets/esri/core/workers/chunks/9cdd087c43a601ec331d.js +1 -0
  94. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  95. package/assets/esri/core/workers/chunks/{5e2ce34def5e053913b2.js → a10e533f336c035d8d40.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{311b564e44ae637c960d.js → a3ade7e8b9ddadb5f800.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{18c5d79d5ee1136e0a57.js → a57751f3d78524c876cd.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{0030d68d9edf42b4af57.js → a6a87f92f453204e9bdb.js} +1 -1
  99. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  100. package/assets/esri/core/workers/chunks/a8ea050090c351e3b6d6.js +1 -0
  101. package/assets/esri/core/workers/chunks/adf7ccf4ef629211c7ee.js +1 -0
  102. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +1 -0
  103. package/assets/esri/core/workers/chunks/af5fc5d6c1d072a27df1.js +1 -0
  104. package/assets/esri/core/workers/chunks/b193de09e005b0976a6a.js +1 -0
  105. package/assets/esri/core/workers/chunks/b328635d191f5424c047.js +1 -0
  106. package/assets/esri/core/workers/chunks/b59f9c3f7a149214256f.js +1 -0
  107. package/assets/esri/core/workers/chunks/{664ae441617afe4b17ec.js → b87bc987983b31c13f64.js} +1 -1
  108. package/assets/esri/core/workers/chunks/bb56717c4e36f28d4c08.js +1 -0
  109. package/assets/esri/core/workers/chunks/bbdfa8ffcf084cbd9938.js +1 -0
  110. package/assets/esri/core/workers/chunks/bc19a232076d98825eef.js +1 -0
  111. package/assets/esri/core/workers/chunks/bc29c29bfa5be3ebafb1.js +1 -0
  112. package/assets/esri/core/workers/chunks/{ddfd01bb9ba8577c3ffc.js → c3dcfe26c2c3c829762d.js} +1 -1
  113. package/assets/esri/core/workers/chunks/c3ddcf9148dd2640c402.js +1 -0
  114. package/assets/esri/core/workers/chunks/{6d9f2b113d6bde936a04.js → c4dfd897bcab20dee43b.js} +1 -1
  115. package/assets/esri/core/workers/chunks/{0f30a9514571c7be9978.js → c5c02ace54fe4ab9214b.js} +1 -1
  116. package/assets/esri/core/workers/chunks/{87921f3fa9001f5801ed.js → c68935ed44eb0702a6ba.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{4fb5f1c671892001a4fd.js → c9579d607e59bae214da.js} +1 -1
  118. package/assets/esri/core/workers/chunks/d39a10155317e6f7a21c.js +1 -0
  119. package/assets/esri/core/workers/chunks/{773f2c6c9d38db76dfed.js → d42f7e48d694b2427c0d.js} +1 -1
  120. package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +1 -0
  121. package/assets/esri/core/workers/chunks/d4a91f2256e48316a8f0.js +1 -0
  122. package/assets/esri/core/workers/chunks/d69265ceabfa92b40bb7.js +1 -0
  123. package/assets/esri/core/workers/chunks/d7755c4c8d1d3059efca.js +1 -0
  124. package/assets/esri/core/workers/chunks/{eb9c166db0db6fa60e95.js → d7b0fcce847f563ea255.js} +1 -1
  125. package/assets/esri/core/workers/chunks/d87f0116ee53ec5f98e9.js +1 -0
  126. package/assets/esri/core/workers/chunks/d888ae5ac1810a486919.js +1 -0
  127. package/assets/esri/core/workers/chunks/db54552def7bc6cef9bd.js +1 -0
  128. package/assets/esri/core/workers/chunks/dc4d29cfce12ac599888.js +1 -0
  129. package/assets/esri/core/workers/chunks/dda6ca9af35518652d0f.js +1 -0
  130. package/assets/esri/core/workers/chunks/{7005d956c990a04ee8b2.js → dec336700cfb83abbbeb.js} +1 -1
  131. package/assets/esri/core/workers/chunks/{b3613a38178cad2ebc82.js → dee9867b3379e024ae96.js} +1 -1
  132. package/assets/esri/core/workers/chunks/df130abb76713a85b4f9.js +1 -0
  133. package/assets/esri/core/workers/chunks/e0aa036c56ecdfe01503.js +1 -0
  134. package/assets/esri/core/workers/chunks/e2e4f6b58763fae51ae5.js +1 -0
  135. package/assets/esri/core/workers/chunks/e8a9c56fd0e7fd2558ef.js +1 -0
  136. package/assets/esri/core/workers/chunks/{1d06fcae4c2f02fb1c95.js → eb7eb3b3b8800fd73f3e.js} +1 -1
  137. package/assets/esri/core/workers/chunks/{37c1f155da14de91565a.js → edf58513f789856cd1db.js} +1 -1
  138. package/assets/esri/core/workers/chunks/{f34e3fa0c5b28531e289.js → ef789e8487deab916fad.js} +1 -1
  139. package/assets/esri/core/workers/chunks/f28ffda9a95c6568503d.js +1 -0
  140. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +1 -0
  141. package/assets/esri/core/workers/chunks/{292daac70bb828e4923f.js → f9cd068d184cab66dc33.js} +1 -1
  142. package/assets/esri/core/workers/chunks/{dff2df259f140b7d97a9.js → fd88e07cba5964f80e9e.js} +1 -1
  143. package/assets/esri/core/workers/chunks/{c9b16fd41cd59d452522.js → fdbe16e3b23e01655c0c.js} +1 -1
  144. package/assets/esri/core/workers/chunks/{063905fbf9a0c6586949.js → ffdba51e7256ebf8ebd3.js} +1 -1
  145. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  146. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  147. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  148. package/assets/esri/themes/base/widgets/_Editor.scss +35 -2
  149. package/assets/esri/themes/base/widgets/_FeatureTable.scss +2 -0
  150. package/assets/esri/themes/dark/main.css +1 -1
  151. package/assets/esri/themes/light/main.css +1 -1
  152. package/assets/esri/themes/light/view.css +1 -1
  153. package/chunks/Envelope.js +1 -1
  154. package/chunks/Geometry.js +1 -1
  155. package/chunks/MultiPathImpl.js +1 -1
  156. package/chunks/Point2D.js +1 -1
  157. package/chunks/UnitFactory.js +1 -1
  158. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  159. package/chunks/arcgis-knowledge-client-core.js +1 -1
  160. package/chunks/containsOperator.js +1 -1
  161. package/chunks/densifyOperator.js +1 -1
  162. package/chunks/differenceOperator.js +1 -1
  163. package/chunks/intersectsOperator.js +1 -1
  164. package/chunks/persistableUrlUtils.js +1 -1
  165. package/config.js +1 -1
  166. package/core/XHRAdapter.js +1 -1
  167. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  168. package/core/quantityFormatUtils.js +1 -1
  169. package/core/unitFormatUtils.js +1 -1
  170. package/core/unitUtils.js +1 -1
  171. package/editing/fieldUtils.js +5 -0
  172. package/geometry/Extent.js +1 -1
  173. package/geometry/Geometry.js +1 -1
  174. package/geometry/Mesh.js +1 -1
  175. package/geometry/Point.js +1 -1
  176. package/geometry/SpatialReference.js +1 -1
  177. package/geometry/ellipsoidUtils.js +1 -1
  178. package/geometry/operators/support/jsonConverter.js +1 -1
  179. package/geometry/support/MeshTransform.js +1 -1
  180. package/geometry/support/axisAngleDegrees.js +1 -1
  181. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  182. package/geometry/support/meshUtils/rotate.js +1 -1
  183. package/geometry/support/meshUtils/scale.js +1 -1
  184. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  185. package/geometry/support/plane.js +1 -1
  186. package/geometry/support/polygonUtils.js +1 -1
  187. package/interfaces.d.ts +114 -11
  188. package/kernel.js +1 -1
  189. package/layers/KnowledgeGraphLayer.js +1 -1
  190. package/layers/Layer.js +1 -1
  191. package/layers/LinkChartLayer.js +1 -1
  192. package/layers/MapNotesLayer.js +1 -1
  193. package/layers/graphics/data/QueryEngine.js +1 -1
  194. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  195. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  196. package/layers/save/groupLayerUtils.js +1 -1
  197. package/layers/save/imageryUtils.js +1 -1
  198. package/layers/save/streamLayerUtils.js +1 -1
  199. package/layers/support/DateTimeFieldFormat.js +1 -1
  200. package/layers/support/FieldFormat.js +1 -1
  201. package/layers/support/LayerLoadContext.js +1 -1
  202. package/layers/support/NumberFieldFormat.js +1 -1
  203. package/layers/support/arcgisLayerUrl.js +1 -1
  204. package/layers/support/arcgisLayers.js +1 -1
  205. package/layers/support/fetchService.js +1 -1
  206. package/layers/support/fieldFormatUtils.js +1 -1
  207. package/layers/support/fieldUtils.js +1 -1
  208. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  209. package/layers/video/VideoCameraSensorModel.js +1 -1
  210. package/networks/support/UNTraceConfiguration.js +1 -1
  211. package/package.json +1 -1
  212. package/popup/ExpressionInfo.js +1 -1
  213. package/popup/FieldInfo.js +1 -1
  214. package/popup/content/AttachmentsContent.js +1 -1
  215. package/popup/content/BarChartMediaInfo.js +1 -1
  216. package/popup/content/ColumnChartMediaInfo.js +1 -1
  217. package/popup/content/Content.js +1 -1
  218. package/popup/content/CustomContent.js +1 -1
  219. package/popup/content/ExpressionContent.js +1 -1
  220. package/popup/content/FieldsContent.js +1 -1
  221. package/popup/content/ImageMediaInfo.js +1 -1
  222. package/popup/content/LineChartMediaInfo.js +1 -1
  223. package/popup/content/MediaContent.js +1 -1
  224. package/popup/content/PieChartMediaInfo.js +1 -1
  225. package/popup/content/RelationshipContent.js +1 -1
  226. package/popup/content/TextContent.js +1 -1
  227. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  228. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  229. package/popup/content/mixins/MediaInfo.js +1 -1
  230. package/popup/content.js +1 -1
  231. package/popup/support/FieldInfoFormat.js +1 -1
  232. package/portal/support/layersLoader.js +1 -1
  233. package/request/cors.js +5 -0
  234. package/request/loadImage.js +5 -0
  235. package/request/preferredHosts.js +5 -0
  236. package/request/process.js +5 -0
  237. package/request/queue.js +5 -0
  238. package/request/serviceJSON.js +5 -0
  239. package/request.js +1 -1
  240. package/rest/geometryService/utils.js +1 -1
  241. package/rest/knowledgeGraphService.d.ts +1 -0
  242. package/support/getDefaultUnitForView.js +1 -1
  243. package/support/popupUtils.js +1 -1
  244. package/support/revision.js +1 -1
  245. package/symbols/support/symbolUtils.js +1 -1
  246. package/time/TimeExtent.js +1 -1
  247. package/views/2d/analysis/AreaMeasurement/AreaMeasurementAreaVisualization.js +5 -0
  248. package/views/2d/analysis/AreaMeasurement/AreaMeasurementController.js +5 -0
  249. package/views/2d/analysis/AreaMeasurement/AreaMeasurementLabelVisualization.js +5 -0
  250. package/views/2d/analysis/AreaMeasurement/AreaMeasurementManipulatorVisualization.js +5 -0
  251. package/views/2d/analysis/AreaMeasurement/AreaMeasurementSketchVisualization.js +5 -0
  252. package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +5 -0
  253. package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +5 -0
  254. package/views/2d/analysis/analysisViewModuleImportUtils.js +1 -1
  255. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  256. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  257. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  258. package/views/2d/layers/features/sources/strategies/FeatureDrillDownTileLoadStrategy.js +1 -1
  259. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  260. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  261. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  262. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  263. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  264. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  265. package/views/3d/environment/CloudsRenderer.js +1 -1
  266. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  267. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  268. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  269. package/views/3d/layers/FlowSubView3D.js +1 -1
  270. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  271. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  272. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  273. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  274. package/views/3d/layers/i3s/I3SDataRequester.js +1 -1
  275. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  276. package/views/3d/support/StreamTextureCollection.js +1 -1
  277. package/views/3d/support/flow/geometryUtils.js +1 -1
  278. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  279. package/views/3d/terrain/TerrainSurface.js +1 -1
  280. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  281. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  282. package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
  283. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  284. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  285. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  286. package/views/3d/webgl-engine/lib/TextureBackedBuffer/BufferManager.js +1 -1
  287. package/views/3d/webgl-engine/lib/TextureBackedBuffer/ManagedTextureBackedBuffer.js +1 -1
  288. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
  289. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  290. package/views/3d/webgl-engine/materials/internal/WaterTextureRepository.js +1 -1
  291. package/views/View2D.js +1 -1
  292. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  293. package/views/analysis/ElevationProfile/constants.js +1 -1
  294. package/views/analysis/ElevationProfile/elevationProfileErrors.js +1 -1
  295. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  296. package/views/draw/DrawOperation.js +1 -1
  297. package/views/draw/support/tooltipUtils.js +1 -1
  298. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  299. package/views/interactive/tooltip/fields/TooltipField.js +1 -1
  300. package/views/interactive/tooltip/infos/TooltipInfoWithCoordinates.js +1 -1
  301. package/views/magnifier/resources.js +1 -1
  302. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  303. package/webdoc/support/webdocSaveUtils.js +1 -1
  304. package/widgets/BasemapLayerList.js +1 -1
  305. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  306. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  307. package/widgets/Editor/EditorViewModel.js +1 -1
  308. package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
  309. package/widgets/Editor/MergeFeaturesWorkflowData.js +1 -1
  310. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  311. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  312. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  313. package/widgets/Editor/UpdateWorkflow.js +1 -1
  314. package/widgets/Editor/Workflow.js +1 -1
  315. package/widgets/Editor/components/FeatureList.js +1 -1
  316. package/widgets/Editor/components/MergeFeaturesList.js +5 -0
  317. package/widgets/Editor/components/Notices.js +1 -1
  318. package/widgets/Editor/components/PanelContent.js +1 -1
  319. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  320. package/widgets/Editor/css.js +1 -1
  321. package/widgets/Editor/support/EditorItem.js +1 -1
  322. package/widgets/Editor/support/SketchController.js +1 -1
  323. package/widgets/Editor/support/errors.js +1 -1
  324. package/widgets/Editor/support/mergeFeaturesUtils.js +1 -1
  325. package/widgets/Editor/support/splitFeatureUtils.js +1 -1
  326. package/widgets/Editor/workflowUtils.js +1 -1
  327. package/widgets/Editor.js +1 -1
  328. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  329. package/widgets/FeatureForm/FieldInput.js +1 -1
  330. package/widgets/FeatureForm.js +1 -1
  331. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  332. package/widgets/FeatureTable/FieldColumn.js +1 -1
  333. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  334. package/widgets/LayerList.js +1 -1
  335. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  336. package/widgets/Legend/support/utils.js +1 -1
  337. package/widgets/PanoramicVideoViewer.js +1 -1
  338. package/widgets/TimeSlider.js +1 -1
  339. package/widgets/support/FilterCondition.js +1 -1
  340. package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +0 -1
  341. package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +0 -1
  342. package/assets/esri/core/workers/chunks/066a0ea67688361e85a5.js +0 -1
  343. package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +0 -1
  344. package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +0 -1
  345. package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +0 -1
  346. package/assets/esri/core/workers/chunks/2a9fc0301268ff909246.js +0 -1
  347. package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +0 -1
  348. package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +0 -1
  349. package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +0 -1
  350. package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +0 -1
  351. package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +0 -1
  352. package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +0 -1
  353. package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +0 -1
  354. package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +0 -1
  355. package/assets/esri/core/workers/chunks/42a1e71d09e8583a7327.js +0 -1
  356. package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +0 -1
  357. package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +0 -1
  358. package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +0 -1
  359. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +0 -1
  360. package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +0 -1
  361. package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +0 -1
  362. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +0 -1
  363. package/assets/esri/core/workers/chunks/57e04e2d8721bbdc029a.js +0 -1
  364. package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +0 -1
  365. package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +0 -1
  366. package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +0 -1
  367. package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +0 -1
  368. package/assets/esri/core/workers/chunks/6293e33f304c4952f88c.js +0 -1
  369. package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +0 -1
  370. package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +0 -1
  371. package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +0 -1
  372. package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +0 -1
  373. package/assets/esri/core/workers/chunks/8ce608013b353155ee5a.js +0 -1
  374. package/assets/esri/core/workers/chunks/8d9d3797c6d62fdfff9d.js +0 -1
  375. package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +0 -1
  376. package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +0 -1
  377. package/assets/esri/core/workers/chunks/9f21436016ff7a899e79.js +0 -1
  378. package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +0 -1
  379. package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +0 -1
  380. package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +0 -1
  381. package/assets/esri/core/workers/chunks/a5a67216e0d0cee95a55.js +0 -1
  382. package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +0 -1
  383. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +0 -1
  384. package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +0 -1
  385. package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +0 -1
  386. package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +0 -1
  387. package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +0 -1
  388. package/assets/esri/core/workers/chunks/c4090a60d149a5962179.js +0 -1
  389. package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +0 -1
  390. package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +0 -1
  391. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +0 -1
  392. package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +0 -1
  393. package/assets/esri/core/workers/chunks/d48af7bc06b4bb176534.js +0 -1
  394. package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +0 -1
  395. package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +0 -1
  396. package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +0 -1
  397. package/assets/esri/core/workers/chunks/df5afa06c6deb6b40109.js +0 -1
  398. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +0 -1
  399. package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +0 -1
  400. package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +0 -1
  401. package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +0 -1
  402. package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +0 -1
  403. package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +0 -1
  404. package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +0 -1
  405. package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +0 -1
  406. package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +0 -1
  407. package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +0 -1
  408. package/processRequest.js +0 -5
  409. package/requestQueue.js +0 -5
  410. package/support/requestPresets.js +0 -5
  411. package/support/requestUtils.js +0 -5
  412. /package/{rest/support → request}/ImageWithType.js +0 -0
  413. /package/{requestConfig.js → request/config.js} +0 -0
  414. /package/{support/requestImageUtils.js → request/image.js} +0 -0
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import e from"../config.js";import{id as t}from"../kernel.js";import r from"../core/Error.js";import has from"../core/has.js";import{clone as s}from"../core/lang.js";import{createAbortError as o,isAbortError as a,isAborted as n}from"../core/promiseUtils.js";import{isTrustedServer as i,getOrigin as l,isBlobProtocol as u,isDataProtocol as c,toHTTPS as d,objectToQuery as m,getProxyRule as p,getProxyUrl as f,addQueryParameters as h,hasSameOrigin as y,addProxyRule as g,getAppUrl as w}from"../core/urlUtils.js";import{isSecureProxyService as b}from"../portal/support/urlUtils.js";import{requestConfig as T}from"./config.js";import{registerNoCorsDomains as k,isNoCorsRequestRequired as q,sendNoCorsRequest as S}from"./cors.js";import{getImageType as O,ImageWithType as C}from"./ImageWithType.js";import{loadImage as x}from"./loadImage.js";import{setPreferredHost as j,getPreferredUrl as v}from"./preferredHosts.js";import{getApiKey as L}from"../support/apiKeyUtils.js";const E="FormData"in globalThis,U=new Set([499,498,403,401]),A=new Set(["COM_0056","COM_0057","SB_0008"]),P=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i];async function H(r){let s,o;await I(r);try{do{[s,o]=await D(r)}while(!await _(r,s,o))}catch(u){const e=z("request:server",u,r.parameters,s);throw e.details.ssl=r.useSSL,r.interceptor?.error?.(e),e}const a=r.parameters.url;if(o)if(/\/sharing\/rest\/(accounts|portals)\/self/i.test(a)){if(!r.hasToken&&!r.credentialToken&&o.user?.username&&!i(a)){const t=l(a,!0);t&&e.request.trustedServers.push(t)}Array.isArray(o.authorizedCrossOriginNoCorsDomains)&&k(o.authorizedCrossOriginNoCorsDomains)}else{"json"===(r.parameters.requestOptions.responseType||"json")&&j(a,o)}const n=r.credential;if(n&&t){const e=t.findServerInfo(n.server);let r=e?.owningSystemUrl;if(r){r=r.replace(/\/?$/,"/sharing");const e=t.findCredential(r,n.userId);e&&-1===t._getIdenticalSvcIdx(r,e)&&e.resources.unshift(r)}}return{data:o,getAllHeaders:s?()=>Array.from(s.headers):J,getHeader:s?e=>s.headers.get(e):J,httpStatus:s?.status??200,requestOptions:r.parameters.requestOptions,ssl:r.useSSL,url:r.parameters.url}}async function I(r){const s=r.parameters.url,o=r.parameters.requestOptions,a=r.controller.signal,i=o.body;let l=null,u=null;if(E&&"HTMLFormElement"in globalThis&&(i instanceof FormData?l=i:i instanceof HTMLFormElement&&(l=new FormData(i))),"string"==typeof i&&(u=i),r.fetchOptions={cache:o.cacheBust?"no-cache":"default",credentials:"same-origin",headers:o.headers||{},keepalive:o.keepAlive??!1,method:"head"===o.method?"HEAD":"GET",mode:"cors",priority:o.priority??e.request.priority,redirect:"follow",signal:a},(l||u)&&(r.fetchOptions.body=l||u),(T.isForeignWorker||"anonymous"===o.authMode)&&(r.useIdentity=!1),r.hasToken=!!(/token=/i.test(s)||o.query?.token||l?.get("token")),!r.hasToken){const e=L(s);e&&(o.query??={},o.query.token=e,r.hasToken=!0)}if(r.useIdentity&&!r.hasToken&&!r.credential&&!r.credentialToken&&!B(s)&&!n(a)){let e;"immediate"===o.authMode?(await N(),e=await t.getCredential(s,{signal:a})):"no-prompt"===o.authMode?(await N(),e=await t.getCredential(s,{prompt:!1,signal:a}).catch(()=>{})):t&&(e=t.findCredential(s)),e&&(r.credential=e,r.credentialToken=e.token,r.useSSL=!!e.ssl)}}async function D(r){let s=r.parameters.url,a=v(s);const n=r.parameters.requestOptions,k=r.fetchOptions??{},x=u(s)||c(s),j=n.responseType??"json",L="image"===j&&n.imageWithType,U=x?0:null!=n.timeout?n.timeout:e.request.timeout;let A=!1;if(!x){r.useSSL&&(s=d(s));let o={...n.query};r.credentialToken&&(o.token=r.credentialToken);let l=m(o);has("esri-url-encodes-apostrophe")&&(l=l.replaceAll("'","%27"));const u=a.length+1+l.length;let c;A="delete"===n.method||"post"===n.method||"put"===n.method||!!n.body||u>e.request.maxUrlLength;const g=n.useProxy||!!p(s);if(g){const t=f(s);c=t.path,!A&&c.length+1+u>e.request.maxUrlLength&&(A=!0),t.query&&(o={...t.query,...o})}if("HEAD"===k.method&&(A||g)){if(A){if(u>e.request.maxUrlLength)throw z("request:invalid-parameters",new Error("URL exceeds maximum length"),r.parameters);throw z("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),r.parameters)}if(g)throw z("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),r.parameters)}if(A?(k.method="delete"===n.method?"DELETE":"put"===n.method?"PUT":"POST",n.body?s=h(s,o):(k.body=m(o),k.headers||(k.headers={}),k.headers["Content-Type"]="application/x-www-form-urlencoded")):s=h(s,o),g&&(r.useProxy=!0,s=`${c}?${s}`),o.token&&E&&k.body instanceof FormData&&!b(s)&&k.body.set("token",o.token),n.hasOwnProperty("withCredentials"))r.withCredentials=n.withCredentials;else if(!y(s,w()))if(i(s))r.withCredentials=!0;else if(t){const e=t.findServerInfo(s);e?.webTierAuth&&(r.withCredentials=!0)}r.withCredentials&&(k.credentials="include",q(s)&&await S(A?h(s,o):s)),a=v(s)}let P,H,I=0,N=!1;U>0&&(I=setTimeout(()=>{N=!0,r.controller.abort()},U));try{if("native-request-init"===n.responseType)H=k,H.url=a,n.signal?H.signal=n.signal:delete H.signal;else if("image"!==n.responseType||"default"!==k.cache||k.keepalive||"GET"!==k.method||A||$(n.headers)||!x&&!r.useProxy&&e.request.proxyUrl&&!R(s)){if(await(T.beforeFetch?.(s,k)),P=await T.fetch(a,k),await(T.afterFetch?.(P)),r.useProxy||F(s),"native"===n.responseType)H=P;else if("HEAD"!==k.method)if(P.ok){switch(j){case"array-buffer":H=await P.arrayBuffer();break;case"blob":H=await P.blob();break;case"image":H=await(L?P.arrayBuffer():P.blob());break;default:H=await P.text()}if(I&&(clearTimeout(I),I=0),"json"===j||"xml"===j||"document"===j)if(H)switch(j){case"json":H=JSON.parse(H);break;case"xml":H=W(H,"application/xml");break;case"document":H=W(H,"text/html")}else H=null;if(H){if("array-buffer"===j||"blob"===j){const e=P.headers.get("Content-Type");if(e&&/application\/json|text\/plain/i.test(e)&&H["blob"===j?"size":"byteLength"]<=750)try{const e=await new Response(H).json();e.error&&(H=e)}catch{}}if(L&&H instanceof ArrayBuffer){const e=O(H);if("unknown"===e)return n.responseType="image",await D(r);H=await P.blob(),H=await M(URL.createObjectURL(H),r,!0),H=new C(H,e)}"image"===j&&H instanceof Blob&&(H=await M(URL.createObjectURL(H),r,!0))}}else{H=await P.text();try{H=JSON.parse(H)}catch{}}}else H=await M(a,r)}catch(B){if("AbortError"===B.name){if(N)throw X();throw o("Request canceled")}if(!(!P&&B instanceof TypeError&&e.request.proxyUrl)||n.body||"delete"===n.method||"head"===n.method||"post"===n.method||"put"===n.method||r.useProxy||R(s))throw B;r.redoRequest=!0,g({proxyUrl:e.request.proxyUrl,urlPrefix:l(s)??""})}finally{I&&clearTimeout(I)}return[P,H]}function M(t,r,s=!1){const o=r.controller.signal,a=new Image;return r.withCredentials?a.crossOrigin="use-credentials":a.crossOrigin="anonymous",a.alt="",a.fetchPriority=e.request.priority,a.src=t,x(a,t,s,o)}function F(e){const t=l(e);t&&!T.corsServers.includes(t)&&T.corsServers.push(t)}function R(e){const t=l(e);return!t||t.endsWith(".arcgis.com")||T.corsServers.includes(t)||i(t)}async function N(){t||await import("../identity/IdentityManager.js")}function B(e){return P.some(t=>t.test(e))}function $(e){if(e)for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0;return!1}function W(e,t){let r;try{r=(new DOMParser).parseFromString(e,t)}catch{}if(!r||r.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return r}async function _(e,r,s){if(e.redoRequest)return e.redoRequest=!1,!1;const o=e.parameters.requestOptions;if(!r||"native"===o.responseType||"native-request-init"===o.responseType)return!0;let a,n;if(s&&(s.error&&"object"==typeof s.error?a=s.error:"error"===s.status&&Array.isArray(s.messages)&&(a={...s},a[G]=s,a.details=s.messages)),!a&&!r.ok)throw a=new Error(`Unable to load ${r.url} status: ${r.status}`),a[G]=s,a;let i,l=null;a&&(n=Number(a.code),l=a.hasOwnProperty("subcode")?Number(a.subcode):null,i=a.messageCode,i=i?.toUpperCase());const u=o.authMode;if(403===n&&(4===l||a.message?.toLowerCase().includes("ssl")&&!a.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&("no-prompt"!==u||498===n)&&void 0!==n&&U.has(n)&&!B(e.parameters.url)&&(403!==n||(!i||!A.has(i))&&(null==l||2===l&&e.credentialToken))){await N();try{const r=await t.getCredential(e.parameters.url,{error:z("request:server",a,e.parameters),credential:e.credential,prompt:"no-prompt"!==u,signal:e.controller.signal,token:e.credentialToken});return e.credential=r,e.credentialToken=r.token,e.useSSL=e.useSSL||r.ssl,!1}catch(c){if("no-prompt"===u)return e.credential=void 0,e.credentialToken=void 0,!1;a=c}}if(a)throw a;return!0}function z(e,t,n,i){let l;const u={url:n.url,requestOptions:n.requestOptions,getAllHeaders:J,getHeader:J,ssl:!1};if(t instanceof r)return t.details?(t.details=s(t.details),t.details.url=n.url,t.details.requestOptions=n.requestOptions):t.details=u,t;if(t){const e=i&&(()=>Array.from(i.headers)),r=i&&(e=>i.headers.get(e)),s=i?.status,o=t.message;o&&(l=o),e&&r&&(u.getAllHeaders=e,u.getHeader=r),u.httpStatus=(null!=t.httpCode?t.httpCode:t.code)||s||0,u.subCode=t.subcode,u.messageCode=t.messageCode,"string"==typeof t.details?(u.messages=[t.details],l??=t.details):(u.messages=t.details,l??=u.messages?.[0]),u.raw=G in t?t[G]:t}return l??="Error",a(t)?o():new r(e,l,u)}const G=Symbol(),J=()=>null,K="Timeout exceeded";function X(){return new Error(K)}function Q(e){return"object"==typeof e&&!!e&&"message"in e&&e.message===K}export{z as createRequestError,Q as isTimeoutError,H as processRequest};
@@ -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 has from"../core/has.js";import{getOrCreateMapValue as r}from"../core/MapUtils.js";import{isAborted as e,createAbortError as o}from"../core/promiseUtils.js";import{getOrigin as t}from"../core/urlUtils.js";import{isHostedAgolService as s}from"../layers/support/arcgisLayerUrl.js";import{createRequestError as n,processRequest as u}from"./process.js";const c={useQueue:!0,priority:"high"},i={useQueue:!0,priority:"auto"};function p(r){const e=f(r);if(!e)return!1;const o=l.get(e.origin);return o?.full??!1}async function a(t){const s=f(t.parameters.url);if(!s)return null;const{QueueProcessor:c,SharedConcurrency:i}=await import("../core/QueueProcessor.js");return r(l,s.origin,()=>{const r=(s.isHosted?has("request-queue-concurrency-hosted"):has("request-queue-concurrency-non-hosted"))??4;return m??=new i(has("request-queue-concurrency-global")??50),new c({concurrency:r,sharedConcurrency:m,process:r=>{if(e(r.parameters.requestOptions))throw n("",o("Request canceled"),r.parameters);return u(r)}})})}const l=new Map;let m;function f(r){let e,o=!1;return"string"==typeof r?(e=t(r,!0),o=s(r)):(e=r.origin,o=s(r.toString())),null==e?null:new y(e,o)}class y{constructor(r,e){this.origin=r,this.isHosted=e}}export{a as ensureRequestQueue,f as getOriginInfo,p as isRequestQueueFull,i as queueAutoPriority,c as queueHighPriority};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import e from"../request.js";async function r(r,t){return(await e(r,{responseType:"json",query:{f:"json",...t?.customParameters,token:t?.apiKey}})).data}export{r as requestServiceJSON};
package/request.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"./config.js";import{createRequestError as r,processRequest as t}from"./processRequest.js";import{requestConfig as o}from"./requestConfig.js";import{ensureRequestQueue as s}from"./requestQueue.js";import n from"./core/Error.js";import has from"./core/has.js";import{onAbort as i}from"./core/promiseUtils.js";import{isDataProtocol as a,isBlobProtocol as u,normalize as p,queryToObject as c,getInterceptor as l}from"./core/urlUtils.js";async function f(e,o){e instanceof URL&&(e=e.toString());const s=a(e),n=u(e);n||s||(e=p(e));const f={url:e,requestOptions:{...o}};o?.query&&(f.requestOptions.query=o?.query instanceof URLSearchParams?c(o.query.toString().replaceAll("+"," ")):o?.query);const b=e=>({data:e,getAllHeaders:q,getHeader:q,httpStatus:200,requestOptions:f.requestOptions,url:f.url}),g=l(e,m.internalInterceptors);if(g){const e=await w(g,f);if(null!=e)return b(e)}let O=l(e);if(O){const e=await w(O,f);if(null!=e)return b(e);O.after||O.error||(O=null)}if(e=f.url,"image"===(o=f.requestOptions).responseType&&(has("host-webworker")||has("host-node")))throw r("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),f);if("head"===o.method){if(o.body)throw r("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),f);if(s||n)throw r("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),f)}if(await h(),d)return d.execute(e,o);const j=new AbortController,v=i(o,()=>j.abort()),k={controller:j,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:O,parameters:f,redoRequest:!1,useIdentity:m.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},S=o.useQueue?y(k):t(k),E=await S.finally(()=>v?.remove());return O?.after?.(E),E}let d;const m=e.request,q=()=>null;async function h(){has("host-webworker")&&(!d&&globalThis.invokeStaticMessage?d=await import("./core/workers/request.js"):o.isForeignWorker=!0)}async function w(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let s,i;try{i=await e.before(t)}catch(o){s=r("request:interceptor",o,t)}if((i instanceof Error||i instanceof n)&&(s=r("request:interceptor",i,t)),s)throw e.error&&e.error(s),s;return i}}async function y(e){const r=await s(e);return r?r.push(e):t(e)}export{f as default};
5
+ import e from"./config.js";import r from"./core/Error.js";import has from"./core/has.js";import{onAbort as t}from"./core/promiseUtils.js";import{isDataProtocol as o,isBlobProtocol as s,normalize as n,queryToObject as i,getInterceptor as a}from"./core/urlUtils.js";import{requestConfig as u}from"./request/config.js";import{createRequestError as p,processRequest as c}from"./request/process.js";import{ensureRequestQueue as l}from"./request/queue.js";async function f(e,r){e instanceof URL&&(e=e.toString());const u=o(e),l=s(e);l||u||(e=n(e));const f={url:e,requestOptions:{...r}};r?.query&&(f.requestOptions.query=r?.query instanceof URLSearchParams?i(r.query.toString().replaceAll("+"," ")):r?.query);const b=e=>({data:e,getAllHeaders:q,getHeader:q,httpStatus:200,requestOptions:f.requestOptions,url:f.url}),g=a(e,m.internalInterceptors);if(g){const e=await w(g,f);if(null!=e)return b(e)}let O=a(e);if(O){const e=await w(O,f);if(null!=e)return b(e);O.after||O.error||(O=null)}if(e=f.url,"image"===(r=f.requestOptions).responseType&&(has("host-webworker")||has("host-node")))throw p("request:invalid-parameters",new Error("responseType 'image' is not supported in Web Workers or Node environment"),f);if("head"===r.method){if(r.body)throw p("request:invalid-parameters",new Error("body parameter cannot be set when method is 'head'"),f);if(u||l)throw p("request:invalid-parameters",new Error("data and blob URLs are not supported for method 'head'"),f)}if(await h(),d)return d.execute(e,r);const j=new AbortController,v=t(r,()=>j.abort()),k={controller:j,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:O,parameters:f,redoRequest:!1,useIdentity:m.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},S=r.useQueue?y(k):c(k),E=await S.finally(()=>v?.remove());return O?.after?.(E),E}let d;const m=e.request,q=()=>null;async function h(){has("host-webworker")&&(!d&&globalThis.invokeStaticMessage?d=await import("./core/workers/request.js"):u.isForeignWorker=!0)}async function w(e,t){if(null!=e.responseData)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let s,n;try{n=await e.before(t)}catch(o){s=p("request:interceptor",o,t)}if((n instanceof Error||n instanceof r)&&(s=p("request:interceptor",n,t)),s)throw e.error&&e.error(s),s;return n}}async function y(e){const r=await l(e);return r?r.push(e):c(e)}export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{getJsonType as e,getGeometryType as t}from"../../geometry/support/jsonUtils.js";function r(t){return{geometryType:e(t[0]),geometries:t.map(e=>e.toJSON())}}function o(e,r,o){const n=t(r);return e.map(e=>{const t=n.fromJSON(e);return t.spatialReference=o,t})}export{o as decodeGeometries,r as encodeGeometries};
5
+ import{getGeometryType as e,getJsonType as t}from"../../geometry/support/jsonUtils.js";function r(e){return{geometryType:t(e[0]),geometries:e.map(e=>e.toJSON())}}function o(t,r,o){const n=e(r);return t.map(e=>{const t=n.fromJSON(e);return t.spatialReference=o,t})}export{o as decodeGeometries,r as encodeGeometries};
@@ -16,6 +16,7 @@ export const executeSearchStreaming: __esri.knowledgeGraphService["executeSearch
16
16
  export const executeUpdateGraphProperty: __esri.knowledgeGraphService["executeUpdateGraphProperty"];
17
17
  export const executeUpdateNamedType: __esri.knowledgeGraphService["executeUpdateNamedType"];
18
18
  export const executeUpdateSearchIndex: __esri.knowledgeGraphService["executeUpdateSearchIndex"];
19
+ export const fetchAllClientDataKeys: __esri.knowledgeGraphService["fetchAllClientDataKeys"];
19
20
  export const fetchAsynchronousFindPathsResultData: __esri.knowledgeGraphService["fetchAsynchronousFindPathsResultData"];
20
21
  export const fetchClientDataAtKeys: __esri.knowledgeGraphService["fetchClientDataAtKeys"];
21
22
  export const fetchKnowledgeGraph: __esri.knowledgeGraphService["fetchKnowledgeGraph"];
@@ -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{getDefaultUnitSystem as t}from"../core/unitUtils.js";import r from"../portal/Portal.js";function e(e){const n="metric";if(null==e)return n;const i=e.map,l=(i&&"portalItem"in i?i.portalItem?.portal:null)??r.getDefault();switch(l.user?.units??l.units){case n:return n;case"english":return"imperial"}return t(e.spatialReference)??n}export{e as getDefaultUnitForView};
5
+ import{getDefaultUnitSystem as t}from"../core/unitUtils.js";import r from"../portal/Portal.js";function e(e){const i="metric";if(!e)return i;const{map:n}=e,o=(n&&"portalItem"in n?n.portalItem?.portal:null)??r.getDefault();switch(o.user?.units??o.units){case i:return i;case"english":return"imperial"}return t(e.spatialReference)??i}export{e as getDefaultUnitForView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../PopupTemplate.js";import{isFieldVisibleByDefault as t,isFieldEditable as i,getDisplayFieldName as n,isRasterPixelValueField as o}from"../layers/support/fieldUtils.js";import r from"../popup/FieldInfo.js";import s from"../popup/content/AttachmentsContent.js";import l from"../popup/content/FieldsContent.js";import a from"../popup/support/FieldInfoFormat.js";function d({displayField:t,editFieldsInfo:i,fields:n,objectIdField:o,title:r},s){if(!n)return null;const l=b({editFieldsInfo:i,fields:n,objectIdField:o},s);if(!l.length)return null;const a=I({titleBase:r,fields:n,displayField:t}),d=y();return new e({title:a,content:d,fieldInfos:l})}function u(t){const{fields:i,featureReduction:n,title:o}=t,r=n.fields;if(!r)return null;const s=w(r,i??[]);if(!s.length)return null;const l=v();return new e({title:o,content:l,fieldInfos:s})}const c=(e,i)=>i.visibleFieldNames?i.visibleFieldNames.has(e.name):t(e,i);function f({fields:e,ignoreFieldTypes:t,sortDisabled:i}){const n=e;return t&&(e=e.filter(e=>!t.includes(e.type))),e===n&&(e=e.slice()),!0!==i&&e.sort(p),e}function p(e,t){return"oid"===e.type?-1:"oid"===t.type?1:j(e)?-1:j(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function m(e,t){return new l({fieldInfos:b(e,t).filter(e=>e.visible)})}function b(e,t){const n=t?.visibleFieldNames;return f({fields:e.fields??[],ignoreFieldTypes:t?.ignoreFieldTypes||C,sortDisabled:t?.sortDisabled}).map(t=>new r({fieldName:t.name,isEditable:i(t,e),label:t.alias,format:g(t),visible:c(t,{...e,visibleFieldNames:n})}))}function w(e,t){return e.map(e=>new r({fieldName:e.name,isEditable:!1,label:e.alias,format:F(e,t),visible:!0}))}function F(e,t){const{onStatisticField:i,onStatisticExpression:n,statisticType:o}=e;if(i){const e=t.find(e=>i===e.name);if(e)return g(e)}return"number"===n?.returnType?new a({digitSeparator:!0,places:2}):"count"===o?new a({digitSeparator:!0,places:0}):void 0}function g(e){switch(e.type){case"small-integer":case"integer":case"single":return new a({digitSeparator:!0,places:0});case"double":return new a({digitSeparator:!0,places:2});case"string":return o(e.name)?new a({digitSeparator:!0,places:0}):void 0;default:return}}function y(){return[new l,new s]}function v(){return[new l]}function I(e){const t=n(e),{titleBase:i}=e;return t?`${i}: {${t.trim()}}`:i??""}function j(e){if("name"===(e.name&&e.name.toLowerCase()))return!0;const t=e.alias?.toLowerCase();return"name"===t}const C=["geometry","blob","raster","guid","xml"];export{b as createFieldInfos,m as createFieldsContent,d as createPopupTemplate,u as createPopupTemplateForFeatureReduction};
5
+ import e from"../PopupTemplate.js";import{isFieldVisibleByDefault as t,isFieldEditable as i,getDisplayFieldName as n,isRasterPixelValueField as o}from"../layers/support/fieldUtils.js";import r from"../popup/FieldInfo.js";import s from"../popup/content/AttachmentsContent.js";import l from"../popup/content/FieldsContent.js";import a from"../popup/support/FieldInfoFormat.js";function d({displayField:t,editFieldsInfo:i,fields:n,objectIdField:o,title:r},s){if(!n)return null;const l=b({editFieldsInfo:i,fields:n,objectIdField:o},s);if(!l.length)return null;const a=I({titleBase:r,fields:n,displayField:t}),d=y();return new e({title:a,content:d,fieldInfos:l})}function u(t){const{fields:i,featureReduction:n,title:o}=t,r=n.fields;if(!r)return null;const s=w(r,i??[]);if(!s.length)return null;const l=v();return new e({title:o,content:l,fieldInfos:s})}const c=(e,i)=>i.visibleFieldNames?i.visibleFieldNames.has(e.name):t(e,i);function f({fields:e,ignoreFieldTypes:t,sortDisabled:i}){const n=e;return t&&(e=e.filter(e=>!t.includes(e.type))),e===n&&(e=e.slice()),!0!==i&&e.sort(p),e}function p(e,t){return"oid"===e.type?-1:"oid"===t.type?1:j(e)?-1:j(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function m(e,t){return new l({fieldInfos:b(e,t).filter(e=>e.visible)})}function b(e,t){const n=t?.visibleFieldNames;return f({fields:e.fields??[],ignoreFieldTypes:t?.ignoreFieldTypes||C,sortDisabled:t?.sortDisabled}).map(t=>new r({fieldName:t.name,isEditable:i(t,e),label:t.alias,format:g(t),visible:c(t,{...e,visibleFieldNames:n})}))}function w(e,t){return e.map(e=>new r({fieldName:e.name,isEditable:!1,label:e.alias,format:F(e,t),visible:!0}))}function F(e,t){const{onStatisticField:i,onStatisticExpression:n,statisticType:o}=e;if(i){const e=t.find(e=>i===e.name);if(e)return g(e)}return"number"===n?.returnType?new a({digitSeparator:!0,places:2}):"count"===o?new a({digitSeparator:!0,places:0}):void 0}function g(e){switch(e.type){case"small-integer":case"integer":return new a({digitSeparator:!0,places:0});case"single":case"double":return new a({digitSeparator:!0,places:2});case"string":return o(e.name)?new a({digitSeparator:!0,places:0}):void 0;default:return}}function y(){return[new l,new s]}function v(){return[new l]}function I(e){const t=n(e),{titleBase:i}=e;return t?`${i}: {${t.trim()}}`:i??""}function j(e){if("name"===(e.name&&e.name.toLowerCase()))return!0;const t=e.alias?.toLowerCase();return"name"===t}const C=["geometry","blob","raster","guid","xml"];export{b as createFieldInfos,m as createFieldsContent,d as createPopupTemplate,u as createPopupTemplateForFeatureReduction};
@@ -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
- const b="20251009",e="6b5d9c7148888d699b656f0e4b57992284e62296";export{b as buildDate,e as commitHash};
5
+ const f="20251011",e="6abee44c043f07bde1faed64dbf9a0120767fff1";export{f as buildDate,e as commitHash};
@@ -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"../../core/has.js";import{pt2px as e,toPt as t,px2pt as l}from"../../core/screenUtils.js";import{isSubtypeGroupLayer as a}from"../../layers/support/layerUtils.js";import{loadArcade as i}from"../../support/loadArcade.js";import{getStroke as r}from"./gfxUtils.js";import{renderSymbol as s,renderOnce as o}from"./renderUtils.js";import{isSymbol3D as n}from"./typeUtils.js";import{applyColorToSymbol as c,applySizesToSymbol as u,applyRotationToSymbol as p,getColorFromSymbol as f,applyOpacityToColor as y}from"./utils.js";import{renderRelationshipRamp as h}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as d}from"../../widgets/Legend/support/relationshipRampUtils.js";let m=null;const b=[255,255,255];function g(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function w(e,t,l){const{backgroundColor:a,outline:i,dotSize:r}=e,s=l?.swatchSize||22,o=.8,n=Math.round(s*s/Math.max(r,.5)**2*o),c=window.devicePixelRatio,u=document.createElement("canvas"),p=s*c;u.width=p,u.height=p,u.style.width=u.width/c+"px",u.style.height=u.height/c+"px";const f=u.getContext("2d");if(a&&(f.fillStyle=a.toCss(!0),f.fillRect(0,0,p,p),f.fill()),f.fillStyle=t?.toCss(!0)??"",m&&m.length/2===n)for(let h=0;h<2*n;h+=2){const e=m[h],t=m[h+1];f.fillRect(e,t,r*c,r*c),f.fill()}else{m=[];for(let e=0;e<2*n;e+=2){const e=g(0,p),t=g(0,p);m.push(e,t),f.fillRect(e,t,r*c,r*c),f.fill()}}i&&(i.color&&(f.strokeStyle=i.color.toCss(!0)),f.lineWidth=i.width,f.strokeRect(0,0,p,p));const y=new Image(s,s);return y.src=u.toDataURL(),y.ariaLabel=l?.ariaLabel??null,y.alt=l?.ariaLabel??"",y}function S(e,t={}){const l=t.radius||40,a=2*Math.PI*l,i=e.length,o=a/i,n=[],c=r(t.outline);null!=c?.width&&(c.width*=2),(c||t.backgroundColor)&&n.push({shape:{type:"circle",cx:l,cy:l,r:l},fill:t.backgroundColor,stroke:c,offset:[0,0]});const u=t.values,p=u&&u.length===i&&100===u.reduce((e,t)=>e+t,0),f=[0];for(let r=0;r<i;r++){let t=null;p&&(t=u[r]*a/100,f.push(t+f[r])),n.push({shape:{type:"circle",cx:l,cy:l,r:l/2},fill:[0,0,0,0],stroke:{width:l,dashArray:`${(t??o)/2} ${a}`,dashoffset:"-"+(p?f[r]/2:r*(o/2)),color:e[r]},offset:[0,0]})}let y=null;const h=2*l+(c?.width||0),d=t.holePercentage;if(d){c&&n.push({shape:{type:"circle",cx:l,cy:l,r:l*d},fill:null,stroke:c,offset:[0,0]});const e=h/2;y=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:b,stroke:c?{...c,color:b}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:l*d},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return s([n],[h,h],{cssEffectFilter:t.cssEffectFilter,ignoreStrokeWidth:!0,masking:y,rotations:[-90],ariaLabel:t.ariaLabel})}function v(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:i}=l,r=d({focus:a,numClasses:i,infos:e.uniqueValueInfos}),s=t?.node||document.createElement("div");return o(s,()=>h(r,t.id||"relationship",{opacity:t.opacity||1,cssEffectFilter:t.cssEffectFilter,ariaLabel:t.ariaLabel})),s}function V(e,t={}){const l=24,a=75,i="horizontal"===t.align,r=i?a:l,s=i?l:a,o=t.width??r,n=t.height??s,c=t.gradient??!0,u=window.devicePixelRatio,p=o*u,f=n*u,y=document.createElement("canvas");y.width=p,y.height=f,y.ariaLabel=t.ariaLabel??null,y.style.width=`${o}px`,y.style.height=`${n}px`;const h=y.getContext("2d"),d=i?p:0,m=i?0:f;if(c){const t=h.createLinearGradient(0,0,d,m),l=e.length,a=1===l?0:1/(l-1);e.forEach((e,l)=>t.addColorStop(l*a,e.toString())),h.fillStyle=t,h.fillRect(0,0,p,f)}else{const t=i?p/e.length:p,l=i?f:f/e.length;let a=0,r=0;for(const s of e)h.fillStyle=s.toString(),h.fillRect(a,r,t,l),a=i?a+t:0,r=i?0:r+l}const b=document.createElement("div");return b.style.width=`${o}px`,b.style.height=`${n}px`,x(b,t?.cssEffectFilter),b.appendChild(y),b}function k(e){const t=e.match(/drop-shadow\(\s*([^\s]+)\s+[^\s]+\s+[^\s]+\s+.+?\)/);return t?t[1]:null}function x(l,a){if(!a)return;l.style.filter=a;const i=k(a);if(i){const a=e(t(i));a<0?l.style.marginLeft=`${Math.abs(a)}px`:l.style.marginRight=`${a}px`}}async function L(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,L,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function R(e){return e&&void 0!==e.opacity?e.opacity*("parent"in e?R(e.parent):1):1}async function C(e,t){if(!e)return;const l=e.sourceLayer,a=(null!=t&&t.useSourceLayer?l:e.layer)??l,r=t?.ignoreOpacity?1:R(a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):e.symbol.clone();return c(l,null,{add:r}),l}const s=t?.renderer??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!o)return;if(o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):o.clone(),!(s&&"visualVariables"in s&&s.visualVariables?.length&&j(o)))return c(o,null,{add:r}),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:n,getOpacity:f,getAllSizes:y,getRotationAngle:h}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),d=[],m=[],b=[],g=[];for(const i of s.visualVariables)switch(i.type){case"color":d.push(i);break;case"opacity":m.push(i);break;case"rotation":g.push(i);break;case"size":i.target||b.push(i)}const w=!!d.length&&d[d.length-1],S=w?n(w,e,t):null,v=!!t?.ignoreOpacity,V=!!m.length&&m[m.length-1],k=V?f(V,e,t):null;if(c(o,S,v?void 0:{override:k,add:r}),b.length&&!0!==t?.ignoreSizeVariables){const l=y(b,e,t);await u(o,l)}if(!0!==t?.ignoreRotationVariables)for(const i of g)p(o,h(i,e,t),i.axis);return o}async function F(e,t){if(!e)return;const{layer:l,sourceLayer:a}=e,r=R(l??a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):e.symbol.clone();return f(l,r)}const s=t?.renderer??I(l)??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):void 0;if(!o)return;o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):o.clone();const n=f(o,void 0);if(!s||!("visualVariables"in s)||"visualVariables"in s&&!s.visualVariables||"visualVariables"in s&&!s.visualVariables?.length||!j(o))return n?y(n,r):void 0;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:c,getOpacity:u}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),p=[],h=[];if(s.visualVariables)for(const i of s.visualVariables)switch(i.type){case"color":p.push(i);break;case"opacity":h.push(i)}const d=p.length>0?p[p.length-1]:null,m=(d?c(d,e,t):void 0)??n,b=h.length>0?h[h.length-1]:null,g=b?u(b,e,t):null;return null!=m&&null!=g&&(m.a=g),m?y(m,r):null}function j(e){return!n(e)||"water"!==e.symbolLayers.at(0)?.type}function I(e){if(e)return"renderer"in e?e.renderer:void 0}async function U(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,r=l?.renderer??I(a)??I(i);if(!r)return null;if("visualVariables"in r&&r.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:s}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getDateFormatOptions:o}=await import("../../widgets/Legend/support/utils.js");let n=null;for(const c of r.visualVariables){const u=t?o(a,c,t.timeZone):null;let p=null;switch(c.type){case"color":p=await i(c,null,u);break;case"opacity":p=await i(c);break;case"size":c.target||(p=await s(r,c,null,l?.scale||t?.scale,t,u))}if(p?.length){const t=p.find((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===p?.length-1?a<=t.value:t.value===a});if(t){n=t.label;break}}}if(n)return n}switch(r.type){case"class-breaks":{const t="getClassBreakInfo"in r?await r.getClassBreakInfo(e,l):null;return t?.label??(t&&r.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in r?await r.getUniqueValueInfo(e,l):null;return t?.label}}return null}async function z(e,t){e?.layer&&a(e.layer)&&((e=e.cloneShallow()).layer=e.layer.findSublayerForFeature(e)??null);const i=null===e?t?.fallbackSymbol??null:await C(e,{ignoreGraphicSymbol:!!e.layer,ignoreOpacity:t?.ignoreOpacity??!0,ignoreRotationVariables:t?.ignoreRotationVariables??!0,ignoreSizeVariables:t?.ignoreSizeVariables??!0})??t?.fallbackSymbol??null;if(!i)return null;const r=await L(i,{geometry:t.useGeometryForShape?e?.geometry??null:null,useMarkerSymbolSize:!1!==t.useMarkerSymbolSize,size:{width:l(t.widthInPixels??16),height:l(t.heightInPixels??16)},..."cim"===i?.type?{cimOptions:{feature:{attributes:e?.attributes??{}}}}:{}});if(!r)return null;return"element"===(t?.format??"element")?r:r.outerHTML}export{F as getDisplayedColor,C as getDisplayedSymbol,U as getLegendLabel,z as previewGraphic,V as renderColorRampPreviewHTML,w as renderDotDensityPreviewHTML,S as renderPieChartPreviewHTML,L as renderPreviewHTML,v as renderRelationshipRampPreviewHTML};
5
+ import"../../core/has.js";import{pt2px as e,toPt as t,px2pt as l}from"../../core/screenUtils.js";import{isSubtypeGroupLayer as a}from"../../layers/support/layerUtils.js";import{loadArcade as i}from"../../support/loadArcade.js";import{getStroke as r}from"./gfxUtils.js";import{renderSymbol as s,renderOnce as o}from"./renderUtils.js";import{isSymbol3D as n}from"./typeUtils.js";import{applyColorToSymbol as c,applySizesToSymbol as u,applyRotationToSymbol as p,getColorFromSymbol as f,applyOpacityToColor as y}from"./utils.js";import{renderRelationshipRamp as h}from"../../widgets/Legend/styles/support/relationshipUtils.js";import{getRelationshipRampElement as d}from"../../widgets/Legend/support/relationshipRampUtils.js";let m=null;const b=[255,255,255];function g(e,t){return Math.floor(Math.random()*(t-e+1)+e)}function w(e,t,l){const{backgroundColor:a,outline:i,dotSize:r}=e,s=l?.swatchSize||22,o=.8,n=Math.round(s*s/Math.max(r,.5)**2*o),c=window.devicePixelRatio,u=document.createElement("canvas"),p=s*c;u.width=p,u.height=p,u.style.width=u.width/c+"px",u.style.height=u.height/c+"px";const f=u.getContext("2d");if(a&&(f.fillStyle=a.toCss(!0),f.fillRect(0,0,p,p),f.fill()),f.fillStyle=t?.toCss(!0)??"",m&&m.length/2===n)for(let h=0;h<2*n;h+=2){const e=m[h],t=m[h+1];f.fillRect(e,t,r*c,r*c),f.fill()}else{m=[];for(let e=0;e<2*n;e+=2){const e=g(0,p),t=g(0,p);m.push(e,t),f.fillRect(e,t,r*c,r*c),f.fill()}}i&&(i.color&&(f.strokeStyle=i.color.toCss(!0)),f.lineWidth=i.width,f.strokeRect(0,0,p,p));const y=new Image(s,s);return y.src=u.toDataURL(),y.ariaLabel=l?.ariaLabel??null,y.alt=l?.ariaLabel??"",y}function S(e,t={}){const l=t.radius||40,a=2*Math.PI*l,i=e.length,o=a/i,n=[],c=r(t.outline);null!=c?.width&&(c.width*=2),(c||t.backgroundColor)&&n.push({shape:{type:"circle",cx:l,cy:l,r:l},fill:t.backgroundColor,stroke:c,offset:[0,0]});const u=t.values,p=u&&u.length===i&&100===u.reduce((e,t)=>e+t,0),f=[0];for(let r=0;r<i;r++){let t=null;p&&(t=u[r]*a/100,f.push(t+f[r])),n.push({shape:{type:"circle",cx:l,cy:l,r:l/2},fill:[0,0,0,0],stroke:{width:l,dashArray:`${(t??o)/2} ${a}`,dashoffset:"-"+(p?f[r]/2:r*(o/2)),color:e[r]},offset:[0,0]})}let y=null;const h=2*l+(c?.width||0),d=t.holePercentage;if(d){c&&n.push({shape:{type:"circle",cx:l,cy:l,r:l*d},fill:null,stroke:c,offset:[0,0]});const e=h/2;y=[[{shape:{type:"circle",cx:e,cy:e,r:e},fill:b,stroke:c?{...c,color:b}:null,offset:[0,0]},{shape:{type:"circle",cx:e,cy:e,r:l*d},fill:[0,0,0],stroke:null,offset:[0,0]}]]}return s([n],[h,h],{cssEffectFilter:t.cssEffectFilter,ignoreStrokeWidth:!0,masking:y,rotations:[-90],ariaLabel:t.ariaLabel})}function v(e,t={}){const l=e?.authoringInfo;if(!("relationship"===l?.type)||!l?.numClasses||!e.uniqueValueInfos)return null;const{focus:a,numClasses:i}=l,r=d({focus:a,numClasses:i,infos:e.uniqueValueInfos}),s=t?.node||document.createElement("div");return o(s,()=>h(r,t.id||"relationship",{opacity:t.opacity||1,cssEffectFilter:t.cssEffectFilter,ariaLabel:t.ariaLabel})),s}function V(e,t={}){const l=24,a=75,i="horizontal"===t.align,r=i?a:l,s=i?l:a,o=t.width??r,n=t.height??s,c=t.gradient??!0,u=window.devicePixelRatio,p=o*u,f=n*u,y=document.createElement("canvas");y.width=p,y.height=f,y.ariaLabel=t.ariaLabel??null,y.style.width=`${o}px`,y.style.height=`${n}px`;const h=y.getContext("2d"),d=i?p:0,m=i?0:f;if(c){const t=h.createLinearGradient(0,0,d,m),l=e.length,a=1===l?0:1/(l-1);e.forEach((e,l)=>t.addColorStop(l*a,e.toString())),h.fillStyle=t,h.fillRect(0,0,p,f)}else{const t=i?p/e.length:p,l=i?f:f/e.length;let a=0,r=0;for(const s of e)h.fillStyle=s.toString(),h.fillRect(a,r,t,l),a=i?a+t:0,r=i?0:r+l}const b=document.createElement("div");return b.style.width=`${o}px`,b.style.height=`${n}px`,x(b,t?.cssEffectFilter),b.appendChild(y),b}function k(e){const t=e.match(/drop-shadow\(\s*([^\s]+)\s+[^\s]+\s+[^\s]+\s+.+?\)/);return t?t[1]:null}function x(l,a){if(!a)return;l.style.filter=a;const i=k(a);if(i){const a=e(t(i));a<0?l.style.marginLeft=`${Math.abs(a)}px`:l.style.marginRight=`${a}px`}}async function L(e,t){switch(e.type){case"web-style":{const{previewWebStyleSymbol:l}=await import("./previewWebStyleSymbol.js");return l(e,L,t)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:l}=await import("./previewSymbol3D.js");return l(e,t)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:l}=await import("./previewSymbol2D.js");return l(e,t)}case"cim":{const{previewCIMSymbol:l}=await import("./previewCIMSymbol.js");return l(e,t)}default:return}}function R(e){return e&&void 0!==e.opacity?e.opacity*("parent"in e?R(e.parent):1):1}async function F(e,t){if(!e)return;const l=e.sourceLayer,a=(null!=t&&t.useSourceLayer?l:e.layer)??l,r=t?.ignoreOpacity?1:R(a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):e.symbol.clone();return c(l,null,{add:r}),l}const s=t?.renderer??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!o)return;if(o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats,cache:t?.webStyleCache}):o.clone(),!(s&&"visualVariables"in s&&s.visualVariables?.length&&j(o)))return c(o,null,{add:r}),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:n,getOpacity:f,getAllSizes:y,getRotationAngle:h}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),d=[],m=[],b=[],g=[];for(const i of s.visualVariables)switch(i.type){case"color":d.push(i);break;case"opacity":m.push(i);break;case"rotation":g.push(i);break;case"size":i.target||b.push(i)}const w=!!d.length&&d[d.length-1],S=w?n(w,e,t):null,v=!!t?.ignoreOpacity,V=!!m.length&&m[m.length-1],k=V?f(V,e,t):null;if(c(o,S,v?void 0:{override:k,add:r}),b.length&&!0!==t?.ignoreSizeVariables){const l=y(b,e,t);await u(o,l)}if(!0!==t?.ignoreRotationVariables)for(const i of g)p(o,h(i,e,t),i.axis);return o}async function C(e,t){if(!e)return;const{layer:l,sourceLayer:a}=e,r=R(l??a);if(null!=e.symbol&&(null==t||!0!==t.ignoreGraphicSymbol)){const l="web-style"===e.symbol.type?await e.symbol.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):e.symbol.clone();return f(l,r)}const s=t?.renderer??I(l)??I(a);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):void 0;if(!o)return;o="web-style"===o.type?await o.fetchSymbol({...t,acceptedFormats:t?.webStyleAcceptedFormats}):o.clone();const n=f(o,void 0);if(!s||!("visualVariables"in s)||"visualVariables"in s&&!s.visualVariables||"visualVariables"in s&&!s.visualVariables?.length||!j(o))return n?y(n,r):void 0;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&null==t?.arcade){const e={...t};e.arcade=await i(),t=e}const{getColor:c,getOpacity:u}=await import("../../renderers/visualVariables/support/visualVariableUtils.js"),p=[],h=[];if(s.visualVariables)for(const i of s.visualVariables)switch(i.type){case"color":p.push(i);break;case"opacity":h.push(i)}const d=p.length>0?p[p.length-1]:null,m=(d?c(d,e,t):void 0)??n,b=h.length>0?h[h.length-1]:null,g=b?u(b,e,t):null;return null!=m&&null!=g&&(m.a=g),m?y(m,r):null}function j(e){return!n(e)||"water"!==e.symbolLayers.at(0)?.type}function I(e){if(e)return"renderer"in e?e.renderer:void 0}async function U(e,t,l){if(!e)return;const{layer:a,sourceLayer:i}=e,r=l?.renderer??I(a)??I(i);if(!r)return null;if("visualVariables"in r&&r.visualVariables?.length){const{getRampStops:i}=await import("../../widgets/Legend/support/colorRampUtils.js"),{getRampStops:s}=await import("../../widgets/Legend/support/sizeRampUtils.js"),{getFormatOptionsForVisualVariable:o}=await import("../../widgets/Legend/support/utils.js");let n=null;for(const c of r.visualVariables){const u=t?o(a,c,t.timeZone):null;let p=null;switch(c.type){case"color":p=await i(c,null,u);break;case"opacity":p=await i(c);break;case"size":c.target||(p=await s(r,c,null,l?.scale||t?.scale,t,u))}if(p?.length){const t=p.find((t,l)=>{const a=e.attributes[c.field];return 0===l?a>=t.value:l===p?.length-1?a<=t.value:t.value===a});if(t){n=t.label;break}}}if(n)return n}switch(r.type){case"class-breaks":{const t="getClassBreakInfo"in r?await r.getClassBreakInfo(e,l):null;return t?.label??(t&&r.classBreakInfos?.length>1)?`${t.minValue} - ${t.maxValue}`:null}case"unique-value":{const t="getUniqueValueInfo"in r?await r.getUniqueValueInfo(e,l):null;return t?.label}}return null}async function z(e,t){e?.layer&&a(e.layer)&&((e=e.cloneShallow()).layer=e.layer.findSublayerForFeature(e)??null);const i=null===e?t?.fallbackSymbol??null:await F(e,{ignoreGraphicSymbol:!!e.layer,ignoreOpacity:t?.ignoreOpacity??!0,ignoreRotationVariables:t?.ignoreRotationVariables??!0,ignoreSizeVariables:t?.ignoreSizeVariables??!0})??t?.fallbackSymbol??null;if(!i)return null;const r=await L(i,{geometry:t.useGeometryForShape?e?.geometry??null:null,useMarkerSymbolSize:!1!==t.useMarkerSymbolSize,size:{width:l(t.widthInPixels??16),height:l(t.heightInPixels??16)},..."cim"===i?.type?{cimOptions:{feature:{attributes:e?.attributes??{}}}}:{}});if(!r)return null;return"element"===(t?.format??"element")?r:r.outerHTML}export{C as getDisplayedColor,F as getDisplayedSymbol,U as getLegendLabel,z as previewGraphic,V as renderColorRampPreviewHTML,w as renderDotDensityPreviewHTML,S as renderPieChartPreviewHTML,L as renderPreviewHTML,v as renderRelationshipRampPreviewHTML};
@@ -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{JSONSupport as e}from"../core/JSONSupport.js";import{truncateDate as r,offsetDate as s}from"../core/timeUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as i}from"../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as o}from"../core/accessorSupport/decorators/writer.js";import{system as a}from"./constants.js";var u;let m=class extends e{static{u=this}static get allTime(){return d}static get empty(){return c}static fromArray(t){return new u({start:null!=t[0]?new Date(t[0]):t[0],end:null!=t[1]?new Date(t[1]):t[1]})}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(u.allTime)}get isEmpty(){return this.equals(u.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new u({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,s=t.start?.getTime()??t.start,n=t.end?.getTime()??t.end;return e===s&&r===n}expandTo(t,e=a){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=r(n,t,e));let i=this.end;if(i){const n=r(i,t,e);i=i.getTime()===n.getTime()?n:s(n,1,t,e)}return new u({start:n,end:i})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return u.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=t.start?.getTime()??-1/0,n=t.end?.getTime()??1/0;let i,l;return s>=e&&s<=r?i=s:e>=s&&e<=n&&(i=e),r>=s&&r<=n?l=r:n>=e&&n<=r&&(l=n),null==i||null==l||isNaN(i)||isNaN(l)?u.empty:new u({start:i===-1/0?null:new Date(i),end:l===1/0?null:new Date(l)})}offset(t,e,r=a){if(this.isEmpty||this.isAllTime)return this.clone();const n=new u,{start:i,end:l}=this;return null!=i&&(n.start=s(i,t,e,r)),null!=l&&(n.end=s(l,t,e,r)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return d.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new u({start:e,end:r})}};t([n({type:Date,json:{write:{allowNull:!0}}})],m.prototype,"end",void 0),t([i("end")],m.prototype,"readEnd",null),t([o("end")],m.prototype,"writeEnd",null),t([n({readOnly:!0,json:{read:!1}})],m.prototype,"isAllTime",null),t([n({readOnly:!0,json:{read:!1}})],m.prototype,"isEmpty",null),t([n({type:Date,json:{write:{allowNull:!0}}})],m.prototype,"start",void 0),t([i("start")],m.prototype,"readStart",null),t([o("start")],m.prototype,"writeStart",null),m=u=t([l("esri.time.TimeExtent")],m);const p=m,d=new m,c=new m({start:void 0,end:void 0});export{p as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as e}from"../core/JSONSupport.js";import{truncateDate as r,offsetDate as s}from"../core/timeUtils.js";import{property as n}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as i}from"../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../core/accessorSupport/decorators/subclass.js";import{writer as o}from"../core/accessorSupport/decorators/writer.js";import{system as a}from"./constants.js";var u;let m=class extends e{static{u=this}static get allTime(){return p}static get empty(){return d}static fromArray(t){return new u({start:null!=t[0]?new Date(t[0]):t[0],end:null!=t[1]?new Date(t[1]):t[1]})}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return null!=e.end?new Date(e.end):null}writeEnd(t,e){e.end=t?.getTime()??null}get isAllTime(){return this.equals(u.allTime)}get isEmpty(){return this.equals(u.empty)}readStart(t,e){return null!=e.start?new Date(e.start):null}writeStart(t,e){e.start=t?.getTime()??null}clone(){return new u({end:this.end,start:this.start})}equals(t){if(!t)return!1;const e=this.start?.getTime()??this.start,r=this.end?.getTime()??this.end,s=t.start?.getTime()??t.start,n=t.end?.getTime()??t.end;return e===s&&r===n}expandTo(t,e=a){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=r(n,t,e));let i=this.end;if(i){const n=r(i,t,e);i=i.getTime()===n.getTime()?n:s(n,1,t,e)}return new u({start:n,end:i})}intersection(t){if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return u.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=this.start?.getTime()??-1/0,r=this.end?.getTime()??1/0,s=t.start?.getTime()??-1/0,n=t.end?.getTime()??1/0;let i,l;return s>=e&&s<=r?i=s:e>=s&&e<=n&&(i=e),r>=s&&r<=n?l=r:n>=e&&n<=r&&(l=n),null==i||null==l||isNaN(i)||isNaN(l)?u.empty:new u({start:i===-1/0?null:new Date(i),end:l===1/0?null:new Date(l)})}offset(t,e,r=a){if(this.isEmpty||this.isAllTime)return this.clone();const n=new u,{start:i,end:l}=this;return null!=i&&(n.start=s(i,t,e,r)),null!=l&&(n.end=s(l,t,e,r)),n}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return p.clone();const e=null!=this.start&&null!=t.start?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,r=null!=this.end&&null!=t.end?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new u({start:e,end:r})}};t([n({type:Date,json:{write:{allowNull:!0}}})],m.prototype,"end",void 0),t([i("end")],m.prototype,"readEnd",null),t([o("end")],m.prototype,"writeEnd",null),t([n({readOnly:!0,json:{read:!1}})],m.prototype,"isAllTime",null),t([n({readOnly:!0,json:{read:!1}})],m.prototype,"isEmpty",null),t([n({type:Date,json:{write:{allowNull:!0}}})],m.prototype,"start",void 0),t([i("start")],m.prototype,"readStart",null),t([o("start")],m.prototype,"writeStart",null),m=u=t([l("esri.time.TimeExtent")],m);const p=new m,d=new m({start:void 0,end:void 0});export{m as default};
@@ -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{__decorate as e}from"tslib";import r from"../../../../Graphic.js";import i from"../../../../core/Accessor.js";import{multiplyOpacity as s}from"../../../../core/colorUtils.js";import{initial as t}from"../../../../core/reactiveUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as l}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../layers/GraphicsLayer.js";import m from"../../../../symbols/SimpleFillSymbol.js";import c from"../../../../symbols/SimpleLineSymbol.js";function n(e){return"simple-line"===e?.type}let h=class extends i{constructor(e){super(e),this._graphicsLayer=new p({listMode:"hide",internal:!0}),this._updatingHandles=new l}initialize(){this.view.map?.add(this._graphicsLayer),this._updatingHandles.add(()=>({color:this.view.effectiveTheme.accentColor,fill:this.measurementViewData.result?.display.fill,outline:this.measurementViewData.result?.display.outline,visible:this.measurementViewData.visible}),({color:e,fill:i,outline:t,visible:o})=>{if(this._graphicsLayer.visible=o,o)if(i&&t){if(2===this._graphicsLayer.graphics.length){const[r,s]=this._graphicsLayer.graphics.toArray(),{symbol:o}=s;if(n(o)&&!!o.color?.equals(e))return r.geometry=i,void(s.geometry=t)}this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.addMany([new r({geometry:i,symbol:new m({color:s(e,.3),outline:null})}),new r({geometry:t,symbol:new c({color:e,width:2})})])}else this._graphicsLayer.graphics.destroyAll()},t)}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._updatingHandles.destroy()}get updating(){return!this._graphicsLayer.loaded||this._updatingHandles.updating}};e([o()],h.prototype,"_graphicsLayer",void 0),e([o()],h.prototype,"_updatingHandles",void 0),e([o()],h.prototype,"measurementViewData",void 0),e([o()],h.prototype,"updating",null),e([o()],h.prototype,"view",void 0),h=e([a("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementAreaVisualization")],h);export{h as AreaMeasurementAreaVisualization};
@@ -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{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{debounce as t,ignoreAbortErrors as s}from"../../../../core/promiseUtils.js";import{createLength as o,createArea as i}from"../../../../core/quantityUtils.js";import{initial as n}from"../../../../core/reactiveUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as u}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as p}from"../../../../core/support/UpdatingHandles.js";import l from"../../../../geometry/Polyline.js";import{e as m}from"../../../../chunks/areaOperator.js";import{l as c,e as d}from"../../../../chunks/geodeticAreaOperator.js";import{l as f,e as g}from"../../../../chunks/geodeticDensifyOperator.js";import{l as y,e as h}from"../../../../chunks/geodeticLengthOperator.js";import{e as j}from"../../../../chunks/lengthOperator.js";import{load as _,execute as w}from"../../../../geometry/operators/projectOperator.js";import{e as R}from"../../../../chunks/simplifyOperator.js";import{isSupported as v,geodesicDensify as q,geodesicLengths as O,geodesicAreas as k}from"../../../../geometry/support/geodesicUtils.js";const H=1e5;async function b(e,r){if(!e?.rings.length||!e.rings[0].length)return null;await _();const t=w(e,r);return t?t.spatialReference.isGeographic?v(t.spatialReference)?A(t):U(t):t.spatialReference.isWebMercator?U(t):G(t):null}async function U(e){await Promise.all([c(),f(),y()]);const r=R(e);if(!r)return null;const t=D(r),s=g(r,H,{unit:"meters"});if(!s)return null;const n=g(t,H,{unit:"meters"});if(!n)return null;const a=h(r,{unit:"meters"}),u=d(r,{unit:"square-meters"});return{area:i(u,"square-meters"),display:{fill:s,outline:n},mode:"geodesic",perimeter:o(a,"meters")}}function A(e){const r=R(e);if(!r)return null;const t=D(r),s=q(r,H),n=q(t,H),a=O([r],"meters")[0],u=k([r],"square-meters")[0];return{area:i(u,"square-meters"),display:{fill:s,outline:n},mode:"geodesic",perimeter:o(a,"meters")}}function G(e){const r=R(e);if(!r)return null;const t=D(r),s=j(t,{unit:"meters"}),n=m(r,{unit:"square-meters"});return{area:i(n,"square-meters"),display:{fill:r,outline:t},mode:"euclidean",perimeter:o(s,"meters")}}function D(e){return new l({spatialReference:e.spatialReference,paths:e.rings})}let L=class extends r{constructor(e){super(e),this._result=null,this._updatingHandles=new p,this._debouncedGetResult=t(async e=>{this._result=await b(e,this.view.spatialReference)})}initialize(){this._updatingHandles.add(()=>this.measurementViewData.analysis.geometry,e=>{s(this._debouncedGetResult(e))},n)}destroy(){this._updatingHandles.destroy()}get result(){return this._result}get updating(){return this._updatingHandles.updating}};e([a()],L.prototype,"_result",void 0),e([a()],L.prototype,"_updatingHandles",void 0),e([a()],L.prototype,"measurementViewData",void 0),e([a()],L.prototype,"result",null),e([a()],L.prototype,"updating",null),e([a()],L.prototype,"view",void 0),L=e([u("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementController")],L);export{L as AreaMeasurementController};
@@ -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{__decorate as s}from"tslib";import e from"../../../../Graphic.js";import t from"../../../../core/Accessor.js";import{createTask as r}from"../../../../core/asyncUtils.js";import{multiplyOpacity as i,getContrast as a}from"../../../../core/colorUtils.js";import{formatArea as o}from"../../../../core/quantityFormatUtils.js";import{watch as m,initial as p}from"../../../../core/reactiveUtils.js";import{property as n}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import{e as c}from"../../../../chunks/labelPointOperator.js";import{onLocaleChange as d}from"../../../../intl/locale.js";import{fetchMessageBundle as g}from"../../../../intl/messages.js";import u from"../../../../layers/GraphicsLayer.js";import y from"../../../../symbols/Font.js";import _ from"../../../../symbols/TextSymbol.js";function f(s){return"text"===s?.type}let v=class extends t{get _messages(){return this._messagesTask?.value}constructor(s){super(s),this._graphicsLayer=new u({listMode:"hide",internal:!0}),this._updatingHandles=new h,this._messagesTask=null}initialize(){this.view.map?.add(this._graphicsLayer),this.addHandles([m(()=>this.measurementViewData.visible,s=>{this._graphicsLayer.visible=s},p),d(()=>this._updateMessageBundle())]),this._updatingHandles.add(()=>({area:this.measurementViewData.result?.area,color:this.view.effectiveTheme.textColor,geometry:this.measurementViewData.result?.display.fill,messages:this._messages,unit:this.measurementViewData.unit,visible:this.measurementViewData.visible}),({area:s,color:t,geometry:r,messages:m,unit:p,visible:n})=>{if(this._graphicsLayer.visible=n,!n)return;if(!s||!r||!m)return void this._graphicsLayer.graphics.destroyAll();const l=c(r),h=m&&s?o(m,s,p):null;if(this._graphicsLayer.graphics.length){const s=this._graphicsLayer.graphics.at(0);return s.geometry=l,void(f(s.symbol)&&(s.symbol.text=h??""))}const d=i(a(t,160),.5),g=new y({family:"sans-serif",size:14}),u=new _({color:t,haloColor:d,haloSize:2,font:g,text:h});this._graphicsLayer.add(new e({geometry:l,symbol:u}))},p),this._updateMessageBundle()}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._updatingHandles.destroy()}get updating(){return!this._graphicsLayer.loaded||!this._messagesTask?.finished||this._updatingHandles.updating}_updateMessageBundle(){return this._messagesTask?.abort(),this._messagesTask=r(()=>g("esri/core/t9n/Units")),this._messagesTask.promise}};s([n()],v.prototype,"_graphicsLayer",void 0),s([n()],v.prototype,"_updatingHandles",void 0),s([n()],v.prototype,"_messages",null),s([n()],v.prototype,"_messagesTask",void 0),s([n()],v.prototype,"measurementViewData",void 0),s([n()],v.prototype,"updating",null),s([n()],v.prototype,"view",void 0),v=s([l("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementLabelVisualization")],v);export{v as AreaMeasurementLabelVisualization};
@@ -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{__decorate as r}from"tslib";import e from"../../../../Graphic.js";import t from"../../../../core/Accessor.js";import{initial as s}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as o}from"../../../../core/support/UpdatingHandles.js";import p from"../../../../layers/GraphicsLayer.js";import c from"../../../../symbols/SimpleFillSymbol.js";let n=class extends t{constructor(r){super(r),this._graphicsLayer=new p({listMode:"hide",internal:!0}),this._updatingHandles=new o}initialize(){this.view.map?.add(this._graphicsLayer),this._updatingHandles.add(()=>({geometry:this.measurementViewData.analysis.geometry}),({geometry:r})=>{if(!r)return void this._graphicsLayer.graphics.destroyAll();const t=this._graphicsLayer.graphics.at(0);t?t.geometry=r:(this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.add(new e({geometry:r,symbol:new c({color:null,outline:null})})))},s)}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.graphics.destroyAll(),this._graphicsLayer.destroy(),this._updatingHandles.destroy()}get graphic(){return this._graphicsLayer.graphics.at(0)}get graphicsLayer(){return this._graphicsLayer}get updating(){return!this._graphicsLayer.loaded||this._updatingHandles.updating}};r([i()],n.prototype,"_graphicsLayer",void 0),r([i()],n.prototype,"_updatingHandles",void 0),r([i()],n.prototype,"graphic",null),r([i()],n.prototype,"graphicsLayer",null),r([i()],n.prototype,"measurementViewData",void 0),r([i()],n.prototype,"updating",null),r([i()],n.prototype,"view",void 0),n=r([a("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementManipulatorVisualization")],n);export{n as AreaMeasurementManipulatorVisualization};
@@ -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{__decorate as r}from"tslib";import e from"../../../../core/Accessor.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import t from"../../../../layers/GraphicsLayer.js";let a=class extends e{constructor(r){super(r),this._graphicsLayer=new t({listMode:"hide",internal:!0})}initialize(){this.view.map?.add(this._graphicsLayer)}destroy(){this._graphicsLayer.removeFromParent(),this._graphicsLayer.destroy()}get graphicsLayer(){return this._graphicsLayer}get updating(){return!this._graphicsLayer.loaded}};r([o()],a.prototype,"_graphicsLayer",void 0),r([o()],a.prototype,"graphicsLayer",null),r([o()],a.prototype,"measurementViewData",void 0),r([o()],a.prototype,"updating",null),r([o()],a.prototype,"view",void 0),a=r([s("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementSketchVisualization")],a);export{a as AreaMeasurementSketchVisualization};
@@ -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{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{multiplyOpacity as i}from"../../../../core/colorUtils.js";import{makeHandle as s}from"../../../../core/handleUtils.js";import{isAborted as a,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import{watch as r,initial as n}from"../../../../core/reactiveUtils.js";import{property as l}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as h}from"../../../../core/support/UpdatingHandles.js";import c from"../../../../symbols/SimpleFillSymbol.js";import m from"../../../../symbols/SimpleLineSymbol.js";import{ExclusiveOperationManager as d}from"../../../analysis/ExclusiveOperationManager.js";import u from"../../../../widgets/Sketch/SketchViewModel.js";function w(e){return"polygon"===e?.type}let y=class extends t{constructor(e){super(e),this._areaSymbol=null,this._invisibleAreaSymbol=new c({color:null,outline:null}),this._operationManager=new d,this._sketchViewModel=null,this._updatingHandles=new h}initialize(){this._sketchViewModel=new u({defaultCreateOptions:{mode:"click"},defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{edgeOperation:"none",shapeOperation:"none"},toggleToolOnClick:!1,tool:"reshape"},updateOnGraphicClick:!1,view:this.view}),this.addHandles([r(()=>({interactive:this.measurementViewData.interactive,visible:this.measurementViewData.visible}),({interactive:e,visible:t})=>{this._operationManager.stop(),t&&e&&this.reshape()}),r(()=>this.measurementViewData.snappingOptions,e=>{this._sketchViewModel&&(this._sketchViewModel.snappingOptions=e)},n),r(()=>this.view.effectiveTheme.accentColor,e=>{this._areaSymbol=new c({color:i(e,.3),outline:new m({color:e,width:2})})},n)])}destroy(){this._invisibleAreaSymbol.destroy(),this._sketchViewModel?.destroy(),this._updatingHandles.destroy()}get state(){if(!this.measurementViewData.visible||!this._operationManager.currentOperationType)return"idle";switch(this._operationManager.currentOperationType){case"place":return"placing";case"reshape":return"reshaping"}}get updating(){return!this._sketchViewModel||this._sketchViewModel.updating||this._updatingHandles.updating}async place(e){return this._operationManager.start("place",async t=>{if(!this._sketchViewModel||!this.measurementViewData.sketchGraphicsLayer)return;const i=this._sketchViewModel.on("create",e=>{switch(e.state){case"active":{const t=e.graphic?.geometry;"polygon"===t?.type&&(this.measurementViewData.analysis.geometry=t);break}case"cancel":case"complete":t.stop()}});t.handles.push(i,s(()=>{if(i.remove(),this._sketchViewModel?.cancel(),this.measurementViewData.sketchGraphicsLayer?.removeAll(),a(e))return t.reject();t.resolve({})})),this._sketchViewModel.polygonSymbol=this._invisibleAreaSymbol,this._sketchViewModel.layer=this.measurementViewData.sketchGraphicsLayer,this._updatingHandles.addPromise(o(this._sketchViewModel.create("polygon")))})}async reshape(e){return this._operationManager.start("reshape",async t=>{if(!this._sketchViewModel)return;const i=()=>this._areaSymbol&&this._sketchViewModel&&this.measurementViewData.manipulatorGraphic&&this.measurementViewData.manipulatorGraphicsLayer?(this._sketchViewModel.polygonSymbol=this._areaSymbol,this._sketchViewModel.layer=this.measurementViewData.manipulatorGraphicsLayer,this._updatingHandles.addPromise(o(this._sketchViewModel.update(this.measurementViewData.manipulatorGraphic,{tool:"reshape"})))):Promise.resolve(),r=this._sketchViewModel.on("update",e=>{const s=e.graphics[0]?.geometry;this.measurementViewData.analysis.geometry=w(s)?s:null,"complete"===e.state&&(this.measurementViewData.interactive?i():t.stop())});t.handles.push(r,s(()=>{if(r.remove(),this._sketchViewModel?.cancel(),a(e))return t.reject();t.resolve()})),await i()})}};e([l()],y.prototype,"_sketchViewModel",void 0),e([l()],y.prototype,"_updatingHandles",void 0),e([l()],y.prototype,"measurementViewData",void 0),e([l()],y.prototype,"state",null),e([l()],y.prototype,"updating",null),e([l()],y.prototype,"view",void 0),y=e([p("esri.views.2d.analysis.AreaMeasurement.AreaMeasurementTool")],y);export{y as AreaMeasurementTool};
@@ -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{__decorate as t}from"tslib";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import{AnalysisView2D as r}from"./AnalysisView2D.js";import{AreaMeasurementAreaVisualization as s}from"./AreaMeasurement/AreaMeasurementAreaVisualization.js";import{AreaMeasurementController as o}from"./AreaMeasurement/AreaMeasurementController.js";import{AreaMeasurementLabelVisualization as n}from"./AreaMeasurement/AreaMeasurementLabelVisualization.js";import{AreaMeasurementManipulatorVisualization as l}from"./AreaMeasurement/AreaMeasurementManipulatorVisualization.js";import{AreaMeasurementSketchVisualization as p}from"./AreaMeasurement/AreaMeasurementSketchVisualization.js";import{AreaMeasurementTool as u}from"./AreaMeasurement/AreaMeasurementTool.js";import m from"../../interactive/snapping/SnappingOptions.js";let h=class extends r{constructor(t){super(t),this._manipulatorVisualization=null,this.analysis=null,this.snappingOptions=new m,this.type="area-measurement-view-2d"}initialize(){const{view:t}=this;this._areaVisualization=new s({view:t,measurementViewData:this}),this._controller=new o({view:t,measurementViewData:this}),this._labelVisualization=new n({view:t,measurementViewData:this}),this._manipulatorVisualization=new l({view:t,measurementViewData:this}),this._sketchVisualization=new p({view:t,measurementViewData:this}),this._tool=new u({view:t,measurementViewData:this})}destroy(){this._areaVisualization?.destroy(),this._controller?.destroy(),this._labelVisualization?.destroy(),this._manipulatorVisualization?.destroy(),this._sketchVisualization?.destroy(),this._tool?.destroy()}get manipulatorGraphic(){return this._manipulatorVisualization?.graphic}get manipulatorGraphicsLayer(){return this._manipulatorVisualization?.graphicsLayer}get sketchGraphicsLayer(){return this._sketchVisualization?.graphicsLayer}get interactive(){return super.interactive}set interactive(t){super.interactive=t}get result(){return this._controller?.result}get unit(){return this.analysis.unit??a(this.view)}get updating(){return(this._areaVisualization?.updating??!0)||(this._controller?.updating??!0)||(this._labelVisualization?.updating??!0)||(this._sketchVisualization?.updating??!0)||(this._tool?.updating??!0)}get visible(){return super.visible}set visible(t){super.visible=t}async place(t){return this._tool.place(t)}};t([e()],h.prototype,"_areaVisualization",void 0),t([e()],h.prototype,"_controller",void 0),t([e()],h.prototype,"_labelVisualization",void 0),t([e()],h.prototype,"_manipulatorVisualization",void 0),t([e()],h.prototype,"_sketchVisualization",void 0),t([e()],h.prototype,"_tool",void 0),t([e({constructOnly:!0})],h.prototype,"analysis",void 0),t([e()],h.prototype,"manipulatorGraphic",null),t([e()],h.prototype,"manipulatorGraphicsLayer",null),t([e()],h.prototype,"sketchGraphicsLayer",null),t([e({readOnly:!0})],h.prototype,"result",null),t([e({type:m,nonNullable:!0})],h.prototype,"snappingOptions",void 0),t([e({readOnly:!0})],h.prototype,"type",void 0),t([e({readOnly:!0})],h.prototype,"unit",null),t([e({readOnly:!0})],h.prototype,"updating",null),h=t([i("esri.views.2d.analysis.AreaMeasurementAnalysisView2D")],h);const c=h;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 e from"../../../core/Error.js";const l={"area-measurement":null,dimension:null,"direct-line-measurement":null,"elevation-profile":()=>import("./ElevationProfileAnalysisView2D.js"),"line-of-sight":null,slice:null,viewshed:null,"volume-measurement":null};function n(n){const i=l[n.type];if(!i)throw new e("analysis-view-module-import-utils:analysis-not-supported",`Analysis "${n.type}" is not supported`);return i()}export{l as analysisModules,n as importAnalysisViewModule};
5
+ import e from"../../../core/Error.js";const n={"area-measurement":()=>import("./AreaMeasurementAnalysisView2D.js"),dimension:null,"direct-line-measurement":null,"elevation-profile":()=>import("./ElevationProfileAnalysisView2D.js"),"line-of-sight":null,slice:null,viewshed:null,"volume-measurement":null};function i(i){const l=n[i.type];if(!l)throw new e("analysis-view-module-import-utils:analysis-not-supported",`Analysis "${i.type}" is not supported`);return l()}export{n as analysisModules,i as importAnalysisViewModule};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{throwIfNotAbortError as i,createResolver as r,ignoreAbortErrors as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=r()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,i=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(i),this._source=new g(this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),o(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);await this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const r=this._source.cleanup();this._processor.removeChunks(r);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){i(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e.source,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{y as default};
5
+ import e from"../../../../core/Error.js";import{handlesGroup as t}from"../../../../core/handleUtils.js";import has from"../../../../core/has.js";import{nextTick as s}from"../../../../core/nextTick.js";import{ignoreAbortErrors as i,throwIfNotAbortError as r,createResolver as o}from"../../../../core/promiseUtils.js";import n from"../../../../core/RandomLCG.js";import{watch as u}from"../../../../core/reactiveUtils.js";import{pt2px as a}from"../../../../core/screenUtils.js";import{ignoreConnectionErrors as d}from"../../../../core/workers/utils.js";import c from"../../../../layers/support/TileInfo.js";import{tileSize as p}from"../../engine/webgl/definitions.js";import{PipelineConnectionHandlers as h}from"./PipelineConnectionHandlers.js";import l from"./Processor.js";import{FeatureSource as g}from"./sources/FeatureSource.js";import{FeatureTileSubscription as _}from"./sources/FeatureTileSubscription.js";import{Tile as f}from"./support/Tile.js";import b from"../../tiling/TileInfoView.js";class m{constructor(e){this.inner=e,this.resolver=o()}}class y{constructor(){this._aggregateAdapter={getFeatureObjectIds:e=>this._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._cachedObjectIds=new Set,this._updateRequested=!1,this._didSourceRefresh=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateOverridesRequest=null,this._tileInfoView=null}onAttach(e){has("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const s=this._connection,r=c.fromJSON(e.tileInfoJSON);this._tileInfoView=new b(r),this._source=new g(this._aggregateAdapter,this._subscriptions,s,this._cachedObjectIds),this._processor=new l(s,this._source),this._handles=t([this._source.store.events.on("changed",()=>this._requestUpdate()),this._source.store.events.on("refresh",()=>this._requestRefresh()),u(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),i(this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){has("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new h(e)}get features(){const t=this._source?.queryEngine;if(!t)throw new e("no-queryEngine","No query engine defined");return t}get aggregates(){const t=this._processor?.aggregateQueryEngine;if(!t)throw new e("no-queryEngine","No aggregate query engine defined");return t}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getUsedMemory(){return this._source.usedMemory+this._processor.usedMemory}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}getObjectIdsFromGlobalIds(e){return this._source.getObjectIdsFromGlobalIds(e)}async updateSchema(e,t){return has("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new m({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new m(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new m(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async onOverride(t){if(null!=this._updateOverridesRequest)throw new e("featurelayer","InternalError - Already processing an edit");this._updateOverridesRequest=new m(t);const s=this._updateOverridesRequest.resolver.promise;return this._requestUpdate(),s}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(a(e.radius));let s=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const r="string"==typeof e.fieldOffset,o=e.fieldOffset??0,n=Array.from(this._subscriptions.values()),u=this._source.chunks(),d=t**2,c=3/(Math.PI*d),h=2*t,l=Math.ceil(p/h);for(const a of n){const t=a.tile,n=new Float64Array(l*l);for(const s of u){const i=s.getTileReader(t);if(!i)continue;const u=i.getCursor();for(;u.next();){let t=1;if(null!=e.field){const s=u.readAttribute(e.field);t=r?-1*+s:+s+o}const s=u.readXForDisplay()/h,i=u.readYForDisplay()/h,a=Math.floor(s),p=Math.floor(i);if(a<0||p<0||a>=l||p>=l)continue;const g=((.5+a-s)*h)**2+((.5+p-i)*h)**2;if(g>d)continue;const _=t*(c*(1-g/d)**2);n[p+a*l]+=_}}for(let e=0;e<n.length;e++)s=Math.min(s,n[e]),i=Math.max(i,n[e])}return{max:i,min:s}}async getSampleFeatures(e){const t=this._source.chunks();if(t.reduce((e,t)=>e+t.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const e=[];return this._source.store.forEachUnsafe(t=>e.push(t.readLegacyFeatureWorldSpace())),e}return null}const s=new Set,i=[],r=t.map(e=>e.reader.getCursor()),o=new n,u=3*e.sampleSize;for(let n=0;n<u&&i.length<e.sampleSize;n++){const e=r[o.getIntRange(0,t.length-1)];if(0===e.getSize())continue;const n=o.getIntRange(0,e.getSize()-1);e.setIndex(n);const u=e.getObjectId();s.has(u)||(s.add(u),i.push(e.readLegacyFeatureWorldSpace()))}return i.length>=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,s(()=>this._scheduleNextUpdate()))}_requestRefresh(){this._didSourceRefresh=!0,this._requestUpdate()}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=d(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;has("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const s=new f(this._tileInfoView,t),i=new _(s,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(has("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const e=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const t of e)this._doUpdateSubscriptions(t.inner),t.resolver.resolve()}if(this._updateHighlightRequests.length){const e=this._updateHighlightRequests,t=new Set,s=new Set;for(const i of e)for(const{objectId:e,highlightFlags:r}of i.inner.highlights)r?(t.add(e),s.delete(e)):(s.add(e),t.delete(e));this._source.prepareCacheUpdate(t,s)}const e=this._updateSchemaRequest;this._updateSchemaRequest=null;let t=!1;if(null!=e){const{schema:s,version:i}=e.inner;t=await this._doUpdateSchema(s,i)}this._processor.requiresInvalidation()&&(t=!0),this._didSourceRefresh&&(t=!0,this._didSourceRefresh=!1),t&&(this._processor.invalidate(),await this._connection.container.updateRenderState(this._processor.version));const s=this._updateOverridesRequest;if(this._updateOverridesRequest=null,null!=s){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverride",s.inner),null!=s.inner.historicMoment&&this._source.unsafeSetQueryHistoricMoment(s.inner.historicMoment);const e=await this._source.normalizeOverrides(s.inner);await this._source.applyOverride(e),has("esri-2d-update-debug")&&console.debug("Pipeline.endOverride",s.inner)}if(await this._source.applyCacheUpdate(),this._updateHighlightRequests.length){const e=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const t of e)this._processor.updateHighlight(t.inner),t.resolver.resolve()}const i=this._source.cleanup();this._processor.removeChunks(i);try{const e=this._source.takeOverrideUpdate();if(null!=e&&this._subscriptions.size){has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesStart"),await this._connection.container.lockForOverrides();try{await this._processor.applyOverrideUpdate(e)}catch(o){has("esri-2d-update-debug")&&console.debug("InternalError",o)}await this._connection.container.unlockForOverrides(),has("esri-2d-update-debug")&&console.debug("Pipeline.applyOverrideChangesEnd")}this._subscriptions.size&&(has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),has("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(o){r(o)}null!=s&&s.resolver.resolve(),null!=e&&e.resolver.resolve(),null==e&&t&&await this._connection.container.trySwapRenderState(),this._connection.onEvent({type:"performance",usedMemory:this.getUsedMemory()}),this._updateRequested?(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:!0})):(has("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({source:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const s={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e.source,t),r=Array.from(this._subscriptions.values()),o=this._processor.update(e,t,s,i,r);return has("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`),o}_doUpdateSubscriptions(e){has("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{y 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 has from"../../../../../core/has.js";import{AProcessorStrategy as e,ASendState as t}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as o}from"../sources/strategies/chunks/Overrides.js";import{createArcadeEvaluationOptions as a}from"../support/arcadeUtils.js";import{FeatureSetReaderJSON as n}from"../support/FeatureSetReaderJSON.js";class d extends t{}class i extends e{constructor(e,t,s,r){super(e,t,r),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(e){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=e,null!=this._evalOptions&&(this._evalOptions=a(this._evalOptions.$view.scale,e))}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(e){return new d(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const r=new Map(e.map(e=>[t(e),e])),o=[];for(const a of this._source.chunks()){const e=a.reader.getCursor();for(;e.next();){const t=e.getObjectId(),a=e.getDisplayId(),n=r.get(t);if(null!=n){const e=s(a,n,t);o.push(e),r.delete(t)}}}return o}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const o of this._source.chunks()){const e=o.reader.getCursor();for(;e.next();){const o=e.getObjectId(),a=e.getDisplayId();t.has(a)&&!s.has(o)&&(r.push({...e.readLegacyFeatureWorldSpace(),displayId:a}),s.add(o))}}return{features:r,aggregates:[],tracks:[]}}async*applyOverrideUpdate(e){const t=[];for(const s of e.modified){const e=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=e,t.push(e)}const r=n.fromOptimizedFeatures(e.modified,this._source.metadata).getCursor();for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,this._evalOptions,this._sqlOptions);const a=[];for(const s of e.removed){const e=this._attributeStore.getDisplayIdForObjectId(s);null!=e&&a.push(e)}has("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:e,modifiedDisplayIds:t,removedDisplayIds:a});const d=o.fromFeatures(e.modified,this._source.metadata);this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const o of this._sendStates.values())o.handledChunks.add(d.chunkId),yield new s(o.subscription,null,t,!1,d.queryInfo);for(const o of this._sendStates.values()){const e=d.getTileReader(o.subscription.tile);yield new s(o.subscription,e,a,!1,d.queryInfo)}for(const s of e.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}_updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(this._attributeStore.referencesScale()||!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions,this._sqlOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const o of this._source.chunks()){const{chunkId:a}=o;if(s.has(a)||!this.handledChunksForIdCreation.has(a)||!this.handledChunksForAttributeData.has(a))continue;s.add(a);const n=o.getTileReader(t.tile);n&&(yield new r(e.subscription,n,!1,o.end,o.queryInfo))}}}export{d as DefaultSendState,i as FeatureUpdateStrategy};
5
+ import has from"../../../../../core/has.js";import{AProcessorStrategy as e,ASendState as t}from"./AProcessorStrategy.js";import{FeatureTileUpdateMessage as s,FeatureTileAppendMessage as r}from"../sources/FeatureSourceMessage.js";import{OverrideChunk as a}from"../sources/strategies/chunks/Overrides.js";import{createArcadeEvaluationOptions as o}from"../support/arcadeUtils.js";import{FeatureSetReaderJSON as n}from"../support/FeatureSetReaderJSON.js";class d extends t{}class i extends e{constructor(e,t,s,r){super(e,t,r),this._arcadeContextInfo=s,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const e of this._source.chunks())this._cleanupChunkIds(e)}invalidateAttributeData(e){this.handledChunksForAttributeData.clear(),this._arcadeContextInfo=e,null!=this._evalOptions&&(this._evalOptions=o(this._evalOptions.$view.scale,e))}onSubscribe(e){super.onSubscribe(e),this._evalOptions=e.tile.createArcadeEvaluationOptions(this._arcadeContextInfo)}createState(e){return new d(e)}get aggregateQueryEngine(){return null}displayMap(e,t,s){const r=new Map(e.map(e=>[t(e),e])),a=[];for(const o of this._source.chunks()){const e=o.reader.getCursor();for(;e.next();){const t=e.getObjectId(),o=e.getDisplayId(),n=r.get(t);if(null!=n){const e=s(o,n,t);a.push(e),r.delete(t)}}}return a}getDisplayFeatures(e){const t=new Set(e),s=new Set,r=[];for(const a of this._source.chunks()){const e=a.reader.getCursor();for(;e.next();){const a=e.getObjectId(),o=e.getDisplayId();t.has(o)&&!s.has(a)&&(r.push({...e.readLegacyFeatureWorldSpace(),displayId:o}),s.add(a))}}return{features:r,aggregates:[],tracks:[]}}async*applyOverrideUpdate(e){const t=[];for(const s of e.modified.values()){const e=this._attributeStore.createDisplayIdForObjectId(s.objectId);s.displayId=e,t.push(e)}const r=n.fromOptimizedFeatures(Array.from(e.modified.values()),this._source.metadata).getCursor();for(;r.next();)this._attributeStore.setAttributeData(r.getDisplayId(),r,this._evalOptions,this._sqlOptions);const o=[];for(const s of e.removed){const e=this._attributeStore.getDisplayIdForObjectId(s);null!=e&&o.push(e)}has("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:e,modifiedDisplayIds:t,removedDisplayIds:o});const d=a.fromFeatures(Array.from(e.modified.values()),this._source.metadata);this.handledChunks.add(d.chunkId),this.handledChunksForAttributeData.add(d.chunkId),this.handledChunksForIdCreation.add(d.chunkId);for(const a of this._sendStates.values())a.handledChunks.add(d.chunkId),yield new s(a.subscription,null,t,!1,d.queryInfo);for(const a of this._sendStates.values()){const e=d.getTileReader(a.subscription.tile);yield new s(a.subscription,e,o,!1,d.queryInfo)}for(const s of e.removed)this._attributeStore.releaseDisplayIdForObjectId(s)}async*updateChunks(){if(this._source.chunks().length){this._updateAttributeData();for(const e of this._sendStates.values())yield*this._update(e)}}removeChunks(e){for(const t of e)this.handledChunks.delete(t.chunkId),this.handledChunksForAttributeData.delete(t.chunkId),this._cleanupChunkIds(t)}afterUpdateChunks(){for(const e of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(e);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(e){if(this.handledChunksForIdCreation.has(e.chunkId)){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(e):this._attributeStore.releaseDisplayIdForObjectId(e)}this.handledChunksForIdCreation.delete(e.chunkId)}}_updateAttributeData(){for(const e of this._source.chunks()){const{chunkId:t,reader:s}=e;if(!this.handledChunksForIdCreation.has(t)){this.handledChunksForIdCreation.add(t);const e=s.getCursor();for(;e.next();){const t=this._attributeStore.createDisplayIdForObjectId(e.getObjectId());e.setDisplayId(t)}}}for(const e of this._source.chunks())if(this._attributeStore.referencesScale()||!this.handledChunksForAttributeData.has(e.chunkId)){this.handledChunksForAttributeData.add(e.chunkId);const t=e.reader.getCursor();for(;t.next();){const e=t.getDisplayId();this._attributeStore.setAttributeData(e,t,this._evalOptions,this._sqlOptions)}}}*_update(e){const{subscription:t,handledChunks:s}=e;for(const a of this._source.chunks()){const{chunkId:o}=a;if(s.has(o)||!this.handledChunksForIdCreation.has(o)||!this.handledChunksForAttributeData.has(o))continue;s.add(o);const n=a.getTileReader(t.tile);n&&(yield new r(e.subscription,n,!1,a.end,a.queryInfo))}}}export{d as DefaultSendState,i as FeatureUpdateStrategy};
@@ -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{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{load as r,execute as i,isLoaded as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new g,o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new g;return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,i,o,n){const l=new R({spatialReference:e}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||a()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),r()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,s,i,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map(t=>t.chunkId));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new M(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=z.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new z(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=C.fromSpatialReference(e);if(null!=r){const t=i(s,1e6,r,o.geodesic);if(null!=t){const e=C.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
5
+ import{isSome as t}from"../../../../../core/arrayUtils.js";import e from"../../../../../core/Logger.js";import{assertIsSome as s}from"../../../../../core/maybe.js";import{isLoaded as r,load as i,execute as a}from"../../../../../geometry/operators/gx/operatorGeodeticDensify.js";import{geodeticCurveType as o}from"../../../../../geometry/operators/support/geodeticCurveType.js";import{intersectsWithMargin as n,fromValues as l,intersects as c,empty as d,expandPointInPlace as u}from"../../../../../geometry/support/aaBoundingRect.js";import{getClosestDenormalizedXToReference as h}from"../../../../../geometry/support/normalizeUtils.js";import{normalizeCentralMeridianForDisplay as p}from"../../../../../geometry/support/normalizeUtilsSync.js";import{quantizeOptimizedGeometry as m,convertToGeometry as f,convertFromPolyline as _}from"../../../../../layers/graphics/featureConversionUtils.js";import{OptimizedFeature as b}from"../../../../../layers/graphics/OptimizedFeature.js";import g from"../../../../../layers/graphics/OptimizedGeometry.js";import{internalTrackPartField as y,externalTrackLineOidPrefix as I,internalTimeReceivedField as v}from"../../../../../layers/support/streamLayerUtils.js";import{tileSize as k}from"../../../engine/webgl/definitions.js";import{AccumulatedStatistics as F}from"../aggregation/AccumulatedStatistics.js";import{ComputedAggregateField as O}from"../aggregation/ComputedAggregateField.js";import{AAggregateStrategy as j}from"./AAggregateStrategy.js";import{ASendState as x}from"./AProcessorStrategy.js";import{FeatureTileAppendMessage as S}from"../sources/FeatureSourceMessage.js";import{createArcadeEvaluationOptions as T}from"../support/arcadeUtils.js";import{ComputedAttributeStorage as R}from"../support/ComputedAttributeStorage.js";import D from"../support/FeatureFilterEvaluator.js";import{FeatureMetadata as w}from"../support/FeatureMetadata.js";import{FeatureSetReaderIndirect as L}from"../support/FeatureSetReaderIndirect.js";import{FeatureSetReaderJSON as A}from"../support/FeatureSetReaderJSON.js";let C;const G=()=>e.getLogger("esri.views.2d.layers.features.processor.TrackStrategy"),P=32;class W{constructor(t,e,s,r,i){this.chunkIndex=t,this.featureIndex=e,this.objectId=s,this.displayId=r,this.time=i}}class z{static getOid(t){return I+t}constructor(t,e,s,r,i,a,o,n){this._schema=t,this.trackId=e,this.objectId=s,this.displayId=r,this._fields=i,this._spatialReference=a,this._metadata=o,this._isStream=n,this._maxDisplayDuration=this._schema.maxDisplayDuration>0?this._schema.maxDisplayDuration:1/0,this._maxDisplayObservationsPerTrack=this._schema.maxDisplayObservationsPerTrack>=1?this._schema.maxDisplayObservationsPerTrack:1/0,this._observationRecords=[],this._nextObservationRecords=[],this._trackLinePath=[],this._bounds=[],this._trackLineGeometry=new g}get _trackLineAttributes(){const t={...this._latestObservationFeature?.attributes,aggregateId:this.objectId,[y]:0};if(null!=this._statistics)for(const e of this._statistics.values())t[e.field.name]=e.value;return t}get _startTimeField(){return this._metadata.timeInfo?.startTimeField}get length(){return this._observationRecords.length}*observations(){yield*this._observationRecords}*previousObservations(){for(let t=0;t<this._observationRecords.length-1;t++)yield this._observationRecords[t]}get latestObservationFeature(){return this._latestObservationFeature}get latestObservationRecord(){return this._latestObservationRecord}stageObservation(t,e){this._nextObservationRecords.push(new W(t,e.getIndex(),e.getObjectId(),e.getDisplayId(),null!=this._startTimeField?e.readAttributeAsTimestamp(this._startTimeField):null))}commitObservations(t,e,r){const i=new Set(this._nextObservationRecords.map(t=>t.objectId)),a=this._observationRecords.filter(t=>!i.has(t.objectId)).map(t=>t.objectId);let o,n;switch(this._observationRecords=[],this._trackLinePath=[],this._isStream||null==this._startTimeField||this._nextObservationRecords.sort((t,e)=>{const s=t.time,r=e.time;return null!=s&&null!=r?s-r:0}),this._schema.timeField){case"startTimeField":o=this._metadata.timeInfo?.startTimeField;break;case"endTimeField":o=this._metadata.timeInfo?.endTimeField;break;case"timeReceived":o=this._isStream?v:null}n=this._isStream?r?.end??Date.now():r?.end??-1/0;const l=e.map(t=>t.reader.getCursor());let c;for(let d=this._nextObservationRecords.length-1;d>=0&&!(this._observationRecords.length>=this._maxDisplayObservationsPerTrack);d--){const t=this._nextObservationRecords[d],e=l[t.chunkIndex];s(e),e.setIndex(t.featureIndex);const r=null!=o?e.readAttributeAsTimestamp(o):null;(null!=r?n-r:0)>=this._maxDisplayDuration||(this._commitObservation(t,e),c??=t)}if(null!=c){const{chunkIndex:e,featureIndex:r}=c,i=`${c.objectId}.latest`,o=t.createDisplayIdForObjectId(i),n=l[e];s(n),n.setIndex(r);const d=new b(n.readGeometryWorldSpace(),{...n.readAttributes(),[y]:1},null,i,o);this._latestObservationFeature&&a.push(this._latestObservationFeature.objectId),this._latestObservationFeature=d,this._latestObservationRecord=c}else this._latestObservationFeature=null;return this._trackLineGeometry=q(this._trackLinePath,this._spatialReference),this._bounds=N(this._trackLineGeometry),this._nextObservationRecords=[],a}updateStatistics(t,e){this._statistics=F.create(this._fields);const r=t.map(t=>t.reader.getCursor());for(const{chunkIndex:i,featureIndex:a}of this._observationRecords){const t=r[i];s(t),t.setIndex(a),this._statistics.insert(t,e)}}overlapsTile(t){for(const e of this._bounds)if(n(e,t.bounds,P))return!0;return!1}getLatestObservationFeatureForTile(t){if(null==this._latestObservationFeature)return null;const{objectId:e,displayId:s,geometry:r,attributes:i}=this._latestObservationFeature,a=m(r,this._metadata.geometryType,t.subscription.tile.transform)??new g,o=l(1/0,1/0,-1/0,-1/0);E(a,(t,e)=>u(o,[t,e]));if(!c(o,l(0,0,k,k)))return null;return new b(a,i,null,e,s)}getTrackLineFeatureForTile(t){const e=m(this._trackLineGeometry,"esriGeometryPolyline",t.subscription.tile.transform)??new g;return new b(e,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineOptimizedFeature(){return new b(this._trackLineGeometry,this._trackLineAttributes,null,this.objectId,this.displayId)}getTrackLineDisplayFeature(){const{_trackLineGeometry:t,_trackLineAttributes:e,displayId:s}=this;return{geometry:f(t,"esriGeometryPolyline",!1,!1),attributes:e,displayId:s}}_commitObservation(t,e){const s=e.readCentroidWorldSpace();let r=s?.coords[0],i=s?.coords[1];null==s&&(r=e.readXWorldSpace(),i=e.readYWorldSpace()),null!=r&&null!=i&&(this._observationRecords.unshift(t),this._trackLinePath.unshift([r,i]))}}class M extends x{constructor(t){super(t),this.done=!1}}class U extends j{static async create(t,e,s,a,o,n){const l=new R({spatialReference:e}),c=await Promise.all(t.fields.map(async t=>O.create(l,t))),d=t.featureFilter?await D.create({geometryType:s.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:s.metadata.timeInfo,fieldsIndex:s.metadata.fieldsIndex,spatialReference:e,filterJSON:t.featureFilter}):null;return e.isWrappable||r()||await Promise.all([import("../../../../../geometry/operators/support/apiConverter.js"),import("../../../../../geometry/operators/support/jsonConverter.js"),i()]).then(([t,e,s])=>{C={fromGeometryToGXGeometry:e.fromGeometryToGXGeometry,toGeometry:e.toGeometry,fromSpatialReference:t.fromSpatialReference}}),new U(t,s,a,e,c,d,o,n)}constructor(t,e,s,r,i,a,o,n){super(e,s,r,i,n),this._schema=t,this._featureFilter=a,this._arcadeContextInfo=o,this._tracks=new Map,this._handledChunks=new Set,this._metadata=e.metadata.weakCloneWithAdditionalFields([{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"}]),this._trackLineMetadata=w.createFeature({geometryType:"esriGeometryPolyline",featureIdInfo:{type:"object-id",fieldName:"aggregateId"},fieldsIndex:{fields:[...this._source.metadata.fieldsIndex.fields,...this.aggregateFields,{name:y,alias:"trackPart",type:"esriFieldTypeSmallInteger"},{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}],timeZoneByFieldName:null},globalIdField:null,spatialReference:e.metadata.spatialReference,outSpatialReference:e.metadata.outSpatialReference,subtypeField:null,subtypes:null,timeInfo:e.metadata.timeInfo,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null,types:null})}destroy(){super.destroy();for(const t of this._tracks.values())this._removeTrack(t);this._tracks.clear()}get _isStream(){return this._source.isStream}get enablePixelBuffering(){return!0}get isAggregate(){return!1}requiresInvalidation(){const t=new Set(this._source.chunks().map(t=>t.chunkId));for(const e of t)if(!this._handledChunks.has(e))return!0;for(const e of this._handledChunks)if(!t.has(e))return!0;return!1}invalidate(){this._handledChunks.clear(),super.invalidate()}createState(t){return new M(t)}async*applyOverrideUpdate(t){G().error("Applying override to tracks is not supported")}displayMap(t,e,s){const r=new Map(t.map(t=>[e(t),t])),i=[];for(const a of this._tracks.values()){const t=r.get(a.objectId);if(null!=t){const e=s(a.displayId,t,a.objectId);i.push(e),r.delete(a.objectId);continue}const e=a.latestObservationFeature;if(e?.objectId){const t=r.get(e.objectId);if(null!=t){const a=s(e.displayId,t,e.objectId);i.push(a),r.delete(e.objectId);continue}}for(const o of a.observations()){const t=r.get(o.objectId);if(null!=t){const e=s(o.displayId,t,o.objectId);i.push(e),r.delete(o.objectId)}}}return i}getDisplayFeatures(t){const e=new Set(t),s=[],r=[],i=this._source.chunks().map(t=>t.reader.getCursor());for(const a of this._tracks.values()){if(e.has(a.displayId)&&r.push(a.getTrackLineDisplayFeature()),null!=a.latestObservationFeature&&e.has(a.latestObservationFeature.displayId)){const{displayId:t,chunkIndex:e,featureIndex:r}=a.latestObservationRecord,o=i[e];o.setIndex(r),s.push({displayId:t,...o.readLegacyFeatureWorldSpace()})}for(const{displayId:t,chunkIndex:r,featureIndex:o}of a.observations())if(e.has(t)){const e=i[r];e.setIndex(o),s.push({displayId:t,...e.readLegacyFeatureWorldSpace()})}}return{features:s,aggregates:[],tracks:r}}getFeatureObjectIdsForAggregate(t){for(const e of this._tracks.values())if(e.objectId===t)return Array.from(e.observations(),t=>t.objectId);return[]}async*updateChunks(){0===this._handledChunks.size&&this._rebuildTracks();for(const t of this._sendStates.values())yield*this._update(t)}forEachAggregateWorldSpace(t){for(const e of this._tracks.values())t(e.getTrackLineOptimizedFeature())}_rebuildTracks(){const t=this._source.chunks();if(!t.length)return;const e=this._metadata.timeInfo?.trackIdField;if(null==e)return;const s=new Set;for(let r=0;r<t.length;r++){const i=t[r];this._handledChunks.add(i.chunkId);const a=i.reader.getCursor();for(;a.next();){const t=a.readAttribute(e),i=a.getObjectId();if(null!=t&&null!=i&&(null===this._featureFilter||this._featureFilter.check(a,this._sqlOptions))){if(a.getDisplayId()||a.setDisplayId(this._attributeStore.createDisplayIdForObjectId(i)),!this._tracks.has(t)){const e=z.getOid(t),s=this._attributeStore.createDisplayIdForObjectId(e),r=new z(this._schema,t,e,s,this.aggregateFields,this.spatialReference,this._source.metadata,this._isStream);this._tracks.set(t,r)}this._tracks.get(t).stageObservation(r,a),s.add(t)}}}for(const r of this._tracks.values())if(s.has(r.trackId)){const e=r.commitObservations(this._attributeStore,t,this._featureFilter?.timeExtent);for(const t of e)this._attributeStore.releaseDisplayIdForObjectId(t);r.updateStatistics(t,T(1,this._arcadeContextInfo))}else this._removeTrack(r)}_removeTrack(t){this._tracks.delete(t.trackId),this._attributeStore.releaseDisplayIdForObjectId(t.objectId);for(const{objectId:e}of t.observations())this._attributeStore.releaseDisplayIdForObjectId(e);null!=t.latestObservationFeature&&this._attributeStore.releaseDisplayIdForObjectId(t.latestObservationFeature.objectId)}*_update(e){if(e.done)return;e.done=!this._source.updateTracking.updating;const s=[],r=[];for(const t of this._tracks.values())if(t.length>0){if(this._schema.showLatestObservation){const r=t.getLatestObservationFeatureForTile(e);null!=r&&s.push(r)}this._schema.showTrackLine&&t.overlapsTile(e.subscription.tile)&&r.push(t.getTrackLineFeatureForTile(e))}const i=A.fromOptimizedFeatures(s,this._metadata,e.subscription.tile.transform),a=A.fromOptimizedFeatures(r,this._trackLineMetadata,e.subscription.tile.transform);let o=[];if(this._schema.showPreviousObservations){const s=this._source.chunks().map(()=>[]);for(const t of this._tracks.values())for(const{chunkIndex:e,featureIndex:r}of t.previousObservations())s[e].push(r);o=this._source.chunks().map((t,r)=>{const i=t.getTileReader(e.subscription.tile);if(null==i)return null;const a=L.from(i,s[r]);return a.setProcessorAttributes({[y]:2}),"esriGeometryPoint"!==a.geometryType&&null!=a.getInTransform()||a.setTransformForDisplay(e.subscription.tile.transform),a}).filter(t)}this.events.emit("changed");const n=e.subscription.tile.createArcadeEvaluationOptions(this._arcadeContextInfo),l=a.getCursor();for(;l.next();)this._attributeStore.setAttributeData(l.getDisplayId(),l,n,this._sqlOptions);for(const t of o){const e=t.getCursor();for(;e.next();)this._attributeStore.setAttributeData(e.getDisplayId(),e,n,this._sqlOptions)}const c=i.getCursor();for(;c.next();)this._attributeStore.setAttributeData(c.getDisplayId(),c,n,this._sqlOptions);yield new S(e.subscription,a,!1,!1,{});for(const t of o)yield new S(e.subscription,t,!1,!1,{});yield new S(e.subscription,i,!1,e.done,{})}}function q(t,e){if(t.length<2)return _({paths:[t]},!1,!1);if(e.isWrappable){let s=!1;for(let r=1;r<t.length;r++){const i=t[r][0],a=h(i,t[r-1][0],e);i!==a&&(t[r][0]=a,s=!0)}if(s){const s=p({paths:[t],spatialReference:e});if(null!=s)return _({paths:s.paths},!1,!1)}return _({paths:[t]},!1,!1)}const s=C.fromGeometryToGXGeometry({hasM:!1,hasZ:!1,paths:[t]}),r=C.fromSpatialReference(e);if(null!=r){const t=a(s,1e6,r,o.geodesic);if(null!=t){const e=C.toGeometry(t,r);if(null!=e&&"paths"in e)return _({paths:e.paths},!1,!1)}}return _({paths:[t]},!1,!1)}function E(t,e){const s=2,{coords:r,lengths:i}=t;if(!i.length)return void e(r[0],r[1]);let a=0;for(let o=0;o<i.length;o++){const t=i[o];let n=0,l=0;for(let i=0;i<t;i++)n+=r[s*(i+a)],l+=r[s*(i+a)+1],e(n,l);a+=t}}function N(t){const{lengths:e,coords:s}=t,r=2;if(!e.length)return[d()];const i=[];let a=0;for(let o=0;o<e.length;o++){const t=e[o],n=d();i.push(n);for(let e=0;e<t;e++){const t=s[r*(e+a)],i=s[r*(e+a)+1];u(n,[t,i])}a+=t}return i}export{U as TrackStrategy};
@@ -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{handlesGroup as t}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{throwIfAborted as e,onAbort as s}from"../../../../../../core/promiseUtils.js";import{AFeatureTileLoadStrategy as o}from"./AFeatureTileLoadStrategy.js";import{DrillDownTileSourceChunk as r}from"./chunks/DrillDownTileSourceChunk.js";import{FeatureSetReaderJSON as i}from"../../support/FeatureSetReaderJSON.js";class l{constructor(e,o){this.subscription=e,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=t([s(e.signal,()=>this._controller.abort()),s(o,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(t){return this._tileIdToResult.get(t)}set(t,e){this._tileIdToResult.set(t,e)}get options(){return{signal:this._controller.signal}}}class a extends o{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const t of this._loadStates.values())t.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(t){this._loadStates.has(t.key.id)||this._loadStates.set(t.key.id,new l(t,this._options));const s=this._loadStates.get(t.key.id);let o;try{for await(const o of this._fetchChunkInfos(s,t.tile,0)){const{queryJSON:t,reader:i,sourceTile:l,sourceTileDepth:a,tile:n}=o,h=new r(i,t,n,l,a,!1);e(s.options),this._addChunk(h)}}catch(n){o=n}const a=new r(i.empty(this.metadata),null,t.tile,null,-1,!0);if(this._addChunk(a),o)throw o}unload(t){super.unload(t),this._loadStates.get(t.key.id)?.destroy(),this._loadStates.delete(t.key.id)}async*_fetchChunkInfos(t,e,s){let o=t.get(e.id);const r=!!o;if(o||(o=await this._fetchChunkInfo(t,e,s),t.set(e.id,o)),o.reader.exceededTransferLimit&&s<has("featurelayer-query-max-depth"))for(const i of e.createChildTiles())yield*this._fetchChunkInfos(t,i,s+1);else r||(yield o)}async _fetchChunkInfo(t,e,s){const o=t.subscription.tile.getQuantizationParameters(),r=this._queryInfo.createTileQuery(e,{returnExceededLimitFeatures:!1,quantizationParameters:o});return{reader:await this._fetch(r,t.options,{chunkId:e.id}),queryJSON:r.inner.toJSON(),tile:t.subscription.tile,sourceTile:e,sourceTileDepth:s}}}export{a as FeatureDrillDownTileLoadStrategy};
5
+ import{handlesGroup as t}from"../../../../../../core/handleUtils.js";import has from"../../../../../../core/has.js";import{throwIfAborted as e,onAbort as s}from"../../../../../../core/promiseUtils.js";import{AFeatureTileLoadStrategy as o}from"./AFeatureTileLoadStrategy.js";import{DrillDownTileSourceChunk as r}from"./chunks/DrillDownTileSourceChunk.js";import{FeatureSetReaderJSON as i}from"../../support/FeatureSetReaderJSON.js";const a=has("featurelayer-query-max-depth");class l{constructor(e,o){this.subscription=e,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=t([s(e.signal,()=>this._controller.abort()),s(o,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(t){return this._tileIdToResult.get(t)}set(t,e){this._tileIdToResult.set(t,e)}get options(){return{signal:this._controller.signal}}}class n extends o{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const t of this._loadStates.values())t.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(t){this._loadStates.has(t.key.id)||this._loadStates.set(t.key.id,new l(t,this._options));const s=this._loadStates.get(t.key.id);let o;try{for await(const o of this._fetchChunkInfos(s,t.tile,0)){const{queryJSON:t,reader:i,sourceTile:a,sourceTileDepth:l,tile:n}=o,h=new r(i,t,n,a,l,!1);e(s.options),this._addChunk(h)}}catch(n){o=n}e(s.options);const a=new r(i.empty(this.metadata),null,t.tile,null,-1,!0);if(this._addChunk(a),o)throw o}unload(t){super.unload(t),this._loadStates.get(t.key.id)?.destroy(),this._loadStates.delete(t.key.id)}async*_fetchChunkInfos(t,e,s){let o=t.get(e.id);const r=!!o;if(o||(o=await this._fetchChunkInfo(t,e,s),t.set(e.id,o)),o.reader.exceededTransferLimit&&s<has("featurelayer-query-max-depth"))for(const i of e.createChildTiles())yield*this._fetchChunkInfos(t,i,s+1);else r||(yield o)}async _fetchChunkInfo(t,e,s){const o=t.subscription.tile.getQuantizationParameters(),r=this._queryInfo.createTileQuery(e,{returnExceededLimitFeatures:s===a,quantizationParameters:o});return{reader:await this._fetch(r,t.options,{chunkId:e.id}),queryJSON:r.inner.toJSON(),tile:t.subscription.tile,sourceTile:e,sourceTileDepth:s}}}export{n as FeatureDrillDownTileLoadStrategy};
@@ -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{parseWhereClause as e}from"../../../../../../../core/sql.js";import{ASourceChunk as t}from"./ASourceChunk.js";import{FeatureSetReaderJSON as s}from"../../../support/FeatureSetReaderJSON.js";const r=1e4,i=1e3;class n{static async create(t){const{metadata:s,definitionExpression:r}=t,i=r?await e(r,s.fieldsIndex):null;return new n(s,i,r)}constructor(e,t,s){this.metadata=e,this._clause=t,this._definitionExpression=s}get hash(){return this._definitionExpression}testFeature(e){return null==this._clause||this._clause.testFeature(e)}}class a{constructor(){this.modified=[],this.removed=[]}modify(e){this.modified.push(e)}remove(e){this.removed.push(e)}get isEmpty(){return 0===this.modified.length&&0===this.removed.length}applyWhereClause(e){const t=new a;for(const s of this.modified)e.testFeature(s)?t.modified.push(s):t.removed.push(s.objectId);for(const s of this.removed)t.removed.push(s);return t}}class o extends t{constructor(e){super(),this._reader=e,this.chunkId="override",this.normalizedChunkId="override"}static fromFeatures(e,t){const r=s.fromOptimizedFeatures(e,t);return new o(r)}get reader(){return this._reader}get queryInfo(){return{}}get first(){return!1}get end(){return!1}get isTiled(){return!1}getTileReader(e){if(!this._reader.getSize())return null;const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class d{constructor(e,t){this.inner=e,this.isWeak=t,this.lastWeak=null}get isStrong(){return!this.isWeak}}class h{constructor(e){this._parameters=e,this._overrides=new Map,this._update=new a,this._lastCleanup=0}update(e){this._parameters=e}hasOverride(e){return this._overrides.has(e)}onChunkInsert(e){if(this._overrides.size){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId(),s=this._overrides.get(e);if(s?.lastWeak&&(s.lastWeak=null),s?.isWeak){const e=t.readOptimizedFeatureWorldSpace();s.inner=e,this._update.modify(e),this.invalidate()}}}e.registerOverrides(this)}apply(e,t){const{updateWeak:s,removeWeak:r,update:i,remove:n,release:a}=e.commands;this.invalidate();for(const o of s){const e=new d(o,!0),t=this._overrides.get(o.objectId);t?.isStrong?t.lastWeak=e:(this._overrides.set(o.objectId,e),this._update.modify(o))}for(const o of i){const e=new d(o,!1),t=this._overrides.get(o.objectId);e.lastWeak=t?.isWeak?t:t?.lastWeak??null,this._overrides.set(o.objectId,e),this._update.modify(o)}for(const o of r){const e=new d(null,!0),t=this._overrides.get(o);t?.isStrong?t.lastWeak=e:(this._overrides.set(o,e),this._update.remove(o))}for(const o of n){const e=new d(null,!1),t=this._overrides.get(o);e.lastWeak=t?.isWeak?t:t?.lastWeak??null,this._overrides.set(o,e),this._update.remove(o)}if(a.length){const e=new Set;for(const t of a){const s=this._overrides.get(t);s?.lastWeak?(this._overrides.set(t,s.lastWeak),null==s.lastWeak.inner?this._update.remove(t):this._update.modify(s.lastWeak.inner)):s&&!s.isWeak&&(this._overrides.delete(t),e.add(t))}t.forEachUnsafe(t=>{const s=t.getObjectId();e.has(s)&&(this._update.modify(t.readOptimizedFeatureWorldSpace()),e.delete(s))});for(const t of e.values())this._update.remove(t)}}clearWeakOverrides(){for(const[e,t]of this._overrides.entries())t.isWeak&&this._overrides.delete(e);this.invalidate()}cleanup(e){if(this._overrides.size<r)return;const t=performance.now();if(t-this._lastCleanup<i)return;this._lastCleanup=t;const s=this._getWeakDeletions();if(!(s.size<r)){for(const t of e){const e=t.reader.withoutOverrides().getCursor();for(;e.next();){const t=e.getObjectId();s.delete(t)}}for(const e of s)this._overrides.delete(e);s.size&&this.invalidate()}}takeOverrideUpdate(){const e=this._update;return e.isEmpty?null:(this._update=new a,e.applyWhereClause(this._parameters))}asChunk(){const e=this._parameters;if(this._lastOverrideParametersHash!==e.hash&&(this._lastOverrideParametersHash=e.hash,this._chunk=null),!this._chunk){const t=[];for(const s of this._overrides.values())null!=s.inner&&e.testFeature(s.inner)&&t.push(s.inner);this._chunk=o.fromFeatures(t,e.metadata)}return this._chunk}invalidate(){this._chunk=null}putWeakObjectIdsFromGlobalIds(e,t,s){for(const[r,i]of this._overrides.entries()){if(i.isWeak&&null!=i.inner){const n=i.inner.attributes[s];n&&t.has(n)&&!e.has(n)&&e.set(n,r);continue}if(null!=i.lastWeak&&null!=i.lastWeak.inner){const n=i.lastWeak.inner.attributes[s];n&&t.has(n)&&!e.has(n)&&e.set(n,r)}}}_getWeakDeletions(){const e=new Set;for(const[t,s]of this._overrides.entries())s.isWeak&&null==s.inner&&e.add(t);return e}}export{o as OverrideChunk,n as OverrideParameters,h as OverrideState,a as OverrideUpdate};
5
+ import{parseWhereClause as e}from"../../../../../../../core/sql.js";import{ASourceChunk as t}from"./ASourceChunk.js";import{FeatureSetReaderJSON as s}from"../../../support/FeatureSetReaderJSON.js";const r=1e4,i=1e3;class o{static async create(t){const{metadata:s,definitionExpression:r}=t,i=r?await e(r,s.fieldsIndex):null;return new o(s,i,r)}constructor(e,t,s){this.metadata=e,this._clause=t,this._definitionExpression=s}get hash(){return this._definitionExpression}testFeature(e){return null==this._clause||this._clause.testFeature(e)}}class a{constructor(){this.modified=new Map,this.removed=new Set}modify(e){this.modified.set(e.objectId,e),this.removed.has(e.objectId)&&this.removed.delete(e.objectId)}remove(e){this.modified.delete(e),this.removed.add(e)}get isEmpty(){return 0===this.modified.size&&0===this.removed.size}applyWhereClause(e){const t=new a;for(const[s,r]of this.modified)e.testFeature(r)?t.modified.set(s,r):t.removed.add(r.objectId);for(const s of this.removed)t.removed.add(s);return t}}class n extends t{constructor(e){super(),this._reader=e,this.chunkId="override",this.normalizedChunkId="override"}static fromFeatures(e,t){const r=s.fromOptimizedFeatures(e,t);return new n(r)}get reader(){return this._reader}get queryInfo(){return{}}get first(){return!1}get end(){return!1}get isTiled(){return!1}getTileReader(e){if(!this._reader.getSize())return null;const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class d{constructor(e,t){this.inner=e,this.isWeak=t,this.lastWeak=null}get isStrong(){return!this.isWeak}}class h{constructor(e){this._parameters=e,this._overrides=new Map,this._update=new a,this._lastCleanup=0}update(e){this._parameters=e}hasOverride(e){return this._overrides.has(e)}onChunkInsert(e){if(this._overrides.size){const t=e.reader.getCursor();for(;t.next();){const e=t.getObjectId(),s=this._overrides.get(e);if(s?.lastWeak&&(s.lastWeak=null),s?.isWeak){const e=t.readOptimizedFeatureWorldSpace();s.inner=e,this._update.modify(e),this.invalidate()}}}e.registerOverrides(this)}apply(e,t){const{updateWeak:s,removeWeak:r,update:i,remove:o,release:a}=e.commands;this.invalidate();for(const n of s){const e=new d(n,!0),t=this._overrides.get(n.objectId);t?.isStrong?t.lastWeak=e:(this._overrides.set(n.objectId,e),this._update.modify(n))}for(const n of i){const e=new d(n,!1),t=this._overrides.get(n.objectId);e.lastWeak=t?.isWeak?t:t?.lastWeak??null,this._overrides.set(n.objectId,e),this._update.modify(n)}for(const n of r){const e=new d(null,!0),t=this._overrides.get(n);t?.isStrong?t.lastWeak=e:(this._overrides.set(n,e),this._update.remove(n))}for(const n of o){const e=new d(null,!1),t=this._overrides.get(n);e.lastWeak=t?.isWeak?t:t?.lastWeak??null,this._overrides.set(n,e),this._update.remove(n)}if(a.length){const e=new Set;for(const t of a){const s=this._overrides.get(t);s?.lastWeak?(this._overrides.set(t,s.lastWeak),null==s.lastWeak.inner?this._update.remove(t):this._update.modify(s.lastWeak.inner)):s&&!s.isWeak&&(this._overrides.delete(t),e.add(t))}t.forEachUnsafe(t=>{const s=t.getObjectId();e.has(s)&&(this._update.modify(t.readOptimizedFeatureWorldSpace()),e.delete(s))});for(const t of e.values())this._update.remove(t)}}clearWeakOverrides(){for(const[e,t]of this._overrides.entries())t.isWeak&&this._overrides.delete(e);this.invalidate()}cleanup(e){if(this._overrides.size<r)return;const t=performance.now();if(t-this._lastCleanup<i)return;this._lastCleanup=t;const s=this._getWeakDeletions();if(!(s.size<r)){for(const t of e){const e=t.reader.withoutOverrides().getCursor();for(;e.next();){const t=e.getObjectId();s.delete(t)}}for(const e of s)this._overrides.delete(e);s.size&&this.invalidate()}}takeOverrideUpdate(){const e=this._update;return e.isEmpty?null:(this._update=new a,e.applyWhereClause(this._parameters))}asChunk(){const e=this._parameters;if(this._lastOverrideParametersHash!==e.hash&&(this._lastOverrideParametersHash=e.hash,this._chunk=null),!this._chunk){const t=[];for(const s of this._overrides.values())null!=s.inner&&e.testFeature(s.inner)&&t.push(s.inner);this._chunk=n.fromFeatures(t,e.metadata)}return this._chunk}invalidate(){this._chunk=null}putWeakObjectIdsFromGlobalIds(e,t,s){for(const[r,i]of this._overrides.entries()){if(i.isWeak&&null!=i.inner){const o=i.inner.attributes[s];o&&t.has(o)&&!e.has(o)&&e.set(o,r);continue}if(null!=i.lastWeak&&null!=i.lastWeak.inner){const o=i.lastWeak.inner.attributes[s];o&&t.has(o)&&!e.has(o)&&e.set(o,r)}}}_getWeakDeletions(){const e=new Set;for(const[t,s]of this._overrides.entries())s.isWeak&&null==s.inner&&e.add(t);return e}}export{n as OverrideChunk,o as OverrideParameters,h as OverrideState,a as OverrideUpdate};
@@ -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"../../../core/has.js";import{abortMaybe as t,destroyMaybe as s}from"../../../core/maybe.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as o}from"./AnalysisView3D.js";import{AreaMeasurementController as n}from"./AreaMeasurement/support/AreaMeasurementController.js";import{AreaMeasurement3DPathHelper as l}from"./AreaMeasurement/support/AreaMeasurementPathHelper.js";import{AreaMeasurementVisualization as u}from"./AreaMeasurement/support/AreaMeasurementVisualization.js";import{toPreferredLengthUnit as p,toPreferredAreaUnit as m}from"./AreaMeasurement/support/utils.js";import y from"../interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js";import{connectAnalysisViewToTool as d,removeAnalysisViewTool as h,startPlaceOperation as c}from"../../analysis/analysisViewUtils.js";import{loadGeodesicAreaMeasurementUtils as g}from"../../support/geodesicAreaMeasurementUtils.js";import{loadGeodesicLengthMeasurementUtils as v}from"../../support/geodesicLengthMeasurementUtils.js";let M=class extends o{constructor(e){super(e),this.type="area-measurement-view-3d",this.analysis=null,this.measurementData=null,this.lastDraggedVertex=null,this.stagedPoint=null,this.mode=0,this.tool=null,this.userOperation=null}initialize(){const{analysis:e,view:t}=this;this.path=new l({view:t,areaMeasurement:e}),this._analysisVisualization=new u({view:t,analysis:e,analysisViewData:this}),this.addResolvingPromise(Promise.all([g(),v()]).then(([s,r])=>{this.destroyed||(this._analysisController=new n({view:t,analysis:e,analysisViewData:this,geodesicAreaMeasurementUtils:s,geodesicLengthMeasurementUtils:r}))})),this.addHandles(d(this,y))}destroy(){h(this),this.userOperation=t(this.userOperation),this._analysisController=s(this._analysisController),this._analysisVisualization=s(this._analysisVisualization),this.path.destroy()}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return!!this._analysisVisualization?.loadingMessages}get result(){const{measurementData:e}=this;if(null==e)return{area:null,mode:null,perimeter:null};const{unit:t}=this;if("euclidean"===e.actualMeasurementMode){const{area:s,perimeterLength:r}=e;return{area:null!=s?m(s,t):null,perimeter:null!=r?p(r,t):null,mode:"euclidean"}}const{geodesicArea:s,pathLength:r}=e;return{area:null!=s?m(s,t):null,perimeter:null!=r?p(r,t):null,mode:"geodesic"}}get viewData(){return this._analysisVisualization.viewData}get areaLabel(){return this._analysisVisualization.areaLabel}get perimeterLengthLabel(){return this._analysisVisualization.perimeterLengthLabel}get validMeasurement(){return this.path.isValidPolygon}get unit(){return this.analysis.unit??a(this.view)}get testData(){}place(e){return c(this,{placementOptions:e})}};e([r()],M.prototype,"_analysisVisualization",void 0),e([r()],M.prototype,"_analysisController",void 0),e([r({readOnly:!0})],M.prototype,"type",void 0),e([r({constructOnly:!0,nonNullable:!0})],M.prototype,"analysis",void 0),e([r()],M.prototype,"updating",null),e([r()],M.prototype,"result",null),e([r()],M.prototype,"measurementData",void 0),e([r()],M.prototype,"viewData",null),e([r()],M.prototype,"areaLabel",null),e([r()],M.prototype,"perimeterLengthLabel",null),e([r()],M.prototype,"validMeasurement",null),e([r()],M.prototype,"path",void 0),e([r()],M.prototype,"lastDraggedVertex",void 0),e([r()],M.prototype,"stagedPoint",void 0),e([r()],M.prototype,"mode",void 0),e([r()],M.prototype,"unit",null),e([r()],M.prototype,"tool",void 0),e([r()],M.prototype,"userOperation",void 0),M=e([i("esri.views.3d.analysis.AreaMeasurementAnalysisView3D")],M);const w=M;export{w as default};
5
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import{abortMaybe as t,destroyMaybe as s}from"../../../core/maybe.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as a}from"../../../support/getDefaultUnitForView.js";import{AnalysisView3D as o}from"./AnalysisView3D.js";import{AreaMeasurementController as n}from"./AreaMeasurement/support/AreaMeasurementController.js";import{AreaMeasurement3DPathHelper as l}from"./AreaMeasurement/support/AreaMeasurementPathHelper.js";import{AreaMeasurementVisualization as p}from"./AreaMeasurement/support/AreaMeasurementVisualization.js";import{toPreferredLengthUnit as u,toPreferredAreaUnit as m}from"./AreaMeasurement/support/utils.js";import y from"../interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js";import{connectAnalysisViewToTool as d,removeAnalysisViewTool as h,startPlaceOperation as c}from"../../analysis/analysisViewUtils.js";import{loadGeodesicAreaMeasurementUtils as g}from"../../support/geodesicAreaMeasurementUtils.js";import{loadGeodesicLengthMeasurementUtils as v}from"../../support/geodesicLengthMeasurementUtils.js";let M=class extends o{constructor(e){super(e),this.type="area-measurement-view-3d",this.analysis=null,this.measurementData=null,this.lastDraggedVertex=null,this.stagedPoint=null,this.mode=0,this.tool=null,this.userOperation=null}initialize(){const{analysis:e,view:t}=this;this.path=new l({view:t,areaMeasurement:e}),this._analysisVisualization=new p({view:t,analysis:e,analysisViewData:this}),this.addResolvingPromise(Promise.all([g(),v()]).then(([s,r])=>{this.destroyed||(this._analysisController=new n({view:t,analysis:e,analysisViewData:this,geodesicAreaMeasurementUtils:s,geodesicLengthMeasurementUtils:r}))})),this.addHandles(d(this,y))}destroy(){h(this),this.userOperation=t(this.userOperation),this._analysisController=s(this._analysisController),this._analysisVisualization=s(this._analysisVisualization),this.path.destroy()}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get updating(){return!!this._analysisVisualization?.loadingMessages}get result(){const{measurementData:e}=this;if(!e)return{area:null,mode:null,perimeter:null};const{unit:t}=this;if("euclidean"===e.actualMeasurementMode){const{area:s,perimeterLength:r}=e;return{area:s?m(s,t):null,perimeter:r?u(r,t):null,mode:"euclidean"}}const{geodesicArea:s,pathLength:r}=e;return{area:s?m(s,t):null,perimeter:r?u(r,t):null,mode:"geodesic"}}get viewData(){return this._analysisVisualization.viewData}get areaLabel(){return this._analysisVisualization.areaLabel}get perimeterLengthLabel(){return this._analysisVisualization.perimeterLengthLabel}get validMeasurement(){return this.path.isValidPolygon}get unit(){return this.analysis.unit??a(this.view)}get testData(){}place(e){return c(this,{placementOptions:e})}};e([r()],M.prototype,"_analysisVisualization",void 0),e([r()],M.prototype,"_analysisController",void 0),e([r({readOnly:!0})],M.prototype,"type",void 0),e([r({constructOnly:!0,nonNullable:!0})],M.prototype,"analysis",void 0),e([r()],M.prototype,"updating",null),e([r()],M.prototype,"result",null),e([r()],M.prototype,"measurementData",void 0),e([r()],M.prototype,"viewData",null),e([r()],M.prototype,"areaLabel",null),e([r()],M.prototype,"perimeterLengthLabel",null),e([r()],M.prototype,"validMeasurement",null),e([r()],M.prototype,"path",void 0),e([r()],M.prototype,"lastDraggedVertex",void 0),e([r()],M.prototype,"stagedPoint",void 0),e([r()],M.prototype,"mode",void 0),e([r()],M.prototype,"unit",null),e([r()],M.prototype,"tool",void 0),e([r()],M.prototype,"userOperation",void 0),M=e([i("esri.views.3d.analysis.AreaMeasurementAnalysisView3D")],M);const w=M;export{w as default};