chunk-4ONPMX2F.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import {
  2. Et,
  3. F,
  4. K,
  5. Lt,
  6. Q,
  7. X,
  8. _,
  9. b,
  10. z
  11. } from "./chunk-VEGAOVMY.js";
  12. import {
  13. e
  14. } from "./chunk-YXWMMD76.js";
  15. // node_modules/@arcgis/core/chunks/persistableUrlUtils.js
  16. function c(e2, o) {
  17. const l = o && o.url && o.url.path;
  18. if (e2 && l && (e2 = Q(e2, l, { preserveProtocolRelative: true }), o.portalItem && o.readResourcePaths)) {
  19. const r = _(e2, o.portalItem.itemUrl);
  20. null != r && v.test(r) && o.readResourcePaths.push(o.portalItem.resourceFromPath(r).path);
  21. }
  22. return I(e2, o && o.portal);
  23. }
  24. function m(e2, n, a = R.YES) {
  25. if (null == e2)
  26. return e2;
  27. !K(e2) && n && n.blockedRelativeUrls && n.blockedRelativeUrls.push(e2);
  28. let u = Q(e2);
  29. if (n) {
  30. const r = n.verifyItemRelativeUrls && n.verifyItemRelativeUrls.rootPath || n.url && n.url.path;
  31. if (r) {
  32. const o = I(r, n.portal);
  33. u = _(I(u, n.portal), o, o), null != u && u !== e2 && n.verifyItemRelativeUrls && n.verifyItemRelativeUrls.writtenUrls.push(u);
  34. }
  35. }
  36. return u = y(u, n == null ? void 0 : n.portal), K(u) && (u = F(u)), (n == null ? void 0 : n.resources) && (n == null ? void 0 : n.portalItem) && !K(u) && !X(u) && a === R.YES && n.resources.toKeep.push({ resource: n.portalItem.resourceFromPath(u), compress: false }), u;
  37. }
  38. function p(e2, r, t) {
  39. return c(e2, t);
  40. }
  41. function f(e2, r, t, o) {
  42. const l = m(e2, o);
  43. void 0 !== l && (r[t] = l);
  44. }
  45. var h = /\/items\/([^\/]+)\/resources\/(.*)/;
  46. var v = /^\.\/resources\//;
  47. function U(e2) {
  48. var _a, _b, _c;
  49. return (_c = (_b = (_a = e2 == null ? void 0 : e2.match(h)) != null ? _a : null) == null ? void 0 : _b[1]) != null ? _c : null;
  50. }
  51. function d(r) {
  52. var _a;
  53. const t = (_a = r == null ? void 0 : r.match(h)) != null ? _a : null;
  54. if (null == t)
  55. return null;
  56. const o = t[2], l = o.lastIndexOf("/");
  57. if (-1 === l) {
  58. const { path: r2, extension: t2 } = Et(o);
  59. return { prefix: null, filename: r2, extension: e(t2) };
  60. }
  61. const { path: s, extension: a } = Et(o.slice(l + 1));
  62. return { prefix: o.slice(0, l), filename: s, extension: e(a) };
  63. }
  64. function y(e2, r) {
  65. return r && !r.isPortal && r.urlKey && r.customBaseUrl ? Lt(e2, `${r.urlKey}.${r.customBaseUrl}`, r.portalHostname) : e2;
  66. }
  67. function I(e2, r) {
  68. if (!r || r.isPortal || !r.urlKey || !r.customBaseUrl)
  69. return e2;
  70. const t = `${r.urlKey}.${r.customBaseUrl}`, o = b();
  71. return z(o, `${o.scheme}://${t}`) ? Lt(e2, r.portalHostname, t) : Lt(e2, t, r.portalHostname);
  72. }
  73. var R;
  74. !function(e2) {
  75. e2[e2.YES = 0] = "YES", e2[e2.NO = 1] = "NO";
  76. }(R || (R = {}));
  77. var x = Object.freeze(Object.defineProperty({ __proto__: null, fromJSON: c, toJSON: m, read: p, write: f, itemIdFromResourceUrl: U, prefixAndFilenameFromResourceUrl: d, ensureMainOnlineDomain: y, get MarkKeep() {
  78. return R;
  79. } }, Symbol.toStringTag, { value: "Module" }));
  80. export {
  81. c,
  82. m,
  83. p,
  84. f,
  85. U,
  86. d,
  87. y,
  88. R,
  89. x
  90. };
  91. //# sourceMappingURL=chunk-4ONPMX2F.js.map