@esri/solutions-components 5.1.0-next.100 → 5.1.0-next.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/dist/cdn/24OJQL75.js +2 -0
  2. package/dist/cdn/2AXKBNIN.js +2 -0
  3. package/dist/cdn/{CEP54NLT.js → 2C4DK6YC.js} +1 -1
  4. package/dist/cdn/2HGZUNIC.js +2 -0
  5. package/dist/cdn/{E63XW5PH.js → 3NPBN2B4.js} +1 -1
  6. package/dist/cdn/{HHVIWWK2.js → 45UNI2VP.js} +2 -2
  7. package/dist/cdn/4SPIPOYO.js +2 -0
  8. package/dist/cdn/5LX6ROQC.js +384 -0
  9. package/dist/cdn/64ZLSOK3.js +2 -0
  10. package/dist/cdn/{MVYIHKFK.js → 66BZFR5Z.js} +1 -1
  11. package/dist/cdn/{ULTK7DMM.js → 6GOYDVLJ.js} +1 -1
  12. package/dist/cdn/{IVSYM7YY.js → 6UTDTBHM.js} +1 -1
  13. package/dist/cdn/{76APML4N.js → 76OYXG7R.js} +1 -1
  14. package/dist/cdn/{XKFPWKMX.js → 7EPZDMA2.js} +1 -1
  15. package/dist/cdn/{7SJP3QTP.js → 7SFTLJTV.js} +1 -1
  16. package/dist/cdn/7X5K32QE.js +2 -0
  17. package/dist/cdn/{AY6K2SJI.js → A2SX6EF7.js} +1 -1
  18. package/dist/cdn/{2MK34V3V.js → ADTHTFGI.js} +1 -1
  19. package/dist/cdn/{IEKNRCBC.js → AFMPPVMO.js} +1 -1
  20. package/dist/cdn/{TFZ2AK22.js → ANZVLZYR.js} +1 -1
  21. package/dist/cdn/{VG6ML5VK.js → AO3QYZNQ.js} +1 -1
  22. package/dist/cdn/AOTEIDXK.js +2 -0
  23. package/dist/cdn/{X23TE3BV.js → AYO5GP4M.js} +1 -1
  24. package/dist/cdn/{DHPZIFHE.js → B4EWPUMU.js} +1 -1
  25. package/dist/cdn/{74OJ22BW.js → BELRJU3A.js} +1 -1
  26. package/dist/cdn/{ZS6XB5WK.js → BYU5RVVM.js} +1 -1
  27. package/dist/cdn/{J3MAWMYQ.js → CNY6H6U2.js} +1 -1
  28. package/dist/cdn/{44R32SU3.js → CZZN3R4F.js} +1 -1
  29. package/dist/cdn/{ZYCAAXQF.js → DINEURA2.js} +1 -1
  30. package/dist/cdn/{W6E3DYEQ.js → EW4O5UX4.js} +1 -1
  31. package/dist/cdn/{E6YARJM2.js → G4OMMOS4.js} +1 -1
  32. package/dist/cdn/GKT3GU2L.js +2 -0
  33. package/dist/cdn/GU4QAZMD.js +2 -0
  34. package/dist/cdn/{7RFQ7MW2.js → IGIHPCRS.js} +1 -1
  35. package/dist/cdn/{CRFLICFH.js → IIOO4ABM.js} +1 -1
  36. package/dist/cdn/{V3YTRV33.js → JMVHSWQR.js} +1 -1
  37. package/dist/cdn/JPJ2PWRJ.js +2 -0
  38. package/dist/cdn/{2PM224B6.js → JUJ5KUGK.js} +1 -1
  39. package/dist/cdn/{UUPARGLA.js → LYNVZ7EL.js} +1 -1
  40. package/dist/cdn/{NBPM6OJQ.js → MSEGWVWC.js} +19 -19
  41. package/dist/cdn/{66NSOJUX.js → MT2QHKUQ.js} +1 -1
  42. package/dist/cdn/{DJFXVUF7.js → N3FJFS6W.js} +1 -1
  43. package/dist/cdn/{GSK7CUMC.js → NBJK6Z7L.js} +1 -1
  44. package/dist/cdn/{R3QHE3VT.js → O5PAINAH.js} +1 -1
  45. package/dist/cdn/O7TCCL6B.js +2 -0
  46. package/dist/cdn/P2QWXLFJ.js +2 -0
  47. package/dist/cdn/{Q6XLTRMA.js → P76UNULK.js} +1 -1
  48. package/dist/cdn/{OIRNHTN3.js → PCZFIXAY.js} +1 -1
  49. package/dist/cdn/{OG6IMWBH.js → PDE6N2YM.js} +1 -1
  50. package/dist/cdn/{U77O2MIG.js → PQPNCADS.js} +1 -1
  51. package/dist/cdn/{KH2WXNMT.js → RQIBNHBN.js} +1 -1
  52. package/dist/cdn/{4QJK4LPR.js → S7ZM2RFD.js} +1 -1
  53. package/dist/cdn/{HNVWONX2.js → SKUGEKDV.js} +1 -1
  54. package/dist/cdn/{2ASJ2RMU.js → SR53JCI4.js} +1 -1
  55. package/dist/cdn/{LOINOBXI.js → TDY54Z67.js} +1 -1
  56. package/dist/cdn/{2HLILJFJ.js → TS7GYVPR.js} +1 -1
  57. package/dist/cdn/{HM4YDFBC.js → TWO6FJHP.js} +1 -1
  58. package/dist/cdn/UUGWRXGN.js +2 -0
  59. package/dist/cdn/{Y3PCMVG7.js → UUMJMH3T.js} +1 -1
  60. package/dist/cdn/VB5C4Z27.js +2 -0
  61. package/dist/cdn/VK6ZOC6A.js +2 -0
  62. package/dist/cdn/WNH3PY6X.js +2 -0
  63. package/dist/cdn/{J75MHJID.js → WU7QCA5H.js} +1 -1
  64. package/dist/cdn/{VLBW4YNM.js → WZ22NICV.js} +1 -1
  65. package/dist/cdn/{DQWJUYMM.js → XF533XOH.js} +1 -1
  66. package/dist/cdn/{YOAGUXW6.js → XKMN6N5I.js} +1 -1
  67. package/dist/cdn/{QZRJRLYA.js → XMHHBXM6.js} +1 -1
  68. package/dist/cdn/{RG2D7ZRS.js → Y2ROEEOX.js} +2 -2
  69. package/dist/cdn/{D5FLGJ5G.js → YXJJ5QPI.js} +1 -1
  70. package/dist/cdn/{3RJKHADA.js → ZPOWEU76.js} +1 -1
  71. package/dist/cdn/{6ENQ42XY.js → ZT5TOVYM.js} +1 -1
  72. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.en.json +1 -1
  73. package/dist/cdn/assets/arcgis-solutions-assistant/t9n/messages.json +1 -1
  74. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ar.json +1 -1
  75. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bg.json +1 -1
  76. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.bs.json +1 -1
  77. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ca.json +1 -1
  78. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.cs.json +1 -1
  79. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.da.json +1 -1
  80. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.de.json +1 -1
  81. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.el.json +1 -1
  82. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.en.json +1 -1
  83. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.es.json +1 -1
  84. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.et.json +1 -1
  85. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fi.json +1 -1
  86. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.fr.json +1 -1
  87. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.he.json +1 -1
  88. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hr.json +1 -1
  89. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.hu.json +1 -1
  90. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.id.json +1 -1
  91. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.it.json +1 -1
  92. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ja.json +1 -1
  93. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.json +1 -1
  94. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ko.json +1 -1
  95. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lt.json +1 -1
  96. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.lv.json +1 -1
  97. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.nl.json +1 -1
  98. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.no.json +1 -1
  99. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pl.json +1 -1
  100. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-BR.json +1 -1
  101. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.pt-PT.json +1 -1
  102. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ro.json +1 -1
  103. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.ru.json +1 -1
  104. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sk.json +1 -1
  105. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sl.json +1 -1
  106. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sr.json +1 -1
  107. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.sv.json +1 -1
  108. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.th.json +1 -1
  109. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.tr.json +1 -1
  110. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.uk.json +1 -1
  111. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.vi.json +1 -1
  112. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-CN.json +1 -1
  113. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-HK.json +1 -1
  114. package/dist/cdn/assets/solution-builder-assistant/t9n/messages.zh-TW.json +1 -1
  115. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.en.json +1 -1
  116. package/dist/cdn/assets/solution-deployed-card-panel/t9n/messages.json +1 -1
  117. package/dist/cdn/index.js +1 -1
  118. package/dist/chunks/CardsFetcher.js +287 -0
  119. package/dist/chunks/cardFetchingUtils.js +22 -304
  120. package/dist/chunks/cardsHelpers.js +6 -6
  121. package/dist/chunks/converter.js +72 -28
  122. package/dist/chunks/downloadUtils.js +246 -235
  123. package/dist/chunks/helpers.js +38 -43
  124. package/dist/chunks/interfaces.js +1 -1
  125. package/dist/chunks/popupUtils.js +2 -2
  126. package/dist/chunks/queryUtils.js +3 -3
  127. package/dist/chunks/solutions-deploy-app-nav.js +1 -1
  128. package/dist/components/arcgis-solutions-assistant/customElement.d.ts +2 -0
  129. package/dist/components/arcgis-solutions-assistant/customElement.js +9725 -8601
  130. package/dist/components/buffer-tools/customElement.d.ts +4 -3
  131. package/dist/components/card-manager/customElement.d.ts +4 -3
  132. package/dist/components/consent-manager/customElement.d.ts +2 -2
  133. package/dist/components/create-feature/customElement.d.ts +2 -2
  134. package/dist/components/create-feature/customElement.js +13 -13
  135. package/dist/components/create-related-feature/customElement.d.ts +6 -4
  136. package/dist/components/create-related-feature/customElement.js +2 -2
  137. package/dist/components/crowdsource-reporter/customElement.d.ts +2 -2
  138. package/dist/components/crowdsource-reporter/customElement.js +4 -4
  139. package/dist/components/delete-button/customElement.d.ts +2 -2
  140. package/dist/components/delete-dialog/customElement.d.ts +2 -2
  141. package/dist/components/edit-card/customElement.d.ts +7 -5
  142. package/dist/components/edit-card/customElement.js +2 -2
  143. package/dist/components/feature-details/customElement.d.ts +7 -6
  144. package/dist/components/feature-details/customElement.js +2 -2
  145. package/dist/components/feature-list/customElement.d.ts +4 -3
  146. package/dist/components/feature-list/customElement.js +3 -3
  147. package/dist/components/field-selection/customElement.d.ts +6 -4
  148. package/dist/components/info-card/customElement.d.ts +6 -5
  149. package/dist/components/info-card/customElement.js +2 -2
  150. package/dist/components/layer-list/customElement.d.ts +2 -2
  151. package/dist/components/layer-list/customElement.js +2 -2
  152. package/dist/components/layer-list-widget/customElement.d.ts +4 -3
  153. package/dist/components/layer-list-widget/customElement.js +1 -1
  154. package/dist/components/layer-table/customElement.d.ts +4 -3
  155. package/dist/components/layer-table/customElement.js +5 -5
  156. package/dist/components/map-basemap-gallery/customElement.d.ts +4 -3
  157. package/dist/components/map-basemap-gallery/customElement.js +2 -2
  158. package/dist/components/map-card/customElement.d.ts +7 -5
  159. package/dist/components/map-card/customElement.js +4 -4
  160. package/dist/components/map-draw-tools/customElement.d.ts +10 -6
  161. package/dist/components/map-draw-tools/customElement.js +3 -3
  162. package/dist/components/map-floor-filter/customElement.d.ts +4 -3
  163. package/dist/components/map-floor-filter/customElement.js +2 -2
  164. package/dist/components/map-fullscreen/customElement.d.ts +4 -3
  165. package/dist/components/map-fullscreen/customElement.js +2 -2
  166. package/dist/components/map-layer-picker/customElement.d.ts +2 -2
  167. package/dist/components/map-legend/customElement.d.ts +4 -3
  168. package/dist/components/map-legend/customElement.js +1 -1
  169. package/dist/components/map-search/customElement.d.ts +4 -3
  170. package/dist/components/map-search/customElement.js +2 -2
  171. package/dist/components/map-select-tools/customElement.d.ts +13 -8
  172. package/dist/components/map-select-tools/customElement.js +5 -5
  173. package/dist/components/map-tools/customElement.d.ts +6 -4
  174. package/dist/components/map-tools/customElement.js +2 -2
  175. package/dist/components/pdf-download/customElement.d.ts +3 -3
  176. package/dist/components/public-notification/customElement.d.ts +10 -6
  177. package/dist/components/public-notification/customElement.js +154 -70
  178. package/dist/components/refine-selection/customElement.d.ts +15 -9
  179. package/dist/components/refine-selection/customElement.js +2 -2
  180. package/dist/components/selection-tool/customElement.d.ts +2 -2
  181. package/dist/components/selection-tool/customElement.js +2 -2
  182. package/dist/components/solution-builder-assistant/customElement.js +57 -57
  183. package/dist/components/solution-configure-titles/customElement.js +1 -1
  184. package/dist/components/solution-delete-dialog/customElement.js +1 -1
  185. package/dist/components/solution-deployed-card-panel/customElement.d.ts +2 -0
  186. package/dist/components/solution-deployed-card-panel/customElement.js +51 -39
  187. package/dist/components/solution-details-card/customElement.js +26 -26
  188. package/dist/components/solution-details-panel/customElement.js +67 -63
  189. package/dist/components/solution-item-accordion/customElement.js +7 -8
  190. package/dist/components/solution-resource-card/customElement.js +1 -1
  191. package/dist/components/solution-snapshot-gallery/customElement.js +1 -1
  192. package/dist/components/solution-social-share/customElement.js +2 -2
  193. package/dist/components/solutions-all-panel/customElement.js +6 -5
  194. package/dist/components/solutions-deploy-app/customElement.js +3 -2
  195. package/dist/components/solutions-deployed-list/customElement.d.ts +10 -6
  196. package/dist/components/solutions-deployed-list/customElement.js +40 -18
  197. package/dist/components/solutions-deployed-list/index.js +2 -0
  198. package/dist/components/solutions-deployed-panel/customElement.js +8 -7
  199. package/dist/components/solutions-deployed-shell/customElement.js +1 -1
  200. package/dist/components/solutions-filter-panel/customElement.js +1 -1
  201. package/dist/components/solutions-searchsort-toolbar/customElement.js +1 -1
  202. package/dist/docs/api.json +1 -1
  203. package/dist/docs/docs.json +1 -1
  204. package/dist/docs/vscode.html-custom-data.json +1 -1
  205. package/dist/docs/web-types.json +1 -1
  206. package/dist/loader.js +3 -3
  207. package/dist/solutions-components_commit.txt +7 -7
  208. package/dist/types/lumina.d.ts +2 -2
  209. package/dist/types/preact.d.ts +2 -2
  210. package/dist/types/react.d.ts +2 -2
  211. package/dist/types/stencil.d.ts +2 -2
  212. package/dist/utils/Auth.d.ts +2 -2
  213. package/dist/utils/interfaces.d.ts +27 -27
  214. package/package.json +1 -1
  215. package/dist/cdn/2R3HJ764.js +0 -2
  216. package/dist/cdn/5AGYVY7S.js +0 -2
  217. package/dist/cdn/AWQQ3CNF.js +0 -2
  218. package/dist/cdn/C47FRSF6.js +0 -2
  219. package/dist/cdn/C6KN2U7N.js +0 -2
  220. package/dist/cdn/DOK6WZN3.js +0 -2
  221. package/dist/cdn/DRXERUDE.js +0 -2
  222. package/dist/cdn/ESBPGZRY.js +0 -2
  223. package/dist/cdn/J6LCEXM3.js +0 -2
  224. package/dist/cdn/J6MVIDTT.js +0 -2
  225. package/dist/cdn/JSJWGKKI.js +0 -2
  226. package/dist/cdn/LEBQMVF6.js +0 -2
  227. package/dist/cdn/MVJVKXZM.js +0 -2
  228. package/dist/cdn/MZXEOLNG.js +0 -2
  229. package/dist/cdn/NM7MKM5L.js +0 -2
  230. package/dist/cdn/TSEG3YWM.js +0 -359
  231. /package/dist/cdn/{HMKJYAVE.js → 2KSTM3IP.js} +0 -0
  232. /package/dist/cdn/{J5FYHTE4.js → 6S56JAXB.js} +0 -0
  233. /package/dist/cdn/{6WQK4DHL.js → 7JOL6EOJ.js} +0 -0
  234. /package/dist/cdn/{ZDLTST3A.js → FB2RD4BK.js} +0 -0
  235. /package/dist/cdn/{3JGLETSR.js → IRQKL5IM.js} +0 -0
  236. /package/dist/cdn/{34EUIYLN.js → ITM5SR7G.js} +0 -0
  237. /package/dist/cdn/{6MP2RVUK.js → SITXFSGP.js} +0 -0
  238. /package/dist/cdn/{QAMVNRII.js → W5VSVSIV.js} +0 -0
  239. /package/dist/cdn/{YVNP437O.js → WV7QX3ED.js} +0 -0
  240. /package/dist/cdn/{6IIMJC5D.js → XMLWS6XC.js} +0 -0
