chunk-CRGY2SDS.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. import {
  2. i
  3. } from "./chunk-4T5ZGMEN.js";
  4. import {
  5. s3 as s
  6. } from "./chunk-E5O6P5I2.js";
  7. import {
  8. o,
  9. t as t2
  10. } from "./chunk-SPWQ3AWG.js";
  11. import {
  12. r,
  13. t
  14. } from "./chunk-YXWMMD76.js";
  15. // node_modules/@arcgis/core/layers/support/domainUtils.js
  16. var e;
  17. function n(n2, a2) {
  18. switch (n2.type) {
  19. case "range": {
  20. const r2 = "range" in n2 ? n2.range[0] : n2.minValue, u2 = "range" in n2 ? n2.range[1] : n2.maxValue;
  21. if (null != r2 && +a2 < r2 || null != u2 && +a2 > u2)
  22. return e.VALUE_OUT_OF_RANGE;
  23. break;
  24. }
  25. case "coded-value":
  26. case "codedValue":
  27. if (null == n2.codedValues || n2.codedValues.every((e2) => null == e2 || e2.code !== a2))
  28. return e.INVALID_CODED_VALUE;
  29. }
  30. return null;
  31. }
  32. !function(e2) {
  33. e2.VALUE_OUT_OF_RANGE = "domain-validation-error::value-out-of-range", e2.INVALID_CODED_VALUE = "domain-validation-error::invalid-coded-value";
  34. }(e || (e = {}));
  35. // node_modules/@arcgis/core/layers/support/fieldUtils.js
  36. var f = /^([0-9])/;
  37. var u = /[^A-Za-z0-9_\u0080-\uffff]/g;
  38. var c = /_{2,}/g;
  39. var d = /^_/;
  40. var m = /_$/;
  41. function p(e2) {
  42. return e2 ? e2.trim().replace(u, "_").replace(c, "_").replace(d, "").replace(m, "").replace(f, "F$1") : null;
  43. }
  44. var y = ["field", "field2", "field3", "normalizationField", "rotationInfo.field", "proportionalSymbolInfo.field", "proportionalSymbolInfo.normalizationField", "colorInfo.field", "colorInfo.normalizationField"];
  45. var g = ["field", "normalizationField"];
  46. function F(e2, n2) {
  47. if (null != e2 && null != n2) {
  48. for (const i2 of Array.isArray(e2) ? e2 : [e2])
  49. if (I(y, i2, n2), "visualVariables" in i2 && i2.visualVariables)
  50. for (const e3 of i2.visualVariables)
  51. I(g, e3, n2);
  52. }
  53. }
  54. function I(e2, n2, i2) {
  55. if (e2)
  56. for (const l of e2) {
  57. const e3 = t2(l, n2), o2 = e3 && "function" != typeof e3 && i2.get(e3);
  58. o2 && o(l, o2.name, n2);
  59. }
  60. }
  61. function x(e2, n2) {
  62. var _a, _b, _c, _d, _e;
  63. if (null != e2 && ((_a = n2 == null ? void 0 : n2.fields) == null ? void 0 : _a.length))
  64. if ("startField" in e2) {
  65. const i2 = n2.get(e2.startField), t3 = n2.get(e2.endField);
  66. e2.startField = (_b = i2 == null ? void 0 : i2.name) != null ? _b : null, e2.endField = (_c = t3 == null ? void 0 : t3.name) != null ? _c : null;
  67. } else {
  68. const i2 = n2.get(e2.startTimeField), t3 = n2.get(e2.endTimeField);
  69. e2.startTimeField = (_d = i2 == null ? void 0 : i2.name) != null ? _d : null, e2.endTimeField = (_e = t3 == null ? void 0 : t3.name) != null ? _e : null;
  70. }
  71. }
  72. var b = /* @__PURE__ */ new Set();
  73. function T(e2, n2) {
  74. return e2 && n2 ? (b.clear(), h(b, e2, n2), Array.from(b).sort()) : [];
  75. }
  76. function h(e2, n2, i2) {
  77. var _a;
  78. if (i2)
  79. if ((_a = n2 == null ? void 0 : n2.fields) == null ? void 0 : _a.length)
  80. if (i2.includes("*"))
  81. for (const { name: t3 } of n2.fields)
  82. e2.add(t3);
  83. else
  84. for (const t3 of i2)
  85. w(e2, n2, t3);
  86. else {
  87. if (i2.includes("*"))
  88. return e2.clear(), void e2.add("*");
  89. for (const n3 of i2)
  90. null != n3 && e2.add(n3);
  91. }
  92. }
  93. function w(e2, n2, i2) {
  94. if ("string" == typeof i2)
  95. if (n2) {
  96. const t3 = n2.get(i2);
  97. t3 && e2.add(t3.name);
  98. } else
  99. e2.add(i2);
  100. }
  101. function v(e2, i2) {
  102. var _a;
  103. return t(i2) || t(e2) ? [] : i2.includes("*") ? ((_a = e2.fields) != null ? _a : []).map((e3) => e3.name) : i2;
  104. }
  105. async function S(e2, n2, i2) {
  106. var _a;
  107. if (!i2)
  108. return;
  109. const { arcadeUtils: t3 } = await i(), r2 = t3.extractFieldNames(i2, (_a = n2 == null ? void 0 : n2.fields) == null ? void 0 : _a.map((e3) => e3.name));
  110. for (const l of r2)
  111. w(e2, n2, l);
  112. }
  113. async function _(n2, i2, t3) {
  114. if (t3 && "1=1" !== t3) {
  115. const r2 = (await import("./WhereClause-32BDBNIA.js")).WhereClause.create(t3, i2);
  116. if (!r2.isStandardized)
  117. throw new s("fieldUtils:collectFilterFields", "Where clause is not standardized", { where: t3 });
  118. h(n2, i2, r2.fieldNames);
  119. }
  120. }
  121. function E({ displayField: e2, fields: n2 }) {
  122. return e2 || (n2 && n2.length ? $(n2, "name-or-title") || $(n2, "unique-identifier") || $(n2, "type-or-category") || N(n2) : null);
  123. }
  124. function N(e2) {
  125. for (const n2 of e2) {
  126. if (!n2 || !n2.name)
  127. continue;
  128. const e3 = n2.name.toLowerCase();
  129. if (e3.includes("name") || e3.includes("title"))
  130. return n2.name;
  131. }
  132. return null;
  133. }
  134. function $(e2, n2) {
  135. for (const i2 of e2)
  136. if (i2 && i2.valueType && i2.valueType === n2)
  137. return i2.name;
  138. return null;
  139. }
  140. async function D(e2, n2) {
  141. if (!n2)
  142. return;
  143. const i2 = t2("elevationInfo.featureExpressionInfo", n2);
  144. return i2 ? i2.collectRequiredFields(e2, n2.fieldsIndex) : void 0;
  145. }
  146. function L(e2, n2, i2) {
  147. i2.onStatisticExpression ? S(e2, n2, i2.onStatisticExpression.expression) : e2.add(i2.onStatisticField);
  148. }
  149. async function O(e2, n2, i2) {
  150. if (!n2 || !i2 || !("fields" in i2))
  151. return;
  152. const t3 = [], r2 = i2.popupTemplate;
  153. t3.push(U(e2, n2, r2)), i2.fields && t3.push(...i2.fields.map(async (i3) => L(e2, n2.fieldsIndex, i3))), await Promise.all(t3);
  154. }
  155. async function U(e2, n2, i2) {
  156. const t3 = [];
  157. (i2 == null ? void 0 : i2.expressionInfos) && t3.push(...i2.expressionInfos.map((i3) => S(e2, n2.fieldsIndex, i3.expression)));
  158. const r2 = i2 == null ? void 0 : i2.content;
  159. if (Array.isArray(r2))
  160. for (const l of r2)
  161. "expression" === l.type && l.expressionInfo && t3.push(S(e2, n2.fieldsIndex, l.expressionInfo.expression));
  162. await Promise.all(t3);
  163. }
  164. async function j(e2, n2, t3) {
  165. n2 && (n2.timeInfo && r(t3) && t3.timeExtent && h(e2, n2.fieldsIndex, [n2.timeInfo.startField, n2.timeInfo.endField]), n2.floorInfo && h(e2, n2.fieldsIndex, [n2.floorInfo.floorField]), r(t3) && r(t3.where) && await _(e2, n2.fieldsIndex, t3.where));
  166. }
  167. async function z(e2, n2, i2) {
  168. n2 && i2 && await Promise.all(i2.map((i3) => P(e2, n2, i3)));
  169. }
  170. async function P(e2, n2, i2) {
  171. n2 && i2 && (i2.valueExpression ? await S(e2, n2.fieldsIndex, i2.valueExpression) : i2.field && w(e2, n2.fieldsIndex, i2.field));
  172. }
  173. function C(e2) {
  174. if (!e2)
  175. return [];
  176. const n2 = "editFieldsInfo" in e2 && e2.editFieldsInfo;
  177. return n2 ? T(e2.fieldsIndex, [n2 && n2.creatorField, n2 && n2.creationDateField, n2 && n2.editorField, n2 && n2.editDateField]) : [];
  178. }
  179. async function W(e2, n2) {
  180. const { labelingInfo: i2, fieldsIndex: t3 } = n2;
  181. i2 && i2.length && await Promise.all(i2.map((n3) => q(e2, t3, n3)));
  182. }
  183. async function q(e2, n2, i2) {
  184. if (!i2)
  185. return;
  186. const t3 = i2.getLabelExpression(), r2 = i2.where;
  187. if ("arcade" === t3.type)
  188. await S(e2, n2, t3.expression);
  189. else {
  190. const i3 = t3.expression.match(/{[^}]*}/g);
  191. i3 && i3.forEach((i4) => {
  192. w(e2, n2, i4.slice(1, -1));
  193. });
  194. }
  195. await _(e2, n2, r2);
  196. }
  197. function M(e2) {
  198. const n2 = e2.defaultValue;
  199. return void 0 !== n2 && Q(e2, n2) ? n2 : e2.nullable ? null : void 0;
  200. }
  201. function Y(e2) {
  202. return "number" == typeof e2 && !isNaN(e2) && isFinite(e2);
  203. }
  204. function J(e2) {
  205. return null === e2 || Y(e2);
  206. }
  207. var X = "isInteger" in Number ? Number.isInteger : (e2) => "number" == typeof e2 && isFinite(e2) && Math.floor(e2) === e2;
  208. function Z(e2) {
  209. return null === e2 || X(e2);
  210. }
  211. function B(e2) {
  212. return null != e2 && "string" == typeof e2;
  213. }
  214. function H(e2) {
  215. return null === e2 || B(e2);
  216. }
  217. function K() {
  218. return true;
  219. }
  220. function Q(e2, n2) {
  221. let i2;
  222. switch (e2.type) {
  223. case "date":
  224. case "integer":
  225. case "long":
  226. case "small-integer":
  227. case "esriFieldTypeDate":
  228. case "esriFieldTypeInteger":
  229. case "esriFieldTypeLong":
  230. case "esriFieldTypeSmallInteger":
  231. i2 = e2.nullable ? Z : X;
  232. break;
  233. case "double":
  234. case "single":
  235. case "esriFieldTypeSingle":
  236. case "esriFieldTypeDouble":
  237. i2 = e2.nullable ? J : Y;
  238. break;
  239. case "string":
  240. case "esriFieldTypeString":
  241. i2 = e2.nullable ? H : B;
  242. break;
  243. default:
  244. i2 = K;
  245. }
  246. return 1 === arguments.length ? i2 : i2(n2);
  247. }
  248. var ee = ["integer", "small-integer", "single", "double"];
  249. var ne = /* @__PURE__ */ new Set([...ee, "esriFieldTypeInteger", "esriFieldTypeSmallInteger", "esriFieldTypeSingle", "esriFieldTypeDouble"]);
  250. function ie(e2) {
  251. return null != e2 && ne.has(e2.type);
  252. }
  253. function te(e2) {
  254. return null != e2 && ("string" === e2.type || "esriFieldTypeString" === e2.type);
  255. }
  256. var oe;
  257. var se;
  258. function ae(e2) {
  259. return null == e2 || "number" == typeof e2 && isNaN(e2) ? null : e2;
  260. }
  261. function fe(e2, n2) {
  262. return e2.nullable && null === n2 ? null : ie(e2) && !ue(e2.type, Number(n2)) ? oe.OUT_OF_RANGE : Q(e2, n2) ? e2.domain ? n(e2.domain, n2) : null : se.INVALID_TYPE;
  263. }
  264. function ue(e2, n2) {
  265. const i2 = "string" == typeof e2 ? de(e2) : e2;
  266. if (!i2)
  267. return false;
  268. const t3 = i2.min, r2 = i2.max;
  269. return i2.isInteger ? X(n2) && n2 >= t3 && n2 <= r2 : n2 >= t3 && n2 <= r2;
  270. }
  271. function de(e2) {
  272. switch (e2) {
  273. case "esriFieldTypeSmallInteger":
  274. case "small-integer":
  275. return pe;
  276. case "esriFieldTypeInteger":
  277. case "integer":
  278. return ye;
  279. case "esriFieldTypeSingle":
  280. case "single":
  281. return ge;
  282. case "esriFieldTypeDouble":
  283. case "double":
  284. return Fe;
  285. }
  286. }
  287. !function(e2) {
  288. e2.OUT_OF_RANGE = "numeric-range-validation-error::out-of-range";
  289. }(oe || (oe = {})), function(e2) {
  290. e2.INVALID_TYPE = "type-validation-error::invalid-type";
  291. }(se || (se = {}));
  292. var pe = { min: -32768, max: 32767, isInteger: true };
  293. var ye = { min: -2147483648, max: 2147483647, isInteger: true };
  294. var ge = { min: -34e37, max: 12e37, isInteger: false };
  295. var Fe = { min: -Number.MAX_VALUE, max: Number.MAX_VALUE, isInteger: false };
  296. function Ie(e2, n2, i2) {
  297. switch (e2) {
  298. case e.INVALID_CODED_VALUE:
  299. return `Value ${i2} is not in the coded domain - field: ${n2.name}, domain: ${JSON.stringify(n2.domain)}`;
  300. case e.VALUE_OUT_OF_RANGE:
  301. return `Value ${i2} is out of the range of valid values - field: ${n2.name}, domain: ${JSON.stringify(n2.domain)}`;
  302. case se.INVALID_TYPE:
  303. return `Value ${i2} is not a valid value for the field type - field: ${n2.name}, type: ${n2.type}, nullable: ${n2.nullable}`;
  304. case oe.OUT_OF_RANGE: {
  305. const { min: e3, max: t3 } = de(n2.type);
  306. return `Value ${i2} is out of range for the number type - field: ${n2.name}, type: ${n2.type}, value range is ${e3} to ${t3}`;
  307. }
  308. }
  309. }
  310. function xe(e2, n2) {
  311. return !be(e2, n2, null);
  312. }
  313. function be(e2, n2, t3) {
  314. if (!n2 || !n2.attributes || !e2) {
  315. if (r(t3))
  316. for (const n3 of e2 != null ? e2 : [])
  317. t3.add(n3);
  318. return true;
  319. }
  320. const r2 = n2.attributes;
  321. let l = false;
  322. for (const o2 of e2)
  323. if (!(o2 in r2)) {
  324. if (l = true, !r(t3))
  325. break;
  326. t3.add(o2);
  327. }
  328. return l;
  329. }
  330. function he(e2) {
  331. return ["raster.itempixelvalue", "raster.servicepixelvalue"].some((n2) => e2.toLowerCase().startsWith(n2));
  332. }
  333. export {
  334. p,
  335. F,
  336. x,
  337. T,
  338. h,
  339. w,
  340. v,
  341. S,
  342. E,
  343. D,
  344. O,
  345. j,
  346. z,
  347. C,
  348. W,
  349. M,
  350. ie,
  351. te,
  352. ae,
  353. fe,
  354. Ie,
  355. xe,
  356. he
  357. };
  358. //# sourceMappingURL=chunk-CRGY2SDS.js.map