chunk-OWVBLVP3.js 24 KB

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