@kteneyck/cesium-timeline-react 0.7.0 → 0.9.0

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,9 +1,9 @@
1
- import qe, { useMemo as Se, useRef as b, useState as ve, useEffect as J, forwardRef as Ge, useCallback as se, useImperativeHandle as Ve, useLayoutEffect as Ke } from "react";
2
- import * as j from "cesium";
3
- import { DEFAULT_LABELS as Ze, splitForDisplay as Qe, getTimezoneAbbr as et, formatDateTime as Fe, resolveLabel as Ie, drawTimeline as tt, hitTestSwimLane as nt, hitTestLaneLabel as rt, isInSwimLaneRegion as ot, zoomRange as st, TICK_AREA_HEIGHT as $e, DEFAULT_LANE_HEIGHT as Oe, LANE_GAP as Pe, SWIM_LANE_SCROLL_SPEED as ct, MIN_SPAN_MS as it, MAX_SPAN_MS as lt, toJulianDate as ge, defaultTheme as at, generateTicks as ut, timeToPosition as dt, snapToTick as ft } from "@kteneyck/cesium-timeline-core";
1
+ import ct, { useMemo as Ne, useRef as x, useState as Ae, useEffect as z, forwardRef as st, useCallback as ae, useImperativeHandle as it, useLayoutEffect as ut } from "react";
2
+ import * as D from "cesium";
3
+ import { DEFAULT_LABELS as lt, splitForDisplay as at, getTimezoneAbbr as dt, formatDateTime as We, resolveLabel as Be, drawTimeline as ft, hitTestSwimLane as pt, hitTestLaneLabel as mt, isInSwimLaneRegion as ht, TICK_AREA_HEIGHT as Oe, zoomRange as gt, DEFAULT_LANE_HEIGHT as $e, LANE_GAP as He, SWIM_LANE_SCROLL_SPEED as xt, MIN_SPAN_MS as vt, MAX_SPAN_MS as bt, zoomAroundMs as Tt, toJulianDate as De, defaultTheme as wt, generateTicks as Mt, timeToPosition as yt, snapToTick as Et } from "@kteneyck/cesium-timeline-core";
4
4
  export * from "@kteneyck/cesium-timeline-core";
