@esri/solutions-components 0.8.39 → 0.8.40

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) hide show
  1. package/dist/assets/t9n/solution-spatial-ref/resources.json +3 -3
  2. package/dist/assets/t9n/solution-spatial-ref/resources_en.json +2 -2
  3. package/dist/assets/t9n/solution-spatial-ref/resources_fr.json +2 -2
  4. package/dist/assets/t9n/solution-spatial-ref/resources_he.json +2 -2
  5. package/dist/cjs/_commonjsHelpers-baf43783.js +20 -0
  6. package/dist/cjs/basemap-gallery_7.cjs.entry.js +3 -2
  7. package/dist/cjs/buffer-tools_3.cjs.entry.js +3 -2
  8. package/dist/cjs/calcite-action-pad_2.cjs.entry.js +3 -2
  9. package/dist/cjs/calcite-alert_4.cjs.entry.js +7 -6
  10. package/dist/cjs/calcite-block_5.cjs.entry.js +5 -4
  11. package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
  12. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +3 -2
  13. package/dist/cjs/calcite-flow_6.cjs.entry.js +3 -2
  14. package/dist/cjs/calcite-pagination.cjs.entry.js +1 -1
  15. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +9 -8
  16. package/dist/cjs/card-manager_3.cjs.entry.js +6 -5
  17. package/dist/cjs/{common-03600219.js → common-7ee7ad73.js} +1 -1
  18. package/dist/cjs/consent-manager.cjs.entry.js +3 -2
  19. package/dist/cjs/{core-b459e4f2.js → core-7f0bcc12.js} +1 -1
  20. package/dist/cjs/crowdsource-manager.cjs.entry.js +3 -2
  21. package/dist/cjs/crowdsource-reporter.cjs.entry.js +3 -2
  22. package/dist/cjs/{downloadUtils-839a1425.js → downloadUtils-2e169425.js} +7 -7
  23. package/dist/cjs/{esri-loader-fce6a9cb.js → esri-loader-a56cbcbe.js} +2 -13
  24. package/dist/cjs/feature-list.cjs.entry.js +7 -6
  25. package/dist/cjs/{helpers-7cee3150.js → helpers-95c28cf3.js} +1 -1
  26. package/dist/cjs/{html2canvas-ef5cae40.js → html2canvas-29c6b9cc.js} +2 -2
  27. package/dist/cjs/{index.es-dd4d4842.js → index.es-301b8d18.js} +11 -10
  28. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +6 -5
  29. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +3 -2
  30. package/dist/cjs/instant-apps-create.cjs.entry.js +5 -4
  31. package/dist/cjs/instant-apps-export.cjs.entry.js +5 -4
  32. package/dist/cjs/instant-apps-header.cjs.entry.js +3 -2
  33. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +5 -4
  34. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +4 -3
  35. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +4 -3
  36. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +4 -3
  37. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +6 -5
  38. package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +5 -4
  39. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +7 -6
  40. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +7 -6
  41. package/dist/cjs/instant-apps-measurement.cjs.entry.js +5 -4
  42. package/dist/cjs/instant-apps-popover.cjs.entry.js +5 -4
  43. package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +5 -4
  44. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +5 -4
  45. package/dist/cjs/instant-apps-splash.cjs.entry.js +5 -4
  46. package/dist/cjs/{languageSwitcher-1154d55d.js → languageSwitcher-f0bb94fa.js} +1 -1
  47. package/dist/cjs/{languageUtil-d23251cd.js → languageUtil-f22ce913.js} +1 -1
  48. package/dist/cjs/layout-manager.cjs.entry.js +3 -2
  49. package/dist/cjs/{loadModules-4189814e.js → loadModules-36d49819.js} +1 -1
  50. package/dist/cjs/loader.cjs.js +1 -1
  51. package/dist/cjs/{locale-62f4cef2.js → locale-708985a1.js} +2 -2
  52. package/dist/cjs/{locale-6973733d.js → locale-f6fd03d2.js} +1 -1
  53. package/dist/cjs/map-select-tools_3.cjs.entry.js +6 -5
  54. package/dist/cjs/{popupUtils-bae7f923.js → popupUtils-36e57a27.js} +2 -2
  55. package/dist/cjs/public-notification.cjs.entry.js +6 -5
  56. package/dist/cjs/{purify-4a0e9dfb.js → purify-17c0fc4a.js} +2 -2
  57. package/dist/cjs/{restHelpersGet-afc74285.js → restHelpersGet-be451f4a.js} +1 -1
  58. package/dist/cjs/solution-configuration.cjs.entry.js +10 -350
  59. package/dist/cjs/solution-contents_3.cjs.entry.js +58 -48
  60. package/dist/cjs/solution-resource-a09a6fe0.js +145 -0
  61. package/dist/cjs/{solution-store-c8bada29.js → solution-store-d9f3ea44.js} +8 -10
  62. package/dist/cjs/solutions-components.cjs.js +1 -1
  63. package/dist/cjs/spatial-ref.cjs.entry.js +6 -5
  64. package/dist/cjs/store-manager.cjs.entry.js +17 -13
  65. package/dist/cjs/templates-f7a3bf48.js +401 -0
  66. package/dist/cjs/{utils-1de4eaa0.js → utils-31a22d49.js} +1 -1
  67. package/dist/collection/components/solution-item/solution-item.js +1 -1
  68. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.css +11 -1
  69. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +83 -47
  70. package/dist/collection/components/solution-spatial-ref/test/solution-spatial-ref.spec.js +25 -24
  71. package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
  72. package/dist/collection/components/solution-variables/solution-variables.js +1 -1
  73. package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
  74. package/dist/collection/components/store-manager/store-manager.js +11 -13
  75. package/dist/collection/demos/data/election-outreach.json +2981 -0
  76. package/dist/collection/demos/solution-item.html +7 -6
  77. package/dist/collection/demos/solution-spatial-ref.html +10 -4
  78. package/dist/collection/demos/solution-template-data.html +5 -5
  79. package/dist/collection/utils/interfaces.ts +0 -2
  80. package/dist/collection/utils/solution-store.js +6 -8
  81. package/dist/collection/utils/solution-store.ts +12 -13
  82. package/dist/collection/utils/templates.js +113 -26
  83. package/dist/collection/utils/templates.ts +125 -30
  84. package/dist/collection/utils/test/templates.e2e.js +2 -2
  85. package/dist/collection/utils/test/templates.e2e.ts +2 -2
  86. package/dist/components/_commonjsHelpers.js +16 -0
  87. package/dist/components/core.js +1 -1
  88. package/dist/components/downloadUtils.js +1 -1
  89. package/dist/components/esri-loader.js +2 -10
  90. package/dist/components/html2canvas.js +1 -1
  91. package/dist/components/index.es.js +1 -1
  92. package/dist/components/instant-apps-interactive-legend-classic2.js +1 -1
  93. package/dist/components/pagination.js +1 -1
  94. package/dist/components/purify.js +1 -1
  95. package/dist/components/solution-configuration.js +1 -342
  96. package/dist/components/solution-item2.js +1 -1
  97. package/dist/components/solution-resource.js +1 -1
  98. package/dist/components/solution-spatial-ref2.js +52 -44
  99. package/dist/components/solution-store.js +6 -8
  100. package/dist/components/solution-template-data2.js +1 -1
  101. package/dist/components/solution-variables2.js +1 -1
  102. package/dist/components/spatial-ref2.js +1 -1
  103. package/dist/components/store-manager.js +11 -13
  104. package/dist/components/templates.js +395 -0
  105. package/dist/esm/_commonjsHelpers-089957fe.js +16 -0
  106. package/dist/esm/basemap-gallery_7.entry.js +3 -2
  107. package/dist/esm/buffer-tools_3.entry.js +3 -2
  108. package/dist/esm/calcite-action-pad_2.entry.js +3 -2
  109. package/dist/esm/calcite-alert_4.entry.js +7 -6
  110. package/dist/esm/calcite-block_5.entry.js +5 -4
  111. package/dist/esm/calcite-combobox_3.entry.js +1 -1
  112. package/dist/esm/calcite-dropdown-group_2.entry.js +3 -2
  113. package/dist/esm/calcite-flow_6.entry.js +3 -2
  114. package/dist/esm/calcite-pagination.entry.js +1 -1
  115. package/dist/esm/calcite-shell-panel_14.entry.js +9 -8
  116. package/dist/esm/card-manager_3.entry.js +6 -5
  117. package/dist/esm/{common-8697fccd.js → common-96e3ddb0.js} +1 -1
  118. package/dist/esm/consent-manager.entry.js +3 -2
  119. package/dist/esm/{core-4bd4a70f.js → core-6a3c13ac.js} +1 -1
  120. package/dist/esm/crowdsource-manager.entry.js +3 -2
  121. package/dist/esm/crowdsource-reporter.entry.js +3 -2
  122. package/dist/esm/{downloadUtils-97acca92.js → downloadUtils-5fbd8a40.js} +6 -6
  123. package/dist/esm/{esri-loader-3080dcc0.js → esri-loader-781d738a.js} +2 -10
  124. package/dist/esm/feature-list.entry.js +7 -6
  125. package/dist/esm/{helpers-7c88b974.js → helpers-3d53560f.js} +1 -1
  126. package/dist/esm/{html2canvas-fd387d87.js → html2canvas-6443b68e.js} +1 -1
  127. package/dist/esm/{index.es-ee5497bc.js → index.es-66571353.js} +6 -5
  128. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +6 -5
  129. package/dist/esm/instant-apps-control-panel.entry.js +3 -2
  130. package/dist/esm/instant-apps-create.entry.js +5 -4
  131. package/dist/esm/instant-apps-export.entry.js +5 -4
  132. package/dist/esm/instant-apps-header.entry.js +3 -2
  133. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +4 -3
  134. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +4 -3
  135. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +4 -3
  136. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +4 -3
  137. package/dist/esm/instant-apps-interactive-legend.entry.js +6 -5
  138. package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +5 -4
  139. package/dist/esm/instant-apps-language-switcher.entry.js +7 -6
  140. package/dist/esm/instant-apps-language-translator.entry.js +7 -6
  141. package/dist/esm/instant-apps-measurement.entry.js +5 -4
  142. package/dist/esm/instant-apps-popover.entry.js +5 -4
  143. package/dist/esm/instant-apps-scoreboard.entry.js +5 -4
  144. package/dist/esm/instant-apps-sign-in.entry.js +5 -4
  145. package/dist/esm/instant-apps-splash.entry.js +5 -4
  146. package/dist/esm/{languageSwitcher-0f693a04.js → languageSwitcher-b665499d.js} +1 -1
  147. package/dist/esm/{languageUtil-de206286.js → languageUtil-a3e6adf6.js} +1 -1
  148. package/dist/esm/layout-manager.entry.js +3 -2
  149. package/dist/esm/{loadModules-43119ac8.js → loadModules-9c062d08.js} +1 -1
  150. package/dist/esm/loader.js +1 -1
  151. package/dist/esm/{locale-42369411.js → locale-28d48640.js} +1 -1
  152. package/dist/esm/{locale-70630b7c.js → locale-b4e7d56f.js} +2 -2
  153. package/dist/esm/map-select-tools_3.entry.js +6 -5
  154. package/dist/esm/{popupUtils-98ad70f3.js → popupUtils-4a91aa2a.js} +2 -2
  155. package/dist/esm/public-notification.entry.js +6 -5
  156. package/dist/esm/{purify-caded4cd.js → purify-72515357.js} +1 -1
  157. package/dist/esm/{restHelpersGet-dab84057.js → restHelpersGet-5c822bcd.js} +1 -1
  158. package/dist/esm/solution-configuration.entry.js +7 -347
  159. package/dist/esm/solution-contents_3.entry.js +58 -48
  160. package/dist/esm/{solution-resource-a2fff3bf.js → solution-resource-3108caf7.js} +1 -1
  161. package/dist/esm/{solution-store-30a19a45.js → solution-store-1c36ce1d.js} +8 -10
  162. package/dist/esm/solutions-components.js +1 -1
  163. package/dist/esm/spatial-ref.entry.js +6 -5
  164. package/dist/esm/store-manager.entry.js +17 -13
  165. package/dist/esm/templates-824ea028.js +395 -0
  166. package/dist/esm/{utils-9bb48951.js → utils-5484fcbf.js} +1 -1
  167. package/dist/solutions-components/demos/data/election-outreach.json +2981 -0
  168. package/dist/solutions-components/demos/solution-item.html +7 -6
  169. package/dist/solutions-components/demos/solution-spatial-ref.html +10 -4
  170. package/dist/solutions-components/demos/solution-template-data.html +5 -5
  171. package/dist/solutions-components/{p-3eb49703.js → p-00291b93.js} +3 -3
  172. package/dist/solutions-components/p-0cd87dca.entry.js +6 -0
  173. package/dist/solutions-components/p-13404ad7.entry.js +6 -0
  174. package/dist/solutions-components/{p-bf27cd5f.js → p-1c3c83a5.js} +1 -1
  175. package/dist/solutions-components/p-1e6c6ec4.entry.js +6 -0
  176. package/dist/solutions-components/p-219f209e.entry.js +6 -0
  177. package/dist/solutions-components/{p-b1abf15c.entry.js → p-2467b476.entry.js} +3 -3
  178. package/dist/solutions-components/p-295f850a.entry.js +6 -0
  179. package/dist/solutions-components/p-2961c63c.entry.js +6 -0
  180. package/dist/solutions-components/{p-946ee345.js → p-2afdcdfc.js} +2 -2
  181. package/dist/solutions-components/p-2d6d44b5.entry.js +6 -0
  182. package/dist/solutions-components/p-36e199e0.entry.js +6 -0
  183. package/dist/solutions-components/{p-d27ab863.js → p-3d7cff5e.js} +1 -1
  184. package/dist/solutions-components/{p-b2f11718.entry.js → p-3e8562b5.entry.js} +1 -1
  185. package/dist/solutions-components/{p-49250010.js → p-427b4593.js} +1 -1
  186. package/dist/solutions-components/{p-f1ae51dc.js → p-44fea43a.js} +1 -1
  187. package/dist/solutions-components/{p-afd2b67b.entry.js → p-4b27da06.entry.js} +1 -1
  188. package/dist/solutions-components/{p-7fe77355.js → p-5cc6eb18.js} +1 -1
  189. package/dist/solutions-components/p-61f88049.entry.js +6 -0
  190. package/dist/solutions-components/{p-d029b513.js → p-65581d83.js} +1 -1
  191. package/dist/solutions-components/p-6a68306c.js +6 -0
  192. package/dist/solutions-components/p-6c7a990a.entry.js +6 -0
  193. package/dist/solutions-components/p-6e6e6d23.entry.js +6 -0
  194. package/dist/solutions-components/p-7696af8e.entry.js +6 -0
  195. package/dist/solutions-components/{p-7afca6b4.js → p-7d1af07b.js} +1 -1
  196. package/dist/solutions-components/{p-6c7e34c1.entry.js → p-881ead62.entry.js} +2 -2
  197. package/dist/solutions-components/p-90864588.entry.js +6 -0
  198. package/dist/solutions-components/{p-59f016a1.js → p-91142a26.js} +1 -1
  199. package/dist/solutions-components/p-932d6f29.entry.js +6 -0
  200. package/dist/solutions-components/{p-71c212e6.entry.js → p-969828ab.entry.js} +1 -1
  201. package/dist/solutions-components/p-986ee365.entry.js +6 -0
  202. package/dist/solutions-components/p-9e3b0220.entry.js +6 -0
  203. package/dist/solutions-components/{p-7996f123.js → p-a0300d31.js} +1 -1
  204. package/dist/solutions-components/p-a8d62b7d.entry.js +6 -0
  205. package/dist/solutions-components/p-ae50581b.entry.js +6 -0
  206. package/dist/solutions-components/{p-89f6ff72.js → p-af2c8aa9.js} +1 -1
  207. package/dist/solutions-components/p-b7123452.entry.js +6 -0
  208. package/dist/solutions-components/p-b92e9047.entry.js +6 -0
  209. package/dist/solutions-components/p-bb7463ed.entry.js +6 -0
  210. package/dist/solutions-components/p-bbc7dd5e.entry.js +6 -0
  211. package/dist/solutions-components/p-bd871071.entry.js +21 -0
  212. package/dist/solutions-components/p-c6fd40f9.entry.js +6 -0
  213. package/dist/solutions-components/{p-42ea2581.js → p-c742acd9.js} +1 -1
  214. package/dist/solutions-components/p-cb4842dd.entry.js +6 -0
  215. package/dist/solutions-components/{p-bd459df3.entry.js → p-ccd1e256.entry.js} +2 -2
  216. package/dist/solutions-components/p-ce4b6931.entry.js +6 -0
  217. package/dist/solutions-components/p-d2de2b2a.entry.js +6 -0
  218. package/dist/solutions-components/p-d300430b.entry.js +6 -0
  219. package/dist/solutions-components/p-d4056c1c.js +6 -0
  220. package/dist/solutions-components/p-d73b90ab.entry.js +6 -0
  221. package/dist/solutions-components/{p-4e92c1ba.entry.js → p-dae9d5b3.entry.js} +1 -1
  222. package/dist/solutions-components/p-df56c019.entry.js +6 -0
  223. package/dist/solutions-components/p-e80751f4.entry.js +6 -0
  224. package/dist/solutions-components/{p-132b1138.entry.js → p-e8ed3fa6.entry.js} +2 -2
  225. package/dist/solutions-components/{p-1d369231.js → p-eed41e1a.js} +1 -1
  226. package/dist/solutions-components/p-fdd93685.js +22 -0
  227. package/dist/solutions-components/{p-6acf6c8f.js → p-ff87b9de.js} +1 -1
  228. package/dist/solutions-components/{p-c9b22653.js → p-ffd41e25.js} +1 -1
  229. package/dist/solutions-components/solutions-components.esm.js +1 -1
  230. package/dist/solutions-components/utils/interfaces.ts +0 -2
  231. package/dist/solutions-components/utils/solution-store.ts +12 -13
  232. package/dist/solutions-components/utils/templates.ts +125 -30
  233. package/dist/solutions-components/utils/test/templates.e2e.ts +2 -2
  234. package/dist/solutions-components_commit.txt +8 -0
  235. package/dist/types/components/solution-spatial-ref/solution-spatial-ref.d.ts +21 -25
  236. package/dist/types/components/store-manager/store-manager.d.ts +3 -3
  237. package/dist/types/components.d.ts +10 -2
  238. package/dist/types/utils/templates.d.ts +35 -5
  239. package/package.json +5 -4
  240. package/dist/cjs/solution-resource-ffe3c333.js +0 -145
  241. package/dist/solutions-components/p-11b4cd1a.entry.js +0 -6
  242. package/dist/solutions-components/p-123fcb43.entry.js +0 -6
  243. package/dist/solutions-components/p-12b84e3b.entry.js +0 -36
  244. package/dist/solutions-components/p-1a8f7075.entry.js +0 -6
  245. package/dist/solutions-components/p-2a7111ad.entry.js +0 -6
  246. package/dist/solutions-components/p-36f5dee9.entry.js +0 -6
  247. package/dist/solutions-components/p-52bcd209.entry.js +0 -6
  248. package/dist/solutions-components/p-57961ae0.entry.js +0 -6
  249. package/dist/solutions-components/p-5b2d9899.entry.js +0 -6
  250. package/dist/solutions-components/p-5bd6a732.entry.js +0 -6
  251. package/dist/solutions-components/p-5fb4ddc2.entry.js +0 -6
  252. package/dist/solutions-components/p-622f33ee.entry.js +0 -6
  253. package/dist/solutions-components/p-652140aa.entry.js +0 -6
  254. package/dist/solutions-components/p-6d0404a6.entry.js +0 -6
  255. package/dist/solutions-components/p-789eb1c2.entry.js +0 -6
  256. package/dist/solutions-components/p-7a2f1801.entry.js +0 -6
  257. package/dist/solutions-components/p-7dcf6b16.entry.js +0 -6
  258. package/dist/solutions-components/p-8413a2ae.entry.js +0 -6
  259. package/dist/solutions-components/p-941e55f0.entry.js +0 -6
  260. package/dist/solutions-components/p-9b38e6a0.entry.js +0 -6
  261. package/dist/solutions-components/p-9c1fbf73.entry.js +0 -6
  262. package/dist/solutions-components/p-9d82f0e3.entry.js +0 -6
  263. package/dist/solutions-components/p-9fa1855f.entry.js +0 -6
  264. package/dist/solutions-components/p-a2390bee.entry.js +0 -6
  265. package/dist/solutions-components/p-a805c11f.entry.js +0 -6
  266. package/dist/solutions-components/p-af1c9389.entry.js +0 -6
  267. package/dist/solutions-components/p-b7d060b0.entry.js +0 -6
  268. package/dist/solutions-components/p-c4160bf7.js +0 -6
  269. package/dist/solutions-components/p-da75df88.entry.js +0 -6
  270. package/dist/solutions-components/p-e0277e0b.entry.js +0 -6
  271. package/dist/solutions-components/p-e11a4728.entry.js +0 -6
  272. package/dist/solutions-components/p-e89c05d6.entry.js +0 -6
  273. /package/dist/solutions-components/{p-8ad54f5c.js → p-e3196917.js} +0 -0