@@ -0,0 +1,287 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
+ import { s as p, c as A, e as d } from "./cardsHelpers.js";
3
+ import * as c from "@esri/solution-common";
4
+ import { g as D, b as v, c as E, d as b, e as I, f as J } from "./helpers.js";
5
+ class M {
6
+ /**
7
+ * Constructor
8
+ *
9
+ * @param orgUrl URL of organization, e.g., "http://myOrg.maps.arcgis.com"
10
+ * @param portalUrl URL of portal, e.g., "https://www.arcgis.com"
11
+ * @param userSession Authentication
12
+ */
13
+ constructor(r, t, a) {
14
+ this.cMissingImageDataURI = "https://static.arcgis.com/images/solution.png", this.cardCache = [], this.cardCacheParams = {
15
+ q: "",
16
+ categoriesAsStr: "[]",
17
+ sortField: "title",
18
+ sortOrder: "asc"
19
+ }, this.locale = r, this.orgUrl = t, this.portalUrl = a, this.anonAgolSession = new c.UserSession({}), this.agolPortalUrl = D(a);
20
+ }
21
+ /**
22
+ * Adds a card to the cache to keep cache fresh between full refreshes.
23
+ *
24
+ * @param card Card to add
25
+ */
26
+ addToCache(r) {
27
+ this.cardCache.push(r);
28
+ }
29
+ /**
30
+ * Returns the current cache.
31
+ *
32
+ * @returns Cards in the cache
33
+ */
34
+ getCache() {
35
+ return this.cardCache;
36
+ }
37
+ /**
38
+ * Removes a card to the cache to keep cache fresh between full refreshes.
39
+ *
40
+ * @param id Id of card to remove
41
+ */
42
+ removeFromCache(r) {
43
+ this.cardCache = this.cardCache.filter((t) => t.id !== r);
44
+ }
45
+ /**
46
+ * Fetches cards for availale Solutions from the server.
47
+ *
48
+ * @param query AGO query terms and options
49
+ * @param primarySolutionsGroupId Id of a group that's the primary source of Solutions for AGO or Enterprise
50
+ * @param agoBasedEnterpriseSolutionsGroupId Id of an AGO-based set of Enterprise Solutions
51
+ * @param userSession Authentication for thumbnailUrl
52
+ * @param isEnterprise When true we are working with an enterprise portal
53
+ * @param signal AbortController signal
54
+ * @param pagingParams Parameters for how the request is to be batched
55
+ * @param acceptableIds A set of item ids that the results must be a part of; if not defined, then there's no restriction
56
+ * @returns A promise resolving to a collection of available Solutions as cards as well as paging information about
57
+ * where those cards came from in the fetcher cache; in case of failure, the promise resolves to an error message
58
+ */
59
+ requestAvailableSolutionCards(r, t, a, e, h, m, s, o) {
60
+ const C = s?.start ? s.start : 1, g = s?.num ? s.num : 24, R = this.portalUrl + "/sharing/rest", B = this.agolPortalUrl + "/sharing/rest", T = this.anonAgolSession, U = JSON.stringify(r.categories);
61
+ if (this.cardCacheParams.q !== r.q || this.cardCacheParams.categoriesAsStr !== U || r.sortField === "relevance" ? (this.cardCache = [], this.cardCacheParams = {
62
+ q: r.q,
63
+ categoriesAsStr: U,
64
+ sortField: r.sortField,
65
+ sortOrder: r.sortOrder
66
+ }) : (this.cardCacheParams.sortField !== r.sortField || this.cardCacheParams.sortOrder !== r.sortOrder) && (this.cardCacheParams.sortField = r.sortField, this.cardCacheParams.sortOrder = r.sortOrder, this.cardCache = p(
67
+ this.cardCache,
68
+ this.cardCacheParams.sortField,
69
+ this.cardCacheParams.sortOrder
70
+ )), this.cardCache.length > 0) {
71
+ let i;
72
+ if (o && o.size > 0) {
73
+ const n = A(this.cardCache, o);
74
+ i = d(n, C, g);
75
+ } else
76
+ i = d(this.cardCache, C, g);
77
+ return Promise.resolve(i);
78
+ }
79
+ const F = {
80
+ filter: r.filter,
81
+ sortField: r.sortField,
82
+ sortOrder: r.sortOrder,
83
+ categories: r?.categories ? this.convertSearchCategories(r.categories) : "",
84
+ signal: m
85
+ }, f = [];
86
+ if (t && !h) {
87
+ const i = e || new c.UserSession({});
88
+ f.push(
89
+ c.searchGroupAllContents(
90
+ t,
91
+ r.q,
92
+ i,
93
+ F,
94
+ R
95
+ )
96
+ );
97
+ }
98
+ return a && h && f.push(
99
+ c.searchGroupAllContents(
100
+ a,
101
+ r.q,
102
+ T,
103
+ F,
104
+ B
105
+ )
106
+ ), Promise.allSettled(f).then((i) => {
107
+ const n = [];
108
+ i.forEach((l) => {
109
+ if (l.status === "fulfilled") {
110
+ const O = l.value;
111
+ let S = "", w = !1;
112
+ S = this.agolPortalUrl, w = !0, O.results.forEach((u) => {
113
+ u.sourcePortalUrl = S, u.knownToBePublicSource = w;
114
+ }), n.push(O);
115
+ } else if (l.status === "rejected")
116
+ throw new Error(
117
+ l.reason.message ? l.reason.message : "cannotAccessAGO"
118
+ // (isPrimary
119
+ // // A failed fetch of the primary group in enterprise or AGO
120
+ // ? result.reason.message
121
+ // // We're in enterprise and configured to search AGO (because agoBasedEnterpriseSolutionsGroupId
122
+ // // is defined), but appear not to be able to reach the internet
123
+ // : "enterpriseCannotAccessAGO"
124
+ // ) as string
125
+ );
126
+ }), n.length === 0 ? this.cardCache = [] : n.length === 1 ? this.cardCache = this.getCardsFromResponse(n[0]) : this.cardCache = p(
127
+ this.getCardsFromResponse(this.mergeResponses(n)),
128
+ this.cardCacheParams.sortField,
129
+ this.cardCacheParams.sortOrder
130
+ );
131
+ let P;
132
+ if (o && o.size > 0) {
133
+ const l = A(this.cardCache, o);
134
+ P = d(l, C, g);
135
+ } else
136
+ P = d(this.cardCache, C, g);
137
+ return Promise.resolve(P);
138
+ }).catch((i) => Promise.reject(new Error(i.message)));
139
+ }
140
+ /**
141
+ * Fetches cards for deployed Solutions from the server.
142
+ *
143
+ * @param query AGO query terms and options
144
+ * @param userSession Authentication for thumbnailUrl
145
+ * @returns A collection of deployed Solutions as cards; the paging information shows that all of the cards
146
+ * are returned
147
+ */
148
+ requestDeployedSolutionCards(r, t, a = "", e) {
149
+ const h = this.portalUrl + "/sharing/rest";
150
+ if (e.aborted)
151
+ return Promise.resolve([]);
152
+ if (this.cardCacheParams.q !== r.q || this.cardCacheParams.categoriesAsStr !== JSON.stringify(r.q) || r.sortField === "relevance" ? (this.cardCache = [], this.cardCacheParams = {
153
+ q: r.q,
154
+ categoriesAsStr: "[]",
155
+ sortField: r.sortField,
156
+ sortOrder: r.sortOrder
157
+ }) : (this.cardCacheParams.sortField !== r.sortField || this.cardCacheParams.sortOrder !== r.sortOrder) && (this.cardCacheParams.sortField = r.sortField, this.cardCacheParams.sortOrder = r.sortOrder, this.cardCache = p(
158
+ this.cardCache,
159
+ this.cardCacheParams.sortField,
160
+ this.cardCacheParams.sortOrder
161
+ )), e.aborted)
162
+ return Promise.resolve([]);
163
+ if (this.cardCache.length > 0) {
164
+ const s = d(this.cardCache, 1, this.cardCache.length);
165
+ return Promise.resolve(s);
166
+ }
167
+ const m = {
168
+ q: r.q,
169
+ filter: r.filter,
170
+ sortField: r.sortField,
171
+ sortOrder: r.sortOrder,
172
+ authentication: t,
173
+ portal: h,
174
+ categories: r?.categories ? JSON.stringify(r.categories) : "",
175
+ num: r.num,
176
+ signal: e
177
+ };
178
+ return a ? c.getItemBase(a, t).then((s) => {
179
+ if (e.aborted)
180
+ return Promise.resolve([]);
181
+ this.cardCache = this.getCardsFromResponse({ results: [s] });
182
+ const o = d(this.cardCache, 1, this.cardCache.length);
183
+ return Promise.resolve(o);
184
+ }).catch((s) => Promise.reject(new Error(s))) : c.searchAllItems(m).then((s) => {
185
+ this.cardCache = this.getCardsFromResponse(s);
186
+ const o = d(this.cardCache, 1, this.cardCache.length);
187
+ return Promise.resolve(o);
188
+ }).catch((s) => Promise.reject(new Error(s)));
189
+ }
190
+ // ---------------------------------------------------------------------------------------------------------------- //
191
+ /**
192
+ * Stringifies categories for search.
193
+ *
194
+ * @param categories AGO item categories, e.g., "/Categories/Conservation"
195
+ * or ["/Categories/Conservation", "/Categories/Pipeline"]
196
+ * @returns Categories where each element is a stringified array of categories
197
+ */
198
+ convertSearchCategories(r) {
199
+ return r && (Array.isArray(r) ? r = r.map(
200
+ (t) => JSON.stringify(Array.isArray(t) ? t : [t])
201
+ // force to an array to allow categories with commas
202
+ ) : r = JSON.stringify([r])), r;
203
+ }
204
+ /**
205
+ * Constructs Solution cards from a Solution-query response.
206
+ *
207
+ * @param response Response from a query
208
+ * @returns Solution information as cards
209
+ */
210
+ getCardsFromResponse(r) {
211
+ return r.results.length > 0 ? c.sanitizeJSON(r.results).map(
212
+ (e) => {
213
+ const h = e.sourcePortalUrl ? e.sourcePortalUrl : this.portalUrl, m = e.sourcePortalUrl ? e.sourcePortalUrl : this.orgUrl, s = {
214
+ id: e.id,
215
+ title: e.title,
216
+ snippet: e.snippet || "",
217
+ description: e.description || "",
218
+ url: e.url || "",
219
+ itemUrl: `${m}/home/item.html` + J([{ k: "id", v: e.id }]) || "",
220
+ thumbnailFilename: e.thumbnail,
221
+ thumbnailUrl: I(
222
+ e.id,
223
+ e.thumbnail,
224
+ this.cMissingImageDataURI,
225
+ h
226
+ ),
227
+ tryitUrl: e.url || "",
228
+ typeKeywords: e.typeKeywords,
229
+ learnMoreUrl: e.properties?.learnMoreUrl || "",
230
+ createdMs: e.created,
231
+ created: b(e.created, this.locale),
232
+ modified: b(e.modified, this.locale),
233
+ numViews: e.numViews,
234
+ tags: e.tags,
235
+ categories: e.groupCategories && e.groupCategories.length > 0 ? e.groupCategories : e.categories || [],
236
+ licenseInfo: E(e.licenseInfo),
237
+ deployCommonId: v(e.typeKeywords || [], "solutionid-"),
238
+ deployVersion: v(e.typeKeywords || [], "solutionversion-"),
239
+ canDelete: e.created > 16183314e5,
240
+ // Only solutions deployed after April 13, 2021 at 9:30PM can be deleted (9.1 release)
241
+ preview: this.preparePreviewImageUrls(e.id, e.properties?.preview, h),
242
+ sourcePortalUrl: e.sourcePortalUrl || "",
243
+ knownToBePublicSource: e.knownToBePublicSource || !1,
244
+ waitId: "",
245
+ relatedSolutions: c.getProp(e, "properties.relatedSolutions") || [],
246
+ owner: e.owner
247
+ };
248
+ return s.deployCommonId !== "" && s.deployVersion !== "" ? s : null;
249
+ }
250
+ ).filter((e) => e != null) : [];
251
+ }
252
+ /**
253
+ * Merge a set of search responses into a single response item.
254
+ *
255
+ * @param responseSet Array of search results
256
+ * @returns A response item that takes its query from the first item in the set and sets the other properties
257
+ * as if all of the responses are the result of one, large query that's independent of AGO's 100-item limit.
258
+ */
259
+ mergeResponses(r) {
260
+ let t = 0;
261
+ r.forEach((e) => t += e.total);
262
+ let a = [];
263
+ return r.forEach((e) => a = a.concat(e.results)), {
264
+ query: r[0].query,
265
+ start: 1,
266
+ num: t,
267
+ nextStart: -1,
268
+ total: t,
269
+ results: a
270
+ };
271
+ }
272
+ /**
273
+ * Converts image preview information into a URL pointing to that image; returns non-image previews unchanged.
274
+ *
275
+ * @param id Item id to insert into URL
276
+ * @param preview List of previews to modify
277
+ * @returns Copy of previews with iamge previews modified
278
+ */
279
+ preparePreviewImageUrls(r, t, a) {
280
+ return t ? t.map(
281
+ (e) => (e.format === "image" && (e.name = a + "/sharing/rest/content/items/" + r + "/resources/" + e.name), e)
282
+ ) : [];
283
+ }
284
+ }
285
+ export {
286
+ M as C
287
+ };
@@ -1,322 +1,40 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import { s as O, d as D, e as g, b as I } from "./cardsHelpers.js";
3
- import * as l from "@esri/solution-common";
4
- import { g as T, b as B, i as M, j as E, k as N, l as k } from "./helpers.js";
2
+ import "@esri/solution-common";
3
+ import { g as p } from "./cardsHelpers.js";
5
4
  import { B as y } from "./interfaces.js";
