import { L, m } from "./chunk-TV3CFJQR.js"; import { h, l } from "./chunk-HWSWTWZD.js"; import { a } from "./chunk-ZLNEXZAN.js"; import { U } from "./chunk-DVUG3KID.js"; import { s2 as s, s3 as s2 } from "./chunk-E5O6P5I2.js"; import { n2 as n, t } from "./chunk-SPWQ3AWG.js"; import { r } from "./chunk-YXWMMD76.js"; // node_modules/@arcgis/core/intl/substitute.js var i = s.getLogger("esri.intl.substitute"); function s3(t2, r2, n2 = {}) { const { format: o2 = {} } = n2; return n(t2, (t3) => u(t3, r2, o2)); } function u(t2, e, n2) { var _a; let o2, i3; const s6 = t2.indexOf(":"); if (-1 === s6 ? o2 = t2.trim() : (o2 = t2.slice(0, s6).trim(), i3 = t2.slice(s6 + 1).trim()), !o2) return ""; const u4 = t(o2, e); if (null == u4) return ""; const m2 = (_a = i3 ? n2 == null ? void 0 : n2[i3] : null) != null ? _a : n2 == null ? void 0 : n2[o2]; return m2 ? c(u4, m2) : i3 ? a2(u4, i3) : f(u4); } function c(t2, r2) { switch (r2.type) { case "date": return L(t2, r2.intlOptions); case "number": return m(t2, r2.intlOptions); default: return i.warn("missing format descriptor for key {key}"), f(t2); } } function a2(t2, r2) { switch (r2.toLowerCase()) { case "dateformat": return L(t2); case "numberformat": return m(t2); default: 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); } } function f(t2) { switch (typeof t2) { case "string": return t2; case "number": return m(t2); case "boolean": return "" + t2; default: return t2 instanceof Date ? L(t2) : ""; } } // node_modules/@arcgis/core/intl/t9n.js async function o(e, n2, o2, i3) { const a5 = n2.exec(o2); if (!a5) throw new s2("esri-intl:invalid-bundle", `Bundle id "${o2}" is not compatible with the pattern "${n2}"`); const c4 = a5[1] ? `${a5[1]}/` : "", l3 = a5[2], w = h(i3), h2 = `${c4}${l3}.json`, u4 = w ? `${c4}${l3}_${w}.json` : h2; let f2; try { f2 = await s4(e(u4)); } catch (d) { if (u4 === h2) throw new s2("intl:unknown-bundle", `Bundle "${o2}" cannot be loaded`, { error: d }); try { f2 = await s4(e(h2)); } catch (d2) { throw new s2("intl:unknown-bundle", `Bundle "${o2}" cannot be loaded`, { error: d2 }); } } return f2; } async function s4(t2) { if (r(c2.fetchBundleAsset)) return c2.fetchBundleAsset(t2); const r2 = await U(t2, { responseType: "text" }); return JSON.parse(r2.data); } var i2 = class { constructor({ base: e = "", pattern: t2, location: n2 = new URL(window.location.href) }) { let r2; 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}(?:(.*)/)?(.*)$`); } fetchMessageBundle(e, t2) { return o(this.getAssetUrl, this.matcher, e, t2); } }; function a3(e) { return new i2(e); } var c2 = {}; // node_modules/@arcgis/core/intl.js l(a3({ pattern: "esri/", location: a })); export { s3 as s }; //# sourceMappingURL=chunk-S6EFEKAU.js.map