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

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 (955) hide show
  1. package/Map.js +1 -1
  2. package/PopupTemplate.js +1 -1
  3. package/analysis/ElevationProfileAnalysis.js +1 -1
  4. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.js +1 -1
  5. package/analysis/VolumeMeasurement/volumeMeasurementConfiguration.js +5 -0
  6. package/analysis/VolumeMeasurementAnalysis.js +1 -1
  7. package/applications/KnowledgeStudio/generalSdkInternalAccess.d.ts +4 -0
  8. package/applications/KnowledgeStudio/generalSdkInternalAccess.js +5 -0
  9. package/applications/KnowledgeStudio/generalSharedKgUtils.d.ts +1 -0
  10. package/applications/KnowledgeStudio/generalSharedKgUtils.js +1 -1
  11. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +2 -0
  12. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  13. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  14. package/arcade/featureset/actions/Adapted.js +1 -1
  15. package/arcade/featureset/actions/AttributeFilter.js +1 -1
  16. package/arcade/featureset/actions/GroupBy.js +1 -1
  17. package/arcade/featureset/actions/OrderBy.js +1 -1
  18. package/arcade/featureset/actions/SpatialFilter.js +1 -1
  19. package/arcade/featureset/actions/Top.js +1 -1
  20. package/arcade/featureset/sources/Empty.js +1 -1
  21. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  22. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  23. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  24. package/arcade/featureset/support/FeatureSet.js +1 -1
  25. package/arcade/featureset/support/sqlUtils.js +1 -1
  26. package/arcade/featureset/support/stats.js +1 -1
  27. package/arcade/functions/featuresetbase.js +1 -1
  28. package/arcade/functions/featuresetstring.js +1 -1
  29. package/arcade/functions/knowledgegraph.js +1 -1
  30. package/assets/components/assets/sort-handle/t9n/messages.uk.json +1 -1
  31. package/assets/esri/core/workers/RemoteClient.js +1 -1
  32. package/assets/esri/core/workers/chunks/{1a713dcc9971e1935401.js → 0030d68d9edf42b4af57.js} +1 -1
  33. package/assets/esri/core/workers/chunks/00c77f03dd511c6dbff2.js +1 -0
  34. package/assets/esri/core/workers/chunks/01d460398f3ba6767a37.js +1 -0
  35. package/assets/esri/core/workers/chunks/0200637e0503556a3b97.js +1 -0
  36. package/assets/esri/core/workers/chunks/022c854eff2c2c2aed6b.js +1 -0
  37. package/assets/esri/core/workers/chunks/{14ace5dc4b8984212a57.js → 042cd64e1f4eb326c30f.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{66db5f77e09d25e33951.js → 063905fbf9a0c6586949.js} +1 -1
  39. package/assets/esri/core/workers/chunks/066a0ea67688361e85a5.js +1 -0
  40. package/assets/esri/core/workers/chunks/06f75c5b6b50934d72a6.js +1 -0
  41. package/assets/esri/core/workers/chunks/{89027f6800e17fab8973.js → 0a5d74414dd02a2fb8e1.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{3815ffa13e7b439bca6e.js → 0d5212f59e9b62c16164.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{388482cea4b9fdeaf06e.js → 0f30a9514571c7be9978.js} +1 -1
  44. package/assets/esri/core/workers/chunks/0f735b0dec173142f3b6.js +2 -0
  45. package/assets/esri/core/workers/chunks/{a8f998b8ec8c56150479.js.LICENSE.txt → 0f735b0dec173142f3b6.js.LICENSE.txt} +1 -1
  46. package/assets/esri/core/workers/chunks/{e032f3d2ee19790f8c79.js → 11e96a312f1294d34c50.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{309c5f69ea06f3081d83.js → 1257c37bf04d39c27b62.js} +1 -1
  48. package/assets/esri/core/workers/chunks/125e71b0e29d1d132777.js +1 -0
  49. package/assets/esri/core/workers/chunks/{1e4e7aedf4b779241a02.js → 15c7c10ff9ac63f0e792.js} +1 -1
  50. package/assets/esri/core/workers/chunks/15f969836d63c7fe2d9d.js +1 -0
  51. package/assets/esri/core/workers/chunks/18c5d79d5ee1136e0a57.js +1 -0
  52. package/assets/esri/core/workers/chunks/{f03635ddf56e2ef90e4c.js → 1d06fcae4c2f02fb1c95.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{651b9144abb1895cc510.js → 1e848d9da1c61a27cf18.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{8cea114168d849c38b1b.js → 20278683bddc8c2d8136.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{d84373a6ec94dcfec8c2.js → 24cd7b84cd0f3de4bff2.js} +1 -1
  56. package/assets/esri/core/workers/chunks/27e6a6c5610007ac6a54.js +1 -0
  57. package/assets/esri/core/workers/chunks/2857bcb68df874e9aa62.js +1 -0
  58. package/assets/esri/core/workers/chunks/{94c9d3094c93f7760433.js → 29286234be26680245f6.js} +1 -1
  59. package/assets/esri/core/workers/chunks/292daac70bb828e4923f.js +1 -0
  60. package/assets/esri/core/workers/chunks/2ddcf3cea0efe4052618.js +1 -0
  61. package/assets/esri/core/workers/chunks/2e8a4df83c43f86d7361.js +1 -0
  62. package/assets/esri/core/workers/chunks/{4f01be74dd26e639330f.js → 2f24017e72d41c259faa.js} +1 -1
  63. package/assets/esri/core/workers/chunks/2f2e4f81f3daa3fb8527.js +1 -0
  64. package/assets/esri/core/workers/chunks/30e220f4f843681a4cdd.js +1 -0
  65. package/assets/esri/core/workers/chunks/3109f0a6914e7be088ed.js +1 -0
  66. package/assets/esri/core/workers/chunks/{5d3661d1fe46dd29aae9.js → 311b564e44ae637c960d.js} +1 -1
  67. package/assets/esri/core/workers/chunks/31bb1ee9370c2753ce9d.js +1 -0
  68. package/assets/esri/core/workers/chunks/329fccd7f5cb8401e0c3.js +1 -0
  69. package/assets/esri/core/workers/chunks/37c1f155da14de91565a.js +1 -0
  70. package/assets/esri/core/workers/chunks/37f2ef14399546e697e6.js +1 -0
  71. package/assets/esri/core/workers/chunks/38ee69125da60464d5a1.js +1 -0
  72. package/assets/esri/core/workers/chunks/38f6b9288c82dac9a800.js +1 -0
  73. package/assets/esri/core/workers/chunks/3a457e718a901a45902e.js.LICENSE.txt +1 -1
  74. package/assets/esri/core/workers/chunks/{f7c99e9c8d19352af38d.js → 3ac7562ea90f91a9f30c.js} +1 -1
  75. package/assets/esri/core/workers/chunks/3b1848713ee25f750242.js +1 -0
  76. package/assets/esri/core/workers/chunks/{e9311386f58f3cb95c22.js → 42a1e71d09e8583a7327.js} +1 -1
  77. package/assets/esri/core/workers/chunks/442973ff4dda923def62.js +1 -0
  78. package/assets/esri/core/workers/chunks/443dfe7029ec208f670c.js +1 -0
  79. package/assets/esri/core/workers/chunks/44f27eac92c5ccc57e12.js +1 -0
  80. package/assets/esri/core/workers/chunks/4941bfd3aae7f6bdac97.js +1 -0
  81. package/assets/esri/core/workers/chunks/{b75930d60449eceb0f1c.js → 4baf6f6e7ddedb25f806.js} +1 -1
  82. package/assets/esri/core/workers/chunks/4bd2cc65f7db0d261543.js +1 -0
  83. package/assets/esri/core/workers/chunks/4fa230dc6e5e87b0dec1.js +1 -0
  84. package/assets/esri/core/workers/chunks/4fb5f1c671892001a4fd.js +1 -0
  85. package/assets/esri/core/workers/chunks/4fbe2a8d742065cbaea3.js +1 -0
  86. package/assets/esri/core/workers/chunks/4fe4feeb251f2916a339.js +1 -0
  87. package/assets/esri/core/workers/chunks/509392131ec473d6b988.js +1 -0
  88. package/assets/esri/core/workers/chunks/{2ea6985da4eb0107bb9d.js → 51ab2acac4ecc1ca9c34.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{fc4417d1260b717a9385.js → 52282f767bd0e99ddca0.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 53654edd766d9b4ef750.js} +1 -1
  91. package/assets/esri/core/workers/chunks/55eb6a0f1e4569a65f2a.js +1 -0
  92. package/assets/esri/core/workers/chunks/57e04e2d8721bbdc029a.js +1 -0
  93. package/assets/esri/core/workers/chunks/{ed8a85efbd90241512bb.js → 588533c3abe876f20f62.js} +1 -1
  94. package/assets/esri/core/workers/chunks/591e459f9fce34f519ca.js +1 -0
  95. package/assets/esri/core/workers/chunks/59514624daf188a8030f.js +1 -0
  96. package/assets/esri/core/workers/chunks/5c09d98b41f71a036e2a.js +1 -0
  97. package/assets/esri/core/workers/chunks/{72846fb9c87c6642daf0.js → 5e2ce34def5e053913b2.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{b7a17927e14f502006b4.js → 5ea0c62016d56990787b.js} +1 -1
  99. package/assets/esri/core/workers/chunks/605b9643b1baeff16149.js +1 -0
  100. package/assets/esri/core/workers/chunks/{2ce4a0fe4fae63c43a81.js → 61d970ed75c2c358b1e9.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{7a6a96edc892d7060b7d.js → 629127877042ad784ad2.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{00aa85ae6419aad183ea.js → 6293e33f304c4952f88c.js} +1 -1
  103. package/assets/esri/core/workers/chunks/664ae441617afe4b17ec.js +1 -0
  104. package/assets/esri/core/workers/chunks/67f03d042455cd0f7009.js +1 -0
  105. package/assets/esri/core/workers/chunks/{ec13053af1999701464a.js → 6826fe54562dcdc054d7.js} +1 -1
  106. package/assets/esri/core/workers/chunks/{8215015f11221a354273.js → 6d049182bec34a22abcd.js} +1 -1
  107. package/assets/esri/core/workers/chunks/6d9f2b113d6bde936a04.js +1 -0
  108. package/assets/esri/core/workers/chunks/{5132ca68e8c7af111a47.js → 6e22b02a9715c10578d0.js} +1 -1
  109. package/assets/esri/core/workers/chunks/6e25ef5ad6d6b3f88343.js +1 -0
  110. package/assets/esri/core/workers/chunks/{deb2854bb7d082a26f52.js → 7005d956c990a04ee8b2.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{c73def15ccfb2a32afa8.js → 7290e7a819eb291b1df2.js} +4 -4
  112. package/assets/esri/core/workers/chunks/731f7b552dde0fb325cd.js +1 -0
  113. package/assets/esri/core/workers/chunks/7565b382f6b3d2cb46a3.js +2 -0
  114. package/assets/esri/core/workers/chunks/{24921d31efa8d222ad2d.js.LICENSE.txt → 7565b382f6b3d2cb46a3.js.LICENSE.txt} +1 -1
  115. package/assets/esri/core/workers/chunks/759321045c264bc6964e.js +1 -0
  116. package/assets/esri/core/workers/chunks/773f2c6c9d38db76dfed.js +1 -0
  117. package/assets/esri/core/workers/chunks/7803495f8862d9025bcd.js +1 -0
  118. package/assets/esri/core/workers/chunks/79dbfa2b9b332ca0002f.js +1 -0
  119. package/assets/esri/core/workers/chunks/7a23ab84e1144f081c92.js +1 -0
  120. package/assets/esri/core/workers/chunks/7e3f27ebf366d4266350.js +1 -0
  121. package/assets/esri/core/workers/chunks/826072cfc0ac8e36f03c.js +1 -0
  122. package/assets/esri/core/workers/chunks/826fa0dfb63df77bfd95.js +1 -0
  123. package/assets/esri/core/workers/chunks/8372f142c4d7a65c7954.js +1 -0
  124. package/assets/esri/core/workers/chunks/87921f3fa9001f5801ed.js +1 -0
  125. package/assets/esri/core/workers/chunks/8ce608013b353155ee5a.js +1 -0
  126. package/assets/esri/core/workers/chunks/{24c14e4a1d2a2267097e.js → 8d9d3797c6d62fdfff9d.js} +1 -1
  127. package/assets/esri/core/workers/chunks/{0086a09441627842d34a.js → 8f3503b2fb6cd38757b9.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{e7638b9ab6674bc8a18f.js → 91dfd29e2dba200eab09.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{de1f75c907152df7e788.js → 9698f36c143953a975d4.js} +1 -1
  130. package/assets/esri/core/workers/chunks/9b0c2f4311fe9bca370a.js +1 -0
  131. package/assets/esri/core/workers/chunks/9c48d8d17831aa57f8a4.js +1 -0
  132. package/assets/esri/core/workers/chunks/9f21436016ff7a899e79.js +1 -0
  133. package/assets/esri/core/workers/chunks/9f28b2800945903bc165.js +1 -0
  134. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js → 9ff8ee6ed6b98c03ae7e.js} +2 -2
  135. package/assets/esri/core/workers/chunks/{67d9cfe02613cb73ee37.js.LICENSE.txt → 9ff8ee6ed6b98c03ae7e.js.LICENSE.txt} +1 -1
  136. package/assets/esri/core/workers/chunks/a091623bbfb3d771c8d8.js +1 -0
  137. package/assets/esri/core/workers/chunks/a27e74117c37f3efcbca.js +1 -0
  138. package/assets/esri/core/workers/chunks/a41ba05c09a59d1eb35f.js +1 -0
  139. package/assets/esri/core/workers/chunks/a470f662d73aa8d5d90f.js +1 -0
  140. package/assets/esri/core/workers/chunks/a93ebd076bc55aa6eab0.js +1 -0
  141. package/assets/esri/core/workers/chunks/aa78b69219d9a0ef1c54.js.LICENSE.txt +1 -1
  142. package/assets/esri/core/workers/chunks/aaed35a6414859233678.js +1 -0
  143. package/assets/esri/core/workers/chunks/acd0564ad1544f452f3f.js +1 -0
  144. package/assets/esri/core/workers/chunks/{135e270b4f03c4270870.js → af47272aaaef0ea57e71.js} +1 -1
  145. package/assets/esri/core/workers/chunks/b0f43191a431c9de16e5.js +1 -0
  146. package/assets/esri/core/workers/chunks/{bc3bcf88b252760e2574.js → b3028b1ff75eafd0c358.js} +1 -1
  147. package/assets/esri/core/workers/chunks/b320bb76c7e9998fe53b.js +1 -0
  148. package/assets/esri/core/workers/chunks/{79968c183135281d2a6f.js → b3613a38178cad2ebc82.js} +1 -1
  149. package/assets/esri/core/workers/chunks/b8a3f1e60e24a13749c1.js +1 -0
  150. package/assets/esri/core/workers/chunks/ba4571d2637a74a59552.js +1 -0
  151. package/assets/esri/core/workers/chunks/bb7976e2f883b544add6.js +1 -0
  152. package/assets/esri/core/workers/chunks/{56916e56c20465428dd4.js → be3b874f86f627f4fa98.js} +1 -1
  153. package/assets/esri/core/workers/chunks/c29486c4eeb3e72effff.js +1 -0
  154. package/assets/esri/core/workers/chunks/{2b94623cabc6ae0f86ce.js → c37f7756d48ff9af2656.js} +1 -1
  155. package/assets/esri/core/workers/chunks/{1c52999a6392370844a6.js → c4090a60d149a5962179.js} +1 -1
  156. package/assets/esri/core/workers/chunks/c61c61dac1e8d6188749.js +1 -0
  157. package/assets/esri/core/workers/chunks/c84caf81bfaa4a8b5aa1.js +1 -0
  158. package/assets/esri/core/workers/chunks/c8c8cf43fd640d2f5cb1.js +1 -0
  159. package/assets/esri/core/workers/chunks/{73c1d43070b4fe1e5c1e.js → c8e686efe344a33a0258.js} +1 -1
  160. package/assets/esri/core/workers/chunks/{6bb5158de43c4b59107f.js → c9b16fd41cd59d452522.js} +1 -1
  161. package/assets/esri/core/workers/chunks/ce16489cf7eb0d78c741.js.LICENSE.txt +1 -1
  162. package/assets/esri/core/workers/chunks/d048e4926e78458afa3e.js +1 -0
  163. package/assets/esri/core/workers/chunks/d07f911d40bf05fc0306.js +1 -0
  164. package/assets/esri/core/workers/chunks/d1ca7c3a32ce00ed8b81.js +1 -0
  165. package/assets/esri/core/workers/chunks/{630efe10c871425b6a95.js → d1e97cce5047f1791e22.js} +1 -1
  166. package/assets/esri/core/workers/chunks/d28670cb11164e318e45.js +1 -0
  167. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js → d391bfbaf0e790cd10d6.js} +2 -2
  168. package/assets/esri/core/workers/chunks/{46ef545d2b3b3f4e6d32.js.LICENSE.txt → d391bfbaf0e790cd10d6.js.LICENSE.txt} +1 -1
  169. package/assets/esri/core/workers/chunks/d56ac52a5288e06365e7.js +1 -0
  170. package/assets/esri/core/workers/chunks/d6e0528eacee7ea4c1ce.js.LICENSE.txt +1 -1
  171. package/assets/esri/core/workers/chunks/{d570c75a425aa29672c8.js → da24ad57747714ac5eda.js} +1 -1
  172. package/assets/esri/core/workers/chunks/{7e43c105f1cfc44b7bd0.js → dc51438b832551924a9e.js} +1 -1
  173. package/assets/esri/core/workers/chunks/dc66490520f97eef15bf.js +316 -0
  174. package/assets/esri/core/workers/chunks/ddca92e18e96ea1c9d89.js +1 -0
  175. package/assets/esri/core/workers/chunks/{cfa3164e7fa1884dc2b9.js → ddfd01bb9ba8577c3ffc.js} +1 -1
  176. package/assets/esri/core/workers/chunks/ded9747ae04ab889d52a.js +1 -0
  177. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  178. package/assets/esri/core/workers/chunks/df8279e1baf378faf85f.js +1 -0
  179. package/assets/esri/core/workers/chunks/dff2df259f140b7d97a9.js +1 -0
  180. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  181. package/assets/esri/core/workers/chunks/e3434f91f47f551d9e02.js +1 -0
  182. package/assets/esri/core/workers/chunks/{da573ecc68e6aa8f6da9.js → e767f83f9e2de6650f80.js} +1 -1
  183. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  184. package/assets/esri/core/workers/chunks/{91df8638b8b904e6d8c5.js → ead8d0cbcebd12dbfad7.js} +1 -1
  185. package/assets/esri/core/workers/chunks/eb6c3dd440ede4adf603.js +1 -0
  186. package/assets/esri/core/workers/chunks/eb9c166db0db6fa60e95.js +1 -0
  187. package/assets/esri/core/workers/chunks/edc671b9b83c8e19cb42.js +1 -0
  188. package/assets/esri/core/workers/chunks/{16d66770ef841564ee3f.js → ee5aa11750c51b220f1e.js} +1 -1
  189. package/assets/esri/core/workers/chunks/ee5f0fd5384caa11c986.js +1 -0
  190. package/assets/esri/core/workers/chunks/f141c9f7f0d9b2322bf6.js +1 -0
  191. package/assets/esri/core/workers/chunks/{5875a51b97ee9bd438a0.js → f34e3fa0c5b28531e289.js} +1 -1
  192. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  193. package/assets/esri/core/workers/chunks/f651c05604eab83aef5f.js.LICENSE.txt +1 -1
  194. package/assets/esri/core/workers/chunks/{fa4411e0a5ac3fcba365.js → f65c0102af17390a50ac.js} +1 -1
  195. package/assets/esri/core/workers/chunks/f6c11c8ac687de3ef1ab.js +1 -0
  196. package/assets/esri/core/workers/chunks/f7a1f48c53422c6e2028.js +1 -0
  197. package/assets/esri/core/workers/chunks/f7f002ea5ff5fe7f6249.js +1 -0
  198. package/assets/esri/core/workers/chunks/f80f5dbf96c343ac4df6.js +1 -0
  199. package/assets/esri/core/workers/chunks/f8e889be4b45f6f0667e.js +1 -0
  200. package/assets/esri/core/workers/chunks/fbd796c88f07bb6755dc.js +1 -0
  201. package/assets/esri/core/workers/chunks/fbd8d2f61f8a15bcf3db.js +1 -0
  202. package/assets/esri/core/workers/chunks/fccd931f95d81ecc57b2.js +1 -0
  203. package/assets/esri/core/workers/chunks/{2f78861afe0e9037dd8d.js → fe49321dca22dc60d105.js} +1 -1
  204. package/assets/esri/core/workers/chunks/fec3897ed7e8691387ed.js +1 -0
  205. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  206. package/assets/esri/themes/base/widgets/_Directions.scss +17 -18
  207. package/assets/esri/themes/base/widgets/_NavigationToggle.scss +1 -1
  208. package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +4 -4
  209. package/assets/esri/themes/base/widgets/_UtilityNetworkTrace.scss +14 -4
  210. package/assets/esri/themes/base/widgets/_Widget.scss +1 -1
  211. package/assets/esri/themes/dark/main.css +1 -1
  212. package/assets/esri/themes/light/main.css +1 -1
  213. package/assets/esri/themes/light/view.css +1 -1
  214. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ar.json +1 -1
  215. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bg.json +1 -1
  216. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_bs.json +1 -1
  217. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ca.json +1 -1
  218. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_cs.json +1 -1
  219. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_da.json +1 -1
  220. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_de.json +1 -1
  221. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_el.json +1 -1
  222. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_es.json +1 -1
  223. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_et.json +1 -1
  224. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fi.json +1 -1
  225. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_fr.json +1 -1
  226. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_he.json +1 -1
  227. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hr.json +1 -1
  228. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_hu.json +1 -1
  229. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_id.json +1 -1
  230. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_it.json +1 -1
  231. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ja.json +1 -1
  232. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ko.json +1 -1
  233. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lt.json +1 -1
  234. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_lv.json +1 -1
  235. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_nl.json +1 -1
  236. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_no.json +1 -1
  237. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pl.json +1 -1
  238. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-BR.json +1 -1
  239. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_pt-PT.json +1 -1
  240. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ro.json +1 -1
  241. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_ru.json +1 -1
  242. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sk.json +1 -1
  243. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sl.json +1 -1
  244. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sr.json +1 -1
  245. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_sv.json +1 -1
  246. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_th.json +1 -1
  247. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_tr.json +1 -1
  248. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_uk.json +1 -1
  249. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_vi.json +1 -1
  250. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-CN.json +1 -1
  251. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-HK.json +1 -1
  252. package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/VolumeMeasurementAnalysis_zh-TW.json +1 -1
  253. package/assets/esri/widgets/Editor/t9n/Editor_ar.json +1 -1
  254. package/assets/esri/widgets/Editor/t9n/Editor_bg.json +1 -1
  255. package/assets/esri/widgets/Editor/t9n/Editor_bs.json +1 -1
  256. package/assets/esri/widgets/Editor/t9n/Editor_ca.json +1 -1
  257. package/assets/esri/widgets/Editor/t9n/Editor_cs.json +1 -1
  258. package/assets/esri/widgets/Editor/t9n/Editor_da.json +1 -1
  259. package/assets/esri/widgets/Editor/t9n/Editor_de.json +1 -1
  260. package/assets/esri/widgets/Editor/t9n/Editor_el.json +1 -1
  261. package/assets/esri/widgets/Editor/t9n/Editor_es.json +1 -1
  262. package/assets/esri/widgets/Editor/t9n/Editor_et.json +1 -1
  263. package/assets/esri/widgets/Editor/t9n/Editor_fi.json +1 -1
  264. package/assets/esri/widgets/Editor/t9n/Editor_fr.json +1 -1
  265. package/assets/esri/widgets/Editor/t9n/Editor_he.json +1 -1
  266. package/assets/esri/widgets/Editor/t9n/Editor_hr.json +1 -1
  267. package/assets/esri/widgets/Editor/t9n/Editor_hu.json +1 -1
  268. package/assets/esri/widgets/Editor/t9n/Editor_id.json +1 -1
  269. package/assets/esri/widgets/Editor/t9n/Editor_it.json +1 -1
  270. package/assets/esri/widgets/Editor/t9n/Editor_ja.json +1 -1
  271. package/assets/esri/widgets/Editor/t9n/Editor_ko.json +1 -1
  272. package/assets/esri/widgets/Editor/t9n/Editor_lt.json +1 -1
  273. package/assets/esri/widgets/Editor/t9n/Editor_lv.json +1 -1
  274. package/assets/esri/widgets/Editor/t9n/Editor_nl.json +1 -1
  275. package/assets/esri/widgets/Editor/t9n/Editor_no.json +1 -1
  276. package/assets/esri/widgets/Editor/t9n/Editor_pl.json +1 -1
  277. package/assets/esri/widgets/Editor/t9n/Editor_pt-BR.json +1 -1
  278. package/assets/esri/widgets/Editor/t9n/Editor_pt-PT.json +1 -1
  279. package/assets/esri/widgets/Editor/t9n/Editor_ro.json +1 -1
  280. package/assets/esri/widgets/Editor/t9n/Editor_ru.json +1 -1
  281. package/assets/esri/widgets/Editor/t9n/Editor_sk.json +1 -1
  282. package/assets/esri/widgets/Editor/t9n/Editor_sl.json +1 -1
  283. package/assets/esri/widgets/Editor/t9n/Editor_sr.json +1 -1
  284. package/assets/esri/widgets/Editor/t9n/Editor_sv.json +1 -1
  285. package/assets/esri/widgets/Editor/t9n/Editor_th.json +1 -1
  286. package/assets/esri/widgets/Editor/t9n/Editor_tr.json +1 -1
  287. package/assets/esri/widgets/Editor/t9n/Editor_uk.json +1 -1
  288. package/assets/esri/widgets/Editor/t9n/Editor_vi.json +1 -1
  289. package/assets/esri/widgets/Editor/t9n/Editor_zh-CN.json +1 -1
  290. package/assets/esri/widgets/Editor/t9n/Editor_zh-HK.json +1 -1
  291. package/assets/esri/widgets/Editor/t9n/Editor_zh-TW.json +1 -1
  292. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
  293. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
  294. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
  295. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
  296. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
  297. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
  298. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
  299. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
  300. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
  301. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
  302. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
  303. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
  304. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
  305. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
  306. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
  307. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
  308. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
  309. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
  310. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
  311. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
  312. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
  313. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
  314. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
  315. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
  316. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
  317. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
  318. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
  319. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
  320. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
  321. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
  322. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
  323. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
  324. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
  325. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
  326. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
  327. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
  328. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
  329. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
  330. package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
  331. package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
  332. package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
  333. package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
  334. package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
  335. package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
  336. package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
  337. package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
  338. package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
  339. package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
  340. package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
  341. package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
  342. package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
  343. package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
  344. package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
  345. package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
  346. package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
  347. package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
  348. package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
  349. package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
  350. package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
  351. package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
  352. package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
  353. package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
  354. package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
  355. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
  356. package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
  357. package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
  358. package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
  359. package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
  360. package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
  361. package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
  362. package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
  363. package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
  364. package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
  365. package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
  366. package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
  367. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
  368. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
  369. package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
  370. package/chunks/ComponentShader.glsl.js +72 -39
  371. package/chunks/Envelope.js +1 -1
  372. package/chunks/Geometry.js +1 -1
  373. package/chunks/MultiPathImpl.js +1 -1
  374. package/chunks/OITBlend.glsl.js +3 -3
  375. package/chunks/Point2D.js +1 -1
  376. package/chunks/UnitFactory.js +1 -1
  377. package/chunks/bundle.js +1 -1
  378. package/chunks/containsOperator.js +1 -1
  379. package/chunks/densifyOperator.js +1 -1
  380. package/chunks/differenceOperator.js +1 -1
  381. package/chunks/intersectsOperator.js +1 -1
  382. package/chunks/persistableUrlUtils.js +1 -1
  383. package/config.js +1 -1
  384. package/core/Identifiable.js +1 -1
  385. package/core/MultiOriginJSONSupport.js +1 -1
  386. package/core/NumericIdentifiable.js +5 -0
  387. package/core/QueueProcessor.js +1 -1
  388. package/core/SetUtils.js +1 -1
  389. package/core/WriteableMultiOriginJSONMixin.js +5 -0
  390. package/core/dedupeResult.js +5 -0
  391. package/core/has.js +1 -1
  392. package/core/libs/gl-matrix-2/math/quat.js +1 -1
  393. package/{views/3d/support/ImageWithType.js → core/performance.js} +1 -1
  394. package/core/sanitizerUtils.js +1 -1
  395. package/core/scheduling.js +1 -1
  396. package/core/unitUtils.js +1 -1
  397. package/core/workers/Connection.js +1 -1
  398. package/core/workers/WorkerHandle.js +1 -1
  399. package/core/workers/utils.js +1 -1
  400. package/editing/sharedTemplates/executor/support/createFeatureServiceEdit.js +1 -1
  401. package/form/FormTemplate.js +1 -1
  402. package/form/elements/Element.js +1 -1
  403. package/form/elements/FieldElement.js +1 -1
  404. package/form/elements/GroupElement.js +1 -1
  405. package/geohash/GeohashCell.js +1 -1
  406. package/geohash/geohashUtils.js +1 -1
  407. package/geometry/Extent.js +1 -1
  408. package/geometry/Geometry.js +1 -1
  409. package/geometry/GeometryCursor.js +1 -1
  410. package/geometry/Point.js +1 -1
  411. package/geometry/SpatialReference.js +1 -1
  412. package/geometry/ellipsoidUtils.js +1 -1
  413. package/geometry/geometryCursorCollectUtils.js +1 -1
  414. package/geometry/libtess.js +1 -1
  415. package/geometry/operators/gx/operatorOffset.js +1 -1
  416. package/geometry/operators/support/jsonConverter.js +1 -1
  417. package/geometry/support/MeshTransform.js +1 -1
  418. package/geometry/support/axisAngleDegrees.js +1 -1
  419. package/geometry/support/jsonUtils.js +1 -1
  420. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  421. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  422. package/geometry/support/meshUtils/rotate.js +1 -1
  423. package/geometry/support/meshUtils/scale.js +1 -1
  424. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  425. package/geometry/support/normalizeUtilsSync.js +1 -1
  426. package/geometry/support/plane.js +1 -1
  427. package/geometry/support/polygonUtils.js +1 -1
  428. package/geometry/support/triangulationUtils.js +1 -1
  429. package/identity/Credential.js +1 -1
  430. package/identity/IdentityManager.js +1 -1
  431. package/identity/IdentityManagerBase.js +1 -1
  432. package/interfaces.d.ts +2067 -458
  433. package/intl/date.js +1 -1
  434. package/intl.d.ts +2 -0
  435. package/intl.js +1 -1
  436. package/kernel.js +1 -1
  437. package/layers/FeatureLayer.js +1 -1
  438. package/layers/KnowledgeGraphLayer.js +1 -1
  439. package/layers/Layer.js +1 -1
  440. package/layers/LinkChartLayer.js +1 -1
  441. package/layers/MapNotesLayer.js +1 -1
  442. package/layers/OrientedImageryLayer.js +1 -1
  443. package/layers/SceneLayer.js +1 -1
  444. package/layers/graphics/OptimizedFeature.js +1 -1
  445. package/layers/graphics/OptimizedGeometry.js +1 -1
  446. package/layers/graphics/centroid.js +1 -1
  447. package/layers/graphics/contains.js +1 -1
  448. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  449. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  450. package/layers/graphics/data/AttributesBuilder.js +1 -1
  451. package/layers/graphics/data/FeatureStore.js +1 -1
  452. package/layers/graphics/data/QueryEngine.js +1 -1
  453. package/layers/graphics/data/QueryEngineResult.js +1 -1
  454. package/layers/graphics/data/geometryUtils.js +1 -1
  455. package/layers/graphics/data/spatialQuerySupport.js +1 -1
  456. package/layers/graphics/featureConversionUtils.js +1 -1
  457. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  458. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  459. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  460. package/layers/graphics/sources/geojson/geojson.js +1 -1
  461. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  462. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  463. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  464. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  465. package/layers/knowledgeGraph/layerUtils.js +1 -1
  466. package/layers/mixins/ArcGISImageService.js +1 -1
  467. package/layers/mixins/ImageryTileMixin.js +1 -1
  468. package/layers/ogc/ogcFeatureUtils.js +1 -1
  469. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  470. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  471. package/layers/save/groupLayerUtils.js +1 -1
  472. package/layers/support/DateTimeFieldFormat.js +1 -1
  473. package/layers/support/FieldFormat.js +1 -1
  474. package/layers/support/MediaElementBase.js +1 -1
  475. package/layers/support/NumberFieldFormat.js +1 -1
  476. package/layers/support/PixelBlock.js +1 -1
  477. package/layers/support/RasterInfo.js +1 -1
  478. package/layers/support/RasterJobHandler.js +1 -1
  479. package/layers/support/RasterSensorInfo.js +1 -1
  480. package/layers/support/RasterStorageInfo.js +1 -1
  481. package/layers/support/RasterWorker.js +1 -1
  482. package/layers/support/Sublayer.js +1 -1
  483. package/layers/support/TitleCreator.js +1 -1
  484. package/layers/support/arcgisLayerUrl.js +1 -1
  485. package/layers/support/capabilities.js +1 -1
  486. package/layers/support/fieldConfigUtils.js +1 -1
  487. package/layers/support/fieldUtils.js +1 -1
  488. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  489. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  490. package/layers/support/rasterFieldUtils.js +1 -1
  491. package/layers/support/rasterFunctions/pixelTransformUtils.js +5 -0
  492. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  493. package/layers/support/serviceCapabilitiesUtils.js +1 -1
  494. package/layers/support/source/DataLayerSource.js +1 -1
  495. package/networks/CircuitManager.d.ts +4 -0
  496. package/networks/UnitIdentifierManager.d.ts +4 -0
  497. package/networks/support/Circuit.d.ts +4 -0
  498. package/networks/support/CircuitLocation.d.ts +4 -0
  499. package/networks/support/CircuitPath.d.ts +4 -0
  500. package/networks/support/CircuitPathConnectivityElement.d.ts +4 -0
  501. package/networks/support/CircuitSection.d.ts +4 -0
  502. package/networks/support/Subcircuit.d.ts +4 -0
  503. package/package.json +5 -5
  504. package/popup/ExpressionInfo.js +1 -1
  505. package/popup/FieldInfo.js +1 -1
  506. package/popup/content/AttachmentsContent.js +1 -1
  507. package/popup/content/BarChartMediaInfo.js +1 -1
  508. package/popup/content/ColumnChartMediaInfo.js +1 -1
  509. package/popup/content/Content.js +1 -1
  510. package/popup/content/CustomContent.js +1 -1
  511. package/popup/content/ExpressionContent.js +1 -1
  512. package/popup/content/FieldsContent.js +1 -1
  513. package/popup/content/ImageMediaInfo.js +1 -1
  514. package/popup/content/LineChartMediaInfo.js +1 -1
  515. package/popup/content/MediaContent.js +1 -1
  516. package/popup/content/PieChartMediaInfo.js +1 -1
  517. package/popup/content/RelationshipContent.js +1 -1
  518. package/popup/content/TextContent.js +1 -1
  519. package/popup/content/UtilityNetworkAssociationsContent.js +1 -1
  520. package/popup/content/mixins/ChartMediaInfo.js +1 -1
  521. package/popup/content/mixins/MediaInfo.js +1 -1
  522. package/popup/content.js +1 -1
  523. package/popup/support/FieldInfoFormat.js +1 -1
  524. package/processRequest.js +5 -0
  525. package/request.js +1 -1
  526. package/requestConfig.js +5 -0
  527. package/requestQueue.js +5 -0
  528. package/rest/geometryService/utils.js +1 -1
  529. package/rest/networks/circuits/support/CircuitTraceResult.d.ts +4 -0
  530. package/rest/networks/circuits/support/CircuitVerifyResult.d.ts +4 -0
  531. package/rest/networks/support/TelecomNetworkElement.d.ts +4 -0
  532. package/rest/networks/unitIdentifiers/support/UnitQueryResult.d.ts +4 -0
  533. package/rest/print.js +1 -1
  534. package/rest/query/executeForCount.js +1 -1
  535. package/rest/query/executeForExtent.js +1 -1
  536. package/rest/query/executeForIds.js +1 -1
  537. package/rest/query/executeQueryJSON.js +1 -1
  538. package/rest/query/executeQueryPBF.js +1 -1
  539. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  540. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  541. package/rest/query/operations/query.js +1 -1
  542. package/rest/query/operations/queryZScale.js +1 -1
  543. package/rest/support/BaseImageMeasureResultValue.js +5 -0
  544. package/rest/support/ImageAreaResult.js +1 -1
  545. package/rest/support/ImageDistanceResult.js +1 -1
  546. package/rest/support/ImageHeightResult.js +1 -1
  547. package/rest/support/ImageMeasureResultAngleValue.js +5 -0
  548. package/rest/support/ImageMeasureResultAreaValue.js +5 -0
  549. package/rest/support/ImageMeasureResultLengthValue.js +5 -0
  550. package/rest/support/ImageWithType.js +5 -0
  551. package/rest/support/imageMeasureUtils.js +1 -1
  552. package/rest/versionManagement/getVersionInfos.js +1 -1
  553. package/smartMapping/renderers/size.js +1 -1
  554. package/smartMapping/statistics/histogram.js +1 -1
  555. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  556. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  557. package/smartMapping/support/adapters/support/histogramUtils.js +1 -1
  558. package/smartMapping/support/adapters/support/utils.js +1 -1
  559. package/smartMapping/support/utils.js +1 -1
  560. package/support/basemapDefinitions.js +1 -1
  561. package/support/elevationInfoUtils.js +1 -1
  562. package/support/requestImageUtils.js +1 -1
  563. package/support/revision.js +1 -1
  564. package/symbols/cim/effects/EffectTaperedPolygon.js +1 -1
  565. package/symbols/support/utils.js +1 -1
  566. package/time/TimeExtent.js +1 -1
  567. package/undoredo/support/Services.js +1 -1
  568. package/views/2d/GoToManager.js +1 -1
  569. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
  570. package/views/2d/constraints/GeometryConstraint.js +1 -1
  571. package/views/2d/constraints/RotationConstraint.js +1 -1
  572. package/views/2d/constraints/ZoomConstraint.js +1 -1
  573. package/views/2d/engine/Bitmap.js +1 -1
  574. package/views/2d/engine/vectorTiles/decluttering/SymbolFader.js +1 -1
  575. package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +1 -1
  576. package/views/2d/engine/webgl/Mesh2D.js +1 -1
  577. package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +1 -1
  578. package/views/2d/engine/webgl/mesh/templates/templateUtils.js +1 -1
  579. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  580. package/views/2d/engine/webgl/shaderGraph/techniques/fill/AFillMeshWriter.js +1 -1
  581. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  582. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  583. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  584. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  585. package/views/2d/layers/features/aggregation/GridCell.js +1 -1
  586. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  587. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  588. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  589. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  590. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  591. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  592. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  593. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  594. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  595. package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
  596. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  597. package/views/2d/layers/features/schema/ExceedsLimitCache.js +5 -0
  598. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  599. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  600. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  601. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  602. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  603. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  604. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  605. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  606. package/views/2d/layers/features/sources/strategies/constants.js +5 -0
  607. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  608. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  609. package/views/2d/layers/features/support/FeatureFilterEvaluator.js +1 -1
  610. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  611. package/views/2d/layers/features/support/FeatureSetReaderIndirect.js +1 -1
  612. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  613. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  614. package/views/2d/layers/features/support/GraphicsReader.js +1 -1
  615. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  616. package/views/3d/FocusAreasView.js +1 -1
  617. package/views/3d/GroundView3D.js +1 -1
  618. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  619. package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
  620. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillComputation.js +1 -1
  621. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  622. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillVisualization.js +1 -1
  623. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +5 -0
  624. package/views/3d/environment/CloudsRenderer.js +1 -1
  625. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  626. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  627. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  628. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  629. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  630. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  631. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  632. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  633. package/views/3d/layers/FlowSubView3D.js +1 -1
  634. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  635. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  636. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  637. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  638. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  639. package/views/3d/layers/graphics/Graphics3DFeatureStore.js +1 -1
  640. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  641. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  642. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  643. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  644. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  645. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  646. package/views/3d/layers/graphics/Labeler.js +1 -1
  647. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  648. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  649. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  650. package/views/3d/layers/graphics/pipeline/featureSet/PBFPointFeatureSetView.js +1 -1
  651. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  652. package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
  653. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  654. package/views/3d/layers/i3s/I3SDataRequester.js +5 -0
  655. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  656. package/views/3d/layers/i3s/I3SNode.js +1 -1
  657. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  658. package/views/3d/layers/i3s/I3SOverrides.js +1 -1
  659. package/views/3d/layers/i3s/I3SQueryFeatureAdapter.js +1 -1
  660. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  661. package/views/3d/layers/support/FeatureTile.js +1 -1
  662. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  663. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  664. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  665. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  666. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  667. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +5 -0
  668. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  669. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  670. package/views/3d/layers/support/fetchTile.js +1 -1
  671. package/views/3d/layers/support/lyr3dTypeConversions.js +1 -1
  672. package/views/3d/state/ViewStateManager.js +1 -1
  673. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  674. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  675. package/views/3d/state/controllers/RotateController.js +1 -1
  676. package/views/3d/state/controllers/ZoomControllerGlobal.js +1 -1
  677. package/views/3d/state/controllers/ZoomControllerLocal.js +1 -1
  678. package/views/3d/state/controllers/ZoomStepControllerGlobal.js +1 -1
  679. package/views/3d/state/controllers/ZoomStepControllerLocal.js +1 -1
  680. package/views/3d/state/utils/navigationUtils.js +1 -1
  681. package/views/3d/support/DisplayQualityProfile.js +1 -1
  682. package/views/3d/support/QualitySettings.js +1 -1
  683. package/views/3d/support/ResourceController.js +1 -1
  684. package/views/3d/support/SharedSymbolResources.js +1 -1
  685. package/views/3d/support/StreamTextureCollection.js +1 -1
  686. package/views/3d/support/engineContent/line.js +1 -1
  687. package/views/3d/support/flow/FlowSubViewExtent3D.js +1 -1
  688. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  689. package/views/3d/support/flow/FlowWorker.js +1 -1
  690. package/views/3d/support/flow/StreamlineResources3D.js +1 -1
  691. package/views/3d/support/flow/StreamlineResources3DOverlay.js +1 -1
  692. package/views/3d/support/flow/StreamlineResources3DShape.js +1 -1
  693. package/views/3d/support/flow/constants.js +1 -1
  694. package/views/3d/support/hitTest.js +1 -1
  695. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  696. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  697. package/views/3d/terrain/OverlayRenderer.js +1 -1
  698. package/views/3d/terrain/TerrainSurface.js +1 -1
  699. package/views/3d/terrain/Tile.js +1 -1
  700. package/views/3d/terrain/TileOverlayData.js +1 -1
  701. package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
  702. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  703. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  704. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
  705. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentShader.glsl.js +1 -1
  706. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +7 -7
  707. package/views/3d/webgl-engine/core/shaderModules/BooleanDrawUniform.js +5 -0
  708. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConstructionContext.js +1 -1
  709. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  710. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  711. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  712. package/views/3d/webgl-engine/lib/RayIntersections.js +1 -1
  713. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  714. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  715. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  716. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  717. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  718. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  719. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +10 -4
  720. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  721. package/views/DOMContainer.js +1 -1
  722. package/views/SceneView.js +1 -1
  723. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  724. package/views/analysis/ElevationProfile/ElevationProfileLineGroundComputation.js +1 -1
  725. package/views/analysis/ElevationProfile/ElevationProfileLineInputComputation.js +1 -1
  726. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  727. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  728. package/views/analysis/ElevationProfile/constants.js +1 -1
  729. package/views/analysis/ElevationProfile/elevationProfileGenerationUtils.js +1 -1
  730. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  731. package/views/analysis/ElevationProfile/elevationProfileLayerUtils.js +5 -0
  732. package/views/draw/DrawOperation.js +1 -1
  733. package/views/draw/MultipointDrawAction.js +1 -1
  734. package/views/draw/PointDrawAction.js +1 -1
  735. package/views/draw/PolygonDrawAction.js +1 -1
  736. package/views/draw/PolylineDrawAction.js +1 -1
  737. package/views/draw/SegmentDrawAction.js +1 -1
  738. package/views/draw/input/CursorUpdateEvents.js +5 -0
  739. package/views/draw/input/DrawCompleteEvent.js +5 -0
  740. package/views/draw/input/VertexAddEvent.js +5 -0
  741. package/views/draw/input/VertexRemoveEvent.js +5 -0
  742. package/views/draw/input/VertexUpdateEvent.js +5 -0
  743. package/views/draw/support/Reshape.js +1 -1
  744. package/views/draw/support/reshapeUtils.js +1 -1
  745. package/views/interactive/dragEventPipeline.js +1 -1
  746. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +5 -0
  747. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  748. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +5 -0
  749. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  750. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  751. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  752. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  753. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  754. package/views/layers/FeatureLayerView.js +1 -1
  755. package/views/support/PromiseQueue.js +1 -1
  756. package/views/support/Scheduler.js +1 -1
  757. package/views/support/TextureCompressionWorker.js +1 -1
  758. package/views/webgl/ShaderBuilder.js +1 -1
  759. package/views/webgl/Texture.js +1 -1
  760. package/webdoc/support/webdocSaveUtils.js +1 -1
  761. package/webscene/spec-certification/api.js +1 -1
  762. package/widgets/Attachments/AttachmentsViewModel.js +1 -1
  763. package/widgets/BasemapLayerList.js +1 -1
  764. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  765. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  766. package/widgets/BatchAttributeForm.js +1 -1
  767. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  768. package/widgets/CoordinateConversion.js +1 -1
  769. package/widgets/Daylight/DaylightViewModel.js +1 -1
  770. package/widgets/Daylight.js +1 -1
  771. package/widgets/Directions/css.js +1 -1
  772. package/widgets/Directions.js +1 -1
  773. package/widgets/Editor/AddAssociationWorkflow.js +1 -1
  774. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  775. package/widgets/Editor/EditorViewModel.js +1 -1
  776. package/widgets/Editor/Edits.js +1 -1
  777. package/widgets/Editor/MergeFeaturesWorkflow.d.ts +4 -0
  778. package/widgets/Editor/MergeFeaturesWorkflow.js +5 -0
  779. package/widgets/Editor/MergeFeaturesWorkflowData.d.ts +4 -0
  780. package/widgets/Editor/MergeFeaturesWorkflowData.js +5 -0
  781. package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
  782. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  783. package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
  784. package/widgets/Editor/UpdateFeaturesWorkflowData.js +1 -1
  785. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  786. package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
  787. package/widgets/Editor/UpdateWorkflow.js +1 -1
  788. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  789. package/widgets/Editor/components/FeatureList.js +1 -1
  790. package/widgets/Editor/components/UploadDetails.js +1 -1
  791. package/widgets/Editor/support/EditorItem.js +1 -1
  792. package/widgets/Editor/support/SketchController.js +1 -1
  793. package/widgets/Editor/support/errors.js +5 -0
  794. package/widgets/Editor/support/mergeFeaturesUtils.js +5 -0
  795. package/widgets/Editor/workflowUtils.js +1 -1
  796. package/widgets/Editor.js +1 -1
  797. package/widgets/Feature/FeatureExpression.js +1 -1
  798. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  799. package/widgets/Feature/FeatureFields.js +1 -1
  800. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  801. package/widgets/Feature/FeatureMedia.js +1 -1
  802. package/widgets/Feature/FeatureViewModel.js +1 -1
  803. package/widgets/Feature/support/featureUtils.js +1 -1
  804. package/widgets/Feature.js +1 -1
  805. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  806. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  807. package/widgets/FeatureForm/FieldInput.js +1 -1
  808. package/widgets/FeatureForm/InputBase.js +1 -1
  809. package/widgets/FeatureForm/RelationshipInput.js +1 -1
  810. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  811. package/widgets/FeatureForm.js +1 -1
  812. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  813. package/widgets/FeatureTable/FieldColumn.js +1 -1
  814. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  815. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  816. package/widgets/LayerList.js +1 -1
  817. package/widgets/Legend/LegendViewModel.js +1 -1
  818. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  819. package/widgets/Legend.js +1 -1
  820. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  821. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  822. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  823. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  824. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  825. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  826. package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
  827. package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
  828. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  829. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  830. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  831. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  832. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  833. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  834. package/widgets/Print.js +1 -1
  835. package/widgets/Search/LayerSearchSource.js +1 -1
  836. package/widgets/Sketch/CreateToolVisibilityMap.js +5 -0
  837. package/widgets/Sketch/SelectionToolVisibilityMap.js +5 -0
  838. package/widgets/Sketch/VisibleElements.js +1 -1
  839. package/widgets/Sketch.js +1 -1
  840. package/widgets/UtilityNetworkTrace.js +1 -1
  841. package/widgets/support/ColorPicker.js +1 -1
  842. package/widgets/support/FilterCondition.js +1 -1
  843. package/widgets/support/SelectionList/LayerItem.js +1 -1
  844. package/widgets/support/jsxWidgetSupport.js +1 -1
  845. package/assets/esri/core/workers/chunks/01642fe19e81bfa33eb5.js +0 -1
  846. package/assets/esri/core/workers/chunks/039ec0fbe3b4b398b8c6.js +0 -1
  847. package/assets/esri/core/workers/chunks/0429c1a3690f20647c9f.js +0 -1
  848. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  849. package/assets/esri/core/workers/chunks/065f2bbcaeef1f13fd48.js +0 -1
  850. package/assets/esri/core/workers/chunks/0731e588afd1f561ec3b.js +0 -1
  851. package/assets/esri/core/workers/chunks/09de8be660174a229efb.js +0 -1
  852. package/assets/esri/core/workers/chunks/0eaa4dccba0d844b9da3.js +0 -1
  853. package/assets/esri/core/workers/chunks/0f9bb3187306f89e3d63.js +0 -1
  854. package/assets/esri/core/workers/chunks/1019fa4818624ba292ef.js +0 -1
  855. package/assets/esri/core/workers/chunks/10fb29ba6f3f81353fbc.js +0 -1
  856. package/assets/esri/core/workers/chunks/147ad5fdd02f46b6da24.js +0 -1
  857. package/assets/esri/core/workers/chunks/17103e6542aae53c7301.js +0 -1
  858. package/assets/esri/core/workers/chunks/188272af9a6470ccfe31.js +0 -1
  859. package/assets/esri/core/workers/chunks/18da83afbc324fef9fd8.js +0 -316
  860. package/assets/esri/core/workers/chunks/1a9f544f20f643161a36.js +0 -1
  861. package/assets/esri/core/workers/chunks/1cfcadaa98ac528fea37.js +0 -1
  862. package/assets/esri/core/workers/chunks/1db0bf570a04687b3130.js +0 -1
  863. package/assets/esri/core/workers/chunks/2266a8f2c2ec37c19bb4.js +0 -1
  864. package/assets/esri/core/workers/chunks/24921d31efa8d222ad2d.js +0 -2
  865. package/assets/esri/core/workers/chunks/25639559336109ff3df1.js +0 -1
  866. package/assets/esri/core/workers/chunks/2a5f331c0f18d8574b4e.js +0 -1
  867. package/assets/esri/core/workers/chunks/2a900a632a1231deb713.js +0 -1
  868. package/assets/esri/core/workers/chunks/31c6e951b99315e8e68a.js +0 -1
  869. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  870. package/assets/esri/core/workers/chunks/35491fbdd287470d40a4.js +0 -1
  871. package/assets/esri/core/workers/chunks/36247c6f6fc2891df2cf.js +0 -1
  872. package/assets/esri/core/workers/chunks/36fe6b8228e622407ec2.js +0 -1
  873. package/assets/esri/core/workers/chunks/3d22fe2f2c40abbc246e.js +0 -1
  874. package/assets/esri/core/workers/chunks/3d53307efbc3f07d7bf2.js +0 -1
  875. package/assets/esri/core/workers/chunks/3d65b8a2fbe1df050a25.js +0 -1
  876. package/assets/esri/core/workers/chunks/40b81d1c2d53cf598b8e.js +0 -1
  877. package/assets/esri/core/workers/chunks/42a72e1d963e4636323b.js +0 -1
  878. package/assets/esri/core/workers/chunks/456161a323be7d640c61.js +0 -1
  879. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  880. package/assets/esri/core/workers/chunks/4c4227b0ea21a5e429ab.js +0 -1
  881. package/assets/esri/core/workers/chunks/4eebd74ebc20579dade8.js +0 -1
  882. package/assets/esri/core/workers/chunks/500d09d2191127371081.js +0 -1
  883. package/assets/esri/core/workers/chunks/50864c1924030e62497d.js +0 -1
  884. package/assets/esri/core/workers/chunks/5707713c2f27588b9194.js +0 -1
  885. package/assets/esri/core/workers/chunks/5713f96bade5ebb54c81.js +0 -1
  886. package/assets/esri/core/workers/chunks/5718cf135e105e1e026b.js +0 -1
  887. package/assets/esri/core/workers/chunks/5c585b338a9e9aa0e205.js +0 -1
  888. package/assets/esri/core/workers/chunks/5d1d909354c90cb8eb60.js +0 -1
  889. package/assets/esri/core/workers/chunks/5ea03f53d4d64d9e7cae.js +0 -1
  890. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  891. package/assets/esri/core/workers/chunks/620a94b54be3ed78350d.js +0 -1
  892. package/assets/esri/core/workers/chunks/63019a7eb5222dc5e420.js +0 -1
  893. package/assets/esri/core/workers/chunks/64629ddcf008349eaf41.js +0 -1
  894. package/assets/esri/core/workers/chunks/64ee8d2acae2d6fce608.js +0 -1
  895. package/assets/esri/core/workers/chunks/650c94c0e8ab9721015e.js +0 -1
  896. package/assets/esri/core/workers/chunks/67f305b0c72e77a6331a.js +0 -1
  897. package/assets/esri/core/workers/chunks/6e5b3bbee054d072b594.js +0 -1
  898. package/assets/esri/core/workers/chunks/6f4bd0ee85e7e5a74340.js +0 -1
  899. package/assets/esri/core/workers/chunks/72ecf49d03bb24bf0998.js +0 -1
  900. package/assets/esri/core/workers/chunks/7421f9575487cdc9e28e.js +0 -1
  901. package/assets/esri/core/workers/chunks/77a11d7d53325d108ed8.js +0 -1
  902. package/assets/esri/core/workers/chunks/7c5c272612198db83851.js +0 -1
  903. package/assets/esri/core/workers/chunks/7d9882ddfa6495f72baa.js +0 -1
  904. package/assets/esri/core/workers/chunks/7fffad8ff6878fa1fd56.js +0 -1
  905. package/assets/esri/core/workers/chunks/81bbe5251ed13c0d91cc.js +0 -1
  906. package/assets/esri/core/workers/chunks/85622fe99f4d08afe875.js +0 -1
  907. package/assets/esri/core/workers/chunks/8b16aa50d879b92a5375.js +0 -1
  908. package/assets/esri/core/workers/chunks/8bc64fc7c4b9eb8fca4d.js +0 -1
  909. package/assets/esri/core/workers/chunks/8eefa133c36a004c054c.js +0 -1
  910. package/assets/esri/core/workers/chunks/91afee11072471e4eefe.js +0 -1
  911. package/assets/esri/core/workers/chunks/929ece362604dc301229.js +0 -1
  912. package/assets/esri/core/workers/chunks/9834bc11586a2d8d6f35.js +0 -1
  913. package/assets/esri/core/workers/chunks/9a723d739ac44b45432c.js +0 -1
  914. package/assets/esri/core/workers/chunks/9c6fc4fe2c46f40d63d9.js +0 -1
  915. package/assets/esri/core/workers/chunks/a5f25104938ab33e7a85.js +0 -1
  916. package/assets/esri/core/workers/chunks/a7bd294996e6c8b8354a.js +0 -1
  917. package/assets/esri/core/workers/chunks/a87521ebe632bf783ef4.js +0 -1
  918. package/assets/esri/core/workers/chunks/a8f998b8ec8c56150479.js +0 -2
  919. package/assets/esri/core/workers/chunks/abf4f018c692c18c3320.js +0 -1
  920. package/assets/esri/core/workers/chunks/ae6066ea6cb373dc6db3.js +0 -1
  921. package/assets/esri/core/workers/chunks/b0b2670596d6d8c32b5e.js +0 -1
  922. package/assets/esri/core/workers/chunks/b1f667006cba60ef4aa7.js +0 -1
  923. package/assets/esri/core/workers/chunks/b2add7338258ca7c24dd.js +0 -1
  924. package/assets/esri/core/workers/chunks/b2d9f4e057af26a538fb.js +0 -1
  925. package/assets/esri/core/workers/chunks/b62807c6fcfb70a87cd4.js +0 -1
  926. package/assets/esri/core/workers/chunks/b8339c1d60847a9eed3e.js +0 -1
  927. package/assets/esri/core/workers/chunks/bc6619307f312f9241bf.js +0 -1
  928. package/assets/esri/core/workers/chunks/bfc1e8aec7aace3ff30e.js +0 -1
  929. package/assets/esri/core/workers/chunks/c0feec6e2f0e45900ae0.js +0 -1
  930. package/assets/esri/core/workers/chunks/c362fbbafec91c44eeb2.js +0 -1
  931. package/assets/esri/core/workers/chunks/c368a8e8d2f1535af446.js +0 -1
  932. package/assets/esri/core/workers/chunks/c55c096669677321a227.js +0 -1
  933. package/assets/esri/core/workers/chunks/c7a3a44cca5a7d52cca9.js +0 -1
  934. package/assets/esri/core/workers/chunks/c941d15190fc08523d0d.js +0 -1
  935. package/assets/esri/core/workers/chunks/cc70a4a915b0b2ccb2a0.js +0 -1
  936. package/assets/esri/core/workers/chunks/d121045cddbe55c2ecb2.js +0 -1
  937. package/assets/esri/core/workers/chunks/d2120a623b1bd91b9ed9.js +0 -1
  938. package/assets/esri/core/workers/chunks/d466f3f0d3824c77da7c.js +0 -1
  939. package/assets/esri/core/workers/chunks/d78c2833cdc4730a88a3.js +0 -1
  940. package/assets/esri/core/workers/chunks/dabc5a38a472c9719df9.js +0 -1
  941. package/assets/esri/core/workers/chunks/dc31865edea480f0ebba.js +0 -1
  942. package/assets/esri/core/workers/chunks/df438b62702007267798.js +0 -1
  943. package/assets/esri/core/workers/chunks/e0bbfbe1ed39c82f1bd4.js +0 -1
  944. package/assets/esri/core/workers/chunks/e6fc278e2390d2787345.js +0 -1
  945. package/assets/esri/core/workers/chunks/f4eb090bcc3eca64306a.js +0 -1
  946. package/assets/esri/core/workers/chunks/f7846523adacbfe5047e.js +0 -1
  947. package/assets/esri/core/workers/chunks/f839b86bee15deaf84e4.js +0 -1
  948. package/assets/esri/core/workers/chunks/f98689562017583f73ee.js +0 -1
  949. package/assets/esri/core/workers/chunks/fa5c87889c2f0bef896b.js +0 -1
  950. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementConfiguration.js +0 -5
  951. package/views/3d/layers/i3s/I3SStreamDataController.js +0 -5
  952. package/views/3d/support/StreamDataLoader.js +0 -5
  953. package/views/3d/support/StreamDataRequester.js +0 -5
  954. package/views/3d/support/downloadSlots.js +0 -5
  955. package/views/draw/input/DrawEvents.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{addEventListener as s}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import{destroyMaybe as r}from"../core/maybe.js";import{debounce as n,isAbortError as a}from"../core/promiseUtils.js";import{watch as l,initial as c,on as d}from"../core/reactiveUtils.js";import{escapeRegExpString as h}from"../core/string.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{onLocaleChange as u,getLocaleLanguage as v}from"../intl/locale.js";import _ from"../portal/Portal.js";import{defaultUnitPropertyMetadata as g}from"../properties/defaultUnit.js";import w from"../rest/support/Stop.js";import y from"../symbols/SimpleMarkerSymbol.js";import b from"./Search.js";import S from"./Widget.js";import{css as f}from"./Directions/css.js";import{DirectionsSearchTool as k}from"./Directions/DirectionsSearchTool.js";import C from"./Directions/DirectionsViewModel.js";import D from"./Directions/DirectionsVisibleElements.js";import{formatDistance as M,formatDuration as I,DepartureTimeOption as T,getIconName as F}from"./Directions/support/directionsUtils.js";import{isArcGISWorldGeocoder as P,meteredArcGISLocatorUrl as x}from"./Search/support/locatorUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as R}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as L}from"./support/decorators/messageBundle.js";import{tsx as A}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";function O(e){const{branchName:i,displayText:s,exitName:o,intersectingName:r,name:n,towardName:a}=e;if(null==s)return null;const l=[i,o,r,n,a].filter(t).sort((e,t)=>t.length-e.length).map(e=>h(e));if(!l.length)return s;const c=new RegExp(l.join("|"),"g"),d=s.matchAll(c);let p=0;const m=[];for(const{0:t,index:h}of d)m.push(s.slice(p,h),A("span",{class:f.labelEmphasize,key:`maneuver-${h}`},t)),p=h+t.length;return m.push(s.slice(p)),A("span",null,m)}let N=class extends S{constructor(e,t){super(e,t),this._activeManeuver=null,this._placeholderStops=new i([new w,new w]),this._portalFolderCombobox=null,this._portalFolders=null,this._portalItemNameInput=null,this._portalUserName=null,this._printDocument=null,this._printDocumentParent=null,this._sections=null,this._stopsToSearches=new Map,this._printDocumentOpen=!1,this._currentFlowItem="primary",this._parentFlowItem="primary",this._saveState="initialized",this._searchTool=null,this.headingLevel=2,this.messages=null,this.messagesUnits=null,this.searchProperties={popupEnabled:!1,resultGraphicEnabled:!1},this.viewModel=new C,this.visibleElements=new D,this._solveRouteDebounced=n(()=>this._solveRoute())}initialize(){this.addHandles([l(()=>this.viewModel.layer,()=>{try{this.viewModel.load()}catch{}},c),l(()=>this.viewModel.layer?.routeInfo,()=>{this._sections=this._getStopSections()},c),l(()=>this.viewModel.layer?.stops.toArray(),e=>{e&&this.view?.activeTool&&this._searchTool&&this.view.activeTool===this._searchTool&&!e.includes(this._searchTool.stop)&&(this.view.tools.remove(this._searchTool),this._searchTool=null)}),s(window,"beforeprint",this._beforePrint.bind(this)),s(window,"afterprint",this._afterPrint.bind(this))])}loadDependencies(){return E({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}destroy(){this._stopsToSearches.forEach(r)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"right"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e);return i.view=t,this._overrideDefaultSources(i),i}const i=new b({icon:"",popupEnabled:!1,resultGraphicEnabled:!1,view:t,...this.searchProperties});return this._normalizeSearchSources(i),this.addHandles([d(()=>i.allSources,"change",()=>this._normalizeSearchSources(i)),i.on("search-clear",()=>{e.geometry=null,e.name=null,this.viewModel.layer?.removeResult()}),i.on("select-result",()=>{const t=i.selectedResult;e.geometry=t?.feature.geometry,e.name=t?.name,this._solveRouteDebounced()}),l(()=>i.searchTerm,t=>{e.name=t}),u(()=>this._normalizeSearchSources(i))],i),this._stopsToSearches.set(e,i),i}getDirections(){return this.viewModel.getDirections()}render(){return A("div",{class:this.classes(f.base,R.widget,R.panel)},A("calcite-flow",null,this._renderPrimaryFlowItem(),this._renderDirectionsFlowItem(),this._renderEditFlowItem(),this._renderSaveFlowItem()),this._renderPrintDocument())}save(){return this.viewModel.save()}saveAs(e,t={}){return this.viewModel.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_afterPrint(){this._printDocumentOpen&&this._printDocument&&this._printDocumentParent?.appendChild(this._printDocument)}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.language=v(),t.locationType??="street",P(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=x))}_beforePrint(){this._printDocumentOpen&&this._printDocument&&document.body.appendChild(this._printDocument)}_disposeSearch(e){if(!e||!this._stopsToSearches.has(e))return;const t=this._stopsToSearches.get(e);this.removeHandles(t),t.destroy(),this._stopsToSearches.delete(e)}_getEffectiveStops(){return this.viewModel.layer?.stops??this._placeholderStops}_getErrorDescription(){switch(this.viewModel.lastError?.name){case"directions-view-model:unable-to-route":return this.messages.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return this.messages.errors.unableToLoadServiceMetadata;default:return this.messages.errors.unknownError}}_getNetworkFeatureName(e){switch(e.type){case"stop":switch(e.locationType){case"stop":default:return this.messages.networkFeatures.stops.stop;case"waypoint":return this.messages.networkFeatures.stops.waypoint;case"break":return this.messages.networkFeatures.stops.break}case"point-barrier":return this.messages.networkFeatures.pointBarrier;case"polyline-barrier":return this.messages.networkFeatures.polylineBarrier;case"polygon-barrier":return this.messages.networkFeatures.polygonBarrier}}_getRouteCostSummary(){const e=this.viewModel.layer?.routeInfo;if(!e)return null;const t=e.totalDistance??0,i=e.totalDuration??0,{messagesUnits:s,unit:o}=this;return{distance:M(s,t,o),duration:I(i)}}_getStopCostDescription(e){if(!e.directions.length)return;const{totalDistance:t,totalDuration:i}=e.directions.reduce((e,{lines:t})=>{for(const{distance:i,duration:s}of t)e.totalDistance+=i??0,e.totalDuration+=s??0;return e},{totalDistance:0,totalDuration:0}),{messagesUnits:s,unit:o}=this,r=M(s,t,o);return`${I(i)} (${r})`}_getStopSections(){if(!this.viewModel.layer)return null;const{directionPoints:e,directionLines:t,stops:i}=this.viewModel.layer;if(!e||!t)return null;const s=[];let o=null;for(const r of e){const{objectId:e,stopId:n}=r;if(null!=n){const e=i.find(({objectId:e})=>e===n);o&&o.stop===e||(o={stop:e,directions:[]},s.push(o));continue}if(null==o)continue;const a=t.toArray().filter(({directionPointId:t})=>t===e);0!==a.length&&o.directions.push({directionPoint:r,lines:a})}return s}_handleAddStopClick(){const e=new y;this.viewModel.layer?.stops.add(new w({symbol:e}))}_handleAutoSolveChange({target:e}){this.viewModel.autoSolve=e.checked}_handleCreatePolylineBarrierClick(){this.viewModel.create("polyline-barrier")}_handleClearRouteClick(){this._currentFlowItem="primary",this.viewModel.reset()}_handleCreateStopClick(){this.viewModel.create("stop")}_handleDeleteNetworkFeatureClick(e){this.viewModel.remove(e),this.viewModel.autoSolve&&this._solveRouteDebounced()}_handleDeleteStopClick(e){this._getEffectiveStops().remove(e),this._disposeSearch(e),this._solveRouteDebounced()}_handleDepartureDateChange({currentTarget:{value:e}}){Array.isArray(e)||(this.viewModel.departureIsoDate=e,this._solveRouteDebounced())}_handleDepartureTimeChange({currentTarget:{value:e}}){this.viewModel.departureIsoTime=e,this._solveRouteDebounced()}_handleDepartureTimeOptionChange({currentTarget:e}){const{selectedItems:t}=e;t.length&&(this.viewModel.departureOption=t[0].value,this._solveRouteDebounced())}_handleDirectionsFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem="primary"}_handleDirectionTurnItemSelect(e){this._activeManeuver===e?this.zoomToRoute():(this._activeManeuver=e,this.viewModel.centerAt(e.geometry))}_handleDirectionTurnPointerEnter(e){this.viewModel.highlight(e)}_handleDirectionTurnPointerLeave(){this.viewModel.clearHighlights()}_handleEditFlowItemBackClick(e){e.stopPropagation(),this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditingDoneClick(){this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditRouteClick(){this._currentFlowItem="edit",this.viewModel.startEditing()}_handleItemDetailsClick(){const e=this.viewModel.layer?.portalItem;e&&window.open(`${e.portal.url}/home/item.html?id=${e.id}`,"_blank")}_handleLocateStopClick(e){const{view:t}=this;if(!t)return;const i="directions-search-tool";this.removeHandles(i),this._searchTool=new k({stop:e,view:t}),this.addHandles([this._searchTool.on("click",async t=>{if(t.mapPoint&&this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e),s=await i.search(t.mapPoint),o=s?.results?.[0].results?.[0];if(o){const{feature:t,name:s}=o;i.searchTerm=s,e.geometry=t.geometry}}this.removeHandles(i)}),o(()=>{this._searchTool&&(this.view?.tools.remove(this._searchTool),this._searchTool=null)})],i),t.addAndActivateTool(this._searchTool)}_handleOptimizeStopOrderToggle({target:{expanded:e}}){this.viewModel.routeParameters.findBestSequence=e,this._solveRouteDebounced()}_handlePanToStopClick(e){this.viewModel.centerAt(e)}_handlePreserveFirstStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveFirstStop=e,this._solveRouteDebounced()}_handlePreserveLastStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveLastStop=e,this._solveRouteDebounced()}_handlePrintDocumentAfterCreate(e){e.focus(),this._printDocument=e,this._printDocumentParent=e.parentElement}_handlePrintDocumentClick(){this._printDocumentOpen=!0}_handlePrintDocumentCloseClick(){this._printDocumentOpen=!1}_handlePrintDocumentKeyDown(e){"Escape"===e.key&&(this._printDocumentOpen=!1)}_handlePrintDocumentPrintClick(){document.body.classList.add(f.printMedia),window.print(),document.body.classList.remove(f.printMedia)}_handleResolveRouteClick(){this._solveRouteDebounced()}_handleReverseStopOrderClick(){this._getEffectiveStops().reverse(),this._solveRouteDebounced()}_handleSaveErrorCloseClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem=this._parentFlowItem}async _handleSaveLayerAs(){const e=_.getDefault();try{await e.signIn()}catch(t){if(a(t)||"identity-manager:user-aborted"===t.name)return;return this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",void(this._saveState="connect-to-portal-error")}this._saveState="fetch-portal-information",this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",this._portalUserName=e.user?.username;try{this._portalFolders=await(e.user?.fetchFolders())}catch{return void(this._saveState="fetch-portal-information-error")}this._saveState="save-layer"}_handleSaveLayerClick(){this.viewModel.layer?.save()}_handleSaveLayerButtonClick(){this._saveState="saving";const{layer:e}=this;if(!e||!this._portalFolders)return;const t=this._portalItemNameInput?.value,i=this._portalFolderCombobox?.value,s=this._portalFolders.find(({id:e})=>e===i);e.saveAs({title:t},{folder:s}).then(()=>{e.title=t,this._currentFlowItem=this._parentFlowItem}).catch(()=>{this._saveState="saving-error"})}_handleSaveLayerCancelClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveLayerFolderCreate(e){this._portalFolderCombobox=e}_handleSaveLayerNameCreate(e){this._portalItemNameInput=e}_handleSignInClick(){this.viewModel.load().catch(()=>{})}_handleStopListReorder({detail:{dragEl:e,newIndex:t}}){this._getEffectiveStops().reorder(e.value,t),this._solveRouteDebounced()}_handleTravelModeChange({currentTarget:{selectedItems:e}}){e.length&&(this.viewModel.selectedTravelMode=e[0].value,this._solveRouteDebounced())}_handleViewDrivingDirectionsClick(){this._currentFlowItem="directions"}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){for(const t of e.viewModel.defaultSources)t.autoNavigate=!1}_renderClearRouteAction(e){return A("calcite-action",{bind:this,icon:"trash",key:"clear-route",onclick:this._handleClearRouteClick,...e,text:this.messages.common.clear,textEnabled:!0})}_renderDeleteStopAction(e){return A("calcite-action",{icon:"trash",onclick:this._handleDeleteStopClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.deleteStop,title:this.messages.deleteStop})}_renderDepartureTime(){const{DEPART_AT:e,NOW:t,UNSPECIFIED:i}=T;return A("calcite-label",{class:f.departureTime,key:"departure-time"},this.messages.departureTime,A("calcite-combobox",{bind:this,clearDisabled:!0,label:this.messages.departureTime,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:this._handleDepartureTimeOptionChange},A("calcite-combobox-item",{heading:this.messages.leaveNow,key:t,label:this.messages.leaveNow,selected:this.viewModel.departureOption===t,value:t}),A("calcite-combobox-item",{heading:this.messages.departAt,key:e,label:this.messages.departAt,selected:this.viewModel.departureOption===e,value:e}),A("calcite-combobox-item",{heading:this.messages.timeUnspecified,key:i,label:this.messages.timeUnspecified,selected:this.viewModel.departureOption===i,value:i})))}_renderDepartureTimeOptions(){return this.viewModel.departureOption!==T.DEPART_AT?null:A("div",{class:f.departureTimeOptions},A("calcite-input-date-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoDate,onCalciteInputDatePickerChange:this._handleDepartureDateChange}),A("calcite-input-time-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoTime,onCalciteInputTimePickerClose:this._handleDepartureTimeChange}))}_renderDirectionsFlowItem(){if("directions"!==this._currentFlowItem)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return A("calcite-flow-item",{bind:this,key:"directions-flow-item",overlayPositioning:"fixed",selected:"directions"===this._currentFlowItem,onCalciteFlowItemBack:this._handleDirectionsFlowItemBackClick},A("div",{class:f.directionsHeader,slot:"header-content"},A("div",{class:f.headerStops},A("span",null,this.messages.from)," ",A("span",{class:f.directionsHeaderStopName},o),A("span",null,this.messages.to)," ",A("span",{class:f.directionsHeaderStopName},r)),A("div",{class:f.flexColumn},A("span",null,`${i} (${t})`),s?A("span",null,s):null)),this._renderRouteLayerActions({slot:"header-menu-actions"}),A("calcite-accordion",{class:f.accordion,iconPosition:"start",selectionMode:"single"},this._sections.map((e,t)=>this._renderDirectionSection(e,t))))}_renderDirectionSection(e,t){const{stop:i,directions:s}=e,{name:o}=i,r=0===t,n=this._getStopCostDescription(e);return A("calcite-accordion-item",{description:n,expanded:r,heading:o??"",key:`stop-${t}`},A("calcite-action",{icon:"zoom-to-object",onclick:this._handlePanToStopClick.bind(this,i),slot:"actions-end",text:this.messages.panToStop,title:this.messages.panToStop}),this._renderDirectionTurns(s))}_renderDirectionTurns(e){return A("calcite-list",{label:this.messages.drivingDirections,selectionMode:"none"},e.map((e,t)=>{const{directionPoint:i,lines:s}=e,o=s[0],{distance:r,duration:n}=o,a=M(this.messagesUnits,r??0,this.unit),l=I(n??0),c=a&&l?`${a} | ${l}`:`${a||l}`,d=O(i),h=F(i.directionPointType);return A("calcite-list-item",{class:f.labelNoBottomMargin,key:`driving-direction-${t}`,onpointerenter:this._handleDirectionTurnPointerEnter.bind(this,o),onpointerleave:this._handleDirectionTurnPointerLeave.bind(this),onCalciteListItemSelect:this._handleDirectionTurnItemSelect.bind(this,o)},A("calcite-icon",{icon:h,slot:"content-start"}),A("div",{slot:"content"},A("calcite-label",{layout:"inline",scale:"s"},d),A("calcite-label",{layout:"inline",scale:"s"},c)))}))}_renderEditFlowItem(){return"edit"!==this._currentFlowItem?null:A("calcite-flow-item",{bind:this,heading:this.messages.editRoute,headingLevel:this.headingLevel,key:"edit-flow-item",loading:"routing"===this.viewModel.state,selected:"edit"===this._currentFlowItem,onCalciteFlowItemBack:this._handleEditFlowItemBackClick},A("div",{class:f.flexColumn,key:"edit-container"},A("div",{class:f.editToolbarContainer},A("calcite-label",{layout:"inline",scale:"s"},this.messages.automaticallySolve,A("calcite-switch",{bind:this,checked:this.viewModel.autoSolve,scale:"s",onCalciteSwitchChange:this._handleAutoSolveChange})),A("div",{class:f.editToolbar},A("calcite-action",{bind:this,disabled:!this.viewModel.layer||this.viewModel.layer.stops.length>=this.maxStops,icon:"flag",onclick:this._handleCreateStopClick,scale:"s",text:this.messages.networkFeatures.stops.stop,textEnabled:!0}),A("calcite-action",{bind:this,icon:"line",onclick:this._handleCreatePolylineBarrierClick,scale:"s",text:this.messages.barrier,textEnabled:!0}),A("calcite-action",{bind:this,class:f.solveRoute,disabled:this.viewModel.autoSolve,icon:"refresh",onclick:this._handleResolveRouteClick,scale:"s",text:this.messages.solve,textEnabled:!0}))),A("div",{class:f.selectedFeatureContainer},A("calcite-list",{label:this.messages.selectedNetworkFeatures,scale:"s",selectionMode:"none"},this.viewModel.selectedNetworkFeatures?.toArray().map((e,t)=>A("calcite-list-item",{description:this._getNetworkFeatureName(e),key:`network-feature-${t}`,label:e.name??e.objectId?.toString()??this.messages.unnamed},A("calcite-action",{icon:"trash",onclick:this._handleDeleteNetworkFeatureClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.common.delete}))))),A("div",{class:f.editFooter},this._renderEditFooterContent())))}_renderEditFooterContent(){return this.viewModel.lastError?this._renderErrorNotice():A("calcite-button",{appearance:"outline-fill",bind:this,onclick:this._handleEditingDoneClick,width:"full"},this.messages.common.done)}_renderErrorNotice(){return A("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this._getErrorDescription()))}_renderFooter(){if(!this.viewModel.layer)return A("div",{class:f.primaryFooter,key:"footer-missing-layer"},A("calcite-notice",{icon:"information",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.missingLayer)));if("unauthenticated"===this.viewModel.state)return A("div",{class:f.primaryFooterCentered,key:"footer-sign-in"},A("calcite-label",null,this.messages.signInRequired),A("calcite-button",{bind:this,onclick:this._handleSignInClick},this.messages.common.auth.signIn));if("routing"===this.viewModel.state)return A("div",{class:this.classes(f.primaryFooter,f.primaryFooterLoader),key:"footer-routing"},A("calcite-loader",{label:this.messages.solve,scale:"s"}));if("error"===this.viewModel.state)return A("div",{class:f.primaryFooter,key:"footer-service-error"},this._renderErrorNotice());if(!this.viewModel.layer?.routeInfo)return A("div",{class:f.primaryFooter,key:"footer-unsolved-route"},A("calcite-notice",{icon:"information",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.directionsPlaceholder)));const e=this._getRouteCostSummary();if(!e||!this.viewModel.layer?.directionPoints)return A("div",{class:f.primaryFooter,key:"footer-invalid-route"},A("calcite-notice",{icon:"exclamation-mark-triangle",kind:"danger",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.invalidRoute)));const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel;return A("div",{class:f.routeItem,key:"footer-directions-summary"},A("button",{"aria-busy":"false","aria-label":this.messages.viewDrivingDirections,"aria-live":"polite",bind:this,class:f.routeItemButton,onclick:this._handleViewDrivingDirectionsClick,title:this.messages.viewDrivingDirections,type:"button"},A("div",{class:f.routeItemButtonContent},A("span",{class:f.routeItemLabel},`${i} (${t})`),A("span",{class:f.routeItemDescription},s)),A("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s"})),A("calcite-action-menu",{label:"test"},A("calcite-action",{icon:"ellipsis",key:"route-actions",slot:"trigger",text:"Route actions"}),this._renderRouteLayerActions()))}_renderInteractiveRouteActions(){return A("div",{class:f.actionContainer,key:f.actionContainer},A("calcite-button",{appearance:"outline",bind:this,class:f.addStopButton,disabled:this._getEffectiveStops().length>=this.maxStops,iconStart:"plus",kind:"neutral",label:this.messages.addStop,onclick:this._handleAddStopClick,title:this.messages.addStop,width:"half"},this.messages.addStop),this.visibleElements.editRouteButton?A("calcite-button",{appearance:"outline",bind:this,class:f.editRouteButton,disabled:"2d"!==this.viewModel.view?.type,iconStart:"pencil",kind:"neutral",label:this.messages.editRoute,onclick:this._handleEditRouteClick,title:this.messages.editRoute,width:"half"},this.messages.editRoute):null)}_renderLocateStopAction(e){if(null!=e.name||null!=e.geometry)return null;const t=this._getEffectiveStops().indexOf(e),i=!!this.view?.activeTool&&this.view.activeTool===this._searchTool&&this._searchTool.stop===e;return A("calcite-action",{active:i,icon:"crosshair",key:`stop-location-action-${t}`,onclick:this._handleLocateStopClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.pickALocationOnTheMap,title:this.messages.pickALocationOnTheMap})}_renderOptimizeStopOrder(){const{routeParameters:e}=this.viewModel,{findBestSequence:t,preserveFirstStop:i,preserveLastStop:s}=e;return A("calcite-block-section",{bind:this,class:f.optimizeSection,text:this.messages.optimizeOrder,toggleDisplay:"switch",onCalciteBlockSectionToggle:this._handleOptimizeStopOrderToggle},t?[A("calcite-label",{class:f.optimizeSwitches,key:"preserve-first-stop",layout:"inline-space-between"},this.messages.preserveFirstStop,A("calcite-switch",{bind:this,checked:i,scale:"s",onCalciteSwitchChange:this._handlePreserveFirstStopChange})),A("calcite-label",{class:f.optimizeSwitches,key:"preserve-last-stop",layout:"inline-space-between"},this.messages.preserveLastStop,A("calcite-switch",{bind:this,checked:s,scale:"s",onCalciteSwitchChange:this._handlePreserveLastStopChange}))]:null)}_renderPrimaryFlowItem(){return A("calcite-flow-item",{key:"primary-flow-item",loading:"initializing"===this.viewModel.state,selected:"primary"===this._currentFlowItem},A("calcite-panel",{class:f.primaryFlowItem,disabled:!this.viewModel.layer||"unauthenticated"===this.viewModel.state||"error"===this.viewModel.state&&!this.viewModel.serviceDescription},this._renderStops(),this._renderInteractiveRouteActions(),this._renderSeparator(),this._renderRouteSolveOptions()),this._renderFooter())}_renderPrintDocument(){if(!this._printDocumentOpen)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return A("div",{afterCreate:this._handlePrintDocumentAfterCreate,bind:this,class:f.printDocument,onkeydown:this._handlePrintDocumentKeyDown,tabindex:0},A("div",{class:f.printBody},A("div",{class:f.printHeader},A("div",{class:f.printHeaderLabel},A("div",{class:f.headerStops},A("span",null,this.messages.from)," ",A("span",{class:f.directionsHeaderStopName},o),A("span",null,this.messages.to)," ",A("span",{class:f.directionsHeaderStopName},r))),A("div",{class:this.classes(f.printHeaderButtons,f.printHideOnPrint)},A("calcite-button",{class:f.printDocumentPrint,iconStart:"print",onclick:this._handlePrintDocumentPrintClick},this.messages.common.print),A("calcite-button",{appearance:"outline",bind:this,class:f.printDocumentClose,iconStart:"x-circle",onclick:this._handlePrintDocumentCloseClick},this.messages.common.close))),A("div",{class:f.directionsHeader},A("span",null,`${i} (${t})`),s?A("span",null,s):null),this._sections.map((e,t)=>this._renderPrintSection(e,t))))}_renderPrintManuever(e,t){const{directionPoint:i,lines:s}=e,{distance:o,duration:r}=s.at(0)??{},n=M(this.messagesUnits,o??0,this.unit),a=I(r??0),l=n&&a?`${n} | ${a}`:`${n||a}`,c=O(i),d=F(i.directionPointType);return A("div",{class:this.classes(f.flexRow,f.printAvoidPageBreak),key:`direction-${t}`},A("calcite-icon",{icon:d}),A("div",{class:f.flexColumn},A("span",null,c),A("span",null,l)))}_renderPrintRouteAction(e){if(!this.visibleElements.printButton)return null;const t=!this.viewModel.layer?.routeInfo;return A("calcite-action",{bind:this,disabled:t,icon:"print",key:"print-route",onclick:this._handlePrintDocumentClick,...e,text:this.messages.common.print,textEnabled:!0})}_renderPrintSection({stop:e,directions:t},i){return A("div",{class:f.printSection,key:`section-${i}`},A("span",{class:f.directionsHeaderStopName},e.name??""),t.map((e,t)=>this._renderPrintManuever(e,t)))}_renderRouteLayerActions(e){return[this._renderClearRouteAction(e),this._renderSaveLayerAction(e),this._renderSaveLayerAsAction(e),this._renderPrintRouteAction(e),this._renderViewItemDetailsAction(e)]}_renderRouteSolveOptions(){return A("div",{class:f.marginInlineMedium,key:"route-solve-options"},this._renderTravelModes(),this._renderDepartureTime(),this._renderDepartureTimeOptions(),this._renderOptimizeStopOrder())}_renderSaveContent(){switch(this._saveState){case"initialized":return this._renderSaveInitialized();case"connect-to-portal":return this._renderSaveProcessing(this.messages.identity.lblSigning);case"connect-to-portal-error":return this._renderSaveError(this.messages.errors.authenticating);case"fetch-portal-information":return this._renderSaveProcessing(this.messages.processing.fetching);case"fetch-portal-information-error":return this._renderSaveError(this.messages.errors.fetching);case"save-layer":return this._renderSaveLayerSettings();case"saving":return this._renderSaveProcessing(this.messages.processing.saving);case"saving-error":return this._renderSaveError(this.messages.errors.saving)}}_renderSaveError(e){return A("calcite-panel",{class:f.paddingMedium,key:"save-layer-error"},A("div",{class:f.saveError},A("calcite-icon",{class:f.saveErrorIcon,icon:"exclamation-mark-triangle",scale:"l",textLabel:this.messages.common.errorMessage}),A("calcite-label",{class:f.saveErrorLabel},e)),A("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveErrorCloseClick,slot:"footer-actions",width:"full"},this.messages.common.close))}_renderSaveInitialized(){return A("calcite-panel",{class:f.paddingMedium,key:"save-layer-initialized"})}_renderSaveFlowItem(){return"save"!==this._currentFlowItem?null:A("calcite-flow-item",{bind:this,heading:this.messages.saveLayer,headingLevel:this.headingLevel,key:"save-layer-flow-item",selected:"save"===this._currentFlowItem,onCalciteFlowItemBack:this._handleSaveFlowItemBackClick},this._renderSaveContent())}_renderSaveLayerAction(e){if(!this.visibleElements.saveButton)return null;const t=this.viewModel.layer,i=t?.routeInfo,s=t?.portalItem?.itemControl;return A("calcite-action",{bind:this,disabled:!(!!i&&("admin"===s||"update"===s)),icon:"save",key:"save-route",onclick:this._handleSaveLayerClick,...e,text:this.messages.common.save,textEnabled:!0})}_renderSaveLayerAsAction(e){if(!this.visibleElements.saveAsButton)return null;const t=!this.viewModel.layer?.routeInfo;return A("calcite-action",{disabled:t,icon:"save-as",key:"save-as-route",onclick:()=>{this._handleSaveLayerAs()},...e,text:this.messages.common.saveAs,textEnabled:!0})}_renderSaveLayerSettings(){if(null==this.layer||null==this._portalFolders||null==this._portalUserName)return this._renderSaveInitialized();const{stops:e}=this.layer,t=`${e.at(0).name} - ${e.at(-1).name}`,i=[A("calcite-combobox-item",{heading:`${this._portalUserName} (${this.messages.common.home})`,key:f.folderHome,selected:!0,value:f.folderHome}),...this._portalFolders.map(e=>A("calcite-combobox-item",{heading:e.title??"",key:`${f.folder}-${e.id}`,value:e.id}))];return A("calcite-panel",{key:"save-layer-panel"},A("div",{class:f.paddingMedium},A("calcite-label",null,this.messages.layerName,A("calcite-input",{afterCreate:this._handleSaveLayerNameCreate,bind:this,label:this.messages.layerName,value:t})),A("calcite-label",null,this.messages.saveInFolder,A("calcite-combobox",{afterCreate:this._handleSaveLayerFolderCreate,bind:this,clearDisabled:!0,label:this.messages.saveInFolder,overlayPositioning:"fixed",selectionMode:"single-persist"},i))),A("calcite-button",{bind:this,onclick:this._handleSaveLayerButtonClick,slot:"footer-actions",width:"full"},this.messages.common.save),A("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveLayerCancelClick,slot:"footer-actions",width:"full"},this.messages.common.cancel))}_renderSaveProcessing(e){return A("calcite-panel",{class:f.marginInlineMedium,key:"save-layer-processing"},A("calcite-loader",{class:f.saveProcessLoader,label:e,text:e}))}_renderSeparator(){return A("div",{class:f.separator})}_renderStop(e){const t=this.acquireSearch(e);null!=e.name&&(t.searchTerm=e.name);const i=this._getEffectiveStops(),s=this._renderLocateStopAction(e),o=i.length>2&&this._renderDeleteStopAction(e);return A("calcite-list-item",{key:e,value:e},s,o,A("div",{class:f.stopItem,slot:"content"},t.render()))}_renderStops(){const e=this._getEffectiveStops();for(const t of this._stopsToSearches.keys())e.includes(t)||this._disposeSearch(t);return A("div",{class:f.stopContainer,key:f.stopContainer},A("calcite-list",{bind:this,class:f.stopList,dragEnabled:!0,label:this.messages.widgetLabel,scale:"s",onCalciteListOrderChange:this._handleStopListReorder},e.toArray().map(e=>this._renderStop(e))),2===e.length&&A("calcite-action",{bind:this,icon:"arrow-up-down",onclick:this._handleReverseStopOrderClick,scale:"s",text:this.messages.reverseStops,title:this.messages.reverseStops}))}_renderTravelMode(e){const{id:t,name:i}=e;return A("calcite-combobox-item",{heading:i,key:t,label:i,selected:this.viewModel.selectedTravelMode?.id===t,value:e})}_renderTravelModes(){return this.viewModel.travelModes.length?A("calcite-label",{key:"travel-modes"},this.messages.mode,A("calcite-combobox",{bind:this,clearDisabled:!0,label:this.messages.mode,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:this._handleTravelModeChange},this.viewModel.travelModes.map(e=>this._renderTravelMode(e)))):null}_renderViewItemDetailsAction(e){return this.visibleElements.layerDetails?A("calcite-action",{bind:this,disabled:!this.viewModel.layer?.portalItem,icon:"launch",key:"open-route-details-link",onclick:this._handleItemDetailsClick,...e,text:this.messages.viewLayerDetails,textEnabled:!0}):null}async _solveRoute(){this.viewModel.updateDepartureTime();if(!((this.viewModel.layer?.stops.filter(({geometry:e})=>!!e).length??0)<2))try{await this.viewModel.getDirections()}catch{}}};e([p()],N.prototype,"_printDocumentOpen",void 0),e([p()],N.prototype,"_currentFlowItem",void 0),e([p()],N.prototype,"_saveState",void 0),e([p()],N.prototype,"_searchTool",void 0),e([p()],N.prototype,"apiKey",null),e([p(g)],N.prototype,"defaultUnit",void 0),e([p()],N.prototype,"goToOverride",null),e([p()],N.prototype,"headingLevel",void 0),e([p()],N.prototype,"icon",null),e([p()],N.prototype,"label",null),e([p({readOnly:!0})],N.prototype,"lastRoute",null),e([p()],N.prototype,"layer",null),e([p()],N.prototype,"maxStops",null),e([p(),L("esri/widgets/Directions/t9n/Directions")],N.prototype,"messages",void 0),e([p(),L("esri/core/t9n/Units")],N.prototype,"messagesUnits",void 0),e([p()],N.prototype,"searchProperties",void 0),e([p()],N.prototype,"unit",null),e([p()],N.prototype,"view",null),e([p({type:C})],N.prototype,"viewModel",void 0),e([p({type:D,nonNullable:!0})],N.prototype,"visibleElements",void 0),N=e([m("esri.widgets.Directions")],N);const j=N;export{j as default};
5
+ import{__decorate as e}from"tslib";import{isSome as t}from"../core/arrayUtils.js";import i from"../core/Collection.js";import{addEventListener as s}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import{destroyMaybe as r}from"../core/maybe.js";import{debounce as a,isAbortError as n}from"../core/promiseUtils.js";import{watch as l,initial as c,on as d}from"../core/reactiveUtils.js";import{escapeRegExpString as h}from"../core/string.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{onLocaleChange as u,getLocaleLanguage as v}from"../intl/locale.js";import g from"../portal/Portal.js";import{defaultUnitPropertyMetadata as _}from"../properties/defaultUnit.js";import w from"../rest/support/Stop.js";import y from"../symbols/SimpleMarkerSymbol.js";import b from"./Search.js";import S from"./Widget.js";import{css as f}from"./Directions/css.js";import{DirectionsSearchTool as k}from"./Directions/DirectionsSearchTool.js";import C from"./Directions/DirectionsViewModel.js";import D from"./Directions/DirectionsVisibleElements.js";import{formatDistance as M,formatDuration as I,DepartureTimeOption as P,getIconName as T}from"./Directions/support/directionsUtils.js";import{isArcGISWorldGeocoder as F,meteredArcGISLocatorUrl as x}from"./Search/support/locatorUtils.js";import{loadCalciteComponents as E}from"./support/componentsUtils.js";import{globalCss as R}from"./support/globalCss.js";import"./support/widgetUtils.js";import{messageBundle as L}from"./support/decorators/messageBundle.js";import{tsx as A}from"./support/jsxFactory.js";import"@arcgis/toolkit/dom";function N(e){const{branchName:i,displayText:s,exitName:o,intersectingName:r,name:a,towardName:n}=e;if(null==s)return null;const l=[i,o,r,a,n].filter(t).sort((e,t)=>t.length-e.length).map(e=>h(e));if(!l.length)return s;const c=new RegExp(l.join("|"),"g"),d=s.matchAll(c);let p=0;const m=[];for(const{0:t,index:h}of d)m.push(s.slice(p,h),A("span",{class:f.labelEmphasize,key:`maneuver-${h}`},t)),p=h+t.length;return m.push(s.slice(p)),A("span",null,m)}const O="print-preview-closed";let j=class extends S{constructor(e,t){super(e,t),this._activeManeuver=null,this._placeholderStops=new i([new w,new w]),this._portalFolderCombobox=null,this._portalFolders=null,this._portalItemNameInput=null,this._portalUserName=null,this._printPreviewDialog=null,this._sections=null,this._stopsToSearches=new Map,this._printPreviewDialogOpen=!1,this._currentFlowItem="primary",this._parentFlowItem="primary",this._saveState="initialized",this._searchTool=null,this.headingLevel=2,this.messages=null,this.messagesUnits=null,this.searchProperties={popupEnabled:!1,resultGraphicEnabled:!1},this.viewModel=new C,this.visibleElements=new D,this._solveRouteDebounced=a(()=>this._solveRoute())}initialize(){this.addHandles([l(()=>this.viewModel.layer,()=>{try{this.viewModel.load()}catch{}},c),l(()=>this.viewModel.layer?.routeInfo,()=>{this._sections=this._getStopSections()},c),l(()=>this.viewModel.layer?.stops.toArray(),e=>{e&&this.view?.activeTool&&this._searchTool&&this.view.activeTool===this._searchTool&&!e.includes(this._searchTool.stop)&&(this.view.tools.remove(this._searchTool),this._searchTool=null)})])}loadDependencies(){return E({accordion:()=>import("@esri/calcite-components/dist/components/calcite-accordion"),"accordion-item":()=>import("@esri/calcite-components/dist/components/calcite-accordion-item"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),"action-menu":()=>import("@esri/calcite-components/dist/components/calcite-action-menu"),"block-section":()=>import("@esri/calcite-components/dist/components/calcite-block-section"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}destroy(){this._stopsToSearches.forEach(r)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get icon(){return"right"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e);return i.view=t,this._overrideDefaultSources(i),i}const i=new b({icon:"",popupEnabled:!1,resultGraphicEnabled:!1,view:t,...this.searchProperties});return this._normalizeSearchSources(i),this.addHandles([d(()=>i.allSources,"change",()=>this._normalizeSearchSources(i)),i.on("search-clear",()=>{e.geometry=null,e.name=null,this.viewModel.layer?.removeResult()}),i.on("select-result",()=>{const t=i.selectedResult;e.geometry=t?.feature.geometry,e.name=t?.name,this._solveRouteDebounced()}),l(()=>i.searchTerm,t=>{e.name=t}),u(()=>this._normalizeSearchSources(i))],i),this._stopsToSearches.set(e,i),i}getDirections(){return this.viewModel.getDirections()}render(){return A("div",{class:this.classes(f.base,R.widget,R.panel)},A("calcite-flow",null,this._renderPrimaryFlowItem(),this._renderDirectionsFlowItem(),this._renderEditFlowItem(),this._renderSaveFlowItem()),this._renderPrintDocument())}save(){return this.viewModel.save()}saveAs(e,t={}){return this.viewModel.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.language=v(),t.locationType??="street",F(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=x))}_disposeSearch(e){if(!e||!this._stopsToSearches.has(e))return;const t=this._stopsToSearches.get(e);this.removeHandles(t),t.destroy(),this._stopsToSearches.delete(e)}_getEffectiveStops(){return this.viewModel.layer?.stops??this._placeholderStops}_getErrorDescription(){switch(this.viewModel.lastError?.name){case"directions-view-model:unable-to-route":return this.messages.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return this.messages.errors.unableToLoadServiceMetadata;default:return this.messages.errors.unknownError}}_getNetworkFeatureName(e){switch(e.type){case"stop":switch(e.locationType){case"stop":default:return this.messages.networkFeatures.stops.stop;case"waypoint":return this.messages.networkFeatures.stops.waypoint;case"break":return this.messages.networkFeatures.stops.break}case"point-barrier":return this.messages.networkFeatures.pointBarrier;case"polyline-barrier":return this.messages.networkFeatures.polylineBarrier;case"polygon-barrier":return this.messages.networkFeatures.polygonBarrier}}_getRouteCostSummary(){const e=this.viewModel.layer?.routeInfo;if(!e)return null;const t=e.totalDistance??0,i=e.totalDuration??0,{messagesUnits:s,unit:o}=this;return{distance:M(s,t,o),duration:I(i)}}_getStopCostDescription(e){if(!e.directions.length)return;const{totalDistance:t,totalDuration:i}=e.directions.reduce((e,{lines:t})=>{for(const{distance:i,duration:s}of t)e.totalDistance+=i??0,e.totalDuration+=s??0;return e},{totalDistance:0,totalDuration:0}),{messagesUnits:s,unit:o}=this,r=M(s,t,o);return`${I(i)} (${r})`}_getStopSections(){if(!this.viewModel.layer)return null;const{directionPoints:e,directionLines:t,stops:i}=this.viewModel.layer;if(!e||!t)return null;const s=[];let o=null;for(const r of e){const{objectId:e,stopId:a}=r;if(null!=a){const e=i.find(({objectId:e})=>e===a);o&&o.stop===e||(o={stop:e,directions:[]},s.push(o));continue}if(null==o)continue;const n=t.toArray().filter(({directionPointId:t})=>t===e);0!==n.length&&o.directions.push({directionPoint:r,lines:n})}return s}_handleAddStopClick(){const e=new y;this.viewModel.layer?.stops.add(new w({symbol:e}))}_handleAutoSolveChange({target:e}){this.viewModel.autoSolve=e.checked}_handleCreatePolylineBarrierClick(){this.viewModel.create("polyline-barrier")}_handleClearRouteClick(){this._currentFlowItem="primary",this.viewModel.reset()}_handleCreateStopClick(){this.viewModel.create("stop")}_handleDeleteNetworkFeatureClick(e){this.viewModel.remove(e),this.viewModel.autoSolve&&this._solveRouteDebounced()}_handleDeleteStopClick(e){this._getEffectiveStops().remove(e),this._disposeSearch(e),this._solveRouteDebounced()}_handleDepartureDateChange({currentTarget:{value:e}}){Array.isArray(e)||(this.viewModel.departureIsoDate=e,this._solveRouteDebounced())}_handleDepartureTimeChange({currentTarget:{value:e}}){this.viewModel.departureIsoTime=e,this._solveRouteDebounced()}_handleDepartureTimeOptionChange({currentTarget:e}){const{selectedItems:t}=e;t.length&&(this.viewModel.departureOption=t[0].value,this._solveRouteDebounced())}_handleDirectionsFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem="primary"}_handleDirectionTurnItemSelect(e){this._activeManeuver===e?this.zoomToRoute():(this._activeManeuver=e,this.viewModel.centerAt(e.geometry))}_handleDirectionTurnPointerEnter(e){this.viewModel.highlight(e)}_handleDirectionTurnPointerLeave(){this.viewModel.clearHighlights()}_handleEditFlowItemBackClick(e){e.stopPropagation(),this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditingDoneClick(){this.viewModel.stopEditing(),this._currentFlowItem="primary"}_handleEditRouteClick(){this._currentFlowItem="edit",this.viewModel.startEditing()}_handleItemDetailsClick(){const e=this.viewModel.layer?.portalItem;e&&window.open(`${e.portal.url}/home/item.html?id=${e.id}`,"_blank")}_handleLocateStopClick(e){const{view:t}=this;if(!t)return;const i="directions-search-tool";this.removeHandles(i),this._searchTool=new k({stop:e,view:t}),this.addHandles([this._searchTool.on("click",async t=>{if(t.mapPoint&&this._stopsToSearches.has(e)){const i=this._stopsToSearches.get(e),s=await i.search(t.mapPoint),o=s?.results?.[0].results?.[0];if(o){const{feature:t,name:s}=o;i.searchTerm=s,e.geometry=t.geometry}}this.removeHandles(i)}),o(()=>{this._searchTool&&(this.view?.tools.remove(this._searchTool),this._searchTool=null)})],i),t.addAndActivateTool(this._searchTool)}_handleOptimizeStopOrderToggle({target:{expanded:e}}){this.viewModel.routeParameters.findBestSequence=e,this._solveRouteDebounced()}_handlePanToStopClick(e){this.viewModel.centerAt(e)}_handlePreserveFirstStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveFirstStop=e,this._solveRouteDebounced()}_handlePreserveLastStopChange({target:{checked:e}}){this.viewModel.routeParameters.preserveLastStop=e,this._solveRouteDebounced()}_handlePrintPreviewDialogAfterCreate(e){document.body.appendChild(e),e.showModal(),this._printPreviewDialog=e,this.removeHandles(O),this.addHandles([s(e,"close",this._handlePrintPreviewDialogClosed.bind(this)),o(()=>{this._printPreviewDialog&&(document.body.removeChild(this._printPreviewDialog),this._printPreviewDialog=null,this._printPreviewDialogOpen=!1)})],O)}_handlePrintPreviewDialogClick(){this._printPreviewDialogOpen=!0}_handlePrintPreviewDialogCloseClick(){this._printPreviewDialog?.close()}_handlePrintPreviewDialogClosed(){this.removeHandles(O)}_handlePrintPreviewDialogPrintClick(){document.body.classList.add(f.printPreviewMedia),window.print(),document.body.classList.remove(f.printPreviewMedia),this._printPreviewDialog?.close()}_handleResolveRouteClick(){this._solveRouteDebounced()}_handleReverseStopOrderClick(){this._getEffectiveStops().reverse(),this._solveRouteDebounced()}_handleSaveErrorCloseClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveFlowItemBackClick(e){e.stopPropagation(),this._currentFlowItem=this._parentFlowItem}async _handleSaveLayerAs(){const e=g.getDefault();try{await e.signIn()}catch(t){if(n(t)||"identity-manager:user-aborted"===t.name)return;return this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",void(this._saveState="connect-to-portal-error")}this._saveState="fetch-portal-information",this._parentFlowItem=this._currentFlowItem,this._currentFlowItem="save",this._portalUserName=e.user?.username;try{this._portalFolders=await(e.user?.fetchFolders())}catch{return void(this._saveState="fetch-portal-information-error")}this._saveState="save-layer"}_handleSaveLayerClick(){this.viewModel.layer?.save()}_handleSaveLayerButtonClick(){this._saveState="saving";const{layer:e}=this;if(!e||!this._portalFolders)return;const t=this._portalItemNameInput?.value,i=this._portalFolderCombobox?.value,s=this._portalFolders.find(({id:e})=>e===i);e.saveAs({title:t},{folder:s}).then(()=>{e.title=t,this._currentFlowItem=this._parentFlowItem}).catch(()=>{this._saveState="saving-error"})}_handleSaveLayerCancelClick(){this._currentFlowItem=this._parentFlowItem}_handleSaveLayerFolderCreate(e){this._portalFolderCombobox=e}_handleSaveLayerNameCreate(e){this._portalItemNameInput=e}_handleSignInClick(){this.viewModel.load().catch(()=>{})}_handleStopListReorder({detail:{dragEl:e,newIndex:t}}){this._getEffectiveStops().reorder(e.value,t),this._solveRouteDebounced()}_handleTravelModeChange({currentTarget:{selectedItems:e}}){e.length&&(this.viewModel.selectedTravelMode=e[0].value,this._solveRouteDebounced())}_handleViewDrivingDirectionsClick(){this._currentFlowItem="directions"}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){for(const t of e.viewModel.defaultSources)t.autoNavigate=!1}_renderClearRouteAction(e){return A("calcite-action",{bind:this,icon:"trash",key:"clear-route",onclick:this._handleClearRouteClick,...e,text:this.messages.common.clear,textEnabled:!0})}_renderDeleteStopAction(e){return A("calcite-action",{icon:"trash",onclick:this._handleDeleteStopClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.deleteStop,title:this.messages.deleteStop})}_renderDepartureTime(){const{DEPART_AT:e,NOW:t,UNSPECIFIED:i}=P;return A("calcite-label",{class:f.departureTime,key:"departure-time"},this.messages.departureTime,A("calcite-combobox",{bind:this,clearDisabled:!0,label:this.messages.departureTime,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:this._handleDepartureTimeOptionChange},A("calcite-combobox-item",{heading:this.messages.leaveNow,key:t,label:this.messages.leaveNow,selected:this.viewModel.departureOption===t,value:t}),A("calcite-combobox-item",{heading:this.messages.departAt,key:e,label:this.messages.departAt,selected:this.viewModel.departureOption===e,value:e}),A("calcite-combobox-item",{heading:this.messages.timeUnspecified,key:i,label:this.messages.timeUnspecified,selected:this.viewModel.departureOption===i,value:i})))}_renderDepartureTimeOptions(){return this.viewModel.departureOption!==P.DEPART_AT?null:A("div",{class:f.departureTimeOptions},A("calcite-input-date-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoDate,onCalciteInputDatePickerChange:this._handleDepartureDateChange}),A("calcite-input-time-picker",{bind:this,scale:"s",value:this.viewModel.departureIsoTime,onCalciteInputTimePickerClose:this._handleDepartureTimeChange}))}_renderDirectionsFlowItem(){if("directions"!==this._currentFlowItem)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return A("calcite-flow-item",{bind:this,key:"directions-flow-item",overlayPositioning:"fixed",selected:"directions"===this._currentFlowItem,onCalciteFlowItemBack:this._handleDirectionsFlowItemBackClick},A("div",{class:f.directionsHeader,slot:"header-content"},A("div",{class:f.headerStops},A("span",null,this.messages.from)," ",A("span",{class:f.directionsHeaderStopName},o),A("span",null,this.messages.to)," ",A("span",{class:f.directionsHeaderStopName},r)),A("div",{class:f.flexColumn},A("span",null,`${i} (${t})`),s?A("span",null,s):null)),this._renderRouteLayerActions({slot:"header-menu-actions"}),A("calcite-accordion",{class:f.accordion,iconPosition:"start",selectionMode:"single"},this._sections.map((e,t)=>this._renderDirectionSection(e,t))))}_renderDirectionSection(e,t){const{stop:i,directions:s}=e,{name:o}=i,r=0===t,a=this._getStopCostDescription(e);return A("calcite-accordion-item",{description:a,expanded:r,heading:o??"",key:`stop-${t}`},A("calcite-action",{icon:"zoom-to-object",onclick:this._handlePanToStopClick.bind(this,i),slot:"actions-end",text:this.messages.panToStop,title:this.messages.panToStop}),this._renderDirectionTurns(s))}_renderDirectionTurns(e){return A("calcite-list",{label:this.messages.drivingDirections,selectionMode:"none"},e.map((e,t)=>{const{directionPoint:i,lines:s}=e,o=s[0],{distance:r,duration:a}=o,n=M(this.messagesUnits,r??0,this.unit),l=I(a??0),c=n&&l?`${n} | ${l}`:`${n||l}`,d=N(i),h=T(i.directionPointType);return A("calcite-list-item",{class:f.labelNoBottomMargin,key:`driving-direction-${t}`,onpointerenter:this._handleDirectionTurnPointerEnter.bind(this,o),onpointerleave:this._handleDirectionTurnPointerLeave.bind(this),onCalciteListItemSelect:this._handleDirectionTurnItemSelect.bind(this,o)},A("calcite-icon",{icon:h,slot:"content-start"}),A("div",{slot:"content"},A("calcite-label",{layout:"inline",scale:"s"},d),A("calcite-label",{layout:"inline",scale:"s"},c)))}))}_renderEditFlowItem(){return"edit"!==this._currentFlowItem?null:A("calcite-flow-item",{bind:this,heading:this.messages.editRoute,headingLevel:this.headingLevel,key:"edit-flow-item",loading:"routing"===this.viewModel.state,selected:"edit"===this._currentFlowItem,onCalciteFlowItemBack:this._handleEditFlowItemBackClick},A("div",{class:f.flexColumn,key:"edit-container"},A("div",{class:f.editToolbarContainer},A("calcite-label",{layout:"inline",scale:"s"},this.messages.automaticallySolve,A("calcite-switch",{bind:this,checked:this.viewModel.autoSolve,scale:"s",onCalciteSwitchChange:this._handleAutoSolveChange})),A("div",{class:f.editToolbar},A("calcite-action",{bind:this,disabled:!this.viewModel.layer||this.viewModel.layer.stops.length>=this.maxStops,icon:"flag",onclick:this._handleCreateStopClick,scale:"s",text:this.messages.networkFeatures.stops.stop,textEnabled:!0}),A("calcite-action",{bind:this,icon:"line",onclick:this._handleCreatePolylineBarrierClick,scale:"s",text:this.messages.barrier,textEnabled:!0}),A("calcite-action",{bind:this,class:f.solveRoute,disabled:this.viewModel.autoSolve,icon:"refresh",onclick:this._handleResolveRouteClick,scale:"s",text:this.messages.solve,textEnabled:!0}))),A("div",{class:f.selectedFeatureContainer},A("calcite-list",{label:this.messages.selectedNetworkFeatures,scale:"s",selectionMode:"none"},this.viewModel.selectedNetworkFeatures?.toArray().map((e,t)=>A("calcite-list-item",{description:this._getNetworkFeatureName(e),key:`network-feature-${t}`,label:e.name??e.objectId?.toString()??this.messages.unnamed},A("calcite-action",{icon:"trash",onclick:this._handleDeleteNetworkFeatureClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.common.delete}))))),A("div",{class:f.editFooter},this._renderEditFooterContent())))}_renderEditFooterContent(){return this.viewModel.lastError?this._renderErrorNotice():A("calcite-button",{appearance:"outline-fill",bind:this,onclick:this._handleEditingDoneClick,width:"full"},this.messages.common.done)}_renderErrorNotice(){return A("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this._getErrorDescription()))}_renderFooter(){if(!this.viewModel.layer)return A("div",{class:f.primaryFooter,key:"footer-missing-layer"},A("calcite-notice",{icon:"information",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.missingLayer)));if("unauthenticated"===this.viewModel.state)return A("div",{class:f.primaryFooterCentered,key:"footer-sign-in"},A("calcite-label",null,this.messages.signInRequired),A("calcite-button",{bind:this,onclick:this._handleSignInClick},this.messages.common.auth.signIn));if("routing"===this.viewModel.state)return A("div",{class:this.classes(f.primaryFooter,f.primaryFooterLoader),key:"footer-routing"},A("calcite-loader",{label:this.messages.solve,scale:"s"}));if("error"===this.viewModel.state)return A("div",{class:f.primaryFooter,key:"footer-service-error"},this._renderErrorNotice());if(!this.viewModel.layer?.routeInfo)return A("div",{class:f.primaryFooter,key:"footer-unsolved-route"},A("calcite-notice",{icon:"information",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.directionsPlaceholder)));const e=this._getRouteCostSummary();if(!e||!this.viewModel.layer?.directionPoints)return A("div",{class:f.primaryFooter,key:"footer-invalid-route"},A("calcite-notice",{icon:"exclamation-mark-triangle",kind:"danger",open:!0},A("calcite-label",{class:f.labelNoBottomMargin,slot:"message"},this.messages.invalidRoute)));const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel;return A("div",{class:f.routeItem,key:"footer-directions-summary"},A("button",{"aria-busy":"false","aria-label":this.messages.viewDrivingDirections,"aria-live":"polite",bind:this,class:f.routeItemButton,onclick:this._handleViewDrivingDirectionsClick,title:this.messages.viewDrivingDirections,type:"button"},A("div",{class:f.routeItemButtonContent},A("span",{class:f.routeItemLabel},`${i} (${t})`),A("span",{class:f.routeItemDescription},s)),A("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s"})),A("calcite-action-menu",{label:"test"},A("calcite-action",{icon:"ellipsis",key:"route-actions",slot:"trigger",text:"Route actions"}),this._renderRouteLayerActions()))}_renderInteractiveRouteActions(){return A("div",{class:f.actionContainer,key:f.actionContainer},A("calcite-button",{appearance:"outline",bind:this,class:f.addStopButton,disabled:this._getEffectiveStops().length>=this.maxStops,iconStart:"plus",kind:"neutral",label:this.messages.addStop,onclick:this._handleAddStopClick,title:this.messages.addStop,width:"half"},this.messages.addStop),this.visibleElements.editRouteButton?A("calcite-button",{appearance:"outline",bind:this,class:f.editRouteButton,disabled:"2d"!==this.viewModel.view?.type,iconStart:"pencil",kind:"neutral",label:this.messages.editRoute,onclick:this._handleEditRouteClick,title:this.messages.editRoute,width:"half"},this.messages.editRoute):null)}_renderLocateStopAction(e){if(null!=e.name||null!=e.geometry)return null;const t=this._getEffectiveStops().indexOf(e),i=!!this.view?.activeTool&&this.view.activeTool===this._searchTool&&this._searchTool.stop===e;return A("calcite-action",{active:i,icon:"crosshair",key:`stop-location-action-${t}`,onclick:this._handleLocateStopClick.bind(this,e),scale:"s",slot:"actions-end",text:this.messages.pickALocationOnTheMap,title:this.messages.pickALocationOnTheMap})}_renderOptimizeStopOrder(){const{routeParameters:e}=this.viewModel,{findBestSequence:t,preserveFirstStop:i,preserveLastStop:s}=e;return A("calcite-block-section",{bind:this,class:f.optimizeSection,text:this.messages.optimizeOrder,toggleDisplay:"switch",onCalciteBlockSectionToggle:this._handleOptimizeStopOrderToggle},t?[A("calcite-label",{class:f.optimizeSwitches,key:"preserve-first-stop",layout:"inline-space-between"},this.messages.preserveFirstStop,A("calcite-switch",{bind:this,checked:i,scale:"s",onCalciteSwitchChange:this._handlePreserveFirstStopChange})),A("calcite-label",{class:f.optimizeSwitches,key:"preserve-last-stop",layout:"inline-space-between"},this.messages.preserveLastStop,A("calcite-switch",{bind:this,checked:s,scale:"s",onCalciteSwitchChange:this._handlePreserveLastStopChange}))]:null)}_renderPrimaryFlowItem(){return A("calcite-flow-item",{key:"primary-flow-item",loading:"initializing"===this.viewModel.state,selected:"primary"===this._currentFlowItem},A("calcite-panel",{class:f.primaryFlowItem,disabled:!this.viewModel.layer||"unauthenticated"===this.viewModel.state||"error"===this.viewModel.state&&!this.viewModel.serviceDescription},this._renderStops(),this._renderInteractiveRouteActions(),this._renderSeparator(),this._renderRouteSolveOptions()),this._renderFooter())}_renderPrintDocument(){if(!this._printPreviewDialogOpen)return null;const e=this._getRouteCostSummary();if(!this._sections||!e)return null;const{distance:t,duration:i}=e,{formattedEta:s}=this.viewModel,o=this._sections.at(0)?.stop.name??"",r=this._sections.at(-1)?.stop.name??"";return A("dialog",{afterCreate:this._handlePrintPreviewDialogAfterCreate,bind:this,class:f.printPreviewDialog},A("div",{class:f.printPreviewContent},A("div",{class:f.printPreviewHeader},A("div",{class:f.printPreviewHeaderLabel},A("div",{class:f.headerStops},A("span",null,this.messages.from)," ",A("span",{class:f.directionsHeaderStopName},o),A("span",null,this.messages.to)," ",A("span",{class:f.directionsHeaderStopName},r))),A("div",{class:this.classes(f.printPreviewHeaderButtons,f.printPreviewHideOnPrint)},A("calcite-button",{autofocus:!0,bind:this,class:f.printPreviewDialogPrint,iconStart:"print",onclick:this._handlePrintPreviewDialogPrintClick},this.messages.common.print),A("calcite-button",{appearance:"outline",bind:this,class:f.printPreviewDialogClose,iconStart:"x-circle",onclick:this._handlePrintPreviewDialogCloseClick},this.messages.common.close))),A("div",{class:f.directionsHeader},A("span",null,`${i} (${t})`),s?A("span",null,s):null),this._sections.map((e,t)=>this._renderPrintSection(e,t))))}_renderPrintManeuver(e,t){const{directionPoint:i,lines:s}=e,{distance:o,duration:r}=s.at(0)??{},a=M(this.messagesUnits,o??0,this.unit),n=I(r??0),l=a&&n?`${a} | ${n}`:`${a||n}`,c=N(i),d=T(i.directionPointType);return A("div",{class:this.classes(f.flexRow,f.printPreviewAvoidPageBreak),key:`direction-${t}`},A("calcite-icon",{icon:d}),A("div",{class:f.flexColumn},A("span",null,c),A("span",null,l)))}_renderPrintRouteAction(e){if(!this.visibleElements.printButton)return null;const t=!this.viewModel.layer?.routeInfo;return A("calcite-action",{bind:this,disabled:t,icon:"print",key:"print-route",onclick:this._handlePrintPreviewDialogClick,...e,text:this.messages.common.print,textEnabled:!0})}_renderPrintSection({stop:e,directions:t},i){return A("div",{class:f.printPreviewSection,key:`section-${i}`},A("span",{class:f.directionsHeaderStopName},e.name??""),t.map((e,t)=>this._renderPrintManeuver(e,t)))}_renderRouteLayerActions(e){return[this._renderClearRouteAction(e),this._renderSaveLayerAction(e),this._renderSaveLayerAsAction(e),this._renderPrintRouteAction(e),this._renderViewItemDetailsAction(e)]}_renderRouteSolveOptions(){return A("div",{class:f.marginInlineMedium,key:"route-solve-options"},this._renderTravelModes(),this._renderDepartureTime(),this._renderDepartureTimeOptions(),this._renderOptimizeStopOrder())}_renderSaveContent(){switch(this._saveState){case"initialized":return this._renderSaveInitialized();case"connect-to-portal":return this._renderSaveProcessing(this.messages.identity.lblSigning);case"connect-to-portal-error":return this._renderSaveError(this.messages.errors.authenticating);case"fetch-portal-information":return this._renderSaveProcessing(this.messages.processing.fetching);case"fetch-portal-information-error":return this._renderSaveError(this.messages.errors.fetching);case"save-layer":return this._renderSaveLayerSettings();case"saving":return this._renderSaveProcessing(this.messages.processing.saving);case"saving-error":return this._renderSaveError(this.messages.errors.saving)}}_renderSaveError(e){return A("calcite-panel",{class:f.paddingMedium,key:"save-layer-error"},A("div",{class:f.saveError},A("calcite-icon",{class:f.saveErrorIcon,icon:"exclamation-mark-triangle",scale:"l",textLabel:this.messages.common.errorMessage}),A("calcite-label",{class:f.saveErrorLabel},e)),A("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveErrorCloseClick,slot:"footer-actions",width:"full"},this.messages.common.close))}_renderSaveInitialized(){return A("calcite-panel",{class:f.paddingMedium,key:"save-layer-initialized"})}_renderSaveFlowItem(){return"save"!==this._currentFlowItem?null:A("calcite-flow-item",{bind:this,heading:this.messages.saveLayer,headingLevel:this.headingLevel,key:"save-layer-flow-item",selected:"save"===this._currentFlowItem,onCalciteFlowItemBack:this._handleSaveFlowItemBackClick},this._renderSaveContent())}_renderSaveLayerAction(e){if(!this.visibleElements.saveButton)return null;const t=this.viewModel.layer,i=t?.routeInfo,s=t?.portalItem?.itemControl;return A("calcite-action",{bind:this,disabled:!(!!i&&("admin"===s||"update"===s)),icon:"save",key:"save-route",onclick:this._handleSaveLayerClick,...e,text:this.messages.common.save,textEnabled:!0})}_renderSaveLayerAsAction(e){if(!this.visibleElements.saveAsButton)return null;const t=!this.viewModel.layer?.routeInfo;return A("calcite-action",{disabled:t,icon:"save-as",key:"save-as-route",onclick:()=>{this._handleSaveLayerAs()},...e,text:this.messages.common.saveAs,textEnabled:!0})}_renderSaveLayerSettings(){if(null==this.layer||null==this._portalFolders||null==this._portalUserName)return this._renderSaveInitialized();const{stops:e}=this.layer,t=`${e.at(0).name} - ${e.at(-1).name}`,i=[A("calcite-combobox-item",{heading:`${this._portalUserName} (${this.messages.common.home})`,key:f.folderHome,selected:!0,value:f.folderHome}),...this._portalFolders.map(e=>A("calcite-combobox-item",{heading:e.title??"",key:`${f.folder}-${e.id}`,value:e.id}))];return A("calcite-panel",{key:"save-layer-panel"},A("div",{class:f.paddingMedium},A("calcite-label",null,this.messages.layerName,A("calcite-input",{afterCreate:this._handleSaveLayerNameCreate,bind:this,label:this.messages.layerName,value:t})),A("calcite-label",null,this.messages.saveInFolder,A("calcite-combobox",{afterCreate:this._handleSaveLayerFolderCreate,bind:this,clearDisabled:!0,label:this.messages.saveInFolder,overlayPositioning:"fixed",selectionMode:"single-persist"},i))),A("calcite-button",{bind:this,onclick:this._handleSaveLayerButtonClick,slot:"footer-actions",width:"full"},this.messages.common.save),A("calcite-button",{appearance:"outline",bind:this,onclick:this._handleSaveLayerCancelClick,slot:"footer-actions",width:"full"},this.messages.common.cancel))}_renderSaveProcessing(e){return A("calcite-panel",{class:f.marginInlineMedium,key:"save-layer-processing"},A("calcite-loader",{class:f.saveProcessLoader,label:e,text:e}))}_renderSeparator(){return A("div",{class:f.separator})}_renderStop(e){const t=this.acquireSearch(e);null!=e.name&&(t.searchTerm=e.name);const i=this._getEffectiveStops(),s=this._renderLocateStopAction(e),o=i.length>2&&this._renderDeleteStopAction(e);return A("calcite-list-item",{key:e,value:e},s,o,A("div",{class:f.stopItem,slot:"content"},t.render()))}_renderStops(){const e=this._getEffectiveStops();for(const t of this._stopsToSearches.keys())e.includes(t)||this._disposeSearch(t);return A("div",{class:f.stopContainer,key:f.stopContainer},A("calcite-list",{bind:this,class:f.stopList,dragEnabled:!0,label:this.messages.widgetLabel,scale:"s",onCalciteListOrderChange:this._handleStopListReorder},e.toArray().map(e=>this._renderStop(e))),2===e.length&&A("calcite-action",{bind:this,icon:"arrow-up-down",onclick:this._handleReverseStopOrderClick,scale:"s",text:this.messages.reverseStops,title:this.messages.reverseStops}))}_renderTravelMode(e){const{id:t,name:i}=e;return A("calcite-combobox-item",{heading:i,key:t,label:i,selected:this.viewModel.selectedTravelMode?.id===t,value:e})}_renderTravelModes(){return this.viewModel.travelModes.length?A("calcite-label",{key:"travel-modes"},this.messages.mode,A("calcite-combobox",{bind:this,clearDisabled:!0,label:this.messages.mode,overlayPositioning:"fixed",selectionMode:"single-persist",onCalciteComboboxChange:this._handleTravelModeChange},this.viewModel.travelModes.map(e=>this._renderTravelMode(e)))):null}_renderViewItemDetailsAction(e){return this.visibleElements.layerDetails?A("calcite-action",{bind:this,disabled:!this.viewModel.layer?.portalItem,icon:"launch",key:"open-route-details-link",onclick:this._handleItemDetailsClick,...e,text:this.messages.viewLayerDetails,textEnabled:!0}):null}async _solveRoute(){this.viewModel.updateDepartureTime();if(!((this.viewModel.layer?.stops.filter(({geometry:e})=>!!e).length??0)<2))try{await this.viewModel.getDirections()}catch{}}};e([p()],j.prototype,"_printPreviewDialogOpen",void 0),e([p()],j.prototype,"_currentFlowItem",void 0),e([p()],j.prototype,"_saveState",void 0),e([p()],j.prototype,"_searchTool",void 0),e([p()],j.prototype,"apiKey",null),e([p(_)],j.prototype,"defaultUnit",void 0),e([p()],j.prototype,"goToOverride",null),e([p()],j.prototype,"headingLevel",void 0),e([p()],j.prototype,"icon",null),e([p()],j.prototype,"label",null),e([p({readOnly:!0})],j.prototype,"lastRoute",null),e([p()],j.prototype,"layer",null),e([p()],j.prototype,"maxStops",null),e([p(),L("esri/widgets/Directions/t9n/Directions")],j.prototype,"messages",void 0),e([p(),L("esri/core/t9n/Units")],j.prototype,"messagesUnits",void 0),e([p()],j.prototype,"searchProperties",void 0),e([p()],j.prototype,"unit",null),e([p()],j.prototype,"view",null),e([p({type:C})],j.prototype,"viewModel",void 0),e([p({type:D,nonNullable:!0})],j.prototype,"visibleElements",void 0),j=e([m("esri.widgets.Directions")],j);const B=j;export{B as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../core/Error.js";import{makeHandle as i,abortHandle as o}from"../../core/handleUtils.js";import{isAborted as s}from"../../core/promiseUtils.js";import{watch as r}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 l}from"../../core/accessorSupport/decorators/subclass.js";import{isSubtypeSublayer as n}from"../../layers/support/layerUtils.js";import{createFeatureServices as d}from"../../rest/featureService/utils.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as u}from"../../views/support/HighlightDefaults.js";import p from"./AddAssociationWorkflowData.js";import w from"./Workflow.js";import{fetchFullFeatures as h}from"./workflowUtils.js";import y from"../FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js";import{getFeatureTitle as m}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";var A;const f={exit:Symbol()};let g=class extends w{static{A=this}constructor(t){super(t),this._utilityNetworkAssociationAddAssociationViewModel=new y,this._highlightHelper=null,this.sourceFeatureItem=null,this.type="add-association"}initialize(){const{data:t}=this,{view:e}=t.viewModel;e&&(this._highlightHelper=new c({view:e,highlightName:u}),this.addHandles(i(()=>this._highlightHelper?.removeAll())));const s=new AbortController;this.addHandles(o(s)),this._updatingHandles.addPromise(this._setup(s))}get editorItem(){return this.data.editorItem}get featureFormViewModel(){return this._featureFormViewModel}get utilityNetworkAssociationAddAssociationViewModel(){return this._utilityNetworkAssociationAddAssociationViewModel}get hasPendingEdits(){return!!this._utilityNetworkAssociationAddAssociationViewModel.selectedFeature}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get reliesOnOwnerAdminPrivileges(){return this.editorItem.capabilities.create.reliesOnOwnerAdminPrivileges}async enter(){this._addHandles()}exit(){this.removeHandles(f.exit)}async start(){return await super.start(),null}async _setup(t){const{data:i}=this,{feature:o}=i;try{const[e]=await h([o],o.sourceLayer,i.viewModel.view.spatialReference,t.signal);if(s(t))return;const r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer?await e.sourceLayer.getFeatureTitle(e):m(e);if(s(t))return;this.sourceFeatureItem={feature:o,label:r},this._initializeUtilityNetworkAssociationAddAssociationViewModel()}catch(r){await this.cancel({force:!0,error:new e("editor:failed-to-fetch-full-feature","Failed to retrieve all information for this feature. The update cannot proceed.",{detail:{error:r}})})}}_initializeUtilityNetworkAssociationAddAssociationViewModel(){const{viewModel:{view:t},utilityNetwork:e,associationType:i}=this.data,o=this._utilityNetworkAssociationAddAssociationViewModel;o.graphic=this.sourceFeatureItem.feature,o.map=t?.map,o.utilityNetwork=e,o.layer=this.layer,o.associationType=i,o.highlightHelper=this._highlightHelper,e.networkSystemLayers.loadAssociationsTable()}_addHandles(){const t=this._utilityNetworkAssociationAddAssociationViewModel;this.addHandles([r(()=>t.selectedLayer,t=>{t&&this.go("add-association-select-feature")}),r(()=>t.selectedFeature,t=>{t&&this.go("add-association-create-association")})],f.exit)}static async create(t){const e=new A({data:await p.create(t),onCommit:this._onCommitFactory(t.applyEditsFeatureService)});return e._set("steps",this._createWorkflowSteps(e)),e}static _createWorkflowSteps(t){return[{id:"add-association-select-layer",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedLayer=null,e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-select-feature",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-create-association",async setUp(){},async tearDown(){}}]}static{this._onCommitFactory=t=>async i=>{const{feature:o,utilityNetwork:s,associationInput:r}=i,{utilityNetworkAssociationAddAssociationViewModel:a}=i.viewModel,{association:l}=a;await s.networkSystemLayers.loadAssociationsTable();const c=s?.generateAddAssociations([l]);if(!c)throw new e("editor:failed-to-add-association","Could not create payload needed to add association");const u=o.sourceLayer,p=n(u)&&u.parent?u.parent:u,w=d([p]),h=w.values().next().value?.featureService;if(!h)throw new e("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(h?.load());const y=s?.gdbVersion??void 0;await t(h,[c],{gdbVersion:y}),await r.refresh()}}};t([a()],g.prototype,"_utilityNetworkAssociationAddAssociationViewModel",void 0),t([a()],g.prototype,"_featureFormViewModel",void 0),t([a()],g.prototype,"editorItem",null),t([a()],g.prototype,"featureFormViewModel",null),t([a()],g.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),t([a()],g.prototype,"sourceFeatureItem",void 0),t([a()],g.prototype,"hasPendingEdits",null),t([a()],g.prototype,"layer",null),t([a()],g.prototype,"parent",null),t([a()],g.prototype,"parentLayer",null),t([a()],g.prototype,"reliesOnOwnerAdminPrivileges",null),g=A=t([l("esri.widgets.Editor.AddAssociationWorkflow")],g);export{g as AddAssociationWorkflow};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Error.js";import{makeHandle as i,abortHandle as o}from"../../core/handleUtils.js";import{isAborted as s}from"../../core/promiseUtils.js";import{watch as r}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 l}from"../../core/accessorSupport/decorators/subclass.js";import{isSubtypeSublayer as n}from"../../layers/support/layerUtils.js";import{createFeatureServices as d}from"../../rest/featureService/utils.js";import c from"../../views/draw/support/HighlightHelper.js";import{temporaryHighlightName as u}from"../../views/support/HighlightDefaults.js";import p from"./AddAssociationWorkflowData.js";import w from"./Workflow.js";import{fetchFullFeatures as h}from"./workflowUtils.js";import m from"../FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js";import{getFeatureTitle as y}from"../support/UtilityNetworkAssociations/utils/getFeatureTitle.js";var A;const f={exit:Symbol()};let g=class extends w{static{A=this}constructor(t){super(t),this._utilityNetworkAssociationAddAssociationViewModel=new m,this._highlightHelper=null,this.sourceFeatureItem=null,this.type="add-association"}initialize(){const{data:t}=this,{view:e}=t.viewModel;e&&(this._highlightHelper=new c({view:e,highlightName:u}),this.addHandles(i(()=>this._highlightHelper?.removeAll())));const s=new AbortController;this.addHandles(o(s)),this._updatingHandles.addPromise(this._setup(s))}get editorItem(){return this.data.editorItem}get formViewModel(){return this._formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){return this._utilityNetworkAssociationAddAssociationViewModel}get hasPendingEdits(){return!!this._utilityNetworkAssociationAddAssociationViewModel.selectedFeature}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get reliesOnOwnerAdminPrivileges(){return this.editorItem.capabilities.create.reliesOnOwnerAdminPrivileges}async enter(){this._addHandles()}exit(){this.removeHandles(f.exit)}async start(){return await super.start(),null}async _setup(t){const{data:i}=this,{feature:o}=i;try{const[e]=await h([o],o.sourceLayer,i.viewModel.view.spatialReference,t.signal);if(s(t))return;const r=e.sourceLayer&&"getFeatureTitle"in e.sourceLayer?await e.sourceLayer.getFeatureTitle(e):y(e);if(s(t))return;this.sourceFeatureItem={feature:o,label:r},this._initializeUtilityNetworkAssociationAddAssociationViewModel()}catch(r){await this.cancel({force:!0,error:new e("editor:failed-to-fetch-full-feature","Failed to retrieve all information for this feature. The update cannot proceed.",{detail:{error:r}})})}}_initializeUtilityNetworkAssociationAddAssociationViewModel(){const{viewModel:{view:t},utilityNetwork:e,associationType:i}=this.data,o=this._utilityNetworkAssociationAddAssociationViewModel;o.graphic=this.sourceFeatureItem.feature,o.map=t?.map,o.utilityNetwork=e,o.layer=this.layer,o.associationType=i,o.highlightHelper=this._highlightHelper,e.networkSystemLayers.loadAssociationsTable()}_addHandles(){const t=this._utilityNetworkAssociationAddAssociationViewModel;this.addHandles([r(()=>t.selectedLayer,t=>{t&&this.go("add-association-select-feature")}),r(()=>t.selectedFeature,t=>{t&&this.go("add-association-create-association")})],f.exit)}static async create(t){const e=new A({data:await p.create(t),onCommit:this._onCommitFactory(t.applyEditsFeatureService)});return e._set("steps",this._createWorkflowSteps(e)),e}static _createWorkflowSteps(t){return[{id:"add-association-select-layer",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedLayer=null,e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-select-feature",async setUp(){const{utilityNetworkAssociationAddAssociationViewModel:e}=t.data.viewModel;e&&(e.selectedFeature=null,e.association=null)},async tearDown(){}},{id:"add-association-create-association",async setUp(){},async tearDown(){}}]}static{this._onCommitFactory=t=>async i=>{const{feature:o,utilityNetwork:s,associationInput:r}=i,{utilityNetworkAssociationAddAssociationViewModel:a}=i.viewModel,{association:l}=a;await s.networkSystemLayers.loadAssociationsTable();const c=s?.generateAddAssociations([l]);if(!c)throw new e("editor:failed-to-add-association","Could not create payload needed to add association");const u=o.sourceLayer,p=n(u)&&u.parent?u.parent:u,w=d([p]),h=w.values().next().value?.featureService;if(!h)throw new e("editor:failed-to-delete-association","Could not retrieve feature service needed to delete association");await(h?.load());const m=s?.gdbVersion??void 0;await t(h,[c],{gdbVersion:m}),await r.refresh()}}};t([a()],g.prototype,"_utilityNetworkAssociationAddAssociationViewModel",void 0),t([a()],g.prototype,"_formViewModel",void 0),t([a()],g.prototype,"editorItem",null),t([a()],g.prototype,"formViewModel",null),t([a()],g.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),t([a()],g.prototype,"sourceFeatureItem",void 0),t([a()],g.prototype,"hasPendingEdits",null),t([a()],g.prototype,"layer",null),t([a()],g.prototype,"parent",null),t([a()],g.prototype,"reliesOnOwnerAdminPrivileges",null),g=A=t([l("esri.widgets.Editor.AddAssociationWorkflow")],g);export{g as AddAssociationWorkflow};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as n,destroyMaybe as l}from"../../core/maybe.js";import{debounce as d,isPromiseLike as c}from"../../core/promiseUtils.js";import{watch as u,when as h,initial as p,whenOnce as m,syncAndInitial as f}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedTemplateOrMetadata as v,isSharedTemplate as F,isStandardFeatureTemplate as _}from"../../editing/templateUtils.js";import b from"../../layers/GraphicsLayer.js";import{isTable as M}from"../../layers/support/layerUtils.js";import{isNumber as I}from"../../support/guards.js";import{getDisplayedSymbol as V}from"../../symbols/support/symbolUtils.js";import{getDrawHelpMessage as k}from"../../views/draw/support/helpMessageUtils.js";import S from"../../views/draw/support/HighlightHelper.js";import A from"../../views/interactive/sketch/SketchOptions.js";import C from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as P}from"../../views/support/HighlightDefaults.js";import T from"./CreateFeaturesWorkflowData.js";import{isModelUpload as E,handleModelUpload as H}from"./modelUploadUtils.js";import L from"./Workflow.js";import{createToolFromGeometryType as U,findEditorItemForLayer as j,getServiceEditsFromWorkflowData as x,getServiceInfoForLayer as O,orderEditsByRelationshipDependencies as z,getFullTemplateForCreationInfo as W,getServiceLayersById as D,startCreatingNewFeature as R,findLayerInfo as G,updateGraphicSymbolWhenRequired as N,isTerminalUpdateEventType as K,getVisualVariableAttributes as Z,startUpdatingFeatureGeometry as q,createWorkflowSteps as B,avoidFeatureTemplateSelectionWithOnlyOneItem as J,getCreationAttributes as Q,setUpSketchCreateWatchers as X,setRelationshipFields as Y,prepareAttachmentsForCreateFeaturesWorkflow as $,showProgressCursor as ee,setVisualVariablesAndElevationInfoForUpdate as te,visualVariableInteractiveUpdate as ae}from"./workflowUtils.js";import ie from"../FeatureForm/FeatureFormViewModel.js";import re from"../Sketch/SketchViewModel.js";var se;const oe=Symbol(),ne=Symbol(),le=Symbol(),de=Symbol(),ce={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let ue=se=class extends L{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._featureFormViewModel=new ie,this._sketchLayer=null,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get featureFormViewModel(){return this._featureFormViewModel}get hasPendingEdits(){if(this.pendingFeatures.some(e=>!!this.data.getEditsForPendingFeature(e)?.modified))return!0;const{creationInfo:e,upload:t}=this.data,{activeComponent:a,createGraphic:i}=this._sketchViewModel,r=i?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==a?.type&&"draw-3d"!==a?.type)&&a.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!E(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const{_sketchViewModel:a}=this,i=e.layer.geometryType,r=a.createGraphic;if("mesh"===i){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then(e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage});const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(r,e):void 0}const{activeCreateToolDrawMode:s,activeTool:o}=a;return k("rectangle"===o||"circle"===o?o:i,r?.geometry,s)}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter(e=>this.data.isDisplayable(e)).length}get parent(){return this.data.parent}get parentLayer(){return this.parent?.data.editorItem.layer}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(v(this.data.fullTemplate)){const{tool:t}=U(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...ce[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([le])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),M(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(){const{featureFormViewModel:e}=this;if(e.pendingSubtypeChoice)return;e.submit(),this._stashValidationState();const t=this.data.selectedPendingFeature,a=this._hasValidationErrors(t)?t:this.data.pendingFeatures.find(e=>this._hasValidationErrors(e));return a?(await this._startUpdating({feature:a}),void e?.submit()):super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||E(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||E(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.removeGraphic(e))}static create(e){const{addAttachmentsCallback:t,applyEdits:a,applyEditsFeatureService:i,isNested:r,creationInfo:s,parent:o,snappingManager:n,startAt:l,viewModel:d}=e,c=e.sketchOptions??new A,u=s?.layer,h=u?j(d.editorItems,u):void 0,p=new se({data:new T({creationInfo:s,editorItem:h,parent:o,sketchOptions:c,snappingManager:n,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;p._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:o}=r,n=o.capabilities?.editing.supportsGlobalId&&"globalIdField"in o,l=p._attachmentFileInfos,{fullTemplate:c}=e,u=x(p.data),h=F(c)&&u;if(n){if(fe(s),h){let t=ge(u,l);const a=await O(o,d.view);a&&(t=z({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=we(s,l);await a(o,e,{globalIdUsed:!0})}return}const m=h?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(o,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map(e=>{if(e?.addFeatureResults)return t(o,me(s,e.addFeatureResults,o,l))}))}});return p._set("steps",this._createWorkflowSteps(p,l)),p}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i(()=>e.effect=t)}const t=e.opacity;return e.opacity=.7,i(()=>e.opacity=t)}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await W(t,a);if(e.fullTemplate=i,i&&F(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:await D(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(ne);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await R(this._sketchViewModel,this._sketchLayer,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._featureFormViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=n(this._featureFormHandle),this._featureFormViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||await(this.data.viewModel.activeWorkflow?.previous())}_stashValidationState(){const e=this._featureFormViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._featureFormViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_featureFormViewModel:o,_sketchViewModel:l}=this,{creationInfo:d,viewModel:c}=a,{attachmentsViewModel:h,layerInfos:p,view:m}=c;if(!m||!d)return;n(this._featureFormHandle);const f=e.sourceLayer,w=G(p,f),g=w?.formTemplate,y=m.spatialReference;o.set({editType:"INSERT",feature:e,formTemplate:g,spatialReference:y,map:m.map}),"add"!==h.mode&&"edit"!==h.mode||await(c.activeWorkflow?.previous()),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach(({file:e,form:t})=>h.addFile(e,t)),await N(e,s,"2d"===m.type?m.scale:null);const v=a.getEditsForPendingFeature(e);this._featureFormHandle=r([o.on("value-change",async({fieldName:t,value:a})=>{if(v?.updateAttributes(o.getValues()),I(a)){const e=this._visualVariableAttributes;e.size&&!e.size.isUpdatingInteractively&&t===e.size.field&&e.size.setInitialValue(a),e.rotation&&!e.rotation.isUpdatingInteractively&&t===e.rotation.field&&e.rotation.setInitialValue(a)}await N(e,s,"2d"===m.type?m.scale:null)}),l.on(["update","undo","redo"],e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&K(e.toolEventInfo.type))&&o.notifyFeatureGeometryChanged()}),u(()=>o.feature?.sourceLayer,t=>e.sourceLayer=t),u(()=>[o.feature,o.submittable],()=>this._stashValidationState())]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchLayer:a,_sketchViewModel:i,data:r}=this,{creationInfo:s,viewModel:o}=r,{view:n}=o;if(!n||!s)return;const l=e.sourceLayer??s.layer;return M(l)?void 0:(this._visualVariableAttributes=Z(e),q({graphic:e,sketchLayer:a,sketchViewModel:i,sourceLayer:l,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=B(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(E(t)?e.addHandles(await H({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())}),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([le,oe,ne,de]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return J(a,i)}static _configureSketchViewModel(e){const{data:t,_sketchLayer:a,_sketchViewModel:s,_webStyleCache:o}=e,{creationInfo:n,viewModel:l}=t,{view:c}=l,p=[];if(!c)return i();if("2d"===c.type){n&&p.push(e._fadeExistingFeatures(n.layer));const t=d((e,t)=>Promise.all(e.map(e=>N(e,o,t))));p.push(u(()=>c.scale,e=>t(a.graphics,e)))}const m=Q(t.fullTemplate,n?.attributeOverrides),f=u(()=>s.createGraphic,a=>{a&&!e.hasHandles(ne)&&e._updatingHandles.addPromise(X({creationAttributes:m,data:t,sketchViewModel:s,view:c,webStyleCache:o}).then(t=>e.addHandles(t,ne)))}),w=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(ne),"cancel"===t.state&&null!==c.activeTool&&c.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===c.type?c.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},g=async i=>{const{attachmentsViewModel:r}=l,{_featureFormViewModel:o}=e;if(i.graphics.length>1)return void await e._clearSelectedFeature();const d=i.graphics[0];if("complete"===i.state){const{submittable:t}=o;if(e.numPendingFeatures!==n?.maxFeatures&&t||o.submit(),await e._clearSelectedFeature(),"add"!==r.mode&&"edit"!==r.mode||await(l.activeWorkflow?.previous()),!i.aborted&&c.activeTool===e.sketchViewModel.activeComponent&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===i.state)return d.sourceLayer??=t.creationInfo?.layer,await te({graphic:d,sketchLayer:a,sketchViewModel:s,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:d.sourceLayer}),e._selectFeatureForUpdate({feature:d});if("active"===i.state){await e.updatePendingFeature(d);const t=e._visualVariableAttributes;ae(c,d,i,t)&&await N(d,e._webStyleCache,"2d"===c.type?c.scale:null);const a=d.attributes,{rotation:r,size:s}=t;if(null!=r){const{field:e}=r;o.setValue(e,a[e])}if(null!=s){const{field:e}=s;o.setValue(e,a[e])}}}},y=async a=>{if(a.graphics.forEach(e=>{t.removePendingFeature(e)}),!E(t.creationInfo))return e._startCreating()},v=async()=>{if(E(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};p.push(f,s.on("create",t=>e._updatingHandles.addPromise(w(t))),s.on("update",t=>e._updatingHandles.addPromise(g(t))),s.on("delete",t=>e._updatingHandles.addPromise(y(t))),h(()=>!e.numPendingFeatures,()=>e._updatingHandles.addPromise(v())),i(()=>{s.cancel()}),he(s,a,t),...pe(t));const F=r(p);return s.addHandles(F),F}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new b({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new re({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},view:t});this._sketchLayer=a,this._sketchViewModel=r,t?.map.add(a),this.addHandles([i(()=>{t?.destroyed||t?.map.remove(a),a.destroy()}),u(()=>this.numPendingFeatures>0,e=>this._sketchViewModel.updateOnGraphicClick=e,p)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._featureFormViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_featureFormViewModel:i,_sketchLayer:r}=this,{layerInfos:s,view:o}=a.viewModel;i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference;const{templateExecutorInfo:n}=a;if(!n){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}r.remove(e);const{executor:l}=n,d=l(e.geometry,"completion"),u=c(d)?await d:d;n.completionResults.push(u),Y(u.relationships),i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const c of u.edits){let e=null;if(c.addFeatures)for(const a of c.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await V(a,t),r.add(a)),a.sourceLayer!==e?.layer&&(e=G(s,a.sourceLayer));const o=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,o)}}i.feature=null,await m(()=>!i.updating);return u.edits.reduce((e,t)=>e+(t.addFeatures?.length??0),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_featureFormViewModel:s}=this,{layerInfos:o}=r.viewModel,n=r.addPendingFeature(e,t,{isAssociation:i});a??=G(o,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await m(()=>!s.updating),n.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(le))return;const{data:e,sketchViewModel:s}=this,{creationInfo:o,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!o?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:h,layer:m}=o,f=[],w=[];this._featureFormHandle=n(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=j(l.editorItems,o.layer),o.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),w.push(i(()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])}))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,$(d),f.push(u(()=>d.mode,e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}}));const g=ee(c);f.push(g);const y=M(o.layer),{template:F}=o,b=!F||_(F)||v(F)&&"feature"===F.type,I=y&&b;try{if(I){const a=h??new t({attributes:Q(e.fullTemplate,o.attributeOverrides),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(se._configureSketchViewModel(this)),h?(E(o)&&o.geometryToPlace&&(h.attributes=Q(e.fullTemplate,o.attributeOverrides)),s.addGraphic(h),await this._startUpdating({feature:h})):await this._startCreating()}finally{g.remove()}const V=i(()=>{for(const t of e.pendingFeatures)s.removeGraphic(t),e.removePendingFeature(t)}),k=u(()=>c?.timeZone,e=>{this._featureFormViewModel.timeZone=e,this.data.timeZone=e},p),S=i(()=>{E(o)&&l.cancelWorkflow({warnIfNoWorkflow:!1})});this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(w,this._handleKeys.afterCommit),this.addHandles([i(()=>d.fileInfos.removeAll()),r(f),r(w),S,V,k],le)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),de),await m(()=>null==e?.activeTool,t.signal),t.abort()}};function he(e,t,a){let s=null;const o=()=>e.snappingOptions.featureSources,n=()=>(s=new C({layer:t}),o().add(s),s),d=()=>{null!=s&&(o().remove(s),s=l(s))};return r([u(()=>{const e=a.creationInfo?.layer,t=o().find(t=>t.layer===e);return{hasFeatureLayerSource:!!t,enabled:t?.enabled??!1}},({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return d();s??=n(),s.enabled=t},f),i(d)])}function pe(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new S({view:t});a.push(u(()=>e.selectedPendingFeature,(e,t)=>{r.remove(e),r.add(t)}),i(()=>r.destroy()))}const r=new S({view:t,highlightName:P});return a.push(u(()=>e.temporaryHighlightFeature,e=>{r.removeAll(),r.add(e)}),i(()=>r.destroy())),a}function me(e,t,a,i){const r=[];return t.forEach((t,s)=>{if(!t.error){const o=e[s],n=i.get(o)||[];o.attributes[a.objectIdField]=t.objectId,n.forEach(({form:e})=>r.push({feature:o,attachment:e}))}}),r}function fe(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function we(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function ge(e,t){return e.map(e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e})}e([g()],ue.prototype,"createFeatureState",void 0),e([g()],ue.prototype,"data",void 0),e([g({constructOnly:!0})],ue.prototype,"isNested",void 0),e([g()],ue.prototype,"featureFormViewModel",null),e([g()],ue.prototype,"hasPendingEdits",null),e([g()],ue.prototype,"hasPreviousStep",null),e([g()],ue.prototype,"_getDrawMeshHelpMessage",void 0),e([g()],ue.prototype,"helpMessage",null),e([g()],ue.prototype,"layer",null),e([g()],ue.prototype,"parent",null),e([g()],ue.prototype,"parentLayer",null),e([g()],ue.prototype,"keyboardCancellationEnabled",null),e([g()],ue.prototype,"reliesOnOwnerAdminPrivileges",null),e([g()],ue.prototype,"shouldShowAttachments",null),e([g()],ue.prototype,"shouldAllowAttachmentEditing",null),e([g()],ue.prototype,"sketchViewModel",null),e([g()],ue.prototype,"availableCreateTools",null),e([g()],ue.prototype,"_attachmentsActive",null),ue=se=e([y("esri.widgets.Editor.CreateFeaturesWorkflow")],ue);const ye=ue;export{ye as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import a from"../../core/Error.js";import{makeHandle as i,handlesGroup as r,abortHandle as s}from"../../core/handleUtils.js";import"../../core/has.js";import o from"../../core/Logger.js";import{removeMaybe as n,destroyMaybe as l}from"../../core/maybe.js";import{isPromiseLike as d,debounce as c}from"../../core/promiseUtils.js";import{watch as u,when as h,initial as p,whenOnce as m,syncAndInitial as f}from"../../core/reactiveUtils.js";import{generateBracedUUID as w}from"../../core/uuid.js";import{property as g}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{isSharedTemplateOrMetadata as v,isSharedTemplate as _,isStandardFeatureTemplate as F}from"../../editing/templateUtils.js";import b from"../../layers/GraphicsLayer.js";import{isTable as M}from"../../layers/support/layerUtils.js";import{isNumber as I}from"../../support/guards.js";import{getDisplayedSymbol as V}from"../../symbols/support/symbolUtils.js";import{getDrawHelpMessage as k}from"../../views/draw/support/helpMessageUtils.js";import S from"../../views/draw/support/HighlightHelper.js";import A from"../../views/interactive/sketch/SketchOptions.js";import C from"../../views/interactive/snapping/FeatureSnappingLayerSource.js";import{temporaryHighlightName as P}from"../../views/support/HighlightDefaults.js";import T from"./CreateFeaturesWorkflowData.js";import{isModelUpload as E,handleModelUpload as H}from"./modelUploadUtils.js";import U from"./Workflow.js";import{createToolFromGeometryType as j,findEditorItemForLayer as L,getServiceEditsFromWorkflowData as x,getServiceInfoForLayer as O,orderEditsByRelationshipDependencies as z,getFullTemplateForCreationInfo as W,getServiceLayersById as D,startCreatingNewFeature as R,findLayerInfo as G,updateGraphicSymbolWhenRequired as N,isTerminalUpdateEventType as K,getVisualVariableAttributes as Z,startUpdatingFeatureGeometry as q,createWorkflowSteps as B,avoidFeatureTemplateSelectionWithOnlyOneItem as J,getCreationAttributes as Q,setRelationshipFields as X,prepareAttachmentsForCreateFeaturesWorkflow as Y,showProgressCursor as $,setVisualVariablesAndElevationInfoForUpdate as ee,visualVariableInteractiveUpdate as te,setUpSketchCreateWatchers as ae}from"./workflowUtils.js";import ie from"../FeatureForm/FeatureFormViewModel.js";import re from"../Sketch/SketchViewModel.js";var se;const oe=Symbol(),ne=Symbol(),le=Symbol(),de=Symbol(),ce={point:["point"],multipoint:["multipoint"],polygon:["polygon","freehandPolygon","rectangle","circle"],polyline:["polyline","freehandPolyline"],mesh:[],multipatch:[]};let ue=se=class extends U{constructor(e){super(e),this.type="create-features",this.createFeatureState="create-new",this.data=void 0,this.isNested=!1,this._getDrawMeshHelpMessage=void 0,this._webStyleCache=new Map,this._featureFormHandle=null,this._visualVariableAttributes={rotation:null,size:null},this._formViewModel=new ie,this._sketchLayer=null,this._sketchViewModel=null,this._attachmentFileInfos=new Map,this._isActive=!0}initialize(){this.isNested&&(this._isActive=!1),this._initializeSketchViewModel()}destroy(){this._sketchViewModel.destroy()}get formViewModel(){return this._formViewModel}get hasInvalidFormTemplate(){return!!this.data.editorItem?.hasInvalidFormTemplate}get hasPendingEdits(){if(this.pendingFeatures.some(e=>!!this.data.getEditsForPendingFeature(e)?.modified))return!0;const{creationInfo:e,upload:t}=this.data,{activeComponent:a,createGraphic:i}=this._sketchViewModel,r=i?.geometry?.type;return!("polyline"!==r&&"polygon"!==r&&"multipoint"!==r||"draw-2d"!==a?.type&&"draw-3d"!==a?.type)&&a.drawOperation.committedVertices.length>0||(!(!t||"pending"!==t.state&&"success"!==t.state)||!!e?.geometryToPlace)}get hasPreviousStep(){return this._stepIndex>0||"update-pending"===this.createFeatureState&&!!this.data.selectedPendingFeature&&!this.parent&&!E(this.data.creationInfo)}get helpMessage(){const{creationInfo:e,viewModel:t}=this.data;if("creating-features"!==this.stepId||!e)return;const{_sketchViewModel:a}=this,i=e.layer.geometryType,r=a.createGraphic;if("mesh"===i){this._getDrawMeshHelpMessage||import("../../views/draw/support/helpMessageUtils3d.js").then(e=>{this._getDrawMeshHelpMessage=e.getDrawMeshHelpMessage});const{view:e}=t;return"3d"===e?.type?this._getDrawMeshHelpMessage?.(r,e):void 0}const{activeCreateToolDrawMode:s,activeTool:o}=a;return k("rectangle"===o||"circle"===o?o:i,r?.geometry,s)}get layer(){return this.data.creationInfo?.layer}get numPendingFeatures(){return this.pendingFeatures.length}get numPendingFeaturesExcludingHidden(){return this.pendingFeatures.filter(e=>this.data.isDisplayable(e)).length}get parent(){return this.data.parent}get pendingFeatures(){return this.data.pendingFeatures}get keyboardCancellationEnabled(){return 0===this.numPendingFeatures}get reliesOnOwnerAdminPrivileges(){return this.data.editorItem?.capabilities.create.reliesOnOwnerAdminPrivileges??!1}get shouldShowAttachments(){return(this.data.selectedPendingFeature&&this.data.editorItem?.capabilities.create.attachments.enabled)??!1}get shouldAllowAttachmentEditing(){return this.shouldShowAttachments}get sketchViewModel(){return this._sketchViewModel}get test(){}get availableCreateTools(){const e=this.data.creationInfo?.layer.geometryType,t=this.data.viewModel.view;if(!e)return[];if(this.data.creationInfo?.maxFeatures&&this.data.creationInfo.maxFeatures<=this.numPendingFeatures)return[];if(v(this.data.fullTemplate)){const{tool:t}=j(e,this.data.fullTemplate);return[t]}return"2d"!==t?.type&&"multipoint"===e?[]:[...ce[e]]}get _attachmentsActive(){const e=this.data.viewModel.attachmentsViewModel.mode,t=this.stepId;return this.shouldShowAttachments&&("add"===e||"edit"===e||"adding-attachment"===t||"editing-attachment"===t)}async enter(){this._isActive=!0,"awaiting-feature-creation-info"!==this.stepId&&await this._updatingHandles.addPromise(this._setUpCreatingFeaturesStep())}exit(){this._isActive=!1,this.removeHandles([le])}async updatePendingFeature(e){if(e!==this.data.selectedPendingFeature)return this._sketchViewModel.cancel(),this._startUpdating({feature:e})}async start(){return await super.start(),M(this.data.creationInfo?.layer)?null:{enter:async()=>{},exit:async()=>{},viewModel:this._sketchViewModel}}async save(){const{formViewModel:e}=this;if(e.pendingSubtypeChoice)return;e.submit(),this._stashValidationState();const t=this.data.selectedPendingFeature,a=this._hasValidationErrors(t)?t:this.data.pendingFeatures.find(e=>this._hasValidationErrors(e));return a?(await this._startUpdating({feature:a}),void e?.submit()):super.save()}back(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||E(this.data.creationInfo)||this._attachmentsActive||this.parent?super.back(e):this._clearSelectedFeature()}previous(e){return"update-pending"!==this.createFeatureState||!this.data.selectedPendingFeature||E(this.data.creationInfo)||this._attachmentsActive?super.previous(e):this._clearSelectedFeature()}cancelFeature(e){this.data.isSharedTemplateWorkflow?o.getLogger(this).warn("Cannot cancel individual features created by shared templates."):(this.data.removePendingFeature(e),this.sketchViewModel.removeGraphic(e))}static create(e){const{addAttachmentsCallback:t,applyEdits:a,applyEditsFeatureService:i,isNested:r,creationInfo:s,parent:o,snappingManager:n,startAt:l,viewModel:d}=e,c=e.sketchOptions??new A,u=s?.layer,h=u?L(d.editorItems,u):void 0,p=new se({data:new T({creationInfo:s,editorItem:h,parent:o,sketchOptions:c,snappingManager:n,viewModel:d}),isNested:r,onCommit:async e=>{const{creationInfo:r}=e;if(!r)return;p._sketchViewModel.cancel();const s=e.pendingFeatures.toArray(),{layer:o}=r,n=o.capabilities?.editing.supportsGlobalId&&"globalIdField"in o,l=p._attachmentFileInfos,{fullTemplate:c}=e,u=x(p.data),h=_(c)&&u;if(n){if(fe(s),h){let t=ge(u,l);const a=await O(o,d.view);a&&(t=z({edits:t,serviceInfo:a,view:d.view,findOriginalFeature:t=>e.getEditsForPendingFeature(t)?.initialFeature??t})),await i(c.featureService,t,{globalIdUsed:!0,gdbVersion:c.layer.gdbVersion??void 0})}else{const e=we(s,l);await a(o,e,{globalIdUsed:!0})}return}const m=h?await i(c.featureService,u,{gdbVersion:c.layer.gdbVersion??void 0}):[await a(o,{addFeatures:s})];m&&l.size>0&&await Promise.all(m.map(e=>{if(e?.addFeatureResults)return t(o,me(s,e.addFeatureResults,o,l))}))}});return p._set("steps",this._createWorkflowSteps(p,l)),p}_fadeExistingFeatures(e){if("effect"in e){const t=e.effect;return e.effect="saturate(0.6) opacity(0.8)",i(()=>e.effect=t)}const t=e.opacity;return e.opacity=.7,i(()=>e.opacity=t)}async _initializeFullTemplateAndExecutorInfo(e){const{creationInfo:t}=e,{view:a}=e.viewModel;if(!t||!a)return null;const i=await W(t,a);if(e.fullTemplate=i,i&&_(i)){const{createTemplateExecutor:r}=await import("../../editing/sharedTemplates/executor/createTemplateExecutor.js"),s={completionResults:[],executor:await r(i),serviceLayersById:await D(t.layer,a)};e.templateExecutorInfo=s}return i}async _startCreating(){this.removeHandles(ne);const{data:e}=this;if(!e.creationInfo)return;const t=this.data.creationInfo?.maxFeatures;if(t&&this.numPendingFeatures>=t)return this.sketchViewModel.cancel(),void(this.numPendingFeatures&&await this._startUpdating({feature:this.pendingFeatures.at(-1)}));this.createFeatureState="create-new",await R(this._sketchViewModel,this._sketchLayer,e,this._webStyleCache)}async _clearSelectedFeature(){const e=this._formViewModel.pendingSubtypeChoice;e&&(e.resolve("undo"),await e.promise),this._stashValidationState(),this.sketchViewModel.cancel(),this.data.selectedPendingFeature=null,this._featureFormHandle=n(this._featureFormHandle),this._formViewModel.feature=null;const t=this.data.viewModel.attachmentsViewModel;"add"!==t.mode&&"edit"!==t.mode||await(this.data.viewModel.activeWorkflow?.previous())}_stashValidationState(){const e=this._formViewModel.feature,t=e&&this.data.getEditsForPendingFeature(e);t&&(t.submittable=this._formViewModel.submittable)}async _selectFeatureForUpdate({feature:e,initialFeature:t=e}){this._stashValidationState();const{data:a,pendingFeatures:i,_webStyleCache:s}=this;i.includes(e)||a.addPendingFeature(e,t),a.selectedPendingFeature=e;const{_formViewModel:o,_sketchViewModel:l}=this,{creationInfo:d,viewModel:c}=a,{attachmentsViewModel:h,layerInfos:p,view:m}=c;if(!m||!d)return;n(this._featureFormHandle);const f=e.sourceLayer,w=G(p,f),g=w?.formTemplate,y=m.spatialReference;o.set({editType:"INSERT",feature:e,formTemplate:g,spatialReference:y,map:m.map}),"add"!==h.mode&&"edit"!==h.mode||await(c.activeWorkflow?.previous()),h.graphic=e,h.fileInfos.removeAll(),h.mode="view";(this._attachmentFileInfos.get(e)||[]).forEach(({file:e,form:t})=>h.addFile(e,t)),await N(e,s,"2d"===m.type?m.scale:null);const v=a.getEditsForPendingFeature(e);this._featureFormHandle=r([o.on("value-change",async({fieldName:t,value:a})=>{if(v?.updateAttributes(o.getValues()),I(a)){const e=this._visualVariableAttributes;e.size&&!e.size.isUpdatingInteractively&&t===e.size.field&&e.size.setInitialValue(a),e.rotation&&!e.rotation.isUpdatingInteractively&&t===e.rotation.field&&e.rotation.setInitialValue(a)}await N(e,s,"2d"===m.type?m.scale:null)}),l.on(["update","undo","redo"],e=>{("undo"===e.type||"redo"===e.type||"update"===e.type&&null!=e.toolEventInfo&&K(e.toolEventInfo.type))&&o.notifyFeatureGeometryChanged()}),u(()=>o.feature?.sourceLayer,t=>e.sourceLayer=t),u(()=>[o.feature,o.submittable],()=>this._stashValidationState())]),this.createFeatureState="update-pending"}async _startUpdating({feature:e,initialFeature:t=e}){await this._selectFeatureForUpdate({feature:e,initialFeature:t});const{_sketchLayer:a,_sketchViewModel:i,data:r}=this,{creationInfo:s,viewModel:o}=r,{view:n}=o;if(!n||!s)return;const l=e.sourceLayer??s.layer;return M(l)?void 0:(this._visualVariableAttributes=Z(e),q({graphic:e,sketchLayer:a,sketchViewModel:i,sourceLayer:l,visualVariables:this._visualVariableAttributes,webStyleCache:this._webStyleCache}))}static _createWorkflowSteps(e,t="awaiting-feature-creation-info"){const{data:a}=e,i=B(["awaiting-feature-creation-info","creating-features","adding-attachment","editing-attachment"],t,{"awaiting-feature-creation-info":()=>({id:"awaiting-feature-creation-info",async setUp(){const{creationInfo:t,viewModel:i}=a,{view:r}=i;r&&(E(t)?e.addHandles(await H({view:r,data:a,next:()=>e.next(),cancel:()=>i.cancelWorkflow({warnIfNoWorkflow:!1})}),this.id):(a.parent&&t&&e.addHandles(i.restrictFeatureTemplatesViewModelToLayer(t.layer),this.id),e.addHandles(i.featureTemplatesViewModel.on("select",({item:t})=>{t&&(a.creationInfo={...a.creationInfo,layer:t.layer,template:t.template},e.next())}),this.id)))},async tearDown(){e.removeHandles(this.id)}}),"creating-features":()=>({id:"creating-features",async setUp(){e._isActive&&await e._setUpCreatingFeaturesStep()},async tearDown(t){const{viewModel:i}=a;t.canceled&&(e.removeHandles([le,oe,ne,de]),i.attachmentsViewModel.fileInfos.removeAll(),e._attachmentFileInfos.clear())}}),"adding-attachment":()=>({id:"adding-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}}),"editing-attachment":()=>({id:"editing-attachment",parent:"creating-features",async setUp(){},async tearDown(){const{attachmentsViewModel:t}=a.viewModel,{graphic:i,fileInfos:r}=t;e._attachmentFileInfos.set(i,r.toArray()),t.mode="view"}})});return J(a,i)}static _configureSketchViewModel(e){const{data:t,_sketchLayer:a,_sketchViewModel:s,_webStyleCache:o}=e,{creationInfo:n,viewModel:l}=t,{view:d}=l,p=[];if(!d)return i();if("2d"===d.type){n&&p.push(e._fadeExistingFeatures(n.layer));const t=c((e,t)=>Promise.all(e.map(e=>N(e,o,t))));p.push(u(()=>d.scale,e=>t(a.graphics,e)))}const m=Q(t.fullTemplate,n?.attributeOverrides),f=u(()=>s.createGraphic,a=>{a&&!e.hasHandles(ne)&&e._updatingHandles.addPromise(ae({creationAttributes:m,data:t,sketchViewModel:s,view:d,webStyleCache:o}).then(t=>e.addHandles(t,ne)))}),w=async t=>{if("cancel"!==t.state&&"complete"!==t.state||e.removeHandles(ne),"cancel"===t.state&&null!==d.activeTool&&d.activeTool!==e.sketchViewModel.activeComponent&&(await e._waitForActiveToolCleared(),await e._startCreating()),"complete"===t.state&&t.graphic){const a=await e._processEdits(t.graphic,{scale:"2d"===d.type?d.scale:null,useSourceLayer:!0,webStyleCache:e._webStyleCache});a&&(await e._waitForActiveToolCleared(),await e._startUpdating({feature:a}))}},g=async i=>{const{attachmentsViewModel:r}=l,{_formViewModel:o}=e;if(i.graphics.length>1)return void await e._clearSelectedFeature();const c=i.graphics[0];if("complete"===i.state){const{submittable:t}=o;if(e.numPendingFeatures!==n?.maxFeatures&&t||o.submit(),await e._clearSelectedFeature(),"add"!==r.mode&&"edit"!==r.mode||await(l.activeWorkflow?.previous()),!i.aborted&&d.activeTool===e.sketchViewModel.activeComponent&&(await e.sketchViewModel.wait(),"ready"===e.sketchViewModel.state&&"mesh"!==e.data.creationInfo?.layer.geometryType))return e._startCreating()}else{if("start"===i.state)return c.sourceLayer??=t.creationInfo?.layer,await ee({graphic:c,sketchLayer:a,sketchViewModel:s,visualVariables:e._visualVariableAttributes,webStyleCache:e._webStyleCache,sourceLayer:c.sourceLayer}),e._selectFeatureForUpdate({feature:c});if("active"===i.state){await e.updatePendingFeature(c);const t=e._visualVariableAttributes;te(d,c,i,t)&&await N(c,e._webStyleCache,"2d"===d.type?d.scale:null);const a=c.attributes,{rotation:r,size:s}=t;if(null!=r){const{field:e}=r;o.setValue(e,a[e])}if(null!=s){const{field:e}=s;o.setValue(e,a[e])}}}},y=async a=>{if(a.graphics.forEach(e=>{t.removePendingFeature(e)}),!E(t.creationInfo))return e._startCreating()},v=async()=>{if(E(t.creationInfo))try{await e.data.viewModel.back()}catch{}return e._startCreating()};p.push(f,s.on("create",t=>e._updatingHandles.addPromise(w(t))),s.on("update",t=>e._updatingHandles.addPromise(g(t))),s.on("delete",t=>e._updatingHandles.addPromise(y(t))),h(()=>!e.numPendingFeatures,()=>e._updatingHandles.addPromise(v())),i(()=>{s.cancel()}),he(s,a,t),...pe(t));const _=r(p);return s.addHandles(_),_}_initializeSketchViewModel(){const{data:e}=this,{view:t}=e.viewModel,a=new b({elevationInfo:e.creationInfo?.layer.elevationInfo,internal:!0,listMode:"hide",title:"createFeaturesWorkflow-internal"}),r=new re({layer:a,creationMode:"single",sketchOptions:e.sketchOptions,snappingManager:e.snappingManager,updateOnGraphicClick:!1,defaultUpdateOptions:{multipleSelectionEnabled:!1},view:t});this._sketchLayer=a,this._sketchViewModel=r,t?.map.add(a),this.addHandles([i(()=>{t?.destroyed||t?.map.remove(a),a.destroy()}),u(()=>this.numPendingFeatures>0,e=>this._sketchViewModel.updateOnGraphicClick=e,p)])}_hasValidationErrors(e){return!!e&&(!this.data.isSubmittable(e)||!!this._formViewModel.validateContingencyConstraints(e.attributes,{includeIncompleteViolations:!0})?.length)}async _processEdits(e,t){const{data:a,_formViewModel:i,_sketchLayer:r}=this,{layerInfos:s,view:o}=a.viewModel;i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference;const{templateExecutorInfo:n}=a;if(!n){const t=e.clone();return t.geometry=null,await this._addAndInitializeEdits(e,t),e}r.remove(e);const{executor:l}=n,c=l(e.geometry,"completion"),u=d(c)?await c:c;n.completionResults.push(u),X(u.relationships),i.editType="INSERT",i.map=o?.map,i.spatialReference=o?.spatialReference,u.primary&&a.creationInfo?.attributeOverrides&&(u.primary.graphic.attributes={...u.primary.graphic.attributes,...a.creationInfo.attributeOverrides});for(const d of u.edits){let e=null;if(d.addFeatures)for(const a of d.addFeatures){const i=a.clone();i.geometry=null,null!=a.geometry&&(a.symbol=await V(a,t),r.add(a)),a.sourceLayer!==e?.layer&&(e=G(s,a.sourceLayer));const o=!!u.associationGraphics?.has(a);await this._addAndInitializeEdits(a,i,e,o)}}i.feature=null,await m(()=>!i.updating);return u.edits.reduce((e,t)=>e+(t.addFeatures?.length??0),0)>1?null:u.primary?.graphic}async _addAndInitializeEdits(e,t,a,i=!1){const{data:r,_formViewModel:s}=this,{layerInfos:o}=r.viewModel,n=r.addPendingFeature(e,t,{isAssociation:i});a??=G(o,e.sourceLayer),s.feature=e,s.formTemplate=a?.formTemplate,await m(()=>!s.updating),n.submittable=s.submittable}async _setUpCreatingFeaturesStep(){if(this.hasHandles(le))return;const{data:e,sketchViewModel:s}=this,{creationInfo:o,viewModel:l}=e,{attachmentsViewModel:d,view:c}=l;if(!c||!o?.layer)throw new a("missing-parameters","CreateFeaturesWorkflow requires a view and creationInfo.");const{initialFeature:h,layer:m}=o,f=[],w=[];this._featureFormHandle=n(this._featureFormHandle),this._visualVariableAttributes={rotation:null,size:null},e.editorItem=L(l.editorItems,o.layer),o.template&&(null==e.fullTemplate&&await this._initializeFullTemplateAndExecutorInfo(e),w.push(i(()=>{e.templateExecutorInfo&&(e.templateExecutorInfo.completionResults=[])}))),s.allowDeleteKey=!e.isSharedTemplateWorkflow,Y(d),f.push(u(()=>d.mode,e=>{switch(e){case"add":this.go("adding-attachment");break;case"edit":this.go("editing-attachment")}}));const g=$(c);f.push(g);const y=M(o.layer),{template:_}=o,b=!_||F(_)||v(_)&&"feature"===_.type,I=y&&b;try{if(I){const a=h??new t({attributes:Q(e.fullTemplate,o.attributeOverrides),sourceLayer:m}),i=await this._processEdits(a);i&&await this._startUpdating({feature:i})}else f.push(se._configureSketchViewModel(this)),h?(E(o)&&o.geometryToPlace&&(h.attributes=Q(e.fullTemplate,o.attributeOverrides)),s.addGraphic(h),await this._startUpdating({feature:h})):await this._startCreating()}finally{g.remove()}const V=i(()=>{for(const t of e.pendingFeatures)s.removeGraphic(t),e.removePendingFeature(t)}),k=u(()=>c?.timeZone,e=>{this._formViewModel.timeZone=e,this.data.timeZone=e},p),S=i(()=>{E(o)&&l.cancelWorkflow({warnIfNoWorkflow:!1})});this._featureFormHandle&&f.push(this._featureFormHandle),this.addHandles(f,this._handleKeys.beforeCommit),this.addHandles(w,this._handleKeys.afterCommit),this.addHandles([i(()=>d.fileInfos.removeAll()),r(f),r(w),S,V,k],le)}async _waitForActiveToolCleared(){const e=this.data.viewModel.view;if(null==e?.activeTool)return;const t=new AbortController;this.addHandles(s(t),de),await m(()=>null==e?.activeTool,t.signal),t.abort()}};function he(e,t,a){let s=null;const o=()=>e.snappingOptions.featureSources,n=()=>(s=new C({layer:t}),o().add(s),s),d=()=>{null!=s&&(o().remove(s),s=l(s))};return r([u(()=>{const e=a.creationInfo?.layer,t=o().find(t=>t.layer===e);return{hasFeatureLayerSource:!!t,enabled:t?.enabled??!1}},({hasFeatureLayerSource:e,enabled:t})=>{if(!e)return d();s??=n(),s.enabled=t},f),i(d)])}function pe(e){const t=e.viewModel.view;if(!t)return[];const a=[];if("3d"===t.type){const r=new S({view:t});a.push(u(()=>e.selectedPendingFeature,(e,t)=>{r.remove(e),r.add(t)}),i(()=>r.destroy()))}const r=new S({view:t,highlightName:P});return a.push(u(()=>e.temporaryHighlightFeature,e=>{r.removeAll(),r.add(e)}),i(()=>r.destroy())),a}function me(e,t,a,i){const r=[];return t.forEach((t,s)=>{if(!t.error){const o=e[s],n=i.get(o)||[];o.attributes[a.objectIdField]=t.objectId,n.forEach(({form:e})=>r.push({feature:o,attachment:e}))}}),r}function fe(e){for(const t of e){const{sourceLayer:e}=t;e&&"globalIdField"in e&&null!=e.globalIdField&&(t.attributes[e.globalIdField]??=w())}}function we(e,t){const a=[];if(!t||0===t.size)return{addFeatures:e};for(const[i,r]of t)for(const{file:e}of r)a.push({feature:i,attachment:{globalId:w(),data:e}});return a.length?{addFeatures:e,addAttachments:a}:{addFeatures:e}}function ge(e,t){return e.map(e=>{const{addFeatures:a}=e;if(!a||0===a.length)return e;const i=[];for(const r of a){const e=t.get(r);if(e)for(const{file:t}of e)i.push({feature:r,attachment:{globalId:w(),data:t}})}return i.length?{...e,addAttachments:i}:e})}e([g()],ue.prototype,"createFeatureState",void 0),e([g()],ue.prototype,"data",void 0),e([g({constructOnly:!0})],ue.prototype,"isNested",void 0),e([g()],ue.prototype,"formViewModel",null),e([g()],ue.prototype,"hasInvalidFormTemplate",null),e([g()],ue.prototype,"hasPendingEdits",null),e([g()],ue.prototype,"hasPreviousStep",null),e([g()],ue.prototype,"_getDrawMeshHelpMessage",void 0),e([g()],ue.prototype,"helpMessage",null),e([g()],ue.prototype,"layer",null),e([g()],ue.prototype,"parent",null),e([g()],ue.prototype,"keyboardCancellationEnabled",null),e([g()],ue.prototype,"reliesOnOwnerAdminPrivileges",null),e([g()],ue.prototype,"shouldShowAttachments",null),e([g()],ue.prototype,"shouldAllowAttachmentEditing",null),e([g()],ue.prototype,"sketchViewModel",null),e([g()],ue.prototype,"availableCreateTools",null),e([g()],ue.prototype,"_attachmentsActive",null),ue=se=e([y("esri.widgets.Editor.CreateFeaturesWorkflow")],ue);const ye=ue;export{ye as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{unique as t,isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import a from"../../core/Collection.js";import{deprecatedFunction as o}from"../../core/deprecate.js";import s from"../../core/Error.js";import{EventedAccessor as n}from"../../core/Evented.js";import{abortHandle as l,makeHandle as d}from"../../core/handleUtils.js";import"../../core/has.js";import p from"../../core/Logger.js";import{destroyMaybe as c,abortMaybe as u,removeMaybe as h}from"../../core/maybe.js";import{throwIfAborted as w,createResolver as f}from"../../core/promiseUtils.js";import{watch as m,on as y,when as g,syncAndInitial as k,initial as v,sync as _,whenOnce as W}from"../../core/reactiveUtils.js";import{property as M}from"../../core/accessorSupport/decorators/property.js";import{subclass as F}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as T}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as V}from"../../editing/templateUtils.js";import{getGraphicLayer as b}from"../../graphic/graphicOriginUtils.js";import E from"../../layers/GraphicsLayer.js";import{isEditableLayer as S}from"../../layers/support/editableLayers.js";import{isFeatureLayer as I,isSubtypeGroupLayer as L,getOwningPortalUrl as A}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as U}from"../../portal/support/urlUtils.js";import C from"../../views/SelectionManager.js";import O from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as j}from"../../views/interactive/snapping/SnappingManager.js";import P from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as R}from"../../views/support/selectionUtils.js";import H from"../Attachments/AttachmentsViewModel.js";import q from"./CreateFeaturesWorkflow.js";import G from"./UpdateFeaturesWorkflow.js";import x from"./UpdateWorkflow.js";import{getLayersFromWorkflow as D,isCreateFeaturesWorkflow as B,isUpdateRecordWorkflow as N,isUpdateFeaturesWorkflow as Q,isUpdateWorkflow as z,findEditorItemForLayerOrThrow as Z,assertSplitWorkflowCapabilities as $,fetchFullFeatures as J,makeMultipleSourceLayersError as K,findEditorItemForLayer as X,whenEditorLayerView as Y}from"./workflowUtils.js";import ee from"./support/EditorItem.js";import{makeTemplateGroupInfoForLayer as te}from"../FeatureTemplates/featureTemplatesUtils.js";import ie from"../FeatureTemplates/FeatureTemplatesViewModel.js";import re from"../Sketch/SketchViewModel.js";import ae from"../Spinner/SpinnerViewModel.js";import{goTo as oe}from"../support/goToUtils.js";import{isFeatureItem as se,isLayerItem as ne}from"../support/SelectionList/selectionListUtils.js";import le from"../support/SelectionList/SelectionListViewModel.js";import de from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function pe(e,t){return e?.find(e=>e.layer===t)}let ce=class extends n{constructor(e){super(e),this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new E({listMode:"hide",internal:!0,title:"Editor sketch layer"}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new T,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new a,this.editorItems=new a,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new H({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new ie({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new re({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new le,this.selectionManager=new C,this.selectionToolbarViewModel=new de({continuousSelectionEnabled:!0,defaultOperationType:"replace",persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new O,this.snappingOptions=new P({attributeRulesEnabled:!0}),this.spinnerViewModel=new ae,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{if("viewing-selection-list"===this.state)return this.selectionListViewModel.filterText=void 0,void this.effectiveSelectionManager.clear();this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;this._candidateCommitted||"update"!==i?.type||(i.data.rootFeature=e,t&&(i.next(),this._candidateCommitted=!0))}}initialize(){this.addHandles([m(()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,r=i?.filter(e=>!!t?.includes(e.layer));return[t,r,this.layerInfos]},()=>this._updateEditorItems(),k),m(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),m(()=>this._selectionSources,()=>this._syncSelectionSources(),v),y(()=>this.activeWorkflow,"cancel",()=>this.emit("workflow-cancel")),y(()=>this.activeWorkflow,"commit",()=>this.emit("workflow-commit")),y(()=>this.activeWorkflow,"complete",()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)}),g(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),m(()=>this.activeWorkflow,e=>this.selectionManager.showHighlight=!e),g(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),v),y(()=>this.editorItems,"change",()=>this._afterEditorItemsChange()),m(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),m(()=>this.page,(e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i},k),g(()=>"awaiting-update-feature-candidate"===this.state,()=>this._candidateCommitted=!1),y(()=>this.featureTemplatesViewModel,"select",async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const r={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(r);await this.startCreateFeaturesWorkflowAtFeatureCreation(r)}),m(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},k),y(()=>this.view,"key-down",e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),y(()=>this.sketchViewModel,["create","delete","update"],e=>{const{activeWorkflow:t}=this,i="update"===t?.type,r=D(t),a=i?t?.activeWorkflow?.parentLayer??void 0:void 0,o=`sketch-${e.type}`;this.emit(o,{type:o,detail:e,layer:r[0],layers:r,parentLayer:a})},_),m(()=>this.view,e=>{if(this._snappingManager=c(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new j({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},k),m(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},k),y(()=>this.selectionToolbarViewModel,"complete",e=>this._onSelectionComplete(e)),m(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:r})=>{t.view=e,i.view=e,r.view=e},k),m(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},k)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=u(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=h(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new a;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new a;for(const t of this.editorItems)R(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return B(e)?e.pendingFeatures.length:N(e)&&e.data.edits.feature?1:Q(e)?e.data.features.length:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&z(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>"scene"===e.type||!e.isTable)}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:null}get formViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFeatureFormViewModel:"create-features"===e?.type?e.featureFormViewModel:"update-features"===e?.type?e.formViewModel:null}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type||"update-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associatedLayer)return"viewing-associated-features";if("update"===e?.type&&null!=e?.activeWorkflow?.featureFormViewModel?.associationId)return"viewing-associated-layers";if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeLeafWorkflow:e}=this;if(N(e))return!1===e.data.editorItem?.capabilities.update.attributes||!0===e.featureFormViewModel.disabled;if(Q(e)){const{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeLeafWorkflow:e}=this;if(N(e)){const{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return!!Q(e)&&e.data.editorItems.every(e=>e.capabilities.delete.enabled)}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await W(()=>!this.updating),!this.canCreate)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await W(()=>!this.updating);const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,r=i?Z(this.editorItems,i):void 0;if(!r?.supportsCreateFeaturesWorkflow)throw new s("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const a=this._createCreateFeaturesWorkflow({initialFeature:t,layer:r.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",a),await a.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startSplitFeatureWorkflow(e,t={}){await W(()=>!this.updating);const{view:i}=this;if(!i)throw new s("editing:view-required","A view is required to start a split feature workflow.");const r=b(e);if(!r)throw new s("editing:layer-required","The feature must be associated with a layer to start a split feature workflow.");const a=Z(this.editorItems,r);$(a);const o=this._createUpdatingResolver(),n=new AbortController;this.addHandles(l(n));try{await this._cancelWorkflow();const a=await J([e],r,i.spatialReference,n.signal);if(0===a.length)throw new s("editing:fetch-feature","Failed to fetch the full feature from the service.");const o=this._createUpdateWorkflow("editing-existing-feature",{rootFeature:a[0],rootWorkflowOptions:{type:"split",props:t}});this._set("activeWorkflow",o),this.addHandles(this._destroyWorkflowOnCommit(o)),await o.start()}catch(d){this._logErrorAndCancelWorkflow(d)}finally{o.resolve()}}async startUpdateFeaturesWorkflow(e){if(await W(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");if(t(e.map(e=>e.sourceLayer??e.layer)).length>1)throw K();const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateFeaturesWorkflow(e);this._set("activeWorkflow",t),await t.start()}catch(r){this._logErrorAndCancelWorkflow(r)}finally{i.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await W(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await W(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await W(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature",{rootFeature:e});t.addHandles(this._destroyWorkflowOnCommit(t)),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount)throw new s("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new s("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.visibleFeatureItems.map(e=>e.graphic);1===t.length?await this.startUpdateWorkflowAtFeatureEdit(t[0]):await this.startUpdateFeaturesWorkflow(t)}async deleteFeatureFromWorkflow(){o(p.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;return z(e)?e.deleteActiveFeature():Q(e)?e.deleteAndCommit():void this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}itemHasInvalidFormTemplate(e){return null!=e&&!0===X(this.editorItems,e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const{view:t,sketchViewModel:r}=this;if(!t)return;const a=void 0,o=e??r?.createGraphic;if(o)"mesh"===o.geometry?.type?oe(t,o.geometry,a):oe(t,o,a);else{const e=r?.updateGraphics?.toArray();"3d"===t.type&&e?.some(e=>"mesh"===e.geometry?.type)?oe(t,e.map(e=>e.geometry).filter(i),a):e&&oe(t,e,a)}}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){se(e)&&await this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e){if(se(e))await this.startUpdateWorkflowAtFeatureEdit(e.graphic);else if(ne(e)){const t=e.featureItems.filter(e=>e.visible).map(e=>e.graphic);1===t.length?await this.startUpdateWorkflowAtFeatureEdit(t[0]):await this.startUpdateFeaturesWorkflow(t)}}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),d(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,r=i.editableLayers.toArray(),a=i.allTables.toArray().filter(e=>I(e)||L(e));return await Promise.allSettled([...r.flatMap(e=>this._getLayerLoadPromise(e)),...a.flatMap(e=>this._getLayerLoadPromise(e))]),w(e),[...r.reverse(),...a.reverse()].filter(e=>S(e)&&("mesh"!==e.geometryType||"3d"===t.type)).flatMap(e=>"subtype-group"===e.type?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return L(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){u(this._updateItemsTask);const{view:e}=this,t=r(async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const r=[],a=[],o=[],{layerInfos:s}=this;for(const l of i){const t=pe(s,l),i=await Y(e,l).catch(()=>null);(t?r:i?a:o).push(new ee({layer:l,layerInfo:t,layerView:i}))}s?.length&&r.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));const n=[...r,...a,...o];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))});this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){u(this._updateTemplatesTask);const e=r(async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(i.length>0){const r=await V({layers:i.toArray(),view:this.view,signal:e,queryOptions:{returnVisibleTemplatesOnly:!0}});for(const{layer:e,templates:i}of r)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const r of e){const e=t.get(r);e&&e.length>0&&i.push(te(r,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return q.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateFeaturesWorkflow(e){const t=G.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,features:e,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i)});return this.addHandles(this._destroyWorkflowOnCommit(t)),t}_createUpdateWorkflow(e,t){const i=x.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,rootFeature:t?.rootFeature,rootWorkflowOptions:t?.rootWorkflowOptions,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)});return i}_addAttachments(e,t){const i=t.map(t=>this._addAttachment(e,t.feature,t.attachment))??[];return Promise.all(i)}async _addAttachment(e,t,i){let r=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new s("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation(async()=>(r=await(e.addAttachment?.(t,i).catch(e=>{throw e?.error||e}))??null,r)),r}async _applyEdits(e,t,i){let r=null;const a=e.url?await A(e.url):null,o={returnServiceEditsOption:(!a||!U(a))&&!/\/hosted\//i.test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation(async()=>{const{view:i}=this;if(!i)return null;const a=await Y(i,e).catch(()=>null);return r=await e.applyEdits(t,o),a&&await W(()=>!a.updating),r}),r}async _applyEditsFeatureService(e,t,i){let r=null;return await this._queueOperation(async()=>r=await e.applyEdits(t,i)),r}_destroyWorkflowOnCommit(e){return y(()=>e,"commit",()=>{e.destroy(),this.activeWorkflow===e&&this._set("activeWorkflow",null)})}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const r={error:i,retry:()=>(t(r,this.failures),this._queueOperation(e)),cancel:()=>{t(r,this.failures)}};this._set("failures",[...this.failures,r])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:r}=e,a=t.find(e=>!!e.error)||r.find(e=>!!e.error)||i.find(e=>!!e.error);if(a)throw a.error}}_createUpdatingResolver(){const e=f();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:r}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,r??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=Z(this.editorItems,e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){p.getLogger(this).error(new s(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:r}=this,a="ready"===this.state,o=1===i.length;if(this._queuedSelectionTool=void 0,a&&o&&"replace"===t)return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":r.updateSelection({current:[],added:[],removed:i});break;case"replace":r.clear(),r.updateSelection({current:i,added:[],removed:[]});break;case"add":r.updateSelection({current:i,added:[],removed:[]})}}};e([M()],ce.prototype,"_featureTemplatesLayersAndTables",null),e([M()],ce.prototype,"_queuedSelectionTool",void 0),e([M()],ce.prototype,"_snappingManager",void 0),e([M()],ce.prototype,"_selectionSources",null),e([M()],ce.prototype,"activeFeatureCount",null),e([M({readOnly:!0})],ce.prototype,"activeWorkflow",void 0),e([M()],ce.prototype,"activeLeafWorkflow",null),e([M({readOnly:!0})],ce.prototype,"_activityQueue",void 0),e([M({readOnly:!0})],ce.prototype,"canCreate",null),e([M()],ce.prototype,"canCreateVisible",null),e([M({readOnly:!0})],ce.prototype,"canUpdate",null),e([M()],ce.prototype,"canUpdateVisible",null),e([M()],ce.prototype,"featureTemplatesLayers",null),e([M()],ce.prototype,"editorItems",void 0),e([M()],ce.prototype,"effectiveSelectionManager",null),e([M({readOnly:!0})],ce.prototype,"failures",void 0),e([M()],ce.prototype,"hideTemplatesForInactiveLayers",void 0),e([M({type:H})],ce.prototype,"attachmentsViewModel",void 0),e([M()],ce.prototype,"featureFormViewModel",null),e([M()],ce.prototype,"formViewModel",null),e([M()],ce.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([M({type:ie})],ce.prototype,"featureTemplatesViewModel",void 0),e([M()],ce.prototype,"labelOptions",null),e([M()],ce.prototype,"layerInfos",void 0),e([M()],ce.prototype,"ownSketchViewModel",void 0),e([M()],ce.prototype,"selectionListViewModel",void 0),e([M()],ce.prototype,"selectionManager",void 0),e([M()],ce.prototype,"selectionToolbarViewModel",void 0),e([M()],ce.prototype,"sketchOptions",void 0),e([M()],ce.prototype,"sketchViewModel",null),e([M({type:P,nonNullable:!0})],ce.prototype,"snappingOptions",void 0),e([M()],ce.prototype,"spinnerViewModel",void 0),e([M()],ce.prototype,"state",null),e([M({readOnly:!0})],ce.prototype,"syncing",null),e([M()],ce.prototype,"updating",null),e([M()],ce.prototype,"tooltipOptions",null),e([M()],ce.prototype,"valueOptions",null),e([M()],ce.prototype,"view",null),e([M()],ce.prototype,"canZoomTo",null),e([M()],ce.prototype,"pageStack",void 0),e([M()],ce.prototype,"showDiscardEditsPrompt",void 0),e([M()],ce.prototype,"_candidateCommitted",void 0),e([M()],ce.prototype,"page",null),e([M()],ce.prototype,"featureFormDisabled",null),e([M()],ce.prototype,"featureFormHasAssociation",null),e([M()],ce.prototype,"canGoBack",null),e([M()],ce.prototype,"shouldShowDeleteButton",null),e([M()],ce.prototype,"hasPendingEdits",null),e([M()],ce.prototype,"snappingManager",null),ce=e([F("esri.widgets.Editor.EditorViewModel")],ce);const ue=ce;export{ue as default};
5
+ import{__decorate as e}from"tslib";import{isSome as t}from"../../core/arrayUtils.js";import{createTask as i}from"../../core/asyncUtils.js";import o from"../../core/Collection.js";import{deprecatedFunction as r}from"../../core/deprecate.js";import a from"../../core/Error.js";import{EventedAccessor as s}from"../../core/Evented.js";import{abortHandle as n,makeHandle as l}from"../../core/handleUtils.js";import"../../core/has.js";import d from"../../core/Logger.js";import{destroyMaybe as c,abortMaybe as p,removeMaybe as h}from"../../core/maybe.js";import{throwIfAborted as u,createResolver as w}from"../../core/promiseUtils.js";import{watch as f,on as m,when as y,syncAndInitial as g,initial as k,sync as v,whenOnce as _}from"../../core/reactiveUtils.js";import{property as W}from"../../core/accessorSupport/decorators/property.js";import{subclass as M}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as F}from"../../core/support/UpdatingHandles.js";import{getTemplatesForLayers as b}from"../../editing/templateUtils.js";import{getGraphicLayer as T}from"../../graphic/graphicOriginUtils.js";import V from"../../layers/GraphicsLayer.js";import{isEditableLayer as E}from"../../layers/support/editableLayers.js";import{isFeatureLayer as I,isSubtypeGroupLayer as S,getOwningPortalUrl as L}from"../../layers/support/layerUtils.js";import{parseKnownArcGISOnlineDomain as U}from"../../portal/support/urlUtils.js";import{isGraphic as A}from"../../support/guards.js";import C from"../../views/SelectionManager.js";import O from"../../views/interactive/sketch/SketchOptions.js";import{SnappingManager as j}from"../../views/interactive/snapping/SnappingManager.js";import R from"../../views/interactive/snapping/SnappingOptions.js";import{isSelectableLayer as P}from"../../views/support/selectionUtils.js";import H from"../Attachments/AttachmentsViewModel.js";import q from"./CreateFeaturesWorkflow.js";import x from"./UpdateWorkflow.js";import{getLayersFromWorkflow as G,isCreateFeaturesWorkflow as D,isUpdateRecordWorkflow as B,isUpdateFeaturesWorkflow as N,isUpdateWorkflow as Q,isFeatureFormViewModel as z,findEditorItemForLayerOrThrow as Z,assertMergeWorkflowCapabilities as $,fetchFullFeatures as J,assertSplitWorkflowCapabilities as K,featuresToFeatureInfos as X,findEditorItemForLayer as Y,whenEditorLayerView as ee}from"./workflowUtils.js";import te from"./support/EditorItem.js";import{assertMinimumFeatureCount as ie,assertFeaturesAreFromSameLayer as oe,MissingOriginLayerError as re,FetchFullFeatureError as ae,MultipleSourceLayersError as se}from"./support/errors.js";import{makeTemplateGroupInfoForLayer as ne}from"../FeatureTemplates/featureTemplatesUtils.js";import le from"../FeatureTemplates/FeatureTemplatesViewModel.js";import de from"../Sketch/SketchViewModel.js";import ce from"../Spinner/SpinnerViewModel.js";import{goTo as pe}from"../support/goToUtils.js";import{isFeatureItem as he,isLayerItem as ue}from"../support/SelectionList/selectionListUtils.js";import we from"../support/SelectionList/SelectionListViewModel.js";import fe from"../support/SelectionToolbar/SelectionToolbarViewModel.js";function me(e,t){return e?.find(e=>e.layer===t)}let ye=class extends s{constructor(e){super(e),this._queuedSelectionTool=null,this._sketchEventListenerHandle=null,this._sketchGraphicsLayer=new V({listMode:"hide",internal:!0,title:"Editor sketch layer"}),this._snappingManager=null,this._templatesByLayer=new Map,this._updateItemsTask=null,this._updateTemplatesTask=null,this._updatingHandles=new F,this._featureTemplatesViewModelIsRestricted=!1,this.activeWorkflow=null,this._activityQueue=new o,this.editorItems=new o,this.failures=[],this.hideTemplatesForInactiveLayers=!1,this.attachmentsViewModel=new H({capabilities:{editing:!0}}),this.featureTemplatesViewModel=new le({disabledItemFunction:({layer:e})=>this._itemIsSuspended(e)}),this.layerInfos=null,this.ownSketchViewModel=new de({layer:this._sketchGraphicsLayer}),this.selectionListViewModel=new we,this.selectionManager=new C,this.selectionToolbarViewModel=new fe({continuousSelectionEnabled:!0,defaultOperationType:"replace",persistSelection:!1,returnGeometry:!1}),this.sketchOptions=new O,this.snappingOptions=new R({attributeRulesEnabled:!0}),this.spinnerViewModel=new ce,this.pageStack=[],this.showDiscardEditsPrompt=()=>Promise.resolve(!0),this._candidateCommitted=!1,this.back=async()=>{if("viewing-selection-list"===this.state)return this.selectionListViewModel.filterText=void 0,void this.effectiveSelectionManager.clear();this.canGoBack&&(this.activeWorkflow?.hasPreviousStep?await this.activeWorkflow.back(this.showDiscardEditsPrompt):await this._cancelWorkflow({force:!this.hasPendingEdits}))},this.saveWorkflow=async()=>await(this.activeWorkflow?.save()),this.selectFeature=(e,t=!1)=>{const i=this.activeWorkflow;if(this._candidateCommitted||"update"!==i?.type)return;const{rootFeatures:o}=i.data;o.removeAll(),e&&o.add(e),t&&(i.next(),this._candidateCommitted=!0)}}initialize(){this.addHandles([f(()=>{const e=this.view,t=e?.map?.editableLayers.toArray(),i=e?.allLayerViews,o=i?.filter(e=>!!t?.includes(e.layer));return[t,o,this.layerInfos]},()=>this._updateEditorItems(),g),f(()=>this.hideTemplatesForInactiveLayers,()=>this.syncFeatureTemplates()),f(()=>this._selectionSources,()=>this._syncSelectionSources(),k),m(()=>this.activeWorkflow,"cancel",()=>this.emit("workflow-cancel")),m(()=>this.activeWorkflow,"commit",()=>this.emit("workflow-commit")),m(()=>this.activeWorkflow,"complete",()=>{this.emit("workflow-commit"),this._set("activeWorkflow",null)}),y(()=>!this.activeWorkflow&&this._queuedSelectionTool,()=>this._queuedSelectionTool&&this.selectionToolbarViewModel.activateTool(this._queuedSelectionTool)),f(()=>this.activeWorkflow,e=>this.selectionManager.showHighlight=!e),y(()=>this.view?.map,e=>e.add(this._sketchGraphicsLayer),k),m(()=>this.editorItems,"change",()=>this._afterEditorItemsChange()),f(()=>[this.canCreate,this.canUpdateVisible],()=>this._afterEditorItemsChange()),f(()=>this.page,(e,t)=>{const i=[...this.pageStack];if(-1===i.indexOf(e))i.push(e);else for(;i.length&&i.at(-1)!==e;)i.pop();this.pageStack=i},g),y(()=>"awaiting-update-feature-candidate"===this.state,()=>this._candidateCommitted=!1),m(()=>this.featureTemplatesViewModel,"select",async({item:e,oldItem:t})=>{const{activeWorkflow:i}=this;if(i){if("update"===i.type&&"awaiting-feature-creation-info"===i.activeWorkflow?.stepId)return;try{await this.cancelWorkflow({force:!this.hasPendingEdits})}catch{return void this.featureTemplatesViewModel.select(t,{emit:!1})}}if(!e)return;const o={layer:e.layer,template:e.template};if(e.supportsUpload)return this.featureTemplatesViewModel.select(t,{emit:!1}),this.startCreateFeaturesWorkflow(o);await this.startCreateFeaturesWorkflowAtFeatureCreation(o)}),f(()=>[this.view,this.featureTemplatesViewModel],([e,t])=>{t.view=e},g),m(()=>this.view,"key-down",e=>{"Escape"===e.key&&this.activeWorkflow?.keyboardCancellationEnabled&&(e.stopPropagation(),this.back())}),m(()=>this.sketchViewModel,["create","delete","update"],e=>{const{activeWorkflow:t}=this,i=G(t),o=`sketch-${e.type}`;this.emit(o,{type:o,detail:e,layer:i[0],layers:i})},v),f(()=>this.view,e=>{if(this._snappingManager=c(this._snappingManager),!e)return;const t=this.snappingOptions;this._snappingManager=new j({view:e,options:t}),this.ownSketchViewModel.snappingManager=this._snappingManager},g),f(()=>this.snappingOptions,e=>{this._snappingManager&&(this._snappingManager.options=e)},g),m(()=>this.selectionToolbarViewModel,"complete",e=>this._onSelectionComplete(e)),f(()=>({view:this.view,selectionManager:this.effectiveSelectionManager,selectionListViewModel:this.selectionListViewModel,selectionToolbarViewModel:this.selectionToolbarViewModel}),({view:e,selectionManager:t,selectionListViewModel:i,selectionToolbarViewModel:o})=>{t.view=e,i.view=e,o.view=e},g),f(()=>this.effectiveSelectionManager,e=>{this.selectionListViewModel.selectionManager=e,this.selectionToolbarViewModel.selectionManager=e},g)])}destroy(){this._cancelWorkflow({warnIfNoWorkflow:!1}).then(()=>{this.view?.map?.remove(this._sketchGraphicsLayer),this.view=null}),this._updateItemsTask=p(this._updateItemsTask),this._updatingHandles.destroy(),this._sketchEventListenerHandle=h(this._sketchEventListenerHandle),this.selectionListViewModel?.destroy(),this.selectionToolbarViewModel?.destroy(),this.selectionManager.destroy()}get _featureTemplatesLayersAndTables(){const e=new o;for(const t of this.editorItems){const i=this.hideTemplatesForInactiveLayers&&!t.visible;t.supportsCreateFeaturesWorkflow&&!i&&e.push(t.layer)}return e}get _selectionSources(){const e=new o;for(const t of this.editorItems)P(t.layer)&&t.supportsUpdateWorkflow&&t.visible&&e.push(t.layer);return e}get activeFeatureCount(){const e=this.activeLeafWorkflow;return D(e)?e.pendingFeatures.length:B(e)&&e.data.edits.feature?1:N(e)?e.data.fullFeatures.length:0}get activeLeafWorkflow(){const e=this.activeWorkflow;return e&&Q(e)?e.activeWorkflow??e:e}get canCreate(){return this.editorItems.some(e=>e.supportsCreateFeaturesWorkflow)}get canCreateVisible(){return!!this.featureTemplatesLayers.length}get canUpdate(){return this.editorItems.some(e=>e.supportsUpdateWorkflow)}get canUpdateVisible(){return this.editorItems.some(e=>e.supportsUpdateWorkflow&&e.visible)}get featureTemplatesLayers(){return this._featureTemplatesLayersAndTables.filter(e=>"scene"===e.type||!e.isTable)}get effectiveSelectionManager(){return this.selectionManager}get featureFormViewModel(){const{activeWorkflow:e}=this,t="update"===e?.type?e.activeFormViewModel:e?.formViewModel;return z(t)?t:null}get formViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeFormViewModel:e?.formViewModel}get utilityNetworkAssociationAddAssociationViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeUtilityNetworkAssociationAddAssociationViewModel:null}get labelOptions(){return this.sketchOptions.labels}set labelOptions(e){this.sketchOptions.labels=e}get sketchViewModel(){const{activeWorkflow:e}=this;return"update"===e?.type?e.activeSketchViewModel:"create-features"===e?.type?e.sketchViewModel:this.ownSketchViewModel}get state(){if(!this.view?.ready)return"disabled";const e=this.attachmentsViewModel.mode;if("add"===e)return"adding-attachment";if("edit"===e)return"editing-attachment";const{activeWorkflow:t}=this,i=!t?.stepId;return this.effectiveSelectionManager.count&&i?"viewing-selection-list":i?"ready":"update"===t.type&&t.activeWorkflow?.stepId?t.activeWorkflow.stepId:t.stepId}get syncing(){return this._activityQueue.length>0}get updating(){return this._updatingHandles.updating||!0===this.activeWorkflow?.updating}get tooltipOptions(){return this.sketchOptions.tooltips}set tooltipOptions(e){this.sketchOptions.tooltips=e}get valueOptions(){return this.sketchOptions.values}set valueOptions(e){this.sketchOptions.values=e}set view(e){this.ownSketchViewModel.view=e,this.spinnerViewModel.view=e,this._set("view",e)}get canZoomTo(){const e=this.sketchViewModel,t=e?.createGraphic?.geometry?.type;return!(!e?.updateGraphics?.length&&"multipoint"!==t)}get page(){const{activeWorkflow:e,state:t}=this;if("update"===e?.type&&z(e.activeFormViewModel)){const{associatedLayer:t,associationId:i}=e.activeFormViewModel;if(t||null!=i)return"viewing-associated-features"}if("update"===e?.type&&"awaiting-feature-to-update"===e.stepId)return"ready";if("create-features"===e?.type&&0===e.numPendingFeatures){const t=e.data.upload;if(t)return"default"===t.state?"ready":"creating-features-upload-details"}return t??"disabled"}get featureFormDisabled(){const{activeLeafWorkflow:e}=this;if(B(e))return!1===e.data.editorItem?.capabilities.update.attributes||!0===e.formViewModel.disabled;if(N(e)){const{formViewModel:t}=e;return t.disabled||t.readOnly}return!1}get featureFormHasAssociation(){return!!this.featureFormViewModel?.activeAssociation}get canGoBack(){return null!=this.activeWorkflow&&!this.syncing}get shouldShowDeleteButton(){const{activeLeafWorkflow:e}=this;if(B(e)){const{data:t}=e;return t.editorItem?.capabilities.delete.enabled&&!t.readOnly}return!!N(e)&&e.data.editorItems.every(e=>e.capabilities.delete.enabled)}get hasPendingEdits(){return this.activeWorkflow?.hasPendingEdits??!1}get snappingManager(){return this._snappingManager}getTemplatesForLayer(e){return this._templatesByLayer.get(e)??[]}async startCreateFeaturesWorkflowAtFeatureTypeSelection(){return this.startCreateFeaturesWorkflow()}async startCreateFeaturesWorkflowAtFeatureCreation(e){return this.startCreateFeaturesWorkflow(e,"creating-features")}async startCreateFeaturesWorkflow(e,t="awaiting-feature-creation-info"){if(await _(()=>!this.updating),!this.canCreate)throw new a("editing:unsupported-workflow","Creating features is unsupported or disabled.");const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const i=this._createCreateFeaturesWorkflow(e,t);this._set("activeWorkflow",i),await i.start()}catch(o){this._logErrorAndCancelWorkflow(o)}finally{i.resolve()}}async startCreateFeaturesWorkflowAtFeatureEdit(e){await _(()=>!this.updating);const t=this._createUpdatingResolver();try{const{initialFeature:t}=e,i=t.sourceLayer=t.layer,o=i?Z(this.editorItems,i):void 0;if(!o?.supportsCreateFeaturesWorkflow)throw new a("editing:unsupported-workflow","Creating features is unsupported or disabled for this layer.");await this._cancelWorkflow();const r=this._createCreateFeaturesWorkflow({initialFeature:t,layer:o.layer,maxFeatures:1},"creating-features");this._set("activeWorkflow",r),await r.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startMergeFeaturesWorkflow(e,t={}){await _(()=>!this.updating),ie(e,2),oe(e);const i=T(e[0]);if(!i)throw new re;const r=Z(this.editorItems,i);$(r);const a=this._createUpdatingResolver(),s=new AbortController;this.addHandles(n(s));try{await this._cancelWorkflow();const r=await J(e,i,this.view?.spatialReference,s.signal);if(r.length!==e.length)throw new ae;let a;if(t.keyFeature){const e=t.keyFeature.getObjectId();a=r.find(t=>t.getObjectId()===e)??t.keyFeature}const n=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new o(r),rootWorkflowOptions:{type:"merge",props:{...t,keyFeature:a}}});this._set("activeWorkflow",n),this.addHandles(this._destroyWorkflowOnCommit(n)),await n.start()}catch(l){this._logErrorAndCancelWorkflow(l)}finally{a.resolve()}}async startSplitFeatureWorkflow(e,t={}){await _(()=>!this.updating);const i=T(e);if(!i)throw new re;const r=Z(this.editorItems,i);K(r);const a=this._createUpdatingResolver(),s=new AbortController;this.addHandles(n(s));try{await this._cancelWorkflow();const r=await J([e],i,this.view?.spatialReference,s.signal);if(1!==r.length)throw new ae;const a=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new o(r),rootWorkflowOptions:{type:"split",props:t}});this._set("activeWorkflow",a),this.addHandles(this._destroyWorkflowOnCommit(a)),await a.start()}catch(l){this._logErrorAndCancelWorkflow(l)}finally{a.resolve()}}async startUpdateFeaturesWorkflow(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update features workflow is unsupported or disabled.");let t=[];if(t=e.some(e=>A(e))?X(e):e,t.length>1)throw new se;const i=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow("editing-existing-feature",{rootFeatureInfos:t,rootWorkflowOptions:{type:"update-multiple"}});e.addHandles(this._destroyWorkflowOnCommit(e)),this._set("activeWorkflow",e),await e.start()}catch(o){this._logErrorAndCancelWorkflow(o)}finally{i.resolve()}}async startUpdateWorkflowAtFeatureSelection(){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const e=this._createUpdatingResolver();try{await this._cancelWorkflow();const e=this._createUpdateWorkflow();this._set("activeWorkflow",e),await e.start()}catch(t){this._logErrorAndCancelWorkflow(t)}finally{e.resolve()}}async startUpdateWorkflowAtMultipleFeatureSelection(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("awaiting-update-feature-candidate");t.data.candidates=e,this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowAtFeatureEdit(e){if(await _(()=>!this.updating),!this.canUpdate)return void this._logError("editing:unsupported-workflow","Update workflow is unsupported or disabled.");const t=this._createUpdatingResolver();try{await this._cancelWorkflow();const t=this._createUpdateWorkflow("editing-existing-feature",{rootFeatures:new o([e])});t.addHandles(this._destroyWorkflowOnCommit(t)),this._set("activeWorkflow",t),await t.start()}catch(i){this._logErrorAndCancelWorkflow(i)}finally{t.resolve()}}async startUpdateWorkflowWithActiveSelection(){const{selectionListViewModel:e}=this;if(!e.visibleFeatureCount||!e.visibleLayerCount)throw new a("editing:missing-selection","Unable to determine visible selection.");if(e.visibleLayerCount>1)throw new a("editing:features-different-layers","Cannot start workflow with features from different layers.");const t=e.layerItems.find(e=>e.visible);t&&await this._startUpdateWorkflowWithLayerItem(t)}async deleteFeatureFromWorkflow(){r(d.getLogger(this),"EditorViewModel.deleteFeatureFromWorkflow is deprecated. Use EditorViewModel.deleteFeatures instead.",{version:"4.33",replacement:"EditorViewModel.deleteFeatures",warnOnce:!0}),await this.deleteFeatures()}async deleteFeatures(){const e=this.activeWorkflow;if(Q(e))return e.deleteActiveFeatures();this._logError("editing:unsupported-workflow","Deleting features requires an active update workflow.")}async deleteAssociationFromWorkflow(){const{activeWorkflow:e}=this;e&&"update"===e.type?await e.deleteActiveAssociation():this._logError("editing:unsupported-workflow","Deleting an association requires an active update workflow.")}async cancelWorkflow(e){return this._cancelWorkflow({warnIfNoWorkflow:!0,...e})}itemHasInvalidFormTemplate(e){return null!=e&&!0===Y(this.editorItems,e.layer)?.hasInvalidFormTemplate}syncFeatureTemplates(){this._featureTemplatesViewModelIsRestricted||this._updateTemplates()}zoomTo(e){const{view:i,sketchViewModel:o}=this;if(!i)return;const r=void 0,a=e??o?.createGraphic;if(a)"mesh"===a.geometry?.type?pe(i,a.geometry,r):pe(i,a,r);else{const e=o?.updateGraphics?.toArray();"3d"===i.type&&e?.some(e=>"mesh"===e.geometry?.type)?pe(i,e.map(e=>e.geometry).filter(t),r):e&&pe(i,e,r)}}async toggleUpdateWorkflow(){this.canUpdate&&(this.hasPendingEdits&&!await this.showDiscardEditsPrompt()||(this.activeWorkflow&&"awaiting-feature-to-update"===this.state?await this.cancelWorkflow({force:!0}):await this.startUpdateWorkflowAtFeatureSelection()))}async onSelectionListItemSelect(e){he(e)&&await this.startUpdateWorkflowAtFeatureEdit(e.graphic)}async onSelectionListMenuItemSelect(e){he(e)?await this.startUpdateWorkflowAtFeatureEdit(e.graphic):ue(e)&&await this._startUpdateWorkflowWithLayerItem(e)}restrictFeatureTemplatesViewModelToLayer(e){return this._featureTemplatesViewModelIsRestricted=!0,this._setFeatureTemplatesViewModelLayers([e]),l(()=>{this._featureTemplatesViewModelIsRestricted=!1,this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)})}async _getEditorItemCandidates(e){const{view:t}=this;if(!t?.map)return[];const{map:i}=t,o=i.editableLayers.toArray(),r=i.allTables.toArray().filter(e=>I(e)||S(e));return await Promise.allSettled([...o.flatMap(e=>this._getLayerLoadPromise(e)),...r.flatMap(e=>this._getLayerLoadPromise(e))]),u(e),[...o.reverse(),...r.reverse()].filter(e=>E(e)&&("mesh"!==e.geometryType||"3d"===t.type)).flatMap(e=>"subtype-group"===e.type?e.sublayers.toArray():e)}_getLayerLoadPromise(e){return S(e)?e.loadAll():e.load()}_drainEditorItems(){this.editorItems.drain(e=>e.destroy())}_updateEditorItems(){p(this._updateItemsTask);const{view:e}=this,t=i(async t=>{if(!e?.map||!e?.allLayerViews)return;const i=await this._getEditorItemCandidates(t);if(!i.length)return void this._drainEditorItems();const o=[],r=[],a=[],{layerInfos:s}=this;for(const l of i){const t=me(s,l),i=await ee(e,l).catch(()=>null);(t?o:i?r:a).push(new te({layer:l,layerInfo:t,layerView:i}))}s?.length&&o.sort((e,t)=>s.findIndex(({layer:t})=>t===e.layer)-s.findIndex(({layer:e})=>e===t.layer));const n=[...o,...r,...a];t.aborted||(this._drainEditorItems(),this.editorItems.addMany(n))});this._updatingHandles.addPromise(t.promise),this._updateItemsTask=t}_updateTemplates(){p(this._updateTemplatesTask);const e=i(async e=>{const t=this._templatesByLayer,i=this._featureTemplatesLayersAndTables.filter(e=>!t.has(e));if(i.length>0){const o=await b({layers:i.toArray(),view:this.view,signal:e,queryOptions:{returnVisibleTemplatesOnly:!0}});for(const{layer:e,templates:i}of o)t.set(e,i)}this._setFeatureTemplatesViewModelLayers(this.featureTemplatesLayers)});this._updatingHandles.addPromise(e.promise),this._updateTemplatesTask=e}_setFeatureTemplatesViewModelLayers(e){const t=this._templatesByLayer,i=[];for(const o of e){const e=t.get(o);e&&e.length>0&&i.push(ne(o,e))}this.featureTemplatesViewModel.templateInfos=i}_afterEditorItemsChange(){const{activeWorkflow:e}=this;if(this.syncFeatureTemplates(),!e)return;const{stepId:t}=e;"create-features"!==e.type?"update"===e.type&&("awaiting-feature-to-update"===t&&!this.canUpdateVisible||"awaiting-update-feature-candidate"===t&&!e.hasUpdatableCandidates)&&this._cancelWorkflow():"awaiting-feature-creation-info"!==t||this.canCreate||this._cancelWorkflow()}async _cancelWorkflow(e){const t=this.activeWorkflow;if(!t)return void(e?.warnIfNoWorkflow&&this._logError("editing:no-active-workflow","There is no active workflow to cancel."));if(!e||!1!==e.force){this.emit("workflow-cancel"),this._set("activeWorkflow",null);try{await t.cancel(e)}finally{t.destroy()}}else try{await t.cancel(e),this._set("activeWorkflow",null),t.destroy()}catch(i){}}_createCreateFeaturesWorkflow(e,t){return q.create({viewModel:this,creationInfo:e,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)})}_createUpdateWorkflow(e,t){const i=x.create({viewModel:this,sketchOptions:this.sketchOptions,snappingManager:this._snappingManager,startAt:e,...t,applyEdits:(e,t,i)=>this._applyEdits(e,t,i),applyEditsFeatureService:(e,t,i)=>this._applyEditsFeatureService(e,t,i),addAttachmentsCallback:(e,t)=>this._addAttachments(e,t)});return i}_addAttachments(e,t){const i=t.map(t=>this._addAttachment(e,t.feature,t.attachment))??[];return Promise.all(i)}async _addAttachment(e,t,i){let o=null;if(!("addAttachment"in e)||null==e.capabilities?.attachment)throw new a("editor:attachments-not-supported","Adding attachments is not supported for this layer type");return await this._queueOperation(async()=>(o=await(e.addAttachment?.(t,i).catch(e=>{throw e?.error||e}))??null,o)),o}async _applyEdits(e,t,i){let o=null;const r=e.url?await L(e.url):null,a={returnServiceEditsOption:(!r||!U(r))&&!/\/hosted\//i.test(e.url)?"original-and-current-features":void 0,...i};return await this._queueOperation(async()=>{const{view:i}=this;if(!i)return null;const r=await ee(i,e).catch(()=>null);return o=await e.applyEdits(t,a),r&&await _(()=>!r.updating),o}),o}async _applyEditsFeatureService(e,t,i){let o=null;return await this._queueOperation(async()=>o=await e.applyEdits(t,i)),o}_destroyWorkflowOnCommit(e){return m(()=>e,"commit",()=>{e.destroy(),this.activeWorkflow===e&&this._set("activeWorkflow",null)})}_queueOperation(e){this._activityQueue.push(e);const t=(e,t)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)};return e().then(e=>(Array.isArray(e)?e.forEach(e=>this._handleEditsResultError(e)):this._handleEditsResultError(e),e)).catch(i=>{this._logError("editing:operation-error","An error occurred.",{error:i});const o={error:i,retry:()=>(t(o,this.failures),this._queueOperation(e)),cancel:()=>{t(o,this.failures)}};this._set("failures",[...this.failures,o])}).then(()=>{t(e,this._activityQueue)})}_handleEditsResultError(e){if(null!=e&&"error"in e&&null!=e.error)throw e.error;if(null!=e&&"addFeatureResults"in e){const{addFeatureResults:t,deleteFeatureResults:i,updateFeatureResults:o}=e,r=t.find(e=>!!e.error)||o.find(e=>!!e.error)||i.find(e=>!!e.error);if(r)throw r.error}}_createUpdatingResolver(){const e=w();return this._updatingHandles.addPromise(e.promise),e}_logErrorAndCancelWorkflow(e){const{name:t,message:i,details:o}=e;this._logError(t??"editing:workflow-start-failed",i??void 0,o??e),this._cancelWorkflow({force:!0})}_itemIsSuspended(e){const t=Z(this.editorItems,e);return null!=t&&(!t.visible||t.disabled)}_logError(e,t,i){d.getLogger(this).error(new a(e,t,i))}_syncSelectionSources(){this.selectionManager.sources.items=this._selectionSources.toArray()}async _onSelectionComplete(e){if(e.aborted)return;const{operationType:t,selection:i}=e,{effectiveSelectionManager:o}=this,r="ready"===this.state,a=1===i.length;if(this._queuedSelectionTool=void 0,r&&a&&"replace"===t)return this._queuedSelectionTool=e.toolName,this.startUpdateWorkflowAtFeatureEdit(i[0]);switch(t){case"remove":o.updateSelection({current:[],added:[],removed:i});break;case"replace":o.clear(),o.updateSelection({current:i,added:[],removed:[]});break;case"add":o.updateSelection({current:i,added:[],removed:[]})}}async _startUpdateWorkflowWithLayerItem(e){if(!e.objectIds?.length)return;const t=e.featureItems.filter(e=>e.visible).map(e=>e.graphic),i=this.selectionListViewModel.filterText;1===t.length?await this.startUpdateWorkflowAtFeatureEdit(t[0]):null!=i&&""!==i?await this.startUpdateFeaturesWorkflow(t):await this.startUpdateFeaturesWorkflow([{layer:e.layer,objectIds:e.objectIds}])}};e([W()],ye.prototype,"_featureTemplatesLayersAndTables",null),e([W()],ye.prototype,"_queuedSelectionTool",void 0),e([W()],ye.prototype,"_snappingManager",void 0),e([W()],ye.prototype,"_selectionSources",null),e([W()],ye.prototype,"activeFeatureCount",null),e([W({readOnly:!0})],ye.prototype,"activeWorkflow",void 0),e([W()],ye.prototype,"activeLeafWorkflow",null),e([W({readOnly:!0})],ye.prototype,"_activityQueue",void 0),e([W({readOnly:!0})],ye.prototype,"canCreate",null),e([W()],ye.prototype,"canCreateVisible",null),e([W({readOnly:!0})],ye.prototype,"canUpdate",null),e([W()],ye.prototype,"canUpdateVisible",null),e([W()],ye.prototype,"featureTemplatesLayers",null),e([W()],ye.prototype,"editorItems",void 0),e([W()],ye.prototype,"effectiveSelectionManager",null),e([W({readOnly:!0})],ye.prototype,"failures",void 0),e([W()],ye.prototype,"hideTemplatesForInactiveLayers",void 0),e([W({type:H})],ye.prototype,"attachmentsViewModel",void 0),e([W()],ye.prototype,"featureFormViewModel",null),e([W()],ye.prototype,"formViewModel",null),e([W()],ye.prototype,"utilityNetworkAssociationAddAssociationViewModel",null),e([W({type:le})],ye.prototype,"featureTemplatesViewModel",void 0),e([W()],ye.prototype,"labelOptions",null),e([W()],ye.prototype,"layerInfos",void 0),e([W()],ye.prototype,"ownSketchViewModel",void 0),e([W()],ye.prototype,"selectionListViewModel",void 0),e([W()],ye.prototype,"selectionManager",void 0),e([W()],ye.prototype,"selectionToolbarViewModel",void 0),e([W()],ye.prototype,"sketchOptions",void 0),e([W()],ye.prototype,"sketchViewModel",null),e([W({type:R,nonNullable:!0})],ye.prototype,"snappingOptions",void 0),e([W()],ye.prototype,"spinnerViewModel",void 0),e([W()],ye.prototype,"state",null),e([W({readOnly:!0})],ye.prototype,"syncing",null),e([W()],ye.prototype,"updating",null),e([W()],ye.prototype,"tooltipOptions",null),e([W()],ye.prototype,"valueOptions",null),e([W()],ye.prototype,"view",null),e([W()],ye.prototype,"canZoomTo",null),e([W()],ye.prototype,"pageStack",void 0),e([W()],ye.prototype,"showDiscardEditsPrompt",void 0),e([W()],ye.prototype,"_candidateCommitted",void 0),e([W()],ye.prototype,"page",null),e([W()],ye.prototype,"featureFormDisabled",null),e([W()],ye.prototype,"featureFormHasAssociation",null),e([W()],ye.prototype,"canGoBack",null),e([W()],ye.prototype,"shouldShowDeleteButton",null),e([W()],ye.prototype,"hasPendingEdits",null),e([W()],ye.prototype,"snappingManager",null),ye=e([M("esri.widgets.Editor.EditorViewModel")],ye);const ge=ye;export{ge as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{debounce as i,ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{attributesAreEquivalent as a}from"./support/editsUtils.js";function l(t){return null==t?null:JSON.stringify(t)}let n=class extends e{constructor(t){super(t),this._stagedForDelete=!1,this.feature=null,this.initialFeature=null,this.submittable=!1,this.displayTitle=null,this.isAssociation=!1,this._debouncedRefreshDisplayTitle=i(this._refreshDisplayTitle.bind(this),100)}get attributesModified(){return!a(this.initialFeature?.attributes,this.feature?.attributes)}get geometryModified(){return this._stringifyGeometry(this.feature)!==this._stringifyGeometry(this.initialFeature)}get stagedForDelete(){return this._stagedForDelete}get modified(){return this.attributesModified||this.geometryModified||this._stagedForDelete}set timeZone(t){this._set("timeZone",t),s(this._debouncedRefreshDisplayTitle())}setAttribute(t,e){const{feature:i}=this;i&&(i.setAttribute(t,e),this.notifyChange("attributesModified")),s(this._debouncedRefreshDisplayTitle())}stageDelete(){this._stagedForDelete=!0}unstageDelete(){this._stagedForDelete=!1}trackChanges(t=this.feature){this.initialFeature=t?.clone(),s(this._debouncedRefreshDisplayTitle())}updateAttributes(t){const{feature:e}=this;e&&(e.attributes=t,this.notifyChange("attributesModified")),s(this._debouncedRefreshDisplayTitle())}updateGeometry(t){const{feature:e}=this;e&&(e.geometry=t,this.notifyChange("geometryModified"))}_stringifyGeometry(t){const e=t?.geometry;return l("mesh"===e?.type?{transform:e.transform??null,vertexSpace:e.vertexSpace}:e)}async _refreshDisplayTitle(t){const e=this.feature,i=e?.sourceLayer;if(!i||!("getFeatureTitle"in i))return;const s=await i.getFeatureTitle(e,{fetchMissingFields:!1,timeZone:this.timeZone});t.aborted||(this.displayTitle=""===s?null:s)}};t([r()],n.prototype,"_stagedForDelete",void 0),t([r()],n.prototype,"attributesModified",null),t([r()],n.prototype,"feature",void 0),t([r()],n.prototype,"geometryModified",null),t([r()],n.prototype,"initialFeature",void 0),t([r()],n.prototype,"modified",null),t([r()],n.prototype,"submittable",void 0),t([r()],n.prototype,"displayTitle",void 0),t([r()],n.prototype,"isAssociation",void 0),t([r()],n.prototype,"timeZone",null),n=t([o("esri.widgets.Editor.Edits")],n);const u=n;export{u as default};
5
+ import{__decorate as t}from"tslib";import e from"../../core/Accessor.js";import{debounce as i,ignoreAbortErrors as s}from"../../core/promiseUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{attributesAreEquivalent as a}from"./support/editsUtils.js";function l(t){return null==t?null:JSON.stringify(t)}let n=class extends e{constructor(t){super(t),this._stagedForDelete=!1,this.feature=null,this.initialFeature=null,this.submittable=!1,this.displayTitle=null,this.isAssociation=!1,this._debouncedRefreshDisplayTitle=i(this._refreshDisplayTitle.bind(this),100)}get attributesModified(){return!a(this.initialFeature?.attributes,this.feature?.attributes)}get geometryModified(){return this._stringifyGeometry(this.feature)!==this._stringifyGeometry(this.initialFeature)}get stagedForDelete(){return this._stagedForDelete}get modified(){return this.attributesModified||this.geometryModified||this._stagedForDelete}set timeZone(t){this._set("timeZone",t),s(this._debouncedRefreshDisplayTitle())}setAttribute(t,e){const{feature:i}=this;i&&(i.setAttribute(t,e),this.notifyChange("attributesModified")),s(this._debouncedRefreshDisplayTitle())}stageDelete(){this._stagedForDelete=!0}unstageDelete(){this._stagedForDelete=!1}trackChanges(t=this.feature){this.initialFeature=t?.clone(),s(this._debouncedRefreshDisplayTitle())}updateAttributes(t){const{feature:e}=this;e&&(e.attributes=t,this.notifyChange("attributesModified")),s(this._debouncedRefreshDisplayTitle())}updateGeometry(t){const{feature:e}=this;e&&(e.geometry=t,this.notifyChange("geometryModified"))}_stringifyGeometry(t){const e=t?.geometry;return l("mesh"===e?.type?{transform:e.transform??null,vertexSpace:e.vertexSpace}:e)}async _refreshDisplayTitle(t){const e=this.feature,i=e?.sourceLayer;if(!i||!("getFeatureTitle"in i))return;const s=await i.getFeatureTitle(e,{fetchMissingFields:!1,removeHTML:!0,timeZone:this.timeZone});t.aborted||(this.displayTitle=""===s?null:s)}};t([r()],n.prototype,"_stagedForDelete",void 0),t([r()],n.prototype,"attributesModified",null),t([r()],n.prototype,"feature",void 0),t([r()],n.prototype,"geometryModified",null),t([r()],n.prototype,"initialFeature",void 0),t([r()],n.prototype,"modified",null),t([r()],n.prototype,"submittable",void 0),t([r()],n.prototype,"displayTitle",void 0),t([r()],n.prototype,"isAssociation",void 0),t([r()],n.prototype,"timeZone",null),n=t([o("esri.widgets.Editor.Edits")],n);const u=n;export{u as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import MergeFeaturesWorkflow = __esri.MergeFeaturesWorkflow;
4
+ export default MergeFeaturesWorkflow;
@@ -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/Error.js";import{destroyMaybe as r}from"../../core/maybe.js";import{on as i,whenOnce as o}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 s}from"../../core/accessorSupport/decorators/subclass.js";import l from"../../layers/GraphicsLayer.js";import n from"../../views/draw/support/HighlightHelper.js";import d from"./Edits.js";import p from"./MergeFeaturesWorkflowData.js";import h from"./Workflow.js";import{assertMergeWorkflowCapabilities as m,updateGraphicSymbolWhenRequired as c,makeMinimalAttributes as u}from"./workflowUtils.js";import{assertMinimumFeatureCount as f,assertFeaturesAreFromSameLayer as y,InvalidKeyFeatureError as w}from"./support/errors.js";import{mergeFeatures as g}from"./support/mergeFeaturesUtils.js";import _ from"../FeatureForm/FeatureFormViewModel.js";var F;let v=F=class extends h{constructor(e){super(e),this.type="merge-features",this._formViewModel=null,this._graphicsLayer=null,this._highlightHelper=null,this._webStyleCache=new Map}initialize(){const e=this.data.viewModel.view;this._highlightHelper=e?new n({view:e}):null,this._initializeFeatureFormViewModel(),this._initializeGraphicsLayer(),this._createAndInitializeEdits(this.data.keyFeature)}destroy(){const e=this._graphicsLayer,{view:t}=this.data.viewModel;t?.destroyed||t?.map.remove(e),this._graphicsLayer=r(this._graphicsLayer),this._formViewModel?.destroy(),this._highlightHelper?.destroy()}get formViewModel(){return this._formViewModel}get layer(){return this.data.editorItem.layer}get parent(){return this.data.parent}get updating(){return this._updatingHandles.updating||this._formViewModel.updating}static async create(e){const{applyEdits:t,applyEditsFeatureService:r,...i}=e,{editorItem:o,features:a}=i;if(m(o),f(a,2),y(a),i.keyFeature&&!a.includes(i.keyFeature))throw new w;const s=await g(a),l=new F({data:new p({...i,mergedGeometry:s}),onCommit:k(t)});return l._set("steps",j()),l}async enter(){}exit(){}async setKeyFeature(e){const{data:t}=this;if(!t.features.includes(e))throw new w;t.keyFeature=e,await this._createAndInitializeEdits(e)}async start(){return await super.start(),this._makeSketchController()}async _createAndInitializeEdits(e){const{data:t}=this,r=e.clone();r.geometry=t.mergedGeometry;const i=new d({feature:r});t.edits=i,i.trackChanges(e),await this._setFeatureOnFormViewModel(r)}_initializeFeatureFormViewModel(){const{data:e,_webStyleCache:t}=this,r=e.viewModel.view,o=new _({disabled:!0,editType:"UPDATE",formTemplate:e.editorItem.formTemplate,highlightHelper:this._highlightHelper,map:r?.map,spatialReference:r?.spatialReference,timeZone:e.timeZone});this._formViewModel=o,this.addHandles(i(()=>o,"value-change",({feature:i,fieldName:o,value:a})=>{const s=e.edits;i&&s&&(s.setAttribute(o,a),c(i,t,r?.scale))}))}_initializeGraphicsLayer(){const{data:e}=this,{view:t}=e.viewModel,r=new l({elevationInfo:e.editorItem.layer.elevationInfo,internal:!0,listMode:"hide",title:"mergeFeaturesWorkflow-internal"});this._graphicsLayer=r,t?.map.add(r)}_makeSketchController(){return{enter:async()=>{for(const e of this.data.features)this._highlightHelper?.add(e)},exit:()=>{this._highlightHelper?.removeAll()}}}async _setFeatureOnFormViewModel(e){const t=this._formViewModel;t.feature=e,await o(()=>!t.updating)}};e([a()],v.prototype,"formViewModel",null),e([a()],v.prototype,"layer",null),e([a()],v.prototype,"parent",null),e([a()],v.prototype,"type",void 0),e([a()],v.prototype,"updating",null),e([a()],v.prototype,"_formViewModel",void 0),e([a()],v.prototype,"_graphicsLayer",void 0),e([a()],v.prototype,"_highlightHelper",void 0),v=F=e([s("esri.widgets.Editor.MergeFeaturesWorkflow")],v);const M=v;function j(){return[{id:"choosing-key-feature",async setUp(){},async tearDown(){}}]}function k(e){return async r=>{const{edits:i,keyFeature:o}=r,a=i?.feature?.cloneShallow(),s=r.editorItem.layer;if(!i||!a)throw new t("editing:missing-feature","Workflow data has no edits to submit.");i.attributesModified||(a.attributes=u(a,r.editorItem.layer));const l=[];for(const e of r.features){if(e===o)continue;const t=e.cloneShallow();t.attributes=u(t,s),t.geometry=null,l.push(t)}await e(s,{updateFeatures:[a],deleteFeatures:l})}}export{M as default};
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import MergeFeaturesWorkflowData = __esri.MergeFeaturesWorkflowData;
4
+ export default MergeFeaturesWorkflowData;
@@ -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{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";let i=class extends t{constructor(e){super(e),this.editorItem=null,this.features=[],this.keyFeature=null,this.edits=null,this.mergedGeometry=null,this.parent=null,this.viewModel=null}initialize(){this.keyFeature??=this.features[0]}get timeZone(){return this.viewModel.view?.timeZone}set timeZone(e){null==e?this._clearOverride("timeZone"):this._override("timeZone",e)}};e([o({constructOnly:!0})],i.prototype,"editorItem",void 0),e([o({constructOnly:!0})],i.prototype,"features",void 0),e([o()],i.prototype,"keyFeature",void 0),e([o()],i.prototype,"edits",void 0),e([o()],i.prototype,"mergedGeometry",void 0),e([o()],i.prototype,"parent",void 0),e([o()],i.prototype,"timeZone",null),e([o()],i.prototype,"viewModel",void 0),i=e([r("esri.widgets.Editor.MergeFeaturesWorkflowData")],i);const s=i;export{s as default};