chunk-IEU3AM37.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import {
  2. j
  3. } from "./chunk-LBW34VZ2.js";
  4. import {
  5. e2 as e,
  6. m
  7. } from "./chunk-2Z2TG5CU.js";
  8. import {
  9. r,
  10. t
  11. } from "./chunk-YXWMMD76.js";
  12. // node_modules/@arcgis/core/core/accessorSupport/diffUtils.js
  13. var f = ["esri.Color", "esri.portal.Portal", "esri.symbols.support.Symbol3DAnchorPosition2D", "esri.symbols.support.Symbol3DAnchorPosition3D"];
  14. function i(t2) {
  15. return t2 instanceof m;
  16. }
  17. function c(e2) {
  18. return e2 instanceof j ? Object.keys(e2.items) : i(e2) ? e(e2).keys() : e2 ? Object.keys(e2) : [];
  19. }
  20. function l(e2, n) {
  21. return e2 instanceof j ? e2.items[n] : e2[n];
  22. }
  23. function u(e2, t2) {
  24. return !(!Array.isArray(e2) || !Array.isArray(t2)) && e2.length !== t2.length;
  25. }
  26. function s(e2) {
  27. return e2 ? e2.declaredClass : null;
  28. }
  29. function p(e2, t2) {
  30. const n = e2.diff;
  31. if (n && "function" == typeof n)
  32. return n(e2, t2);
  33. const r2 = c(e2), a2 = c(t2);
  34. if (0 === r2.length && 0 === a2.length)
  35. return;
  36. if (!r2.length || !a2.length || u(e2, t2))
  37. return { type: "complete", oldValue: e2, newValue: t2 };
  38. const y2 = a2.filter((e3) => !r2.includes(e3)), m3 = r2.filter((e3) => !a2.includes(e3)), d = r2.filter((n2) => a2.includes(n2) && l(e2, n2) !== l(t2, n2)).concat(y2, m3).sort(), b = s(e2);
  39. if (b && f.includes(b) && d.length)
  40. return { type: "complete", oldValue: e2, newValue: t2 };
  41. let h;
  42. const g = i(e2) && i(t2);
  43. for (const f2 of d) {
  44. const r3 = l(e2, f2), i2 = l(t2, f2);
  45. let c2;
  46. if ((g || "function" != typeof r3 && "function" != typeof i2) && (r3 !== i2 && (null != r3 || null != i2))) {
  47. if (n && n[f2] && "function" == typeof n[f2])
  48. c2 = n[f2](r3, i2);
  49. else if (r3 instanceof Date && i2 instanceof Date) {
  50. if (r3.getTime() === i2.getTime())
  51. continue;
  52. c2 = { type: "complete", oldValue: r3, newValue: i2 };
  53. } else
  54. c2 = "object" == typeof r3 && "object" == typeof i2 && s(r3) === s(i2) ? p(r3, i2) : { type: "complete", oldValue: r3, newValue: i2 };
  55. r(c2) && (r(h) ? h.diff[f2] = c2 : h = { type: "partial", diff: { [f2]: c2 } });
  56. }
  57. }
  58. return h;
  59. }
  60. function a(e2, t2) {
  61. if (t(e2))
  62. return false;
  63. const o = t2.split(".");
  64. let r2 = e2;
  65. for (const n of o) {
  66. if ("complete" === r2.type)
  67. return true;
  68. if ("partial" !== r2.type)
  69. return false;
  70. {
  71. const e3 = r2.diff[n];
  72. if (!e3)
  73. return false;
  74. r2 = e3;
  75. }
  76. }
  77. return true;
  78. }
  79. function y(e2, t2) {
  80. for (const n of t2)
  81. if (a(e2, n))
  82. return true;
  83. return false;
  84. }
  85. function m2(e2, t2) {
  86. if (!("function" == typeof e2 || "function" == typeof t2 || t(e2) && t(t2)))
  87. return t(e2) || t(t2) || "object" == typeof e2 && "object" == typeof t2 && s(e2) !== s(t2) ? { type: "complete", oldValue: e2, newValue: t2 } : p(e2, t2);
  88. }
  89. export {
  90. a,
  91. y,
  92. m2 as m
  93. };
  94. //# sourceMappingURL=chunk-IEU3AM37.js.map