5
- import { TICK_AREA_HEIGHT as Dt } from "@kteneyck/cesium-timeline-core";
6
- var Me = { exports: {} }, Te = {};
5
+ import { TICK_AREA_HEIGHT as Ot } from "@kteneyck/cesium-timeline-core";
6
+ var Xe = { exports: {} }, Se = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,29 +13,29 @@ var Me = { exports: {} }, Te = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var Ne;
17
- function pt() {
18
- if (Ne) return Te;
19
- Ne = 1;
20
- var A = Symbol.for("react.transitional.element"), L = Symbol.for("react.fragment");
21
- function Y(a, M, R) {
22
- var F = null;
23
- if (R !== void 0 && (F = "" + R), M.key !== void 0 && (F = "" + M.key), "key" in M) {
24
- R = {};
25
- for (var O in M)
26
- O !== "key" && (R[O] = M[O]);
27
- } else R = M;
28
- return M = R.ref, {
29
- $$typeof: A,
30
- type: a,
31
- key: F,
32
- ref: M !== void 0 ? M : null,
33
- props: R
16
+ var Ue;
17
+ function Rt() {
18
+ if (Ue) return Se;
19
+ Ue = 1;
20
+ var F = Symbol.for("react.transitional.element"), X = Symbol.for("react.fragment");
21
+ function K(d, _, S) {
22
+ var W = null;
23
+ if (S !== void 0 && (W = "" + S), _.key !== void 0 && (W = "" + _.key), "key" in _) {
24
+ S = {};
25
+ for (var $ in _)
26
+ $ !== "key" && (S[$] = _[$]);
27
+ } else S = _;
28
+ return _ = S.ref, {
29
+ $$typeof: F,
30
+ type: d,
31
+ key: W,
32
+ ref: _ !== void 0 ? _ : null,
33
+ props: S
34
34
  };
35
35
  }
36
- return Te.Fragment = L, Te.jsx = Y, Te.jsxs = Y, Te;
36
+ return Se.Fragment = X, Se.jsx = K, Se.jsxs = K, Se;
37
37
  }
38
- var we = {};
38
+ var Le = {};
39
39
  /**
40
40
  * @license React
41
41
  * react-jsx-runtime.development.js
@@ -45,126 +45,126 @@ var we = {};
45
45
  * This source code is licensed under the MIT license found in the
46
46
  * LICENSE file in the root directory of this source tree.
47
47
  */
48
- var Xe;
49
- function mt() {
50
- return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && (function() {
51
- function A(t) {
48
+ var qe;
49
+ function Dt() {
50
+ return qe || (qe = 1, process.env.NODE_ENV !== "production" && (function() {
51
+ function F(t) {
52
52
  if (t == null) return null;
53
53
  if (typeof t == "function")
54
- return t.$$typeof === re ? null : t.displayName || t.name || null;
54
+ return t.$$typeof === p ? null : t.displayName || t.name || null;
55
55
  if (typeof t == "string") return t;
56
56
  switch (t) {
57
- case B:
57
+ case te:
58
58
  return "Fragment";
59
- case p:
59
+ case w:
60
60
  return "Profiler";
61
- case ee:
61
+ case ue:
62
62
  return "StrictMode";
63
- case u:
63
+ case B:
64
64
  return "Suspense";
65
- case v:
65
+ case oe:
66
66
  return "SuspenseList";
67
- case w:
67
+ case A:
68
68
  return "Activity";
69
69
  }
70
70
  if (typeof t == "object")
71
71
  switch (typeof t.tag == "number" && console.error(
72
72
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
73
73
  ), t.$$typeof) {
74
- case Q:
74
+ case ie:
75
75
  return "Portal";
76
- case $:
76
+ case Q:
77
77
  return t.displayName || "Context";
78
- case g:
78
+ case v:
79
79
  return (t._context.displayName || "Context") + ".Consumer";
80
- case K:
81
- var d = t.render;
82
- return t = t.displayName, t || (t = d.displayName || d.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
83
- case P:
84
- return d = t.displayName || null, d !== null ? d : A(t.type) || "Memo";
85
- case y:
86
- d = t._payload, t = t._init;
80
+ case M:
81
+ var f = t.render;
82
+ return t = t.displayName, t || (t = f.displayName || f.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
83
+ case ge:
84
+ return f = t.displayName || null, f !== null ? f : F(t.type) || "Memo";
85
+ case ce:
86
+ f = t._payload, t = t._init;
87
87
  try {
88
- return A(t(d));
88
+ return F(t(f));
89
89
  } catch {
90
90
  }
91
91
  }
92
92
  return null;
93
93
  }
94
- function L(t) {
94
+ function X(t) {
95
95
  return "" + t;
96
96
  }
97
- function Y(t) {
97
+ function K(t) {
98
98
  try {
99
- L(t);
100
- var d = !1;
99
+ X(t);
100
+ var f = !1;
101
101
  } catch {
102
- d = !0;
102
+ f = !0;
103
103
  }
104
- if (d) {
105
- d = console;
106
- var x = d.error, E = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
107
- return x.call(
108
- d,
104
+ if (f) {
105
+ f = console;
106
+ var b = f.error, y = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
107
+ return b.call(
108
+ f,
109
109
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
110
- E
111
- ), L(t);
110
+ y
111
+ ), X(t);
112
112
  }
113
113
  }
114
- function a(t) {
115
- if (t === B) return "<>";
116
- if (typeof t == "object" && t !== null && t.$$typeof === y)
114
+ function d(t) {
115
+ if (t === te) return "<>";
116
+ if (typeof t == "object" && t !== null && t.$$typeof === ce)
117
117
  return "<...>";
118
118
  try {
119
- var d = A(t);
120
- return d ? "<" + d + ">" : "<...>";
119
+ var f = F(t);
120
+ return f ? "<" + f + ">" : "<...>";
121
121
  } catch {
122
122
  return "<...>";
123
123
  }
124
124
  }
125
- function M() {
126
- var t = X.A;
125
+ function _() {
126
+ var t = g.A;
127
127
  return t === null ? null : t.getOwner();
128
128
  }
129
- function R() {
129
+ function S() {
130
130
  return Error("react-stack-top-frame");
131
131
  }
132
- function F(t) {
133
- if (te.call(t, "key")) {
134
- var d = Object.getOwnPropertyDescriptor(t, "key").get;
135
- if (d && d.isReactWarning) return !1;
132
+ function W(t) {
133
+ if (L.call(t, "key")) {
134
+ var f = Object.getOwnPropertyDescriptor(t, "key").get;
135
+ if (f && f.isReactWarning) return !1;
136
136
  }
137
137
  return t.key !== void 0;
138
138
  }
139
- function O(t, d) {
140
- function x() {
141
- k || (k = !0, console.error(
139
+ function $(t, f) {
140
+ function b() {
141
+ O || (O = !0, console.error(
142
142
  "%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)",
143
- d
143
+ f
144
144
  ));
145
145
  }
146
- x.isReactWarning = !0, Object.defineProperty(t, "key", {
147
- get: x,
146
+ b.isReactWarning = !0, Object.defineProperty(t, "key", {
147
+ get: b,
148
148
  configurable: !0
149
149
  });
150
150
  }
151
- function z() {
152
- var t = A(this.type);
153
- return S[t] || (S[t] = !0, console.error(
151
+ function de() {
152
+ var t = F(this.type);
153
+ return j[t] || (j[t] = !0, console.error(
154
154
  "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."
155
155
  )), t = this.props.ref, t !== void 0 ? t : null;
156
156
  }
157
- function _(t, d, x, E, ce, pe) {
158
- var T = x.ref;
157
+ function H(t, f, b, y, re, he) {
158
+ var J = b.ref;
159
159
  return t = {
160
160
  $$typeof: Z,
161
161
  type: t,
162
- key: d,
163
- props: x,
164
- _owner: E
165
- }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(t, "ref", {
162
+ key: f,
163
+ props: b,
164
+ _owner: y
165
+ }, (J !== void 0 ? J : null) !== null ? Object.defineProperty(t, "ref", {
166
166
  enumerable: !1,
167
- get: z
167
+ get: de
168
168
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
169
169
  configurable: !1,
170
170
  enumerable: !1,
@@ -179,148 +179,148 @@ function mt() {
179
179
  configurable: !1,
180
180
  enumerable: !1,
181
181
  writable: !0,
182
- value: ce
182
+ value: re
183
183
  }), Object.defineProperty(t, "_debugTask", {
184
184
  configurable: !1,
185
185
  enumerable: !1,
186
186
  writable: !0,
187
- value: pe
187
+ value: he
188
188
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
189
189
  }
190
- function U(t, d, x, E, ce, pe) {
191
- var T = d.children;
192
- if (T !== void 0)
193
- if (E)
194
- if (H(T)) {
195
- for (E = 0; E < T.length; E++)
196
- W(T[E]);
197
- Object.freeze && Object.freeze(T);
190
+ function G(t, f, b, y, re, he) {
191
+ var J = f.children;
192
+ if (J !== void 0)
193
+ if (y)
194
+ if (C(J)) {
195
+ for (y = 0; y < J.length; y++)
196
+ U(J[y]);
197
+ Object.freeze && Object.freeze(J);
198
198
  } else
199
199
  console.error(
200
200
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
201
  );
202
- else W(T);
203
- if (te.call(d, "key")) {
204
- T = A(t);
205
- var oe = Object.keys(d).filter(function(xe) {
206
- return xe !== "key";
202
+ else U(J);
203
+ if (L.call(f, "key")) {
204
+ J = F(t);
205
+ var E = Object.keys(f).filter(function(Te) {
206
+ return Te !== "key";
207
207
  });
208
- E = 0 < oe.length ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}", q[T + E] || (oe = 0 < oe.length ? "{" + oe.join(": ..., ") + ": ...}" : "{}", console.error(
208
+ y = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", k[J + y] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
209
209
  `A props object containing a "key" prop is being spread into JSX:
210
210
  let props = %s;
211
211
  <%s {...props} />
212
212
  React keys must be passed directly to JSX without using spread:
213
213
  let props = %s;
214
214
  <%s key={someKey} {...props} />`,
215
+ y,
216
+ J,
215
217
  E,
216
- T,
217
- oe,
218
- T
219
- ), q[T + E] = !0);
218
+ J
219
+ ), k[J + y] = !0);
220
220
  }
221
- if (T = null, x !== void 0 && (Y(x), T = "" + x), F(d) && (Y(d.key), T = "" + d.key), "key" in d) {
222
- x = {};
223
- for (var ae in d)
224
- ae !== "key" && (x[ae] = d[ae]);
225
- } else x = d;
226
- return T && O(
227
- x,
221
+ if (J = null, b !== void 0 && (K(b), J = "" + b), W(f) && (K(f.key), J = "" + f.key), "key" in f) {
222
+ b = {};
223
+ for (var fe in f)
224
+ fe !== "key" && (b[fe] = f[fe]);
225
+ } else b = f;
226
+ return J && $(
227
+ b,
228
228
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
229
- ), _(
229
+ ), H(
230
230
  t,
231
- T,
232
- x,
233
- M(),
234
- ce,
235
- pe
231
+ J,
232
+ b,
233
+ _(),
234
+ re,
235
+ he
236
236
  );
237
237
  }
238
- function W(t) {
239
- ne(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === y && (t._payload.status === "fulfilled" ? ne(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
238
+ function U(t) {
239
+ I(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === ce && (t._payload.status === "fulfilled" ? I(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
240
240
  }
241
- function ne(t) {
241
+ function I(t) {
242
242
  return typeof t == "object" && t !== null && t.$$typeof === Z;
243
243
  }
244
- var V = qe, Z = Symbol.for("react.transitional.element"), Q = Symbol.for("react.portal"), B = Symbol.for("react.fragment"), ee = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), g = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), w = Symbol.for("react.activity"), re = Symbol.for("react.client.reference"), X = V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, H = Array.isArray, D = console.createTask ? console.createTask : function() {
244
+ var se = ct, Z = Symbol.for("react.transitional.element"), ie = Symbol.for("react.portal"), te = Symbol.for("react.fragment"), ue = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), v = Symbol.for("react.consumer"), Q = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), B = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), ge = Symbol.for("react.memo"), ce = Symbol.for("react.lazy"), A = Symbol.for("react.activity"), p = Symbol.for("react.client.reference"), g = se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, L = Object.prototype.hasOwnProperty, C = Array.isArray, ee = console.createTask ? console.createTask : function() {
245
245
  return null;
246
246
  };
247
- V = {
247
+ se = {
248
248
  react_stack_bottom_frame: function(t) {
249
249
  return t();
250
250
  }
251
251
  };
252
- var k, S = {}, i = V.react_stack_bottom_frame.bind(
253
- V,
254
- R
255
- )(), C = D(a(R)), q = {};
256
- we.Fragment = B, we.jsx = function(t, d, x) {
257
- var E = 1e4 > X.recentlyCreatedOwnerStacks++;
258
- return U(
252
+ var O, j = {}, s = se.react_stack_bottom_frame.bind(
253
+ se,
254
+ S
255
+ )(), V = ee(d(S)), k = {};
256
+ Le.Fragment = te, Le.jsx = function(t, f, b) {
257
+ var y = 1e4 > g.recentlyCreatedOwnerStacks++;
258
+ return G(
259
259
  t,
260
- d,
261
- x,
260
+ f,
261
+ b,
262
262
  !1,
263
- E ? Error("react-stack-top-frame") : i,
264
- E ? D(a(t)) : C
263
+ y ? Error("react-stack-top-frame") : s,
264
+ y ? ee(d(t)) : V
265
265
  );
266
- }, we.jsxs = function(t, d, x) {
267
- var E = 1e4 > X.recentlyCreatedOwnerStacks++;
268
- return U(
266
+ }, Le.jsxs = function(t, f, b) {
267
+ var y = 1e4 > g.recentlyCreatedOwnerStacks++;
268
+ return G(
269
269
  t,
270
- d,
271
- x,
270
+ f,
271
+ b,
272
272
  !0,
273
- E ? Error("react-stack-top-frame") : i,
274
- E ? D(a(t)) : C
273
+ y ? Error("react-stack-top-frame") : s,
274
+ y ? ee(d(t)) : V
275
275
  );
276
276
  };
277
- })()), we;
277
+ })()), Le;
278
278
  }
279
- var Je;
280
- function ht() {
281
- return Je || (Je = 1, process.env.NODE_ENV === "production" ? Me.exports = pt() : Me.exports = mt()), Me.exports;
279
+ var Ge;
280
+ function At() {
281
+ return Ge || (Ge = 1, process.env.NODE_ENV === "production" ? Xe.exports = Rt() : Xe.exports = Dt()), Xe.exports;
282
282
  }
283
- var l = ht();
284
- const xt = 520, gt = () => /* @__PURE__ */ l.jsxs("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: [
285
- /* @__PURE__ */ l.jsx("rect", { x: "1", y: "0", width: "4", height: "16", rx: "1" }),
286
- /* @__PURE__ */ l.jsx("rect", { x: "9", y: "0", width: "4", height: "16", rx: "1" })
287
- ] }), Ye = () => /* @__PURE__ */ l.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ l.jsx("polyline", { points: "3,5 7,9 11,5" }) }), ze = () => /* @__PURE__ */ l.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ l.jsx("polyline", { points: "3,9 7,5 11,9" }) }), vt = ({
288
- currentTime: A,
289
- isPlaying: L,
290
- multiplier: Y,
291
- dateTimeFormat: a,
292
- timezone: M,
293
- isLive: R,
294
- hasStartTime: F,
295
- hasEndTime: O,
296
- showJumpToStart: z = !0,
297
- showJumpToEnd: _ = !0,
298
- onPlayPause: U,
299
- onJumpToStart: W,
300
- onRewind: ne,
301
- onFastForward: V,
283
+ var u = At();
284
+ const Ct = 520, _t = () => /* @__PURE__ */ u.jsxs("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: [
285
+ /* @__PURE__ */ u.jsx("rect", { x: "1", y: "0", width: "4", height: "16", rx: "1" }),
286
+ /* @__PURE__ */ u.jsx("rect", { x: "9", y: "0", width: "4", height: "16", rx: "1" })
287
+ ] }), Ve = () => /* @__PURE__ */ u.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ u.jsx("polyline", { points: "3,5 7,9 11,5" }) }), Ke = () => /* @__PURE__ */ u.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ u.jsx("polyline", { points: "3,9 7,5 11,9" }) }), jt = ({
288
+ currentTime: F,
289
+ isPlaying: X,
290
+ multiplier: K,
291
+ dateTimeFormat: d,
292
+ timezone: _,
293
+ isLive: S,
294
+ hasStartTime: W,
295
+ hasEndTime: $,
296
+ showJumpToStart: de = !0,
297
+ showJumpToEnd: H = !0,
298
+ onPlayPause: G,
299
+ onJumpToStart: U,
300
+ onRewind: I,
301
+ onFastForward: se,
302
302
  onJumpToEnd: Z,
303
- onJumpToLive: Q,
304
- onResetSpeed: B,
305
- onDateTimeClick: ee,
306
- theme: p,
307
- swimLanesVisible: g,
308
- onToggleSwimLanes: $,
309
- labels: K
303
+ onJumpToLive: ie,
304
+ onResetSpeed: te,
305
+ onDateTimeClick: ue,
306
+ theme: w,
307
+ swimLanesVisible: v,
308
+ onToggleSwimLanes: Q,
309
+ labels: M
310
310
  }) => {
311
- const u = Y < 0, v = Y > 1, P = Y === 1, y = Math.abs(Y), w = Se(
312
- () => ({ ...Ze, ...K }),
313
- [K]
314
- ), re = b(null), [X, te] = ve(!1);
315
- J(() => {
316
- const i = re.current;
317
- if (!i) return;
318
- const C = new ResizeObserver(([q]) => {
319
- te(q.contentRect.width < xt);
311
+ const B = K < 0, oe = K > 1, ge = K === 1, ce = Math.abs(K), A = Ne(
312
+ () => ({ ...lt, ...M }),
313
+ [M]
314
+ ), p = x(null), [g, L] = Ae(!1);
315
+ z(() => {
316
+ const s = p.current;
317
+ if (!s) return;
318
+ const V = new ResizeObserver(([k]) => {
319
+ L(k.contentRect.width < Ct);
320
320
  });
321
- return C.observe(i), () => C.disconnect();
321
+ return V.observe(s), () => V.disconnect();
322
322
  }, []);
323
- const H = {
323
+ const C = {
324
324
  background: "none",
325
325
  border: "1px solid transparent",
326
326
  cursor: "pointer",
@@ -337,73 +337,73 @@ const xt = 520, gt = () => /* @__PURE__ */ l.jsxs("svg", { width: "14", height:
337
337
  fontFamily: "system-ui, -apple-system, sans-serif",
338
338
  flexShrink: 0,
339
339
  lineHeight: 1
340
- }, D = (i) => ({
341
- ...H,
342
- color: i ? p.buttonActiveColor : p.buttonColor,
343
- borderColor: i ? `${p.buttonActiveColor}33` : "transparent"
344
- }), k = (i, C) => {
345
- i.currentTarget.style.backgroundColor = C ? `${p.buttonActiveColor}22` : p.buttonHoverColor + "44";
346
- }, S = (i) => {
347
- i.currentTarget.style.backgroundColor = "transparent";
340
+ }, ee = (s) => ({
341
+ ...C,
342
+ color: s ? w.buttonActiveColor : w.buttonColor,
343
+ borderColor: s ? `${w.buttonActiveColor}33` : "transparent"
344
+ }), O = (s, V) => {
345
+ s.currentTarget.style.backgroundColor = V ? `${w.buttonActiveColor}22` : w.buttonHoverColor + "44";
346
+ }, j = (s) => {
347
+ s.currentTarget.style.backgroundColor = "transparent";
348
348
  };
349
- return /* @__PURE__ */ l.jsxs(
349
+ return /* @__PURE__ */ u.jsxs(
350
350
  "div",
351
351
  {
352
- ref: re,
352
+ ref: p,
353
353
  style: {
354
- display: X ? "flex" : "grid",
355
- gridTemplateColumns: X ? void 0 : "1fr auto 1fr",
354
+ display: g ? "flex" : "grid",
355
+ gridTemplateColumns: g ? void 0 : "1fr auto 1fr",
356
356
  alignItems: "center",
357
357
  padding: "6px 16px",
358
- backgroundColor: p.controlBarBackground,
359
- borderBottom: `1px solid ${p.controlBarBorder}`,
358
+ backgroundColor: w.controlBarBackground,
359
+ borderBottom: `1px solid ${w.controlBarBorder}`,
360
360
  fontFamily: "system-ui, -apple-system, sans-serif"
361
361
  },
362
362
  children: [
363
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexShrink: 0 }, children: [
364
- /* @__PURE__ */ l.jsx(
363
+ /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexShrink: 0 }, children: [
364
+ /* @__PURE__ */ u.jsx(
365
365
  "div",
366
366
  {
367
- onClick: ee,
368
- title: ee ? w.dateTimeClickTooltip : void 0,
367
+ onClick: ue,
368
+ title: ue ? A.dateTimeClickTooltip : void 0,
369
369
  style: {
370
- color: p.labelColor,
370
+ color: w.labelColor,
371
371
  fontFamily: "monospace",
372
372
  lineHeight: 1.15,
373
- cursor: ee ? "pointer" : "default",
373
+ cursor: ue ? "pointer" : "default",
374
374
  borderRadius: "4px",
375
375
  padding: "2px 4px",
376
376
  transition: "background 0.15s"
377
377
  },
378
- onMouseEnter: (i) => {
379
- ee && (i.currentTarget.style.background = p.buttonHoverColor + "44");
378
+ onMouseEnter: (s) => {
379
+ ue && (s.currentTarget.style.background = w.buttonHoverColor + "44");
380
380
  },
381
- onMouseLeave: (i) => i.currentTarget.style.background = "transparent",
381
+ onMouseLeave: (s) => s.currentTarget.style.background = "transparent",
382
382
  children: (() => {
383
- const { timeFormat: i, dateFormat: C } = Qe(a), q = et(A, M);
384
- return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
385
- i && /* @__PURE__ */ l.jsx("div", { style: { fontSize: "2em", fontWeight: "bold", letterSpacing: "0.02em" }, children: Fe(A, i, M) }),
386
- C && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
387
- /* @__PURE__ */ l.jsx("span", { style: { fontSize: "1.15em", letterSpacing: "0.03em", color: p.buttonActiveColor }, children: Fe(A, C, M) }),
388
- q && /* @__PURE__ */ l.jsx("span", { style: {
383
+ const { timeFormat: s, dateFormat: V } = at(d), k = dt(F, _);
384
+ return /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
385
+ s && /* @__PURE__ */ u.jsx("div", { style: { fontSize: "2em", fontWeight: "bold", letterSpacing: "0.02em" }, children: We(F, s, _) }),
386
+ V && /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
387
+ /* @__PURE__ */ u.jsx("span", { style: { fontSize: "1.15em", letterSpacing: "0.03em", color: w.buttonActiveColor }, children: We(F, V, _) }),
388
+ k && /* @__PURE__ */ u.jsx("span", { style: {
389
389
  fontSize: "0.9em",
390
- color: p.labelColor,
390
+ color: w.labelColor,
391
391
  opacity: 0.7,
392
392
  fontWeight: "bold",
393
393
  letterSpacing: "0.04em"
394
- }, children: q })
394
+ }, children: k })
395
395
  ] })
396
396
  ] });
397
397
  })()
398
398
  }
399
399
  ),
400
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px", justifyContent: "center" }, children: [
401
- /* @__PURE__ */ l.jsx(
400
+ /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px", justifyContent: "center" }, children: [
401
+ /* @__PURE__ */ u.jsx(
402
402
  "button",
403
403
  {
404
- onClick: Q,
404
+ onClick: ie,
405
405
  style: {
406
- ...H,
406
+ ...C,
407
407
  fontSize: "11px",
408
408
  fontWeight: "bold",
409
409
  letterSpacing: "0.05em",
@@ -411,816 +411,869 @@ const xt = 520, gt = () => /* @__PURE__ */ l.jsxs("svg", { width: "14", height:
411
411
  minWidth: "52px",
412
412
  height: "20px",
413
413
  borderRadius: "3px",
414
- color: R ? p.controlBarBackground : p.buttonActiveColor,
415
- backgroundColor: R ? p.buttonActiveColor : "transparent",
416
- borderColor: p.buttonActiveColor,
417
- opacity: R ? 1 : 0.55
414
+ color: S ? w.controlBarBackground : w.buttonActiveColor,
415
+ backgroundColor: S ? w.buttonActiveColor : "transparent",
416
+ borderColor: w.buttonActiveColor,
417
+ opacity: S ? 1 : 0.55
418
418
  },
419
- onMouseEnter: (i) => {
420
- i.currentTarget.style.opacity = "1";
419
+ onMouseEnter: (s) => {
420
+ s.currentTarget.style.opacity = "1";
421
421
  },
422
- onMouseLeave: (i) => {
423
- i.currentTarget.style.opacity = R ? "1" : "0.55";
422
+ onMouseLeave: (s) => {
423
+ s.currentTarget.style.opacity = S ? "1" : "0.55";
424
424
  },
425
- title: R ? w.liveActiveTooltip : w.liveTooltip,
426
- children: R ? w.liveActiveLabel : w.liveLabel
425
+ title: S ? A.liveActiveTooltip : A.liveTooltip,
426
+ children: S ? A.liveActiveLabel : A.liveLabel
427
427
  }
428
428
  ),
429
- /* @__PURE__ */ l.jsx("div", { style: { height: "20px", display: "flex", alignItems: "center" }, children: !P && /* @__PURE__ */ l.jsx(
429
+ /* @__PURE__ */ u.jsx("div", { style: { height: "20px", display: "flex", alignItems: "center" }, children: !ge && /* @__PURE__ */ u.jsx(
430
430
  "button",
431
431
  {
432
- onClick: () => B(),
432
+ onClick: () => te(),
433
433
  style: {
434
- ...H,
434
+ ...C,
435
435
  fontSize: "11px",
436
- color: p.buttonActiveColor,
437
- borderColor: `${p.buttonActiveColor}44`,
436
+ color: w.buttonActiveColor,
437
+ borderColor: `${w.buttonActiveColor}44`,
438
438
  width: "52px",
439
439
  minWidth: "52px",
440
440
  height: "20px"
441
441
  },
442
- onMouseEnter: (i) => k(i, !0),
443
- onMouseLeave: S,
444
- title: w.resetSpeedTooltip,
445
- children: u ? `◀ ${y}×` : `${y}× ▶`
442
+ onMouseEnter: (s) => O(s, !0),
443
+ onMouseLeave: j,
444
+ title: A.resetSpeedTooltip,
445
+ children: B ? `◀ ${ce}×` : `${ce}× ▶`
446
446
  }
447
447
  ) })
448
448
  ] })
449
449
  ] }),
450
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px", ...X ? { flex: 1, justifyContent: "center" } : {} }, children: [
451
- z && /* @__PURE__ */ l.jsx(
450
+ /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px", ...g ? { flex: 1, justifyContent: "center" } : {} }, children: [
451
+ de && /* @__PURE__ */ u.jsx(
452
452
  "button",
453
453
  {
454
- onClick: F ? W : void 0,
455
- disabled: !F,
456
- style: { ...D(!1), opacity: F ? 1 : 0.3, cursor: F ? "pointer" : "default" },
457
- onMouseEnter: F ? (i) => k(i, !1) : void 0,
458
- onMouseLeave: F ? S : void 0,
459
- title: F ? w.jumpToStartTooltip : w.noStartTimeTooltip,
454
+ onClick: W ? U : void 0,
455
+ disabled: !W,
456
+ style: { ...ee(!1), opacity: W ? 1 : 0.3, cursor: W ? "pointer" : "default" },
457
+ onMouseEnter: W ? (s) => O(s, !1) : void 0,
458
+ onMouseLeave: W ? j : void 0,
459
+ title: W ? A.jumpToStartTooltip : A.noStartTimeTooltip,
460
460
  children: "⏮"
461
461
  }
462
462
  ),
463
- /* @__PURE__ */ l.jsx(
463
+ /* @__PURE__ */ u.jsx(
464
464
  "button",
465
465
  {
466
- onClick: ne,
467
- style: { ...D(u), width: "64px", minWidth: "64px", gap: "3px" },
468
- onMouseEnter: (i) => k(i, u),
469
- onMouseLeave: S,
470
- title: u ? Ie(w.rewindActiveTooltip, y) : w.rewindTooltip,
471
- children: u ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
472
- /* @__PURE__ */ l.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
473
- y,
466
+ onClick: I,
467
+ style: { ...ee(B), width: "64px", minWidth: "64px", gap: "3px" },
468
+ onMouseEnter: (s) => O(s, B),
469
+ onMouseLeave: j,
470
+ title: B ? Be(A.rewindActiveTooltip, ce) : A.rewindTooltip,
471
+ children: B ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
472
+ /* @__PURE__ */ u.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
473
+ ce,
474
474
  "×"
475
475
  ] }),
476
476
  "◀◀"
477
477
  ] }) : "◀◀"
478
478
  }
479
479
  ),
480
- /* @__PURE__ */ l.jsx(
480
+ /* @__PURE__ */ u.jsx(
481
481
  "button",
482
482
  {
483
- onClick: () => U(!L),
483
+ onClick: () => G(!X),
484
484
  style: {
485
- ...H,
486
- color: p.buttonActiveColor,
485
+ ...C,
486
+ color: w.buttonActiveColor,
487
487
  fontSize: "18px",
488
488
  width: "40px",
489
489
  minWidth: "40px",
490
490
  height: "40px",
491
- borderColor: `${p.buttonActiveColor}55`,
491
+ borderColor: `${w.buttonActiveColor}55`,
492
492
  borderRadius: "50%",
493
- paddingLeft: L ? "0" : "2px"
493
+ paddingLeft: X ? "0" : "2px"
494
494
  },
495
- onMouseEnter: (i) => k(i, !0),
496
- onMouseLeave: S,
497
- title: L ? w.pauseTooltip : u ? w.playFromRewindTooltip : w.playTooltip,
498
- children: L ? /* @__PURE__ */ l.jsx(gt, {}) : "▶"
495
+ onMouseEnter: (s) => O(s, !0),
496
+ onMouseLeave: j,
497
+ title: X ? A.pauseTooltip : B ? A.playFromRewindTooltip : A.playTooltip,
498
+ children: X ? /* @__PURE__ */ u.jsx(_t, {}) : "▶"
499
499
  }
500
500
  ),
501
- /* @__PURE__ */ l.jsx(
501
+ /* @__PURE__ */ u.jsx(
502
502
  "button",
503
503
  {
504
- onClick: V,
505
- style: { ...D(v), width: "64px", minWidth: "64px", gap: "3px" },
506
- onMouseEnter: (i) => k(i, v),
507
- onMouseLeave: S,
508
- title: v ? Ie(w.fastForwardActiveTooltip, y) : w.fastForwardTooltip,
509
- children: v ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
504
+ onClick: se,
505
+ style: { ...ee(oe), width: "64px", minWidth: "64px", gap: "3px" },
506
+ onMouseEnter: (s) => O(s, oe),
507
+ onMouseLeave: j,
508
+ title: oe ? Be(A.fastForwardActiveTooltip, ce) : A.fastForwardTooltip,
509
+ children: oe ? /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
510
510
  "▶▶",
511
- /* @__PURE__ */ l.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
512
- y,
511
+ /* @__PURE__ */ u.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
512
+ ce,
513
513
  "×"
514
514
  ] })
515
515
  ] }) : "▶▶"
516
516
  }
517
517
  ),
518
- _ && /* @__PURE__ */ l.jsx(
518
+ H && /* @__PURE__ */ u.jsx(
519
519
  "button",
520
520
  {
521
- onClick: O ? Z : void 0,
522
- disabled: !O,
523
- style: { ...D(!1), opacity: O ? 1 : 0.3, cursor: O ? "pointer" : "default" },
524
- onMouseEnter: O ? (i) => k(i, !1) : void 0,
525
- onMouseLeave: O ? S : void 0,
526
- title: O ? w.jumpToEndTooltip : w.noEndTimeTooltip,
521
+ onClick: $ ? Z : void 0,
522
+ disabled: !$,
523
+ style: { ...ee(!1), opacity: $ ? 1 : 0.3, cursor: $ ? "pointer" : "default" },
524
+ onMouseEnter: $ ? (s) => O(s, !1) : void 0,
525
+ onMouseLeave: $ ? j : void 0,
526
+ title: $ ? A.jumpToEndTooltip : A.noEndTimeTooltip,
527
527
  children: "⏭"
528
528
  }
529
529
  )
530
530
  ] }),
531
- !X && /* @__PURE__ */ l.jsx("div", { style: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: $ != null && g != null && /* @__PURE__ */ l.jsx(
531
+ !g && /* @__PURE__ */ u.jsx("div", { style: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: Q != null && v != null && /* @__PURE__ */ u.jsx(
532
532
  "button",
533
533
  {
534
- onClick: $,
534
+ onClick: Q,
535
535
  style: {
536
- ...H,
537
- color: p.buttonActiveColor,
538
- borderColor: `${p.buttonActiveColor}33`
536
+ ...C,
537
+ color: w.buttonActiveColor,
538
+ borderColor: `${w.buttonActiveColor}33`
539
539
  },
540
- onMouseEnter: (i) => k(i, g),
541
- onMouseLeave: S,
542
- title: g ? w.collapseSwimLanesTooltip : w.expandSwimLanesTooltip,
543
- children: g ? /* @__PURE__ */ l.jsx(Ye, {}) : /* @__PURE__ */ l.jsx(ze, {})
540
+ onMouseEnter: (s) => O(s, v),
541
+ onMouseLeave: j,
542
+ title: v ? A.collapseSwimLanesTooltip : A.expandSwimLanesTooltip,
543
+ children: v ? /* @__PURE__ */ u.jsx(Ve, {}) : /* @__PURE__ */ u.jsx(Ke, {})
544
544
  }
545
545
  ) }),
546
- X && $ != null && g != null && /* @__PURE__ */ l.jsx(
546
+ g && Q != null && v != null && /* @__PURE__ */ u.jsx(
547
547
  "button",
548
548
  {
549
- onClick: $,
549
+ onClick: Q,
550
550
  style: {
551
- ...H,
552
- color: p.buttonActiveColor,
553
- borderColor: `${p.buttonActiveColor}33`,
551
+ ...C,
552
+ color: w.buttonActiveColor,
553
+ borderColor: `${w.buttonActiveColor}33`,
554
554
  marginLeft: "4px"
555
555
  },
556
- onMouseEnter: (i) => k(i, g),
557
- onMouseLeave: S,
558
- title: g ? w.collapseSwimLanesTooltip : w.expandSwimLanesTooltip,
559
- children: g ? /* @__PURE__ */ l.jsx(Ye, {}) : /* @__PURE__ */ l.jsx(ze, {})
556
+ onMouseEnter: (s) => O(s, v),
557
+ onMouseLeave: j,
558
+ title: v ? A.collapseSwimLanesTooltip : A.expandSwimLanesTooltip,
559
+ children: v ? /* @__PURE__ */ u.jsx(Ve, {}) : /* @__PURE__ */ u.jsx(Ke, {})
560
560
  }
561
561
  )
562
562
  ]
563
563
  }
564
564
  );
565
- }, He = Ge(
566
- (A, L) => {
565
+ }, et = st(
566
+ (F, X) => {
567
567
  const {
568
- currentTime: Y,
569
- defaultStartMs: a,
570
- defaultEndMs: M,
571
- theme: R,
572
- maxTicks: F,
573
- timezone: O,
574
- onTimeChange: z,
575
- onDragStart: _,
576
- onDragEnd: U,
577
- swimLanes: W,
578
- showSwimLanes: ne,
579
- onSwimLaneItemClick: V,
580
- onSwimLaneItemHover: Z,
581
- onSwimLaneItemDoubleClick: Q,
582
- onSwimLaneItemContextMenu: B,
583
- onSwimLaneReorder: ee
584
- } = A, p = b(null), g = b(R), $ = b(F), K = b(O), u = b(a), v = b(M), P = b(j.JulianDate.toDate(Y).getTime());
585
- J(() => {
586
- g.current = R;
587
- }, [R]), J(() => {
588
- $.current = F;
589
- }, [F]), J(() => {
590
- K.current = O, h();
591
- }, [O]);
592
- const y = b(W ?? []), w = b(ne ?? (W != null && W.length > 0)), re = b(0), X = b(null), te = b(null), H = b(V), D = b(Z), k = b(Q), S = b(B), i = b(ee);
593
- J(() => {
594
- H.current = V;
595
- }, [V]), J(() => {
596
- D.current = Z;
597
- }, [Z]), J(() => {
598
- k.current = Q;
599
- }, [Q]), J(() => {
600
- S.current = B;
601
- }, [B]), J(() => {
602
- i.current = ee;
603
- }, [ee]), J(() => {
604
- y.current = W ?? [], h();
605
- }, [W]), J(() => {
606
- w.current = ne ?? (W != null && W.length > 0), h();
607
- }, [ne, W]);
608
- const C = b(null), q = b(null), t = b(!1), d = b(0), x = b("none"), E = b(0), ce = b(0), pe = b(0), T = b("none"), oe = b(0), ae = b(0), xe = (e, n) => Math.hypot(n.clientX - e.clientX, n.clientY - e.clientY), fe = se(() => ({
609
- startMs: u.current,
610
- endMs: v.current,
611
- currentMs: P.current,
612
- theme: g.current,
613
- maxTicks: $.current,
614
- timezone: K.current,
615
- swimLanes: y.current,
616
- showSwimLanes: w.current,
617
- scrollTop: re.current,
618
- reorderState: te.current
568
+ currentTime: K,
569
+ defaultStartMs: d,
570
+ defaultEndMs: _,
571
+ theme: S,
572
+ maxTicks: W,
573
+ timezone: $,
574
+ dateTimeFormat: de,
575
+ months: H,
576
+ onTimeChange: G,
577
+ onDragStart: U,
578
+ onDragEnd: I,
579
+ onRangeSelect: se,
580
+ swimLanes: Z,
581
+ showSwimLanes: ie,
582
+ onSwimLaneItemClick: te,
583
+ onSwimLaneItemHover: ue,
584
+ onSwimLaneItemDoubleClick: w,
585
+ onSwimLaneItemContextMenu: v,
586
+ onSwimLaneReorder: Q
587
+ } = F, M = x(null), B = x(S), oe = x(W), ge = x($), ce = x(de), A = x(H), p = x(d), g = x(_), L = x(D.JulianDate.toDate(K).getTime());
588
+ z(() => {
589
+ B.current = S;
590
+ }, [S]), z(() => {
591
+ oe.current = W;
592
+ }, [W]), z(() => {
593
+ ge.current = $, m();
594
+ }, [$]), z(() => {
595
+ ce.current = de, m();
596
+ }, [de]), z(() => {
597
+ A.current = H, m();
598
+ }, [H]);
599
+ const C = x(Z ?? []), ee = x(ie ?? (Z != null && Z.length > 0)), O = x(0), j = x(null), s = x(null), V = x(te), k = x(ue), t = x(w), f = x(v), b = x(Q);
600
+ z(() => {
601
+ V.current = te;
602
+ }, [te]), z(() => {
603
+ k.current = ue;
604
+ }, [ue]), z(() => {
605
+ t.current = w;
606
+ }, [w]), z(() => {
607
+ f.current = v;
608
+ }, [v]), z(() => {
609
+ b.current = Q;
610
+ }, [Q]), z(() => {
611
+ C.current = Z ?? [], m();
612
+ }, [Z]), z(() => {
613
+ ee.current = ie ?? (Z != null && Z.length > 0), m();
614
+ }, [ie, Z]);
615
+ const y = x(null), re = x(null), he = x(!1), J = x(0), E = x("none"), fe = x(0), Te = x(0), ke = x(0), Ce = x(0), Fe = x(0), xe = x(null), q = x(se);
616
+ z(() => {
617
+ q.current = se;
618
+ }, [se]);
619
+ const pe = x("none"), ve = x(0), ye = x(0), _e = x(0), je = x(0), Ie = (e, n) => Math.hypot(n.clientX - e.clientX, n.clientY - e.clientY), be = ae(() => ({
620
+ startMs: p.current,
621
+ endMs: g.current,
622
+ currentMs: L.current,
623
+ theme: B.current,
624
+ maxTicks: oe.current,
625
+ timezone: ge.current,
626
+ use12h: /h/.test(ce.current ?? ""),
627
+ months: A.current,
628
+ swimLanes: C.current,
629
+ showSwimLanes: ee.current,
630
+ scrollTop: O.current,
631
+ reorderState: s.current,
632
+ rangeSelection: xe.current
619
633
  }), []);
620
- Ve(L, () => ({
634
+ it(X, () => ({
621
635
  zoomTo(e, n, r) {
622
- const c = Math.max(it, Math.min(lt, n - e)), o = (e + n) / 2;
623
- u.current = o - c / 2, v.current = o + c / 2, r !== void 0 && (P.current = r), h();
636
+ const a = Math.max(vt, Math.min(bt, n - e)), o = (e + n) / 2;
637
+ p.current = o - a / 2, g.current = o + a / 2, r !== void 0 && (L.current = r), m();
624
638
  },
625
639
  getVisibleRange() {
626
- return { startMs: u.current, endMs: v.current };
640
+ return { startMs: p.current, endMs: g.current };
627
641
  },
628
642
  startFollow(e) {
629
- if (d.current = e, q.current !== null) return;
630
- t.current = !0;
643
+ if (J.current = e, re.current !== null) return;
644
+ he.current = !0;
631
645
  let n = performance.now();
632
646
  const r = () => {
633
- const c = performance.now(), o = c - n;
634
- n = c;
635
- const s = o * d.current;
636
- u.current += s, v.current += s, P.current += s, h(), q.current = requestAnimationFrame(r);
647
+ const a = performance.now(), o = a - n;
648
+ n = a;
649
+ const c = o * J.current;
650
+ p.current += c, g.current += c, L.current += c, m(), re.current = requestAnimationFrame(r);
637
651
  };
638
- q.current = requestAnimationFrame(r);
652
+ re.current = requestAnimationFrame(r);
639
653
  },
640
654
  stopFollow() {
641
- t.current = !1, q.current !== null && (cancelAnimationFrame(q.current), q.current = null);
655
+ he.current = !1, re.current !== null && (cancelAnimationFrame(re.current), re.current = null);
642
656
  },
643
657
  correctFollow(e) {
644
- if (!t.current) return;
645
- const n = e - P.current;
646
- P.current = e, u.current += n, v.current += n;
658
+ if (!he.current) return;
659
+ const n = e - L.current;
660
+ L.current = e, p.current += n, g.current += n;
647
661
  },
648
662
  // ── Swim lane CRUD ──────────────────────────────────────────────
649
663
  appendSwimLane(e) {
650
- y.current = [...y.current, e], h();
664
+ C.current = [...C.current, e], m();
651
665
  },
652
666
  updateSwimLane(e, n) {
653
- y.current = y.current.map(
667
+ C.current = C.current.map(
654
668
  (r) => r.id === e ? { ...r, ...n, id: r.id } : r
655
- ), h();
669
+ ), m();
656
670
  },
657
671
  removeSwimLane(e) {
658
- y.current = y.current.filter((n) => n.id !== e), h();
672
+ C.current = C.current.filter((n) => n.id !== e), m();
659
673
  },
660
674
  reorderSwimLanes(e) {
661
- const n = new Map(y.current.map((c) => [c.id, c])), r = [];
662
- for (const c of e) {
663
- const o = n.get(c);
675
+ const n = new Map(C.current.map((a) => [a.id, a])), r = [];
676
+ for (const a of e) {
677
+ const o = n.get(a);
664
678
  o && r.push(o);
665
679
  }
666
- y.current = r, h();
680
+ C.current = r, m();
667
681
  }
668
682
  }));
669
- const h = se(() => {
670
- const e = p.current;
683
+ const m = ae(() => {
684
+ const e = M.current;
671
685
  if (!e) return;
672
686
  const n = e.getContext("2d");
673
687
  if (!n) return;
674
- const r = e.getBoundingClientRect(), c = r.width, o = r.height;
675
- if (c === 0 || o === 0) return;
676
- const s = window.devicePixelRatio || 1, f = Math.round(c * s), m = Math.round(o * s);
677
- (e.width !== f || e.height !== m) && (e.width = f, e.height = m), n.save(), n.scale(s, s);
678
- const I = tt(n, c, o, fe());
679
- I !== re.current && (re.current = I), n.restore();
680
- }, [fe]);
681
- Ke(() => {
682
- h();
683
- const e = p.current;
688
+ const r = e.getBoundingClientRect(), a = r.width, o = r.height;
689
+ if (a === 0 || o === 0) return;
690
+ const c = window.devicePixelRatio || 1, h = Math.round(a * c), l = Math.round(o * c);
691
+ (e.width !== h || e.height !== l) && (e.width = h, e.height = l), n.save(), n.scale(c, c);
692
+ const T = ft(n, a, o, be());
693
+ T !== O.current && (O.current = T), n.restore();
694
+ }, [be]);
695
+ ut(() => {
696
+ m();
697
+ const e = M.current;
684
698
  if (!e) return;
685
- const n = new ResizeObserver(() => h());
699
+ const n = new ResizeObserver(() => m());
686
700
  return n.observe(e), () => n.disconnect();
687
- }, [h]), J(() => {
688
- if (t.current) return;
689
- const e = j.JulianDate.toDate(Y).getTime();
690
- P.current !== e && (P.current = e, h());
691
- }, [Y, h]);
692
- const le = se((e) => {
693
- if (C.current !== null) return;
701
+ }, [m]), z(() => {
702
+ if (he.current) return;
703
+ const e = D.JulianDate.toDate(K).getTime();
704
+ L.current !== e && (L.current = e, m());
705
+ }, [K, m]);
706
+ const we = ae((e) => {
707
+ if (y.current !== null) return;
694
708
  const n = () => {
695
- const r = p.current, c = v.current - u.current, o = e * c * 0.01;
696
- if (u.current += o, v.current += o, r) {
697
- const s = r.getBoundingClientRect(), f = Math.max(0, Math.min(s.width, ce.current - s.left)), m = u.current + f / s.width * (v.current - u.current);
698
- P.current = m, z(j.JulianDate.fromDate(new Date(m)));
709
+ const r = M.current, a = g.current - p.current, o = e * a * 0.01;
710
+ if (p.current += o, g.current += o, r) {
711
+ const c = r.getBoundingClientRect(), h = Math.max(0, Math.min(c.width, Te.current - c.left)), l = p.current + h / c.width * (g.current - p.current);
712
+ L.current = l, G(D.JulianDate.fromDate(new Date(l)));
699
713
  }
700
- h(), C.current = requestAnimationFrame(n);
714
+ m(), y.current = requestAnimationFrame(n);
701
715
  };
702
- C.current = requestAnimationFrame(n);
703
- }, [h, z]), N = se(() => {
704
- C.current !== null && (cancelAnimationFrame(C.current), C.current = null);
705
- }, []), ie = se((e, n, r, c) => nt(e, n, r, c, fe()), [fe]), ue = se((e, n, r) => rt(e, n, r, fe()), [fe]), me = se((e, n) => ot(e, n, fe()), [fe]), Re = se((e) => {
716
+ y.current = requestAnimationFrame(n);
717
+ }, [m, G]), Me = ae(() => {
718
+ y.current !== null && (cancelAnimationFrame(y.current), y.current = null);
719
+ }, []), i = ae((e, n, r, a) => pt(e, n, r, a, be()), [be]), R = ae((e, n, r) => mt(e, n, r, be()), [be]), P = ae((e, n) => ht(e, n, be()), [be]), le = ae((e) => {
706
720
  e.preventDefault();
707
- const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, c = e.clientY - n.top;
708
- if (e.button === 0 && i.current) {
709
- const o = ue(r, c, n.height);
721
+ const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top;
722
+ if (e.button === 0 && b.current) {
723
+ const o = R(r, a, n.height);
710
724
  if (o) {
711
- const f = y.current.findIndex((m) => m.id === o.id);
712
- te.current = {
725
+ const h = C.current.findIndex((l) => l.id === o.id);
726
+ s.current = {
713
727
  dragging: !0,
714
728
  dragLaneId: o.id,
715
729
  dragStartY: e.clientY,
716
730
  currentY: e.clientY,
717
- insertIndex: f
731
+ insertIndex: h
718
732
  }, e.currentTarget.style.cursor = "grabbing";
719
733
  return;
720
734
  }
721
735
  }
722
- if (e.button === 0 && me(c, n.height)) {
723
- const o = (P.current - u.current) / (v.current - u.current) * n.width;
724
- if (!(Math.abs(r - o) <= 10) && ie(r, c, n.width, n.height)) {
725
- pe.current = performance.now();
736
+ if (e.button === 0 && P(a, n.height)) {
737
+ const o = (L.current - p.current) / (g.current - p.current) * n.width;
738
+ if (!(Math.abs(r - o) <= 10) && i(r, a, n.width, n.height)) {
739
+ ke.current = performance.now();
726
740
  return;
727
741
  }
728
742
  }
729
743
  if (e.button === 0) {
730
- x.current = "scrub", ce.current = e.clientX, e.currentTarget.style.cursor = "grabbing", _ == null || _();
731
- const o = u.current + r / n.width * (v.current - u.current);
732
- P.current = o, h(), z(j.JulianDate.fromDate(new Date(o)));
744
+ const o = (L.current - p.current) / (g.current - p.current) * n.width, c = Math.abs(r - o) <= 10, h = a >= n.height - Oe;
745
+ if (!c && h)
746
+ E.current = "rangeSelectPending", Fe.current = r, Ce.current = p.current + r / n.width * (g.current - p.current), e.currentTarget.style.cursor = "crosshair", U == null || U();
747
+ else {
748
+ E.current = "scrub", Te.current = e.clientX, e.currentTarget.style.cursor = "grabbing", U == null || U();
749
+ const l = p.current + r / n.width * (g.current - p.current);
750
+ L.current = l, m(), G(D.JulianDate.fromDate(new Date(l)));
751
+ }
733
752
  } else if (e.button === 1)
734
- x.current = "slide", E.current = e.clientX;
753
+ E.current = "slide", fe.current = e.clientX;
735
754
  else if (e.button === 2) {
736
- if (S.current && me(c, n.height))
755
+ if (f.current && P(a, n.height))
737
756
  return;
738
- x.current = "zoom", E.current = e.clientX;
757
+ E.current = "zoom", fe.current = e.clientX;
739
758
  }
740
- }, [h, z, _, ue, me, ie]);
741
- J(() => {
759
+ }, [m, G, U, R, P, i]);
760
+ z(() => {
742
761
  const e = (r) => {
743
- const c = te.current;
744
- if (c && c.dragging) {
745
- c.currentY = r.clientY;
746
- const m = p.current;
747
- if (m) {
748
- const I = m.getBoundingClientRect(), G = r.clientY - I.top;
749
- let Ee = -re.current;
750
- const je = y.current;
751
- let Le = je.length;
752
- for (let ye = 0; ye < je.length; ye++) {
753
- const ke = je[ye].height ?? Oe, Ue = Ee + ke / 2;
754
- if (G < Ue) {
755
- Le = ye;
762
+ const a = s.current;
763
+ if (a && a.dragging) {
764
+ a.currentY = r.clientY;
765
+ const l = M.current;
766
+ if (l) {
767
+ const T = l.getBoundingClientRect(), Y = r.clientY - T.top;
768
+ let Re = -O.current;
769
+ const Je = C.current;
770
+ let Ye = Je.length;
771
+ for (let Pe = 0; Pe < Je.length; Pe++) {
772
+ const ze = Je[Pe].height ?? $e, ot = Re + ze / 2;
773
+ if (Y < ot) {
774
+ Ye = Pe;
756
775
  break;
757
776
  }
758
- Ee += ke + Pe;
777
+ Re += ze + He;
759
778
  }
760
- c.insertIndex = Le;
779
+ a.insertIndex = Ye;
761
780
  }
762
- h();
781
+ m();
763
782
  return;
764
783
  }
765
- if (x.current === "none") return;
766
- const o = p.current;
784
+ if (E.current === "none") return;
785
+ const o = M.current;
767
786
  if (!o) return;
768
- const s = o.getBoundingClientRect(), f = s.width;
769
- if (x.current === "scrub") {
770
- ce.current = r.clientX;
771
- const m = r.clientX - s.left, I = f * 0.08;
772
- m < I ? le(-1) : m > f - I ? le(1) : N();
773
- const G = Math.max(0, Math.min(f, m)), de = u.current + G / f * (v.current - u.current);
774
- P.current = de, h(), z(j.JulianDate.fromDate(new Date(de)));
775
- } else if (x.current === "slide") {
776
- const m = E.current - r.clientX;
777
- if (E.current = r.clientX, m !== 0) {
778
- const I = m / f * (v.current - u.current);
779
- u.current += I, v.current += I, h();
787
+ const c = o.getBoundingClientRect(), h = c.width;
788
+ if (E.current === "scrub") {
789
+ Te.current = r.clientX;
790
+ const l = r.clientX - c.left, T = h * 0.08;
791
+ l < T ? we(-1) : l > h - T ? we(1) : Me();
792
+ const Y = Math.max(0, Math.min(h, l)), me = p.current + Y / h * (g.current - p.current);
793
+ L.current = me, m(), G(D.JulianDate.fromDate(new Date(me)));
794
+ } else if (E.current === "rangeSelectPending" || E.current === "rangeSelect") {
795
+ const l = r.clientX - c.left, T = Math.abs(l - Fe.current);
796
+ if (E.current === "rangeSelectPending" && T >= 3 && (E.current = "rangeSelect"), E.current === "rangeSelect") {
797
+ const Y = Math.max(0, Math.min(h, l)), me = p.current + Y / h * (g.current - p.current);
798
+ xe.current = {
799
+ startMs: Ce.current,
800
+ endMs: me
801
+ }, m();
802
+ }
803
+ } else if (E.current === "slide") {
804
+ const l = fe.current - r.clientX;
805
+ if (fe.current = r.clientX, l !== 0) {
806
+ const T = l / h * (g.current - p.current);
807
+ p.current += T, g.current += T, m();
780
808
  }
781
- } else if (x.current === "zoom") {
782
- const m = E.current - r.clientX;
783
- E.current = r.clientX, m !== 0 && he(Math.pow(1.01, m));
809
+ } else if (E.current === "zoom") {
810
+ const l = fe.current - r.clientX;
811
+ fe.current = r.clientX, l !== 0 && N(Math.pow(1.01, l));
784
812
  }
785
813
  }, n = () => {
786
- var c;
787
- const r = te.current;
814
+ var a, o;
815
+ const r = s.current;
788
816
  if (r && r.dragging) {
789
- const o = Math.abs(r.currentY - r.dragStartY), s = y.current, f = s.findIndex((m) => m.id === r.dragLaneId);
790
- if (o > 5 && f >= 0 && r.insertIndex !== f && r.insertIndex !== f + 1) {
791
- const m = [...s], [I] = m.splice(f, 1), G = r.insertIndex > f ? r.insertIndex - 1 : r.insertIndex;
792
- m.splice(G, 0, I), y.current = m, (c = i.current) == null || c.call(i, m.map((de) => de.id));
817
+ const c = Math.abs(r.currentY - r.dragStartY), h = C.current, l = h.findIndex((T) => T.id === r.dragLaneId);
818
+ if (c > 5 && l >= 0 && r.insertIndex !== l && r.insertIndex !== l + 1) {
819
+ const T = [...h], [Y] = T.splice(l, 1), me = r.insertIndex > l ? r.insertIndex - 1 : r.insertIndex;
820
+ T.splice(me, 0, Y), C.current = T, (a = b.current) == null || a.call(b, T.map((Re) => Re.id));
793
821
  }
794
- te.current = null, p.current && (p.current.style.cursor = "default"), h();
822
+ s.current = null, M.current && (M.current.style.cursor = "default"), m();
795
823
  return;
796
824
  }
797
- N(), x.current = "none", p.current && (p.current.style.cursor = "default"), U == null || U();
825
+ if (Me(), E.current === "rangeSelectPending") {
826
+ L.current = Ce.current, xe.current = null, E.current = "none", M.current && (M.current.style.cursor = "default"), m(), G(D.JulianDate.fromDate(new Date(Ce.current))), I == null || I();
827
+ return;
828
+ }
829
+ if (E.current === "rangeSelect") {
830
+ const c = xe.current;
831
+ if (xe.current = null, c) {
832
+ const h = Math.min(c.startMs, c.endMs), l = Math.max(c.startMs, c.endMs);
833
+ p.current = h, g.current = l;
834
+ const T = D.JulianDate.fromDate(new Date(h)), Y = D.JulianDate.fromDate(new Date(l));
835
+ (o = q.current) == null || o.call(q, T, Y);
836
+ }
837
+ E.current = "none", M.current && (M.current.style.cursor = "default"), m(), I == null || I();
838
+ return;
839
+ }
840
+ E.current = "none", M.current && (M.current.style.cursor = "default"), I == null || I();
798
841
  };
799
842
  return document.addEventListener("mousemove", e), document.addEventListener("mouseup", n), () => {
800
843
  document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", n);
801
844
  };
802
- }, [h, z, U, le, N]);
803
- const he = se((e) => {
804
- const n = st(u.current, v.current, e);
805
- u.current = n.startMs, v.current = n.endMs, h();
806
- }, [h]), be = se((e) => {
845
+ }, [m, G, I, we, Me]);
846
+ const N = ae((e) => {
847
+ const n = gt(p.current, g.current, e);
848
+ p.current = n.startMs, g.current = n.endMs, m();
849
+ }, [m]), ne = ae((e) => {
807
850
  e.preventDefault();
808
- const n = p.current;
851
+ const n = M.current;
809
852
  if (!n) return;
810
- const r = n.getBoundingClientRect(), c = e.clientY - r.top, o = w.current, s = y.current;
811
- if (o && s.length > 0) {
812
- const f = Math.max(0, r.height - $e);
813
- if (c >= 0 && c < f) {
814
- let m = 0;
815
- for (const G of s) m += (G.height ?? Oe) + Pe;
816
- const I = Math.max(0, m - f);
817
- if (I > 0) {
818
- re.current = Math.max(0, Math.min(I, re.current + e.deltaY * ct)), h();
853
+ const r = n.getBoundingClientRect(), a = e.clientY - r.top, o = ee.current, c = C.current;
854
+ if (o && c.length > 0) {
855
+ const h = Math.max(0, r.height - Oe);
856
+ if (a >= 0 && a < h) {
857
+ let l = 0;
858
+ for (const Y of c) l += (Y.height ?? $e) + He;
859
+ const T = Math.max(0, l - h);
860
+ if (T > 0) {
861
+ O.current = Math.max(0, Math.min(T, O.current + e.deltaY * xt)), m();
819
862
  return;
820
863
  }
821
864
  }
822
865
  }
823
- he(Math.pow(1.05, e.deltaY > 0 ? -1 : 1));
824
- }, [he, h]);
825
- J(() => {
826
- const e = p.current;
866
+ N(Math.pow(1.05, e.deltaY > 0 ? -1 : 1));
867
+ }, [N, m]);
868
+ z(() => {
869
+ const e = M.current;
827
870
  if (e)
828
- return e.addEventListener("wheel", be, { passive: !1 }), () => e.removeEventListener("wheel", be);
829
- }, [be]), J(() => {
830
- const e = p.current;
871
+ return e.addEventListener("wheel", ne, { passive: !1 }), () => e.removeEventListener("wheel", ne);
872
+ }, [ne]), z(() => {
873
+ const e = M.current;
831
874
  if (!e) return;
832
875
  const n = (o) => {
833
876
  o.preventDefault();
834
- const s = e.getBoundingClientRect();
877
+ const c = e.getBoundingClientRect();
835
878
  if (o.touches.length === 1) {
836
- const f = o.touches[0].clientX - s.left, m = Math.max(0, Math.min(s.width, f)), I = u.current + m / s.width * (v.current - u.current);
837
- T.current = "scrub", oe.current = o.touches[0].clientX, ce.current = o.touches[0].clientX, P.current = I, h(), _ == null || _(), z(j.JulianDate.fromDate(new Date(I)));
838
- } else o.touches.length >= 2 && (T.current = "pinch", ae.current = xe(o.touches[0], o.touches[1]));
879
+ const h = o.touches[0].clientX - c.left, l = Math.max(0, Math.min(c.width, h)), T = p.current + l / c.width * (g.current - p.current);
880
+ je.current = L.current, pe.current = "scrub", ve.current = o.touches[0].clientX, Te.current = o.touches[0].clientX, L.current = T, m(), U == null || U(), G(D.JulianDate.fromDate(new Date(T)));
881
+ } else o.touches.length >= 2 && (pe.current === "scrub" && (L.current = je.current, m(), G(D.JulianDate.fromDate(new Date(je.current)))), pe.current = "pinch", ye.current = Ie(o.touches[0], o.touches[1]), _e.current = (o.touches[0].clientX + o.touches[1].clientX) / 2 - c.left);
839
882
  }, r = (o) => {
840
883
  o.preventDefault();
841
- const s = e.getBoundingClientRect();
842
- if (T.current === "scrub" && o.touches.length >= 1) {
843
- const f = o.touches[0].clientX - s.left, m = s.width * 0.08;
844
- if (ce.current = o.touches[0].clientX, f < m) le(-1);
845
- else if (f > s.width - m) le(1);
884
+ const c = e.getBoundingClientRect();
885
+ if (pe.current === "scrub" && o.touches.length >= 1) {
886
+ const h = o.touches[0].clientX - c.left, l = c.width * 0.08;
887
+ if (Te.current = o.touches[0].clientX, h < l) we(-1);
888
+ else if (h > c.width - l) we(1);
846
889
  else {
847
- N();
848
- const I = Math.max(0, Math.min(s.width, f)), G = u.current + I / s.width * (v.current - u.current);
849
- P.current = G, h(), z(j.JulianDate.fromDate(new Date(G)));
890
+ Me();
891
+ const T = Math.max(0, Math.min(c.width, h)), Y = p.current + T / c.width * (g.current - p.current);
892
+ L.current = Y, m(), G(D.JulianDate.fromDate(new Date(Y)));
893
+ }
894
+ } else if (pe.current === "slide" && o.touches.length >= 1) {
895
+ const h = ve.current - o.touches[0].clientX;
896
+ if (ve.current = o.touches[0].clientX, h !== 0) {
897
+ const l = h / c.width * (g.current - p.current);
898
+ p.current += l, g.current += l, m();
850
899
  }
851
- } else if (T.current === "slide" && o.touches.length >= 1) {
852
- const f = oe.current - o.touches[0].clientX;
853
- if (oe.current = o.touches[0].clientX, f !== 0) {
854
- const m = f / s.width * (v.current - u.current);
855
- u.current += m, v.current += m, h();
900
+ } else if (pe.current === "pinch" && o.touches.length >= 2) {
901
+ const h = Ie(o.touches[0], o.touches[1]), l = (o.touches[0].clientX + o.touches[1].clientX) / 2 - c.left;
902
+ if (h > 0 && ye.current > 0) {
903
+ const T = p.current + _e.current / c.width * (g.current - p.current), Y = Tt(p.current, g.current, ye.current / h, T);
904
+ p.current = Y.startMs, g.current = Y.endMs, m();
856
905
  }
857
- } else if (T.current === "pinch" && o.touches.length >= 2) {
858
- const f = xe(o.touches[0], o.touches[1]);
859
- f > 0 && ae.current > 0 && he(ae.current / f), ae.current = f;
906
+ ye.current = h, _e.current = l;
860
907
  }
861
- }, c = (o) => {
862
- N(), T.current === "scrub" && (U == null || U()), o.touches.length === 0 ? T.current = "none" : o.touches.length === 1 && (T.current = "slide", oe.current = o.touches[0].clientX);
908
+ }, a = (o) => {
909
+ Me(), pe.current === "scrub" && (I == null || I()), o.touches.length === 0 ? pe.current = "none" : o.touches.length === 1 && (pe.current = "slide", ve.current = o.touches[0].clientX);
863
910
  };
864
- return e.addEventListener("touchstart", n, { passive: !1 }), e.addEventListener("touchmove", r, { passive: !1 }), e.addEventListener("touchend", c, { passive: !1 }), () => {
865
- e.removeEventListener("touchstart", n), e.removeEventListener("touchmove", r), e.removeEventListener("touchend", c);
911
+ return e.addEventListener("touchstart", n, { passive: !1 }), e.addEventListener("touchmove", r, { passive: !1 }), e.addEventListener("touchend", a, { passive: !1 }), () => {
912
+ e.removeEventListener("touchstart", n), e.removeEventListener("touchmove", r), e.removeEventListener("touchend", a);
866
913
  };
867
- }, [h, _, U, z, he, le, N]);
868
- const De = se((e) => {
869
- var f, m, I;
870
- if (x.current !== "none") return;
871
- const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, c = e.clientY - n.top, o = (P.current - u.current) / (v.current - u.current) * n.width, s = Math.abs(r - o) <= 10;
872
- if (me(c, n.height)) {
873
- const G = ie(r, c, n.width, n.height), de = X.current;
874
- if (G)
875
- e.currentTarget.style.cursor = s ? "grab" : "pointer", (!de || de.item.id !== G.item.id || de.lane.id !== G.lane.id) && (X.current = G, (f = D.current) == null || f.call(D, { laneId: G.lane.id, item: G.item, originalEvent: e.nativeEvent }), h());
876
- else if (de && (X.current = null, (m = D.current) == null || m.call(D, null), h()), s)
914
+ }, [m, U, I, G, N, we, Me]);
915
+ const Ee = ae((e) => {
916
+ var h, l, T;
917
+ if (E.current !== "none") return;
918
+ const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = (L.current - p.current) / (g.current - p.current) * n.width, c = Math.abs(r - o) <= 10;
919
+ if (P(a, n.height)) {
920
+ const Y = i(r, a, n.width, n.height), me = j.current;
921
+ if (Y)
922
+ e.currentTarget.style.cursor = c ? "grab" : "pointer", (!me || me.item.id !== Y.item.id || me.lane.id !== Y.lane.id) && (j.current = Y, (h = k.current) == null || h.call(k, { laneId: Y.lane.id, item: Y.item, originalEvent: e.nativeEvent }), m());
923
+ else if (me && (j.current = null, (l = k.current) == null || l.call(k, null), m()), c)
877
924
  e.currentTarget.style.cursor = "grab";
878
925
  else {
879
- const Ee = ue(r, c, n.height);
880
- e.currentTarget.style.cursor = Ee && i.current ? "grab" : "default";
926
+ const Re = R(r, a, n.height);
927
+ e.currentTarget.style.cursor = Re && b.current ? "grab" : "default";
881
928
  }
882
929
  return;
883
930
  }
884
- X.current && (X.current = null, (I = D.current) == null || I.call(D, null), h()), e.currentTarget.style.cursor = s ? "grab" : "default";
885
- }, [h, ie, me, ue]), Ce = se((e) => {
886
- var f;
887
- if (performance.now() - pe.current > 300) return;
888
- const r = e.currentTarget.getBoundingClientRect(), c = e.clientX - r.left, o = e.clientY - r.top, s = ie(c, o, r.width, r.height);
889
- s && ((f = H.current) == null || f.call(H, { laneId: s.lane.id, item: s.item, originalEvent: e.nativeEvent }));
890
- }, [ie]), Ae = se((e) => {
891
- var s;
892
- const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, c = e.clientY - n.top, o = ie(r, c, n.width, n.height);
893
- o && ((s = k.current) == null || s.call(k, { laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent }));
894
- }, [ie]), _e = se((e) => {
895
- const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, c = e.clientY - n.top, o = ie(r, c, n.width, n.height);
896
- o && S.current ? (e.preventDefault(), S.current({ laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent })) : e.preventDefault();
897
- }, [ie]);
898
- return J(() => () => {
899
- C.current !== null && cancelAnimationFrame(C.current), q.current !== null && cancelAnimationFrame(q.current);
900
- }, []), /* @__PURE__ */ l.jsx(
931
+ j.current && (j.current = null, (T = k.current) == null || T.call(k, null), m()), c ? e.currentTarget.style.cursor = "grab" : a >= n.height - Oe ? e.currentTarget.style.cursor = "crosshair" : e.currentTarget.style.cursor = "default";
932
+ }, [m, i, P, R]), tt = ae((e) => {
933
+ var h;
934
+ if (performance.now() - ke.current > 300) return;
935
+ const r = e.currentTarget.getBoundingClientRect(), a = e.clientX - r.left, o = e.clientY - r.top, c = i(a, o, r.width, r.height);
936
+ c && ((h = V.current) == null || h.call(V, { laneId: c.lane.id, item: c.item, originalEvent: e.nativeEvent }));
937
+ }, [i]), nt = ae((e) => {
938
+ var c;
939
+ const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = i(r, a, n.width, n.height);
940
+ o && ((c = t.current) == null || c.call(t, { laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent }));
941
+ }, [i]), rt = ae((e) => {
942
+ const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, a = e.clientY - n.top, o = i(r, a, n.width, n.height);
943
+ o && f.current ? (e.preventDefault(), f.current({ laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent })) : e.preventDefault();
944
+ }, [i]);
945
+ return z(() => () => {
946
+ y.current !== null && cancelAnimationFrame(y.current), re.current !== null && cancelAnimationFrame(re.current);
947
+ }, []), /* @__PURE__ */ u.jsx(
901
948
  "canvas",
902
949
  {
903
- ref: p,
950
+ ref: M,
904
951
  style: { width: "100%", flex: 1, minHeight: 0, display: "block", cursor: "default" },
905
- onMouseDown: Re,
906
- onMouseMove: De,
907
- onClick: Ce,
908
- onDoubleClick: Ae,
952
+ onMouseDown: le,
953
+ onMouseMove: Ee,
954
+ onClick: tt,
955
+ onDoubleClick: nt,
909
956
  onMouseLeave: () => {
910
957
  var e;
911
- X.current && (X.current = null, (e = D.current) == null || e.call(D, null), h()), x.current === "none" && p.current && (p.current.style.cursor = "default");
958
+ j.current && (j.current = null, (e = k.current) == null || e.call(k, null), m()), E.current === "none" && M.current && (M.current.style.cursor = "default");
912
959
  },
913
- onContextMenu: _e
960
+ onContextMenu: rt
914
961
  }
915
962
  );
916
963
  }
917
964
  );
918
- He.displayName = "TimelineCanvas";
919
- const We = [2, 4, 8, 16, 32, 100, 1], Be = [1, 2, 4, 8, 16, 32, 100], wt = ({
920
- startTime: A,
921
- endTime: L,
922
- currentTime: Y,
923
- clock: a,
924
- onTimeChange: M,
925
- onPlayPause: R,
926
- onMultiplierChange: F,
927
- height: O,
928
- showControls: z = !0,
929
- showJumpToStart: _,
930
- showJumpToEnd: U,
931
- enableDrag: W = !0,
932
- dateTimeFormat: ne,
933
- onDateTimeClick: V,
965
+ et.displayName = "TimelineCanvas";
966
+ const Ze = [2, 4, 8, 16, 32, 100, 1], Qe = [1, 2, 4, 8, 16, 32, 100], kt = ({
967
+ startTime: F,
968
+ endTime: X,
969
+ currentTime: K,
970
+ clock: d,
971
+ onTimeChange: _,
972
+ onPlayPause: S,
973
+ onMultiplierChange: W,
974
+ height: $,
975
+ showControls: de = !0,
976
+ showJumpToStart: H,
977
+ showJumpToEnd: G,
978
+ enableDrag: U = !0,
979
+ dateTimeFormat: I,
980
+ onDateTimeClick: se,
934
981
  jumpToTime: Z,
935
- maxTicks: Q,
936
- ffSpeeds: B = We,
937
- rwSpeeds: ee = Be,
938
- theme: p,
939
- className: g,
940
- timezone: $,
941
- swimLanes: K,
942
- showSwimLanes: u,
943
- onShowSwimLanesChange: v,
944
- swimLaneTransition: P = "animated",
945
- onSwimLaneItemClick: y,
946
- onSwimLaneItemHover: w,
947
- onSwimLaneItemDoubleClick: re,
948
- onSwimLaneItemContextMenu: X,
949
- onSwimLaneReorder: te,
950
- labels: H
982
+ maxTicks: ie,
983
+ ffSpeeds: te = Ze,
984
+ rwSpeeds: ue = Qe,
985
+ theme: w,
986
+ className: v,
987
+ timezone: Q,
988
+ swimLanes: M,
989
+ showSwimLanes: B,
990
+ onShowSwimLanesChange: oe,
991
+ swimLaneTransition: ge = "animated",
992
+ onSwimLaneItemClick: ce,
993
+ onSwimLaneItemHover: A,
994
+ onSwimLaneItemDoubleClick: p,
995
+ onSwimLaneItemContextMenu: g,
996
+ onSwimLaneReorder: L,
997
+ onRangeSelect: C,
998
+ labels: ee
951
999
  }) => {
952
- const D = () => Date.now(), k = A ? j.JulianDate.toDate(ge(A)).getTime() : D() - 432e5, S = L ? j.JulianDate.toDate(ge(L)).getTime() : D() + 12 * 3600 * 1e3, [i, C] = ve(
953
- () => ge(Y ?? A ?? j.JulianDate.fromDate(/* @__PURE__ */ new Date()))
954
- ), [q, t] = ve((a == null ? void 0 : a.shouldAnimate) ?? !1), [d, x] = ve((a == null ? void 0 : a.multiplier) ?? 1), [E, ce] = ve(u ?? !0);
955
- J(() => {
956
- u != null && ce(u);
957
- }, [u]);
958
- const pe = () => {
959
- const e = !E;
960
- ce(e), v == null || v(e);
961
- }, T = K != null && K.length > 0, oe = b(null), [ae, xe] = ve(0);
962
- J(() => {
963
- const e = oe.current;
964
- if (!e) return;
965
- const n = new ResizeObserver(([r]) => xe(r.borderBoxSize[0].blockSize));
966
- return n.observe(e), () => n.disconnect();
967
- }, [z]);
968
- const h = T && !E ? `${ae + $e}px` : O != null ? `${O}px` : "100%", le = b(!1), N = b(null), ie = { ...at, ...p };
969
- J(() => {
970
- if (!a) return;
971
- const e = () => {
972
- if (!le.current) {
973
- const n = j.JulianDate.clone(a.currentTime);
974
- if (C(n), t(a.shouldAnimate), x(a.multiplier), N.current) {
975
- const { startMs: r, endMs: c } = N.current.getVisibleRange(), o = c - r, s = j.JulianDate.toDate(n).getTime(), f = s - r;
976
- f <= o * 0.1 ? N.current.zoomTo(s - o * 0.1, s + o * 0.9, s) : f >= o * 0.9 && N.current.zoomTo(s - o * 0.9, s + o * 0.1, s);
1000
+ const O = () => Date.now(), j = F ? D.JulianDate.toDate(De(F)).getTime() : O() - 432e5, s = X ? D.JulianDate.toDate(De(X)).getTime() : O() + 12 * 3600 * 1e3, [V, k] = Ae(
1001
+ () => De(K ?? F ?? D.JulianDate.fromDate(/* @__PURE__ */ new Date()))
1002
+ ), [t, f] = Ae((d == null ? void 0 : d.shouldAnimate) ?? !1), [b, y] = Ae((d == null ? void 0 : d.multiplier) ?? 1), [re, he] = Ae(B ?? !0);
1003
+ z(() => {
1004
+ B != null && he(B);
1005
+ }, [B]);
1006
+ const J = () => {
1007
+ const i = !re;
1008
+ he(i), oe == null || oe(i);
1009
+ }, E = M != null && M.length > 0, fe = x(null), [Te, ke] = Ae(0);
1010
+ z(() => {
1011
+ const i = fe.current;
1012
+ if (!i) return;
1013
+ const R = new ResizeObserver(([P]) => ke(P.borderBoxSize[0].blockSize));
1014
+ return R.observe(i), () => R.disconnect();
1015
+ }, [de]);
1016
+ const Fe = E && !re ? `${Te + Oe}px` : $ != null ? `${$}px` : "100%", xe = x(!1), q = x(null), pe = { ...wt, ...w };
1017
+ z(() => {
1018
+ if (!d) return;
1019
+ const i = () => {
1020
+ if (!xe.current) {
1021
+ const R = D.JulianDate.clone(d.currentTime);
1022
+ if (k(R), f(d.shouldAnimate), y(d.multiplier), q.current) {
1023
+ const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P, ne = D.JulianDate.toDate(R).getTime(), Ee = ne - P;
1024
+ Ee <= N * 0.1 ? q.current.zoomTo(ne - N * 0.1, ne + N * 0.9, ne) : Ee >= N * 0.9 && q.current.zoomTo(ne - N * 0.9, ne + N * 0.1, ne);
977
1025
  }
978
1026
  }
979
1027
  };
980
- return a.onTick.addEventListener(e), () => {
981
- a.onTick.removeEventListener(e);
1028
+ return d.onTick.addEventListener(i), () => {
1029
+ d.onTick.removeEventListener(i);
982
1030
  };
983
- }, [a]), J(() => {
984
- if (a) return;
985
- const e = setInterval(() => {
986
- if (le.current) return;
987
- const n = j.JulianDate.fromDate(/* @__PURE__ */ new Date());
988
- if (C(n), N.current) {
989
- const { startMs: r, endMs: c } = N.current.getVisibleRange(), o = c - r, s = j.JulianDate.toDate(n).getTime(), f = s - r;
990
- f <= o * 0.1 ? N.current.zoomTo(s - o * 0.1, s + o * 0.9, s) : f >= o * 0.9 && N.current.zoomTo(s - o * 0.9, s + o * 0.1, s);
1031
+ }, [d]), z(() => {
1032
+ if (d) return;
1033
+ const i = setInterval(() => {
1034
+ if (xe.current) return;
1035
+ const R = D.JulianDate.fromDate(/* @__PURE__ */ new Date());
1036
+ if (k(R), q.current) {
1037
+ const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P, ne = D.JulianDate.toDate(R).getTime(), Ee = ne - P;
1038
+ Ee <= N * 0.1 ? q.current.zoomTo(ne - N * 0.1, ne + N * 0.9, ne) : Ee >= N * 0.9 && q.current.zoomTo(ne - N * 0.9, ne + N * 0.1, ne);
991
1039
  }
992
1040
  }, 1e3);
993
- return () => clearInterval(e);
994
- }, [a]), J(() => {
1041
+ return () => clearInterval(i);
1042
+ }, [d]), z(() => {
995
1043
  if (!Z) return;
996
- const e = ge(Z);
997
- if (me(e), N.current) {
998
- const { startMs: n, endMs: r } = N.current.getVisibleRange(), c = r - n, o = j.JulianDate.toDate(e).getTime();
999
- N.current.zoomTo(o - c / 2, o + c / 2);
1044
+ const i = De(Z);
1045
+ if (ye(i), q.current) {
1046
+ const { startMs: R, endMs: P } = q.current.getVisibleRange(), le = P - R, N = D.JulianDate.toDate(i).getTime();
1047
+ q.current.zoomTo(N - le / 2, N + le / 2);
1000
1048
  }
1001
1049
  }, [Z]);
1002
- const ue = (e, n = !0) => {
1003
- a && (a.multiplier = e, n && (a.shouldAnimate = !0)), x(e), n && t(!0), F == null || F(e);
1004
- }, me = (e) => {
1005
- C(e), a && (a.currentTime = j.JulianDate.clone(e)), M == null || M(e);
1006
- }, Re = (e) => {
1007
- e && d < 0 && ue(1, !1), a && (a.shouldAnimate = e), t(e), R == null || R(e);
1008
- }, he = () => {
1009
- const e = B.length > 0 ? B : We, n = d > 1 ? d : 1, r = e.indexOf(n), c = e[r < 0 || r === e.length - 1 ? 0 : r + 1];
1010
- ue(c);
1050
+ const ve = (i, R = !0) => {
1051
+ d && (d.multiplier = i, R && (d.shouldAnimate = !0)), y(i), R && f(!0), W == null || W(i);
1052
+ }, ye = (i) => {
1053
+ k(i), d && (d.currentTime = D.JulianDate.clone(i)), _ == null || _(i);
1054
+ }, _e = (i) => {
1055
+ i && b < 0 && ve(1, !1), d && (d.shouldAnimate = i), f(i), S == null || S(i);
1056
+ }, je = () => {
1057
+ const i = te.length > 0 ? te : Ze, R = b > 1 ? b : 1, P = i.indexOf(R), le = i[P < 0 || P === i.length - 1 ? 0 : P + 1];
1058
+ ve(le);
1059
+ }, Ie = () => {
1060
+ const i = ue.length > 0 ? ue : Qe, R = b < 0 ? Math.abs(b) : 0, P = i.indexOf(R), le = -i[P < 0 || P === i.length - 1 ? 0 : P + 1];
1061
+ ve(le);
1011
1062
  }, be = () => {
1012
- const e = ee.length > 0 ? ee : Be, n = d < 0 ? Math.abs(d) : 0, r = e.indexOf(n), c = -e[r < 0 || r === e.length - 1 ? 0 : r + 1];
1013
- ue(c);
1014
- }, De = () => {
1015
- var n;
1016
- const e = ge(A ?? j.JulianDate.fromDate(new Date(k)));
1017
- a && (a.currentTime = j.JulianDate.clone(e)), C(e), (n = N.current) == null || n.zoomTo(k, S);
1018
- }, Ce = () => {
1019
- var n;
1020
- const e = ge(L ?? j.JulianDate.fromDate(new Date(S)));
1021
- a && (a.currentTime = j.JulianDate.clone(e)), C(e), (n = N.current) == null || n.zoomTo(k, S);
1022
- }, Ae = () => {
1023
- var r;
1024
- const e = j.JulianDate.fromDate(/* @__PURE__ */ new Date());
1025
- a && (a.currentTime = j.JulianDate.clone(e)), C(e), ue(1);
1026
- const n = Date.now();
1027
- (r = N.current) == null || r.zoomTo(n - 12 * 3600 * 1e3, n + 12 * 3600 * 1e3);
1028
- }, _e = Math.abs(j.JulianDate.toDate(i).getTime() - Date.now()) < 1e4;
1029
- return /* @__PURE__ */ l.jsxs(
1063
+ var R;
1064
+ const i = De(F ?? D.JulianDate.fromDate(new Date(j)));
1065
+ d && (d.currentTime = D.JulianDate.clone(i)), k(i), (R = q.current) == null || R.zoomTo(j, s);
1066
+ }, m = () => {
1067
+ var R;
1068
+ const i = De(X ?? D.JulianDate.fromDate(new Date(s)));
1069
+ d && (d.currentTime = D.JulianDate.clone(i)), k(i), (R = q.current) == null || R.zoomTo(j, s);
1070
+ }, we = () => {
1071
+ const i = D.JulianDate.fromDate(/* @__PURE__ */ new Date());
1072
+ d && (d.currentTime = D.JulianDate.clone(i)), k(i), ve(1);
1073
+ const R = Date.now();
1074
+ if (q.current) {
1075
+ const { startMs: P, endMs: le } = q.current.getVisibleRange(), N = le - P;
1076
+ q.current.zoomTo(R - N / 2, R + N / 2);
1077
+ }
1078
+ }, Me = Math.abs(D.JulianDate.toDate(V).getTime() - Date.now()) < 1e4;
1079
+ return /* @__PURE__ */ u.jsxs(
1030
1080
  "div",
1031
1081
  {
1032
- className: g,
1082
+ className: v,
1033
1083
  style: {
1034
1084
  width: "100%",
1035
- height: h,
1085
+ height: Fe,
1036
1086
  overflow: "hidden",
1037
1087
  display: "flex",
1038
1088
  flexDirection: "column",
1039
1089
  fontFamily: "system-ui, -apple-system, sans-serif",
1040
- transition: P === "animated" ? "height 0.2s ease" : void 0
1090
+ transition: ge === "animated" ? "height 0.2s ease" : void 0
1041
1091
  },
1042
1092
  children: [
1043
- z && /* @__PURE__ */ l.jsx("div", { ref: oe, children: /* @__PURE__ */ l.jsx(
1044
- vt,
1093
+ de && /* @__PURE__ */ u.jsx("div", { ref: fe, children: /* @__PURE__ */ u.jsx(
1094
+ jt,
1045
1095
  {
1046
- currentTime: i,
1047
- isPlaying: q,
1048
- multiplier: d,
1049
- isLive: _e,
1050
- hasStartTime: A != null,
1051
- hasEndTime: L != null,
1052
- showJumpToStart: _,
1053
- showJumpToEnd: U,
1054
- onPlayPause: Re,
1055
- onJumpToStart: De,
1056
- onRewind: be,
1057
- onFastForward: he,
1058
- onJumpToEnd: Ce,
1059
- onJumpToLive: Ae,
1060
- onResetSpeed: () => ue(1),
1061
- onDateTimeClick: V,
1062
- dateTimeFormat: ne,
1063
- timezone: $,
1064
- theme: ie,
1065
- swimLanesVisible: T ? E : void 0,
1066
- onToggleSwimLanes: T ? pe : void 0,
1067
- labels: H
1096
+ currentTime: V,
1097
+ isPlaying: t,
1098
+ multiplier: b,
1099
+ isLive: Me,
1100
+ hasStartTime: F != null,
1101
+ hasEndTime: X != null,
1102
+ showJumpToStart: H,
1103
+ showJumpToEnd: G,
1104
+ onPlayPause: _e,
1105
+ onJumpToStart: be,
1106
+ onRewind: Ie,
1107
+ onFastForward: je,
1108
+ onJumpToEnd: m,
1109
+ onJumpToLive: we,
1110
+ onResetSpeed: () => ve(1),
1111
+ onDateTimeClick: se,
1112
+ dateTimeFormat: I,
1113
+ timezone: Q,
1114
+ theme: pe,
1115
+ swimLanesVisible: E ? re : void 0,
1116
+ onToggleSwimLanes: E ? J : void 0,
1117
+ labels: ee
1068
1118
  }
1069
1119
  ) }),
1070
- W !== !1 && /* @__PURE__ */ l.jsx(
1071
- He,
1120
+ U !== !1 && /* @__PURE__ */ u.jsx(
1121
+ et,
1072
1122
  {
1073
- ref: N,
1074
- currentTime: i,
1075
- defaultStartMs: k,
1076
- defaultEndMs: S,
1077
- theme: ie,
1078
- maxTicks: Q,
1079
- timezone: $,
1080
- onTimeChange: me,
1123
+ ref: q,
1124
+ currentTime: V,
1125
+ defaultStartMs: j,
1126
+ defaultEndMs: s,
1127
+ theme: pe,
1128
+ maxTicks: ie,
1129
+ timezone: Q,
1130
+ dateTimeFormat: I,
1131
+ months: ee == null ? void 0 : ee.months,
1132
+ onTimeChange: ye,
1081
1133
  onDragStart: () => {
1082
- le.current = !0;
1134
+ xe.current = !0;
1083
1135
  },
1084
1136
  onDragEnd: () => {
1085
- le.current = !1;
1137
+ xe.current = !1;
1086
1138
  },
1087
- swimLanes: K,
1088
- showSwimLanes: E,
1089
- onSwimLaneItemClick: y,
1090
- onSwimLaneItemHover: w,
1091
- onSwimLaneItemDoubleClick: re,
1092
- onSwimLaneItemContextMenu: X,
1093
- onSwimLaneReorder: te
1139
+ swimLanes: M,
1140
+ showSwimLanes: re,
1141
+ onSwimLaneItemClick: ce,
1142
+ onSwimLaneItemHover: A,
1143
+ onSwimLaneItemDoubleClick: p,
1144
+ onSwimLaneItemContextMenu: g,
1145
+ onSwimLaneReorder: L,
1146
+ onRangeSelect: C
1094
1147
  }
1095
1148
  )
1096
1149
  ]
1097
1150
  }
1098
1151
  );
1099
- }, Et = ({
1100
- startTime: A,
1101
- endTime: L,
1102
- currentTime: Y,
1103
- width: a,
1104
- height: M,
1105
- tickInterval: R,
1106
- showLabels: F,
1107
- snapToTicks: O,
1108
- enableDrag: z,
1109
- theme: _,
1110
- onTimeChange: U,
1111
- onVisibleRangeChange: W,
1112
- onDragStart: ne,
1113
- onDragEnd: V
1152
+ }, Ft = ({
1153
+ startTime: F,
1154
+ endTime: X,
1155
+ currentTime: K,
1156
+ width: d,
1157
+ height: _,
1158
+ tickInterval: S,
1159
+ showLabels: W,
1160
+ snapToTicks: $,
1161
+ enableDrag: de,
1162
+ theme: H,
1163
+ onTimeChange: G,
1164
+ onVisibleRangeChange: U,
1165
+ onDragStart: I,
1166
+ onDragEnd: se
1114
1167
  }) => {
1115
- const Z = Se(
1116
- () => ut(A, L, R, a),
1117
- [A, L, R, a]
1118
- ), Q = Se(
1119
- () => dt(Y, A, L, a),
1120
- [Y, A, L, a]
1121
- ), B = b(null), ee = (g) => {
1122
- if (!z) return;
1123
- const $ = g.currentTarget.getBoundingClientRect(), K = g.clientX - $.left, u = Math.max(0, Math.min(a, K));
1124
- if (!(Math.abs(u - Q) <= 10)) {
1125
- let S = u;
1126
- O && (S = ft(u, Z, 10));
1127
- const i = new Date(A).getTime(), C = new Date(L).getTime();
1128
- U(j.JulianDate.fromDate(new Date(i + S / a * (C - i))));
1168
+ const Z = Ne(
1169
+ () => Mt(F, X, S, d),
1170
+ [F, X, S, d]
1171
+ ), ie = Ne(
1172
+ () => yt(K, F, X, d),
1173
+ [K, F, X, d]
1174
+ ), te = x(null), ue = (v) => {
1175
+ if (!de) return;
1176
+ const Q = v.currentTarget.getBoundingClientRect(), M = v.clientX - Q.left, B = Math.max(0, Math.min(d, M));
1177
+ if (!(Math.abs(B - ie) <= 10)) {
1178
+ let j = B;
1179
+ $ && (j = Et(B, Z, 10));
1180
+ const s = new Date(F).getTime(), V = new Date(X).getTime();
1181
+ G(D.JulianDate.fromDate(new Date(s + j / d * (V - s))));
1129
1182
  return;
1130
1183
  }
1131
- ne == null || ne();
1132
- const P = g.clientX, y = new Date(Y).getTime(), w = new Date(A).getTime(), X = (new Date(L).getTime() - w) / a;
1133
- let te = 0, H = !1;
1134
- const D = (S) => {
1135
- te = S.clientX - P, H = !0, B.current || (B.current = requestAnimationFrame(() => {
1136
- if (H) {
1137
- const i = y + te * X;
1138
- U(j.JulianDate.fromDate(new Date(i))), H = !1;
1184
+ I == null || I();
1185
+ const ge = v.clientX, ce = new Date(K).getTime(), A = new Date(F).getTime(), g = (new Date(X).getTime() - A) / d;
1186
+ let L = 0, C = !1;
1187
+ const ee = (j) => {
1188
+ L = j.clientX - ge, C = !0, te.current || (te.current = requestAnimationFrame(() => {
1189
+ if (C) {
1190
+ const s = ce + L * g;
1191
+ G(D.JulianDate.fromDate(new Date(s))), C = !1;
1139
1192
  }
1140
- B.current = null;
1193
+ te.current = null;
1141
1194
  }));
1142
- }, k = () => {
1143
- document.removeEventListener("mousemove", D), document.removeEventListener("mouseup", k), B.current !== null && (cancelAnimationFrame(B.current), B.current = null), V == null || V();
1195
+ }, O = () => {
1196
+ document.removeEventListener("mousemove", ee), document.removeEventListener("mouseup", O), te.current !== null && (cancelAnimationFrame(te.current), te.current = null), se == null || se();
1144
1197
  };
1145
- document.addEventListener("mousemove", D), document.addEventListener("mouseup", k);
1146
- }, p = (g) => {
1147
- g.preventDefault();
1148
- const $ = g.shiftKey ? g.deltaY : g.deltaX !== 0 ? g.deltaX : g.deltaY;
1149
- if (Math.abs($) < 1) return;
1150
- const K = new Date(A).getTime(), u = new Date(L).getTime(), v = $ / a * (u - K) * 0.5;
1151
- W == null || W(
1152
- j.JulianDate.fromDate(new Date(K + v)),
1153
- j.JulianDate.fromDate(new Date(u + v))
1198
+ document.addEventListener("mousemove", ee), document.addEventListener("mouseup", O);
1199
+ }, w = (v) => {
1200
+ v.preventDefault();
1201
+ const Q = v.shiftKey ? v.deltaY : v.deltaX !== 0 ? v.deltaX : v.deltaY;
1202
+ if (Math.abs(Q) < 1) return;
1203
+ const M = new Date(F).getTime(), B = new Date(X).getTime(), oe = Q / d * (B - M) * 0.5;
1204
+ U == null || U(
1205
+ D.JulianDate.fromDate(new Date(M + oe)),
1206
+ D.JulianDate.fromDate(new Date(B + oe))
1154
1207
  );
1155
1208
  };
1156
- return /* @__PURE__ */ l.jsxs(
1209
+ return /* @__PURE__ */ u.jsxs(
1157
1210
  "svg",
1158
1211
  {
1159
1212
  width: "100%",
1160
- height: M,
1161
- style: { backgroundColor: _.backgroundColor, display: "block", cursor: "default" },
1162
- onMouseDown: ee,
1163
- onWheel: p,
1213
+ height: _,
1214
+ style: { backgroundColor: H.backgroundColor, display: "block", cursor: "default" },
1215
+ onMouseDown: ue,
1216
+ onWheel: w,
1164
1217
  children: [
1165
- /* @__PURE__ */ l.jsx("rect", { width: a, height: M, fill: _.backgroundColor }),
1166
- Z.map((g, $) => /* @__PURE__ */ l.jsxs("g", { children: [
1167
- /* @__PURE__ */ l.jsx(
1218
+ /* @__PURE__ */ u.jsx("rect", { width: d, height: _, fill: H.backgroundColor }),
1219
+ Z.map((v, Q) => /* @__PURE__ */ u.jsxs("g", { children: [
1220
+ /* @__PURE__ */ u.jsx(
1168
1221
  "line",
1169
1222
  {
1170
- x1: g.position,
1171
- y1: M - (g.isMajor ? _.majorTickHeight : _.minorTickHeight),
1172
- x2: g.position,
1173
- y2: M,
1174
- stroke: g.isMajor ? _.majorTickColor : _.tickColor,
1223
+ x1: v.position,
1224
+ y1: _ - (v.isMajor ? H.majorTickHeight : H.minorTickHeight),
1225
+ x2: v.position,
1226
+ y2: _,
1227
+ stroke: v.isMajor ? H.majorTickColor : H.tickColor,
1175
1228
  strokeWidth: "1"
1176
1229
  }
1177
1230
  ),
1178
- F && g.isMajor && g.label && /* @__PURE__ */ l.jsx(
1231
+ W && v.isMajor && v.label && /* @__PURE__ */ u.jsx(
1179
1232
  "text",
1180
1233
  {
1181
- x: g.position,
1182
- y: M - _.majorTickHeight - 5,
1234
+ x: v.position,
1235
+ y: _ - H.majorTickHeight - 5,
1183
1236
  textAnchor: "middle",
1184
- fill: _.labelColor,
1185
- fontSize: _.fontSize,
1237
+ fill: H.labelColor,
1238
+ fontSize: H.fontSize,
1186
1239
  fontFamily: "monospace",
1187
- children: g.label
1240
+ children: v.label
1188
1241
  }
1189
1242
  )
1190
- ] }, $)),
1191
- /* @__PURE__ */ l.jsx(
1243
+ ] }, Q)),
1244
+ /* @__PURE__ */ u.jsx(
1192
1245
  "line",
1193
1246
  {
1194
- x1: Q,
1247
+ x1: ie,
1195
1248
  y1: 0,
1196
- x2: Q,
1197
- y2: M,
1198
- stroke: _.indicatorColor,
1199
- strokeWidth: _.indicatorLineWidth,
1249
+ x2: ie,
1250
+ y2: _,
1251
+ stroke: H.indicatorColor,
1252
+ strokeWidth: H.indicatorLineWidth,
1200
1253
  pointerEvents: "none"
1201
1254
  }
1202
1255
  ),
1203
- z && /* @__PURE__ */ l.jsx(
1256
+ de && /* @__PURE__ */ u.jsx(
1204
1257
  "rect",
1205
1258
  {
1206
- x: Math.max(0, Q - 10),
1259
+ x: Math.max(0, ie - 10),
1207
1260
  y: 0,
1208
1261
  width: 20,
1209
- height: M,
1262
+ height: _,
1210
1263
  fill: "transparent",
1211
1264
  style: { cursor: "ew-resize" },
1212
1265
  pointerEvents: "visiblePainted"
1213
1266
  }
1214
1267
  ),
1215
- /* @__PURE__ */ l.jsx("circle", { cx: Q, cy: 5, r: 4, fill: _.indicatorColor, pointerEvents: "none" })
1268
+ /* @__PURE__ */ u.jsx("circle", { cx: ie, cy: 5, r: 4, fill: H.indicatorColor, pointerEvents: "none" })
1216
1269
  ]
1217
1270
  }
1218
1271
  );
1219
1272
  };
1220
1273
  export {
1221
- Dt as TICK_AREA_HEIGHT,
1222
- wt as Timeline,
1223
- He as TimelineCanvas,
1224
- vt as TimelineControls,
1225
- Et as TimelineSVG
1274
+ Ot as TICK_AREA_HEIGHT,
1275
+ kt as Timeline,
1276
+ et as TimelineCanvas,
1277
+ jt as TimelineControls,
1278
+ Ft as TimelineSVG
1226
1279
  };