@esri/solutions-components 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (531) hide show
  1. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +16 -6
  2. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js.map +1 -1
  3. package/dist/cjs/solution-configuration.cjs.entry.js +1095 -4
  4. package/dist/cjs/solution-configuration.cjs.entry.js.map +1 -1
  5. package/dist/cjs/solution-contents_3.cjs.entry.js +3 -1
  6. package/dist/cjs/solution-contents_3.cjs.entry.js.map +1 -1
  7. package/dist/cjs/{solution-store-f0547fe7.js → solution-store-893499a5.js} +8 -1
  8. package/dist/cjs/solution-store-893499a5.js.map +1 -0
  9. package/dist/collection/components/solution-configuration/solution-configuration.js +14 -11
  10. package/dist/collection/components/solution-configuration/solution-configuration.js.map +1 -1
  11. package/dist/collection/components/solution-item/solution-item.js +2 -0
  12. package/dist/collection/components/solution-item/solution-item.js.map +1 -1
  13. package/dist/collection/components/solution-item-details/solution-item-details.js +15 -5
  14. package/dist/collection/components/solution-item-details/solution-item-details.js.map +1 -1
  15. package/dist/collection/utils/solution-store.js +2 -0
  16. package/dist/collection/utils/solution-store.js.map +1 -1
  17. package/dist/collection/utils/solution-store.ts +2 -0
  18. package/dist/esm/calcite-shell-panel_14.entry.js +16 -6
  19. package/dist/esm/calcite-shell-panel_14.entry.js.map +1 -1
  20. package/dist/esm/solution-configuration.entry.js +1095 -4
  21. package/dist/esm/solution-configuration.entry.js.map +1 -1
  22. package/dist/esm/solution-contents_3.entry.js +3 -1
  23. package/dist/esm/solution-contents_3.entry.js.map +1 -1
  24. package/dist/esm/{solution-store-c1f6173a.js → solution-store-0c58c852.js} +4 -2
  25. package/dist/esm/solution-store-0c58c852.js.map +1 -0
  26. package/dist/solutions-components/{p-065830b8.js → p-659edb14.js} +4 -2
  27. package/dist/solutions-components/p-659edb14.js.map +1 -0
  28. package/dist/solutions-components/{p-ee9be0ef.entry.js → p-77c75f3a.entry.js} +4 -2
  29. package/dist/solutions-components/p-77c75f3a.entry.js.map +1 -0
  30. package/dist/solutions-components/p-90629c1d.entry.js +1986 -0
  31. package/dist/solutions-components/p-90629c1d.entry.js.map +1 -0
  32. package/dist/solutions-components/{p-0e7a0839.entry.js → p-984cb687.entry.js} +17 -7
  33. package/dist/solutions-components/p-984cb687.entry.js.map +1 -0
  34. package/dist/solutions-components/solutions-components.esm.js +1 -1
  35. package/dist/solutions-components/utils/solution-store.ts +2 -0
  36. package/dist/solutions-components_commit.txt +9 -7
  37. package/dist/types/components/solution-item-details/solution-item-details.d.ts +2 -1
  38. package/package.json +1 -1
  39. package/dist/cjs/solution-store-f0547fe7.js.map +0 -1
  40. package/dist/components/ExpandToggle.js +0 -112
  41. package/dist/components/ExpandToggle.js.map +0 -1
  42. package/dist/components/Heading.js +0 -24
  43. package/dist/components/Heading.js.map +0 -1
  44. package/dist/components/_commonjsHelpers.js +0 -24
  45. package/dist/components/_commonjsHelpers.js.map +0 -1
  46. package/dist/components/action-bar.js +0 -278
  47. package/dist/components/action-bar.js.map +0 -1
  48. package/dist/components/action-group.js +0 -151
  49. package/dist/components/action-group.js.map +0 -1
  50. package/dist/components/action-menu.js +0 -358
  51. package/dist/components/action-menu.js.map +0 -1
  52. package/dist/components/action.js +0 -216
  53. package/dist/components/action.js.map +0 -1
  54. package/dist/components/array.js +0 -17
  55. package/dist/components/array.js.map +0 -1
  56. package/dist/components/buffer-tools.d.ts +0 -11
  57. package/dist/components/buffer-tools.js +0 -13
  58. package/dist/components/buffer-tools.js.map +0 -1
  59. package/dist/components/buffer-tools2.js +0 -256
  60. package/dist/components/buffer-tools2.js.map +0 -1
  61. package/dist/components/button.js +0 -265
  62. package/dist/components/button.js.map +0 -1
  63. package/dist/components/calcite-accordion-item.js +0 -246
  64. package/dist/components/calcite-accordion-item.js.map +0 -1
  65. package/dist/components/calcite-accordion.js +0 -182
  66. package/dist/components/calcite-accordion.js.map +0 -1
  67. package/dist/components/calcite-action-bar.js +0 -13
  68. package/dist/components/calcite-action-bar.js.map +0 -1
  69. package/dist/components/calcite-action-group.js +0 -13
  70. package/dist/components/calcite-action-group.js.map +0 -1
  71. package/dist/components/calcite-action-menu.js +0 -13
  72. package/dist/components/calcite-action-menu.js.map +0 -1
  73. package/dist/components/calcite-action-pad.js +0 -199
  74. package/dist/components/calcite-action-pad.js.map +0 -1
  75. package/dist/components/calcite-action.js +0 -13
  76. package/dist/components/calcite-action.js.map +0 -1
  77. package/dist/components/calcite-alert.js +0 -299
  78. package/dist/components/calcite-alert.js.map +0 -1
  79. package/dist/components/calcite-avatar.js +0 -184
  80. package/dist/components/calcite-avatar.js.map +0 -1
  81. package/dist/components/calcite-block-section.js +0 -157
  82. package/dist/components/calcite-block-section.js.map +0 -1
  83. package/dist/components/calcite-block.js +0 -277
  84. package/dist/components/calcite-block.js.map +0 -1
  85. package/dist/components/calcite-button.js +0 -13
  86. package/dist/components/calcite-button.js.map +0 -1
  87. package/dist/components/calcite-card.js +0 -189
  88. package/dist/components/calcite-card.js.map +0 -1
  89. package/dist/components/calcite-checkbox.js +0 -13
  90. package/dist/components/calcite-checkbox.js.map +0 -1
  91. package/dist/components/calcite-chip.js +0 -13
  92. package/dist/components/calcite-chip.js.map +0 -1
  93. package/dist/components/calcite-color-picker-hex-input.js +0 -13
  94. package/dist/components/calcite-color-picker-hex-input.js.map +0 -1
  95. package/dist/components/calcite-color-picker-swatch.js +0 -13
  96. package/dist/components/calcite-color-picker-swatch.js.map +0 -1
  97. package/dist/components/calcite-color-picker.js +0 -1038
  98. package/dist/components/calcite-color-picker.js.map +0 -1
  99. package/dist/components/calcite-combobox-item-group.js +0 -77
  100. package/dist/components/calcite-combobox-item-group.js.map +0 -1
  101. package/dist/components/calcite-combobox-item.js +0 -13
  102. package/dist/components/calcite-combobox-item.js.map +0 -1
  103. package/dist/components/calcite-combobox.js +0 -13
  104. package/dist/components/calcite-combobox.js.map +0 -1
  105. package/dist/components/calcite-date-picker-day.js +0 -13
  106. package/dist/components/calcite-date-picker-day.js.map +0 -1
  107. package/dist/components/calcite-date-picker-month-header.js +0 -13
  108. package/dist/components/calcite-date-picker-month-header.js.map +0 -1
  109. package/dist/components/calcite-date-picker-month.js +0 -13
  110. package/dist/components/calcite-date-picker-month.js.map +0 -1
  111. package/dist/components/calcite-date-picker.js +0 -13
  112. package/dist/components/calcite-date-picker.js.map +0 -1
  113. package/dist/components/calcite-dropdown-group.js +0 -101
  114. package/dist/components/calcite-dropdown-group.js.map +0 -1
  115. package/dist/components/calcite-dropdown-item.js +0 -237
  116. package/dist/components/calcite-dropdown-item.js.map +0 -1
  117. package/dist/components/calcite-dropdown.js +0 -13
  118. package/dist/components/calcite-dropdown.js.map +0 -1
  119. package/dist/components/calcite-fab.js +0 -146
  120. package/dist/components/calcite-fab.js.map +0 -1
  121. package/dist/components/calcite-filter.js +0 -197
  122. package/dist/components/calcite-filter.js.map +0 -1
  123. package/dist/components/calcite-flow-item.js +0 -245
  124. package/dist/components/calcite-flow-item.js.map +0 -1
  125. package/dist/components/calcite-flow.js +0 -149
  126. package/dist/components/calcite-flow.js.map +0 -1
  127. package/dist/components/calcite-graph.js +0 -13
  128. package/dist/components/calcite-graph.js.map +0 -1
  129. package/dist/components/calcite-handle.js +0 -13
  130. package/dist/components/calcite-handle.js.map +0 -1
  131. package/dist/components/calcite-icon.js +0 -13
  132. package/dist/components/calcite-icon.js.map +0 -1
  133. package/dist/components/calcite-inline-editable.js +0 -296
  134. package/dist/components/calcite-inline-editable.js.map +0 -1
  135. package/dist/components/calcite-input-date-picker.js +0 -715
  136. package/dist/components/calcite-input-date-picker.js.map +0 -1
  137. package/dist/components/calcite-input-message.js +0 -13
  138. package/dist/components/calcite-input-message.js.map +0 -1
  139. package/dist/components/calcite-input-number.js +0 -639
  140. package/dist/components/calcite-input-number.js.map +0 -1
  141. package/dist/components/calcite-input-text.js +0 -402
  142. package/dist/components/calcite-input-text.js.map +0 -1
  143. package/dist/components/calcite-input-time-picker.js +0 -436
  144. package/dist/components/calcite-input-time-picker.js.map +0 -1
  145. package/dist/components/calcite-input.js +0 -13
  146. package/dist/components/calcite-input.js.map +0 -1
  147. package/dist/components/calcite-label.js +0 -13
  148. package/dist/components/calcite-label.js.map +0 -1
  149. package/dist/components/calcite-link.js +0 -13
  150. package/dist/components/calcite-link.js.map +0 -1
  151. package/dist/components/calcite-list-item-group.js +0 -67
  152. package/dist/components/calcite-list-item-group.js.map +0 -1
  153. package/dist/components/calcite-list-item.js +0 -13
  154. package/dist/components/calcite-list-item.js.map +0 -1
  155. package/dist/components/calcite-list.js +0 -13
  156. package/dist/components/calcite-list.js.map +0 -1
  157. package/dist/components/calcite-loader.js +0 -13
  158. package/dist/components/calcite-loader.js.map +0 -1
  159. package/dist/components/calcite-modal.js +0 -500
  160. package/dist/components/calcite-modal.js.map +0 -1
  161. package/dist/components/calcite-notice.js +0 -13
  162. package/dist/components/calcite-notice.js.map +0 -1
  163. package/dist/components/calcite-option-group.js +0 -66
  164. package/dist/components/calcite-option-group.js.map +0 -1
  165. package/dist/components/calcite-option.js +0 -13
  166. package/dist/components/calcite-option.js.map +0 -1
  167. package/dist/components/calcite-pagination.js +0 -260
  168. package/dist/components/calcite-pagination.js.map +0 -1
  169. package/dist/components/calcite-panel.js +0 -13
  170. package/dist/components/calcite-panel.js.map +0 -1
  171. package/dist/components/calcite-pick-list-group.js +0 -76
  172. package/dist/components/calcite-pick-list-group.js.map +0 -1
  173. package/dist/components/calcite-pick-list-item.js +0 -13
  174. package/dist/components/calcite-pick-list-item.js.map +0 -1
  175. package/dist/components/calcite-pick-list.js +0 -175
  176. package/dist/components/calcite-pick-list.js.map +0 -1
  177. package/dist/components/calcite-popover-manager.js +0 -96
  178. package/dist/components/calcite-popover-manager.js.map +0 -1
  179. package/dist/components/calcite-popover.js +0 -13
  180. package/dist/components/calcite-popover.js.map +0 -1
  181. package/dist/components/calcite-progress.js +0 -13
  182. package/dist/components/calcite-progress.js.map +0 -1
  183. package/dist/components/calcite-radio-button-group.js +0 -134
  184. package/dist/components/calcite-radio-button-group.js.map +0 -1
  185. package/dist/components/calcite-radio-button.js +0 -312
  186. package/dist/components/calcite-radio-button.js.map +0 -1
  187. package/dist/components/calcite-radio-group-item.js +0 -13
  188. package/dist/components/calcite-radio-group-item.js.map +0 -1
  189. package/dist/components/calcite-radio-group.js +0 -13
  190. package/dist/components/calcite-radio-group.js.map +0 -1
  191. package/dist/components/calcite-rating.js +0 -203
  192. package/dist/components/calcite-rating.js.map +0 -1
  193. package/dist/components/calcite-scrim.js +0 -13
  194. package/dist/components/calcite-scrim.js.map +0 -1
  195. package/dist/components/calcite-select.js +0 -13
  196. package/dist/components/calcite-select.js.map +0 -1
  197. package/dist/components/calcite-shell-center-row.js +0 -102
  198. package/dist/components/calcite-shell-center-row.js.map +0 -1
  199. package/dist/components/calcite-shell-panel.js +0 -13
  200. package/dist/components/calcite-shell-panel.js.map +0 -1
  201. package/dist/components/calcite-shell.js +0 -13
  202. package/dist/components/calcite-shell.js.map +0 -1
  203. package/dist/components/calcite-slider.js +0 -13
  204. package/dist/components/calcite-slider.js.map +0 -1
  205. package/dist/components/calcite-sortable-list.js +0 -204
  206. package/dist/components/calcite-sortable-list.js.map +0 -1
  207. package/dist/components/calcite-split-button.js +0 -170
  208. package/dist/components/calcite-split-button.js.map +0 -1
  209. package/dist/components/calcite-stepper-item.js +0 -273
  210. package/dist/components/calcite-stepper-item.js.map +0 -1
  211. package/dist/components/calcite-stepper.js +0 -258
  212. package/dist/components/calcite-stepper.js.map +0 -1
  213. package/dist/components/calcite-switch.js +0 -13
  214. package/dist/components/calcite-switch.js.map +0 -1
  215. package/dist/components/calcite-tab-nav.js +0 -13
  216. package/dist/components/calcite-tab-nav.js.map +0 -1
  217. package/dist/components/calcite-tab-title.js +0 -13
  218. package/dist/components/calcite-tab-title.js.map +0 -1
  219. package/dist/components/calcite-tab.js +0 -13
  220. package/dist/components/calcite-tab.js.map +0 -1
  221. package/dist/components/calcite-tabs.js +0 -13
  222. package/dist/components/calcite-tabs.js.map +0 -1
  223. package/dist/components/calcite-tile-select-group.js +0 -67
  224. package/dist/components/calcite-tile-select-group.js.map +0 -1
  225. package/dist/components/calcite-tile-select.js +0 -268
  226. package/dist/components/calcite-tile-select.js.map +0 -1
  227. package/dist/components/calcite-tile.js +0 -13
  228. package/dist/components/calcite-tile.js.map +0 -1
  229. package/dist/components/calcite-time-picker.js +0 -13
  230. package/dist/components/calcite-time-picker.js.map +0 -1
  231. package/dist/components/calcite-tip-group.js +0 -43
  232. package/dist/components/calcite-tip-group.js.map +0 -1
  233. package/dist/components/calcite-tip-manager.js +0 -225
  234. package/dist/components/calcite-tip-manager.js.map +0 -1
  235. package/dist/components/calcite-tip.js +0 -164
  236. package/dist/components/calcite-tip.js.map +0 -1
  237. package/dist/components/calcite-tooltip-manager.js +0 -59
  238. package/dist/components/calcite-tooltip-manager.js.map +0 -1
  239. package/dist/components/calcite-tooltip.js +0 -13
  240. package/dist/components/calcite-tooltip.js.map +0 -1
  241. package/dist/components/calcite-tree-item.js +0 -13
  242. package/dist/components/calcite-tree-item.js.map +0 -1
  243. package/dist/components/calcite-tree.js +0 -13
  244. package/dist/components/calcite-tree.js.map +0 -1
  245. package/dist/components/calcite-value-list-item.js +0 -13
  246. package/dist/components/calcite-value-list-item.js.map +0 -1
  247. package/dist/components/calcite-value-list.js +0 -13
  248. package/dist/components/calcite-value-list.js.map +0 -1
  249. package/dist/components/check-list.d.ts +0 -11
  250. package/dist/components/check-list.js +0 -13
  251. package/dist/components/check-list.js.map +0 -1
  252. package/dist/components/check-list2.js +0 -128
  253. package/dist/components/check-list2.js.map +0 -1
  254. package/dist/components/checkbox.js +0 -167
  255. package/dist/components/checkbox.js.map +0 -1
  256. package/dist/components/chip.js +0 -172
  257. package/dist/components/chip.js.map +0 -1
  258. package/dist/components/color-picker-hex-input.js +0 -365
  259. package/dist/components/color-picker-hex-input.js.map +0 -1
  260. package/dist/components/color-picker-swatch.js +0 -2036
  261. package/dist/components/color-picker-swatch.js.map +0 -1
  262. package/dist/components/combobox-item.js +0 -184
  263. package/dist/components/combobox-item.js.map +0 -1
  264. package/dist/components/combobox.js +0 -914
  265. package/dist/components/combobox.js.map +0 -1
  266. package/dist/components/conditionalSlot.js +0 -52
  267. package/dist/components/conditionalSlot.js.map +0 -1
  268. package/dist/components/config-buffer-tools.d.ts +0 -11
  269. package/dist/components/config-buffer-tools.js +0 -185
  270. package/dist/components/config-buffer-tools.js.map +0 -1
  271. package/dist/components/config-draw-tools.d.ts +0 -11
  272. package/dist/components/config-draw-tools.js +0 -124
  273. package/dist/components/config-draw-tools.js.map +0 -1
  274. package/dist/components/config-layer-picker.d.ts +0 -11
  275. package/dist/components/config-layer-picker.js +0 -148
  276. package/dist/components/config-layer-picker.js.map +0 -1
  277. package/dist/components/config-pdf-download.d.ts +0 -11
  278. package/dist/components/config-pdf-download.js +0 -157
  279. package/dist/components/config-pdf-download.js.map +0 -1
  280. package/dist/components/date-picker-day.js +0 -113
  281. package/dist/components/date-picker-day.js.map +0 -1
  282. package/dist/components/date-picker-month-header.js +0 -226
  283. package/dist/components/date-picker-month-header.js.map +0 -1
  284. package/dist/components/date-picker-month.js +0 -346
  285. package/dist/components/date-picker-month.js.map +0 -1
  286. package/dist/components/date-picker.js +0 -577
  287. package/dist/components/date-picker.js.map +0 -1
  288. package/dist/components/date.js +0 -182
  289. package/dist/components/date.js.map +0 -1
  290. package/dist/components/debounce.js +0 -489
  291. package/dist/components/debounce.js.map +0 -1
  292. package/dist/components/dom.js +0 -233
  293. package/dist/components/dom.js.map +0 -1
  294. package/dist/components/dropdown.js +0 -507
  295. package/dist/components/dropdown.js.map +0 -1
  296. package/dist/components/filter.js +0 -765
  297. package/dist/components/filter.js.map +0 -1
  298. package/dist/components/floating-ui.js +0 -1787
  299. package/dist/components/floating-ui.js.map +0 -1
  300. package/dist/components/form.js +0 -230
  301. package/dist/components/form.js.map +0 -1
  302. package/dist/components/graph.js +0 -256
  303. package/dist/components/graph.js.map +0 -1
  304. package/dist/components/guid.js +0 -26
  305. package/dist/components/guid.js.map +0 -1
  306. package/dist/components/handle.js +0 -121
  307. package/dist/components/handle.js.map +0 -1
  308. package/dist/components/icon.js +0 -204
  309. package/dist/components/icon.js.map +0 -1
  310. package/dist/components/index.d.ts +0 -48
  311. package/dist/components/index.js +0 -190
  312. package/dist/components/index.js.map +0 -1
  313. package/dist/components/index2.js +0 -201
  314. package/dist/components/index2.js.map +0 -1
  315. package/dist/components/input-message.js +0 -103
  316. package/dist/components/input-message.js.map +0 -1
  317. package/dist/components/input.js +0 -742
  318. package/dist/components/input.js.map +0 -1
  319. package/dist/components/interactive.js +0 -53
  320. package/dist/components/interactive.js.map +0 -1
  321. package/dist/components/interfaces.js +0 -21
  322. package/dist/components/interfaces.js.map +0 -1
  323. package/dist/components/interfaces2.js +0 -23
  324. package/dist/components/interfaces2.js.map +0 -1
  325. package/dist/components/interfaces3.js +0 -72
  326. package/dist/components/interfaces3.js.map +0 -1
  327. package/dist/components/json-editor.d.ts +0 -11
  328. package/dist/components/json-editor.js +0 -13
  329. package/dist/components/json-editor.js.map +0 -1
  330. package/dist/components/json-editor2.js +0 -443
  331. package/dist/components/json-editor2.js.map +0 -1
  332. package/dist/components/key.js +0 -18
  333. package/dist/components/key.js.map +0 -1
  334. package/dist/components/label.js +0 -108
  335. package/dist/components/label.js.map +0 -1
  336. package/dist/components/label2.js +0 -133
  337. package/dist/components/label2.js.map +0 -1
  338. package/dist/components/labelFormats.js +0 -212
  339. package/dist/components/labelFormats.js.map +0 -1
  340. package/dist/components/link.js +0 -125
  341. package/dist/components/link.js.map +0 -1
  342. package/dist/components/list-item.js +0 -151
  343. package/dist/components/list-item.js.map +0 -1
  344. package/dist/components/list.js +0 -85
  345. package/dist/components/list.js.map +0 -1
  346. package/dist/components/loadModules.js +0 -30
  347. package/dist/components/loadModules.js.map +0 -1
  348. package/dist/components/loader.js +0 -118
  349. package/dist/components/loader.js.map +0 -1
  350. package/dist/components/locale.js +0 -414
  351. package/dist/components/locale.js.map +0 -1
  352. package/dist/components/locale2.js +0 -415
  353. package/dist/components/locale2.js.map +0 -1
  354. package/dist/components/map-draw-tools.d.ts +0 -11
  355. package/dist/components/map-draw-tools.js +0 -13
  356. package/dist/components/map-draw-tools.js.map +0 -1
  357. package/dist/components/map-draw-tools2.js +0 -230
  358. package/dist/components/map-draw-tools2.js.map +0 -1
  359. package/dist/components/map-layer-picker.d.ts +0 -11
  360. package/dist/components/map-layer-picker.js +0 -13
  361. package/dist/components/map-layer-picker.js.map +0 -1
  362. package/dist/components/map-layer-picker2.js +0 -190
  363. package/dist/components/map-layer-picker2.js.map +0 -1
  364. package/dist/components/map-search.d.ts +0 -11
  365. package/dist/components/map-search.js +0 -157
  366. package/dist/components/map-search.js.map +0 -1
  367. package/dist/components/map-select-tools.d.ts +0 -11
  368. package/dist/components/map-select-tools.js +0 -13
  369. package/dist/components/map-select-tools.js.map +0 -1
  370. package/dist/components/map-select-tools2.js +0 -555
  371. package/dist/components/map-select-tools2.js.map +0 -1
  372. package/dist/components/mapViewUtils.js +0 -131
  373. package/dist/components/mapViewUtils.js.map +0 -1
  374. package/dist/components/math.js +0 -26
  375. package/dist/components/math.js.map +0 -1
  376. package/dist/components/nonChromiumPlatformUtils.js +0 -505
  377. package/dist/components/nonChromiumPlatformUtils.js.map +0 -1
  378. package/dist/components/notice.js +0 -194
  379. package/dist/components/notice.js.map +0 -1
  380. package/dist/components/observers.js +0 -58
  381. package/dist/components/observers.js.map +0 -1
  382. package/dist/components/openCloseComponent.js +0 -58
  383. package/dist/components/openCloseComponent.js.map +0 -1
  384. package/dist/components/option.js +0 -111
  385. package/dist/components/option.js.map +0 -1
  386. package/dist/components/panel.js +0 -461
  387. package/dist/components/panel.js.map +0 -1
  388. package/dist/components/pdf-download.d.ts +0 -11
  389. package/dist/components/pdf-download.js +0 -13
  390. package/dist/components/pdf-download.js.map +0 -1
  391. package/dist/components/pdf-download2.js +0 -243
  392. package/dist/components/pdf-download2.js.map +0 -1
  393. package/dist/components/pick-list-item.js +0 -257
  394. package/dist/components/pick-list-item.js.map +0 -1
  395. package/dist/components/popover.js +0 -502
  396. package/dist/components/popover.js.map +0 -1
  397. package/dist/components/progress.js +0 -62
  398. package/dist/components/progress.js.map +0 -1
  399. package/dist/components/public-notification.d.ts +0 -11
  400. package/dist/components/public-notification.js +0 -784
  401. package/dist/components/public-notification.js.map +0 -1
  402. package/dist/components/publicNotificationStore.js +0 -40
  403. package/dist/components/publicNotificationStore.js.map +0 -1
  404. package/dist/components/queryUtils.js +0 -163
  405. package/dist/components/queryUtils.js.map +0 -1
  406. package/dist/components/radio-group-item.js +0 -103
  407. package/dist/components/radio-group-item.js.map +0 -1
  408. package/dist/components/radio-group.js +0 -237
  409. package/dist/components/radio-group.js.map +0 -1
  410. package/dist/components/refine-selection-tools.d.ts +0 -11
  411. package/dist/components/refine-selection-tools.js +0 -13
  412. package/dist/components/refine-selection-tools.js.map +0 -1
  413. package/dist/components/refine-selection-tools2.js +0 -500
  414. package/dist/components/refine-selection-tools2.js.map +0 -1
  415. package/dist/components/refine-selection.d.ts +0 -11
  416. package/dist/components/refine-selection.js +0 -13
  417. package/dist/components/refine-selection.js.map +0 -1
  418. package/dist/components/refine-selection2.js +0 -369
  419. package/dist/components/refine-selection2.js.map +0 -1
  420. package/dist/components/resources.js +0 -26
  421. package/dist/components/resources.js.map +0 -1
  422. package/dist/components/resources2.js +0 -23
  423. package/dist/components/resources2.js.map +0 -1
  424. package/dist/components/resources3.js +0 -40
  425. package/dist/components/resources3.js.map +0 -1
  426. package/dist/components/scrim.js +0 -85
  427. package/dist/components/scrim.js.map +0 -1
  428. package/dist/components/select.js +0 -261
  429. package/dist/components/select.js.map +0 -1
  430. package/dist/components/shared-list-render.js +0 -321
  431. package/dist/components/shared-list-render.js.map +0 -1
  432. package/dist/components/shell-panel.js +0 -283
  433. package/dist/components/shell-panel.js.map +0 -1
  434. package/dist/components/shell.js +0 -123
  435. package/dist/components/shell.js.map +0 -1
  436. package/dist/components/slider.js +0 -898
  437. package/dist/components/slider.js.map +0 -1
  438. package/dist/components/solution-configuration.d.ts +0 -11
  439. package/dist/components/solution-configuration.js +0 -1141
  440. package/dist/components/solution-configuration.js.map +0 -1
  441. package/dist/components/solution-contents.d.ts +0 -11
  442. package/dist/components/solution-contents.js +0 -13
  443. package/dist/components/solution-contents.js.map +0 -1
  444. package/dist/components/solution-contents2.js +0 -130
  445. package/dist/components/solution-contents2.js.map +0 -1
  446. package/dist/components/solution-item-details.d.ts +0 -11
  447. package/dist/components/solution-item-details.js +0 -13
  448. package/dist/components/solution-item-details.js.map +0 -1
  449. package/dist/components/solution-item-details2.js +0 -236
  450. package/dist/components/solution-item-details2.js.map +0 -1
  451. package/dist/components/solution-item-icon.d.ts +0 -11
  452. package/dist/components/solution-item-icon.js +0 -13
  453. package/dist/components/solution-item-icon.js.map +0 -1
  454. package/dist/components/solution-item-icon2.js +0 -344
  455. package/dist/components/solution-item-icon2.js.map +0 -1
  456. package/dist/components/solution-item-sharing.d.ts +0 -11
  457. package/dist/components/solution-item-sharing.js +0 -13
  458. package/dist/components/solution-item-sharing.js.map +0 -1
  459. package/dist/components/solution-item-sharing2.js +0 -169
  460. package/dist/components/solution-item-sharing2.js.map +0 -1
  461. package/dist/components/solution-item.d.ts +0 -11
  462. package/dist/components/solution-item.js +0 -13
  463. package/dist/components/solution-item.js.map +0 -1
  464. package/dist/components/solution-item2.js +0 -317
  465. package/dist/components/solution-item2.js.map +0 -1
  466. package/dist/components/solution-organization-variables.d.ts +0 -11
  467. package/dist/components/solution-organization-variables.js +0 -13
  468. package/dist/components/solution-organization-variables.js.map +0 -1
  469. package/dist/components/solution-organization-variables2.js +0 -134
  470. package/dist/components/solution-organization-variables2.js.map +0 -1
  471. package/dist/components/solution-resource-item.d.ts +0 -11
  472. package/dist/components/solution-resource-item.js +0 -13
  473. package/dist/components/solution-resource-item.js.map +0 -1
  474. package/dist/components/solution-resource-item2.js +0 -358
  475. package/dist/components/solution-resource-item2.js.map +0 -1
  476. package/dist/components/solution-spatial-ref.d.ts +0 -11
  477. package/dist/components/solution-spatial-ref.js +0 -13
  478. package/dist/components/solution-spatial-ref.js.map +0 -1
  479. package/dist/components/solution-spatial-ref2.js +0 -21448
  480. package/dist/components/solution-spatial-ref2.js.map +0 -1
  481. package/dist/components/solution-store.js +0 -4094
  482. package/dist/components/solution-store.js.map +0 -1
  483. package/dist/components/solution-template-data.d.ts +0 -11
  484. package/dist/components/solution-template-data.js +0 -13
  485. package/dist/components/solution-template-data.js.map +0 -1
  486. package/dist/components/solution-template-data2.js +0 -235
  487. package/dist/components/solution-template-data2.js.map +0 -1
  488. package/dist/components/solution-variables.d.ts +0 -11
  489. package/dist/components/solution-variables.js +0 -13
  490. package/dist/components/solution-variables.js.map +0 -1
  491. package/dist/components/solution-variables2.js +0 -152
  492. package/dist/components/solution-variables2.js.map +0 -1
  493. package/dist/components/sortable.esm.js +0 -3028
  494. package/dist/components/sortable.esm.js.map +0 -1
  495. package/dist/components/store-manager.d.ts +0 -11
  496. package/dist/components/store-manager.js +0 -85
  497. package/dist/components/store-manager.js.map +0 -1
  498. package/dist/components/switch.js +0 -141
  499. package/dist/components/switch.js.map +0 -1
  500. package/dist/components/tab-nav.js +0 -243
  501. package/dist/components/tab-nav.js.map +0 -1
  502. package/dist/components/tab-title.js +0 -278
  503. package/dist/components/tab-title.js.map +0 -1
  504. package/dist/components/tab.js +0 -156
  505. package/dist/components/tab.js.map +0 -1
  506. package/dist/components/tabs.js +0 -190
  507. package/dist/components/tabs.js.map +0 -1
  508. package/dist/components/tile.js +0 -131
  509. package/dist/components/tile.js.map +0 -1
  510. package/dist/components/time-picker.js +0 -945
  511. package/dist/components/time-picker.js.map +0 -1
  512. package/dist/components/tooltip.js +0 -401
  513. package/dist/components/tooltip.js.map +0 -1
  514. package/dist/components/tree-item.js +0 -296
  515. package/dist/components/tree-item.js.map +0 -1
  516. package/dist/components/tree.js +0 -329
  517. package/dist/components/tree.js.map +0 -1
  518. package/dist/components/utils.js +0 -121
  519. package/dist/components/utils.js.map +0 -1
  520. package/dist/components/utils2.js +0 -53
  521. package/dist/components/utils2.js.map +0 -1
  522. package/dist/components/value-list-item.js +0 -206
  523. package/dist/components/value-list-item.js.map +0 -1
  524. package/dist/components/value-list.js +0 -335
  525. package/dist/components/value-list.js.map +0 -1
  526. package/dist/esm/solution-store-c1f6173a.js.map +0 -1
  527. package/dist/solutions-components/p-065830b8.js.map +0 -1
  528. package/dist/solutions-components/p-0e7a0839.entry.js.map +0 -1
  529. package/dist/solutions-components/p-401541a5.entry.js +0 -895
  530. package/dist/solutions-components/p-401541a5.entry.js.map +0 -1
  531. package/dist/solutions-components/p-ee9be0ef.entry.js.map +0 -1
