chunk-S6EFEKAU.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import {
  2. L,
  3. m
  4. } from "./chunk-TV3CFJQR.js";
  5. import {
  6. h,
  7. l
  8. } from "./chunk-HWSWTWZD.js";
  9. import {
  10. a
  11. } from "./chunk-ZLNEXZAN.js";
  12. import {
  13. U
  14. } from "./chunk-DVUG3KID.js";
  15. import {
  16. s2 as s,
  17. s3 as s2
  18. } from "./chunk-E5O6P5I2.js";
  19. import {
  20. n2 as n,
  21. t
  22. } from "./chunk-SPWQ3AWG.js";
  23. import {
  24. r
  25. } from "./chunk-YXWMMD76.js";
  26. // node_modules/@arcgis/core/intl/substitute.js
  27. var i = s.getLogger("esri.intl.substitute");
  28. function s3(t2, r2, n2 = {}) {
  29. const { format: o2 = {} } = n2;
  30. return n(t2, (t3) => u(t3, r2, o2));
  31. }
  32. function u(t2, e, n2) {
  33. var _a;
  34. let o2, i3;
  35. const s6 = t2.indexOf(":");
  36. if (-1 === s6 ? o2 = t2.trim() : (o2 = t2.slice(0, s6).trim(), i3 = t2.slice(s6 + 1).trim()), !o2)
  37. return "";
  38. const u4 = t(o2, e);
  39. if (null == u4)
  40. return "";
  41. const m2 = (_a = i3 ? n2 == null ? void 0 : n2[i3] : null) != null ? _a : n2 == null ? void 0 : n2[o2];
  42. return m2 ? c(u4, m2) : i3 ? a2(u4, i3) : f(u4);
  43. }
  44. function c(t2, r2) {
  45. switch (r2.type) {
  46. case "date":
  47. return L(t2, r2.intlOptions);
  48. case "number":
  49. return m(t2, r2.intlOptions);
  50. default:
  51. return i.warn("missing format descriptor for key {key}"), f(t2);
  52. }
  53. }
  54. function a2(t2, r2) {
  55. switch (r2.toLowerCase()) {
  56. case "dateformat":
  57. return L(t2);
  58. case "numberformat":
  59. return m(t2);
  60. default:
  61. return i.warn(`inline format is unsupported since 4.12: ${r2}`), /^(dateformat|datestring)/i.test(r2) ? L(t2) : /^numberformat/i.test(r2) ? m(t2) : f(t2);
  62. }
  63. }
  64. function f(t2) {
  65. switch (typeof t2) {
  66. case "string":
  67. return t2;
  68. case "number":
  69. return m(t2);
  70. case "boolean":
  71. return "" + t2;
  72. default:
  73. return t2 instanceof Date ? L(t2) : "";
  74. }
  75. }
  76. // node_modules/@arcgis/core/intl/t9n.js
  77. async function o(e, n2, o2, i3) {
  78. const a5 = n2.exec(o2);
  79. if (!a5)
  80. throw new s2("esri-intl:invalid-bundle", `Bundle id "${o2}" is not compatible with the pattern "${n2}"`);
  81. const c4 = a5[1] ? `${a5[1]}/` : "", l3 = a5[2], w = h(i3), h2 = `${c4}${l3}.json`, u4 = w ? `${c4}${l3}_${w}.json` : h2;
  82. let f2;
  83. try {
  84. f2 = await s4(e(u4));
  85. } catch (d) {
  86. if (u4 === h2)
  87. throw new s2("intl:unknown-bundle", `Bundle "${o2}" cannot be loaded`, { error: d });
  88. try {
  89. f2 = await s4(e(h2));
  90. } catch (d2) {
  91. throw new s2("intl:unknown-bundle", `Bundle "${o2}" cannot be loaded`, { error: d2 });
  92. }
  93. }
  94. return f2;
  95. }
  96. async function s4(t2) {
  97. if (r(c2.fetchBundleAsset))
  98. return c2.fetchBundleAsset(t2);
  99. const r2 = await U(t2, { responseType: "text" });
  100. return JSON.parse(r2.data);
  101. }
  102. var i2 = class {
  103. constructor({ base: e = "", pattern: t2, location: n2 = new URL(window.location.href) }) {
  104. let r2;
  105. r2 = "string" == typeof n2 ? (e2) => new URL(e2, new URL(n2, window.location.href)).href : n2 instanceof URL ? (e2) => new URL(e2, n2).href : n2, this.pattern = "string" == typeof t2 ? new RegExp(`^${t2}`) : t2, this.getAssetUrl = r2, e = e ? e.endsWith("/") ? e : e + "/" : "", this.matcher = new RegExp(`^${e}(?:(.*)/)?(.*)$`);
  106. }
  107. fetchMessageBundle(e, t2) {
  108. return o(this.getAssetUrl, this.matcher, e, t2);
  109. }
  110. };
  111. function a3(e) {
  112. return new i2(e);
  113. }
  114. var c2 = {};
  115. // node_modules/@arcgis/core/intl.js
  116. l(a3({ pattern: "esri/", location: a }));
  117. export {
  118. s3 as s
  119. };
  120. //# sourceMappingURL=chunk-S6EFEKAU.js.map