{"version":3,"sources":["node_modules/@arcgis/core/layers/support/arcgisLayerUrl.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*/\nimport { urlToObject as e, getOrigin as r, removeTrailingSlash as t, removeQueryParameters as s, join as n, Url as l, makeAbsolute as i } from \"../../core/urlUtils.js\";\nimport { w as u } from \"../../chunks/persistableUrlUtils.js\";\nconst o = {\n mapserver: \"MapServer\",\n imageserver: \"ImageServer\",\n featureserver: \"FeatureServer\",\n knowledgegraphserver: \"KnowledgeGraphServer\",\n sceneserver: \"SceneServer\",\n streamserver: \"StreamServer\",\n vectortileserver: \"VectorTileServer\",\n \"3dtilesserver\": \"3DTilesServer\",\n videoserver: \"VideoServer\"\n },\n a = Object.values(o),\n c = new RegExp(`^((?:https?:)?\\\\/\\\\/\\\\S+?\\\\/rest\\\\/services\\\\/(.+?)\\\\/(${a.join(\"|\")}))(?:\\\\/(?:layers\\\\/)?(\\\\d+))?`, \"i\"),\n v = new RegExp(`^((?:https?:)?\\\\/\\\\/\\\\S+?\\\\/([^/\\\\n]+)\\\\/(${a.join(\"|\")}))(?:\\\\/(?:layers\\\\/)?(\\\\d+))?`, \"i\"),\n f = /(.*?)\\/(?:layers\\/)?(\\d+)\\/?$/i;\nfunction p(e) {\n return c.test(e);\n}\nfunction d(r) {\n if (null == r) return null;\n const t = e(r),\n s = t?.path.match(c) || t?.path.match(v);\n if (!s) return null;\n const [, n, l, i, u] = s,\n a = l.indexOf(\"/\");\n return {\n title: m(-1 !== a ? l.slice(a + 1) : l),\n serverType: o[i.toLowerCase()],\n sublayer: null != u && \"\" !== u ? parseInt(u, 10) : null,\n url: {\n path: n\n }\n };\n}\nfunction h(r) {\n const t = e(r).path.match(f);\n return t ? {\n serviceUrl: t[1],\n sublayerId: Number(t[2])\n } : null;\n}\nfunction m(e) {\n return (e = e.replaceAll(/\\s*[/_]+\\s*/g, \" \"))[0].toUpperCase() + e.slice(1);\n}\nfunction w(e, r) {\n const t = [];\n if (e) {\n const r = d(e);\n null != r && r.title && t.push(r.title);\n }\n if (r) {\n const e = m(r);\n t.push(e);\n }\n if (2 === t.length) {\n if (t[0].toLowerCase().includes(t[1].toLowerCase())) return t[0];\n if (t[1].toLowerCase().includes(t[0].toLowerCase())) return t[1];\n }\n return t.join(\" - \");\n}\nfunction g(e) {\n let t = r(e, !0);\n return !!t && (t = t.toLowerCase(), t.endsWith(\".arcgis.com\") && (t.startsWith(\"services\") || t.startsWith(\"tiles\") || t.startsWith(\"features\")));\n}\nfunction y(e, r) {\n return e ? t(s(e, r)) : e;\n}\nfunction S(r) {\n let {\n url: n\n } = r;\n if (!n) return {\n url: n\n };\n n = s(n, r.logger);\n const l = e(n),\n i = d(l.path);\n let u;\n if (null != i) null != i.sublayer && null == r.layer.layerId && (u = i.sublayer), n = i.url.path;else if (r.nonStandardUrlAllowed) {\n const e = h(l.path);\n null != e && (n = e.serviceUrl, u = e.sublayerId);\n }\n return {\n url: t(n),\n layerId: u\n };\n}\nfunction C(e, r, t, s, l) {\n u(r, s, \"url\", l), s.url && null != e.layerId && (s.url = n(s.url, t, e.layerId.toString()));\n}\nfunction b(e) {\n if (!e) return !1;\n const r = e.toLowerCase(),\n t = r.includes(\"/services/\"),\n s = r.includes(\"/mapserver/wmsserver\"),\n n = r.includes(\"/imageserver/wmsserver\"),\n l = r.includes(\"/wmsserver\");\n return t && (s || n || l);\n}\nfunction I(e) {\n if (!e) return !1;\n const r = new l(i(e)),\n t = r.authority?.toLowerCase();\n return \"server.arcgisonline.com\" === t || \"services.arcgisonline.com\" === t;\n}\nexport { m as cleanTitle, p as isArcGISUrl, g as isHostedAgolService, I as isServerOrServicesAGOLUrl, b as isWmsServer, d as parse, h as parseNonStandardSublayerUrl, y as sanitizeUrl, S as sanitizeUrlWithLayerId, a as serverTypes, w as titleFromUrlAndName, C as writeUrlWithLayerId };"],"mappings":"4GAMA,IAAMA,EAAI,CACN,UAAW,YAC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ACA,MAAO,CACL,IAAKe,EAAEX,CAAC,EACR,QAASG,CACX,CACF,CACA,SAASW,EAAElB,EAAGW,EAAGT,EAAGiB,EAAGd,EAAG,CACxBI,EAAEE,EAAGQ,EAAG,MAAOd,CAAC,EAAGc,EAAE,KAAenB,EAAE,SAAV,OAAsBmB,EAAE,IAAMC,EAAED,EAAE,IAAKjB,EAAGF,EAAE,QAAQ,SAAS,CAAC,EAC5F,CACA,SAASqB,EAAErB,EAAG,CACZ,GAAI,CAACA,EAAG,MAAO,GACf,IAAMW,EAAIX,EAAE,YAAY,EACtBE,EAAIS,EAAE,SAAS,YAAY,EAC3BQ,EAAIR,EAAE,SAAS,sBAAsB,EACrC,EAAIA,EAAE,SAAS,wBAAwB,EACvC,EAAIA,EAAE,SAAS,YAAY,EAC7B,OAAOT,IAAMiB,GAAK,GAAK,EACzB","names":["o","a","c","v","f","p","e","d","t","I","n","l","i","u","m","h","w","r","g","X","y","jt","St","S","C","s","V","b"],"x_google_ignoreList":[0]}