chunk-TRK7CKWP.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // node_modules/@arcgis/core/symbols/cim/utils.js
  2. function t(t2) {
  3. return typeof t2 == "function";
  4. }
  5. function e(e2, r2, n2, o2) {
  6. return t(e2) ? e2(r2, n2, o2) : e2;
  7. }
  8. function r(t2) {
  9. return [t2.r, t2.g, t2.b, t2.a];
  10. }
  11. function n(t2, e2, r2) {
  12. const n2 = " /-,\n", a2 = (t3) => {
  13. let e3 = t3.length;
  14. for (; e3--; )
  15. if (!n2.includes(t3.charAt(e3)))
  16. return false;
  17. return true;
  18. }, i2 = [];
  19. let c2 = 0, l2 = -1;
  20. do {
  21. if (l2 = e2.indexOf("[", c2), l2 >= c2) {
  22. if (l2 > c2) {
  23. const t3 = e2.substr(c2, l2 - c2);
  24. i2.push([t3, null, a2(t3)]);
  25. }
  26. if (c2 = l2 + 1, l2 = e2.indexOf("]", c2), l2 >= c2) {
  27. if (l2 > c2) {
  28. const r3 = t2[e2.substr(c2, l2 - c2)];
  29. r3 && i2.push([null, r3, false]);
  30. }
  31. c2 = l2 + 1;
  32. }
  33. }
  34. } while (l2 !== -1);
  35. if (c2 < e2.length - 1) {
  36. const t3 = e2.substr(c2);
  37. i2.push([t3, null, a2(t3)]);
  38. }
  39. return (t3) => {
  40. let e3 = "", n3 = null;
  41. for (const r3 of i2) {
  42. const [o2, a3, i3] = r3;
  43. if (o2)
  44. i3 ? n3 = o2 : (n3 && (e3 += n3, n3 = null), e3 += o2);
  45. else {
  46. const r4 = t3.attributes[a3];
  47. r4 && (n3 && (e3 += n3, n3 = null), e3 += r4);
  48. }
  49. }
  50. return o(e3, r2);
  51. };
  52. }
  53. function o(t2, e2) {
  54. switch (typeof t2 != "string" && (t2 = String(t2)), e2) {
  55. case "LowerCase":
  56. return t2.toLowerCase();
  57. case "Allcaps":
  58. return t2.toUpperCase();
  59. default:
  60. return t2;
  61. }
  62. }
  63. function a(t2, e2, r2, n2, o2, a2, i2 = true) {
  64. const c2 = e2 / o2, l2 = r2 / a2, u2 = Math.ceil(c2 / 2), s2 = Math.ceil(l2 / 2);
  65. for (let f2 = 0; f2 < a2; f2++)
  66. for (let r3 = 0; r3 < o2; r3++) {
  67. const M2 = 4 * (r3 + (i2 ? a2 - f2 - 1 : f2) * o2);
  68. let p2 = 0, C2 = 0, y = 0, I = 0, h = 0, k = 0, m = 0;
  69. const d = (f2 + 0.5) * l2;
  70. for (let n3 = Math.floor(f2 * l2); n3 < (f2 + 1) * l2; n3++) {
  71. const o3 = Math.abs(d - (n3 + 0.5)) / s2, a3 = (r3 + 0.5) * c2, i3 = o3 * o3;
  72. for (let l3 = Math.floor(r3 * c2); l3 < (r3 + 1) * c2; l3++) {
  73. let r4 = Math.abs(a3 - (l3 + 0.5)) / u2;
  74. const o4 = Math.sqrt(i3 + r4 * r4);
  75. o4 >= -1 && o4 <= 1 && (p2 = 2 * o4 * o4 * o4 - 3 * o4 * o4 + 1, p2 > 0 && (r4 = 4 * (l3 + n3 * e2), m += p2 * t2[r4 + 3], y += p2, t2[r4 + 3] < 255 && (p2 = p2 * t2[r4 + 3] / 250), I += p2 * t2[r4], h += p2 * t2[r4 + 1], k += p2 * t2[r4 + 2], C2 += p2));
  76. }
  77. }
  78. n2[M2] = I / C2, n2[M2 + 1] = h / C2, n2[M2 + 2] = k / C2, n2[M2 + 3] = m / y;
  79. }
  80. }
  81. function i(t2) {
  82. return t2 ? { r: t2[0], g: t2[1], b: t2[2], a: t2[3] / 255 } : { r: 0, g: 0, b: 0, a: 0 };
  83. }
  84. function c(t2) {
  85. return t2.data?.symbol;
  86. }
  87. function l(t2) {
  88. return t2.type === "CIMVectorMarker" || t2.type === "CIMPictureMarker" || t2.type === "CIMBarChartMarker" || t2.type === "CIMCharacterMarker" || t2.type === "CIMPieChartMarker" || t2.type === "CIMStackedBarChartMarker";
  89. }
  90. function u(t2) {
  91. return t2.type === "CIMGradientStroke" || t2.type === "CIMPictureStroke" || t2.type === "CIMSolidStroke";
  92. }
  93. function s(t2) {
  94. return t2.type === "CIMGradientFill" || t2.type === "CIMHatchFill" || t2.type === "CIMPictureFill" || t2.type === "CIMSolidFill" || t2.type === "CIMWaterFill";
  95. }
  96. function f(t2) {
  97. return t2.type === "CIMMarkerPlacementAlongLineRandomSize" || t2.type === "CIMMarkerPlacementAlongLineSameSize" || t2.type === "CIMMarkerPlacementAlongLineVariableSize" || t2.type === "CIMMarkerPlacementAtExtremities" || t2.type === "CIMMarkerPlacementAtMeasuredUnits" || t2.type === "CIMMarkerPlacementAtRatioPositions" || t2.type === "CIMMarkerPlacementOnLine" || t2.type === "CIMMarkerPlacementOnVertices";
  98. }
  99. var M = (t2) => isNaN(t2) || !t2 ? 0 : t2;
  100. var p = (t2) => {
  101. if (!t2)
  102. return false;
  103. for (const e2 of t2)
  104. switch (e2.type) {
  105. case "CIMGeometricEffectBuffer":
  106. case "CIMGeometricEffectOffset":
  107. return true;
  108. }
  109. return false;
  110. };
  111. function C() {
  112. return import("./geometryEngineJSON-XXKTYTFH.js");
  113. }
  114. export {
  115. e,
  116. r,
  117. n,
  118. o,
  119. a,
  120. i,
  121. c,
  122. l,
  123. u,
  124. s,
  125. f,
  126. M,
  127. p,
  128. C
  129. };
  130. //# sourceMappingURL=chunk-TRK7CKWP.js.map