chunk-BQSLUIIU.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. import {
  2. t as t3
  3. } from "./chunk-XO7O5UZJ.js";
  4. import {
  5. r as r5
  6. } from "./chunk-GGGVIS2U.js";
  7. import {
  8. p as p2
  9. } from "./chunk-S3GK7VUF.js";
  10. import {
  11. t as t2
  12. } from "./chunk-TU7WVKU4.js";
  13. import {
  14. n as n4
  15. } from "./chunk-NQA5XJGK.js";
  16. import {
  17. c2 as c3,
  18. j2 as j3
  19. } from "./chunk-JAUFBT5U.js";
  20. import {
  21. p as p3
  22. } from "./chunk-7C2KDOAI.js";
  23. import {
  24. n as n3,
  25. p2 as p
  26. } from "./chunk-RHFU6KWO.js";
  27. import {
  28. k as k2
  29. } from "./chunk-P6VVVEX6.js";
  30. import {
  31. c2
  32. } from "./chunk-3Z755LKF.js";
  33. import {
  34. K,
  35. c,
  36. x
  37. } from "./chunk-WD4J43GZ.js";
  38. import {
  39. m as m2
  40. } from "./chunk-SZFMKPVM.js";
  41. import {
  42. a
  43. } from "./chunk-YZVAB3DF.js";
  44. import {
  45. r as r4
  46. } from "./chunk-JLSNMUQJ.js";
  47. import {
  48. y as y3
  49. } from "./chunk-JGBXYDGB.js";
  50. import {
  51. U,
  52. l
  53. } from "./chunk-TJV6ODRM.js";
  54. import {
  55. j as j4,
  56. p as p4
  57. } from "./chunk-GLSWDDR3.js";
  58. import {
  59. O
  60. } from "./chunk-MIQGEDET.js";
  61. import {
  62. l as l2
  63. } from "./chunk-CDZENOCQ.js";
  64. import {
  65. s as s5
  66. } from "./chunk-3GZSQU56.js";
  67. import {
  68. i
  69. } from "./chunk-75U5LM2V.js";
  70. import {
  71. j
  72. } from "./chunk-LBW34VZ2.js";
  73. import {
  74. m
  75. } from "./chunk-YFSLJIO4.js";
  76. import {
  77. U as U2
  78. } from "./chunk-DVUG3KID.js";
  79. import {
  80. I,
  81. j as j2
  82. } from "./chunk-VEGAOVMY.js";
  83. import {
  84. o,
  85. w2 as w
  86. } from "./chunk-6T6G6LCQ.js";
  87. import {
  88. s as s4
  89. } from "./chunk-YEJL5NEF.js";
  90. import {
  91. k2 as k,
  92. r as r3
  93. } from "./chunk-PQFTYGF5.js";
  94. import {
  95. e,
  96. e2,
  97. n3 as n,
  98. n5 as n2,
  99. r2,
  100. t3 as t,
  101. y3 as y2
  102. } from "./chunk-2Z2TG5CU.js";
  103. import {
  104. T,
  105. b,
  106. s as s3,
  107. v
  108. } from "./chunk-SQOPWYIT.js";
  109. import {
  110. f
  111. } from "./chunk-V6P2MAQQ.js";
  112. import {
  113. s2 as s,
  114. s3 as s2
  115. } from "./chunk-E5O6P5I2.js";
  116. import {
  117. y
  118. } from "./chunk-SPWQ3AWG.js";
  119. import {
  120. r
  121. } from "./chunk-YXWMMD76.js";
  122. // node_modules/@arcgis/core/layers/mixins/ArcGISMapService.js
  123. var y4 = (y5) => {
  124. let d = class extends y5 {
  125. constructor() {
  126. super(...arguments), this.capabilities = void 0, this.copyright = null, this.fullExtent = null, this.legendEnabled = true, this.spatialReference = null, this.version = void 0, this._allLayersAndTablesPromise = null, this._allLayersAndTablesMap = null;
  127. }
  128. readCapabilities(e3, r6) {
  129. var _a, _b;
  130. const s6 = r6.capabilities && r6.capabilities.split(",").map((e4) => e4.toLowerCase().trim());
  131. if (!s6)
  132. return { operations: { supportsExportMap: false, supportsExportTiles: false, supportsIdentify: false, supportsQuery: false, supportsTileMap: false }, exportMap: null, exportTiles: null };
  133. const t4 = this.type, i2 = s6.includes("data"), p5 = s6.includes("query"), a2 = s6.includes("map"), l3 = !!r6.exportTilesAllowed, n5 = s6.includes("tilemap"), u = "tile" !== t4 && !!r6.supportsDynamicLayers, c4 = "tile" !== t4 && (!r6.tileInfo || u), y6 = "tile" !== t4 && (!r6.tileInfo || u), d2 = "tile" !== t4, m4 = r6.cimVersion && r5.parse(r6.cimVersion), h2 = (_a = m4 == null ? void 0 : m4.since(1, 4)) != null ? _a : false, b2 = (_b = m4 == null ? void 0 : m4.since(2, 0)) != null ? _b : false;
  134. return { operations: { supportsExportMap: a2, supportsExportTiles: l3, supportsIdentify: p5, supportsQuery: i2, supportsTileMap: n5 }, exportMap: a2 ? { supportsArcadeExpressionForLabeling: h2, supportsSublayersChanges: d2, supportsDynamicLayers: u, supportsSublayerVisibility: c4, supportsSublayerDefinitionExpression: y6, supportsCIMSymbols: b2 } : null, exportTiles: l3 ? { maxExportTilesCount: +r6.maxExportTilesCount } : null };
  135. }
  136. readVersion(e3, r6) {
  137. let s6 = r6.currentVersion;
  138. return s6 || (s6 = r6.hasOwnProperty("capabilities") || r6.hasOwnProperty("tables") ? 10 : r6.hasOwnProperty("supportedImageFormatTypes") ? 9.31 : 9.3), s6;
  139. }
  140. async fetchSublayerInfo(e3, r6) {
  141. var _a;
  142. return await this.fetchAllLayersAndTables(r6), (_a = this._allLayersAndTablesMap) == null ? void 0 : _a.get(e3);
  143. }
  144. async fetchAllLayersAndTables(e3) {
  145. await this.load(e3), this._allLayersAndTablesPromise || (this._allLayersAndTablesPromise = U2(j2(this.url).path + "/layers", { responseType: "json", query: { f: "json", ...this.customParameters, token: this.apiKey } }).then((e4) => {
  146. this._allLayersAndTablesMap = /* @__PURE__ */ new Map();
  147. for (const r6 of e4.data.layers)
  148. this._allLayersAndTablesMap.set(r6.id, r6);
  149. return { result: e4.data };
  150. }, (e4) => ({ error: e4 })));
  151. const o2 = await this._allLayersAndTablesPromise;
  152. if (f(e3), "result" in o2)
  153. return o2.result;
  154. throw o2.error;
  155. }
  156. };
  157. return e([y2({ readOnly: true })], d.prototype, "capabilities", void 0), e([o("service", "capabilities", ["capabilities", "exportTilesAllowed", "maxExportTilesCount", "supportsDynamicLayers", "tileInfo"])], d.prototype, "readCapabilities", null), e([y2({ json: { read: { source: "copyrightText" } } })], d.prototype, "copyright", void 0), e([y2({ type: w })], d.prototype, "fullExtent", void 0), e([y2(j4)], d.prototype, "id", void 0), e([y2({ type: Boolean, json: { origins: { service: { read: { enabled: false } } }, read: { source: "showLegend" }, write: { target: "showLegend" } } })], d.prototype, "legendEnabled", void 0), e([y2(p4)], d.prototype, "popupEnabled", void 0), e([y2({ type: k })], d.prototype, "spatialReference", void 0), e([y2({ readOnly: true })], d.prototype, "version", void 0), e([o("version", ["currentVersion", "capabilities", "tables", "supportedImageFormatTypes"])], d.prototype, "readVersion", null), d = e([n2("esri.layers.mixins.ArcGISMapService")], d), d;
  158. };
  159. // node_modules/@arcgis/core/layers/support/Sublayer.js
  160. var $;
  161. function J(e3) {
  162. return e3 && "esriSMS" === e3.type;
  163. }
  164. function B(e3, r6, t4) {
  165. var _a;
  166. const i2 = this.originIdOf(r6) >= t(t4.origin);
  167. return { ignoreOrigin: true, allowNull: i2, enabled: !!t4 && ("map-image" === ((_a = t4.layer) == null ? void 0 : _a.type) && (t4.writeSublayerStructure || i2)) };
  168. }
  169. function Q(e3, r6, t4) {
  170. var _a;
  171. return { enabled: !!t4 && ("tile" === ((_a = t4.layer) == null ? void 0 : _a.type) && this._isOverridden(r6)) };
  172. }
  173. function G(e3, r6, t4) {
  174. return { ignoreOrigin: true, enabled: t4 && t4.writeSublayerStructure || false };
  175. }
  176. function H(e3, r6, t4) {
  177. return { ignoreOrigin: true, enabled: !!t4 && (t4.writeSublayerStructure || this.originIdOf(r6) >= t(t4.origin)) };
  178. }
  179. var K2 = 0;
  180. var W = /* @__PURE__ */ new Set();
  181. W.add("layer"), W.add("parent"), W.add("loaded"), W.add("loadStatus"), W.add("loadError"), W.add("loadWarnings");
  182. var X = $ = class extends a(O(s5(m))) {
  183. constructor(e3) {
  184. super(e3), this.capabilities = void 0, this.fields = null, this.fullExtent = null, this.geometryType = null, this.globalIdField = null, this.legendEnabled = true, this.objectIdField = null, this.popupEnabled = true, this.popupTemplate = null, this.sourceJSON = null, this.title = null, this.typeIdField = null, this.types = null;
  185. }
  186. async load(e3) {
  187. return this.addResolvingPromise((async () => {
  188. var _a, _b;
  189. if (!this.layer && !this.url)
  190. throw new s2("sublayer:missing-layer", "Sublayer can't be loaded without being part of a layer", { sublayer: this });
  191. let r6 = null;
  192. if (!this.layer || this.originIdOf("url") > r2.SERVICE || "data-layer" === ((_a = this.source) == null ? void 0 : _a.type)) {
  193. r6 = (await U2(this.url, { responseType: "json", query: { f: "json" }, ...e3 })).data;
  194. } else {
  195. let t4 = this.id;
  196. "map-layer" === ((_b = this.source) == null ? void 0 : _b.type) && (t4 = this.source.mapLayerId), r6 = await this.layer.fetchSublayerInfo(t4, e3);
  197. }
  198. r6 && (this.sourceJSON = r6, this.read({ layerDefinition: r6 }, { origin: "service" }));
  199. })()), this;
  200. }
  201. readCapabilities(e3, r6) {
  202. const t4 = (e3 = (r6 = r6.layerDefinition || r6).capabilities || e3) ? e3.toLowerCase().split(",").map((e4) => e4.trim()) : [], i2 = this.url ? m2(this.url) : null, o2 = t4.includes(r(i2) && "MapServer" === i2.serverType ? "data" : "query");
  203. return { exportMap: { supportsModification: !!r6.canModifyLayer }, operations: { supportsQuery: o2 } };
  204. }
  205. set definitionExpression(e3) {
  206. this._setAndNotifyLayer("definitionExpression", e3);
  207. }
  208. get fieldsIndex() {
  209. return new r4(this.fields || []);
  210. }
  211. set floorInfo(e3) {
  212. this._setAndNotifyLayer("floorInfo", e3);
  213. }
  214. readGlobalIdFieldFromService(e3, r6) {
  215. if ((r6 = r6.layerDefinition || r6).globalIdField)
  216. return r6.globalIdField;
  217. if (r6.fields) {
  218. for (const t4 of r6.fields)
  219. if ("esriFieldTypeGlobalID" === t4.type)
  220. return t4.name;
  221. }
  222. }
  223. get id() {
  224. const e3 = this._get("id");
  225. return e3 != null ? e3 : K2++;
  226. }
  227. set id(e3) {
  228. this._get("id") !== e3 && (false !== this.get("layer.capabilities.exportMap.supportsDynamicLayers") ? this._set("id", e3) : this._logLockedError("id", "capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"));
  229. }
  230. set labelingInfo(e3) {
  231. this._setAndNotifyLayer("labelingInfo", e3);
  232. }
  233. writeLabelingInfo(e3, r6, t4, i2) {
  234. e3 && e3.length && (r6.layerDefinition = { drawingInfo: { labelingInfo: e3.map((e4) => e4.write({}, i2)) } });
  235. }
  236. set labelsVisible(e3) {
  237. this._setAndNotifyLayer("labelsVisible", e3);
  238. }
  239. set layer(e3) {
  240. this._set("layer", e3), this.sublayers && this.sublayers.forEach((r6) => r6.layer = e3);
  241. }
  242. set listMode(e3) {
  243. this._set("listMode", e3);
  244. }
  245. set minScale(e3) {
  246. this._setAndNotifyLayer("minScale", e3);
  247. }
  248. readMinScale(e3, r6) {
  249. return r6.minScale || r6.layerDefinition && r6.layerDefinition.minScale || 0;
  250. }
  251. set maxScale(e3) {
  252. this._setAndNotifyLayer("maxScale", e3);
  253. }
  254. readMaxScale(e3, r6) {
  255. return r6.maxScale || r6.layerDefinition && r6.layerDefinition.maxScale || 0;
  256. }
  257. get effectiveScaleRange() {
  258. const { minScale: e3, maxScale: r6 } = this;
  259. return { minScale: e3, maxScale: r6 };
  260. }
  261. readObjectIdFieldFromService(e3, r6) {
  262. if ((r6 = r6.layerDefinition || r6).objectIdField)
  263. return r6.objectIdField;
  264. if (r6.fields) {
  265. for (const t4 of r6.fields)
  266. if ("esriFieldTypeOID" === t4.type)
  267. return t4.name;
  268. }
  269. }
  270. set opacity(e3) {
  271. this._setAndNotifyLayer("opacity", e3);
  272. }
  273. readOpacity(e3, r6) {
  274. const t4 = r6.layerDefinition;
  275. return 1 - 0.01 * (null != t4.transparency ? t4.transparency : t4.drawingInfo.transparency);
  276. }
  277. writeOpacity(e3, r6, t4, i2) {
  278. r6.layerDefinition = { drawingInfo: { transparency: 100 - 100 * e3 } };
  279. }
  280. writeParent(e3, r6) {
  281. this.parent && this.parent !== this.layer ? r6.parentLayerId = s3(this.parent.id) : r6.parentLayerId = -1;
  282. }
  283. get defaultPopupTemplate() {
  284. return this.createPopupTemplate();
  285. }
  286. set renderer(e3) {
  287. if (e3) {
  288. for (const r6 of e3.getSymbols())
  289. if (c2(r6)) {
  290. s.getLogger(this.declaredClass).warn("Sublayer renderer should use 2D symbols");
  291. break;
  292. }
  293. }
  294. this._setAndNotifyLayer("renderer", e3);
  295. }
  296. get source() {
  297. return this._get("source") || new c({ mapLayerId: this.id });
  298. }
  299. set source(e3) {
  300. this._setAndNotifyLayer("source", e3);
  301. }
  302. set sublayers(e3) {
  303. this._handleSublayersChange(e3, this._get("sublayers")), this._set("sublayers", e3);
  304. }
  305. castSublayers(e3) {
  306. return b(j.ofType($), e3);
  307. }
  308. writeSublayers(e3, r6, t4) {
  309. this.get("sublayers.length") && (r6[t4] = this.sublayers.map((e4) => e4.id).toArray().reverse());
  310. }
  311. readTypeIdField(e3, r6) {
  312. let t4 = (r6 = r6.layerDefinition || r6).typeIdField;
  313. if (t4 && r6.fields) {
  314. t4 = t4.toLowerCase();
  315. const e4 = r6.fields.find((e5) => e5.name.toLowerCase() === t4);
  316. e4 && (t4 = e4.name);
  317. }
  318. return t4;
  319. }
  320. get url() {
  321. var _a, _b;
  322. const e3 = (_b = (_a = this.layer) == null ? void 0 : _a.parsedUrl) != null ? _b : this._lastParsedUrl, r6 = this.source;
  323. if (!e3)
  324. return null;
  325. if (this._lastParsedUrl = e3, "map-layer" === (r6 == null ? void 0 : r6.type))
  326. return `${e3.path}/${r6.mapLayerId}`;
  327. const t4 = { layer: JSON.stringify({ source: this.source }) };
  328. return `${e3.path}/dynamicLayer?${I(t4)}`;
  329. }
  330. set url(e3) {
  331. this._overrideIfSome("url", e3);
  332. }
  333. set visible(e3) {
  334. this._setAndNotifyLayer("visible", e3);
  335. }
  336. writeVisible(e3, r6, t4, i2) {
  337. r6[t4] = this.getAtOrigin("defaultVisibility", "service") || e3;
  338. }
  339. clone() {
  340. const { store: e3 } = e2(this), r6 = new $();
  341. return e2(r6).store = e3.clone(W), this.commitProperty("url"), r6._lastParsedUrl = this._lastParsedUrl, r6;
  342. }
  343. createPopupTemplate(e3) {
  344. return p3(this, e3);
  345. }
  346. createQuery() {
  347. return new x({ returnGeometry: true, where: this.definitionExpression || "1=1" });
  348. }
  349. async createFeatureLayer() {
  350. var _a, _b;
  351. if (this.hasOwnProperty("sublayers"))
  352. return null;
  353. const e3 = (_a = this.layer) == null ? void 0 : _a.parsedUrl, r6 = new (0, (await import("./FeatureLayer-3WEBJCEM.js")).default)({ url: e3.path });
  354. return e3 && this.source && ("map-layer" === this.source.type ? r6.layerId = this.source.mapLayerId : r6.dynamicDataSource = this.source), null != this.layer.refreshInterval && (r6.refreshInterval = this.layer.refreshInterval), this.definitionExpression && (r6.definitionExpression = this.definitionExpression), this.floorInfo && (r6.floorInfo = y(this.floorInfo)), this.originIdOf("labelingInfo") > r2.SERVICE && (r6.labelingInfo = y(this.labelingInfo)), this.originIdOf("labelsVisible") > r2.DEFAULTS && (r6.labelsVisible = this.labelsVisible), this.originIdOf("legendEnabled") > r2.DEFAULTS && (r6.legendEnabled = this.legendEnabled), this.originIdOf("visible") > r2.DEFAULTS && (r6.visible = this.visible), this.originIdOf("minScale") > r2.DEFAULTS && (r6.minScale = this.minScale), this.originIdOf("maxScale") > r2.DEFAULTS && (r6.maxScale = this.maxScale), this.originIdOf("opacity") > r2.DEFAULTS && (r6.opacity = this.opacity), this.originIdOf("popupTemplate") > r2.DEFAULTS && (r6.popupTemplate = y(this.popupTemplate)), this.originIdOf("renderer") > r2.SERVICE && (r6.renderer = y(this.renderer)), "data-layer" === ((_b = this.source) == null ? void 0 : _b.type) && (r6.dynamicDataSource = this.source.clone()), this.originIdOf("title") > r2.DEFAULTS && (r6.title = this.title), "map-image" === this.layer.type && this.layer.originIdOf("customParameters") > r2.DEFAULTS && (r6.customParameters = this.layer.customParameters), "tile" === this.layer.type && this.layer.originIdOf("customParameters") > r2.DEFAULTS && (r6.customParameters = this.layer.customParameters), r6;
  355. }
  356. getField(e3) {
  357. return this.fieldsIndex.get(e3);
  358. }
  359. getFeatureType(e3) {
  360. const { typeIdField: r6, types: t4 } = this;
  361. if (!r6 || !e3)
  362. return null;
  363. const i2 = e3.attributes ? e3.attributes[r6] : void 0;
  364. if (null == i2)
  365. return null;
  366. let o2 = null;
  367. return t4.some((e4) => {
  368. const { id: r7 } = e4;
  369. return null != r7 && (r7.toString() === i2.toString() && (o2 = e4), !!o2);
  370. }), o2;
  371. }
  372. getFieldDomain(e3, r6) {
  373. const t4 = r6 && r6.feature, i2 = this.getFeatureType(t4);
  374. if (i2) {
  375. const r7 = i2.domains && i2.domains[e3];
  376. if (r7 && "inherited" !== r7.type)
  377. return r7;
  378. }
  379. return this._getLayerDomain(e3);
  380. }
  381. async queryFeatures(e3 = this.createQuery(), r6) {
  382. var _a, _b, _c, _d, _e, _f;
  383. if (await this.load(), !((_b = (_a = this.capabilities) == null ? void 0 : _a.operations) == null ? void 0 : _b.supportsQuery))
  384. throw new s2("Sublayer.queryFeatures", "this layer doesn't support queries.");
  385. const [{ executeQuery: t4 }, { default: i2 }] = await Promise.all([import("./query-5UKXMJ3Z.js"), import("./FeatureSet-4LFEUCS7.js")]), o2 = await t4(this.url, x.from(e3), (_d = (_c = this.layer) == null ? void 0 : _c.spatialReference) != null ? _d : null, { ...r6, query: { ...(_e = this.layer) == null ? void 0 : _e.customParameters, token: (_f = this.layer) == null ? void 0 : _f.apiKey } }), a2 = i2.fromJSON(o2.data);
  386. if (a2 == null ? void 0 : a2.features)
  387. for (const s6 of a2.features)
  388. s6.sourceLayer = this;
  389. return a2;
  390. }
  391. toExportImageJSON(e3) {
  392. var _a;
  393. const r6 = { id: this.id, source: ((_a = this.source) == null ? void 0 : _a.toJSON()) || { mapLayerId: this.id, type: "mapLayer" } }, t4 = t2(e3, this.definitionExpression);
  394. r(t4) && (r6.definitionExpression = t4);
  395. const i2 = ["renderer", "labelingInfo", "opacity", "labelsVisible"].reduce((e4, r7) => (e4[r7] = this.originIdOf(r7), e4), {}), o2 = Object.keys(i2).some((e4) => i2[e4] > r2.SERVICE);
  396. if (o2) {
  397. const e4 = r6.drawingInfo = {};
  398. if (i2.renderer > r2.SERVICE && (e4.renderer = this.renderer ? this.renderer.toJSON() : null), i2.labelsVisible > r2.SERVICE && (e4.showLabels = this.labelsVisible), this.labelsVisible && i2.labelingInfo > r2.SERVICE) {
  399. !this.loaded && this.labelingInfo.some((e5) => !e5.labelPlacement) && s.getLogger(this.declaredClass).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`, { sublayer: this });
  400. let r7 = this.labelingInfo;
  401. r(this.geometryType) && (r7 = c3(this.labelingInfo, i.toJSON(this.geometryType))), e4.labelingInfo = r7.filter((e5) => e5.labelPlacement).map((e5) => e5.toJSON({ origin: "service", layer: this.layer })), e4.showLabels = true;
  402. }
  403. i2.opacity > r2.SERVICE && (e4.transparency = 100 - 100 * this.opacity), this._assignDefaultSymbolColors(e4.renderer);
  404. }
  405. return r6;
  406. }
  407. _assignDefaultSymbolColors(e3) {
  408. this._forEachSimpleMarkerSymbols(e3, (e4) => {
  409. e4.color || "esriSMSX" !== e4.style && "esriSMSCross" !== e4.style || (e4.outline && e4.outline.color ? e4.color = e4.outline.color : e4.color = [0, 0, 0, 0]);
  410. });
  411. }
  412. _forEachSimpleMarkerSymbols(e3, r6) {
  413. if (e3) {
  414. const t4 = "uniqueValueInfos" in e3 ? e3.uniqueValueInfos : "classBreakInfos" in e3 ? e3.classBreakInfos : [];
  415. for (const e4 of t4)
  416. J(e4.symbol) && r6(e4.symbol);
  417. "symbol" in e3 && J(e3.symbol) && r6(e3.symbol), "defaultSymbol" in e3 && J(e3.defaultSymbol) && r6(e3.defaultSymbol);
  418. }
  419. }
  420. _setAndNotifyLayer(e3, r6) {
  421. const t4 = this.layer, i2 = this._get(e3);
  422. let o2, a2;
  423. switch (e3) {
  424. case "definitionExpression":
  425. case "floorInfo":
  426. o2 = "supportsSublayerDefinitionExpression";
  427. case "minScale":
  428. case "maxScale":
  429. case "visible":
  430. o2 = "supportsSublayerVisibility";
  431. break;
  432. case "labelingInfo":
  433. case "labelsVisible":
  434. case "opacity":
  435. case "renderer":
  436. case "source":
  437. o2 = "supportsDynamicLayers", a2 = "supportsModification";
  438. }
  439. const s6 = e2(this).getDefaultOrigin();
  440. if ("service" !== s6) {
  441. if (o2 && false === this.get(`layer.capabilities.exportMap.${o2}`))
  442. return void this._logLockedError(e3, `capability not available 'layer.capabilities.exportMap.${o2}'`);
  443. if (a2 && false === this.get(`capabilities.exportMap.${a2}`))
  444. return void this._logLockedError(e3, `capability not available 'capabilities.exportMap.${a2}'`);
  445. }
  446. "source" !== e3 || "not-loaded" === this.loadStatus ? (this._set(e3, r6), "service" !== s6 && i2 !== r6 && t4 && t4.emit && t4.emit("sublayer-update", { propertyName: e3, target: this })) : this._logLockedError(e3, "'source' can't be changed after calling sublayer.load()");
  447. }
  448. _handleSublayersChange(e3, r6) {
  449. r6 && (r6.forEach((e4) => {
  450. e4.parent = null, e4.layer = null;
  451. }), this.handles.removeAll()), e3 && (e3.forEach((e4) => {
  452. e4.parent = this, e4.layer = this.layer;
  453. }), this.handles.add([e3.on("after-add", ({ item: e4 }) => {
  454. e4.parent = this, e4.layer = this.layer;
  455. }), e3.on("after-remove", ({ item: e4 }) => {
  456. e4.parent = null, e4.layer = null;
  457. }), e3.on("before-changes", (e4) => {
  458. const r7 = this.get("layer.capabilities.exportMap.supportsSublayersChanges");
  459. null == r7 || r7 || (s.getLogger(this.declaredClass).error(new s2("sublayer:sublayers-non-modifiable", "Sublayer can't be added, moved, or removed from the layer's sublayers", { sublayer: this, layer: this.layer })), e4.preventDefault());
  460. })]));
  461. }
  462. _logLockedError(e3, r6) {
  463. s.getLogger(this.declaredClass).error(new s2("sublayer:locked", `Property '${String(e3)}' can't be changed on Sublayer from the layer '${this.layer.id}'`, { reason: r6, sublayer: this, layer: this.layer }));
  464. }
  465. _getLayerDomain(e3) {
  466. const r6 = this.fieldsIndex.get(e3);
  467. return r6 ? r6.domain : null;
  468. }
  469. };
  470. X.test = { isMapImageLayerOverridePolicy: (e3) => e3 === G || e3 === B, isTileImageLayerOverridePolicy: (e3) => e3 === Q }, e([y2({ readOnly: true })], X.prototype, "capabilities", void 0), e([o("service", "capabilities", ["layerDefinition.canModifyLayer", "layerDefinition.capabilities"])], X.prototype, "readCapabilities", null), e([y2({ type: String, value: null, json: { name: "layerDefinition.definitionExpression", write: { allowNull: true, overridePolicy: B } } })], X.prototype, "definitionExpression", null), e([y2({ type: [y3], json: { origins: { service: { read: { source: "layerDefinition.fields" } } } } })], X.prototype, "fields", void 0), e([y2({ readOnly: true })], X.prototype, "fieldsIndex", null), e([y2({ type: p2, value: null, json: { name: "layerDefinition.floorInfo", read: { source: "layerDefinition.floorInfo" }, write: { target: "layerDefinition.floorInfo", overridePolicy: B }, origins: { "web-scene": { read: false, write: false } } } })], X.prototype, "floorInfo", null), e([y2({ type: w, json: { read: { source: "layerDefinition.extent" } } })], X.prototype, "fullExtent", void 0), e([y2({ type: i.apiValues, json: { origins: { service: { name: "layerDefinition.geometryType", read: { reader: i.read } } } } })], X.prototype, "geometryType", void 0), e([y2({ type: String })], X.prototype, "globalIdField", void 0), e([o("service", "globalIdField", ["layerDefinition.globalIdField", "layerDefinition.fields"])], X.prototype, "readGlobalIdFieldFromService", null), e([y2({ type: T, json: { write: { ignoreOrigin: true } } })], X.prototype, "id", null), e([y2({ value: null, type: [j3], json: { read: { source: "layerDefinition.drawingInfo.labelingInfo" }, write: { target: "layerDefinition.drawingInfo.labelingInfo", overridePolicy: G } } })], X.prototype, "labelingInfo", null), e([r3("labelingInfo")], X.prototype, "writeLabelingInfo", null), e([y2({ type: Boolean, value: true, json: { read: { source: "layerDefinition.drawingInfo.showLabels" }, write: { target: "layerDefinition.drawingInfo.showLabels", overridePolicy: G } } })], X.prototype, "labelsVisible", null), e([y2({ value: null })], X.prototype, "layer", null), e([y2({ type: Boolean, value: true, json: { origins: { service: { read: { enabled: false } } }, read: { source: "showLegend" }, write: { target: "showLegend", overridePolicy: H } } })], X.prototype, "legendEnabled", void 0), e([y2({ type: ["show", "hide", "hide-children"], value: "show", json: { read: false, write: false, origins: { "web-scene": { read: true, write: true } } } })], X.prototype, "listMode", null), e([y2({ type: Number, value: 0, json: { write: { overridePolicy: G } } })], X.prototype, "minScale", null), e([o("minScale", ["minScale", "layerDefinition.minScale"])], X.prototype, "readMinScale", null), e([y2({ type: Number, value: 0, json: { write: { overridePolicy: G } } })], X.prototype, "maxScale", null), e([o("maxScale", ["maxScale", "layerDefinition.maxScale"])], X.prototype, "readMaxScale", null), e([y2({ readOnly: true })], X.prototype, "effectiveScaleRange", null), e([y2({ type: String })], X.prototype, "objectIdField", void 0), e([o("service", "objectIdField", ["layerDefinition.objectIdField", "layerDefinition.fields"])], X.prototype, "readObjectIdFieldFromService", null), e([y2({ type: Number, value: 1, json: { write: { target: "layerDefinition.drawingInfo.transparency", overridePolicy: G } } })], X.prototype, "opacity", null), e([o("opacity", ["layerDefinition.drawingInfo.transparency", "layerDefinition.transparency"])], X.prototype, "readOpacity", null), e([r3("opacity")], X.prototype, "writeOpacity", null), e([y2({ json: { type: T, write: { target: "parentLayerId", writerEnsuresNonNull: true, overridePolicy: G } } })], X.prototype, "parent", void 0), e([r3("parent")], X.prototype, "writeParent", null), e([y2({ type: Boolean, value: true, json: { read: { source: "disablePopup", reader: (e3, r6) => !r6.disablePopup }, write: { target: "disablePopup", overridePolicy: H, writer(e3, r6, t4) {
  471. r6[t4] = !e3;
  472. } } } })], X.prototype, "popupEnabled", void 0), e([y2({ type: k2, json: { read: { source: "popupInfo" }, write: { target: "popupInfo", overridePolicy: H } } })], X.prototype, "popupTemplate", void 0), e([y2({ readOnly: true })], X.prototype, "defaultPopupTemplate", null), e([y2({ types: p, value: null, json: { name: "layerDefinition.drawingInfo.renderer", write: { overridePolicy: G }, origins: { "web-scene": { types: n3, name: "layerDefinition.drawingInfo.renderer", write: { overridePolicy: G } } } } })], X.prototype, "renderer", null), e([y2({ types: { key: "type", base: null, typeMap: { "data-layer": K, "map-layer": c } }, cast(e3) {
  473. if (e3) {
  474. if ("mapLayerId" in e3)
  475. return v(c, e3);
  476. if ("dataSource" in e3)
  477. return v(K, e3);
  478. }
  479. return e3;
  480. }, json: { name: "layerDefinition.source", write: { overridePolicy: G } } })], X.prototype, "source", null), e([y2()], X.prototype, "sourceJSON", void 0), e([y2({ value: null, json: { type: [T], write: { target: "subLayerIds", allowNull: true, overridePolicy: G } } })], X.prototype, "sublayers", null), e([s4("sublayers")], X.prototype, "castSublayers", null), e([r3("sublayers")], X.prototype, "writeSublayers", null), e([y2({ type: String, json: { name: "name", write: { overridePolicy: H } } })], X.prototype, "title", void 0), e([y2({ type: String })], X.prototype, "typeIdField", void 0), e([o("typeIdField", ["layerDefinition.typeIdField"])], X.prototype, "readTypeIdField", null), e([y2({ type: [n4], json: { origins: { service: { read: { source: "layerDefinition.types" } } } } })], X.prototype, "types", void 0), e([y2({ type: String, json: { read: { source: "layerUrl" }, write: { target: "layerUrl", overridePolicy: Q } } })], X.prototype, "url", null), e([y2({ type: Boolean, value: true, json: { read: { source: "defaultVisibility" }, write: { target: "defaultVisibility", overridePolicy: G } } })], X.prototype, "visible", null), e([r3("visible")], X.prototype, "writeVisible", null), X = $ = e([n2("esri.layers.support.Sublayer")], X);
  481. var z = X;
  482. // node_modules/@arcgis/core/layers/mixins/SublayersOwner.js
  483. var f2 = s.getLogger("esri.layers.TileLayer");
  484. function S(e3, r6) {
  485. const s6 = [], t4 = {};
  486. return e3 ? (e3.forEach((e4) => {
  487. const o2 = new z();
  488. if (o2.read(e4, r6), t4[o2.id] = o2, null != e4.parentLayerId && -1 !== e4.parentLayerId) {
  489. const r7 = t4[e4.parentLayerId];
  490. r7.sublayers || (r7.sublayers = []), r7.sublayers.unshift(o2);
  491. } else
  492. s6.unshift(o2);
  493. }), s6) : s6;
  494. }
  495. var h = j.ofType(z);
  496. function m3(e3, r6) {
  497. e3 && e3.forEach((e4) => {
  498. r6(e4), e4.sublayers && e4.sublayers.length && m3(e4.sublayers, r6);
  499. });
  500. }
  501. var E = (o2) => {
  502. let E2 = class extends o2 {
  503. constructor(...e3) {
  504. super(...e3), this.allSublayers = new l2({ getCollections: () => [this.sublayers], getChildrenFunction: (e4) => e4.sublayers }), this.sublayersSourceJSON = { [r2.SERVICE]: {}, [r2.PORTAL_ITEM]: {}, [r2.WEB_SCENE]: {}, [r2.WEB_MAP]: {} }, this.addHandles(l(() => this.sublayers, (e4, r6) => this._handleSublayersChange(e4, r6), U));
  505. }
  506. readSublayers(e3, r6) {
  507. if (!r6 || !e3)
  508. return;
  509. const { sublayersSourceJSON: s6 } = this, t4 = t(r6.origin);
  510. if (t4 < r2.SERVICE)
  511. return;
  512. if (s6[t4] = { context: r6, visibleLayers: e3.visibleLayers || s6[t4].visibleLayers, layers: e3.layers || s6[t4].layers }, t4 > r2.SERVICE)
  513. return;
  514. this._set("serviceSublayers", this.createSublayersForOrigin("service").sublayers);
  515. const { sublayers: o3, origin: a2 } = this.createSublayersForOrigin("web-document"), l3 = e2(this);
  516. l3.setDefaultOrigin(a2), this._set("sublayers", new h(o3)), l3.setDefaultOrigin("user");
  517. }
  518. findSublayerById(e3) {
  519. return this.allSublayers.find((r6) => r6.id === e3);
  520. }
  521. createServiceSublayers() {
  522. return this.createSublayersForOrigin("service").sublayers;
  523. }
  524. createSublayersForOrigin(e3) {
  525. const r6 = t("web-document" === e3 ? "web-map" : e3);
  526. let s6 = r2.SERVICE, t4 = this.sublayersSourceJSON[r2.SERVICE].layers, o3 = this.sublayersSourceJSON[r2.SERVICE].context, a2 = null;
  527. const l3 = [r2.PORTAL_ITEM, r2.WEB_SCENE, r2.WEB_MAP].filter((e4) => e4 <= r6);
  528. for (const y5 of l3) {
  529. const e4 = this.sublayersSourceJSON[y5];
  530. t3(e4.layers) && (s6 = y5, t4 = e4.layers, o3 = e4.context, e4.visibleLayers && (a2 = { visibleLayers: e4.visibleLayers, context: e4.context }));
  531. }
  532. const i2 = [r2.PORTAL_ITEM, r2.WEB_SCENE, r2.WEB_MAP].filter((e4) => e4 > s6 && e4 <= r6);
  533. let n5 = null;
  534. for (const y5 of i2) {
  535. const { layers: e4, visibleLayers: r7, context: s7 } = this.sublayersSourceJSON[y5];
  536. e4 && (n5 = { layers: e4, context: s7 }), r7 && (a2 = { visibleLayers: r7, context: s7 });
  537. }
  538. const u = S(t4, o3), p5 = /* @__PURE__ */ new Map(), f3 = /* @__PURE__ */ new Set();
  539. if (n5)
  540. for (const y5 of n5.layers)
  541. p5.set(y5.id, y5);
  542. if (a2)
  543. for (const y5 of a2.visibleLayers)
  544. f3.add(y5);
  545. return m3(u, (e4) => {
  546. n5 && e4.read(p5.get(e4.id), n5.context), a2 && e4.read({ defaultVisibility: f3.has(e4.id) }, a2.context);
  547. }), { origin: n(s6), sublayers: new h({ items: u }) };
  548. }
  549. read(e3, r6) {
  550. super.read(e3, r6), this.readSublayers(e3, r6);
  551. }
  552. _handleSublayersChange(e3, r6) {
  553. r6 && (r6.forEach((e4) => {
  554. e4.parent = null, e4.layer = null;
  555. }), this.handles.remove("sublayers-owner")), e3 && (e3.forEach((e4) => {
  556. e4.parent = this, e4.layer = this;
  557. }), this.handles.add([e3.on("after-add", ({ item: e4 }) => {
  558. e4.parent = this, e4.layer = this;
  559. }), e3.on("after-remove", ({ item: e4 }) => {
  560. e4.parent = null, e4.layer = null;
  561. })], "sublayers-owner"), "tile" === this.type && this.handles.add(e3.on("before-changes", (e4) => {
  562. f2.error(new s2("tilelayer:sublayers-non-modifiable", "ISublayer can't be added, moved, or removed from the layer's sublayers", { layer: this })), e4.preventDefault();
  563. }), "sublayers-owner"));
  564. }
  565. };
  566. return e([y2({ readOnly: true })], E2.prototype, "allSublayers", void 0), e([y2({ readOnly: true, type: j.ofType(z) })], E2.prototype, "serviceSublayers", void 0), e([y2({ value: null, type: h, json: { read: false, write: { allowNull: true, ignoreOrigin: true } } })], E2.prototype, "sublayers", void 0), e([y2({ readOnly: true })], E2.prototype, "sublayersSourceJSON", void 0), E2 = e([n2("esri.layers.mixins.SublayersOwner")], E2), E2;
  567. };
  568. export {
  569. y4 as y,
  570. z,
  571. E
  572. };
  573. //# sourceMappingURL=chunk-BQSLUIIU.js.map