@@ -24,6 +24,9 @@
24
24
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
25
25
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
26
26
  <style>
27
+ .content {
28
+ padding: 20px;
29
+ }
27
30
  .full-height {
28
31
  height: 100%;
29
32
  }
@@ -37,12 +40,12 @@
37
40
  <h1>Demo Solution Item</h1>
38
41
  <main id="appContainer">
39
42
  <div id="sol-item" class="content full-height">
40
- <store-manager id="helper"></store-manager>
41
- <solution-item id="demo"></solution-item>
43
+ <store-manager id="helper"/>
44
+ <solution-item id="demo"/>
42
45
  </div>
43
46
  </main>
44
47
 
45
- <script src="./libs/require.js"></script>
48
+ <script src="./libs/require.js">/script>
46
49
  <script src="./libs/setLocale.js"></script>
47
50
  <script src="./monacoConfig.js"></script>
48
51
  <script>
@@ -53,9 +56,7 @@
53
56
  });
54
57
  require(['vs/editor/editor.main'],
55
58
  function () {
56
- // Initialize the configuration content
57
59
  const demo = document.getElementById("demo");
58
-
59
60
  const helper = document.getElementById("helper");
60
61
 
61
62
  // set the data
@@ -68,7 +69,7 @@
68
69
  ])
69
70
  .then(results => Promise.all(results.map(r => r.json())))
70
71
  .then(jsonResults => {
71
- helper.value = JSON.stringify(jsonResults[4].templates[0]);
72
+ helper.value = JSON.stringify(jsonResults[4]);
72
73
 
73
74
  const itemDetails = jsonResults[0].value;
74
75
  const value = jsonResults[1].value;
@@ -19,6 +19,7 @@
19
19
  | See the License for the specific language governing permissions and
20
20
  | limitations under the License.
21
21
  -->
22
+
22
23
  <link rel="stylesheet" type="text/css" href="https://js.arcgis.com/calcite-components/2.0.0/calcite.css" />
23
24
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
24
25
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
@@ -30,14 +31,16 @@
30
31
  height: calc(100% - 40px);
31
32
  }
32
33
  </style>
34
+
33
35
  <script type="module" src="https://js.arcgis.com/calcite-components/2.0.0/calcite.esm.js"></script>
34
36
  <script type="module" src="../solutions-components.esm.js"></script>
35
37
  </head>
38
+
36
39
  <body>
37
40
  <h1>Demo Solution Spatial Reference</h1>
38
41
  <main id="appContainer">
39
42
  <div class="content full-height">
40
- <store-manager id="helper"></store-manager>
43
+ <store-manager id="helper"/>
41
44
  <solution-spatial-ref id="demo"/>
42
45
  </div>
43
46
  </main>
@@ -45,13 +48,16 @@
45
48
  <script src="./libs/require.js"></script>
46
49
  <script src="./libs/setLocale.js"></script>
47
50
  <script>
48
- require([], // for loading i18n in setLocale
51
+ require([],
49
52
  function () {
53
+ const demo = document.getElementById("demo");
54
+ const helper = document.getElementById("helper");
55
+
56
+ // set the data
50
57
  fetch("./data/election-outreach.json").then(result => {
51
58
  result.json().then(data => {
52
59
  document.getElementById("appContainer").style.opacity = "1";
53
- const helper = document.getElementById("helper");
54
- helper.value = JSON.stringify(data.templates);
60
+ helper.value = JSON.stringify(data);
55
61
  });
56
62
  });
57
63
  });
@@ -24,6 +24,9 @@
24
24
  <link rel="stylesheet" href="https://webapps-cdn.esri.com/CDN/fonts/v1.4.1/fonts.css" />
25
25
  <link rel="stylesheet" href="../solutions-components.css" type="text/css">
26
26
  <style>
27
+ .content {
28
+ padding: 20px;
29
+ }
27
30
  .full-height {
28
31
  height: 100%;
29
32
  }
@@ -37,7 +40,7 @@
37
40
  <h1>Demo Solution Template Data</h1>
38
41
  <main id="appContainer">
39
42
  <div id="template-data" class="content full-height">
40
- <store-manager id="helper"></store-manager>
43
+ <store-manager id="helper"/>
41
44
  <solution-template-data id="demo" instanceId="data" itemid="2d2d176f5f3e43a985a31649e213aaf4"></solution-template-data>
42
45
  </div>
43
46
  </main>
@@ -53,9 +56,7 @@
53
56
  });
54
57
  require(["vs/editor/editor.main"],
55
58
  function () {
56
- // Initialize the content
57
59
  const demo = document.getElementById("demo");
58
-
59
60
  const helper = document.getElementById("helper");
60
61
 
61
62
  // set the data
@@ -67,8 +68,7 @@
67
68
  ])
68
69
  .then(results => Promise.all(results.map(r => r.json())))
