{"version":3,"sources":["node_modules/@arcgis/core/symbols/support/styleCache.js","node_modules/@arcgis/core/symbols/support/styleUtils.js"],"sourcesContent":["/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.31/esri/copyright.txt for details.\n*/\nconst e = new Map();\nexport { e as cachedStyles };","/*\nAll material copyright ESRI, All Rights Reserved, unless otherwise specified.\nSee https://js.arcgis.com/4.31/esri/copyright.txt for details.\n*/\nimport e from \"../../request.js\";\nimport t from \"../../core/Error.js\";\nimport has from \"../../core/has.js\";\nimport { throwIfAbortError as r } from \"../../core/promiseUtils.js\";\nimport { normalize as o, removeFile as s } from \"../../core/urlUtils.js\";\nimport n from \"../../portal/Portal.js\";\nimport l from \"../../portal/PortalQueryParams.js\";\nimport { cachedStyles as a } from \"./styleCache.js\";\nasync function f(e, t) {\n try {\n return {\n data: (await p(e, t)).data,\n baseUrl: s(e),\n styleUrl: e\n };\n } catch (o) {\n return r(o), null;\n }\n}\nfunction u(e, t, r) {\n const o = null != t.portal ? t.portal : n.getDefault();\n let s;\n const l = `${o.url} - ${o.user?.username} - ${e}`,\n f = a.get(l);\n if (f) return f;\n const u = c(e, o, r).then(e => (s = e, e.fetchData())).then(t => ({\n data: t,\n baseUrl: s.itemUrl ?? \"\",\n styleName: e\n }));\n return a.set(l, u), u;\n}\nfunction c(e, r, o) {\n return r.load(o).then(() => {\n const t = new l({\n disableExtraQuery: !0,\n query: `owner:${d} AND type:${b} AND typekeywords:\"${e}\"`\n });\n return r.queryItems(t, o);\n }).then(({\n results: r\n }) => {\n let s = null;\n const n = e.toLowerCase();\n if (r && Array.isArray(r)) for (const e of r) {\n const t = e.typeKeywords?.some(e => e.toLowerCase() === n);\n if (t && e.type === b && e.owner === d) {\n s = e;\n break;\n }\n }\n if (!s) throw new t(\"symbolstyleutils:style-not-found\", `The style '${e}' could not be found`, {\n styleName: e\n });\n return s.load(o);\n });\n}\nfunction i(e, r, o) {\n return null != e?.styleUrl ? f(e.styleUrl, o) : null != e?.styleName ? u(e.styleName, r, o) : Promise.reject(new t(\"symbolstyleutils:style-url-and-name-missing\", \"Either styleUrl or styleName is required to resolve a style\"));\n}\nfunction m(e) {\n return null === e || \"CIMSymbolReference\" === e.type ? e : {\n type: \"CIMSymbolReference\",\n symbol: e\n };\n}\nfunction y(e, t, r = [\"gltf\"]) {\n if (\"cimRef\" === t) return encodeURI(e.cimRef);\n if (e.formatInfos && !has(\"enable-feature:force-wosr\")) for (const o of r) {\n const t = e.formatInfos.find(e => e.type === o);\n if (t) return t.href;\n }\n return encodeURI(e.webRef);\n}\nfunction p(t, r) {\n const s = {\n responseType: \"json\",\n query: {\n f: \"json\"\n },\n ...r\n };\n return e(o(t), s);\n}\nconst d = \"esri_en\",\n b = \"Style\",\n h = \"https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json\";\nexport { h as Style2DUrlTemplate, i as fetchStyle, m as makeCIMSymbolRef, p as requestJSON, y as symbolUrlFromStyleItem };"],"mappings":"6SAIA,IAAMA,EAAI,IAAI,ICQd,SAAeC,EAAE,EAAGC,EAAG,QAAAC,EAAA,sBACrB,GAAI,CACF,MAAO,CACL,MAAO,MAAMC,EAAE,EAAGF,CAAC,GAAG,KACtB,QAASG,EAAE,CAAC,EACZ,SAAU,CACZ,CACF,OAASC,EAAG,CACV,OAAOC,EAAED,CAAC,EAAG,IACf,CACF,GACA,SAASE,EAAE,EAAGN,EAAGO,EAAG,CAClB,IAAM,EAAYP,EAAE,QAAV,KAAmBA,EAAE,OAASQ,EAAE,WAAW,EACjD,EACE,EAAI,GAAG,EAAE,GAAG,MAAM,EAAE,MAAM,QAAQ,MAAM,CAAC,GAC7CT,EAAIU,EAAE,IAAI,CAAC,EACb,GAAIV,EAAG,OAAOA,EACd,IAAMO,EAAII,EAAE,EAAG,EAAGH,CAAC,EAAE,KAAKE,IAAM,EAAIA,EAAGA,EAAE,UAAU,EAAE,EAAE,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AI,EAAE,aAAe,CAACiB,EAAI,2BAA2B,EAAG,QAAW,KAAKV,EAAG,CACzE,IAAMP,EAAI,EAAE,YAAY,KAAKS,GAAKA,EAAE,OAAS,CAAC,EAC9C,GAAIT,EAAG,OAAOA,EAAE,IAClB,CACA,OAAO,UAAU,EAAE,MAAM,CAC3B,CACA,SAASE,EAAEF,EAAG,EAAG,CACf,IAAMa,EAAIK,EAAA,CACR,aAAc,OACd,MAAO,CACL,EAAG,MACL,GACG,GAEL,OAAOC,EAAEC,EAAEpB,CAAC,EAAGa,CAAC,CAClB,CACA,IAAMF,EAAI,UACRH,EAAI,QACJa,EAAI","names":["e","f","t","__async","p","Rt","o","a","u","r","b","e","c","d","n","s","i","m","y","has","__spreadValues","U","K","h"],"x_google_ignoreList":[0,1]}