chunk-3RTOMVBL.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. import {
  2. e as e4
  3. } from "./chunk-YR7YKE3S.js";
  4. import {
  5. h,
  6. u as u3
  7. } from "./chunk-GSORSXL5.js";
  8. import {
  9. c as c2
  10. } from "./chunk-YJKEIUMW.js";
  11. import {
  12. x
  13. } from "./chunk-UFOCENZS.js";
  14. import {
  15. o
  16. } from "./chunk-GZJP6H3U.js";
  17. import {
  18. t as t2
  19. } from "./chunk-MWIFVNKP.js";
  20. import {
  21. o as o2
  22. } from "./chunk-VS4BIQ2O.js";
  23. import {
  24. re
  25. } from "./chunk-Q4LKAPDF.js";
  26. import {
  27. A,
  28. S
  29. } from "./chunk-23ONSYIH.js";
  30. import {
  31. q
  32. } from "./chunk-WFSV2B2I.js";
  33. import {
  34. t as t3
  35. } from "./chunk-S7R5EXHN.js";
  36. import {
  37. j,
  38. l
  39. } from "./chunk-6EU7GFUT.js";
  40. import {
  41. e as e3
  42. } from "./chunk-5NKYXKIA.js";
  43. import {
  44. u as u2
  45. } from "./chunk-N2663GRX.js";
  46. import {
  47. u
  48. } from "./chunk-WEMIK25H.js";
  49. import {
  50. v2 as v
  51. } from "./chunk-OWVBLVP3.js";
  52. import {
  53. R,
  54. r as r2
  55. } from "./chunk-MRJEICT6.js";
  56. import {
  57. d,
  58. e,
  59. n2 as n
  60. } from "./chunk-Y3WMVFTW.js";
  61. import {
  62. s,
  63. s3 as s2
  64. } from "./chunk-EMJ4ZSM2.js";
  65. import {
  66. m
  67. } from "./chunk-IKP3YN53.js";
  68. import {
  69. a,
  70. c,
  71. e as e2,
  72. r,
  73. t
  74. } from "./chunk-GZT4BVFP.js";
  75. // node_modules/@arcgis/core/views/2d/engine/LevelDependentSizeVariable.js
  76. var l2;
  77. var n2 = l2 = class extends j {
  78. writeLevels(e6, s3, i) {
  79. for (const t4 in e6) {
  80. const e7 = this.levels[t4];
  81. return void (s3.stops = e7);
  82. }
  83. }
  84. clone() {
  85. return new l2({ axis: this.axis, field: this.field, valueExpression: this.valueExpression, valueExpressionTitle: this.valueExpressionTitle, maxDataValue: this.maxDataValue, maxSize: e3(this.maxSize) ? this.maxSize.clone() : this.maxSize, minDataValue: this.minDataValue, minSize: e3(this.minSize) ? this.minSize.clone() : this.minSize, normalizationField: this.normalizationField, stops: this.stops && this.stops.map((e6) => e6.clone()), target: this.target, useSymbolValue: this.useSymbolValue, valueRepresentation: this.valueRepresentation, valueUnit: this.valueUnit, legendOptions: this.legendOptions && this.legendOptions.clone(), levels: m(this.levels) });
  86. }
  87. };
  88. e([d()], n2.prototype, "levels", void 0), e([r2("levels")], n2.prototype, "writeLevels", null), n2 = l2 = e([n("esri.views.2d.engine.LevelDependentSizeVariable")], n2);
  89. // node_modules/@arcgis/core/views/2d/layers/support/clusterUtils.js
  90. var o3 = s.getLogger("esri.views.2d.layers.support.clusterUtils");
  91. a.add("esri-cluster-arcade-enabled", true);
  92. var u4 = a("esri-cluster-arcade-enabled");
  93. var c3 = (e6, i, t4, s3) => {
  94. const a2 = i.clone();
  95. if (!m2(a2))
  96. return a2;
  97. if (t4.fields)
  98. for (const r4 of t4.fields)
  99. x2(e6, r4);
  100. if ("visualVariables" in a2) {
  101. const i2 = (a2.visualVariables || []).filter((e7) => e7.valueExpression !== "$view.scale"), n6 = d2(i2);
  102. i2.forEach((i3) => {
  103. i3.type === "rotation" ? i3.field ? i3.field = y(e6, i3.field, "avg_angle") : i3.valueExpression && (i3.field = S2(e6, i3.valueExpression, "avg_angle"), i3.valueExpression = null) : i3.normalizationField ? (i3.field = y(e6, i3.field, "norm", i3.normalizationField), i3.normalizationField = null) : i3.field ? i3.field = y(e6, i3.field, "avg") : (i3.field = S2(e6, i3.valueExpression, "avg"), i3.valueExpression = null);
  104. }), t(n6) && !p(i2) && (i2.push(f(t4, s3)), a2.dynamicClusterSize = true), a2.visualVariables = i2;
  105. }
  106. switch (a2.type) {
  107. case "simple":
  108. break;
  109. case "unique-value":
  110. a2.field ? a2.field = y(e6, a2.field, "mode") : a2.valueExpression && (a2.field = S2(e6, a2.valueExpression, "mode"), a2.valueExpression = null);
  111. break;
  112. case "class-breaks":
  113. a2.normalizationField ? (a2.field = y(e6, a2.field, "norm", a2.normalizationField), a2.normalizationField = null) : a2.field ? a2.field = y(e6, a2.field, "avg") : (a2.field = S2(e6, a2.valueExpression, "avg"), a2.valueExpression = null);
  114. }
  115. return a2;
  116. };
  117. var d2 = (e6) => {
  118. for (const i of e6)
  119. if (i.type === "size")
  120. return i;
  121. return null;
  122. };
  123. var p = (e6) => {
  124. for (const i of e6)
  125. if (i.field === "cluster_count")
  126. return true;
  127. return false;
  128. };
  129. var f = (e6, i) => {
  130. const t4 = [new l({ value: 0, size: 0 }), new l({ value: 1 })];
  131. if (t(i))
  132. return new j({ field: "cluster_count", stops: [...t4, new l({ value: 2, size: 0 })] });
  133. const s3 = Object.keys(i).reduce((r4, s4) => ({ ...r4, [s4]: [...t4, new l({ value: Math.max(2, i[s4].minValue), size: e6.clusterMinSize }), new l({ value: Math.max(3, i[s4].maxValue), size: e6.clusterMaxSize })] }), {});
  134. return new n2({ field: "cluster_count", levels: s3 });
  135. };
  136. var m2 = (i) => {
  137. const t4 = (t5) => o3.error(new s2("Unsupported-renderer", t5, { renderer: i }));
  138. if (i.type === "unique-value") {
  139. if (i.field2 || i.field3)
  140. return t4("FeatureReductionCluster does not support multi-field UniqueValueRenderers"), false;
  141. } else if (i.type === "class-breaks") {
  142. if (i.normalizationField) {
  143. const e6 = i.normalizationType;
  144. if (e6 !== "field")
  145. return t4(`FeatureReductionCluster does not support a normalizationType of ${e6}`), false;
  146. }
  147. } else if (i.type !== "simple")
  148. return t4(`FeatureReductionCluster does not support renderers of type ${i.type}`), false;
  149. if (!u4) {
  150. if ("valueExpression" in i && i.valueExpression)
  151. return t4("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"), false;
  152. if (("visualVariables" in i && i.visualVariables || []).some((e6) => !(!("valueExpression" in e6) || !e6.valueExpression)))
  153. return t4("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"), false;
  154. }
  155. return true;
  156. };
  157. function v2(e6, i, t4) {
  158. switch (e6) {
  159. case "avg":
  160. case "avg_angle":
  161. return `cluster_avg_${i}`;
  162. case "mode":
  163. return `cluster_type_${i}`;
  164. case "norm": {
  165. const e7 = t4, r4 = "field", a2 = i.toLowerCase() + ",norm:" + r4 + "," + e7.toLowerCase();
  166. return "cluster_avg_" + x(a2);
  167. }
  168. }
  169. }
  170. function x2(i, t4) {
  171. const { name: r4, outStatistic: a2 } = t4, { onStatisticField: n6, onStatisticValueExpression: l3, statisticType: u6 } = a2;
  172. if (l3) {
  173. const e6 = x(l3.toLowerCase());
  174. i.push({ name: r4, outStatistic: { onStatisticField: e6, onStatisticValueExpression: l3, statisticType: u6 } });
  175. } else
  176. n6 ? i.push({ name: r4, outStatistic: { onStatisticField: n6, statisticType: u6 } }) : o3.error(new s2("mapview-unsupported-field", "Unable to handle field", { field: t4 }));
  177. }
  178. function S2(e6, i, t4) {
  179. const r4 = x(i), a2 = t4 === "mode" ? `cluster_type_${r4}` : `cluster_avg_${r4}`;
  180. return e6.some((e7) => e7.name === a2) || e6.push({ name: a2, outStatistic: { onStatisticField: r4, onStatisticValueExpression: i, statisticType: t4 } }), a2;
  181. }
  182. function y(e6, i, t4, r4) {
  183. if (i === "cluster_count" || e6.some((e7) => e7.name === i))
  184. return i;
  185. const s3 = v2(t4, i, r4);
  186. return e6.some((e7) => e7.name === s3) || (t4 === "norm" ? e6.push({ name: s3, outStatistic: { onStatisticField: i, onStatisticNormalizationField: r4, statisticType: t4 } }) : e6.push({ name: s3, outStatistic: { onStatisticField: i, statisticType: t4 } })), s3;
  187. }
  188. // node_modules/@arcgis/core/views/2d/engine/webgl/util/vvFlagUtils.js
  189. function e5(e6) {
  190. if (!e6)
  191. return A.NONE;
  192. let r4 = 0;
  193. for (const i of e6)
  194. if (i.type === "size") {
  195. const t4 = o2(i);
  196. r4 |= t4, i.target === "outline" && (r4 |= t4 << 4);
  197. } else
  198. i.type === "color" ? r4 |= A.COLOR : i.type === "opacity" ? r4 |= A.OPACITY : i.type === "rotation" && (r4 |= A.ROTATION);
  199. return r4;
  200. }
  201. // node_modules/@arcgis/core/views/2d/layers/graphics/graphicsUtils.js
  202. var c4 = 512;
  203. var g = 50;
  204. function p2(e6, t4) {
  205. const n6 = R(t4);
  206. if (!n6)
  207. return null;
  208. const [i, s3] = n6.valid;
  209. return e6[2] > s3 ? [u2([e6[0], e6[1], s3, e6[3]]), u2([i, e6[1], i + e6[2] - s3, e6[3]])] : e6[0] < i ? [u2([i, e6[1], e6[2], e6[3]]), u2([s3 - (i - e6[0]), e6[1], s3, e6[3]])] : null;
  210. }
  211. function u5(e6) {
  212. return e6 === "text" || e6 === "esriTS";
  213. }
  214. function h2(e6) {
  215. return e6 === "simple-marker" || e6 === "picture-marker" || e6 === "esriSMS" || e6 === "esriPMS";
  216. }
  217. function y2(e6) {
  218. switch (e2(e6.geometry).type) {
  219. case "point":
  220. case "multipoint":
  221. return 0;
  222. case "polyline":
  223. return 1;
  224. case "polygon":
  225. case "extent":
  226. return 2;
  227. }
  228. return 0;
  229. }
  230. function d3(e6) {
  231. if (!e6)
  232. return null;
  233. const { xmin: t4, ymin: n6, xmax: r4, ymax: o4, spatialReference: s3 } = e6;
  234. return new v({ rings: [[[t4, n6], [t4, o4], [r4, o4], [r4, n6], [t4, n6]]], spatialReference: s3 });
  235. }
  236. // node_modules/@arcgis/core/views/2d/layers/features/support/pixelBuffering.js
  237. function m3(t4) {
  238. if (!("visualVariables" in t4))
  239. return 0;
  240. if (!t4.hasVisualVariables("size"))
  241. return 0;
  242. const e6 = t4.getVisualVariablesForType("size");
  243. if (!e6[0])
  244. return 0;
  245. const r4 = e6[0];
  246. if (r4.target === "outline")
  247. return 0;
  248. if (r4.transformationType === "stops")
  249. return r4.stops.map((t5) => t5.size).reduce(g2, 0);
  250. if (r4.transformationType === "clamped-linear") {
  251. let t5 = -1 / 0, e7 = -1 / 0;
  252. return t5 = typeof r4.maxSize == "number" ? r4.maxSize : r4.maxSize.stops.map((t6) => t6.size).reduce(g2, 0), e7 = typeof r4.minSize == "number" ? r4.minSize : r4.minSize.stops.map((t6) => t6.size).reduce(g2, 0), Math.max(t5, e7);
  253. }
  254. return r4.transformationType === "real-world-size" ? 30 : void 0;
  255. }
  256. var h3 = { sdf: true, code: 99, metrics: q.metrics, rect: new t2(0, 0, 24, 24), page: 0, textureBinding: 2 };
  257. function g2(t4, e6) {
  258. return Math.max(t4, e6);
  259. }
  260. // node_modules/@arcgis/core/views/2d/layers/features/schemaUtils.js
  261. var w = s.getLogger("esri.views.2d.layers.features.schemaUtils");
  262. var T = "ValidationError";
  263. var E = { esriGeometryPoint: ["above-right", "above-center", "above-left", "center-center", "center-left", "center-right", "below-center", "below-left", "below-right"], esriGeometryPolygon: ["always-horizontal"], esriGeometryPolyline: ["center-along"], esriGeometryMultipoint: null };
  264. function I(e6) {
  265. return e6;
  266. }
  267. function S3(e6) {
  268. let t4 = 0, r4 = 0, i = S.DEFAULT;
  269. if (r(e6)) {
  270. if (r4 = m3(e6), "visualVariables" in e6 && (t4 = e5(e6.visualVariables || []), e6.type === "dot-density" && (i = S.DOT_DENSITY)), e6.type === "heatmap" && (i = S.HEATMAP), e6.type === "dictionary")
  271. return { maxVVSize: r4, vvFlags: t4, symbologyType: S.DEFAULT };
  272. if (e6.type === "pie-chart")
  273. return { maxVVSize: r4, vvFlags: t4, symbologyType: S.PIE_CHART };
  274. if (i !== S.DOT_DENSITY && i !== S.HEATMAP) {
  275. const t5 = e6.getSymbols();
  276. "backgroundFillSymbol" in e6 && e6.backgroundFillSymbol && t5.push(e6.backgroundFillSymbol);
  277. let r5 = true, n6 = true;
  278. for (const e7 of t5)
  279. if (e7.type === "cim" && (n6 = false), e7.type === "simple-fill" || e7.type === "picture-fill") {
  280. const t6 = e7.outline, i2 = t6 && t6.style !== "none" && t6.style !== "solid", l3 = e7.type === "simple-fill" && e7.style !== "none" && e7.style !== "solid", s3 = e7.type === "picture-fill" || l3 || i2;
  281. i2 && (r5 = false), s3 && (n6 = false);
  282. }
  283. r5 ? i = n6 ? S.OUTLINE_FILL_SIMPLE : S.OUTLINE_FILL : n6 && (i = S.SIMPLE);
  284. }
  285. }
  286. return { vvFlags: t4, maxVVSize: r4, symbologyType: i };
  287. }
  288. function F(t4, r4) {
  289. const i = t4.labelPlacement, n6 = E[r4];
  290. if (!t4.symbol)
  291. return w.warn("No ILabelClass symbol specified."), true;
  292. if (!n6)
  293. return w.error(new s2("mapview-labeling:unsupported-geometry-type", `Unable to create labels for Feature Layer, ${r4} is not supported`)), true;
  294. if (!n6.includes(i)) {
  295. const e6 = n6[0];
  296. i && w.warn(`Found invalid label placement type ${i} for ${r4}. Defaulting to ${e6}`), t4.labelPlacement = e6;
  297. }
  298. return false;
  299. }
  300. function V(e6, t4) {
  301. const i = m(e6);
  302. return i.some((e7) => F(e7, t4)) ? [] : i;
  303. }
  304. function z(e6) {
  305. return a("esri-2d-update-debug") && console.debug("Created new schema", N(e6, true)), N(e6);
  306. }
  307. function N(e6, t4 = false) {
  308. try {
  309. const r4 = U(e6, t4), i = $(e6), l3 = {};
  310. r4.map((t5) => M(l3, e6, t5));
  311. const s3 = r(e6.subtypeCode) ? `${e6.subtypeField} = ${e6.subtypeCode}` : null, o4 = t3(e6.definitionExpression, s3);
  312. return { source: { definitionExpression: o4, fields: e6.fields.map((e7) => e7.toJSON()), gdbVersion: e6.gdbVersion, historicMoment: e6.historicMoment?.getTime(), outFields: e6.availableFields, pixelBuffer: e6.pixelBuffer, spatialReference: e6.spatialReference.toJSON(), timeExtent: e6.timeExtent?.toJSON(), customParameters: e6.customParameters }, attributes: { fields: {}, indexCount: 0 }, processors: r4, tileRenderer: i, targets: l3 };
  313. } catch (r4) {
  314. if (r4.fieldName === T)
  315. return w.error(r4), null;
  316. throw r4;
  317. }
  318. }
  319. function M(t4, r4, i) {
  320. switch (i.target) {
  321. case "feature":
  322. return void P(t4, O(r4), i);
  323. case "aggregate": {
  324. if (!("featureReduction" in r4))
  325. return;
  326. const n6 = r4.featureReduction;
  327. switch (n6.type) {
  328. case "selection":
  329. throw new s2(T, "Mapview does not support `selection` reduction type", n6);
  330. case "binning":
  331. return P(t4, O(r4), i), void j4(t4, n6, i);
  332. case "cluster":
  333. return P(t4, O(r4), i), void R2(t4, n6, i);
  334. }
  335. }
  336. }
  337. }
  338. function L(e6, t4) {
  339. for (const r4 in t4) {
  340. const i = t4[r4];
  341. if (i.target !== e6.name)
  342. continue;
  343. const n6 = e6.attributes[r4];
  344. n6 ? (n6.context.mesh = n6.context.mesh || i.context.mesh, n6.context.storage = n6.context.storage || i.context.storage) : e6.attributes[r4] = i;
  345. }
  346. return e6;
  347. }
  348. function O(e6) {
  349. return [e2(e6.filter)?.toJSON() ?? null, e2(e2(e6.featureEffect)?.filter)?.toJSON() ?? null];
  350. }
  351. function P(e6, t4, r4) {
  352. return e6.feature || (e6.feature = { name: "feature", input: "source", filters: t4, attributes: {} }), L(e6.feature, r4.attributes.fields), e6;
  353. }
  354. function j4(e6, t4, r4) {
  355. return e6.aggregate || (e6.aggregate = { name: "aggregate", type: "bin", filters: null, input: "feature", params: { fixedBinLevel: t4.fixedBinLevel }, attributes: {} }), L(e6.aggregate, r4.attributes.fields), e6;
  356. }
  357. function R2(e6, t4, r4) {
  358. return e6.aggregate || (e6.aggregate = { name: "aggregate", type: "cluster", input: "feature", filters: null, attributes: {}, params: { clusterRadius: u(t4.clusterRadius / 2), clusterPixelBuffer: 64 * Math.ceil(u(t4.clusterMaxSize) / 64), fields: r4.aggregateFields } }), L(e6.aggregate, r4.attributes.fields), e6;
  359. }
  360. function B(e6, t4) {
  361. return t4.field ? k(e6, { ...t4, type: "field", field: t4.field }) : t4.valueExpression ? k(e6, { ...t4, type: "expression", valueExpression: t4.valueExpression }) : { field: null, fieldIndex: null };
  362. }
  363. function k(e6, t4) {
  364. switch (t4.type) {
  365. case "expression": {
  366. const r4 = I(t4.valueExpression);
  367. if (!e6.fields[r4]) {
  368. const i = e6.indexCount++;
  369. e6.fields[r4] = { ...t4, name: r4, fieldIndex: i };
  370. }
  371. return { fieldIndex: e6.fields[r4].fieldIndex };
  372. }
  373. case "label-expression": {
  374. const r4 = I(JSON.stringify(t4.label));
  375. if (!e6.fields[r4]) {
  376. const i = e6.indexCount++;
  377. e6.fields[r4] = { ...t4, name: r4, fieldIndex: i };
  378. }
  379. return { fieldIndex: e6.fields[r4].fieldIndex };
  380. }
  381. case "field": {
  382. const r4 = t4.field;
  383. return t4.target === "aggregate" && e6.fields[r4] || (e6.fields[r4] = { ...t4, name: r4 }), { field: r4 };
  384. }
  385. case "statistic":
  386. return e6.fields[t4.name] = { ...t4 }, { field: t4.name };
  387. }
  388. }
  389. function U(e6, t4 = false) {
  390. const r4 = new Array();
  391. let i = 0;
  392. return r4.push(A2(e6, i++, t4)), r4;
  393. }
  394. function C(e6, t4, r4, i, n6, l3 = false) {
  395. const s3 = k(t4, { type: "label-expression", target: i, context: { mesh: true }, resultType: "string", label: { labelExpression: r4.labelExpression, labelExpressionInfo: r4.labelExpressionInfo ? { expression: r4.labelExpressionInfo.expression } : null, symbol: !!r4.symbol, where: r4.where } }), { fieldIndex: o4 } = s3, a2 = S3(e6);
  396. return { ...o(r4, a2, l3), fieldIndex: o4, target: i, index: n6 };
  397. }
  398. function D(t4, r4, i) {
  399. const n6 = "featureReduction" in r4 && r4.featureReduction;
  400. if (!n6)
  401. return { fields: [], labels: [], matcher: null, rendererOverride: null };
  402. const l3 = "aggregate", s3 = [];
  403. let o4 = null, a2 = e4(r4.geometryType), u6 = [], f3 = null;
  404. if (n6)
  405. switch (n6.type) {
  406. case "selection":
  407. throw new s2(T, "Mapview does not support `selection` reduction type", n6);
  408. case "cluster":
  409. case "binning":
  410. if (n6.type === "cluster" ? a2 = "esriGeometryPoint" : n6.type === "binning" && (a2 = "esriGeometryPolygon"), n6.renderer) {
  411. for (const e6 of n6.fields)
  412. x2(s3, e6);
  413. f3 = n6.renderer, o4 = K(null, l3, n6.renderer, i), u6 = n6 && n6.labelsVisible && n6.labelingInfo || [];
  414. } else if (n6.type === "cluster") {
  415. if (f3 = c3(s3, r4.renderer, n6, null), n6.symbol) {
  416. const e6 = S3(f3);
  417. o4 = { type: "simple", symbol: o(n6.symbol, e6, i), symbologyType: e6.symbologyType };
  418. }
  419. u6 = n6 && n6.labelsVisible && n6.labelingInfo || [];
  420. }
  421. }
  422. q2(t4, s3);
  423. return { labels: V(u6, n6.type === "binning" ? "esriGeometryPolygon" : a2), matcher: o4, fields: s3, rendererOverride: f3 };
  424. }
  425. function A2(t4, r4, i = false) {
  426. const l3 = { indexCount: 0, fields: {} }, s3 = "featureReduction" in t4 && t4.featureReduction ? "aggregate" : "feature";
  427. if ("sublayers" in t4) {
  428. const r5 = { type: "subtype", subtypeField: t4.subtypeField, renderers: {}, symbologyType: S.DEFAULT }, o5 = { type: "subtype", mapping: {}, target: "feature" }, a3 = { type: "subtype", classes: {} }, u7 = { type: "symbol", target: "feature", aggregateFields: [], attributes: l3, storage: o5, mesh: { matcher: r5, aggregateMatcher: null, labels: a3, sortKey: null } }, d5 = new Set();
  429. let p4 = 0;
  430. for (const { renderer: f3, subtypeCode: c6, labelingInfo: y4, labelsVisible: m5 } of t4.sublayers) {
  431. const t5 = K(l3, s3, f3, i), u8 = J(l3, s3, f3), g3 = m5 && y4;
  432. if ("visualVariables" in f3 && f3.visualVariables && f3.visualVariables.length)
  433. throw new s2(T, "Visual variables are currently not supported for subtype layers");
  434. if (t5.type === "dictionary")
  435. throw new s2(T, "Dictionary renderer is not supported in subtype layers");
  436. if (t5.type === "subtype")
  437. throw new s2(T, "Nested subtype renderers is not supported");
  438. if (r(u8) && u8.type === "subtype")
  439. throw new s2(T, "Nested subtype storage is not supported");
  440. if (r(u8) && r(u8.attributeMapping))
  441. throw new s2(T, "Non-visual-variable attributes are not supported in subtype layers");
  442. if (t5.type === "heatmap")
  443. throw new s2(T, "Heatmaps are not supported in subtype layers");
  444. if (t5.type === "pie-chart")
  445. throw new s2(T, "Pie-charts are not supported in subtype layers");
  446. if (d5.has(c6))
  447. throw new s2(T, "Subtype codes for sublayers must be unique");
  448. d5.add(c6), r5.renderers[c6] = t5, o5.mapping[c6] = u8, g3 && (a3.classes[c6] = g3.map((e6) => C(f3, l3, e6, "feature", p4++, i)));
  449. }
  450. return u7;
  451. }
  452. if (t4.renderer.type === "heatmap" && h() === "raster") {
  453. const { radius: e6, fieldOffset: r5, field: i2 } = t4.renderer;
  454. return { type: "heatmap", aggregateFields: [], attributes: l3, target: s3, storage: null, mesh: { radius: e6, fieldOffset: r5, field: B(l3, { target: s3, field: i2, resultType: "numeric" }).field } };
  455. }
  456. const o4 = D(l3, t4, i), a2 = e4(t4.geometryType), u6 = o4.rendererOverride ?? t4.renderer, d4 = K(l3, s3, u6, i), p3 = J(l3, s3, u6), c5 = G(l3, t4.orderBy), y3 = V(t4.labelsVisible && t4.labelingInfo || [], a2);
  457. let m4 = 0;
  458. const b = [...y3.map((e6) => C(u6, l3, e6, "feature", m4++, i)), ...o4.labels.map((e6) => C(u6, l3, e6, "aggregate", m4++, i))];
  459. return { type: "symbol", target: s3, attributes: l3, aggregateFields: o4.fields, storage: p3, mesh: { matcher: d4, labels: { type: "simple", classes: b }, aggregateMatcher: o4.matcher, sortKey: c5 } };
  460. }
  461. function $(e6) {
  462. return e6.renderer?.type === "heatmap" && h() === "raster" ? { type: "heatmap" } : { type: "symbol" };
  463. }
  464. function G(t4, r4) {
  465. if (t(r4) || !r4.length)
  466. return null;
  467. r4.length > 1 && w.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${r4.length}. All but the first will be discarded`);
  468. const i = r4[0], n6 = i.order === "ascending" ? "asc" : "desc";
  469. if (i.field)
  470. return { field: i.field, order: n6 };
  471. if (i.valueExpression) {
  472. return { fieldIndex: k(t4, { type: "expression", target: "feature", valueExpression: i.valueExpression, resultType: "numeric" }).fieldIndex, order: n6 };
  473. }
  474. return w.error(new s2(T, "Expected to find a field or valueExpression for OrderByInfo", i)), null;
  475. }
  476. function q2(e6, t4) {
  477. const r4 = { mesh: true, storage: true };
  478. for (const i of t4) {
  479. const { name: t5, outStatistic: n6 } = i, { statisticType: l3, onStatisticField: s3 } = n6;
  480. let o4 = null, a2 = null, u6 = null;
  481. const f3 = "numeric", d4 = "feature";
  482. if ("onStatisticValueExpression" in n6) {
  483. a2 = k(e6, { type: "expression", target: d4, valueExpression: n6.onStatisticValueExpression, resultType: f3 }).fieldIndex;
  484. } else if ("onStatisticNormalizationField" in n6) {
  485. o4 = k(e6, { type: "field", target: d4, field: s3, resultType: f3 }).field, u6 = n6.onStatisticNormalizationField;
  486. } else {
  487. o4 = k(e6, { type: "field", target: d4, field: s3, resultType: f3 }).field;
  488. }
  489. k(e6, { type: "statistic", target: "aggregate", name: t5, context: r4, inField: o4, inNormalizationField: u6, inFieldIndex: a2, statisticType: l3 });
  490. }
  491. }
  492. function J(e6, t4, r4) {
  493. let i;
  494. switch (r4.type) {
  495. case "simple":
  496. case "class-breaks":
  497. case "unique-value":
  498. case "dictionary":
  499. i = { visualVariables: true, attributes: null };
  500. break;
  501. default:
  502. i = c2(r4).getStorageSpec(r4);
  503. }
  504. return _(e6, t4, i, r4);
  505. }
  506. function _(e6, t4, r4, i) {
  507. if (t(r4))
  508. return null;
  509. const { visualVariables: l3, attributes: o4 } = r4;
  510. let a2 = null;
  511. l3 && "visualVariables" in i && (a2 = H(e6, t4, i.visualVariables));
  512. const u6 = r(a2) ? 4 : 0;
  513. let f3 = null;
  514. return r(o4) && (f3 = o4.map((r5, i2) => {
  515. const { field: n6, fieldIndex: l4 } = B(e6, { valueExpression: r5.valueExpression, field: r5.field, resultType: "numeric", target: t4 });
  516. return { binding: i2 + u6, field: n6, fieldIndex: l4 };
  517. })), { type: "simple", target: t4, attributeMapping: f3, vvMapping: a2 };
  518. }
  519. function H(e6, t4, r4) {
  520. if (!r4 || !r4.length)
  521. return [];
  522. const i = { storage: true }, n6 = "numeric";
  523. return u3(r4).map((r5) => {
  524. const l3 = re(r5.type), { field: s3, fieldIndex: o4 } = B(e6, { target: t4, valueExpression: r5.valueExpression, field: r5.field, context: i, resultType: n6 });
  525. switch (r5.type) {
  526. case "size":
  527. return r5.valueExpression === "$view.scale" ? null : { type: "size", binding: l3, field: s3, fieldIndex: o4, normalizationField: B(e6, { target: t4, field: r5.normalizationField, context: i, resultType: n6 }).field, valueRepresentation: r5.valueRepresentation ?? null };
  528. case "color":
  529. return { type: "color", binding: l3, field: s3, fieldIndex: o4, normalizationField: B(e6, { target: t4, field: r5.normalizationField, context: i, resultType: n6 }).field };
  530. case "opacity":
  531. return { type: "opacity", binding: l3, field: s3, fieldIndex: o4, normalizationField: B(e6, { target: t4, field: r5.normalizationField, context: i, resultType: n6 }).field };
  532. case "rotation":
  533. return { type: "rotation", binding: l3, field: s3, fieldIndex: o4 };
  534. }
  535. }).filter((e7) => e7);
  536. }
  537. function K(e6, t4, r4, i = false) {
  538. const n6 = c(e6, { indexCount: 0, fields: {} });
  539. switch (r4.type) {
  540. case "simple":
  541. case "dot-density":
  542. return Y(n6, r4, i);
  543. case "class-breaks":
  544. return W(n6, t4, r4, i);
  545. case "unique-value":
  546. return X(n6, t4, r4, i);
  547. case "dictionary":
  548. return Z2(n6, r4, i);
  549. case "heatmap":
  550. return ee(n6, r4, i);
  551. case "pie-chart":
  552. return Q(n6, r4, i);
  553. }
  554. }
  555. function Y(e6, t4, r4 = false) {
  556. const i = t4.getSymbols(), n6 = i.length ? i[0] : null, l3 = S3(t4);
  557. return { type: "simple", symbol: o(n6, l3, r4), symbologyType: l3.symbologyType };
  558. }
  559. function Q(e6, t4, r4 = false) {
  560. const i = t4.getSymbols(), n6 = i[0], l3 = i.length > 1 ? i[1] : null, s3 = S3(t4);
  561. return { type: "pie-chart", markerSymbol: o(n6, s3, r4), fillSymbol: o(l3, s3, r4), symbologyType: s3.symbologyType };
  562. }
  563. function W(e6, t4, r4, i = false) {
  564. const n6 = { mesh: true, use: "renderer.field" }, l3 = r4.backgroundFillSymbol, { field: s3, fieldIndex: o4 } = B(e6, { target: t4, field: r4.field, valueExpression: r4.valueExpression, resultType: "numeric", context: n6 }), a2 = r4.normalizationType, u6 = a2 === "log" ? "esriNormalizeByLog" : a2 === "percent-of-total" ? "esriNormalizeByPercentOfTotal" : a2 === "field" ? "esriNormalizeByField" : null, f3 = S3(r4), d4 = r4.classBreakInfos.map((e7) => ({ symbol: o(e7.symbol, f3, i), min: e7.minValue, max: e7.maxValue })).sort((e7, t5) => e7.min - t5.min);
  565. return { type: "interval", attributes: e6.fields, field: s3, fieldIndex: o4, backgroundFillSymbol: o(l3, f3, i), defaultSymbol: o(r4.defaultSymbol, f3, i), intervals: d4, normalizationField: r4.normalizationField, normalizationTotal: r4.normalizationTotal, normalizationType: u6, isMaxInclusive: r4.isMaxInclusive, symbologyType: f3.symbologyType };
  566. }
  567. function X(t4, r4, i, n6 = false) {
  568. const l3 = [], s3 = i.backgroundFillSymbol, o4 = { target: r4, context: { mesh: true }, resultType: "string" };
  569. if (i.field && typeof i.field != "string")
  570. throw new s2(T, "Expected renderer.field to be a string", i);
  571. const { field: a2, fieldIndex: u6 } = B(t4, { ...o4, field: i.field, valueExpression: i.valueExpression }), f3 = S3(i);
  572. for (const e6 of i.uniqueValueInfos)
  573. l3.push({ value: "" + e6.value, symbol: o(e6.symbol, f3, n6) });
  574. return { type: "map", attributes: t4.fields, field: a2, fieldIndex: u6, field2: B(t4, { ...o4, field: i.field2 }).field, field3: B(t4, { ...o4, field: i.field3 }).field, fieldDelimiter: i.fieldDelimiter, backgroundFillSymbol: o(s3, f3), defaultSymbol: o(i.defaultSymbol, f3), map: l3, symbologyType: f3.symbologyType };
  575. }
  576. function Z2(e6, t4, r4 = false) {
  577. const i = S3(t4);
  578. return { type: "dictionary", config: t4.config, fieldMap: t4.fieldMap, scaleExpression: t4.scaleExpression, url: t4.url, symbolOptions: i, symbologyType: i.symbologyType };
  579. }
  580. function ee(e6, t4, r4 = false) {
  581. const i = t4.getSymbols(), n6 = i.length ? i[0] : null, l3 = S3(t4);
  582. return { type: "heatmap", symbol: o(n6, l3, r4), symbologyType: l3.symbologyType };
  583. }
  584. export {
  585. c4 as c,
  586. g,
  587. p2 as p,
  588. u5 as u,
  589. h2 as h,
  590. y2 as y,
  591. d3 as d,
  592. c3 as c2,
  593. d2,
  594. f,
  595. m2 as m,
  596. x2 as x,
  597. S3 as S,
  598. z,
  599. K
  600. };
  601. //# sourceMappingURL=chunk-3RTOMVBL.js.map