@gridsheet/preact-core 3.4.2 → 3.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -233,16 +233,16 @@ const Cs = 20, rt = 24, he = 90, jr = 500, Gr = 1e3, $e = 24, Le = 50, Zr = 5, q
233
233
  let l = o.y, h = o.x, u = o.y, c = o.x;
234
234
  const f = [o];
235
235
  for (i.add(a); f.length > 0; ) {
236
- const { y: d, x: p } = f.shift();
237
- d < l && (l = d), d > u && (u = d), p < h && (h = p), p > c && (c = p);
238
- for (const [m, y] of [
236
+ const { y: d, x: m } = f.shift();
237
+ d < l && (l = d), d > u && (u = d), m < h && (h = m), m > c && (c = m);
238
+ for (const [p, y] of [
239
239
  [0, 1],
240
240
  [0, -1],
241
241
  [1, 0],
242
242
  [-1, 0]
243
243
  ]) {
244
- const g = e(d + m, p + y);
245
- s.has(g) && !i.has(g) && (i.add(g), f.push({ y: d + m, x: p + y }));
244
+ const g = e(d + p, m + y);
245
+ s.has(g) && !i.has(g) && (i.add(g), f.push({ y: d + p, x: m + y }));
246
246
  }
247
247
  }
248
248
  n.push({ top: l, left: h, bottom: u, right: c });
@@ -850,7 +850,7 @@ const ei = (r, t) => {
850
850
  for (let h = 0; h < i.length; h++) {
851
851
  if (n.has(h))
852
852
  continue;
853
- const u = i[h], c = u.replace(l, (f, d, p) => `${d || ""}#${a}${p || ""}`);
853
+ const u = i[h], c = u.replace(l, (f, d, m) => `${d || ""}#${a}${m || ""}`);
854
854
  c !== u && (i[h] = c, n.add(h));
855
855
  }
856
856
  }), `${e}!${i.join(":")}`;
@@ -964,13 +964,13 @@ const Rt = (r, { sheet: t, operation: e, dependency: s }) => {
964
964
  return { sheet: t, sheetName: i, addresses: n, ids: o };
965
965
  const a = [];
966
966
  for (let h = 0; h < n.length; h++) {
967
- const u = n[h], { y: c, x: f, absX: d, absY: p } = T(u);
968
- let m = t.getId({ y: c, x: f });
969
- if (m === s && (e === "removeRows" ? m = t.getId({ y: c - 1, x: f }) : e === "removeCols" && (m = t.getId({ y: c, x: f - 1 }))), m == null) {
970
- a.push(Ke(u, !!d, !!p) || "?");
967
+ const u = n[h], { y: c, x: f, absX: d, absY: m } = T(u);
968
+ let p = t.getId({ y: c, x: f });
969
+ if (p === s && (e === "removeRows" ? p = t.getId({ y: c - 1, x: f }) : e === "removeCols" && (p = t.getId({ y: c, x: f - 1 }))), p == null) {
970
+ a.push(Ke(u, !!d, !!m) || "?");
971
971
  continue;
972
972
  }
973
- o.push(m), a.push(`${d ? "$" : ""}#${m}${p ? "$" : ""}`);
973
+ o.push(p), a.push(`${d ? "$" : ""}#${p}${m ? "$" : ""}`);
974
974
  }
975
975
  let l = `#${t.id}!${a.join(":")}`;
976
976
  return {
@@ -1022,10 +1022,10 @@ const Rt = (r, { sheet: t, operation: e, dependency: s }) => {
1022
1022
  const a = {};
1023
1023
  if (i) {
1024
1024
  for (const f of i) {
1025
- const d = T(f), p = is(r, f, { resolution: t, raise: e }) ?? {};
1026
- if (s(p)) {
1027
- let m = p.value;
1028
- o && (m = r.getPolicy(d).toScalar({ value: p.value, cell: p, sheet: r.__raw__, point: d })), a[f] = m;
1025
+ const d = T(f), m = is(r, f, { resolution: t, raise: e }) ?? {};
1026
+ if (s(m)) {
1027
+ let p = m.value;
1028
+ o && (p = r.getPolicy(d).toScalar({ value: m.value, cell: m, sheet: r.__raw__, point: d })), a[f] = p;
1029
1029
  }
1030
1030
  }
1031
1031
  return a;
@@ -1033,37 +1033,37 @@ const Rt = (r, { sheet: t, operation: e, dependency: s }) => {
1033
1033
  const { top: l, left: h, bottom: u, right: c } = n ?? r.area;
1034
1034
  for (let f = l; f <= u; f++)
1035
1035
  for (let d = h; d <= c; d++) {
1036
- const p = r.getCell({ y: f, x: d }, { resolution: t, raise: e }) ?? {};
1037
- if (s(p)) {
1038
- let m = p.value;
1039
- o && (m = r.getPolicy({ y: f, x: d }).toScalar({ value: p.value, cell: p, sheet: r.__raw__, point: { y: f, x: d } })), a[M({ y: f, x: d })] = m;
1036
+ const m = r.getCell({ y: f, x: d }, { resolution: t, raise: e }) ?? {};
1037
+ if (s(m)) {
1038
+ let p = m.value;
1039
+ o && (p = r.getPolicy({ y: f, x: d }).toScalar({ value: m.value, cell: m, sheet: r.__raw__, point: { y: f, x: d } })), a[M({ y: f, x: d })] = p;
1040
1040
  }
1041
1041
  }
1042
1042
  return a;
1043
1043
  }, Rn = (r, { resolution: t = "RESOLVED", raise: e = false, filter: s = st, rows: i, area: n, asScalar: o = false } = {}) => {
1044
- const a = [], { top: l, left: h, bottom: u, right: c } = n ?? r.area, f = i ?? Array.from({ length: r.numRows }, (d, p) => l + p);
1044
+ const a = [], { top: l, left: h, bottom: u, right: c } = n ?? r.area, f = i ?? Array.from({ length: r.numRows }, (d, m) => l + m);
1045
1045
  for (const d of f) {
1046
- const p = {};
1047
- a.push(p);
1048
- for (let m = h; m <= c; m++) {
1049
- const y = r.getCell({ y: d, x: m }, { resolution: t, raise: e }) ?? {};
1046
+ const m = {};
1047
+ a.push(m);
1048
+ for (let p = h; p <= c; p++) {
1049
+ const y = r.getCell({ y: d, x: p }, { resolution: t, raise: e }) ?? {};
1050
1050
  if (s(y)) {
1051
1051
  let g = y.value;
1052
- o && (g = r.getPolicy({ y: d, x: m }).toScalar({ value: y.value, cell: y, sheet: r.__raw__, point: { y: d, x: m } })), p[G$1(m)] = g;
1052
+ o && (g = r.getPolicy({ y: d, x: p }).toScalar({ value: y.value, cell: y, sheet: r.__raw__, point: { y: d, x: p } })), m[G$1(p)] = g;
1053
1053
  }
1054
1054
  }
1055
1055
  }
1056
1056
  return a;
1057
1057
  }, En = (r, { resolution: t = "RESOLVED", raise: e = false, filter: s = st, cols: i, area: n, asScalar: o = false } = {}) => {
1058
- const a = [], { top: l, left: h, bottom: u, right: c } = n ?? r.area, f = i ? i.map((d) => typeof d == "string" ? Ht(d) : d) : Array.from({ length: r.numCols }, (d, p) => h + p);
1058
+ const a = [], { top: l, left: h, bottom: u, right: c } = n ?? r.area, f = i ? i.map((d) => typeof d == "string" ? Ht(d) : d) : Array.from({ length: r.numCols }, (d, m) => h + m);
1059
1059
  for (const d of f) {
1060
- const p = {};
1061
- a.push(p);
1062
- for (let m = l; m <= u; m++) {
1063
- const y = r.getCell({ y: m, x: d }, { resolution: t, raise: e }) ?? {};
1060
+ const m = {};
1061
+ a.push(m);
1062
+ for (let p = l; p <= u; p++) {
1063
+ const y = r.getCell({ y: p, x: d }, { resolution: t, raise: e }) ?? {};
1064
1064
  if (s(y)) {
1065
1065
  let g = y.value;
1066
- o && (g = r.getPolicy({ y: m, x: d }).toScalar({ value: y.value, cell: y, sheet: r.__raw__, point: { y: m, x: d } })), p[bt(m)] = g;
1066
+ o && (g = r.getPolicy({ y: p, x: d }).toScalar({ value: y.value, cell: y, sheet: r.__raw__, point: { y: p, x: d } })), m[bt(p)] = g;
1067
1067
  }
1068
1068
  }
1069
1069
  }
@@ -1074,8 +1074,8 @@ const Rt = (r, { sheet: t, operation: e, dependency: s }) => {
1074
1074
  for (let f = a; f <= h; f++) {
1075
1075
  const d = r.getCell({ y: c, x: f }, { resolution: e, raise: s }) ?? {};
1076
1076
  if (i(d)) {
1077
- const p = Bt(d, n);
1078
- u[c - o][f - a] = p;
1077
+ const m = Bt(d, n);
1078
+ u[c - o][f - a] = m;
1079
1079
  }
1080
1080
  }
1081
1081
  return u;
@@ -1098,29 +1098,29 @@ const Rt = (r, { sheet: t, operation: e, dependency: s }) => {
1098
1098
  const { top: l, left: h, bottom: u, right: c } = n ?? r.area;
1099
1099
  for (let f = l; f <= u; f++)
1100
1100
  for (let d = h; d <= c; d++) {
1101
- const p = r.getCell({ y: f, x: d }, { resolution: t, raise: e }) ?? {};
1102
- s(p) && (a[M({ y: f, x: d })] = Bt(p, o));
1101
+ const m = r.getCell({ y: f, x: d }, { resolution: t, raise: e }) ?? {};
1102
+ s(m) && (a[M({ y: f, x: d })] = Bt(m, o));
1103
1103
  }
1104
1104
  return a;
1105
1105
  }, Cn = (r, { resolution: t = "RESOLVED", raise: e = false, filter: s = st, rows: i, area: n, ignoreFields: o = [] } = {}) => {
1106
- const a = [], { top: l, left: h, bottom: u, right: c } = n ?? r.area, f = i ?? Array.from({ length: r.numRows }, (d, p) => l + p);
1106
+ const a = [], { top: l, left: h, bottom: u, right: c } = n ?? r.area, f = i ?? Array.from({ length: r.numRows }, (d, m) => l + m);
1107
1107
  for (const d of f) {
1108
- const p = {};
1109
- a.push(p);
1110
- for (let m = h; m <= c; m++) {
1111
- const y = r.getCell({ y: d, x: m }, { resolution: t, raise: e }) ?? {};
1112
- s(y) && (p[G$1(m)] = Bt(y, o));
1108
+ const m = {};
1109
+ a.push(m);
1110
+ for (let p = h; p <= c; p++) {
1111
+ const y = r.getCell({ y: d, x: p }, { resolution: t, raise: e }) ?? {};
1112
+ s(y) && (m[G$1(p)] = Bt(y, o));
1113
1113
  }
1114
1114
  }
1115
1115
  return a;
1116
1116
  }, rs = (r) => `'${r.replace(/'/g, "''")}'`, ri = (r) => r ? `${rs(r)}!` : "", Tn = (r, { resolution: t = "RESOLVED", raise: e = false, filter: s = st, cols: i, area: n, ignoreFields: o = [] } = {}) => {
1117
- const a = [], { top: l, left: h, bottom: u, right: c } = n ?? r.area, f = i ? i.map((d) => typeof d == "string" ? Ht(d) : d) : Array.from({ length: r.numCols }, (d, p) => h + p);
1117
+ const a = [], { top: l, left: h, bottom: u, right: c } = n ?? r.area, f = i ? i.map((d) => typeof d == "string" ? Ht(d) : d) : Array.from({ length: r.numCols }, (d, m) => h + m);
1118
1118
  for (const d of f) {
1119
- const p = {};
1120
- a.push(p);
1121
- for (let m = l; m <= u; m++) {
1122
- const y = r.getCell({ y: m, x: d }, { resolution: t, raise: e }) ?? {};
1123
- s(y) && (p[bt(m)] = Bt(y, o));
1119
+ const m = {};
1120
+ a.push(m);
1121
+ for (let p = l; p <= u; p++) {
1122
+ const y = r.getCell({ y: p, x: d }, { resolution: t, raise: e }) ?? {};
1123
+ s(y) && (m[bt(p)] = Bt(y, o));
1124
1124
  }
1125
1125
  }
1126
1126
  return a;
@@ -1884,15 +1884,15 @@ let Y$1 = class Y {
1884
1884
  f != null && f.sortFixed ? i.add(c) : n.push(c);
1885
1885
  }
1886
1886
  n.sort((c, f) => {
1887
- const d = this.getCell({ y: c, x: t }, { resolution: "RESOLVED" }), p = this.getCell({ y: f, x: t }, { resolution: "RESOLVED" }), m = d == null ? void 0 : d.value, y = p == null ? void 0 : p.value;
1888
- if (m == null && y == null)
1887
+ const d = this.getCell({ y: c, x: t }, { resolution: "RESOLVED" }), m = this.getCell({ y: f, x: t }, { resolution: "RESOLVED" }), p = d == null ? void 0 : d.value, y = m == null ? void 0 : m.value;
1888
+ if (p == null && y == null)
1889
1889
  return 0;
1890
- if (m == null)
1890
+ if (p == null)
1891
1891
  return 1;
1892
1892
  if (y == null)
1893
1893
  return -1;
1894
1894
  let g = 0;
1895
- return typeof m == "number" && typeof y == "number" ? g = m - y : m instanceof Date && y instanceof Date ? g = m.getTime() - y.getTime() : g = String(m).localeCompare(String(y)), e === "asc" ? g : -g;
1895
+ return typeof p == "number" && typeof y == "number" ? g = p - y : p instanceof Date && y instanceof Date ? g = p.getTime() - y.getTime() : g = String(p).localeCompare(String(y)), e === "asc" ? g : -g;
1896
1896
  });
1897
1897
  const o = [];
1898
1898
  for (let c = 1; c <= s; c++)
@@ -2062,8 +2062,8 @@ let Y$1 = class Y {
2062
2062
  const u = T(h), { y: c, x: f } = u;
2063
2063
  if (c === 0 && f === 0 || c === 0 || f === 0 || c <= 0 || f <= 0 || c > e.numRows || f > e.numCols)
2064
2064
  continue;
2065
- const p = this._ensureIdRow(c)[f];
2066
- p != null && this._ensureCellPopulated(c, f, p);
2065
+ const m = this._ensureIdRow(c)[f];
2066
+ m != null && this._ensureCellPopulated(c, f, m);
2067
2067
  }
2068
2068
  this.status = 1, this.registry.sheetIdsByName[this.name] = this.id;
2069
2069
  }
@@ -2119,43 +2119,43 @@ let Y$1 = class Y {
2119
2119
  const i = this._initCells, n = Date.now();
2120
2120
  let o;
2121
2121
  if (t === 0 && e > 0) {
2122
- const u = this._colLetters[e] || G$1(e), c = i == null ? void 0 : i[u], { style: f, ...d } = c ?? {}, p = i == null ? void 0 : i[u + "0"];
2122
+ const u = this._colLetters[e] || G$1(e), c = i == null ? void 0 : i[u], { style: f, ...d } = c ?? {}, m = i == null ? void 0 : i[u + "0"];
2123
2123
  o = {
2124
2124
  ...this._commonCol,
2125
2125
  ...d,
2126
- ...p,
2127
- ...Y._stack(this._commonCol, p)
2126
+ ...m,
2127
+ ...Y._stack(this._commonCol, m)
2128
2128
  };
2129
2129
  } else if (e === 0 && t > 0) {
2130
- const u = bt(t), c = i == null ? void 0 : i[u], { style: f, ...d } = c ?? {}, p = i == null ? void 0 : i["0" + u];
2130
+ const u = bt(t), c = i == null ? void 0 : i[u], { style: f, ...d } = c ?? {}, m = i == null ? void 0 : i["0" + u];
2131
2131
  o = {
2132
2132
  ...this._commonRow,
2133
2133
  ...d,
2134
- ...p,
2135
- ...Y._stack(this._commonRow, p)
2134
+ ...m,
2135
+ ...Y._stack(this._commonRow, m)
2136
2136
  };
2137
2137
  } else if (t === 0 && e === 0) {
2138
2138
  const u = i == null ? void 0 : i["0"];
2139
2139
  o = { ...u, ...Y._stack(u) };
2140
2140
  } else {
2141
- const u = this._colLetters[e] || G$1(e), c = bt(t), f = `${u}${c}`, d = i == null ? void 0 : i[c], p = i == null ? void 0 : i[u];
2142
- let m = i == null ? void 0 : i[f];
2143
- if ((m == null || !("value" in m)) && this._matrixByBase.length > 0)
2141
+ const u = this._colLetters[e] || G$1(e), c = bt(t), f = `${u}${c}`, d = i == null ? void 0 : i[c], m = i == null ? void 0 : i[u];
2142
+ let p = i == null ? void 0 : i[f];
2143
+ if ((p == null || !("value" in p)) && this._matrixByBase.length > 0)
2144
2144
  for (const { baseY: y, baseX: g, matrix: b } of this._matrixByBase) {
2145
2145
  const _2 = t - y, x = e - g;
2146
2146
  if (_2 >= 0 && _2 < b.length && x >= 0 && x < b[_2].length) {
2147
2147
  const w2 = b[_2][x];
2148
2148
  let E;
2149
- this._initFlattenAs ? E = { [this._initFlattenAs]: w2 } : E = w2, m = m ? { ...E, ...m } : E;
2149
+ this._initFlattenAs ? E = { [this._initFlattenAs]: w2 } : E = w2, p = p ? { ...E, ...p } : E;
2150
2150
  break;
2151
2151
  }
2152
2152
  }
2153
2153
  o = {
2154
2154
  ...this._common,
2155
2155
  ...d,
2156
- ...p,
2157
2156
  ...m,
2158
- ...Y._stack(this._common, d, p, m)
2157
+ ...p,
2158
+ ...Y._stack(this._common, d, m, p)
2159
2159
  };
2160
2160
  }
2161
2161
  (h = (l = o == null ? void 0 : o.value) == null ? void 0 : l.startsWith) != null && h.call(l, "=") && ((o == null ? void 0 : o.formulaEnabled) ?? true) && this.idsToBeIdentified.push(s), t === 0 ? o.width == null && (o.width = he) : e === 0 ? (o.height == null && (o.height = rt), o.height !== (this.defaultRowHeight || rt) && this._rowHeightOverrides.set(t, o.height), o.filtered && this._filteredRows.add(t)) : (delete o.height, delete o.width, delete o.label), o = (this.policies[o.policy ?? ""] ?? this.defaultPolicy).deserializeValue(o.value, o) ?? {}, this.registry.systems[s] = { ...this.registry.systems[s], id: s, changedTime: n, sheetId: this.id }, this.registry.data[s] = o;
@@ -2230,8 +2230,8 @@ let Y$1 = class Y {
2230
2230
  }
2231
2231
  }
2232
2232
  getRectSize({ top: t, left: e, bottom: s, right: i }) {
2233
- var d, p;
2234
- const n = e || 1, o = t || 1, a = ((d = this.registry.systems[this.getId({ y: 0, x: i })]) == null ? void 0 : d.offsetLeft) ?? 0, l = ((p = this.registry.systems[this.getId({ y: 0, x: n })]) == null ? void 0 : p.offsetLeft) ?? 0, h = this.getOffsetTop(s), u = this.getOffsetTop(o), c = Math.max(0, a - l), f = Math.max(0, h - u);
2233
+ var d, m;
2234
+ const n = e || 1, o = t || 1, a = ((d = this.registry.systems[this.getId({ y: 0, x: i })]) == null ? void 0 : d.offsetLeft) ?? 0, l = ((m = this.registry.systems[this.getId({ y: 0, x: n })]) == null ? void 0 : m.offsetLeft) ?? 0, h = this.getOffsetTop(s), u = this.getOffsetTop(o), c = Math.max(0, a - l), f = Math.max(0, h - u);
2235
2235
  return { y: o, x: n, height: f, width: c };
2236
2236
  }
2237
2237
  /** @internal */
@@ -2419,8 +2419,8 @@ let Y$1 = class Y {
2419
2419
  throw new S$1("#REF!", "References are circulating.");
2420
2420
  const d = this.getCell({ y: e, x: c }, { resolution: a, raise: l }) ?? {};
2421
2421
  if (h(d)) {
2422
- let p = d.value;
2423
- u && (p = this.getPolicy({ y: e, x: c }).toScalar({ value: d.value, cell: d, sheet: this, point: { y: e, x: c } })), t[e - s][c - i] = p;
2422
+ let m = d.value;
2423
+ u && (m = this.getPolicy({ y: e, x: c }).toScalar({ value: d.value, cell: d, sheet: this, point: { y: e, x: c } })), t[e - s][c - i] = m;
2424
2424
  }
2425
2425
  }
2426
2426
  }
@@ -2459,12 +2459,12 @@ let Y$1 = class Y {
2459
2459
  onProgress: l,
2460
2460
  yieldControl: h
2461
2461
  } = {}) {
2462
- const { top: u, left: c, bottom: f, right: d } = t ?? this.area, p = Math.max(0, f - u + 1), m = Jt(p, d - c + 1), y = h ?? (() => Promise.resolve());
2463
- l == null || l({ done: 0, total: p });
2462
+ const { top: u, left: c, bottom: f, right: d } = t ?? this.area, m = Math.max(0, f - u + 1), p = Jt(m, d - c + 1), y = h ?? (() => Promise.resolve());
2463
+ l == null || l({ done: 0, total: m });
2464
2464
  let g = Date.now(), b = 0;
2465
2465
  for (let _2 = u; _2 <= f; _2++)
2466
- this._fillValueRow(m, _2, { top: u, left: c, right: d, at: e, resolution: s, raise: i, filter: n, asScalar: o }), b++, Date.now() - g >= a && (l == null || l({ done: b, total: p }), await y(), g = Date.now());
2467
- return l == null || l({ done: p, total: p }), m;
2466
+ this._fillValueRow(p, _2, { top: u, left: c, right: d, at: e, resolution: s, raise: i, filter: n, asScalar: o }), b++, Date.now() - g >= a && (l == null || l({ done: b, total: m }), await y(), g = Date.now());
2467
+ return l == null || l({ done: m, total: m }), p;
2468
2468
  }
2469
2469
  /** @internal */
2470
2470
  _pushHistory(t) {
@@ -2548,28 +2548,28 @@ let Y$1 = class Y {
2548
2548
  const { top: n, left: o, bottom: a, right: l } = e, { top: h, left: u } = i, c = s.numRows, f = s.numCols, d = [];
2549
2549
  for (let x = n; x <= a; x++)
2550
2550
  t.isRowFiltered(x) || d.push(x);
2551
- const p = l - o + 1, m = d.length, y = [];
2551
+ const m = l - o + 1, p = d.length, y = [];
2552
2552
  {
2553
2553
  let x = 0, w2 = h;
2554
- for (; x < m; )
2554
+ for (; x < p; )
2555
2555
  s.isRowFiltered(w2) || (y.push(w2), x++), w2++;
2556
2556
  }
2557
2557
  const g = /* @__PURE__ */ new Set();
2558
- for (let x = 0; x < m; x++)
2559
- for (let w2 = 0; w2 < p; w2++)
2558
+ for (let x = 0; x < p; x++)
2559
+ for (let w2 = 0; w2 < m; w2++)
2560
2560
  g.add(M({ y: d[x], x: o + w2 }));
2561
2561
  const b = /* @__PURE__ */ new Set();
2562
- for (let x = 0; x < m; x++) {
2562
+ for (let x = 0; x < p; x++) {
2563
2563
  const w2 = y[x];
2564
- for (let E = 0; E < p; E++) {
2564
+ for (let E = 0; E < m; E++) {
2565
2565
  const D = u + E;
2566
2566
  w2 <= c && D <= f && b.add(M({ y: w2, x: D }));
2567
2567
  }
2568
2568
  }
2569
2569
  const _2 = [];
2570
- for (let x = 0; x < m; x++) {
2570
+ for (let x = 0; x < p; x++) {
2571
2571
  const w2 = d[x], E = y[x];
2572
- for (let D = 0; D < p; D++) {
2572
+ for (let D = 0; D < m; D++) {
2573
2573
  const k2 = o + D, N = u + D, B2 = M({ y: w2, x: k2 }), Z2 = E <= c && N <= f, q2 = Z2 ? M({ y: E, x: N }) : void 0;
2574
2574
  let C;
2575
2575
  t === s && b.has(B2) || (C = t._generateId());
@@ -2615,7 +2615,7 @@ let Y$1 = class Y {
2615
2615
  const o = {}, a = new wt(e), l = {}, h = [], u = [];
2616
2616
  if (i)
2617
2617
  for (const {
2618
- before: m,
2618
+ before: p,
2619
2619
  after: y,
2620
2620
  src: g,
2621
2621
  dst: b,
@@ -2640,7 +2640,7 @@ let Y$1 = class Y {
2640
2640
  }
2641
2641
  else
2642
2642
  for (const {
2643
- before: m,
2643
+ before: p,
2644
2644
  after: y,
2645
2645
  src: g,
2646
2646
  dst: b,
@@ -2650,7 +2650,7 @@ let Y$1 = class Y {
2650
2650
  const w2 = T(g), E = t.getId(w2), D = b != null ? T(b) : void 0, k2 = D != null ? e.getId(D) : void 0, N = E != null ? t.registry.data[E] : void 0, B2 = k2 != null ? e.registry.data[k2] : void 0;
2651
2651
  if (!(n === "USER" && (F(N == null ? void 0 : N.prevention, Ut) || F(B2 == null ? void 0 : B2.prevention, Vt)))) {
2652
2652
  if (_2 != null) {
2653
- const Z2 = m || Nt, C = (t.policies[Z2] ?? t.defaultPolicy).select({
2653
+ const Z2 = p || Nt, C = (t.policies[Z2] ?? t.defaultPolicy).select({
2654
2654
  sheet: t,
2655
2655
  point: w2,
2656
2656
  next: { value: null },
@@ -2659,11 +2659,11 @@ let Y$1 = class Y {
2659
2659
  });
2660
2660
  l[_2] = {
2661
2661
  ...C,
2662
- policy: m
2662
+ policy: p
2663
2663
  }, this.registry.systems[_2] = { id: _2, sheetId: t.id, changedTime: Date.now() }, h.push({ y: w2.y, x: w2.x, id: _2 });
2664
2664
  }
2665
2665
  if (k2 != null && D != null && b != null) {
2666
- const Z2 = y || Nt, q2 = m || Nt, C = e.policies[Z2] ?? e.defaultPolicy, v = t.policies[q2] ?? t.defaultPolicy, X = v.priority > C.priority, U2 = (X ? v : C).select({
2666
+ const Z2 = y || Nt, q2 = p || Nt, C = e.policies[Z2] ?? e.defaultPolicy, v = t.policies[q2] ?? t.defaultPolicy, X = v.priority > C.priority, U2 = (X ? v : C).select({
2667
2667
  sheet: e,
2668
2668
  point: D,
2669
2669
  next: N,
@@ -2673,7 +2673,7 @@ let Y$1 = class Y {
2673
2673
  if (U2 && (o[E] = N ?? {}, l[E] = {
2674
2674
  ...N,
2675
2675
  ...U2,
2676
- policy: X ? m : y
2676
+ policy: X ? p : y
2677
2677
  }), N != null) {
2678
2678
  const K = this.registry.systems[E];
2679
2679
  K && (K.changedTime = Date.now());
@@ -2685,21 +2685,21 @@ let Y$1 = class Y {
2685
2685
  i || (t._materializeIdMatrix(), t !== e && e._materializeIdMatrix());
2686
2686
  const c = i ? null : t.idMatrix.flat(), f = !i && t !== e ? e.idMatrix.flat() : null;
2687
2687
  Object.assign(this.registry.data, l);
2688
- for (const { y: m, x: y, id: g } of h)
2689
- t._ensureIdRow(m)[y] = g;
2690
- for (const { y: m, x: y, id: g } of u)
2691
- e._ensureIdRow(m)[y] = g;
2692
- const d = s.filter((m) => m.dst != null).map((m) => m.dst), p = s.map((m) => m.src);
2693
- if (t === e ? e.lastChangedAddresses = [.../* @__PURE__ */ new Set([...p, ...d])] : (e.lastChangedAddresses = d, t.lastChangedAddresses = p), !i) {
2688
+ for (const { y: p, x: y, id: g } of h)
2689
+ t._ensureIdRow(p)[y] = g;
2690
+ for (const { y: p, x: y, id: g } of u)
2691
+ e._ensureIdRow(p)[y] = g;
2692
+ const d = s.filter((p) => p.dst != null).map((p) => p.dst), m = s.map((p) => p.src);
2693
+ if (t === e ? e.lastChangedAddresses = [.../* @__PURE__ */ new Set([...m, ...d])] : (e.lastChangedAddresses = d, t.lastChangedAddresses = m), !i) {
2694
2694
  a.buildMap(c.flat(), t.idMatrix.flat()), t !== e && a.buildMap(f.flat(), e.idMatrix.flat());
2695
- const m = a.resolveDependents("move");
2696
- Object.assign(o, m);
2695
+ const p = a.resolveDependents("move");
2696
+ Object.assign(o, p);
2697
2697
  }
2698
2698
  return { diffBefore: o, diffAfter: {} };
2699
2699
  }
2700
2700
  /** Build the paste (copy) diff without applying it. Shared by copy()/copyAsync(). @internal */
2701
2701
  _buildCopyDiff({ srcSheet: t = this, src: e, dst: s, onlyValue: i = false }) {
2702
- const n = t !== this, { top: o, left: a, bottom: l, right: h } = e, { top: u, left: c, bottom: f, right: d } = s, p = {}, m = Date.now(), y = [];
2702
+ const n = t !== this, { top: o, left: a, bottom: l, right: h } = e, { top: u, left: c, bottom: f, right: d } = s, m = {}, p = Date.now(), y = [];
2703
2703
  for (let w2 = o; w2 <= l; w2++)
2704
2704
  t.isRowFiltered(w2) || y.push(w2);
2705
2705
  const g = [];
@@ -2723,16 +2723,16 @@ let Y$1 = class Y {
2723
2723
  slideY: Z2,
2724
2724
  slideX: q2
2725
2725
  }) : C == null ? void 0 : C.value, P = this.getId(v), et = this.registry.systems[P];
2726
- et != null && (et.changedTime = m);
2726
+ et != null && (et.changedTime = p);
2727
2727
  const yt = M(v);
2728
2728
  if (i) {
2729
2729
  const $ = this.getCell(v, { resolution: "SYSTEM" });
2730
2730
  C.style = $ == null ? void 0 : $.style, C.justifyContent = $ == null ? void 0 : $.justifyContent, C.alignItems = $ == null ? void 0 : $.alignItems;
2731
2731
  }
2732
- p[yt] = { ...C, value: Tt };
2732
+ m[yt] = { ...C, value: Tt };
2733
2733
  }
2734
2734
  }
2735
- return p;
2735
+ return m;
2736
2736
  }
2737
2737
  copy(t) {
2738
2738
  const { operator: e = "SYSTEM", undoReflection: s, redoReflection: i } = t;
@@ -2754,8 +2754,8 @@ let Y$1 = class Y {
2754
2754
  * target) never reads an already-pasted value. @internal
2755
2755
  */
2756
2756
  async copyAsync(t, e) {
2757
- const { srcSheet: s = this, src: i, dst: n, onlyValue: o = false, operator: a = "SYSTEM", undoReflection: l, redoReflection: h } = t, { onProgress: u, yieldControl: c, frameBudgetMs: f = 12 } = e, d = c ?? (() => Promise.resolve()), p = s !== this, { top: m, left: y, bottom: g, right: b } = i, { top: _2, left: x, bottom: w2, right: E } = n, D = Date.now(), k2 = [];
2758
- for (let P = m; P <= g; P++)
2757
+ const { srcSheet: s = this, src: i, dst: n, onlyValue: o = false, operator: a = "SYSTEM", undoReflection: l, redoReflection: h } = t, { onProgress: u, yieldControl: c, frameBudgetMs: f = 12 } = e, d = c ?? (() => Promise.resolve()), m = s !== this, { top: p, left: y, bottom: g, right: b } = i, { top: _2, left: x, bottom: w2, right: E } = n, D = Date.now(), k2 = [];
2758
+ for (let P = p; P <= g; P++)
2759
2759
  s.isRowFiltered(P) || k2.push(P);
2760
2760
  const N = k2.length, B2 = b - y + 1, Z2 = E - x + 1, q2 = [], C = [];
2761
2761
  for (let P = 0; P < N; P++) {
@@ -2789,7 +2789,7 @@ let Y$1 = class Y {
2789
2789
  const ot = x + $;
2790
2790
  if (ot > this.numCols)
2791
2791
  continue;
2792
- const gt = $ % B2, xs = y + gt, bs = p ? 0 : P - yt, Ss = p ? 0 : ot - xs, J2 = q2[et][gt], Xt = { y: P, x: ot }, Mt = this.getId(Xt), H = this.registry.data[Mt] ?? this.getCell(Xt, { resolution: "SYSTEM" }), _s = (H == null ? void 0 : H.policy) == null ? this.defaultPolicy : this.policies[H.policy] ?? this.defaultPolicy, Rs = C[et][gt].priority > _s.priority;
2792
+ const gt = $ % B2, xs = y + gt, bs = m ? 0 : P - yt, Ss = m ? 0 : ot - xs, J2 = q2[et][gt], Xt = { y: P, x: ot }, Mt = this.getId(Xt), H = this.registry.data[Mt] ?? this.getCell(Xt, { resolution: "SYSTEM" }), _s = (H == null ? void 0 : H.policy) == null ? this.defaultPolicy : this.policies[H.policy] ?? this.defaultPolicy, Rs = C[et][gt].priority > _s.priority;
2793
2793
  this.clearDependencies(Mt);
2794
2794
  const jt = J2 == null ? void 0 : J2.value, Es = typeof jt == "string" && jt.charCodeAt(0) === 61 && ((J2 == null ? void 0 : J2.formulaEnabled) ?? true) ? this.processFormula(jt, { dependency: Mt, slideY: bs, slideX: Ss }) : jt, ke = this.registry.systems[Mt];
2795
2795
  ke != null && (ke.changedTime = D);
@@ -2850,14 +2850,14 @@ let Y$1 = class Y {
2850
2850
  * never diverge. Returns whether this cell triggered a resize. @internal
2851
2851
  */
2852
2852
  _applyUpdateCell(t, e, s, i, n, o, a = false) {
2853
- var f, d, p, m, y;
2853
+ var f, d, m, p, y;
2854
2854
  const l = this.registry.data[e];
2855
2855
  if (n.operator === "USER" && F(l == null ? void 0 : l.prevention, xt))
2856
2856
  return false;
2857
2857
  let h = a ? i : { ...i };
2858
2858
  n.formulaIdentify && "value" in h && (h.formulaEnabled ?? (l == null ? void 0 : l.formulaEnabled) ?? true) && (this.clearDependencies(e), h.value = this.processFormula(h.value, { dependency: e })), n.ignoreFields.forEach((g) => {
2859
2859
  h[g] = l == null ? void 0 : l[g];
2860
- }), n.operator === "USER" && F(l == null ? void 0 : l.prevention, St) && delete h.value, n.operator === "USER" && F(l == null ? void 0 : l.prevention, ae$1) && ((f = h == null ? void 0 : h.style) == null || delete f.justifyContent, (d = h == null ? void 0 : h.style) == null || delete d.alignItems), n.operator === "USER" && F(l == null ? void 0 : l.prevention, ce$1) && ((p = h == null ? void 0 : h.style) == null || delete p.width, (m = h == null ? void 0 : h.style) == null || delete m.height);
2860
+ }), n.operator === "USER" && F(l == null ? void 0 : l.prevention, St) && delete h.value, n.operator === "USER" && F(l == null ? void 0 : l.prevention, ae$1) && ((f = h == null ? void 0 : h.style) == null || delete f.justifyContent, (d = h == null ? void 0 : h.style) == null || delete d.alignItems), n.operator === "USER" && F(l == null ? void 0 : l.prevention, ce$1) && ((m = h == null ? void 0 : h.style) == null || delete m.width, (p = h == null ? void 0 : h.style) == null || delete p.height);
2861
2861
  let u = false;
2862
2862
  if ((h.width != null || h.height != null) && (u = true), o.diffBefore[e] = l ?? {}, h = (this.policies[(l == null ? void 0 : l.policy) || Nt] ?? this.defaultPolicy).select({ sheet: this, point: t, next: h, current: l, operation: n.op }) ?? h, n.updateChangedTime) {
2863
2863
  const g = this.registry.systems[e];
@@ -2927,7 +2927,7 @@ let Y$1 = class Y {
2927
2927
  yieldControl: c,
2928
2928
  frameBudgetMs: f = 12
2929
2929
  }) {
2930
- const d = { diffBefore: {}, diffAfter: {}, changedAddresses: [] }, p = {
2930
+ const d = { diffBefore: {}, diffAfter: {}, changedAddresses: [] }, m = {
2931
2931
  partial: e,
2932
2932
  updateChangedTime: s,
2933
2933
  ignoreFields: a,
@@ -2935,12 +2935,12 @@ let Y$1 = class Y {
2935
2935
  op: o,
2936
2936
  formulaIdentify: true,
2937
2937
  changedTime: Date.now()
2938
- }, m = Object.keys(t), y = m.length, g = c ?? (() => Promise.resolve());
2938
+ }, p = Object.keys(t), y = p.length, g = c ?? (() => Promise.resolve());
2939
2939
  let b = false, _2 = Date.now();
2940
2940
  u == null || u({ done: 0, total: y });
2941
2941
  for (let x = 0; x < y; x++) {
2942
- const w2 = m[x], E = T(w2);
2943
- this._applyUpdateCell(E, this.getId(E), w2, t[w2], p, d) && (b = true), Date.now() - _2 >= f && (u == null || u({ done: x + 1, total: y }), await g(), _2 = Date.now());
2942
+ const w2 = p[x], E = T(w2);
2943
+ this._applyUpdateCell(E, this.getId(E), w2, t[w2], m, d) && (b = true), Date.now() - _2 >= f && (u == null || u({ done: x + 1, total: y }), await g(), _2 = Date.now());
2944
2944
  }
2945
2945
  return this.lastChangedAddresses = d.changedAddresses, u == null || u({ done: y, total: y }), i && this._pushHistory({
2946
2946
  applyed: true,
@@ -2972,12 +2972,12 @@ let Y$1 = class Y {
2972
2972
  d++;
2973
2973
  continue;
2974
2974
  }
2975
- e[f].forEach((m, y) => {
2975
+ e[f].forEach((p, y) => {
2976
2976
  const g = u + y;
2977
2977
  if (g > this.right)
2978
2978
  return;
2979
- const b = { y: d, x: g }, _2 = this.parse(b, m.value ?? "");
2980
- if (_2.style = { ...m.style, ..._2.style }, n) {
2979
+ const b = { y: d, x: g }, _2 = this.parse(b, p.value ?? "");
2980
+ if (_2.style = { ...p.style, ..._2.style }, n) {
2981
2981
  const x = this.getCell(b, { resolution: "SYSTEM" });
2982
2982
  _2.style = x == null ? void 0 : x.style, _2.justifyContent = x == null ? void 0 : x.justifyContent, _2.alignItems = x == null ? void 0 : x.alignItems;
2983
2983
  }
@@ -3026,14 +3026,14 @@ let Y$1 = class Y {
3026
3026
  return console.error(`Rows are limited to ${this.maxNumRows}.`), this;
3027
3027
  const u = this.numCols, c = [], f = Date.now();
3028
3028
  for (let d = 0; d < e; d++) {
3029
- const p = [];
3030
- for (let m = 0; m <= u; m++) {
3029
+ const m = [];
3030
+ for (let p = 0; p <= u; p++) {
3031
3031
  const y = this._generateId();
3032
- p.push(y);
3033
- const g = this.getCell({ y: s, x: m }, { resolution: "SYSTEM" }), b = this._copyCellLayout(g);
3032
+ m.push(y);
3033
+ const g = this.getCell({ y: s, x: p }, { resolution: "SYSTEM" }), b = this._copyCellLayout(g);
3034
3034
  this.registry.data[y] = { ...b }, this.registry.systems[y] = { id: y, sheetId: this.id, changedTime: f };
3035
3035
  }
3036
- c.push(p);
3036
+ c.push(m);
3037
3037
  }
3038
3038
  if (this.idMatrix.splice(t, 0, ...c), this.area.bottom += e, this._shiftRowMetaForInsert(t, e), this._seedRowMeta(t, e), this._pushHistory({
3039
3039
  applyed: true,
@@ -3075,8 +3075,8 @@ let Y$1 = class Y {
3075
3075
  if (s === "USER" && F(f == null ? void 0 : f.prevention, ne$1))
3076
3076
  return console.warn(`Cannot delete row ${c}.`), this;
3077
3077
  for (let d = 1; d <= this.numCols; d++) {
3078
- const p = this.getId({ y: c, x: d });
3079
- p != null && (o.collectDependents(p), o.map[p] = this.getId({ y: c + e, x: d }));
3078
+ const m = this.getId({ y: c, x: d });
3079
+ m != null && (o.collectDependents(m), o.map[m] = this.getId({ y: c + e, x: d }));
3080
3080
  }
3081
3081
  a.unshift(c);
3082
3082
  }
@@ -3122,14 +3122,14 @@ let Y$1 = class Y {
3122
3122
  return console.error(`Columns are limited to ${this.maxNumCols}.`), this;
3123
3123
  const u = this.numRows, c = [], f = Date.now();
3124
3124
  for (let d = 0; d <= u; d++) {
3125
- const p = [];
3126
- for (let m = 0; m < e; m++) {
3125
+ const m = [];
3126
+ for (let p = 0; p < e; p++) {
3127
3127
  const y = this._generateId();
3128
- p.push(y);
3128
+ m.push(y);
3129
3129
  const g = this.getCell({ y: d, x: s }, { resolution: "SYSTEM" }), b = this._copyCellLayout(g);
3130
3130
  this._ensureIdRow(d).splice(t, 0, y), this.registry.data[y] = { ...b }, this.registry.systems[y] = { id: y, sheetId: this.id, changedTime: f };
3131
3131
  }
3132
- c.push(p);
3132
+ c.push(m);
3133
3133
  }
3134
3134
  if (this.area.right += e, this._pushHistory({
3135
3135
  applyed: true,
@@ -3173,8 +3173,8 @@ let Y$1 = class Y {
3173
3173
  continue;
3174
3174
  }
3175
3175
  for (let d = 1; d <= this.numRows; d++) {
3176
- const p = this.getId({ y: d, x: c });
3177
- p != null && (o.collectDependents(p), o.map[p] = this.getId({ y: d, x: c + e }));
3176
+ const m = this.getId({ y: d, x: c });
3177
+ m != null && (o.collectDependents(m), o.map[m] = this.getId({ y: d, x: c + e }));
3178
3178
  }
3179
3179
  a.unshift(c);
3180
3180
  }
@@ -3688,12 +3688,12 @@ const we = ({ value: r, sheet: t, point: e, raise: s = true, resolution: i = "RE
3688
3688
  if (d != null)
3689
3689
  return d;
3690
3690
  r.setSolvingCache(c);
3691
- const p = we({ value: l, sheet: r, point: c, raise: t, at: e, resolution: "RESOLVED" });
3692
- return r.finishSolvedCache(c, p), p;
3693
- } catch (p) {
3694
- if (r.finishSolvedCache(c, p), t)
3695
- throw p;
3696
- return p;
3691
+ const m = we({ value: l, sheet: r, point: c, raise: t, at: e, resolution: "RESOLVED" });
3692
+ return r.finishSolvedCache(c, m), m;
3693
+ } catch (m) {
3694
+ if (r.finishSolvedCache(c, m), t)
3695
+ throw m;
3696
+ return m;
3697
3697
  }
3698
3698
  });
3699
3699
  });
@@ -3736,7 +3736,8 @@ const we = ({ value: r, sheet: t, point: e, raise: s = true, resolution: i = "RE
3736
3736
  const c = i.data[t];
3737
3737
  c != null && ee$1(c, e, { value: u, expireTime: h.expireTime });
3738
3738
  }).finally(() => {
3739
- i.asyncPending.delete(a);
3739
+ var u;
3740
+ i.asyncPending.delete(a), (u = i.onAsyncResolve) == null || u.call(i, t);
3740
3741
  }), h.pending;
3741
3742
  }
3742
3743
  return xe;
@@ -3750,7 +3751,8 @@ const we = ({ value: r, sheet: t, point: e, raise: s = true, resolution: i = "RE
3750
3751
  const c = o.data[e];
3751
3752
  c != null && ee$1(c, s, { value: u, expireTime: a });
3752
3753
  }).finally(() => {
3753
- o.asyncPending.delete(l), n && o.asyncInflight && o.asyncInflight.delete(s), o.solvedCaches.clear(), o.transmit();
3754
+ var u;
3755
+ o.asyncPending.delete(l), n && o.asyncInflight && o.asyncInflight.delete(s), (u = o.onAsyncResolve) == null || u.call(o, e), o.solvedCaches.clear(), o.transmit();
3754
3756
  }), h;
3755
3757
  }, de$1 = () => new L(Promise.resolve()), Me = (r, t) => {
3756
3758
  if (typeof r == "string" || typeof t == "string")
@@ -4130,10 +4132,10 @@ const vi = /^(<=|>=|<>|>|<|=)?(.*)$/, ki = (r, t) => {
4130
4132
  for (let h = 0; h < n; h++) {
4131
4133
  const u = [];
4132
4134
  for (let c = 0; c < o; c++) {
4133
- const f = i.map((d, p) => {
4135
+ const f = i.map((d, m) => {
4134
4136
  var y;
4135
- const m = s[p];
4136
- return m ? ((y = m == null ? void 0 : m[h]) == null ? void 0 : y[c]) ?? null : d;
4137
+ const p = s[m];
4138
+ return p ? ((y = p == null ? void 0 : p[h]) == null ? void 0 : y[c]) ?? null : d;
4137
4139
  });
4138
4140
  try {
4139
4141
  if (Ci(f))
@@ -4769,7 +4771,8 @@ class Hr {
4769
4771
  onSelect: u,
4770
4772
  onKeyUp: c,
4771
4773
  onInit: f,
4772
- onFormula: d
4774
+ onFormula: d,
4775
+ onAsyncResolve: m
4773
4776
  } = {}) {
4774
4777
  this.sheetHead = 0, this.cellHead = 0, this.data = {}, this.systems = {}, this.sheetIdsByName = {}, this.contextsBySheetId = {}, this.choosingSheetId = 0, this.choosingAddress = "", this.editingSheetId = 0, this.editingAddress = "", this.paletteBySheetName = {}, this.lastFocused = null, this.solvedCaches = /* @__PURE__ */ new Map(), this.lastSpilledTargetIds = /* @__PURE__ */ new Set(), this.asyncFormulaCells = /* @__PURE__ */ new Set(), this.asyncPending = /* @__PURE__ */ new Map(), this.copyingSheetId = 0, this.copyingZone = Ms, this.cutting = false, this.histories = [], this.historyIndex = -1, this.historyLimit = Cs, this._componentSheetIds = /* @__PURE__ */ new Map(), this.ready = false, this.functions = {}, this.policies = {}, this.transmit = (p) => {
4775
4778
  }, this.updateSheet = (p) => ({ type: 0, value: p }), t != null && (this.historyLimit = t), this.functions = {
@@ -4777,10 +4780,10 @@ class Hr {
4777
4780
  ...e
4778
4781
  };
4779
4782
  for (const p in this.functions) {
4780
- const m = this.functions[p];
4781
- m.__name = p;
4783
+ const y = this.functions[p];
4784
+ y.__name = p;
4782
4785
  }
4783
- this.policies = s, this.onSave = i, this.onChange = n, this.onRemoveRows = o, this.onRemoveCols = a, this.onInsertRows = l, this.onInsertCols = h, this.onSelect = u, this.onKeyUp = c, this.onInit = f, this.onFormula = d;
4786
+ this.policies = s, this.onSave = i, this.onChange = n, this.onRemoveRows = o, this.onRemoveCols = a, this.onInsertRows = l, this.onInsertCols = h, this.onSelect = u, this.onKeyUp = c, this.onInit = f, this.onFormula = d, this.onAsyncResolve = m;
4784
4787
  }
4785
4788
  boot() {
4786
4789
  if (this.ready || Object.keys(this.contextsBySheetId).length === 0)
@@ -4855,14 +4858,14 @@ class Hn {
4855
4858
  var c, f;
4856
4859
  const [t, e] = Ze[this.direction], { top: s, left: i, bottom: n, right: o } = this.src, a = Jt(n - s + 1, o - i + 1);
4857
4860
  for (let d = s; d <= n; d++)
4858
- for (let p = i; p <= o; p++)
4859
- a[d - s][p - i] = this.sheet.getCell({ y: d, x: p }, { resolution: "SYSTEM" }) ?? null;
4861
+ for (let m = i; m <= o; m++)
4862
+ a[d - s][m - i] = this.sheet.getCell({ y: d, x: m }, { resolution: "SYSTEM" }) ?? null;
4860
4863
  const l = me$1(this.src), h = me$1(this.dst), u = {};
4861
4864
  if (t === "horizontal")
4862
4865
  for (let d = 0; d < h.rows; d++) {
4863
- const p = this.getChangePatterns(a[d], "");
4864
- for (let m = 0; m < h.cols; m++) {
4865
- const y = (c = a[d % l.rows]) == null ? void 0 : c[m % l.cols], g = e > 0 ? this.dst.left + m : this.dst.right - m, b = e > 0 ? m % l.cols : (l.cols - 1 - m % l.cols) % l.cols, _2 = { y: this.dst.top + d, x: g }, x = this.sheet.getId(_2), w2 = p[b].next().value, E = (y == null ? void 0 : y.formulaEnabled) ?? true ? this.sheet.processFormula(w2, {
4866
+ const m = this.getChangePatterns(a[d], "");
4867
+ for (let p = 0; p < h.cols; p++) {
4868
+ const y = (c = a[d % l.rows]) == null ? void 0 : c[p % l.cols], g = e > 0 ? this.dst.left + p : this.dst.right - p, b = e > 0 ? p % l.cols : (l.cols - 1 - p % l.cols) % l.cols, _2 = { y: this.dst.top + d, x: g }, x = this.sheet.getId(_2), w2 = m[b].next().value, E = (y == null ? void 0 : y.formulaEnabled) ?? true ? this.sheet.processFormula(w2, {
4866
4869
  dependency: x
4867
4870
  }) : w2;
4868
4871
  u[M(_2)] = {
@@ -4873,12 +4876,12 @@ class Hn {
4873
4876
  }
4874
4877
  else if (t === "vertical")
4875
4878
  for (let d = 0; d < h.cols; d++) {
4876
- const p = this.getChangePatterns(
4877
- a.map((m) => m[d]),
4879
+ const m = this.getChangePatterns(
4880
+ a.map((p) => p[d]),
4878
4881
  ""
4879
4882
  );
4880
- for (let m = 0; m < h.rows; m++) {
4881
- const y = (f = a[m % l.rows]) == null ? void 0 : f[d % l.cols], g = e > 0 ? this.dst.top + m : this.dst.bottom - m, b = e > 0 ? m % l.rows : (l.rows - 1 - m % l.rows) % l.rows, _2 = p[b].next().value;
4883
+ for (let p = 0; p < h.rows; p++) {
4884
+ const y = (f = a[p % l.rows]) == null ? void 0 : f[d % l.cols], g = e > 0 ? this.dst.top + p : this.dst.bottom - p, b = e > 0 ? p % l.rows : (l.rows - 1 - p % l.rows) % l.rows, _2 = m[b].next().value;
4882
4885
  u[M({ y: g, x: this.dst.left + d })] = { ...y, value: _2 };
4883
4886
  }
4884
4887
  }
@@ -5003,9 +5006,9 @@ class Hn {
5003
5006
  function* h() {
5004
5007
  const { prefix: c } = lt(a.first), { number: f } = lt(l);
5005
5008
  let d = f;
5006
- const p = a.numericDelta * o;
5009
+ const m = a.numericDelta * o;
5007
5010
  for (; ; )
5008
- d += p, yield `${c}${Math.abs(d)}`;
5011
+ d += m, yield `${c}${Math.abs(d)}`;
5009
5012
  }
5010
5013
  const u = h();
5011
5014
  s.push(u, ...a.nexts.map(() => u));
@@ -7188,4 +7191,4 @@ export {
7188
7191
  arrow as y,
7189
7192
  escape as z
7190
7193
  };
7191
- //# sourceMappingURL=hooks-Ij1DTX5N.mjs.map
7194
+ //# sourceMappingURL=hooks-CWD7gJMA.mjs.map