chunk-6KWY7SN7.js 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508
  1. import {
  2. A,
  3. F,
  4. I,
  5. K,
  6. M,
  7. O,
  8. W,
  9. g,
  10. h,
  11. p,
  12. w,
  13. x
  14. } from "./chunk-UDNYCFF2.js";
  15. import {
  16. m as m2
  17. } from "./chunk-ETWBEEKL.js";
  18. import {
  19. DateTime,
  20. S,
  21. c,
  22. d,
  23. f,
  24. i2 as i,
  25. l,
  26. m,
  27. o,
  28. t3 as t,
  29. v,
  30. y
  31. } from "./chunk-25BNEBXZ.js";
  32. import {
  33. d as d2
  34. } from "./chunk-KMAHKQ2G.js";
  35. import {
  36. k2
  37. } from "./chunk-MRJEICT6.js";
  38. import {
  39. k
  40. } from "./chunk-ULGDPLM2.js";
  41. // node_modules/@arcgis/core/arcade/featureset/support/cache.js
  42. var a = class {
  43. constructor() {
  44. this._databaseTypeMetaData = {}, this._layerInfo = {};
  45. }
  46. clearDatabaseType(a4) {
  47. this._databaseTypeMetaData[a4] === void 0 && delete this._databaseTypeMetaData[a4];
  48. }
  49. getDatabaseType(a4) {
  50. return a4 === "MUSTBESET" || this._databaseTypeMetaData[a4] === void 0 ? null : this._databaseTypeMetaData[a4];
  51. }
  52. setDatabaseType(a4, e) {
  53. this._databaseTypeMetaData[a4] = e;
  54. }
  55. getLayerInfo(a4) {
  56. return this._layerInfo[a4] === void 0 ? null : this._layerInfo[a4];
  57. }
  58. setLayerInfo(a4, e) {
  59. this._layerInfo[a4] = e;
  60. }
  61. clearLayerInfo(a4) {
  62. this._layerInfo[a4] !== void 0 && delete this._layerInfo[a4];
  63. }
  64. };
  65. a.applicationCache = null;
  66. // node_modules/@arcgis/core/arcade/featureset/support/sqlUtils.js
  67. function n(e, r) {
  68. return c2(e.parseTree, r, e.parameters);
  69. }
  70. function a2(e, r, t4) {
  71. return c2(e, r, t4);
  72. }
  73. function s(t4, n2, a4, s3) {
  74. return m2.create(c2(t4.parseTree, t.Standardised, t4.parameters, n2, a4), s3);
  75. }
  76. function o2(t4, a4, s3 = "AND") {
  77. return m2.create("((" + n(t4, t.Standardised) + ")" + s3 + "(" + n(a4, t.Standardised) + "))", t4.fieldsIndex);
  78. }
  79. function c2(e, r, t4, n2 = null, a4 = null) {
  80. let s3, o4, f4, d5;
  81. switch (e.type) {
  82. case "interval":
  83. return T(c2(e.value, r, t4, n2, a4), e.qualifier, e.op);
  84. case "case-expression": {
  85. let s4 = " CASE ";
  86. e.format === "simple" && (s4 += c2(e.operand, r, t4, n2, a4));
  87. for (let o5 = 0; o5 < e.clauses.length; o5++)
  88. s4 += " WHEN " + c2(e.clauses[o5].operand, r, t4, n2, a4) + " THEN " + c2(e.clauses[o5].value, r, t4, n2, a4);
  89. return e.else !== null && (s4 += " ELSE " + c2(e.else, r, t4, n2, a4)), s4 += " END ", s4;
  90. }
  91. case "parameter": {
  92. const n3 = t4[e.value.toLowerCase()];
  93. if (typeof n3 == "string") {
  94. return "'" + t4[e.value.toLowerCase()].toString().replace(/'/g, "''") + "'";
  95. }
  96. if (n3 instanceof Date)
  97. return i2(n3, r);
  98. if (n3 instanceof Array) {
  99. const e2 = [];
  100. for (let t5 = 0; t5 < n3.length; t5++)
  101. typeof n3[t5] == "string" ? e2.push("'" + n3[t5].toString().replace(/'/g, "''") + "'") : n3[t5] instanceof Date ? e2.push(i2(n3[t5], r)) : e2.push(n3[t5].toString());
  102. return e2;
  103. }
  104. return n3.toString();
  105. }
  106. case "expression-list":
  107. o4 = [];
  108. for (const s4 of e.value)
  109. o4.push(c2(s4, r, t4, n2, a4));
  110. return o4;
  111. case "unary-expression":
  112. return " ( NOT " + c2(e.expr, r, t4, n2, a4) + " ) ";
  113. case "binary-expression":
  114. switch (e.operator) {
  115. case "AND":
  116. return " (" + c2(e.left, r, t4, n2, a4) + " AND " + c2(e.right, r, t4, n2, a4) + ") ";
  117. case "OR":
  118. return " (" + c2(e.left, r, t4, n2, a4) + " OR " + c2(e.right, r, t4, n2, a4) + ") ";
  119. case "IS":
  120. if (e.right.type !== "null")
  121. throw new Error("Unsupported RHS for IS");
  122. return " (" + c2(e.left, r, t4, n2, a4) + " IS NULL )";
  123. case "ISNOT":
  124. if (e.right.type !== "null")
  125. throw new Error("Unsupported RHS for IS");
  126. return " (" + c2(e.left, r, t4, n2, a4) + " IS NOT NULL )";
  127. case "IN":
  128. return s3 = [], e.right.type === "expression-list" ? (s3 = c2(e.right, r, t4, n2, a4), " (" + c2(e.left, r, t4, n2, a4) + " IN (" + s3.join(",") + ")) ") : (d5 = c2(e.right, r, t4, n2, a4), d5 instanceof Array ? " (" + c2(e.left, r, t4, n2, a4) + " IN (" + d5.join(",") + ")) " : " (" + c2(e.left, r, t4, n2, a4) + " IN (" + d5 + ")) ");
  129. case "NOT IN":
  130. return s3 = [], e.right.type === "expression-list" ? (s3 = c2(e.right, r, t4, n2, a4), " (" + c2(e.left, r, t4, n2, a4) + " NOT IN (" + s3.join(",") + ")) ") : (d5 = c2(e.right, r, t4, n2, a4), d5 instanceof Array ? " (" + c2(e.left, r, t4, n2, a4) + " NOT IN (" + d5.join(",") + ")) " : " (" + c2(e.left, r, t4, n2, a4) + " NOT IN (" + d5 + ")) ");
  131. case "BETWEEN":
  132. return f4 = c2(e.right, r, t4, n2, a4), " (" + c2(e.left, r, t4, n2, a4) + " BETWEEN " + f4[0] + " AND " + f4[1] + " ) ";
  133. case "NOTBETWEEN":
  134. return f4 = c2(e.right, r, t4, n2, a4), " (" + c2(e.left, r, t4, n2, a4) + " NOT BETWEEN " + f4[0] + " AND " + f4[1] + " ) ";
  135. case "LIKE":
  136. return e.escape !== "" ? " (" + c2(e.left, r, t4, n2, a4) + " LIKE " + c2(e.right, r, t4, n2, a4) + " ESCAPE '" + e.escape + "') " : " (" + c2(e.left, r, t4, n2, a4) + " LIKE " + c2(e.right, r, t4, n2, a4) + ") ";
  137. case "NOT LIKE":
  138. return e.escape !== "" ? " (" + c2(e.left, r, t4, n2, a4) + " NOT LIKE " + c2(e.right, r, t4, n2, a4) + " ESCAPE '" + e.escape + "') " : " (" + c2(e.left, r, t4, n2, a4) + " NOT LIKE " + c2(e.right, r, t4, n2, a4) + ") ";
  139. case "<>":
  140. case "<":
  141. case ">":
  142. case ">=":
  143. case "<=":
  144. case "=":
  145. case "*":
  146. case "-":
  147. case "+":
  148. case "/":
  149. return " (" + c2(e.left, r, t4, n2, a4) + " " + e.operator + " " + c2(e.right, r, t4, n2, a4) + ") ";
  150. }
  151. throw new Error("Not Supported Operator " + e.operator);
  152. case "null":
  153. return "null";
  154. case "boolean":
  155. return e.value === true ? "1" : "0";
  156. case "string":
  157. return "'" + e.value.toString().replace(/'/g, "''") + "'";
  158. case "timestamp":
  159. case "date":
  160. return i2(e.value, r);
  161. case "number":
  162. return e.value.toString();
  163. case "current-time":
  164. return u(e.mode === "date", r);
  165. case "column-reference":
  166. return n2 && n2.toLowerCase() === e.column.toLowerCase() ? "(" + a4 + ")" : e.column;
  167. case "function": {
  168. const s4 = c2(e.args, r, t4, n2, a4);
  169. return l2(e.name, s4, r);
  170. }
  171. }
  172. throw new Error("Unsupported sql syntax " + e.type);
  173. }
  174. function l2(r, t4, n2) {
  175. switch (r.toLowerCase().trim()) {
  176. case "abs":
  177. if (t4.length !== 1)
  178. throw new Error("Invalid Parameter for call to ABS");
  179. return "abs(" + t4[0] + ")";
  180. case "ceiling":
  181. case "ceil":
  182. if (t4.length !== 1)
  183. throw new Error("Invalid Parameter for call to CEILING");
  184. switch (n2) {
  185. case t.Standardised:
  186. case t.StandardisedNoInterval:
  187. }
  188. return "CEILING(" + t4[0] + ")";
  189. case "floor":
  190. if (t4.length !== 1)
  191. throw new Error("Invalid Parameter for call to Floor");
  192. return "FLOOR(" + t4[0] + ")";
  193. case "log":
  194. if (t4.length !== 1)
  195. throw new Error("Invalid Parameter for call to LOG");
  196. return "LOG(" + t4[0] + ")";
  197. case "log10":
  198. if (t4.length !== 1)
  199. throw new Error("Invalid Parameter for call to LOG10");
  200. return "LOG10(" + t4[0] + ")";
  201. case "power":
  202. if (t4.length !== 2)
  203. throw new Error("Invalid Parameter for call to POWER");
  204. return "POWER(" + t4[0] + "," + t4[1] + ")";
  205. case "round":
  206. if (t4.length === 2)
  207. return "ROUND(" + t4[0] + "," + t4[1] + ")";
  208. if (t4.length === 1)
  209. return "ROUND(" + t4[0] + ")";
  210. throw new Error("Invalid Parameter for call to ROUND");
  211. case "truncate":
  212. if (t4.length < 1 || t4.length > 2)
  213. throw new Error("Invalid Parameter for TRUNCATE function");
  214. return n2 === t.SqlServer ? "ROUND(" + t4[0] + (t4.length === 1 ? "0" : "," + t4[1]) + ",1)" : "TRUNCATE(" + t4[0] + (t4.length === 1 ? ")" : "," + t4[1] + ")");
  215. case "char_length":
  216. case "len":
  217. if (t4.length !== 1)
  218. throw new Error("Invalid Parameter for CHAR_LENGTH function");
  219. switch (n2) {
  220. case t.SqlServer:
  221. return "LEN(" + t4[0] + ")";
  222. case t.Oracle:
  223. return "LENGTH(" + t4[0] + ")";
  224. default:
  225. return "CHAR_LENGTH(" + t4[0] + ")";
  226. }
  227. case "concat":
  228. if (t4.length < 1)
  229. throw new Error("Invalid Parameter for CONCAT function");
  230. {
  231. let e = "CONCAT(";
  232. for (let r2 = 0; r2 < t4.length; r2++)
  233. r2 !== 0 && (e += ","), e += t4[r2];
  234. return e += ")", e;
  235. }
  236. case "lower":
  237. case "lcase":
  238. if (t4.length !== 1)
  239. throw new Error("Invalid Parameter for Lower function");
  240. return "LOWER(" + t4[0] + ")";
  241. case "upper":
  242. case "ucase":
  243. if (t4.length !== 1)
  244. throw new Error("Invalid Parameter for Upper function");
  245. return "UPPER(" + t4[0] + ")";
  246. case "substring": {
  247. let r2 = "";
  248. switch (n2) {
  249. case t.Oracle:
  250. return r2 = "SUBSTR(" + t4[0] + "," + t4[1], t4.length === 3 && (r2 += "," + t4[2]), r2 += ")", r2;
  251. case t.SqlServer:
  252. return r2 = t4.length === 3 ? "SUBSTRING(" + t4[0] + "," + t4[1] + "," + t4[2] + ")" : "SUBSTRING(" + t4[0] + ", " + t4[1] + ", LEN(" + t4[0] + ") - " + t4[1] + ")", r2;
  253. default:
  254. return r2 = "SUBSTRING(" + t4[0] + " FROM " + t4[1], t4.length === 3 && (r2 += " FOR " + t4[2]), r2 += ")", r2;
  255. }
  256. }
  257. case "extract":
  258. return "EXTRACT(" + t4[0].replace(/\'/g, "") + " FROM " + t4[1] + ")";
  259. }
  260. throw new Error("Function Not Recognised");
  261. }
  262. function i2(r, n2) {
  263. const a4 = r instanceof Date ? DateTime.fromJSDate(r) : DateTime.fromSQL(r), s3 = a4.hour === 0 && a4.minute === 0 && a4.second === 0 && a4.millisecond === 0;
  264. switch (n2) {
  265. case t.FILEGDB:
  266. case t.Standardised:
  267. case t.StandardisedNoInterval:
  268. return s3 ? `date '${a4.toFormat("yyyy-LL-dd")}'` : `date '${a4.toFormat("yyyy-LL-dd HH:mm:ss")}'`;
  269. case t.Oracle:
  270. return s3 ? `TO_DATE('${a4.toFormat("yyyy-LL-dd")}','YYYY-MM-DD')` : `TO_DATE('${a4.toFormat("yyyy-LL-dd HH:mm:ss")}','YYYY-MM-DD HH24:MI:SS')`;
  271. case t.SqlServer:
  272. return `'${a4.toFormat(s3 ? "yyyy-LL-dd" : "yyyy-LL-dd HH:mm:ss")}'`;
  273. case t.PGDB:
  274. return `#${a4.toFormat(s3 ? "LL-dd-yyyy" : "LL-dd-yyyy HH:mm:ss")}#`;
  275. case t.Postgres:
  276. return `TIMESTAMP '${a4.toFormat(s3 ? "yyyy-LL-dd" : "yyyy-LL-dd HH:mm:ss")}'`;
  277. default:
  278. return `date '${a4.toFormat("yyyy-LL-dd HH:mm:ss")}'`;
  279. }
  280. }
  281. function u(r, t4) {
  282. switch (t4) {
  283. case t.FILEGDB:
  284. case t.Standardised:
  285. case t.StandardisedNoInterval:
  286. case t.Oracle:
  287. return r ? "CURRENT_DATE" : "CURRENT_TIMESTAMP";
  288. case t.SqlServer:
  289. return r ? "CAST(GETDATE() AS DATE)" : "GETDATE()";
  290. case t.PGDB:
  291. case t.Postgres:
  292. default:
  293. return r ? "CURRENT_DATE" : "CURRENT_TIMESTAMP";
  294. }
  295. }
  296. function f2(e, r, t4 = {}) {
  297. const n2 = {}, a4 = {}, s3 = { esriFieldTypeSmallInteger: "integer", esriFieldTypeInteger: "integer", esriFieldTypeSingle: "double", esriFieldTypeDouble: "double", esriFieldTypeString: "string", esriFieldTypeDate: "date", esriFieldTypeOID: "integer", oid: "integer", long: "integer", "small-integer": "integer", integer: "integer", single: "double", double: "double", date: "date", string: "string" };
  298. for (const o4 of r) {
  299. const e2 = s3[o4.type];
  300. n2[o4.name.toLowerCase()] = e2 === void 0 ? "" : e2;
  301. }
  302. for (const o4 in t4) {
  303. const e2 = s3[t4[o4]];
  304. a4[o4.toLowerCase()] = e2 === void 0 ? "" : e2;
  305. }
  306. switch (d3(n2, e.parseTree, e.parameters, a4)) {
  307. case "double":
  308. return "double";
  309. case "integer":
  310. return "integer";
  311. case "date":
  312. return "date";
  313. case "string":
  314. return "string";
  315. }
  316. return "";
  317. }
  318. function d3(e, r, t4, n2) {
  319. let a4;
  320. switch (r.type) {
  321. case "interval":
  322. return "integer";
  323. case "case-expression": {
  324. const a5 = [];
  325. if (r.format === "simple") {
  326. for (let s3 = 0; s3 < r.clauses.length; s3++)
  327. a5.push(d3(e, r.clauses[s3].value, t4, n2));
  328. r.else !== null && a5.push(d3(e, r.else, t4, n2));
  329. } else {
  330. for (let s3 = 0; s3 < r.clauses.length; s3++)
  331. a5.push(d3(e, r.else, t4, n2));
  332. r.else !== null && a5.push(d3(e, r.else, t4, n2));
  333. }
  334. return g2(a5);
  335. }
  336. case "parameter": {
  337. const e2 = n2[r.value.toLowerCase()];
  338. if (e2 === void 0 && t4) {
  339. const e3 = t4[r.value.toLowerCase()];
  340. if (e3 === void 0)
  341. return "";
  342. if (e3 === null)
  343. return "";
  344. if (typeof e3 == "string" || e3 instanceof String)
  345. return "string";
  346. if (typeof e3 == "boolean")
  347. return "boolean";
  348. if (e3 instanceof Date)
  349. return "date";
  350. if (typeof e3 == "number")
  351. return e3 % 1 == 0 ? "integer" : "double";
  352. }
  353. return e2 === void 0 ? "" : e2;
  354. }
  355. case "expression-list": {
  356. const a5 = [];
  357. for (const s3 of r.value)
  358. a5.push(d3(e, s3, t4, n2));
  359. return a5;
  360. }
  361. case "unary-expression":
  362. return "boolean";
  363. case "binary-expression":
  364. switch (r.operator) {
  365. case "AND":
  366. case "OR":
  367. case "IN":
  368. case "NOT IN":
  369. case "BETWEEN":
  370. case "NOTBETWEEN":
  371. case "LIKE":
  372. case "NOT LIKE":
  373. case "<>":
  374. case "<":
  375. case ">":
  376. case ">=":
  377. case "<=":
  378. case "=":
  379. return "boolean";
  380. case "IS":
  381. case "ISNOT":
  382. if (r.right.type !== "null")
  383. throw new Error("Unsupported RHS for IS");
  384. return "boolean";
  385. case "*":
  386. case "-":
  387. case "+":
  388. case "/":
  389. return g2([d3(e, r.left, t4, n2), d3(e, r.right, t4, n2)]);
  390. default:
  391. throw new Error("Not Supported Operator " + r.operator);
  392. }
  393. case "null":
  394. return "";
  395. case "boolean":
  396. return "boolean";
  397. case "string":
  398. return "string";
  399. case "number":
  400. return r.value === null ? "" : r.value % 1 == 0 ? "integer" : "double";
  401. case "date":
  402. case "timestamp":
  403. case "current-time":
  404. return "date";
  405. case "column-reference": {
  406. const t5 = e[r.column.toLowerCase()];
  407. return t5 === void 0 ? "" : t5;
  408. }
  409. case "function":
  410. switch (r.name.toLowerCase()) {
  411. case "position":
  412. case "extract":
  413. case "char_length":
  414. return "integer";
  415. case "round":
  416. return a4 = d3(e, r.args, t4, n2), a4 instanceof Array ? a4.length > 0 ? a4[0] : "" : a4;
  417. case "sign":
  418. return a4 = d3(e, r.args, t4, n2), a4 instanceof Array && (a4 = g2(a4)), a4 === "integer" || a4 === "double" ? a4 : "double";
  419. case "ceiling":
  420. case "floor":
  421. case "abs": {
  422. const a5 = d3(e, r.args, t4, n2);
  423. return a5 instanceof Array ? g2(a5) : a5;
  424. }
  425. case "area":
  426. case "length":
  427. case "log":
  428. case "log10":
  429. case "sin":
  430. case "cos":
  431. case "tan":
  432. case "asin":
  433. case "acos":
  434. case "atan":
  435. case "power":
  436. case "truncate":
  437. return "double";
  438. case "substring":
  439. case "trim":
  440. case "concat":
  441. case "lower":
  442. case "upper":
  443. return "string";
  444. }
  445. return "";
  446. }
  447. throw new Error("Unsupported sql syntax " + r.type);
  448. }
  449. var p2 = { boolean: 1, string: 2, integer: 3, double: 4, date: 5 };
  450. function g2(e) {
  451. if (e) {
  452. let r = "";
  453. for (const t4 of e)
  454. t4 !== "" && (r = r === "" || p2[r] < p2[t4] ? t4 : r);
  455. return r;
  456. }
  457. return "";
  458. }
  459. function h2(e, r) {
  460. return y2(e.parseTree, r);
  461. }
  462. function E(e) {
  463. return e.parseTree.type === "column-reference";
  464. }
  465. function y2(e, r) {
  466. if (e == null)
  467. return false;
  468. switch (e.type) {
  469. case "when-clause":
  470. return y2(e.operand, r) || y2(e.value, r);
  471. case "case-expression":
  472. for (const t4 of e.clauses)
  473. if (y2(t4, r))
  474. return true;
  475. return !(e.format !== "simple" || !y2(e.operand, r)) || !(e.else === null || !y2(e.else, r));
  476. case "parameter":
  477. case "null":
  478. case "boolean":
  479. case "date":
  480. case "timestamp":
  481. case "string":
  482. case "number":
  483. return false;
  484. case "expression-list":
  485. for (const t4 of e.value)
  486. if (y2(t4, r))
  487. return true;
  488. return false;
  489. case "unary-expression":
  490. return y2(e.expr, r);
  491. case "binary-expression":
  492. return y2(e.left, r) || y2(e.right, r);
  493. case "column-reference":
  494. return r.toLowerCase() === e.column.toLowerCase();
  495. case "function":
  496. return y2(e.args, r);
  497. }
  498. return false;
  499. }
  500. function m3(e) {
  501. let r = "";
  502. return r += e.period.toUpperCase(), r;
  503. }
  504. function T(e, r, t4) {
  505. let n2 = "";
  506. return n2 = r.type === "interval-period" ? m3(r) : m3(r.start) + " TO " + m3(r.end), "INTERVAL " + t4 + " " + e + " " + n2;
  507. }
  508. // node_modules/@arcgis/core/arcade/featureset/support/FeatureSetIterator.js
  509. var t2 = class {
  510. constructor(t4, e) {
  511. this._lastId = -1, this._progress = e, this._parent = t4;
  512. }
  513. reset() {
  514. this._lastId = -1;
  515. }
  516. nextBatch(t4) {
  517. if (this._parent._mainSetInUse !== null)
  518. return this._parent._mainSetInUse.then((e2) => this.nextBatch(t4), (e2) => this.nextBatch(t4));
  519. const e = { returnpromise: null, hasset: false }, n2 = [];
  520. return e.returnpromise = new Promise((s3, a4) => {
  521. this._parent._getSet(this._progress).then((i4) => {
  522. let r = i4._known.length - 1;
  523. if (i4._known[i4._known.length - 1] === "GETPAGES" && (r -= 1), this._lastId + t4 > r && i4._known.length > 0 && i4._known[i4._known.length - 1] === "GETPAGES")
  524. this._parent._expandPagedSet(i4, this._parent._maxQueryRate(), 0, 0, this._progress).then((n3) => {
  525. e.hasset = true, this._parent._mainSetInUse = null, this.nextBatch(t4).then(s3, a4);
  526. }, (t5) => {
  527. e.hasset = true, this._parent._mainSetInUse = null, a4(t5);
  528. });
  529. else {
  530. if (r >= this._lastId + t4 || i4._candidates.length === 0) {
  531. for (let e2 = 0; e2 < t4; e2++) {
  532. const t5 = e2 + this._lastId + 1;
  533. if (t5 >= i4._known.length)
  534. break;
  535. n2[e2] = i4._known[t5];
  536. }
  537. return this._lastId += n2.length, n2.length === 0 && (e.hasset = true, this._parent._mainSetInUse = null, s3([])), void this._parent._getFeatureBatch(n2, this._progress).then((t5) => {
  538. e.hasset = true, this._parent._mainSetInUse = null, s3(t5);
  539. }, (t5) => {
  540. e.hasset = true, this._parent._mainSetInUse = null, a4(t5);
  541. });
  542. }
  543. this._parent._refineSetBlock(i4, this._parent._maxProcessingRate(), this._progress).then(() => {
  544. e.hasset = true, this._parent._mainSetInUse = null, this.nextBatch(t4).then(s3, a4);
  545. }, (t5) => {
  546. e.hasset = true, this._parent._mainSetInUse = null, a4(t5);
  547. });
  548. }
  549. }, (t5) => {
  550. e.hasset = true, this._parent._mainSetInUse = null, a4(t5);
  551. });
  552. }), e.hasset === false && (this._parent._mainSetInUse = e.returnpromise, e.hasset = true), e.returnpromise;
  553. }
  554. next() {
  555. if (this._parent._mainSetInUse !== null)
  556. return this._parent._mainSetInUse.then((t5) => this.next(), (t5) => this.next());
  557. const t4 = { returnpromise: null, hasset: false };
  558. return t4.returnpromise = new Promise((e, n2) => {
  559. this._parent._getSet(this._progress).then((s3) => {
  560. this._lastId < s3._known.length - 1 ? s3._known[this._lastId + 1] === "GETPAGES" ? this._parent._expandPagedSet(s3, this._parent._maxQueryRate(), 0, 0, this._progress).then((e2) => (t4.hasset = true, this._parent._mainSetInUse = null, this.next())).then(e, n2) : (this._lastId += 1, this._parent._getFeature(s3, s3._known[this._lastId], this._progress).then((n3) => {
  561. t4.hasset = true, this._parent._mainSetInUse = null, e(n3);
  562. }, (e2) => {
  563. t4.hasset = true, this._parent._mainSetInUse = null, n2(e2);
  564. })) : s3._candidates.length > 0 ? this._parent._refineSetBlock(s3, this._parent._maxProcessingRate(), this._progress).then(() => {
  565. t4.hasset = true, this._parent._mainSetInUse = null, this.next().then(e, n2);
  566. }, (e2) => {
  567. t4.hasset = true, this._parent._mainSetInUse = null, n2(e2);
  568. }) : (t4.hasset = true, this._parent._mainSetInUse = null, e(null));
  569. }, (e2) => {
  570. t4.hasset = true, this._parent._mainSetInUse = null, n2(e2);
  571. });
  572. }), t4.hasset === false && (this._parent._mainSetInUse = t4.returnpromise, t4.hasset = true), t4.returnpromise;
  573. }
  574. async count() {
  575. if (this._parent._totalCount !== -1)
  576. return this._parent._totalCount;
  577. const t4 = await this._parent._getSet(this._progress), e = await this._refineAllSets(t4);
  578. return this._parent._totalCount = e._known.length, this._parent._totalCount;
  579. }
  580. async _refineAllSets(t4) {
  581. if (t4._known.length > 0 && t4._known[t4._known.length - 1] === "GETPAGES")
  582. return await this._parent._expandPagedSet(t4, this._parent._maxQueryRate(), 0, 1, this._progress), this._refineAllSets(t4);
  583. if (t4._candidates.length > 0) {
  584. if (t4._known[t4._candidates.length - 1] === "GETPAGES")
  585. return await this._parent._expandPagedSet(t4, this._parent._maxQueryRate(), 0, 2, this._progress), this._refineAllSets(t4);
  586. const e = await this._parent._refineSetBlock(t4, this._parent._maxProcessingRate(), this._progress);
  587. return e._candidates.length > 0 ? this._refineAllSets(e) : e;
  588. }
  589. return t4;
  590. }
  591. };
  592. // node_modules/@arcgis/core/arcade/featureset/support/IdSet.js
  593. var t3 = class {
  594. constructor(t4, s3, i4, e) {
  595. this._candidates = null, this._known = null, this._lastFetchedIndex = 0, this._ordered = false, this.pagesDefinition = null, this._candidates = t4, this._known = s3, this._ordered = i4, this.pagesDefinition = e;
  596. }
  597. };
  598. // node_modules/@arcgis/core/arcade/featureset/support/stats.js
  599. function c3(t4) {
  600. return t4 = +t4, isFinite(t4) ? t4 - t4 % 1 || (t4 < 0 ? -0 : t4 === 0 ? t4 : 0) : t4;
  601. }
  602. function u2(t4) {
  603. let n2 = 0;
  604. for (let e = 0; e < t4.length; e++)
  605. n2 += t4[e];
  606. return n2 / t4.length;
  607. }
  608. function l3(t4) {
  609. const n2 = u2(t4);
  610. let e = 0;
  611. for (let r = 0; r < t4.length; r++)
  612. e += (n2 - t4[r]) ** 2;
  613. return e / t4.length;
  614. }
  615. function s2(t4) {
  616. const n2 = u2(t4);
  617. let e = 0;
  618. for (let r = 0; r < t4.length; r++)
  619. e += (n2 - t4[r]) ** 2;
  620. return e / (t4.length - 1);
  621. }
  622. function i3(t4) {
  623. let n2 = 0;
  624. for (let e = 0; e < t4.length; e++)
  625. n2 += t4[e];
  626. return n2;
  627. }
  628. function o3(r, a4) {
  629. const c5 = [], u3 = {}, l4 = [];
  630. for (let s3 = 0; s3 < r.length; s3++) {
  631. if (r[s3] !== void 0 && r[s3] !== null) {
  632. const a5 = r[s3];
  633. if (y(a5) || l(a5))
  634. u3[a5] === void 0 && (c5.push(a5), u3[a5] = 1);
  635. else {
  636. let t4 = false;
  637. for (let n2 = 0; n2 < l4.length; n2++)
  638. c(l4[n2], a5) === true && (t4 = true);
  639. t4 === false && (l4.push(a5), c5.push(a5));
  640. }
  641. }
  642. if (c5.length >= a4 && a4 !== -1)
  643. return c5;
  644. }
  645. return c5;
  646. }
  647. function h3(t4) {
  648. switch (t4.toLowerCase()) {
  649. case "distinct":
  650. return "distinct";
  651. case "avg":
  652. case "mean":
  653. return "avg";
  654. case "min":
  655. return "min";
  656. case "sum":
  657. return "sum";
  658. case "max":
  659. return "max";
  660. case "stdev":
  661. case "stddev":
  662. return "stddev";
  663. case "var":
  664. case "variance":
  665. return "var";
  666. case "count":
  667. return "count";
  668. }
  669. return "";
  670. }
  671. function f3(t4, n2, e = 1e3) {
  672. switch (t4.toLowerCase()) {
  673. case "distinct":
  674. return o3(n2, e);
  675. case "avg":
  676. case "mean":
  677. return u2(n2);
  678. case "min":
  679. return Math.min.apply(Math, n2);
  680. case "sum":
  681. return i3(n2);
  682. case "max":
  683. return Math.max.apply(Math, n2);
  684. case "stdev":
  685. case "stddev":
  686. return Math.sqrt(l3(n2));
  687. case "var":
  688. case "variance":
  689. return l3(n2);
  690. case "count":
  691. return n2.length;
  692. }
  693. return 0;
  694. }
  695. async function g3(t4, n2, e) {
  696. const r = await x2(t4, n2, e, true);
  697. return r.length === 0 ? null : Math.min.apply(Math, r);
  698. }
  699. async function m4(t4, n2, e) {
  700. const r = await x2(t4, n2, e, true);
  701. return r.length === 0 ? null : Math.max.apply(Math, r);
  702. }
  703. async function w2(t4, n2, e) {
  704. let l4 = "";
  705. E(n2) === false && (l4 = f2(n2, t4.fields, null));
  706. const s3 = await x2(t4, n2, e, true);
  707. if (s3.length === 0)
  708. return null;
  709. const i4 = u2(s3);
  710. return i4 === null ? i4 : l4 === "integer" ? c3(i4) : i4;
  711. }
  712. async function d4(t4, n2, e) {
  713. const r = await x2(t4, n2, e, true);
  714. return r.length === 0 ? null : s2(r);
  715. }
  716. async function v2(t4, n2, e) {
  717. const r = await x2(t4, n2, e, true);
  718. return r.length === 0 ? null : Math.sqrt(s2(r));
  719. }
  720. async function p3(t4, n2, e) {
  721. const r = await x2(t4, n2, e, true);
  722. return r.length === 0 ? null : i3(r);
  723. }
  724. async function y3(t4, n2) {
  725. return t4.iterator(n2).count();
  726. }
  727. async function x2(t4, n2, e, r = false) {
  728. const a4 = t4.iterator(e), c5 = [], u3 = { ticker: 0 };
  729. let l4 = await a4.next();
  730. for (; l4 !== null; ) {
  731. if (u3.ticker++, e.aborted)
  732. throw new Error("Cancelled");
  733. u3.ticker % 100 == 0 && (u3.ticker = 0, await new Promise((t6) => {
  734. setTimeout(t6, 0);
  735. }));
  736. const t5 = n2.calculateValue(l4);
  737. t5 === null ? r === false && (c5[c5.length] = t5) : c5[c5.length] = t5, l4 = await a4.next();
  738. }
  739. return c5;
  740. }
  741. async function M2(t4, n2, e = 1e3, r = null) {
  742. const a4 = t4.iterator(r), c5 = [], u3 = {}, l4 = { ticker: 0 };
  743. let s3 = await a4.next();
  744. for (; s3 !== null; ) {
  745. if (l4.ticker++, r.aborted)
  746. throw new Error("Cancelled");
  747. l4.ticker % 100 == 0 && (l4.ticker = 0, await new Promise((t6) => {
  748. setTimeout(t6, 0);
  749. }));
  750. const t5 = n2.calculateValue(s3);
  751. if (t5 != null && u3[t5] === void 0 && (c5.push(t5), u3[t5] = 1), c5.length >= e && e !== -1)
  752. return c5;
  753. s3 = await a4.next();
  754. }
  755. return c5;
  756. }
  757. // node_modules/@arcgis/core/arcade/featureset/support/FeatureSet.js
  758. var k3 = class {
  759. constructor(e) {
  760. this.recentlyUsedQueries = null, this.featureSetQueryInterceptor = null, this._idstates = [], this._parent = null, this._wset = null, this._mainSetInUse = null, this._maxProcessing = 200, this._maxQuery = 500, this._totalCount = -1, this._databaseType = t.NotEvaluated, this._databaseTypeProbed = null, this.declaredRootClass = "esri.arcade.featureset.support.FeatureSet", this._featureCache = [], this.types = null, this.fields = null, this.geometryType = "", this.objectIdField = "", this.globalIdField = "", this.spatialReference = null, this.hasM = false, this.hasZ = false, this._transparent = false, this.loaded = false, this._loadPromise = null, this._fieldsIndex = null, e && e.lrucache && (this.recentlyUsedQueries = e.lrucache), e && e.interceptor && (this.featureSetQueryInterceptor = e.interceptor);
  761. }
  762. optimisePagingFeatureQueries(e) {
  763. this._parent && this._parent.optimisePagingFeatureQueries(e);
  764. }
  765. _hasMemorySource() {
  766. return true;
  767. }
  768. prop(e, t4) {
  769. return t4 === void 0 ? this[e] : (this[e] !== void 0 && (this[e] = t4), this);
  770. }
  771. end() {
  772. return this._parent !== null && this._parent._transparent === true ? this._parent.end() : this._parent;
  773. }
  774. _ensureLoaded() {
  775. return this.load();
  776. }
  777. load() {
  778. return this._loadPromise === null && (this._loadPromise = this.loadImpl()), this._loadPromise;
  779. }
  780. async loadImpl() {
  781. return this._parent.loaded === true ? (this._initialiseFeatureSet(), this) : (await this._parent.load(), this._initialiseFeatureSet(), this);
  782. }
  783. _initialiseFeatureSet() {
  784. this._parent !== null ? (this.fields = this._parent.fields.slice(0), this.geometryType = this._parent.geometryType, this.objectIdField = this._parent.objectIdField, this.globalIdField = this._parent.globalIdField, this.spatialReference = this._parent.spatialReference, this.hasM = this._parent.hasM, this.hasZ = this._parent.hasZ, this.typeIdField = this._parent.typeIdField, this.types = this._parent.types) : (this.fields = [], this.typeIdField = "", this.objectIdField = "", this.globalIdField = "", this.spatialReference = new k2({ wkid: 4326 }), this.geometryType = S.point);
  785. }
  786. getField(e, t4) {
  787. let s3;
  788. return (t4 = t4 || this.fields) && (e = e.toLowerCase(), t4.some((t5) => (t5 && t5.name.toLowerCase() === e && (s3 = t5), !!s3))), s3;
  789. }
  790. getFieldsIndex() {
  791. return this._fieldsIndex === null && (this._fieldsIndex = new d2(this.fields)), this._fieldsIndex;
  792. }
  793. _maxProcessingRate() {
  794. return this._parent !== null ? Math.min(this._maxProcessing, this._parent._maxProcessingRate()) : Math.min(this._maxProcessing, this._maxQueryRate());
  795. }
  796. _maxQueryRate() {
  797. return this._parent !== null ? Math.max(this._maxQuery, this._parent._maxQueryRate()) : this._maxQuery;
  798. }
  799. _checkCancelled(e) {
  800. if (e !== null && e.aborted)
  801. throw new Error("Operation has been cancelled.");
  802. }
  803. nativeCapabilities() {
  804. return this._parent.nativeCapabilities();
  805. }
  806. async _canDoAggregates(e, t4, s3, r, a4) {
  807. return this._parent !== null && this._parent._canDoAggregates(e, t4, s3, r, a4);
  808. }
  809. async _getAggregatePagesDataSourceDefinition(e, t4, s3, r, a4, n2, i4) {
  810. if (this._parent === null)
  811. throw new Error("Should never be called");
  812. return this._parent._getAggregatePagesDataSourceDefinition(e, t4, s3, r, a4, n2, i4);
  813. }
  814. async _getAgregagtePhysicalPage(e, t4, s3) {
  815. if (this._parent === null)
  816. throw new Error("Should never be called");
  817. return this._parent._getAgregagtePhysicalPage(e, t4, s3);
  818. }
  819. async databaseType() {
  820. if (this._databaseType === t.NotEvaluated) {
  821. if (a.applicationCache !== null) {
  822. const t4 = a.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());
  823. if (t4 !== null)
  824. return t4;
  825. }
  826. if (this._databaseTypeProbed !== null)
  827. return this._databaseTypeProbed;
  828. try {
  829. this._databaseTypeProbed = this._getDatabaseTypeImpl(), a.applicationCache !== null && a.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(), this._databaseTypeProbed);
  830. } catch (t4) {
  831. throw a.applicationCache !== null && a.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()), t4;
  832. }
  833. return this._databaseTypeProbed;
  834. }
  835. return this._databaseType;
  836. }
  837. async _getDatabaseTypeImpl() {
  838. const e = [{ thetype: t.SqlServer, testwhere: "(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0" }, { thetype: t.Oracle, testwhere: "(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0" }, { thetype: t.StandardisedNoInterval, testwhere: "(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0" }];
  839. for (const t4 of e) {
  840. if (await this._runDatabaseProbe(t4.testwhere) === true)
  841. return t4.thetype;
  842. }
  843. return t.StandardisedNoInterval;
  844. }
  845. _cacheableFeatureSetSourceKey() {
  846. return "MUSTBESET";
  847. }
  848. async _runDatabaseProbe(e) {
  849. if (this._parent !== null)
  850. return this._parent._runDatabaseProbe(e);
  851. throw new Error("Not Implemented");
  852. }
  853. isTable() {
  854. return this._parent.isTable();
  855. }
  856. _featureFromCache(e) {
  857. if (this._featureCache[e] !== void 0)
  858. return this._featureCache[e];
  859. }
  860. _isInFeatureSet(e) {
  861. return i.Unknown;
  862. }
  863. _getSet(e) {
  864. throw new Error("Not implemented in abstract class");
  865. }
  866. async _getFeature(e, t4, s3) {
  867. if (this._checkCancelled(s3), this._featureFromCache(t4) !== void 0)
  868. return this._featureFromCache(t4);
  869. if (await this._getFeatures(e, t4, this._maxProcessingRate(), s3), this._checkCancelled(s3), this._featureFromCache(t4) !== void 0)
  870. return this._featureFromCache(t4);
  871. throw new Error("Feature Not Found");
  872. }
  873. async _getFeatureBatch(e, t4) {
  874. this._checkCancelled(t4);
  875. const r = new t3([], e, false, null), a4 = [];
  876. await this._getFeatures(r, -1, e.length, t4), this._checkCancelled(t4);
  877. for (const s3 of e)
  878. this._featureFromCache(s3) !== void 0 && a4.push(this._featureFromCache(s3));
  879. return a4;
  880. }
  881. async _getFeatures(e, t4, s3, r) {
  882. return "success";
  883. }
  884. _getFilteredSet(e, t4, s3, r, a4) {
  885. throw new Error("Not implemented in abstract class");
  886. }
  887. async _refineSetBlock(e, t4, s3) {
  888. if (this._checkIfNeedToExpandCandidatePage(e, this._maxQueryRate()) === true)
  889. return await this._expandPagedSet(e, this._maxQueryRate(), 0, 0, s3), this._refineSetBlock(e, t4, s3);
  890. this._checkCancelled(s3);
  891. const r = e._candidates.length;
  892. this._refineKnowns(e, t4);
  893. let a4 = r - e._candidates.length;
  894. if (e._candidates.length === 0)
  895. return e;
  896. if (a4 >= t4)
  897. return e;
  898. if (await this._refineIfParentKnown(e, t4 - a4, s3), this._checkCancelled(s3), this._refineKnowns(e, t4 - a4), a4 = r - e._candidates.length, a4 < t4 && e._candidates.length > 0) {
  899. const r2 = t4 - a4, n2 = this._prepareFetchAndRefineSet(e._candidates);
  900. return await this._fetchAndRefineFeatures(n2, n2.length > r2 ? r2 : e._candidates.length, s3), this._checkCancelled(s3), this._refineKnowns(e, t4 - a4), e;
  901. }
  902. return e;
  903. }
  904. _fetchAndRefineFeatures(e, t4, s3) {
  905. return null;
  906. }
  907. _prepareFetchAndRefineSet(e) {
  908. const t4 = [];
  909. for (let s3 = 0; s3 < e.length; s3++)
  910. this._isPhysicalFeature(e[s3]) && t4.push(e[s3]);
  911. return t4;
  912. }
  913. _isPhysicalFeature(e) {
  914. return this._parent === null || this._parent._isPhysicalFeature(e);
  915. }
  916. _refineKnowns(e, t4) {
  917. let s3 = 0, r = null;
  918. const a4 = [];
  919. t4 = this._maxQueryRate();
  920. for (let i4 = 0; i4 < e._candidates.length && e._candidates[i4] !== "GETPAGES"; i4++) {
  921. let l4 = false;
  922. const u3 = this._candidateIdTransform(e._candidates[i4]);
  923. u3 !== e._candidates[i4] && (l4 = true);
  924. const h4 = this._isInFeatureSet(u3);
  925. if (h4 === i.InFeatureSet)
  926. l4 === true ? e._known.includes(u3) || (e._known.push(u3), s3 += 1) : (e._known.push(e._candidates[i4]), s3 += 1), r === null ? r = { start: i4, end: i4 } : r.end === i4 - 1 ? r.end = i4 : (a4.push(r), r = { start: i4, end: i4 });
  927. else if (h4 === i.NotInFeatureSet)
  928. r === null ? r = { start: i4, end: i4 } : r.end === i4 - 1 ? r.end = i4 : (a4.push(r), r = { start: i4, end: i4 }), s3 += 1;
  929. else if (h4 === i.Unknown && (s3 += 1, e._ordered === true))
  930. break;
  931. if (s3 >= t4)
  932. break;
  933. }
  934. r !== null && a4.push(r);
  935. for (let n2 = a4.length - 1; n2 >= 0; n2--)
  936. e._candidates.splice(a4[n2].start, a4[n2].end - a4[n2].start + 1);
  937. }
  938. _refineIfParentKnown(e, t4, r) {
  939. const a4 = new t3([], [], e._ordered, null);
  940. return a4._candidates = e._candidates.slice(0), this._parent._refineSetBlock(a4, t4, r);
  941. }
  942. _candidateIdTransform(e) {
  943. return this._parent._candidateIdTransform(e);
  944. }
  945. _checkIfNeedToExpandKnownPage(e, t4) {
  946. if (e.pagesDefinition === null)
  947. return false;
  948. let s3 = 0;
  949. for (let r = e._lastFetchedIndex; r < e._known.length; r++) {
  950. if (e._known[r] === "GETPAGES")
  951. return true;
  952. if (this._featureCache[e._known[r]] === void 0 && (s3 += 1, s3 >= t4))
  953. break;
  954. }
  955. return false;
  956. }
  957. _checkIfNeedToExpandCandidatePage(e, t4) {
  958. if (e.pagesDefinition === null)
  959. return false;
  960. let s3 = 0;
  961. for (let r = 0; r < e._candidates.length; r++) {
  962. if (e._candidates[r] === "GETPAGES")
  963. return true;
  964. if (s3 += 1, s3 >= t4)
  965. break;
  966. }
  967. return false;
  968. }
  969. async _expandPagedSet(e, t4, s3, r, a4) {
  970. if (this._parent === null)
  971. throw new Error("Parent Paging not implemented");
  972. return this._parent._expandPagedSet(e, t4, s3, r, a4);
  973. }
  974. async _expandPagedSetFeatureSet(e, t4, s3, r, a4) {
  975. if (e._known.length > 0 && e._known[e._known.length - 1] === "GETPAGES" && (r = 1), r === 0 && e._candidates.length > 0 && e._candidates[e._candidates.length - 1] === "GETPAGES" && (r = 2), r === 0)
  976. return "finished";
  977. const n2 = await this._getPage(e, r, a4);
  978. return s3 + n2 < t4 ? this._expandPagedSet(e, t4, s3 + n2, 0, a4) : "success";
  979. }
  980. async _getPage(e, t4, s3) {
  981. const r = t4 === 1 ? e._known : e._candidates;
  982. if (e.pagesDefinition.internal.set.length > e.pagesDefinition.resultOffset || e.pagesDefinition.internal.fullyResolved === true) {
  983. r.length = r.length - 1;
  984. let t5 = 0;
  985. for (let a4 = 0; a4 < e.pagesDefinition.resultRecordCount && !(e.pagesDefinition.resultOffset + a4 >= e.pagesDefinition.internal.set.length); a4++)
  986. r[r.length] = e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset + a4], t5++;
  987. e.pagesDefinition.resultOffset += t5;
  988. let s4 = false;
  989. return e.pagesDefinition.internal.fullyResolved === true && e.pagesDefinition.internal.set.length <= e.pagesDefinition.resultOffset && (s4 = true), s4 === false && r.push("GETPAGES"), t5;
  990. }
  991. return await this._getPhysicalPage(e, t4, s3), this._getPage(e, t4, s3);
  992. }
  993. _getPhysicalPage(e, t4, s3) {
  994. return null;
  995. }
  996. _clonePageDefinition(e) {
  997. return this._parent === null ? null : this._parent._clonePageDefinition(e);
  998. }
  999. _first(e) {
  1000. return this.iterator(e).next();
  1001. }
  1002. first(e) {
  1003. return this._first(e);
  1004. }
  1005. async calculateStatistic(e, t4, s3, r) {
  1006. await this._ensureLoaded();
  1007. let a4 = await this._stat(e, t4, "", null, null, s3, r);
  1008. return a4.calculated === false && (a4 = await this._manualStat(e, t4, s3, r)), a4.result;
  1009. }
  1010. async _manualStat(e, t4, s3, r) {
  1011. let a4 = null;
  1012. switch (e.toLowerCase()) {
  1013. case "count":
  1014. return a4 = await y3(this, r), { calculated: true, result: a4 };
  1015. case "distinct":
  1016. return a4 = await M2(this, t4, s3), { calculated: true, result: a4 };
  1017. case "avg":
  1018. case "mean":
  1019. return a4 = await w2(this, t4, r), { calculated: true, result: a4 };
  1020. case "stdev":
  1021. return a4 = await v2(this, t4, r), { calculated: true, result: a4 };
  1022. case "variance":
  1023. return a4 = await d4(this, t4, r), { calculated: true, result: a4 };
  1024. case "sum":
  1025. return a4 = await p3(this, t4, r), { calculated: true, result: a4 };
  1026. case "min":
  1027. return a4 = await g3(this, t4, r), { calculated: true, result: a4 };
  1028. case "max":
  1029. return a4 = await m4(this, t4, r), { calculated: true, result: a4 };
  1030. default:
  1031. return { calculated: true, result: 0 };
  1032. }
  1033. }
  1034. async _stat(e, t4, s3, r, a4, n2, i4) {
  1035. const l4 = await this._parent._stat(e, t4, s3, r, a4, n2, i4);
  1036. return l4.calculated === false ? a4 === null && s3 === "" && r === null ? this._manualStat(e, t4, n2, i4) : { calculated: false } : l4;
  1037. }
  1038. _unionAllGeomSelf(e) {
  1039. const t4 = this.iterator(this._defaultTracker(e)), s3 = [];
  1040. return new Promise((e2, r) => {
  1041. this._unionShapeInBatches(s3, t4, e2, r);
  1042. });
  1043. }
  1044. _unionAllGeom(e) {
  1045. return new Promise((t4, s3) => {
  1046. const r = this.iterator(this._defaultTracker(e)), a4 = [];
  1047. this._unionShapeInBatches(a4, r, t4, s3);
  1048. });
  1049. }
  1050. _unionShapeInBatches(e, t4, s3, r) {
  1051. t4.next().then((a4) => {
  1052. try {
  1053. a4 !== null && a4.geometry !== null && e.push(a4.geometry), e.length > 30 || a4 === null && e.length > 1 ? I(e).then((n2) => {
  1054. try {
  1055. a4 === null ? s3(n2) : (e = [n2], this._unionShapeInBatches(e, t4, s3, r));
  1056. } catch (i4) {
  1057. r(i4);
  1058. }
  1059. }, r) : a4 === null ? e.length === 1 ? s3(e[0]) : s3(null) : this._unionShapeInBatches(e, t4, s3, r);
  1060. } catch (n2) {
  1061. r(n2);
  1062. }
  1063. }, r);
  1064. }
  1065. iterator(e) {
  1066. return new t2(this, e);
  1067. }
  1068. intersection(e, t4 = false) {
  1069. return k3._featuresetFunctions.intersection.bind(this)(e, t4);
  1070. }
  1071. difference(e, t4 = false, s3 = true) {
  1072. return k3._featuresetFunctions.difference.bind(this)(e, t4, s3);
  1073. }
  1074. symmetricDifference(e, t4 = false, s3 = true) {
  1075. return k3._featuresetFunctions.symmetricDifference.bind(this)(e, t4, s3);
  1076. }
  1077. morphShape(e, t4, s3 = "unknown", r = null) {
  1078. return k3._featuresetFunctions.morphShape.bind(this)(e, t4, s3, r);
  1079. }
  1080. morphShapeAndAttributes(e, t4, s3 = "unknown") {
  1081. return k3._featuresetFunctions.morphShapeAndAttributes.bind(this)(e, t4, s3);
  1082. }
  1083. union(e, t4 = false) {
  1084. return k3._featuresetFunctions.union.bind(this)(e, t4);
  1085. }
  1086. intersects(e) {
  1087. return k3._featuresetFunctions.intersects.bind(this)(e);
  1088. }
  1089. envelopeIntersects(e) {
  1090. return k3._featuresetFunctions.envelopeIntersects.bind(this)(e);
  1091. }
  1092. contains(e) {
  1093. return k3._featuresetFunctions.contains.bind(this)(e);
  1094. }
  1095. overlaps(e) {
  1096. return k3._featuresetFunctions.overlaps.bind(this)(e);
  1097. }
  1098. relate(e, t4) {
  1099. return k3._featuresetFunctions.relate.bind(this)(e, t4);
  1100. }
  1101. within(e) {
  1102. return k3._featuresetFunctions.within.bind(this)(e);
  1103. }
  1104. touches(e) {
  1105. return k3._featuresetFunctions.touches.bind(this)(e);
  1106. }
  1107. top(e) {
  1108. return k3._featuresetFunctions.top.bind(this)(e);
  1109. }
  1110. crosses(e) {
  1111. return k3._featuresetFunctions.crosses.bind(this)(e);
  1112. }
  1113. buffer(e, t4, s3, r = true) {
  1114. return k3._featuresetFunctions.buffer.bind(this)(e, t4, s3, r);
  1115. }
  1116. filter(e, t4 = null) {
  1117. return k3._featuresetFunctions.filter.bind(this)(e, t4);
  1118. }
  1119. orderBy(e) {
  1120. return k3._featuresetFunctions.orderBy.bind(this)(e);
  1121. }
  1122. dissolve(e, t4) {
  1123. return k3._featuresetFunctions.dissolve.bind(this)(e, t4);
  1124. }
  1125. groupby(e, t4) {
  1126. return k3._featuresetFunctions.groupby.bind(this)(e, t4);
  1127. }
  1128. reduce(e, t4 = null, s3) {
  1129. return new Promise((r, a4) => {
  1130. this._reduceImpl(this.iterator(this._defaultTracker(s3)), e, t4, 0, r, a4, 0);
  1131. });
  1132. }
  1133. _reduceImpl(e, t4, s3, r, a4, n2, i4) {
  1134. try {
  1135. if (++i4 > 1e3)
  1136. return void setTimeout(() => {
  1137. i4 = 0, this._reduceImpl(e, t4, s3, r, a4, n2, i4);
  1138. });
  1139. e.next().then((l4) => {
  1140. try {
  1141. if (l4 === null)
  1142. a4(s3);
  1143. else {
  1144. const u3 = t4(s3, l4, r, this);
  1145. k(u3) ? u3.then((s4) => {
  1146. this._reduceImpl(e, t4, s4, r + 1, a4, n2, i4);
  1147. }, n2) : this._reduceImpl(e, t4, u3, r + 1, a4, n2, i4);
  1148. }
  1149. } catch (u3) {
  1150. n2(u3);
  1151. }
  1152. }, n2);
  1153. } catch (l4) {
  1154. n2(l4);
  1155. }
  1156. }
  1157. removeField(e) {
  1158. return k3._featuresetFunctions.removeField.bind(this)(e);
  1159. }
  1160. addField(e, t4, s3 = null) {
  1161. return k3._featuresetFunctions.addField.bind(this)(e, t4, s3);
  1162. }
  1163. sumArea(e, t4 = false, s3) {
  1164. const r = m(e);
  1165. return this.reduce((e2, s4) => s4.geometry === null ? 0 : t4 ? K(s4.geometry, r).then((t5) => e2 + t5) : W(s4.geometry, r).then((t5) => e2 + t5), 0, s3);
  1166. }
  1167. sumLength(e, t4 = false, s3) {
  1168. const r = f(e);
  1169. return this.reduce((e2, s4) => s4.geometry === null ? 0 : t4 ? M(s4.geometry, r).then((t5) => e2 + t5) : F(s4.geometry, r).then((t5) => e2 + t5), 0, s3);
  1170. }
  1171. _substituteVars(e, t4) {
  1172. if (t4 !== null) {
  1173. const s3 = {};
  1174. for (const e2 in t4)
  1175. s3[e2.toLowerCase()] = t4[e2];
  1176. e.parameters = s3;
  1177. }
  1178. }
  1179. async distinct(e, t4 = 1e3, s3 = null, r) {
  1180. await this.load();
  1181. const a4 = m2.create(e, this.getFieldsIndex());
  1182. return this._substituteVars(a4, s3), this.calculateStatistic("distinct", a4, t4, this._defaultTracker(r));
  1183. }
  1184. async min(e, t4 = null, s3) {
  1185. await this.load();
  1186. const r = m2.create(e, this.getFieldsIndex());
  1187. return this._substituteVars(r, t4), this.calculateStatistic("min", r, -1, this._defaultTracker(s3));
  1188. }
  1189. async max(e, t4 = null, s3) {
  1190. await this.load();
  1191. const r = m2.create(e, this.getFieldsIndex());
  1192. return this._substituteVars(r, t4), this.calculateStatistic("max", r, -1, this._defaultTracker(s3));
  1193. }
  1194. async avg(e, t4 = null, s3) {
  1195. await this.load();
  1196. const r = m2.create(e, this.getFieldsIndex());
  1197. return this._substituteVars(r, t4), this.calculateStatistic("avg", r, -1, this._defaultTracker(s3));
  1198. }
  1199. async sum(e, t4 = null, s3) {
  1200. await this.load();
  1201. const r = m2.create(e, this.getFieldsIndex());
  1202. return this._substituteVars(r, t4), this.calculateStatistic("sum", r, -1, this._defaultTracker(s3));
  1203. }
  1204. async stdev(e, t4 = null, s3) {
  1205. await this.load();
  1206. const r = m2.create(e, this.getFieldsIndex());
  1207. return this._substituteVars(r, t4), this.calculateStatistic("stdev", r, -1, this._defaultTracker(s3));
  1208. }
  1209. async variance(e, t4 = null, s3) {
  1210. await this.load();
  1211. const r = m2.create(e, this.getFieldsIndex());
  1212. return this._substituteVars(r, t4), this.calculateStatistic("variance", r, -1, this._defaultTracker(s3));
  1213. }
  1214. async count(e) {
  1215. return await this.load(), this.calculateStatistic("count", m2.create("1", this.getFieldsIndex()), -1, this._defaultTracker(e));
  1216. }
  1217. _defaultTracker(e) {
  1218. return e || { aborted: false };
  1219. }
  1220. forEach(e, t4) {
  1221. return new Promise((s3, r) => {
  1222. this._forEachImpl(this.iterator(this._defaultTracker(t4)), e, this, s3, r, 0);
  1223. });
  1224. }
  1225. _forEachImpl(e, t4, s3, r, a4, n2) {
  1226. try {
  1227. if (++n2 > 1e3)
  1228. return void setTimeout(() => {
  1229. n2 = 0, this._forEachImpl(e, t4, s3, r, a4, n2);
  1230. }, 0);
  1231. e.next().then((i4) => {
  1232. try {
  1233. if (i4 === null)
  1234. r(s3);
  1235. else {
  1236. const l4 = t4(i4);
  1237. l4 == null ? this._forEachImpl(e, t4, s3, r, a4, n2) : k(l4) ? l4.then(() => {
  1238. try {
  1239. this._forEachImpl(e, t4, s3, r, a4, n2);
  1240. } catch (i5) {
  1241. a4(i5);
  1242. }
  1243. }, a4) : this._forEachImpl(e, t4, s3, r, a4, n2);
  1244. }
  1245. } catch (l4) {
  1246. a4(l4);
  1247. }
  1248. }, a4);
  1249. } catch (i4) {
  1250. a4(i4);
  1251. }
  1252. }
  1253. convertToJSON(e) {
  1254. const t4 = { layerDefinition: { geometryType: this.geometryType, fields: [] }, featureSet: { features: [], geometryType: this.geometryType } };
  1255. for (let s3 = 0; s3 < this.fields.length; s3++)
  1256. t4.layerDefinition.fields.push(o(this.fields[s3]));
  1257. return this.reduce((e2, s3) => {
  1258. const r = { geometry: s3.geometry && s3.geometry.toJSON(), attributes: {} };
  1259. for (const t5 in s3.attributes)
  1260. r.attributes[t5] = s3.attributes[t5];
  1261. return t4.featureSet.features.push(r), 1;
  1262. }, 0, e).then(() => t4);
  1263. }
  1264. castToText() {
  1265. return "object, FeatureSet";
  1266. }
  1267. queryAttachments(e, t4, s3, r, a4) {
  1268. return this._parent.queryAttachments(e, t4, s3, r, a4);
  1269. }
  1270. serviceUrl() {
  1271. return this._parent.serviceUrl();
  1272. }
  1273. subtypes() {
  1274. return this.typeIdField ? { subtypeField: this.typeIdField, subtypes: this.types ? this.types.map((e) => ({ name: e.name, code: e.id })) : [] } : null;
  1275. }
  1276. relationshipMetaData() {
  1277. return this._parent.relationshipMetaData();
  1278. }
  1279. get gdbVersion() {
  1280. return this._parent ? this._parent.gdbVersion : "";
  1281. }
  1282. schema() {
  1283. const e = [];
  1284. for (const t4 of this.fields)
  1285. e.push(o(t4));
  1286. return { objectIdField: this.objectIdField, globalIdField: this.globalIdField, geometryType: v[this.geometryType] === void 0 ? "" : v[this.geometryType], fields: e };
  1287. }
  1288. async convertToText(e, t4) {
  1289. if (e === "schema")
  1290. return await this._ensureLoaded(), JSON.stringify(this.schema());
  1291. if (e === "featureset") {
  1292. await this._ensureLoaded();
  1293. const e2 = [];
  1294. await this.reduce((t5, s4) => {
  1295. const r = { geometry: s4.geometry ? s4.geometry.toJSON() : null, attributes: s4.attributes };
  1296. return r.geometry !== null && r.geometry.spatialReference && delete r.geometry.spatialReference, e2.push(r), 1;
  1297. }, 0, t4);
  1298. const s3 = this.schema();
  1299. return s3.features = e2, s3.spatialReference = this.spatialReference.toJSON(), JSON.stringify(s3);
  1300. }
  1301. return this.castToText();
  1302. }
  1303. getFeatureByObjectId(e, t4) {
  1304. return this._parent.getFeatureByObjectId(e, t4);
  1305. }
  1306. getOwningSystemUrl() {
  1307. return this._parent.getOwningSystemUrl();
  1308. }
  1309. getIdentityUser() {
  1310. return this._parent.getIdentityUser();
  1311. }
  1312. getRootFeatureSet() {
  1313. return this._parent !== null ? this._parent.getRootFeatureSet() : this;
  1314. }
  1315. getDataSourceFeatureSet() {
  1316. return this._parent !== null ? this._parent.getDataSourceFeatureSet() : this;
  1317. }
  1318. castAsJson(e = null) {
  1319. return e?.featureset === "keeptype" ? this : e?.featureset === "none" ? null : { type: "FeatureSet" };
  1320. }
  1321. async castAsJsonAsync(e = null, t4 = null) {
  1322. if (t4?.featureset === "keeptype")
  1323. return this;
  1324. if (t4?.featureset === "schema")
  1325. return await this._ensureLoaded(), JSON.parse(JSON.stringify(this.schema()));
  1326. if (t4?.featureset === "none")
  1327. return null;
  1328. await this._ensureLoaded();
  1329. const s3 = [];
  1330. await this.reduce((e2, r2) => {
  1331. const a4 = { geometry: r2.geometry ? t4?.keepGeometryType === true ? r2.geometry : r2.geometry.toJSON() : null, attributes: r2.attributes };
  1332. return a4.geometry !== null && a4.geometry.spatialReference && t4?.keepGeometryType !== true && delete a4.geometry.spatialReference, s3.push(a4), 1;
  1333. }, 0, e);
  1334. const r = this.schema();
  1335. return r.features = s3, r.spatialReference = t4?.keepGeometryType === true ? this.spatialReference : this.spatialReference.toJSON(), r;
  1336. }
  1337. };
  1338. k3._featuresetFunctions = {};
  1339. // node_modules/@arcgis/core/arcade/featureset/sources/Empty.js
  1340. var a3 = class extends k3 {
  1341. constructor(e) {
  1342. super(e), this.declaredClass = "esri.layers.featureset.sources.Empty", this._maxProcessing = 1e3, this._wset = new t3([], [], false, null), this._parent = e.parentfeatureset, this._databaseType = t.Standardised;
  1343. }
  1344. async _getSet() {
  1345. return this._wset;
  1346. }
  1347. optimisePagingFeatureQueries() {
  1348. }
  1349. _isInFeatureSet() {
  1350. return i.NotInFeatureSet;
  1351. }
  1352. async _getFeature() {
  1353. throw new Error("No Feature Found in EmptySet");
  1354. }
  1355. async queryAttachments() {
  1356. return [];
  1357. }
  1358. async _getFeatures() {
  1359. return "success";
  1360. }
  1361. _featureFromCache() {
  1362. return null;
  1363. }
  1364. async _fetchAndRefineFeatures() {
  1365. throw new Error("Fetch and Refine should not be called in this featureset");
  1366. }
  1367. async _getFilteredSet() {
  1368. return new t3([], [], false, null);
  1369. }
  1370. _stat(e, t4, r, s3, a4, n2, u3) {
  1371. return this._manualStat(e, t4, n2, u3);
  1372. }
  1373. async _canDoAggregates() {
  1374. return false;
  1375. }
  1376. };
  1377. // node_modules/@arcgis/core/arcade/featureset/actions/SpatialFilter.js
  1378. var c4 = class extends k3 {
  1379. constructor(e) {
  1380. super(e), this._relation = "", this._relationGeom = null, this._relationString = "", this.declaredClass = "esri.arcade.featureset.actions.SpatialFilter", this._relationString = e.relationString, this._parent = e.parentfeatureset, this._maxProcessing = 40, this._relation = e.relation, this._relationGeom = e.relationGeom;
  1381. }
  1382. async _getSet(e) {
  1383. if (this._wset === null) {
  1384. await this._ensureLoaded();
  1385. const t4 = await this._parent._getFilteredSet(this._relation !== "esriSpatialRelRelation" ? this._relation : this._relation + ":" + this._relationString, this._relationGeom, null, null, e);
  1386. return this._checkCancelled(e), this._wset = new t3(t4._candidates.slice(0), t4._known.slice(0), t4._ordered, this._clonePageDefinition(t4.pagesDefinition)), this._wset;
  1387. }
  1388. return this._wset;
  1389. }
  1390. _isInFeatureSet(e) {
  1391. let t4 = this._parent._isInFeatureSet(e);
  1392. return t4 === i.NotInFeatureSet ? t4 : (t4 = this._idstates[e], t4 === void 0 ? i.Unknown : t4);
  1393. }
  1394. _getFeature(e, t4, i4) {
  1395. return this._parent._getFeature(e, t4, i4);
  1396. }
  1397. _getFeatures(e, t4, i4, n2) {
  1398. return this._parent._getFeatures(e, t4, i4, n2);
  1399. }
  1400. _featureFromCache(e) {
  1401. return this._parent._featureFromCache(e);
  1402. }
  1403. async executeSpatialRelationTest(e) {
  1404. if (e.geometry === null)
  1405. return false;
  1406. switch (this._relation) {
  1407. case "esriSpatialRelEnvelopeIntersects": {
  1408. const t4 = d(this._relationGeom), i4 = d(e.geometry);
  1409. return g(t4, i4);
  1410. }
  1411. case "esriSpatialRelIntersects":
  1412. return g(this._relationGeom, e.geometry);
  1413. case "esriSpatialRelContains":
  1414. return p(this._relationGeom, e.geometry);
  1415. case "esriSpatialRelOverlaps":
  1416. return O(this._relationGeom, e.geometry);
  1417. case "esriSpatialRelWithin":
  1418. return x(this._relationGeom, e.geometry);
  1419. case "esriSpatialRelTouches":
  1420. return A(this._relationGeom, e.geometry);
  1421. case "esriSpatialRelCrosses":
  1422. return w(this._relationGeom, e.geometry);
  1423. case "esriSpatialRelRelation":
  1424. return h(this._relationGeom, e.geometry, this._relationString);
  1425. }
  1426. }
  1427. async _fetchAndRefineFeatures(e, t4, r) {
  1428. const a4 = new t3([], e, false, null), s3 = Math.min(t4, e.length);
  1429. await this._parent._getFeatures(a4, -1, s3, r), this._checkCancelled(r);
  1430. const l4 = [];
  1431. for (let i4 = 0; i4 < s3; i4++) {
  1432. const t5 = this._parent._featureFromCache(e[i4]);
  1433. l4.push(await this.executeSpatialRelationTest(t5));
  1434. }
  1435. for (let i4 = 0; i4 < t4; i4++)
  1436. l4[i4] === true ? this._idstates[e[i4]] = i.InFeatureSet : this._idstates[e[i4]] = i.NotInFeatureSet;
  1437. return "success";
  1438. }
  1439. async _getFilteredSet(e, t4, n2, r, a4) {
  1440. await this._ensureLoaded();
  1441. const s3 = await this._parent._getFilteredSet(this._relation !== "esriSpatialRelRelation" ? this._relation : this._relation + ":" + this._relationString, this._relationGeom, n2, r, a4);
  1442. let l4;
  1443. return this._checkCancelled(a4), l4 = t4 !== null ? new t3(s3._candidates.slice(0).concat(s3._known.slice(0)), [], s3._ordered, this._clonePageDefinition(s3.pagesDefinition)) : new t3(s3._candidates.slice(0), s3._known.slice(0), s3._ordered, this._clonePageDefinition(s3.pagesDefinition)), l4;
  1444. }
  1445. async _stat(e, t4, i4, n2, r, a4, s3) {
  1446. if (i4 !== "")
  1447. return { calculated: false };
  1448. const l4 = await this._parent._stat(e, t4, this._relation !== "esriSpatialRelRelation" ? this._relation : this._relation + ":" + this._relationString, this._relationGeom, r, a4, s3);
  1449. return l4.calculated === false ? r === null && i4 === "" && n2 === null ? this._manualStat(e, t4, a4, s3) : { calculated: false } : l4;
  1450. }
  1451. async _canDoAggregates(e, t4, i4, n2, r) {
  1452. return i4 === "" && n2 === null && (this._parent !== null && this._parent._canDoAggregates(e, t4, this._relation !== "esriSpatialRelRelation" ? this._relation : this._relation + ":" + this._relationString, this._relationGeom, r));
  1453. }
  1454. async _getAggregatePagesDataSourceDefinition(e, t4, i4, n2, r, a4, s3) {
  1455. if (this._parent === null)
  1456. throw new Error("Should never be called");
  1457. return this._parent._getAggregatePagesDataSourceDefinition(e, t4, this._relation !== "esriSpatialRelRelation" ? this._relation : this._relation + ":" + this._relationString, this._relationGeom, r, a4, s3);
  1458. }
  1459. static registerAction() {
  1460. k3._featuresetFunctions.intersects = function(t4) {
  1461. return t4 == null ? new a3({ parentfeatureset: this }) : new c4({ parentfeatureset: this, relation: "esriSpatialRelIntersects", relationGeom: t4 });
  1462. }, k3._featuresetFunctions.envelopeIntersects = function(t4) {
  1463. return t4 == null ? new a3({ parentfeatureset: this }) : new c4({ parentfeatureset: this, relation: "esriSpatialRelEnvelopeIntersects", relationGeom: t4 });
  1464. }, k3._featuresetFunctions.contains = function(t4) {
  1465. return t4 == null ? new a3({ parentfeatureset: this }) : new c4({ parentfeatureset: this, relation: "esriSpatialRelContains", relationGeom: t4 });
  1466. }, k3._featuresetFunctions.overlaps = function(t4) {
  1467. return t4 == null ? new a3({ parentfeatureset: this }) : new c4({ parentfeatureset: this, relation: "esriSpatialRelOverlaps", relationGeom: t4 });
  1468. }, k3._featuresetFunctions.within = function(t4) {
  1469. return t4 == null ? new a3({ parentfeatureset: this }) : new c4({ parentfeatureset: this, relation: "esriSpatialRelWithin", relationGeom: t4 });
  1470. }, k3._featuresetFunctions.touches = function(t4) {
  1471. return t4 == null ? new a3({ parentfeatureset: this }) : new c4({ parentfeatureset: this, relation: "esriSpatialRelTouches", relationGeom: t4 });
  1472. }, k3._featuresetFunctions.crosses = function(t4) {
  1473. return t4 == null ? new a3({ parentfeatureset: this }) : new c4({ parentfeatureset: this, relation: "esriSpatialRelCrosses", relationGeom: t4 });
  1474. }, k3._featuresetFunctions.relate = function(t4, i4) {
  1475. return t4 == null ? new a3({ parentfeatureset: this }) : new c4({ parentfeatureset: this, relation: "esriSpatialRelRelation", relationGeom: t4, relationString: i4 });
  1476. };
  1477. }
  1478. };
  1479. export {
  1480. a,
  1481. t3 as t,
  1482. n,
  1483. a2,
  1484. s,
  1485. o2 as o,
  1486. l2 as l,
  1487. i2 as i,
  1488. u,
  1489. f2 as f,
  1490. h2 as h,
  1491. E,
  1492. T,
  1493. h3 as h2,
  1494. f3 as f2,
  1495. k3 as k,
  1496. a3,
  1497. c4 as c
  1498. };
  1499. //# sourceMappingURL=chunk-6KWY7SN7.js.map