import { B } from "./chunk-4NKD334K.js"; import { d } from "./chunk-ATPLLI5W.js"; import { U } from "./chunk-VNFRAYHO.js"; import { F, Ot } from "./chunk-VBRY5KJM.js"; import { w } from "./chunk-ULGDPLM2.js"; import { s3 as s } from "./chunk-EMJ4ZSM2.js"; import { a, r } from "./chunk-GZT4BVFP.js"; // node_modules/@arcgis/core/support/featureFlags.js var r2 = () => !!a("enable-feature:force-wosr"); // node_modules/@arcgis/core/symbols/support/styleUtils.js var i = {}; async function u(e, r3) { try { return { data: (await j(e, r3)).data, baseUrl: Ot(e), styleUrl: e }; } catch (t) { return w(t), null; } } function y(e, r3, o) { const s2 = r(r3.portal) ? r3.portal : B.getDefault(); let n; const a2 = `${s2.url} - ${s2.user && s2.user.username} - ${e}`; return i[a2] || (i[a2] = m(e, s2, o).then((e2) => (n = e2, e2.fetchData())).then((r4) => ({ data: r4, baseUrl: n.itemUrl, styleName: e }))), i[a2]; } function m(e, t, o) { return t.load(o).then(() => { const r3 = new d({ disableExtraQuery: true, query: `owner:${w2} AND type:${h} AND typekeywords:"${e}"` }); return t.queryItems(r3, o); }).then(({ results: t2 }) => { let s2 = null; const n = e.toLowerCase(); if (t2 && Array.isArray(t2)) for (const e2 of t2) { if (e2.typeKeywords.some((e3) => e3.toLowerCase() === n) && e2.type === h && e2.owner === w2) { s2 = e2; break; } } if (!s2) throw new s("symbolstyleutils:style-not-found", `The style '${e}' could not be found`, { styleName: e }); return s2.load(o); }); } function c(e, t, o) { return e.styleUrl ? u(e.styleUrl, o) : e.styleName ? y(e.styleName, t, o) : Promise.reject(new s("symbolstyleutils:style-url-and-name-missing", "Either styleUrl or styleName is required to resolve a style")); } function p(e) { return e === null || e.type === "CIMSymbolReference" ? e : { type: "CIMSymbolReference", symbol: e }; } function d2(e, r3) { if (r3 === "cimRef") return e.cimRef; if (e.formatInfos && !r2()) { for (const t of e.formatInfos) if (t.type === "gltf") return t.href; } return e.webRef; } function j(r3, t) { const o = { responseType: "json", query: { f: "json" }, ...t }; return U(F(r3), o); } var w2 = "esri_en"; var h = "Style"; var U2 = "https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json"; export { c, p, d2 as d, j, U2 as U }; //# sourceMappingURL=chunk-UPD4MTCL.js.map