@cyca/react-timeline-editor 0.2.2-alpha.2 → 0.2.2-alpha.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.
@@ -1,23 +1,11 @@
1
- var Ze = Object.defineProperty;
2
- var Qe = (n, t, e) => t in n ? Ze(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var ot = (n, t, e) => Qe(n, typeof t != "symbol" ? t + "" : t, e);
4
- import * as Et from "react";
5
- import Mt, { useRef as V, useEffect as ht, useEffectEvent as tn, useImperativeHandle as ce, useMemo as en, useState as xt, useLayoutEffect as Gt, useCallback as nn } from "react";
6
- import { flushSync as rn } from "react-dom";
7
- var ee = { exports: {} }, It = {};
8
- /**
9
- * @license React
10
- * react-jsx-runtime.production.js
11
- *
12
- * Copyright (c) Meta Platforms, Inc. and affiliates.
13
- *
14
- * This source code is licensed under the MIT license found in the
15
- * LICENSE file in the root directory of this source tree.
16
- */
17
- var le;
18
- function sn() {
19
- if (le) return It;
20
- le = 1;
1
+ import * as Jt from "react";
2
+ import Zt, { useRef as Q, useEffect as Vt, useEffectEvent as Zn, useImperativeHandle as nn, useState as ne, useLayoutEffect as $e, useCallback as Qn } from "react";
3
+ import { flushSync as tr } from "react-dom";
4
+ var Le = { exports: {} }, Re = {};
5
+ var sn;
6
+ function er() {
7
+ if (sn) return Re;
8
+ sn = 1;
21
9
  var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
22
10
  function e(r, s, i) {
23
11
  var o = null;
@@ -34,289 +22,283 @@ function sn() {
34
22
  props: i
35
23
  };
36
24
  }
37
- return It.Fragment = t, It.jsx = e, It.jsxs = e, It;
38
- }
39
- var Pt = {};
40
- /**
41
- * @license React
42
- * react-jsx-runtime.development.js
43
- *
44
- * Copyright (c) Meta Platforms, Inc. and affiliates.
45
- *
46
- * This source code is licensed under the MIT license found in the
47
- * LICENSE file in the root directory of this source tree.
48
- */
49
- var ue;
50
- function on() {
51
- return ue || (ue = 1, process.env.NODE_ENV !== "production" && function() {
52
- function n(f) {
53
- if (f == null) return null;
54
- if (typeof f == "function")
55
- return f.$$typeof === j ? null : f.displayName || f.name || null;
56
- if (typeof f == "string") return f;
57
- switch (f) {
58
- case m:
25
+ return Re.Fragment = t, Re.jsx = e, Re.jsxs = e, Re;
26
+ }
27
+ var Te = {};
28
+ var on;
29
+ function nr() {
30
+ return on || (on = 1, process.env.NODE_ENV !== "production" && (function() {
31
+ function n(u) {
32
+ if (u == null) return null;
33
+ if (typeof u == "function")
34
+ return u.$$typeof === X ? null : u.displayName || u.name || null;
35
+ if (typeof u == "string") return u;
36
+ switch (u) {
37
+ case b:
59
38
  return "Fragment";
60
- case v:
61
- return "Profiler";
62
39
  case h:
40
+ return "Profiler";
41
+ case w:
63
42
  return "StrictMode";
64
- case C:
43
+ case y:
65
44
  return "Suspense";
66
- case I:
45
+ case E:
67
46
  return "SuspenseList";
68
- case L:
47
+ case H:
69
48
  return "Activity";
70
49
  }
71
- if (typeof f == "object")
72
- switch (typeof f.tag == "number" && console.error(
50
+ if (typeof u == "object")
51
+ switch (typeof u.tag == "number" && console.error(
73
52
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
74
- ), f.$$typeof) {
75
- case y:
53
+ ), u.$$typeof) {
54
+ case p:
76
55
  return "Portal";
77
- case T:
78
- return f.displayName || "Context";
56
+ case O:
57
+ return u.displayName || "Context";
79
58
  case x:
80
- return (f._context.displayName || "Context") + ".Consumer";
81
- case b:
82
- var A = f.render;
83
- return f = f.displayName, f || (f = A.displayName || A.name || "", f = f !== "" ? "ForwardRef(" + f + ")" : "ForwardRef"), f;
84
- case k:
85
- return A = f.displayName || null, A !== null ? A : n(f.type) || "Memo";
86
- case N:
87
- A = f._payload, f = f._init;
59
+ return (u._context.displayName || "Context") + ".Consumer";
60
+ case _:
61
+ var T = u.render;
62
+ return u = u.displayName, u || (u = T.displayName || T.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
63
+ case P:
64
+ return T = u.displayName || null, T !== null ? T : n(u.type) || "Memo";
65
+ case C:
66
+ T = u._payload, u = u._init;
88
67
  try {
89
- return n(f(A));
68
+ return n(u(T));
90
69
  } catch {
91
70
  }
92
71
  }
93
72
  return null;
94
73
  }
95
- function t(f) {
96
- return "" + f;
74
+ function t(u) {
75
+ return "" + u;
97
76
  }
98
- function e(f) {
77
+ function e(u) {
99
78
  try {
100
- t(f);
101
- var A = !1;
79
+ t(u);
80
+ var T = !1;
102
81
  } catch {
103
- A = !0;
82
+ T = !0;
104
83
  }
105
- if (A) {
106
- A = console;
107
- var d = A.error, _ = typeof Symbol == "function" && Symbol.toStringTag && f[Symbol.toStringTag] || f.constructor.name || "Object";
108
- return d.call(
109
- A,
84
+ if (T) {
85
+ T = console;
86
+ var I = T.error, V = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
87
+ return I.call(
88
+ T,
110
89
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
111
- _
112
- ), t(f);
90
+ V
91
+ ), t(u);
113
92
  }
114
93
  }
115
- function r(f) {
116
- if (f === m) return "<>";
117
- if (typeof f == "object" && f !== null && f.$$typeof === N)
94
+ function r(u) {
95
+ if (u === b) return "<>";
96
+ if (typeof u == "object" && u !== null && u.$$typeof === C)
118
97
  return "<...>";
119
98
  try {
120
- var A = n(f);
121
- return A ? "<" + A + ">" : "<...>";
99
+ var T = n(u);
100
+ return T ? "<" + T + ">" : "<...>";
122
101
  } catch {
123
102
  return "<...>";
124
103
  }
125
104
  }
126
105
  function s() {
127
- var f = W.A;
128
- return f === null ? null : f.getOwner();
106
+ var u = z.A;
107
+ return u === null ? null : u.getOwner();
129
108
  }
130
109
  function i() {
131
110
  return Error("react-stack-top-frame");
132
111
  }
133
- function o(f) {
134
- if (Y.call(f, "key")) {
135
- var A = Object.getOwnPropertyDescriptor(f, "key").get;
136
- if (A && A.isReactWarning) return !1;
112
+ function o(u) {
113
+ if (F.call(u, "key")) {
114
+ var T = Object.getOwnPropertyDescriptor(u, "key").get;
115
+ if (T && T.isReactWarning) return !1;
137
116
  }
138
- return f.key !== void 0;
117
+ return u.key !== void 0;
139
118
  }
140
- function c(f, A) {
141
- function d() {
142
- U || (U = !0, console.error(
119
+ function c(u, T) {
120
+ function I() {
121
+ R || (R = !0, console.error(
143
122
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
144
- A
123
+ T
145
124
  ));
146
125
  }
147
- d.isReactWarning = !0, Object.defineProperty(f, "key", {
148
- get: d,
126
+ I.isReactWarning = !0, Object.defineProperty(u, "key", {
127
+ get: I,
149
128
  configurable: !0
150
129
  });
151
130
  }
152
- function l() {
153
- var f = n(this.type);
154
- return q[f] || (q[f] = !0, console.error(
131
+ function a() {
132
+ var u = n(this.type);
133
+ return M[u] || (M[u] = !0, console.error(
155
134
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
156
- )), f = this.props.ref, f !== void 0 ? f : null;
135
+ )), u = this.props.ref, u !== void 0 ? u : null;
157
136
  }
158
- function u(f, A, d, _, E, D) {
159
- var w = d.ref;
160
- return f = {
161
- $$typeof: S,
162
- type: f,
163
- key: A,
164
- props: d,
165
- _owner: _
166
- }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(f, "ref", {
137
+ function f(u, T, I, V, _t, vt) {
138
+ var D = I.ref;
139
+ return u = {
140
+ $$typeof: v,
141
+ type: u,
142
+ key: T,
143
+ props: I,
144
+ _owner: V
145
+ }, (D !== void 0 ? D : null) !== null ? Object.defineProperty(u, "ref", {
167
146
  enumerable: !1,
168
- get: l
169
- }) : Object.defineProperty(f, "ref", { enumerable: !1, value: null }), f._store = {}, Object.defineProperty(f._store, "validated", {
147
+ get: a
148
+ }) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
170
149
  configurable: !1,
171
150
  enumerable: !1,
172
151
  writable: !0,
173
152
  value: 0
174
- }), Object.defineProperty(f, "_debugInfo", {
153
+ }), Object.defineProperty(u, "_debugInfo", {
175
154
  configurable: !1,
176
155
  enumerable: !1,
177
156
  writable: !0,
178
157
  value: null
179
- }), Object.defineProperty(f, "_debugStack", {
158
+ }), Object.defineProperty(u, "_debugStack", {
180
159
  configurable: !1,
181
160
  enumerable: !1,
182
161
  writable: !0,
183
- value: E
184
- }), Object.defineProperty(f, "_debugTask", {
162
+ value: _t
163
+ }), Object.defineProperty(u, "_debugTask", {
185
164
  configurable: !1,
186
165
  enumerable: !1,
187
166
  writable: !0,
188
- value: D
189
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
167
+ value: vt
168
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
190
169
  }
191
- function a(f, A, d, _, E, D) {
192
- var w = A.children;
193
- if (w !== void 0)
194
- if (_)
195
- if (st(w)) {
196
- for (_ = 0; _ < w.length; _++)
197
- g(w[_]);
198
- Object.freeze && Object.freeze(w);
170
+ function l(u, T, I, V, _t, vt) {
171
+ var D = T.children;
172
+ if (D !== void 0)
173
+ if (V)
174
+ if (q(D)) {
175
+ for (V = 0; V < D.length; V++)
176
+ m(D[V]);
177
+ Object.freeze && Object.freeze(D);
199
178
  } else
200
179
  console.error(
201
180
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
202
181
  );
203
- else g(w);
204
- if (Y.call(A, "key")) {
205
- w = n(f);
206
- var X = Object.keys(A).filter(function($) {
207
- return $ !== "key";
182
+ else m(D);
183
+ if (F.call(T, "key")) {
184
+ D = n(u);
185
+ var rt = Object.keys(T).filter(function(k) {
186
+ return k !== "key";
208
187
  });
209
- _ = 0 < X.length ? "{key: someKey, " + X.join(": ..., ") + ": ...}" : "{key: someKey}", dt[w + _] || (X = 0 < X.length ? "{" + X.join(": ..., ") + ": ...}" : "{}", console.error(
188
+ V = 0 < rt.length ? "{key: someKey, " + rt.join(": ..., ") + ": ...}" : "{key: someKey}", gt[D + V] || (rt = 0 < rt.length ? "{" + rt.join(": ..., ") + ": ...}" : "{}", console.error(
210
189
  `A props object containing a "key" prop is being spread into JSX:
211
190
  let props = %s;
212
191
  <%s {...props} />
213
192
  React keys must be passed directly to JSX without using spread:
214
193
  let props = %s;
215
194
  <%s key={someKey} {...props} />`,
216
- _,
217
- w,
218
- X,
219
- w
220
- ), dt[w + _] = !0);
195
+ V,
196
+ D,
197
+ rt,
198
+ D
199
+ ), gt[D + V] = !0);
221
200
  }
222
- if (w = null, d !== void 0 && (e(d), w = "" + d), o(A) && (e(A.key), w = "" + A.key), "key" in A) {
223
- d = {};
224
- for (var R in A)
225
- R !== "key" && (d[R] = A[R]);
226
- } else d = A;
227
- return w && c(
228
- d,
229
- typeof f == "function" ? f.displayName || f.name || "Unknown" : f
230
- ), u(
231
- f,
232
- w,
233
- d,
201
+ if (D = null, I !== void 0 && (e(I), D = "" + I), o(T) && (e(T.key), D = "" + T.key), "key" in T) {
202
+ I = {};
203
+ for (var $ in T)
204
+ $ !== "key" && (I[$] = T[$]);
205
+ } else I = T;
206
+ return D && c(
207
+ I,
208
+ typeof u == "function" ? u.displayName || u.name || "Unknown" : u
209
+ ), f(
210
+ u,
211
+ D,
212
+ I,
234
213
  s(),
235
- E,
236
- D
214
+ _t,
215
+ vt
237
216
  );
238
217
  }
239
- function g(f) {
240
- p(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === N && (f._payload.status === "fulfilled" ? p(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
218
+ function m(u) {
219
+ d(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === C && (u._payload.status === "fulfilled" ? d(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
241
220
  }
242
- function p(f) {
243
- return typeof f == "object" && f !== null && f.$$typeof === S;
221
+ function d(u) {
222
+ return typeof u == "object" && u !== null && u.$$typeof === v;
244
223
  }
245
- var O = Mt, S = Symbol.for("react.transitional.element"), y = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), v = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), T = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), N = Symbol.for("react.lazy"), L = Symbol.for("react.activity"), j = Symbol.for("react.client.reference"), W = O.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, st = Array.isArray, M = console.createTask ? console.createTask : function() {
224
+ var g = Zt, v = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), O = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), X = Symbol.for("react.client.reference"), z = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, q = Array.isArray, S = console.createTask ? console.createTask : function() {
246
225
  return null;
247
226
  };
248
- O = {
249
- react_stack_bottom_frame: function(f) {
250
- return f();
227
+ g = {
228
+ react_stack_bottom_frame: function(u) {
229
+ return u();
251
230
  }
252
231
  };
253
- var U, q = {}, K = O.react_stack_bottom_frame.bind(
254
- O,
232
+ var R, M = {}, U = g.react_stack_bottom_frame.bind(
233
+ g,
255
234
  i
256
- )(), mt = M(r(i)), dt = {};
257
- Pt.Fragment = m, Pt.jsx = function(f, A, d) {
258
- var _ = 1e4 > W.recentlyCreatedOwnerStacks++;
259
- return a(
260
- f,
261
- A,
262
- d,
235
+ )(), ft = S(r(i)), gt = {};
236
+ Te.Fragment = b, Te.jsx = function(u, T, I) {
237
+ var V = 1e4 > z.recentlyCreatedOwnerStacks++;
238
+ return l(
239
+ u,
240
+ T,
241
+ I,
263
242
  !1,
264
- _ ? Error("react-stack-top-frame") : K,
265
- _ ? M(r(f)) : mt
243
+ V ? Error("react-stack-top-frame") : U,
244
+ V ? S(r(u)) : ft
266
245
  );
267
- }, Pt.jsxs = function(f, A, d) {
268
- var _ = 1e4 > W.recentlyCreatedOwnerStacks++;
269
- return a(
270
- f,
271
- A,
272
- d,
246
+ }, Te.jsxs = function(u, T, I) {
247
+ var V = 1e4 > z.recentlyCreatedOwnerStacks++;
248
+ return l(
249
+ u,
250
+ T,
251
+ I,
273
252
  !0,
274
- _ ? Error("react-stack-top-frame") : K,
275
- _ ? M(r(f)) : mt
253
+ V ? Error("react-stack-top-frame") : U,
254
+ V ? S(r(u)) : ft
276
255
  );
277
256
  };
278
- }()), Pt;
257
+ })()), Te;
258
+ }
259
+ var cn;
260
+ function rr() {
261
+ return cn || (cn = 1, process.env.NODE_ENV === "production" ? Le.exports = er() : Le.exports = nr()), Le.exports;
279
262
  }
280
- process.env.NODE_ENV === "production" ? ee.exports = sn() : ee.exports = on();
281
- var P = ee.exports;
282
- const ne = "timeline-editor", cn = 0, $t = 1, Ie = 10, Bt = 160, Ht = 20, re = 1, se = 8, fe = 32, ie = 20, Pe = 5, Zt = {
263
+ var N = rr();
264
+ const Je = "timeline-editor", sr = 0, ze = 1, Mn = 10, Fe = 160, Ue = 20, Ze = 1, Qe = 8, an = 32, tn = 20, In = 5, Xe = {
283
265
  trace: 0,
284
266
  debug: 1,
285
267
  info: 2,
286
268
  warn: 3,
287
269
  error: 4,
288
270
  silent: 5
289
- }, an = [
271
+ }, ir = [
290
272
  "trace",
291
273
  "debug",
292
274
  "info",
293
275
  "warn",
294
276
  "error"
295
277
  ];
296
- var ln = class ke {
278
+ var or = class Pn {
279
+ s;
280
+ ls = /* @__PURE__ */ new Map();
281
+ lvl;
282
+ def;
283
+ n;
284
+ r;
285
+ c = console;
286
+ e;
287
+ trace;
288
+ debug;
289
+ info;
290
+ warn;
291
+ error;
297
292
  constructor(t, e, r, s) {
298
- ot(this, "s");
299
- ot(this, "ls", /* @__PURE__ */ new Map());
300
- ot(this, "lvl");
301
- ot(this, "def");
302
- ot(this, "n");
303
- ot(this, "r");
304
- ot(this, "c", console);
305
- ot(this, "e");
306
- ot(this, "trace");
307
- ot(this, "debug");
308
- ot(this, "info");
309
- ot(this, "warn");
310
- ot(this, "error");
311
- ot(this, "noop", () => {
312
- });
313
293
  this.s = t, this.e = e, this.n = r, this.r = s, this.bindMethods();
314
294
  }
295
+ noop = () => {
296
+ };
315
297
  bindMethods() {
316
- an.forEach((t) => {
298
+ ir.forEach((t) => {
317
299
  const e = this.e.bind(this.c, t, this.n);
318
300
  Object.defineProperty(this, t, {
319
- get: () => Zt[t] >= Zt[this.currentLevel()] ? e : this.noop,
301
+ get: () => Xe[t] >= Xe[this.currentLevel()] ? e : this.noop,
320
302
  configurable: !0
321
303
  });
322
304
  });
@@ -327,7 +309,7 @@ var ln = class ke {
327
309
  currentLevel() {
328
310
  if (this.lvl) return this.lvl;
329
311
  const t = this.s.get(this.storageKey());
330
- return t && t in Zt ? (this.lvl = t, this.lvl) : this.def ? this.def : this.r ? this.r.currentLevel() : "trace";
312
+ return t && t in Xe ? (this.lvl = t, this.lvl) : this.def ? this.def : this.r ? this.r.currentLevel() : "trace";
331
313
  }
332
314
  setLevel(t) {
333
315
  return this.lvl = t, this.s.set(this.storageKey(), t), this;
@@ -341,8 +323,8 @@ var ln = class ke {
341
323
  getLogger(t) {
342
324
  if (!t) throw new Error("Logger name required");
343
325
  if (!this.ls.has(t)) {
344
- const e = new ke(this.s, this.e, t, this.r || this);
345
- this.ls.set(t, Le(e));
326
+ const e = new Pn(this.s, this.e, t, this.r || this);
327
+ this.ls.set(t, kn(e));
346
328
  }
347
329
  return this.ls.get(t);
348
330
  }
@@ -356,14 +338,14 @@ var ln = class ke {
356
338
  this.c = t, this.bindMethods();
357
339
  }
358
340
  };
359
- function Le(n) {
341
+ function kn(n) {
360
342
  return new Proxy(n, { get(t, e, r) {
361
343
  if (e in t) return Reflect.get(t, e, r);
362
344
  const s = t.c[e];
363
345
  return typeof s == "function" ? s.bind(t.c) : s;
364
346
  } });
365
347
  }
366
- var un = class {
348
+ var cr = class {
367
349
  get(n) {
368
350
  return localStorage.getItem(n);
369
351
  }
@@ -374,13 +356,13 @@ var un = class {
374
356
  localStorage.removeItem(n);
375
357
  }
376
358
  };
377
- const fn = {
359
+ const ar = {
378
360
  trace: "#95bdb7",
379
361
  debug: "#ad95b8",
380
362
  info: "#b6bd73",
381
363
  warn: "#88a1bb",
382
364
  error: "#bf6c69"
383
- }, de = {
365
+ }, ln = {
384
366
  info: "⚡️",
385
367
  success: "✔",
386
368
  warn: "▲",
@@ -388,27 +370,29 @@ const fn = {
388
370
  log: "●",
389
371
  trace: "◔",
390
372
  debug: "◌"
391
- }, dn = { bind(n, t, e) {
392
- const r = e ? `${de[t]} ${String(e)}:` : `${de[t]}`;
393
- return (n[t] || n.log).bind(n, `%c${r}%c`, `color: ${fn[t]}; font-weight: bold;`, "color: inherit");
394
- } }, yt = Le(new ln(new un(), dn));
395
- function hn(n) {
373
+ }, lr = { bind(n, t, e) {
374
+ const r = e ? `${ln[t]} ${String(e)}:` : `${ln[t]}`;
375
+ return (n[t] || n.log).bind(n, `%c${r}%c`, `color: ${ar[t]}; font-weight: bold;`, "color: inherit");
376
+ } }, qt = kn(new or(new cr(), lr));
377
+ function ur(n) {
396
378
  let {
397
379
  editorData: t = [],
398
380
  effects: e = {},
399
381
  scrollTop: r = 0,
400
- scale: s = $t,
401
- scaleSplitCount: i = Ie,
402
- scaleWidth: o = Bt,
403
- startLeft: c = Ht,
404
- minScaleCount: l = ie,
405
- maxScaleCount: u = 1 / 0,
406
- rowHeight: a = fe
382
+ scale: s = ze,
383
+ scaleSplitCount: i = Mn,
384
+ scaleWidth: o = Fe,
385
+ startLeft: c = Ue,
386
+ minScaleCount: a = tn,
387
+ maxScaleCount: f = 1 / 0,
388
+ rowHeight: l = an
407
389
  } = n;
408
- s <= 0 && (yt.error("Error: scale must be greater than 0!"), s = $t), r < 0 && (yt.warn("Warning: scrollTop cannot be less than 0!"), r = 0), i <= 0 && (yt.warn("Warning: scaleSplitCount cannot be less than 1!"), i = 1), o <= 0 && (yt.warn("Warning: scaleWidth must be greater than 0!"), o = Bt), c < 0 && (yt.warn("Warning: startLeft cannot be less than 0!"), c = 0), l < 1 && (yt.warn("Warning: minScaleCount must be greater than 1!"), l = ie), l = parseInt(l + ""), u < l && (yt.warn("Warning: maxScaleCount cannot be less than minScaleCount!"), u = l), u = u === 1 / 0 ? 1 / 0 : parseInt(u + ""), a <= 0 && (yt.warn("Warning: rowHeight must be greater than 0!"), a = fe);
409
- const g = { ...n };
410
- return delete g.style, {
411
- ...g,
390
+ s <= 0 && (qt.error("Error: scale must be greater than 0!"), s = ze), r < 0 && (qt.warn("Warning: scrollTop cannot be less than 0!"), r = 0), i <= 0 && (qt.warn("Warning: scaleSplitCount cannot be less than 1!"), i = 1), o <= 0 && (qt.warn("Warning: scaleWidth must be greater than 0!"), o = Fe), c < 0 && (qt.warn("Warning: startLeft cannot be less than 0!"), c = 0), a < 1 && (qt.warn("Warning: minScaleCount must be greater than 1!"), a = tn), a = parseInt(a + ""), f < a && (qt.warn("Warning: maxScaleCount cannot be less than minScaleCount!"), f = a), f = f === 1 / 0 ? 1 / 0 : parseInt(f + ""), l <= 0 && (qt.warn("Warning: rowHeight must be greater than 0!"), l = an);
391
+ const m = {
392
+ ...n
393
+ };
394
+ return delete m.style, {
395
+ ...m,
412
396
  editorData: t,
413
397
  effects: e,
414
398
  scrollTop: r,
@@ -416,52 +400,101 @@ function hn(n) {
416
400
  scaleSplitCount: i,
417
401
  scaleWidth: o,
418
402
  startLeft: c,
419
- minScaleCount: l,
420
- maxScaleCount: u,
421
- rowHeight: a
403
+ minScaleCount: a,
404
+ maxScaleCount: f,
405
+ rowHeight: l
422
406
  };
423
407
  }
424
- function pt(n, t) {
425
- const { startLeft: e, scale: r, scaleWidth: s } = t;
408
+ function $t(n, t) {
409
+ const {
410
+ startLeft: e,
411
+ scale: r,
412
+ scaleWidth: s
413
+ } = t;
426
414
  return e + n / r * s;
427
415
  }
428
- function Tt(n, t) {
429
- const { startLeft: e, scale: r, scaleWidth: s } = t;
416
+ function re(n, t) {
417
+ const {
418
+ startLeft: e,
419
+ scale: r,
420
+ scaleWidth: s
421
+ } = t;
430
422
  return (n - e) / s * r;
431
423
  }
432
- function kt(n, t) {
433
- const { left: e, width: r } = n, s = Tt(e, t), i = Tt(e + r, t);
424
+ function Ae(n, t) {
425
+ const {
426
+ left: e,
427
+ width: r
428
+ } = n, s = re(e, t), i = re(e + r, t);
434
429
  return {
435
430
  start: s,
436
431
  end: i
437
432
  };
438
433
  }
439
- function Ne(n, t) {
440
- const { start: e, end: r } = n, s = pt(e, t), i = pt(r, t) - s;
434
+ function Nn(n, t) {
435
+ const {
436
+ start: e,
437
+ end: r
438
+ } = n, s = $t(e, t), i = $t(r, t) - s;
441
439
  return {
442
440
  left: s,
443
441
  width: i
444
442
  };
445
443
  }
446
- function pn(n, t) {
444
+ function fr(n, t) {
447
445
  let e = 0;
448
446
  return n.forEach((s) => {
449
447
  s.actions.forEach((i) => {
450
448
  e = Math.max(e, i.end);
451
449
  });
452
- }), Math.ceil(e / t.scale) + Pe;
450
+ }), Math.ceil(e / t.scale) + In;
453
451
  }
454
- function mn(n, t) {
455
- const { startLeft: e, scaleWidth: r } = t, s = Math.ceil((n - e) / r);
456
- return Math.max(s + Pe, t.scaleCount);
452
+ function dr(n, t) {
453
+ const {
454
+ startLeft: e,
455
+ scaleWidth: r
456
+ } = t, s = Math.ceil((n - e) / r);
457
+ return Math.max(s + In, t.scaleCount);
457
458
  }
458
- function gn(n, t) {
459
+ function hr(n, t) {
459
460
  const e = [];
460
461
  return n.forEach((r) => {
461
- e.push(pt(r.start, t)), e.push(pt(r.end, t));
462
+ e.push($t(r.start, t)), e.push($t(r.end, t));
462
463
  }), e;
463
464
  }
464
- function vn(n) {
465
+ var Me = { exports: {} }, Ye = {};
466
+ var un;
467
+ function mr() {
468
+ if (un) return Ye;
469
+ un = 1;
470
+ var n = Zt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
471
+ return Ye.c = function(t) {
472
+ return n.H.useMemoCache(t);
473
+ }, Ye;
474
+ }
475
+ var Ge = {};
476
+ var fn;
477
+ function pr() {
478
+ return fn || (fn = 1, process.env.NODE_ENV !== "production" && (function() {
479
+ var n = Zt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
480
+ Ge.c = function(t) {
481
+ var e = n.H;
482
+ return e === null && console.error(
483
+ `Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
484
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
485
+ 2. You might be breaking the Rules of Hooks
486
+ 3. You might have more than one copy of React in the same app
487
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
488
+ ), e.useMemoCache(t);
489
+ };
490
+ })()), Ge;
491
+ }
492
+ var dn;
493
+ function gr() {
494
+ return dn || (dn = 1, process.env.NODE_ENV === "production" ? Me.exports = mr() : Me.exports = pr()), Me.exports;
495
+ }
496
+ var Qt = gr();
497
+ function _r(n) {
465
498
  for (var t = [], e = 1; e < arguments.length; e++)
466
499
  t[e - 1] = arguments[e];
467
500
  return t.map(function(r) {
@@ -470,54 +503,70 @@ function vn(n) {
470
503
  }).join(" ");
471
504
  }).join(" ");
472
505
  }
473
- function tt(...n) {
474
- return vn(`${ne}-`, ...n);
475
- }
476
- const Wt = 1, he = 3, pe = 10;
477
- function bn(n) {
478
- const t = V(Number.MIN_SAFE_INTEGER), e = V(Number.MAX_SAFE_INTEGER), r = V(Wt), s = V(void 0);
479
- return {
480
- initAutoScroll: () => {
481
- if (n != null && n.current) {
482
- const { left: u, width: a } = n.current.getBoundingClientRect();
483
- t.current = u, e.current = u + a;
484
- }
485
- },
486
- dealDragAutoScroll: (u, a) => {
487
- if (u.clientX >= e.current || u.clientX <= t.current) {
488
- s.current !== void 0 && cancelAnimationFrame(s.current);
489
- const g = Math.abs(u.clientX >= e.current ? u.clientX - e.current : u.clientX - t.current);
490
- r.current = Math.min(Number((g / pe).toFixed(0)) * Wt, he);
491
- const O = (u.clientX >= e.current ? 1 : -1) * r.current, S = () => {
492
- a && a(O), s.current = requestAnimationFrame(S);
493
- };
494
- return s.current = requestAnimationFrame(S), !1;
495
- } else
496
- s.current !== void 0 && cancelAnimationFrame(s.current);
497
- return !0;
498
- },
499
- dealResizeAutoScroll: (u, a, g) => {
500
- if (u.clientX >= e.current || u.clientX < t.current) {
501
- s.current !== void 0 && cancelAnimationFrame(s.current);
502
- const p = Math.abs(u.clientX >= e.current ? u.clientX - e.current : u.clientX - t.current);
503
- r.current = Math.min(Number((p / pe).toFixed(0)) * Wt, he);
504
- const S = (u.clientX >= e.current ? 1 : -1) * r.current, y = () => {
505
- g && g(S), s.current = requestAnimationFrame(y);
506
- };
507
- return s.current = requestAnimationFrame(y), !1;
508
- } else
509
- s.current !== void 0 && cancelAnimationFrame(s.current);
510
- return !0;
511
- },
512
- stopAutoScroll: () => {
513
- t.current = Number.MIN_SAFE_INTEGER, e.current = Number.MAX_SAFE_INTEGER, r.current = Wt, s.current !== void 0 && cancelAnimationFrame(s.current);
506
+ function mt(...n) {
507
+ return _r(`${Je}-`, ...n);
508
+ }
509
+ const Ie = 1, hn = 3, mn = 10;
510
+ function vr(n) {
511
+ const t = Qt.c(7), e = Q(Number.MIN_SAFE_INTEGER), r = Q(Number.MAX_SAFE_INTEGER), s = Q(Ie), i = Q(void 0);
512
+ let o;
513
+ t[0] !== n ? (o = () => {
514
+ if (n?.current) {
515
+ const {
516
+ left: p,
517
+ width: b
518
+ } = n.current.getBoundingClientRect();
519
+ e.current = p, r.current = p + b;
514
520
  }
515
- };
516
- }
517
- function yn(n, t, e) {
521
+ }, t[0] = n, t[1] = o) : o = t[1];
522
+ const c = o;
523
+ let a;
524
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (p, b) => {
525
+ if (p.clientX >= r.current || p.clientX <= e.current) {
526
+ i.current !== void 0 && cancelAnimationFrame(i.current);
527
+ const w = Math.abs(p.clientX >= r.current ? p.clientX - r.current : p.clientX - e.current);
528
+ s.current = Math.min(Number((w / mn).toFixed(0)) * Ie, hn);
529
+ const x = (p.clientX >= r.current ? 1 : -1) * s.current, O = () => {
530
+ b && b(x), i.current = requestAnimationFrame(O);
531
+ };
532
+ return i.current = requestAnimationFrame(O), !1;
533
+ } else
534
+ i.current !== void 0 && cancelAnimationFrame(i.current);
535
+ return !0;
536
+ }, t[2] = a) : a = t[2];
537
+ const f = a;
538
+ let l;
539
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = (p, b, w) => {
540
+ if (p.clientX >= r.current || p.clientX < e.current) {
541
+ i.current !== void 0 && cancelAnimationFrame(i.current);
542
+ const h = Math.abs(p.clientX >= r.current ? p.clientX - r.current : p.clientX - e.current);
543
+ s.current = Math.min(Number((h / mn).toFixed(0)) * Ie, hn);
544
+ const O = (p.clientX >= r.current ? 1 : -1) * s.current, _ = () => {
545
+ w && w(O), i.current = requestAnimationFrame(_);
546
+ };
547
+ return i.current = requestAnimationFrame(_), !1;
548
+ } else
549
+ i.current !== void 0 && cancelAnimationFrame(i.current);
550
+ return !0;
551
+ }, t[3] = l) : l = t[3];
552
+ const m = l;
553
+ let d;
554
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = () => {
555
+ e.current = Number.MIN_SAFE_INTEGER, r.current = Number.MAX_SAFE_INTEGER, s.current = Ie, i.current !== void 0 && cancelAnimationFrame(i.current);
556
+ }, t[4] = d) : d = t[4];
557
+ const g = d;
558
+ let v;
559
+ return t[5] !== c ? (v = {
560
+ initAutoScroll: c,
561
+ dealDragAutoScroll: f,
562
+ dealResizeAutoScroll: m,
563
+ stopAutoScroll: g
564
+ }, t[5] = c, t[6] = v) : v = t[6], v;
565
+ }
566
+ function br(n, t, e) {
518
567
  return Math.max(t, Math.min(n, e));
519
568
  }
520
- const rt = {
569
+ const pt = {
521
570
  toVector(n, t) {
522
571
  return n === void 0 && (n = t), Array.isArray(n) ? n : [n, n];
523
572
  },
@@ -534,17 +583,17 @@ const rt = {
534
583
  n[0] -= t[0], n[1] -= t[1];
535
584
  }
536
585
  };
537
- function me(n, t, e) {
586
+ function pn(n, t, e) {
538
587
  return t === 0 || Math.abs(t) === 1 / 0 ? Math.pow(n, e * 5) : n * t * e / (t + e * n);
539
588
  }
540
- function ge(n, t, e, r = 0.15) {
541
- return r === 0 ? yn(n, t, e) : n < t ? -me(t - n, e - t, r) + t : n > e ? +me(n - e, e - t, r) + e : n;
589
+ function gn(n, t, e, r = 0.15) {
590
+ return r === 0 ? br(n, t, e) : n < t ? -pn(t - n, e - t, r) + t : n > e ? +pn(n - e, e - t, r) + e : n;
542
591
  }
543
- function _n(n, [t, e], [r, s]) {
544
- const [[i, o], [c, l]] = n;
545
- return [ge(t, i, o, r), ge(e, c, l, s)];
592
+ function yr(n, [t, e], [r, s]) {
593
+ const [[i, o], [c, a]] = n;
594
+ return [gn(t, i, o, r), gn(e, c, a, s)];
546
595
  }
547
- function En(n, t) {
596
+ function wr(n, t) {
548
597
  if (typeof n != "object" || n === null) return n;
549
598
  var e = n[Symbol.toPrimitive];
550
599
  if (e !== void 0) {
@@ -554,19 +603,19 @@ function En(n, t) {
554
603
  }
555
604
  return (t === "string" ? String : Number)(n);
556
605
  }
557
- function wn(n) {
558
- var t = En(n, "string");
606
+ function Er(n) {
607
+ var t = wr(n, "string");
559
608
  return typeof t == "symbol" ? t : String(t);
560
609
  }
561
- function ct(n, t, e) {
562
- return t = wn(t), t in n ? Object.defineProperty(n, t, {
610
+ function St(n, t, e) {
611
+ return t = Er(t), t in n ? Object.defineProperty(n, t, {
563
612
  value: e,
564
613
  enumerable: !0,
565
614
  configurable: !0,
566
615
  writable: !0
567
616
  }) : n[t] = e, n;
568
617
  }
569
- function ve(n, t) {
618
+ function _n(n, t) {
570
619
  var e = Object.keys(n);
571
620
  if (Object.getOwnPropertySymbols) {
572
621
  var r = Object.getOwnPropertySymbols(n);
@@ -576,18 +625,18 @@ function ve(n, t) {
576
625
  }
577
626
  return e;
578
627
  }
579
- function G(n) {
628
+ function nt(n) {
580
629
  for (var t = 1; t < arguments.length; t++) {
581
630
  var e = arguments[t] != null ? arguments[t] : {};
582
- t % 2 ? ve(Object(e), !0).forEach(function(r) {
583
- ct(n, r, e[r]);
584
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : ve(Object(e)).forEach(function(r) {
631
+ t % 2 ? _n(Object(e), !0).forEach(function(r) {
632
+ St(n, r, e[r]);
633
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : _n(Object(e)).forEach(function(r) {
585
634
  Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(e, r));
586
635
  });
587
636
  }
588
637
  return n;
589
638
  }
590
- const je = {
639
+ const jn = {
591
640
  pointer: {
592
641
  start: "down",
593
642
  change: "move",
@@ -609,63 +658,63 @@ const je = {
609
658
  end: "end"
610
659
  }
611
660
  };
612
- function be(n) {
661
+ function vn(n) {
613
662
  return n ? n[0].toUpperCase() + n.slice(1) : "";
614
663
  }
615
- const Sn = ["enter", "leave"];
616
- function xn(n = !1, t) {
617
- return n && !Sn.includes(t);
664
+ const Sr = ["enter", "leave"];
665
+ function xr(n = !1, t) {
666
+ return n && !Sr.includes(t);
618
667
  }
619
- function Tn(n, t = "", e = !1) {
620
- const r = je[n], s = r && r[t] || t;
621
- return "on" + be(n) + be(s) + (xn(e, s) ? "Capture" : "");
668
+ function Rr(n, t = "", e = !1) {
669
+ const r = jn[n], s = r && r[t] || t;
670
+ return "on" + vn(n) + vn(s) + (xr(e, s) ? "Capture" : "");
622
671
  }
623
- const On = ["gotpointercapture", "lostpointercapture"];
624
- function An(n) {
672
+ const Tr = ["gotpointercapture", "lostpointercapture"];
673
+ function Ar(n) {
625
674
  let t = n.substring(2).toLowerCase();
626
675
  const e = !!~t.indexOf("passive");
627
676
  e && (t = t.replace("passive", ""));
628
- const r = On.includes(t) ? "capturecapture" : "capture", s = !!~t.indexOf(r);
677
+ const r = Tr.includes(t) ? "capturecapture" : "capture", s = !!~t.indexOf(r);
629
678
  return s && (t = t.replace("capture", "")), {
630
679
  device: t,
631
680
  capture: s,
632
681
  passive: e
633
682
  };
634
683
  }
635
- function Rn(n, t = "") {
636
- const e = je[n], r = e && e[t] || t;
684
+ function Or(n, t = "") {
685
+ const e = jn[n], r = e && e[t] || t;
637
686
  return n + r;
638
687
  }
639
- function Yt(n) {
688
+ function He(n) {
640
689
  return "touches" in n;
641
690
  }
642
- function We(n) {
643
- return Yt(n) ? "touch" : "pointerType" in n ? n.pointerType : "mouse";
691
+ function Wn(n) {
692
+ return He(n) ? "touch" : "pointerType" in n ? n.pointerType : "mouse";
644
693
  }
645
- function Cn(n) {
694
+ function Cr(n) {
646
695
  return Array.from(n.touches).filter((t) => {
647
696
  var e, r;
648
697
  return t.target === n.currentTarget || ((e = n.currentTarget) === null || e === void 0 || (r = e.contains) === null || r === void 0 ? void 0 : r.call(e, t.target));
649
698
  });
650
699
  }
651
- function Dn(n) {
700
+ function Dr(n) {
652
701
  return n.type === "touchend" || n.type === "touchcancel" ? n.changedTouches : n.targetTouches;
653
702
  }
654
- function ze(n) {
655
- return Yt(n) ? Dn(n)[0] : n;
703
+ function zn(n) {
704
+ return He(n) ? Dr(n)[0] : n;
656
705
  }
657
- function Mn(n) {
658
- return Cn(n).map((t) => t.identifier);
706
+ function Lr(n) {
707
+ return Cr(n).map((t) => t.identifier);
659
708
  }
660
- function Qt(n) {
661
- const t = ze(n);
662
- return Yt(n) ? t.identifier : t.pointerId;
709
+ function Ke(n) {
710
+ const t = zn(n);
711
+ return He(n) ? t.identifier : t.pointerId;
663
712
  }
664
- function ye(n) {
665
- const t = ze(n);
713
+ function bn(n) {
714
+ const t = zn(n);
666
715
  return [t.clientX, t.clientY];
667
716
  }
668
- function In(n) {
717
+ function Mr(n) {
669
718
  const t = {};
670
719
  if ("buttons" in n && (t.buttons = n.buttons), "shiftKey" in n) {
671
720
  const {
@@ -683,24 +732,24 @@ function In(n) {
683
732
  }
684
733
  return t;
685
734
  }
686
- function Xt(n, ...t) {
735
+ function Ve(n, ...t) {
687
736
  return typeof n == "function" ? n(...t) : n;
688
737
  }
689
- function Pn() {
738
+ function Ir() {
690
739
  }
691
- function kn(...n) {
692
- return n.length === 0 ? Pn : n.length === 1 ? n[0] : function() {
740
+ function Pr(...n) {
741
+ return n.length === 0 ? Ir : n.length === 1 ? n[0] : function() {
693
742
  let t;
694
743
  for (const e of n)
695
744
  t = e.apply(this, arguments) || t;
696
745
  return t;
697
746
  };
698
747
  }
699
- function _e(n, t) {
748
+ function yn(n, t) {
700
749
  return Object.assign({}, t, n || {});
701
750
  }
702
- const Ln = 32;
703
- class Nn {
751
+ const kr = 32;
752
+ class Nr {
704
753
  constructor(t, e, r) {
705
754
  this.ctrl = t, this.args = e, this.key = r, this.state || (this.state = {}, this.computeValues([0, 0]), this.computeInitial(), this.init && this.init(), this.reset());
706
755
  }
@@ -739,7 +788,7 @@ class Nn {
739
788
  }
740
789
  start(t) {
741
790
  const e = this.state, r = this.config;
742
- e._active || (this.reset(), this.computeInitial(), e._active = !0, e.target = t.target, e.currentTarget = t.currentTarget, e.lastOffset = r.from ? Xt(r.from, e) : e.offset, e.offset = e.lastOffset, e.startTime = e.timeStamp = t.timeStamp);
791
+ e._active || (this.reset(), this.computeInitial(), e._active = !0, e.target = t.target, e.currentTarget = t.currentTarget, e.lastOffset = r.from ? Ve(r.from, e) : e.offset, e.offset = e.lastOffset, e.startTime = e.timeStamp = t.timeStamp);
743
792
  }
744
793
  computeValues(t) {
745
794
  const e = this.state;
@@ -757,38 +806,38 @@ class Nn {
757
806
  } = this;
758
807
  e.args = this.args;
759
808
  let i = 0;
760
- if (t && (e.event = t, r.preventDefault && t.cancelable && e.event.preventDefault(), e.type = t.type, s.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, s.locked = !!document.pointerLockElement, Object.assign(s, In(t)), s.down = s.pressed = s.buttons % 2 === 1 || s.touches > 0, i = t.timeStamp - e.timeStamp, e.timeStamp = t.timeStamp, e.elapsedTime = e.timeStamp - e.startTime), e._active) {
761
- const C = e._delta.map(Math.abs);
762
- rt.addTo(e._distance, C);
809
+ if (t && (e.event = t, r.preventDefault && t.cancelable && e.event.preventDefault(), e.type = t.type, s.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, s.locked = !!document.pointerLockElement, Object.assign(s, Mr(t)), s.down = s.pressed = s.buttons % 2 === 1 || s.touches > 0, i = t.timeStamp - e.timeStamp, e.timeStamp = t.timeStamp, e.elapsedTime = e.timeStamp - e.startTime), e._active) {
810
+ const y = e._delta.map(Math.abs);
811
+ pt.addTo(e._distance, y);
763
812
  }
764
813
  this.axisIntent && this.axisIntent(t);
765
- const [o, c] = e._movement, [l, u] = r.threshold, {
766
- _step: a,
767
- values: g
814
+ const [o, c] = e._movement, [a, f] = r.threshold, {
815
+ _step: l,
816
+ values: m
768
817
  } = e;
769
- if (r.hasCustomTransform ? (a[0] === !1 && (a[0] = Math.abs(o) >= l && g[0]), a[1] === !1 && (a[1] = Math.abs(c) >= u && g[1])) : (a[0] === !1 && (a[0] = Math.abs(o) >= l && Math.sign(o) * l), a[1] === !1 && (a[1] = Math.abs(c) >= u && Math.sign(c) * u)), e.intentional = a[0] !== !1 || a[1] !== !1, !e.intentional) return;
770
- const p = [0, 0];
818
+ if (r.hasCustomTransform ? (l[0] === !1 && (l[0] = Math.abs(o) >= a && m[0]), l[1] === !1 && (l[1] = Math.abs(c) >= f && m[1])) : (l[0] === !1 && (l[0] = Math.abs(o) >= a && Math.sign(o) * a), l[1] === !1 && (l[1] = Math.abs(c) >= f && Math.sign(c) * f)), e.intentional = l[0] !== !1 || l[1] !== !1, !e.intentional) return;
819
+ const d = [0, 0];
771
820
  if (r.hasCustomTransform) {
772
- const [C, I] = g;
773
- p[0] = a[0] !== !1 ? C - a[0] : 0, p[1] = a[1] !== !1 ? I - a[1] : 0;
821
+ const [y, E] = m;
822
+ d[0] = l[0] !== !1 ? y - l[0] : 0, d[1] = l[1] !== !1 ? E - l[1] : 0;
774
823
  } else
775
- p[0] = a[0] !== !1 ? o - a[0] : 0, p[1] = a[1] !== !1 ? c - a[1] : 0;
776
- this.restrictToAxis && !e._blocked && this.restrictToAxis(p);
777
- const O = e.offset, S = e._active && !e._blocked || e.active;
778
- S && (e.first = e._active && !e.active, e.last = !e._active && e.active, e.active = s[this.ingKey] = e._active, t && (e.first && ("bounds" in r && (e._bounds = Xt(r.bounds, e)), this.setup && this.setup()), e.movement = p, this.computeOffset()));
779
- const [y, m] = e.offset, [[h, v], [x, T]] = e._bounds;
780
- e.overflow = [y < h ? -1 : y > v ? 1 : 0, m < x ? -1 : m > T ? 1 : 0], e._movementBound[0] = e.overflow[0] ? e._movementBound[0] === !1 ? e._movement[0] : e._movementBound[0] : !1, e._movementBound[1] = e.overflow[1] ? e._movementBound[1] === !1 ? e._movement[1] : e._movementBound[1] : !1;
781
- const b = e._active ? r.rubberband || [0, 0] : [0, 0];
782
- if (e.offset = _n(e._bounds, e.offset, b), e.delta = rt.sub(e.offset, O), this.computeMovement(), S && (!e.last || i > Ln)) {
783
- e.delta = rt.sub(e.offset, O);
784
- const C = e.delta.map(Math.abs);
785
- rt.addTo(e.distance, C), e.direction = e.delta.map(Math.sign), e._direction = e._delta.map(Math.sign), !e.first && i > 0 && (e.velocity = [C[0] / i, C[1] / i], e.timeDelta = i);
824
+ d[0] = l[0] !== !1 ? o - l[0] : 0, d[1] = l[1] !== !1 ? c - l[1] : 0;
825
+ this.restrictToAxis && !e._blocked && this.restrictToAxis(d);
826
+ const g = e.offset, v = e._active && !e._blocked || e.active;
827
+ v && (e.first = e._active && !e.active, e.last = !e._active && e.active, e.active = s[this.ingKey] = e._active, t && (e.first && ("bounds" in r && (e._bounds = Ve(r.bounds, e)), this.setup && this.setup()), e.movement = d, this.computeOffset()));
828
+ const [p, b] = e.offset, [[w, h], [x, O]] = e._bounds;
829
+ e.overflow = [p < w ? -1 : p > h ? 1 : 0, b < x ? -1 : b > O ? 1 : 0], e._movementBound[0] = e.overflow[0] ? e._movementBound[0] === !1 ? e._movement[0] : e._movementBound[0] : !1, e._movementBound[1] = e.overflow[1] ? e._movementBound[1] === !1 ? e._movement[1] : e._movementBound[1] : !1;
830
+ const _ = e._active ? r.rubberband || [0, 0] : [0, 0];
831
+ if (e.offset = yr(e._bounds, e.offset, _), e.delta = pt.sub(e.offset, g), this.computeMovement(), v && (!e.last || i > kr)) {
832
+ e.delta = pt.sub(e.offset, g);
833
+ const y = e.delta.map(Math.abs);
834
+ pt.addTo(e.distance, y), e.direction = e.delta.map(Math.sign), e._direction = e._delta.map(Math.sign), !e.first && i > 0 && (e.velocity = [y[0] / i, y[1] / i], e.timeDelta = i);
786
835
  }
787
836
  }
788
837
  emit() {
789
838
  const t = this.state, e = this.shared, r = this.config;
790
839
  if (t._active || this.clean(), (t._blocked || !t.intentional) && !t._force && !r.triggerAllEvents) return;
791
- const s = this.handler(G(G(G({}, e), t), {}, {
840
+ const s = this.handler(nt(nt(nt({}, e), t), {}, {
792
841
  [this.aliasKey]: t.values
793
842
  }));
794
843
  s !== void 0 && (t.memo = s);
@@ -797,16 +846,16 @@ class Nn {
797
846
  this.eventStore.clean(), this.timeoutStore.clean();
798
847
  }
799
848
  }
800
- function jn([n, t], e) {
849
+ function jr([n, t], e) {
801
850
  const r = Math.abs(n), s = Math.abs(t);
802
851
  if (r > s && r > e)
803
852
  return "x";
804
853
  if (s > r && s > e)
805
854
  return "y";
806
855
  }
807
- class Wn extends Nn {
856
+ class Wr extends Nr {
808
857
  constructor(...t) {
809
- super(...t), ct(this, "aliasKey", "xy");
858
+ super(...t), St(this, "aliasKey", "xy");
810
859
  }
811
860
  reset() {
812
861
  super.reset(), this.state.axis = void 0;
@@ -815,16 +864,16 @@ class Wn extends Nn {
815
864
  this.state.offset = [0, 0], this.state.lastOffset = [0, 0];
816
865
  }
817
866
  computeOffset() {
818
- this.state.offset = rt.add(this.state.lastOffset, this.state.movement);
867
+ this.state.offset = pt.add(this.state.lastOffset, this.state.movement);
819
868
  }
820
869
  computeMovement() {
821
- this.state.movement = rt.sub(this.state.offset, this.state.lastOffset);
870
+ this.state.movement = pt.sub(this.state.offset, this.state.lastOffset);
822
871
  }
823
872
  axisIntent(t) {
824
873
  const e = this.state, r = this.config;
825
874
  if (!e.axis && t) {
826
- const s = typeof r.axisThreshold == "object" ? r.axisThreshold[We(t)] : r.axisThreshold;
827
- e.axis = jn(e._movement, s);
875
+ const s = typeof r.axisThreshold == "object" ? r.axisThreshold[Wn(t)] : r.axisThreshold;
876
+ e.axis = jr(e._movement, s);
828
877
  }
829
878
  e._blocked = (r.lockDirection || !!r.axis) && !e.axis || !!r.axis && r.axis !== e.axis;
830
879
  }
@@ -840,12 +889,12 @@ class Wn extends Nn {
840
889
  }
841
890
  }
842
891
  }
843
- const Ee = (n) => n, we = 0.15, ae = {
892
+ const wn = (n) => n, En = 0.15, rn = {
844
893
  enabled(n = !0) {
845
894
  return n;
846
895
  },
847
896
  eventOptions(n, t, e) {
848
- return G(G({}, e.shared.eventOptions), n);
897
+ return nt(nt({}, e.shared.eventOptions), n);
849
898
  },
850
899
  preventDefault(n = !1) {
851
900
  return n;
@@ -856,33 +905,33 @@ const Ee = (n) => n, we = 0.15, ae = {
856
905
  rubberband(n = 0) {
857
906
  switch (n) {
858
907
  case !0:
859
- return [we, we];
908
+ return [En, En];
860
909
  case !1:
861
910
  return [0, 0];
862
911
  default:
863
- return rt.toVector(n);
912
+ return pt.toVector(n);
864
913
  }
865
914
  },
866
915
  from(n) {
867
916
  if (typeof n == "function") return n;
868
- if (n != null) return rt.toVector(n);
917
+ if (n != null) return pt.toVector(n);
869
918
  },
870
919
  transform(n, t, e) {
871
920
  const r = n || e.shared.transform;
872
921
  if (this.hasCustomTransform = !!r, process.env.NODE_ENV === "development") {
873
- const s = r || Ee;
922
+ const s = r || wn;
874
923
  return (i) => {
875
924
  const o = s(i);
876
925
  return (!isFinite(o[0]) || !isFinite(o[1])) && console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${o[0]},${[1]}]`), o;
877
926
  };
878
927
  }
879
- return r || Ee;
928
+ return r || wn;
880
929
  },
881
930
  threshold(n) {
882
- return rt.toVector(n, 0);
931
+ return pt.toVector(n, 0);
883
932
  }
884
933
  };
885
- process.env.NODE_ENV === "development" && Object.assign(ae, {
934
+ process.env.NODE_ENV === "development" && Object.assign(rn, {
886
935
  domTarget(n) {
887
936
  if (n !== void 0)
888
937
  throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");
@@ -899,18 +948,18 @@ process.env.NODE_ENV === "development" && Object.assign(ae, {
899
948
  return NaN;
900
949
  }
901
950
  });
902
- const zn = 0, Lt = G(G({}, ae), {}, {
951
+ const zr = 0, Oe = nt(nt({}, rn), {}, {
903
952
  axis(n, t, {
904
953
  axis: e
905
954
  }) {
906
955
  if (this.lockDirection = e === "lock", !this.lockDirection) return e;
907
956
  },
908
- axisThreshold(n = zn) {
957
+ axisThreshold(n = zr) {
909
958
  return n;
910
959
  },
911
960
  bounds(n = {}) {
912
961
  if (typeof n == "function")
913
- return (i) => Lt.bounds(n(i));
962
+ return (i) => Oe.bounds(n(i));
914
963
  if ("current" in n)
915
964
  return () => n.current;
916
965
  if (typeof HTMLElement == "function" && n instanceof HTMLElement)
@@ -923,15 +972,15 @@ const zn = 0, Lt = G(G({}, ae), {}, {
923
972
  } = n;
924
973
  return [[t, e], [r, s]];
925
974
  }
926
- }), Se = {
975
+ }), Sn = {
927
976
  ArrowRight: (n, t = 1) => [n * t, 0],
928
977
  ArrowLeft: (n, t = 1) => [-1 * n * t, 0],
929
978
  ArrowUp: (n, t = 1) => [0, -1 * n * t],
930
979
  ArrowDown: (n, t = 1) => [0, n * t]
931
980
  };
932
- class Fn extends Wn {
981
+ class Fr extends Wr {
933
982
  constructor(...t) {
934
- super(...t), ct(this, "ingKey", "dragging");
983
+ super(...t), St(this, "ingKey", "dragging");
935
984
  }
936
985
  reset() {
937
986
  super.reset();
@@ -947,7 +996,7 @@ class Fn extends Wn {
947
996
  top: e.top - r.top + t.offset[1],
948
997
  bottom: e.bottom - r.bottom + t.offset[1]
949
998
  };
950
- t._bounds = Lt.bounds(s);
999
+ t._bounds = Oe.bounds(s);
951
1000
  }
952
1001
  }
953
1002
  cancel() {
@@ -966,7 +1015,7 @@ class Fn extends Wn {
966
1015
  const e = this.config, r = this.state;
967
1016
  if (t.buttons != null && (Array.isArray(e.pointerButtons) ? !e.pointerButtons.includes(t.buttons) : e.pointerButtons !== -1 && e.pointerButtons !== t.buttons)) return;
968
1017
  const s = this.ctrl.setEventIds(t);
969
- e.pointerCapture && t.target.setPointerCapture(t.pointerId), !(s && s.size > 1 && r._pointerActive) && (this.start(t), this.setupPointer(t), r._pointerId = Qt(t), r._pointerActive = !0, this.computeValues(ye(t)), this.computeInitial(), e.preventScrollAxis && We(t) !== "mouse" ? (r._active = !1, this.setupScrollPrevention(t)) : e.delay > 0 ? (this.setupDelayTrigger(t), e.triggerAllEvents && (this.compute(t), this.emit())) : this.startPointerDrag(t));
1018
+ e.pointerCapture && t.target.setPointerCapture(t.pointerId), !(s && s.size > 1 && r._pointerActive) && (this.start(t), this.setupPointer(t), r._pointerId = Ke(t), r._pointerActive = !0, this.computeValues(bn(t)), this.computeInitial(), e.preventScrollAxis && Wn(t) !== "mouse" ? (r._active = !1, this.setupScrollPrevention(t)) : e.delay > 0 ? (this.setupDelayTrigger(t), e.triggerAllEvents && (this.compute(t), this.emit())) : this.startPointerDrag(t));
970
1019
  }
971
1020
  startPointerDrag(t) {
972
1021
  const e = this.state;
@@ -975,10 +1024,10 @@ class Fn extends Wn {
975
1024
  pointerMove(t) {
976
1025
  const e = this.state, r = this.config;
977
1026
  if (!e._pointerActive) return;
978
- const s = Qt(t);
1027
+ const s = Ke(t);
979
1028
  if (e._pointerId !== void 0 && s !== e._pointerId) return;
980
- const i = ye(t);
981
- if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta = rt.sub(i, e._values), this.computeValues(i)), rt.addTo(e._movement, e._delta), this.compute(t), e._delayed && e.intentional) {
1029
+ const i = bn(t);
1030
+ if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta = pt.sub(i, e._values), this.computeValues(i)), pt.addTo(e._movement, e._delta), this.compute(t), e._delayed && e.intentional) {
982
1031
  this.timeoutStore.remove("dragDelay"), e.active = !1, this.startPointerDrag(t);
983
1032
  return;
984
1033
  }
@@ -1004,17 +1053,17 @@ class Fn extends Wn {
1004
1053
  }
1005
1054
  const e = this.state, r = this.config;
1006
1055
  if (!e._active || !e._pointerActive) return;
1007
- const s = Qt(t);
1056
+ const s = Ke(t);
1008
1057
  if (e._pointerId !== void 0 && s !== e._pointerId) return;
1009
1058
  this.state._pointerActive = !1, this.setActive(), this.compute(t);
1010
1059
  const [i, o] = e._distance;
1011
1060
  if (e.tap = i <= r.tapsThreshold && o <= r.tapsThreshold, e.tap && r.filterTaps)
1012
1061
  e._force = !0;
1013
1062
  else {
1014
- const [c, l] = e._delta, [u, a] = e._movement, [g, p] = r.swipe.velocity, [O, S] = r.swipe.distance, y = r.swipe.duration;
1015
- if (e.elapsedTime < y) {
1016
- const m = Math.abs(c / e.timeDelta), h = Math.abs(l / e.timeDelta);
1017
- m > g && Math.abs(u) > O && (e.swipe[0] = Math.sign(c)), h > p && Math.abs(a) > S && (e.swipe[1] = Math.sign(l));
1063
+ const [c, a] = e._delta, [f, l] = e._movement, [m, d] = r.swipe.velocity, [g, v] = r.swipe.distance, p = r.swipe.duration;
1064
+ if (e.elapsedTime < p) {
1065
+ const b = Math.abs(c / e.timeDelta), w = Math.abs(a / e.timeDelta);
1066
+ b > m && Math.abs(f) > g && (e.swipe[0] = Math.sign(c)), w > d && Math.abs(l) > v && (e.swipe[1] = Math.sign(a));
1018
1067
  }
1019
1068
  }
1020
1069
  this.emit();
@@ -1041,7 +1090,7 @@ class Fn extends Wn {
1041
1090
  this.state._preventScroll && t.cancelable && t.preventDefault();
1042
1091
  }
1043
1092
  setupScrollPrevention(t) {
1044
- this.state._preventScroll = !1, Vn(t);
1093
+ this.state._preventScroll = !1, Vr(t);
1045
1094
  const e = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
1046
1095
  passive: !1
1047
1096
  });
@@ -1053,14 +1102,14 @@ class Fn extends Wn {
1053
1102
  }, this.config.delay);
1054
1103
  }
1055
1104
  keyDown(t) {
1056
- const e = Se[t.key];
1105
+ const e = Sn[t.key];
1057
1106
  if (e) {
1058
1107
  const r = this.state, s = t.shiftKey ? 10 : t.altKey ? 0.1 : 1;
1059
- this.start(t), r._delta = e(this.config.keyboardDisplacement, s), r._keyboardActive = !0, rt.addTo(r._movement, r._delta), this.compute(t), this.emit();
1108
+ this.start(t), r._delta = e(this.config.keyboardDisplacement, s), r._keyboardActive = !0, pt.addTo(r._movement, r._delta), this.compute(t), this.emit();
1060
1109
  }
1061
1110
  }
1062
1111
  keyUp(t) {
1063
- t.key in Se && (this.state._keyboardActive = !1, this.setActive(), this.compute(t), this.emit());
1112
+ t.key in Sn && (this.state._keyboardActive = !1, this.setActive(), this.compute(t), this.emit());
1064
1113
  }
1065
1114
  bind(t) {
1066
1115
  const e = this.config.device;
@@ -1070,41 +1119,41 @@ class Fn extends Wn {
1070
1119
  });
1071
1120
  }
1072
1121
  }
1073
- function Vn(n) {
1122
+ function Vr(n) {
1074
1123
  "persist" in n && typeof n.persist == "function" && n.persist();
1075
1124
  }
1076
- const Nt = typeof window < "u" && window.document && window.document.createElement;
1077
- function Fe() {
1078
- return Nt && "ontouchstart" in window;
1125
+ const Ce = typeof window < "u" && window.document && window.document.createElement;
1126
+ function Fn() {
1127
+ return Ce && "ontouchstart" in window;
1079
1128
  }
1080
- function Un() {
1081
- return Fe() || Nt && window.navigator.maxTouchPoints > 1;
1129
+ function $r() {
1130
+ return Fn() || Ce && window.navigator.maxTouchPoints > 1;
1082
1131
  }
1083
- function $n() {
1084
- return Nt && "onpointerdown" in window;
1132
+ function Ur() {
1133
+ return Ce && "onpointerdown" in window;
1085
1134
  }
1086
- function Bn() {
1087
- return Nt && "exitPointerLock" in window.document;
1135
+ function Hr() {
1136
+ return Ce && "exitPointerLock" in window.document;
1088
1137
  }
1089
- function Xn() {
1138
+ function Br() {
1090
1139
  try {
1091
1140
  return "constructor" in GestureEvent;
1092
1141
  } catch {
1093
1142
  return !1;
1094
1143
  }
1095
1144
  }
1096
- const lt = {
1097
- isBrowser: Nt,
1098
- gesture: Xn(),
1099
- touch: Fe(),
1100
- touchscreen: Un(),
1101
- pointer: $n(),
1102
- pointerLock: Bn()
1103
- }, Gn = 250, Hn = 180, Yn = 0.5, Kn = 50, qn = 250, Jn = 10, xe = {
1145
+ const Mt = {
1146
+ isBrowser: Ce,
1147
+ gesture: Br(),
1148
+ touch: Fn(),
1149
+ touchscreen: $r(),
1150
+ pointer: Ur(),
1151
+ pointerLock: Hr()
1152
+ }, Xr = 250, Yr = 180, Gr = 0.5, Kr = 50, qr = 250, Jr = 10, xn = {
1104
1153
  mouse: 0,
1105
1154
  touch: 0,
1106
1155
  pen: 8
1107
- }, Ve = G(G({}, Lt), {}, {
1156
+ }, Vn = nt(nt({}, Oe), {}, {
1108
1157
  device(n, t, {
1109
1158
  pointer: {
1110
1159
  touch: e = !1,
@@ -1112,12 +1161,12 @@ const lt = {
1112
1161
  mouse: s = !1
1113
1162
  } = {}
1114
1163
  }) {
1115
- return this.pointerLock = r && lt.pointerLock, lt.touch && e ? "touch" : this.pointerLock ? "mouse" : lt.pointer && !s ? "pointer" : lt.touch ? "touch" : "mouse";
1164
+ return this.pointerLock = r && Mt.pointerLock, Mt.touch && e ? "touch" : this.pointerLock ? "mouse" : Mt.pointer && !s ? "pointer" : Mt.touch ? "touch" : "mouse";
1116
1165
  },
1117
1166
  preventScrollAxis(n, t, {
1118
1167
  preventScroll: e
1119
1168
  }) {
1120
- if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && n ? Gn : void 0, !(!lt.touchscreen || e === !1))
1169
+ if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && n ? Xr : void 0, !(!Mt.touchscreen || e === !1))
1121
1170
  return n || (e !== void 0 ? "y" : void 0);
1122
1171
  },
1123
1172
  pointerCapture(n, t, {
@@ -1134,24 +1183,24 @@ const lt = {
1134
1183
  tapsThreshold: r = 3,
1135
1184
  axis: s = void 0
1136
1185
  }) {
1137
- const i = rt.toVector(n, e ? r : s ? 1 : 0);
1186
+ const i = pt.toVector(n, e ? r : s ? 1 : 0);
1138
1187
  return this.filterTaps = e, this.tapsThreshold = r, i;
1139
1188
  },
1140
1189
  swipe({
1141
- velocity: n = Yn,
1142
- distance: t = Kn,
1143
- duration: e = qn
1190
+ velocity: n = Gr,
1191
+ distance: t = Kr,
1192
+ duration: e = qr
1144
1193
  } = {}) {
1145
1194
  return {
1146
- velocity: this.transform(rt.toVector(n)),
1147
- distance: this.transform(rt.toVector(t)),
1195
+ velocity: this.transform(pt.toVector(n)),
1196
+ distance: this.transform(pt.toVector(t)),
1148
1197
  duration: e
1149
1198
  };
1150
1199
  },
1151
1200
  delay(n = 0) {
1152
1201
  switch (n) {
1153
1202
  case !0:
1154
- return Hn;
1203
+ return Yr;
1155
1204
  case !1:
1156
1205
  return 0;
1157
1206
  default:
@@ -1159,13 +1208,13 @@ const lt = {
1159
1208
  }
1160
1209
  },
1161
1210
  axisThreshold(n) {
1162
- return n ? G(G({}, xe), n) : xe;
1211
+ return n ? nt(nt({}, xn), n) : xn;
1163
1212
  },
1164
- keyboardDisplacement(n = Jn) {
1213
+ keyboardDisplacement(n = Jr) {
1165
1214
  return n;
1166
1215
  }
1167
1216
  });
1168
- process.env.NODE_ENV === "development" && Object.assign(Ve, {
1217
+ process.env.NODE_ENV === "development" && Object.assign(Vn, {
1169
1218
  useTouch(n) {
1170
1219
  if (n !== void 0)
1171
1220
  throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");
@@ -1192,18 +1241,18 @@ process.env.NODE_ENV === "development" && Object.assign(Ve, {
1192
1241
  return NaN;
1193
1242
  }
1194
1243
  });
1195
- G(G({}, ae), {}, {
1244
+ nt(nt({}, rn), {}, {
1196
1245
  device(n, t, {
1197
1246
  shared: e,
1198
1247
  pointer: {
1199
1248
  touch: r = !1
1200
1249
  } = {}
1201
1250
  }) {
1202
- if (e.target && !lt.touch && lt.gesture) return "gesture";
1203
- if (lt.touch && r) return "touch";
1204
- if (lt.touchscreen) {
1205
- if (lt.pointer) return "pointer";
1206
- if (lt.touch) return "touch";
1251
+ if (e.target && !Mt.touch && Mt.gesture) return "gesture";
1252
+ if (Mt.touch && r) return "touch";
1253
+ if (Mt.touchscreen) {
1254
+ if (Mt.pointer) return "pointer";
1255
+ if (Mt.touch) return "touch";
1207
1256
  }
1208
1257
  },
1209
1258
  bounds(n, t, {
@@ -1211,13 +1260,13 @@ G(G({}, ae), {}, {
1211
1260
  angleBounds: r = {}
1212
1261
  }) {
1213
1262
  const s = (o) => {
1214
- const c = _e(Xt(e, o), {
1263
+ const c = yn(Ve(e, o), {
1215
1264
  min: -1 / 0,
1216
1265
  max: 1 / 0
1217
1266
  });
1218
1267
  return [c.min, c.max];
1219
1268
  }, i = (o) => {
1220
- const c = _e(Xt(r, o), {
1269
+ const c = yn(Ve(r, o), {
1221
1270
  min: -1 / 0,
1222
1271
  max: 1 / 0
1223
1272
  });
@@ -1226,7 +1275,7 @@ G(G({}, ae), {}, {
1226
1275
  return typeof e != "function" && typeof r != "function" ? [s(), i()] : (o) => [s(o), i(o)];
1227
1276
  },
1228
1277
  threshold(n, t, e) {
1229
- return this.lockDirection = e.axis === "lock", rt.toVector(n, this.lockDirection ? [0.1, 3] : 0);
1278
+ return this.lockDirection = e.axis === "lock", pt.toVector(n, this.lockDirection ? [0.1, 3] : 0);
1230
1279
  },
1231
1280
  modifierKey(n) {
1232
1281
  return n === void 0 ? "ctrlKey" : n;
@@ -1235,31 +1284,31 @@ G(G({}, ae), {}, {
1235
1284
  return n;
1236
1285
  }
1237
1286
  });
1238
- G(G({}, Lt), {}, {
1287
+ nt(nt({}, Oe), {}, {
1239
1288
  mouseOnly: (n = !0) => n
1240
1289
  });
1241
- G(G({}, Lt), {}, {
1290
+ nt(nt({}, Oe), {}, {
1242
1291
  mouseOnly: (n = !0) => n
1243
1292
  });
1244
- const Ue = /* @__PURE__ */ new Map(), oe = /* @__PURE__ */ new Map();
1245
- function Zn(n) {
1246
- Ue.set(n.key, n.engine), oe.set(n.key, n.resolver);
1293
+ const $n = /* @__PURE__ */ new Map(), en = /* @__PURE__ */ new Map();
1294
+ function Zr(n) {
1295
+ $n.set(n.key, n.engine), en.set(n.key, n.resolver);
1247
1296
  }
1248
- const Qn = {
1297
+ const Qr = {
1249
1298
  key: "drag",
1250
- engine: Fn,
1251
- resolver: Ve
1299
+ engine: Fr,
1300
+ resolver: Vn
1252
1301
  };
1253
- function tr(n, t) {
1302
+ function ts(n, t) {
1254
1303
  if (n == null) return {};
1255
1304
  var e = {}, r = Object.keys(n), s, i;
1256
1305
  for (i = 0; i < r.length; i++)
1257
1306
  s = r[i], !(t.indexOf(s) >= 0) && (e[s] = n[s]);
1258
1307
  return e;
1259
1308
  }
1260
- function er(n, t) {
1309
+ function es(n, t) {
1261
1310
  if (n == null) return {};
1262
- var e = tr(n, t), r, s;
1311
+ var e = ts(n, t), r, s;
1263
1312
  if (Object.getOwnPropertySymbols) {
1264
1313
  var i = Object.getOwnPropertySymbols(n);
1265
1314
  for (s = 0; s < i.length; s++)
@@ -1267,7 +1316,7 @@ function er(n, t) {
1267
1316
  }
1268
1317
  return e;
1269
1318
  }
1270
- const nr = {
1319
+ const ns = {
1271
1320
  target(n) {
1272
1321
  if (n)
1273
1322
  return () => "current" in n ? n.current : n;
@@ -1275,7 +1324,7 @@ const nr = {
1275
1324
  enabled(n = !0) {
1276
1325
  return n;
1277
1326
  },
1278
- window(n = lt.isBrowser ? window : void 0) {
1327
+ window(n = Mt.isBrowser ? window : void 0) {
1279
1328
  return n;
1280
1329
  },
1281
1330
  eventOptions({
@@ -1290,8 +1339,8 @@ const nr = {
1290
1339
  transform(n) {
1291
1340
  return n;
1292
1341
  }
1293
- }, rr = ["target", "eventOptions", "window", "enabled", "transform"];
1294
- function Ft(n = {}, t) {
1342
+ }, rs = ["target", "eventOptions", "window", "enabled", "transform"];
1343
+ function ke(n = {}, t) {
1295
1344
  const e = {};
1296
1345
  for (const [r, s] of Object.entries(t))
1297
1346
  switch (typeof s) {
@@ -1303,7 +1352,7 @@ function Ft(n = {}, t) {
1303
1352
  e[r] = s.call(e, n[r], r, n);
1304
1353
  break;
1305
1354
  case "object":
1306
- e[r] = Ft(n[r], s);
1355
+ e[r] = ke(n[r], s);
1307
1356
  break;
1308
1357
  case "boolean":
1309
1358
  s && (e[r] = n[r]);
@@ -1311,59 +1360,59 @@ function Ft(n = {}, t) {
1311
1360
  }
1312
1361
  return e;
1313
1362
  }
1314
- function sr(n, t, e = {}) {
1363
+ function ss(n, t, e = {}) {
1315
1364
  const r = n, {
1316
1365
  target: s,
1317
1366
  eventOptions: i,
1318
1367
  window: o,
1319
1368
  enabled: c,
1320
- transform: l
1321
- } = r, u = er(r, rr);
1322
- if (e.shared = Ft({
1369
+ transform: a
1370
+ } = r, f = es(r, rs);
1371
+ if (e.shared = ke({
1323
1372
  target: s,
1324
1373
  eventOptions: i,
1325
1374
  window: o,
1326
1375
  enabled: c,
1327
- transform: l
1328
- }, nr), t) {
1329
- const a = oe.get(t);
1330
- e[t] = Ft(G({
1376
+ transform: a
1377
+ }, ns), t) {
1378
+ const l = en.get(t);
1379
+ e[t] = ke(nt({
1331
1380
  shared: e.shared
1332
- }, u), a);
1381
+ }, f), l);
1333
1382
  } else
1334
- for (const a in u) {
1335
- const g = oe.get(a);
1336
- if (g)
1337
- e[a] = Ft(G({
1383
+ for (const l in f) {
1384
+ const m = en.get(l);
1385
+ if (m)
1386
+ e[l] = ke(nt({
1338
1387
  shared: e.shared
1339
- }, u[a]), g);
1340
- else if (process.env.NODE_ENV === "development" && !["drag", "pinch", "scroll", "wheel", "move", "hover"].includes(a)) {
1341
- if (a === "domTarget")
1388
+ }, f[l]), m);
1389
+ else if (process.env.NODE_ENV === "development" && !["drag", "pinch", "scroll", "wheel", "move", "hover"].includes(l)) {
1390
+ if (l === "domTarget")
1342
1391
  throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");
1343
- console.warn(`[@use-gesture]: Unknown config key \`${a}\` was used. Please read the documentation for further information.`);
1392
+ console.warn(`[@use-gesture]: Unknown config key \`${l}\` was used. Please read the documentation for further information.`);
1344
1393
  }
1345
1394
  }
1346
1395
  return e;
1347
1396
  }
1348
- class $e {
1397
+ class Un {
1349
1398
  constructor(t, e) {
1350
- ct(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = t, this._gestureKey = e;
1399
+ St(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = t, this._gestureKey = e;
1351
1400
  }
1352
1401
  add(t, e, r, s, i) {
1353
- const o = this._listeners, c = Rn(e, r), l = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, u = G(G({}, l), i);
1354
- t.addEventListener(c, s, u);
1355
- const a = () => {
1356
- t.removeEventListener(c, s, u), o.delete(a);
1402
+ const o = this._listeners, c = Or(e, r), a = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, f = nt(nt({}, a), i);
1403
+ t.addEventListener(c, s, f);
1404
+ const l = () => {
1405
+ t.removeEventListener(c, s, f), o.delete(l);
1357
1406
  };
1358
- return o.add(a), a;
1407
+ return o.add(l), l;
1359
1408
  }
1360
1409
  clean() {
1361
1410
  this._listeners.forEach((t) => t()), this._listeners.clear();
1362
1411
  }
1363
1412
  }
1364
- class ir {
1413
+ class is {
1365
1414
  constructor() {
1366
- ct(this, "_timeouts", /* @__PURE__ */ new Map());
1415
+ St(this, "_timeouts", /* @__PURE__ */ new Map());
1367
1416
  }
1368
1417
  add(t, e, r = 140, ...s) {
1369
1418
  this.remove(t), this._timeouts.set(t, window.setTimeout(e, r, ...s));
@@ -1376,20 +1425,20 @@ class ir {
1376
1425
  this._timeouts.forEach((t) => void window.clearTimeout(t)), this._timeouts.clear();
1377
1426
  }
1378
1427
  }
1379
- class or {
1428
+ class os {
1380
1429
  constructor(t) {
1381
- ct(this, "gestures", /* @__PURE__ */ new Set()), ct(this, "_targetEventStore", new $e(this)), ct(this, "gestureEventStores", {}), ct(this, "gestureTimeoutStores", {}), ct(this, "handlers", {}), ct(this, "config", {}), ct(this, "pointerIds", /* @__PURE__ */ new Set()), ct(this, "touchIds", /* @__PURE__ */ new Set()), ct(this, "state", {
1430
+ St(this, "gestures", /* @__PURE__ */ new Set()), St(this, "_targetEventStore", new Un(this)), St(this, "gestureEventStores", {}), St(this, "gestureTimeoutStores", {}), St(this, "handlers", {}), St(this, "config", {}), St(this, "pointerIds", /* @__PURE__ */ new Set()), St(this, "touchIds", /* @__PURE__ */ new Set()), St(this, "state", {
1382
1431
  shared: {
1383
1432
  shiftKey: !1,
1384
1433
  metaKey: !1,
1385
1434
  ctrlKey: !1,
1386
1435
  altKey: !1
1387
1436
  }
1388
- }), cr(this, t);
1437
+ }), cs(this, t);
1389
1438
  }
1390
1439
  setEventIds(t) {
1391
- if (Yt(t))
1392
- return this.touchIds = new Set(Mn(t)), this.touchIds;
1440
+ if (He(t))
1441
+ return this.touchIds = new Set(Lr(t)), this.touchIds;
1393
1442
  if ("pointerId" in t)
1394
1443
  return t.type === "pointerup" || t.type === "pointercancel" ? this.pointerIds.delete(t.pointerId) : t.type === "pointerdown" && this.pointerIds.add(t.pointerId), this.pointerIds;
1395
1444
  }
@@ -1397,7 +1446,7 @@ class or {
1397
1446
  this.handlers = t, this.nativeHandlers = e;
1398
1447
  }
1399
1448
  applyConfig(t, e) {
1400
- this.config = sr(t, e, this.config);
1449
+ this.config = ss(t, e, this.config);
1401
1450
  }
1402
1451
  clean() {
1403
1452
  this._targetEventStore.clean();
@@ -1413,49 +1462,49 @@ class or {
1413
1462
  if (!(e.target && (s = e.target(), !s))) {
1414
1463
  if (e.enabled) {
1415
1464
  for (const o of this.gestures) {
1416
- const c = this.config[o], l = Te(r, c.eventOptions, !!s);
1465
+ const c = this.config[o], a = Rn(r, c.eventOptions, !!s);
1417
1466
  if (c.enabled) {
1418
- const u = Ue.get(o);
1419
- new u(this, t, o).bind(l);
1467
+ const f = $n.get(o);
1468
+ new f(this, t, o).bind(a);
1420
1469
  }
1421
1470
  }
1422
- const i = Te(r, e.eventOptions, !!s);
1471
+ const i = Rn(r, e.eventOptions, !!s);
1423
1472
  for (const o in this.nativeHandlers)
1424
- i(o, "", (c) => this.nativeHandlers[o](G(G({}, this.state.shared), {}, {
1473
+ i(o, "", (c) => this.nativeHandlers[o](nt(nt({}, this.state.shared), {}, {
1425
1474
  event: c,
1426
1475
  args: t
1427
1476
  })), void 0, !0);
1428
1477
  }
1429
1478
  for (const i in r)
1430
- r[i] = kn(...r[i]);
1479
+ r[i] = Pr(...r[i]);
1431
1480
  if (!s) return r;
1432
1481
  for (const i in r) {
1433
1482
  const {
1434
1483
  device: o,
1435
1484
  capture: c,
1436
- passive: l
1437
- } = An(i);
1485
+ passive: a
1486
+ } = Ar(i);
1438
1487
  this._targetEventStore.add(s, o, "", r[i], {
1439
1488
  capture: c,
1440
- passive: l
1489
+ passive: a
1441
1490
  });
1442
1491
  }
1443
1492
  }
1444
1493
  }
1445
1494
  }
1446
- function Rt(n, t) {
1447
- n.gestures.add(t), n.gestureEventStores[t] = new $e(n, t), n.gestureTimeoutStores[t] = new ir();
1495
+ function Ee(n, t) {
1496
+ n.gestures.add(t), n.gestureEventStores[t] = new Un(n, t), n.gestureTimeoutStores[t] = new is();
1448
1497
  }
1449
- function cr(n, t) {
1450
- t.drag && Rt(n, "drag"), t.wheel && Rt(n, "wheel"), t.scroll && Rt(n, "scroll"), t.move && Rt(n, "move"), t.pinch && Rt(n, "pinch"), t.hover && Rt(n, "hover");
1498
+ function cs(n, t) {
1499
+ t.drag && Ee(n, "drag"), t.wheel && Ee(n, "wheel"), t.scroll && Ee(n, "scroll"), t.move && Ee(n, "move"), t.pinch && Ee(n, "pinch"), t.hover && Ee(n, "hover");
1451
1500
  }
1452
- const Te = (n, t, e) => (r, s, i, o = {}, c = !1) => {
1453
- var l, u;
1454
- const a = (l = o.capture) !== null && l !== void 0 ? l : t.capture, g = (u = o.passive) !== null && u !== void 0 ? u : t.passive;
1455
- let p = c ? r : Tn(r, s, a);
1456
- e && g && (p += "Passive"), n[p] = n[p] || [], n[p].push(i);
1501
+ const Rn = (n, t, e) => (r, s, i, o = {}, c = !1) => {
1502
+ var a, f;
1503
+ const l = (a = o.capture) !== null && a !== void 0 ? a : t.capture, m = (f = o.passive) !== null && f !== void 0 ? f : t.passive;
1504
+ let d = c ? r : Rr(r, s, l);
1505
+ e && m && (d += "Passive"), n[d] = n[d] || [], n[d].push(i);
1457
1506
  };
1458
- function ar(n, t) {
1507
+ function as(n, t) {
1459
1508
  if (typeof n != "object" || n === null) return n;
1460
1509
  var e = n[Symbol.toPrimitive];
1461
1510
  if (e !== void 0) {
@@ -1465,19 +1514,19 @@ function ar(n, t) {
1465
1514
  }
1466
1515
  return (t === "string" ? String : Number)(n);
1467
1516
  }
1468
- function lr(n) {
1469
- var t = ar(n, "string");
1517
+ function ls(n) {
1518
+ var t = as(n, "string");
1470
1519
  return typeof t == "symbol" ? t : String(t);
1471
1520
  }
1472
- function ur(n, t, e) {
1473
- return t = lr(t), t in n ? Object.defineProperty(n, t, {
1521
+ function us(n, t, e) {
1522
+ return t = ls(t), t in n ? Object.defineProperty(n, t, {
1474
1523
  value: e,
1475
1524
  enumerable: !0,
1476
1525
  configurable: !0,
1477
1526
  writable: !0
1478
1527
  }) : n[t] = e, n;
1479
1528
  }
1480
- function Oe(n, t) {
1529
+ function Tn(n, t) {
1481
1530
  var e = Object.keys(n);
1482
1531
  if (Object.getOwnPropertySymbols) {
1483
1532
  var r = Object.getOwnPropertySymbols(n);
@@ -1487,20 +1536,20 @@ function Oe(n, t) {
1487
1536
  }
1488
1537
  return e;
1489
1538
  }
1490
- function zt(n) {
1539
+ function Pe(n) {
1491
1540
  for (var t = 1; t < arguments.length; t++) {
1492
1541
  var e = arguments[t] != null ? arguments[t] : {};
1493
- t % 2 ? Oe(Object(e), !0).forEach(function(r) {
1494
- ur(n, r, e[r]);
1495
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : Oe(Object(e)).forEach(function(r) {
1542
+ t % 2 ? Tn(Object(e), !0).forEach(function(r) {
1543
+ us(n, r, e[r]);
1544
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : Tn(Object(e)).forEach(function(r) {
1496
1545
  Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(e, r));
1497
1546
  });
1498
1547
  }
1499
1548
  return n;
1500
1549
  }
1501
- class fr {
1550
+ class fs {
1502
1551
  constructor(t, e, r, s, i) {
1503
- this._target = t, this._gestureKey = s, this._ctrl = new or(e), this._ctrl.applyHandlers(e, i), this._ctrl.applyConfig(zt(zt({}, r), {}, {
1552
+ this._target = t, this._gestureKey = s, this._ctrl = new os(e), this._ctrl.applyHandlers(e, i), this._ctrl.applyConfig(Pe(Pe({}, r), {}, {
1504
1553
  target: t
1505
1554
  }), s), this._ctrl.effect();
1506
1555
  }
@@ -1508,25 +1557,28 @@ class fr {
1508
1557
  this._ctrl.clean();
1509
1558
  }
1510
1559
  setConfig(t) {
1511
- this._ctrl.clean(), this._ctrl.applyConfig(zt(zt({}, t), {}, {
1560
+ this._ctrl.clean(), this._ctrl.applyConfig(Pe(Pe({}, t), {}, {
1512
1561
  target: this._target
1513
1562
  }), this._gestureKey), this._ctrl.effect();
1514
1563
  }
1515
1564
  }
1516
- const te = function(t, e, r) {
1517
- return Zn(Qn), new fr(t, {
1565
+ const qe = function(t, e, r) {
1566
+ return Zr(Qr), new fs(t, {
1518
1567
  drag: e
1519
1568
  }, r || {}, "drag");
1520
1569
  };
1521
- function Be(...n) {
1570
+ function Hn(...n) {
1522
1571
  const t = n.filter(Boolean);
1523
1572
  return t.length <= 1 ? t[0] || null : function(r) {
1524
1573
  for (const s of t)
1525
1574
  typeof s == "function" ? s(r) : s && (s.current = r);
1526
1575
  };
1527
1576
  }
1528
- const Xe = ({ children: n, ...t }) => {
1529
- const e = Mt.Children.only(n), r = dr(e), s = e.props || {}, i = s.style || {}, o = {
1577
+ const Bn = ({
1578
+ children: n,
1579
+ ...t
1580
+ }) => {
1581
+ const e = Zt.Children.only(n), r = ds(e), s = e.props || {}, i = s.style || {}, o = {
1530
1582
  ...t,
1531
1583
  ...s,
1532
1584
  // child's own props take precedence
@@ -1534,304 +1586,443 @@ const Xe = ({ children: n, ...t }) => {
1534
1586
  ...t.style ?? {},
1535
1587
  ...i
1536
1588
  },
1537
- ref: Be(r, t.ref)
1589
+ ref: Hn(r, t.ref)
1538
1590
  };
1539
- return Mt.cloneElement(e, o);
1591
+ return Zt.cloneElement(e, o);
1540
1592
  };
1541
- function dr(n) {
1542
- var r;
1543
- let t = (r = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : r.get;
1593
+ function ds(n) {
1594
+ let t = Object.getOwnPropertyDescriptor(n, "ref")?.get;
1544
1595
  return t && "isReactWarning" in t && t.isReactWarning ? n.props.ref : n.props.ref || n.ref;
1545
1596
  }
1546
- const hr = ({ children: n, interactRef: t, draggable: e, resizable: r, draggableOptions: s, resizableOptions: i }) => {
1547
- const o = V(null), c = V(void 0), l = V(void 0), u = V(void 0), a = V(void 0), g = V(void 0), p = V(null), O = V(null);
1548
- ht(() => {
1549
- c.current = s, l.current = i;
1597
+ const hs = ({
1598
+ children: n,
1599
+ interactRef: t,
1600
+ draggable: e,
1601
+ resizable: r,
1602
+ draggableOptions: s,
1603
+ resizableOptions: i
1604
+ }) => {
1605
+ const o = Q(null), c = Q(void 0), a = Q(void 0), f = Q(void 0), l = Q(void 0), m = Q(void 0), d = Q(null), g = Q(null);
1606
+ Vt(() => {
1607
+ c.current = s, a.current = i;
1550
1608
  }, [s, i]);
1551
- const S = tn(() => {
1552
- var y, m;
1553
- o.current && (e && c.current && (u.current = new te(
1554
- o.current,
1555
- (h) => {
1556
- var L, j, W, Y, st, M;
1557
- const { active: v, delta: x, xy: T, event: b, first: C, last: I } = h, k = b == null ? void 0 : b.target;
1558
- if (k && (k === p.current || k === O.current || p.current && p.current.contains(k) || O.current && O.current.contains(k)))
1559
- return;
1560
- const N = {
1561
- target: o.current,
1562
- dx: x[0],
1563
- dy: x[1],
1564
- clientX: T[0],
1565
- clientY: T[1]
1566
- };
1567
- C ? (j = (L = c.current) == null ? void 0 : L.onstart) == null || j.call(L, N) : I ? (Y = (W = c.current) == null ? void 0 : W.onend) == null || Y.call(W, N) : v && ((M = (st = c.current) == null ? void 0 : st.onmove) == null || M.call(st, N));
1568
- },
1569
- {
1570
- axis: ((y = c.current) == null ? void 0 : y.lockAxis) === "x" ? "x" : void 0,
1571
- pointer: { capture: !0 }
1609
+ const v = Zn(() => {
1610
+ o.current && (e && c.current && (f.current = new qe(o.current, (p) => {
1611
+ const {
1612
+ active: b,
1613
+ delta: w,
1614
+ xy: h,
1615
+ event: x,
1616
+ first: O,
1617
+ last: _
1618
+ } = p, y = x?.target;
1619
+ if (y && (y === d.current || y === g.current || d.current && d.current.contains(y) || g.current && g.current.contains(y)))
1620
+ return;
1621
+ const E = {
1622
+ target: o.current,
1623
+ dx: w[0],
1624
+ dy: w[1],
1625
+ clientX: h[0],
1626
+ clientY: h[1]
1627
+ };
1628
+ O ? c.current?.onstart?.(E) : _ ? c.current?.onend?.(E) : b && c.current?.onmove?.(E);
1629
+ }, {
1630
+ axis: c.current?.lockAxis === "x" ? "x" : void 0,
1631
+ pointer: {
1632
+ capture: !0
1572
1633
  }
1573
- )), r && ((m = l.current) != null && m.edges) && (l.current.edges.left && (p.current || (p.current = o.current.querySelector(l.current.edges.left)), a.current = new te(
1574
- p.current,
1575
- (h) => {
1576
- var k, N, L, j, W, Y;
1577
- const { active: v, delta: x, xy: T, first: b, last: C } = h, I = {
1578
- target: o.current,
1579
- dx: x[0],
1580
- dy: 0,
1581
- clientX: T[0],
1582
- clientY: T[1],
1583
- edges: { left: !0 },
1584
- deltaRect: { left: x[0] }
1585
- };
1586
- C ? (N = (k = l.current) == null ? void 0 : k.onend) == null || N.call(k, I) : b ? (j = (L = l.current) == null ? void 0 : L.onstart) == null || j.call(L, I) : v && ((Y = (W = l.current) == null ? void 0 : W.onmove) == null || Y.call(W, I));
1587
- },
1588
- { pointer: { capture: !0 } }
1589
- )), l.current.edges.right && (O.current || (O.current = o.current.querySelector(l.current.edges.right)), g.current = new te(
1590
- O.current,
1591
- (h) => {
1592
- var k, N, L, j, W, Y;
1593
- const { active: v, delta: x, xy: T, first: b, last: C } = h, I = {
1594
- target: o.current,
1595
- dx: x[0],
1596
- dy: 0,
1597
- clientX: T[0],
1598
- clientY: T[1],
1599
- edges: { right: !0 },
1600
- deltaRect: { right: x[0] }
1601
- };
1602
- C ? (N = (k = l.current) == null ? void 0 : k.onend) == null || N.call(k, I) : b ? (j = (L = l.current) == null ? void 0 : L.onstart) == null || j.call(L, I) : v && ((Y = (W = l.current) == null ? void 0 : W.onmove) == null || Y.call(W, I));
1603
- },
1604
- { pointer: { capture: !0 } }
1605
- ))));
1634
+ })), r && a.current?.edges && (a.current.edges.left && (d.current || (d.current = o.current.querySelector(a.current.edges.left)), l.current = new qe(d.current, (p) => {
1635
+ const {
1636
+ active: b,
1637
+ delta: w,
1638
+ xy: h,
1639
+ first: x,
1640
+ last: O
1641
+ } = p, _ = {
1642
+ target: o.current,
1643
+ dx: w[0],
1644
+ dy: 0,
1645
+ clientX: h[0],
1646
+ clientY: h[1],
1647
+ edges: {
1648
+ left: !0
1649
+ },
1650
+ deltaRect: {
1651
+ left: w[0]
1652
+ }
1653
+ };
1654
+ O ? a.current?.onend?.(_) : x ? a.current?.onstart?.(_) : b && a.current?.onmove?.(_);
1655
+ }, {
1656
+ pointer: {
1657
+ capture: !0
1658
+ }
1659
+ })), a.current.edges.right && (g.current || (g.current = o.current.querySelector(a.current.edges.right)), m.current = new qe(g.current, (p) => {
1660
+ const {
1661
+ active: b,
1662
+ delta: w,
1663
+ xy: h,
1664
+ first: x,
1665
+ last: O
1666
+ } = p, _ = {
1667
+ target: o.current,
1668
+ dx: w[0],
1669
+ dy: 0,
1670
+ clientX: h[0],
1671
+ clientY: h[1],
1672
+ edges: {
1673
+ right: !0
1674
+ },
1675
+ deltaRect: {
1676
+ right: w[0]
1677
+ }
1678
+ };
1679
+ O ? a.current?.onend?.(_) : x ? a.current?.onstart?.(_) : b && a.current?.onmove?.(_);
1680
+ }, {
1681
+ pointer: {
1682
+ capture: !0
1683
+ }
1684
+ }))));
1606
1685
  });
1607
- return ht(() => {
1608
- var m, h, v;
1686
+ return Vt(() => {
1609
1687
  if (!o.current) return;
1610
- (m = u.current) == null || m.destroy(), (h = a.current) == null || h.destroy(), (v = g.current) == null || v.destroy();
1611
- const y = {
1688
+ f.current?.destroy(), l.current?.destroy(), m.current?.destroy();
1689
+ const p = {
1612
1690
  target: o.current,
1613
1691
  unset: () => {
1614
- var x, T, b;
1615
- (x = u.current) == null || x.destroy(), (T = a.current) == null || T.destroy(), (b = g.current) == null || b.destroy();
1692
+ f.current?.destroy(), l.current?.destroy(), m.current?.destroy();
1616
1693
  }
1617
1694
  };
1618
- t && (t.current = y), S();
1619
- }, [e, r, t]), Xe({ children: n, ref: o, draggable: !1, style: { ...e && { touchAction: "none" } } });
1620
- }, Ge = Mt.forwardRef(
1621
- ({
1695
+ t && (t.current = p), v();
1696
+ }, [e, r, t]), Bn({
1622
1697
  children: n,
1623
- edges: t,
1624
- left: e,
1625
- width: r,
1626
- start: s = Ht,
1627
- grid: i = re,
1628
- bounds: o = {
1629
- left: Number.MIN_SAFE_INTEGER,
1630
- right: Number.MAX_SAFE_INTEGER
1631
- },
1632
- enableResizing: c = !0,
1633
- enableDragging: l = !0,
1634
- adsorptionDistance: u = se,
1635
- adsorptionPositions: a = [],
1636
- onResizeStart: g,
1698
+ ref: o,
1699
+ draggable: !1,
1700
+ style: {
1701
+ ...e && {
1702
+ touchAction: "none"
1703
+ }
1704
+ }
1705
+ });
1706
+ }, Xn = Zt.forwardRef((n, t) => {
1707
+ const e = Qt.c(72), {
1708
+ children: r,
1709
+ edges: s,
1710
+ left: i,
1711
+ width: o,
1712
+ start: c,
1713
+ grid: a,
1714
+ bounds: f,
1715
+ enableResizing: l,
1716
+ enableDragging: m,
1717
+ adsorptionDistance: d,
1718
+ adsorptionPositions: g,
1719
+ onResizeStart: v,
1637
1720
  onResize: p,
1638
- onResizeEnd: O,
1639
- onDragStart: S,
1640
- onDragEnd: y,
1641
- onDrag: m,
1642
- parentRef: h,
1643
- deltaScrollLeft: v
1644
- }, x) => {
1645
- const T = V(void 0), b = V(0), C = V(!1), { initAutoScroll: I, dealDragAutoScroll: k, dealResizeAutoScroll: N, stopAutoScroll: L } = bn(h);
1646
- ht(() => {
1647
- let d = T.current;
1648
- return () => {
1649
- d == null || d.unset();
1650
- };
1651
- }, []);
1652
- const j = (d, _ = !0) => {
1653
- if (!T.current || !T.current.target) return;
1654
- _ && (b.current = 0);
1655
- const E = T.current.target;
1656
- E.style.left = `${d}px`, Object.assign(E.dataset, { left: d });
1657
- }, W = (d, _ = !0) => {
1658
- if (!T.current || !T.current.target) return;
1659
- _ && (b.current = 0);
1660
- const E = T.current.target;
1661
- E.style.width = `${d}px`, Object.assign(E.dataset, { width: d });
1662
- }, Y = () => {
1663
- var _, E;
1664
- if (!((_ = T.current) != null && _.target)) return 0;
1665
- const d = T.current.target;
1666
- return parseFloat(((E = d == null ? void 0 : d.dataset) == null ? void 0 : E.left) || "0");
1667
- }, st = () => {
1668
- var _, E;
1669
- if (!((_ = T.current) != null && _.target)) return 0;
1670
- const d = T.current.target;
1671
- return parseFloat(((E = d == null ? void 0 : d.dataset) == null ? void 0 : E.width) || "0");
1721
+ onResizeEnd: b,
1722
+ onDragStart: w,
1723
+ onDragEnd: h,
1724
+ onDrag: x,
1725
+ parentRef: O,
1726
+ deltaScrollLeft: _
1727
+ } = n, y = c === void 0 ? Ue : c, E = a === void 0 ? Ze : a;
1728
+ let P;
1729
+ e[0] !== f ? (P = f === void 0 ? {
1730
+ left: Number.MIN_SAFE_INTEGER,
1731
+ right: Number.MAX_SAFE_INTEGER
1732
+ } : f, e[0] = f, e[1] = P) : P = e[1];
1733
+ const C = P, H = l === void 0 ? !0 : l, X = m === void 0 ? !0 : m, z = d === void 0 ? Qe : d;
1734
+ let F;
1735
+ e[2] !== g ? (F = g === void 0 ? [] : g, e[2] = g, e[3] = F) : F = e[3];
1736
+ const q = F, S = Q(void 0), R = Q(0), M = Q(!1), {
1737
+ initAutoScroll: U,
1738
+ dealDragAutoScroll: ft,
1739
+ dealResizeAutoScroll: gt,
1740
+ stopAutoScroll: u
1741
+ } = vr(O);
1742
+ let T, I;
1743
+ e[4] === Symbol.for("react.memo_cache_sentinel") ? (T = () => {
1744
+ const L = S.current;
1745
+ return () => {
1746
+ L?.unset();
1672
1747
  };
1673
- ht(() => {
1674
- var _;
1675
- if (!((_ = T.current) != null && _.target)) return;
1676
- const d = T.current.target;
1677
- W(typeof r > "u" ? d.offsetWidth : r, !1);
1678
- }, [r]), ht(() => {
1679
- j(e || 0, !1);
1680
- }, [e]), ce(x, () => ({
1681
- updateLeft: (d) => j(d || 0, !1),
1682
- updateWidth: (d) => W(d, !1),
1683
- getLeft: Y,
1684
- getWidth: st
1685
- }));
1686
- const M = () => {
1687
- b.current = 0, C.current = !1, I(), S && S();
1688
- }, U = (d) => {
1689
- const { preLeft: _, preWidth: E, scrollDelta: D } = d, w = C.current ? u : i;
1690
- if (Math.abs(b.current) >= w) {
1691
- const X = parseInt(b.current / w + "");
1692
- let R = _ + X * w, $ = R, J = Number.MAX_SAFE_INTEGER;
1693
- if (a.forEach((F) => {
1694
- const et = Math.abs(F - R);
1695
- et < u && et < J && ($ = F);
1696
- const Z = Math.abs(F - (R + E));
1697
- Z < u && Z < J && ($ = F - E);
1698
- }), $ !== R ? (C.current = !0, R = $) : ((R - s) % i !== 0 && (R = s + i * Math.round((R - s) / i)), C.current = !1), b.current = b.current % w, R < o.left ? R = o.left : R + E > o.right && (R = o.right - E), m && m(
1699
- {
1700
- lastLeft: _,
1701
- left: R,
1702
- lastWidth: E,
1703
- width: E
1704
- },
1705
- D
1706
- ) === !1)
1707
- return;
1708
- j(R, !1);
1709
- }
1710
- }, q = (d) => {
1711
- const _ = d.target;
1712
- if (v && (h != null && h.current) && !k(d, ($) => {
1713
- v($);
1714
- let { left: J, width: F } = _.dataset;
1715
- const et = parseFloat(J || "0"), Z = parseFloat(F || "0");
1716
- b.current += $, U({ preLeft: et, preWidth: Z, scrollDelta: $ });
1717
- }))
1748
+ }, I = [], e[4] = T, e[5] = I) : (T = e[4], I = e[5]), Vt(T, I);
1749
+ let V;
1750
+ e[6] === Symbol.for("react.memo_cache_sentinel") ? (V = (L, K) => {
1751
+ const B = K === void 0 ? !0 : K;
1752
+ if (!S.current || !S.current.target)
1753
+ return;
1754
+ B && (R.current = 0);
1755
+ const W = S.current.target;
1756
+ W.style.left = `${L}px`, Object.assign(W.dataset, {
1757
+ left: L
1758
+ });
1759
+ }, e[6] = V) : V = e[6];
1760
+ const _t = V;
1761
+ let vt;
1762
+ e[7] === Symbol.for("react.memo_cache_sentinel") ? (vt = (L, K) => {
1763
+ const B = K === void 0 ? !0 : K;
1764
+ if (!S.current || !S.current.target)
1765
+ return;
1766
+ B && (R.current = 0);
1767
+ const W = S.current.target;
1768
+ W.style.width = `${L}px`, Object.assign(W.dataset, {
1769
+ width: L
1770
+ });
1771
+ }, e[7] = vt) : vt = e[7];
1772
+ const D = vt;
1773
+ let rt;
1774
+ e[8] === Symbol.for("react.memo_cache_sentinel") ? (rt = () => {
1775
+ if (!S.current?.target)
1776
+ return 0;
1777
+ const L = S.current.target;
1778
+ return parseFloat(L?.dataset?.left || "0");
1779
+ }, e[8] = rt) : rt = e[8];
1780
+ const $ = rt;
1781
+ let k;
1782
+ e[9] === Symbol.for("react.memo_cache_sentinel") ? (k = () => {
1783
+ if (!S.current?.target)
1784
+ return 0;
1785
+ const L = S.current.target;
1786
+ return parseFloat(L?.dataset?.width || "0");
1787
+ }, e[9] = k) : k = e[9];
1788
+ const j = k;
1789
+ let jt, Ut;
1790
+ e[10] !== o ? (jt = () => {
1791
+ if (!S.current?.target)
1792
+ return;
1793
+ const L = S.current.target;
1794
+ D(typeof o > "u" ? L.offsetWidth : o, !1);
1795
+ }, Ut = [o], e[10] = o, e[11] = jt, e[12] = Ut) : (jt = e[11], Ut = e[12]), Vt(jt, Ut);
1796
+ let It, xt;
1797
+ e[13] !== i ? (It = () => {
1798
+ _t(i || 0, !1);
1799
+ }, xt = [i], e[13] = i, e[14] = It, e[15] = xt) : (It = e[14], xt = e[15]), Vt(It, xt);
1800
+ let Rt;
1801
+ e[16] === Symbol.for("react.memo_cache_sentinel") ? (Rt = () => ({
1802
+ updateLeft: (L) => _t(L || 0, !1),
1803
+ updateWidth: (L) => D(L, !1),
1804
+ getLeft: $,
1805
+ getWidth: j
1806
+ }), e[16] = Rt) : Rt = e[16], nn(t, Rt);
1807
+ let At;
1808
+ e[17] !== U || e[18] !== w ? (At = () => {
1809
+ R.current = 0, M.current = !1, U(), w && w();
1810
+ }, e[17] = U, e[18] = w, e[19] = At) : At = e[19];
1811
+ const Wt = At;
1812
+ let Ot;
1813
+ e[20] !== z || e[21] !== q || e[22] !== C || e[23] !== E || e[24] !== x || e[25] !== y ? (Ot = (L) => {
1814
+ const {
1815
+ preLeft: K,
1816
+ preWidth: B,
1817
+ scrollDelta: W
1818
+ } = L, tt = M.current ? z : E;
1819
+ if (Math.abs(R.current) >= tt) {
1820
+ const lt = parseInt(R.current / tt + "");
1821
+ let A = K + lt * tt, et = A;
1822
+ const ot = Number.MAX_SAFE_INTEGER;
1823
+ if (q.forEach((G) => {
1824
+ const ct = Math.abs(G - A);
1825
+ ct < z && ct < ot && (et = G);
1826
+ const dt = Math.abs(G - (A + B));
1827
+ dt < z && dt < ot && (et = G - B);
1828
+ }), et !== A ? (M.current = !0, A = et) : ((A - y) % E !== 0 && (A = y + E * Math.round((A - y) / E)), M.current = !1), R.current = R.current % tt, A < C.left ? A = C.left : A + B > C.right && (A = C.right - B), x && x({
1829
+ lastLeft: K,
1830
+ left: A,
1831
+ lastWidth: B,
1832
+ width: B
1833
+ }, W) === !1)
1718
1834
  return;
1719
- let { left: E, width: D } = _.dataset;
1720
- const w = parseFloat(E || "0"), X = parseFloat(D || "0");
1721
- b.current += d.dx, U({ preLeft: w, preWidth: X });
1722
- }, K = (d) => {
1723
- b.current = 0, C.current = !1, L();
1724
- const _ = d.target;
1725
- let { left: E, width: D } = _.dataset;
1726
- y && y({ left: parseFloat(E || "0"), width: parseFloat(D || "0") });
1727
- }, mt = (d) => {
1728
- var E;
1729
- b.current = 0, C.current = !1, I();
1730
- let _ = (E = d.edges) != null && E.right ? "right" : "left";
1731
- g && g(_);
1732
- }, dt = (d) => {
1733
- const { dir: _, preWidth: E, preLeft: D } = d, w = C.current ? u : i;
1734
- if (_ === "left") {
1735
- if (Math.abs(b.current) >= w) {
1736
- const X = parseInt(b.current / w + "");
1737
- let R = D + X * w, $ = R, J = Number.MAX_SAFE_INTEGER;
1738
- a.forEach((Z) => {
1739
- const at = Math.abs(Z - R);
1740
- at < u && at < J && ($ = Z);
1741
- }), $ !== R ? (C.current = !0, R = $) : ((R - s) % i !== 0 && (R = s + i * Math.round((R - s) / i)), C.current = !1), b.current = b.current % w;
1742
- const F = D + E;
1743
- R < o.left && (R = o.left);
1744
- const et = F - R;
1745
- if (p && p("left", {
1746
- lastLeft: D,
1747
- lastWidth: E,
1748
- left: R,
1749
- width: et
1750
- }) === !1)
1751
- return;
1752
- j(R, !1), W(et, !1);
1753
- }
1754
- } else if (_ === "right" && Math.abs(b.current) >= w) {
1755
- const X = parseInt(b.current / i + "");
1756
- let R = E + X * i, $ = D + R, J = Number.MAX_SAFE_INTEGER;
1757
- if (a.forEach((F) => {
1758
- const et = Math.abs(F - (D + R));
1759
- et < u && et < J && ($ = F);
1760
- }), $ !== D + R)
1761
- C.current = !0, R = $ - D;
1762
- else {
1763
- let F = D + R;
1764
- (F - s) % i !== 0 && (F = s + i * Math.round((F - s) / i), R = F - D), C.current = !1;
1765
- }
1766
- if (b.current = b.current % w, D + R > o.right && (R = o.right - D), p && p("right", {
1767
- lastLeft: D,
1768
- lastWidth: E,
1769
- left: D,
1770
- width: R
1835
+ _t(A, !1);
1836
+ }
1837
+ }, e[20] = z, e[21] = q, e[22] = C, e[23] = E, e[24] = x, e[25] = y, e[26] = Ot) : Ot = e[26];
1838
+ const Ct = Ot;
1839
+ let Dt;
1840
+ e[27] !== ft || e[28] !== _ || e[29] !== Ct || e[30] !== O ? (Dt = (L) => {
1841
+ const K = L.target;
1842
+ if (_ && O?.current && !ft(L, (et) => {
1843
+ _(et);
1844
+ const {
1845
+ left: ot,
1846
+ width: G
1847
+ } = K.dataset, ct = parseFloat(ot || "0"), dt = parseFloat(G || "0");
1848
+ R.current = R.current + et, Ct({
1849
+ preLeft: ct,
1850
+ preWidth: dt,
1851
+ scrollDelta: et
1852
+ });
1853
+ }))
1854
+ return;
1855
+ const {
1856
+ left: B,
1857
+ width: W
1858
+ } = K.dataset, tt = parseFloat(B || "0"), lt = parseFloat(W || "0");
1859
+ R.current = R.current + L.dx, Ct({
1860
+ preLeft: tt,
1861
+ preWidth: lt
1862
+ });
1863
+ }, e[27] = ft, e[28] = _, e[29] = Ct, e[30] = O, e[31] = Dt) : Dt = e[31];
1864
+ const te = Dt;
1865
+ let J;
1866
+ e[32] !== h || e[33] !== u ? (J = (L) => {
1867
+ R.current = 0, M.current = !1, u();
1868
+ const K = L.target, {
1869
+ left: B,
1870
+ width: W
1871
+ } = K.dataset;
1872
+ h && h({
1873
+ left: parseFloat(B || "0"),
1874
+ width: parseFloat(W || "0")
1875
+ });
1876
+ }, e[32] = h, e[33] = u, e[34] = J) : J = e[34];
1877
+ const Z = J;
1878
+ let Y;
1879
+ e[35] !== U || e[36] !== v ? (Y = (L) => {
1880
+ R.current = 0, M.current = !1, U();
1881
+ const K = L.edges?.right ? "right" : "left";
1882
+ v && v(K);
1883
+ }, e[35] = U, e[36] = v, e[37] = Y) : Y = e[37];
1884
+ const it = Y;
1885
+ let bt;
1886
+ e[38] !== z || e[39] !== q || e[40] !== C || e[41] !== E || e[42] !== p || e[43] !== y ? (bt = (L) => {
1887
+ const {
1888
+ dir: K,
1889
+ preWidth: B,
1890
+ preLeft: W
1891
+ } = L, tt = M.current ? z : E;
1892
+ if (K === "left") {
1893
+ if (Math.abs(R.current) >= tt) {
1894
+ const lt = parseInt(R.current / tt + "");
1895
+ let A = W + lt * tt, et = A;
1896
+ const ot = Number.MAX_SAFE_INTEGER;
1897
+ q.forEach((dt) => {
1898
+ const Nt = Math.abs(dt - A);
1899
+ Nt < z && Nt < ot && (et = dt);
1900
+ }), et !== A ? (M.current = !0, A = et) : ((A - y) % E !== 0 && (A = y + E * Math.round((A - y) / E)), M.current = !1), R.current = R.current % tt;
1901
+ const G = W + B;
1902
+ A < C.left && (A = C.left);
1903
+ const ct = G - A;
1904
+ if (p && p("left", {
1905
+ lastLeft: W,
1906
+ lastWidth: B,
1907
+ left: A,
1908
+ width: ct
1771
1909
  }) === !1)
1772
1910
  return;
1773
- W(R, !1);
1911
+ _t(A, !1), D(ct, !1);
1774
1912
  }
1775
- }, f = (d) => {
1776
- var $, J, F;
1777
- const _ = d.target, E = ($ = d.edges) != null && $.left ? "left" : "right";
1778
- if (v && (h != null && h.current) && !N(d, E, (Z) => {
1779
- v(Z);
1780
- let { left: at, width: wt } = _.dataset;
1781
- const ut = parseFloat(at || "0"), Ot = parseFloat(wt || "0");
1782
- b.current += Z, dt({ preLeft: ut, preWidth: Ot, dir: E });
1783
- }))
1913
+ } else if (K === "right" && Math.abs(R.current) >= tt) {
1914
+ const lt = parseInt(R.current / E + "");
1915
+ let A = B + lt * E, et = W + A;
1916
+ const ot = Number.MAX_SAFE_INTEGER;
1917
+ if (q.forEach((G) => {
1918
+ const ct = Math.abs(G - (W + A));
1919
+ ct < z && ct < ot && (et = G);
1920
+ }), et !== W + A)
1921
+ M.current = !0, A = et - W;
1922
+ else {
1923
+ let G = W + A;
1924
+ (G - y) % E !== 0 && (G = y + E * Math.round((G - y) / E), A = G - W), M.current = !1;
1925
+ }
1926
+ if (R.current = R.current % tt, W + A > C.right && (A = C.right - W), p && p("right", {
1927
+ lastLeft: W,
1928
+ lastWidth: B,
1929
+ left: W,
1930
+ width: A
1931
+ }) === !1)
1784
1932
  return;
1785
- let { left: D, width: w } = _.dataset;
1786
- const X = parseFloat(D || "0"), R = parseFloat(w || "0");
1787
- b.current += E === "left" ? ((J = d.deltaRect) == null ? void 0 : J.left) || 0 : ((F = d.deltaRect) == null ? void 0 : F.right) || 0, dt({ preLeft: X, preWidth: R, dir: E });
1788
- }, A = (d) => {
1789
- var X;
1790
- b.current = 0, C.current = !1, L();
1791
- const _ = d.target;
1792
- let { left: E, width: D } = _.dataset, w = (X = d.edges) != null && X.right ? "right" : "left";
1793
- O && O(w, {
1794
- left: parseFloat(E || "0"),
1795
- width: parseFloat(D || "0")
1933
+ D(A, !1);
1934
+ }
1935
+ }, e[38] = z, e[39] = q, e[40] = C, e[41] = E, e[42] = p, e[43] = y, e[44] = bt) : bt = e[44];
1936
+ const Tt = bt;
1937
+ let Pt;
1938
+ e[45] !== gt || e[46] !== _ || e[47] !== O || e[48] !== Tt ? (Pt = (L) => {
1939
+ const K = L.target, B = L.edges?.left ? "left" : "right";
1940
+ if (_ && O?.current && !gt(L, B, (ot) => {
1941
+ _(ot);
1942
+ const {
1943
+ left: G,
1944
+ width: ct
1945
+ } = K.dataset, dt = parseFloat(G || "0"), Nt = parseFloat(ct || "0");
1946
+ R.current = R.current + ot, Tt({
1947
+ preLeft: dt,
1948
+ preWidth: Nt,
1949
+ dir: B
1796
1950
  });
1797
- };
1798
- return /* @__PURE__ */ P.jsx(
1799
- hr,
1800
- {
1801
- interactRef: T,
1802
- draggable: l,
1803
- resizable: c,
1804
- draggableOptions: {
1805
- lockAxis: "x",
1806
- onmove: q,
1807
- onstart: M,
1808
- onend: K,
1809
- cursorChecker: () => ""
1810
- },
1811
- resizableOptions: {
1812
- axis: "x",
1813
- invert: "none",
1814
- edges: t,
1815
- onmove: f,
1816
- onstart: mt,
1817
- onend: A
1818
- },
1819
- children: Xe({ children: n, style: { left: e, width: r } })
1820
- }
1821
- );
1822
- }
1823
- ), He = Et.forwardRef(({ children: n }, t) => {
1824
- const [e, r] = Et.useState({
1951
+ }))
1952
+ return;
1953
+ const {
1954
+ left: W,
1955
+ width: tt
1956
+ } = K.dataset, lt = parseFloat(W || "0"), A = parseFloat(tt || "0");
1957
+ R.current = R.current + (B === "left" ? L.deltaRect?.left || 0 : L.deltaRect?.right || 0), Tt({
1958
+ preLeft: lt,
1959
+ preWidth: A,
1960
+ dir: B
1961
+ });
1962
+ }, e[45] = gt, e[46] = _, e[47] = O, e[48] = Tt, e[49] = Pt) : Pt = e[49];
1963
+ const Ht = Pt;
1964
+ let Bt;
1965
+ e[50] !== b || e[51] !== u ? (Bt = (L) => {
1966
+ R.current = 0, M.current = !1, u();
1967
+ const K = L.target, {
1968
+ left: B,
1969
+ width: W
1970
+ } = K.dataset, tt = L.edges?.right ? "right" : "left";
1971
+ b && b(tt, {
1972
+ left: parseFloat(B || "0"),
1973
+ width: parseFloat(W || "0")
1974
+ });
1975
+ }, e[50] = b, e[51] = u, e[52] = Bt) : Bt = e[52];
1976
+ const ee = Bt;
1977
+ let kt;
1978
+ e[53] !== te || e[54] !== Wt || e[55] !== Z ? (kt = {
1979
+ lockAxis: "x",
1980
+ onmove: te,
1981
+ onstart: Wt,
1982
+ onend: Z,
1983
+ cursorChecker: ms
1984
+ }, e[53] = te, e[54] = Wt, e[55] = Z, e[56] = kt) : kt = e[56];
1985
+ let zt;
1986
+ e[57] !== s || e[58] !== Ht || e[59] !== it || e[60] !== ee ? (zt = {
1987
+ axis: "x",
1988
+ invert: "none",
1989
+ edges: s,
1990
+ onmove: Ht,
1991
+ onstart: it,
1992
+ onend: ee
1993
+ }, e[57] = s, e[58] = Ht, e[59] = it, e[60] = ee, e[61] = zt) : zt = e[61];
1994
+ const Yt = r;
1995
+ let Ft;
1996
+ e[62] !== i || e[63] !== Yt || e[64] !== o ? (Ft = Bn({
1997
+ children: Yt,
1998
+ style: {
1999
+ left: i,
2000
+ width: o
2001
+ }
2002
+ }), e[62] = i, e[63] = Yt, e[64] = o, e[65] = Ft) : Ft = e[65];
2003
+ let Xt;
2004
+ return e[66] !== X || e[67] !== H || e[68] !== kt || e[69] !== zt || e[70] !== Ft ? (Xt = /* @__PURE__ */ N.jsx(hs, { interactRef: S, draggable: X, resizable: H, draggableOptions: kt, resizableOptions: zt, children: Ft }), e[66] = X, e[67] = H, e[68] = kt, e[69] = zt, e[70] = Ft, e[71] = Xt) : Xt = e[71], Xt;
2005
+ });
2006
+ function ms() {
2007
+ return "";
2008
+ }
2009
+ const Yn = Jt.forwardRef(({
2010
+ children: n
2011
+ }, t) => {
2012
+ const [e, r] = Jt.useState({
1825
2013
  clientHeight: 0,
1826
2014
  clientWidth: 0,
1827
2015
  scrollHeight: 0,
1828
2016
  scrollLeft: 0,
1829
2017
  scrollTop: 0,
1830
2018
  scrollWidth: 0
1831
- }), s = Et.useCallback((i) => {
1832
- r((o) => ({ ...o, ...i }));
2019
+ }), s = Jt.useCallback((i) => {
2020
+ r((o) => ({
2021
+ ...o,
2022
+ ...i
2023
+ }));
1833
2024
  }, []);
1834
- return Et.useImperativeHandle(t, () => ({
2025
+ return Jt.useImperativeHandle(t, () => ({
1835
2026
  get state() {
1836
2027
  return e;
1837
2028
  },
@@ -1842,164 +2033,150 @@ const hr = ({ children: n, interactRef: t, draggable: e, resizable: r, draggable
1842
2033
  onScroll: s
1843
2034
  });
1844
2035
  });
1845
- He.displayName = "ScrollSync";
1846
- const pr = ({
1847
- disableDrag: n,
1848
- cursorTime: t,
1849
- setCursor: e,
1850
- startLeft: r,
1851
- timelineWidth: s,
1852
- scaleWidth: i,
1853
- scale: o,
1854
- scrollLeft: c,
1855
- scrollSync: l,
1856
- areaRef: u,
1857
- maxScaleCount: a,
1858
- deltaScrollLeft: g,
1859
- onCursorDragStart: p,
1860
- onCursorDrag: O,
1861
- onCursorDragEnd: S
1862
- }) => {
1863
- const y = V(null), m = V(void 0);
1864
- ht(() => {
1865
- if (typeof m.current > "u" && y.current) {
1866
- const b = r ?? 20, C = i ?? 160, I = o ?? 1;
1867
- y.current.updateLeft(
1868
- pt(t, {
1869
- startLeft: b,
1870
- scaleWidth: C,
1871
- scale: I
1872
- }) - c
1873
- );
2036
+ Yn.displayName = "ScrollSync";
2037
+ const ps = (n) => {
2038
+ const t = Qt.c(42), {
2039
+ disableDrag: e,
2040
+ cursorTime: r,
2041
+ setCursor: s,
2042
+ startLeft: i,
2043
+ timelineWidth: o,
2044
+ scaleWidth: c,
2045
+ scale: a,
2046
+ scrollLeft: f,
2047
+ scrollSync: l,
2048
+ areaRef: m,
2049
+ maxScaleCount: d,
2050
+ deltaScrollLeft: g,
2051
+ onCursorDragStart: v,
2052
+ onCursorDrag: p,
2053
+ onCursorDragEnd: b
2054
+ } = n, w = Q(null), h = Q(void 0);
2055
+ let x, O;
2056
+ t[0] !== r || t[1] !== a || t[2] !== c || t[3] !== f || t[4] !== i ? (x = () => {
2057
+ if (typeof h.current > "u" && w.current) {
2058
+ const ft = i ?? 20, gt = c ?? 160, u = a ?? 1;
2059
+ w.current.updateLeft($t(r, {
2060
+ startLeft: ft,
2061
+ scaleWidth: gt,
2062
+ scale: u
2063
+ }) - f);
1874
2064
  }
1875
- }, [t, r, i, o, c]);
1876
- const h = r ?? 20, v = i ?? 160, x = o ?? 1, T = a ?? 1 / 0;
1877
- return /* @__PURE__ */ P.jsx(
1878
- Ge,
1879
- {
1880
- start: h,
1881
- ref: y,
1882
- parentRef: u,
1883
- bounds: {
1884
- left: 0,
1885
- right: Math.min(
1886
- s,
1887
- T * v + h - c
1888
- )
1889
- },
1890
- deltaScrollLeft: g,
1891
- enableDragging: !n,
1892
- enableResizing: !1,
1893
- onDragStart: () => {
1894
- var b;
1895
- p && p(t), m.current = pt(t, {
1896
- startLeft: h,
1897
- scaleWidth: v,
1898
- scale: x
1899
- }) - c, (b = y.current) == null || b.updateLeft(m.current);
1900
- },
1901
- onDragEnd: () => {
1902
- if (typeof m.current < "u") {
1903
- const b = Tt(m.current + c, {
1904
- startLeft: h,
1905
- scale: x,
1906
- scaleWidth: v
1907
- });
1908
- e({ time: b }), S && S(b);
1909
- }
1910
- m.current = void 0;
1911
- },
1912
- onDrag: ({ left: b }, C = 0) => {
1913
- var k, N;
1914
- if (!((k = l.current) != null && k.state)) return !1;
1915
- const I = l.current.state.scrollLeft;
1916
- if (!C || I === 0 ? b < h - I ? m.current = h - I : m.current = b : typeof m.current < "u" && m.current < h - I - C && (m.current = h - I - C), typeof m.current < "u") {
1917
- (N = y.current) == null || N.updateLeft(m.current);
1918
- const L = Tt(
1919
- m.current + I,
1920
- { startLeft: h, scale: x, scaleWidth: v }
1921
- );
1922
- e({ time: L }), O && O(L);
1923
- }
1924
- return !1;
1925
- },
1926
- children: /* @__PURE__ */ P.jsxs("div", { className: tt("cursor"), children: [
1927
- /* @__PURE__ */ P.jsx(
1928
- "svg",
1929
- {
1930
- className: tt("cursor-top"),
1931
- width: "8",
1932
- height: "12",
1933
- viewBox: "0 0 8 12",
1934
- fill: "none",
1935
- children: /* @__PURE__ */ P.jsx(
1936
- "path",
1937
- {
1938
- d: "M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",
1939
- fill: "#5297FF"
1940
- }
1941
- )
1942
- }
1943
- ),
1944
- /* @__PURE__ */ P.jsx("div", { className: tt("cursor-area") })
1945
- ] })
2065
+ }, O = [r, i, c, a, f], t[0] = r, t[1] = a, t[2] = c, t[3] = f, t[4] = i, t[5] = x, t[6] = O) : (x = t[5], O = t[6]), Vt(x, O);
2066
+ const _ = i ?? 20, y = c ?? 160, E = a ?? 1, C = Math.min(o, (d ?? 1 / 0) * y + _ - f);
2067
+ let H;
2068
+ t[7] !== C ? (H = {
2069
+ left: 0,
2070
+ right: C
2071
+ }, t[7] = C, t[8] = H) : H = t[8];
2072
+ const X = !e;
2073
+ let z;
2074
+ t[9] !== r || t[10] !== _ || t[11] !== v || t[12] !== E || t[13] !== f || t[14] !== y ? (z = () => {
2075
+ v && v(r), h.current = $t(r, {
2076
+ startLeft: _,
2077
+ scaleWidth: y,
2078
+ scale: E
2079
+ }) - f, w.current?.updateLeft(h.current);
2080
+ }, t[9] = r, t[10] = _, t[11] = v, t[12] = E, t[13] = f, t[14] = y, t[15] = z) : z = t[15];
2081
+ let F;
2082
+ t[16] !== _ || t[17] !== b || t[18] !== E || t[19] !== f || t[20] !== s || t[21] !== y ? (F = () => {
2083
+ if (typeof h.current < "u") {
2084
+ const ft = re(h.current + f, {
2085
+ startLeft: _,
2086
+ scale: E,
2087
+ scaleWidth: y
2088
+ });
2089
+ s({
2090
+ time: ft
2091
+ }), b && b(ft);
1946
2092
  }
1947
- );
2093
+ h.current = void 0;
2094
+ }, t[16] = _, t[17] = b, t[18] = E, t[19] = f, t[20] = s, t[21] = y, t[22] = F) : F = t[22];
2095
+ let q;
2096
+ t[23] !== _ || t[24] !== p || t[25] !== E || t[26] !== l.current || t[27] !== s || t[28] !== y ? (q = (ft, gt) => {
2097
+ const {
2098
+ left: u
2099
+ } = ft, T = gt === void 0 ? 0 : gt;
2100
+ if (!l.current?.state)
2101
+ return !1;
2102
+ const I = l.current.state.scrollLeft;
2103
+ if (!T || I === 0 ? u < _ - I ? h.current = _ - I : h.current = u : typeof h.current < "u" && h.current < _ - I - T && (h.current = _ - I - T), typeof h.current < "u") {
2104
+ w.current?.updateLeft(h.current);
2105
+ const V = re(h.current + I, {
2106
+ startLeft: _,
2107
+ scale: E,
2108
+ scaleWidth: y
2109
+ });
2110
+ s({
2111
+ time: V
2112
+ }), p && p(V);
2113
+ }
2114
+ return !1;
2115
+ }, t[23] = _, t[24] = p, t[25] = E, t[26] = l.current, t[27] = s, t[28] = y, t[29] = q) : q = t[29];
2116
+ let S, R;
2117
+ t[30] === Symbol.for("react.memo_cache_sentinel") ? (R = mt("cursor"), S = mt("cursor-top"), t[30] = S, t[31] = R) : (S = t[30], R = t[31]);
2118
+ let M;
2119
+ t[32] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ N.jsxs("div", { className: R, children: [
2120
+ /* @__PURE__ */ N.jsx("svg", { className: S, width: "8", height: "12", viewBox: "0 0 8 12", fill: "none", children: /* @__PURE__ */ N.jsx("path", { d: "M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z", fill: "#5297FF" }) }),
2121
+ /* @__PURE__ */ N.jsx("div", { className: mt("cursor-area") })
2122
+ ] }), t[32] = M) : M = t[32];
2123
+ let U;
2124
+ return t[33] !== m || t[34] !== g || t[35] !== _ || t[36] !== H || t[37] !== X || t[38] !== z || t[39] !== F || t[40] !== q ? (U = /* @__PURE__ */ N.jsx(Xn, { start: _, ref: w, parentRef: m, bounds: H, deltaScrollLeft: g, enableDragging: X, enableResizing: !1, onDragStart: z, onDragEnd: F, onDrag: q, children: M }), t[33] = m, t[34] = g, t[35] = _, t[36] = H, t[37] = X, t[38] = z, t[39] = F, t[40] = q, t[41] = U) : U = t[41], U;
1948
2125
  };
1949
- function Ct(n, t, e) {
2126
+ function Se(n, t, e) {
1950
2127
  let r = e.initialDeps ?? [], s;
1951
2128
  function i() {
1952
- var o, c, l, u;
1953
- let a;
1954
- e.key && ((o = e.debug) != null && o.call(e)) && (a = Date.now());
1955
- const g = n();
1956
- if (!(g.length !== r.length || g.some((S, y) => r[y] !== S)))
2129
+ var o, c, a, f;
2130
+ let l;
2131
+ e.key && ((o = e.debug) != null && o.call(e)) && (l = Date.now());
2132
+ const m = n();
2133
+ if (!(m.length !== r.length || m.some((v, p) => r[p] !== v)))
1957
2134
  return s;
1958
- r = g;
1959
- let O;
1960
- if (e.key && ((c = e.debug) != null && c.call(e)) && (O = Date.now()), s = t(...g), e.key && ((l = e.debug) != null && l.call(e))) {
1961
- const S = Math.round((Date.now() - a) * 100) / 100, y = Math.round((Date.now() - O) * 100) / 100, m = y / 16, h = (v, x) => {
1962
- for (v = String(v); v.length < x; )
1963
- v = " " + v;
1964
- return v;
2135
+ r = m;
2136
+ let g;
2137
+ if (e.key && ((c = e.debug) != null && c.call(e)) && (g = Date.now()), s = t(...m), e.key && ((a = e.debug) != null && a.call(e))) {
2138
+ const v = Math.round((Date.now() - l) * 100) / 100, p = Math.round((Date.now() - g) * 100) / 100, b = p / 16, w = (h, x) => {
2139
+ for (h = String(h); h.length < x; )
2140
+ h = " " + h;
2141
+ return h;
1965
2142
  };
1966
2143
  console.info(
1967
- `%c⏱ ${h(y, 5)} /${h(S, 5)} ms`,
2144
+ `%c⏱ ${w(p, 5)} /${w(v, 5)} ms`,
1968
2145
  `
1969
2146
  font-size: .6rem;
1970
2147
  font-weight: bold;
1971
2148
  color: hsl(${Math.max(
1972
2149
  0,
1973
- Math.min(120 - 120 * m, 120)
2150
+ Math.min(120 - 120 * b, 120)
1974
2151
  )}deg 100% 31%);`,
1975
- e == null ? void 0 : e.key
2152
+ e?.key
1976
2153
  );
1977
2154
  }
1978
- return (u = e == null ? void 0 : e.onChange) == null || u.call(e, s), s;
2155
+ return (f = e?.onChange) == null || f.call(e, s), s;
1979
2156
  }
1980
2157
  return i.updateDeps = (o) => {
1981
2158
  r = o;
1982
2159
  }, i;
1983
2160
  }
1984
- function Ae(n, t) {
2161
+ function An(n, t) {
1985
2162
  if (n === void 0)
1986
2163
  throw new Error("Unexpected undefined");
1987
2164
  return n;
1988
2165
  }
1989
- const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
2166
+ const gs = (n, t) => Math.abs(n - t) < 1.01, _s = (n, t, e) => {
1990
2167
  let r;
1991
2168
  return function(...s) {
1992
2169
  n.clearTimeout(r), r = n.setTimeout(() => t.apply(this, s), e);
1993
2170
  };
1994
- }, Re = (n) => {
2171
+ }, On = (n) => {
1995
2172
  const { offsetWidth: t, offsetHeight: e } = n;
1996
2173
  return { width: t, height: e };
1997
- }, vr = (n) => n, br = (n) => {
2174
+ }, vs = (n) => n, bs = (n) => {
1998
2175
  const t = Math.max(n.startIndex - n.overscan, 0), e = Math.min(n.endIndex + n.overscan, n.count - 1), r = [];
1999
2176
  for (let s = t; s <= e; s++)
2000
2177
  r.push(s);
2001
2178
  return r;
2002
- }, yr = (n, t) => {
2179
+ }, ys = (n, t) => {
2003
2180
  const e = n.scrollElement;
2004
2181
  if (!e)
2005
2182
  return;
@@ -2007,32 +2184,32 @@ const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
2007
2184
  if (!r)
2008
2185
  return;
2009
2186
  const s = (o) => {
2010
- const { width: c, height: l } = o;
2011
- t({ width: Math.round(c), height: Math.round(l) });
2187
+ const { width: c, height: a } = o;
2188
+ t({ width: Math.round(c), height: Math.round(a) });
2012
2189
  };
2013
- if (s(Re(e)), !r.ResizeObserver)
2190
+ if (s(On(e)), !r.ResizeObserver)
2014
2191
  return () => {
2015
2192
  };
2016
2193
  const i = new r.ResizeObserver((o) => {
2017
2194
  const c = () => {
2018
- const l = o[0];
2019
- if (l != null && l.borderBoxSize) {
2020
- const u = l.borderBoxSize[0];
2021
- if (u) {
2022
- s({ width: u.inlineSize, height: u.blockSize });
2195
+ const a = o[0];
2196
+ if (a?.borderBoxSize) {
2197
+ const f = a.borderBoxSize[0];
2198
+ if (f) {
2199
+ s({ width: f.inlineSize, height: f.blockSize });
2023
2200
  return;
2024
2201
  }
2025
2202
  }
2026
- s(Re(e));
2203
+ s(On(e));
2027
2204
  };
2028
2205
  n.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(c) : c();
2029
2206
  });
2030
2207
  return i.observe(e, { box: "border-box" }), () => {
2031
2208
  i.unobserve(e);
2032
2209
  };
2033
- }, Ce = {
2210
+ }, Cn = {
2034
2211
  passive: !0
2035
- }, De = typeof window > "u" ? !0 : "onscrollend" in window, _r = (n, t) => {
2212
+ }, Dn = typeof window > "u" ? !0 : "onscrollend" in window, ws = (n, t) => {
2036
2213
  const e = n.scrollElement;
2037
2214
  if (!e)
2038
2215
  return;
@@ -2040,24 +2217,24 @@ const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
2040
2217
  if (!r)
2041
2218
  return;
2042
2219
  let s = 0;
2043
- const i = n.options.useScrollendEvent && De ? () => {
2044
- } : gr(
2220
+ const i = n.options.useScrollendEvent && Dn ? () => {
2221
+ } : _s(
2045
2222
  r,
2046
2223
  () => {
2047
2224
  t(s, !1);
2048
2225
  },
2049
2226
  n.options.isScrollingResetDelay
2050
- ), o = (a) => () => {
2051
- const { horizontal: g, isRtl: p } = n.options;
2052
- s = g ? e.scrollLeft * (p && -1 || 1) : e.scrollTop, i(), t(s, a);
2053
- }, c = o(!0), l = o(!1);
2054
- l(), e.addEventListener("scroll", c, Ce);
2055
- const u = n.options.useScrollendEvent && De;
2056
- return u && e.addEventListener("scrollend", l, Ce), () => {
2057
- e.removeEventListener("scroll", c), u && e.removeEventListener("scrollend", l);
2227
+ ), o = (l) => () => {
2228
+ const { horizontal: m, isRtl: d } = n.options;
2229
+ s = m ? e.scrollLeft * (d && -1 || 1) : e.scrollTop, i(), t(s, l);
2230
+ }, c = o(!0), a = o(!1);
2231
+ a(), e.addEventListener("scroll", c, Cn);
2232
+ const f = n.options.useScrollendEvent && Dn;
2233
+ return f && e.addEventListener("scrollend", a, Cn), () => {
2234
+ e.removeEventListener("scroll", c), f && e.removeEventListener("scrollend", a);
2058
2235
  };
2059
- }, Er = (n, t, e) => {
2060
- if (t != null && t.borderBoxSize) {
2236
+ }, Es = (n, t, e) => {
2237
+ if (t?.borderBoxSize) {
2061
2238
  const r = t.borderBoxSize[0];
2062
2239
  if (r)
2063
2240
  return Math.round(
@@ -2065,7 +2242,7 @@ const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
2065
2242
  );
2066
2243
  }
2067
2244
  return n[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
2068
- }, wr = (n, {
2245
+ }, Ss = (n, {
2069
2246
  adjustments: t = 0,
2070
2247
  behavior: e
2071
2248
  }, r) => {
@@ -2076,7 +2253,7 @@ const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
2076
2253
  behavior: e
2077
2254
  });
2078
2255
  };
2079
- class Sr {
2256
+ class xs {
2080
2257
  constructor(t) {
2081
2258
  this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
2082
2259
  let e = null;
@@ -2114,11 +2291,11 @@ class Sr {
2114
2291
  scrollPaddingStart: 0,
2115
2292
  scrollPaddingEnd: 0,
2116
2293
  horizontal: !1,
2117
- getItemKey: vr,
2118
- rangeExtractor: br,
2294
+ getItemKey: vs,
2295
+ rangeExtractor: bs,
2119
2296
  onChange: () => {
2120
2297
  },
2121
- measureElement: Er,
2298
+ measureElement: Es,
2122
2299
  initialRect: { width: 0, height: 0 },
2123
2300
  scrollMargin: 0,
2124
2301
  gap: 0,
@@ -2135,7 +2312,7 @@ class Sr {
2135
2312
  }, this.notify = (e) => {
2136
2313
  var r, s;
2137
2314
  (s = (r = this.options).onChange) == null || s.call(r, this, e);
2138
- }, this.maybeNotify = Ct(
2315
+ }, this.maybeNotify = Se(
2139
2316
  () => (this.calculateRange(), [
2140
2317
  this.isScrolling,
2141
2318
  this.range ? this.range.startIndex : null,
@@ -2186,14 +2363,14 @@ class Sr {
2186
2363
  const c = e[o];
2187
2364
  if (s.has(c.lane))
2188
2365
  continue;
2189
- const l = i.get(
2366
+ const a = i.get(
2190
2367
  c.lane
2191
2368
  );
2192
- if (l == null || c.end > l.end ? i.set(c.lane, c) : c.end < l.end && s.set(c.lane, !0), s.size === this.options.lanes)
2369
+ if (a == null || c.end > a.end ? i.set(c.lane, c) : c.end < a.end && s.set(c.lane, !0), s.size === this.options.lanes)
2193
2370
  break;
2194
2371
  }
2195
2372
  return i.size === this.options.lanes ? Array.from(i.values()).sort((o, c) => o.end === c.end ? o.index - c.index : o.end - c.end)[0] : void 0;
2196
- }, this.getMeasurementOptions = Ct(
2373
+ }, this.getMeasurementOptions = Se(
2197
2374
  () => [
2198
2375
  this.options.count,
2199
2376
  this.options.paddingStart,
@@ -2211,42 +2388,42 @@ class Sr {
2211
2388
  {
2212
2389
  key: !1
2213
2390
  }
2214
- ), this.getMeasurements = Ct(
2391
+ ), this.getMeasurements = Se(
2215
2392
  () => [this.getMeasurementOptions(), this.itemSizeCache],
2216
2393
  ({ count: e, paddingStart: r, scrollMargin: s, getItemKey: i, enabled: o }, c) => {
2217
2394
  if (!o)
2218
2395
  return this.measurementsCache = [], this.itemSizeCache.clear(), [];
2219
- this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((a) => {
2220
- this.itemSizeCache.set(a.key, a.size);
2396
+ this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
2397
+ this.itemSizeCache.set(l.key, l.size);
2221
2398
  }));
2222
- const l = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
2399
+ const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
2223
2400
  this.pendingMeasuredCacheIndexes = [];
2224
- const u = this.measurementsCache.slice(0, l);
2225
- for (let a = l; a < e; a++) {
2226
- const g = i(a), p = this.options.lanes === 1 ? u[a - 1] : this.getFurthestMeasurement(u, a), O = p ? p.end + this.options.gap : r + s, S = c.get(g), y = typeof S == "number" ? S : this.options.estimateSize(a), m = O + y, h = p ? p.lane : a % this.options.lanes;
2227
- u[a] = {
2228
- index: a,
2229
- start: O,
2230
- size: y,
2231
- end: m,
2232
- key: g,
2233
- lane: h
2401
+ const f = this.measurementsCache.slice(0, a);
2402
+ for (let l = a; l < e; l++) {
2403
+ const m = i(l), d = this.options.lanes === 1 ? f[l - 1] : this.getFurthestMeasurement(f, l), g = d ? d.end + this.options.gap : r + s, v = c.get(m), p = typeof v == "number" ? v : this.options.estimateSize(l), b = g + p, w = d ? d.lane : l % this.options.lanes;
2404
+ f[l] = {
2405
+ index: l,
2406
+ start: g,
2407
+ size: p,
2408
+ end: b,
2409
+ key: m,
2410
+ lane: w
2234
2411
  };
2235
2412
  }
2236
- return this.measurementsCache = u, u;
2413
+ return this.measurementsCache = f, f;
2237
2414
  },
2238
2415
  {
2239
2416
  key: process.env.NODE_ENV !== "production" && "getMeasurements",
2240
2417
  debug: () => this.options.debug
2241
2418
  }
2242
- ), this.calculateRange = Ct(
2419
+ ), this.calculateRange = Se(
2243
2420
  () => [
2244
2421
  this.getMeasurements(),
2245
2422
  this.getSize(),
2246
2423
  this.getScrollOffset(),
2247
2424
  this.options.lanes
2248
2425
  ],
2249
- (e, r, s, i) => this.range = e.length > 0 && r > 0 ? xr({
2426
+ (e, r, s, i) => this.range = e.length > 0 && r > 0 ? Rs({
2250
2427
  measurements: e,
2251
2428
  outerSize: r,
2252
2429
  scrollOffset: s,
@@ -2256,7 +2433,7 @@ class Sr {
2256
2433
  key: process.env.NODE_ENV !== "production" && "calculateRange",
2257
2434
  debug: () => this.options.debug
2258
2435
  }
2259
- ), this.getVirtualIndexes = Ct(
2436
+ ), this.getVirtualIndexes = Se(
2260
2437
  () => {
2261
2438
  let e = null, r = null;
2262
2439
  const s = this.calculateRange();
@@ -2306,13 +2483,13 @@ class Sr {
2306
2483
  return;
2307
2484
  }
2308
2485
  this._measureElement(e, void 0);
2309
- }, this.getVirtualItems = Ct(
2486
+ }, this.getVirtualItems = Se(
2310
2487
  () => [this.getVirtualIndexes(), this.getMeasurements()],
2311
2488
  (e, r) => {
2312
2489
  const s = [];
2313
2490
  for (let i = 0, o = e.length; i < o; i++) {
2314
- const c = e[i], l = r[c];
2315
- s.push(l);
2491
+ const c = e[i], a = r[c];
2492
+ s.push(a);
2316
2493
  }
2317
2494
  return s;
2318
2495
  },
@@ -2323,11 +2500,11 @@ class Sr {
2323
2500
  ), this.getVirtualItemForOffset = (e) => {
2324
2501
  const r = this.getMeasurements();
2325
2502
  if (r.length !== 0)
2326
- return Ae(
2327
- r[Ye(
2503
+ return An(
2504
+ r[Gn(
2328
2505
  0,
2329
2506
  r.length - 1,
2330
- (s) => Ae(r[s]).start,
2507
+ (s) => An(r[s]).start,
2331
2508
  e
2332
2509
  )]
2333
2510
  );
@@ -2366,24 +2543,24 @@ class Sr {
2366
2543
  "The `smooth` scroll behavior is not fully supported with dynamic size."
2367
2544
  ), e = Math.max(0, Math.min(e, this.options.count - 1));
2368
2545
  let i = 0;
2369
- const o = 10, c = (u) => {
2546
+ const o = 10, c = (f) => {
2370
2547
  if (!this.targetWindow) return;
2371
- const a = this.getOffsetForIndex(e, u);
2372
- if (!a) {
2548
+ const l = this.getOffsetForIndex(e, f);
2549
+ if (!l) {
2373
2550
  console.warn("Failed to get offset for index:", e);
2374
2551
  return;
2375
2552
  }
2376
- const [g, p] = a;
2377
- this._scrollToOffset(g, { adjustments: void 0, behavior: s }), this.targetWindow.requestAnimationFrame(() => {
2378
- const O = this.getScrollOffset(), S = this.getOffsetForIndex(e, p);
2379
- if (!S) {
2553
+ const [m, d] = l;
2554
+ this._scrollToOffset(m, { adjustments: void 0, behavior: s }), this.targetWindow.requestAnimationFrame(() => {
2555
+ const g = this.getScrollOffset(), v = this.getOffsetForIndex(e, d);
2556
+ if (!v) {
2380
2557
  console.warn("Failed to get offset for index:", e);
2381
2558
  return;
2382
2559
  }
2383
- mr(S[0], O) || l(p);
2560
+ gs(v[0], g) || a(d);
2384
2561
  });
2385
- }, l = (u) => {
2386
- this.targetWindow && (i++, i < o ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", i, o), this.targetWindow.requestAnimationFrame(() => c(u))) : console.warn(
2562
+ }, a = (f) => {
2563
+ this.targetWindow && (i++, i < o ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", i, o), this.targetWindow.requestAnimationFrame(() => c(f))) : console.warn(
2387
2564
  `Failed to scroll to index ${e} after ${o} attempts.`
2388
2565
  ));
2389
2566
  };
@@ -2426,7 +2603,7 @@ class Sr {
2426
2603
  }, this.setOptions(t);
2427
2604
  }
2428
2605
  }
2429
- const Ye = (n, t, e, r) => {
2606
+ const Gn = (n, t, e, r) => {
2430
2607
  for (; n <= t; ) {
2431
2608
  const s = (n + t) / 2 | 0, i = e(s);
2432
2609
  if (i < r)
@@ -2438,19 +2615,19 @@ const Ye = (n, t, e, r) => {
2438
2615
  }
2439
2616
  return n > 0 ? n - 1 : 0;
2440
2617
  };
2441
- function xr({
2618
+ function Rs({
2442
2619
  measurements: n,
2443
2620
  outerSize: t,
2444
2621
  scrollOffset: e,
2445
2622
  lanes: r
2446
2623
  }) {
2447
- const s = n.length - 1, i = (l) => n[l].start;
2624
+ const s = n.length - 1, i = (a) => n[a].start;
2448
2625
  if (n.length <= r)
2449
2626
  return {
2450
2627
  startIndex: 0,
2451
2628
  endIndex: s
2452
2629
  };
2453
- let o = Ye(
2630
+ let o = Gn(
2454
2631
  0,
2455
2632
  s,
2456
2633
  i,
@@ -2460,279 +2637,540 @@ function xr({
2460
2637
  for (; c < s && n[c].end < e + t; )
2461
2638
  c++;
2462
2639
  else if (r > 1) {
2463
- const l = Array(r).fill(0);
2464
- for (; c < s && l.some((a) => a < e + t); ) {
2465
- const a = n[c];
2466
- l[a.lane] = a.end, c++;
2640
+ const a = Array(r).fill(0);
2641
+ for (; c < s && a.some((l) => l < e + t); ) {
2642
+ const l = n[c];
2643
+ a[l.lane] = l.end, c++;
2467
2644
  }
2468
- const u = Array(r).fill(e + t);
2469
- for (; o >= 0 && u.some((a) => a >= e); ) {
2470
- const a = n[o];
2471
- u[a.lane] = a.start, o--;
2645
+ const f = Array(r).fill(e + t);
2646
+ for (; o >= 0 && f.some((l) => l >= e); ) {
2647
+ const l = n[o];
2648
+ f[l.lane] = l.start, o--;
2472
2649
  }
2473
2650
  o = Math.max(0, o - o % r), c = Math.min(s, c + (r - 1 - c % r));
2474
2651
  }
2475
2652
  return { startIndex: o, endIndex: c };
2476
2653
  }
2477
- const Me = typeof document < "u" ? Et.useLayoutEffect : Et.useEffect;
2478
- function Tr(n) {
2479
- const t = Et.useReducer(() => ({}), {})[1], e = {
2654
+ const Ln = typeof document < "u" ? Jt.useLayoutEffect : Jt.useEffect;
2655
+ function Ts(n) {
2656
+ const t = Jt.useReducer(() => ({}), {})[1], e = {
2480
2657
  ...n,
2481
2658
  onChange: (s, i) => {
2482
2659
  var o;
2483
- i ? rn(t) : t(), (o = n.onChange) == null || o.call(n, s, i);
2660
+ i ? tr(t) : t(), (o = n.onChange) == null || o.call(n, s, i);
2484
2661
  }
2485
- }, [r] = Et.useState(
2486
- () => new Sr(e)
2662
+ }, [r] = Jt.useState(
2663
+ () => new xs(e)
2487
2664
  );
2488
- return r.setOptions(e), Me(() => r._didMount(), []), Me(() => r._willUpdate()), r;
2665
+ return r.setOptions(e), Ln(() => r._didMount(), []), Ln(() => r._willUpdate()), r;
2489
2666
  }
2490
- function Ke(n) {
2491
- return Tr({
2492
- observeElementRect: yr,
2493
- observeElementOffset: _r,
2494
- scrollToFn: wr,
2667
+ function Kn(n) {
2668
+ return Ts({
2669
+ observeElementRect: ys,
2670
+ observeElementOffset: ws,
2671
+ scrollToFn: Ss,
2495
2672
  ...n
2496
2673
  });
2497
2674
  }
2498
- const Or = ({
2499
- isMoving: n,
2500
- movePositions: t = [],
2501
- assistPositions: e = [],
2502
- scrollLeft: r
2503
- }) => /* @__PURE__ */ P.jsx("div", { className: tt("drag-line-container"), children: n && t.filter((s) => e.includes(s)).map((s, i) => /* @__PURE__ */ P.jsx("div", { className: tt("drag-line"), style: { left: s - r } }, i)) }), Ar = ({
2504
- editorData: n,
2505
- row: t,
2506
- action: e,
2507
- effects: r,
2508
- rowHeight: s,
2509
- scale: i,
2510
- scaleWidth: o,
2511
- scaleSplitCount: c,
2512
- startLeft: l,
2513
- gridSnap: u,
2514
- disableDrag: a,
2515
- scaleCount: g,
2516
- maxScaleCount: p,
2517
- setScaleCount: O,
2518
- onActionMoveStart: S,
2519
- onActionMoving: y,
2520
- onActionMoveEnd: m,
2521
- onActionResizeStart: h,
2522
- onActionResizeEnd: v,
2523
- onActionResizing: x,
2524
- dragLineData: T,
2525
- setEditorData: b,
2526
- onClickAction: C,
2527
- onClickActionOnly: I,
2528
- onDoubleClickAction: k,
2529
- onContextMenuAction: N,
2530
- getActionRender: L,
2531
- handleTime: j,
2532
- areaRef: W,
2533
- deltaScrollLeft: Y
2534
- }) => {
2535
- const st = V(null), M = V(!1), { id: U, maxEnd: q, minStart: K, end: mt, start: dt, selected: f, flexible: A = !0, movable: d = !0, effectId: _ } = e, E = i ?? $t, D = o ?? Bt, w = l ?? Ht, X = c ?? Ie, R = p ?? Number.MAX_SAFE_INTEGER, $ = pt(K || 0, {
2536
- startLeft: w,
2537
- scale: E,
2538
- scaleWidth: D
2539
- }), J = Math.min(
2540
- R * D + w,
2541
- // Limit movement range based on maxScaleCount
2542
- pt(q || Number.MAX_VALUE, {
2543
- startLeft: w,
2544
- scale: E,
2545
- scaleWidth: D
2546
- })
2547
- ), F = en(() => Ne({ start: dt, end: mt }, { startLeft: w, scale: E, scaleWidth: D }), [mt, dt, w, D, E]), [et, Z] = xt(null), at = et ?? F, wt = D / X, ut = ["action"];
2548
- d && ut.push("action-movable"), f && ut.push("action-selected"), A && ut.push("action-flexible"), r[_] && ut.push(`action-effect-${_}`);
2549
- const Ot = (z, B) => {
2550
- const it = mn(z + B, {
2551
- startLeft: w,
2675
+ const As = (n) => {
2676
+ const t = Qt.c(12), {
2677
+ isMoving: e,
2678
+ movePositions: r,
2679
+ assistPositions: s,
2680
+ scrollLeft: i
2681
+ } = n;
2682
+ let o, c;
2683
+ if (t[0] !== e || t[1] !== i || t[2] !== r || t[3] !== s) {
2684
+ const f = r === void 0 ? [] : r;
2685
+ let l;
2686
+ t[6] !== s ? (l = s === void 0 ? [] : s, t[6] = s, t[7] = l) : l = t[7];
2687
+ const m = l;
2688
+ t[8] === Symbol.for("react.memo_cache_sentinel") ? (o = mt("drag-line-container"), t[8] = o) : o = t[8], c = e && f.filter((d) => m.includes(d)).map((d, g) => /* @__PURE__ */ N.jsx("div", { className: mt("drag-line"), style: {
2689
+ left: d - i
2690
+ } }, g)), t[0] = e, t[1] = i, t[2] = r, t[3] = s, t[4] = o, t[5] = c;
2691
+ } else
2692
+ o = t[4], c = t[5];
2693
+ let a;
2694
+ return t[9] !== o || t[10] !== c ? (a = /* @__PURE__ */ N.jsx("div", { className: o, children: c }), t[9] = o, t[10] = c, t[11] = a) : a = t[11], a;
2695
+ }, Os = (n) => {
2696
+ const t = Qt.c(198), {
2697
+ editorData: e,
2698
+ row: r,
2699
+ action: s,
2700
+ effects: i,
2701
+ rowHeight: o,
2702
+ scale: c,
2703
+ scaleWidth: a,
2704
+ scaleSplitCount: f,
2705
+ startLeft: l,
2706
+ gridSnap: m,
2707
+ disableDrag: d,
2708
+ scaleCount: g,
2709
+ maxScaleCount: v,
2710
+ setScaleCount: p,
2711
+ onActionMoveStart: b,
2712
+ onActionMoving: w,
2713
+ onActionMoveEnd: h,
2714
+ onActionResizeStart: x,
2715
+ onActionResizeEnd: O,
2716
+ onActionResizing: _,
2717
+ dragLineData: y,
2718
+ setEditorData: E,
2719
+ onClickAction: P,
2720
+ onClickActionOnly: C,
2721
+ onDoubleClickAction: H,
2722
+ onContextMenuAction: X,
2723
+ getActionRender: z,
2724
+ handleTime: F,
2725
+ areaRef: q,
2726
+ deltaScrollLeft: S
2727
+ } = n, R = Q(null), M = Q(!1), {
2728
+ id: U,
2729
+ maxEnd: ft,
2730
+ minStart: gt,
2731
+ end: u,
2732
+ start: T,
2733
+ selected: I,
2734
+ flexible: V,
2735
+ movable: _t,
2736
+ effectId: vt
2737
+ } = s, D = V === void 0 ? !0 : V, rt = _t === void 0 ? !0 : _t, $ = c ?? ze, k = a ?? Fe, j = l ?? Ue, jt = f ?? Mn, Ut = v ?? Number.MAX_SAFE_INTEGER, It = gt || 0;
2738
+ let xt;
2739
+ t[0] !== $ || t[1] !== k || t[2] !== j || t[3] !== It ? (xt = $t(It, {
2740
+ startLeft: j,
2741
+ scale: $,
2742
+ scaleWidth: k
2743
+ }), t[0] = $, t[1] = k, t[2] = j, t[3] = It, t[4] = xt) : xt = t[4];
2744
+ const Rt = xt, At = ft || Number.MAX_VALUE;
2745
+ let Wt;
2746
+ t[5] !== $ || t[6] !== k || t[7] !== j || t[8] !== At ? (Wt = $t(At, {
2747
+ startLeft: j,
2748
+ scale: $,
2749
+ scaleWidth: k
2750
+ }), t[5] = $, t[6] = k, t[7] = j, t[8] = At, t[9] = Wt) : Wt = t[9];
2751
+ const Ot = Math.min(Ut * k + j, Wt);
2752
+ let Ct;
2753
+ t[10] !== u || t[11] !== $ || t[12] !== k || t[13] !== j || t[14] !== T ? (Ct = Nn({
2754
+ start: T,
2755
+ end: u
2756
+ }, {
2757
+ startLeft: j,
2758
+ scale: $,
2759
+ scaleWidth: k
2760
+ }), t[10] = u, t[11] = $, t[12] = k, t[13] = j, t[14] = T, t[15] = Ct) : Ct = t[15];
2761
+ const Dt = Ct, [te, J] = ne(null), Z = te ?? Dt, Y = k / jt;
2762
+ let it;
2763
+ t[16] !== vt || t[17] !== i || t[18] !== D || t[19] !== rt || t[20] !== I ? (it = ["action"], rt && it.push("action-movable"), I && it.push("action-selected"), D && it.push("action-flexible"), i[vt] && it.push(`action-effect-${vt}`), t[16] = vt, t[17] = i, t[18] = D, t[19] = rt, t[20] = I, t[21] = it) : it = t[21];
2764
+ let bt;
2765
+ t[22] !== k || t[23] !== j || t[24] !== g || t[25] !== p ? (bt = (yt, wt) => {
2766
+ const st = dr(yt + wt, {
2767
+ startLeft: j,
2552
2768
  scaleCount: g,
2553
- scaleWidth: D
2769
+ scaleWidth: k
2554
2770
  });
2555
- it !== g && O(it);
2556
- }, Kt = () => {
2557
- S && S({ action: e, row: t });
2558
- }, jt = ({ left: z, width: B }) => {
2559
- if (M.current = !0, y) {
2560
- const { start: it, end: ft } = kt({ left: z, width: B }, { scaleWidth: D, scale: E, startLeft: w });
2561
- if (y({ action: e, row: t, start: it, end: ft }) === !1) return !1;
2562
- }
2563
- Z({ left: z, width: B }), Ot(z, B);
2564
- }, St = ({ left: z, width: B }) => {
2565
- const { start: it, end: ft } = kt({ left: z, width: B }, { scaleWidth: D, scale: E, startLeft: w }), gt = n.find((bt) => bt.id === t.id);
2566
- if (!gt) return;
2567
- const vt = gt.actions.find((bt) => bt.id === U);
2568
- vt && (vt.start = it, vt.end = ft, b(n), m && m({ action: vt, row: t, start: it, end: ft }), Z(null));
2569
- }, qt = (z) => {
2570
- h && h({ action: e, row: t, dir: z });
2571
- }, Q = (z, { left: B, width: it }) => {
2572
- if (M.current = !0, x) {
2573
- const { start: ft, end: gt } = kt({ left: B, width: it }, { scaleWidth: D, scale: E, startLeft: w });
2574
- if (x({ action: e, row: t, start: ft, end: gt, dir: z }) === !1) return !1;
2575
- }
2576
- Z({ left: B, width: it }), Ot(B, it);
2577
- }, nt = (z, { left: B, width: it }) => {
2578
- const { start: ft, end: gt } = kt({ left: B, width: it }, { scaleWidth: D, scale: E, startLeft: w }), vt = n.find((Jt) => Jt.id === t.id);
2579
- if (!vt) return;
2580
- const bt = vt.actions.find((Jt) => Jt.id === U);
2581
- bt && (bt.start = ft, bt.end = gt, b(n), v && v({ action: bt, row: t, start: ft, end: gt, dir: z }), Z(null));
2582
- }, H = {
2583
- ...e,
2584
- ...kt({ left: at.left, width: at.width }, { startLeft: w, scaleWidth: D, scale: E })
2585
- }, At = {
2586
- ...t,
2587
- actions: [...t.actions]
2588
- };
2589
- return t.actions.includes(e) && (At.actions[t.actions.indexOf(e)] = H), /* @__PURE__ */ P.jsx(
2590
- Ge,
2591
- {
2592
- ref: st,
2593
- parentRef: W,
2594
- start: w,
2595
- left: at.left,
2596
- width: at.width,
2597
- grid: u && wt || re,
2598
- adsorptionDistance: u ? Math.max((wt || re) / 2, se) : se,
2599
- adsorptionPositions: T.assistPositions,
2600
- bounds: {
2601
- left: $,
2602
- right: J
2603
- },
2604
- edges: {
2605
- left: !a && A && `.${tt("action-left-stretch")}`,
2606
- right: !a && A && `.${tt("action-right-stretch")}`
2607
- },
2608
- enableDragging: !a && d,
2609
- enableResizing: !a && A,
2610
- onDragStart: Kt,
2611
- onDrag: jt,
2612
- onDragEnd: St,
2613
- onResizeStart: qt,
2614
- onResize: Q,
2615
- onResizeEnd: nt,
2616
- deltaScrollLeft: Y,
2617
- children: /* @__PURE__ */ P.jsxs(
2618
- "div",
2619
- {
2620
- onMouseDown: () => {
2621
- M.current = !1;
2622
- },
2623
- onClick: (z) => {
2624
- let B;
2625
- C && (B = j(z), C(z, { row: t, action: e, time: B })), !M.current && I && (B === void 0 && (B = j(z)), I(z, { row: t, action: e, time: B }));
2626
- },
2627
- onDoubleClick: (z) => {
2628
- if (k) {
2629
- const B = j(z);
2630
- k(z, { row: t, action: e, time: B });
2631
- }
2632
- },
2633
- onContextMenu: (z) => {
2634
- if (N) {
2635
- const B = j(z);
2636
- N(z, { row: t, action: e, time: B });
2637
- }
2638
- },
2639
- className: tt((ut || []).join(" ")),
2640
- style: { height: s },
2641
- children: [
2642
- L && L(H, At),
2643
- A && /* @__PURE__ */ P.jsx("div", { className: tt("action-left-stretch"), style: { touchAction: "none" } }),
2644
- A && /* @__PURE__ */ P.jsx("div", { className: tt("action-right-stretch"), style: { touchAction: "none" } })
2645
- ]
2646
- }
2647
- )
2648
- }
2649
- );
2650
- }, Rr = (n) => {
2651
- const { rowData: t, style: e = {}, onClickRow: r, onDoubleClickRow: s, onContextMenuRow: i, areaRef: o, scrollLeft: c, startLeft: l, scale: u, scaleWidth: a } = n, g = ["edit-row"];
2652
- t != null && t.selected && g.push("edit-row-selected");
2653
- const p = u ?? $t, O = a ?? Bt, S = l ?? Ht, y = (m) => {
2654
- if (!o.current) return 0;
2655
- const h = o.current.getBoundingClientRect(), x = m.clientX - h.x + c;
2656
- return Tt(x, { startLeft: S, scale: p, scaleWidth: O });
2657
- };
2658
- return /* @__PURE__ */ P.jsx(
2659
- "div",
2660
- {
2661
- className: `${tt(...g)} ${((t == null ? void 0 : t.classNames) || []).join(" ")}`,
2662
- style: e,
2663
- onClick: (m) => {
2664
- if (t && r) {
2665
- const h = y(m);
2666
- r(m, { row: t, time: h });
2667
- }
2668
- },
2669
- onDoubleClick: (m) => {
2670
- if (t && s) {
2671
- const h = y(m);
2672
- s(m, { row: t, time: h });
2673
- }
2674
- },
2675
- onContextMenu: (m) => {
2676
- if (t && i) {
2677
- const h = y(m);
2678
- i(m, { row: t, time: h });
2679
- }
2680
- },
2681
- children: t && (t.actions || []).map((m) => /* @__PURE__ */ P.jsx(Ar, { ...n, handleTime: y, row: t, action: m }, m.id))
2771
+ st !== g && p(st);
2772
+ }, t[22] = k, t[23] = j, t[24] = g, t[25] = p, t[26] = bt) : bt = t[26];
2773
+ const Tt = bt;
2774
+ let Pt;
2775
+ t[27] !== s || t[28] !== b || t[29] !== r ? (Pt = () => {
2776
+ b && b({
2777
+ action: s,
2778
+ row: r
2779
+ });
2780
+ }, t[27] = s, t[28] = b, t[29] = r, t[30] = Pt) : Pt = t[30];
2781
+ const Ht = Pt;
2782
+ let Bt;
2783
+ t[31] !== s || t[32] !== Tt || t[33] !== w || t[34] !== r || t[35] !== $ || t[36] !== k || t[37] !== j ? (Bt = (yt) => {
2784
+ const {
2785
+ left: wt,
2786
+ width: st
2787
+ } = yt;
2788
+ if (M.current = !0, w) {
2789
+ const {
2790
+ start: ht,
2791
+ end: Et
2792
+ } = Ae({
2793
+ left: wt,
2794
+ width: st
2795
+ }, {
2796
+ scaleWidth: k,
2797
+ scale: $,
2798
+ startLeft: j
2799
+ });
2800
+ if (w({
2801
+ action: s,
2802
+ row: r,
2803
+ start: ht,
2804
+ end: Et
2805
+ }) === !1)
2806
+ return !1;
2682
2807
  }
2683
- );
2684
- };
2685
- function Cr() {
2686
- const [n, t] = xt({ isMoving: !1, movePositions: [], assistPositions: [] });
2687
- return {
2688
- initDragLine: (c) => {
2689
- const { movePositions: l, assistPositions: u } = c;
2690
- t({
2691
- isMoving: !0,
2692
- movePositions: l || [],
2693
- assistPositions: u || []
2808
+ J({
2809
+ left: wt,
2810
+ width: st
2811
+ }), Tt(wt, st);
2812
+ }, t[31] = s, t[32] = Tt, t[33] = w, t[34] = r, t[35] = $, t[36] = k, t[37] = j, t[38] = Bt) : Bt = t[38];
2813
+ const ee = Bt;
2814
+ let kt;
2815
+ t[39] !== e || t[40] !== U || t[41] !== h || t[42] !== r || t[43] !== $ || t[44] !== k || t[45] !== j || t[46] !== E ? (kt = (yt) => {
2816
+ const {
2817
+ left: wt,
2818
+ width: st
2819
+ } = yt, {
2820
+ start: ht,
2821
+ end: Et
2822
+ } = Ae({
2823
+ left: wt,
2824
+ width: st
2825
+ }, {
2826
+ scaleWidth: k,
2827
+ scale: $,
2828
+ startLeft: j
2829
+ }), Lt = e.find((ut) => ut.id === r.id);
2830
+ if (!Lt)
2831
+ return;
2832
+ const at = Lt.actions.find((ut) => ut.id === U);
2833
+ at && (at.start = ht, at.end = Et, E(e), h && h({
2834
+ action: at,
2835
+ row: r,
2836
+ start: ht,
2837
+ end: Et
2838
+ }), J(null));
2839
+ }, t[39] = e, t[40] = U, t[41] = h, t[42] = r, t[43] = $, t[44] = k, t[45] = j, t[46] = E, t[47] = kt) : kt = t[47];
2840
+ const zt = kt;
2841
+ let Yt;
2842
+ t[48] !== s || t[49] !== x || t[50] !== r ? (Yt = (yt) => {
2843
+ x && x({
2844
+ action: s,
2845
+ row: r,
2846
+ dir: yt
2847
+ });
2848
+ }, t[48] = s, t[49] = x, t[50] = r, t[51] = Yt) : Yt = t[51];
2849
+ const Ft = Yt;
2850
+ let Xt;
2851
+ t[52] !== s || t[53] !== Tt || t[54] !== _ || t[55] !== r || t[56] !== $ || t[57] !== k || t[58] !== j ? (Xt = (yt, wt) => {
2852
+ const {
2853
+ left: st,
2854
+ width: ht
2855
+ } = wt;
2856
+ if (M.current = !0, _) {
2857
+ const {
2858
+ start: Et,
2859
+ end: Lt
2860
+ } = Ae({
2861
+ left: st,
2862
+ width: ht
2863
+ }, {
2864
+ scaleWidth: k,
2865
+ scale: $,
2866
+ startLeft: j
2694
2867
  });
2695
- },
2696
- updateDragLine: (c) => {
2697
- const { movePositions: l, assistPositions: u } = c;
2698
- t((a) => ({
2699
- ...a,
2700
- movePositions: l || a.movePositions,
2701
- assistPositions: u || a.assistPositions
2868
+ if (_({
2869
+ action: s,
2870
+ row: r,
2871
+ start: Et,
2872
+ end: Lt,
2873
+ dir: yt
2874
+ }) === !1)
2875
+ return !1;
2876
+ }
2877
+ J({
2878
+ left: st,
2879
+ width: ht
2880
+ }), Tt(st, ht);
2881
+ }, t[52] = s, t[53] = Tt, t[54] = _, t[55] = r, t[56] = $, t[57] = k, t[58] = j, t[59] = Xt) : Xt = t[59];
2882
+ const L = Xt;
2883
+ let K;
2884
+ t[60] !== e || t[61] !== U || t[62] !== O || t[63] !== r || t[64] !== $ || t[65] !== k || t[66] !== j || t[67] !== E ? (K = (yt, wt) => {
2885
+ const {
2886
+ left: st,
2887
+ width: ht
2888
+ } = wt, {
2889
+ start: Et,
2890
+ end: Lt
2891
+ } = Ae({
2892
+ left: st,
2893
+ width: ht
2894
+ }, {
2895
+ scaleWidth: k,
2896
+ scale: $,
2897
+ startLeft: j
2898
+ }), at = e.find((Be) => Be.id === r.id);
2899
+ if (!at)
2900
+ return;
2901
+ const ut = at.actions.find((Be) => Be.id === U);
2902
+ ut && (ut.start = Et, ut.end = Lt, E(e), O && O({
2903
+ action: ut,
2904
+ row: r,
2905
+ start: Et,
2906
+ end: Lt,
2907
+ dir: yt
2908
+ }), J(null));
2909
+ }, t[60] = e, t[61] = U, t[62] = O, t[63] = r, t[64] = $, t[65] = k, t[66] = j, t[67] = E, t[68] = K) : K = t[68];
2910
+ const B = K;
2911
+ let W, tt, lt, A, et, ot, G, ct, dt, Nt, se, ie, oe, ce, ae, le, Gt, Kt, ue, fe, de, he, me, pe, ge, _e, ve;
2912
+ if (t[69] !== s || t[70] !== q || t[71] !== it || t[72] !== S || t[73] !== d || t[74] !== y.assistPositions || t[75] !== D || t[76] !== z || t[77] !== Y || t[78] !== m || t[79] !== ee || t[80] !== zt || t[81] !== Ht || t[82] !== B || t[83] !== Ft || t[84] !== L || t[85] !== F || t[86] !== Rt || t[87] !== rt || t[88] !== P || t[89] !== C || t[90] !== X || t[91] !== H || t[92] !== Ot || t[93] !== r || t[94] !== o || t[95] !== $ || t[96] !== k || t[97] !== j || t[98] !== Z.left || t[99] !== Z.width) {
2913
+ const yt = {
2914
+ ...s,
2915
+ ...Ae({
2916
+ left: Z.left,
2917
+ width: Z.width
2918
+ }, {
2919
+ startLeft: j,
2920
+ scaleWidth: k,
2921
+ scale: $
2922
+ })
2923
+ }, wt = {
2924
+ ...r,
2925
+ actions: [...r.actions]
2926
+ };
2927
+ r.actions.includes(s) && (wt.actions[r.actions.indexOf(s)] = yt), W = Xn, dt = R, Nt = q, se = j, ie = Z.left, oe = Z.width, ce = m && Y || Ze, ae = m ? Math.max((Y || Ze) / 2, Qe) : Qe, le = y.assistPositions, t[127] !== Rt || t[128] !== Ot ? (Gt = {
2928
+ left: Rt,
2929
+ right: Ot
2930
+ }, t[127] = Rt, t[128] = Ot, t[129] = Gt) : Gt = t[129];
2931
+ let st;
2932
+ t[130] !== d || t[131] !== D ? (st = !d && D && `.${mt("action-left-stretch")}`, t[130] = d, t[131] = D, t[132] = st) : st = t[132];
2933
+ let ht;
2934
+ t[133] !== d || t[134] !== D ? (ht = !d && D && `.${mt("action-right-stretch")}`, t[133] = d, t[134] = D, t[135] = ht) : ht = t[135], t[136] !== st || t[137] !== ht ? (Kt = {
2935
+ left: st,
2936
+ right: ht
2937
+ }, t[136] = st, t[137] = ht, t[138] = Kt) : Kt = t[138], ue = !d && rt, fe = !d && D, de = Ht, he = ee, me = zt, pe = Ft, ge = L, _e = B, ve = S, t[139] === Symbol.for("react.memo_cache_sentinel") ? (tt = () => {
2938
+ M.current = !1;
2939
+ }, t[139] = tt) : tt = t[139], t[140] !== s || t[141] !== F || t[142] !== P || t[143] !== C || t[144] !== r ? (lt = (at) => {
2940
+ let ut;
2941
+ P && (ut = F(at), P(at, {
2942
+ row: r,
2943
+ action: s,
2944
+ time: ut
2945
+ })), !M.current && C && (ut === void 0 && (ut = F(at)), C(at, {
2946
+ row: r,
2947
+ action: s,
2948
+ time: ut
2702
2949
  }));
2703
- },
2704
- disposeDragLine: () => {
2705
- t({ isMoving: !1, movePositions: [], assistPositions: [] });
2706
- },
2707
- dragLineData: n,
2708
- defaultGetAssistPosition: (c) => {
2709
- const { editorData: l, assistActionIds: u, action: a, row: g, scale: p, scaleWidth: O, startLeft: S, cursorLeft: y, hideCursor: m } = c, h = [];
2710
- u ? l.forEach((x) => {
2711
- x.actions.forEach((T) => {
2712
- u.includes(T.id) && h.push(T);
2950
+ }, t[140] = s, t[141] = F, t[142] = P, t[143] = C, t[144] = r, t[145] = lt) : lt = t[145], t[146] !== s || t[147] !== F || t[148] !== H || t[149] !== r ? (A = (at) => {
2951
+ if (H) {
2952
+ const ut = F(at);
2953
+ H(at, {
2954
+ row: r,
2955
+ action: s,
2956
+ time: ut
2713
2957
  });
2714
- }) : l.forEach((x) => {
2715
- x.id !== g.id ? h.push(...x.actions) : x.actions.forEach((T) => {
2716
- T.id !== a.id && h.push(T);
2958
+ }
2959
+ }, t[146] = s, t[147] = F, t[148] = H, t[149] = r, t[150] = A) : A = t[150], t[151] !== s || t[152] !== F || t[153] !== X || t[154] !== r ? (et = (at) => {
2960
+ if (X) {
2961
+ const ut = F(at);
2962
+ X(at, {
2963
+ row: r,
2964
+ action: s,
2965
+ time: ut
2717
2966
  });
2967
+ }
2968
+ }, t[151] = s, t[152] = F, t[153] = X, t[154] = r, t[155] = et) : et = t[155];
2969
+ let Et;
2970
+ t[156] !== it ? (Et = it || [], t[156] = it, t[157] = Et) : Et = t[157];
2971
+ const Lt = Et.join(" ");
2972
+ t[158] !== Lt ? (ot = mt(Lt), t[158] = Lt, t[159] = ot) : ot = t[159], t[160] !== o ? (G = {
2973
+ height: o
2974
+ }, t[160] = o, t[161] = G) : G = t[161], ct = z && z(yt, wt), t[69] = s, t[70] = q, t[71] = it, t[72] = S, t[73] = d, t[74] = y.assistPositions, t[75] = D, t[76] = z, t[77] = Y, t[78] = m, t[79] = ee, t[80] = zt, t[81] = Ht, t[82] = B, t[83] = Ft, t[84] = L, t[85] = F, t[86] = Rt, t[87] = rt, t[88] = P, t[89] = C, t[90] = X, t[91] = H, t[92] = Ot, t[93] = r, t[94] = o, t[95] = $, t[96] = k, t[97] = j, t[98] = Z.left, t[99] = Z.width, t[100] = W, t[101] = tt, t[102] = lt, t[103] = A, t[104] = et, t[105] = ot, t[106] = G, t[107] = ct, t[108] = dt, t[109] = Nt, t[110] = se, t[111] = ie, t[112] = oe, t[113] = ce, t[114] = ae, t[115] = le, t[116] = Gt, t[117] = Kt, t[118] = ue, t[119] = fe, t[120] = de, t[121] = he, t[122] = me, t[123] = pe, t[124] = ge, t[125] = _e, t[126] = ve;
2975
+ } else
2976
+ W = t[100], tt = t[101], lt = t[102], A = t[103], et = t[104], ot = t[105], G = t[106], ct = t[107], dt = t[108], Nt = t[109], se = t[110], ie = t[111], oe = t[112], ce = t[113], ae = t[114], le = t[115], Gt = t[116], Kt = t[117], ue = t[118], fe = t[119], de = t[120], he = t[121], me = t[122], pe = t[123], ge = t[124], _e = t[125], ve = t[126];
2977
+ let be;
2978
+ t[162] !== D ? (be = D && /* @__PURE__ */ N.jsx("div", { className: mt("action-left-stretch"), style: {
2979
+ touchAction: "none"
2980
+ } }), t[162] = D, t[163] = be) : be = t[163];
2981
+ let ye;
2982
+ t[164] !== D ? (ye = D && /* @__PURE__ */ N.jsx("div", { className: mt("action-right-stretch"), style: {
2983
+ touchAction: "none"
2984
+ } }), t[164] = D, t[165] = ye) : ye = t[165];
2985
+ let we;
2986
+ t[166] !== tt || t[167] !== lt || t[168] !== A || t[169] !== et || t[170] !== ot || t[171] !== G || t[172] !== ct || t[173] !== be || t[174] !== ye ? (we = /* @__PURE__ */ N.jsxs("div", { onMouseDown: tt, onClick: lt, onDoubleClick: A, onContextMenu: et, className: ot, style: G, children: [
2987
+ ct,
2988
+ be,
2989
+ ye
2990
+ ] }), t[166] = tt, t[167] = lt, t[168] = A, t[169] = et, t[170] = ot, t[171] = G, t[172] = ct, t[173] = be, t[174] = ye, t[175] = we) : we = t[175];
2991
+ let De;
2992
+ return t[176] !== W || t[177] !== dt || t[178] !== Nt || t[179] !== se || t[180] !== ie || t[181] !== oe || t[182] !== ce || t[183] !== ae || t[184] !== le || t[185] !== Gt || t[186] !== Kt || t[187] !== ue || t[188] !== fe || t[189] !== de || t[190] !== he || t[191] !== me || t[192] !== pe || t[193] !== ge || t[194] !== _e || t[195] !== ve || t[196] !== we ? (De = /* @__PURE__ */ N.jsx(W, { ref: dt, parentRef: Nt, start: se, left: ie, width: oe, grid: ce, adsorptionDistance: ae, adsorptionPositions: le, bounds: Gt, edges: Kt, enableDragging: ue, enableResizing: fe, onDragStart: de, onDrag: he, onDragEnd: me, onResizeStart: pe, onResize: ge, onResizeEnd: _e, deltaScrollLeft: ve, children: we }), t[176] = W, t[177] = dt, t[178] = Nt, t[179] = se, t[180] = ie, t[181] = oe, t[182] = ce, t[183] = ae, t[184] = le, t[185] = Gt, t[186] = Kt, t[187] = ue, t[188] = fe, t[189] = de, t[190] = he, t[191] = me, t[192] = pe, t[193] = ge, t[194] = _e, t[195] = ve, t[196] = we, t[197] = De) : De = t[197], De;
2993
+ }, Cs = (n) => {
2994
+ const t = Qt.c(43), {
2995
+ rowData: e,
2996
+ style: r,
2997
+ onClickRow: s,
2998
+ onDoubleClickRow: i,
2999
+ onContextMenuRow: o,
3000
+ areaRef: c,
3001
+ scrollLeft: a,
3002
+ startLeft: f,
3003
+ scale: l,
3004
+ scaleWidth: m
3005
+ } = n;
3006
+ let d;
3007
+ t[0] !== r ? (d = r === void 0 ? {} : r, t[0] = r, t[1] = d) : d = t[1];
3008
+ const g = d;
3009
+ let v, p;
3010
+ if (t[2] !== c || t[3] !== e?.selected || t[4] !== l || t[5] !== m || t[6] !== a || t[7] !== f) {
3011
+ const P = ["edit-row"];
3012
+ e?.selected && P.push("edit-row-selected");
3013
+ const C = l ?? ze, H = m ?? Fe, X = f ?? Ue;
3014
+ let z;
3015
+ t[10] !== c || t[11] !== C || t[12] !== H || t[13] !== X || t[14] !== a ? (z = (F) => {
3016
+ if (!c.current)
3017
+ return 0;
3018
+ const q = c.current.getBoundingClientRect(), R = F.clientX - q.x + a;
3019
+ return re(R, {
3020
+ startLeft: X,
3021
+ scale: C,
3022
+ scaleWidth: H
2718
3023
  });
2719
- const v = gn(h, {
2720
- startLeft: S,
2721
- scale: p,
2722
- scaleWidth: O
3024
+ }, t[10] = c, t[11] = C, t[12] = H, t[13] = X, t[14] = a, t[15] = z) : z = t[15], v = z, p = mt(...P), t[2] = c, t[3] = e?.selected, t[4] = l, t[5] = m, t[6] = a, t[7] = f, t[8] = v, t[9] = p;
3025
+ } else
3026
+ v = t[8], p = t[9];
3027
+ let b;
3028
+ t[16] !== e?.classNames ? (b = e?.classNames || [], t[16] = e?.classNames, t[17] = b) : b = t[17];
3029
+ let w;
3030
+ t[18] !== b ? (w = b.join(" "), t[18] = b, t[19] = w) : w = t[19];
3031
+ const h = `${p} ${w}`;
3032
+ let x;
3033
+ t[20] !== v || t[21] !== s || t[22] !== e ? (x = (P) => {
3034
+ if (e && s) {
3035
+ const C = v(P);
3036
+ s(P, {
3037
+ row: e,
3038
+ time: C
2723
3039
  });
2724
- return m || v.push(y), v;
2725
- },
2726
- defaultGetMovePosition: (c) => {
2727
- const { start: l, end: u, dir: a, scale: g, scaleWidth: p, startLeft: O } = c, { left: S, width: y } = Ne({ start: l, end: u }, { startLeft: O, scaleWidth: p, scale: g });
2728
- return a ? a === "right" ? [S + y] : [S] : [S, S + y];
2729
3040
  }
2730
- };
3041
+ }, t[20] = v, t[21] = s, t[22] = e, t[23] = x) : x = t[23];
3042
+ let O;
3043
+ t[24] !== v || t[25] !== i || t[26] !== e ? (O = (P) => {
3044
+ if (e && i) {
3045
+ const C = v(P);
3046
+ i(P, {
3047
+ row: e,
3048
+ time: C
3049
+ });
3050
+ }
3051
+ }, t[24] = v, t[25] = i, t[26] = e, t[27] = O) : O = t[27];
3052
+ let _;
3053
+ t[28] !== v || t[29] !== o || t[30] !== e ? (_ = (P) => {
3054
+ if (e && o) {
3055
+ const C = v(P);
3056
+ o(P, {
3057
+ row: e,
3058
+ time: C
3059
+ });
3060
+ }
3061
+ }, t[28] = v, t[29] = o, t[30] = e, t[31] = _) : _ = t[31];
3062
+ let y;
3063
+ t[32] !== v || t[33] !== n || t[34] !== e ? (y = e && (e.actions || []).map((P) => /* @__PURE__ */ N.jsx(Os, { ...n, handleTime: v, row: e, action: P }, P.id)), t[32] = v, t[33] = n, t[34] = e, t[35] = y) : y = t[35];
3064
+ let E;
3065
+ return t[36] !== g || t[37] !== h || t[38] !== x || t[39] !== O || t[40] !== _ || t[41] !== y ? (E = /* @__PURE__ */ N.jsx("div", { className: h, style: g, onClick: x, onDoubleClick: O, onContextMenu: _, children: y }), t[36] = g, t[37] = h, t[38] = x, t[39] = O, t[40] = _, t[41] = y, t[42] = E) : E = t[42], E;
3066
+ };
3067
+ function Ds() {
3068
+ const n = Qt.c(6);
3069
+ let t;
3070
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
3071
+ isMoving: !1,
3072
+ movePositions: [],
3073
+ assistPositions: []
3074
+ }, n[0] = t) : t = n[0];
3075
+ const [e, r] = ne(t), s = Ms, i = Ls;
3076
+ let o;
3077
+ n[1] === Symbol.for("react.memo_cache_sentinel") ? (o = (g) => {
3078
+ const {
3079
+ movePositions: v,
3080
+ assistPositions: p
3081
+ } = g;
3082
+ r({
3083
+ isMoving: !0,
3084
+ movePositions: v || [],
3085
+ assistPositions: p || []
3086
+ });
3087
+ }, n[1] = o) : o = n[1];
3088
+ const c = o;
3089
+ let a;
3090
+ n[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (g) => {
3091
+ const {
3092
+ movePositions: v,
3093
+ assistPositions: p
3094
+ } = g;
3095
+ r((b) => ({
3096
+ ...b,
3097
+ movePositions: v || b.movePositions,
3098
+ assistPositions: p || b.assistPositions
3099
+ }));
3100
+ }, n[2] = a) : a = n[2];
3101
+ const f = a;
3102
+ let l;
3103
+ n[3] === Symbol.for("react.memo_cache_sentinel") ? (l = () => {
3104
+ r({
3105
+ isMoving: !1,
3106
+ movePositions: [],
3107
+ assistPositions: []
3108
+ });
3109
+ }, n[3] = l) : l = n[3];
3110
+ const m = l;
3111
+ let d;
3112
+ return n[4] !== e ? (d = {
3113
+ initDragLine: c,
3114
+ updateDragLine: f,
3115
+ disposeDragLine: m,
3116
+ dragLineData: e,
3117
+ defaultGetAssistPosition: s,
3118
+ defaultGetMovePosition: i
3119
+ }, n[4] = e, n[5] = d) : d = n[5], d;
3120
+ }
3121
+ function Ls(n) {
3122
+ const {
3123
+ start: t,
3124
+ end: e,
3125
+ dir: r,
3126
+ scale: s,
3127
+ scaleWidth: i,
3128
+ startLeft: o
3129
+ } = n, {
3130
+ left: c,
3131
+ width: a
3132
+ } = Nn({
3133
+ start: t,
3134
+ end: e
3135
+ }, {
3136
+ startLeft: o,
3137
+ scaleWidth: i,
3138
+ scale: s
3139
+ });
3140
+ return r ? r === "right" ? [c + a] : [c] : [c, c + a];
2731
3141
  }
2732
- function Dr(n) {
3142
+ function Ms(n) {
3143
+ const {
3144
+ editorData: t,
3145
+ assistActionIds: e,
3146
+ action: r,
3147
+ row: s,
3148
+ scale: i,
3149
+ scaleWidth: o,
3150
+ startLeft: c,
3151
+ cursorLeft: a,
3152
+ hideCursor: f
3153
+ } = n, l = [];
3154
+ e ? t.forEach((d) => {
3155
+ d.actions.forEach((g) => {
3156
+ e.includes(g.id) && l.push(g);
3157
+ });
3158
+ }) : t.forEach((d) => {
3159
+ d.id !== s.id ? l.push(...d.actions) : d.actions.forEach((g) => {
3160
+ g.id !== r.id && l.push(g);
3161
+ });
3162
+ });
3163
+ const m = hr(l, {
3164
+ startLeft: c,
3165
+ scale: i,
3166
+ scaleWidth: o
3167
+ });
3168
+ return f || m.push(a), m;
3169
+ }
3170
+ function Is(n) {
2733
3171
  return typeof n == "object" && n !== null;
2734
3172
  }
2735
- function Mr(n, t, e) {
3173
+ function Ps(n, t, e) {
2736
3174
  if (n instanceof EventTarget)
2737
3175
  return [n];
2738
3176
  if (typeof n == "string") {
@@ -2741,48 +3179,47 @@ function Mr(n, t, e) {
2741
3179
  }
2742
3180
  return Array.from(n);
2743
3181
  }
2744
- function Ir(n) {
2745
- return Dr(n) && "ownerSVGElement" in n;
3182
+ function ks(n) {
3183
+ return Is(n) && "ownerSVGElement" in n;
2746
3184
  }
2747
- const Vt = /* @__PURE__ */ new WeakMap();
2748
- let _t;
2749
- const qe = (n, t, e) => (r, s) => s && s[0] ? s[0][n + "Size"] : Ir(r) && "getBBox" in r ? r.getBBox()[t] : r[e], Pr = /* @__PURE__ */ qe("inline", "width", "offsetWidth"), kr = /* @__PURE__ */ qe("block", "height", "offsetHeight");
2750
- function Lr({ target: n, borderBoxSize: t }) {
2751
- var e;
2752
- (e = Vt.get(n)) == null || e.forEach((r) => {
2753
- r(n, {
3185
+ const Ne = /* @__PURE__ */ new WeakMap();
3186
+ let je;
3187
+ const qn = (n, t, e) => (r, s) => s && s[0] ? s[0][n + "Size"] : ks(r) && "getBBox" in r ? r.getBBox()[t] : r[e], Ns = /* @__PURE__ */ qn("inline", "width", "offsetWidth"), js = /* @__PURE__ */ qn("block", "height", "offsetHeight");
3188
+ function Ws({ target: n, borderBoxSize: t }) {
3189
+ Ne.get(n)?.forEach((e) => {
3190
+ e(n, {
2754
3191
  get width() {
2755
- return Pr(n, t);
3192
+ return Ns(n, t);
2756
3193
  },
2757
3194
  get height() {
2758
- return kr(n, t);
3195
+ return js(n, t);
2759
3196
  }
2760
3197
  });
2761
3198
  });
2762
3199
  }
2763
- function Nr(n) {
2764
- n.forEach(Lr);
3200
+ function zs(n) {
3201
+ n.forEach(Ws);
2765
3202
  }
2766
- function jr() {
2767
- typeof ResizeObserver > "u" || (_t = new ResizeObserver(Nr));
3203
+ function Fs() {
3204
+ typeof ResizeObserver > "u" || (je = new ResizeObserver(zs));
2768
3205
  }
2769
- function Wr(n, t) {
2770
- _t || jr();
2771
- const e = Mr(n);
3206
+ function Vs(n, t) {
3207
+ je || Fs();
3208
+ const e = Ps(n);
2772
3209
  return e.forEach((r) => {
2773
- let s = Vt.get(r);
2774
- s || (s = /* @__PURE__ */ new Set(), Vt.set(r, s)), s.add(t), _t == null || _t.observe(r);
3210
+ let s = Ne.get(r);
3211
+ s || (s = /* @__PURE__ */ new Set(), Ne.set(r, s)), s.add(t), je?.observe(r);
2775
3212
  }), () => {
2776
3213
  e.forEach((r) => {
2777
- const s = Vt.get(r);
2778
- s == null || s.delete(t), s != null && s.size || _t == null || _t.unobserve(r);
3214
+ const s = Ne.get(r);
3215
+ s?.delete(t), s?.size || je?.unobserve(r);
2779
3216
  });
2780
3217
  };
2781
3218
  }
2782
- const Ut = /* @__PURE__ */ new Set();
2783
- let Dt;
2784
- function zr() {
2785
- Dt = () => {
3219
+ const We = /* @__PURE__ */ new Set();
3220
+ let xe;
3221
+ function $s() {
3222
+ xe = () => {
2786
3223
  const n = {
2787
3224
  get width() {
2788
3225
  return window.innerWidth;
@@ -2791,26 +3228,48 @@ function zr() {
2791
3228
  return window.innerHeight;
2792
3229
  }
2793
3230
  };
2794
- Ut.forEach((t) => t(n));
2795
- }, window.addEventListener("resize", Dt);
3231
+ We.forEach((t) => t(n));
3232
+ }, window.addEventListener("resize", xe);
2796
3233
  }
2797
- function Fr(n) {
2798
- return Ut.add(n), Dt || zr(), () => {
2799
- Ut.delete(n), !Ut.size && typeof Dt == "function" && (window.removeEventListener("resize", Dt), Dt = void 0);
3234
+ function Us(n) {
3235
+ return We.add(n), xe || $s(), () => {
3236
+ We.delete(n), !We.size && typeof xe == "function" && (window.removeEventListener("resize", xe), xe = void 0);
2800
3237
  };
2801
3238
  }
2802
- function Vr(n, t) {
2803
- return typeof n == "function" ? Fr(n) : Wr(n, t);
2804
- }
2805
- function Je({ render: n, ref: t, ...e }) {
2806
- const [r, s] = xt({ width: 0, height: 0 }), i = V(null);
2807
- return Gt(() => {
2808
- i.current && Vr(i.current, (o, c) => {
2809
- s({ width: c.width, height: c.height });
3239
+ function Hs(n, t) {
3240
+ return typeof n == "function" ? Us(n) : Vs(n, t);
3241
+ }
3242
+ function Jn(n) {
3243
+ const t = Qt.c(16);
3244
+ let e, r, s;
3245
+ t[0] !== n ? ({
3246
+ render: s,
3247
+ ref: r,
3248
+ ...e
3249
+ } = n, t[0] = n, t[1] = e, t[2] = r, t[3] = s) : (e = t[1], r = t[2], s = t[3]);
3250
+ let i;
3251
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (i = {
3252
+ width: 0,
3253
+ height: 0
3254
+ }, t[4] = i) : i = t[4];
3255
+ const [o, c] = ne(i), a = Q(null);
3256
+ let f, l;
3257
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (f = () => {
3258
+ a.current && Hs(a.current, (v, p) => {
3259
+ c({
3260
+ width: p.width,
3261
+ height: p.height
3262
+ });
2810
3263
  });
2811
- }, []), /* @__PURE__ */ P.jsx("div", { ref: Be(i, t), ...e, children: n(r) });
2812
- }
2813
- const Ur = ({
3264
+ }, l = [], t[5] = f, t[6] = l) : (f = t[5], l = t[6]), $e(f, l);
3265
+ let m;
3266
+ t[7] !== r ? (m = Hn(a, r), t[7] = r, t[8] = m) : m = t[8];
3267
+ let d;
3268
+ t[9] !== s || t[10] !== o ? (d = s(o), t[9] = s, t[10] = o, t[11] = d) : d = t[11];
3269
+ let g;
3270
+ return t[12] !== e || t[13] !== m || t[14] !== d ? (g = /* @__PURE__ */ N.jsx("div", { ref: m, ...e, children: d }), t[12] = e, t[13] = m, t[14] = d, t[15] = g) : g = t[15], g;
3271
+ }
3272
+ const Bs = ({
2814
3273
  width: n,
2815
3274
  height: t,
2816
3275
  editAreaRef: e,
@@ -2819,409 +3278,329 @@ const Ur = ({
2819
3278
  scaleWidth: i,
2820
3279
  scaleCount: o,
2821
3280
  setScaleCount: c,
2822
- startLeft: l,
2823
- scrollLeft: u,
2824
- scrollTop: a,
2825
- scale: g,
2826
- dragLine: p,
2827
- getAssistDragLineActionIds: O,
2828
- onActionMoveEnd: S,
2829
- onActionMoveStart: y,
2830
- onActionMoving: m,
2831
- onActionResizeEnd: h,
2832
- onActionResizeStart: v,
3281
+ startLeft: a,
3282
+ scrollLeft: f,
3283
+ scrollTop: l,
3284
+ scale: m,
3285
+ dragLine: d,
3286
+ getAssistDragLineActionIds: g,
3287
+ onActionMoveEnd: v,
3288
+ onActionMoveStart: p,
3289
+ onActionMoving: b,
3290
+ onActionResizeEnd: w,
3291
+ onActionResizeStart: h,
2833
3292
  onActionResizing: x,
2834
- onScroll: T,
2835
- cursorTime: b,
2836
- hideCursor: C,
2837
- setEditorData: I,
2838
- deltaScrollLeft: k,
2839
- timelineWidth: N,
3293
+ onScroll: O,
3294
+ cursorTime: _,
3295
+ hideCursor: y,
3296
+ setEditorData: E,
3297
+ deltaScrollLeft: P,
3298
+ timelineWidth: C,
2840
3299
  // Pass remaining CommonProp fields
2841
- getActionRender: L,
2842
- getScaleRender: j,
2843
- onClickRow: W,
2844
- onDoubleClickRow: Y,
2845
- onContextMenuRow: st,
2846
- onClickAction: M,
2847
- onClickActionOnly: U,
2848
- onDoubleClickAction: q,
2849
- onContextMenuAction: K,
2850
- onCursorDragStart: mt,
2851
- onCursorDragEnd: dt,
2852
- onCursorDrag: f,
2853
- onClickTimeArea: A,
2854
- gridSnap: d,
2855
- effects: _
3300
+ getActionRender: H,
3301
+ getScaleRender: X,
3302
+ onClickRow: z,
3303
+ onDoubleClickRow: F,
3304
+ onContextMenuRow: q,
3305
+ onClickAction: S,
3306
+ onClickActionOnly: R,
3307
+ onDoubleClickAction: M,
3308
+ onContextMenuAction: U,
3309
+ onCursorDragStart: ft,
3310
+ onCursorDragEnd: gt,
3311
+ onCursorDrag: u,
3312
+ onClickTimeArea: T,
3313
+ gridSnap: I,
3314
+ effects: V
2856
3315
  }) => {
2857
- const { dragLineData: E, initDragLine: D, updateDragLine: w, disposeDragLine: X, defaultGetAssistPosition: R, defaultGetMovePosition: $ } = Cr(), J = V(null), F = V(-1), et = (Q) => {
2858
- if (p) {
2859
- const nt = O && O({
2860
- action: Q.action,
2861
- row: Q.row,
3316
+ const {
3317
+ dragLineData: _t,
3318
+ initDragLine: vt,
3319
+ updateDragLine: D,
3320
+ disposeDragLine: rt,
3321
+ defaultGetAssistPosition: $,
3322
+ defaultGetMovePosition: k
3323
+ } = Ds(), j = Q(null), jt = Q(-1), Ut = (J) => {
3324
+ if (d) {
3325
+ const Z = g && g({
3326
+ action: J.action,
3327
+ row: J.row,
2862
3328
  editorData: r
2863
- }), H = i ?? 160, At = g ?? 1, z = l ?? 20, B = C ?? !1, it = pt(b, { scaleWidth: H, scale: At, startLeft: z }), ft = R({
3329
+ }), Y = i ?? 160, it = m ?? 1, bt = a ?? 20, Tt = y ?? !1, Pt = $t(_, {
3330
+ scaleWidth: Y,
3331
+ scale: it,
3332
+ startLeft: bt
3333
+ }), Ht = $({
2864
3334
  editorData: r,
2865
- assistActionIds: nt,
2866
- action: Q.action,
2867
- row: Q.row,
2868
- scale: At,
2869
- scaleWidth: H,
2870
- startLeft: z,
2871
- hideCursor: B,
2872
- cursorLeft: it
3335
+ assistActionIds: Z,
3336
+ action: J.action,
3337
+ row: J.row,
3338
+ scale: it,
3339
+ scaleWidth: Y,
3340
+ startLeft: bt,
3341
+ hideCursor: Tt,
3342
+ cursorLeft: Pt
3343
+ });
3344
+ vt({
3345
+ assistPositions: Ht
2873
3346
  });
2874
- D({ assistPositions: ft });
2875
3347
  }
2876
- }, Z = (Q) => {
2877
- if (p) {
2878
- const z = $({
2879
- ...Q,
2880
- startLeft: l ?? 20,
3348
+ }, It = (J) => {
3349
+ if (d) {
3350
+ const bt = k({
3351
+ ...J,
3352
+ startLeft: a ?? 20,
2881
3353
  scaleWidth: i ?? 160,
2882
- scale: g ?? 1
3354
+ scale: m ?? 1
3355
+ });
3356
+ D({
3357
+ movePositions: bt
2883
3358
  });
2884
- w({ movePositions: z });
2885
3359
  }
2886
3360
  };
2887
- let at = 0;
2888
- const wt = s ?? 32, ut = r.map((Q) => {
2889
- const nt = Q.rowHeight || wt;
2890
- return at += nt, nt;
3361
+ let xt = 0;
3362
+ const Rt = s ?? 32, At = r.map((J) => {
3363
+ const Z = J.rowHeight || Rt;
3364
+ return xt += Z, Z;
2891
3365
  });
2892
- at < t && (ut.push(t - at), F.current !== t && F.current >= 0 && setTimeout(() => {
2893
- St.measure();
2894
- })), F.current = t;
2895
- const Ot = i ?? 160, Kt = l ?? 20, jt = Math.max(o * Ot + Kt, n), St = Ke({
2896
- count: ut.length,
2897
- getScrollElement: () => J.current,
2898
- estimateSize: (Q) => ut[Q] ?? wt,
3366
+ xt < t && (At.push(t - xt), jt.current !== t && jt.current >= 0 && setTimeout(() => {
3367
+ Dt.measure();
3368
+ })), jt.current = t;
3369
+ const Wt = i ?? 160, Ot = a ?? 20, Ct = Math.max(o * Wt + Ot, n), Dt = Kn({
3370
+ count: At.length,
3371
+ getScrollElement: () => j.current,
3372
+ estimateSize: (J) => At[J] ?? Rt,
2899
3373
  overscan: 10
2900
3374
  });
2901
- Gt(() => {
2902
- J.current && (a !== void 0 && (J.current.scrollTop = a), u !== void 0 && (J.current.scrollLeft = u));
2903
- }, [a, u]), ht(() => {
2904
- St.measure();
2905
- }, [r, St]);
2906
- const qt = (Q) => {
2907
- const nt = Q.currentTarget;
2908
- T({
2909
- clientHeight: nt.clientHeight,
2910
- clientWidth: nt.clientWidth,
2911
- scrollHeight: nt.scrollHeight,
2912
- scrollLeft: nt.scrollLeft,
2913
- scrollTop: nt.scrollTop,
2914
- scrollWidth: nt.scrollWidth
3375
+ $e(() => {
3376
+ j.current && (l !== void 0 && (j.current.scrollTop = l), f !== void 0 && (j.current.scrollLeft = f));
3377
+ }, [l, f]), Vt(() => {
3378
+ Dt.measure();
3379
+ }, [r, Dt]);
3380
+ const te = (J) => {
3381
+ const Z = J.currentTarget;
3382
+ O({
3383
+ clientHeight: Z.clientHeight,
3384
+ clientWidth: Z.clientWidth,
3385
+ scrollHeight: Z.scrollHeight,
3386
+ scrollLeft: Z.scrollLeft,
3387
+ scrollTop: Z.scrollTop,
3388
+ scrollWidth: Z.scrollWidth
2915
3389
  });
2916
3390
  };
2917
- return /* @__PURE__ */ P.jsxs(P.Fragment, { children: [
2918
- /* @__PURE__ */ P.jsx(
2919
- "div",
2920
- {
2921
- ref: J,
2922
- style: { width: n, height: t, overflow: "auto" },
2923
- onScroll: qt,
2924
- children: /* @__PURE__ */ P.jsx(
2925
- "div",
2926
- {
2927
- style: {
2928
- height: `${St.getTotalSize()}px`,
2929
- width: jt,
2930
- position: "relative"
2931
- },
2932
- children: St.getVirtualItems().map((Q) => {
2933
- const nt = r[Q.index];
2934
- return /* @__PURE__ */ P.jsx(
2935
- Rr,
2936
- {
2937
- scaleCount: o,
2938
- setScaleCount: c,
2939
- cursorTime: b,
2940
- editorData: r,
2941
- rowHeight: s,
2942
- scaleWidth: i,
2943
- startLeft: l,
2944
- scale: g,
2945
- hideCursor: C,
2946
- timelineWidth: N,
2947
- getActionRender: L,
2948
- getScaleRender: j,
2949
- onClickRow: W,
2950
- onDoubleClickRow: Y,
2951
- onContextMenuRow: st,
2952
- onClickAction: M,
2953
- onClickActionOnly: U,
2954
- onDoubleClickAction: q,
2955
- onContextMenuAction: K,
2956
- onCursorDragStart: mt,
2957
- onCursorDragEnd: dt,
2958
- onCursorDrag: f,
2959
- onClickTimeArea: A,
2960
- gridSnap: d,
2961
- effects: _,
2962
- setEditorData: I,
2963
- deltaScrollLeft: k,
2964
- style: {
2965
- position: "absolute",
2966
- top: 0,
2967
- left: 0,
2968
- width: jt,
2969
- height: `${Q.size}px`,
2970
- transform: `translateY(${Q.start}px)`,
2971
- backgroundPositionX: `0, ${l ?? 20}px`,
2972
- backgroundSize: `${l ?? 20}px, ${i ?? 160}px`
2973
- },
2974
- areaRef: e,
2975
- rowData: nt,
2976
- dragLineData: E,
2977
- onActionMoveStart: (H) => (et(H), y && y(H)),
2978
- onActionResizeStart: (H) => (et(H), v && v(H)),
2979
- onActionMoving: (H) => (Z(H), m && m(H)),
2980
- onActionResizing: (H) => (Z(H), x && x(H)),
2981
- onActionResizeEnd: (H) => (X(), h && h(H)),
2982
- onActionMoveEnd: (H) => (X(), S && S(H)),
2983
- scrollLeft: u
2984
- },
2985
- Q.key
2986
- );
2987
- })
2988
- }
2989
- )
2990
- }
2991
- ),
2992
- p && /* @__PURE__ */ P.jsx(Or, { scrollLeft: u, ...E })
3391
+ return /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
3392
+ /* @__PURE__ */ N.jsx("div", { ref: j, style: {
3393
+ width: n,
3394
+ height: t,
3395
+ overflow: "auto"
3396
+ }, onScroll: te, children: /* @__PURE__ */ N.jsx("div", { style: {
3397
+ height: `${Dt.getTotalSize()}px`,
3398
+ width: Ct,
3399
+ position: "relative"
3400
+ }, children: Dt.getVirtualItems().map((J) => {
3401
+ const Z = r[J.index];
3402
+ return /* @__PURE__ */ N.jsx(Cs, { scaleCount: o, setScaleCount: c, cursorTime: _, editorData: r, rowHeight: s, scaleWidth: i, startLeft: a, scale: m, hideCursor: y, timelineWidth: C, getActionRender: H, getScaleRender: X, onClickRow: z, onDoubleClickRow: F, onContextMenuRow: q, onClickAction: S, onClickActionOnly: R, onDoubleClickAction: M, onContextMenuAction: U, onCursorDragStart: ft, onCursorDragEnd: gt, onCursorDrag: u, onClickTimeArea: T, gridSnap: I, effects: V, setEditorData: E, deltaScrollLeft: P, style: {
3403
+ position: "absolute",
3404
+ top: 0,
3405
+ left: 0,
3406
+ width: Ct,
3407
+ height: `${J.size}px`,
3408
+ transform: `translateY(${J.start}px)`,
3409
+ backgroundPositionX: `0, ${a ?? 20}px`,
3410
+ backgroundSize: `${a ?? 20}px, ${i ?? 160}px`
3411
+ }, areaRef: e, rowData: Z, dragLineData: _t, onActionMoveStart: (Y) => (Ut(Y), p && p(Y)), onActionResizeStart: (Y) => (Ut(Y), h && h(Y)), onActionMoving: (Y) => (It(Y), b && b(Y)), onActionResizing: (Y) => (It(Y), x && x(Y)), onActionResizeEnd: (Y) => (rt(), w && w(Y)), onActionMoveEnd: (Y) => (rt(), v && v(Y)), scrollLeft: f }, J.key);
3412
+ }) }) }),
3413
+ d && /* @__PURE__ */ N.jsx(As, { scrollLeft: f, ..._t })
2993
3414
  ] });
2994
- }, $r = Mt.forwardRef((n, t) => {
2995
- const e = V(null);
2996
- return ce(t, () => ({
3415
+ }, Xs = Zt.forwardRef((n, t) => {
3416
+ const e = Q(null);
3417
+ return nn(t, () => ({
2997
3418
  get domRef() {
2998
3419
  return e;
2999
3420
  }
3000
- })), /* @__PURE__ */ P.jsx(
3001
- Je,
3002
- {
3003
- ref: e,
3004
- className: tt("edit-area"),
3005
- render: ({ width: r, height: s }) => /* @__PURE__ */ P.jsx(
3006
- Ur,
3007
- {
3008
- ...n,
3009
- width: r,
3010
- height: s,
3011
- editAreaRef: e
3012
- }
3013
- )
3014
- }
3015
- );
3016
- }), Br = ({ setCursor: n, maxScaleCount: t, hideCursor: e, scale: r, scaleWidth: s, scaleCount: i, scaleSplitCount: o, startLeft: c, scrollLeft: l, onClickTimeArea: u, getScaleRender: a }) => {
3017
- const g = V(null), p = (o ?? 0) > 0, O = (m) => {
3018
- const h = o ?? 1, v = s ?? 160, x = c ?? 20;
3019
- switch (m) {
3421
+ })), /* @__PURE__ */ N.jsx(Jn, { ref: e, className: mt("edit-area"), render: ({
3422
+ width: r,
3423
+ height: s
3424
+ }) => /* @__PURE__ */ N.jsx(Bs, { ...n, width: r, height: s, editAreaRef: e }) });
3425
+ }), Ys = ({
3426
+ setCursor: n,
3427
+ maxScaleCount: t,
3428
+ hideCursor: e,
3429
+ scale: r,
3430
+ scaleWidth: s,
3431
+ scaleCount: i,
3432
+ scaleSplitCount: o,
3433
+ startLeft: c,
3434
+ scrollLeft: a,
3435
+ onClickTimeArea: f,
3436
+ getScaleRender: l
3437
+ }) => {
3438
+ const m = Q(null), d = (o ?? 0) > 0, g = (b) => {
3439
+ const w = o ?? 1, h = s ?? 160, x = c ?? 20;
3440
+ switch (b) {
3020
3441
  case 0:
3021
3442
  return x;
3022
3443
  default:
3023
- return p ? v / h : v;
3444
+ return d ? h / w : h;
3024
3445
  }
3025
- }, S = p ? i * (o ?? 1) + 1 : i, y = Ke({
3446
+ }, v = d ? i * (o ?? 1) + 1 : i, p = Kn({
3026
3447
  horizontal: !0,
3027
- count: S,
3028
- getScrollElement: () => g.current,
3029
- estimateSize: O,
3448
+ count: v,
3449
+ getScrollElement: () => m.current,
3450
+ estimateSize: g,
3030
3451
  overscan: 10
3031
3452
  });
3032
- return Gt(() => {
3033
- g.current && l !== void 0 && (g.current.scrollLeft = l);
3034
- }, [l]), ht(() => {
3035
- y.measure();
3036
- }, [s, c, y]), /* @__PURE__ */ P.jsx(
3037
- Je,
3038
- {
3039
- className: tt("time-area"),
3040
- render: ({ width: m, height: h }) => /* @__PURE__ */ P.jsxs(P.Fragment, { children: [
3041
- /* @__PURE__ */ P.jsx(
3042
- "div",
3043
- {
3044
- className: tt("time-area-virtual"),
3045
- ref: g,
3046
- style: {
3047
- width: m,
3048
- height: h,
3049
- overflowX: "hidden",
3050
- overflowY: "hidden"
3051
- },
3052
- children: /* @__PURE__ */ P.jsx(
3053
- "div",
3054
- {
3055
- style: {
3056
- width: `${y.getTotalSize()}px`,
3057
- height: "100%",
3058
- position: "relative"
3059
- },
3060
- children: y.getVirtualItems().map((v) => {
3061
- const x = v.index, T = o ?? 1, b = r ?? 1, C = p ? x % T === 0 : !0, I = ["time-unit"];
3062
- C && I.push("time-unit-big");
3063
- const k = (p ? x / T : x) * b;
3064
- return /* @__PURE__ */ P.jsx(
3065
- "div",
3066
- {
3067
- "data-index": v.index,
3068
- style: {
3069
- position: "absolute",
3070
- top: 0,
3071
- left: 0,
3072
- height: "100%",
3073
- width: `${v.size}px`,
3074
- transform: `translateX(${v.start}px)`
3075
- },
3076
- className: tt(...I),
3077
- children: C && /* @__PURE__ */ P.jsx("div", { className: tt("time-unit-scale"), children: a ? a(k) : k })
3078
- },
3079
- v.key
3080
- );
3081
- })
3082
- }
3083
- )
3084
- }
3085
- ),
3086
- /* @__PURE__ */ P.jsx(
3087
- "div",
3088
- {
3089
- style: { width: m, height: h },
3090
- onClick: (v) => {
3091
- if (e) return;
3092
- const x = c ?? 20, T = s ?? 160, b = r ?? 1, C = t ?? 1 / 0, I = v.currentTarget.getBoundingClientRect(), k = v.clientX - I.x, N = Math.max(k + l, x);
3093
- if (N > C * T + x - l) return;
3094
- const L = Tt(N, { startLeft: x, scale: b, scaleWidth: T });
3095
- (u && u(L, v)) !== !1 && n({ time: L });
3096
- },
3097
- className: tt("time-area-interact")
3098
- }
3099
- )
3100
- ] })
3101
- }
3102
- );
3103
- }, Yr = Mt.forwardRef((n, t) => {
3104
- const e = hn(n), { style: r } = n;
3453
+ return $e(() => {
3454
+ m.current && a !== void 0 && (m.current.scrollLeft = a);
3455
+ }, [a]), Vt(() => {
3456
+ p.measure();
3457
+ }, [s, c, p]), /* @__PURE__ */ N.jsx(Jn, { className: mt("time-area"), render: ({
3458
+ width: b,
3459
+ height: w
3460
+ }) => /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
3461
+ /* @__PURE__ */ N.jsx("div", { className: mt("time-area-virtual"), ref: m, style: {
3462
+ width: b,
3463
+ height: w,
3464
+ overflowX: "hidden",
3465
+ overflowY: "hidden"
3466
+ }, children: /* @__PURE__ */ N.jsx("div", { style: {
3467
+ width: `${p.getTotalSize()}px`,
3468
+ height: "100%",
3469
+ position: "relative"
3470
+ }, children: p.getVirtualItems().map((h) => {
3471
+ const x = h.index, O = o ?? 1, _ = r ?? 1, y = d ? x % O === 0 : !0, E = ["time-unit"];
3472
+ y && E.push("time-unit-big");
3473
+ const P = (d ? x / O : x) * _;
3474
+ return /* @__PURE__ */ N.jsx("div", { "data-index": h.index, style: {
3475
+ position: "absolute",
3476
+ top: 0,
3477
+ left: 0,
3478
+ height: "100%",
3479
+ width: `${h.size}px`,
3480
+ transform: `translateX(${h.start}px)`
3481
+ }, className: mt(...E), children: y && /* @__PURE__ */ N.jsx("div", { className: mt("time-unit-scale"), children: l ? l(P) : P }) }, h.key);
3482
+ }) }) }),
3483
+ /* @__PURE__ */ N.jsx("div", { style: {
3484
+ width: b,
3485
+ height: w
3486
+ }, onClick: (h) => {
3487
+ if (e) return;
3488
+ const x = c ?? 20, O = s ?? 160, _ = r ?? 1, y = t ?? 1 / 0, E = h.currentTarget.getBoundingClientRect(), P = h.clientX - E.x, C = Math.max(P + a, x);
3489
+ if (C > y * O + x - a) return;
3490
+ const H = re(C, {
3491
+ startLeft: x,
3492
+ scale: _,
3493
+ scaleWidth: O
3494
+ });
3495
+ (f && f(H, h)) !== !1 && n({
3496
+ time: H
3497
+ });
3498
+ }, className: mt("time-area-interact") })
3499
+ ] }) });
3500
+ }, qs = Zt.forwardRef((n, t) => {
3501
+ const e = ur(n), {
3502
+ style: r
3503
+ } = n;
3105
3504
  let {
3106
3505
  editorData: s,
3107
3506
  scrollTop: i,
3108
3507
  autoScroll: o,
3109
3508
  hideCursor: c,
3110
- disableDrag: l,
3111
- scale: u = 1,
3112
- scaleWidth: a = 160,
3113
- startLeft: g = 20,
3114
- minScaleCount: p = 20,
3115
- maxScaleCount: O = 1 / 0,
3116
- onChange: S,
3117
- onScroll: y
3509
+ disableDrag: a,
3510
+ scale: f = 1,
3511
+ scaleWidth: l = 160,
3512
+ startLeft: m = 20,
3513
+ minScaleCount: d = 20,
3514
+ maxScaleCount: g = 1 / 0,
3515
+ onChange: v,
3516
+ onScroll: p
3118
3517
  } = e;
3119
- const m = V(null), h = V(null), v = V(null), [x, T] = xt(s), [b, C] = xt(ie), [I, k] = xt(cn), [N, L] = xt(Number.MAX_SAFE_INTEGER), j = nn(
3120
- (M) => {
3121
- const U = Math.min(O, Math.max(p, M));
3122
- C(U);
3123
- },
3124
- [O, p]
3125
- );
3126
- Gt(() => {
3127
- j(pn(s, { scale: u })), T(s);
3128
- }, [s, p, O, u, j]), ht(() => {
3129
- var M;
3130
- i !== void 0 && ((M = v.current) == null || M.setScrollState((U) => ({ ...U, scrollTop: i })));
3518
+ const b = Q(null), w = Q(null), h = Q(null), [x, O] = ne(s), [_, y] = ne(tn), [E, P] = ne(sr), [C, H] = ne(Number.MAX_SAFE_INTEGER), X = Qn((S) => {
3519
+ const R = Math.min(g, Math.max(d, S));
3520
+ y(R);
3521
+ }, [g, d]);
3522
+ $e(() => {
3523
+ X(fr(s, {
3524
+ scale: f
3525
+ })), O(s);
3526
+ }, [s, d, g, f, X]), Vt(() => {
3527
+ i !== void 0 && h.current?.setScrollState((S) => ({
3528
+ ...S,
3529
+ scrollTop: i
3530
+ }));
3131
3531
  }, [i]);
3132
- const W = (M) => {
3133
- S == null || S(M);
3134
- }, Y = (M) => {
3135
- let { left: U, time: q } = M;
3136
- if (typeof U > "u" && typeof q > "u") return !0;
3137
- typeof q > "u" && (U = pt(q ?? 0, { startLeft: g, scale: u, scaleWidth: a }), q = Tt(U, { startLeft: g, scale: u, scaleWidth: a }));
3138
- let K = !0;
3139
- return k(q), K;
3140
- }, st = (M) => {
3141
- var q;
3142
- !((q = v.current) != null && q.state) || v.current.state.scrollLeft + M > b * (a - 1) + g - N || v.current && v.current.setScrollState((K) => ({ ...K, scrollLeft: Math.max(K.scrollLeft + M, 0) }));
3532
+ const z = (S) => {
3533
+ v?.(S);
3534
+ }, F = (S) => {
3535
+ let {
3536
+ left: R,
3537
+ time: M
3538
+ } = S;
3539
+ if (typeof R > "u" && typeof M > "u") return !0;
3540
+ typeof M > "u" && (R = $t(M ?? 0, {
3541
+ startLeft: m,
3542
+ scale: f,
3543
+ scaleWidth: l
3544
+ }), M = re(R, {
3545
+ startLeft: m,
3546
+ scale: f,
3547
+ scaleWidth: l
3548
+ }));
3549
+ let U = !0;
3550
+ return P(M), U;
3551
+ }, q = (S) => {
3552
+ !h.current?.state || h.current.state.scrollLeft + S > _ * (l - 1) + m - C || h.current && h.current.setScrollState((M) => ({
3553
+ ...M,
3554
+ scrollLeft: Math.max(M.scrollLeft + S, 0)
3555
+ }));
3143
3556
  };
3144
- return ce(t, () => ({
3557
+ return nn(t, () => ({
3145
3558
  get target() {
3146
- return m.current;
3559
+ return b.current;
3147
3560
  },
3148
- set time(M) {
3149
- Y({ time: M });
3561
+ set time(S) {
3562
+ F({
3563
+ time: S
3564
+ });
3150
3565
  },
3151
3566
  get time() {
3152
- return I;
3567
+ return E;
3153
3568
  },
3154
- setScrollLeft: (M) => {
3155
- v.current && v.current.setScrollState((U) => ({ ...U, scrollLeft: Math.max(M, 0) }));
3569
+ setScrollLeft: (S) => {
3570
+ h.current && h.current.setScrollState((R) => ({
3571
+ ...R,
3572
+ scrollLeft: Math.max(S, 0)
3573
+ }));
3156
3574
  },
3157
- setScrollTop: (M) => {
3158
- v.current && v.current.setScrollState((U) => ({ ...U, scrollTop: Math.max(M, 0) }));
3575
+ setScrollTop: (S) => {
3576
+ h.current && h.current.setScrollState((R) => ({
3577
+ ...R,
3578
+ scrollTop: Math.max(S, 0)
3579
+ }));
3159
3580
  }
3160
- })), ht(() => {
3161
- if (h.current) {
3162
- const M = new ResizeObserver(() => {
3163
- h.current && L(h.current.getBoundingClientRect().width);
3581
+ })), Vt(() => {
3582
+ if (w.current) {
3583
+ const S = new ResizeObserver(() => {
3584
+ w.current && H(w.current.getBoundingClientRect().width);
3164
3585
  });
3165
- return M.observe(h.current), () => {
3166
- M && M.disconnect();
3586
+ return S.observe(w.current), () => {
3587
+ S && S.disconnect();
3167
3588
  };
3168
3589
  }
3169
- }, []), /* @__PURE__ */ P.jsx("div", { ref: m, style: r, className: `${ne} ${l ? ne + "-disable" : ""}`, children: /* @__PURE__ */ P.jsx(He, { ref: v, children: ({ scrollLeft: M, scrollTop: U, onScroll: q }) => /* @__PURE__ */ P.jsxs(P.Fragment, { children: [
3170
- /* @__PURE__ */ P.jsx(
3171
- Br,
3172
- {
3173
- ...e,
3174
- timelineWidth: N,
3175
- disableDrag: l,
3176
- setCursor: Y,
3177
- cursorTime: I,
3178
- editorData: x,
3179
- scaleCount: b,
3180
- setScaleCount: j,
3181
- onScroll: q,
3182
- scrollLeft: M
3183
- }
3184
- ),
3185
- /* @__PURE__ */ P.jsx(
3186
- $r,
3187
- {
3188
- ...e,
3189
- timelineWidth: N,
3190
- ref: (K) => {
3191
- K != null && K.domRef.current && (h.current = K.domRef.current);
3192
- },
3193
- disableDrag: l,
3194
- editorData: x,
3195
- cursorTime: I,
3196
- scaleCount: b,
3197
- setScaleCount: j,
3198
- scrollTop: U,
3199
- scrollLeft: M,
3200
- setEditorData: W,
3201
- deltaScrollLeft: o ? st : void 0,
3202
- onScroll: (K) => {
3203
- q(K), y == null || y(K);
3204
- }
3205
- }
3206
- ),
3207
- !c && /* @__PURE__ */ P.jsx(
3208
- pr,
3209
- {
3210
- ...e,
3211
- timelineWidth: N,
3212
- scrollLeft: M,
3213
- scaleCount: b,
3214
- setScaleCount: j,
3215
- setCursor: Y,
3216
- cursorTime: I,
3217
- editorData: x,
3218
- areaRef: h,
3219
- scrollSync: v,
3220
- deltaScrollLeft: o ? st : void 0
3221
- }
3222
- )
3590
+ }, []), /* @__PURE__ */ N.jsx("div", { ref: b, style: r, className: `${Je} ${a ? Je + "-disable" : ""}`, children: /* @__PURE__ */ N.jsx(Yn, { ref: h, children: ({
3591
+ scrollLeft: S,
3592
+ scrollTop: R,
3593
+ onScroll: M
3594
+ }) => /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
3595
+ /* @__PURE__ */ N.jsx(Ys, { ...e, timelineWidth: C, disableDrag: a, setCursor: F, cursorTime: E, editorData: x, scaleCount: _, setScaleCount: X, onScroll: M, scrollLeft: S }),
3596
+ /* @__PURE__ */ N.jsx(Xs, { ...e, timelineWidth: C, ref: (U) => {
3597
+ U?.domRef.current && (w.current = U.domRef.current);
3598
+ }, disableDrag: a, editorData: x, cursorTime: E, scaleCount: _, setScaleCount: X, scrollTop: R, scrollLeft: S, setEditorData: z, deltaScrollLeft: o ? q : void 0, onScroll: (U) => {
3599
+ M(U), p?.(U);
3600
+ } }),
3601
+ !c && /* @__PURE__ */ N.jsx(ps, { ...e, timelineWidth: C, scrollLeft: S, scaleCount: _, setScaleCount: X, setCursor: F, cursorTime: E, editorData: x, areaRef: w, scrollSync: h, deltaScrollLeft: o ? q : void 0 })
3223
3602
  ] }) }) });
3224
3603
  });
3225
3604
  export {
3226
- Yr as Timeline
3605
+ qs as Timeline
3227
3606
  };