6
- class z {
7
- /**
8
- * Constructor
9
- *
10
- * @param orgUrl URL of organization, e.g., "http://myOrg.maps.arcgis.com"
11
- * @param portalUrl URL of portal, e.g., "https://www.arcgis.com"
12
- * @param userSession Authentication
13
- */
14
- constructor(r, t, s) {
15
- this.cMissingImageDataURI = "https://static.arcgis.com/images/solution.png", this.cardCache = [], this.cardCacheParams = {
16
- q: "",
17
- categoriesAsStr: "[]",
18
- sortField: "title",
19
- sortOrder: "asc"
20
- }, this.locale = r, this.orgUrl = t, this.portalUrl = s, this.anonAgolSession = new l.UserSession({}), this.agolPortalUrl = T(s);
21
- }
22
- /**
23
- * Adds a card to the cache to keep cache fresh between full refreshes.
24
- *
25
- * @param card Card to add
26
- */
27
- addToCache(r) {
28
- this.cardCache.push(r);
29
- }
30
- /**
31
- * Returns the current cache.
32
- *
33
- * @returns Cards in the cache
34
- */
35
- getCache() {
36
- return this.cardCache;
37
- }
38
- /**
39
- * Removes a card to the cache to keep cache fresh between full refreshes.
40
- *
41
- * @param id Id of card to remove
42
- */
43
- removeFromCache(r) {
44
- this.cardCache = this.cardCache.filter((t) => t.id !== r);
45
- }
46
- /**
47
- * Fetches cards for availale Solutions from the server.
48
- *
49
- * @param query AGO query terms and options
50
- * @param primarySolutionsGroupId Id of a group that's the primary source of Solutions for AGO or Enterprise
51
- * @param agoBasedEnterpriseSolutionsGroupId Id of an AGO-based set of Enterprise Solutions
52
- * @param userSession Authentication for thumbnailUrl
53
- * @param isEnterprise When true we are working with an enterprise portal
54
- * @param signal AbortController signal
55
- * @param pagingParams Parameters for how the request is to be batched
56
- * @param acceptableIds A set of item ids that the results must be a part of; if not defined, then there's no restriction
57
- * @returns A promise resolving to a collection of available Solutions as cards as well as paging information about
58
- * where those cards came from in the fetcher cache; in case of failure, the promise resolves to an error message
59
- */
60
- requestAvailableSolutionCards(r, t, s, e, i, c, a, o) {
61
- const C = a?.start ? a.start : 1, f = a?.num ? a.num : 24, p = this.portalUrl + "/sharing/rest", u = this.agolPortalUrl + "/sharing/rest", P = this.anonAgolSession, F = JSON.stringify(r.categories);
62
- if (this.cardCacheParams.q !== r.q || this.cardCacheParams.categoriesAsStr !== F || r.sortField === "relevance" ? (this.cardCache = [], this.cardCacheParams = {
63
- q: r.q,
64
- categoriesAsStr: F,
65
- sortField: r.sortField,
66
- sortOrder: r.sortOrder
67
- }) : (this.cardCacheParams.sortField !== r.sortField || this.cardCacheParams.sortOrder !== r.sortOrder) && (this.cardCacheParams.sortField = r.sortField, this.cardCacheParams.sortOrder = r.sortOrder, this.cardCache = O(
68
- this.cardCache,
69
- this.cardCacheParams.sortField,
70
- this.cardCacheParams.sortOrder
71
- )), this.cardCache.length > 0) {
72
- let n;
73
- if (o && o.size > 0) {
74
- const d = D(this.cardCache, o);
75
- n = g(d, C, f);
76
- } else
77
- n = g(this.cardCache, C, f);
78
- return Promise.resolve(n);
79
- }
80
- const w = {
81
- filter: r.filter,
82
- sortField: r.sortField,
83
- sortOrder: r.sortOrder,
84
- categories: r?.categories ? this.convertSearchCategories(r.categories) : "",
85
- signal: c
86
- }, S = [];
87
- if (t && !i) {
88
- const n = e || new l.UserSession({});
89
- S.push(
90
- l.searchGroupAllContents(
91
- t,
92
- r.q,
93
- n,
94
- w,
95
- p
96
- )
97
- );
98
- }
99
- return s && i && S.push(
100
- l.searchGroupAllContents(
101
- s,
102
- r.q,
103
- P,
104
- w,
105
- u
106
- )
107
- ), Promise.allSettled(S).then((n) => {
108
- const d = [];
109
- n.forEach((m) => {
110
- if (m.status === "fulfilled") {
111
- const A = m.value;
112
- let v = "", b = !1;
113
- v = this.agolPortalUrl, b = !0, A.results.forEach((R) => {
114
- R.sourcePortalUrl = v, R.knownToBePublicSource = b;
115
- }), d.push(A);
116
- } else if (m.status === "rejected")
117
- throw new Error(
118
- m.reason.message ? m.reason.message : "cannotAccessAGO"
119
- // (isPrimary
120
- // // A failed fetch of the primary group in enterprise or AGO
121
- // ? result.reason.message
122
- // // We're in enterprise and configured to search AGO (because agoBasedEnterpriseSolutionsGroupId
123
- // // is defined), but appear not to be able to reach the internet
124
- // : "enterpriseCannotAccessAGO"
125
- // ) as string
126
- );
127
- }), d.length === 0 ? this.cardCache = [] : d.length === 1 ? this.cardCache = this.getCardsFromResponse(d[0]) : this.cardCache = O(
128
- this.getCardsFromResponse(this.mergeResponses(d)),
129
- this.cardCacheParams.sortField,
130
- this.cardCacheParams.sortOrder
131
- );
132
- let U;
133
- if (o && o.size > 0) {
134
- const m = D(this.cardCache, o);
135
- U = g(m, C, f);
136
- } else
137
- U = g(this.cardCache, C, f);
138
- return Promise.resolve(U);
139
- }).catch((n) => Promise.reject(new Error(n.message)));
140
- }
141
- /**
142
- * Fetches cards for deployed Solutions from the server.
143
- *
144
- * @param query AGO query terms and options
145
- * @param userSession Authentication for thumbnailUrl
146
- * @returns A collection of deployed Solutions as cards; the paging information shows that all of the cards
147
- * are returned
148
- */
149
- requestDeployedSolutionCards(r, t, s = "", e) {
150
- const i = this.portalUrl + "/sharing/rest";
151
- if (e.aborted)
152
- return Promise.resolve([]);
153
- if (this.cardCacheParams.q !== r.q || this.cardCacheParams.categoriesAsStr !== JSON.stringify(r.q) || r.sortField === "relevance" ? (this.cardCache = [], this.cardCacheParams = {
154
- q: r.q,
155
- categoriesAsStr: "[]",
156
- sortField: r.sortField,
157
- sortOrder: r.sortOrder
158
- }) : (this.cardCacheParams.sortField !== r.sortField || this.cardCacheParams.sortOrder !== r.sortOrder) && (this.cardCacheParams.sortField = r.sortField, this.cardCacheParams.sortOrder = r.sortOrder, this.cardCache = O(
159
- this.cardCache,
160
- this.cardCacheParams.sortField,
161
- this.cardCacheParams.sortOrder
162
- )), e.aborted)
163
- return Promise.resolve([]);
164
- if (this.cardCache.length > 0) {
165
- const a = g(this.cardCache, 1, this.cardCache.length);
166
- return Promise.resolve(a);
167
- }
168
- const c = {
169
- q: r.q,
170
- filter: r.filter,
171
- sortField: r.sortField,
172
- sortOrder: r.sortOrder,
173
- authentication: t,
174
- portal: i,
175
- categories: r?.categories ? JSON.stringify(r.categories) : "",
176
- num: r.num,
177
- signal: e
178
- };
179
- return s ? l.getItemBase(s, t).then((a) => {
180
- if (e.aborted)
181
- return Promise.resolve([]);
182
- this.cardCache = this.getCardsFromResponse({ results: [a] });
183
- const o = g(this.cardCache, 1, this.cardCache.length);
184
- return Promise.resolve(o);
185
- }).catch((a) => Promise.reject(new Error(a))) : l.searchAllItems(c).then((a) => {
186
- this.cardCache = this.getCardsFromResponse(a);
187
- const o = g(this.cardCache, 1, this.cardCache.length);
188
- return Promise.resolve(o);
189
- }).catch((a) => Promise.reject(new Error(a)));
190
- }
191
- // ---------------------------------------------------------------------------------------------------------------- //
192
- /**
193
- * Stringifies categories for search.
194
- *
195
- * @param categories AGO item categories, e.g., "/Categories/Conservation"
196
- * or ["/Categories/Conservation", "/Categories/Pipeline"]
197
- * @returns Categories where each element is a stringified array of categories
198
- */
199
- convertSearchCategories(r) {
200
- return r && (Array.isArray(r) ? r = r.map(
201
- (t) => JSON.stringify(Array.isArray(t) ? t : [t])
202
- // force to an array to allow categories with commas
203
- ) : r = JSON.stringify([r])), r;
204
- }
205
- /**
206
- * Constructs Solution cards from a Solution-query response.
207
- *
208
- * @param response Response from a query
209
- * @returns Solution information as cards
210
- */
211
- getCardsFromResponse(r) {
212
- return r.results.length > 0 ? l.sanitizeJSON(r.results).map(
213
- (e) => {
214
- const i = e.sourcePortalUrl ? e.sourcePortalUrl : this.portalUrl, c = e.sourcePortalUrl ? e.sourcePortalUrl : this.orgUrl, a = {
215
- id: e.id,
216
- title: e.title,
217
- snippet: e.snippet || "",
218
- description: e.description || "",
219
- url: e.url || "",
220
- itemUrl: `${c}/home/item.html` + k([{ k: "id", v: e.id }]) || "",
221
- thumbnailFilename: e.thumbnail,
222
- thumbnailUrl: N(
223
- e.id,
224
- e.thumbnail,
225
- this.cMissingImageDataURI,
226
- i
227
- ),
228
- tryitUrl: e.url || "",
229
- typeKeywords: e.typeKeywords,
230
- learnMoreUrl: e.properties?.learnMoreUrl || "",
231
- createdMs: e.created,
232
- created: E(e.created, this.locale),
233
- modified: E(e.modified, this.locale),
234
- numViews: e.numViews,
235
- tags: e.tags,
236
- categories: e.groupCategories && e.groupCategories.length > 0 ? e.groupCategories : e.categories || [],
237
- licenseInfo: M(e.licenseInfo),
238
- deployCommonId: B(e.typeKeywords || [], "solutionid-"),
239
- deployVersion: B(e.typeKeywords || [], "solutionversion-"),
240
- canDelete: e.created > 16183314e5,
241
- // Only solutions deployed after April 13, 2021 at 9:30PM can be deleted (9.1 release)
242
- preview: this.preparePreviewImageUrls(e.id, e.properties?.preview, i),
243
- sourcePortalUrl: e.sourcePortalUrl || "",
244
- knownToBePublicSource: e.knownToBePublicSource || !1,
245
- waitId: "",
246
- relatedSolutions: l.getProp(e, "properties.relatedSolutions") || [],
247
- owner: e.owner
248
- };
249
- return a.deployCommonId !== "" && a.deployVersion !== "" ? a : null;
250
- }
251
- ).filter((e) => e != null) : [];
252
- }
253
- /**
254
- * Merge a set of search responses into a single response item.
255
- *
256
- * @param responseSet Array of search results
257
- * @returns A response item that takes its query from the first item in the set and sets the other properties
258
- * as if all of the responses are the result of one, large query that's independent of AGO's 100-item limit.
259
- */
260
- mergeResponses(r) {
261
- let t = 0;
262
- r.forEach((e) => t += e.total);
263
- let s = [];
264
- return r.forEach((e) => s = s.concat(e.results)), {
265
- query: r[0].query,
266
- start: 1,
267
- num: t,
268
- nextStart: -1,
269
- total: t,
270
- results: s
271
- };
272
- }
273
- /**
274
- * Converts image preview information into a URL pointing to that image; returns non-image previews unchanged.
275
- *
276
- * @param id Item id to insert into URL
277
- * @param preview List of previews to modify
278
- * @returns Copy of previews with iamge previews modified
279
- */
280
- preparePreviewImageUrls(r, t, s) {
281
- return t ? t.map(
282
- (e) => (e.format === "image" && (e.name = s + "/sharing/rest/content/items/" + r + "/resources/" + e.name), e)
283
- ) : [];
284
- }
285
- }
286
- async function V(h, r, t, s, e = y, i = "created", c = "desc", a = !1, o = [], C = [], f, p, u) {
287
- if (!h?.IsSignedIn)
5
+ async function _(e, n, r, o, t = y, i = "created", s = "desc", a = !1, l = [], u = [], c, f, g) {
6
+ if (!e?.IsSignedIn)
288
7
  return;
289
- const P = {
290
- q: e,
8
+ const d = {
9
+ q: t,
291
10
  filter: "type:Solution",
292
11
  sortField: i,
293
- sortOrder: c,
12
+ sortOrder: s,
294
13
  delay: a,
295
- categories: o,
14
+ categories: l,
296
15
  num: 100
297
16
  };
298
- return P.q += J(h, p), await j(
299
- r,
300
- P,
301
- s,
302
- C,
17
+ return d.q += S(e, f), await m(
18
+ n,
19
+ d,
20
+ o,
303
21
  u,
304
- f
22
+ g,
23
+ c
305
24
  );
306
25
  }
307
- function J(h, r) {
308
- let t = "";
309
- const s = h.PortalUserOrg, e = h.PortalUserName;
310
- return s && (t += " orgid:" + s), r !== "My organization's solutions" && e && (t += " owner:" + e), t;
26
+ function S(e, n) {
27
+ let r = "";
28
+ const o = e.PortalUserOrg, t = e.PortalUserName;
29
+ return o && (r += " orgid:" + o), n !== "My organization's solutions" && t && (r += " owner:" + t), r;
311
30
  }
312
- async function j(h, r, t, s, e = "", i) {
313
- const c = await t.requestDeployedSolutionCards(r, h, e, i), a = I(c.cards, s);
31
+ async function m(e, n, r, o, t = "", i) {
32
+ const s = await r.requestDeployedSolutionCards(n, e, t, i), a = p(s.cards, o);
314
33
  return {
315
- cards: c.cards,
34
+ cards: s.cards,
316
35
  relatedSolutions: a
317
36
  };
318
37
  }
319
38
  export {
320
- z as C,
321
- V as g
39
+ _ as g
322
40
  };
@@ -96,13 +96,13 @@ function b(o, t) {
96
96
  return u(n.title);
97
97
  }
98
98
  export {
99
- b as a,
100
- g as b,
101
- u as c,
102
- p as d,
99
+ I as a,
100
+ m as b,
101
+ p as c,
102
+ u as d,
103
103
  y as e,
104
- I as f,
105
- m as g,
104
+ b as f,
105
+ g,
106
106
  h,
107
107
  w as s
108
108
  };