chunk-UMUHMVL4.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import {
  2. f,
  3. l,
  4. s,
  5. u,
  6. y
  7. } from "./chunk-RMDDCMKS.js";
  8. import {
  9. r,
  10. t
  11. } from "./chunk-YXWMMD76.js";
  12. // node_modules/@arcgis/core/geometry/support/quantizationUtils.js
  13. var a = (n, t2, e) => [t2, e];
  14. var m = (n, t2, e) => [t2, e, n[2]];
  15. var c = (n, t2, e) => [t2, e, n[2], n[3]];
  16. function s2(t2) {
  17. if (!t2)
  18. return null;
  19. return { originPosition: "upper-left" === t2.originPosition ? "upperLeft" : "lower-left" === t2.originPosition ? "lowerLeft" : t2.originPosition, scale: t2.tolerance ? [t2.tolerance, t2.tolerance] : [1, 1], translate: r(t2.extent) ? [t2.extent.xmin, t2.extent.ymax] : [0, 0] };
  20. }
  21. function x({ scale: n, translate: t2 }, e) {
  22. return Math.round((e - t2[0]) / n[0]);
  23. }
  24. function h({ scale: n, translate: t2 }, e) {
  25. return Math.round((t2[1] - e) / n[1]);
  26. }
  27. function I(n, t2, e) {
  28. const r2 = [];
  29. let u2, i, o, l2;
  30. for (let a2 = 0; a2 < e.length; a2++) {
  31. const m2 = e[a2];
  32. a2 > 0 ? (o = x(n, m2[0]), l2 = h(n, m2[1]), o === u2 && l2 === i || (r2.push(t2(m2, o - u2, l2 - i)), u2 = o, i = l2)) : (u2 = x(n, m2[0]), i = h(n, m2[1]), r2.push(t2(m2, u2, i)));
  33. }
  34. return r2.length > 0 ? r2 : null;
  35. }
  36. function p(n, t2, e, r2) {
  37. return I(n, e ? r2 ? c : m : r2 ? m : a, t2);
  38. }
  39. function N(n, t2, e, r2) {
  40. const u2 = [], i = e ? r2 ? c : m : r2 ? m : a;
  41. for (let o = 0; o < t2.length; o++) {
  42. const e2 = I(n, i, t2[o]);
  43. e2 && e2.length >= 3 && u2.push(e2);
  44. }
  45. return u2.length ? u2 : null;
  46. }
  47. function y2(n, t2, e, r2) {
  48. const u2 = [], i = e ? r2 ? c : m : r2 ? m : a;
  49. for (let o = 0; o < t2.length; o++) {
  50. const e2 = I(n, i, t2[o]);
  51. e2 && e2.length >= 2 && u2.push(e2);
  52. }
  53. return u2.length ? u2 : null;
  54. }
  55. function z({ scale: n, translate: t2 }, e) {
  56. return e * n[0] + t2[0];
  57. }
  58. function T({ scale: n, translate: t2 }, e) {
  59. return t2[1] - e * n[1];
  60. }
  61. function M(n, t2, e) {
  62. const r2 = new Array(e.length);
  63. if (!e.length)
  64. return r2;
  65. const [u2, i] = n.scale;
  66. let o = z(n, e[0][0]), l2 = T(n, e[0][1]);
  67. r2[0] = t2(e[0], o, l2);
  68. for (let a2 = 1; a2 < e.length; a2++) {
  69. const n2 = e[a2];
  70. o += n2[0] * u2, l2 -= n2[1] * i, r2[a2] = t2(n2, o, l2);
  71. }
  72. return r2;
  73. }
  74. function E(n, t2, e) {
  75. const r2 = new Array(e.length);
  76. for (let u2 = 0; u2 < e.length; u2++)
  77. r2[u2] = M(n, t2, e[u2]);
  78. return r2;
  79. }
  80. function b(n, t2, e, r2) {
  81. return M(n, e ? r2 ? c : m : r2 ? m : a, t2);
  82. }
  83. function F(n, t2, e, r2) {
  84. return E(n, e ? r2 ? c : m : r2 ? m : a, t2);
  85. }
  86. function V(n, t2, e, r2) {
  87. return E(n, e ? r2 ? c : m : r2 ? m : a, t2);
  88. }
  89. function G(n, t2, e, r2, u2) {
  90. return t2.xmin = x(n, e.xmin), t2.ymin = h(n, e.ymin), t2.xmax = x(n, e.xmax), t2.ymax = h(n, e.ymax), t2 !== e && (r2 && (t2.zmin = e.zmin, t2.zmax = e.zmax), u2 && (t2.mmin = e.mmin, t2.mmax = e.mmax)), t2;
  91. }
  92. function L(n, t2, e, r2, u2) {
  93. var _a;
  94. return t2.points = (_a = p(n, e.points, r2, u2)) != null ? _a : [], t2;
  95. }
  96. function O(n, t2, e, r2, u2) {
  97. return t2.x = x(n, e.x), t2.y = h(n, e.y), t2 !== e && (r2 && (t2.z = e.z), u2 && (t2.m = e.m)), t2;
  98. }
  99. function S(n, t2, e, r2, u2) {
  100. const i = N(n, e.rings, r2, u2);
  101. return i ? (t2.rings = i, t2) : null;
  102. }
  103. function d(n, t2, e, r2, u2) {
  104. const i = y2(n, e.paths, r2, u2);
  105. return i ? (t2.paths = i, t2) : null;
  106. }
  107. function U(n, t2) {
  108. return n && t2 ? s(t2) ? O(n, {}, t2, false, false) : f(t2) ? d(n, {}, t2, false, false) : y(t2) ? S(n, {}, t2, false, false) : l(t2) ? L(n, {}, t2, false, false) : u(t2) ? G(n, {}, t2, false, false) : null : null;
  109. }
  110. function q(t2, e, r2, u2, i) {
  111. return r(r2) && (e.points = b(t2, r2.points, u2, i)), e;
  112. }
  113. function v(n, e, r2, u2, i) {
  114. return t(r2) || (e.x = z(n, r2.x), e.y = T(n, r2.y), e !== r2 && (u2 && (e.z = r2.z), i && (e.m = r2.m))), e;
  115. }
  116. function B(t2, e, r2, u2, i) {
  117. return r(r2) && (e.rings = V(t2, r2.rings, u2, i)), e;
  118. }
  119. function C(t2, e, r2, u2, i) {
  120. return r(r2) && (e.paths = F(t2, r2.paths, u2, i)), e;
  121. }
  122. export {
  123. s2 as s,
  124. O,
  125. U,
  126. q,
  127. v,
  128. B,
  129. C
  130. };
  131. //# sourceMappingURL=chunk-UMUHMVL4.js.map