69
70
  .then(jsonResults => {
70
- const template = JSON.stringify(jsonResults[3].templates[0]);
71
- helper.value = template;
71
+ helper.value = JSON.stringify(jsonResults[3]);
72
72
 
73
73
  demo.value = { value: jsonResults[0].value };
74
74
  demo.itemid = "2d2d176f5f3e43a985a31649e213aaf4";
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{g as t}from"./p-c4160bf7.js";import{a as n}from"./p-fa1ceaf9.js";import{l as i}from"./p-c9b22653.js";import{q as r}from"./p-996c1ac5.js";import"./p-d27ab863.js";import"./p-a230b270.js";import{_ as e,r as s,c as o,g as a}from"./p-7996f123.js";
6
+ import{g as t}from"./p-d4056c1c.js";import{a as n}from"./p-fa1ceaf9.js";import{l as i}from"./p-ffd41e25.js";import{q as r}from"./p-996c1ac5.js";import"./p-3d7cff5e.js";import"./p-a230b270.js";import{_ as e,r as s,c as o,g as a}from"./p-a0300d31.js";
7
7
  /* @preserve
8
8
  * arcgis-pdf-creator v0.0.1
9
9
  * Thu Apr 27 2023 17:20:32 GMT-0700 (Pacific Daylight Time)
@@ -149,7 +149,7 @@ function(){var t=function(t){var n,i,r,e,s,o,a,u,f,c;for(/[^\x00-\xFF]/.test(t),
149
149
  * Licensed under the MIT License.
150
150
  * http://opensource.org/licenses/mit-license
151
151
  */
152
- function(t){t.loadFile=function(t,n,i){return function(t,n,i){n=!1!==n,i="function"==typeof i?i:function(){};var r=void 0;try{r=function(t,n,i){var r=new XMLHttpRequest,e=0,s=function(t){var n=t.length,i=[],r=String.fromCharCode;for(e=0;e<n;e+=1)i.push(r(255&t.charCodeAt(e)));return i.join("")};if(r.open("GET",t,!n),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===n&&(r.onload=function(){i(200===r.status?s(this.responseText):void 0)}),r.send(null),n&&200===r.status)return s(r.responseText)}(t,n,i)}catch(t){}return r}(t,n,i)},t.loadImageFile=t.loadFile}(Et.API),function(t){function n(){return(X.html2canvas?Promise.resolve(X.html2canvas):import("./p-7afca6b4.js").then((function(t){return t.h}))).catch((function(t){return Promise.reject(new Error("Could not load html2canvas: "+t))})).then((function(t){return t.default?t.default:t}))}function i(){return(X.DOMPurify?Promise.resolve(X.DOMPurify):import("./p-6acf6c8f.js").then((function(t){return t.p}))).catch((function(t){return Promise.reject(new Error("Could not load dompurify: "+t))})).then((function(t){return t.default?t.default:t}))}var r=function(t){var n=h(t);return"undefined"===n?"undefined":"string"===n||t instanceof String?"string":"number"===n||t instanceof Number?"number":"function"===n||t instanceof Function?"function":t&&t.constructor===Array?"array":t&&1===t.nodeType?"element":"object"===n?"object":"unknown"},e=function(t,n){var i=document.createElement(t);for(var r in n.className&&(i.className=n.className),n.innerHTML&&n.dompurify&&(i.innerHTML=n.dompurify.sanitize(n.innerHTML)),n.style)i.style[r]=n.style[r];return i},s=function t(n){var i=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),r=t.convert(Promise.resolve(),i);return(r=r.setProgress(1,t,1,[t])).set(n)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(t,n){return t.__proto__=n||s.prototype,t},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(t,n){return this.then((function(){switch(n=n||function(t){switch(r(t)){case"string":return"string";case"element":return"canvas"===t.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(t)){case"string":return this.then(i).then((function(n){return this.set({src:e("div",{innerHTML:t,dompurify:n})})}));case"element":return this.set({src:t});case"canvas":return this.set({canvas:t});case"img":return this.set({img:t});default:return this.error("Unknown source type.")}}))},s.prototype.to=function(t){switch(t){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var t={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},n=function t(n,i){for(var r=3===n.nodeType?document.createTextNode(n.nodeValue):n.cloneNode(!1),e=n.firstChild;e;e=e.nextSibling)!0!==i&&1===e.nodeType&&"SCRIPT"===e.nodeName||r.appendChild(t(e,i));return 1===n.nodeType&&("CANVAS"===n.nodeName?(r.width=n.width,r.height=n.height,r.getContext("2d").drawImage(n,0,0)):"TEXTAREA"!==n.nodeName&&"SELECT"!==n.nodeName||(r.value=n.value),r.addEventListener("load",(function(){r.scrollTop=n.scrollTop,r.scrollLeft=n.scrollLeft}),!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===n.tagName&&(t.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=e("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=e("div",{className:"html2pdf__container",style:t}),this.prop.container.appendChild(n),this.prop.container.firstChild.appendChild(e("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"}))},s.prototype.toCanvas=function(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(n).then((function(t){var n=Object.assign({},this.opt.html2canvas);return delete n.onrendered,t(this.prop.container,n)})).then((function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)}))},s.prototype.toContext2d=function(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(n).then((function(t){var n=this.opt.jsPDF,i=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,e=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete e.onrendered,n.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,n.context2d.posX=this.opt.x,n.context2d.posY=this.opt.y,n.context2d.margin=this.opt.margin,n.context2d.fontFaces=i,i)for(var s=0;s<i.length;++s){var o=i[s],a=o.src.find((function(t){return"truetype"===t.format}));a&&n.addFont(a.url,o.ref.name,o.ref.style)}return e.windowHeight=e.windowHeight||0,e.windowHeight=0==e.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):e.windowHeight,n.context2d.save(!0),t(this.prop.container,e)})).then((function(t){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)}))},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then((function(){var t=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=t}))},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then((function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF}))},s.prototype.output=function(t,n,i){return"img"===(i=i||"pdf").toLowerCase()||"image"===i.toLowerCase()?this.outputImg(t,n):this.outputPdf(t,n)},s.prototype.outputPdf=function(t,n){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){return this.prop.pdf.output(t,n)}))},s.prototype.outputImg=function(t){return this.thenList([function(){return this.prop.img||this.toImg()}]).then((function(){switch(t){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+t+'" is not supported.'}}))},s.prototype.save=function(t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(t?{filename:t}:null).then((function(){this.prop.pdf.save(this.opt.filename)}))},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){this.prop.callback(this.prop.pdf)}))},s.prototype.set=function(t){if("object"!==r(t))return this;var n=Object.keys(t||{}).map((function(n){if(n in s.template.prop)return function(){this.prop[n]=t[n]};switch(n){case"margin":return this.setMargin.bind(this,t.margin);case"jsPDF":return function(){return this.opt.jsPDF=t.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,t.pageSize);default:return function(){this.opt[n]=t[n]}}}),this);return this.then((function(){return this.thenList(n)}))},s.prototype.get=function(t,n){return this.then((function(){var i=t in s.template.prop?this.prop[t]:this.opt[t];return n?n(i):i}))},s.prototype.setMargin=function(t){return this.then((function(){switch(r(t)){case"number":t=[t,t,t,t];case"array":if(2===t.length&&(t=[t[0],t[1],t[0],t[1]]),4===t.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=t})).then(this.setPageSize)},s.prototype.setPageSize=function(t){function n(t,n){return Math.floor(t*n/72*96)}return this.then((function(){(t=t||Et.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(t.inner={width:t.width-this.opt.margin[1]-this.opt.margin[3],height:t.height-this.opt.margin[0]-this.opt.margin[2]},t.inner.px={width:n(t.inner.width,t.k),height:n(t.inner.height,t.k)},t.inner.ratio=t.inner.height/t.inner.width),this.prop.pageSize=t}))},s.prototype.setProgress=function(t,n,i,r){return null!=t&&(this.progress.val=t),null!=n&&(this.progress.state=n),null!=i&&(this.progress.n=i),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(t,n,i,r){return this.setProgress(t?this.progress.val+t:null,n||null,i?this.progress.n+i:null,r?this.progress.stack.concat(r):null)},s.prototype.then=function(t,n){var i=this;return this.thenCore(t,n,(function(t,n){return i.updateProgress(null,null,1,[t]),Promise.prototype.then.call(this,(function(n){return i.updateProgress(null,t),n})).then(t,n).then((function(t){return i.updateProgress(1),t}))}))},s.prototype.thenCore=function(t,n,i){i=i||Promise.prototype.then,t&&(t=t.bind(this)),n&&(n=n.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:s.convert(Object.assign({},this),Promise.prototype),e=i.call(r,t,n);return s.convert(e,this.__proto__)},s.prototype.thenExternal=function(t,n){return Promise.prototype.then.call(this,t,n)},s.prototype.thenList=function(t){var n=this;return t.forEach((function(t){n=n.thenCore(t)})),n},s.prototype.catch=function(t){t&&(t=t.bind(this));var n=Promise.prototype.catch.call(this,t);return s.convert(n,this)},s.prototype.catchExternal=function(t){return Promise.prototype.catch.call(this,t)},s.prototype.error=function(t){return this.then((function(){throw new Error(t)}))},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,Et.getPageSize=function(t,n,i){if("object"===h(t)){var r=t;t=r.orientation,n=r.unit||n,i=r.format||i}n=n||"mm",i=i||"a4",t=(""+(t||"P")).toLowerCase();var e,s=(""+i).toLowerCase(),o={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(n){case"pt":e=1;break;case"mm":e=72/25.4;break;case"cm":e=72/2.54;break;case"in":e=72;break;case"px":e=.75;break;case"pc":case"em":e=12;break;case"ex":e=6;break;default:throw"Invalid unit: "+n}var a,u=0,f=0;if(o.hasOwnProperty(s))u=o[s][1]/e,f=o[s][0]/e;else try{u=i[1],f=i[0]}catch(t){throw new Error("Invalid format: "+i)}if("p"===t||"portrait"===t)t="p",f>u&&(a=f,f=u,u=a);else{if("l"!==t&&"landscape"!==t)throw"Invalid orientation: "+t;t="l",u>f&&(a=f,f=u,u=a)}return{width:f,height:u,unit:n,k:e,orientation:t}},t.html=function(t,n){(n=n||{}).callback=n.callback||function(){},n.html2canvas=n.html2canvas||{},n.html2canvas.canvas=n.html2canvas.canvas||this.canvas,n.jsPDF=n.jsPDF||this,n.fontFaces=n.fontFaces?n.fontFaces.map(Sn):null;var i=new s(n);return n.worker?i:i.from(t).doCallback()}}(Et.API),Et.API.addJS=function(t){return Bn=t,this.internal.events.subscribe("postPutResources",(function(){In=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(In+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Fn=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Bn+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==In&&void 0!==Fn&&this.internal.out("/Names <</JavaScript "+In+" 0 R>>")})),this
152
+ function(t){t.loadFile=function(t,n,i){return function(t,n,i){n=!1!==n,i="function"==typeof i?i:function(){};var r=void 0;try{r=function(t,n,i){var r=new XMLHttpRequest,e=0,s=function(t){var n=t.length,i=[],r=String.fromCharCode;for(e=0;e<n;e+=1)i.push(r(255&t.charCodeAt(e)));return i.join("")};if(r.open("GET",t,!n),r.overrideMimeType("text/plain; charset=x-user-defined"),!1===n&&(r.onload=function(){i(200===r.status?s(this.responseText):void 0)}),r.send(null),n&&200===r.status)return s(r.responseText)}(t,n,i)}catch(t){}return r}(t,n,i)},t.loadImageFile=t.loadFile}(Et.API),function(t){function n(){return(X.html2canvas?Promise.resolve(X.html2canvas):import("./p-7d1af07b.js").then((function(t){return t.h}))).catch((function(t){return Promise.reject(new Error("Could not load html2canvas: "+t))})).then((function(t){return t.default?t.default:t}))}function i(){return(X.DOMPurify?Promise.resolve(X.DOMPurify):import("./p-ff87b9de.js").then((function(t){return t.p}))).catch((function(t){return Promise.reject(new Error("Could not load dompurify: "+t))})).then((function(t){return t.default?t.default:t}))}var r=function(t){var n=h(t);return"undefined"===n?"undefined":"string"===n||t instanceof String?"string":"number"===n||t instanceof Number?"number":"function"===n||t instanceof Function?"function":t&&t.constructor===Array?"array":t&&1===t.nodeType?"element":"object"===n?"object":"unknown"},e=function(t,n){var i=document.createElement(t);for(var r in n.className&&(i.className=n.className),n.innerHTML&&n.dompurify&&(i.innerHTML=n.dompurify.sanitize(n.innerHTML)),n.style)i.style[r]=n.style[r];return i},s=function t(n){var i=Object.assign(t.convert(Promise.resolve()),JSON.parse(JSON.stringify(t.template))),r=t.convert(Promise.resolve(),i);return(r=r.setProgress(1,t,1,[t])).set(n)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(t,n){return t.__proto__=n||s.prototype,t},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(t,n){return this.then((function(){switch(n=n||function(t){switch(r(t)){case"string":return"string";case"element":return"canvas"===t.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(t)){case"string":return this.then(i).then((function(n){return this.set({src:e("div",{innerHTML:t,dompurify:n})})}));case"element":return this.set({src:t});case"canvas":return this.set({canvas:t});case"img":return this.set({img:t});default:return this.error("Unknown source type.")}}))},s.prototype.to=function(t){switch(t){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var t={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},n=function t(n,i){for(var r=3===n.nodeType?document.createTextNode(n.nodeValue):n.cloneNode(!1),e=n.firstChild;e;e=e.nextSibling)!0!==i&&1===e.nodeType&&"SCRIPT"===e.nodeName||r.appendChild(t(e,i));return 1===n.nodeType&&("CANVAS"===n.nodeName?(r.width=n.width,r.height=n.height,r.getContext("2d").drawImage(n,0,0)):"TEXTAREA"!==n.nodeName&&"SELECT"!==n.nodeName||(r.value=n.value),r.addEventListener("load",(function(){r.scrollTop=n.scrollTop,r.scrollLeft=n.scrollLeft}),!0)),r}(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===n.tagName&&(t.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=e("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=e("div",{className:"html2pdf__container",style:t}),this.prop.container.appendChild(n),this.prop.container.firstChild.appendChild(e("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"}))},s.prototype.toCanvas=function(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(n).then((function(t){var n=Object.assign({},this.opt.html2canvas);return delete n.onrendered,t(this.prop.container,n)})).then((function(t){(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)}))},s.prototype.toContext2d=function(){return this.thenList([function(){return document.body.contains(this.prop.container)||this.toContainer()}]).then(n).then((function(t){var n=this.opt.jsPDF,i=this.opt.fontFaces,r="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,e=Object.assign({async:!0,allowTaint:!0,scale:r,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete e.onrendered,n.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,n.context2d.posX=this.opt.x,n.context2d.posY=this.opt.y,n.context2d.margin=this.opt.margin,n.context2d.fontFaces=i,i)for(var s=0;s<i.length;++s){var o=i[s],a=o.src.find((function(t){return"truetype"===t.format}));a&&n.addFont(a.url,o.ref.name,o.ref.style)}return e.windowHeight=e.windowHeight||0,e.windowHeight=0==e.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):e.windowHeight,n.context2d.save(!0),t(this.prop.container,e)})).then((function(t){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(t),this.prop.canvas=t,document.body.removeChild(this.prop.overlay)}))},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then((function(){var t=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=t}))},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then((function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF}))},s.prototype.output=function(t,n,i){return"img"===(i=i||"pdf").toLowerCase()||"image"===i.toLowerCase()?this.outputImg(t,n):this.outputPdf(t,n)},s.prototype.outputPdf=function(t,n){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){return this.prop.pdf.output(t,n)}))},s.prototype.outputImg=function(t){return this.thenList([function(){return this.prop.img||this.toImg()}]).then((function(){switch(t){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+t+'" is not supported.'}}))},s.prototype.save=function(t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(t?{filename:t}:null).then((function(){this.prop.pdf.save(this.opt.filename)}))},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){this.prop.callback(this.prop.pdf)}))},s.prototype.set=function(t){if("object"!==r(t))return this;var n=Object.keys(t||{}).map((function(n){if(n in s.template.prop)return function(){this.prop[n]=t[n]};switch(n){case"margin":return this.setMargin.bind(this,t.margin);case"jsPDF":return function(){return this.opt.jsPDF=t.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,t.pageSize);default:return function(){this.opt[n]=t[n]}}}),this);return this.then((function(){return this.thenList(n)}))},s.prototype.get=function(t,n){return this.then((function(){var i=t in s.template.prop?this.prop[t]:this.opt[t];return n?n(i):i}))},s.prototype.setMargin=function(t){return this.then((function(){switch(r(t)){case"number":t=[t,t,t,t];case"array":if(2===t.length&&(t=[t[0],t[1],t[0],t[1]]),4===t.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=t})).then(this.setPageSize)},s.prototype.setPageSize=function(t){function n(t,n){return Math.floor(t*n/72*96)}return this.then((function(){(t=t||Et.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(t.inner={width:t.width-this.opt.margin[1]-this.opt.margin[3],height:t.height-this.opt.margin[0]-this.opt.margin[2]},t.inner.px={width:n(t.inner.width,t.k),height:n(t.inner.height,t.k)},t.inner.ratio=t.inner.height/t.inner.width),this.prop.pageSize=t}))},s.prototype.setProgress=function(t,n,i,r){return null!=t&&(this.progress.val=t),null!=n&&(this.progress.state=n),null!=i&&(this.progress.n=i),null!=r&&(this.progress.stack=r),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(t,n,i,r){return this.setProgress(t?this.progress.val+t:null,n||null,i?this.progress.n+i:null,r?this.progress.stack.concat(r):null)},s.prototype.then=function(t,n){var i=this;return this.thenCore(t,n,(function(t,n){return i.updateProgress(null,null,1,[t]),Promise.prototype.then.call(this,(function(n){return i.updateProgress(null,t),n})).then(t,n).then((function(t){return i.updateProgress(1),t}))}))},s.prototype.thenCore=function(t,n,i){i=i||Promise.prototype.then,t&&(t=t.bind(this)),n&&(n=n.bind(this));var r=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?this:s.convert(Object.assign({},this),Promise.prototype),e=i.call(r,t,n);return s.convert(e,this.__proto__)},s.prototype.thenExternal=function(t,n){return Promise.prototype.then.call(this,t,n)},s.prototype.thenList=function(t){var n=this;return t.forEach((function(t){n=n.thenCore(t)})),n},s.prototype.catch=function(t){t&&(t=t.bind(this));var n=Promise.prototype.catch.call(this,t);return s.convert(n,this)},s.prototype.catchExternal=function(t){return Promise.prototype.catch.call(this,t)},s.prototype.error=function(t){return this.then((function(){throw new Error(t)}))},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,Et.getPageSize=function(t,n,i){if("object"===h(t)){var r=t;t=r.orientation,n=r.unit||n,i=r.format||i}n=n||"mm",i=i||"a4",t=(""+(t||"P")).toLowerCase();var e,s=(""+i).toLowerCase(),o={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(n){case"pt":e=1;break;case"mm":e=72/25.4;break;case"cm":e=72/2.54;break;case"in":e=72;break;case"px":e=.75;break;case"pc":case"em":e=12;break;case"ex":e=6;break;default:throw"Invalid unit: "+n}var a,u=0,f=0;if(o.hasOwnProperty(s))u=o[s][1]/e,f=o[s][0]/e;else try{u=i[1],f=i[0]}catch(t){throw new Error("Invalid format: "+i)}if("p"===t||"portrait"===t)t="p",f>u&&(a=f,f=u,u=a);else{if("l"!==t&&"landscape"!==t)throw"Invalid orientation: "+t;t="l",u>f&&(a=f,f=u,u=a)}return{width:f,height:u,unit:n,k:e,orientation:t}},t.html=function(t,n){(n=n||{}).callback=n.callback||function(){},n.html2canvas=n.html2canvas||{},n.html2canvas.canvas=n.html2canvas.canvas||this.canvas,n.jsPDF=n.jsPDF||this,n.fontFaces=n.fontFaces?n.fontFaces.map(Sn):null;var i=new s(n);return n.worker?i:i.from(t).doCallback()}}(Et.API),Et.API.addJS=function(t){return Bn=t,this.internal.events.subscribe("postPutResources",(function(){In=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(In+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),Fn=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Bn+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==In&&void 0!==Fn&&this.internal.out("/Names <</JavaScript "+In+" 0 R>>")})),this
153
153
  /**
154
154
  * @license
155
155
  * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
@@ -310,7 +310,7 @@ function(t){var n=function(t){for(var n=t.length,i=new Uint8Array(n),r=0;r<n;r++
310
310
  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
311
311
  * ====================================================================
312
312
  */
313
- function(){function t(){return(X.canvg?Promise.resolve(X.canvg):import("./p-59f016a1.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}Et.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw Q.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw Q.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=e,f.height=s;var c=f.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,f.width,f.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(c,n,h)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(h)})).then((function(){l.addImage(f.toDataURL("image/jpeg",1),i,r,e,s,a,u)}))}}(),Et.API.putTotalPages=function(t){var n,i=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(t,"g"),i=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),i=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var e=0;e<this.internal.pages[r].length;e++)this.internal.pages[r][e]=this.internal.pages[r][e].replace(n,i);return this},Et.API.viewerPreferences=function(t,n){var i;t=t||{},n=n||!1;var r,e,s,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),u=[],f=0,c=0,l=0;function v(t,n){var i,r=!1;for(i=0;i<t.length;i+=1)t[i]===n&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),i=this.internal.viewerpreferences.configuration,"reset"===t||!0===n){var d=a.length;for(l=0;l<d;l+=1)i[a[l]].value=i[a[l]].defaultValue,i[a[l]].explicitSet=!1}if("object"===h(t))for(e in t)if(s=t[e],v(a,e)&&void 0!==s){if("boolean"===i[e].type&&"boolean"==typeof s)i[e].value=s;else if("name"===i[e].type&&v(i[e].valueSet,s))i[e].value=s;else if("integer"===i[e].type&&Number.isInteger(s))i[e].value=s;else if("array"===i[e].type){for(f=0;f<s.length;f+=1)if(r=!0,1===s[f].length&&"number"==typeof s[f][0])u.push(String(s[f]-1));else if(s[f].length>1){for(c=0;c<s[f].length;c+=1)"number"!=typeof s[f][c]&&(r=!1);!0===r&&u.push([s[f][0]-1,s[f][1]-1].join(" "))}i[e].value="["+u.join(" ")+"]"}else i[e].value=i[e].defaultValue;i[e].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in i)!0===i[t].explicitSet&&n.push("name"===i[t].type?"/"+t+" /"+i[t].value:"/"+t+" "+i[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=i,this
313
+ function(){function t(){return(X.canvg?Promise.resolve(X.canvg):import("./p-91142a26.js")).catch((function(t){return Promise.reject(new Error("Could not load canvg: "+t))})).then((function(t){return t.default?t.default:t}))}Et.API.addSvgAsImage=function(n,i,r,e,s,o,a,u){if(isNaN(i)||isNaN(r))throw Q.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(e)||isNaN(s))throw Q.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var f=document.createElement("canvas");f.width=e,f.height=s;var c=f.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,f.width,f.height);var h={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return t().then((function(t){return t.fromString(c,n,h)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(t){return t.render(h)})).then((function(){l.addImage(f.toDataURL("image/jpeg",1),i,r,e,s,a,u)}))}}(),Et.API.putTotalPages=function(t){var n,i=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(n=new RegExp(t,"g"),i=this.internal.getNumberOfPages()):(n=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),i=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var e=0;e<this.internal.pages[r].length;e++)this.internal.pages[r][e]=this.internal.pages[r][e].replace(n,i);return this},Et.API.viewerPreferences=function(t,n){var i;t=t||{},n=n||!1;var r,e,s,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(o),u=[],f=0,c=0,l=0;function v(t,n){var i,r=!1;for(i=0;i<t.length;i+=1)t[i]===n&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),i=this.internal.viewerpreferences.configuration,"reset"===t||!0===n){var d=a.length;for(l=0;l<d;l+=1)i[a[l]].value=i[a[l]].defaultValue,i[a[l]].explicitSet=!1}if("object"===h(t))for(e in t)if(s=t[e],v(a,e)&&void 0!==s){if("boolean"===i[e].type&&"boolean"==typeof s)i[e].value=s;else if("name"===i[e].type&&v(i[e].valueSet,s))i[e].value=s;else if("integer"===i[e].type&&Number.isInteger(s))i[e].value=s;else if("array"===i[e].type){for(f=0;f<s.length;f+=1)if(r=!0,1===s[f].length&&"number"==typeof s[f][0])u.push(String(s[f]-1));else if(s[f].length>1){for(c=0;c<s[f].length;c+=1)"number"!=typeof s[f][c]&&(r=!1);!0===r&&u.push([s[f][0]-1,s[f][1]-1].join(" "))}i[e].value="["+u.join(" ")+"]"}else i[e].value=i[e].defaultValue;i[e].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var t,n=[];for(t in i)!0===i[t].explicitSet&&n.push("name"===i[t].type?"/"+t+" /"+i[t].value:"/"+t+" "+i[t].value);0!==n.length&&this.internal.write("/ViewerPreferences\n<<\n"+n.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=i,this
314
314
  /** ====================================================================
315
315
  * @license
316
316
  * jsPDF XMP metadata plugin
@@ -0,0 +1,6 @@
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,h as i,H as a,g as s}from"./p-fa1ceaf9.js";import{s as l}from"./p-2afdcdfc.js";import{g as c}from"./p-ffd41e25.js";import{n}from"./p-eed41e1a.js";import"./p-8c6d9b5a.js";import"./p-c1cf3ebc.js";import"./p-3d7cff5e.js";import"./p-d4056c1c.js";import"./p-a230b270.js";import"./p-a0300d31.js";import"./p-6a68306c.js";const r=class{constructor(i){t(this,i),this.solutionItemSelected=e(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}valueWatchHandler(t,e){t&&t!==e&&Array.isArray(t)&&t.length>0&&this._treeItemSelected(t[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return i(a,{key:"7546d1fe9d944520db9f8f81600fb7cf0655f1ab"},i("calcite-tree",{key:"94bea7616cd3bdbb9fbcaddd49bb394e11bcf88b"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(t){return t.map((t=>{const e=this.selectedItemId&&this.selectedItemId===t.id;return t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this.renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title))}))}_treeItemSelected(t,e){var i;const a=null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.closest("calcite-tree-item");a&&(a.expanded=!(null==a?void 0:a.expanded)),this.selectedItemId=t,this.solutionItemSelected.emit(t)}static get assetsDirs(){return["item-type-icons"]}get el(){return s(this)}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};r.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const o=class{constructor(e){t(this,e),this.authentication=void 0,this.itemId="",this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}itemIdWatchHandler(){const t=l.getItemInfo(this.itemId);this.itemType=t.type}async componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"16de446a44799754d7066eb5cc587585fc9e37c8"},i("div",{key:"ddb7c1e6c86657502dc4b293d495f3b4dee594cf",class:"configuration-container"},i("div",{key:"016954a98a5eb229a1f9eb2a4b9260daff3593bf",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.groupDetailsTab),i("calcite-tab-title",null,this._translations.sharingTab)),i("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"share-tab"},i("solution-item-sharing",{"group-id":this.itemId})))}_showItemTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.itemDetailsTab),i("calcite-tab-title",null,this._translations.dataTab),i("calcite-tab-title",null,this._translations.propertiesTab),i("calcite-tab-title",null,this._translations.resourcesTab)),i("calcite-tab",{class:"config-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"data-tab"},i("solution-template-data",{instanceid:"data","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"props-tab"},i("solution-template-data",{instanceid:"properties","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"resources-tab"},i("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId})))}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};o.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 d=class{constructor(i){t(this,i),this.featureServiceSpatialReferenceChange=e(this,"featureServiceSpatialReferenceChange",7),this.lockedSpatialReferenceChange=e(this,"lockedSpatialReferenceChange",7),this.defaultWkid=102100,this.loaded=!1,this.locked=!0,this.services=[],this.value=this.defaultWkid.toString(),this._translations=void 0}lockedChanged(t){t||this._setFeatureServiceDefaults(this.services),this.lockedSpatialReferenceChange.emit({locked:t})}componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"8c5f34b7d44429ed0395ae48956161caf7e62111"},i("label",{key:"69f1178da58409888f0b5b15ae4ffd224bb999d4",class:"switch-label"},i("calcite-switch",{key:"279795c5e21b914c595ea95219e3f589f7270ac4",checked:!this.locked,class:"spatial-ref-switch",onCalciteSwitchChange:t=>this._updateLocked(t),scale:"m"}),this._translations.specifyParam),i("div",{key:"516e621ad3e2f6f881b0fbc0a80d98f1f3b7eecd",class:"spatial-ref-component",id:"spatialRefDefn"},i("calcite-label",{key:"19b05ffa3e80d5e33521d0b6ee8438d882f9481d"},this._translations.spatialReferenceInfo,i("label",{key:"0766edb36aa3e8853bfd4754b9ea7aa955d7d987",class:"spatial-ref-default"},i("spatial-ref",{key:"9f1b37a12e18b5ba3c2d2b4b372f01a4f69ded28",defaultWkid:this.defaultWkid,disabled:this.locked,value:this.value}))),this._getFeatureServices(this.services)))}solutionStoreHasChanges(){this.services=l.getStoreInfo("featureServices").map((t=>t.name))}spatialReferenceChange(t){this.value=t.detail.newValue,l.setStoreInfo("defaultWkid",t.detail.newValue);const e=l.getStoreInfo("spatialReferenceInfo");e.spatialReference=t.detail.newValue,l.setStoreInfo("spatialReferenceInfo",e)}_getFeatureServices(t){const e=l.getStoreInfo("spatialReferenceInfo"),a=t.filter((t=>Object.keys(e.services).some((e=>e===t))));return a.length>0?i("div",null,i("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),i("ul",{class:"spatial-ref-services-list"},a.map((t=>i("li",{class:"spatial-ref-services-list-item"},i("label",{class:"switch-label"},i("calcite-switch",{checked:e.services[t],class:"spatial-ref-item-switch",disabled:this.locked,onCalciteSwitchChange:e=>this._updateEnabledServices(e,t),scale:"m"}),t)))))):null}_setFeatureServiceDefaults(t){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((t=>t.checked=!0)),t.forEach((t=>this._updateEnabledServices({detail:{switched:!0}},t)))}_updateEnabledServices(t,e){var i,a;const s=l.getStoreInfo("spatialReferenceInfo"),c=void 0!==(null===(i=t.detail)||void 0===i?void 0:i.switched)?t.detail.switched:void 0===(null===(a=t.target)||void 0===a?void 0:a.checked)||t.target.checked;s.services[e]=c,l.setStoreInfo("spatialReferenceInfo",s),this.featureServiceSpatialReferenceChange.emit({name:e,enabled:c})}_updateLocked(t){this.locked=!t.target.checked,this._updateStore(),this.loaded||(t.target.checked&&this._setFeatureServiceDefaults(this.services),this.loaded=!0)}_updateStore(){const t=l.getStoreInfo("spatialReferenceInfo");t.enabled=!this.locked,t.spatialReference=this.value,l.setStoreInfo("spatialReferenceInfo",t)}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{locked:["lockedChanged"]}}};d.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-default{margin:0px}.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}.disabled-div{pointer-events:none;opacity:0.4}.spatial-ref-desc{padding-bottom:0.5rem;padding-inline-start:0.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:0}.spatial-ref-services-list-item{margin-top:0.25rem}";export{r as solution_contents,o as solution_item,d as solution_spatial_ref}
@@ -0,0 +1,6 @@
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 i,c as t,h as e,H as s,g as o}from"./p-fa1ceaf9.js";import{g as h}from"./p-ffd41e25.js";import{E as l}from"./p-c1cf3ebc.js";import{g as a}from"./p-996c1ac5.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";const n=class{constructor(e){i(this,e),this.showIntroductionWindow=t(this,"showIntroductionWindow",7),this.showCoverPage=t(this,"showCoverPage",7),this._defaultCenterHonored=!1,this._defaultLevelHonored=!1,this._hideMapOnLoadHonored=!1,this._shouldSetMapView=!1,this.appProxies=void 0,this.basemapConfig=void 0,this.coverPageEnabled=void 0,this.defaultCenter="",this.defaultGlobalId="",this.defaultLayer="",this.defaultLevel="",this.defaultOid="",this.defaultWebmap="",this.introductionWindowEnabled=!1,this.enableAutoRefresh=!1,this.enableBasemap=!0,this.enableColumnReorder=!0,this.enableCSV=!0,this.enableFloorFilter=!0,this.enableFullscreen=!0,this.enableHome=!0,this.enableInlineEdit=!1,this.enableLegend=!0,this.enableSearch=!0,this.enableShare=!1,this.enableZoom=!0,this.hideMapOnLoad=!1,this.mapInfos=[],this.onlyShowUpdatableLayers=!0,this.popupHeaderColor=void 0,this.popupHeaderHoverColor=void 0,this.popupHeaderHoverTextColor=void 0,this.popupHeaderTextColor=void 0,this.searchConfiguration=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=!0,this.theme="light",this.zoomAndScrollToSelected=!1,this.zoomToScale=void 0,this._expandPopup=!1,this._hideFooter=!1,this._hideTable=!1,this._isMobile=!1,this._translations=void 0,this._layer=void 0,this._layoutMode=l.GRID,this._mapInfo=void 0,this._mapView=void 0,this._panelOpen=!0,this._numSelected=0,this._tableOnly=!1}enableZoomWatchHandler(){this._initMapZoom()}hideMapOnLoadWatchHandler(){this.showHideMapPopupAndTable(this.hideMapOnLoad&&!this._isMobile),this._expandPopup=this.hideMapOnLoad&&!this._isMobile}mapInfosWatchHandler(){console.log("mapInfosWatchHandler"),console.log(this.mapInfos)}async featureSelectionChange(i){var t;this._numSelected=null===(t=i.detail)||void 0===t?void 0:t.length}async popupClosed(){this._isMobile&&this.showHideMapPopupAndTable(!1)}async idsFound(i){const t=i.detail;this._tableOnly=t.tableIds.length>0&&0===t.layerIds.length,this._tableOnly&&(this._expandPopup=!0)}async layoutChanged(i){this._layoutMode=i.detail}async mapChanged(i){this._mapChange=i.detail,await this._mapChange.mapView.when((async()=>{await this._setMapView()}))}async beforeMapChanged(){this._expandPopup&&(this._shouldSetMapView=!0)}async layerSelectionChange(i){const t=i.detail[0],e=await a(this._mapView,t);await e.when((()=>{this._layer=e}))}async mapInfoChange(){this._expandPopup=this.hideMapOnLoad&&!this._isMobile,this._hideMapOnLoadHonored=!1}async componentWillLoad(){await this._getTranslations(),this._resizeObserver=new ResizeObserver((()=>this._onResize()))}render(){return e(s,{key:"09154a91e9c1ca9ee6fffcc9d15f6488d1572429"},e("calcite-shell",{key:"78268044775861d16a557d7e95678614c3be90c8",class:"position-relative"},e("calcite-panel",{key:"2efe00d79d9c939400bc13558e8ad89a06ae68ab",class:"width-full height-full "+(this.popupHeaderColor&&"#FFFFFF"!==this.popupHeaderColor?"border-width-0":"")},this._getBody(this._layoutMode,this._panelOpen,this._hideTable)),this._getFooter()))}async componentDidRender(){this._shouldSetMapView&&(this._shouldSetMapView=!1,this._mapChange&&await this._setMapView())}async componentDidLoad(){this._resizeObserver.observe(this.el)}_getFooter(){var i,t,s,o;const h=(null===(i=this._layer)||void 0===i?void 0:i.editingEnabled)&&(null===(o=null===(s=null===(t=this._layer)||void 0===t?void 0:t.capabilities)||void 0===s?void 0:s.operations)||void 0===o?void 0:o.supportsDelete);return this._isMobile&&this._numSelected>0&&!this._hideFooter?e("div",{class:"width-100",slot:"footer"},e("div",{class:"display-flex padding-1-2"},e("calcite-button",{appearance:"solid",id:"solutions-show",onClick:()=>this.showHideMapPopupAndTable(!0),width:"full"},this._translations.view.replace("{{n}}",this._numSelected.toString())),h?e("delete-button",{class:"padding-inline-start-1 width-full",id:"solutions-delete",ids:this._layerTable.selectedIds,layer:this._layer}):void 0)):void 0}_getDividerIcon(i,t){let e="";switch(i){case l.HORIZONTAL:e=t?"chevrons-up":"chevrons-down";break;case l.VERTICAL:case l.GRID:e=t?"chevrons-left":"chevrons-right"}return e}_getMapSizeClass(i,t,e){let s="";switch(i){case l.HORIZONTAL:s=(t&&!e?"height-1-2 display-grid":t&&e?"height-full":"height-0")+" width-full position-relative";break;case l.GRID:s="height-full position-relative "+(t?"width-1-3":"width-0");break;case l.VERTICAL:s="height-full position-relative "+(t?"width-1-2":"width-0")}return s}_getTableSizeClass(i,t){let e="";switch(i){case l.HORIZONTAL:e=(t?"height-1-2":"height-full")+" width-full display-flex flex-column";break;case l.GRID:e=(t?"width-2-3":"width-full")+" height-full display-flex";break;case l.VERTICAL:e=(t?"width-1-2":"width-full")+" height-full display-flex"}return e}_getBody(i,t,s){const o="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light";return e("calcite-panel",{class:"width-full height-full"},e("div",{class:"width-full height-full overflow-hidden "+(i===l.HORIZONTAL?"":"display-flex")},this._getMapAndCard(i,t,s),this._getTable(i,t,s)),this.coverPageEnabled&&e("div",{class:"floating-container",onClick:this.coverPageButtonClick.bind(this)},e("calcite-button",{appearance:"solid",class:`floating-button ${o}`,"icon-start":"content-minimal",kind:"neutral",label:"",round:!0,scale:"l","split-child":"primary",width:"auto"})),this.introductionWindowEnabled&&e("div",{class:"floating-container",onClick:this.infoButtonClick.bind(this)},e("calcite-button",{appearance:"solid",class:`floating-button ${o}`,"icon-start":"information-letter",kind:"neutral",label:"",round:!0,scale:"l","split-child":"primary",width:"auto"})))}infoButtonClick(){this.showIntroductionWindow.emit()}coverPageButtonClick(){this.showCoverPage.emit()}_getMapAndCard(i,t,s){const o=this._getMapSizeClass(i,t,s);return e("div",{class:`${o} overflow-hidden`},this._getMapNode(t),this._getPopupExpandNode())}_getMapNode(i){var t;return e("div",{class:(this._layoutMode!==l.HORIZONTAL||this._isMobile&&!i?"adjusted-height-50":"")+" overflow-hidden"},e("map-card",{appProxies:this.appProxies,basemapConfig:this.basemapConfig,class:"width-full",defaultWebmapId:this.defaultWebmap,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:!0,hidden:this._expandPopup&&!this._isMobile,homeZoomIndex:3,homeZoomPosition:"top-left",homeZoomToolsSize:"s",mapInfos:null===(t=this.mapInfos)||void 0===t?void 0:t.filter((i=>!1!==i.visible)),mapWidgetsIndex:0,mapWidgetsPosition:"top-right",mapWidgetsSize:"m",stackTools:!0,theme:this.theme,toolOrder:["legend","search","fullscreen","basemap","floorfilter"]}))}_getPopupExpandNode(){var i;const t=this._expandPopup?"chevrons-down":"chevrons-up",s="expand-popup",o=this._expandPopup?this._translations.collapsePopup:this._translations.expandPopup,h="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",l=this._expandPopup?1===(null===(i=this.mapInfos)||void 0===i?void 0:i.length)||this._isMobile?"position-absolute-0":"position-absolute-50":"height-full",a=this._isMobile?"display-none height-0":"";return e("div",{class:`${this.popupHeaderColor?"":this._isMobile?"calcite-mode-light":"calcite-mode-dark"} ${l} ${this._isMobile&&this._hideTable?"position-absolute-0 width-full height-full":this._isMobile?"display-none height-0":""}`,style:{"--calcite-color-foreground-1":this.popupHeaderColor,"--calcite-color-foreground-2":this.popupHeaderHoverColor,"--calcite-color-text-3":this.popupHeaderTextColor,"--calcite-color-text-2":this.popupHeaderTextColor}},e("calcite-panel",null,this._isMobile?void 0:e("div",{class:`display-flex align-items-center ${a}`,slot:"header-content"},e("calcite-icon",{icon:"information",scale:"s"}),e("div",{class:"padding-inline-start-75"},this._translations.information)),e("calcite-action",{class:a,disabled:this._tableOnly,icon:t,id:s,onClick:()=>this._togglePopup(),slot:"header-actions-end",text:""}),this._tableOnly?void 0:e("calcite-tooltip",{class:h,label:"",placement:"bottom","reference-element":s},e("span",null,o)),this._getCardNode()))}_togglePopup(){this._expandPopup=!this._expandPopup,this._hideMapOnLoadHonored=!0}_getCardNode(){return e("div",{class:"width-50 height-full "+("dark"===this.theme?"calcite-mode-dark":"calcite-mode-light")},e("card-manager",{class:(this._expandPopup||this._isMobile?"height-full":"height-50")+" width-full",isMobile:this._isMobile,mapView:null==this?void 0:this._mapView,zoomAndScrollToSelected:this.zoomAndScrollToSelected}))}_getTable(i,t,s){var o,h;const a=s&&this._isMobile?"visibility-hidden":"",n=this._getTableSizeClass(i,t),d=this._getDividerIcon(i,t),r=t?this._translations.close:this._translations.open,c="toggle-layout",p=i===l.HORIZONTAL?"horizontal":"vertical",g=i===l.HORIZONTAL?"header":"panel-start",u=this.defaultWebmap&&this.defaultLayer,f=this.defaultGlobalId?(null===(o=this.defaultGlobalId)||void 0===o?void 0:o.indexOf(","))>-1?this.defaultGlobalId.split(","):[this.defaultGlobalId]:void 0,m=this.defaultOid?(null===(h=this.defaultOid)||void 0===h?void 0:h.indexOf(","))>-1?this.defaultOid.split(",").map((i=>parseInt(i,10))):[parseInt(this.defaultOid,10)]:void 0;return e("calcite-shell",{class:`${n} ${a} border-bottom`},this._isMobile?void 0:e("calcite-action-bar",{class:"border-sides",expandDisabled:!0,layout:p,slot:g},e("calcite-action",{class:"toggle-node",icon:d,id:c,onClick:()=>this._toggleLayout(),text:""}),e("calcite-tooltip",{label:r,placement:"bottom","reference-element":c},e("span",null,r))),e("div",{class:"width-full height-full position-relative"},e("layer-table",{defaultGlobalId:u?f:void 0,defaultLayerId:u?this.defaultLayer:"",defaultOid:u&&!f?m:void 0,enableAutoRefresh:this.enableAutoRefresh,enableCSV:this.enableCSV,enableColumnReorder:this.enableColumnReorder,enableInlineEdit:this.enableInlineEdit,enableShare:this.enableShare,isMobile:this._isMobile,mapHidden:this._expandPopup,mapInfo:this._mapInfo,mapView:null==this?void 0:this._mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,ref:i=>this._layerTable=i,shareIncludeEmbed:this.shareIncludeEmbed,shareIncludeSocial:this.shareIncludeSocial,showNewestFirst:this.showNewestFirst,zoomAndScrollToSelected:this.zoomAndScrollToSelected,zoomToScale:this.zoomToScale})))}_onResize(){const i=this.el.offsetWidth<1024,t=!this._isMobile&&i;this._isMobile=i,this._layoutMode=this._isMobile?l.HORIZONTAL:l.GRID,t&&(this._panelOpen=!0),(this.hideMapOnLoad&&!this._hideMapOnLoadHonored||this._isMobile)&&this.hideMapOnLoadWatchHandler()}_toggleLayout(){this._panelOpen=!this._panelOpen}showHideMapPopupAndTable(i){this._expandPopup=!1,this._hideTable=i,this._hideFooter=i}_getMapInfo(i){let t;return this.mapInfos.some((e=>{if(e.id===i)return t=e,!0})),Object.assign({},t)}async _setMapView(){var i;this._mapInfo=this._getMapInfo(this._mapChange.id),this._mapView=this._mapChange.mapView,this._initMapZoom(),this._mapView.popupEnabled=!1;const t=!this.defaultCenter||this._defaultCenterHonored||null===(i=this.defaultCenter)||void 0===i?void 0:i.split(";").map((i=>parseFloat(i))),e=!this.defaultLevel||this._defaultLevelHonored?void 0:parseInt(this.defaultLevel,10);t&&e&&(await this._mapView.goTo({center:t,zoom:e}),this._defaultCenterHonored=!0,this._defaultLevelHonored=!0)}_initMapZoom(){this.enableZoom?this.enableZoom&&this._mapView.ui.add({component:"zoom",position:"top-left",index:0}):this._mapView.ui.remove("zoom")}async _getTranslations(){const i=await h(this.el);this._translations=i[0]}get el(){return o(this)}static get watchers(){return{enableZoom:["enableZoomWatchHandler"],hideMapOnLoad:["hideMapOnLoadWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};n.style=":host{display:block;--calcite-label-margin-bottom:0px;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.padding-1-2{padding:0.5rem}.display-flex{display:flex}.width-full{width:100%}.width-1-2{position:relative;width:50%}.width-1-3{position:relative;width:33.33%}.width-2-3{position:relative;width:66.66%}.width-0{width:0}.height-full{height:100%}.height-1-2{position:relative;height:50%}.height-0{height:0}.toggle-node{width:51px;height:51px}.overflow-hidden{overflow:hidden}.flex-column{flex-direction:column}.border{border:1px solid var(--calcite-color-border-3)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.border-sides{border-left:1px solid var(--calcite-color-border-3);border-right:1px solid var(--calcite-color-border-3)}.position-relative{position:relative}.height-50{height:50%}.adjusted-height-50{height:calc(50% - 25px)}.adjusted-height-100{height:calc(100% - 50px)}.adjusted-height-100-50{height:calc(100% - 50px)}.display-none{display:none}.height-53{height:53px}.position-absolute-53{position:absolute;top:53px}.display-grid{display:grid}.height-50-px{height:50px}.padding-inline-start-75{padding-inline-start:0.75rem}.align-items-center{align-items:center}.esri-floor-filter__close-levels-button{width:40px !important;height:40px !important}.esri-floor-filter__level-button{width:40px !important;height:40px !important}.esri-floor-filter__browse-button{width:40px !important;height:40px !important}.position-absolute-50{position:absolute;top:50px;bottom:0px;left:0px;right:0px}.position-absolute-0{position:absolute;top:0px;bottom:0px;left:0px;right:0px}.visibility-hidden{visibility:hidden;height:0px}.position-fixed{position:fixed}.border-width-0{border-width:0px}.border-bottom-width-0{border-bottom-width:0px}.floating-container{position:fixed;width:100px;height:10px;bottom:0;right:0;margin:100px 0px}.floating-container .floating-button{box-shadow:0 10px 25px rgb(92 93 94 / 60%);transform:translatey(5px);transition:all 0.3s}";export{n as crowdsource_manager}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{l}from"./p-d029b513.js";import{c as n}from"./p-8c6d9b5a.js";async function o(n,o,i){const[u]=await l(["esri/layers/effects/jsonUtils"]),{toJSON:v,fromJSON:d}=u,t=null==o?void 0:o.layer;if(!n)return(null==t?void 0:t.effect)?t.effect:(null==t?void 0:t.featureEffect)?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:null;const e=v(n);let r;r=t.featureEffect?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:t.effect;const a=r?v(r):null;if(!a)return d(e);let s=[...a];return e&&e.forEach((l=>{s.forEach((n=>{const{value:o}=n;if(o)o.forEach(((i,u)=>{i.type===l.type?o[u]=l:!n.value.find((l=>l.type===e[0].type))&&(n.value=[...n.value,...e])}));else{const o=!s.find((l=>l.type===n.type));!s.find((n=>n.type===l.type))&&(s=[...s,l]),o&&(s=[...s,n])}}))})),d(s)}const i=n({data:{},relationshipRampExpandStates:{}}),u=i.state,v=i;async function d(l,n,o){var i,u,v,d,t,e,r,a,s;try{const c="group"===(null===(i=null==n?void 0:n.layer)||void 0===i?void 0:i.type),f=null===(v=null===(u=null==n?void 0:n.layer)||void 0===u?void 0:u.layers)||void 0===v?void 0:v.some((l=>l.visible)),$=null===(t=null===(d=null==n?void 0:n.layer)||void 0===d?void 0:d.layers)||void 0===t?void 0:t.every((l=>!(null==l?void 0:l.legendEnabled)));await o.whenOnce((()=>"ready"===(null==l?void 0:l.state))),!c||c&&f?c&&$?await o.whenOnce((()=>{var l;return null===(l=null==n?void 0:n.layer)||void 0===l?void 0:l.loaded})):await o.whenOnce((()=>null==n?void 0:n.ready)):await o.whenOnce((()=>null==n?void 0:n.legendElements));const y=null===(e=null==n?void 0:n.legendElements)||void 0===e?void 0:e[0],m=new Map,p=n.layer,N=await l.view.whenLayerView(p);await o.whenOnce((()=>!1===(null==N?void 0:N.updating)));const O=null===(r=p.renderer)||void 0===r?void 0:r.field;return void 0!==y&&(null===(a=null==y?void 0:y.infos)||void 0===a||a.forEach((l=>{var n;if("symbol-table"===l.type){const n=[];l.infos.forEach((l=>{n.push({count:null,selected:!1,legendElementInfo:l})})),m.set(l.title,{count:null,selected:!1,legendElementInfo:l,nestedInfos:n})}else m.set(null!==(n=l.label)&&void 0!==n?n:p.id,{count:null,selected:!1,legendElementInfo:l})}))),Promise.resolve({activeLayerInfo:n,title:null===(s=null==N?void 0:N.layer)||void 0===s?void 0:s.title,categories:m,field:O,queryExpressions:[],totalCount:null,fLayerView:N,legendElement:y})}catch(l){return Promise.resolve(null)}}async function t(l,n){const o={},i=[];l.activeLayerInfos.forEach(function(l,n,o){return i=>{var u;const v=null===(u=null==i?void 0:i.layer)||void 0===u?void 0:u.type;if("feature"===v||"group"===v){const u=d(n,i,o).then((l=>l));u&&l.push(u);const v=i=>{const u=d(n,i,o).then((l=>l));u&&l.push(u)};i.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{v(l)}))}))}))}}}(i,l,n));try{return(await Promise.all(i)).forEach((l=>{var n,i;return o[null===(i=null===(n=null==l?void 0:l.activeLayerInfo)||void 0===n?void 0:n.layer)||void 0===i?void 0:i.id]=l})),Promise.resolve(o)}catch(l){return Promise.reject(null)}}function e(l){return Array.from(l).map((l=>l[1]))}function r(l,n,o,i,u){var v,d,t;return i?null===(v=null==i?void 0:i.nestedInfos)||void 0===v?void 0:v[u]:null===(d=null==l?void 0:l.categories)||void 0===d?void 0:d.get(null!==(t=null==o?void 0:o.label)&&void 0!==t?t:null==n?void 0:n.id)}function a(l){var n;return null===(n=null==u?void 0:u.data)||void 0===n?void 0:n[null==l?void 0:l.id]}async function s(n,i,u,v,d){var t,e;const[r,a]=await l(["esri/layers/support/FeatureFilter","esri/layers/support/FeatureEffect"]),{queryExpressions:s,fLayerView:$}=n;!function(l,n,o,i){var u,v,d,t;const{field:e,legendElement:r,categories:a,fLayerView:s}=l,$=null==l?void 0:l.queryExpressions;i&&Array.from(l.categories).map((l=>l[1])).forEach((l=>{var n,o;(null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected)))&&(null===(o=l.nestedInfos)||void 0===o||o.forEach((l=>{const n=e?`${e} = '${l.legendElementInfo.value}'`:null,o=n?$.indexOf(n):-1;n&&-1!==o&&$.splice(o,1)})))}));const m=null==r?void 0:r.infos,p=y(s);let N=p?c(n,s):f(n,e,o,r,m,"");const O=a?i?null===(v=null===(u=a.get(i.title))||void 0===u?void 0:u.nestedInfos)||void 0===v?void 0:v[o]:a.get(null!==(d=n.label)&&void 0!==d?d:null===(t=null==s?void 0:s.layer)||void 0===t?void 0:t.id):null;O&&(O.selected=!(null==O?void 0:O.selected));const A=m&&1===m.length,w=$.indexOf(N);if(p){const l=$.indexOf(N);0===$.length||-1===l?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]?$[0]="1=0":$&&1===$.length||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]?$[0]=null:$.splice(l,1),$.join(" OR ")}else 0===$.length||-1===w?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]&&!A?$[0]="1=0":$&&1===$.length&&!A||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]&&!A?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]&&!A?$[0]=null:$.splice(w,1);if(i){const n=[];Array.from(l.categories).map((l=>l[1])).forEach((l=>{var o,i;(null===(o=l.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=l.nestedInfos)||void 0===i||i.forEach((l=>{e&&`${e} = '${l.legendElementInfo.value}'`&&n.push(`${e} = '${l.legendElementInfo.value}'`)})))})),n.forEach((l=>{-1===$.indexOf(l)&&$.push(l)}))}}(n,i,u,d);const m=s.every((l=>l&&l.includes("<>")))?" AND ":" OR ",p=s.join(m),N=null!==(e=null===(t=null==$?void 0:$.filter)||void 0===t?void 0:t.timeExtent)&&void 0!==e?e:null,{type:O}=v;if("filter"===O)$.filter=new r({where:p,timeExtent:N});else if(v.effect){const{includedEffect:l,excludedEffect:n}=v.effect,i=await o(n,$,"excludedEffect"),u=await o(l,$,"includedEffect");$.featureEffect=new a({filter:new r({where:p,timeExtent:N}),includedEffect:u,excludedEffect:i})}return Promise.resolve()}function c(l,n){const o=n?n.layer.renderer.authoringInfo:null,i=o?o.fields:null,u=[];if(!i)return"";if(l.hasOwnProperty("value"))return i.forEach((n=>{l.value!==n&&u.push(`(${l.value} > ${n} OR (${n} IS NULL AND ${l.value} <> 0 AND ${l.value} IS NOT NULL))`)})),u.join(" AND ");{const l=[];i.forEach((n=>{l.push(`${n} = 0`)}));const n=[];if(i.length>2){i.forEach((l=>{i.forEach((o=>{if(l===o)return;const u=[];i.forEach((n=>{l!==n&&o!==n&&u.push(`${l} = ${o} AND (${l} > ${n} OR ${l} >= ${n})`)})),n.push(`(${u.join(" AND ")})`)}))}));const o=[];return i.forEach((l=>{o.push(`${l} IS NULL`)})),`(${l.join(" AND ")}) OR (${n.join(" OR ")}) OR (${o.join(" AND ")})`}{const n=[];i.forEach((o=>{i.forEach((i=>{o!==i&&(n.push(`${o} = ${i}`),n.push(`(${l.join(" AND ")})`))}))}));const o=[];return i.forEach((l=>{i.forEach((n=>{l!==n&&o.push(`(${l} = 0 AND ${n} IS NULL) OR (${l} IS NULL AND ${n} IS NULL)`)}))})),`(${n.join(" OR ")}) OR (${o.join(" OR ")})`}}}function f(l,n,o,i,u,v){const{value:d}=l;if("symbol-table"===(null==i?void 0:i.type)){if(!l.hasOwnProperty("value")||Array.isArray(l.value)&&1===(null==u?void 0:u.length)){if((null==u?void 0:u[0].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[0].value)&&(null==u?void 0:u[(null==u?void 0:u.length)-2])&&(null==u?void 0:u[(null==u?void 0:u.length)-2].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[(null==u?void 0:u.length)-2].value))return v?`((${n}/${v}) > ${null==u?void 0:u[0].value[1]}) OR ((${n}/${v}) < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]}) OR ${v} = 0 OR ${v} IS NULL`:`${n} > ${null==u?void 0:u[0].value[1]} OR ${n} < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]} OR ${n} IS NULL`;if(1===(null==u?void 0:u.length))return"1=0";{const l=[];null==u||u.forEach((o=>{if(null==o?void 0:o.value){const{value:i}=o,u=-1!==i.indexOf("'")?i.split("'").join("''"):null,v=u?`${n} <> '${u}'`:isNaN(i)||"string"==typeof i&&!i.trim()?`${n} <> '${i}'`:`${n} <> ${i} AND ${n} <> '${i}'`;l.push(v)}}));const o=l.join(" AND ");return n&&o?`${o} OR ${n} IS NULL`:""}}{const i=-1!==d.indexOf("'")?d.split("'").join("''"):null,t=Array.isArray(l.value),e=(null==u?void 0:u.length)-1===o,r=!(null==u?void 0:u[(null==u?void 0:u.length)-1].hasOwnProperty("value")),a=o===(null==u?void 0:u.length)-2;return t?v?e||r&&a?`(${n}/${v}) >= ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:`(${n}/${v}) > ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:e||r&&a?`${n} >= ${d[0]} AND ${n} <= ${d[1]}`:`${n} > ${d[0]} AND ${n} <= ${d[1]}`:1===(null==u?void 0:u.length)&&n?isNaN(d)||!d.trim().length?`${n} <> '${d}'`:`${n} <> ${d} OR ${n} <> '${d}'`:i?`${n} = '${i}'`:isNaN(d)||!d.trim().length?`${n} = '${d}'`:`${n} = ${d} OR ${n} = '${d}'`}}return""}function $(l){return Array.isArray(l)?l.every((l=>!l.selected)):l&&Array.from(l.categories.entries()).every((l=>!l[1].selected))&&"1=0"!==l.queryExpressions[0]}function y(l){var n,o,i;return"predominance"===(null===(i=null===(o=null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.renderer)||void 0===o?void 0:o.authoringInfo)||void 0===i?void 0:i.type)}function m(l){var n;return"relationship-ramp"===(null===(n=null==l?void 0:l.legendElements[1])||void 0===n?void 0:n.type)}function p(l,n,o){var i,u,v,d,t,e,r,a,s,c,f,$,m,p,N,O,A,w,E;const b=l.layer,R=null===(i=null==b?void 0:b.renderer)||void 0===i?void 0:i.field,L=null==n?void 0:n.type,D=null==l?void 0:l.layerView,I=null===(v=null===(u=null==D?void 0:D.layer)||void 0===u?void 0:u.renderer)||void 0===v?void 0:v.classBreakInfos,x=(null===(t=null===(d=null==D?void 0:D.layer)||void 0===d?void 0:d.renderer)||void 0===t?void 0:t.uniqueValueInfos)&&R,g="size-ramp"===L,h="color-ramp"===L,P="opacity-ramp"===L,S="heatmap-ramp"===L,U=D&&I&&I.length>1,z=null===(a=null===(r=null===(e=null==D?void 0:D.layer)||void 0===e?void 0:e.renderer)||void 0===r?void 0:r.authoringInfo)||void 0===a?void 0:a.type,F="class-breaks-color"===z,k="class-breaks-size"===z,q=1===(null===(s=null==n?void 0:n.infos)||void 0===s?void 0:s.length)&&!R,V="relationship"===z&&"size-ramp"!==(null==n?void 0:n.type)&&"symbol-table"!==(null==n?void 0:n.type),C="feature"===(null===(c=null==l?void 0:l.layer)||void 0===c?void 0:c.type),J=C&&R&&!h&&!g&&U,T=!(!C||!R||h||g||U),M=!!(T||y(D)&&!g||F&&R||k&&R||q&&!R&&null!==R||V||x),B=(null===(f=null==l?void 0:l.layer)||void 0===f?void 0:f.featureReduction)&&"size-ramp"===(null===(m=null===($=null==l?void 0:l.legendElements)||void 0===$?void 0:$[o])||void 0===m?void 0:m.type),G="symbol-table"===(null==n?void 0:n.type)&&1===(null===(p=null==n?void 0:n.infos)||void 0===p?void 0:p.length),H=!(null==l?void 0:l.legendElements.every((l=>"color-ramp"!==l.type))),K=!(null==l?void 0:l.legendElements.every((l=>"size-ramp"!==l.type))),Q=G&&H,W=G&&K,X=null===(N=null==n?void 0:n.infos)||void 0===N?void 0:N.every((l=>"number"==typeof l.value)),Y="symbol-table"===(null===(A=null===(O=null==l?void 0:l.legendElements)||void 0===O?void 0:O[0])||void 0===A?void 0:A.type)&&"color-ramp"===(null===(E=null===(w=null==l?void 0:l.legendElements)||void 0===w?void 0:w[1])||void 0===E?void 0:E.type),Z="dot-density"===z,_=j(null==l?void 0:l.layer,R);return!(!C||B||P||S||Q||W||X||Y||Z||!_)&&(I?J||M:T||M)}function N(l){var n,o,i,u,v;return l.queryExpressions=[],(null===(o=null===(n=null==l?void 0:l.fLayerView)||void 0===n?void 0:n.filter)||void 0===o?void 0:o.where)&&(l.fLayerView.filter.where=""),(null===(v=null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.featureEffect)||void 0===u?void 0:u.filter)||void 0===v?void 0:v.where)&&(l.fLayerView.featureEffect=null),l.categories.forEach((l=>{l.selected=!1})),l}function O(l,n){var o,i,u,v,d,t,e,r,a,s,c;const f=l.categories.get(n);null===(o=null==f?void 0:f.nestedInfos)||void 0===o||o.forEach((n=>{const o=l.queryExpressions.indexOf(`${l.field} = '${n.legendElementInfo.value}'`);-1!==o&&l.queryExpressions.splice(o,1),n.selected=!1}));const $=[],y=Array.from(l.categories).map((l=>l[1]));y.forEach((n=>{var o,i;(null===(o=n.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=n.nestedInfos)||void 0===i||i.forEach((n=>{$.push(`${l.field} = '${n.legendElementInfo.value}'`)})))})),$.forEach((n=>{-1===l.queryExpressions.indexOf(n)&&l.queryExpressions.push(n)}));let m=l.queryExpressions.join(" OR ");const p=y.every((l=>{var n;return null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected))}));return p?((null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.filter)||void 0===u?void 0:u.where)&&(l.fLayerView.filter.where=""),(null===(t=null===(d=null===(v=null==l?void 0:l.fLayerView)||void 0===v?void 0:v.featureEffect)||void 0===d?void 0:d.filter)||void 0===t?void 0:t.where)&&(l.fLayerView.featureEffect=null),l.queryExpressions=[]):((null===(r=null===(e=null==l?void 0:l.fLayerView)||void 0===e?void 0:e.filter)||void 0===r?void 0:r.where)&&(l.fLayerView.filter.where=m),(null===(c=null===(s=null===(a=null==l?void 0:l.fLayerView)||void 0===a?void 0:a.featureEffect)||void 0===s?void 0:s.filter)||void 0===c?void 0:c.where)&&(l.fLayerView.featureEffect.filter.where=m)),l}async function A(l,n,o){var i,u;const v=l.fLayerView.createQuery();if(o)if(o.nestedInfos.every((l=>!l.selected))){const n=o.nestedInfos.map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=o.nestedInfos.filter((l=>l.selected)).map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=l.queryExpressions.join(" OR ");v.where=n}try{const{extent:o}=await(null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.layer)||void 0===u?void 0:u.queryExtent(v));await n.goTo(o)}catch(l){}}function w(l){return l.map((l=>null==l?void 0:l.count)).reduce(((l,n)=>l+n))}function E(l){return l.map((l=>{var n;return null===(n=null==l?void 0:l.nestedInfos)||void 0===n?void 0:n.map((l=>l.count)).reduce(((l,n)=>l+n))})).reduce(((l,n)=>l+n))}async function b(l,n,o,i,u,v,d,t){var e,r,a;if(!n)return;if(!j(null==n?void 0:n.layer,o))return;const s="feature"===(null===(e=null==n?void 0:n.layer)||void 0===e?void 0:e.type)?n.createQuery():null,$=y(n)?c(i,n):i.type?f(d,o,t,i,i.infos):f(i,o,u,v,v.infos);s&&$&&(s.where="1=0"===$?"1=1":$,s.geometry=l);try{const l=s?await n.queryFeatureCount(s):null;return Promise.resolve({[null!==(r=i.label)&&void 0!==r?r:null===(a=null==n?void 0:n.layer)||void 0===a?void 0:a.id]:l})}catch(l){console.error("FAILURE AT 'getInfoCount': ",l)}return Promise.resolve(null)}async function R(l,n){let o=Object.assign({},n);const{activeLayerInfos:i}=l;let u={};const v={};i.forEach((async o=>{var i,u,d,t;const e=o.legendElements[0],r=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,a=null===(d=o.layer.renderer)||void 0===d?void 0:d.field,s=[];v[o.layer.id]=[],null===(t=null==e?void 0:e.infos)||void 0===t||t.forEach(((n,i)=>{var u;const d=null===(u=e.infos)||void 0===u?void 0:u.every((l=>"symbol-table"===l.type));if(d){const u=[];n.infos.forEach(((o,v)=>{const d=b(l.view.extent,r,a,n,i,e,o,v);u.push(d)})),v[o.layer.id].push(u)}else s.push(b(l.view.extent,r,a,n,i,e)),v[o.layer.id]=s}));const c=o=>{var i,u,d,t;const e=[],r=o.legendElements[0],a=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,s=null===(d=o.layer.renderer)||void 0===d?void 0:d.field;null===(t=null==r?void 0:r.infos)||void 0===t||t.forEach(((n,o)=>e.push(b(l.view.extent,a,s,n,o,r)))),v[o.layer.id]=e};o.children.forEach((async l=>{var n;c(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;c(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{c(l)}))}))}))}));for(const l in v){let n=u[l];n||(n=u[l]={});const o=await Promise.all(v[l]);if(o.every((l=>Array.isArray(l)))){const i=await Promise.all(o.map((async l=>(await Promise.all(l)).map((l=>l&&Object.values(l)[0])))));n[l]=i,u[l]=Object.assign({},n[l])}else{const i={};o.forEach((l=>{if(!l)return;const n=Object.keys(l)[0];i[n]=l[n]})),l&&(n[l]=i),u[l]=Object.assign({},n[l])}}return i.forEach((l=>{var o;const i=n[l.layer.id],v=l.layer.id;null===(o=null==i?void 0:i.categories)||void 0===o||o.forEach(((n,o)=>{var d;const t=Array.from(null==i?void 0:i.categories).findIndex((l=>l[0]===o));if(null==n?void 0:n.nestedInfos)null==n||n.nestedInfos.forEach(((n,o)=>{var i,v,d;const e=null===(d=null===(v=null==u?void 0:u[null===(i=null==l?void 0:l.layer)||void 0===i?void 0:i.id])||void 0===v?void 0:v[t])||void 0===d?void 0:d[o];n.count=isNaN(e)?null:e}));else{const l=null===(d=null==u?void 0:u[v])||void 0===d?void 0:d[o];n.count=isNaN(l)?null:l}}));const d=l=>{var o;const i=l.layer.id,v=n[i];null===(o=null==v?void 0:v.categories)||void 0===o||o.forEach(((l,n)=>{var o;const v=null===(o=null==u?void 0:u[i])||void 0===o?void 0:o[n];l.count=v}))};l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{d(l)}))}))}))})),Promise.resolve(o)}function L(l,n){var o;return null===(o=null==l?void 0:l.nestedInfos)||void 0===o?void 0:o[n]}function D(l){return Array.from(l).map((l=>l[1])).every((l=>!!(null==l?void 0:l.nestedInfos)))}function I(l){var n,o,i,u;return!!(null===(u=null===(i=null===(o=null===(n=null==l?void 0:l.legendElements)||void 0===n?void 0:n[0])||void 0===o?void 0:o.infos)||void 0===i?void 0:i.every)||void 0===u?void 0:u.call(i,(l=>"symbol-table"===(null==l?void 0:l.type))))}function x(l,n){var o;return null===(o=null==l?void 0:l.categories)||void 0===o?void 0:o.get(null==n?void 0:n.title)}function g(l){const n="calcite-mode-",o=`${n}light`,i=`${n}dark`;return l.classList.contains(i)?i:o}function h(l){if(l.layerId&&l.intLegendLayerData){const n=l.layerId,o=l.intLegendLayerData,i=Object.assign(Object.assign({},u.data),{[n]:o});v.set("data",i)}}function P(n,i){const{type:u}=n;"filter"===u?function(l){var n,o;null===(o=null===(n=null==l?void 0:l.allLayerViews)||void 0===n?void 0:n.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})))||void 0===o||o.forEach((l=>{const n=S(l);l.filter=n,l.set("featureEffect",null)}))}(i):"effect"===u&&function(n,i){var u;null===(u=null==i?void 0:i.allLayerViews)||void 0===u||u.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})).forEach((async i=>{if((null==n?void 0:n.effect)&&i){const[u]=await l(["esri/layers/support/FeatureEffect"]),{includedEffect:v,excludedEffect:d}=n.effect,t=await o(d,i,"excludedEffect"),e=await o(v,i,"includedEffect"),r=S(i);i.featureEffect=new u({filter:r,includedEffect:e,excludedEffect:t}),i.set("filter",null)}}))}(n,i)}function S(l){var n;return(null==l?void 0:l.filter)||(null===(n=null==l?void 0:l.featureEffect)||void 0===n?void 0:n.filter)}function j(l,n){const o=null==l?void 0:l.fields,i=o&&o.map((l=>l.name));return!n||i&&i.includes(n)}function U(l){const n=[];return l.forEach((l=>z(l,n))),n}function z(l,n){n.push(l),l.children&&l.children.length>0&&l.children.forEach((l=>{z(l,n)}))}export{x as a,r as b,$ as c,R as d,t as e,U as f,g,P as h,u as i,d as j,s as k,a as l,I as m,m as n,O as o,N as p,o as q,e as r,v as s,D as t,h as u,p as v,E as w,w as x,L as y,A as z}
6
+ import{l}from"./p-65581d83.js";import{c as n}from"./p-8c6d9b5a.js";async function o(n,o,i){const[u]=await l(["esri/layers/effects/jsonUtils"]),{toJSON:v,fromJSON:d}=u,t=null==o?void 0:o.layer;if(!n)return(null==t?void 0:t.effect)?t.effect:(null==t?void 0:t.featureEffect)?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:null;const e=v(n);let r;r=t.featureEffect?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:t.effect;const a=r?v(r):null;if(!a)return d(e);let s=[...a];return e&&e.forEach((l=>{s.forEach((n=>{const{value:o}=n;if(o)o.forEach(((i,u)=>{i.type===l.type?o[u]=l:!n.value.find((l=>l.type===e[0].type))&&(n.value=[...n.value,...e])}));else{const o=!s.find((l=>l.type===n.type));!s.find((n=>n.type===l.type))&&(s=[...s,l]),o&&(s=[...s,n])}}))})),d(s)}const i=n({data:{},relationshipRampExpandStates:{}}),u=i.state,v=i;async function d(l,n,o){var i,u,v,d,t,e,r,a,s;try{const c="group"===(null===(i=null==n?void 0:n.layer)||void 0===i?void 0:i.type),f=null===(v=null===(u=null==n?void 0:n.layer)||void 0===u?void 0:u.layers)||void 0===v?void 0:v.some((l=>l.visible)),$=null===(t=null===(d=null==n?void 0:n.layer)||void 0===d?void 0:d.layers)||void 0===t?void 0:t.every((l=>!(null==l?void 0:l.legendEnabled)));await o.whenOnce((()=>"ready"===(null==l?void 0:l.state))),!c||c&&f?c&&$?await o.whenOnce((()=>{var l;return null===(l=null==n?void 0:n.layer)||void 0===l?void 0:l.loaded})):await o.whenOnce((()=>null==n?void 0:n.ready)):await o.whenOnce((()=>null==n?void 0:n.legendElements));const y=null===(e=null==n?void 0:n.legendElements)||void 0===e?void 0:e[0],m=new Map,p=n.layer,N=await l.view.whenLayerView(p);await o.whenOnce((()=>!1===(null==N?void 0:N.updating)));const O=null===(r=p.renderer)||void 0===r?void 0:r.field;return void 0!==y&&(null===(a=null==y?void 0:y.infos)||void 0===a||a.forEach((l=>{var n;if("symbol-table"===l.type){const n=[];l.infos.forEach((l=>{n.push({count:null,selected:!1,legendElementInfo:l})})),m.set(l.title,{count:null,selected:!1,legendElementInfo:l,nestedInfos:n})}else m.set(null!==(n=l.label)&&void 0!==n?n:p.id,{count:null,selected:!1,legendElementInfo:l})}))),Promise.resolve({activeLayerInfo:n,title:null===(s=null==N?void 0:N.layer)||void 0===s?void 0:s.title,categories:m,field:O,queryExpressions:[],totalCount:null,fLayerView:N,legendElement:y})}catch(l){return Promise.resolve(null)}}async function t(l,n){const o={},i=[];l.activeLayerInfos.forEach(function(l,n,o){return i=>{var u;const v=null===(u=null==i?void 0:i.layer)||void 0===u?void 0:u.type;if("feature"===v||"group"===v){const u=d(n,i,o).then((l=>l));u&&l.push(u);const v=i=>{const u=d(n,i,o).then((l=>l));u&&l.push(u)};i.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{v(l)}))}))}))}}}(i,l,n));try{return(await Promise.all(i)).forEach((l=>{var n,i;return o[null===(i=null===(n=null==l?void 0:l.activeLayerInfo)||void 0===n?void 0:n.layer)||void 0===i?void 0:i.id]=l})),Promise.resolve(o)}catch(l){return Promise.reject(null)}}function e(l){return Array.from(l).map((l=>l[1]))}function r(l,n,o,i,u){var v,d,t;return i?null===(v=null==i?void 0:i.nestedInfos)||void 0===v?void 0:v[u]:null===(d=null==l?void 0:l.categories)||void 0===d?void 0:d.get(null!==(t=null==o?void 0:o.label)&&void 0!==t?t:null==n?void 0:n.id)}function a(l){var n;return null===(n=null==u?void 0:u.data)||void 0===n?void 0:n[null==l?void 0:l.id]}async function s(n,i,u,v,d){var t,e;const[r,a]=await l(["esri/layers/support/FeatureFilter","esri/layers/support/FeatureEffect"]),{queryExpressions:s,fLayerView:$}=n;!function(l,n,o,i){var u,v,d,t;const{field:e,legendElement:r,categories:a,fLayerView:s}=l,$=null==l?void 0:l.queryExpressions;i&&Array.from(l.categories).map((l=>l[1])).forEach((l=>{var n,o;(null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected)))&&(null===(o=l.nestedInfos)||void 0===o||o.forEach((l=>{const n=e?`${e} = '${l.legendElementInfo.value}'`:null,o=n?$.indexOf(n):-1;n&&-1!==o&&$.splice(o,1)})))}));const m=null==r?void 0:r.infos,p=y(s);let N=p?c(n,s):f(n,e,o,r,m,"");const O=a?i?null===(v=null===(u=a.get(i.title))||void 0===u?void 0:u.nestedInfos)||void 0===v?void 0:v[o]:a.get(null!==(d=n.label)&&void 0!==d?d:null===(t=null==s?void 0:s.layer)||void 0===t?void 0:t.id):null;O&&(O.selected=!(null==O?void 0:O.selected));const A=m&&1===m.length,w=$.indexOf(N);if(p){const l=$.indexOf(N);0===$.length||-1===l?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]?$[0]="1=0":$&&1===$.length||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]?$[0]=null:$.splice(l,1),$.join(" OR ")}else 0===$.length||-1===w?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]&&!A?$[0]="1=0":$&&1===$.length&&!A||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]&&!A?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]&&!A?$[0]=null:$.splice(w,1);if(i){const n=[];Array.from(l.categories).map((l=>l[1])).forEach((l=>{var o,i;(null===(o=l.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=l.nestedInfos)||void 0===i||i.forEach((l=>{e&&`${e} = '${l.legendElementInfo.value}'`&&n.push(`${e} = '${l.legendElementInfo.value}'`)})))})),n.forEach((l=>{-1===$.indexOf(l)&&$.push(l)}))}}(n,i,u,d);const m=s.every((l=>l&&l.includes("<>")))?" AND ":" OR ",p=s.join(m),N=null!==(e=null===(t=null==$?void 0:$.filter)||void 0===t?void 0:t.timeExtent)&&void 0!==e?e:null,{type:O}=v;if("filter"===O)$.filter=new r({where:p,timeExtent:N});else if(v.effect){const{includedEffect:l,excludedEffect:n}=v.effect,i=await o(n,$,"excludedEffect"),u=await o(l,$,"includedEffect");$.featureEffect=new a({filter:new r({where:p,timeExtent:N}),includedEffect:u,excludedEffect:i})}return Promise.resolve()}function c(l,n){const o=n?n.layer.renderer.authoringInfo:null,i=o?o.fields:null,u=[];if(!i)return"";if(l.hasOwnProperty("value"))return i.forEach((n=>{l.value!==n&&u.push(`(${l.value} > ${n} OR (${n} IS NULL AND ${l.value} <> 0 AND ${l.value} IS NOT NULL))`)})),u.join(" AND ");{const l=[];i.forEach((n=>{l.push(`${n} = 0`)}));const n=[];if(i.length>2){i.forEach((l=>{i.forEach((o=>{if(l===o)return;const u=[];i.forEach((n=>{l!==n&&o!==n&&u.push(`${l} = ${o} AND (${l} > ${n} OR ${l} >= ${n})`)})),n.push(`(${u.join(" AND ")})`)}))}));const o=[];return i.forEach((l=>{o.push(`${l} IS NULL`)})),`(${l.join(" AND ")}) OR (${n.join(" OR ")}) OR (${o.join(" AND ")})`}{const n=[];i.forEach((o=>{i.forEach((i=>{o!==i&&(n.push(`${o} = ${i}`),n.push(`(${l.join(" AND ")})`))}))}));const o=[];return i.forEach((l=>{i.forEach((n=>{l!==n&&o.push(`(${l} = 0 AND ${n} IS NULL) OR (${l} IS NULL AND ${n} IS NULL)`)}))})),`(${n.join(" OR ")}) OR (${o.join(" OR ")})`}}}function f(l,n,o,i,u,v){const{value:d}=l;if("symbol-table"===(null==i?void 0:i.type)){if(!l.hasOwnProperty("value")||Array.isArray(l.value)&&1===(null==u?void 0:u.length)){if((null==u?void 0:u[0].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[0].value)&&(null==u?void 0:u[(null==u?void 0:u.length)-2])&&(null==u?void 0:u[(null==u?void 0:u.length)-2].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[(null==u?void 0:u.length)-2].value))return v?`((${n}/${v}) > ${null==u?void 0:u[0].value[1]}) OR ((${n}/${v}) < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]}) OR ${v} = 0 OR ${v} IS NULL`:`${n} > ${null==u?void 0:u[0].value[1]} OR ${n} < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]} OR ${n} IS NULL`;if(1===(null==u?void 0:u.length))return"1=0";{const l=[];null==u||u.forEach((o=>{if(null==o?void 0:o.value){const{value:i}=o,u=-1!==i.indexOf("'")?i.split("'").join("''"):null,v=u?`${n} <> '${u}'`:isNaN(i)||"string"==typeof i&&!i.trim()?`${n} <> '${i}'`:`${n} <> ${i} AND ${n} <> '${i}'`;l.push(v)}}));const o=l.join(" AND ");return n&&o?`${o} OR ${n} IS NULL`:""}}{const i=-1!==d.indexOf("'")?d.split("'").join("''"):null,t=Array.isArray(l.value),e=(null==u?void 0:u.length)-1===o,r=!(null==u?void 0:u[(null==u?void 0:u.length)-1].hasOwnProperty("value")),a=o===(null==u?void 0:u.length)-2;return t?v?e||r&&a?`(${n}/${v}) >= ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:`(${n}/${v}) > ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:e||r&&a?`${n} >= ${d[0]} AND ${n} <= ${d[1]}`:`${n} > ${d[0]} AND ${n} <= ${d[1]}`:1===(null==u?void 0:u.length)&&n?isNaN(d)||!d.trim().length?`${n} <> '${d}'`:`${n} <> ${d} OR ${n} <> '${d}'`:i?`${n} = '${i}'`:isNaN(d)||!d.trim().length?`${n} = '${d}'`:`${n} = ${d} OR ${n} = '${d}'`}}return""}function $(l){return Array.isArray(l)?l.every((l=>!l.selected)):l&&Array.from(l.categories.entries()).every((l=>!l[1].selected))&&"1=0"!==l.queryExpressions[0]}function y(l){var n,o,i;return"predominance"===(null===(i=null===(o=null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.renderer)||void 0===o?void 0:o.authoringInfo)||void 0===i?void 0:i.type)}function m(l){var n;return"relationship-ramp"===(null===(n=null==l?void 0:l.legendElements[1])||void 0===n?void 0:n.type)}function p(l,n,o){var i,u,v,d,t,e,r,a,s,c,f,$,m,p,N,O,A,w,E;const b=l.layer,R=null===(i=null==b?void 0:b.renderer)||void 0===i?void 0:i.field,L=null==n?void 0:n.type,D=null==l?void 0:l.layerView,I=null===(v=null===(u=null==D?void 0:D.layer)||void 0===u?void 0:u.renderer)||void 0===v?void 0:v.classBreakInfos,x=(null===(t=null===(d=null==D?void 0:D.layer)||void 0===d?void 0:d.renderer)||void 0===t?void 0:t.uniqueValueInfos)&&R,g="size-ramp"===L,h="color-ramp"===L,P="opacity-ramp"===L,S="heatmap-ramp"===L,U=D&&I&&I.length>1,z=null===(a=null===(r=null===(e=null==D?void 0:D.layer)||void 0===e?void 0:e.renderer)||void 0===r?void 0:r.authoringInfo)||void 0===a?void 0:a.type,F="class-breaks-color"===z,k="class-breaks-size"===z,q=1===(null===(s=null==n?void 0:n.infos)||void 0===s?void 0:s.length)&&!R,V="relationship"===z&&"size-ramp"!==(null==n?void 0:n.type)&&"symbol-table"!==(null==n?void 0:n.type),C="feature"===(null===(c=null==l?void 0:l.layer)||void 0===c?void 0:c.type),J=C&&R&&!h&&!g&&U,T=!(!C||!R||h||g||U),M=!!(T||y(D)&&!g||F&&R||k&&R||q&&!R&&null!==R||V||x),B=(null===(f=null==l?void 0:l.layer)||void 0===f?void 0:f.featureReduction)&&"size-ramp"===(null===(m=null===($=null==l?void 0:l.legendElements)||void 0===$?void 0:$[o])||void 0===m?void 0:m.type),G="symbol-table"===(null==n?void 0:n.type)&&1===(null===(p=null==n?void 0:n.infos)||void 0===p?void 0:p.length),H=!(null==l?void 0:l.legendElements.every((l=>"color-ramp"!==l.type))),K=!(null==l?void 0:l.legendElements.every((l=>"size-ramp"!==l.type))),Q=G&&H,W=G&&K,X=null===(N=null==n?void 0:n.infos)||void 0===N?void 0:N.every((l=>"number"==typeof l.value)),Y="symbol-table"===(null===(A=null===(O=null==l?void 0:l.legendElements)||void 0===O?void 0:O[0])||void 0===A?void 0:A.type)&&"color-ramp"===(null===(E=null===(w=null==l?void 0:l.legendElements)||void 0===w?void 0:w[1])||void 0===E?void 0:E.type),Z="dot-density"===z,_=j(null==l?void 0:l.layer,R);return!(!C||B||P||S||Q||W||X||Y||Z||!_)&&(I?J||M:T||M)}function N(l){var n,o,i,u,v;return l.queryExpressions=[],(null===(o=null===(n=null==l?void 0:l.fLayerView)||void 0===n?void 0:n.filter)||void 0===o?void 0:o.where)&&(l.fLayerView.filter.where=""),(null===(v=null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.featureEffect)||void 0===u?void 0:u.filter)||void 0===v?void 0:v.where)&&(l.fLayerView.featureEffect=null),l.categories.forEach((l=>{l.selected=!1})),l}function O(l,n){var o,i,u,v,d,t,e,r,a,s,c;const f=l.categories.get(n);null===(o=null==f?void 0:f.nestedInfos)||void 0===o||o.forEach((n=>{const o=l.queryExpressions.indexOf(`${l.field} = '${n.legendElementInfo.value}'`);-1!==o&&l.queryExpressions.splice(o,1),n.selected=!1}));const $=[],y=Array.from(l.categories).map((l=>l[1]));y.forEach((n=>{var o,i;(null===(o=n.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=n.nestedInfos)||void 0===i||i.forEach((n=>{$.push(`${l.field} = '${n.legendElementInfo.value}'`)})))})),$.forEach((n=>{-1===l.queryExpressions.indexOf(n)&&l.queryExpressions.push(n)}));let m=l.queryExpressions.join(" OR ");const p=y.every((l=>{var n;return null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected))}));return p?((null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.filter)||void 0===u?void 0:u.where)&&(l.fLayerView.filter.where=""),(null===(t=null===(d=null===(v=null==l?void 0:l.fLayerView)||void 0===v?void 0:v.featureEffect)||void 0===d?void 0:d.filter)||void 0===t?void 0:t.where)&&(l.fLayerView.featureEffect=null),l.queryExpressions=[]):((null===(r=null===(e=null==l?void 0:l.fLayerView)||void 0===e?void 0:e.filter)||void 0===r?void 0:r.where)&&(l.fLayerView.filter.where=m),(null===(c=null===(s=null===(a=null==l?void 0:l.fLayerView)||void 0===a?void 0:a.featureEffect)||void 0===s?void 0:s.filter)||void 0===c?void 0:c.where)&&(l.fLayerView.featureEffect.filter.where=m)),l}async function A(l,n,o){var i,u;const v=l.fLayerView.createQuery();if(o)if(o.nestedInfos.every((l=>!l.selected))){const n=o.nestedInfos.map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=o.nestedInfos.filter((l=>l.selected)).map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=l.queryExpressions.join(" OR ");v.where=n}try{const{extent:o}=await(null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.layer)||void 0===u?void 0:u.queryExtent(v));await n.goTo(o)}catch(l){}}function w(l){return l.map((l=>null==l?void 0:l.count)).reduce(((l,n)=>l+n))}function E(l){return l.map((l=>{var n;return null===(n=null==l?void 0:l.nestedInfos)||void 0===n?void 0:n.map((l=>l.count)).reduce(((l,n)=>l+n))})).reduce(((l,n)=>l+n))}async function b(l,n,o,i,u,v,d,t){var e,r,a;if(!n)return;if(!j(null==n?void 0:n.layer,o))return;const s="feature"===(null===(e=null==n?void 0:n.layer)||void 0===e?void 0:e.type)?n.createQuery():null,$=y(n)?c(i,n):i.type?f(d,o,t,i,i.infos):f(i,o,u,v,v.infos);s&&$&&(s.where="1=0"===$?"1=1":$,s.geometry=l);try{const l=s?await n.queryFeatureCount(s):null;return Promise.resolve({[null!==(r=i.label)&&void 0!==r?r:null===(a=null==n?void 0:n.layer)||void 0===a?void 0:a.id]:l})}catch(l){console.error("FAILURE AT 'getInfoCount': ",l)}return Promise.resolve(null)}async function R(l,n){let o=Object.assign({},n);const{activeLayerInfos:i}=l;let u={};const v={};i.forEach((async o=>{var i,u,d,t;const e=o.legendElements[0],r=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,a=null===(d=o.layer.renderer)||void 0===d?void 0:d.field,s=[];v[o.layer.id]=[],null===(t=null==e?void 0:e.infos)||void 0===t||t.forEach(((n,i)=>{var u;const d=null===(u=e.infos)||void 0===u?void 0:u.every((l=>"symbol-table"===l.type));if(d){const u=[];n.infos.forEach(((o,v)=>{const d=b(l.view.extent,r,a,n,i,e,o,v);u.push(d)})),v[o.layer.id].push(u)}else s.push(b(l.view.extent,r,a,n,i,e)),v[o.layer.id]=s}));const c=o=>{var i,u,d,t;const e=[],r=o.legendElements[0],a=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,s=null===(d=o.layer.renderer)||void 0===d?void 0:d.field;null===(t=null==r?void 0:r.infos)||void 0===t||t.forEach(((n,o)=>e.push(b(l.view.extent,a,s,n,o,r)))),v[o.layer.id]=e};o.children.forEach((async l=>{var n;c(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;c(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{c(l)}))}))}))}));for(const l in v){let n=u[l];n||(n=u[l]={});const o=await Promise.all(v[l]);if(o.every((l=>Array.isArray(l)))){const i=await Promise.all(o.map((async l=>(await Promise.all(l)).map((l=>l&&Object.values(l)[0])))));n[l]=i,u[l]=Object.assign({},n[l])}else{const i={};o.forEach((l=>{if(!l)return;const n=Object.keys(l)[0];i[n]=l[n]})),l&&(n[l]=i),u[l]=Object.assign({},n[l])}}return i.forEach((l=>{var o;const i=n[l.layer.id],v=l.layer.id;null===(o=null==i?void 0:i.categories)||void 0===o||o.forEach(((n,o)=>{var d;const t=Array.from(null==i?void 0:i.categories).findIndex((l=>l[0]===o));if(null==n?void 0:n.nestedInfos)null==n||n.nestedInfos.forEach(((n,o)=>{var i,v,d;const e=null===(d=null===(v=null==u?void 0:u[null===(i=null==l?void 0:l.layer)||void 0===i?void 0:i.id])||void 0===v?void 0:v[t])||void 0===d?void 0:d[o];n.count=isNaN(e)?null:e}));else{const l=null===(d=null==u?void 0:u[v])||void 0===d?void 0:d[o];n.count=isNaN(l)?null:l}}));const d=l=>{var o;const i=l.layer.id,v=n[i];null===(o=null==v?void 0:v.categories)||void 0===o||o.forEach(((l,n)=>{var o;const v=null===(o=null==u?void 0:u[i])||void 0===o?void 0:o[n];l.count=v}))};l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{d(l)}))}))}))})),Promise.resolve(o)}function L(l,n){var o;return null===(o=null==l?void 0:l.nestedInfos)||void 0===o?void 0:o[n]}function D(l){return Array.from(l).map((l=>l[1])).every((l=>!!(null==l?void 0:l.nestedInfos)))}function I(l){var n,o,i,u;return!!(null===(u=null===(i=null===(o=null===(n=null==l?void 0:l.legendElements)||void 0===n?void 0:n[0])||void 0===o?void 0:o.infos)||void 0===i?void 0:i.every)||void 0===u?void 0:u.call(i,(l=>"symbol-table"===(null==l?void 0:l.type))))}function x(l,n){var o;return null===(o=null==l?void 0:l.categories)||void 0===o?void 0:o.get(null==n?void 0:n.title)}function g(l){const n="calcite-mode-",o=`${n}light`,i=`${n}dark`;return l.classList.contains(i)?i:o}function h(l){if(l.layerId&&l.intLegendLayerData){const n=l.layerId,o=l.intLegendLayerData,i=Object.assign(Object.assign({},u.data),{[n]:o});v.set("data",i)}}function P(n,i){const{type:u}=n;"filter"===u?function(l){var n,o;null===(o=null===(n=null==l?void 0:l.allLayerViews)||void 0===n?void 0:n.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})))||void 0===o||o.forEach((l=>{const n=S(l);l.filter=n,l.set("featureEffect",null)}))}(i):"effect"===u&&function(n,i){var u;null===(u=null==i?void 0:i.allLayerViews)||void 0===u||u.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})).forEach((async i=>{if((null==n?void 0:n.effect)&&i){const[u]=await l(["esri/layers/support/FeatureEffect"]),{includedEffect:v,excludedEffect:d}=n.effect,t=await o(d,i,"excludedEffect"),e=await o(v,i,"includedEffect"),r=S(i);i.featureEffect=new u({filter:r,includedEffect:e,excludedEffect:t}),i.set("filter",null)}}))}(n,i)}function S(l){var n;return(null==l?void 0:l.filter)||(null===(n=null==l?void 0:l.featureEffect)||void 0===n?void 0:n.filter)}function j(l,n){const o=null==l?void 0:l.fields,i=o&&o.map((l=>l.name));return!n||i&&i.includes(n)}function U(l){const n=[];return l.forEach((l=>z(l,n))),n}function z(l,n){n.push(l),l.children&&l.children.length>0&&l.children.forEach((l=>{z(l,n)}))}export{x as a,r as b,$ as c,R as d,t as e,U as f,g,P as h,u as i,d as j,s as k,a as l,I as m,m as n,O as o,N as p,o as q,e as r,v as s,D as t,h as u,p as v,E as w,w as x,L as y,A as z}
@@ -0,0 +1,6 @@
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,h as a,H as i,g as c}from"./p-fa1ceaf9.js";import{g as o}from"./p-ffd41e25.js";import{E as n}from"./p-c1cf3ebc.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";const r=class{constructor(a){e(this,a),this.layoutChanged=t(this,"layoutChanged",7),this._layoutMode=n.GRID,this._translations=void 0}async componentWillLoad(){await this._getTranslations()}render(){return a(i,{key:"10b8c1f7ee9503c4bd7cb1bbbd8b58cb5009336f"},a("div",{key:"39ae898c19e24746bfa5f7510006e368f37fe7d5",class:"display-flex"},a("div",{key:"0080f9562ab26665e26a8447e4484d76e4861f9f",class:"display-flex action-center"},a("calcite-icon",{key:"cc941eede331c518fe0944e2bf4b46b0c9799f0c",class:"icon icon-color",icon:"information",id:"app-information-icon",scale:"s"}),a("calcite-popover",{key:"d92ccbe95f58f15964fd8b5d0d1446216ef780a7",closable:!0,label:"",referenceElement:"app-information-icon"},a("span",{key:"37d306563b80589652c25809233063c60035397b",class:"tooltip-message"},this._translations.appInfo))),a("div",{key:"e33a33071990cd0edb32e1c76505ddcc834ae932",class:"header-text"},this._translations.layout),this._getAction("grid-background",n.GRID,this._translations.grid),this._getAction("vertical-background",n.VERTICAL,this._translations.vertical),this._getAction("horizontal-background",n.HORIZONTAL,this._translations.horizontal)))}_getAction(e,t,i){return a("div",null,a("calcite-action",{alignment:"center",appearance:"transparent",compact:!1,id:e,indicator:t===this._layoutMode,onClick:()=>{this._setLayoutMode(t)},text:""},a("div",{class:e+" img-background"})),a("calcite-tooltip",{label:"",placement:"bottom","reference-element":e},a("span",null,i)))}_setLayoutMode(e){this._layoutMode=e,this.layoutChanged.emit(this._layoutMode)}async _getTranslations(){const e=await o(this.el);this._translations=e[0]}get el(){return c(this)}};r.style=":host{display:block}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.display-flex{display:flex}.icon-color{--calcite-color-icon-color:var(--calcite-color-brand)}.icon{cursor:pointer}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.header-text{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium);padding-inline:0.75rem;padding-block:0.875rem;line-height:1.25rem}.img-background{background-repeat:no-repeat;background-size:100% 100%;width:38px;height:26px}.grid-background{background-image:url('../../assets/data/images/grid.png')}.horizontal-background{background-image:url('../../assets/data/images/horizontal.png')}.vertical-background{background-image:url('../../assets/data/images/vertical.png')}";export{r as layout_manager}
@@ -0,0 +1,6 @@
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 a,c as t,h as n,H as s,F as e,g as i}from"./p-fa1ceaf9.js";import{g as r,a as l,s as o,E as c,b as p,l as g,c as u}from"./p-5cc6eb18.js";import{l as d}from"./p-65581d83.js";import{c as h}from"./p-427b4593.js";import{g as v,f as m}from"./p-c742acd9.js";import"./p-8c6d9b5a.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";const _="instant-apps-language-translator",b={BASE:_,header:`${_}__header`,headerText:`${_}__header-text`,savingIndicator:`${_}__saving-indicator`,closeButton:`${_}__close-button`,headerTip:`${_}__header-tip`,topBar:`${_}__top-bar`,topBarSection:`${_}__top-bar-section`,collapseSearchContainer:`${_}__collapse-search-container`,userLangText:`${_}__user-lang-text`,lastItem:`${_}--last-item`,writingIcon:`${_}__writing-icon`},f=class{constructor(n){a(this,n),this.translatorDataUpdated=t(this,"translatorDataUpdated",7),this.portalItem=void 0,this.appSettings=void 0,this.locales=void 0,this.open=!1,this.userLocaleInputOnChangeCallback=void 0,this.translatedLocaleInputOnChangeCallback=void 0,this.saving=!1,this.messages=void 0,this.isCollapse=!0}handleT9nItemUpdate(){this.translatorDataUpdated.emit()}handleLocaleChange(){this.initUIData(),this.initSelectLanguage()}handleAppSettings(){this.initUIData(),this.initSelectLanguage()}async componentDidLoad(){this.initialize()}async initialize(){const[a,t]=await d(["esri/intl","esri/request"]);this.intl=a,this.request=t,await this.initMessages(),this.initUIData(),this.initPortalItemResourceT9nData(),this.initSelectLanguage()}async initMessages(){try{const{el:a}=this,t=await r(a);return this.messages=t,Promise.resolve()}catch(a){return Promise.reject()}}initUIData(){const{appSettings:a,locales:t}=this,n=l(a,t);o.set("uiData",n)}initSelectLanguage(){var a,t;if(!this.intl)return;const{locales:n}=this,s=null!==(t=null===(a=null==n?void 0:n[0])||void 0===a?void 0:a.locale)&&void 0!==t?t:this.intl.getLocale(),e=o.get("currentLanguage");0===this.locales.filter((a=>a.locale===e)).length&&o.set("currentLanguage",s)}async initPortalItemResourceT9nData(){try{const a=await v(this.portalItem);o.set("portalItemResource",a);const t=await m(this.request,a);o.set("portalItemResourceT9n",null!=t?t:{})}catch(a){}}render(){return n(s,{key:"fc32ca4cd8da2d20de670b77e7e6e324fbe15e80"},this.renderModal(),this.renderPopoverTip())}renderModal(){return n("calcite-modal",{open:this.open,scale:"l",fullscreen:!0,onCalciteModalClose:this.close.bind(this)},this.renderHeader(),this.renderContent(),this.renderPrimaryButton())}renderPopoverTip(){var a;return n("calcite-popover",{label:"",referenceElement:"headerTip",placement:"trailing","auto-close":!0,closable:!0},n("div",{class:b.headerTip},null===(a=this.messages)||void 0===a?void 0:a.headerTip))}renderHeader(){const a=o.get("saving");return n("header",{class:b.header,slot:"header"},this.renderHeaderText(),a?this.renderSavingIndicator():null)}renderHeaderText(){const{messages:a}=this;return n("div",{class:b.headerText},n("span",null,null==a?void 0:a.header),n("calcite-button",{id:"headerTip",appearance:"transparent"},n("calcite-icon",{icon:c.Popover,scale:"s"})))}renderSavingIndicator(){var a;const t=o.get("saving"),s=null===(a=this.messages)||void 0===a?void 0:a.saving;return n("div",{class:b.savingIndicator},t?n("calcite-loader",{label:s,inline:!0}):null,n("span",null,s))}renderContent(){const a=p(this.locales);return n("div",{slot:"content"},this.renderTopBar(),(null==a?void 0:a.length)>0?this.renderUIData():this.renderNotice())}renderTopBar(){return n("div",{class:b.topBar},this.renderLeadingTopBarSection(),this.renderTrailingTopBarSection())}renderLeadingTopBarSection(){return n("div",{class:b.topBarSection},this.renderUserLocale(),this.renderCollapseSearchContainer())}renderUserLocale(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.languages,s=h(this.el);return n("div",{class:b.userLangText},null==t?void 0:t[s])}renderCollapseSearchContainer(){return n("div",{class:b.collapseSearchContainer},this.renderExpandCollapseButton(),this.renderSearch())}renderExpandCollapseButton(){const{isCollapse:a,messages:t}=this,s=a?null==t?void 0:t.collapseAll:null==t?void 0:t.expandAll;return n(e,null,n("slot",{name:"primary-custom-action"}),n("slot",{name:"secondary-custom-action"}),n("calcite-button",{onClick:this.handleExpandCollapseAll.bind(this),appearance:"transparent","icon-start":c.ExpandCollapse},s))}renderSearch(){var a;return n("instant-apps-language-translator-search",{onSuggestionSelected:this.onSuggestionSelect.bind(this),t9nPlaceholder:null===(a=this.messages)||void 0===a?void 0:a.searchPlaceholder})}renderTrailingTopBarSection(){return n("div",{class:b.topBarSection},this.renderLanguageSelection(),n("slot",{name:"translation-custom-action"}))}renderLanguageSelection(){var a;return n("calcite-label",{layout:"inline"},null===(a=this.messages)||void 0===a?void 0:a.translatedLanguage,n("calcite-select",{label:"",onCalciteSelectChange:this.handleLanguageSelection.bind(this)},this.renderTranslatedLangOptions()))}renderTranslatedLangOptions(){const a=o.get("uiData"),t=null==a?void 0:a.get("locales"),s=p(t);return null==s?void 0:s.map((a=>{const{messages:t}=this,s=null==t?void 0:t.translatedLanguageNames,e=null==t?void 0:t.languages;return n("calcite-option",{key:`translated-lang-option-${a}`,value:a},`${null==s?void 0:s[a]} - ${null==e?void 0:e[a]}`)}))}renderUIData(){if(!(null==g?void 0:g.uiData))return;const a=u();return n("div",null,null==a?void 0:a.map(((t,n)=>this.renderUIDataItem(t,n,a.length))))}renderNotice(){var a;const t=null===(a=this.messages)||void 0===a?void 0:a.noLanguage;return n("calcite-notice",{open:!0,icon:"exclamation-mark-triangle",kind:"warning"},n("div",{slot:"title"},null==t?void 0:t.title),n("div",{slot:"message"},null==t?void 0:t.message))}renderUIDataItem(a,t,s){var e,i;const r=null===(i=null===(e=this.appSettings)||void 0===e?void 0:e.translatedLanguageLabels)||void 0===i?void 0:i[g.currentLanguage],l=`${t===s-1?b.lastItem:""}`,o=this.appSettings.content.filter((t=>t.id===a))[0];return n("instant-apps-language-translator-item",{key:`${a}-${t}`,class:l,fieldName:a,translatedLanguageLabels:r,setting:o,userLocaleInputOnChangeCallback:this.userLocaleInputOnChangeCallback,translatedLocaleInputOnChangeCallback:this.translatedLocaleInputOnChangeCallback})}renderPrimaryButton(){var a;return n("calcite-button",{onClick:()=>this.open=!1,slot:"primary",class:b.closeButton},null===(a=this.messages)||void 0===a?void 0:a.close)}handleExpandCollapseAll(){this.isCollapse=!this.isCollapse;const a=new Map(g.uiData);u().forEach((t=>a.get(t).expanded=this.isCollapse)),o.set("uiData",a)}onSuggestionSelect(a){const t=a.detail,n=new Map(g.uiData);u().forEach((a=>{n.get(a).selected=a===t})),o.set("uiData",n)}close(){this.open=!1}handleLanguageSelection(a){o.set("currentLanguage",a.target.value)}async getTranslationData(){return o.get("portalItemResourceT9n")}async setTranslationData(a){return o.set("portalItemResourceT9n",a)}async getPortalItemResource(){return o.get("portalItemResource")}async batchWriteToPortalItemResource(a){o.set("saving",!0);try{const t=await this.getPortalItemResource(),n=JSON.stringify(a),s=new Blob([n],{type:"application/json"});return await t.update(s),setTimeout((()=>o.set("saving",!1)),1500),this.translatorDataUpdated.emit(),Promise.resolve()}catch(a){return console.error("Error writing to portal item resource: ",a),o.set("saving",!1),Promise.reject()}}get el(){return i(this)}static get watchers(){return{locales:["handleLocaleChange"],appSettings:["handleAppSettings"]}}};f.style=".sc-instant-apps-language-translator-h{display:block}.sc-instant-apps-language-translator-h calcite-modal.sc-instant-apps-language-translator{--calcite-modal-content-padding:0}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header.sc-instant-apps-language-translator{display:flex;justify-content:space-between;width:100%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-text.sc-instant-apps-language-translator{font-size:18px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__saving-indicator.sc-instant-apps-language-translator{display:flex;align-items:center;font-size:14.5px;color:var(--calcite-color-brand)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__writing-icon.sc-instant-apps-language-translator{display:flex;justify-content:center;align-items:center;margin-right:5px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__close-button.sc-instant-apps-language-translator{width:175px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__header-tip.sc-instant-apps-language-translator{padding:20px;max-width:45vw}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator{display:flex;width:100%;position:sticky;top:0;background:var(--calcite-color-foreground-1);z-index:1}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar.sc-instant-apps-language-translator calcite-label.sc-instant-apps-language-translator{--calcite-label-margin-bottom:0;font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator{box-sizing:border-box;display:flex;align-items:center;width:50%;padding:0.5%}.sc-instant-apps-language-translator-h .instant-apps-language-translator__user-lang-text.sc-instant-apps-language-translator{font-weight:var(--calcite-font-weight-medium)}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:first-child{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__top-bar-section.sc-instant-apps-language-translator:nth-child(2) calcite-select.sc-instant-apps-language-translator{width:255px}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator{display:flex;justify-content:space-between}.sc-instant-apps-language-translator-h .instant-apps-language-translator__collapse-search-container.sc-instant-apps-language-translator calcite-input.sc-instant-apps-language-translator{width:300px;margin-left:30px}.ck.ck-reset.ck-editor.ck-rounded-corners.sc-instant-apps-language-translator{margin-top:10px !important;margin-left:55px !important}.ck-editor__editable.sc-instant-apps-language-translator{height:70px !important;font-size:0.875rem !important;line-height:1.375 !important}.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:first-child,.ck.ck-editor__editable_inline.sc-instant-apps-language-translator>.sc-instant-apps-language-translator:last-child{--ck-spacing-large:0.5rem !important}";export{f as instant_apps_language_translator}