@esri/solutions-components 0.11.18 → 0.11.20

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 (299) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +49 -258
  2. package/dist/cjs/buffer-tools_2.cjs.entry.js +30 -123
  3. package/dist/cjs/card-manager_3.cjs.entry.js +98 -427
  4. package/dist/cjs/consent-manager.cjs.entry.js +12 -54
  5. package/dist/cjs/create-feature_4.cjs.entry.js +88 -287
  6. package/dist/cjs/create-related-feature_3.cjs.entry.js +36 -170
  7. package/dist/cjs/crowdsource-manager.cjs.entry.js +61 -253
  8. package/dist/cjs/crowdsource-reporter.cjs.entry.js +56 -219
  9. package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
  10. package/dist/cjs/delete-dialog.cjs.entry.js +8 -37
  11. package/dist/cjs/{downloadUtils-9abff913.js → downloadUtils-fcae8eb1.js} +2 -2
  12. package/dist/cjs/feature-list.cjs.entry.js +27 -107
  13. package/dist/cjs/{helpers-a65cb83a.js → helpers-8d452256.js} +1 -1
  14. package/dist/cjs/{index-2c21082d.js → index-af14245a.js} +346 -428
  15. package/dist/cjs/{index-90ef3c01.js → index-ffd12cb0.js} +1 -1
  16. package/dist/cjs/instant-apps-app-guide.cjs.entry.js +2 -2
  17. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +4 -4
  18. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +1 -1
  19. package/dist/cjs/instant-apps-create.cjs.entry.js +2 -2
  20. package/dist/cjs/instant-apps-export-views.cjs.entry.js +2 -2
  21. package/dist/cjs/instant-apps-export.cjs.entry.js +2 -2
  22. package/dist/cjs/instant-apps-filter-list_2.cjs.entry.js +2 -2
  23. package/dist/cjs/instant-apps-header.cjs.entry.js +1 -1
  24. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +3 -3
  25. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +3 -3
  26. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +3 -3
  27. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +3 -3
  28. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +4 -4
  29. package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +2 -2
  30. package/dist/cjs/instant-apps-landing-page.cjs.entry.js +1 -1
  31. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +4 -4
  32. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +4 -4
  33. package/dist/cjs/instant-apps-measurement-tool.cjs.entry.js +1 -1
  34. package/dist/cjs/instant-apps-measurement.cjs.entry.js +2 -2
  35. package/dist/cjs/instant-apps-popover.cjs.entry.js +2 -2
  36. package/dist/cjs/instant-apps-popovers.cjs.entry.js +1 -1
  37. package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +2 -2
  38. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +2 -2
  39. package/dist/cjs/instant-apps-splash.cjs.entry.js +2 -2
  40. package/dist/cjs/instant-apps-time-filter.cjs.entry.js +3 -3
  41. package/dist/cjs/json-editor_7.cjs.entry.js +49 -227
  42. package/dist/cjs/loader.cjs.js +2 -2
  43. package/dist/cjs/{locale-c09e93fb.js → locale-1c60be9c.js} +1 -1
  44. package/dist/cjs/{locale-0a273172.js → locale-da41a06f.js} +1 -1
  45. package/dist/cjs/map-layer-picker.cjs.entry.js +27 -112
  46. package/dist/cjs/map-select-tools_3.cjs.entry.js +50 -229
  47. package/dist/cjs/pci-calculator.cjs.entry.js +2 -15
  48. package/dist/cjs/{popupUtils-fc7557da.js → popupUtils-87b006a6.js} +2 -2
  49. package/dist/cjs/public-notification.cjs.entry.js +44 -194
  50. package/dist/cjs/{publicNotificationStore-ee00411f.js → publicNotificationStore-beb782de.js} +1 -1
  51. package/dist/cjs/solution-configuration.cjs.entry.js +17 -52
  52. package/dist/cjs/solution-contents_3.cjs.entry.js +18 -84
  53. package/dist/cjs/solution-item-accordion.cjs.entry.js +8 -38
  54. package/dist/cjs/solution-item-icon.cjs.entry.js +4 -18
  55. package/dist/cjs/{solution-store-6208ce28.js → solution-store-3cf25b71.js} +1 -1
  56. package/dist/cjs/solutions-components.cjs.js +3 -3
  57. package/dist/cjs/spatial-ref.cjs.entry.js +10 -45
  58. package/dist/cjs/store-manager.cjs.entry.js +6 -21
  59. package/dist/cjs/{utils-30344ce0.js → utils-3e512114.js} +2 -2
  60. package/dist/collection/assets/t9n/create-feature/resources.json +1 -1
  61. package/dist/collection/assets/t9n/create-feature/resources_en.json +1 -1
  62. package/dist/collection/assets/t9n/solution-item-accordion/resources.json +1 -1
  63. package/dist/collection/assets/t9n/solution-item-accordion/resources_en.json +1 -1
  64. package/dist/collection/collection-manifest.json +1 -1
  65. package/dist/collection/components/basemap-gallery/basemap-gallery.js +5 -19
  66. package/dist/collection/components/buffer-tools/buffer-tools.js +13 -52
  67. package/dist/collection/components/card-manager/card-manager.js +17 -71
  68. package/dist/collection/components/consent-manager/consent-manager.js +12 -52
  69. package/dist/collection/components/create-feature/create-feature.js +139 -171
  70. package/dist/collection/components/create-related-feature/create-related-feature.js +10 -44
  71. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +61 -251
  72. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +75 -217
  73. package/dist/collection/components/delete-button/delete-button.js +13 -55
  74. package/dist/collection/components/delete-dialog/delete-dialog.js +8 -35
  75. package/dist/collection/components/edit-card/edit-card.js +10 -43
  76. package/dist/collection/components/feature-details/feature-details.js +18 -74
  77. package/dist/collection/components/feature-list/feature-list.js +25 -103
  78. package/dist/collection/components/floor-filter/floor-filter.js +5 -19
  79. package/dist/collection/components/info-card/info-card.js +20 -85
  80. package/dist/collection/components/json-editor/json-editor.js +7 -28
  81. package/dist/collection/components/layer-list/layer-list.js +12 -50
  82. package/dist/collection/components/layer-table/layer-table.js +41 -171
  83. package/dist/collection/components/map-card/map-card.js +43 -182
  84. package/dist/collection/components/map-draw-tools/map-draw-tools.js +17 -67
  85. package/dist/collection/components/map-fullscreen/map-fullscreen.js +4 -18
  86. package/dist/collection/components/map-layer-picker/map-layer-picker.js +25 -108
  87. package/dist/collection/components/map-legend/map-legend.js +4 -15
  88. package/dist/collection/components/map-picker/map-picker.js +8 -35
  89. package/dist/collection/components/map-search/map-search.js +8 -35
  90. package/dist/collection/components/map-select-tools/map-select-tools.js +32 -138
  91. package/dist/collection/components/map-tools/map-tools.js +27 -115
  92. package/dist/collection/components/pci-calculator/pci-calculator.js +3 -14
  93. package/dist/collection/components/pdf-download/pdf-download.js +6 -27
  94. package/dist/collection/components/public-notification/public-notification.js +41 -189
  95. package/dist/collection/components/refine-selection/refine-selection.js +13 -59
  96. package/dist/collection/components/solution-configuration/solution-configuration.js +13 -48
  97. package/dist/collection/components/solution-contents/solution-contents.js +4 -13
  98. package/dist/collection/components/solution-item/solution-item.js +9 -36
  99. package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +8 -36
  100. package/dist/collection/components/solution-item-details/solution-item-details.js +16 -35
  101. package/dist/collection/components/solution-item-icon/solution-item-icon.js +5 -17
  102. package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +6 -27
  103. package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +6 -24
  104. package/dist/collection/components/solution-resource-item/solution-resource-item.js +8 -36
  105. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +7 -31
  106. package/dist/collection/components/solution-template-data/solution-template-data.js +8 -49
  107. package/dist/collection/components/solution-variables/solution-variables.js +6 -24
  108. package/dist/collection/components/spatial-ref/spatial-ref.js +8 -43
  109. package/dist/collection/components/store-manager/store-manager.js +5 -18
  110. package/dist/components/basemap-gallery2.js +3 -19
  111. package/dist/components/buffer-tools2.js +11 -52
  112. package/dist/components/card-manager2.js +15 -71
  113. package/dist/components/consent-manager.js +10 -52
  114. package/dist/components/create-feature2.js +55 -107
  115. package/dist/components/create-related-feature2.js +8 -44
  116. package/dist/components/crowdsource-manager.js +59 -251
  117. package/dist/components/crowdsource-reporter.js +55 -217
  118. package/dist/components/delete-button2.js +11 -55
  119. package/dist/components/delete-dialog2.js +6 -35
  120. package/dist/components/edit-card2.js +8 -43
  121. package/dist/components/feature-details2.js +16 -74
  122. package/dist/components/feature-list2.js +23 -103
  123. package/dist/components/floor-filter2.js +3 -19
  124. package/dist/components/info-card2.js +18 -85
  125. package/dist/components/json-editor2.js +5 -28
  126. package/dist/components/layer-list2.js +10 -50
  127. package/dist/components/layer-table2.js +39 -171
  128. package/dist/components/map-card2.js +41 -182
  129. package/dist/components/map-draw-tools2.js +15 -67
  130. package/dist/components/map-fullscreen2.js +2 -18
  131. package/dist/components/map-layer-picker2.js +23 -108
  132. package/dist/components/map-legend2.js +2 -15
  133. package/dist/components/map-picker2.js +6 -35
  134. package/dist/components/map-search2.js +6 -35
  135. package/dist/components/map-select-tools2.js +30 -138
  136. package/dist/components/map-tools2.js +25 -115
  137. package/dist/components/pci-calculator.js +1 -14
  138. package/dist/components/pdf-download2.js +4 -27
  139. package/dist/components/public-notification.js +39 -189
  140. package/dist/components/refine-selection2.js +11 -59
  141. package/dist/components/solution-configuration.js +13 -48
  142. package/dist/components/solution-contents2.js +2 -13
  143. package/dist/components/solution-item-accordion.js +6 -36
  144. package/dist/components/solution-item-details2.js +14 -35
  145. package/dist/components/solution-item-icon2.js +3 -17
  146. package/dist/components/solution-item-sharing2.js +4 -27
  147. package/dist/components/solution-item2.js +7 -36
  148. package/dist/components/solution-organization-variables2.js +4 -24
  149. package/dist/components/solution-resource-item2.js +6 -36
  150. package/dist/components/solution-spatial-ref2.js +5 -31
  151. package/dist/components/solution-template-data2.js +8 -49
  152. package/dist/components/solution-variables2.js +4 -24
  153. package/dist/components/spatial-ref.js +8 -43
  154. package/dist/components/store-manager.js +3 -18
  155. package/dist/esm/basemap-gallery_7.entry.js +49 -258
  156. package/dist/esm/buffer-tools_2.entry.js +30 -123
  157. package/dist/esm/card-manager_3.entry.js +98 -427
  158. package/dist/esm/consent-manager.entry.js +12 -54
  159. package/dist/esm/create-feature_4.entry.js +88 -287
  160. package/dist/esm/create-related-feature_3.entry.js +36 -170
  161. package/dist/esm/crowdsource-manager.entry.js +61 -253
  162. package/dist/esm/crowdsource-reporter.entry.js +56 -219
  163. package/dist/esm/deduct-calculator.entry.js +1 -1
  164. package/dist/esm/delete-dialog.entry.js +8 -37
  165. package/dist/esm/{downloadUtils-36d854d2.js → downloadUtils-078cd709.js} +2 -2
  166. package/dist/esm/feature-list.entry.js +27 -107
  167. package/dist/esm/{helpers-77bdd30e.js → helpers-15d5cd56.js} +1 -1
  168. package/dist/esm/{index-6de7c296.js → index-c247b62b.js} +1 -1
  169. package/dist/esm/{index-3702583a.js → index-df5db8e9.js} +346 -428
  170. package/dist/esm/instant-apps-app-guide.entry.js +2 -2
  171. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +4 -4
  172. package/dist/esm/instant-apps-control-panel.entry.js +1 -1
  173. package/dist/esm/instant-apps-create.entry.js +2 -2
  174. package/dist/esm/instant-apps-export-views.entry.js +2 -2
  175. package/dist/esm/instant-apps-export.entry.js +2 -2
  176. package/dist/esm/instant-apps-filter-list_2.entry.js +2 -2
  177. package/dist/esm/instant-apps-header.entry.js +1 -1
  178. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +3 -3
  179. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +3 -3
  180. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +3 -3
  181. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +3 -3
  182. package/dist/esm/instant-apps-interactive-legend.entry.js +4 -4
  183. package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +2 -2
  184. package/dist/esm/instant-apps-landing-page.entry.js +1 -1
  185. package/dist/esm/instant-apps-language-switcher.entry.js +4 -4
  186. package/dist/esm/instant-apps-language-translator.entry.js +4 -4
  187. package/dist/esm/instant-apps-measurement-tool.entry.js +1 -1
  188. package/dist/esm/instant-apps-measurement.entry.js +2 -2
  189. package/dist/esm/instant-apps-popover.entry.js +2 -2
  190. package/dist/esm/instant-apps-popovers.entry.js +1 -1
  191. package/dist/esm/instant-apps-scoreboard.entry.js +2 -2
  192. package/dist/esm/instant-apps-sign-in.entry.js +2 -2
  193. package/dist/esm/instant-apps-splash.entry.js +2 -2
  194. package/dist/esm/instant-apps-time-filter.entry.js +3 -3
  195. package/dist/esm/json-editor_7.entry.js +49 -227
  196. package/dist/esm/loader.js +3 -3
  197. package/dist/esm/{locale-aa656a2c.js → locale-7874c756.js} +1 -1
  198. package/dist/esm/{locale-b0016f8e.js → locale-e02b0e14.js} +1 -1
  199. package/dist/esm/map-layer-picker.entry.js +27 -112
  200. package/dist/esm/map-select-tools_3.entry.js +50 -229
  201. package/dist/esm/pci-calculator.entry.js +2 -15
  202. package/dist/esm/{popupUtils-64d25cb0.js → popupUtils-6a965512.js} +2 -2
  203. package/dist/esm/public-notification.entry.js +44 -194
  204. package/dist/esm/{publicNotificationStore-70219049.js → publicNotificationStore-9ec5e22a.js} +1 -1
  205. package/dist/esm/solution-configuration.entry.js +17 -52
  206. package/dist/esm/solution-contents_3.entry.js +18 -84
  207. package/dist/esm/solution-item-accordion.entry.js +8 -38
  208. package/dist/esm/solution-item-icon.entry.js +4 -18
  209. package/dist/esm/{solution-store-2493275a.js → solution-store-4c39c654.js} +1 -1
  210. package/dist/esm/solutions-components.js +4 -4
  211. package/dist/esm/spatial-ref.entry.js +10 -45
  212. package/dist/esm/store-manager.entry.js +6 -21
  213. package/dist/esm/{utils-68015f9d.js → utils-6fe5b5fa.js} +2 -2
  214. package/dist/solutions-components/assets/t9n/create-feature/resources.json +1 -1
  215. package/dist/solutions-components/assets/t9n/create-feature/resources_en.json +1 -1
  216. package/dist/solutions-components/assets/t9n/solution-item-accordion/resources.json +1 -1
  217. package/dist/solutions-components/assets/t9n/solution-item-accordion/resources_en.json +1 -1
  218. package/dist/solutions-components/p-00ec642f.entry.js +6 -0
  219. package/dist/solutions-components/p-02c4e6fc.entry.js +6 -0
  220. package/dist/solutions-components/{p-68d49e1a.entry.js → p-0326f1f4.entry.js} +2 -2
  221. package/dist/solutions-components/{p-8f7957a2.js → p-1e1dfef6.js} +1 -1
  222. package/dist/solutions-components/p-244316dd.entry.js +6 -0
  223. package/dist/solutions-components/p-2460cf10.entry.js +6 -0
  224. package/dist/solutions-components/{p-173d5fce.js → p-2884ca49.js} +1 -1
  225. package/dist/solutions-components/p-38814554.entry.js +6 -0
  226. package/dist/solutions-components/{p-ee863ffb.entry.js → p-3ce5c7fd.entry.js} +1 -1
  227. package/dist/solutions-components/{p-ee2cbba0.js → p-404cbf48.js} +1 -1
  228. package/dist/solutions-components/{p-2dcf8f00.entry.js → p-41a3b49a.entry.js} +1 -1
  229. package/dist/solutions-components/{p-579628d9.entry.js → p-443168f0.entry.js} +1 -1
  230. package/dist/solutions-components/{p-81ae30bd.entry.js → p-4ced7b11.entry.js} +1 -1
  231. package/dist/solutions-components/{p-eb97b5ad.entry.js → p-4d5dd39e.entry.js} +1 -1
  232. package/dist/solutions-components/{p-699a9557.entry.js → p-4e7514a3.entry.js} +1 -1
  233. package/dist/solutions-components/{p-fa09caf3.entry.js → p-4f7fb338.entry.js} +1 -1
  234. package/dist/solutions-components/{p-959cb673.entry.js → p-552fb1c0.entry.js} +1 -1
  235. package/dist/solutions-components/{p-f07a02e2.entry.js → p-5786b9da.entry.js} +1 -1
  236. package/dist/solutions-components/p-5a202f3f.entry.js +6 -0
  237. package/dist/solutions-components/p-5e4e0f84.entry.js +6 -0
  238. package/dist/solutions-components/{p-2b556610.entry.js → p-64a6162f.entry.js} +1 -1
  239. package/dist/solutions-components/{p-7f6cbe61.entry.js → p-65105504.entry.js} +1 -1
  240. package/dist/solutions-components/p-698656b8.entry.js +6 -0
  241. package/dist/solutions-components/p-7251848d.entry.js +6 -0
  242. package/dist/solutions-components/{p-1890b884.entry.js → p-72d04c7a.entry.js} +2 -2
  243. package/dist/solutions-components/p-832707fd.entry.js +6 -0
  244. package/dist/solutions-components/{p-e81e2d83.entry.js → p-837e0939.entry.js} +2 -2
  245. package/dist/solutions-components/{p-3d20e307.js → p-84bb6925.js} +1 -1
  246. package/dist/solutions-components/{p-e23b4193.js → p-8717729a.js} +1 -1
  247. package/dist/solutions-components/p-8859b622.entry.js +6 -0
  248. package/dist/solutions-components/{p-300ff31e.entry.js → p-8a010f9e.entry.js} +1 -1
  249. package/dist/solutions-components/{p-e85da876.entry.js → p-8dd677dd.entry.js} +1 -1
  250. package/dist/solutions-components/{p-ea64b72e.entry.js → p-9927342d.entry.js} +1 -1
  251. package/dist/solutions-components/{p-1dffcc22.entry.js → p-a277d08c.entry.js} +1 -1
  252. package/dist/solutions-components/p-a5eaf7fe.entry.js +6 -0
  253. package/dist/solutions-components/{p-b40b5be5.entry.js → p-aad84d69.entry.js} +1 -1
  254. package/dist/solutions-components/{p-b560498c.entry.js → p-b394f504.entry.js} +1 -1
  255. package/dist/solutions-components/p-b636a8b4.entry.js +6 -0
  256. package/dist/solutions-components/{p-1ddd7128.entry.js → p-ba4e219a.entry.js} +1 -1
  257. package/dist/solutions-components/{p-d0d21a1f.js → p-bf04c6f4.js} +2 -2
  258. package/dist/solutions-components/{p-335a630e.entry.js → p-c6c697e5.entry.js} +1 -1
  259. package/dist/solutions-components/{p-2c8360b4.entry.js → p-d324196d.entry.js} +1 -1
  260. package/dist/solutions-components/{p-8b218ba7.js → p-da1e098c.js} +1 -1
  261. package/dist/solutions-components/{p-6eab9d1f.js → p-db3391b9.js} +1 -1
  262. package/dist/solutions-components/p-de42e8b2.entry.js +6 -0
  263. package/dist/solutions-components/{p-70e8be5c.entry.js → p-e3e35c14.entry.js} +1 -1
  264. package/dist/solutions-components/{p-48942eb8.js → p-e6859850.js} +2 -2
  265. package/dist/solutions-components/p-e996c38f.js +7 -0
  266. package/dist/solutions-components/p-ea566af0.entry.js +6 -0
  267. package/dist/solutions-components/p-eb3c867f.entry.js +6 -0
  268. package/dist/solutions-components/p-ed1ecb5b.entry.js +6 -0
  269. package/dist/solutions-components/p-ee3bb943.entry.js +6 -0
  270. package/dist/solutions-components/{p-ff5db601.entry.js → p-f165921f.entry.js} +1 -1
  271. package/dist/solutions-components/{p-4bdd4009.entry.js → p-f75786a8.entry.js} +1 -1
  272. package/dist/solutions-components/{p-8107be38.entry.js → p-f956c598.entry.js} +1 -1
  273. package/dist/solutions-components/{p-6da8fe2d.entry.js → p-fa663804.entry.js} +1 -1
  274. package/dist/solutions-components/{p-afc3ac6d.entry.js → p-ff317687.entry.js} +1 -1
  275. package/dist/solutions-components/solutions-components.esm.js +1 -1
  276. package/dist/solutions-components_commit.txt +6 -6
  277. package/dist/types/components/create-feature/create-feature.d.ts +54 -50
  278. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +4 -0
  279. package/dist/types/components.d.ts +16 -0
  280. package/package.json +2 -2
  281. package/dist/solutions-components/p-032d4411.entry.js +0 -6
  282. package/dist/solutions-components/p-055706e3.entry.js +0 -6
  283. package/dist/solutions-components/p-06970873.entry.js +0 -6
  284. package/dist/solutions-components/p-1b0588d2.js +0 -7
  285. package/dist/solutions-components/p-265f5dc4.entry.js +0 -6
  286. package/dist/solutions-components/p-3c43839b.entry.js +0 -6
  287. package/dist/solutions-components/p-4426901e.entry.js +0 -6
  288. package/dist/solutions-components/p-4ebc471b.entry.js +0 -6
  289. package/dist/solutions-components/p-6d62a4fa.entry.js +0 -6
  290. package/dist/solutions-components/p-70036eb6.entry.js +0 -6
  291. package/dist/solutions-components/p-72ae3bf0.entry.js +0 -6
  292. package/dist/solutions-components/p-777ed6b0.entry.js +0 -6
  293. package/dist/solutions-components/p-8b5c3c9f.entry.js +0 -6
  294. package/dist/solutions-components/p-9d953313.entry.js +0 -6
  295. package/dist/solutions-components/p-a44815ea.entry.js +0 -6
  296. package/dist/solutions-components/p-acd2699e.entry.js +0 -6
  297. package/dist/solutions-components/p-b1bd3028.entry.js +0 -6
  298. package/dist/solutions-components/p-e2270562.entry.js +0 -6
  299. package/dist/solutions-components/p-e90c0e26.entry.js +0 -6
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,g as e,a as s,h as a,H as l}from"./p-1b0588d2.js";import{b as o,c as n,a as c}from"./p-80cb7c73.js";import{l as h,g as r}from"./p-ee2cbba0.js";import{e as d,h as p}from"./p-dcd2f00b.js";import{s as g}from"./p-48942eb8.js";import{c as b,r as m}from"./p-6eab9d1f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-e23b4193.js";import"./p-4fe489cf.js";import"./p-2bc98cb0.js";import"./p-4f236b5d.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const u=class{constructor(e){t(this,e),this.searchConfigurationChange=i(this,"searchConfigurationChange",7)}get el(){return e(this)}addresseeLayerIds=[];bufferColor=[227,139,79,.8];bufferOutlineColor=[255,255,255];customLabelEnabled;defaultBufferDistance;defaultBufferUnit;defaultExportTitle="";defaultNumLabelsPerPage=6;enableLayerFeatures=!0;enableLayerFeaturesOnLoad=!1;enableSearchDistance=!0;enableSearchDistanceOnLoad=!1;enableSketchTools=!0;featureEffect;featureHighlightEnabled;locale;mapView;noResultText;initialNotice="";searchConfiguration;selectionLayerIds=[];showRefineSelection=!1;showSearchSettings=!0;sketchLineSymbol;sketchPointSymbol;sketchPolygonSymbol;_exportGraphics=!1;_addMap=!1;_addResults=!0;_addTitle=!1;_downloadActive=!0;_exportType=o.PDF;_fetchingData=!1;_isMobile;_numDuplicates=0;_pageType=n.LIST;_saveEnabled=!1;_selectionSets=[];_translations;_activeSelection;_downloadTools;_geometryEngine;Graphic;_jsonUtils;_onboardingImageUrl="";_popupsEnabled;_removeDuplicates;_searchConfiguration;_selectTools;_mediaQuery;_titleElement;_titleValue=void 0;_numSelected=0;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(t){t?.popup&&(this._popupsEnabled=t?.popupEnabled),this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(t,i){const e=JSON.stringify(t);this.mapView&&(e!==JSON.stringify(i)||e&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(e),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){if(this._checkPopups(),this.mapView?.popup&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),i===n.EXPORT&&this._removeExportGraphics(),t!==n.SELECT)return this._highlightFeatures()}searchConfigurationChange;selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=s("assets/data/images/onboarding.png")}render(){return a(l,{key:"61ed8da1de1c6780188fb7bd4f69c82036ddf705"},a("calcite-shell",{key:"9eb929b7d27d103a207be34681623ca2e0097ef1"},a("calcite-action-bar",{key:"3c7ad5516fdca78819ebdbdc7c41642c816239ec",class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async componentDidLoad(){this._initSearchConfiguration(this.searchConfiguration)}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i,e]=await h(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils","esri/Graphic"]);this._geometryEngine=t,this._jsonUtils=i,this.Graphic=e}_initSearchConfiguration(t){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=t,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,e){return a("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},a("div",{class:"background-override"},a("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),a("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},a("span",null,e)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections(),i=t?this._translations.listHasSetsTip:""!==this.initialNotice?this.initialNotice:this._translations.selectLayerAndAdd;return a("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(i,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),a("div",{class:"display-flex padding-1"},a("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},a("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return a("div",{class:"display-flex padding-sides-1"},a("img",{class:"img-container",role:"presentation",src:this._onboardingImageUrl}))}_getSelectionSetList(){return a("div",{class:"padding-top-1-2 padding-bottom-1-2"},a("calcite-list",{class:"list-border margin-sides-1",label:""},this._selectionSets.reduce(((t,i,e)=>{const s=this._getSelectionSetIds(i);let l=!0;return i.workflowType===c.REFINE&&(l=Object.keys(i.refineInfos).reduce(((t,e)=>{const s=i.refineInfos[e];return t+(s.addIds.length+s.removeIds.length)}),0)>0),l&&t.push(a("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",s.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(e,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==c.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,e)=>[...i,...t.refineInfos[e].addIds]),[])}_hasSelections(t=!1){let i=[];const e=this._selectionSets.some((t=>{if(t.workflowType===c.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&e?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),e=m(i);return i.length-e.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==c.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((e=>{const s=i.refineInfos[e];s.addIds.length>0&&this._updateIds(e,s.layerView,s.addIds,t)}))),t)),{})}_updateIds(t,i,e,s){return s[t]?s[t].ids=s[t].ids.concat(e):s[t]={layerView:i,ids:e},s}_getSelectPage(){const t=this._translations.selectSearchTip;return a("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),a("div",null,a("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enableLayerFeatures:this.enableLayerFeatures,enableLayerFeaturesOnLoad:this.enableLayerFeaturesOnLoad,enableSearchDistance:this.enableSearchDistance,enableSearchDistanceOnLoad:this.enableSearchDistanceOnLoad,enableSketchTools:this.enableSketchTools,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,locale:this.locale,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,searchDistanceEnabled:this.enableSearchDistanceOnLoad,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol,useLayerFeaturesEnabled:this.enableLayerFeaturesOnLoad})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return a("calcite-panel",null,a("div",null,this._getLabel(this._translations.export,!1),t?a("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),a("div",{class:"padding-sides-1 "+i},a("div",{class:"display-flex"},a("calcite-label",{layout:"inline"},a("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),a("div",{class:"display-flex"},this._translations.removeDuplicate,a("div",{class:"info-message padding-start-1-2"},a("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"remove-duplicates-icon",scale:"s"})),a("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},a("span",{class:"tooltip-message"},this._translations.duplicatesTip))),a("div",{class:"border-bottom"}),a("div",{class:"padding-top-sides-1"},a("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},a("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},a("span",{class:"font-weight-500"},this._translations.pdf)),a("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},a("span",{class:"font-weight-500"},this._translations.csv)))),a("div",{class:"padding-bottom-1"},this._getExportOptions()),a("div",{class:"padding-1 display-flex"},a("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},a("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",e=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",s=this._addResults?"":"display-none";return a("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),a("div",{class:`padding-top-sides-1 ${s}`},a("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),a("div",{class:`padding-sides-1 ${s}`},a("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,locale:this.locale,ref:t=>{this._downloadTools=t}})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),a("div",{class:t},this._getLabel(this._translations.title,!0,""),a("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:e})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),a("div",{class:`padding-top-sides-1 ${i}`},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"list-graphics-icon",scale:"s"}),a("calcite-popover",{closable:!0,label:"",referenceElement:"list-graphics-icon"},a("span",{class:"tooltip-message"},this._translations.listGraphicsTip))))}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(t){let i;return Object.keys(g.managedLayers).some((e=>{const s=this.mapView.map.layers.findIndex((t=>t.title===e));if(g.managedLayers[e]===t)return i=this.mapView.map.layers.getItemAt(s),!0})),i}_updateExportGraphics(t=!1){!t&&this._exportGraphics&&this._addMap||this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");t&&t.graphics.removeAll(),i&&i.graphics.removeAll()}_addExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");this._selectionSets.forEach((e=>{if(e.download&&(t&&t.graphics.add(e.sketchGraphic),i)){const t=new this.Graphic({geometry:e.buffer,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});i.graphics.add(t)}}))}_getRefinePage(){const t=this._hasSelections();return a("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?a("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),a("refine-selection",{enabledLayerIds:this.selectionLayerIds,locale:this.locale,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,e,s,l,o){return a("div",{class:"padding-bottom-1"},a("div",{class:"display-flex padding-top-sides-1"},a("calcite-button",{disabled:i,onClick:e,width:"full"},a("span",{class:"font-weight-500"},t))),a("div",{class:"display-flex padding-top-1-2 padding-sides-1"},a("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},a("span",{class:"font-weight-500"},s))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",e=""){return a("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},a("div",{class:e,slot:"message"},t))}_getLabel(t,i=!1,e="font-bold"){return a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:e+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{const e=this._getSelectionSetIds(i),s=i.workflowType!==c.REFINE||e.length>0;return!this._downloadActive&&i.download&&s&&(this._downloadActive=!0),s&&t.push(a("div",{class:"display-flex padding-sides-1 padding-bottom-1"},a("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),a("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list",label:""},a("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",e.length.toString()))))))),t}),[])||a("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((e=>(e.download=e.id===t?!e.download:e.download,i=!!e.download||i,e))),this._updateExportGraphics(!0),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=t?.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{if(i.workflowType===c.REFINE)Object.keys(i.refineInfos).forEach((e=>{const s=i.refineInfos[e];s.addIds&&(t=this._updateExportInfos(t,s.layerView.layer.id,i.label,s.addIds,s.layerView))}));else{const e=i?.layerView?.layer.id;t=this._updateExportInfos(t,e,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,e,s,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...s])],t[i].selectionSetNames.push(e)):i&&(t[i]={ids:s,layerView:a,selectionSetNames:[e]}),t}_getAction(t,i,e,s,l=!1,o=""){return a("calcite-action",{disabled:!t,icon:i,iconFlipRtl:!0,indicator:l,onClick:s,slot:o,text:e})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){const t=await(this._selectTools?.getSelection()),i=this._selectTools?.isUpdate;return this._selectionSets=i?this._selectionSets.map((i=>i.id===t.id?t:i)):[...this._selectionSets,t],this._home()}async _clearSelection(){await(this._selectTools?.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,e)=>{if(e!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){d(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===c.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let e=0;e<i.length;e++){const s=t[i[e]];g.highlightHandles.push(await p(s.ids,s.layerView,this.mapView))}}_checkPopups(){"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=this.mapView?.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await r(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,g as e,h as s,F as a,H as n}from"./p-1b0588d2.js";import{l as o,g as h}from"./p-ee2cbba0.js";import{a as c,g as d}from"./p-dcd2f00b.js";import{P as l}from"./p-d0d21a1f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-6eab9d1f.js";import"./p-4fe489cf.js";import"./p-2bc98cb0.js";import"./p-4f236b5d.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const r=class{constructor(e){t(this,e),this.success=i(this,"success",7),this.fail=i(this,"fail",7),this.drawComplete=i(this,"drawComplete",7),this.editingAttachment=i(this,"editingAttachment",7),this.progressStatus=i(this,"progressStatus",7),this.modeChanged=i(this,"modeChanged",7)}get el(){return e(this)}mapView;selectedLayerId;customizeSubmit=!1;locale;searchConfiguration;isMobile;floorLevel;formElements;enableSearch=!1;showGuidingMsg=!0;showGuidingMsgWhileDrawing=!0;_editorLoading=!1;_currentPage="templatePicker";_translations;Editor;ExpressionInfo;FieldElement;FormTemplate;_editor;FeatureLayer;MapView;_updatedMapView;Search;_search;reactiveUtils;_addingAttachment;_container;_mapViewContainer;_isSubmitBtnClicked=!1;_selectedLayer;_searchDiv;_calciteNotice;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async isMobileHandler(){this.modeChanged.emit()}async _editorLoadingWatchHandler(t){if(t){if(this._container?.classList.add("display-none"),this._selectedLayer?.isTable){const t={layer:this._selectedLayer,template:this._selectedLayer.templates[0]};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(t),await this.hideEditorsElements()}else await this.startCreate();this._container?.classList.remove("display-none"),this._editorLoading=!1}}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}async refresh(t){this._editor&&this._setFloorLevel(t)}success;fail;drawComplete;editingAttachment;progressStatus;modeChanged;async componentWillLoad(){await this._getTranslations(),await this.initModules()}async componentDidLoad(){await this.init()}componentDidRender(){this.isMobile&&(this._mapViewContainer.style.top=`${this._calciteNotice.offsetHeight+this._searchDiv.offsetHeight+80}px`)}disconnectedCallback(){this._editor&&this._editor.destroy()}render(){const t="drawing"===this._currentPage?"":"display-none",i=this._editorLoading?"":"display-none",e=this._editorLoading?"display-none":"",n=this.isMobile?"show-map":"display-none";let o=this._translations.chooseCategoryMsg;return"drawing"===this._currentPage?o=this._translations.provideLocationMsg:"featureForm"===this._currentPage&&(o=this._translations.provideDetailsMsg),s(a,{key:"829e66e8b4818b2566d514ae85eddc50968075f8"},this.showGuidingMsg&&(this.showGuidingMsgWhileDrawing||"drawing"!==this._currentPage)&&s("calcite-notice",{key:"0347181f26f5d87d38f8be185e0b43ffbbc34208",class:"notice-msg",icon:"lightbulb",kind:"success",open:!0,ref:t=>this._calciteNotice=t},s("div",{key:"e5dd776ead66c26184a5aad747e82d97612d961a",slot:"message"},o)),s("calcite-loader",{key:"7989ecdbb4b635d38a1d63bf879d7e95b3f9a9be",class:i,label:"",scale:"s"}),s("div",{key:"6f6184af21e8a0595e5c51c132e657e7660caa01",class:e,id:"feature-form"}),this.enableSearch&&s("div",{key:"2068ca424a9355a28c9957104a4f6973b11c1b8f",class:`search-widget ${t} ${e}`,id:"search-widget-ref",ref:t=>this._searchDiv=t}),s("div",{key:"a899d52788e6cfa67fe77abbbe0eeb6383b40d0a",class:`${n}`,ref:t=>{this._mapViewContainer=t}}))}async init(){this.mapView&&this.selectedLayerId&&(this._updatedMapView=this.mapView,await(this.isMobile?this.createMobileMapView():this._loadWidgets()))}async initModules(){const[t,i,e,s,a,n,h]=await o(["esri/widgets/Editor","esri/core/reactiveUtils","esri/widgets/Search","esri/form/ExpressionInfo","esri/form/elements/FieldElement","esri/form/FormTemplate","esri/views/MapView"]);this.Editor=t,this.reactiveUtils=i,this.Search=e,this.ExpressionInfo=s,this.FieldElement=a,this.FormTemplate=n,this.MapView=h}async createMobileMapView(){this._mapViewContainer.classList.add("hide-map"),await new this.MapView({map:this.mapView.map,container:this._mapViewContainer,zoom:this.mapView.zoom}).when((t=>{this._updatedMapView=t,this._loadWidgets()}),(t=>{console.log(t)}))}async _loadWidgets(){await this.createEditorWidget(),this.enableSearch&&await this.createSearchWidget()}async createEditorWidget(){this._editor&&this._editor.destroy();const t=[];this._container=document.createElement("div"),this._container?.classList.add("display-none");const i=await c(this._updatedMapView);this._selectedLayer=await d(this.mapView,this.selectedLayerId),this._selectedLayer?.isTable||i.forEach((async i=>{t.push({layer:i,enabled:"feature"===i?.type&&i?.id===this.selectedLayerId,addEnabled:!0,updateEnabled:!1,deleteEnabled:!1})})),this._editor=new this.Editor({view:this._updatedMapView,layerInfos:t,visibleElements:{snappingControls:!1,createFeaturesSection:!0,editFeaturesSection:!1},container:this._container}),this._mapViewContainer?this.el.insertBefore(this._container,this._mapViewContainer):this.el.appendChild(this._container);const e=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.editingAttachment.emit(!0)):this._addingAttachment&&(this.editingAttachment.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(e);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&"create-features"!==this._editor.viewModel?.activeWorkflow?.type&&(this.progressStatus.emit(50),this._editorLoading=!0)}));this._editor.viewModel.addHandles(s);const a=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&(this._mapViewContainer?.classList?.replace("show-map","hide-map"),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this)),setTimeout((()=>{this._setFloorLevel(this.floorLevel)}),50),this._currentPage="featureForm",this.progressStatus.emit(100),this.drawComplete.emit())}));this._editor.viewModel.addHandles(a);const n=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"creating-features"===t&&"disabled"===this._editor.viewModel.featureFormViewModel.state&&(this._mapViewContainer?.classList?.replace("hide-map","show-map"),this._selectedLayer&&!this._selectedLayer.isTable&&(this._currentPage="drawing"))}));this._editor.viewModel.addHandles(n)}async startCreate(){return await this.hideEditorsElements(),new Promise(((t,i)=>{if(this._editor.viewModel.featureTemplatesViewModel.items?.length){const e=this._editor.viewModel.featureTemplatesViewModel.items[0].items;this._editor.viewModel.featureTemplatesViewModel.on("select",(()=>{this.progressStatus.emit(75),setTimeout((()=>{this.hideEditorsElements().then((()=>{t({})}),(t=>i(t)))}),700)})),1===e.length&&this._editor.viewModel.featureTemplatesViewModel.select(e[0]);const s=e.length>1;this.hideEditorsElements().then((()=>{s&&t({})}),(t=>s&&i(t)))}}))}async createSearchWidget(){let t={view:this._updatedMapView};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this._updatedMapView)}),this._search=new this.Search(t),this._search.container="search-widget-ref",this._search.popupEnabled=!1,this._search.resultGraphicEnabled=!1;let i=null;this._search.on("search-complete",(t=>{this._updatedMapView.goTo(t.results[0].results[0].extent),"point"===this._selectedLayer.geometryType&&(i=t.results[0].results[0]?.feature.geometry)}));const e=this.reactiveUtils.watch((()=>this._search.viewModel.state),(t=>{"ready"===t&&setTimeout((()=>{this._editor.viewModel.sketchViewModel.createGraphic&&i&&(this._editor.viewModel.sketchViewModel.createGraphic.set("geometry",i),this._editor.viewModel.sketchViewModel.complete(),this.hideEditorsElements())}),100)}));this._search.viewModel.addHandles(e)}_getSearchConfig(t,i){const e=t.sources;return e?.length>0?(t.includeDefaultSources=!1,e.forEach((t=>{if(t.hasOwnProperty("layer")){const e=t,s=e.layer?.id,a=s?i.map.findLayerById(s):null,n=e?.layer?.url;a?e.layer=a:n&&(e.layer=new this.FeatureLayer(n))}})),e?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}async _setFloorLevel(t){if(!t)return;const i=this._selectedLayer;if(i?.floorInfo?.floorField){const e=i.fields.find((t=>t.name===i.floorInfo.floorField));if(e&&!i?.formTemplate)this._editor.viewModel.featureFormViewModel.setValue(e.name,t),e.editable=!1;else if(i.formTemplate&&this.formElements){const e=new this.ExpressionInfo({expression:`"${t}"`,name:"floor-info-test",title:"Floor Info",returnType:"string"}),s=new this.FieldElement({label:i.floorInfo.floorField,editableExpression:"false",fieldName:i.floorInfo.floorField,input:{type:"text-box",maxLength:50,minLength:0},valueExpression:e.name});this._updatedMapView.map.editableLayers.forEach((t=>{const i=this.formElements.orgExpressionInfos,a=[...this.formElements.orgElements];a.push(s);const n=new this.FormTemplate({title:t.formTemplate.title,description:t.formTemplate.description,elements:a,expressionInfos:[e].concat(i)});t.formTemplate=n}))}}}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.querySelectorAll("calcite-flow-item")?.forEach((t=>{const i=t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");i?.querySelector("header")?.setAttribute("style","display: none"),i?.querySelector("footer")?.setAttribute("style","display: none")})))}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}timeout(t){return new Promise((i=>setTimeout(i,t)))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],isMobile:["isMobileHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};r.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.esri-editor__panel-content{padding-block:0px !important}.esri-editor .esri-item-list__group__header{display:none !important}.esri-editor__panel-content__section .esri-widget__heading{display:none !important}.esri-editor .esri-item-list__filter-container--sticky{padding-block:0px !important;padding-inline:10px !important}.search-widget{width:92% !important;margin:5px 14px 20px 14px}.display-none{display:none !important}.hide-map{height:1%;visibility:hidden}.show-map{padding:10px !important;position:absolute !important;bottom:0;height:auto !important;width:calc(100% - 22px)}.notice-msg{padding:10px;width:calc(100% - 20px)}.esri-editor__panel-content{padding-block:10px !important}@media only screen and (max-width: 600px){.esri-editor__panel-content{padding-block:0 !important;min-height:0 !important}}";const p=class{constructor(e){t(this,e),this.editsComplete=i(this,"editsComplete",7)}get el(){return e(this)}deleteDialog;buttonType="button";disabled=!1;icon;ids=[];layer;locale;_confirmDelete=!1;_deleteEndabled=!1;_supportsDelete;_translations;async idsWatchHandler(){this._setDeleteEnabled()}async layerWatchHandler(){this._setDeleteEnabled()}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;async componentWillLoad(){await this._getTranslations()}render(){return s(n,{key:"73d07f24703df76fdacc1b3a1ec80cfdd7bbee30"},"button"===this.buttonType?s("calcite-button",{appearance:"outline",disabled:!this._deleteEndabled,id:"solutions-delete",kind:"danger",onClick:()=>this._delete(),width:"full"},this._translations.deleteCount.replace("{{n}}",this.ids.length.toString())):s("calcite-action",{appearance:"solid",disabled:!this._deleteEndabled,id:this.icon,onClick:()=>this._delete(),scale:"s",text:this._translations.delete},s("calcite-button",{appearance:"transparent",iconStart:this.icon,kind:"danger"},this._translations.delete)),this._deleteMessage(),s("calcite-tooltip",{key:"803898895029bd098264b9144ff5ccee102d4ae8",placement:"bottom","reference-element":"button"===this.buttonType?"solutions-delete":this.icon},s("span",{key:"a920ffea1849667cd58812a2c1813d2e066f0064"},this._translations.delete)))}async componentDidLoad(){this._setDeleteEnabled()}_setDeleteEnabled(){this._supportsDelete=this.layer?.editingEnabled&&this.layer?.capabilities?.operations?.supportsDelete,this._deleteEndabled=!this.disabled||this._supportsDelete&&this.ids.length>0}_delete(){this._confirmDelete=!0}_deleteMessage(){return this.deleteDialog?this.deleteDialog:s("delete-dialog",{id:"solution-delete-dialog",ids:this.ids,layer:this.layer,locale:this.locale,onDeleteDialogClose:()=>this._confirmDelete=!1,open:this._confirmDelete})}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{ids:["idsWatchHandler"],layer:["layerWatchHandler"],locale:["localeWatchHandler"]}}};p.style=":host{display:block}.delete-modal{position:fixed}";const b=class{constructor(e){t(this,e),this.closeEdit=i(this,"closeEdit",7),this.editorInitialized=i(this,"editorInitialized",7),this.editsComplete=i(this,"editsComplete",7),this.refreshGraphics=i(this,"refreshGraphics",7)}get el(){return e(this)}enableEditGeometry=!1;graphics;locale;mapView;open=!1;graphicIndex=0;_editorLoading=!1;_translations;_activeWorkflowHandle;_addRelatedRecordHandle;_attachmentHandle;_editHandle;_layerEditHandle;Editor;_editor;_layer;_editContainer;_editControlElements;_editingDisabled;_shouldClose=!1;reactiveUtils;async graphicsWatchHandler(){0===this.graphics.length&&this.open&&await this._closeEdit(!0)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async openWatchHandler(t){t&&this.graphics?.length>0&&this.graphicIndex>-1&&(this._editorLoading=!0,await this._initEditorWidget(),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&await this._startUpdate(),this._editorLoading=!1),t||await this._closeEdit(!0)}closeEdit;editorInitialized;editsComplete;refreshGraphics;async featureSelectionChange(){this.open&&await this._closeEdit(!1)}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){this.graphics?.length>0&&this.graphics[0]?.layer&&(this._layer=this.graphics[0].layer,this._layerEditHandle&&this._layerEditHandle.remove(),this._layerEditHandle=("subtype-sublayer"===this._layer.type?this._layer.parent:this._layer).on("edits",(()=>{this.editsComplete.emit()})))}render(){const t=this._editorLoading?"display-none":"position-absolute",i=this._editorLoading?"":"display-none";return s(n,{key:"e181f65e7218ce0350de5dcab9049ff63a5d39c1"},s("div",{key:"44bf2b5cf31c5acc7f65fb7ec50fd84e77c95470",class:"position-absolute"},this.graphics?.length>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled?void 0:s("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},s("div",{slot:"message"},this._translations.enableEditing)),s("div",{key:"97119476aa2a992ccadc1d61119f2640d195e7b1",class:"position-absolute"},s("div",{key:"f429decea684a6a22db89de89da3755bdbff19cc",class:t,id:"feature-form",ref:t=>this._editContainer=t}),s("calcite-loader",{key:"3ea908ef8dadd2f1c85bfac1b344f8b4441b8706",class:i,label:"",scale:"s"}))))}async _initModules(){const[t,i]=await o(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}async _initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div"),i=(await c(this.mapView)).map((t=>({layer:t,geometryUpdatesEnabled:this.enableEditGeometry})));this._editor=new this.Editor({view:this.mapView,layerInfos:i,visibleElements:{snappingControls:!1},container:t}),this._attachmentHandle&&this._activeWorkflowHandle&&(this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state||"creating-features"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>this._editor.viewModel.activeWorkflow?.activeWorkflow),(t=>{"update-table-record"!==t?.type&&"create-features"!==t?.type||(this._shouldClose=!1),(t?.type||t?.hasPendingEdits||this._editor.activeWorkflow)&&this._editor?.activeWorkflow?.started||(this.open=!1)})),this._editContainer.appendChild(t),this.editorInitialized.emit(this._editor)}}async _closeEdit(t){this._shouldClose=!0,t&&this._editor?.activeWorkflow?(this._editor.activeWorkflow?.activeWorkflow?.hasPendingEdits&&(await this._editor.activeWorkflow.reset(),await this._editor.cancelWorkflow()),this._editor.destroy()):this.graphicIndex>-1&&this.graphics?.length>0&&this.refreshGraphics.emit(this.graphics),this._shouldClose=!1,this.closeEdit.emit()}async _startUpdate(){await this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],locale:["localeWatchHandler"],open:["openWatchHandler"]}}};b.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-color-foreground-1) !important}.esri-feature__content-node{background-color:var(--calcite-color-foreground-1) !important}.esri-editor__panel-toolbar{display:none !important}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.esri-editor__panel-content{padding-block:10px !important}";const f=class{constructor(e){t(this,e),this.popupClosed=i(this,"popupClosed",7),this.clearSelection=i(this,"clearSelection",7),this.selectionChanged=i(this,"selectionChanged",7)}get el(){return e(this)}enableEditGeometry=!1;graphics;isLoading=!1;isMobile;mapView;allowEditing=!0;highlightEnabled=!0;locale;paginationEnabled=!0;position="absolute";showCloseBtn=!1;_alertOpen=!1;_count="";_editRecordOpen=!1;_mobileTitle="";_showListView=!1;_translations;_navigatedToRelatedFeature;Features;_editEnabled;_features;_layer;_popupUtils;_featuresNodeId="features-node"+(new Date).getMilliseconds().toString();reactiveUtils;_relatedFeature;async graphicsWatchHandler(){this._navigatedToRelatedFeature&&this._features&&(this._features.clear(),this._features.close(),this._count="",this._navigatedToRelatedFeature=!1),await this.setGraphics()}async isMobileWatchHandler(){await this._initFeaturesWidget()}async localeWatchHandler(){if(this.el.lang=this.locale,await this._getTranslations(),this._features){const t=[...this.graphics];this.graphics=[],this.graphics=t}}async mapViewWatchHandler(){return await this._initFeaturesWidget()}async getSelectedFeature(){return this._features.selectedFeature}async refresh(){await this.setGraphics()}async back(){this._features.previous(),this._count=this._getCount()}async next(){this._features.next(),this._count=this._getCount()}async toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async updateCurrentGraphic(t){this._features.selectedFeatureWidget.graphic=t}popupClosed;clearSelection;selectionChanged;async closeEdit(){this._editRecordOpen=!1}async layerSelectionChange(){this._showListView=!1,this._features?.viewModel&&(this._features.viewModel.featureMenuOpen=!1,this._features.close())}async refreshGraphics(t){this._navigatedToRelatedFeature||(this.graphics=[...t.detail])}async componentWillLoad(){await this._initModules(),await this._getTranslations(),this._popupUtils=new l}async componentDidLoad(){this.graphics?.length>0&&await this.setGraphics()}render(){const t=this.isLoading?"":"display-none",i=this.isLoading||this._editRecordOpen?"visibility-hidden":"position-absolute",e=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",a=!this.isLoading&&this._editRecordOpen||this._showListView?"display-none":"",o=this._features?.features?.length<2||this._navigatedToRelatedFeature,h=this.isMobile?"display-none":"",c=this._features?.selectedFeature?.getObjectId(),d=parseInt(c?.toString(),10)>-1?[c]:[],l=this._layer?.editingEnabled&&this._layer?.capabilities?.operations?.supportsDelete,r=this._relatedFeature?[this._relatedFeature]:this.graphics,p=this._navigatedToRelatedFeature?0:this._features?.selectedFeatureIndex;return s(n,{key:"9f75eb2e7aba944474e85c34b2abe23982629558"},s("calcite-shell",{key:"748f9e50cd3aa7a52dd7910b171c0d7f54d09203",style:{position:this.position}},this._getHeader(),s("calcite-loader",{key:"feced4d4a66df36958644436acaa53ddabdfc02a",class:t,label:this._translations.fetchingData}),s("div",{key:"3bb912c80d610a21a5e283c6bd19ab0c63023c45",class:"esri-widget feature-node "+i,id:this._featuresNodeId}),s("div",{key:"479dcbda08f837b32bd19ed7f40856f081e92a6e",class:`${a} width-100`,slot:"footer"},this.allowEditing&&s("div",{key:"dd78b02ba8506c391aada6c5233691ec9babcfbe",class:"display-flex top-border padding-1-2"},s("calcite-button",{key:"c5a807609c60151a433fa9c0055fbfdf20b2935f",appearance:"solid",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),this.isMobile&&l?s("delete-button",{class:"padding-inline-start-1 width-100",id:"solutions-delete",ids:d,layer:this._layer,locale:this.locale,onEditsComplete:()=>this._closePopup()}):void 0,s("calcite-tooltip",{key:"a4cd4c77e982e23675ec9eaf08e2135de6c83b65",placement:"bottom","reference-element":"solutions-edit"},s("span",{key:"22533608996d1c87b9b04e339506ec01176379b0"},this._translations.edit)),this.isMobile&&l?s("calcite-tooltip",{placement:"bottom","reference-element":"solutions-delete"},s("span",null,this._translations.delete)):void 0),this.paginationEnabled&&!o&&s("div",{key:"183ff7da57a06de8f5419edf5973f18b41c46097",class:`display-flex padding-1-2 button-container top-border ${h}`},s("div",{key:"77e59229d1d516ccdc8f7c5be2f89a5ad9d5004b"},s("calcite-button",{key:"4b6a6f1f85e9199e14d626ba66b6b319283d0c32",appearance:"transparent",disabled:o,iconFlipRtl:"both",iconStart:"chevron-left",id:"solutions-back",onClick:()=>this._back(),width:"full"}),s("calcite-tooltip",{key:"7056c5cb3c790c804194f09f2586864a28dce5e1",placement:"top","reference-element":"solutions-back"},s("span",{key:"923fc5425a9faced6952a1b9acff9b7d0f3da286"},this._translations.back))),s("calcite-action",{key:"a34bfb4ae71a91373fd476e7b704a6a2f8f23157",class:"pagination-action",iconFlipRtl:!0,onClick:()=>this._toggleListView(),scale:"s",text:"",textEnabled:!0},s("span",{key:"101a0fa592af65b540123c835e9031a18671ad8b",class:"pagination-count"},this._count)),s("div",{key:"c4f88f464a3091dfc77578470de4f42d05b9f5c7"},s("calcite-button",{key:"e4e35e539f0c7e01a31e0047db545d4d334ef2d8",appearance:"transparent",disabled:o,iconFlipRtl:"both",iconStart:"chevron-right",id:"solutions-next",onClick:()=>this._next(),width:"full"}),s("calcite-tooltip",{key:"40244ecf5566fde448b311272d2ee00d70bc531a",placement:"top","reference-element":"solutions-next"},s("span",{key:"db01e2a2b9da9a80f9a25caf49bf8beb872e6ad9"},this._translations.next))))),s("edit-card",{key:"cfa193b01b67f7709ea6a491caa0c647c536e9e3",class:e,enableEditGeometry:this.enableEditGeometry,graphicIndex:p,graphics:r,locale:this.locale,mapView:this.mapView,open:this._editRecordOpen}),s("calcite-alert",{key:"709fd6d681d32a03fcf5fba959e81a0153676e26",icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},s("div",{key:"bbdd9cc98fcda8ffba294a4322f08468072f6aef",slot:"title"},this._translations.editDisabled),s("div",{key:"d07e32e9cd54cc82ff005e7e696e13e1b8bdaa4e",slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t,i]=await o(["esri/widgets/Features","esri/core/reactiveUtils"]);this.Features=t,this.reactiveUtils=i}async setGraphics(){this._features||await this._initFeaturesWidget(),this.graphics.length>0?(this._layer=this.graphics[0]?.layer,this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._mobileTitle=await this._popupUtils.getPopupTitle(this.graphics[0],this.mapView.map),this._features.open({features:this.graphics})):(this._features.clear(),this._features.close()),this._count=this._getCount()}async _initFeaturesWidget(){return void 0!==this.isMobile?await(this.mapView?.when((()=>{this._features?(this._features.view=this.mapView,this._features.visibleElements.actionBar=!1,this._features.visibleElements.closeButton=this.showCloseBtn,this._features.visibleElements.heading=!this.isMobile):(this._features=new this.Features({view:this.mapView,container:this._featuresNodeId,visibleElements:{actionBar:!1,closeButton:this.showCloseBtn,heading:!this.isMobile}}),this._features.viewModel.highlightEnabled=this.highlightEnabled,this.reactiveUtils.watch((()=>this._features.viewModel.featureMenuOpen),(t=>{this._count=this._getCount(),t||(this._showListView=t)})),this.reactiveUtils.watch((()=>this._features.selectedFeatureIndex),(t=>{t>-1&&this.selectionChanged.emit({selectedFeature:[this._features.selectedFeature],selectedFeatureIndex:this._features.selectedFeatureIndex})})),this.reactiveUtils.watch((()=>this._features.selectedDrillInFeature),(t=>{t?(this._relatedFeature=t,this._navigatedToRelatedFeature=!0):(this._relatedFeature=null,this._navigatedToRelatedFeature=!1)})),this.el.querySelector("#"+this._featuresNodeId).addEventListener("calciteFlowItemClose",(()=>{this.clearSelection.emit()})))}))):Promise.resolve()}_getHeader(){return this.isMobile&&!this._editRecordOpen?s("calcite-panel",{class:"border-width-0",slot:"header"},s("calcite-action",{class:"end-border",icon:"chevron-left",iconFlipRtl:!0,onClick:()=>this._closePopup(),scale:"s",slot:"header-actions-start",text:""}),s("span",{class:"font-bold",slot:"header-content"},this._mobileTitle)):void 0}_closePopup(){this.popupClosed.emit()}_alertClosed(){this._alertOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}_back(){this._features.previous(),this._count=this._getCount()}_next(){this._features.next(),this._count=this._getCount()}_getCount(){const t=(this._features?.viewModel.selectedFeatureIndex+1).toString(),i=this._features?.features?.length.toString();return this._translations.indexOfTotal.replace("{{index}}",t).replace("{{total}}",i)}_toggleListView(){this._showListView=!this._showListView;const t=this._features.selectedFeatureIndex;this._features.open({features:this.graphics,featureMenuOpen:this._showListView}),this._features.selectedFeatureIndex=t}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],isMobile:["isMobileWatchHandler"],locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"]}}};f.style=":host{display:block;--calcite-label-margin-bottom:0}.padding-1-2{padding:0.5rem}.display-none{display:none !important}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}.feature-node{position:relative !important}.feature-node .esri-features__footer{display:none !important}.button-container{justify-content:center;align-items:center}.top-border{border-top:1px solid var(--calcite-color-border-1)}.width-100{width:100%}.esri-features__container{padding:0.5rem !important;background-color:var(--calcite-color-foreground-1) !important;height:100% !important}.overflow-hidden{overflow:hidden}.height-40{height:40px}.end-border{border-inline-end:1px solid var(--calcite-color-border-1)}.font-bold{font-weight:bold}.visibility-hidden{visibility:hidden;height:0px}.padding-inline-start-1{padding-inline-start:1rem}.border-width-0{border-width:0px}.pagination-action{position:relative;left:3px}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}";export{r as create_feature,p as delete_button,b as edit_card,f as info_card}
@@ -1,7 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- var t=Object.defineProperty,e=(t,e)=>{var n;Object.entries(null!=(n=e.o.t)?n:{}).map((([n,[o]])=>{if(31&o||32&o){const o=t[n],l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t),n);Object.defineProperty(t,n,{get(){return l.get.call(this)},set(t){l.set.call(this,t)},configurable:!0,enumerable:!0}),t[n]=e.l.has(n)?e.l.get(n):o}}))},n=new WeakMap,o=t=>n.get(t),l=(t,o)=>{n.set(o.i=t,o),e(t,o)},s=(t,e)=>e in t,i=(t,e)=>(0,console.error)(t,e),r=new Map,c=new Map,u="slot-fb{display:contents}slot-fb[hidden]{display:none}",f="undefined"!=typeof window?window:{},a=f.document||{head:{}},d={u:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,o)=>t.addEventListener(e,n,o),rel:(t,e,n,o)=>t.removeEventListener(e,n,o),ce:(t,e)=>new CustomEvent(t,e)},h=t=>Promise.resolve(t),v=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(t){}return!1})(),p=!1,m=[],y=[],b=(t,e)=>n=>{t.push(n),p||(p=!0,e&&4&d.u?g(w):d.raf(w))},$=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){i(t)}t.length=0},w=()=>{$(m),$(y),(p=m.length>0)&&d.raf(w)},g=t=>h().then(t),j=b(y,!0),S=t=>{const e=new URL(t,d.h);return e.origin!==f.location.origin?e.href:e.pathname},O=t=>"object"==(t=typeof t)||"function"===t;function k(t){var e,n,o;return null!=(o=null==(n=null==(e=t.head)?void 0:e.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}((e,n)=>{for(var o in n)t(e,o,{get:n[o],enumerable:!0})})({},{err:()=>C,map:()=>M,ok:()=>E,unwrap:()=>R,unwrapErr:()=>x});var E=t=>({isOk:!0,isErr:!1,value:t}),C=t=>({isOk:!1,isErr:!0,value:t});function M(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>E(t))):E(n)}if(t.isErr)return C(t.value);throw"should never get here"}var R=t=>{if(t.isOk)return t.value;throw t.value},x=t=>{if(t.isErr)return t.value;throw t.value},T=t=>{const e=t.__childNodes||t.childNodes;t.tagName&&t.tagName.includes("-")&&t["s-cr"]&&"SLOT-FB"!==t.tagName&&L(e,t.tagName).forEach((t=>{var e;1===t.nodeType&&"SLOT-FB"===t.tagName&&(t.hidden=!!(null==(e=D(t,t["s-sn"],!1))?void 0:e.length))}));for(const t of e)1===t.nodeType&&(t.__childNodes||t.childNodes).length&&T(t)};function L(t,e,n){let o,l=0,s=[];for(;l<t.length;l++){if(o=t[l],o["s-sr"]&&o["s-hn"]===e&&(void 0===n||o["s-sn"]===n)&&(s.push(o),void 0!==n))return s;s=[...s,...L(o.childNodes,e,n)]}return s}var P,F,A,D=(t,e,n=!0)=>{const o=[];for((n&&t["s-sr"]||!t["s-sr"])&&o.push(t);(t=t.nextSibling)&&t["s-sn"]===e;)o.push(t);return o},U=(t,e)=>1===t.nodeType?null===t.getAttribute("slot")&&""===e||t.getAttribute("slot")===e:t["s-sn"]===e||""===e,H=(t,e,...n)=>{let o=null,l=null,s=null,i=!1,r=!1;const c=[],u=e=>{for(let n=0;n<e.length;n++)o=e[n],Array.isArray(o)?u(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof t&&!O(o))&&(o+=""),i&&r?c[c.length-1].v+=o:c.push(i?N(null,o):o),r=i)};if(u(n),e){e.key&&(l=e.key),e.name&&(s=e.name);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}if("function"==typeof t)return t(null===e?{}:e,c,B);const f=N(t,null);return f.p=e,c.length>0&&(f.m=c),f.$=l,f.j=s,f},N=(t,e)=>({u:0,S:t,v:e,O:null,m:null,p:null,$:null,j:null}),W={},B={forEach:(t,e)=>t.map(V).forEach(e),map:(t,e)=>t.map(V).map(e).map(q)},V=t=>({vattrs:t.p,vchildren:t.m,vkey:t.$,vname:t.j,vtag:t.S,vtext:t.v}),q=t=>{if("function"==typeof t.vtag){const e={...t.vattrs};return t.vkey&&(e.key=t.vkey),t.vname&&(e.name=t.vname),H(t.vtag,e,...t.vchildren||[])}const e=N(t.vtag,t.vtext);return e.p=t.vattrs,e.m=t.vchildren,e.$=t.vkey,e.j=t.vname,e},G=(t,e)=>null==t||O(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?parseFloat(t):1&e?t+"":t,_=t=>o(t).$hostElement$,z=(t,e,n)=>{const o=_(t);return{emit:t=>I(o,e,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:t})}},I=(t,e,n)=>{const o=d.ce(e,n);return t.dispatchEvent(o),o},J=new WeakMap,K=t=>"sc-"+t.k,Q=(t,e,n,o,l,i)=>{if(n!==o){let r=s(t,e),c=e.toLowerCase();if("class"===e){const e=t.classList,l=Y(n);let s=Y(o);e.remove(...l.filter((t=>t&&!s.includes(t)))),e.add(...s.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)o&&null!=o[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in o)n&&o[e]===n[e]||(e.includes("-")?t.style.setProperty(e,o[e]):t.style[e]=o[e])}else if("key"===e);else if("ref"===e)o&&o(t);else if(r||"o"!==e[0]||"n"!==e[1]){const s=O(o);if((r||s&&null!==o)&&!l)try{if(t.tagName.includes("-"))t[e]!==o&&(t[e]=o);else{const l=null==o?"":o;"list"===e?r=!1:null!=n&&t[e]==l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==o||!1===o?!1===o&&""!==t.getAttribute(e)||t.removeAttribute(e):(!r||4&i||l)&&!s&&t.setAttribute(e,o=!0===o?"":o)}else if(e="-"===e[2]?e.slice(3):s(f,c)?c.slice(2):c[2]+e.slice(3),n||o){const l=e.endsWith(Z);e=e.replace(tt,""),n&&d.rel(t,e,n,l),o&&d.ael(t,e,o,l)}}},X=/\s/,Y=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(X):[]),Z="Capture",tt=RegExp(Z+"$"),et=(t,e,n)=>{const o=11===e.O.nodeType&&e.O.host?e.O.host:e.O,l=t&&t.p||{},s=e.p||{};for(const t of nt(Object.keys(l)))t in s||Q(o,t,l[t],void 0,n,e.u);for(const t of nt(Object.keys(s)))Q(o,t,l[t],s[t],n,e.u)};function nt(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var ot=!1,lt=!1,st=!1,it=!1,rt=(t,e,n)=>{var o;const l=e.m[n];let s,i,r,c=0;if(ot||(st=!0,"slot"===l.S&&(l.u|=l.m?2:1)),null!==l.v)s=l.O=a.createTextNode(l.v);else if(1&l.u)s=l.O=a.createTextNode("");else{if(it||(it="svg"===l.S),s=l.O=a.createElementNS(it?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",!ot&&2&l.u?"slot-fb":l.S),it&&"foreignObject"===l.S&&(it=!1),et(null,l,it),null!=P&&void 0!==P&&s["s-si"]!==P&&s.classList.add(s["s-si"]=P),l.m)for(c=0;c<l.m.length;++c)i=rt(t,l,c),i&&s.appendChild(i);"svg"===l.S?it=!1:"foreignObject"===s.tagName&&(it=!0)}return s["s-hn"]=A,3&l.u&&(s["s-sr"]=!0,s["s-cr"]=F,s["s-sn"]=l.j||"",s["s-rf"]=null==(o=l.p)?void 0:o.ref,r=t&&t.m&&t.m[n],r&&r.S===l.S&&t.O&&ct(t.O,!1),bt(F,s,e.O,null==t?void 0:t.O)),s},ct=(t,e)=>{d.u|=1;const n=Array.from(t.__childNodes||t.childNodes);for(let t=n.length-1;t>=0;t--){const o=n[t];o["s-hn"]!==A&&o["s-ol"]&&(yt(dt(o).parentNode,o,dt(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,st=!0),e&&ct(o,e)}d.u&=-2},ut=(t,e,n,o,l,s)=>{let i,r=t["s-cr"]&&t["s-cr"].parentNode||t;for(r.shadowRoot&&r.tagName===A&&(r=r.shadowRoot);l<=s;++l)o[l]&&(i=rt(null,n,l),i&&(o[l].O=i,yt(r,i,dt(e))))},ft=(t,e,n)=>{for(let o=e;o<=n;++o){const e=t[o];if(e){const t=e.O;mt(e),t&&(lt=!0,t["s-ol"]?t["s-ol"].remove():ct(t,!0),t.remove())}}},at=(t,e,n=!1)=>t.S===e.S&&("slot"===t.S?t.j===e.j:n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),dt=t=>t&&t["s-ol"]||t,ht=(t,e,n=!1)=>{const o=e.O=t.O,l=t.m,s=e.m,i=e.S,r=e.v;let c;null===r?(it="svg"===i||"foreignObject"!==i&&it,("slot"!==i||ot)&&et(t,e,it),null!==l&&null!==s?((t,e,n,o,l=!1)=>{let s,i,r=0,c=0,u=0,f=0,a=e.length-1,d=e[0],h=e[a],v=o.length-1,p=o[0],m=o[v];for(;r<=a&&c<=v;)if(null==d)d=e[++r];else if(null==h)h=e[--a];else if(null==p)p=o[++c];else if(null==m)m=o[--v];else if(at(d,p,l))ht(d,p,l),d=e[++r],p=o[++c];else if(at(h,m,l))ht(h,m,l),h=e[--a],m=o[--v];else if(at(d,m,l))"slot"!==d.S&&"slot"!==m.S||ct(d.O.parentNode,!1),ht(d,m,l),yt(t,d.O,h.O.nextSibling),d=e[++r],m=o[--v];else if(at(h,p,l))"slot"!==d.S&&"slot"!==m.S||ct(h.O.parentNode,!1),ht(h,p,l),yt(t,h.O,d.O),h=e[--a],p=o[++c];else{for(u=-1,f=r;f<=a;++f)if(e[f]&&null!==e[f].$&&e[f].$===p.$){u=f;break}u>=0?(i=e[u],i.S!==p.S?s=rt(e&&e[c],n,u):(ht(i,p,l),e[u]=void 0,s=i.O),p=o[++c]):(s=rt(e&&e[c],n,c),p=o[++c]),s&&yt(dt(d.O).parentNode,s,dt(d.O))}r>a?ut(t,null==o[v+1]?null:o[v+1].O,n,o,c,v):c>v&&ft(e,r,a)})(o,l,e,s,n):null!==s?(null!==t.v&&(o.textContent=""),ut(o,null,e,s,0,s.length-1)):!n&&null!==l&&ft(l,0,l.length-1),it&&"svg"===i&&(it=!1)):(c=o["s-cr"])?c.parentNode.textContent=r:t.v!==r&&(o.data=r)},vt=[],pt=t=>{let e,n,o;const l=t.__childNodes||t.childNodes;for(const t of l){if(t["s-sr"]&&(e=t["s-cr"])&&e.parentNode){n=e.parentNode.__childNodes||e.parentNode.childNodes;const l=t["s-sn"];for(o=n.length-1;o>=0;o--)if(e=n[o],!e["s-cn"]&&!e["s-nr"]&&e["s-hn"]!==t["s-hn"])if(U(e,l)){let n=vt.find((t=>t.C===e));lt=!0,e["s-sn"]=e["s-sn"]||l,n?(n.C["s-sh"]=t["s-hn"],n.M=t):(e["s-sh"]=t["s-hn"],vt.push({M:t,C:e})),e["s-sr"]&&vt.map((t=>{U(t.C,e["s-sn"])&&(n=vt.find((t=>t.C===e)),n&&!t.M&&(t.M=n.M))}))}else vt.some((t=>t.C===e))||vt.push({C:e})}1===t.nodeType&&pt(t)}},mt=t=>{t.p&&t.p.ref&&t.p.ref(null),t.m&&t.m.map(mt)},yt=(t,e,n)=>("string"==typeof e["s-sn"]&&e["s-sr"]&&e["s-cr"]&&bt(e["s-cr"],e,t,e.parentElement),null==t?void 0:t.insertBefore(e,n));function bt(t,e,n,o){var l;let s;if(t&&"string"==typeof e["s-sn"]&&e["s-sr"]&&t.parentNode&&t.parentNode["s-sc"]&&(s=e["s-si"]||t.parentNode["s-sc"])){const t=e["s-sn"],i=e["s-hn"];if(null==(l=n.classList)||l.add(s+"-s"),o&&o.classList.contains(s+"-s")){let e=(o.__childNodes||o.childNodes)[0],n=!1;for(;e;){if(e["s-sn"]!==t&&e["s-hn"]===i&&e["s-sr"]){n=!0;break}e=e.nextSibling}n||o.classList.remove(s+"-s")}}}var $t=(t,e)=>{if(e&&!t.R&&e["s-p"]){const n=e["s-p"].push(new Promise((o=>t.R=()=>{e["s-p"].splice(n-1,1),o()})))}},wt=(t,e)=>{if(t.u|=16,!(4&t.u))return $t(t,t.T),j((()=>gt(t,e)));t.u|=512},gt=(t,e)=>{const n=t.$hostElement$,o=t.i;if(!o)throw Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let l;return e?(t.u|=256,t.L&&(t.L.map((([t,e])=>Tt(o,t,e,n))),t.L=void 0),l=Tt(o,"componentWillLoad",void 0,n)):l=Tt(o,"componentWillUpdate",void 0,n),l=jt(l,(()=>Tt(o,"componentWillRender",void 0,n))),jt(l,(()=>Ot(t,o,e)))},jt=(t,e)=>St(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),St=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,Ot=async(t,e,n)=>{var o;const l=t.$hostElement$,s=l["s-rc"];n&&(t=>{const e=t.o,n=t.$hostElement$,o=e.u,l=((t,e)=>{var n;const o=K(e),l=c.get(o);if(t=11===t.nodeType?t:a,l)if("string"==typeof l){let s,i=J.get(t=t.head||t);if(i||J.set(t,i=new Set),!i.has(o)){{s=document.querySelector(`[sty-id="${o}"]`)||a.createElement("style"),s.innerHTML=l;const i=null!=(n=d.P)?n:k(a);if(null!=i&&s.setAttribute("nonce",i),!(1&e.u))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(s,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(v){const e=new CSSStyleSheet;e.replaceSync(l),t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.innerHTML=l+e.innerHTML:t.prepend(s)}else t.append(s);1&e.u&&"HEAD"!==t.nodeName&&t.insertBefore(s,null)}4&e.u&&(s.innerHTML+=u),i&&i.add(o)}}else t.adoptedStyleSheets.includes(l)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,l]);return o})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&o&&2&o&&(n["s-sc"]=l,n.classList.add(l+"-h"))})(t);Et(t,e,l,n),s&&(s.map((t=>t())),l["s-rc"]=void 0);{const e=null!=(o=l["s-p"])?o:[],n=()=>Mt(t);0===e.length?n():(Promise.all(e).then(n),t.u|=4,e.length=0)}},kt=null,Et=(t,e,n,o)=>{try{kt=e,e=e.render(),t.u&=-17,t.u|=2,((t,e,n=!1)=>{var o,l,s,i;const r=t.$hostElement$,c=t.o,u=t.F||N(null,null),f=(t=>t&&t.S===W)(e)?e:H(null,null,e);if(A=r.tagName,c.A&&(f.p=f.p||{},c.A.map((([t,e])=>f.p[e]=r[t]))),n&&f.p)for(const t of Object.keys(f.p))r.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(f.p[t]=r[t]);if(f.S=null,f.u|=4,t.F=f,f.O=u.O=r.shadowRoot||r,P=r["s-sc"],ot=!!(1&c.u),F=r["s-cr"],lt=!1,ht(u,f,n),d.u|=1,st){pt(f.O);for(const t of vt){const e=t.C;if(!e["s-ol"]){const t=a.createTextNode("");t["s-nr"]=e,yt(e.parentNode,e["s-ol"]=t,e)}}for(const t of vt){const e=t.C,r=t.M;if(r){const t=r.parentNode;let n=r.nextSibling;{let s=null==(o=e["s-ol"])?void 0:o.previousSibling;for(;s;){let o=null!=(l=s["s-nr"])?l:null;if(o&&o["s-sn"]===e["s-sn"]&&t===(o.__parentNode||o.parentNode)){for(o=o.nextSibling;o===e||(null==o?void 0:o["s-sr"]);)o=null==o?void 0:o.nextSibling;if(!o||!o["s-nr"]){n=o;break}}s=s.previousSibling}}(!n&&t!==(e.__parentNode||e.parentNode)||(e.__nextSibling||e.nextSibling)!==n)&&e!==n&&(!e["s-hn"]&&e["s-ol"]&&(e["s-hn"]=e["s-ol"].parentNode.nodeName),yt(t,e,n),1===e.nodeType&&"SLOT-FB"!==e.tagName&&(e.hidden=null!=(s=e["s-ih"])&&s)),e&&"function"==typeof r["s-rf"]&&r["s-rf"](e)}else 1===e.nodeType&&(n&&(e["s-ih"]=null!=(i=e.hidden)&&i),e.hidden=!0)}}lt&&T(f.O),d.u&=-2,vt.length=0,F=void 0})(t,e,o)}catch(e){i(e,t.$hostElement$)}return kt=null,null},Ct=()=>kt,Mt=t=>{const e=t.$hostElement$,n=t.i,o=t.T;Tt(n,"componentDidRender",void 0,e),64&t.u?Tt(n,"componentDidUpdate",void 0,e):(t.u|=64,Lt(e),Tt(n,"componentDidLoad",void 0,e),t.D(e),o||xt()),t.U(e),t.R&&(t.R(),t.R=void 0),512&t.u&&g((()=>wt(t,!1))),t.u&=-517},Rt=t=>{{const e=o(t),n=e.$hostElement$.isConnected;return n&&2==(18&e.u)&&wt(e,!1),n}},xt=()=>{Lt(a.documentElement),g((()=>I(f,"appload",{detail:{namespace:"solutions-components"}})))},Tt=(t,e,n,o)=>{if(t&&t[e])try{return t[e](n)}catch(t){i(t,o)}},Lt=t=>t.classList.add("hydrated"),Pt=(t,e,n,l)=>{const s=o(t);if(!s)throw Error(`Couldn't find host element for "${l.k}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/ionic-team/stencil/issues/5457).`);const r=s.$hostElement$,c=s.l.get(e),u=s.u,f=s.i;if(n=G(n,l.t[e][0]),(!(8&u)||void 0===c)&&n!==c&&(!Number.isNaN(c)||!Number.isNaN(n))&&(s.l.set(e,n),f)){if(l.H&&128&u){const t=l.H[e];t&&t.map((t=>{try{f[t](n,c,e)}catch(t){i(t,r)}}))}2==(18&u)&&wt(s,!1)}},Ft=(t,e,n)=>{var l,s;const i=t.prototype;if(e.t||e.H||t.watchers){t.watchers&&!e.H&&(e.H=t.watchers);const r=Object.entries(null!=(l=e.t)?l:{});if(r.map((([t,[l]])=>{if(31&l||2&n&&32&l){const{get:s,set:r}=Object.getOwnPropertyDescriptor(i,t)||{};s&&(e.t[t][0]|=2048),r&&(e.t[t][0]|=4096),(1&n||!s)&&Object.defineProperty(i,t,{get(){{if(!(2048&e.t[t][0]))return((t,e)=>o(this).l.get(e))(0,t);const n=o(this),l=n?n.i:i;if(!l)return;return l[t]}},configurable:!0,enumerable:!0}),Object.defineProperty(i,t,{set(s){const i=o(this);if(r){const n=32&l?this[t]:i.$hostElement$[t];return void 0===n&&i.l.get(t)?s=i.l.get(t):!i.l.get(t)&&n&&i.l.set(t,n),r.call(this,G(s,l)),void Pt(this,t,s=32&l?this[t]:i.$hostElement$[t],e)}{if(!(1&n&&4096&e.t[t][0]))return Pt(this,t,s,e),void(1&n&&!i.i&&i.N.then((()=>{4096&e.t[t][0]&&i.i[t]!==i.l.get(t)&&(i.i[t]=s)})));const o=()=>{const n=i.i[t];!i.l.get(t)&&n&&i.l.set(t,n),i.i[t]=G(s,l),Pt(this,t,i.i[t],e)};i.i?o():i.N.then((()=>o()))}}})}else 1&n&&64&l&&Object.defineProperty(i,t,{value(...e){var n;const l=o(this);return null==(n=null==l?void 0:l.W)?void 0:n.then((()=>{var n;return null==(n=l.i)?void 0:n[t](...e)}))}})})),1&n){const n=new Map;i.attributeChangedCallback=function(t,l,s){d.jmp((()=>{var r;const c=n.get(t);if(this.hasOwnProperty(c))s=this[c],delete this[c];else{if(i.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==s)return;if(null==c){const n=o(this),i=null==n?void 0:n.u;if(i&&!(8&i)&&128&i&&s!==l){const o=n.i,i=null==(r=e.H)?void 0:r[t];null==i||i.forEach((e=>{null!=o[e]&&o[e].call(o,s,l,t)}))}return}}const u=Object.getOwnPropertyDescriptor(i,c);(s=(null!==s||"boolean"!=typeof this[c])&&s)===this[c]||u.get&&!u.set||(this[c]=s)}))},t.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.H)?s:{}),...r.filter((([t,e])=>15&e[0])).map((([t,o])=>{var l;const s=o[1]||t;return n.set(s,t),512&o[0]&&(null==(l=e.A)||l.push([t,s])),s}))]))}}return t},At=(t,e)=>{Tt(t,"connectedCallback",void 0,e)},Dt=(t,e)=>{Tt(t,"disconnectedCallback",void 0,e||t)},Ut=(t,e={})=>{var l;const s=[],h=e.exclude||[],p=f.customElements,m=a.head,y=m.querySelector("meta[charset]"),b=a.createElement("style"),$=[];let w,g=!0;Object.assign(d,e),d.h=new URL(e.resourcesUrl||"./",a.baseURI).href;let j=!1;if(t.map((t=>{t[1].map((e=>{var l;const u={u:e[0],k:e[1],t:e[2],B:e[3]};4&u.u&&(j=!0),u.t=e[2],u.B=e[3],u.A=[],u.H=null!=(l=e[4])?l:{};const f=u.k,m=class extends HTMLElement{constructor(t){if(super(t),this.hasRegisteredEventListeners=!1,((t,e)=>{const o={u:0,$hostElement$:t,o:e,l:new Map};o.W=new Promise((t=>o.U=t)),o.N=new Promise((t=>o.D=t)),t["s-p"]=[],t["s-rc"]=[],n.set(t,o)})(t=this,u),1&u.u)if(t.shadowRoot){if("open"!==t.shadowRoot.mode)throw Error(`Unable to re-use existing shadow root for ${u.k}! Mode is set to ${t.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else t.attachShadow({mode:"open"})}connectedCallback(){const t=o(this);this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0,Nt(this,t,u.B)),w&&(clearTimeout(w),w=null),g?$.push(this):d.jmp((()=>(t=>{if(!(1&d.u)){const e=o(t),n=e.o,l=()=>{};if(1&e.u)Nt(t,e,n.B),(null==e?void 0:e.i)?At(e.i,t):(null==e?void 0:e.N)&&e.N.then((()=>At(e.i,t)));else{e.u|=1,12&n.u&&(t=>{const e=t["s-cr"]=a.createComment("");e["s-cn"]=!0,yt(t,e,t.firstChild)})(t);{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){$t(e,e.T=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&t.hasOwnProperty(e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let o;if(!(32&e.u)){e.u|=32;{const l=((t,e)=>{const n=t.k.replace(/-/g,"_"),o=t.V;if(!o)return;const l=r.get(o);return l?l[n]:import(`./${o}.entry.js`).then((t=>(r.set(o,t),t[n])),(t=>{i(t,e.$hostElement$)}))
7
- /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(n,e);if(l&&"then"in l){const t=()=>{};o=await l,t()}else o=l;if(!o)throw Error(`Constructor for "${n.k}#${e.q}" was not found`);o.isProxied||(n.H=o.watchers,Ft(o,n,2),o.isProxied=!0);const s=()=>{};e.u|=8;try{new o(e)}catch(e){i(e,t)}e.u&=-9,e.u|=128,s(),At(e.i,t)}if(o&&o.style){let t;"string"==typeof o.style&&(t=o.style);const e=K(n);if(!c.has(e)){const o=()=>{};((t,e,n)=>{let o=c.get(t);v&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=e:o.replaceSync(e)):o=e,c.set(t,o)})(e,t,!!(1&n.u)),o()}}}const l=e.T,s=()=>wt(e,!0);l&&l["s-rc"]?l["s-rc"].push(s):s()})(t,e,n)}l()}})(this)))}disconnectedCallback(){d.jmp((()=>(async t=>{if(!(1&d.u)){const e=o(t);e.G&&(e.G.map((t=>t())),e.G=void 0),(null==e?void 0:e.i)?Dt(e.i,t):(null==e?void 0:e.N)&&e.N.then((()=>Dt(e.i,t)))}J.has(t)&&J.delete(t),t.shadowRoot&&J.has(t.shadowRoot)&&J.delete(t.shadowRoot)})(this))),d.raf((()=>{var t;const e=o(this);(null==(t=null==e?void 0:e.F)?void 0:t.O)instanceof Node&&!e.F.O.isConnected&&delete e.F.O}))}componentOnReady(){return o(this).N}};u.V=t[0],h.includes(f)||p.get(f)||(s.push(f),p.define(f,Ft(m,u,1)))}))})),s.length>0&&(j&&(b.textContent+=u),b.textContent+=s.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",b.innerHTML.length)){b.setAttribute("data-styles","");const t=null!=(l=d.P)?l:k(a);null!=t&&b.setAttribute("nonce",t),m.insertBefore(b,y?y.nextSibling:m.firstChild)}g=!1,$.length?$.map((t=>t.connectedCallback())):d.jmp((()=>w=setTimeout(xt,30)))},Ht=(t,e)=>e,Nt=(t,e,n)=>{n&&n.map((([n,o,l])=>{const s=Bt(t,n),i=Wt(e,l),r=Vt(n);d.ael(s,o,i,r),(e.G=e.G||[]).push((()=>d.rel(s,o,i,r)))}))},Wt=(t,e)=>n=>{var o;try{256&t.u?null==(o=t.i)||o[e](n):(t.L=t.L||[]).push([e,n])}catch(e){i(e,t.$hostElement$)}},Bt=(t,e)=>8&e?f:t,Vt=t=>({passive:!!(1&t),capture:!!(2&t)}),qt=t=>d.P=t;export{Ht as F,W as H,S as a,Ut as b,z as c,Ct as d,Rt as f,_ as g,H as h,h as p,l as r,qt as s}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,g as e,h as i,H as a,c as s}from"./p-1b0588d2.js";import{g as n}from"./p-ee2cbba0.js";import{s as c}from"./p-8b218ba7.js";import{d as o}from"./p-80cb7c73.js";import{E as l}from"./p-4f236b5d.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-e23b4193.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const d=class{constructor(e){t(this,e)}get el(){return e(this)}hasChanges=!1;hasErrors=!1;instanceid="";locale;value="";async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentDidLoad(){const t=document.getElementById(`${this.instanceid}-container`);if(t){this._editor=monaco.editor.create(t,{value:this.value,language:"json",theme:"vs",minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1}),this._currentModel=this._editor.getModel(),this._contentChanged=this._currentModel.onDidChangeContent(this._onEditorChange.bind(this));const e=monaco.editor.setModelMarkers,i=this;monaco.editor.setModelMarkers=function(t,a,s){t.id===i._currentModel.id&&(i._flagEditorHasErrors(s.length>0),i.hasErrors||(i._flagEditorHasChanges(i._currentModel?.canUndo()),i._currentModel?.canUndo()&&i._flagEditorContentChanged()),document.getElementById(`${i.instanceid}-errorFlag`).style.visibility=i.hasErrors?"visible":"hidden"),e.call(monaco.editor,t,a,s)},this._diffEditor=monaco.editor.createDiffEditor(document.getElementById(`${this.instanceid}-diff-container`),{automaticLayout:!0}),this._setDiffModel(),this._loaded=!0,this._toggleUndoRedo()}}async componentWillLoad(){this._initValueObserver(),await this._getTranslations()}render(){return i(a,{key:"e9c806dbfc886daac9be93350e461246339787dd"},i("div",{key:"5f31103bc0392042581d1421530f2ddcdebcc507",id:`${this.instanceid}-editor-container`,class:"editor-container padding-right"},i("div",{key:"560c74b9864cd94f4e689bf65cb8e1fac42b94af",class:"editor-controls"},i("div",{key:"73ca9ac97f3d40fb408e98477641a9d94e1cd32e",class:"editor-buttons"},i("calcite-icon",{key:"2d83934e4493595f66e047c608a87e316279ec1b",id:`${this.instanceid}-errorFlag`,icon:"exclamation-mark-triangle",title:this._translations.errorFlag,scale:"s",class:"edit-error-flag"}),i("calcite-button",{key:"fe95dd90ec0db23c6d6d6766d6d405c32468cec1",id:`${this.instanceid}-undo`,color:"blue",appearance:"solid",title:this._translations.undo,onClick:()=>this._undo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"d802118d2ac7b8cbf2750f3af11252fd52173dd0",icon:"undo",scale:"s"})),i("calcite-button",{key:"9e9af33be6b712ff83ec70e024776c2429086761",id:`${this.instanceid}-redo`,color:"blue",appearance:"solid",title:this._translations.redo,onClick:()=>this._redo(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"bb5bfd3a99902b03c4ffb704b8fdc963c006e664",icon:"redo",scale:"s"})),i("calcite-button",{key:"a88fcffeb9c82394470717ebc6659b42ad9a1c20",id:`${this.instanceid}-diff`,color:"blue",appearance:"solid",title:this._translations.diff,onClick:()=>this._toggleEditor(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"f902baf72fee24ef3b56da2c4d9337db96ab63b1",icon:"compare",scale:"s"})),i("calcite-button",{key:"841abd705338fb1e43c892c4858bff00591958c3",id:`${this.instanceid}-search`,appearance:"outline",color:"blue",title:this._translations.search,onClick:()=>this._search(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"01c24bdbf30cd22a06064bf26a47b38516508879",icon:"search",scale:"s"})),i("calcite-button",{key:"2d6b9dc60e26e347272c76ff9f8ada529975265b",id:`${this.instanceid}-reset`,color:"blue",appearance:"solid",disabled:!0,title:this._translations.cancelEdits,onClick:()=>this._reset(),scale:"s",class:"edit-button"},i("calcite-icon",{key:"a373dc694d97992dfbd60f49f38536ba34684381",icon:"reset",scale:"s"})))),i("div",{key:"6cdebae478b9d1b61e317155000bf62ad4c5b8a3",class:"edit-parent"},i("div",{key:"e3914618f86335e9538969b5cb7f7797212985c2",id:`${this.instanceid}-container`,class:"json-edit-container"}),i("div",{key:"4a17fd062060ddf2e5dca5c2fb6c9883ed9aadd4",id:`${this.instanceid}-diff-container`,class:"json-edit-container display-none"}))))}_cancelEditsBtnHandler;_contentChanged;_currentModel;_diffEditor;_editor;_loaded=!1;_searchBtnHandler;_translations;_useDiffEditor=!1;_valueObserver;async getEditorContents(){return new Promise(((t,e)=>{try{t(this._currentModel.getValue())}catch(t){e(t)}}))}async prepareForDeletion(){this._searchBtnHandler?.removeEventListener("click",this._search),this._cancelEditsBtnHandler?.removeEventListener("click",this._reset),this._valueObserver?.disconnect(),this._contentChanged?.dispose(),this._editor?.dispose()}async replaceCurrentSelection(t){const e=this._editor.getSelection();this._editor.executeEdits("",[{range:e,text:t}])}async reset(){return new Promise(((t,e)=>{try{this._reset(),t({success:!0})}catch(t){e(t)}}))}_disableButton(t){document.getElementById(t)?.setAttribute("disabled","")}_enableButton(t){document.getElementById(t)?.removeAttribute("disabled")}_flagEditorContentChanged(){window.dispatchEvent(new CustomEvent("solutionEditorContentChanged",{detail:{id:this.instanceid,contents:this._currentModel.getValue()},bubbles:!0,cancelable:!1,composed:!0}))}_flagEditorHasChanges(t){this.hasChanges!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasChanges",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasChanges=t)}_flagEditorHasErrors(t){this.hasErrors!==t&&(window.dispatchEvent(new CustomEvent("solutionEditorHasErrors",{detail:t,bubbles:!0,cancelable:!1,composed:!0})),this.hasErrors=t)}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}_initValueObserver(){this._valueObserver=new MutationObserver((t=>{t.forEach((t=>{"attributes"===t.type&&"value"===t.attributeName&&t.target[t.attributeName]!==t.oldValue&&this._loaded&&this._currentModel.setValue(this.value)}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}_onEditorChange(){this._toggleUndoRedo()}_redo(){this._currentModel?.canRedo()&&(this._currentModel.redo(),this._toggleUndoRedo())}_reset(){this._currentModel.setValue(this.value),this._toggleUndoRedo()}_search(){this._editor.trigger("toggleFind","actions.find")}_setDiffModel(){this._diffEditor&&this._diffEditor.setModel({original:monaco.editor.createModel(this.value,"json"),modified:this._editor.getModel()})}_toggleEditor(){this._useDiffEditor=!this._useDiffEditor;let t=document.getElementById(`${this.instanceid}-diff-container`),e=document.getElementById(`${this.instanceid}-container`);this._useDiffEditor?(this._setDiffModel(),t.classList.remove("display-none"),e.classList.add("display-none")):(t.classList.add("display-none"),e.classList.remove("display-none"))}_toggleUndoRedo(){this._currentModel?.canUndo()?this._enableButton(`${this.instanceid}-undo`):this._disableButton(`${this.instanceid}-undo`),this._currentModel?.canRedo()?this._enableButton(`${this.instanceid}-redo`):this._disableButton(`${this.instanceid}-redo`),this._currentModel?.canUndo()||this._currentModel?.canRedo()?this._enableButton(`${this.instanceid}-reset`):this._disableButton(`${this.instanceid}-reset`)}_undo(){this._currentModel?.canUndo()&&(this._currentModel.undo(),this._toggleUndoRedo())}static get assetsDirs(){return["assets"]}static get watchers(){return{locale:["localeWatchHandler"]}}};d.style=":host{display:block}.editor-container{position:relative;height:100%}.editor-controls{height:2.75rem;padding-right:0.5rem;background-color:#F4F4F4}.editor-buttons{float:right}html[dir=rtl] .editor-buttons{float:left}.edit-error-flag{padding-top:0.5rem;color:red;visibility:hidden}.edit-button{padding-inline-start:0.5rem}.editor-text{width:100%;overflow-y:auto;background-color:#FFFFFF}.edit-width{width:100%}.edit-parent{box-sizing:border-box;width:100%;height:calc(100% - 46px)}.json-edit-container{height:100%;width:100%;border:1px #808080 solid}.padding-right{padding-inline-end:0.125rem}.btn{margin-bottom:1rem;display:flex;align-content:center;height:25px;width:120px}.select-ctrl{margin-bottom:1rem}.all-edits{margin-top:4rem}.floating-title{font-size:2rem;z-index:100;position:absolute;left:0.5rem;pointer-events:none}.floating-title-button{pointer-events:auto}.json-editor-position1{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:100%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2a{position:absolute;left:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}.json-editor-position2b{position:absolute;right:0px;top:0px;margin:0px;height:100%;width:50%;overflow:hidden;padding:0px;max-height:100% !important}";const r=class{constructor(e){t(this,e)}get el(){return e(this)}itemId="";locale;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}async componentWillRender(){return this.itemEdit=c.getItemInfo(this.itemId),this.itemEdit&&(this.itemDetails=this.itemEdit.item,this.itemType=this.itemDetails.type),Promise.resolve()}render(){return i(a,{key:"8ad2bab229a9ee6cd80efde17d269a484288f5ae"},i("div",{key:"a066afedf3e5ea056579e07cac6c38496fe00d79",class:"parent-container"},i("div",{key:"fe7d207e2d28f0e70507ef048d993bc3ddc62297",class:"inputBottomSeparation"},i("calcite-input",{key:"f0714ef845c9b4aa791e3fc6f5ac28fe6572127d",id:"item-title",value:this.itemDetails.title})),i("div",{key:"40b6f0d4d34ff62134f25fdd42887f395407aa45",class:"inputBottomSeparation"},i("input",{key:"216060434e37ff499a47b4cc24d7682ac6e55ba7",accept:".jpg,.gif,.png,image/jpg,image/gif,image/png",class:"display-none",onChange:t=>this._updateThumbnail(t),ref:t=>this.browseForThumbnail=t,type:"file"}),i("button",{key:"a6b71fac06b9231a91b32a0416cb3a723b6ac6dd",class:"font-size--3 btn-link inline-block trailer-quarter",onClick:()=>this._getThumbnail()},i("svg",{key:"395adfcd43d737fe049f765b3700d7358c06e8a0",class:"icon-inline icon-inline--on-left",height:"16",viewBox:"0 0 16 16",width:"16"},i("path",{key:"5e541a3fcb79fe3a306b720a08e745f0dd69d557",d:"M14.792 2.666l-1.414-1.413a.965.965 0 0 0-1.385-.03l-1.444 1.444-8.763 8.72L.03 15.481a.371.371 0 0 0 .488.488l4.096-1.756 8.763-8.72-.001-.001.002.002 1.443-1.444a.965.965 0 0 0-.03-1.385zM1.569 14.431l.554-1.293.74.739zm2.338-.924l-1.414-1.414 7.963-7.92 1.414 1.415zm8.67-8.626l-1.413-1.414 1.29-1.29a.306.306 0 0 1 .433 0l.981.98a.306.306 0 0 1 0 .433z"})),this._translations.editThumbnail),i("div",{key:"e6dc45b53a0deac24d29a7be29569c55857a7801",class:"flex"},i("div",{key:"8c81b6db29e4b03a5188e729eb8e27b8dcf22e5f",class:"img-container",ref:t=>this.thumbnailContainer=t},i("img",{key:"cfbfad50a4eb55166cb49be45a20f680b7d482d3",class:"scale-down",height:"133",id:"item-thumbnail",ref:t=>this.thumbnail=t,width:"200"})),i("div",{key:"0cf010a87106c0434ff7d54f7889bc2eb08fd733",class:"snippet-count-container"},i("calcite-input",{key:"85eedc1b801db3afdc2dfb606aa93de489bac491",id:"item-snippet",maxLength:250,type:"textarea",value:this.itemDetails.snippet}),i("label",{key:"783be9f5082085add36a16f1a8bc55ecc11dc7e8",class:"font-size--3",id:"item-snippet-count",ref:t=>this.itemSnippetCount=t})))),i("calcite-label",{key:"63bdfb42b95d1e8086e792efd757919676230354"},this._translations.description,i("label",{key:"aa9056a2807d9fd14c7dcd81775d902a30a2df63",id:"item-description-label"},i("calcite-input",{key:"61d584f29afd305913039e0cf4d6be7d54f1aa2f",id:"item-description",type:"textarea",value:this.itemDetails.description}))),i("calcite-label",{key:"4daf0f44b2b14274fe8992bad5607c8ba82d6fa4"},this._translations.tags,i("label",{key:"142f41ae1667c916e2ef32e7b7eb9aacad80e17d",id:"item-tags-label"},i("calcite-input",{key:"2f576b51a68370ce1112b999c35eef0714595e9f",id:"item-tags",value:(this.itemDetails.tags&&Array.isArray(this.itemDetails.tags)?this.itemDetails.tags:[this.itemDetails.tags]).join(",")}))),"Group"!==this.itemType?i("calcite-label",null,this._translations.credits,i("label",{id:"item-credits-label"},i("calcite-input",{id:"item-credits",value:this.itemDetails.accessInformation}))):null,"Group"!==this.itemType?i("calcite-label",null,i("label",{id:"item-terms-label"},this._translations.termsOfUse,i("calcite-input",{id:"item-terms",type:"textarea",value:this.itemDetails.licenseInfo}))):null))}componentDidRender(){this._loadThumb()}browseForThumbnail;itemDetails={accessInformation:"",description:"",licenseInfo:"",snippet:"",tags:[],title:""};itemEdit;itemType;_translations;itemSnippetCount;thumbnail;thumbnailContainer;inputReceivedHandler(t){switch(t.target.id){case"item-title":this.itemDetails.title=t.target.value,this._updateStore();break;case"item-snippet":t.target.value.length>250&&(t.target.value=t.target.value.substring(0,250)),this.itemDetails.snippet=t.target.value,this._updateLengthLabel(this.itemDetails.snippet),this._updateStore();break;case"item-description":this.itemDetails.description=t.target.value,this._updateStore();break;case"item-tags":this.itemDetails.tags=t.target.value,this._updateStore();break;case"item-credits":this.itemDetails.accessInformation=t.target.value,this._updateStore();break;case"item-terms":this.itemDetails.licenseInfo=t.target.value,this._updateStore()}}_getThumbnail(){this.browseForThumbnail.click()}_loadThumb(){this.thumbnail&&this.itemEdit?.thumbnail?(this.thumbnail.src=URL.createObjectURL(this.itemEdit.thumbnail),this.thumbnailContainer.classList.remove("empty-box"),this.thumbnail.classList.remove("display-none")):(this.thumbnailContainer.classList.add("empty-box"),this.thumbnail.classList.add("display-none"))}_updateLengthLabel(t){this.itemSnippetCount.innerText=this._translations.snippetCountPattern.replace("{{n}}",t.length.toString())}_updateStore(){this.itemEdit=c.getItemInfo(this.itemId),this.itemEdit.item=this.itemDetails,c.setItemInfo(this.itemEdit)}_updateThumbnail(t){const e=t.target.files;e&&e[0]&&this.thumbnail&&(this.thumbnail.src=URL.createObjectURL(e[0]),this.itemEdit=c.getItemInfo(this.itemId),this.itemEdit.thumbnail=e[0],c.replaceItemThumbnail(this.itemEdit))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};r.style=".inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.icon-inline--on-left,.icon-inline--on-right{display:inline;vertical-align:middle;margin-inline-end:0.375rem;fill:#0079c1}.scale-down{-o-object-fit:scale-down;object-fit:scale-down}.img-container{display:inline;margin-inline-end:1rem;max-width:363px}.summary-count-container{display:inline;flex-grow:1;margin-inline-start:0.75rem}.snippet-count-container{width:calc(100vw - 363px)}.parent-container{max-width:100%;padding:1rem}label{position:relative;margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem;display:block;min-width:-moz-min-content;min-width:min-content}";const h=class{constructor(e){t(this,e)}get el(){return e(this)}groupId="";locale;itemIdWatchHandler(){const t=c.getItemInfo(this.groupId);this.sharing=t.groupDetails}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"1c7dbee68fbf0eabf736fb783f173ade2f408122"},i("div",{key:"3c3d88ab122d4a8bc69363224a2754c4a4b092ba",class:"container-border"},i("calcite-label",{key:"137bb704b258a3cd1e5e5b7a18c53aca331d7f91"},this._translations.groupInfo),this._renderItems(this.sharing)))}_translations;sharing=[];async getShareInfo(){return this.sharing}_renderItems(t){return t&&t.length>0?t.map((t=>i("calcite-label",{layout:"inline"},i("calcite-switch",{checked:t.shareItem,id:t.id,name:"setting",onCalciteSwitchChange:t=>this._updateItem(t),scale:"m",value:"enabled"}),i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title)))):null}_updateItem(t){const e=t.target.id;this.sharing=this.sharing.map((i=>{if(i.id===e){i.shareItem=t.target.checked;const a=c.getItemInfo(e);if(i.shareItem)a.groups?a.groups.indexOf(this.groupId)<0&&a.groups.push(this.groupId):a.groups=[this.groupId];else if(a.groups){const t=a.groups.indexOf(this.groupId);t>-1&&a.groups.splice(t,1)}c.setItemInfo(a)}return i}))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{groupId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};h.style=":host{display:block}.container-border{padding:1rem}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const b=class{constructor(e){t(this,e),this.organizationVariableSelected=s(this,"organizationVariableSelected",7)}get el(){return e(this)}locale;value="";async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}valueWatchHandler(){this._organizationVariables=JSON.parse(this.value)}async componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"3f72a5c1b8fb6bcdab858ee061eadb38cb9965d9"},i("div",{key:"118c7cafc8330c44e72a59a76fd81ca0f39696e1"},i("h4",{key:"86934bdf3cbf162a732a53579e324c5fff8beead",class:"org-var-header"},this._translations.orgVariables)),i("div",{key:"ed5c1df397286a7d1c8e61b5ce04623fa13d74cc",class:"container-border"},i("calcite-tree",{key:"47f4f9bf5a81ded9a37a33a94fac6a230263e917",id:"variable-label"},this._renderHierarchy(this._organizationVariables))))}_organizationVariables=[];_translations;organizationVariableSelected;_renderHierarchy(t){return t.map((t=>i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.organizationVariableSelected.emit({itemId:t,value:e})}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],value:["valueWatchHandler"]}}};b.style=":host{display:block}.container-border{overflow-y:auto}.org-var-header{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1rem}";const f=class{constructor(e){t(this,e)}get el(){return e(this)}authentication;itemId="";locale;itemIdWatchHandler(){const t=c.getItemInfo(this.itemId);this.resourceFilePaths=t.resourceFilePaths,this.resources=t.resources.map((t=>t.substring(t.lastIndexOf("/")+1)))}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentWillLoad(){return this._getTranslations()}render(){const t=this._hasValidResources();return i(a,{key:"13f2759a882d2eca48bf9dda58e74caade76142b"},i("div",{key:"498ced2e29b8af9138a8aa9d77ec78e07e3c64de",class:"resource-item"},i("div",{key:"d76a967373a990906a67d88ea6466030c41401ff",class:"margin-bottom-1"},i("calcite-button",{key:"96cd2ee08adadef9e1b29db12c38d4748b0689c0",appearance:"solid",class:"resource-button",color:"blue",onClick:()=>this._addNewResource()},this._translations.addResource),i("calcite-button",{key:"49326139cad065995512d3e3568c7d8e7f5cef4f",appearance:"solid",color:"blue",disabled:!t,onClick:()=>this._downloadAll()},this._translations.downloadAll)),i("div",{key:"9c056d9ab7242ea10cbcf57eaabce4bd9777541e",class:"resources-container",style:{display:t?"inherit":"none"}},this._renderResourceList())))}resourceFilePaths=[];resources=[];_translations;_removedResources={};_renderResourceList(){return i("calcite-value-list",{multiple:!0},this.resourceFilePaths.reduce(((t,e)=>(e.type!==l.Thumbnail&&t.push(this._renderResource(e)),t)),[]))}_renderResource(t){const e=t.updateType===o.Remove;return i("calcite-value-list-item",{class:e?"disabled":"",label:t.folder?t.folder+"/"+t.filename:t.filename,nonInteractive:!0,value:t.url},i("calcite-action-group",{"expand-disabled":"true",layout:"horizontal",slot:"actions-end"},i("calcite-action",{disabled:e,icon:"download",label:this._translations.download,onClick:()=>this._download(t.url,t.filename),scale:"m",text:this._translations.download,title:this._translations.download}),i("calcite-action",{disabled:e,icon:"upload-to",label:this._translations.update,onClick:()=>this._upload(t),scale:"m",text:this._translations.update,title:this._translations.update}),i("calcite-action",{disabled:e,icon:"trash",label:this._translations.delete,onClick:()=>this._delete(t),scale:"m",text:this._translations.delete,title:this._translations.delete}),e?i("calcite-action",{icon:"reset",label:this._translations.reset,onClick:()=>this._reset(t.filename),scale:"m",text:this._translations.reset,title:this._translations.reset}):i("div",{class:"display-none"})))}_delete(t){t.updateType=o.Remove,this.resourceFilePaths=[...this.resourceFilePaths],this._updateStore()}_reset(t){this.resourceFilePaths=this.resources.some((e=>e===t))?this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=o.None),e))):this.resourceFilePaths.map((e=>(e.filename===t&&(e.updateType=o.Add),e))),this._updateStore()}_downloadAll(){this.resourceFilePaths.forEach((t=>{this._download(t.url,t.filename)}))}_download(t,e){t.startsWith("blob")?this.downloadFile(t,e):this.fetchAndDownload(`${t}?token=${this.authentication.token}`,e)}downloadFile(t,e){const i=document.createElement("a");i.href=t,i.download=e,i.target="_blank",i.click()}_hasValidResources(){return this.resourceFilePaths.some((t=>t.url.indexOf("_info_thumbnail")<0))}async fetchAndDownload(t,e){const i=await fetch(t),a=await i.blob(),s=URL.createObjectURL(a);this.downloadFile(s,e)}_upload(t){const e=document.createElement("input");e.classList.add("display-none"),e.onchange=this._updateResource.bind(this,t),e.type="file",e.click()}_addNewResource(){const t=document.createElement("input");t.classList.add("display-none"),t.onchange=this._add.bind(this),t.type="file",t.click()}_updateResource(t,e){const i=e.target.files;i&&i[0]&&(t.blob=i[0],t.updateType=o.Update,this._updateStore())}_add(t){const e=t.target.files;if(e&&e[0]){const t=URL.createObjectURL(e[0]),i=e[0].name;this.resourceFilePaths.some((e=>e.filename===i&&e.url===t))||(this.resourceFilePaths=[...this.resourceFilePaths,{url:t,type:l.Data,folder:void 0,filename:i,blob:e[0],updateType:o.Add}],this._updateStore())}}_updateStore(){const t=c.getItemInfo(this.itemId);t.resourceFilePaths=this.resourceFilePaths,c.setItemInfo(t)}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};f.style=":host{display:block}.resource-item{padding:1rem}.resource-button{margin-inline-end:1rem}.resource-progress{padding-top:1rem}.resources-container{border:1px #808080 solid}.margin-bottom-1{margin-bottom:1rem}";const p=class{get el(){return e(this)}instanceid="";itemId="";itemIdWatchHandler(){this._initializing=!0,this.value=JSON.stringify("data"===this.instanceid?c.getItemInfo(this.itemId).data:c.getItemInfo(this.itemId).properties,null,2)}locale;organizationVariables="";solutionVariables="";varsOpen=!0;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}constructor(e){t(this,e),window.addEventListener("solutionEditorContentChanged",(t=>{if(this.itemId){const{id:e,contents:i}=t.detail,[a,s]=e.split("|");if(a==this.itemId&&s===this.instanceid){if(!this._initializing&&i.length>0){const t=c.getItemInfo(a);"data"===s?t.data=JSON.parse(i):t.properties=JSON.parse(i),c.setItemInfo(t)}this._initializing=!1}}}))}componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"3f853006c19509c8cf484d4420b3f687aaad5161"},i("div",{key:"f524e1ee3c8dc972779be0909372c11c26092dd0",class:"solution-data-container"},i("calcite-shell",{key:"56797702bc53b08051360975dc529c884eb7d294",class:"light var-container",dir:"ltr"},i("calcite-panel",{key:"6208ac7b63ab8b69bc29ad88abdb9bcdeaaa707a",class:"json-editor"},i("div",{key:"66e99550359b5665b4dd04f794d8108e4ee34284",class:"solution-data-child-container calcite-match-height"},i("json-editor",{key:"7a7f5afa5d424fb6099b7167f274ce211e791a56",class:"solution-data-editor-container",instanceid:this.itemId+"|"+this.instanceid,locale:this.locale,value:this.value}))),i("calcite-shell-panel",{key:"7cc8bac91bfc5be96018d005cc87be457278ed6d","height-scale":"l",position:"end",slot:"contextual-panel","width-scale":"xs"},i("div",{key:"4ce0c251d30d5735781394f5c213523867205886",class:this.varsOpen?"solution-data-child-container":"solution-data-child-container-collapsed"},i("calcite-button",{key:"814c8996b854102b022f7ac482498dd6aac36ec8",appearance:"transparent",class:"collapse-btn","icon-start":this.varsOpen?"chevrons-right":"chevrons-left",id:"collapse-vars",onClick:()=>this._toggleVars(),scale:"s",title:this.varsOpen?this._translations.collapse:this._translations.expand}),i("div",{key:"6b872cfc1c60870fb6262808f5d9f61cc35f0f44",class:this.varsOpen?"org-vars":"org-vars display-none",id:"orgVars"},i("solution-organization-variables",{key:"e8e9ee594b6dcb5ddaabd05c322fb33d568ac7b5",locale:this.locale,value:this.organizationVariables})),i("div",{key:"109d17a77a54a13818af6aa2a9beb92526100ea7",class:this.varsOpen?"sol-vars":"sol-vars display-none",id:"solVars"},i("solution-variables",{key:"46902ed69897ed01334def99817fedafbda2e8d5",locale:this.locale,value:this.solutionVariables})))))))}_translations;value="";_initializing=!1;_toggleVars(){this.varsOpen=!this.varsOpen}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};p.style=":host{display:flexbox}.solution-data-container{position:absolute;height:-moz-available;height:calc(100% - 48px);height:-webkit-fill-available;height:stretch;width:-moz-available;width:100%;width:-webkit-fill-available;width:stretch}.solution-data-child-container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}.solution-data-editor-container{height:100%}.solution-data-child-container-collapsed{display:flex;height:100%;flex-direction:column;overflow:auto;width:50px}.inputBottomSeparation{margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:1.5rem}.json-editor{margin:1rem;width:auto;width:-webkit-fill-available -moz-available}.collapse-btn{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.org-vars{padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:0px}.sol-vars{padding-top:0px;padding-bottom:0px;padding-left:1rem;padding-right:1rem;min-height:45%}.padding-1{padding:1rem}.light{background-color:#F4F4F4}";const u=class{constructor(e){t(this,e),this.solutionVariableSelected=s(this,"solutionVariableSelected",7)}get el(){return e(this)}value="";locale;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}valueWatchHandler(){this._solutionVariables=JSON.parse(this.value)}componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"a90cdfc9a32279cb07938fc57f9dd7e38d822f6d"},i("div",{key:"6826e3dd84034368f419ff759962a721a275dc9c"},i("h4",{key:"5ebdf456e8c4dc006b036dc182fa75218aac0e01",class:"org-var-header"},this._translations.solVariables)),i("div",{key:"06fc04c1e61dc1897989e3cc11df7b173f1fdb2a",class:"container-border"},i("calcite-tree",{key:"15500194129af7440ec05dc495b060fc18f22324",id:"variable-label"},this._renderHierarchy(this._solutionVariables))))}_solutionVariables=[];_translations;solutionVariableSelected;_renderHierarchy(t){return t.map((t=>t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:t=>this._toggleExpand(t)},i("solution-item-icon",{type:t.type}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this._renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:()=>this._treeItemSelected(t.id,t.value)},t.title)))}_treeItemSelected(t,e){this.solutionVariableSelected.emit({itemId:t,value:e})}_toggleExpand(t){const e=t?.target?.closest("calcite-tree-item");e&&(e.expanded=!e.expanded)}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],value:["valueWatchHandler"]}}};u.style=":host{display:block}.container-border{overflow-y:hidden}.org-var-header{margin-top:1rem;margin-bottom:1rem;margin-left:0px;margin-right:0px}.icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";export{d as json_editor,r as solution_item_details,h as solution_item_sharing,b as solution_organization_variables,f as solution_resource_item,p as solution_template_data,u as solution_variables}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as e,g as i,h as s,H as a,F as h}from"./p-1b0588d2.js";import{l,g as o}from"./p-ee2cbba0.js";import{g as n,a as r,b as c,c as d,h as u,d as p,q as m}from"./p-dcd2f00b.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";const f=class{constructor(i){t(this,i),this.togglePanel=e(this,"togglePanel",7)}get el(){return i(this)}center;commentButtonText;commentSubmittedMessage;defaultWebmap="";description;enableAnonymousAccess;enableAnonymousComments;enableComments;enableHome=!0;enableLogin;enableNewReports;enableSearch=!0;enableZoom=!0;isMobile;layerExpressions=[];layerId;level;locale;loginTitle;mapInfos=[];mapView;objectId;reportButtonText;reportingOptions;reportsHeader;reportSubmittedMessage;searchConfiguration;showComments;showUserImageInCommentsList=!1;showFeatureSymbol=!1;showMyReportsOnly=!1;theme="light";zoomToScale;floorLevel;showFullCommentTitle=!0;_featureCreationFailedErrorMsg;_filterActive=!1;_flowItems=[];_hasValidLayers=!1;_mapInfo;_reportSubmitted=!1;_selectedLayerName;_showSubmitCancelButton=!1;_showLoadingIndicator=!1;_sidePanelCollapsed=!1;_translations;_updatedProgressBarStatus=25;_updatedSorting;_updatedSortOption="sortNewest";_commentSubmitted=!1;_addingCommentFailed=!1;_createFeature;_currentFeatureId;_defaultCenter;_defaultLevel;_editableLayerIds;_featureDetails;_featureList;_currentFeature;_selectedRelatedFeature;_relatedTable;_filterList;_highlightHandle;_layerList;_createRelatedFeature;_layers;_mapChange;_mapClickHandle;reactiveUtils;FeatureFilter;_selectedFeature;_selectedFeatureIndex;_selectedLayerId;_shareNode;_urlParamsLoaded;_validLayers;_nonVisibleValidLayers;_selectedLayer;_layerItemsHash;_showFullPanel;_floorExpression;_formElements=[];_prevSelectedLayerId;_currentLayerExpressions;_initDefExpressions;_t9nLayerExpressions;async isMobileWatchHandler(){this.updatePanelState(!1,this._showFullPanel)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((async()=>{this.setInitExpressions(),await this.setMapView()}))}async floorLevelWatchHandler(){if(this._editableLayerIds)for(const t of this._editableLayerIds){const e=await n(this.mapView,t);e.floorInfo?.floorField&&this._updateFloorDefinitionExpression(e)}"layer-list"===this._flowItems[this._flowItems.length-1]&&this._layerList&&await this._layerList.refresh(),this._featureList&&this._featureList.refresh(),this._createFeature&&this._createFeature.refresh(this.floorLevel)}async showMyReportsOnlyWatchHandler(){this._editableLayerIds&&(await this._updateFeatures(),setTimeout((()=>{"layer-list"===this._flowItems[this._flowItems.length-1]&&this._layerList&&this._layerList.refresh(),this._featureList&&this._featureList.refresh()}),50))}async layerExpressionsWatchHandler(){this.resetFilterList(),await this.handleSelectedLayersFilter(),await(this._featureList?.refresh())}async showFeatureSymbolWatchHandler(){await(this._featureList?.refresh())}async updateLayerExpressionsT9n(t){if(this._t9nLayerExpressions=t||this.layerExpressions,null!=this._filterList)await this._filterList.handleUpdatingT9nData(this._t9nLayerExpressions);else if(null!=this._currentLayerExpressions){const t=structuredClone(this._currentLayerExpressions);this.handleLayerExpressionsT9n(t,this._t9nLayerExpressions),this._currentLayerExpressions=t}return Promise.resolve()}togglePanel;async componentWillLoad(){this._urlParamsLoaded=!1,await this._initModules(),await this._getTranslations(),await(this.mapView?.when((async()=>{this._layers=this.reportingOptions?Object.keys(this.reportingOptions).filter((t=>this.reportingOptions[t].visible)):[],this.setInitExpressions(),await this.setMapView()})))}componentWillRender(){this._flowItems.includes("filter-panel")&&this._filterList?.updateInitDefExpressions({initDefExpressions:this._initDefExpressions})}render(){const t="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return s(a,{key:"03d613fe8f275852672fb546ceb4449fb82580c0"},this._reportSubmitted&&s("calcite-alert",{key:"969a66978549d6993b1e4fce87bbd2387858cdf8","auto-close":!0,class:t+" report-submitted-msg",icon:"check-circle",kind:"success",label:"",onCalciteAlertClose:()=>{this._reportSubmitted=!1},open:!0,placement:"top"},s("div",{key:"60ae42443e09a97d97a46bba07b1ea010b382348",slot:"message"},this.reportSubmittedMessage?this.reportSubmittedMessage:this._translations.submitMsg)),this._featureCreationFailedErrorMsg&&s("calcite-alert",{key:"bf6c346cf976a4b84da3553230239665c712e2b6","auto-close":!0,class:t,icon:"x-octagon",kind:"danger",label:"",onCalciteAlertClose:()=>{this._featureCreationFailedErrorMsg=""},open:!0,placement:"top"},s("div",{key:"1f9560e18d802a15bcb3e8ea9f05837a4a6fb8aa",slot:"title"},this._translations.error),s("div",{key:"1f5ef09cbf94996eeb5783211ed1542a5cf53e93",slot:"message"},this._featureCreationFailedErrorMsg)),this._commentSubmitted&&s("calcite-alert",{key:"15538e8faabbec476d7586dcc4152b422404c23f","auto-close":!0,class:"report-submitted "+t,icon:"check-circle",kind:"success",label:"",onCalciteAlertClose:()=>{this._commentSubmitted=!1},open:!0,placement:"top"},s("div",{key:"925a9a243a79dfb66554a9a51f24396ca2b71c98",slot:"message"},this.commentSubmittedMessage||this._translations.commentSubmittedMsg)),this._addingCommentFailed&&s("calcite-alert",{key:"62c63d3b1c51bdc7879e815e2b2f4d3c4d039c4c","auto-close":!0,class:t,icon:"x-octagon",kind:"danger",label:"",onCalciteAlertClose:()=>{this._addingCommentFailed=!1},open:!0,placement:"top"},s("div",{key:"971f07331a8689b859f2cedc96ba3589a3ad3e16",slot:"title"},this._translations.error),s("div",{key:"1627f1ab5c4a4aceb7bdb70471aed6b8ca6d67b8",slot:"message"},this._translations.addingCommentFailedMsg)),s("div",{key:"b3257ba523357b4444ce7da7d13a86f6b71185d9"},s("calcite-shell",{key:"35fc5a814528bb0acc22919839719bb4349e9ae4","content-behind":!0},this._getReporter())))}async _initModules(){const[t,e]=await l(["esri/core/reactiveUtils","esri/layers/support/FeatureFilter"]);this.reactiveUtils=t,this.FeatureFilter=e}async setSelectedLayer(t,e){this._selectedLayerId=t,this._selectedLayer=await n(this.mapView,t),this._selectedLayerName=e,this._validLayers.forEach((e=>{this._nonVisibleValidLayers.find((t=>t.id===e.id))||e.set("visible",!t||e.id===t)}))}_getLayersConfig(t){return this.reportingOptions&&this.reportingOptions[t]?this.reportingOptions[t]:null}_getReporter(){const t=[];return this._flowItems.forEach((e=>{switch(e){case"layer-list":t.push(this.getLayerListFlowItem());break;case"feature-list":t.push(this.getFeatureListFlowItem(this._selectedLayerId,this._selectedLayerName));break;case"filter-panel":t.push(this.getFilterPanel());break;case"feature-details":t.push(this.getFeatureDetailsFlowItem());break;case"reporting-layer-list":t.push(this.getChooseCategoryFlowItem());break;case"feature-create":t.push(this.getFeatureCreateFlowItem());break;case"comment-details":t.push(this.getCommentDetailsFlowItem());break;case"add-comment":t.push(this.getAddCommentFlowItem())}})),s("calcite-panel",{class:"width-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},this.mapView?s("calcite-flow",null,t?.length>0&&t):s("calcite-loader",{label:"",scale:"m"}))}async sortOptionClick(t,e,i){this._updatedSorting={field:t,order:e},this._updatedSortOption=i}_toggleSort(){const t=this.reportingOptions&&this.reportingOptions[this._selectedLayerId]&&this.reportingOptions[this._selectedLayerId].like&&this.reportingOptions[this._selectedLayerId].likeField;return s("calcite-popover",{autoClose:!0,label:"",offsetDistance:0,placement:this.isMobile?"leading-start":"bottom-start",pointerDisabled:!0,referenceElement:"sort-popover"},s("calcite-list",{label:"","selection-mode":"single"},s("calcite-list-item",{label:this._translations.sortNewest,onCalciteListItemSelect:()=>{this.sortOptionClick(this._selectedLayer.objectIdField,"desc","sortNewest")},selected:"sortNewest"===this._updatedSortOption,value:"sortNewest"}),s("calcite-list-item",{label:this._translations.sortOldest,onCalciteListItemSelect:()=>{this.sortOptionClick(this._selectedLayer.objectIdField,"asc","sortOldest")},selected:"sortOldest"===this._updatedSortOption,value:"sortOldest"}),t&&s(h,null,s("calcite-list-item",{label:this._translations.sortHighestVoted,onCalciteListItemSelect:()=>{this.sortOptionClick(this.reportingOptions[this._selectedLayerId].likeField,"desc","sortHighestVoted")},selected:"sortHighestVoted"===this._updatedSortOption,value:"sortHighestVoted"}),s("calcite-list-item",{label:this._translations.sortLowestVoted,onCalciteListItemSelect:()=>{this.sortOptionClick(this.reportingOptions[this._selectedLayerId].likeField,"asc","sortLowestVoted")},selected:"sortLowestVoted"===this._updatedSortOption,value:"sortLowestVoted"}))))}async _handleFilterListReset(){this._filterActive=!1}async _handleFilterUpdate(t){this._showLoadingIndicator=!0,this._filterActive=t,await this._featureList.refresh(),this._showLoadingIndicator=!1}getLayerListFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this.reportsHeader,selected:"layer-list"===this._flowItems[this._flowItems.length-1]},this.isMobile&&this.getActionToExpandCollapsePanel(),this._hasValidLayers&&this.enableNewReports&&s("calcite-button",{appearance:"solid",onClick:this.navigateToChooseCategory.bind(this),slot:"footer",width:"full"},this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText),s("calcite-panel",{"full-height":!0,"full-width":!0},s("layer-list",{applyLayerViewFilter:this.showMyReportsOnly,class:"height-full",layers:this._editableLayerIds?.length>0?this._editableLayerIds:this._layers,locale:this.locale,mapView:this.mapView,onLayerSelect:this.displayFeaturesList.bind(this),onLayersListLoaded:this.layerListLoaded.bind(this),ref:t=>this._layerList=t,showFeatureCount:!0,showNextIcon:!0})))}getChooseCategoryFlowItem(){const t=this.reportingOptions?Object.keys(this.reportingOptions).filter((t=>this.reportingOptions[t].visible&&this.reportingOptions[t].reporting&&this._layerItemsHash[t]&&this._layerItemsHash[t].supportsAdd)):[];return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this),selected:"reporting-layer-list"===this._flowItems[this._flowItems.length-1]},s("calcite-panel",{"full-height":!0,"full-width":!0},s("div",{class:"progress-bar"},s("calcite-progress",{type:"determinate",value:this._updatedProgressBarStatus})),s("calcite-notice",{class:"notice-msg",icon:"lightbulb",kind:"success",open:!0},s("div",{slot:"message"},this._translations.chooseCategoryMsg)),s("layer-list",{class:"height-full",layers:t,locale:this.locale,mapView:this.mapView,onLayerSelect:this.navigateToCreateFeature.bind(this),showFeatureCount:!1,showNextIcon:!1})))}getFeatureCreateFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._selectedLayerName,onCalciteFlowItemBack:this.backFromCreateFeaturePanel.bind(this),selected:"feature-create"===this._flowItems[this._flowItems.length-1]},this._showSubmitCancelButton&&s("div",{class:"width-full",slot:"footer"},s("calcite-button",{appearance:"solid",class:"footer-top-button footer-button",onClick:this.onCreateFeatureSubmitButtonClick.bind(this),width:"full"},this._translations.submit),s("calcite-button",{appearance:"outline",class:"footer-button",onClick:this.backFromCreateFeaturePanel.bind(this),width:"full"},this._translations.cancel)),s("calcite-panel",{"full-height":!0,"full-width":!0},s("div",{class:"progress-bar"},s("calcite-progress",{type:"determinate",value:this._updatedProgressBarStatus})),s("create-feature",{customizeSubmit:!0,enableSearch:!0,floorLevel:this.floorLevel,formElements:this._formElements.find((t=>t.id===this._selectedLayerId)),isMobile:this.isMobile,locale:this.locale,mapView:this.mapView,onDrawComplete:this.onFormReady.bind(this),onEditingAttachment:this.showSubmitCancelButton.bind(this),onFail:this.createFeatureFailed.bind(this),onModeChanged:this.backFromCreateFeaturePanel.bind(this),onProgressStatus:this.updatedProgressStatus.bind(this),onSuccess:this.onReportSubmitted.bind(this),ref:t=>this._createFeature=t,searchConfiguration:this.searchConfiguration,selectedLayerId:this._selectedLayerId})))}updatedProgressStatus(t){this._updatedProgressBarStatus=t.detail}onFormReady(){this._showSubmitCancelButton=!0}showSubmitCancelButton(t){this._showSubmitCancelButton=!t.detail}onCreateFeatureSubmitButtonClick(){this._createFeature&&this._createFeature.submit()}backFromCreateFeaturePanel(){this._createFeature&&this.updateNonVisibleLayersOnMap(!1),this.backFromSelectedPanel()}onCreateRelatedFeatureSubmitButtonClick(){this._createRelatedFeature&&this._createRelatedFeature.submit()}backFromCreateRelatedFeaturePanel(){this._createRelatedFeature&&(this._showSubmitCancelButton=!1),this.backFromSelectedPanel()}createFeatureFailed(t){console.error(t.detail),this._featureCreationFailedErrorMsg=t.detail.message}async onReportSubmitted(){this.updateNonVisibleLayersOnMap(!1),await this.navigateToHomePage(),this._reportSubmitted=!0,this._updatedProgressBarStatus=25,this._showFullPanel&&this.updatePanelState(this._sidePanelCollapsed,!1)}addCommentFailed(t){console.error(t.detail),this._addingCommentFailed=!0}async onCommentSubmitted(){this._commentSubmitted=!0,this.backFromSelectedPanel(),this._showLoadingIndicator=!0,await this._featureDetails.refresh(this._currentFeature),setTimeout((()=>{this._showLoadingIndicator=!1}),300)}async navigateToHomePage(){await this.setSelectedFeatures([]),this._layerList&&await this._layerList.refresh(),1===this._editableLayerIds.length?(await this._featureList.refresh(),this._flowItems=["feature-list"]):this._flowItems=["layer-list"]}async navigateToCreateFeature(t){t.detail.layerId&&t.detail.layerName&&await this.setSelectedLayer(t.detail.layerId,t.detail.layerName),this.updateNonVisibleLayersOnMap(!0),this._getFormElements(),this._showSubmitCancelButton=!1,this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"feature-create"]}navigateToChooseCategory(){this.updatePanelState(!1,!0),this._flowItems=[...this._flowItems,"reporting-layer-list"]}updateNonVisibleLayersOnMap(t){this._nonVisibleValidLayers.find((t=>t.id===this._selectedLayerId))&&this._selectedLayer.set("visible",t)}async layerListLoaded(t){const e=t.detail,i=await r(this.mapView),s=[];this._validLayers=[],this._nonVisibleValidLayers=[],i.forEach((t=>{e.includes(t.id)&&(this._validLayers.push(t),t.visible||this._nonVisibleValidLayers.push(t),this._getLayersConfig(t.id)?.reporting&&this._layerItemsHash[t.id]&&this._layerItemsHash[t.id].supportsAdd&&s.push(t.id))})),this.handleMapClick(),this._hasValidLayers=s.length>0,this._urlParamsLoaded||(this._urlParamsLoaded=!0,await this.loadFeatureFromURLParams())}async displayFeaturesList(t){this._updatedSorting={field:"",order:"desc"},this._updatedSortOption="sortNewest",await this.setSelectedLayer(t.detail.layerId,t.detail.layerName),this.handleSelectedLayersFilter(),this._flowItems=[...this._flowItems,"feature-list"],this._prevSelectedLayerId=this._selectedLayerId}async backFromFilterPanel(){null!=this._filterList&&(this._currentLayerExpressions=await this._filterList.getCurrentLayerExpressions()),await this._featureList.refresh(),this.backFromSelectedPanel()}backFromSelectedPanel(){this._updatedProgressBarStatus=25;const t=[...this._flowItems];"comment-details"!==t[t.length-1]&&"add-comment"!==t[t.length-1]&&this.clearHighlights(),"reporting-layer-list"!==t[t.length-1]&&("feature-create"!==t[t.length-1]||"feature-list"!==t[0]&&"feature-list"!==t[t.length-2])||this.updatePanelState(this._sidePanelCollapsed,!1),t.pop(),1!==t.length||"layer-list"!==t[0]?this._flowItems=[...t]:this.navigateToHomePage()}toggleSidePanel(){this._sidePanelCollapsed=!this._sidePanelCollapsed,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}updatePanelState(t,e){this._sidePanelCollapsed=t,this._showFullPanel=e,this.togglePanel.emit({panelState:this._sidePanelCollapsed,isFormOpen:this._showFullPanel})}async onFeatureSelectFromList(t){this._showLoadingIndicator=!0,await this.setSelectedFeatures([t.detail]),this._flowItems=[...this._flowItems,"feature-details"]}async getRelatedTable(){const t=this._currentFeature.layer,e=await c(this.mapView);t.relationships.some((i=>{const s=e.filter((e=>t.url===e.url&&e.layerId===i.relatedTableId));if(s&&s.length>0)return this._relatedTable=s[0],!0}))}async updatingFeatureDetails(t){this._showLoadingIndicator=t}async selectionChanged(t){this.updatingFeatureDetails(!0),await this.setCurrentFeature(t.detail.selectedFeature[0]),this.highlightOnMap(t.detail.selectedFeature[0]),this._selectedFeatureIndex=t.detail.selectedFeatureIndex,await this._featureDetails.refresh(t.detail.selectedFeature[0])}showAddCommentsPanel(){this._flowItems=[...this._flowItems,"add-comment"]}async onCommentSelectFromList(t){this._selectedRelatedFeature=[t.detail],this._flowItems=[...this._flowItems,"comment-details"]}getFeatureListFlowItem(t,e){const i=this._getLayersConfig(this._selectedLayerId)?.reporting&&this._layerItemsHash[this._selectedLayerId].supportsAdd,a=this._currentLayerExpressions?.length>0;return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:e,loading:this._showLoadingIndicator,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this),selected:"feature-list"===this._flowItems[this._flowItems.length-1]},this._toggleSort(),s("calcite-action",{icon:"sort-ascending-arrow",id:"sort-popover",slot:"header-actions-end",text:this._translations.sort,title:this._translations.sort}),a&&s("calcite-action",{icon:"filter",indicator:this._filterActive,onClick:()=>{this._flowItems=[...this._flowItems,"filter-panel"]},slot:"header-actions-end",text:this._translations.filter,title:this._translations.filter}),this.isMobile&&this.getActionToExpandCollapsePanel(),this.enableNewReports&&i&&s("calcite-button",{appearance:"solid",onClick:this.navigateToCreateFeature.bind(this),slot:"footer",width:"full"},this.reportButtonText?this.reportButtonText:this._translations.createReportButtonText),s("calcite-panel",{"full-height":!0},s("feature-list",{applyLayerViewFilter:this.showMyReportsOnly,class:"height-full",highlightOnHover:!0,locale:this.locale,mapView:this.mapView,noFeaturesFoundMsg:this._translations.featureErrorMsg,onFeatureSelect:this.onFeatureSelectFromList.bind(this),pageSize:30,ref:t=>this._featureList=t,reportingOptions:this.reportingOptions,selectedLayerId:t,showFeatureSymbol:this.showFeatureSymbol,sortingInfo:this._updatedSorting})))}getFilterPanel(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._translations?.filterLayerTitle?.replace("{{title}}",this._selectedLayerName),loading:this._showLoadingIndicator,onCalciteFlowItemBack:this.backFromFilterPanel.bind(this),selected:"filter-panel"===this._flowItems[this._flowItems.length-1]},this.isMobile&&this.getActionToExpandCollapsePanel(),s("div",{class:"width-full",slot:"footer"},s("div",{class:"width-full",slot:"footer"},s("calcite-button",{appearance:"solid",class:"footer-top-button footer-button",disabled:!this._filterActive,onClick:this.resetFilterList.bind(this),width:"full"},this._translations.resetFilter),s("calcite-button",{appearance:"outline",class:"footer-button",onClick:this.backFromFilterPanel.bind(this),width:"full"},this._translations.close))),s("calcite-panel",{"full-height":!0},s("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtnOnClick:()=>{},comboboxOverlayPositioning:"fixed",layerExpressions:this._currentLayerExpressions,onFilterListReset:()=>{this._handleFilterListReset()},onFilterUpdate:()=>{this._handleFilterUpdate(this._filterList.filterCount>0)},ref:t=>this._filterList=t,resetBtn:!1,resetFiltersOnDisconnect:!1,view:this.mapView,zoomBtn:!1})))}getFeatureDetailsFlowItem(){const t=this._getLayersConfig(this._selectedLayerId)?.comment&&this._selectedLayer.relationships.length>0&&this._relatedTable;return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._selectedLayerName,loading:this._showLoadingIndicator,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this),selected:"feature-details"===this._flowItems[this._flowItems.length-1]},this.isMobile&&this.getActionToExpandCollapsePanel(),s("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"share-node",embed:!1,popoverButtonIconScale:"s",ref:t=>this._shareNode=t,removePopoverOffset:!0,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",slot:"header-actions-end",socialMedia:!0,view:this.mapView}),this._selectedFeature.length>1&&this.getFeaturesPagination(),s("calcite-panel",null,s("feature-details",{class:"full-height",graphics:this._selectedFeature,layerItemsHash:this._layerItemsHash,locale:this.locale,mapView:this.mapView,onAddComment:this.showAddCommentsPanel.bind(this),onCommentSelect:this.onCommentSelectFromList.bind(this),onFeatureSelectionChange:this.selectionChanged.bind(this),onLikeOrDislikeClicked:()=>{this._featureList.refresh(!0)},onLoadingStatus:t=>{this.updatingFeatureDetails(t.detail)},ref:t=>this._featureDetails=t,reportingOptions:this.reportingOptions,showFullCommentTitle:this.showFullCommentTitle,showUserImageInCommentsList:this.showUserImageInCommentsList}),t&&s("calcite-button",{appearance:"solid",onClick:this.showAddCommentsPanel.bind(this),slot:"footer",width:"full"},this.commentButtonText||this._translations.comment)))}getFeaturesPagination(){return s("div",{class:"feature-pagination"},s("div",null,s("calcite-button",{appearance:"transparent",disabled:!1,iconStart:"chevron-left",id:"solutions-back",onClick:()=>{this._featureDetails.back()},scale:"s",width:"full"}),s("calcite-tooltip",{label:"",placement:"top","reference-element":"solutions-back"},s("span",null,this._translations.back))),s("calcite-button",{appearance:"transparent",onClick:()=>{this._featureDetails.toggleListView()},scale:"s"},s("span",{class:"pagination-count"},this._getCount())),s("div",null,s("calcite-button",{appearance:"transparent",disabled:!1,iconStart:"chevron-right",id:"solutions-next",onClick:()=>{this._featureDetails.next()},scale:"s",width:"full"}),s("calcite-tooltip",{placement:"top","reference-element":"solutions-next"},s("span",null,this._translations.next))))}getCommentDetailsFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._relatedTable.title,onCalciteFlowItemBack:this.backFromSelectedPanel.bind(this),selected:"comment-details"===this._flowItems[this._flowItems.length-1]},this.isMobile&&this.getActionToExpandCollapsePanel(),s("calcite-panel",{"full-height":!0},s("info-card",{allowEditing:!1,graphics:this._selectedRelatedFeature,highlightEnabled:!1,isLoading:!1,isMobile:!1,locale:this.locale,mapView:this.mapView,paginationEnabled:!1})))}getAddCommentFlowItem(){return s("calcite-flow-item",{collapsed:this.isMobile&&this._sidePanelCollapsed,heading:this._relatedTable.title,onCalciteFlowItemBack:this.backFromCreateRelatedFeaturePanel.bind(this),selected:"add-comment"===this._flowItems[this._flowItems.length-1]},this.isMobile&&this.getActionToExpandCollapsePanel(),s("div",{class:"width-full",slot:"footer"},this._showSubmitCancelButton&&s("div",{class:"width-full",slot:"footer"},s("calcite-button",{appearance:"solid",class:"footer-top-button footer-button",onClick:this.onCreateRelatedFeatureSubmitButtonClick.bind(this),width:"full"},this._translations.submit),s("calcite-button",{appearance:"outline",class:"footer-button",onClick:this.backFromCreateRelatedFeaturePanel.bind(this),width:"full"},this._translations.cancel))),s("calcite-panel",null,s("create-related-feature",{customizeSubmit:!0,locale:this.locale,mapView:this.mapView,onFail:this.addCommentFailed.bind(this),onFormReady:this.onFormReady.bind(this),onIsActionPending:this.showSubmitCancelButton.bind(this),onSuccess:this.onCommentSubmitted.bind(this),ref:t=>this._createRelatedFeature=t,selectedFeature:this._currentFeature,table:this._relatedTable})))}async setSelectedFeatures(t){this._selectedFeature=t,await this.setCurrentFeature(this._selectedFeature.length?this._selectedFeature[0]:null)}async setCurrentFeature(t){if(this._currentFeature=t,t&&t.layer){const e=t.layer;this.setSelectedLayer(e.id,e.title),this._currentFeatureId=t.attributes[e.objectIdField],this._getLayersConfig(e.id)?.comment&&e.relationships.length>0&&await this.getRelatedTable()}else this._editableLayerIds.length>1&&(this.setSelectedLayer("",""),this.handlePrevLayersFilter()),this._currentFeatureId="";this._updateShareURL()}async highlightOnMap(t){if(this.clearHighlights(),t&&t.geometry&&t.layer){const e=await d(this.mapView,t.layer.id);e.highlightOptions=null,this._highlightHandle=await u([t.getObjectId()],e,this.mapView,!0,this.zoomToScale)}this.updatingFeatureDetails(!1)}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}getActionToExpandCollapsePanel(){return s("calcite-action",{icon:this._sidePanelCollapsed?"chevrons-up":"chevrons-down",onClick:this.toggleSidePanel.bind(this),slot:"header-actions-end",text:this._sidePanelCollapsed?this._translations.expand:this._translations.collapse})}async setMapView(){await this.getLayersToShowInList(),await this._updateFeatures(),1===this._editableLayerIds?.length?await this.renderFeaturesList():this._flowItems=["layer-list"],this.mapView.popupEnabled=!1,this._defaultCenter&&this._defaultLevel&&(await this.mapView.goTo({center:this._defaultCenter,zoom:this._defaultLevel}),this._defaultCenter=void 0,this._defaultLevel=void 0)}handleMapClick(){this._mapClickHandle&&this._mapClickHandle.remove(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",this.onMapClick.bind(this))}async onMapClick(t){this.mapView.popupEnabled=!1;const e=await this.mapView.hitTest(t);if(e.results.length>0){const t=[];e.results.forEach((function(e){"graphic"===e.type&&t.push(e.graphic)}));const i=t.filter((t=>this._validLayers.includes(t.layer))),s=t.filter((t=>!this._validLayers.includes(t.layer)&&t?.layer?.popupEnabled&&t?.layer?.id));if(i.length>0&&(await this.setSelectedFeatures(i),this._flowItems.length&&this._flowItems.includes("feature-details")?(this._flowItems=[...this._flowItems.slice(0,this._flowItems.indexOf("feature-details")+1)],await this.highlightOnMap(t[0])):this._flowItems=[...this._flowItems,"feature-details"]),s.length>0){this.mapView.popupEnabled=!0;const t={features:s,updateLocationEnabled:!0};await this.mapView.openPopup(t)}}}_getCount(){const t=(this._selectedFeatureIndex+1).toString(),e=this._selectedFeature.length.toString();return this._translations.indexOfTotal.replace("{{index}}",t).replace("{{total}}",e)}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}_updateFloorDefinitionExpression(t){const e=`${t.floorInfo.floorField} = '${this.floorLevel}'`,i=t.definitionExpression;t.definitionExpression=i?.indexOf(this._floorExpression)>-1?i.replace(this._floorExpression,e):e,this._floorExpression=e}_getFormElements(){const t=this._selectedLayer,e=t?.floorInfo?.floorField;if(e&&this.floorLevel&&t?.formTemplate){const e=this._formElements.find((e=>e.id===t.id));0!==this._formElements.length&&e||this._formElements.push({id:t.id,orgElements:t.formTemplate.elements,orgExpressionInfos:t.formTemplate.expressionInfos})}}reduceToConfiguredLayers(t,e){return Object.keys(t).reduce(((i,s)=>{const a=this.reportingOptions?this._getLayersConfig(s)?.visible:t[s].supportsAdd;return!e.includes(s)&&a&&i.push(s),i}),[])}async _updateFeatures(){for(const t of this._editableLayerIds){const e=await d(this.mapView,t);await this._showMyFeaturesOnly(e);const i=e.layer?.floorInfo?.floorField;i&&this.floorLevel&&this._updateFloorDefinitionExpression(e.layer)}}async _showMyFeaturesOnly(t){const e=this.mapView.map.portalItem.portal?.credential?.userId;if(e){const i=t.layer.editFieldsInfo?.creatorField.toLowerCase();t.filter=this.showMyReportsOnly&&i?new this.FeatureFilter({where:i+"='"+e+"'"}):null}}async getLayersToShowInList(){const t=await p(this.mapView,!0),e=await r(this.mapView),i=[];e.forEach((e=>{"feature"===e?.type&&e?.editingEnabled&&e?.capabilities?.operations?.supportsAdd&&(t[e.id].supportsAdd=!0),e?.editingEnabled||i.push(e.id)})),this._editableLayerIds=this.reduceToConfiguredLayers(t,i),this._layerItemsHash=t}async renderFeaturesList(){this._flowItems=["feature-list"];const t={detail:this._editableLayerIds};await this.layerListLoaded(t),await this.setSelectedLayer(this._validLayers[0].id,this._validLayers[0].title),this.handleSelectedLayersFilter()}_updateShareURL(){const t=this._shareNode?.shareUrl;if(!t)return;const e=new URL(t);this._selectedLayerId?e.searchParams.set("layerid",this._selectedLayerId):e.searchParams.delete("layerid"),this._selectedFeature?.length?e.searchParams.set("oid",this._currentFeatureId):e.searchParams.delete("oid"),this._shareNode.shareUrl=e.href}async loadFeatureFromURLParams(){if(this.center&&this.level&&await this.mapView.goTo({center:this.center.split(";").map(Number),zoom:this.level}),this.layerId&&this.objectId){const t=await n(this.mapView,this.layerId);if(t){const e=await m([Number(this.objectId)],t,[],!0,this.mapView.spatialReference);e.length&&(await this.setSelectedFeatures(e),this._flowItems=this._flowItems.length&&"feature-details"!==this._flowItems[this._flowItems.length-1]?[...this._flowItems,"feature-details"]:[...this._flowItems])}}}async handleSelectedLayersFilter(){if(this._selectedLayer){const t=this.layerExpressions?structuredClone(this.layerExpressions.filter((t=>t.id===this._selectedLayerId))):[];null!=this._t9nLayerExpressions&&this.handleLayerExpressionsT9n(t,this._t9nLayerExpressions),this._currentLayerExpressions=t,this.setActiveDefinitionExpressions()}}async handlePrevLayersFilter(){if(this._prevSelectedLayerId){const t=await n(this.mapView,this._prevSelectedLayerId);t&&(t.definitionExpression=this._initDefExpressions[this._prevSelectedLayerId])}}resetFilterList(){this._filterList?.forceReset(),null!=this._selectedLayer&&(this._selectedLayer.definitionExpression=this._initDefExpressions[this._selectedLayerId],this._filterActive=!1)}setActiveDefinitionExpressions(){if(null==this._selectedLayer)return;const t=[];if(this._currentLayerExpressions?.length>0){const e=this._currentLayerExpressions[0];for(const i of e.expressions){const{active:e,definitionExpression:s}=i;e&&s&&t.push(`(${s})`)}this._filterActive=t.length>0,this.updateFilterLayerDefExpression(t,e.operator)}}updateFilterLayerDefExpression(t,e){const i=this._initDefExpressions[this._selectedLayerId],s=t?.length>0&&null!=i?`(${t.join(e)}) AND (${i})`:t.length>0?t.join(e):i;this._selectedLayer.definitionExpression=s}setInitExpressions(){if(this._initDefExpressions={},null==this.mapView)return;const t=this.mapView.map;t.allLayers.concat(t.allTables).forEach((t=>{"feature"===t.type&&(this._initDefExpressions[t.id]=t.definitionExpression)}))}handleLayerExpressionsT9n(t,e){t?.forEach((t=>{const i=e?.find((e=>e.id===t.id));null!=i&&(t.title=i.title,t.expressions?.forEach((t=>{const e=i.expressions?.find((e=>e.id===t.id));null!=e&&(t.name=e.name)})))}))}static get watchers(){return{isMobile:["isMobileWatchHandler"],locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],floorLevel:["floorLevelWatchHandler"],showMyReportsOnly:["showMyReportsOnlyWatchHandler"],layerExpressions:["layerExpressionsWatchHandler"],showFeatureSymbol:["showFeatureSymbolWatchHandler"]}}};f.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100% !important}.width-0{width:0}.height-full{height:100% !important}.height-0{height:0}.overflow-hidden{overflow:hidden}.border{border:1px solid var(--calcite-color-border-3)}.notice-msg{padding:10px;width:calc(100% - 20px)}.progress-bar{padding:12px}.footer-top-button{padding-bottom:7px}.footer-button{height:35px}.feature-pagination{background-color:var(--calcite-color-foreground-1) !important;border-block-end:1px solid var(--calcite-color-border-3);display:flex;justify-content:center;padding:5px 0}.pagination-count{color:var(--calcite-color-brand);border-bottom:1px solid var(--calcite-color-brand);font-weight:bold}.report-submitted-msg{position:absolute;z-index:1000}.share-node{display:flex}";export{f as crowdsource_reporter}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as e,c as t,g as i,h as a,H as s}from"./p-1b0588d2.js";import{s as l}from"./p-8b218ba7.js";import{g as c}from"./p-ee2cbba0.js";import{n}from"./p-8850bd21.js";import{C as r,g as o}from"./p-80cb7c73.js";import"./p-e23b4193.js";import"./p-4f236b5d.js";import"./p-d4056c1c.js";import"./p-570b13d9.js";import"./p-0668e30d.js";import"./p-0a24ad5f.js";const h=class{constructor(i){e(this,i),this.solutionItemSelected=t(this,"solutionItemSelected",7)}get el(){return i(this)}selectedItemId;templateHierarchy=[];valueWatchHandler(e,t){e&&e!==t&&Array.isArray(e)&&e.length>0&&this._treeItemSelected(e[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return a(s,{key:"cf80f637e998eda76162eb1cf3fe94dfb2aeae3e"},a("calcite-tree",{key:"3bb27819fff1f63b28ed70c360fe8f7a63619d3c"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(e){return e.map((e=>{const t=this.selectedItemId&&this.selectedItemId===e.id;return e.dependencies&&e.dependencies.length>0?a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title),a("calcite-tree",{slot:"children"},this.renderHierarchy(e.dependencies))):a("calcite-tree-item",{onClick:t=>this._treeItemSelected(e.id,t),selected:t},a("solution-item-icon",{type:e.type,typeKeywords:e.typeKeywords}),a("span",{class:"icon-text",title:e.title},e.title))}))}solutionItemSelected;_treeItemSelected(e,t){const i=t?.target?.closest("calcite-tree-item");i&&(i.expanded=!i?.expanded),this.selectedItemId=e,this.solutionItemSelected.emit(e)}static get assetsDirs(){return["item-type-icons"]}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};h.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const d=class{constructor(t){e(this,t)}get el(){return i(this)}authentication;itemId="";itemIdWatchHandler(){const e=l.getItemInfo(this.itemId);this.itemType=e.type}locale;solutionVariables="";organizationVariables="";async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async componentWillLoad(){return this._getTranslations()}render(){return a(s,{key:"8213c164dbfc2f9d897bcd2dbb732d1029e7bc9a"},a("div",{key:"252091fa803626400a22295d6a9d148d207c84e6",class:"configuration-container"},a("div",{key:"b30bcfd2bec082f8248584749e6d98a2c9331bdf",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}itemType;_translations;_showGroupTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.groupDetailsTab),a("calcite-tab-title",null,this._translations.sharingTab)),a("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"share-tab"},a("solution-item-sharing",{"group-id":this.itemId,locale:this.locale})))}_showItemTabs(e){return a("calcite-tabs",{class:"config-tabs",style:{display:e?"inherit":"none"}},a("calcite-tab-nav",{slot:"tab-nav"},a("calcite-tab-title",null,this._translations.itemDetailsTab),a("calcite-tab-title",null,this._translations.dataTab),a("calcite-tab-title",null,this._translations.propertiesTab),a("calcite-tab-title",null,this._translations.resourcesTab)),a("calcite-tab",{class:"config-tab",selected:!0},a("solution-item-details",{"item-id":this.itemId,locale:this.locale})),a("calcite-tab",{class:"config-tab",id:"data-tab"},a("solution-template-data",{instanceid:"data","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"props-tab"},a("solution-template-data",{instanceid:"properties","item-id":this.itemId,locale:this.locale,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),a("calcite-tab",{class:"config-tab",id:"resources-tab"},a("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId,locale:this.locale})))}async _getTranslations(){const e=await c(this.el);this._translations=e[0]}static get watchers(){return{itemId:["itemIdWatchHandler"],locale:["localeWatchHandler"]}}};d.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const f="3857",b=class{constructor(i){e(this,i),this.featureServiceSpatialReferenceChange=t(this,"featureServiceSpatialReferenceChange",7),this.enableDefaultSpatialReferenceChange=t(this,"enableDefaultSpatialReferenceChange",7),this.enabledSpatialReferenceChange=t(this,"enabledSpatialReferenceChange",7)}get el(){return i(this)}enabled=!1;enabledChanged(){this._handleSpatialRefParamChange()}enableDefault=!1;enableDefaultChanged(){this._handleDefaultSpatialRefParamChange()}featureServices=[];locale;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}componentWillLoad(){return this._updateUIFromStore(),this._getTranslations()}render(){return this._updateUIFromStore(),a(s,{key:"7f273e4ac344e1ee0caf40e7d1b7f939ecabda20"},a("label",{key:"06de012379cbfc355a9ace954b1dffffa9ce8c83",class:"switch-label"},a("calcite-switch",{key:"81660a69b2ac46824e2b929e13362f5ab9260c54",checked:this.enabled,class:"spatial-ref-switch",onCalciteSwitchChange:e=>this.enabled=e.target.checked,scale:"m"}),this._translations.enableSpatialReference),a("br",{key:"361d2d822ddad721842b806e4ee1e04ff313a19b"}),a("div",{key:"a211f2f6f55191a9ae9b4e94eae7a998b7bc8e35",class:"spatial-ref-component",id:"spatialRefDefn"},this._renderFeatureServicesList(this.featureServices)),a("label",{key:"9fc52be401af098888688636168b6742e92ce939",class:"switch-label spatial-ref-component"},a("calcite-switch",{key:"138644a57bd5c159e9f7f219f8956f0ed1af5bf1",checked:this.enableDefault,class:"spatial-ref-switch",disabled:!this.enabled,onCalciteSwitchChange:e=>this.enableDefault=e.target.checked,scale:"m"}),this._translations.enableDefaultSpatialReference))}_translations;featureServiceSpatialReferenceChange;enableDefaultSpatialReferenceChange;enabledSpatialReferenceChange;solutionStoreHasChanges(){this.featureServices=l.getStoreInfo("featureServices")}async _testAccess(e,t,i,a){switch(e){case"_parameterizeWkid":return Promise.resolve(this._parameterizeWkid(t));case"_unparameterizeWkid":return Promise.resolve(this._unparameterizeWkid(t))}return Promise.resolve(null)}_clearFeatureServiceDefaults(e){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((e=>e.checked=!1)),e.forEach((e=>this._updateEnabledServices({detail:{switched:!1}},e)))}_handleDefaultSpatialRefParamChange(){this._updateStore(),this.enableDefaultSpatialReferenceChange.emit({defaultWkid:this.enableDefault?f:""})}_handleSpatialRefParamChange(){this.enabled||(this.enableDefault=!1,this._clearFeatureServiceDefaults(this.featureServices)),this._updateStore(),this.enabledSpatialReferenceChange.emit({enabled:this.enabled})}_parameterizeWkid(e){return e?e.toString().startsWith(r)?e:`${r}${e}${o}`:e}_renderFeatureServicesList(e){const t=l.getStoreInfo("spatialReferenceInfo"),i=e.filter((e=>Object.keys(t.services).some((t=>t===e.id))));return i.length>0?a("div",null,a("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),a("ul",{class:"spatial-ref-services-list"},i.map((e=>a("li",{class:"spatial-ref-services-list-item"},a("label",{class:"switch-label"},a("calcite-switch",{checked:t.services[e.id],class:"spatial-ref-item-switch",disabled:!this.enabled,onCalciteSwitchChange:t=>this._updateEnabledServices(t,e),scale:"m"}),e.name)))))):null}_updateEnabledServices(e,t){const i=l.getStoreInfo("spatialReferenceInfo");i.services[t.id]=void 0!==e.detail?.switched?e.detail.switched:void 0===e.target?.checked||e.target.checked,l.setStoreInfo("spatialReferenceInfo",i),this._updateStore(),this.featureServiceSpatialReferenceChange.emit(t)}_unparameterizeWkid(e){return e&&e.toString().startsWith(r)?e.substring(r.length,e.length-o.length):e}_updateFeatureServices(e){e.enabled||Object.keys(e.services).forEach((t=>{e.services[t]=!1})),this.featureServices.forEach((t=>{t.enabled=e.services[t.id],t.wkid=t.enabled?this._parameterizeWkid(t.wkid):this._unparameterizeWkid(t.wkid)})),l.setStoreInfo("featureServices",this.featureServices)}_updateStore(){const e=l.getStoreInfo("spatialReferenceInfo");e.enabled=this.enabled,this.enabled&&this.enableDefault?e.default=f:e.hasOwnProperty("default")&&delete e.default,l.setStoreInfo("spatialReferenceInfo",e),this._updateFeatureServices(e)}_updateUIFromStore(){const e=l.getStoreInfo("spatialReferenceInfo");this.enabled=e.enabled,this.enableDefault=!!e.default,this.featureServices=l.getStoreInfo("featureServices")}async _getTranslations(){const e=await c(this.el);this._translations=e[0]}static get watchers(){return{enabled:["enabledChanged"],enableDefault:["enableDefaultChanged"],locale:["localeWatchHandler"]}}};b.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{font-size:0.875rem;line-height:1.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:2em}.spatial-ref-services-list-item{margin-top:0.25rem}";export{h as solution_contents,d as solution_item,b as solution_spatial_ref}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as e,g as a,h as i,H as t}from"./p-1b0588d2.js";import{c as l}from"./p-747d4b59.js";const d=class{constructor(a){e(this,a)}get el(){return a(this)}showAddDeduct=!1;_deductValuesElement;render(){const e=this.showAddDeduct?"position-relative":"display-none";return i(t,{key:"6ee5741fe10030324155d5f05a9e4a0eeb337028"},i("div",{key:"14e0c3495ad57d8d1ec4da9b6c5df80323ef1735",class:this.showAddDeduct?"display-none":"display-grid"},i("div",{key:"ef2e48f06b194ee7806e2f6b5c60d77e17ac1e5f",class:"label-display"},i("calcite-label",{key:"60695651cdad1e30570f76f3621740fb8c0b62e9",class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),i("div",{key:"19e2db05e7b45fb012892ffa539cb2037da9f449"},this._getCalculateButton())),i("div",{key:"4a2cd1a80a86d2ba7e4b24935dbebbaecd316cd0",class:e},i("div",{key:"f288ef667dd2532c8f409ef12a033d6b4f13ad7e",class:"position-right"},i("calcite-action",{key:"0d62669dd9660098f6ac4eb10334c5a9ea3897aa",appearance:"transparent",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),i("deduct-calculator",{key:"dd0a3cb656e7e2c707b1956e40e8a597d8972cfa",class:"display-grid padding-top-1",onDeductValueComplete:e=>this._addDeductValue(e)})))}_getDeductValuesInput(){return i("div",{class:"display-flex"},i("calcite-input",{class:"main-input",ref:e=>{this._deductValuesElement=e}}),i("calcite-action",{appearance:"transparent",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return i("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(e){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${e.detail}`:e.detail}_calculatePCI(e){const a=l(e,!0),i=a<=10?"Failed":a<=25?"Serious":a<=40?"Very Poor":a<=55?"Poor":a<=70?"Fair":a<=85?"Satisfactory":"Good";console.log(`PCI: ${a}`),console.log(`Rating: ${i}`),alert("See debug console for results")}};d.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{d as pci_calculator}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as e,g as s}from"./p-1b0588d2.js";import{s as r}from"./p-8b218ba7.js";import{c as a,d as i}from"./p-f6e81cf8.js";import"./p-e23b4193.js";import"./p-80cb7c73.js";import"./p-4f236b5d.js";import"./p-d4056c1c.js";import"./p-570b13d9.js";import"./p-0668e30d.js";const o=class{constructor(s){t(this,s),this.stateLoaded=e(this,"stateLoaded",7)}get el(){return s(this)}value="";templates=[];authentication;connectedCallback(){this._handleValueChange(this.value),this._initValueObserver()}render(){return null}stateLoaded;async getStoreInfo(t){return Promise.resolve(r.getStoreInfo(t))}_valueObserver;_handleValueChange(t){if(""!==t){const e=JSON.parse(t);r.setStoreInfo("solutionData",e);const s=a(e.templates);r.setStoreInfo("featureServices",s),r.setStoreInfo("spatialReferenceInfo",i(s,e)),this.templates=e.templates,this.stateLoaded.emit(r)}}_initValueObserver(){this._valueObserver=new MutationObserver((t=>{t.some((t=>{const e=t.target[t.attributeName];if("attributes"===t.type&&"value"===t.attributeName&&e!==t.oldValue)return this._handleValueChange(e),!0}))})),this._valueObserver.observe(this.el,{attributes:!0,attributeOldValue:!0})}};export{o as store_manager}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as e,g as a,h as r,a as t}from"./p-1b0588d2.js";const s=class{constructor(a){e(this,a)}get el(){return a(this)}isPortal=!1;type="";typeKeywords=[];render(){return r("div",{key:"cc13e7bfc0a58ca1727651c3c31b0dc4e50f716a",title:this.type},r("img",{key:"76808f6a3ced35a15626d4a4d30e7a2b8185d8d6",class:"item-type-icon item-type-icon-margin",height:"16",src:this._getIconUrl(this.type,this.typeKeywords),width:"16"}))}_getIconUrl(e,a){const r=this._getItemIcon(e,a);return t("group"===r?`./item-icons/${r}16.png`:`./item-icons/${r}16.svg`)}_getItemIcon(e,a){const r=e.toLowerCase(),t=a||[],s=t.includes("Hosted Service");switch(r.trim()){case"360 vr experience":return"360vr";case"3dtiles package":return"3dtileslayerpackage";case"3dtiles service":return t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dobjecttileslayer";case"feature service":case"feature collection":case"kml":case"wfs":if(t.includes("IndoorPositioningDataService"))return"indoorpositioningdataservice";const e=t.includes("Spatiotemporal");return t.includes("Table")?e?"spatiotemporaltable":"table":t.includes("Route Layer")?"routelayer":t.includes("Markup")?"markup":e?"spatiotemporal":t.includes("UtilityNetwork")?"utilitynetwork":s?"featureshosted":"features";case"group":return"group";case"group layer":return t.includes("Map")?"layergroup2d":t.includes("Scene")?"layergroup3d":"layergroup";case"wmts":return"maptiles";case"map service":case"wms":return s||t.includes("Tiled")?"maptiles":"mapimages";case"scene service":return t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer";case"image service":return t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery";case"stream service":return"streamlayer";case"video service":return t.includes("Live Stream")?"livestreamvideolayer":"mediaservice";case"vector tile service":return"vectortile";case"datastore catalog service":return"datastorecollection";case"geocoding service":return"geocodeservice";case"geoprocessing service":return t.includes("Web Tool")?"tool":"layers";case"geodata service":return"geodataservice";case"web map":case"cityengine web scene":return"maps";case"web scene":return t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal";case"application":case"web mapping application":case"mobile application":case"operation view":case"desktop application":return t.includes("configurableApp")?"instantapps":"apps";case"map document":case"map package":case"published map":case"scene document":case"globe document":case"basemap package":case"mobile basemap package":case"mobile map package":case"project package":case"project template":case"pro map":case"layout":return"mapsgray";case"layer":if(t.includes("ArcGIS Pro"))return"mapsgray";case"explorer map":if(t.indexOf("Explorer Document"))return"mapsgray";if(t.includes("Explorer Mapping Application"))return"datafilesgray";case"pro presentation":return"propresentation";case"api key":return"key";case"csv":return"csv";case"shapefile":return"shapefile";case"csv collection":return"csvcollection";case"media layer":return"medialayer";case"microsoft excel":return"excel";case"microsoft powerpoint":return"powerpoint";case"microsoft word":return"word";case"pdf":return"pdf";case"sqlite geodatabase":return"sqlite";case"administrative report":return"report";case"image":return"image";case"cad drawing":return"cad";case"service definition":case"geojson":case"360 vr experience":case"netcdf":return"data";case"explorer add in":case"desktop add in":case"windows viewer add in":case"windows viewer configuration":return"appsgray";case"arcgis pro add in":case"arcgis pro configuration":return"addindesktop";case"rule package":case"file geodatabase":case"kml collection":case"windows mobile package":case"map template":case"desktop application template":case"gml":case"arcpad package":case"code sample":case"document link":case"earth configuration":case"operations dashboard add in":case"rules package":case"workflow manager package":return"datafilesgray";case"form":return t.includes("Survey123")?"survey":"datafilesgray";case"network analysis service":case"geoprocessing service":case"geodata service":case"geometry service":case"geoprocessing package":case"locator package":case"geoprocessing sample":case"workflow manager service":return"toolsgray";case"layer":case"layer package":case"explorer layer":return"layersgray";case"scene package":return"scenepackage";case"mobile scene package":return"mobilescenepackage";case"tile package":case"compact tile package":return"tilepackage";case"task file":return"taskfile";case"report template":return"reporttemplate";case"statistical data collection":return"statisticaldatacollection";case"analysis model":return"geoprocessingmodel";case"insights workbook":return"workbook";case"insights model":return"insightsmodel";case"insights page":return"insightspage";case"insights theme":return"insightstheme";case"hub initiative":return"hubinitiative";case"hub page":return"hubpage";case"hub event":return"hubevent";case"hub site application":return"hubsite";case"hub project":return"hubproject";case"relational database connection":return"relationaldatabaseconnection";case"image":return"image";case"image collection":return"imagecollection";case"style":return t.includes("Dictionary")?"dictionarystyle":"style";case"desktop style":return"desktopstyle";case"dashboard":return"dashboard";case"raster function template":return"rasterprocessingtemplate";case"vector tile package":return"vectortilepackage";case"ortho mapping project":return"orthomappingproject";case"ortho mapping template":return"orthomappingtemplate";case"solution":return"solutions";case"geopackage":return"geopackage";case"deep learning package":return"deeplearningpackage";case"real time analytic":return"realtimeanalytics";case"big data analytic":return"bigdataanalytics";case"feed":return"feed";case"excalibur imagery project":return"excaliburimageryproject";case"notebook":return"notebook";case"reality mapping project":return"realitymappingproject";case"storymap":return t.includes("storymaptemplate")?"storymapstemplate":t.includes("storymapcollection")?"storymapcollection":t.includes("storymapbriefing")?"storymapbriefing":"storymap";case"survey123 add in":return"survey123addin";case"mission":return"mission";case"mission report":return"missionreport";case"quickcapture project":return"quickcaptureproject";case"pro report":return"proreport";case"urban model":return"urbanmodel";case"urban project":return"urbanproject";case"web experience":return"experiencebuilder";case"web experience template":return"webexperiencetemplate";case"experience builder widget":return"experiencebuilderwidget";case"experience builder widget package":return"experiencebuilderwidgetpackage";case"workflow":return"workflow";case"insights script":return"insightsscript";case"kernel gateway connection":return"kernelgatewayconnection";case"hub initiative template":return"hubinitiativetemplate";case"storymap theme":return"storymaptheme";case"knowledge graph":return"knowledgegraph";case"knowledge studio project":return"knowledgestudio";case"knowledge graph layer":return"knowledgegraphlayer";case"native application":return"nativeapp";case"native application installer":return"nativeappinstaller";case"web link chart":return"linkchart";case"knowledge graph web investigation":return"investigation";case"ogcfeatureserver":return"features";case"pro project":return"proproject";case"insights workbook package":return"insightsworkbookpackage";case"apache parquet":return"apacheparquet";case"notebook code snippets":case"notebook code snippet library":return"notebookcodesnippets";case"suitability model":return"suitabilitymodel";case"esri classifier definition":return"classifierdefinition";case"esri classification schema":return"classificationschema";case"insights data engineering workbook":return"dataengineeringworkbook";case"insights data engineering model":return"dataengineeringmodel";case"deep learning studio project":return"deeplearningproject";case"data store":return"datastore";case"data pipeline":return"datapipeline";default:return t.includes("Document")?"datafilesgray":r.includes("service")?"layers":"maps"}}static get assetsDirs(){return["item-icons"]}};s.style=".item-type-icon{pointer-events:none;display:block;height:1rem;margin-top:0.15em !important;min-width:16px;fill:currentColor;transform:rotate(360deg)}.item-type-icon-margin{margin-inline-end:0.375rem}";export{s as solution_item_icon}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as e,g as i,h as s,H as a}from"./p-1b0588d2.js";import{g as h}from"./p-ee2cbba0.js";import{g as l,d as n,n as o}from"./p-dcd2f00b.js";import{s as r}from"./p-48942eb8.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-e23b4193.js";const c=class{constructor(i){t(this,i),this.beforeLayerSelectionChange=e(this,"beforeLayerSelectionChange",7),this.idsFound=e(this,"idsFound",7),this.noLayersFound=e(this,"noLayersFound",7),this.layerSelectionChange=e(this,"layerSelectionChange",7)}get el(){return i(this)}appearance="transparent";defaultLayerId="";display="inline-block";enabledLayerIds=[];enabledTableIds=[];height;isMobile;locale;mapView;onlyShowUpdatableLayers;placeholderIcon="";selectedIds=[];scale="m";showTables;showTablesDisabled;showSingleLayerAsLabel=!1;type="select";_hasMultipleLayers=!0;_hasValidLayers=!0;_isDropdownOpen;ids=[];selectedName="";_translations;defaultLayerHonored=!1;_layerElement;_layerNameHash;_skipEditCheck=!1;_tableNameHash;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this._setLayers(),this.ids.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this._setSelectedLayer(this.ids[0])):(this._hasValidLayers=!1,this.noLayersFound.emit())}async setLayerById(t,e=!1){this._skipEditCheck=e,this._setSelectedLayer(t),this._skipEditCheck=!1}async setLayerByIds(t,e=!1){this._skipEditCheck=e,this._layerSelectionChange(t),this._skipEditCheck=!1}async updateLayer(){this._setSelectedLayer(this.ids[0])}beforeLayerSelectionChange;idsFound;noLayersFound;layerSelectionChange;async componentWillLoad(){await this._getTranslations(),await this._setLayers()}async componentWillRender(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];if(t!==this.selectedIds[0])this._setSelectedLayer(t);else{const t=await l(this.mapView,this.selectedIds[0]);this.selectedName=t?.title}}}render(){const t="map-layer-picker";let e=this.height>0?{height:`${this.height.toString()}px`}:{};return e={...e,display:this.display},s(a,{key:"a4d7a923fcf0b6ec488fafa3af8b3c3a9599d61a"},s("div",{key:"54d5cde231707391537fbd649647a5b9e86a1ab3",class:"map-layer-picker-container",style:e},s("div",{key:"1d1329f393778e561bfed22a1c1542cd75d4b55b",class:"map-layer-picker",style:e},this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():"combobox"===this.type?this._getCombobox(t):"select"===this.type?this._getSelect(t):this._getDropdown(t):this._getInvalidPlaceholder())))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=t:"dropdown"===this.type&&(this.selectedName=Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t].name:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t].name:"")}}_getInvalidPlaceholder(){return s("div",null,s("calcite-notice",{class:"height-100",icon:"exclamation-mark-triangle",id:"no-valid-layers",kind:"danger",open:!0},s("div",{slot:"message"},this._translations.noLayersFound)),s("calcite-tooltip",{label:this._translations.enableEditUpdate,placement:"bottom","reference-element":"no-valid-layers"},s("span",null,this._translations.enableEditUpdate)))}_getSingleLayerPlaceholder(){const t=this._getItemTypeIcon();return s("div",{class:"layer-picker-label-container cursor-default"},s("calcite-icon",{icon:t,scale:"s"}),s("calcite-label",{class:"no-bottom-margin padding-start-1"},this.selectedName))}_getSelect(t){return s("calcite-select",{id:t,label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:t=>{this._layerElement=t},scale:this.scale},this._getMapLayerOptions())}_getCombobox(t){return s("calcite-combobox",{clearDisabled:!0,id:t,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:t=>{this._layerElement=t},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(t){return s("calcite-dropdown",{class:"layer-picker-dropdown",onCalciteDropdownBeforeClose:()=>this._isDropdownOpen=!1,onCalciteDropdownBeforeOpen:()=>this._isDropdownOpen=!0},this.isMobile?this._getDropdownButton():this._getActionDropdownButton(t),s("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getActionDropdownButton(t){return s("calcite-action",{id:t,slot:"trigger",text:""},this._getDropdownButton())}_getDropdownButton(){const t=this._getItemTypeIcon();return s("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:this.isMobile?"":"max-width-350",iconEnd:this._isDropdownOpen?"chevron-up":"chevron-down",iconStart:t,kind:"neutral",slot:this.isMobile?"trigger":"",width:"full"},s("div",null,this.selectedName))}_getItemTypeIcon(){let t="layers";if(this.selectedIds.length>0){const e=this.selectedIds[0];t=Object.keys(this._layerNameHash).indexOf(e)>-1?"layers":"table"}return t}_getMapLayerOptions(){return this.ids.reduce(((t,e)=>(this._validLayer(e)?t.push(this._getItem(e,"layer")):this._validTable(e)&&t.push(this._getItem(e,"table")),t)),[])}_getItem(t,e){const i="layer"===e?this._layerNameHash[t]:this._tableNameHash[t],a=!!this.onlyShowUpdatableLayers&&!i.supportsUpdate,h=i.name,l=this.selectedIds.indexOf(t)>-1;return"combobox"===this.type?s("calcite-combobox-item",{disabled:a,selected:l,textLabel:h,value:t}):"select"===this.type?s("calcite-option",{disabled:a,label:h,selected:l,value:t}):s("calcite-dropdown-group",{class:a?"disabled":"",selectionMode:a?"none":"single"},s("calcite-dropdown-item",{disabled:"table"===e&&this.showTablesDisabled,"icon-start":e,onClick:a?void 0:()=>{this._setSelectedLayer(t)},selected:l},h))}_setSelectedLayer(t){let e;this.defaultLayerId&&!this.defaultLayerHonored&&(e=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=void 0!==e,t=this.defaultLayerHonored?this.defaultLayerId:t),e=e||this._getLayerFromHash(t),(this._skipEditCheck||!this.beforeLayerSelectionChange.emit({currentId:this.selectedIds[0],newId:t,ref:this.el}).defaultPrevented)&&(this.selectedName=e?.name,this.selectedIds=[t],this.layerSelectionChange.emit(this.selectedIds))}_getLayerFromHash(t){return Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t]:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();const t=this.onlyShowUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash),e=this.showTables?this.onlyShowUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[];this.ids=[...t.reverse().filter((t=>!(this.enabledLayerIds?.length>0)||this.enabledLayerIds.reverse().indexOf(t)>-1)),...e.reverse().filter((t=>!(this.enabledTableIds?.length>0)||this.enabledTableIds.reverse().indexOf(t)>-1))],this.idsFound.emit({layerIds:t,tableIds:e})}}_getEditableIds(t){return Object.keys(t).reduce(((e,i)=>(t[i].supportsUpdate&&e.push(i),e)),[])}async _initLayerTableHash(){this._layerNameHash=await n(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await o(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){const e=this._layerNameHash[t]?.name;return e&&Object.keys(r.managedLayers).indexOf(e)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){const e=this._tableNameHash[t]?.name,i=e&&this.showTables;return i?r.managedTables.indexOf(e)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):i}_layerSelectionChange(t){const e=t||(Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value]);if(JSON.stringify(e)!==JSON.stringify([""])){if(!this._skipEditCheck&&this.beforeLayerSelectionChange.emit({currentIds:this.selectedIds,newIds:e,ref:this.el}).defaultPrevented)return;this.selectedIds=e,this.layerSelectionChange.emit(this.selectedIds)}}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"]}}};c.style=":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";export{c as map_layer_picker}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as e,c as t,g as i,h as s,H as o}from"./p-1b0588d2.js";import{g as a}from"./p-ee2cbba0.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const n=class{constructor(i){e(this,i),this.solutionItemHover=t(this,"solutionItemHover",7),this.solutionItemSelect=t(this,"solutionItemSelect",7),this.solutionTypeHover=t(this,"solutionTypeHover",7)}get el(){return i(this)}locale;listSelectionMode="none";templateInfos=[];_sortedTemplateInfos=[];_translations;_sortOrder=["Hub Site Application","Hub Page","Web Experience","Instant App","Web Mapping Application","Dashboard","StoryMap","Form","QuickCapture Project","Workflow","Big Data Analytic (hosted)","Real Time Analytic (hosted)","Feed (hosted)","Tool","Notebook","Data Pipeline","Project Package","Desktop Application Template","TypeNotFound","Web Map","Web Scene","Feature Layer (hosted, view)","Feature Layer (hosted)","Table (hosted, view)","Table (hosted)","Tile Layer","CSV","Microsoft Excel","Microsoft Word","Report Template","Rule Package","Group"];async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async templateInfosWatchHandler(){this._sortedTemplateInfos=this._sortTemplates()}async deselectAll(){"single"!==this.listSelectionMode&&"single-persist"!==this.listSelectionMode||this.el.shadowRoot.querySelectorAll("calcite-list-item").forEach((e=>{e.selected&&(e.selected=!1,e.parentElement.parentElement.expanded=!1)}))}async selectItem(e){"single"!==this.listSelectionMode&&"single-persist"!==this.listSelectionMode||this.el.shadowRoot.querySelectorAll("calcite-list-item").forEach((t=>{t.id===e&&(t.selected=!0,t.parentElement.parentElement.expanded=!0)}))}solutionItemHover;solutionItemSelect;solutionTypeHover;async componentWillLoad(){this._sortedTemplateInfos=this._sortTemplates(),await this._getTranslations()}render(){return s(o,{key:"23845e68bd1920f17f27b1679df20915230f99c3"},this._getAccordion())}_deselectOthers(e){"single"!==this.listSelectionMode&&"single-persist"!==this.listSelectionMode||this.el.shadowRoot.querySelectorAll("calcite-list-item").forEach((t=>{t.id!==e&&(t.selected=!1)}))}_getAccordion(){const e=[],t=this._sortedTemplateInfos.reduce(((t,i)=>{const s=this._getTypeForDisplay(i.type,i.typeKeywords);return e.indexOf(s)<0&&(e.push(s),t.push(this._getAccordionItem(i))),t}),[]);return s("calcite-accordion",{class:"border-override",selectionMode:"single"},t)}_getAccordionItem(e){const t=this._getTypeForDisplay(e.type,e.typeKeywords),i=this._sortedTemplateInfos.filter((e=>this._getTypeForDisplay(e.type,e.typeKeywords)===t));return s("calcite-accordion-item",{description:`${t} (${i.length})`,onMouseEnter:()=>this.solutionTypeHover.emit({itemType:t,entering:!0}),onMouseLeave:()=>this.solutionTypeHover.emit({itemType:t,entering:!1})},s("solution-item-icon",{class:"padding-start-1 display-flex align-center",slot:"actions-start",type:e.type,typeKeywords:e.typeKeywords}),this._getList(i))}_getList(e){const t=this._sortTemplatesByTitle(e);return s("calcite-list",{label:"",selectionAppearance:"border",selectionMode:this.listSelectionMode},t.map((e=>this._getListItem(e))))}_getListItem(e){return s("calcite-list-item",{description:e.snippet,id:e.id,label:e.title,onCalciteListItemSelect:()=>{this._deselectOthers(e.id),this.solutionItemSelect.emit({itemId:e.id,selected:!0})},onMouseEnter:()=>this.solutionItemHover.emit({itemId:e.id,entering:!0}),onMouseLeave:()=>this.solutionItemHover.emit({itemId:e.id,entering:!1}),value:e.id},e.url?s("calcite-action",{icon:"launch",onClick:()=>window.open(e.url,"_blank"),slot:"actions-end",text:this._translations?.openDetails?.replace("{{solutionTitle}}",e.title)}):null)}_sortTemplatesByTitle(e){return e.sort(((e,t)=>e.title<t.title?-1:e.title>t.title?1:0))}_sortTemplates(){return this.templateInfos.sort(((e,t)=>{const i=this._getTypeForSort(e),s=this._getTypeForSort(t);return this._sortOrder.indexOf(i)-this._sortOrder.indexOf(s)}))}_getTypeForSort(e){let t=this._getTypeForDisplay(e.type,e.typeKeywords);return this._sortOrder.indexOf(t)<0&&(t="TypeNotFound"),t}_getTypeForDisplay(e,t){let i=e;if("Feature Service"===e){const e=t.indexOf("View Service")>-1,s=t.indexOf("Table")>-1;i=e&&s?"Table (hosted, view)":s?"Table (hosted)":e?"Feature Layer (hosted, view)":"Feature Layer (hosted)"}return"Web Mapping Application"===e&&(i=t.indexOf("configurableApp")>-1?"Instant App":i),i="Geoprocessing Service"===e?"Tool":i,i="Feed"===e?"Feed (hosted)":i,i="Real Time Analytic"===e?"Real Time Analytic (hosted)":i,i="Big Data Analytic"===e?"Big Data Analytic (hosted)":i,i="Vector Tile Service"===e?"Tile Layer":i,i}async _getTranslations(){const e=await a(this.el);this._translations=e[0]}static get watchers(){return{locale:["localeWatchHandler"],templateInfos:["templateInfosWatchHandler"]}}};n.style=":host{display:block}.padding-start-1{padding-inline-start:1rem}.border-override{--calcite-accordion-border-color:var(--calcite-color-border-1) !important}.display-flex{display:flex}.align-center{align-items:center}";export{n as solution_item_accordion}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,g as e,h as s}from"./p-1b0588d2.js";import{l as a,g as h}from"./p-ee2cbba0.js";import{P as l}from"./p-d0d21a1f.js";import{g as n,c as o,h as r}from"./p-dcd2f00b.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-6eab9d1f.js";import"./p-4fe489cf.js";import"./p-2bc98cb0.js";import"./p-4f236b5d.js";import"./p-570b13d9.js";import"./p-0668e30d.js";import"./p-80cb7c73.js";const c=class{constructor(e){t(this,e),this.featureSelect=i(this,"featureSelect",7)}get el(){return e(this)}selectedLayerId;mapView;noFeaturesFoundMsg;pageSize=100;highlightOnMap=!1;highlightOnHover=!1;locale;sortingInfo;whereClause;textSize="large";showInitialLoading=!0;showErrorWhenNoFeatures=!0;showUserImageInList=!1;showFeatureSymbol=!1;applyLayerViewFilter=!1;reportingOptions;showFullTitle=!0;_featureItems=[];_featuresCount=0;_isLoading=!1;_searchPlaceHolder="";_fullTextSearchInfo;_translations;Color;esriConfig;symbolUtils;_popupUtils;_selectedLayer;_highlightHandle;_highlights;_pagination;_calciteList;_validFieldTypes=["small-integer","integer","big-integer","single","long"];_abbreviatedLikeCount;_likeFieldAvailable=!1;_searchExpression;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async selectedLayerWatchHandler(){this._selectedLayer=await n(this.mapView,this.selectedLayerId),await this.initializeFeatureItems()}async sortingInfoWatchHandler(){await this.initializeFeatureItems()}async whereClauseHandler(){await this.initializeFeatureItems()}async refresh(t){if(t&&this._pagination){const t={target:{startItem:this._pagination.startItem}};await this.pageChanged(t)}else this._searchExpression?await this._searchFullText():await this.initializeFeatureItems()}featureSelect;async componentWillLoad(){await this.initModules(),await this._getTranslations(),this._isLoading=this.showInitialLoading,this._popupUtils=new l,this.mapView&&this.selectedLayerId&&(this._selectedLayer=await n(this.mapView,this.selectedLayerId),this._getFullTextSearchInfo())}async componentDidLoad(){await this.initializeFeatureItems()}render(){const t=this._canShowFullTextSearch();return s("calcite-panel",{key:"56599be334eec65be00681d415db28917133b0c1","full-height":!0,"full-width":!0},t&&s("calcite-input",{key:"6de9873f6b7ab961dffe1334d2fc20b4322d8ea8",class:"search",clearable:!0,icon:"search",onCalciteInputChange:this._searchTextChanged.bind(this),placeholder:this._searchPlaceHolder,title:"",type:"search"}),this._isLoading&&s("calcite-loader",{key:"4189b0d6c2a85116d529f5b7844c1f2d41657350",label:"",scale:"m"}),this.showErrorWhenNoFeatures&&0===this._featureItems.length&&!this._isLoading&&s("calcite-notice",{key:"7f2e8276ad5345e21667b2dedc7e23f5c34672f5",class:"error-msg",icon:"feature-details",kind:"info",open:!0},s("div",{key:"63d44ac906c8d5584aac2cfbeec4cf0962d61abe",slot:"message"},this.noFeaturesFoundMsg?this.noFeaturesFoundMsg:this._translations.featureErrorMsg)),s("calcite-list",{key:"5843f8d7ca994cb799a9be0ab2f43a8f1e407e9a",class:"small"!==this.textSize||this.showFullTitle?"":"overflow-hidden",label:"",ref:t=>this._calciteList=t,"selection-appearance":"border","selection-mode":"none"},!this._isLoading&&this._featureItems.length>0&&this._featureItems),this._featuresCount>this.pageSize&&s("div",{key:"288364bc505fe6bce8b1260dce5173163a795330",class:"width-full",slot:"footer"},s("calcite-pagination",{key:"e30e2d46a0005dd3e0d289deb4721b9155d4df29",class:"pagination","full-width":!0,onCalcitePaginationChange:this.pageChanged.bind(this),"page-size":this.pageSize,ref:t=>this._pagination=t,"start-item":"1","total-items":this._featuresCount})))}async initModules(){const[t,i,e]=await a(["esri/Color","esri/config","esri/symbols/support/symbolUtils"]);this.Color=t,this.esriConfig=i,this.symbolUtils=e}async getWhereCondition(){let t="1=1";if(this.whereClause&&(t=this.whereClause),this._selectedLayer?.definitionExpression&&(t=t+" AND "+this._selectedLayer.definitionExpression),this.applyLayerViewFilter){const i=await o(this.mapView,this.selectedLayerId);i?.filter?.where&&(t=t+" AND "+i.filter.where)}return t}async initializeFeatureItems(){if(this._selectedLayer){this._pagination?.goTo("start"),this._isLoading=this.showInitialLoading,this._featureItems=await this.queryPage(0);const t={where:await this.getWhereCondition()};this._featuresCount=await this._selectedLayer.queryFeatureCount(t),this._isLoading=!1}}async pageChanged(t){this._isLoading=!0,this._highlightHandle&&(this._highlightHandle.remove(),this._highlightHandle=null);const i=t.target.startItem-1;this._featureItems=await this.queryPage(i),this._isLoading=!1}_canShowFullTextSearch(){return((this._selectedLayer?.capabilities)?.query)?.supportsFullTextSearch&&this._selectedLayer.indexes.items.filter((t=>"FullText"==t.indexType)).length>0}_getFullTextSearchInfo(){if(this._fullTextSearchInfo=[],((this._selectedLayer?.capabilities)?.query)?.supportsFullTextSearch){const t=this._selectedLayer.indexes?.filter((t=>"FullText"==t.indexType));if(t?.length){const i=[];t.forEach((t=>{i.push(...t.fields.split(","))}));const e=[];i.forEach((t=>{const i=this._selectedLayer.getField(t.trim());e.push(i.alias)})),this._searchPlaceHolder=this._translations.searchPlaceholder.replace("{{fields}}",e.join(", ")),this._fullTextSearchInfo.push({onFields:["*"],searchTerm:"",searchType:"prefix"})}}}async _searchTextChanged(t){this._fullTextSearchInfo.forEach((i=>{i.searchTerm=t.target.value})),await this._searchFullText()}async _searchFullText(){this._searchExpression&&this._clearSearchDefinitionExpression();let t=[];if(this._fullTextSearchInfo&&this._fullTextSearchInfo[0].searchTerm){const i=this._selectedLayer.createQuery();i.fullText=this._fullTextSearchInfo,t=await this._selectedLayer.queryObjectIds(i),await this._updateSearchDefinitionExpression(t?.length?t:[-1])}await this.initializeFeatureItems()}async _updateSearchDefinitionExpression(t){const i=this._selectedLayer.definitionExpression;if(t?.length){const e=`objectId in(${t})`;this._selectedLayer.definitionExpression=i?.indexOf(this._searchExpression)>-1?i.replace(this._searchExpression,e):i?`${i} AND (${e})`:e,this._searchExpression=e}else this._clearSearchDefinitionExpression()}_clearSearchDefinitionExpression(){const t=this._selectedLayer.definitionExpression;this._searchExpression&&t?.indexOf(this._searchExpression)>-1&&(this._selectedLayer.definitionExpression=t?.indexOf(" AND ("+this._searchExpression)>-1?t.replace(` AND (${this._searchExpression})`,""):t.replace(this._searchExpression,"")),this._searchExpression=void 0}async featureClicked(t,i){if(this.clearHighlights(),this.highlightOnMap){const i=Number(t.target.value),e=await o(this.mapView,this.selectedLayerId);this._highlightHandle=await r([i],e,this.mapView,!0)}await this.emitSelectedFeature(i)}async emitSelectedFeature(t){const i=t.layer,e=i.createQuery();e.returnGeometry=!0,e.objectIds=[t.getObjectId()];const s=await i.queryFeatures(e);this.featureSelect.emit(s.features[0])}async onFeatureHover(t){if(this.clearHighlights(),this.highlightOnHover){const i=t.getObjectId(),e=await o(this.mapView,this.selectedLayerId);this._highlights&&(e.highlights=JSON.parse(this._highlights)),e.highlightOptions={color:new this.Color("#FFFF00")},this._highlights=JSON.stringify(e.highlights),this._highlightHandle=e.highlight([i])}}clearHighlights(){this._highlightHandle&&this._highlightHandle.remove()}async queryPage(t){const i=this._selectedLayer,e=this.sortingInfo?.field?this.sortingInfo.field:i.objectIdField,s=this.sortingInfo?.order?this.sortingInfo.order:"desc",a=await this.getWhereCondition(),h={start:t,num:this.pageSize,outFields:["*"],returnGeometry:!0,where:a,outSpatialReference:this.mapView.spatialReference.toJSON()};e&&s&&(h.orderByFields=[e.toString()+" "+s]);const l=await i.queryFeatures(h);return await this.createFeatureItem(l)}async createFeatureItem(t){const i=t?.features,e=this.reportingOptions&&this.reportingOptions[this.selectedLayerId].like,s=i.map((async t=>{const i=await this._popupUtils.getPopupTitle(t,this.mapView.map);let s,a;if(this.showUserImageInList){const i=this._selectedLayer.editFieldsInfo?.creatorField;i&&(s=await this.getUserInformation(t))}return this.showFeatureSymbol&&(a=await this.getFeatureSymbol(t)),e&&this.getAbbreviatedLikeCount(t),this.getFeatureItem(t,i,a,s)}));return Promise.all(s)}getAbbreviatedLikeCount(t){const i=this._selectedLayer,e=this.reportingOptions[i.id].likeField;i.fields.forEach((s=>{if(this._validFieldTypes.indexOf(s.type)>-1&&s.name===e&&this.reportingOptions[i.id].like){this._likeFieldAvailable=!0;let i=t.attributes[e]||0;i>999&&(i=i>999999?this._translations.millionsAbbreviation.replace("{{abbreviated_value}}",Math.floor(i/1e6).toString()):this._translations.thousandsAbbreviation.replace("{{abbreviated_value}}",Math.floor(i/1e3).toString())),this._abbreviatedLikeCount=i}}))}getFeatureItem(t,i,e,a){const h=t.attributes[this._selectedLayer.objectIdField].toString();i=i??h;const l=Number(t.attributes[this.reportingOptions?.[this._selectedLayer.id].likeField]).toLocaleString(),n="small"!==this.textSize||this.showFullTitle?"small"===this.textSize?"feature-list-popup-title-small":"feature-list-popup-title":"feature-list-popup-title-small-ellipsis",o=this._calciteList.offsetWidth-(this.showUserImageInList?115:65);return s("calcite-list-item",{onCalciteListItemSelect:i=>{this.featureClicked(i,t)},onMouseLeave:()=>{this.clearHighlights()},onMouseOver:()=>{this.onFeatureHover(t)},value:h},this.showUserImageInList&&s("calcite-avatar",{class:"profile-img","full-name":a?.fullName,scale:"m",slot:"content-start",thumbnail:a?.userProfileUrl,userId:a?.id,username:a?.fullName?a.username:void 0}),this.showFeatureSymbol&&s("div",{class:"feature-symbol",ref:t=>t&&t.replaceChildren(e),slot:"content-start"}),s("div",{class:`popup-title ${n}`,slot:"content-start",style:{maxWidth:"large"===this.textSize?"none":`${o}px`}},i),this._likeFieldAvailable&&s("div",{class:"like-container",id:h.concat("like"),slot:"content-end"},s("span",null,this._abbreviatedLikeCount),s("calcite-icon",{icon:"thumbs-up",scale:"s"}),s("calcite-tooltip",{overlayPositioning:"fixed",placement:"top","reference-element":h.concat("like")},l)),s("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}async getUserInformation(t){let i=this._selectedLayer.editFieldsInfo?.creatorField;t.attributes.hasOwnProperty(i.toLowerCase())?i=i.toLowerCase():t.attributes.hasOwnProperty(i.toUpperCase())&&(i=i.toUpperCase());let e=`${this.esriConfig.portalUrl}/sharing/rest/community/users/${t.attributes[i]}?f=json&returnUserLicensedItems=true`;const s=this.mapView.map.portalItem.portal?.credential?.token;s&&(e+=`&token=${s}`);const a=await fetch(e),h=await a.json();let l=`${this.esriConfig.portalUrl}/sharing/rest/community/users/${h?.username??t.attributes[i]}/info/blob.png`;return h?.access&&s&&(l+=`?token=${s}`),h.userProfileUrl=l,h}async getFeatureSymbol(t){const i=document.createElement("div");return await this.symbolUtils.getDisplayedSymbol(t).then((async t=>{if(t&&await(this.symbolUtils?.renderPreviewHTML(t,{node:i})),i.children?.length){const t=i.children[0];if(t){const i=Number(t.getAttribute("height")),e=Number(t.getAttribute("width"));e>30?t.setAttribute("width","30"):e<19&&t.setAttribute("width","20"),t.setAttribute("viewBox",`0 0 ${e} ${i}`)}}})),i}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],selectedLayerId:["selectedLayerWatchHandler"],sortingInfo:["sortingInfoWatchHandler"],whereClause:["whereClauseHandler"]}}};c.style=":host{display:block}.width-full{width:100%}.pagination{display:flex;justify-content:center}.error-msg{padding:10px;width:calc(100% - 20px)}.feature-list-popup-title{font-weight:500;white-space:pre-line}.feature-list-popup-title-small{font-size:small;white-space:pre-line}.feature-list-popup-title-small-ellipsis{font-size:small;white-space:nowrap !important;text-overflow:ellipsis;overflow:hidden}.popup-title{padding:0 5px;word-break:break-word}.profile-img{padding:0 5px;min-width:32px}.like-container{display:flex;align-items:center;gap:5px;color:gray !important;font-style:italic}.feature-symbol{padding:0 3px;min-width:30px;display:flex;justify-content:center}.search{padding:10px;background-color:var(--calcite-color-foreground-1) !important;border-block-end:1px solid var(--calcite-color-border-3)}";export{c as feature_list}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as e,c as t,g as s,h as i,H as a}from"./p-1b0588d2.js";import{g as l}from"./p-ee2cbba0.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const o=class{constructor(s){e(this,s),this.editsComplete=t(this,"editsComplete",7),this.deleteDialogClose=t(this,"deleteDialogClose",7)}get el(){return s(this)}ids=[];layer;locale;open=!1;_isDeleting=!1;_translations;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}editsComplete;deleteDialogClose;async componentWillLoad(){await this._getTranslations()}render(){const e=1===this.ids.length?this._translations?.confirmSingle:this._translations?.confirmMultiple;return i(a,{key:"d672a7218bc19c762c89b519b5d12c8d0122f770"},i("calcite-dialog",{key:"c43ba38dd9477869ae9797f98e3daafce09c5eae",heading:this._translations?.deleteFeature,kind:"danger",modal:!0,onCalciteDialogClose:()=>this._close(),open:this.open,widthScale:"s"},i("div",{key:"481710981431c3bb10b8ec221604f0740f3f8772"},e),i("calcite-button",{key:"8f1fc8a1a66fbd25edbb8d7f99f223b5bfea0517",appearance:"outline",kind:"danger",onClick:()=>this._close(),slot:"footer-end",width:"full"},this._translations?.cancel),i("calcite-button",{key:"46830e28586f1d345de2b19a2d8198f36ae74f15",kind:"danger",loading:this._isDeleting,onClick:()=>{this._deleteFeatures()},slot:"footer-end",width:"full"},this._translations?.delete)))}async _deleteFeatures(){this._isDeleting=!0;const e=this.ids.map((e=>({objectId:e})));await this.layer.applyEdits({deleteFeatures:e}),this._isDeleting=!1,this._close(),this.editsComplete.emit("delete")}_close(){this.open=!1,this.deleteDialogClose.emit()}async _getTranslations(){const e=await l(this.el);this._translations=e[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};o.style=":host{display:block}.delete-modal{position:fixed}";export{o as delete_dialog}