@@ -8,7 +8,7 @@
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
10
  const index = require('./index-a86078a0.js');
11
- const solutionStore = require('./solution-store-f0547fe7.js');
11
+ const solutionStore = require('./solution-store-893499a5.js');
12
12
  const locale = require('./locale-746a095d.js');
13
13
  require('./index-d7f9770d.js');
14
14
  require('./interfaces-ab603e16.js');
@@ -356,6 +356,1090 @@ function _getTopLevelItemIds(templates) {
356
356
  return topLevelItemCandidateIds;
357
357
  }
358
358
 
359
+ /* Copyright (c) 2017-2020 Environmental Systems Research Institute, Inc.
360
+ * Apache-2.0 */
361
+ function decodeParam(param) {
362
+ var _a = param.split("="), key = _a[0], value = _a[1];
363
+ return { key: decodeURIComponent(key), value: decodeURIComponent(value) };
364
+ }
365
+ /**
366
+ * Decodes the passed query string as an object.
367
+ *
368
+ * @param query A string to be decoded.
369
+ * @returns A decoded query param object.
370
+ */
371
+ function decodeQueryString(query) {
372
+ return query
373
+ .replace(/^#/, "")
374
+ .split("&")
375
+ .reduce(function (acc, entry) {
376
+ var _a = decodeParam(entry), key = _a.key, value = _a.value;
377
+ acc[key] = value;
378
+ return acc;
379
+ }, {});
380
+ }
381
+
382
+ /*! *****************************************************************************
383
+ Copyright (c) Microsoft Corporation.
384
+
385
+ Permission to use, copy, modify, and/or distribute this software for any
386
+ purpose with or without fee is hereby granted.
387
+
388
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
389
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
390
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
391
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
392
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
393
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
394
+ PERFORMANCE OF THIS SOFTWARE.
395
+ ***************************************************************************** */
396
+
397
+ var __assign = function() {
398
+ __assign = Object.assign || function __assign(t) {
399
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
400
+ s = arguments[i];
401
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
402
+ }
403
+ return t;
404
+ };
405
+ return __assign.apply(this, arguments);
406
+ };
407
+
408
+ /* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
409
+ * Apache-2.0 */
410
+ function fetchToken(url, requestOptions) {
411
+ var options = requestOptions;
412
+ // we generate a response, so we can't return the raw response
413
+ options.rawResponse = false;
414
+ return solutionStore.request(url, options).then(function (response) {
415
+ var r = {
416
+ token: response.access_token,
417
+ username: response.username,
418
+ expires: new Date(
419
+ // convert seconds in response to milliseconds and add the value to the current time to calculate a static expiration timestamp
420
+ Date.now() + (response.expires_in * 1000 - 1000)),
421
+ ssl: response.ssl === true
422
+ };
423
+ if (response.refresh_token) {
424
+ r.refreshToken = response.refresh_token;
425
+ }
426
+ return r;
427
+ });
428
+ }
429
+
430
+ /* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.
431
+ * Apache-2.0 */
432
+ function generateToken(url, requestOptions) {
433
+ var options = requestOptions;
434
+ /* istanbul ignore else */
435
+ if (typeof window !== "undefined" &&
436
+ window.location &&
437
+ window.location.host) {
438
+ options.params.referer = window.location.host;
439
+ }
440
+ else {
441
+ options.params.referer = solutionStore.NODEJS_DEFAULT_REFERER_HEADER;
442
+ }
443
+ return solutionStore.request(url, options);
444
+ }
445
+
446
+ /**
447
+ * Used to test if a URL is an ArcGIS Online URL
448
+ */
449
+ var arcgisOnlineUrlRegex = /^https?:\/\/(\S+)\.arcgis\.com.+/;
450
+ function isOnline(url) {
451
+ return arcgisOnlineUrlRegex.test(url);
452
+ }
453
+ function normalizeOnlinePortalUrl(portalUrl) {
454
+ if (!arcgisOnlineUrlRegex.test(portalUrl)) {
455
+ return portalUrl;
456
+ }
457
+ switch (getOnlineEnvironment(portalUrl)) {
458
+ case "dev":
459
+ return "https://devext.arcgis.com/sharing/rest";
460
+ case "qa":
461
+ return "https://qaext.arcgis.com/sharing/rest";
462
+ default:
463
+ return "https://www.arcgis.com/sharing/rest";
464
+ }
465
+ }
466
+ function getOnlineEnvironment(url) {
467
+ if (!arcgisOnlineUrlRegex.test(url)) {
468
+ return null;
469
+ }
470
+ var match = url.match(arcgisOnlineUrlRegex);
471
+ var subdomain = match[1].split(".").pop();
472
+ if (subdomain.includes("dev")) {
473
+ return "dev";
474
+ }
475
+ if (subdomain.includes("qa")) {
476
+ return "qa";
477
+ }
478
+ return "production";
479
+ }
480
+ function isFederated(owningSystemUrl, portalUrl) {
481
+ var normalizedPortalUrl = solutionStore.cleanUrl(normalizeOnlinePortalUrl(portalUrl)).replace(/https?:\/\//, "");
482
+ var normalizedOwningSystemUrl = solutionStore.cleanUrl(owningSystemUrl).replace(/https?:\/\//, "");
483
+ return new RegExp(normalizedOwningSystemUrl, "i").test(normalizedPortalUrl);
484
+ }
485
+ function canUseOnlineToken(portalUrl, requestUrl) {
486
+ var portalIsOnline = isOnline(portalUrl);
487
+ var requestIsOnline = isOnline(requestUrl);
488
+ var portalEnv = getOnlineEnvironment(portalUrl);
489
+ var requestEnv = getOnlineEnvironment(requestUrl);
490
+ if (portalIsOnline && requestIsOnline && portalEnv === requestEnv) {
491
+ return true;
492
+ }
493
+ return false;
494
+ }
495
+
496
+ /* Copyright (c) 2018-2020 Environmental Systems Research Institute, Inc.
497
+ * Apache-2.0 */
498
+ /**
499
+ * Validates that the user has access to the application
500
+ * and if they user should be presented a "View Only" mode
501
+ *
502
+ * This is only needed/valid for Esri applications that are "licensed"
503
+ * and shipped in ArcGIS Online or ArcGIS Enterprise. Most custom applications
504
+ * should not need or use this.
505
+ *
506
+ * ```js
507
+ * import { validateAppAccess } from '@esri/arcgis-rest-auth';
508
+ *
509
+ * return validateAppAccess('your-token', 'theClientId')
510
+ * .then((result) => {
511
+ * if (!result.value) {
512
+ * // redirect or show some other ui
513
+ * } else {
514
+ * if (result.viewOnlyUserTypeApp) {
515
+ * // use this to inform your app to show a "View Only" mode
516
+ * }
517
+ * }
518
+ * })
519
+ * .catch((err) => {
520
+ * // two possible errors
521
+ * // invalid clientId: {"error":{"code":400,"messageCode":"GWM_0007","message":"Invalid request","details":[]}}
522
+ * // invalid token: {"error":{"code":498,"message":"Invalid token.","details":[]}}
523
+ * })
524
+ * ```
525
+ *
526
+ * Note: This is only usable by Esri applications hosted on *arcgis.com, *esri.com or within
527
+ * an ArcGIS Enterprise installation. Custom applications can not use this.
528
+ *
529
+ * @param token platform token
530
+ * @param clientId application client id
531
+ * @param portal Optional
532
+ */
533
+ function validateAppAccess(token, clientId, portal) {
534
+ if (portal === void 0) { portal = "https://www.arcgis.com/sharing/rest"; }
535
+ var url = portal + "/oauth2/validateAppAccess";
536
+ var ro = {
537
+ method: "POST",
538
+ params: {
539
+ f: "json",
540
+ client_id: clientId,
541
+ token: token,
542
+ },
543
+ };
544
+ return solutionStore.request(url, ro);
545
+ }
546
+
547
+ /* Copyright (c) 2017-2019 Environmental Systems Research Institute, Inc.
548
+ * Apache-2.0 */
549
+ function defer() {
550
+ var deferred = {
551
+ promise: null,
552
+ resolve: null,
553
+ reject: null,
554
+ };
555
+ deferred.promise = new Promise(function (resolve, reject) {
556
+ deferred.resolve = resolve;
557
+ deferred.reject = reject;
558
+ });
559
+ return deferred;
560
+ }
561
+ /**
562
+ * ```js
563
+ * import { UserSession } from '@esri/arcgis-rest-auth';
564
+ * UserSession.beginOAuth2({
565
+ * // register an app of your own to create a unique clientId
566
+ * clientId: "abc123",
567
+ * redirectUri: 'https://yourapp.com/authenticate.html'
568
+ * })
569
+ * .then(session)
570
+ * // or
571
+ * new UserSession({
572
+ * username: "jsmith",
573
+ * password: "123456"
574
+ * })
575
+ * // or
576
+ * UserSession.deserialize(cache)
577
+ * ```
578
+ * Used to authenticate both ArcGIS Online and ArcGIS Enterprise users. `UserSession` includes helper methods for [OAuth 2.0](/arcgis-rest-js/guides/browser-authentication/) in both browser and server applications.
579
+ */
580
+ var UserSession = /** @class */ (function () {
581
+ function UserSession(options) {
582
+ this.clientId = options.clientId;
583
+ this._refreshToken = options.refreshToken;
584
+ this._refreshTokenExpires = options.refreshTokenExpires;
585
+ this.username = options.username;
586
+ this.password = options.password;
587
+ this._token = options.token;
588
+ this._tokenExpires = options.tokenExpires;
589
+ this.portal = options.portal
590
+ ? solutionStore.cleanUrl(options.portal)
591
+ : "https://www.arcgis.com/sharing/rest";
592
+ this.ssl = options.ssl;
593
+ this.provider = options.provider || "arcgis";
594
+ this.tokenDuration = options.tokenDuration || 20160;
595
+ this.redirectUri = options.redirectUri;
596
+ this.refreshTokenTTL = options.refreshTokenTTL || 20160;
597
+ this.server = options.server;
598
+ this.federatedServers = {};
599
+ this.trustedDomains = [];
600
+ // if a non-federated server was passed explicitly, it should be trusted.
601
+ if (options.server) {
602
+ // if the url includes more than '/arcgis/', trim the rest
603
+ var root = this.getServerRootUrl(options.server);
604
+ this.federatedServers[root] = {
605
+ token: options.token,
606
+ expires: options.tokenExpires,
607
+ };
608
+ }
609
+ this._pendingTokenRequests = {};
610
+ }
611
+ Object.defineProperty(UserSession.prototype, "token", {
612
+ /**
613
+ * The current ArcGIS Online or ArcGIS Enterprise `token`.
614
+ */
615
+ get: function () {
616
+ return this._token;
617
+ },
618
+ enumerable: false,
619
+ configurable: true
620
+ });
621
+ Object.defineProperty(UserSession.prototype, "tokenExpires", {
622
+ /**
623
+ * The expiration time of the current `token`.
624
+ */
625
+ get: function () {
626
+ return this._tokenExpires;
627
+ },
628
+ enumerable: false,
629
+ configurable: true
630
+ });
631
+ Object.defineProperty(UserSession.prototype, "refreshToken", {
632
+ /**
633
+ * The current token to ArcGIS Online or ArcGIS Enterprise.
634
+ */
635
+ get: function () {
636
+ return this._refreshToken;
637
+ },
638
+ enumerable: false,
639
+ configurable: true
640
+ });
641
+ Object.defineProperty(UserSession.prototype, "refreshTokenExpires", {
642
+ /**
643
+ * The expiration time of the current `refreshToken`.
644
+ */
645
+ get: function () {
646
+ return this._refreshTokenExpires;
647
+ },
648
+ enumerable: false,
649
+ configurable: true
650
+ });
651
+ Object.defineProperty(UserSession.prototype, "trustedServers", {
652
+ /**
653
+ * Deprecated, use `federatedServers` instead.
654
+ *
655
+ * @deprecated
656
+ */
657
+ get: function () {
658
+ console.log("DEPRECATED: use federatedServers instead");
659
+ return this.federatedServers;
660
+ },
661
+ enumerable: false,
662
+ configurable: true
663
+ });
664
+ /**
665
+ * Begins a new browser-based OAuth 2.0 sign in. If `options.popup` is `true` the
666
+ * authentication window will open in a new tab/window and the function will return
667
+ * Promise&lt;UserSession&gt;. Otherwise, the user will be redirected to the
668
+ * authorization page in their current tab/window and the function will return `undefined`.
669
+ *
670
+ * @browserOnly
671
+ */
672
+ /* istanbul ignore next */
673
+ UserSession.beginOAuth2 = function (options, win) {
674
+ if (win === void 0) { win = window; }
675
+ if (options.duration) {
676
+ console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");
677
+ }
678
+ var _a = __assign({
679
+ portal: "https://www.arcgis.com/sharing/rest",
680
+ provider: "arcgis",
681
+ expiration: 20160,
682
+ popup: true,
683
+ popupWindowFeatures: "height=400,width=600,menubar=no,location=yes,resizable=yes,scrollbars=yes,status=yes",
684
+ state: options.clientId,
685
+ locale: "",
686
+ }, options), portal = _a.portal, provider = _a.provider, clientId = _a.clientId, expiration = _a.expiration, redirectUri = _a.redirectUri, popup = _a.popup, popupWindowFeatures = _a.popupWindowFeatures, state = _a.state, locale = _a.locale, params = _a.params;
687
+ var url;
688
+ if (provider === "arcgis") {
689
+ url = portal + "/oauth2/authorize?client_id=" + clientId + "&response_type=token&expiration=" + (options.duration || expiration) + "&redirect_uri=" + encodeURIComponent(redirectUri) + "&state=" + state + "&locale=" + locale;
690
+ }
691
+ else {
692
+ url = portal + "/oauth2/social/authorize?client_id=" + clientId + "&socialLoginProviderName=" + provider + "&autoAccountCreateForSocial=true&response_type=token&expiration=" + (options.duration || expiration) + "&redirect_uri=" + encodeURIComponent(redirectUri) + "&state=" + state + "&locale=" + locale;
693
+ }
694
+ // append additional params
695
+ if (params) {
696
+ url = url + "&" + solutionStore.encodeQueryString(params);
697
+ }
698
+ if (!popup) {
699
+ win.location.href = url;
700
+ return undefined;
701
+ }
702
+ var session = defer();
703
+ win["__ESRI_REST_AUTH_HANDLER_" + clientId] = function (errorString, oauthInfoString) {
704
+ if (errorString) {
705
+ var error = JSON.parse(errorString);
706
+ session.reject(new solutionStore.ArcGISAuthError(error.errorMessage, error.error));
707
+ return;
708
+ }
709
+ if (oauthInfoString) {
710
+ var oauthInfo = JSON.parse(oauthInfoString);
711
+ session.resolve(new UserSession({
712
+ clientId: clientId,
713
+ portal: portal,
714
+ ssl: oauthInfo.ssl,
715
+ token: oauthInfo.token,
716
+ tokenExpires: new Date(oauthInfo.expires),
717
+ username: oauthInfo.username,
718
+ }));
719
+ }
720
+ };
721
+ win.open(url, "oauth-window", popupWindowFeatures);
722
+ return session.promise;
723
+ };
724
+ /**
725
+ * Completes a browser-based OAuth 2.0 sign in. If `options.popup` is `true` the user
726
+ * will be returned to the previous window. Otherwise a new `UserSession`
727
+ * will be returned. You must pass the same values for `options.popup` and
728
+ * `options.portal` as you used in `beginOAuth2()`.
729
+ *
730
+ * @browserOnly
731
+ */
732
+ /* istanbul ignore next */
733
+ UserSession.completeOAuth2 = function (options, win) {
734
+ if (win === void 0) { win = window; }
735
+ var _a = __assign({ portal: "https://www.arcgis.com/sharing/rest", popup: true }, options), portal = _a.portal, clientId = _a.clientId, popup = _a.popup;
736
+ function completeSignIn(error, oauthInfo) {
737
+ try {
738
+ var handlerFn = void 0;
739
+ var handlerFnName = "__ESRI_REST_AUTH_HANDLER_" + clientId;
740
+ if (popup) {
741
+ // Guard b/c IE does not support window.opener
742
+ if (win.opener) {
743
+ if (win.opener.parent && win.opener.parent[handlerFnName]) {
744
+ handlerFn = win.opener.parent[handlerFnName];
745
+ }
746
+ else if (win.opener && win.opener[handlerFnName]) {
747
+ // support pop-out oauth from within an iframe
748
+ handlerFn = win.opener[handlerFnName];
749
+ }
750
+ }
751
+ else {
752
+ // IE
753
+ if (win !== win.parent && win.parent && win.parent[handlerFnName]) {
754
+ handlerFn = win.parent[handlerFnName];
755
+ }
756
+ }
757
+ // if we have a handler fn, call it and close the window
758
+ if (handlerFn) {
759
+ handlerFn(error ? JSON.stringify(error) : undefined, JSON.stringify(oauthInfo));
760
+ win.close();
761
+ return undefined;
762
+ }
763
+ }
764
+ }
765
+ catch (e) {
766
+ throw new solutionStore.ArcGISAuthError("Unable to complete authentication. It's possible you specified popup based oAuth2 but no handler from \"beginOAuth2()\" present. This generally happens because the \"popup\" option differs between \"beginOAuth2()\" and \"completeOAuth2()\".");
767
+ }
768
+ if (error) {
769
+ throw new solutionStore.ArcGISAuthError(error.errorMessage, error.error);
770
+ }
771
+ return new UserSession({
772
+ clientId: clientId,
773
+ portal: portal,
774
+ ssl: oauthInfo.ssl,
775
+ token: oauthInfo.token,
776
+ tokenExpires: oauthInfo.expires,
777
+ username: oauthInfo.username,
778
+ });
779
+ }
780
+ var params = decodeQueryString(win.location.hash);
781
+ if (!params.access_token) {
782
+ var error = void 0;
783
+ var errorMessage = "Unknown error";
784
+ if (params.error) {
785
+ error = params.error;
786
+ errorMessage = params.error_description;
787
+ }
788
+ return completeSignIn({ error: error, errorMessage: errorMessage });
789
+ }
790
+ var token = params.access_token;
791
+ var expires = new Date(Date.now() + parseInt(params.expires_in, 10) * 1000 - 60 * 1000);
792
+ var username = params.username;
793
+ var ssl = params.ssl === "true";
794
+ return completeSignIn(undefined, {
795
+ token: token,
796
+ expires: expires,
797
+ ssl: ssl,
798
+ username: username,
799
+ });
800
+ };
801
+ /**
802
+ * Request session information from the parent application
803
+ *
804
+ * When an application is embedded into another application via an IFrame, the embedded app can
805
+ * use `window.postMessage` to request credentials from the host application. This function wraps
806
+ * that behavior.
807
+ *
808
+ * The ArcGIS API for Javascript has this built into the Identity Manager as of the 4.19 release.
809
+ *
810
+ * Note: The parent application will not respond if the embedded app's origin is not:
811
+ * - the same origin as the parent or *.arcgis.com (JSAPI)
812
+ * - in the list of valid child origins (REST-JS)
813
+ *
814
+ *
815
+ * @param parentOrigin origin of the parent frame. Passed into the embedded application as `parentOrigin` query param
816
+ * @browserOnly
817
+ */
818
+ UserSession.fromParent = function (parentOrigin, win) {
819
+ /* istanbul ignore next: must pass in a mockwindow for tests so we can't cover the other branch */
820
+ if (!win && window) {
821
+ win = window;
822
+ }
823
+ // Declare handler outside of promise scope so we can detach it
824
+ var handler;
825
+ // return a promise that will resolve when the handler receives
826
+ // session information from the correct origin
827
+ return new Promise(function (resolve, reject) {
828
+ // create an event handler that just wraps the parentMessageHandler
829
+ handler = function (event) {
830
+ // ensure we only listen to events from the parent
831
+ if (event.source === win.parent && event.data) {
832
+ try {
833
+ return resolve(UserSession.parentMessageHandler(event));
834
+ }
835
+ catch (err) {
836
+ return reject(err);
837
+ }
838
+ }
839
+ };
840
+ // add listener
841
+ win.addEventListener("message", handler, false);
842
+ win.parent.postMessage({ type: "arcgis:auth:requestCredential" }, parentOrigin);
843
+ }).then(function (session) {
844
+ win.removeEventListener("message", handler, false);
845
+ return session;
846
+ });
847
+ };
848
+ /**
849
+ * Begins a new server-based OAuth 2.0 sign in. This will redirect the user to
850
+ * the ArcGIS Online or ArcGIS Enterprise authorization page.
851
+ *
852
+ * @nodeOnly
853
+ */
854
+ UserSession.authorize = function (options, response) {
855
+ if (options.duration) {
856
+ console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");
857
+ }
858
+ var _a = __assign({ portal: "https://arcgis.com/sharing/rest", expiration: 20160 }, options), portal = _a.portal, clientId = _a.clientId, expiration = _a.expiration, redirectUri = _a.redirectUri;
859
+ response.writeHead(301, {
860
+ Location: portal + "/oauth2/authorize?client_id=" + clientId + "&expiration=" + (options.duration || expiration) + "&response_type=code&redirect_uri=" + encodeURIComponent(redirectUri),
861
+ });
862
+ response.end();
863
+ };
864
+ /**
865
+ * Completes the server-based OAuth 2.0 sign in process by exchanging the `authorizationCode`
866
+ * for a `access_token`.
867
+ *
868
+ * @nodeOnly
869
+ */
870
+ UserSession.exchangeAuthorizationCode = function (options, authorizationCode) {
871
+ var _a = __assign({
872
+ portal: "https://www.arcgis.com/sharing/rest",
873
+ refreshTokenTTL: 20160,
874
+ }, options), portal = _a.portal, clientId = _a.clientId, redirectUri = _a.redirectUri, refreshTokenTTL = _a.refreshTokenTTL;
875
+ return fetchToken(portal + "/oauth2/token", {
876
+ params: {
877
+ grant_type: "authorization_code",
878
+ client_id: clientId,
879
+ redirect_uri: redirectUri,
880
+ code: authorizationCode,
881
+ },
882
+ }).then(function (response) {
883
+ return new UserSession({
884
+ clientId: clientId,
885
+ portal: portal,
886
+ ssl: response.ssl,
887
+ redirectUri: redirectUri,
888
+ refreshToken: response.refreshToken,
889
+ refreshTokenTTL: refreshTokenTTL,
890
+ refreshTokenExpires: new Date(Date.now() + (refreshTokenTTL - 1) * 60 * 1000),
891
+ token: response.token,
892
+ tokenExpires: response.expires,
893
+ username: response.username,
894
+ });
895
+ });
896
+ };
897
+ UserSession.deserialize = function (str) {
898
+ var options = JSON.parse(str);
899
+ return new UserSession({
900
+ clientId: options.clientId,
901
+ refreshToken: options.refreshToken,
902
+ refreshTokenExpires: new Date(options.refreshTokenExpires),
903
+ username: options.username,
904
+ password: options.password,
905
+ token: options.token,
906
+ tokenExpires: new Date(options.tokenExpires),
907
+ portal: options.portal,
908
+ ssl: options.ssl,
909
+ tokenDuration: options.tokenDuration,
910
+ redirectUri: options.redirectUri,
911
+ refreshTokenTTL: options.refreshTokenTTL,
912
+ });
913
+ };
914
+ /**
915
+ * Translates authentication from the format used in the [ArcGIS API for JavaScript](https://developers.arcgis.com/javascript/).
916
+ *
917
+ * ```js
918
+ * UserSession.fromCredential({
919
+ * userId: "jsmith",
920
+ * token: "secret"
921
+ * });
922
+ * ```
923
+ *
924
+ * @returns UserSession
925
+ */
926
+ UserSession.fromCredential = function (credential) {
927
+ // At ArcGIS Online 9.1, credentials no longer include the ssl and expires properties
928
+ // Here, we provide default values for them to cover this condition
929
+ var ssl = typeof credential.ssl !== "undefined" ? credential.ssl : true;
930
+ var expires = credential.expires || Date.now() + 7200000; /* 2 hours */
931
+ return new UserSession({
932
+ portal: credential.server.includes("sharing/rest")
933
+ ? credential.server
934
+ : credential.server + "/sharing/rest",
935
+ ssl: ssl,
936
+ token: credential.token,
937
+ username: credential.userId,
938
+ tokenExpires: new Date(expires),
939
+ });
940
+ };
941
+ /**
942
+ * Handle the response from the parent
943
+ * @param event DOM Event
944
+ */
945
+ UserSession.parentMessageHandler = function (event) {
946
+ if (event.data.type === "arcgis:auth:credential") {
947
+ return UserSession.fromCredential(event.data.credential);
948
+ }
949
+ if (event.data.type === "arcgis:auth:error") {
950
+ var err = new Error(event.data.error.message);
951
+ err.name = event.data.error.name;
952
+ throw err;
953
+ }
954
+ else {
955
+ throw new Error("Unknown message type.");
956
+ }
957
+ };
958
+ /**
959
+ * Returns authentication in a format useable in the [ArcGIS API for JavaScript](https://developers.arcgis.com/javascript/).
960
+ *
961
+ * ```js
962
+ * esriId.registerToken(session.toCredential());
963
+ * ```
964
+ *
965
+ * @returns ICredential
966
+ */
967
+ UserSession.prototype.toCredential = function () {
968
+ return {
969
+ expires: this.tokenExpires.getTime(),
970
+ server: this.portal,
971
+ ssl: this.ssl,
972
+ token: this.token,
973
+ userId: this.username,
974
+ };
975
+ };
976
+ /**
977
+ * Returns information about the currently logged in [user](https://developers.arcgis.com/rest/users-groups-and-items/user.htm). Subsequent calls will *not* result in additional web traffic.
978
+ *
979
+ * ```js
980
+ * session.getUser()
981
+ * .then(response => {
982
+ * console.log(response.role); // "org_admin"
983
+ * })
984
+ * ```
985
+ *
986
+ * @param requestOptions - Options for the request. NOTE: `rawResponse` is not supported by this operation.
987
+ * @returns A Promise that will resolve with the data from the response.
988
+ */
989
+ UserSession.prototype.getUser = function (requestOptions) {
990
+ var _this = this;
991
+ if (this._pendingUserRequest) {
992
+ return this._pendingUserRequest;
993
+ }
994
+ else if (this._user) {
995
+ return Promise.resolve(this._user);
996
+ }
997
+ else {
998
+ var url = this.portal + "/community/self";
999
+ var options = __assign(__assign({ httpMethod: "GET", authentication: this }, requestOptions), { rawResponse: false });
1000
+ this._pendingUserRequest = solutionStore.request(url, options).then(function (response) {
1001
+ _this._user = response;
1002
+ _this._pendingUserRequest = null;
1003
+ return response;
1004
+ });
1005
+ return this._pendingUserRequest;
1006
+ }
1007
+ };
1008
+ /**
1009
+ * Returns information about the currently logged in user's [portal](https://developers.arcgis.com/rest/users-groups-and-items/portal-self.htm). Subsequent calls will *not* result in additional web traffic.
1010
+ *
1011
+ * ```js
1012
+ * session.getPortal()
1013
+ * .then(response => {
1014
+ * console.log(portal.name); // "City of ..."
1015
+ * })
1016
+ * ```
1017
+ *
1018
+ * @param requestOptions - Options for the request. NOTE: `rawResponse` is not supported by this operation.
1019
+ * @returns A Promise that will resolve with the data from the response.
1020
+ */
1021
+ UserSession.prototype.getPortal = function (requestOptions) {
1022
+ var _this = this;
1023
+ if (this._pendingPortalRequest) {
1024
+ return this._pendingPortalRequest;
1025
+ }
1026
+ else if (this._portalInfo) {
1027
+ return Promise.resolve(this._portalInfo);
1028
+ }
1029
+ else {
1030
+ var url = this.portal + "/portals/self";
1031
+ var options = __assign(__assign({ httpMethod: "GET", authentication: this }, requestOptions), { rawResponse: false });
1032
+ this._pendingPortalRequest = solutionStore.request(url, options).then(function (response) {
1033
+ _this._portalInfo = response;
1034
+ _this._pendingPortalRequest = null;
1035
+ return response;
1036
+ });
1037
+ return this._pendingPortalRequest;
1038
+ }
1039
+ };
1040
+ /**
1041
+ * Returns the username for the currently logged in [user](https://developers.arcgis.com/rest/users-groups-and-items/user.htm). Subsequent calls will *not* result in additional web traffic. This is also used internally when a username is required for some requests but is not present in the options.
1042
+ *
1043
+ * * ```js
1044
+ * session.getUsername()
1045
+ * .then(response => {
1046
+ * console.log(response); // "casey_jones"
1047
+ * })
1048
+ * ```
1049
+ */
1050
+ UserSession.prototype.getUsername = function () {
1051
+ if (this.username) {
1052
+ return Promise.resolve(this.username);
1053
+ }
1054
+ else if (this._user) {
1055
+ return Promise.resolve(this._user.username);
1056
+ }
1057
+ else {
1058
+ return this.getUser().then(function (user) {
1059
+ return user.username;
1060
+ });
1061
+ }
1062
+ };
1063
+ /**
1064
+ * Gets an appropriate token for the given URL. If `portal` is ArcGIS Online and
1065
+ * the request is to an ArcGIS Online domain `token` will be used. If the request
1066
+ * is to the current `portal` the current `token` will also be used. However if
1067
+ * the request is to an unknown server we will validate the server with a request
1068
+ * to our current `portal`.
1069
+ */
1070
+ UserSession.prototype.getToken = function (url, requestOptions) {
1071
+ if (canUseOnlineToken(this.portal, url)) {
1072
+ return this.getFreshToken(requestOptions);
1073
+ }
1074
+ else if (new RegExp(this.portal, "i").test(url)) {
1075
+ return this.getFreshToken(requestOptions);
1076
+ }
1077
+ else {
1078
+ return this.getTokenForServer(url, requestOptions);
1079
+ }
1080
+ };
1081
+ /**
1082
+ * Get application access information for the current user
1083
+ * see `validateAppAccess` function for details
1084
+ *
1085
+ * @param clientId application client id
1086
+ */
1087
+ UserSession.prototype.validateAppAccess = function (clientId) {
1088
+ return this.getToken(this.portal).then(function (token) {
1089
+ return validateAppAccess(token, clientId);
1090
+ });
1091
+ };
1092
+ UserSession.prototype.toJSON = function () {
1093
+ return {
1094
+ clientId: this.clientId,
1095
+ refreshToken: this.refreshToken,
1096
+ refreshTokenExpires: this.refreshTokenExpires,
1097
+ username: this.username,
1098
+ password: this.password,
1099
+ token: this.token,
1100
+ tokenExpires: this.tokenExpires,
1101
+ portal: this.portal,
1102
+ ssl: this.ssl,
1103
+ tokenDuration: this.tokenDuration,
1104
+ redirectUri: this.redirectUri,
1105
+ refreshTokenTTL: this.refreshTokenTTL,
1106
+ };
1107
+ };
1108
+ UserSession.prototype.serialize = function () {
1109
+ return JSON.stringify(this);
1110
+ };
1111
+ /**
1112
+ * For a "Host" app that embeds other platform apps via iframes, after authenticating the user
1113
+ * and creating a UserSession, the app can then enable "post message" style authentication by calling
1114
+ * this method.
1115
+ *
1116
+ * Internally this adds an event listener on window for the `message` event
1117
+ *
1118
+ * @param validChildOrigins Array of origins that are allowed to request authentication from the host app
1119
+ */
1120
+ UserSession.prototype.enablePostMessageAuth = function (validChildOrigins, win) {
1121
+ /* istanbul ignore next: must pass in a mockwindow for tests so we can't cover the other branch */
1122
+ if (!win && window) {
1123
+ win = window;
1124
+ }
1125
+ this._hostHandler = this.createPostMessageHandler(validChildOrigins);
1126
+ win.addEventListener("message", this._hostHandler, false);
1127
+ };
1128
+ /**
1129
+ * For a "Host" app that has embedded other platform apps via iframes, when the host needs
1130
+ * to transition routes, it should call `UserSession.disablePostMessageAuth()` to remove
1131
+ * the event listener and prevent memory leaks
1132
+ */
1133
+ UserSession.prototype.disablePostMessageAuth = function (win) {
1134
+ /* istanbul ignore next: must pass in a mockwindow for tests so we can't cover the other branch */
1135
+ if (!win && window) {
1136
+ win = window;
1137
+ }
1138
+ win.removeEventListener("message", this._hostHandler, false);
1139
+ };
1140
+ /**
1141
+ * Manually refreshes the current `token` and `tokenExpires`.
1142
+ */
1143
+ UserSession.prototype.refreshSession = function (requestOptions) {
1144
+ // make sure subsequent calls to getUser() don't returned cached metadata
1145
+ this._user = null;
1146
+ if (this.username && this.password) {
1147
+ return this.refreshWithUsernameAndPassword(requestOptions);
1148
+ }
1149
+ if (this.clientId && this.refreshToken) {
1150
+ return this.refreshWithRefreshToken();
1151
+ }
1152
+ return Promise.reject(new solutionStore.ArcGISAuthError("Unable to refresh token."));
1153
+ };
1154
+ /**
1155
+ * Determines the root of the ArcGIS Server or Portal for a given URL.
1156
+ *
1157
+ * @param url the URl to determine the root url for.
1158
+ */
1159
+ UserSession.prototype.getServerRootUrl = function (url) {
1160
+ var root = solutionStore.cleanUrl(url).split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/)[0];
1161
+ var _a = root.match(/(https?:\/\/)(.+)/), protocol = _a[1], domainAndPath = _a[2];
1162
+ var _b = domainAndPath.split("/"), domain = _b[0], path = _b.slice(1);
1163
+ // only the domain is lowercased because in some cases an org id might be
1164
+ // in the path which cannot be lowercased.
1165
+ return "" + protocol + domain.toLowerCase() + "/" + path.join("/");
1166
+ };
1167
+ /**
1168
+ * Returns the proper [`credentials`] option for `fetch` for a given domain.
1169
+ * See [trusted server](https://enterprise.arcgis.com/en/portal/latest/administer/windows/configure-security.htm#ESRI_SECTION1_70CC159B3540440AB325BE5D89DBE94A).
1170
+ * Used internally by underlying request methods to add support for specific security considerations.
1171
+ *
1172
+ * @param url The url of the request
1173
+ * @returns "include" or "same-origin"
1174
+ */
1175
+ UserSession.prototype.getDomainCredentials = function (url) {
1176
+ if (!this.trustedDomains || !this.trustedDomains.length) {
1177
+ return "same-origin";
1178
+ }
1179
+ return this.trustedDomains.some(function (domainWithProtocol) {
1180
+ return url.startsWith(domainWithProtocol);
1181
+ })
1182
+ ? "include"
1183
+ : "same-origin";
1184
+ };
1185
+ /**
1186
+ * Return a function that closes over the validOrigins array and
1187
+ * can be used as an event handler for the `message` event
1188
+ *
1189
+ * @param validOrigins Array of valid origins
1190
+ */
1191
+ UserSession.prototype.createPostMessageHandler = function (validOrigins) {
1192
+ var _this = this;
1193
+ // return a function that closes over the validOrigins and
1194
+ // has access to the credential
1195
+ return function (event) {
1196
+ // Verify that the origin is valid
1197
+ // Note: do not use regex's here. validOrigins is an array so we're checking that the event's origin
1198
+ // is in the array via exact match. More info about avoiding postMessage xss issues here
1199
+ // https://jlajara.gitlab.io/web/2020/07/17/Dom_XSS_PostMessage_2.html#tipsbypasses-in-postmessage-vulnerabilities
1200
+ var isValidOrigin = validOrigins.indexOf(event.origin) > -1;
1201
+ // JSAPI handles this slightly differently - instead of checking a list, it will respond if
1202
+ // event.origin === window.location.origin || event.origin.endsWith('.arcgis.com')
1203
+ // For Hub, and to enable cross domain debugging with port's in urls, we are opting to
1204
+ // use a list of valid origins
1205
+ // Ensure the message type is something we want to handle
1206
+ var isValidType = event.data.type === "arcgis:auth:requestCredential";
1207
+ var isTokenValid = _this.tokenExpires.getTime() > Date.now();
1208
+ if (isValidOrigin && isValidType) {
1209
+ var msg = {};
1210
+ if (isTokenValid) {
1211
+ var credential = _this.toCredential();
1212
+ // arcgis:auth:error with {name: "", message: ""}
1213
+ // the following line allows us to conform to our spec without changing other depended-on functionality
1214
+ // https://github.com/Esri/arcgis-rest-js/blob/master/packages/arcgis-rest-auth/post-message-auth-spec.md#arcgisauthcredential
1215
+ credential.server = credential.server.replace("/sharing/rest", "");
1216
+ msg = { type: "arcgis:auth:credential", credential: credential };
1217
+ }
1218
+ else {
1219
+ // Return an error
1220
+ msg = {
1221
+ type: "arcgis:auth:error",
1222
+ error: {
1223
+ name: "tokenExpiredError",
1224
+ message: "Session token was expired, and not returned to the child application",
1225
+ },
1226
+ };
1227
+ }
1228
+ event.source.postMessage(msg, event.origin);
1229
+ }
1230
+ };
1231
+ };
1232
+ /**
1233
+ * Validates that a given URL is properly federated with our current `portal`.
1234
+ * Attempts to use the internal `federatedServers` cache first.
1235
+ */
1236
+ UserSession.prototype.getTokenForServer = function (url, requestOptions) {
1237
+ var _this = this;
1238
+ // requests to /rest/services/ and /rest/admin/services/ are both valid
1239
+ // Federated servers may have inconsistent casing, so lowerCase it
1240
+ var root = this.getServerRootUrl(url);
1241
+ var existingToken = this.federatedServers[root];
1242
+ if (existingToken &&
1243
+ existingToken.expires &&
1244
+ existingToken.expires.getTime() > Date.now()) {
1245
+ return Promise.resolve(existingToken.token);
1246
+ }
1247
+ if (this._pendingTokenRequests[root]) {
1248
+ return this._pendingTokenRequests[root];
1249
+ }
1250
+ this._pendingTokenRequests[root] = this.fetchAuthorizedDomains().then(function () {
1251
+ return solutionStore.request(root + "/rest/info", {
1252
+ credentials: _this.getDomainCredentials(url),
1253
+ })
1254
+ .then(function (response) {
1255
+ if (response.owningSystemUrl) {
1256
+ /**
1257
+ * if this server is not owned by this portal
1258
+ * bail out with an error since we know we wont
1259
+ * be able to generate a token
1260
+ */
1261
+ if (!isFederated(response.owningSystemUrl, _this.portal)) {
1262
+ throw new solutionStore.ArcGISAuthError(url + " is not federated with " + _this.portal + ".", "NOT_FEDERATED");
1263
+ }
1264
+ else {
1265
+ /**
1266
+ * if the server is federated, use the relevant token endpoint.
1267
+ */
1268
+ return solutionStore.request(response.owningSystemUrl + "/sharing/rest/info", requestOptions);
1269
+ }
1270
+ }
1271
+ else if (response.authInfo &&
1272
+ _this.federatedServers[root] !== undefined) {
1273
+ /**
1274
+ * if its a stand-alone instance of ArcGIS Server that doesn't advertise
1275
+ * federation, but the root server url is recognized, use its built in token endpoint.
1276
+ */
1277
+ return Promise.resolve({
1278
+ authInfo: response.authInfo,
1279
+ });
1280
+ }
1281
+ else {
1282
+ throw new solutionStore.ArcGISAuthError(url + " is not federated with any portal and is not explicitly trusted.", "NOT_FEDERATED");
1283
+ }
1284
+ })
1285
+ .then(function (response) {
1286
+ return response.authInfo.tokenServicesUrl;
1287
+ })
1288
+ .then(function (tokenServicesUrl) {
1289
+ // an expired token cant be used to generate a new token
1290
+ if (_this.token && _this.tokenExpires.getTime() > Date.now()) {
1291
+ return generateToken(tokenServicesUrl, {
1292
+ params: {
1293
+ token: _this.token,
1294
+ serverUrl: url,
1295
+ expiration: _this.tokenDuration,
1296
+ client: "referer",
1297
+ },
1298
+ });
1299
+ // generate an entirely fresh token if necessary
1300
+ }
1301
+ else {
1302
+ return generateToken(tokenServicesUrl, {
1303
+ params: {
1304
+ username: _this.username,
1305
+ password: _this.password,
1306
+ expiration: _this.tokenDuration,
1307
+ client: "referer",
1308
+ },
1309
+ }).then(function (response) {
1310
+ _this._token = response.token;
1311
+ _this._tokenExpires = new Date(response.expires);
1312
+ return response;
1313
+ });
1314
+ }
1315
+ })
1316
+ .then(function (response) {
1317
+ _this.federatedServers[root] = {
1318
+ expires: new Date(response.expires),
1319
+ token: response.token,
1320
+ };
1321
+ delete _this._pendingTokenRequests[root];
1322
+ return response.token;
1323
+ });
1324
+ });
1325
+ return this._pendingTokenRequests[root];
1326
+ };
1327
+ /**
1328
+ * Returns an unexpired token for the current `portal`.
1329
+ */
1330
+ UserSession.prototype.getFreshToken = function (requestOptions) {
1331
+ var _this = this;
1332
+ if (this.token && !this.tokenExpires) {
1333
+ return Promise.resolve(this.token);
1334
+ }
1335
+ if (this.token &&
1336
+ this.tokenExpires &&
1337
+ this.tokenExpires.getTime() > Date.now()) {
1338
+ return Promise.resolve(this.token);
1339
+ }
1340
+ if (!this._pendingTokenRequests[this.portal]) {
1341
+ this._pendingTokenRequests[this.portal] = this.refreshSession(requestOptions).then(function (session) {
1342
+ _this._pendingTokenRequests[_this.portal] = null;
1343
+ return session.token;
1344
+ });
1345
+ }
1346
+ return this._pendingTokenRequests[this.portal];
1347
+ };
1348
+ /**
1349
+ * Refreshes the current `token` and `tokenExpires` with `username` and
1350
+ * `password`.
1351
+ */
1352
+ UserSession.prototype.refreshWithUsernameAndPassword = function (requestOptions) {
1353
+ var _this = this;
1354
+ var options = __assign({ params: {
1355
+ username: this.username,
1356
+ password: this.password,
1357
+ expiration: this.tokenDuration,
1358
+ } }, requestOptions);
1359
+ return generateToken(this.portal + "/generateToken", options).then(function (response) {
1360
+ _this._token = response.token;
1361
+ _this._tokenExpires = new Date(response.expires);
1362
+ return _this;
1363
+ });
1364
+ };
1365
+ /**
1366
+ * Refreshes the current `token` and `tokenExpires` with `refreshToken`.
1367
+ */
1368
+ UserSession.prototype.refreshWithRefreshToken = function (requestOptions) {
1369
+ var _this = this;
1370
+ if (this.refreshToken &&
1371
+ this.refreshTokenExpires &&
1372
+ this.refreshTokenExpires.getTime() < Date.now()) {
1373
+ return this.refreshRefreshToken(requestOptions);
1374
+ }
1375
+ var options = __assign({ params: {
1376
+ client_id: this.clientId,
1377
+ refresh_token: this.refreshToken,
1378
+ grant_type: "refresh_token",
1379
+ } }, requestOptions);
1380
+ return fetchToken(this.portal + "/oauth2/token", options).then(function (response) {
1381
+ _this._token = response.token;
1382
+ _this._tokenExpires = response.expires;
1383
+ return _this;
1384
+ });
1385
+ };
1386
+ /**
1387
+ * Exchanges an unexpired `refreshToken` for a new one, also updates `token` and
1388
+ * `tokenExpires`.
1389
+ */
1390
+ UserSession.prototype.refreshRefreshToken = function (requestOptions) {
1391
+ var _this = this;
1392
+ var options = __assign({ params: {
1393
+ client_id: this.clientId,
1394
+ refresh_token: this.refreshToken,
1395
+ redirect_uri: this.redirectUri,
1396
+ grant_type: "exchange_refresh_token",
1397
+ } }, requestOptions);
1398
+ return fetchToken(this.portal + "/oauth2/token", options).then(function (response) {
1399
+ _this._token = response.token;
1400
+ _this._tokenExpires = response.expires;
1401
+ _this._refreshToken = response.refreshToken;
1402
+ _this._refreshTokenExpires = new Date(Date.now() + (_this.refreshTokenTTL - 1) * 60 * 1000);
1403
+ return _this;
1404
+ });
1405
+ };
1406
+ /**
1407
+ * ensures that the authorizedCrossOriginDomains are obtained from the portal and cached
1408
+ * so we can check them later.
1409
+ *
1410
+ * @returns this
1411
+ */
1412
+ UserSession.prototype.fetchAuthorizedDomains = function () {
1413
+ var _this = this;
1414
+ // if this token is for a specific server or we don't have a portal
1415
+ // don't get the portal info because we cant get the authorizedCrossOriginDomains
1416
+ if (this.server || !this.portal) {
1417
+ return Promise.resolve(this);
1418
+ }
1419
+ return this.getPortal().then(function (portalInfo) {
1420
+ /**
1421
+ * Specific domains can be configured as secure.esri.com or https://secure.esri.com this
1422
+ * normalizes to https://secure.esri.com so we can use startsWith later.
1423
+ */
1424
+ if (portalInfo.authorizedCrossOriginDomains &&
1425
+ portalInfo.authorizedCrossOriginDomains.length) {
1426
+ _this.trustedDomains = portalInfo.authorizedCrossOriginDomains
1427
+ .filter(function (d) { return !d.startsWith("http://"); })
1428
+ .map(function (d) {
1429
+ if (d.startsWith("https://")) {
1430
+ return d;
1431
+ }
1432
+ else {
1433
+ return "https://" + d;
1434
+ }
1435
+ });
1436
+ }
1437
+ return _this;
1438
+ });
1439
+ };
1440
+ return UserSession;
1441
+ }());
1442
+
359
1443
  const solutionConfigurationCss = ".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%}.config-solution{position:absolute;top:3.5rem;right:-1px;bottom:-1px;left:-1px;display:flex;padding:0.5rem}.config-inventory{display:inline;max-width:-moz-min-content;max-width:min-content;flex-grow:0;overflow-y:auto}.config-inventory-hide{display:none;max-width:-moz-min-content;max-width:min-content;flex-grow:0;overflow-y:auto}.config-item{position:relative;display:inline;flex-grow:1;overflow-y:auto;-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}solution-contents{position:relative;height:100%}solution-item{position:relative;height:100%}solution-spatial-ref{position:relative;height:100%;width:100%;overflow-y:auto}";
360
1444
 
361
1445
  const SolutionConfiguration = class {
@@ -370,7 +1454,7 @@ const SolutionConfiguration = class {
370
1454
  this._solutionEditorHasChanges = false;
371
1455
  this._solutionEditorHasErrors = false;
372
1456
  this._canSave = false;
373
- this.authentication = undefined;
1457
+ this.authentication = new UserSession({});
374
1458
  this.solutionItemId = "";
375
1459
  this.showLoading = false;
376
1460
  this._currentEditItemId = "";
@@ -393,6 +1477,7 @@ const SolutionConfiguration = class {
393
1477
  });
394
1478
  }
395
1479
  async valueWatchHandler() {
1480
+ console.log("update solution config " + this.solutionItemId); //???
396
1481
  await this._loadSolution(this.solutionItemId);
397
1482
  }
398
1483
  /**
@@ -407,8 +1492,12 @@ const SolutionConfiguration = class {
407
1492
  * Renders the component.
408
1493
  */
409
1494
  render() {
1495
+ console.log("render solution config " + this.solutionItemId); //???
410
1496
  const wkid = solutionStore.getProp(solutionStore.state.getStoreInfo("spatialReferenceInfo"), "spatialReference");
411
1497
  const hasServices = solutionStore.state.getStoreInfo("featureServices").length > 0;
1498
+ const solutionData = solutionStore.state.getStoreInfo("solutionData");
1499
+ this._solutionVariables = JSON.stringify(getSolutionVariables(solutionData.templates, this._translations));
1500
+ this._organizationVariables = JSON.stringify(getOrganizationVariables(this._translations));
412
1501
  return (index.h(index.Host, null, !this._solutionIsLoaded
413
1502
  ? index.h("calcite-loader", { active: true, label: '' })
414
1503
  : null, index.h("div", { class: "configuration-container" }, index.h("div", { class: "configuration" }, index.h("calcite-tabs", { class: "config-tabs" }, index.h("calcite-tab-nav", { slot: "tab-nav" }, index.h("calcite-tab-title", null, this._translations.definitionTab), hasServices ?
@@ -507,8 +1596,6 @@ const SolutionConfiguration = class {
507
1596
  */
508
1597
  _initProps() {
509
1598
  const solutionData = solutionStore.state.getStoreInfo("solutionData");
510
- this._solutionVariables = JSON.stringify(getSolutionVariables(solutionData.templates, this._translations));
511
- this._organizationVariables = JSON.stringify(getOrganizationVariables(this._translations));
512
1599
  this._templateHierarchy = [...getInventoryItems(solutionData.templates)];
513
1600
  if (this._solutionContentsComponent) {
514
1601
  this._solutionContentsComponent.templateHierarchy = this._templateHierarchy;
@@ -517,6 +1604,10 @@ const SolutionConfiguration = class {
517
1604
  if (this._templateHierarchy.length > 0) {
518
1605
  // Start with the first item in the contents
519
1606
  firstItem = solutionStore.state.getItemInfo(this._templateHierarchy[0].id);
1607
+ console.log("init with first item " + firstItem.itemId); //???
1608
+ }
1609
+ else {
1610
+ console.log("no initial first item"); //???
520
1611
  }
521
1612
  this._currentEditItemId = firstItem ? firstItem.itemId : "";
522
1613
  }