chunk-VCH45Q2I.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. import {
  2. M,
  3. c2 as c,
  4. p,
  5. p2,
  6. w,
  7. w2
  8. } from "./chunk-6T6G6LCQ.js";
  9. import {
  10. k2 as k,
  11. r as r2
  12. } from "./chunk-PQFTYGF5.js";
  13. import {
  14. e,
  15. n5 as n,
  16. y3 as y2
  17. } from "./chunk-2Z2TG5CU.js";
  18. import {
  19. y
  20. } from "./chunk-SPWQ3AWG.js";
  21. import {
  22. i
  23. } from "./chunk-2TIUKVZN.js";
  24. import {
  25. r,
  26. t
  27. } from "./chunk-YXWMMD76.js";
  28. // node_modules/@arcgis/core/geometry/support/zmUtils.js
  29. function h(h7, a3, s5 = false) {
  30. let { hasM: t4, hasZ: e6 } = h7;
  31. Array.isArray(a3) ? 4 !== a3.length || t4 || e6 ? 3 === a3.length && s5 && !t4 ? (e6 = true, t4 = false) : 3 === a3.length && t4 && e6 && (t4 = false, e6 = false) : (t4 = true, e6 = true) : (e6 = !e6 && a3.hasZ && (!t4 || a3.hasM), t4 = !t4 && a3.hasM && (!e6 || a3.hasZ)), h7.hasZ = e6, h7.hasM = t4;
  32. }
  33. // node_modules/@arcgis/core/geometry/Multipoint.js
  34. var h2;
  35. function l(t4) {
  36. return (s5, e6) => null == s5 ? e6 : null == e6 ? s5 : t4(s5, e6);
  37. }
  38. function c2(t4) {
  39. return t4 && ("esri.geometry.SpatialReference" === t4.declaredClass || null != t4.wkid);
  40. }
  41. var m = h2 = class extends p {
  42. constructor(...t4) {
  43. super(...t4), this.points = [], this.type = "multipoint";
  44. }
  45. normalizeCtorArgs(t4, s5) {
  46. if (!t4 && !s5)
  47. return {};
  48. const e6 = {};
  49. Array.isArray(t4) ? (e6.points = t4, e6.spatialReference = s5) : c2(t4) ? e6.spatialReference = t4 : (t4.points && (e6.points = t4.points), t4.spatialReference && (e6.spatialReference = t4.spatialReference), t4.hasZ && (e6.hasZ = t4.hasZ), t4.hasM && (e6.hasM = t4.hasM));
  50. const i5 = e6.points && e6.points[0];
  51. return i5 && (void 0 === e6.hasZ && void 0 === e6.hasM ? (e6.hasZ = i5.length > 2, e6.hasM = false) : void 0 === e6.hasZ ? e6.hasZ = i5.length > 3 : void 0 === e6.hasM && (e6.hasM = i5.length > 3)), e6;
  52. }
  53. get cache() {
  54. return this.commitProperty("points"), this.commitProperty("hasZ"), this.commitProperty("hasM"), this.commitProperty("spatialReference"), {};
  55. }
  56. get extent() {
  57. const t4 = this.points;
  58. if (!t4.length)
  59. return null;
  60. const s5 = new w2(), e6 = this.hasZ, i5 = this.hasM, r6 = e6 ? 3 : 2, n3 = t4[0], a3 = l(Math.min), p3 = l(Math.max);
  61. let h7, c7, m5, u6, [f5, y4] = n3, [d2, g4] = n3;
  62. for (let o5 = 0, l5 = t4.length; o5 < l5; o5++) {
  63. const s6 = t4[o5], [n4, l6] = s6;
  64. if (f5 = a3(f5, n4), y4 = a3(y4, l6), d2 = p3(d2, n4), g4 = p3(g4, l6), e6 && s6.length > 2) {
  65. const t5 = s6[2];
  66. h7 = a3(h7, t5), m5 = p3(m5, t5);
  67. }
  68. if (i5 && s6.length > r6) {
  69. const t5 = s6[r6];
  70. c7 = a3(c7, t5), u6 = p3(u6, t5);
  71. }
  72. }
  73. return s5.xmin = f5, s5.ymin = y4, s5.xmax = d2, s5.ymax = g4, s5.spatialReference = this.spatialReference, e6 ? (s5.zmin = h7, s5.zmax = m5) : (s5.zmin = void 0, s5.zmax = void 0), i5 ? (s5.mmin = c7, s5.mmax = u6) : (s5.mmin = void 0, s5.mmax = void 0), s5;
  74. }
  75. writePoints(t4, e6) {
  76. e6.points = y(this.points);
  77. }
  78. addPoint(t4) {
  79. return h(this, t4), Array.isArray(t4) ? this.points.push(t4) : this.points.push(t4.toArray()), this.notifyChange("points"), this;
  80. }
  81. clone() {
  82. const t4 = { points: y(this.points), spatialReference: this.spatialReference };
  83. return this.hasZ && (t4.hasZ = true), this.hasM && (t4.hasM = true), new h2(t4);
  84. }
  85. getPoint(t4) {
  86. if (!this._validateInputs(t4))
  87. return null;
  88. const s5 = this.points[t4], e6 = { x: s5[0], y: s5[1], spatialReference: this.spatialReference };
  89. let i5 = 2;
  90. return this.hasZ && (e6.z = s5[2], i5 = 3), this.hasM && (e6.m = s5[i5]), new w(e6);
  91. }
  92. removePoint(t4) {
  93. if (!this._validateInputs(t4))
  94. return null;
  95. const s5 = new w(this.points.splice(t4, 1)[0], this.spatialReference);
  96. return this.notifyChange("points"), s5;
  97. }
  98. setPoint(t4, s5) {
  99. return this._validateInputs(t4) ? (h(this, s5), Array.isArray(s5) || (s5 = s5.toArray()), this.points[t4] = s5, this.notifyChange("points"), this) : this;
  100. }
  101. toJSON(t4) {
  102. return this.write({}, t4);
  103. }
  104. _validateInputs(t4) {
  105. return null != t4 && t4 >= 0 && t4 < this.points.length;
  106. }
  107. };
  108. e([y2({ readOnly: true })], m.prototype, "cache", null), e([y2()], m.prototype, "extent", null), e([y2({ type: [[Number]], json: { write: { isRequired: true } } })], m.prototype, "points", void 0), e([r2("points")], m.prototype, "writePoints", null), m = h2 = e([n("esri.geometry.Multipoint")], m), m.prototype.toJSON.isDefaultToJSON = true;
  109. var u = m;
  110. // node_modules/@arcgis/core/geometry/support/boundsUtils.js
  111. function n2(n3) {
  112. return void 0 !== n3.xmin && void 0 !== n3.ymin && void 0 !== n3.xmax && void 0 !== n3.ymax;
  113. }
  114. function t2(n3) {
  115. return void 0 !== n3.points;
  116. }
  117. function e2(n3) {
  118. return void 0 !== n3.x && void 0 !== n3.y;
  119. }
  120. function o(n3) {
  121. return void 0 !== n3.paths;
  122. }
  123. function r3(n3) {
  124. return void 0 !== n3.rings;
  125. }
  126. function i2(n3) {
  127. function t4(t5, e6) {
  128. return null == t5 ? e6 : null == e6 ? t5 : n3(t5, e6);
  129. }
  130. return t4;
  131. }
  132. var l2 = i2(Math.min);
  133. var u2 = i2(Math.max);
  134. function c3(i5, l5) {
  135. return o(l5) ? h3(i5, l5.paths, false, false) : r3(l5) ? h3(i5, l5.rings, false, false) : t2(l5) ? s(i5, l5.points, false, false, false, false) : n2(l5) ? g(i5, l5) : (e2(l5) && (i5[0] = l5.x, i5[1] = l5.y, i5[2] = l5.x, i5[3] = l5.y), i5);
  136. }
  137. function f(i5, l5) {
  138. return o(l5) ? h3(i5, l5.paths, true, false) : r3(l5) ? h3(i5, l5.rings, true, false) : t2(l5) ? s(i5, l5.points, true, false, true, false) : n2(l5) ? g(i5, l5, true, false, true, false) : (e2(l5) && (i5[0] = l5.x, i5[1] = l5.y, i5[2] = l5.z, i5[3] = l5.x, i5[4] = l5.y, i5[5] = l5.z), i5);
  139. }
  140. function h3(n3, t4, e6, o5) {
  141. const r6 = e6 ? 3 : 2;
  142. if (!t4.length || !t4[0].length)
  143. return null;
  144. let i5, c7, f5, h7, [g4, s5] = t4[0][0], [x3, m5] = t4[0][0];
  145. for (let a3 = 0; a3 < t4.length; a3++) {
  146. const n4 = t4[a3];
  147. for (let t5 = 0; t5 < n4.length; t5++) {
  148. const a4 = n4[t5], [d2, v3] = a4;
  149. if (g4 = l2(g4, d2), s5 = l2(s5, v3), x3 = u2(x3, d2), m5 = u2(m5, v3), e6 && a4.length > 2) {
  150. const n5 = a4[2];
  151. i5 = l2(i5, n5), c7 = u2(c7, n5);
  152. }
  153. if (o5 && a4.length > r6) {
  154. const n5 = a4[r6];
  155. f5 = l2(i5, n5), h7 = u2(c7, n5);
  156. }
  157. }
  158. }
  159. return e6 ? o5 ? (n3[0] = g4, n3[1] = s5, n3[2] = i5, n3[3] = f5, n3[4] = x3, n3[5] = m5, n3[6] = c7, n3[7] = h7, n3.length = 8, n3) : (n3[0] = g4, n3[1] = s5, n3[2] = i5, n3[3] = x3, n3[4] = m5, n3[5] = c7, n3.length = 6, n3) : o5 ? (n3[0] = g4, n3[1] = s5, n3[2] = f5, n3[3] = x3, n3[4] = m5, n3[5] = h7, n3.length = 6, n3) : (n3[0] = g4, n3[1] = s5, n3[2] = x3, n3[3] = m5, n3.length = 4, n3);
  160. }
  161. function g(n3, t4, e6, o5, r6, i5) {
  162. const l5 = t4.xmin, u6 = t4.xmax, c7 = t4.ymin, f5 = t4.ymax;
  163. let h7 = t4.zmin, g4 = t4.zmax, s5 = t4.mmin, x3 = t4.mmax;
  164. return r6 ? (h7 = h7 || 0, g4 = g4 || 0, i5 ? (s5 = s5 || 0, x3 = x3 || 0, n3[0] = l5, n3[1] = c7, n3[2] = h7, n3[3] = s5, n3[4] = u6, n3[5] = f5, n3[6] = g4, n3[7] = x3, n3) : (n3[0] = l5, n3[1] = c7, n3[2] = h7, n3[3] = u6, n3[4] = f5, n3[5] = g4, n3)) : i5 ? (s5 = s5 || 0, x3 = x3 || 0, n3[0] = l5, n3[1] = c7, n3[2] = s5, n3[3] = u6, n3[4] = f5, n3[5] = x3, n3) : (n3[0] = l5, n3[1] = c7, n3[2] = u6, n3[3] = f5, n3);
  165. }
  166. function s(n3, t4, e6, o5, r6, i5) {
  167. const c7 = e6 ? 3 : 2, f5 = o5 && i5, h7 = e6 && r6;
  168. if (!t4.length || !t4[0].length)
  169. return null;
  170. let g4, s5, x3, m5, [a3, d2] = t4[0], [v3, y4] = t4[0];
  171. for (let p3 = 0; p3 < t4.length; p3++) {
  172. const n4 = t4[p3], [e7, o6] = n4;
  173. if (a3 = l2(a3, e7), d2 = l2(d2, o6), v3 = u2(v3, e7), y4 = u2(y4, o6), h7 && n4.length > 2) {
  174. const t5 = n4[2];
  175. g4 = l2(g4, t5), s5 = u2(s5, t5);
  176. }
  177. if (f5 && n4.length > c7) {
  178. const t5 = n4[c7];
  179. x3 = l2(g4, t5), m5 = u2(s5, t5);
  180. }
  181. }
  182. return r6 ? (g4 = g4 || 0, s5 = s5 || 0, i5 ? (x3 = x3 || 0, m5 = m5 || 0, n3[0] = a3, n3[1] = d2, n3[2] = g4, n3[3] = x3, n3[4] = v3, n3[5] = y4, n3[6] = s5, n3[7] = m5, n3) : (n3[0] = a3, n3[1] = d2, n3[2] = g4, n3[3] = v3, n3[4] = y4, n3[5] = s5, n3)) : i5 ? (x3 = x3 || 0, m5 = m5 || 0, n3[0] = a3, n3[1] = d2, n3[2] = x3, n3[3] = v3, n3[4] = y4, n3[5] = m5, n3) : (n3[0] = a3, n3[1] = d2, n3[2] = v3, n3[3] = y4, n3);
  183. }
  184. // node_modules/@arcgis/core/geometry/support/coordsUtils.js
  185. function e3(n3, t4) {
  186. const r6 = t4[0] - n3[0], e6 = t4[1] - n3[1];
  187. if (n3.length > 2 && t4.length > 2) {
  188. const o5 = n3[2] - t4[2];
  189. return Math.sqrt(r6 * r6 + e6 * e6 + o5 * o5);
  190. }
  191. return Math.sqrt(r6 * r6 + e6 * e6);
  192. }
  193. function o2(n3, t4, r6) {
  194. const e6 = n3[0] + r6 * (t4[0] - n3[0]), o5 = n3[1] + r6 * (t4[1] - n3[1]);
  195. return n3.length > 2 && t4.length > 2 ? [e6, o5, n3[2] + r6 * (t4[2] - n3[2])] : [e6, o5];
  196. }
  197. function i3(n3, t4, r6, e6) {
  198. const [o5, i5] = t4, [s5, l5] = r6[e6], [f5, c7] = r6[e6 + 1], u6 = f5 - s5, h7 = c7 - l5, a3 = u6 * u6 + h7 * h7, g4 = (o5 - s5) * u6 + (i5 - l5) * h7, m5 = Math.min(1, Math.max(0, g4 / a3));
  199. return n3[0] = s5 + u6 * m5, n3[1] = l5 + h7 * m5, n3;
  200. }
  201. function s2(n3, t4, r6) {
  202. const e6 = r6.rings;
  203. let o5, i5, s5 = false, f5 = 1 / 0;
  204. for (let c7 = 0; c7 < e6.length; c7++) {
  205. const r7 = e6[c7];
  206. for (let e7 = 0, c8 = r7.length - 1; e7 < r7.length; c8 = e7++)
  207. o5 = r7[e7], i5 = r7[c8], o5[1] > t4 != i5[1] > t4 && n3 < (i5[0] - o5[0]) * (t4 - o5[1]) / (i5[1] - o5[1]) + o5[0] && (s5 = !s5), f5 = Math.min(f5, l3(n3, t4, o5, i5));
  208. }
  209. return 0 === f5 ? 0 : (s5 ? 1 : -1) * Math.sqrt(f5);
  210. }
  211. function l3(n3, t4, r6, e6) {
  212. let o5 = r6[0], i5 = r6[1], s5 = e6[0] - o5, l5 = e6[1] - i5;
  213. if (0 !== s5 || 0 !== l5) {
  214. const r7 = ((n3 - o5) * s5 + (t4 - i5) * l5) / (s5 * s5 + l5 * l5);
  215. r7 > 1 ? (o5 = e6[0], i5 = e6[1]) : r7 > 0 && (o5 += s5 * r7, i5 += l5 * r7);
  216. }
  217. return s5 = n3 - o5, l5 = t4 - i5, s5 * s5 + l5 * l5;
  218. }
  219. function f2(n3, t4) {
  220. return o2(n3, t4, 0.5);
  221. }
  222. function h4(n3, t4, r6) {
  223. const e6 = n3.length;
  224. let o5 = 0, i5 = 0, s5 = 0;
  225. for (let l5 = 0; l5 < e6; l5++) {
  226. const f5 = n3[l5], c7 = n3[(l5 + 1) % e6];
  227. let u6 = 2;
  228. o5 += f5[0] * c7[1] - c7[0] * f5[1], f5.length > 2 && c7.length > 2 && r6 && (i5 += f5[0] * c7[2] - c7[0] * f5[2], u6 = 3), f5.length > u6 && c7.length > u6 && t4 && (s5 += f5[0] * c7[u6] - c7[0] * f5[u6]);
  229. }
  230. return o5 <= 0 && i5 <= 0 && s5 <= 0;
  231. }
  232. function a(t4) {
  233. const r6 = t4.length;
  234. return r6 > 2 && i(t4[0], t4[r6 - 1]);
  235. }
  236. function g2(n3) {
  237. var _a, _b;
  238. if ("rings" in n3 && (m2(n3), n3.rings.length > 0 && !h4(n3.rings[0], (_a = n3.hasM) != null ? _a : false, (_b = n3.hasZ) != null ? _b : false)))
  239. for (const t4 of n3.rings)
  240. t4.reverse();
  241. }
  242. function m2(n3) {
  243. if ("rings" in n3)
  244. for (const t4 of n3.rings)
  245. a(t4) || t4.push(t4[0].slice());
  246. }
  247. function M2(n3) {
  248. if (!n3 || n3.length < 3)
  249. return 0;
  250. let t4 = 0;
  251. const r6 = n3.length - 1;
  252. for (let e6 = 0; e6 < r6; e6++)
  253. t4 += (n3[e6][0] - n3[e6 + 1][0]) * (n3[e6][1] + n3[e6 + 1][1]);
  254. return t4 += (n3[r6][0] - n3[0][0]) * (n3[r6][1] + n3[0][1]), -0.5 * t4;
  255. }
  256. // node_modules/@arcgis/core/geometry/support/centroid.js
  257. function e4(n3) {
  258. return n3 ? n3.hasZ ? [n3.xmax - n3.xmin / 2, n3.ymax - n3.ymin / 2, n3.zmax - n3.zmin / 2] : [n3.xmax - n3.xmin / 2, n3.ymax - n3.ymin / 2] : null;
  259. }
  260. function r4(n3) {
  261. var _a;
  262. return n3 ? o3(n3.rings, (_a = n3.hasZ) != null ? _a : false) : null;
  263. }
  264. function o3(n3, t4) {
  265. if (!n3 || !n3.length)
  266. return null;
  267. const l5 = [], e6 = [], r6 = t4 ? [1 / 0, -1 / 0, 1 / 0, -1 / 0, 1 / 0, -1 / 0] : [1 / 0, -1 / 0, 1 / 0, -1 / 0];
  268. for (let o5 = 0, i5 = n3.length; o5 < i5; o5++) {
  269. const l6 = u3(n3[o5], t4, r6);
  270. l6 && e6.push(l6);
  271. }
  272. if (e6.sort((n4, l6) => {
  273. let e7 = n4[2] - l6[2];
  274. return 0 === e7 && t4 && (e7 = n4[4] - l6[4]), e7;
  275. }), e6.length && (l5[0] = e6[0][0], l5[1] = e6[0][1], t4 && (l5[2] = e6[0][3]), (l5[0] < r6[0] || l5[0] > r6[1] || l5[1] < r6[2] || l5[1] > r6[3] || t4 && (l5[2] < r6[4] || l5[2] > r6[5])) && (l5.length = 0)), !l5.length) {
  276. const e7 = n3[0] && n3[0].length ? i4(n3[0], t4) : null;
  277. if (!e7)
  278. return null;
  279. l5[0] = e7[0], l5[1] = e7[1], t4 && e7.length > 2 && (l5[2] = e7[2]);
  280. }
  281. return l5;
  282. }
  283. function u3(n3, t4, l5) {
  284. let e6 = 0, r6 = 0, o5 = 0, u6 = 0, i5 = 0;
  285. const s5 = n3.length ? n3[0][0] : 0, g4 = n3.length ? n3[0][1] : 0, h7 = n3.length && t4 ? n3[0][2] : 0;
  286. for (let f5 = 0; f5 < n3.length; f5++) {
  287. const c8 = n3[f5], m5 = n3[(f5 + 1) % n3.length], [x3, a3, y4] = c8, p3 = x3 - s5, z = a3 - g4, [Z, d2, j2] = m5, U = Z - s5, b = d2 - g4, k2 = p3 * b - U * z;
  288. if (u6 += k2, e6 += (p3 + U) * k2, r6 += (z + b) * k2, t4 && c8.length > 2 && m5.length > 2) {
  289. const n4 = y4 - h7, t5 = j2 - h7, l6 = p3 * t5 - U * n4;
  290. o5 += (n4 + t5) * l6, i5 += l6;
  291. }
  292. x3 < l5[0] && (l5[0] = x3), x3 > l5[1] && (l5[1] = x3), a3 < l5[2] && (l5[2] = a3), a3 > l5[3] && (l5[3] = a3), t4 && (y4 < l5[4] && (l5[4] = y4), y4 > l5[5] && (l5[5] = y4));
  293. }
  294. if (u6 > 0 && (u6 *= -1), i5 > 0 && (i5 *= -1), !u6)
  295. return null;
  296. u6 *= 0.5, i5 *= 0.5;
  297. const c7 = [e6 / (6 * u6) + s5, r6 / (6 * u6) + g4, u6];
  298. return t4 && (l5[4] === l5[5] || 0 === i5 ? (c7[3] = (l5[4] + l5[5]) / 2, c7[4] = 0) : (c7[3] = o5 / (6 * i5) + h7, c7[4] = i5)), c7;
  299. }
  300. function i4(l5, e6) {
  301. const r6 = e6 ? [0, 0, 0] : [0, 0], o5 = e6 ? [0, 0, 0] : [0, 0];
  302. let u6 = 0, i5 = 0, s5 = 0, g4 = 0;
  303. for (let h7 = 0, c7 = l5.length; h7 < c7 - 1; h7++) {
  304. const c8 = l5[h7], f5 = l5[h7 + 1];
  305. if (c8 && f5) {
  306. r6[0] = c8[0], r6[1] = c8[1], o5[0] = f5[0], o5[1] = f5[1], e6 && c8.length > 2 && f5.length > 2 && (r6[2] = c8[2], o5[2] = f5[2]);
  307. const l6 = e3(r6, o5);
  308. if (l6) {
  309. u6 += l6;
  310. const n3 = f2(c8, f5);
  311. i5 += l6 * n3[0], s5 += l6 * n3[1], e6 && n3.length > 2 && (g4 += l6 * n3[2]);
  312. }
  313. }
  314. }
  315. return u6 > 0 ? e6 ? [i5 / u6, s5 / u6, g4 / u6] : [i5 / u6, s5 / u6] : l5.length ? l5[0] : null;
  316. }
  317. var s3 = 1e-6;
  318. function g3(n3) {
  319. if (!n3 || !n3.rings)
  320. return null;
  321. const { rings: t4 } = n3;
  322. let e6 = 0;
  323. for (let o5 = 0; o5 < t4.length; o5++)
  324. e6 += M2(t4[o5]);
  325. if (e6 < s3)
  326. return o3(t4, false);
  327. const r6 = [0, 0], u6 = t4[0][0];
  328. for (let l5 = 0; l5 < t4.length; l5++)
  329. c4(r6, u6, t4[l5]);
  330. return r6[0] *= 1 / e6, r6[1] *= 1 / e6, r6[0] += u6[0], r6[1] += u6[1], r6;
  331. }
  332. var h5 = 1 / 3;
  333. function c4(n3, t4, e6) {
  334. if (!n3 || !e6 || e6.length < 3)
  335. return null;
  336. const r6 = e6[0], o5 = [0, 0], u6 = [e6[1][0] - r6[0], e6[1][1] - r6[1]];
  337. let i5;
  338. for (let l5 = 2; l5 < e6.length; l5++)
  339. o5[0] = e6[l5][0] - r6[0], o5[1] = e6[l5][1] - r6[1], i5 = 0.5 * h5 * (o5[0] * u6[1] - o5[1] * u6[0]), n3[0] += i5 * (u6[0] + o5[0]), n3[1] += i5 * (u6[1] + o5[1]), u6[0] = o5[0], u6[1] = o5[1];
  340. const s5 = M2(e6), g4 = [r6[0], r6[1]];
  341. return g4[0] -= t4[0], g4[1] -= t4[1], g4[0] *= s5, g4[1] *= s5, n3[0] += g4[0], n3[1] += g4[1], n3;
  342. }
  343. // node_modules/@arcgis/core/geometry/support/extentUtils.js
  344. function t3(n3) {
  345. return void 0 !== n3.xmin && void 0 !== n3.ymin && void 0 !== n3.xmax && void 0 !== n3.ymax;
  346. }
  347. function u4(n3) {
  348. return void 0 !== n3.points;
  349. }
  350. function m3(n3) {
  351. return void 0 !== n3.x && void 0 !== n3.y;
  352. }
  353. function o4(n3) {
  354. return void 0 !== n3.paths;
  355. }
  356. function r5(n3) {
  357. return void 0 !== n3.rings;
  358. }
  359. var x = [];
  360. function a2(n3, i5, t4, u6) {
  361. return { xmin: n3, ymin: i5, xmax: t4, ymax: u6 };
  362. }
  363. function c5(n3, i5, t4, u6, m5, o5) {
  364. return { xmin: n3, ymin: i5, zmin: t4, xmax: u6, ymax: m5, zmax: o5 };
  365. }
  366. function s4(n3, i5, t4, u6, m5, o5) {
  367. return { xmin: n3, ymin: i5, mmin: t4, xmax: u6, ymax: m5, mmax: o5 };
  368. }
  369. function e5(n3, i5, t4, u6, m5, o5, r6, x3) {
  370. return { xmin: n3, ymin: i5, zmin: t4, mmin: u6, xmax: m5, ymax: o5, zmax: r6, mmax: x3 };
  371. }
  372. function f3(n3, i5 = false, t4 = false) {
  373. return i5 ? t4 ? e5(n3[0], n3[1], n3[2], n3[3], n3[4], n3[5], n3[6], n3[7]) : c5(n3[0], n3[1], n3[2], n3[3], n3[4], n3[5]) : t4 ? s4(n3[0], n3[1], n3[2], n3[3], n3[4], n3[5]) : a2(n3[0], n3[1], n3[2], n3[3]);
  374. }
  375. function l4(n3) {
  376. return n3 ? t3(n3) ? n3 : m3(n3) ? d(n3) : r5(n3) ? v(n3) : o4(n3) ? h6(n3) : u4(n3) ? y3(n3) : null : null;
  377. }
  378. function y3(i5) {
  379. const { hasZ: t4, hasM: u6, points: m5 } = i5;
  380. return f3(s(x, m5, t4 != null ? t4 : false, u6 != null ? u6 : false), t4, u6);
  381. }
  382. function d(n3) {
  383. const { x: i5, y: t4, z: u6, m: m5 } = n3, o5 = null != m5;
  384. return null != u6 ? o5 ? e5(i5, t4, u6, m5, i5, t4, u6, m5) : c5(i5, t4, u6, i5, t4, u6) : o5 ? s4(i5, t4, m5, i5, t4, m5) : a2(i5, t4, i5, t4);
  385. }
  386. function v(n3) {
  387. const { hasZ: t4, hasM: u6, rings: m5 } = n3, o5 = h3(x, m5, t4 != null ? t4 : false, u6 != null ? u6 : false);
  388. return o5 ? f3(o5, t4, u6) : null;
  389. }
  390. function h6(n3) {
  391. const { hasZ: t4, hasM: u6, paths: m5 } = n3, o5 = h3(x, m5, t4 != null ? t4 : false, u6 != null ? u6 : false);
  392. return o5 ? f3(o5, t4, u6) : null;
  393. }
  394. // node_modules/@arcgis/core/geometry/Polygon.js
  395. var x2;
  396. function j(t4) {
  397. return !Array.isArray(t4[0]);
  398. }
  399. var w3 = x2 = class extends p {
  400. constructor(...t4) {
  401. super(...t4), this.rings = [], this.type = "polygon";
  402. }
  403. static fromExtent(t4) {
  404. const r6 = t4.clone().normalize(), e6 = t4.spatialReference;
  405. let s5 = false, i5 = false;
  406. for (const o5 of r6)
  407. o5.hasZ && (s5 = true), o5.hasM && (i5 = true);
  408. const n3 = { rings: r6.map((t5) => {
  409. const r7 = [[t5.xmin, t5.ymin], [t5.xmin, t5.ymax], [t5.xmax, t5.ymax], [t5.xmax, t5.ymin], [t5.xmin, t5.ymin]];
  410. if (s5 && t5.hasZ) {
  411. const e7 = t5.zmin + 0.5 * (t5.zmax - t5.zmin);
  412. for (let t6 = 0; t6 < r7.length; t6++)
  413. r7[t6].push(e7);
  414. }
  415. if (i5 && t5.hasM) {
  416. const e7 = t5.mmin + 0.5 * (t5.mmax - t5.mmin);
  417. for (let t6 = 0; t6 < r7.length; t6++)
  418. r7[t6].push(e7);
  419. }
  420. return r7;
  421. }), spatialReference: e6 };
  422. return s5 && (n3.hasZ = true), i5 && (n3.hasM = true), new x2(n3);
  423. }
  424. normalizeCtorArgs(t4, r6) {
  425. let e6, s5, i5 = null, n3 = null;
  426. return t4 && !Array.isArray(t4) ? (i5 = t4.rings ? t4.rings : null, r6 || (t4.spatialReference ? r6 = t4.spatialReference : t4.rings || (r6 = t4)), e6 = t4.hasZ, s5 = t4.hasM) : i5 = t4, i5 = i5 || [], r6 = r6 || k.WGS84, i5.length && i5[0] && null != i5[0][0] && "number" == typeof i5[0][0] && (i5 = [i5]), n3 = i5[0] && i5[0][0], n3 && (void 0 === e6 && void 0 === s5 ? (e6 = n3.length > 2, s5 = n3.length > 3) : void 0 === e6 ? e6 = s5 ? n3.length > 3 : n3.length > 2 : void 0 === s5 && (s5 = e6 ? n3.length > 3 : n3.length > 2)), { rings: i5, spatialReference: r6, hasZ: e6, hasM: s5 };
  427. }
  428. get cache() {
  429. return this.commitProperty("rings"), this.commitProperty("hasZ"), this.commitProperty("hasM"), this.commitProperty("spatialReference"), {};
  430. }
  431. get centroid() {
  432. const t4 = r4(this);
  433. if (!t4 || isNaN(t4[0]) || isNaN(t4[1]) || this.hasZ && isNaN(t4[2]))
  434. return null;
  435. const r6 = new w();
  436. return r6.x = t4[0], r6.y = t4[1], r6.spatialReference = this.spatialReference, this.hasZ && (r6.z = t4[2]), r6;
  437. }
  438. get extent() {
  439. const { spatialReference: t4 } = this, r6 = v(this);
  440. if (!r6)
  441. return null;
  442. const e6 = new w2(r6);
  443. return e6.spatialReference = t4, e6;
  444. }
  445. get isSelfIntersecting() {
  446. return p2(this.rings);
  447. }
  448. writeRings(t4, r6) {
  449. r6.rings = y(this.rings);
  450. }
  451. addRing(t4) {
  452. if (!t4)
  453. return;
  454. const r6 = this.rings, e6 = r6.length;
  455. if (j(t4)) {
  456. const s5 = [];
  457. for (let r7 = 0, e7 = t4.length; r7 < e7; r7++)
  458. s5[r7] = t4[r7].toArray();
  459. r6[e6] = s5;
  460. } else
  461. r6[e6] = t4.concat();
  462. return this.notifyChange("rings"), this;
  463. }
  464. clone() {
  465. const t4 = new x2();
  466. return t4.spatialReference = this.spatialReference, t4.rings = y(this.rings), t4.hasZ = this.hasZ, t4.hasM = this.hasM, t4;
  467. }
  468. equals(t4) {
  469. if (this === t4)
  470. return true;
  471. if (t(t4))
  472. return false;
  473. const e6 = this.spatialReference, n3 = t4.spatialReference;
  474. if (r(e6) !== r(n3))
  475. return false;
  476. if (r(e6) && r(n3) && !e6.equals(n3))
  477. return false;
  478. if (this.rings.length !== t4.rings.length)
  479. return false;
  480. const o5 = ([t5, r6, e7, s5], [i5, n4, o6, a3]) => t5 === i5 && r6 === n4 && (null == e7 && null == o6 || e7 === o6) && (null == s5 && null == a3 || s5 === a3);
  481. for (let s5 = 0; s5 < this.rings.length; s5++) {
  482. const e7 = this.rings[s5], i5 = t4.rings[s5];
  483. if (!i(e7, i5, o5))
  484. return false;
  485. }
  486. return true;
  487. }
  488. contains(t4) {
  489. if (!t4)
  490. return false;
  491. const r6 = M(t4, this.spatialReference);
  492. return c(this, r(r6) ? r6 : t4);
  493. }
  494. isClockwise(t4) {
  495. let r6;
  496. return r6 = j(t4) ? t4.map((t5) => this.hasZ ? this.hasM ? [t5.x, t5.y, t5.z, t5.m] : [t5.x, t5.y, t5.z] : [t5.x, t5.y]) : t4, h4(r6, this.hasM, this.hasZ);
  497. }
  498. getPoint(t4, r6) {
  499. if (!this._validateInputs(t4, r6))
  500. return null;
  501. const e6 = this.rings[t4][r6], s5 = this.hasZ, i5 = this.hasM;
  502. return s5 && !i5 ? new w(e6[0], e6[1], e6[2], void 0, this.spatialReference) : i5 && !s5 ? new w(e6[0], e6[1], void 0, e6[2], this.spatialReference) : s5 && i5 ? new w(e6[0], e6[1], e6[2], e6[3], this.spatialReference) : new w(e6[0], e6[1], this.spatialReference);
  503. }
  504. insertPoint(t4, r6, e6) {
  505. return this._validateInputs(t4, r6, true) ? (h(this, e6), Array.isArray(e6) || (e6 = e6.toArray()), this.rings[t4].splice(r6, 0, e6), this.notifyChange("rings"), this) : this;
  506. }
  507. removePoint(t4, r6) {
  508. if (!this._validateInputs(t4, r6))
  509. return null;
  510. const e6 = new w(this.rings[t4].splice(r6, 1)[0], this.spatialReference);
  511. return this.notifyChange("rings"), e6;
  512. }
  513. removeRing(t4) {
  514. if (!this._validateInputs(t4, null))
  515. return null;
  516. const r6 = this.rings.splice(t4, 1)[0], e6 = this.spatialReference, s5 = r6.map((t5) => new w(t5, e6));
  517. return this.notifyChange("rings"), s5;
  518. }
  519. setPoint(t4, r6, e6) {
  520. return this._validateInputs(t4, r6) ? (h(this, e6), Array.isArray(e6) || (e6 = e6.toArray()), this.rings[t4][r6] = e6, this.notifyChange("rings"), this) : this;
  521. }
  522. _validateInputs(t4, r6, e6 = false) {
  523. if (null == t4 || t4 < 0 || t4 >= this.rings.length)
  524. return false;
  525. if (null != r6) {
  526. const s5 = this.rings[t4];
  527. if (e6 && (r6 < 0 || r6 > s5.length))
  528. return false;
  529. if (!e6 && (r6 < 0 || r6 >= s5.length))
  530. return false;
  531. }
  532. return true;
  533. }
  534. toJSON(t4) {
  535. return this.write({}, t4);
  536. }
  537. };
  538. e([y2({ readOnly: true })], w3.prototype, "cache", null), e([y2({ readOnly: true })], w3.prototype, "centroid", null), e([y2({ readOnly: true })], w3.prototype, "extent", null), e([y2({ readOnly: true })], w3.prototype, "isSelfIntersecting", null), e([y2({ type: [[[Number]]], json: { write: { isRequired: true } } })], w3.prototype, "rings", void 0), e([r2("rings")], w3.prototype, "writeRings", null), w3 = x2 = e([n("esri.geometry.Polygon")], w3), w3.prototype.toJSON.isDefaultToJSON = true;
  539. var v2 = w3;
  540. // node_modules/@arcgis/core/geometry/Polyline.js
  541. var c6;
  542. function u5(t4) {
  543. return !Array.isArray(t4[0]);
  544. }
  545. var f4 = c6 = class extends p {
  546. constructor(...t4) {
  547. super(...t4), this.paths = [], this.type = "polyline";
  548. }
  549. normalizeCtorArgs(t4, e6) {
  550. let s5, r6, i5 = null, a3 = null;
  551. return t4 && !Array.isArray(t4) ? (i5 = t4.paths ? t4.paths : null, e6 || (t4.spatialReference ? e6 = t4.spatialReference : t4.paths || (e6 = t4)), s5 = t4.hasZ, r6 = t4.hasM) : i5 = t4, i5 = i5 || [], e6 = e6 || k.WGS84, i5.length && i5[0] && null != i5[0][0] && "number" == typeof i5[0][0] && (i5 = [i5]), a3 = i5[0] && i5[0][0], a3 && (void 0 === s5 && void 0 === r6 ? (s5 = a3.length > 2, r6 = false) : void 0 === s5 ? s5 = !r6 && a3.length > 3 : void 0 === r6 && (r6 = !s5 && a3.length > 3)), { paths: i5, spatialReference: e6, hasZ: s5, hasM: r6 };
  552. }
  553. get cache() {
  554. return this.commitProperty("paths"), this.commitProperty("hasZ"), this.commitProperty("hasM"), this.commitProperty("spatialReference"), {};
  555. }
  556. get extent() {
  557. const { spatialReference: t4 } = this, e6 = h6(this);
  558. if (!e6)
  559. return null;
  560. const s5 = new w2(e6);
  561. return s5.spatialReference = t4, s5;
  562. }
  563. writePaths(t4, s5) {
  564. s5.paths = y(this.paths);
  565. }
  566. addPath(t4) {
  567. if (!t4)
  568. return;
  569. const e6 = this.paths, s5 = e6.length;
  570. if (u5(t4)) {
  571. const r6 = [];
  572. for (let e7 = 0, s6 = t4.length; e7 < s6; e7++)
  573. r6[e7] = t4[e7].toArray();
  574. e6[s5] = r6;
  575. } else
  576. e6[s5] = t4.concat();
  577. return this.notifyChange("paths"), this;
  578. }
  579. clone() {
  580. const t4 = new c6();
  581. return t4.spatialReference = this.spatialReference, t4.paths = y(this.paths), t4.hasZ = this.hasZ, t4.hasM = this.hasM, t4;
  582. }
  583. getPoint(t4, e6) {
  584. if (!this._validateInputs(t4, e6))
  585. return null;
  586. const s5 = this.paths[t4][e6], r6 = this.hasZ, i5 = this.hasM;
  587. return r6 && !i5 ? new w(s5[0], s5[1], s5[2], void 0, this.spatialReference) : i5 && !r6 ? new w(s5[0], s5[1], void 0, s5[2], this.spatialReference) : r6 && i5 ? new w(s5[0], s5[1], s5[2], s5[3], this.spatialReference) : new w(s5[0], s5[1], this.spatialReference);
  588. }
  589. insertPoint(t4, e6, s5) {
  590. return this._validateInputs(t4, e6, true) ? (h(this, s5), Array.isArray(s5) || (s5 = s5.toArray()), this.paths[t4].splice(e6, 0, s5), this.notifyChange("paths"), this) : this;
  591. }
  592. removePath(t4) {
  593. if (!this._validateInputs(t4, null))
  594. return null;
  595. const e6 = this.paths.splice(t4, 1)[0], s5 = this.spatialReference, r6 = e6.map((t5) => new w(t5, s5));
  596. return this.notifyChange("paths"), r6;
  597. }
  598. removePoint(t4, e6) {
  599. if (!this._validateInputs(t4, e6))
  600. return null;
  601. const s5 = new w(this.paths[t4].splice(e6, 1)[0], this.spatialReference);
  602. return this.notifyChange("paths"), s5;
  603. }
  604. setPoint(t4, e6, s5) {
  605. return this._validateInputs(t4, e6) ? (h(this, s5), Array.isArray(s5) || (s5 = s5.toArray()), this.paths[t4][e6] = s5, this.notifyChange("paths"), this) : this;
  606. }
  607. _validateInputs(t4, e6, s5 = false) {
  608. if (null == t4 || t4 < 0 || t4 >= this.paths.length)
  609. return false;
  610. if (null != e6) {
  611. const r6 = this.paths[t4];
  612. if (s5 && (e6 < 0 || e6 > r6.length))
  613. return false;
  614. if (!s5 && (e6 < 0 || e6 >= r6.length))
  615. return false;
  616. }
  617. return true;
  618. }
  619. toJSON(t4) {
  620. return this.write({}, t4);
  621. }
  622. };
  623. e([y2({ readOnly: true })], f4.prototype, "cache", null), e([y2({ readOnly: true })], f4.prototype, "extent", null), e([y2({ type: [[[Number]]], json: { write: { isRequired: true } } })], f4.prototype, "paths", void 0), e([r2("paths")], f4.prototype, "writePaths", null), f4 = c6 = e([n("esri.geometry.Polyline")], f4), f4.prototype.toJSON.isDefaultToJSON = true;
  624. var m4 = f4;
  625. export {
  626. u,
  627. i3 as i,
  628. s2 as s,
  629. h4 as h,
  630. g2 as g,
  631. m2 as m,
  632. M2 as M,
  633. e4 as e,
  634. r4 as r,
  635. o3 as o,
  636. u3 as u2,
  637. g3 as g2,
  638. c3 as c,
  639. f,
  640. s as s2,
  641. l4 as l,
  642. v,
  643. v2,
  644. m4 as m2
  645. };
  646. //# sourceMappingURL=chunk-VCH45Q2I.js.map