chunk-ATPLLI5W.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import {
  2. s as s2
  3. } from "./chunk-PDKDCAAD.js";
  4. import {
  5. M,
  6. M2
  7. } from "./chunk-ECW2QABR.js";
  8. import {
  9. k2 as k
  10. } from "./chunk-MRJEICT6.js";
  11. import {
  12. d,
  13. e,
  14. l3 as l,
  15. n2 as n,
  16. y3 as y
  17. } from "./chunk-Y3WMVFTW.js";
  18. import {
  19. b
  20. } from "./chunk-IHXECKQQ.js";
  21. import {
  22. s3 as s
  23. } from "./chunk-EMJ4ZSM2.js";
  24. import {
  25. m
  26. } from "./chunk-IKP3YN53.js";
  27. import {
  28. r
  29. } from "./chunk-GZT4BVFP.js";
  30. // node_modules/@arcgis/core/portal/PortalQueryParams.js
  31. var u;
  32. var m2 = new s2({ avgRating: "avg-rating", numRatings: "num-ratings", numComments: "num-comments", numViews: "num-views" });
  33. var c = u = class extends y {
  34. constructor(t) {
  35. super(t), this.categories = null, this.disableExtraQuery = false, this.extent = null, this.filter = null, this.num = 10, this.query = null, this.sortField = null, this.start = 1;
  36. }
  37. get sortOrder() {
  38. return this._get("sortOrder") || "asc";
  39. }
  40. set sortOrder(t) {
  41. t !== "asc" && t !== "desc" || this._set("sortOrder", t);
  42. }
  43. clone() {
  44. return new u({ categories: this.categories ? m(this.categories) : null, disableExtraQuery: this.disableExtraQuery, extent: this.extent ? this.extent.clone() : null, filter: this.filter, num: this.num, query: this.query, sortField: this.sortField, sortOrder: this.sortOrder, start: this.start });
  45. }
  46. toRequestOptions(t, r2) {
  47. let e2, s3;
  48. if (this.categories && (e2 = this.categories.map((t2) => Array.isArray(t2) ? JSON.stringify(t2) : t2)), this.extent) {
  49. const t2 = M(this.extent, k.WGS84);
  50. r(t2) && (s3 = `${t2.xmin},${t2.ymin},${t2.xmax},${t2.ymax}`);
  51. }
  52. let i = this.query;
  53. !this.disableExtraQuery && t.extraQuery && (i = "(" + i + ")" + t.extraQuery);
  54. const a = { categories: e2, bbox: s3, q: i, filter: this.filter, num: this.num, sortField: null, sortOrder: null, start: this.start };
  55. return this.sortField && (a.sortField = this.sortField.split(",").map((t2) => m2.toJSON(t2.trim())).join(","), a.sortOrder = this.sortOrder), { query: { ...r2, ...a } };
  56. }
  57. };
  58. e([d()], c.prototype, "categories", void 0), e([d()], c.prototype, "disableExtraQuery", void 0), e([d({ type: M2 })], c.prototype, "extent", void 0), e([d()], c.prototype, "filter", void 0), e([d()], c.prototype, "num", void 0), e([d()], c.prototype, "query", void 0), e([d()], c.prototype, "sortField", void 0), e([d()], c.prototype, "sortOrder", null), e([d()], c.prototype, "start", void 0), c = u = e([n("esri.portal.PortalQueryParams")], c);
  59. var d2 = c;
  60. // node_modules/@arcgis/core/portal/PortalGroup.js
  61. var l2 = class extends l {
  62. constructor(t) {
  63. super(t), this.access = null, this.created = null, this.description = null, this.id = null, this.isInvitationOnly = false, this.modified = null, this.owner = null, this.portal = null, this.snippet = null, this.sortField = null, this.sortOrder = null, this.tags = null, this.title = null;
  64. }
  65. get thumbnailUrl() {
  66. const t = this.url, r2 = this.thumbnail;
  67. return t && r2 ? this.portal._normalizeUrl(`${t}/info/${r2}?f=json`) : null;
  68. }
  69. get url() {
  70. const t = this.get("portal.restUrl");
  71. return t ? t + "/community/groups/" + this.id : null;
  72. }
  73. fetchCategorySchema(t) {
  74. return this.portal._request(this.url + "/categorySchema", t).then((r2) => {
  75. const e2 = r2.categorySchema || [];
  76. return e2.some((t2) => t2.source === "contentCategorySetsGroupQuery.LivingAtlas") ? this._fetchCategorySchemaSet("LivingAtlas", t) : e2;
  77. });
  78. }
  79. fetchMembers(t) {
  80. return this.portal._request(this.url + "/users", t);
  81. }
  82. getThumbnailUrl(t) {
  83. let r2 = this.thumbnailUrl;
  84. return r2 && t && (r2 += `&w=${t}`), r2;
  85. }
  86. toJSON() {
  87. throw new s("internal:not-yet-implemented", "PortalGroup.toJSON is not yet implemented");
  88. }
  89. queryItems(t, r2) {
  90. let e2 = b(d2, t);
  91. return parseFloat(this.portal.currentVersion) > 5 ? (e2 = e2 || new d2(), this.portal._queryPortal(`/content/groups/${this.id}/search`, e2, "PortalItem", r2)) : (e2 = e2 ? e2.clone() : new d2(), e2.query = "group:" + this.id + (e2.query ? " " + e2.query : ""), this.portal.queryItems(e2, r2));
  92. }
  93. _fetchCategorySchemaSet(t, e2) {
  94. return this.portal._fetchSelf(this.portal.authMode, true, e2).then((t2) => {
  95. const o = t2.contentCategorySetsGroupQuery;
  96. if (o) {
  97. const t3 = new d2();
  98. return t3.disableExtraQuery = true, t3.num = 1, t3.query = o, this.portal.queryGroups(t3, e2);
  99. }
  100. throw new s("portal-group:fetchCategorySchema", "contentCategorySetsGroupQuery value not found");
  101. }).then((o) => {
  102. if (o.total) {
  103. const r2 = o.results[0], s3 = new d2();
  104. return s3.num = 1, s3.query = `typekeywords:"${t}"`, r2.queryItems(s3, e2);
  105. }
  106. throw new s("portal-group:fetchCategorySchema", "contentCategorySetsGroupQuery group not found");
  107. }).then((t2) => {
  108. if (t2.total) {
  109. return t2.results[0].fetchData("json", e2).then((t3) => {
  110. const r2 = t3 && t3.categorySchema;
  111. return r2 && r2.length ? r2 : [];
  112. });
  113. }
  114. return [];
  115. });
  116. }
  117. };
  118. e([d()], l2.prototype, "access", void 0), e([d({ type: Date })], l2.prototype, "created", void 0), e([d()], l2.prototype, "description", void 0), e([d()], l2.prototype, "id", void 0), e([d()], l2.prototype, "isInvitationOnly", void 0), e([d({ type: Date })], l2.prototype, "modified", void 0), e([d()], l2.prototype, "owner", void 0), e([d()], l2.prototype, "portal", void 0), e([d()], l2.prototype, "snippet", void 0), e([d()], l2.prototype, "sortField", void 0), e([d()], l2.prototype, "sortOrder", void 0), e([d()], l2.prototype, "tags", void 0), e([d()], l2.prototype, "thumbnail", void 0), e([d({ readOnly: true })], l2.prototype, "thumbnailUrl", null), e([d()], l2.prototype, "title", void 0), e([d({ readOnly: true })], l2.prototype, "url", null), l2 = e([n("esri.portal.PortalGroup")], l2);
  119. var p = l2;
  120. export {
  121. d2 as d,
  122. p
  123. };
  124. //# sourceMappingURL=chunk-ATPLLI5W.js.map