react-timelane 0.0.0 → 0.0.1

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.
Files changed (110) hide show
  1. package/dist/components/TimelineAside.d.ts +13 -0
  2. package/dist/components/TimelineBackground.d.ts +5 -0
  3. package/dist/components/TimelineBody.d.ts +13 -0
  4. package/dist/components/TimelineHeader/DaysHeader.d.ts +15 -0
  5. package/dist/components/TimelineHeader/MonthsHeader.d.ts +15 -0
  6. package/dist/components/TimelineHeader/TimelineHeader.d.ts +24 -0
  7. package/dist/components/TimelineHeader/WeeksHeader.d.ts +15 -0
  8. package/dist/components/TimelineHeader/index.d.ts +5 -0
  9. package/dist/components/TimelineHeader/renderingUtils.d.ts +4 -0
  10. package/dist/components/TimelineSelectionLayer.d.ts +6 -0
  11. package/dist/components/TimelineSettingsContext.d.ts +7 -0
  12. package/dist/components/TimelineSettingsProvider.d.ts +7 -0
  13. package/dist/components/TimelineWrapper.d.ts +17 -0
  14. package/dist/components/core/CoreItem/CoreItemComponent.d.ts +14 -0
  15. package/dist/components/core/CoreItem/DragResizeComponent.d.ts +20 -0
  16. package/dist/components/core/CoreSwimlane/AvailableSpaceIndicator.d.ts +21 -0
  17. package/dist/components/core/CoreSwimlane/CoreSwimlane.d.ts +16 -0
  18. package/dist/components/core/CoreSwimlane/DropPreview.d.ts +9 -0
  19. package/dist/components/core/CoreSwimlane/DropTarget.d.ts +11 -0
  20. package/dist/components/core/CoreSwimlane/OverlapIndicator.d.ts +6 -0
  21. package/dist/components/core/CoreSwimlane/utils.d.ts +13 -0
  22. package/dist/components/core/utils.d.ts +15 -0
  23. package/dist/components/layout/TimelineLayout.d.ts +23 -0
  24. package/dist/hooks/useScroll.d.ts +10 -0
  25. package/dist/hooks/useTimelineContext.d.ts +1 -0
  26. package/dist/index.d.ts +13 -0
  27. package/dist/react-timelane.css +1 -0
  28. package/dist/react-timelane.js +4744 -0
  29. package/dist/types/AvailableSpace.d.ts +6 -0
  30. package/dist/types/CoreItem.d.ts +12 -0
  31. package/dist/types/DateBounds.d.ts +4 -0
  32. package/dist/types/Dimensions.d.ts +4 -0
  33. package/dist/types/GrabInfo.d.ts +5 -0
  34. package/dist/types/Grid.d.ts +6 -0
  35. package/dist/types/OffsetBounds.d.ts +4 -0
  36. package/dist/types/Pixels.d.ts +4 -0
  37. package/{src/types/Position.ts → dist/types/Position.d.ts} +2 -2
  38. package/dist/types/Rectangle.d.ts +6 -0
  39. package/dist/types/SwimlaneT.d.ts +5 -0
  40. package/dist/types/TimeRange.d.ts +4 -0
  41. package/dist/types/TimelineSettings.d.ts +11 -0
  42. package/dist/types/index.d.ts +15 -0
  43. package/package.json +1 -1
  44. package/vite.config.ts +1 -1
  45. package/.github/workflows/static.yml +0 -55
  46. package/docs/README.md +0 -54
  47. package/docs/eslint.config.js +0 -28
  48. package/docs/index.html +0 -12
  49. package/docs/package-lock.json +0 -5101
  50. package/docs/package.json +0 -35
  51. package/docs/src/App.css +0 -5
  52. package/docs/src/App.tsx +0 -59
  53. package/docs/src/assets/react.svg +0 -1
  54. package/docs/src/components/AllocationComponent.tsx +0 -82
  55. package/docs/src/components/Timeline.tsx +0 -183
  56. package/docs/src/constants.ts +0 -42
  57. package/docs/src/hooks/useLocalStorage.ts +0 -21
  58. package/docs/src/main.tsx +0 -9
  59. package/docs/src/models/Allocation.ts +0 -11
  60. package/docs/src/models/AllocationId.ts +0 -1
  61. package/docs/src/models/Resource.ts +0 -8
  62. package/docs/src/models/ResourceId.ts +0 -1
  63. package/docs/src/vite-env.d.ts +0 -1
  64. package/docs/tsconfig.json +0 -27
  65. package/docs/vite.config.ts +0 -8
  66. package/src/components/Timeline.scss +0 -297
  67. package/src/components/TimelineAside.tsx +0 -81
  68. package/src/components/TimelineBackground.tsx +0 -53
  69. package/src/components/TimelineBody.tsx +0 -54
  70. package/src/components/TimelineHeader/DaysHeader.tsx +0 -44
  71. package/src/components/TimelineHeader/MonthsHeader.tsx +0 -62
  72. package/src/components/TimelineHeader/TimelineHeader.tsx +0 -64
  73. package/src/components/TimelineHeader/WeeksHeader.tsx +0 -63
  74. package/src/components/TimelineHeader/index.ts +0 -9
  75. package/src/components/TimelineHeader/renderingUtils.tsx +0 -57
  76. package/src/components/TimelineSelectionLayer.tsx +0 -179
  77. package/src/components/TimelineSettingsContext.tsx +0 -27
  78. package/src/components/TimelineSettingsProvider.tsx +0 -24
  79. package/src/components/TimelineWrapper.tsx +0 -51
  80. package/src/components/core/CoreItem/CoreItemComponent.tsx +0 -69
  81. package/src/components/core/CoreItem/DragResizeComponent.tsx +0 -180
  82. package/src/components/core/CoreSwimlane/AvailableSpaceIndicator.tsx +0 -156
  83. package/src/components/core/CoreSwimlane/CoreSwimlane.tsx +0 -245
  84. package/src/components/core/CoreSwimlane/DropPreview.tsx +0 -30
  85. package/src/components/core/CoreSwimlane/DropTarget.tsx +0 -83
  86. package/src/components/core/CoreSwimlane/OverlapIndicator.tsx +0 -22
  87. package/src/components/core/CoreSwimlane/utils.ts +0 -375
  88. package/src/components/core/utils.ts +0 -154
  89. package/src/components/layout/TimelineLayout.tsx +0 -93
  90. package/src/components/layout/layout.scss +0 -107
  91. package/src/global.d.ts +0 -9
  92. package/src/hooks/useScroll.tsx +0 -71
  93. package/src/hooks/useTimelineContext.tsx +0 -6
  94. package/src/index.ts +0 -15
  95. package/src/types/AvailableSpace.ts +0 -6
  96. package/src/types/CoreItem.ts +0 -23
  97. package/src/types/DateBounds.ts +0 -4
  98. package/src/types/Dimensions.ts +0 -4
  99. package/src/types/GrabInfo.ts +0 -6
  100. package/src/types/Grid.ts +0 -6
  101. package/src/types/OffsetBounds.ts +0 -4
  102. package/src/types/Pixels.ts +0 -4
  103. package/src/types/Rectangle.ts +0 -6
  104. package/src/types/SwimlaneT.ts +0 -6
  105. package/src/types/TimeRange.ts +0 -4
  106. package/src/types/TimelineSettings.ts +0 -11
  107. package/src/types/index.ts +0 -15
  108. package/tsconfig.json +0 -32
  109. /package/{src/types/ItemId.ts → dist/types/ItemId.d.ts} +0 -0
  110. /package/{src/types/SwimlaneId.ts → dist/types/SwimlaneId.d.ts} +0 -0
@@ -0,0 +1,4744 @@
1
+ import { jsx as v, jsxs as K, Fragment as Se } from "react/jsx-runtime";
2
+ import Rt, { useRef as ce, createContext as Vt, useContext as Qt, useState as G, useEffect as ee, memo as Jt, useCallback as Ke, useMemo as Zt, PureComponent as er } from "react";
3
+ function re({ children: e }) {
4
+ const t = ce(null);
5
+ return /* @__PURE__ */ v(
6
+ "div",
7
+ {
8
+ className: "timeline-layout",
9
+ onWheel: (r) => {
10
+ t.current && (r.ctrlKey || r.shiftKey) && (t.current.scrollLeft += r.deltaY, r.preventDefault());
11
+ },
12
+ ref: t,
13
+ children: /* @__PURE__ */ v("div", { className: "timeline-layout-inner", children: e })
14
+ }
15
+ );
16
+ }
17
+ function tr({ children: e }) {
18
+ return /* @__PURE__ */ v("div", { className: "timeline-layout-header", children: e });
19
+ }
20
+ function rr({ children: e }) {
21
+ return /* @__PURE__ */ v("div", { className: "timeline-layout-background", children: e });
22
+ }
23
+ function nr({ children: e }) {
24
+ return /* @__PURE__ */ v("div", { className: "timeline-layout-body", children: e });
25
+ }
26
+ function ir({ children: e }) {
27
+ return /* @__PURE__ */ v("div", { className: "timeline-layout-footer", children: e });
28
+ }
29
+ function ar({
30
+ side: e = "left",
31
+ children: t
32
+ }) {
33
+ return /* @__PURE__ */ v(
34
+ "div",
35
+ {
36
+ className: `timeline-layout-aside ${e == "left" ? "timeline-layout-aside-left" : "timeline-layout-aside-right"}`,
37
+ children: t
38
+ }
39
+ );
40
+ }
41
+ function or({
42
+ corner: e = "top left",
43
+ children: t
44
+ }) {
45
+ let r = "";
46
+ switch (e) {
47
+ case "top left":
48
+ r = "timeline-layout-corner-top-left";
49
+ break;
50
+ case "top right":
51
+ r = "timeline-layout-corner-top-right";
52
+ break;
53
+ case "bottom left":
54
+ r = "timeline-layout-corner-bottom-left";
55
+ break;
56
+ case "bottom right":
57
+ r = "timeline-layout-corner-bottom-right";
58
+ break;
59
+ }
60
+ return /* @__PURE__ */ v("div", { className: `timeline-layout-corner ${r}`, children: t });
61
+ }
62
+ re.Header = tr;
63
+ re.Body = nr;
64
+ re.Background = rr;
65
+ re.Footer = ir;
66
+ re.Aside = ar;
67
+ re.Corner = or;
68
+ const sr = {
69
+ start: new Date(2025, 1, 1),
70
+ end: new Date(2025, 5, 1),
71
+ pixelsPerDay: 30,
72
+ pixelsPerResource: 100,
73
+ showMonths: !0,
74
+ showWeeks: !0,
75
+ showDays: !0,
76
+ allowOverlaps: !0,
77
+ focusedDate: null
78
+ }, ur = {
79
+ settings: sr,
80
+ setSettings: () => {
81
+ }
82
+ }, kt = Vt(ur), ge = () => Qt(kt);
83
+ function fa({
84
+ swimlanes: e,
85
+ focusedSwimlane: t,
86
+ setFocusedSwimlane: r = () => {
87
+ },
88
+ onSwimlaneHeaderClick: n = () => {
89
+ },
90
+ onSwimlaneHeaderDoubleClick: i = () => {
91
+ },
92
+ onSwimlaneHeaderContextMenu: a = () => {
93
+ },
94
+ renderSwimlaneHeader: u = lr
95
+ }) {
96
+ const { settings: c } = ge();
97
+ return /* @__PURE__ */ v("div", { className: "timeline-aside", children: e && e.map((s) => /* @__PURE__ */ v(
98
+ cr,
99
+ {
100
+ height: c.pixelsPerResource,
101
+ isFocused: t ? t.id === s.id : !1,
102
+ onClick: (o) => {
103
+ r(s), n(s, o);
104
+ },
105
+ onDoubleClick: (o) => i(s, o),
106
+ onContextMenu: (o) => a(s, o),
107
+ children: u(s)
108
+ },
109
+ s.id
110
+ )) });
111
+ }
112
+ function cr({
113
+ height: e,
114
+ isFocused: t,
115
+ onClick: r,
116
+ onDoubleClick: n,
117
+ onContextMenu: i,
118
+ children: a
119
+ }) {
120
+ return /* @__PURE__ */ v(
121
+ "div",
122
+ {
123
+ className: `timeline-aside-swimlane-header ${t ? "timeline-aside-swimlane-header-focused" : ""}`,
124
+ style: { height: `${e}px` },
125
+ onClick: r,
126
+ onDoubleClick: n,
127
+ onContextMenu: i,
128
+ children: a
129
+ }
130
+ );
131
+ }
132
+ function lr(e) {
133
+ return /* @__PURE__ */ v("div", { children: e.id });
134
+ }
135
+ const Nt = 6048e5, dr = 864e5, Ve = Symbol.for("constructDateFrom");
136
+ function W(e, t) {
137
+ return typeof e == "function" ? e(t) : e && typeof e == "object" && Ve in e ? e[Ve](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
138
+ }
139
+ function N(e, t) {
140
+ return W(t || e, e);
141
+ }
142
+ function le(e, t, r) {
143
+ const n = N(e, r == null ? void 0 : r.in);
144
+ return isNaN(t) ? W(e, NaN) : (t && n.setDate(n.getDate() + t), n);
145
+ }
146
+ function At(e, t) {
147
+ return N(e, t == null ? void 0 : t.in).getDay() === 0;
148
+ }
149
+ let fr = {};
150
+ function Te() {
151
+ return fr;
152
+ }
153
+ function j(e, t) {
154
+ var c, s, o, f;
155
+ const r = Te(), n = (t == null ? void 0 : t.weekStartsOn) ?? ((s = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : s.weekStartsOn) ?? r.weekStartsOn ?? ((f = (o = r.locale) == null ? void 0 : o.options) == null ? void 0 : f.weekStartsOn) ?? 0, i = N(e, t == null ? void 0 : t.in), a = i.getDay(), u = (a < n ? 7 : 0) + a - n;
156
+ return i.setDate(i.getDate() - u), i.setHours(0, 0, 0, 0), i;
157
+ }
158
+ function Oe(e, t) {
159
+ return j(e, { ...t, weekStartsOn: 1 });
160
+ }
161
+ function zt(e, t) {
162
+ const r = N(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = W(r, 0);
163
+ i.setFullYear(n + 1, 0, 4), i.setHours(0, 0, 0, 0);
164
+ const a = Oe(i), u = W(r, 0);
165
+ u.setFullYear(n, 0, 4), u.setHours(0, 0, 0, 0);
166
+ const c = Oe(u);
167
+ return r.getTime() >= a.getTime() ? n + 1 : r.getTime() >= c.getTime() ? n : n - 1;
168
+ }
169
+ function Qe(e) {
170
+ const t = N(e), r = new Date(
171
+ Date.UTC(
172
+ t.getFullYear(),
173
+ t.getMonth(),
174
+ t.getDate(),
175
+ t.getHours(),
176
+ t.getMinutes(),
177
+ t.getSeconds(),
178
+ t.getMilliseconds()
179
+ )
180
+ );
181
+ return r.setUTCFullYear(t.getFullYear()), +e - +r;
182
+ }
183
+ function Ie(e, ...t) {
184
+ const r = W.bind(
185
+ null,
186
+ e || t.find((n) => typeof n == "object")
187
+ );
188
+ return t.map(r);
189
+ }
190
+ function De(e, t) {
191
+ const r = N(e, t == null ? void 0 : t.in);
192
+ return r.setHours(0, 0, 0, 0), r;
193
+ }
194
+ function B(e, t, r) {
195
+ const [n, i] = Ie(
196
+ r == null ? void 0 : r.in,
197
+ e,
198
+ t
199
+ ), a = De(n), u = De(i), c = +a - Qe(a), s = +u - Qe(u);
200
+ return Math.round((c - s) / dr);
201
+ }
202
+ function hr(e, t) {
203
+ const r = zt(e, t), n = W(e, 0);
204
+ return n.setFullYear(r, 0, 4), n.setHours(0, 0, 0, 0), Oe(n);
205
+ }
206
+ function gr(e, t, r) {
207
+ return le(e, t * 7, r);
208
+ }
209
+ function pr(e, t) {
210
+ let r, n = t == null ? void 0 : t.in;
211
+ return e.forEach((i) => {
212
+ !n && typeof i == "object" && (n = W.bind(null, i));
213
+ const a = N(i, n);
214
+ (!r || r < a || isNaN(+a)) && (r = a);
215
+ }), W(n, r || NaN);
216
+ }
217
+ function mr(e, t) {
218
+ let r, n = t == null ? void 0 : t.in;
219
+ return e.forEach((i) => {
220
+ !n && typeof i == "object" && (n = W.bind(null, i));
221
+ const a = N(i, n);
222
+ (!r || r > a || isNaN(+a)) && (r = a);
223
+ }), W(n, r || NaN);
224
+ }
225
+ function yr(e, t, r) {
226
+ const [n, i] = Ie(
227
+ r == null ? void 0 : r.in,
228
+ e,
229
+ t
230
+ );
231
+ return +De(n) == +De(i);
232
+ }
233
+ function vr(e) {
234
+ return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
235
+ }
236
+ function br(e) {
237
+ return !(!vr(e) && typeof e != "number" || isNaN(+N(e)));
238
+ }
239
+ function je(e, t) {
240
+ const [r, n] = Ie(e, t.start, t.end);
241
+ return { start: r, end: n };
242
+ }
243
+ function Ct(e, t) {
244
+ const { start: r, end: n } = je(t == null ? void 0 : t.in, e);
245
+ let i = +r > +n;
246
+ const a = i ? +r : +n, u = i ? n : r;
247
+ u.setHours(0, 0, 0, 0);
248
+ let c = 1;
249
+ const s = [];
250
+ for (; +u <= a; )
251
+ s.push(W(r, u)), u.setDate(u.getDate() + c), u.setHours(0, 0, 0, 0);
252
+ return i ? s.reverse() : s;
253
+ }
254
+ function wr(e, t) {
255
+ const { start: r, end: n } = je(t == null ? void 0 : t.in, e);
256
+ let i = +r > +n;
257
+ const a = i ? +r : +n, u = i ? n : r;
258
+ u.setHours(0, 0, 0, 0), u.setDate(1);
259
+ let c = 1;
260
+ const s = [];
261
+ for (; +u <= a; )
262
+ s.push(W(r, u)), u.setMonth(u.getMonth() + c);
263
+ return i ? s.reverse() : s;
264
+ }
265
+ function xr(e, t) {
266
+ const { start: r, end: n } = je(t == null ? void 0 : t.in, e);
267
+ let i = +r > +n;
268
+ const a = j(i ? n : r, t), u = j(i ? r : n, t);
269
+ a.setHours(15), u.setHours(15);
270
+ const c = +u.getTime();
271
+ let s = a, o = (t == null ? void 0 : t.step) ?? 1;
272
+ if (!o) return [];
273
+ o < 0 && (o = -o, i = !i);
274
+ const f = [];
275
+ for (; +s <= c; )
276
+ s.setHours(0), f.push(W(r, s)), s = gr(s, o), s.setHours(15);
277
+ return i ? f.reverse() : f;
278
+ }
279
+ function Sr(e, t) {
280
+ const r = N(e, t == null ? void 0 : t.in);
281
+ return r.setFullYear(r.getFullYear(), 0, 1), r.setHours(0, 0, 0, 0), r;
282
+ }
283
+ const Or = {
284
+ lessThanXSeconds: {
285
+ one: "less than a second",
286
+ other: "less than {{count}} seconds"
287
+ },
288
+ xSeconds: {
289
+ one: "1 second",
290
+ other: "{{count}} seconds"
291
+ },
292
+ halfAMinute: "half a minute",
293
+ lessThanXMinutes: {
294
+ one: "less than a minute",
295
+ other: "less than {{count}} minutes"
296
+ },
297
+ xMinutes: {
298
+ one: "1 minute",
299
+ other: "{{count}} minutes"
300
+ },
301
+ aboutXHours: {
302
+ one: "about 1 hour",
303
+ other: "about {{count}} hours"
304
+ },
305
+ xHours: {
306
+ one: "1 hour",
307
+ other: "{{count}} hours"
308
+ },
309
+ xDays: {
310
+ one: "1 day",
311
+ other: "{{count}} days"
312
+ },
313
+ aboutXWeeks: {
314
+ one: "about 1 week",
315
+ other: "about {{count}} weeks"
316
+ },
317
+ xWeeks: {
318
+ one: "1 week",
319
+ other: "{{count}} weeks"
320
+ },
321
+ aboutXMonths: {
322
+ one: "about 1 month",
323
+ other: "about {{count}} months"
324
+ },
325
+ xMonths: {
326
+ one: "1 month",
327
+ other: "{{count}} months"
328
+ },
329
+ aboutXYears: {
330
+ one: "about 1 year",
331
+ other: "about {{count}} years"
332
+ },
333
+ xYears: {
334
+ one: "1 year",
335
+ other: "{{count}} years"
336
+ },
337
+ overXYears: {
338
+ one: "over 1 year",
339
+ other: "over {{count}} years"
340
+ },
341
+ almostXYears: {
342
+ one: "almost 1 year",
343
+ other: "almost {{count}} years"
344
+ }
345
+ }, Dr = (e, t, r) => {
346
+ let n;
347
+ const i = Or[e];
348
+ return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
349
+ };
350
+ function Me(e) {
351
+ return (t = {}) => {
352
+ const r = t.width ? String(t.width) : e.defaultWidth;
353
+ return e.formats[r] || e.formats[e.defaultWidth];
354
+ };
355
+ }
356
+ const Tr = {
357
+ full: "EEEE, MMMM do, y",
358
+ long: "MMMM do, y",
359
+ medium: "MMM d, y",
360
+ short: "MM/dd/yyyy"
361
+ }, Mr = {
362
+ full: "h:mm:ss a zzzz",
363
+ long: "h:mm:ss a z",
364
+ medium: "h:mm:ss a",
365
+ short: "h:mm a"
366
+ }, Er = {
367
+ full: "{{date}} 'at' {{time}}",
368
+ long: "{{date}} 'at' {{time}}",
369
+ medium: "{{date}}, {{time}}",
370
+ short: "{{date}}, {{time}}"
371
+ }, Pr = {
372
+ date: Me({
373
+ formats: Tr,
374
+ defaultWidth: "full"
375
+ }),
376
+ time: Me({
377
+ formats: Mr,
378
+ defaultWidth: "full"
379
+ }),
380
+ dateTime: Me({
381
+ formats: Er,
382
+ defaultWidth: "full"
383
+ })
384
+ }, Rr = {
385
+ lastWeek: "'last' eeee 'at' p",
386
+ yesterday: "'yesterday at' p",
387
+ today: "'today at' p",
388
+ tomorrow: "'tomorrow at' p",
389
+ nextWeek: "eeee 'at' p",
390
+ other: "P"
391
+ }, kr = (e, t, r, n) => Rr[e];
392
+ function ie(e) {
393
+ return (t, r) => {
394
+ const n = r != null && r.context ? String(r.context) : "standalone";
395
+ let i;
396
+ if (n === "formatting" && e.formattingValues) {
397
+ const u = e.defaultFormattingWidth || e.defaultWidth, c = r != null && r.width ? String(r.width) : u;
398
+ i = e.formattingValues[c] || e.formattingValues[u];
399
+ } else {
400
+ const u = e.defaultWidth, c = r != null && r.width ? String(r.width) : e.defaultWidth;
401
+ i = e.values[c] || e.values[u];
402
+ }
403
+ const a = e.argumentCallback ? e.argumentCallback(t) : t;
404
+ return i[a];
405
+ };
406
+ }
407
+ const Nr = {
408
+ narrow: ["B", "A"],
409
+ abbreviated: ["BC", "AD"],
410
+ wide: ["Before Christ", "Anno Domini"]
411
+ }, Ar = {
412
+ narrow: ["1", "2", "3", "4"],
413
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
414
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
415
+ }, zr = {
416
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
417
+ abbreviated: [
418
+ "Jan",
419
+ "Feb",
420
+ "Mar",
421
+ "Apr",
422
+ "May",
423
+ "Jun",
424
+ "Jul",
425
+ "Aug",
426
+ "Sep",
427
+ "Oct",
428
+ "Nov",
429
+ "Dec"
430
+ ],
431
+ wide: [
432
+ "January",
433
+ "February",
434
+ "March",
435
+ "April",
436
+ "May",
437
+ "June",
438
+ "July",
439
+ "August",
440
+ "September",
441
+ "October",
442
+ "November",
443
+ "December"
444
+ ]
445
+ }, Cr = {
446
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
447
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
448
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
449
+ wide: [
450
+ "Sunday",
451
+ "Monday",
452
+ "Tuesday",
453
+ "Wednesday",
454
+ "Thursday",
455
+ "Friday",
456
+ "Saturday"
457
+ ]
458
+ }, _r = {
459
+ narrow: {
460
+ am: "a",
461
+ pm: "p",
462
+ midnight: "mi",
463
+ noon: "n",
464
+ morning: "morning",
465
+ afternoon: "afternoon",
466
+ evening: "evening",
467
+ night: "night"
468
+ },
469
+ abbreviated: {
470
+ am: "AM",
471
+ pm: "PM",
472
+ midnight: "midnight",
473
+ noon: "noon",
474
+ morning: "morning",
475
+ afternoon: "afternoon",
476
+ evening: "evening",
477
+ night: "night"
478
+ },
479
+ wide: {
480
+ am: "a.m.",
481
+ pm: "p.m.",
482
+ midnight: "midnight",
483
+ noon: "noon",
484
+ morning: "morning",
485
+ afternoon: "afternoon",
486
+ evening: "evening",
487
+ night: "night"
488
+ }
489
+ }, Wr = {
490
+ narrow: {
491
+ am: "a",
492
+ pm: "p",
493
+ midnight: "mi",
494
+ noon: "n",
495
+ morning: "in the morning",
496
+ afternoon: "in the afternoon",
497
+ evening: "in the evening",
498
+ night: "at night"
499
+ },
500
+ abbreviated: {
501
+ am: "AM",
502
+ pm: "PM",
503
+ midnight: "midnight",
504
+ noon: "noon",
505
+ morning: "in the morning",
506
+ afternoon: "in the afternoon",
507
+ evening: "in the evening",
508
+ night: "at night"
509
+ },
510
+ wide: {
511
+ am: "a.m.",
512
+ pm: "p.m.",
513
+ midnight: "midnight",
514
+ noon: "noon",
515
+ morning: "in the morning",
516
+ afternoon: "in the afternoon",
517
+ evening: "in the evening",
518
+ night: "at night"
519
+ }
520
+ }, Lr = (e, t) => {
521
+ const r = Number(e), n = r % 100;
522
+ if (n > 20 || n < 10)
523
+ switch (n % 10) {
524
+ case 1:
525
+ return r + "st";
526
+ case 2:
527
+ return r + "nd";
528
+ case 3:
529
+ return r + "rd";
530
+ }
531
+ return r + "th";
532
+ }, Hr = {
533
+ ordinalNumber: Lr,
534
+ era: ie({
535
+ values: Nr,
536
+ defaultWidth: "wide"
537
+ }),
538
+ quarter: ie({
539
+ values: Ar,
540
+ defaultWidth: "wide",
541
+ argumentCallback: (e) => e - 1
542
+ }),
543
+ month: ie({
544
+ values: zr,
545
+ defaultWidth: "wide"
546
+ }),
547
+ day: ie({
548
+ values: Cr,
549
+ defaultWidth: "wide"
550
+ }),
551
+ dayPeriod: ie({
552
+ values: _r,
553
+ defaultWidth: "wide",
554
+ formattingValues: Wr,
555
+ defaultFormattingWidth: "wide"
556
+ })
557
+ };
558
+ function ae(e) {
559
+ return (t, r = {}) => {
560
+ const n = r.width, i = n && e.matchPatterns[n] || e.matchPatterns[e.defaultMatchWidth], a = t.match(i);
561
+ if (!a)
562
+ return null;
563
+ const u = a[0], c = n && e.parsePatterns[n] || e.parsePatterns[e.defaultParseWidth], s = Array.isArray(c) ? jr(c, (l) => l.test(u)) : (
564
+ // [TODO] -- I challenge you to fix the type
565
+ Ir(c, (l) => l.test(u))
566
+ );
567
+ let o;
568
+ o = e.valueCallback ? e.valueCallback(s) : s, o = r.valueCallback ? (
569
+ // [TODO] -- I challenge you to fix the type
570
+ r.valueCallback(o)
571
+ ) : o;
572
+ const f = t.slice(u.length);
573
+ return { value: o, rest: f };
574
+ };
575
+ }
576
+ function Ir(e, t) {
577
+ for (const r in e)
578
+ if (Object.prototype.hasOwnProperty.call(e, r) && t(e[r]))
579
+ return r;
580
+ }
581
+ function jr(e, t) {
582
+ for (let r = 0; r < e.length; r++)
583
+ if (t(e[r]))
584
+ return r;
585
+ }
586
+ function Yr(e) {
587
+ return (t, r = {}) => {
588
+ const n = t.match(e.matchPattern);
589
+ if (!n) return null;
590
+ const i = n[0], a = t.match(e.parsePattern);
591
+ if (!a) return null;
592
+ let u = e.valueCallback ? e.valueCallback(a[0]) : a[0];
593
+ u = r.valueCallback ? r.valueCallback(u) : u;
594
+ const c = t.slice(i.length);
595
+ return { value: u, rest: c };
596
+ };
597
+ }
598
+ const Fr = /^(\d+)(th|st|nd|rd)?/i, Br = /\d+/i, $r = {
599
+ narrow: /^(b|a)/i,
600
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
601
+ wide: /^(before christ|before common era|anno domini|common era)/i
602
+ }, qr = {
603
+ any: [/^b/i, /^(a|c)/i]
604
+ }, Xr = {
605
+ narrow: /^[1234]/i,
606
+ abbreviated: /^q[1234]/i,
607
+ wide: /^[1234](th|st|nd|rd)? quarter/i
608
+ }, Ur = {
609
+ any: [/1/i, /2/i, /3/i, /4/i]
610
+ }, Gr = {
611
+ narrow: /^[jfmasond]/i,
612
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
613
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
614
+ }, Kr = {
615
+ narrow: [
616
+ /^j/i,
617
+ /^f/i,
618
+ /^m/i,
619
+ /^a/i,
620
+ /^m/i,
621
+ /^j/i,
622
+ /^j/i,
623
+ /^a/i,
624
+ /^s/i,
625
+ /^o/i,
626
+ /^n/i,
627
+ /^d/i
628
+ ],
629
+ any: [
630
+ /^ja/i,
631
+ /^f/i,
632
+ /^mar/i,
633
+ /^ap/i,
634
+ /^may/i,
635
+ /^jun/i,
636
+ /^jul/i,
637
+ /^au/i,
638
+ /^s/i,
639
+ /^o/i,
640
+ /^n/i,
641
+ /^d/i
642
+ ]
643
+ }, Vr = {
644
+ narrow: /^[smtwf]/i,
645
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
646
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
647
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
648
+ }, Qr = {
649
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
650
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
651
+ }, Jr = {
652
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
653
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
654
+ }, Zr = {
655
+ any: {
656
+ am: /^a/i,
657
+ pm: /^p/i,
658
+ midnight: /^mi/i,
659
+ noon: /^no/i,
660
+ morning: /morning/i,
661
+ afternoon: /afternoon/i,
662
+ evening: /evening/i,
663
+ night: /night/i
664
+ }
665
+ }, en = {
666
+ ordinalNumber: Yr({
667
+ matchPattern: Fr,
668
+ parsePattern: Br,
669
+ valueCallback: (e) => parseInt(e, 10)
670
+ }),
671
+ era: ae({
672
+ matchPatterns: $r,
673
+ defaultMatchWidth: "wide",
674
+ parsePatterns: qr,
675
+ defaultParseWidth: "any"
676
+ }),
677
+ quarter: ae({
678
+ matchPatterns: Xr,
679
+ defaultMatchWidth: "wide",
680
+ parsePatterns: Ur,
681
+ defaultParseWidth: "any",
682
+ valueCallback: (e) => e + 1
683
+ }),
684
+ month: ae({
685
+ matchPatterns: Gr,
686
+ defaultMatchWidth: "wide",
687
+ parsePatterns: Kr,
688
+ defaultParseWidth: "any"
689
+ }),
690
+ day: ae({
691
+ matchPatterns: Vr,
692
+ defaultMatchWidth: "wide",
693
+ parsePatterns: Qr,
694
+ defaultParseWidth: "any"
695
+ }),
696
+ dayPeriod: ae({
697
+ matchPatterns: Jr,
698
+ defaultMatchWidth: "any",
699
+ parsePatterns: Zr,
700
+ defaultParseWidth: "any"
701
+ })
702
+ }, tn = {
703
+ code: "en-US",
704
+ formatDistance: Dr,
705
+ formatLong: Pr,
706
+ formatRelative: kr,
707
+ localize: Hr,
708
+ match: en,
709
+ options: {
710
+ weekStartsOn: 0,
711
+ firstWeekContainsDate: 1
712
+ }
713
+ };
714
+ function rn(e, t) {
715
+ const r = N(e, t == null ? void 0 : t.in);
716
+ return B(r, Sr(r)) + 1;
717
+ }
718
+ function nn(e, t) {
719
+ const r = N(e, t == null ? void 0 : t.in), n = +Oe(r) - +hr(r);
720
+ return Math.round(n / Nt) + 1;
721
+ }
722
+ function _t(e, t) {
723
+ var f, l, d, h;
724
+ const r = N(e, t == null ? void 0 : t.in), n = r.getFullYear(), i = Te(), a = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((l = (f = t == null ? void 0 : t.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? i.firstWeekContainsDate ?? ((h = (d = i.locale) == null ? void 0 : d.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, u = W((t == null ? void 0 : t.in) || e, 0);
725
+ u.setFullYear(n + 1, 0, a), u.setHours(0, 0, 0, 0);
726
+ const c = j(u, t), s = W((t == null ? void 0 : t.in) || e, 0);
727
+ s.setFullYear(n, 0, a), s.setHours(0, 0, 0, 0);
728
+ const o = j(s, t);
729
+ return +r >= +c ? n + 1 : +r >= +o ? n : n - 1;
730
+ }
731
+ function an(e, t) {
732
+ var c, s, o, f;
733
+ const r = Te(), n = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((s = (c = t == null ? void 0 : t.locale) == null ? void 0 : c.options) == null ? void 0 : s.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((f = (o = r.locale) == null ? void 0 : o.options) == null ? void 0 : f.firstWeekContainsDate) ?? 1, i = _t(e, t), a = W((t == null ? void 0 : t.in) || e, 0);
734
+ return a.setFullYear(i, 0, n), a.setHours(0, 0, 0, 0), j(a, t);
735
+ }
736
+ function on(e, t) {
737
+ const r = N(e, t == null ? void 0 : t.in), n = +j(r, t) - +an(r, t);
738
+ return Math.round(n / Nt) + 1;
739
+ }
740
+ function T(e, t) {
741
+ const r = e < 0 ? "-" : "", n = Math.abs(e).toString().padStart(t, "0");
742
+ return r + n;
743
+ }
744
+ const Y = {
745
+ // Year
746
+ y(e, t) {
747
+ const r = e.getFullYear(), n = r > 0 ? r : 1 - r;
748
+ return T(t === "yy" ? n % 100 : n, t.length);
749
+ },
750
+ // Month
751
+ M(e, t) {
752
+ const r = e.getMonth();
753
+ return t === "M" ? String(r + 1) : T(r + 1, 2);
754
+ },
755
+ // Day of the month
756
+ d(e, t) {
757
+ return T(e.getDate(), t.length);
758
+ },
759
+ // AM or PM
760
+ a(e, t) {
761
+ const r = e.getHours() / 12 >= 1 ? "pm" : "am";
762
+ switch (t) {
763
+ case "a":
764
+ case "aa":
765
+ return r.toUpperCase();
766
+ case "aaa":
767
+ return r;
768
+ case "aaaaa":
769
+ return r[0];
770
+ case "aaaa":
771
+ default:
772
+ return r === "am" ? "a.m." : "p.m.";
773
+ }
774
+ },
775
+ // Hour [1-12]
776
+ h(e, t) {
777
+ return T(e.getHours() % 12 || 12, t.length);
778
+ },
779
+ // Hour [0-23]
780
+ H(e, t) {
781
+ return T(e.getHours(), t.length);
782
+ },
783
+ // Minute
784
+ m(e, t) {
785
+ return T(e.getMinutes(), t.length);
786
+ },
787
+ // Second
788
+ s(e, t) {
789
+ return T(e.getSeconds(), t.length);
790
+ },
791
+ // Fraction of second
792
+ S(e, t) {
793
+ const r = t.length, n = e.getMilliseconds(), i = Math.trunc(
794
+ n * Math.pow(10, r - 3)
795
+ );
796
+ return T(i, t.length);
797
+ }
798
+ }, Q = {
799
+ midnight: "midnight",
800
+ noon: "noon",
801
+ morning: "morning",
802
+ afternoon: "afternoon",
803
+ evening: "evening",
804
+ night: "night"
805
+ }, Je = {
806
+ // Era
807
+ G: function(e, t, r) {
808
+ const n = e.getFullYear() > 0 ? 1 : 0;
809
+ switch (t) {
810
+ // AD, BC
811
+ case "G":
812
+ case "GG":
813
+ case "GGG":
814
+ return r.era(n, { width: "abbreviated" });
815
+ // A, B
816
+ case "GGGGG":
817
+ return r.era(n, { width: "narrow" });
818
+ // Anno Domini, Before Christ
819
+ case "GGGG":
820
+ default:
821
+ return r.era(n, { width: "wide" });
822
+ }
823
+ },
824
+ // Year
825
+ y: function(e, t, r) {
826
+ if (t === "yo") {
827
+ const n = e.getFullYear(), i = n > 0 ? n : 1 - n;
828
+ return r.ordinalNumber(i, { unit: "year" });
829
+ }
830
+ return Y.y(e, t);
831
+ },
832
+ // Local week-numbering year
833
+ Y: function(e, t, r, n) {
834
+ const i = _t(e, n), a = i > 0 ? i : 1 - i;
835
+ if (t === "YY") {
836
+ const u = a % 100;
837
+ return T(u, 2);
838
+ }
839
+ return t === "Yo" ? r.ordinalNumber(a, { unit: "year" }) : T(a, t.length);
840
+ },
841
+ // ISO week-numbering year
842
+ R: function(e, t) {
843
+ const r = zt(e);
844
+ return T(r, t.length);
845
+ },
846
+ // Extended year. This is a single number designating the year of this calendar system.
847
+ // The main difference between `y` and `u` localizers are B.C. years:
848
+ // | Year | `y` | `u` |
849
+ // |------|-----|-----|
850
+ // | AC 1 | 1 | 1 |
851
+ // | BC 1 | 1 | 0 |
852
+ // | BC 2 | 2 | -1 |
853
+ // Also `yy` always returns the last two digits of a year,
854
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
855
+ u: function(e, t) {
856
+ const r = e.getFullYear();
857
+ return T(r, t.length);
858
+ },
859
+ // Quarter
860
+ Q: function(e, t, r) {
861
+ const n = Math.ceil((e.getMonth() + 1) / 3);
862
+ switch (t) {
863
+ // 1, 2, 3, 4
864
+ case "Q":
865
+ return String(n);
866
+ // 01, 02, 03, 04
867
+ case "QQ":
868
+ return T(n, 2);
869
+ // 1st, 2nd, 3rd, 4th
870
+ case "Qo":
871
+ return r.ordinalNumber(n, { unit: "quarter" });
872
+ // Q1, Q2, Q3, Q4
873
+ case "QQQ":
874
+ return r.quarter(n, {
875
+ width: "abbreviated",
876
+ context: "formatting"
877
+ });
878
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
879
+ case "QQQQQ":
880
+ return r.quarter(n, {
881
+ width: "narrow",
882
+ context: "formatting"
883
+ });
884
+ // 1st quarter, 2nd quarter, ...
885
+ case "QQQQ":
886
+ default:
887
+ return r.quarter(n, {
888
+ width: "wide",
889
+ context: "formatting"
890
+ });
891
+ }
892
+ },
893
+ // Stand-alone quarter
894
+ q: function(e, t, r) {
895
+ const n = Math.ceil((e.getMonth() + 1) / 3);
896
+ switch (t) {
897
+ // 1, 2, 3, 4
898
+ case "q":
899
+ return String(n);
900
+ // 01, 02, 03, 04
901
+ case "qq":
902
+ return T(n, 2);
903
+ // 1st, 2nd, 3rd, 4th
904
+ case "qo":
905
+ return r.ordinalNumber(n, { unit: "quarter" });
906
+ // Q1, Q2, Q3, Q4
907
+ case "qqq":
908
+ return r.quarter(n, {
909
+ width: "abbreviated",
910
+ context: "standalone"
911
+ });
912
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
913
+ case "qqqqq":
914
+ return r.quarter(n, {
915
+ width: "narrow",
916
+ context: "standalone"
917
+ });
918
+ // 1st quarter, 2nd quarter, ...
919
+ case "qqqq":
920
+ default:
921
+ return r.quarter(n, {
922
+ width: "wide",
923
+ context: "standalone"
924
+ });
925
+ }
926
+ },
927
+ // Month
928
+ M: function(e, t, r) {
929
+ const n = e.getMonth();
930
+ switch (t) {
931
+ case "M":
932
+ case "MM":
933
+ return Y.M(e, t);
934
+ // 1st, 2nd, ..., 12th
935
+ case "Mo":
936
+ return r.ordinalNumber(n + 1, { unit: "month" });
937
+ // Jan, Feb, ..., Dec
938
+ case "MMM":
939
+ return r.month(n, {
940
+ width: "abbreviated",
941
+ context: "formatting"
942
+ });
943
+ // J, F, ..., D
944
+ case "MMMMM":
945
+ return r.month(n, {
946
+ width: "narrow",
947
+ context: "formatting"
948
+ });
949
+ // January, February, ..., December
950
+ case "MMMM":
951
+ default:
952
+ return r.month(n, { width: "wide", context: "formatting" });
953
+ }
954
+ },
955
+ // Stand-alone month
956
+ L: function(e, t, r) {
957
+ const n = e.getMonth();
958
+ switch (t) {
959
+ // 1, 2, ..., 12
960
+ case "L":
961
+ return String(n + 1);
962
+ // 01, 02, ..., 12
963
+ case "LL":
964
+ return T(n + 1, 2);
965
+ // 1st, 2nd, ..., 12th
966
+ case "Lo":
967
+ return r.ordinalNumber(n + 1, { unit: "month" });
968
+ // Jan, Feb, ..., Dec
969
+ case "LLL":
970
+ return r.month(n, {
971
+ width: "abbreviated",
972
+ context: "standalone"
973
+ });
974
+ // J, F, ..., D
975
+ case "LLLLL":
976
+ return r.month(n, {
977
+ width: "narrow",
978
+ context: "standalone"
979
+ });
980
+ // January, February, ..., December
981
+ case "LLLL":
982
+ default:
983
+ return r.month(n, { width: "wide", context: "standalone" });
984
+ }
985
+ },
986
+ // Local week of year
987
+ w: function(e, t, r, n) {
988
+ const i = on(e, n);
989
+ return t === "wo" ? r.ordinalNumber(i, { unit: "week" }) : T(i, t.length);
990
+ },
991
+ // ISO week of year
992
+ I: function(e, t, r) {
993
+ const n = nn(e);
994
+ return t === "Io" ? r.ordinalNumber(n, { unit: "week" }) : T(n, t.length);
995
+ },
996
+ // Day of the month
997
+ d: function(e, t, r) {
998
+ return t === "do" ? r.ordinalNumber(e.getDate(), { unit: "date" }) : Y.d(e, t);
999
+ },
1000
+ // Day of year
1001
+ D: function(e, t, r) {
1002
+ const n = rn(e);
1003
+ return t === "Do" ? r.ordinalNumber(n, { unit: "dayOfYear" }) : T(n, t.length);
1004
+ },
1005
+ // Day of week
1006
+ E: function(e, t, r) {
1007
+ const n = e.getDay();
1008
+ switch (t) {
1009
+ // Tue
1010
+ case "E":
1011
+ case "EE":
1012
+ case "EEE":
1013
+ return r.day(n, {
1014
+ width: "abbreviated",
1015
+ context: "formatting"
1016
+ });
1017
+ // T
1018
+ case "EEEEE":
1019
+ return r.day(n, {
1020
+ width: "narrow",
1021
+ context: "formatting"
1022
+ });
1023
+ // Tu
1024
+ case "EEEEEE":
1025
+ return r.day(n, {
1026
+ width: "short",
1027
+ context: "formatting"
1028
+ });
1029
+ // Tuesday
1030
+ case "EEEE":
1031
+ default:
1032
+ return r.day(n, {
1033
+ width: "wide",
1034
+ context: "formatting"
1035
+ });
1036
+ }
1037
+ },
1038
+ // Local day of week
1039
+ e: function(e, t, r, n) {
1040
+ const i = e.getDay(), a = (i - n.weekStartsOn + 8) % 7 || 7;
1041
+ switch (t) {
1042
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1043
+ case "e":
1044
+ return String(a);
1045
+ // Padded numerical value
1046
+ case "ee":
1047
+ return T(a, 2);
1048
+ // 1st, 2nd, ..., 7th
1049
+ case "eo":
1050
+ return r.ordinalNumber(a, { unit: "day" });
1051
+ case "eee":
1052
+ return r.day(i, {
1053
+ width: "abbreviated",
1054
+ context: "formatting"
1055
+ });
1056
+ // T
1057
+ case "eeeee":
1058
+ return r.day(i, {
1059
+ width: "narrow",
1060
+ context: "formatting"
1061
+ });
1062
+ // Tu
1063
+ case "eeeeee":
1064
+ return r.day(i, {
1065
+ width: "short",
1066
+ context: "formatting"
1067
+ });
1068
+ // Tuesday
1069
+ case "eeee":
1070
+ default:
1071
+ return r.day(i, {
1072
+ width: "wide",
1073
+ context: "formatting"
1074
+ });
1075
+ }
1076
+ },
1077
+ // Stand-alone local day of week
1078
+ c: function(e, t, r, n) {
1079
+ const i = e.getDay(), a = (i - n.weekStartsOn + 8) % 7 || 7;
1080
+ switch (t) {
1081
+ // Numerical value (same as in `e`)
1082
+ case "c":
1083
+ return String(a);
1084
+ // Padded numerical value
1085
+ case "cc":
1086
+ return T(a, t.length);
1087
+ // 1st, 2nd, ..., 7th
1088
+ case "co":
1089
+ return r.ordinalNumber(a, { unit: "day" });
1090
+ case "ccc":
1091
+ return r.day(i, {
1092
+ width: "abbreviated",
1093
+ context: "standalone"
1094
+ });
1095
+ // T
1096
+ case "ccccc":
1097
+ return r.day(i, {
1098
+ width: "narrow",
1099
+ context: "standalone"
1100
+ });
1101
+ // Tu
1102
+ case "cccccc":
1103
+ return r.day(i, {
1104
+ width: "short",
1105
+ context: "standalone"
1106
+ });
1107
+ // Tuesday
1108
+ case "cccc":
1109
+ default:
1110
+ return r.day(i, {
1111
+ width: "wide",
1112
+ context: "standalone"
1113
+ });
1114
+ }
1115
+ },
1116
+ // ISO day of week
1117
+ i: function(e, t, r) {
1118
+ const n = e.getDay(), i = n === 0 ? 7 : n;
1119
+ switch (t) {
1120
+ // 2
1121
+ case "i":
1122
+ return String(i);
1123
+ // 02
1124
+ case "ii":
1125
+ return T(i, t.length);
1126
+ // 2nd
1127
+ case "io":
1128
+ return r.ordinalNumber(i, { unit: "day" });
1129
+ // Tue
1130
+ case "iii":
1131
+ return r.day(n, {
1132
+ width: "abbreviated",
1133
+ context: "formatting"
1134
+ });
1135
+ // T
1136
+ case "iiiii":
1137
+ return r.day(n, {
1138
+ width: "narrow",
1139
+ context: "formatting"
1140
+ });
1141
+ // Tu
1142
+ case "iiiiii":
1143
+ return r.day(n, {
1144
+ width: "short",
1145
+ context: "formatting"
1146
+ });
1147
+ // Tuesday
1148
+ case "iiii":
1149
+ default:
1150
+ return r.day(n, {
1151
+ width: "wide",
1152
+ context: "formatting"
1153
+ });
1154
+ }
1155
+ },
1156
+ // AM or PM
1157
+ a: function(e, t, r) {
1158
+ const i = e.getHours() / 12 >= 1 ? "pm" : "am";
1159
+ switch (t) {
1160
+ case "a":
1161
+ case "aa":
1162
+ return r.dayPeriod(i, {
1163
+ width: "abbreviated",
1164
+ context: "formatting"
1165
+ });
1166
+ case "aaa":
1167
+ return r.dayPeriod(i, {
1168
+ width: "abbreviated",
1169
+ context: "formatting"
1170
+ }).toLowerCase();
1171
+ case "aaaaa":
1172
+ return r.dayPeriod(i, {
1173
+ width: "narrow",
1174
+ context: "formatting"
1175
+ });
1176
+ case "aaaa":
1177
+ default:
1178
+ return r.dayPeriod(i, {
1179
+ width: "wide",
1180
+ context: "formatting"
1181
+ });
1182
+ }
1183
+ },
1184
+ // AM, PM, midnight, noon
1185
+ b: function(e, t, r) {
1186
+ const n = e.getHours();
1187
+ let i;
1188
+ switch (n === 12 ? i = Q.noon : n === 0 ? i = Q.midnight : i = n / 12 >= 1 ? "pm" : "am", t) {
1189
+ case "b":
1190
+ case "bb":
1191
+ return r.dayPeriod(i, {
1192
+ width: "abbreviated",
1193
+ context: "formatting"
1194
+ });
1195
+ case "bbb":
1196
+ return r.dayPeriod(i, {
1197
+ width: "abbreviated",
1198
+ context: "formatting"
1199
+ }).toLowerCase();
1200
+ case "bbbbb":
1201
+ return r.dayPeriod(i, {
1202
+ width: "narrow",
1203
+ context: "formatting"
1204
+ });
1205
+ case "bbbb":
1206
+ default:
1207
+ return r.dayPeriod(i, {
1208
+ width: "wide",
1209
+ context: "formatting"
1210
+ });
1211
+ }
1212
+ },
1213
+ // in the morning, in the afternoon, in the evening, at night
1214
+ B: function(e, t, r) {
1215
+ const n = e.getHours();
1216
+ let i;
1217
+ switch (n >= 17 ? i = Q.evening : n >= 12 ? i = Q.afternoon : n >= 4 ? i = Q.morning : i = Q.night, t) {
1218
+ case "B":
1219
+ case "BB":
1220
+ case "BBB":
1221
+ return r.dayPeriod(i, {
1222
+ width: "abbreviated",
1223
+ context: "formatting"
1224
+ });
1225
+ case "BBBBB":
1226
+ return r.dayPeriod(i, {
1227
+ width: "narrow",
1228
+ context: "formatting"
1229
+ });
1230
+ case "BBBB":
1231
+ default:
1232
+ return r.dayPeriod(i, {
1233
+ width: "wide",
1234
+ context: "formatting"
1235
+ });
1236
+ }
1237
+ },
1238
+ // Hour [1-12]
1239
+ h: function(e, t, r) {
1240
+ if (t === "ho") {
1241
+ let n = e.getHours() % 12;
1242
+ return n === 0 && (n = 12), r.ordinalNumber(n, { unit: "hour" });
1243
+ }
1244
+ return Y.h(e, t);
1245
+ },
1246
+ // Hour [0-23]
1247
+ H: function(e, t, r) {
1248
+ return t === "Ho" ? r.ordinalNumber(e.getHours(), { unit: "hour" }) : Y.H(e, t);
1249
+ },
1250
+ // Hour [0-11]
1251
+ K: function(e, t, r) {
1252
+ const n = e.getHours() % 12;
1253
+ return t === "Ko" ? r.ordinalNumber(n, { unit: "hour" }) : T(n, t.length);
1254
+ },
1255
+ // Hour [1-24]
1256
+ k: function(e, t, r) {
1257
+ let n = e.getHours();
1258
+ return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, { unit: "hour" }) : T(n, t.length);
1259
+ },
1260
+ // Minute
1261
+ m: function(e, t, r) {
1262
+ return t === "mo" ? r.ordinalNumber(e.getMinutes(), { unit: "minute" }) : Y.m(e, t);
1263
+ },
1264
+ // Second
1265
+ s: function(e, t, r) {
1266
+ return t === "so" ? r.ordinalNumber(e.getSeconds(), { unit: "second" }) : Y.s(e, t);
1267
+ },
1268
+ // Fraction of second
1269
+ S: function(e, t) {
1270
+ return Y.S(e, t);
1271
+ },
1272
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
1273
+ X: function(e, t, r) {
1274
+ const n = e.getTimezoneOffset();
1275
+ if (n === 0)
1276
+ return "Z";
1277
+ switch (t) {
1278
+ // Hours and optional minutes
1279
+ case "X":
1280
+ return et(n);
1281
+ // Hours, minutes and optional seconds without `:` delimiter
1282
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1283
+ // so this token always has the same output as `XX`
1284
+ case "XXXX":
1285
+ case "XX":
1286
+ return U(n);
1287
+ // Hours, minutes and optional seconds with `:` delimiter
1288
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1289
+ // so this token always has the same output as `XXX`
1290
+ case "XXXXX":
1291
+ case "XXX":
1292
+ // Hours and minutes with `:` delimiter
1293
+ default:
1294
+ return U(n, ":");
1295
+ }
1296
+ },
1297
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
1298
+ x: function(e, t, r) {
1299
+ const n = e.getTimezoneOffset();
1300
+ switch (t) {
1301
+ // Hours and optional minutes
1302
+ case "x":
1303
+ return et(n);
1304
+ // Hours, minutes and optional seconds without `:` delimiter
1305
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1306
+ // so this token always has the same output as `xx`
1307
+ case "xxxx":
1308
+ case "xx":
1309
+ return U(n);
1310
+ // Hours, minutes and optional seconds with `:` delimiter
1311
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
1312
+ // so this token always has the same output as `xxx`
1313
+ case "xxxxx":
1314
+ case "xxx":
1315
+ // Hours and minutes with `:` delimiter
1316
+ default:
1317
+ return U(n, ":");
1318
+ }
1319
+ },
1320
+ // Timezone (GMT)
1321
+ O: function(e, t, r) {
1322
+ const n = e.getTimezoneOffset();
1323
+ switch (t) {
1324
+ // Short
1325
+ case "O":
1326
+ case "OO":
1327
+ case "OOO":
1328
+ return "GMT" + Ze(n, ":");
1329
+ // Long
1330
+ case "OOOO":
1331
+ default:
1332
+ return "GMT" + U(n, ":");
1333
+ }
1334
+ },
1335
+ // Timezone (specific non-location)
1336
+ z: function(e, t, r) {
1337
+ const n = e.getTimezoneOffset();
1338
+ switch (t) {
1339
+ // Short
1340
+ case "z":
1341
+ case "zz":
1342
+ case "zzz":
1343
+ return "GMT" + Ze(n, ":");
1344
+ // Long
1345
+ case "zzzz":
1346
+ default:
1347
+ return "GMT" + U(n, ":");
1348
+ }
1349
+ },
1350
+ // Seconds timestamp
1351
+ t: function(e, t, r) {
1352
+ const n = Math.trunc(+e / 1e3);
1353
+ return T(n, t.length);
1354
+ },
1355
+ // Milliseconds timestamp
1356
+ T: function(e, t, r) {
1357
+ return T(+e, t.length);
1358
+ }
1359
+ };
1360
+ function Ze(e, t = "") {
1361
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), i = Math.trunc(n / 60), a = n % 60;
1362
+ return a === 0 ? r + String(i) : r + String(i) + t + T(a, 2);
1363
+ }
1364
+ function et(e, t) {
1365
+ return e % 60 === 0 ? (e > 0 ? "-" : "+") + T(Math.abs(e) / 60, 2) : U(e, t);
1366
+ }
1367
+ function U(e, t = "") {
1368
+ const r = e > 0 ? "-" : "+", n = Math.abs(e), i = T(Math.trunc(n / 60), 2), a = T(n % 60, 2);
1369
+ return r + i + t + a;
1370
+ }
1371
+ const tt = (e, t) => {
1372
+ switch (e) {
1373
+ case "P":
1374
+ return t.date({ width: "short" });
1375
+ case "PP":
1376
+ return t.date({ width: "medium" });
1377
+ case "PPP":
1378
+ return t.date({ width: "long" });
1379
+ case "PPPP":
1380
+ default:
1381
+ return t.date({ width: "full" });
1382
+ }
1383
+ }, Wt = (e, t) => {
1384
+ switch (e) {
1385
+ case "p":
1386
+ return t.time({ width: "short" });
1387
+ case "pp":
1388
+ return t.time({ width: "medium" });
1389
+ case "ppp":
1390
+ return t.time({ width: "long" });
1391
+ case "pppp":
1392
+ default:
1393
+ return t.time({ width: "full" });
1394
+ }
1395
+ }, sn = (e, t) => {
1396
+ const r = e.match(/(P+)(p+)?/) || [], n = r[1], i = r[2];
1397
+ if (!i)
1398
+ return tt(e, t);
1399
+ let a;
1400
+ switch (n) {
1401
+ case "P":
1402
+ a = t.dateTime({ width: "short" });
1403
+ break;
1404
+ case "PP":
1405
+ a = t.dateTime({ width: "medium" });
1406
+ break;
1407
+ case "PPP":
1408
+ a = t.dateTime({ width: "long" });
1409
+ break;
1410
+ case "PPPP":
1411
+ default:
1412
+ a = t.dateTime({ width: "full" });
1413
+ break;
1414
+ }
1415
+ return a.replace("{{date}}", tt(n, t)).replace("{{time}}", Wt(i, t));
1416
+ }, un = {
1417
+ p: Wt,
1418
+ P: sn
1419
+ }, cn = /^D+$/, ln = /^Y+$/, dn = ["D", "DD", "YY", "YYYY"];
1420
+ function fn(e) {
1421
+ return cn.test(e);
1422
+ }
1423
+ function hn(e) {
1424
+ return ln.test(e);
1425
+ }
1426
+ function gn(e, t, r) {
1427
+ const n = pn(e, t, r);
1428
+ if (console.warn(n), dn.includes(e)) throw new RangeError(n);
1429
+ }
1430
+ function pn(e, t, r) {
1431
+ const n = e[0] === "Y" ? "years" : "days of the month";
1432
+ return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
1433
+ }
1434
+ const mn = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, yn = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, vn = /^'([^]*?)'?$/, bn = /''/g, wn = /[a-zA-Z]/;
1435
+ function I(e, t, r) {
1436
+ var f, l, d, h;
1437
+ const n = Te(), i = n.locale ?? tn, a = n.firstWeekContainsDate ?? ((l = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, u = n.weekStartsOn ?? ((h = (d = n.locale) == null ? void 0 : d.options) == null ? void 0 : h.weekStartsOn) ?? 0, c = N(e, r == null ? void 0 : r.in);
1438
+ if (!br(c))
1439
+ throw new RangeError("Invalid time value");
1440
+ let s = t.match(yn).map((g) => {
1441
+ const p = g[0];
1442
+ if (p === "p" || p === "P") {
1443
+ const m = un[p];
1444
+ return m(g, i.formatLong);
1445
+ }
1446
+ return g;
1447
+ }).join("").match(mn).map((g) => {
1448
+ if (g === "''")
1449
+ return { isToken: !1, value: "'" };
1450
+ const p = g[0];
1451
+ if (p === "'")
1452
+ return { isToken: !1, value: xn(g) };
1453
+ if (Je[p])
1454
+ return { isToken: !0, value: g };
1455
+ if (p.match(wn))
1456
+ throw new RangeError(
1457
+ "Format string contains an unescaped latin alphabet character `" + p + "`"
1458
+ );
1459
+ return { isToken: !1, value: g };
1460
+ });
1461
+ i.localize.preprocessor && (s = i.localize.preprocessor(c, s));
1462
+ const o = {
1463
+ firstWeekContainsDate: a,
1464
+ weekStartsOn: u,
1465
+ locale: i
1466
+ };
1467
+ return s.map((g) => {
1468
+ if (!g.isToken) return g.value;
1469
+ const p = g.value;
1470
+ (hn(p) || fn(p)) && gn(p, t, String(e));
1471
+ const m = Je[p[0]];
1472
+ return m(c, p, i.localize, o);
1473
+ }).join("");
1474
+ }
1475
+ function xn(e) {
1476
+ const t = e.match(vn);
1477
+ return t ? t[1].replace(bn, "'") : e;
1478
+ }
1479
+ function Sn(e, t) {
1480
+ return N(e, t == null ? void 0 : t.in).getDay();
1481
+ }
1482
+ function On(e, t) {
1483
+ const r = N(e, t == null ? void 0 : t.in), n = r.getMonth();
1484
+ return r.setFullYear(r.getFullYear(), n + 1, 0), r.setHours(0, 0, 0, 0), N(r, t == null ? void 0 : t.in);
1485
+ }
1486
+ function Dn(e, t, r) {
1487
+ let n = t - Sn(e, r);
1488
+ return n <= 0 && (n += 7), le(e, n, r);
1489
+ }
1490
+ function Tn(e, t) {
1491
+ return Dn(e, 0, t);
1492
+ }
1493
+ function ze(e, t, r) {
1494
+ const n = N(e, r == null ? void 0 : r.in);
1495
+ return n.setHours(t), n;
1496
+ }
1497
+ function Ye(e, t, r) {
1498
+ const n = En(e, t, r), i = Mn(e, t);
1499
+ return { width: n, height: i };
1500
+ }
1501
+ function Mn(e, t) {
1502
+ return t.pixelsPerResource;
1503
+ }
1504
+ function En(e, t, r) {
1505
+ return Math.abs(
1506
+ (B(r.end, r.start) + 1) * t.pixelsPerDay
1507
+ );
1508
+ }
1509
+ function Fe(e, t, r, n) {
1510
+ const i = Lt(e, t, n), a = Rn(e, t, r.start, n);
1511
+ return {
1512
+ ...i,
1513
+ ...a
1514
+ };
1515
+ }
1516
+ function Lt(e, t, r) {
1517
+ const n = B(e.end, e.start) * r.pixelsPerDay, i = e.size / t.capacity * r.pixelsPerResource;
1518
+ return { width: n, height: i };
1519
+ }
1520
+ function Be(e, t, r) {
1521
+ return B(e, t) * r.pixelsPerDay + r.pixelsPerDay / 2;
1522
+ }
1523
+ function Pn(e, t, r) {
1524
+ return e / t * r.pixelsPerResource;
1525
+ }
1526
+ function Rn(e, t, r, n) {
1527
+ const i = Be(e.start, r, n), a = Pn(e.offset, t.capacity, n);
1528
+ return { x: i, y: a };
1529
+ }
1530
+ function Z(e, t) {
1531
+ const r = e.element.getBoundingClientRect(), n = {
1532
+ x: r.x - t.initial.input.pageX,
1533
+ y: r.y - t.initial.input.pageY
1534
+ }, i = {
1535
+ x: n.x / r.width,
1536
+ y: n.y / r.height
1537
+ };
1538
+ return {
1539
+ absolute: n,
1540
+ relative: i
1541
+ };
1542
+ }
1543
+ function Ht(e, t, r, n, i) {
1544
+ return {
1545
+ id: e.id,
1546
+ swimlaneId: t.id,
1547
+ start: ze(
1548
+ le(i.start, Math.floor(r.x / n.pixelsPerDay)),
1549
+ 12
1550
+ ),
1551
+ end: ze(
1552
+ le(
1553
+ i.start,
1554
+ Math.floor(
1555
+ (r.x + r.width) / n.pixelsPerDay
1556
+ )
1557
+ ),
1558
+ 12
1559
+ ),
1560
+ offset: Math.floor(
1561
+ r.y / n.pixelsPerResource * t.capacity
1562
+ ),
1563
+ size: Math.floor(
1564
+ r.height / n.pixelsPerResource * t.capacity
1565
+ ),
1566
+ payload: e.payload
1567
+ };
1568
+ }
1569
+ function ha({
1570
+ focusedDay: e
1571
+ }) {
1572
+ const { settings: t } = ge();
1573
+ return /* @__PURE__ */ v("div", { className: "timeline-background", children: /* @__PURE__ */ K("div", { className: "timeline-background-inner", children: [
1574
+ e && /* @__PURE__ */ v(
1575
+ "div",
1576
+ {
1577
+ className: "timeline-background-focused-day-position",
1578
+ style: {
1579
+ width: `${t.pixelsPerDay}px`,
1580
+ marginLeft: `${Be(e, t.start, t) - t.pixelsPerDay / 2}px`
1581
+ }
1582
+ }
1583
+ ),
1584
+ /* @__PURE__ */ v(
1585
+ "div",
1586
+ {
1587
+ id: "timeline-background-date-anchor",
1588
+ style: {
1589
+ position: "absolute",
1590
+ top: 0,
1591
+ width: "1px",
1592
+ height: "100%"
1593
+ }
1594
+ }
1595
+ ),
1596
+ Ct(t).map((r, n) => /* @__PURE__ */ v(
1597
+ "div",
1598
+ {
1599
+ className: `timeline-background-day-label ${At(r) ? "timeline-background-day-label-sunday" : ""} `,
1600
+ style: { width: `${t.pixelsPerDay}px` },
1601
+ "data-day": I(r, "yyyy-MM-dd")
1602
+ },
1603
+ n
1604
+ ))
1605
+ ] }) });
1606
+ }
1607
+ function kn(e, t) {
1608
+ const r = B(t, e) + 1;
1609
+ return /* @__PURE__ */ v(Se, { children: r > 4 ? I(e, "LLLL yyyy") : /* @__PURE__ */ v(Se, {}) });
1610
+ }
1611
+ function Nn(e, t) {
1612
+ const r = B(t, e) + 1, n = `KW ${I(e, "w")} (${I(
1613
+ e,
1614
+ "MM-dd"
1615
+ )} - ${I(t, "MM-dd")}`;
1616
+ return /* @__PURE__ */ v("div", { title: n, children: r > 2 ? /* @__PURE__ */ K(Se, { children: [
1617
+ "KW ",
1618
+ I(e, "w")
1619
+ ] }) : /* @__PURE__ */ v(Se, {}) });
1620
+ }
1621
+ function An(e) {
1622
+ const t = `${I(e, "yyyy-MM-dd")}`;
1623
+ return /* @__PURE__ */ v("div", { title: t, children: I(e, "d") });
1624
+ }
1625
+ function zn({
1626
+ range: e,
1627
+ pixels: t,
1628
+ focusedDay: r,
1629
+ setFocusedDay: n = () => {
1630
+ },
1631
+ render: i = An,
1632
+ onDayClick: a = () => {
1633
+ }
1634
+ }) {
1635
+ return /* @__PURE__ */ v("div", { className: "timeline-header-days", children: Ct(e).map((u, c) => /* @__PURE__ */ v(
1636
+ "div",
1637
+ {
1638
+ className: `timeline-header-day-label ${r && yr(r, u) ? "timeline-header-day-label-focused" : ""}`,
1639
+ style: { width: `${t.pixelsPerDay}px` },
1640
+ onClick: (s) => {
1641
+ a({ day: u, e: s }), n(u);
1642
+ },
1643
+ children: i(u)
1644
+ },
1645
+ c
1646
+ )) });
1647
+ }
1648
+ function Cn({
1649
+ range: e,
1650
+ pixels: t,
1651
+ setFocusedDay: r = () => {
1652
+ },
1653
+ render: n = Nn,
1654
+ onWeekClick: i = () => {
1655
+ }
1656
+ }) {
1657
+ return /* @__PURE__ */ v("div", { className: "timeline-header-weeks", children: xr(e, { weekStartsOn: 1 }).map((a, u) => {
1658
+ a < e.start && (a = e.start);
1659
+ let c = At(a) ? a : Tn(a);
1660
+ c > e.end && (c = e.end);
1661
+ const s = B(c, a) + 1;
1662
+ return /* @__PURE__ */ v(
1663
+ "div",
1664
+ {
1665
+ className: "timeline-header-week-label",
1666
+ style: {
1667
+ width: `${t.pixelsPerDay * s}px`
1668
+ },
1669
+ onClick: (o) => {
1670
+ i({ firstDay: a, lastDay: c, e: o }), r(a);
1671
+ },
1672
+ children: n(a, c)
1673
+ },
1674
+ u
1675
+ );
1676
+ }) });
1677
+ }
1678
+ function _n({
1679
+ range: e,
1680
+ pixels: t,
1681
+ setFocusedDay: r = () => {
1682
+ },
1683
+ render: n = kn,
1684
+ onMonthClick: i = () => {
1685
+ }
1686
+ }) {
1687
+ return /* @__PURE__ */ v("div", { className: "timeline-header-months", children: wr(e).map((a, u) => {
1688
+ a < e.start && (a = e.start);
1689
+ let c = On(a);
1690
+ c > e.end && (c = e.end);
1691
+ const s = B(c, a) + 1;
1692
+ return /* @__PURE__ */ v(
1693
+ "div",
1694
+ {
1695
+ className: "timeline-header-month-label",
1696
+ style: {
1697
+ width: `${t.pixelsPerDay * s}px`
1698
+ },
1699
+ onClick: (o) => {
1700
+ i({ firstDay: a, lastDay: c, e: o }), r(a);
1701
+ },
1702
+ children: n(a, c)
1703
+ },
1704
+ u
1705
+ );
1706
+ }) });
1707
+ }
1708
+ function ga({
1709
+ focusedDay: e,
1710
+ setFocusedDay: t = () => {
1711
+ },
1712
+ renderMonthHeader: r,
1713
+ renderWeekHeader: n,
1714
+ renderDayHeader: i,
1715
+ onMonthClick: a,
1716
+ onDayClick: u,
1717
+ onWeekClick: c
1718
+ }) {
1719
+ const { settings: s } = ge();
1720
+ return /* @__PURE__ */ K("div", { className: "timeline-header", children: [
1721
+ s.showMonths && /* @__PURE__ */ v(
1722
+ _n,
1723
+ {
1724
+ range: s,
1725
+ pixels: s,
1726
+ setFocusedDay: t,
1727
+ render: r,
1728
+ onMonthClick: a
1729
+ }
1730
+ ),
1731
+ s.showWeeks && /* @__PURE__ */ v(
1732
+ Cn,
1733
+ {
1734
+ range: s,
1735
+ pixels: s,
1736
+ setFocusedDay: t,
1737
+ render: n,
1738
+ onWeekClick: c
1739
+ }
1740
+ ),
1741
+ s.showDays && /* @__PURE__ */ v(
1742
+ zn,
1743
+ {
1744
+ range: s,
1745
+ pixels: s,
1746
+ focusedDay: e,
1747
+ setFocusedDay: t,
1748
+ render: i,
1749
+ onDayClick: u
1750
+ }
1751
+ )
1752
+ ] });
1753
+ }
1754
+ const Wn = ({
1755
+ settings: e,
1756
+ children: t
1757
+ }) => {
1758
+ const [r, n] = G(e);
1759
+ return ee(() => {
1760
+ n((i) => ({ ...i, _settings: e }));
1761
+ }, [e]), /* @__PURE__ */ v(kt.Provider, { value: { settings: r, setSettings: n }, children: t });
1762
+ };
1763
+ function pa({
1764
+ children: e,
1765
+ start: t = new Date(2025, 1, 1),
1766
+ end: r = new Date(2025, 5, 1),
1767
+ pixelsPerDay: n = 30,
1768
+ pixelsPerResource: i = 100,
1769
+ showMonths: a = !0,
1770
+ showWeeks: u = !0,
1771
+ showDays: c = !0,
1772
+ allowOverlaps: s = !0,
1773
+ focusedDate: o = null
1774
+ }) {
1775
+ return /* @__PURE__ */ v("div", { className: "timeline", children: /* @__PURE__ */ v(
1776
+ Wn,
1777
+ {
1778
+ settings: {
1779
+ start: t,
1780
+ end: r,
1781
+ pixelsPerDay: n,
1782
+ pixelsPerResource: i,
1783
+ showDays: c,
1784
+ showMonths: a,
1785
+ showWeeks: u,
1786
+ allowOverlaps: s,
1787
+ focusedDate: o
1788
+ },
1789
+ children: e
1790
+ }
1791
+ ) });
1792
+ }
1793
+ function Ln(e) {
1794
+ if (Array.isArray(e)) return e;
1795
+ }
1796
+ function Hn(e, t) {
1797
+ var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1798
+ if (r != null) {
1799
+ var n, i, a, u, c = [], s = !0, o = !1;
1800
+ try {
1801
+ if (a = (r = r.call(e)).next, t !== 0) for (; !(s = (n = a.call(r)).done) && (c.push(n.value), c.length !== t); s = !0) ;
1802
+ } catch (f) {
1803
+ o = !0, i = f;
1804
+ } finally {
1805
+ try {
1806
+ if (!s && r.return != null && (u = r.return(), Object(u) !== u)) return;
1807
+ } finally {
1808
+ if (o) throw i;
1809
+ }
1810
+ }
1811
+ return c;
1812
+ }
1813
+ }
1814
+ function Ce(e, t) {
1815
+ (t == null || t > e.length) && (t = e.length);
1816
+ for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
1817
+ return n;
1818
+ }
1819
+ function It(e, t) {
1820
+ if (e) {
1821
+ if (typeof e == "string") return Ce(e, t);
1822
+ var r = {}.toString.call(e).slice(8, -1);
1823
+ return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ce(e, t) : void 0;
1824
+ }
1825
+ }
1826
+ function In() {
1827
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1828
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1829
+ }
1830
+ function jt(e, t) {
1831
+ return Ln(e) || Hn(e, t) || It(e, t) || In();
1832
+ }
1833
+ var Ee = {}, oe = {}, rt;
1834
+ function Yt() {
1835
+ if (rt) return oe;
1836
+ rt = 1, Object.defineProperty(oe, "__esModule", { value: !0 }), oe.bind = void 0;
1837
+ function e(t, r) {
1838
+ var n = r.type, i = r.listener, a = r.options;
1839
+ return t.addEventListener(n, i, a), function() {
1840
+ t.removeEventListener(n, i, a);
1841
+ };
1842
+ }
1843
+ return oe.bind = e, oe;
1844
+ }
1845
+ var X = {}, nt;
1846
+ function jn() {
1847
+ if (nt) return X;
1848
+ nt = 1;
1849
+ var e = X && X.__assign || function() {
1850
+ return e = Object.assign || function(a) {
1851
+ for (var u, c = 1, s = arguments.length; c < s; c++) {
1852
+ u = arguments[c];
1853
+ for (var o in u) Object.prototype.hasOwnProperty.call(u, o) && (a[o] = u[o]);
1854
+ }
1855
+ return a;
1856
+ }, e.apply(this, arguments);
1857
+ };
1858
+ Object.defineProperty(X, "__esModule", { value: !0 }), X.bindAll = void 0;
1859
+ var t = /* @__PURE__ */ Yt();
1860
+ function r(a) {
1861
+ if (!(typeof a > "u"))
1862
+ return typeof a == "boolean" ? {
1863
+ capture: a
1864
+ } : a;
1865
+ }
1866
+ function n(a, u) {
1867
+ if (u == null)
1868
+ return a;
1869
+ var c = e(e({}, a), { options: e(e({}, r(u)), r(a.options)) });
1870
+ return c;
1871
+ }
1872
+ function i(a, u, c) {
1873
+ var s = u.map(function(o) {
1874
+ var f = n(o, c);
1875
+ return (0, t.bind)(a, f);
1876
+ });
1877
+ return function() {
1878
+ s.forEach(function(f) {
1879
+ return f();
1880
+ });
1881
+ };
1882
+ }
1883
+ return X.bindAll = i, X;
1884
+ }
1885
+ var it;
1886
+ function Yn() {
1887
+ return it || (it = 1, function(e) {
1888
+ Object.defineProperty(e, "__esModule", { value: !0 }), e.bindAll = e.bind = void 0;
1889
+ var t = /* @__PURE__ */ Yt();
1890
+ Object.defineProperty(e, "bind", { enumerable: !0, get: function() {
1891
+ return t.bind;
1892
+ } });
1893
+ var r = /* @__PURE__ */ jn();
1894
+ Object.defineProperty(e, "bindAll", { enumerable: !0, get: function() {
1895
+ return r.bindAll;
1896
+ } });
1897
+ }(Ee)), Ee;
1898
+ }
1899
+ var te = /* @__PURE__ */ Yn(), Ft = "data-pdnd-honey-pot";
1900
+ function Bt(e) {
1901
+ return e instanceof Element && e.hasAttribute(Ft);
1902
+ }
1903
+ function $t(e) {
1904
+ var t = document.elementsFromPoint(e.x, e.y), r = jt(t, 2), n = r[0], i = r[1];
1905
+ return n ? Bt(n) ? i ?? null : n : null;
1906
+ }
1907
+ function de(e) {
1908
+ "@babel/helpers - typeof";
1909
+ return de = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
1910
+ return typeof t;
1911
+ } : function(t) {
1912
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
1913
+ }, de(e);
1914
+ }
1915
+ function Fn(e, t) {
1916
+ if (de(e) != "object" || !e) return e;
1917
+ var r = e[Symbol.toPrimitive];
1918
+ if (r !== void 0) {
1919
+ var n = r.call(e, t);
1920
+ if (de(n) != "object") return n;
1921
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1922
+ }
1923
+ return (t === "string" ? String : Number)(e);
1924
+ }
1925
+ function Bn(e) {
1926
+ var t = Fn(e, "string");
1927
+ return de(t) == "symbol" ? t : t + "";
1928
+ }
1929
+ function $e(e, t, r) {
1930
+ return (t = Bn(t)) in e ? Object.defineProperty(e, t, {
1931
+ value: r,
1932
+ enumerable: !0,
1933
+ configurable: !0,
1934
+ writable: !0
1935
+ }) : e[t] = r, e;
1936
+ }
1937
+ var $n = 2147483647;
1938
+ function at(e, t) {
1939
+ var r = Object.keys(e);
1940
+ if (Object.getOwnPropertySymbols) {
1941
+ var n = Object.getOwnPropertySymbols(e);
1942
+ t && (n = n.filter(function(i) {
1943
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
1944
+ })), r.push.apply(r, n);
1945
+ }
1946
+ return r;
1947
+ }
1948
+ function ot(e) {
1949
+ for (var t = 1; t < arguments.length; t++) {
1950
+ var r = arguments[t] != null ? arguments[t] : {};
1951
+ t % 2 ? at(Object(r), !0).forEach(function(n) {
1952
+ $e(e, n, r[n]);
1953
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : at(Object(r)).forEach(function(n) {
1954
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
1955
+ });
1956
+ }
1957
+ return e;
1958
+ }
1959
+ var fe = 2, st = fe / 2;
1960
+ function qn(e) {
1961
+ return {
1962
+ x: Math.floor(e.x),
1963
+ y: Math.floor(e.y)
1964
+ };
1965
+ }
1966
+ function Xn(e) {
1967
+ return {
1968
+ x: e.x - st,
1969
+ y: e.y - st
1970
+ };
1971
+ }
1972
+ function Un(e) {
1973
+ return {
1974
+ x: Math.max(e.x, 0),
1975
+ y: Math.max(e.y, 0)
1976
+ };
1977
+ }
1978
+ function Gn(e) {
1979
+ return {
1980
+ x: Math.min(e.x, window.innerWidth - fe),
1981
+ y: Math.min(e.y, window.innerHeight - fe)
1982
+ };
1983
+ }
1984
+ function ut(e) {
1985
+ var t = e.client, r = Gn(Un(Xn(qn(t))));
1986
+ return DOMRect.fromRect({
1987
+ x: r.x,
1988
+ y: r.y,
1989
+ width: fe,
1990
+ height: fe
1991
+ });
1992
+ }
1993
+ function ct(e) {
1994
+ var t = e.clientRect;
1995
+ return {
1996
+ left: "".concat(t.left, "px"),
1997
+ top: "".concat(t.top, "px"),
1998
+ width: "".concat(t.width, "px"),
1999
+ height: "".concat(t.height, "px")
2000
+ };
2001
+ }
2002
+ function Kn(e) {
2003
+ var t = e.client, r = e.clientRect;
2004
+ return (
2005
+ // is within horizontal bounds
2006
+ t.x >= r.x && t.x <= r.x + r.width && // is within vertical bounds
2007
+ t.y >= r.y && t.y <= r.y + r.height
2008
+ );
2009
+ }
2010
+ function Vn(e) {
2011
+ var t = e.initial, r = document.createElement("div");
2012
+ r.setAttribute(Ft, "true");
2013
+ var n = ut({
2014
+ client: t
2015
+ });
2016
+ Object.assign(r.style, ot(ot({
2017
+ // Setting a background color explicitly to avoid any inherited styles.
2018
+ // Looks like this could be `opacity: 0`, but worried that _might_
2019
+ // cause the element to be ignored on some platforms.
2020
+ // When debugging, set backgroundColor to something like "red".
2021
+ backgroundColor: "transparent",
2022
+ position: "fixed",
2023
+ // Being explicit to avoid inheriting styles
2024
+ padding: 0,
2025
+ margin: 0,
2026
+ boxSizing: "border-box"
2027
+ }, ct({
2028
+ clientRect: n
2029
+ })), {}, {
2030
+ // We want this element to absorb pointer events,
2031
+ // it's kind of the whole point 😉
2032
+ pointerEvents: "auto",
2033
+ // Want to make sure the honey pot is top of everything else.
2034
+ // Don't need to worry about native drag previews, as they will
2035
+ // have been rendered (and removed) before the honey pot is rendered
2036
+ zIndex: $n
2037
+ })), document.body.appendChild(r);
2038
+ var i = te.bind(window, {
2039
+ type: "pointermove",
2040
+ listener: function(u) {
2041
+ var c = {
2042
+ x: u.clientX,
2043
+ y: u.clientY
2044
+ };
2045
+ n = ut({
2046
+ client: c
2047
+ }), Object.assign(r.style, ct({
2048
+ clientRect: n
2049
+ }));
2050
+ },
2051
+ // using capture so we are less likely to be impacted by event stopping
2052
+ options: {
2053
+ capture: !0
2054
+ }
2055
+ });
2056
+ return function(u) {
2057
+ var c = u.current;
2058
+ if (i(), Kn({
2059
+ client: c,
2060
+ clientRect: n
2061
+ })) {
2062
+ r.remove();
2063
+ return;
2064
+ }
2065
+ function s() {
2066
+ o(), r.remove();
2067
+ }
2068
+ var o = te.bindAll(window, [
2069
+ {
2070
+ type: "pointerdown",
2071
+ listener: s
2072
+ },
2073
+ {
2074
+ type: "pointermove",
2075
+ listener: s
2076
+ },
2077
+ {
2078
+ type: "focusin",
2079
+ listener: s
2080
+ },
2081
+ {
2082
+ type: "focusout",
2083
+ listener: s
2084
+ },
2085
+ // a 'pointerdown' should happen before 'dragstart', but just being super safe
2086
+ {
2087
+ type: "dragstart",
2088
+ listener: s
2089
+ },
2090
+ // if the user has dragged something out of the window
2091
+ // and then is dragging something back into the window
2092
+ // the first events we will see are "dragenter" (and then "dragover").
2093
+ // So if we see any of these we need to clear the post drag fix.
2094
+ {
2095
+ type: "dragenter",
2096
+ listener: s
2097
+ },
2098
+ {
2099
+ type: "dragover",
2100
+ listener: s
2101
+ }
2102
+ // Not adding a "wheel" event listener, as "wheel" by itself does not
2103
+ // resolve the bug.
2104
+ ], {
2105
+ // Using `capture` so less likely to be impacted by other code stopping events
2106
+ capture: !0
2107
+ });
2108
+ };
2109
+ }
2110
+ function Qn() {
2111
+ var e = null;
2112
+ function t() {
2113
+ return e = null, te.bind(window, {
2114
+ type: "pointermove",
2115
+ listener: function(i) {
2116
+ e = {
2117
+ x: i.clientX,
2118
+ y: i.clientY
2119
+ };
2120
+ },
2121
+ // listening for pointer move in capture phase
2122
+ // so we are less likely to be impacted by events being stopped.
2123
+ options: {
2124
+ capture: !0
2125
+ }
2126
+ });
2127
+ }
2128
+ function r() {
2129
+ var n = null;
2130
+ return function(a) {
2131
+ var u = a.eventName, c = a.payload;
2132
+ if (u === "onDragStart") {
2133
+ var s = c.location.initial.input, o = e ?? {
2134
+ x: s.clientX,
2135
+ y: s.clientY
2136
+ };
2137
+ n = Vn({
2138
+ initial: o
2139
+ });
2140
+ }
2141
+ if (u === "onDrop") {
2142
+ var f, l = c.location.current.input;
2143
+ (f = n) === null || f === void 0 || f({
2144
+ current: {
2145
+ x: l.clientX,
2146
+ y: l.clientY
2147
+ }
2148
+ }), n = null, e = null;
2149
+ }
2150
+ };
2151
+ }
2152
+ return {
2153
+ bindEvents: t,
2154
+ getOnPostDispatch: r
2155
+ };
2156
+ }
2157
+ function Jn(e) {
2158
+ if (Array.isArray(e)) return Ce(e);
2159
+ }
2160
+ function Zn(e) {
2161
+ if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
2162
+ }
2163
+ function ei() {
2164
+ throw new TypeError(`Invalid attempt to spread non-iterable instance.
2165
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
2166
+ }
2167
+ function qt(e) {
2168
+ return Jn(e) || Zn(e) || It(e) || ei();
2169
+ }
2170
+ function ne(e) {
2171
+ var t = null;
2172
+ return function() {
2173
+ if (!t) {
2174
+ for (var n = arguments.length, i = new Array(n), a = 0; a < n; a++)
2175
+ i[a] = arguments[a];
2176
+ var u = e.apply(this, i);
2177
+ t = {
2178
+ result: u
2179
+ };
2180
+ }
2181
+ return t.result;
2182
+ };
2183
+ }
2184
+ var ti = ne(function() {
2185
+ return process.env.NODE_ENV === "test" ? !1 : navigator.userAgent.includes("Firefox");
2186
+ }), qe = ne(function() {
2187
+ if (process.env.NODE_ENV === "test")
2188
+ return !1;
2189
+ var t = navigator, r = t.userAgent;
2190
+ return r.includes("AppleWebKit") && !r.includes("Chrome");
2191
+ }), _e = {
2192
+ isLeavingWindow: Symbol("leaving"),
2193
+ isEnteringWindow: Symbol("entering")
2194
+ };
2195
+ function ri(e) {
2196
+ var t = e.dragLeave;
2197
+ return qe() ? t.hasOwnProperty(_e.isLeavingWindow) : !1;
2198
+ }
2199
+ (function() {
2200
+ if (typeof window > "u" || process.env.NODE_ENV === "test" || !qe())
2201
+ return;
2202
+ function t() {
2203
+ return {
2204
+ enterCount: 0,
2205
+ isOverWindow: !1
2206
+ };
2207
+ }
2208
+ var r = t();
2209
+ function n() {
2210
+ r = t();
2211
+ }
2212
+ te.bindAll(
2213
+ window,
2214
+ [{
2215
+ type: "dragstart",
2216
+ listener: function() {
2217
+ r.enterCount = 0, r.isOverWindow = !0;
2218
+ }
2219
+ }, {
2220
+ type: "drop",
2221
+ listener: n
2222
+ }, {
2223
+ type: "dragend",
2224
+ listener: n
2225
+ }, {
2226
+ type: "dragenter",
2227
+ listener: function(a) {
2228
+ !r.isOverWindow && r.enterCount === 0 && (a[_e.isEnteringWindow] = !0), r.isOverWindow = !0, r.enterCount++;
2229
+ }
2230
+ }, {
2231
+ type: "dragleave",
2232
+ listener: function(a) {
2233
+ r.enterCount--, r.isOverWindow && r.enterCount === 0 && (a[_e.isLeavingWindow] = !0, r.isOverWindow = !1);
2234
+ }
2235
+ }],
2236
+ // using `capture: true` so that adding event listeners
2237
+ // in bubble phase will have the correct symbols
2238
+ {
2239
+ capture: !0
2240
+ }
2241
+ );
2242
+ })();
2243
+ function ni(e) {
2244
+ return "nodeName" in e;
2245
+ }
2246
+ function ii(e) {
2247
+ return ni(e) && e.ownerDocument !== document;
2248
+ }
2249
+ function ai(e) {
2250
+ var t = e.dragLeave, r = t.type, n = t.relatedTarget;
2251
+ return r !== "dragleave" ? !1 : qe() ? ri({
2252
+ dragLeave: t
2253
+ }) : n == null ? !0 : ti() ? ii(n) : n instanceof HTMLIFrameElement;
2254
+ }
2255
+ function oi(e) {
2256
+ var t = e.onDragEnd;
2257
+ return [
2258
+ // ## Detecting drag ending for removed draggables
2259
+ //
2260
+ // If a draggable element is removed during a drag and the user drops:
2261
+ // 1. if over a valid drop target: we get a "drop" event to know the drag is finished
2262
+ // 2. if not over a valid drop target (or cancelled): we get nothing
2263
+ // The "dragend" event will not fire on the source draggable if it has been
2264
+ // removed from the DOM.
2265
+ // So we need to figure out if a drag operation has finished by looking at other events
2266
+ // We can do this by looking at other events
2267
+ // ### First detection: "pointermove" events
2268
+ // 1. "pointermove" events cannot fire during a drag and drop operation
2269
+ // according to the spec. So if we get a "pointermove" it means that
2270
+ // the drag and drop operations has finished. So if we get a "pointermove"
2271
+ // we know that the drag is over
2272
+ // 2. 🦊😤 Drag and drop operations are _supposed_ to suppress
2273
+ // other pointer events. However, firefox will allow a few
2274
+ // pointer event to get through after a drag starts.
2275
+ // The most I've seen is 3
2276
+ {
2277
+ type: "pointermove",
2278
+ listener: /* @__PURE__ */ function() {
2279
+ var r = 0;
2280
+ return function() {
2281
+ if (r < 20) {
2282
+ r++;
2283
+ return;
2284
+ }
2285
+ t();
2286
+ };
2287
+ }()
2288
+ },
2289
+ // ### Second detection: "pointerdown" events
2290
+ // If we receive this event then we know that a drag operation has finished
2291
+ // and potentially another one is about to start.
2292
+ // Note: `pointerdown` fires on all browsers / platforms before "dragstart"
2293
+ {
2294
+ type: "pointerdown",
2295
+ listener: t
2296
+ }
2297
+ ];
2298
+ }
2299
+ function ue(e) {
2300
+ return {
2301
+ altKey: e.altKey,
2302
+ button: e.button,
2303
+ buttons: e.buttons,
2304
+ ctrlKey: e.ctrlKey,
2305
+ metaKey: e.metaKey,
2306
+ shiftKey: e.shiftKey,
2307
+ clientX: e.clientX,
2308
+ clientY: e.clientY,
2309
+ pageX: e.pageX,
2310
+ pageY: e.pageY
2311
+ };
2312
+ }
2313
+ var si = function(t) {
2314
+ var r = [], n = null, i = function() {
2315
+ for (var u = arguments.length, c = new Array(u), s = 0; s < u; s++)
2316
+ c[s] = arguments[s];
2317
+ r = c, !n && (n = requestAnimationFrame(function() {
2318
+ n = null, t.apply(void 0, r);
2319
+ }));
2320
+ };
2321
+ return i.cancel = function() {
2322
+ n && (cancelAnimationFrame(n), n = null);
2323
+ }, i;
2324
+ }, Pe = si(function(e) {
2325
+ return e();
2326
+ }), pe = /* @__PURE__ */ function() {
2327
+ var e = null;
2328
+ function t(n) {
2329
+ var i = requestAnimationFrame(function() {
2330
+ e = null, n();
2331
+ });
2332
+ e = {
2333
+ frameId: i,
2334
+ fn: n
2335
+ };
2336
+ }
2337
+ function r() {
2338
+ e && (cancelAnimationFrame(e.frameId), e.fn(), e = null);
2339
+ }
2340
+ return {
2341
+ schedule: t,
2342
+ flush: r
2343
+ };
2344
+ }();
2345
+ function ui(e) {
2346
+ var t = e.source, r = e.initial, n = e.dispatchEvent, i = {
2347
+ dropTargets: []
2348
+ };
2349
+ function a(c) {
2350
+ n(c), i = {
2351
+ dropTargets: c.payload.location.current.dropTargets
2352
+ };
2353
+ }
2354
+ var u = {
2355
+ start: function(s) {
2356
+ var o = s.nativeSetDragImage, f = {
2357
+ current: r,
2358
+ previous: i,
2359
+ initial: r
2360
+ };
2361
+ a({
2362
+ eventName: "onGenerateDragPreview",
2363
+ payload: {
2364
+ source: t,
2365
+ location: f,
2366
+ nativeSetDragImage: o
2367
+ }
2368
+ }), pe.schedule(function() {
2369
+ a({
2370
+ eventName: "onDragStart",
2371
+ payload: {
2372
+ source: t,
2373
+ location: f
2374
+ }
2375
+ });
2376
+ });
2377
+ },
2378
+ dragUpdate: function(s) {
2379
+ var o = s.current;
2380
+ pe.flush(), Pe.cancel(), a({
2381
+ eventName: "onDropTargetChange",
2382
+ payload: {
2383
+ source: t,
2384
+ location: {
2385
+ initial: r,
2386
+ previous: i,
2387
+ current: o
2388
+ }
2389
+ }
2390
+ });
2391
+ },
2392
+ drag: function(s) {
2393
+ var o = s.current;
2394
+ Pe(function() {
2395
+ pe.flush();
2396
+ var f = {
2397
+ initial: r,
2398
+ previous: i,
2399
+ current: o
2400
+ };
2401
+ a({
2402
+ eventName: "onDrag",
2403
+ payload: {
2404
+ source: t,
2405
+ location: f
2406
+ }
2407
+ });
2408
+ });
2409
+ },
2410
+ drop: function(s) {
2411
+ var o = s.current, f = s.updatedSourcePayload;
2412
+ pe.flush(), Pe.cancel(), a({
2413
+ eventName: "onDrop",
2414
+ payload: {
2415
+ source: f ?? t,
2416
+ location: {
2417
+ current: o,
2418
+ previous: i,
2419
+ initial: r
2420
+ }
2421
+ }
2422
+ });
2423
+ }
2424
+ };
2425
+ return u;
2426
+ }
2427
+ var We = {
2428
+ isActive: !1
2429
+ };
2430
+ function Xt() {
2431
+ return !We.isActive;
2432
+ }
2433
+ function ci(e) {
2434
+ return e.dataTransfer ? e.dataTransfer.setDragImage.bind(e.dataTransfer) : null;
2435
+ }
2436
+ function li(e) {
2437
+ var t = e.current, r = e.next;
2438
+ if (t.length !== r.length)
2439
+ return !0;
2440
+ for (var n = 0; n < t.length; n++)
2441
+ if (t[n].element !== r[n].element)
2442
+ return !0;
2443
+ return !1;
2444
+ }
2445
+ function di(e) {
2446
+ var t = e.event, r = e.dragType, n = e.getDropTargetsOver, i = e.dispatchEvent;
2447
+ if (!Xt())
2448
+ return;
2449
+ var a = fi({
2450
+ event: t,
2451
+ dragType: r,
2452
+ getDropTargetsOver: n
2453
+ });
2454
+ We.isActive = !0;
2455
+ var u = {
2456
+ current: a
2457
+ };
2458
+ Re({
2459
+ event: t,
2460
+ current: a.dropTargets
2461
+ });
2462
+ var c = ui({
2463
+ source: r.payload,
2464
+ dispatchEvent: i,
2465
+ initial: a
2466
+ });
2467
+ function s(h) {
2468
+ var g = li({
2469
+ current: u.current.dropTargets,
2470
+ next: h.dropTargets
2471
+ });
2472
+ u.current = h, g && c.dragUpdate({
2473
+ current: u.current
2474
+ });
2475
+ }
2476
+ function o(h) {
2477
+ var g = ue(h), p = Bt(h.target) ? $t({
2478
+ x: g.clientX,
2479
+ y: g.clientY
2480
+ }) : h.target, m = n({
2481
+ target: p,
2482
+ input: g,
2483
+ source: r.payload,
2484
+ current: u.current.dropTargets
2485
+ });
2486
+ m.length && (h.preventDefault(), Re({
2487
+ event: h,
2488
+ current: m
2489
+ })), s({
2490
+ dropTargets: m,
2491
+ input: g
2492
+ });
2493
+ }
2494
+ function f() {
2495
+ u.current.dropTargets.length && s({
2496
+ dropTargets: [],
2497
+ input: u.current.input
2498
+ }), c.drop({
2499
+ current: u.current,
2500
+ updatedSourcePayload: null
2501
+ }), l();
2502
+ }
2503
+ function l() {
2504
+ We.isActive = !1, d();
2505
+ }
2506
+ var d = te.bindAll(
2507
+ window,
2508
+ [{
2509
+ // 👋 Note: we are repurposing the `dragover` event as our `drag` event
2510
+ // this is because firefox does not publish pointer coordinates during
2511
+ // a `drag` event, but does for every other type of drag event
2512
+ // `dragover` fires on all elements that are being dragged over
2513
+ // Because we are binding to `window` - our `dragover` is effectively the same as a `drag`
2514
+ // 🦊😤
2515
+ type: "dragover",
2516
+ listener: function(g) {
2517
+ o(g), c.drag({
2518
+ current: u.current
2519
+ });
2520
+ }
2521
+ }, {
2522
+ type: "dragenter",
2523
+ listener: o
2524
+ }, {
2525
+ type: "dragleave",
2526
+ listener: function(g) {
2527
+ ai({
2528
+ dragLeave: g
2529
+ }) && (s({
2530
+ input: u.current.input,
2531
+ dropTargets: []
2532
+ }), r.startedFrom === "external" && f());
2533
+ }
2534
+ }, {
2535
+ // A "drop" can only happen if the browser allowed the drop
2536
+ type: "drop",
2537
+ listener: function(g) {
2538
+ if (u.current = {
2539
+ dropTargets: u.current.dropTargets,
2540
+ input: ue(g)
2541
+ }, !u.current.dropTargets.length) {
2542
+ f();
2543
+ return;
2544
+ }
2545
+ g.preventDefault(), Re({
2546
+ event: g,
2547
+ current: u.current.dropTargets
2548
+ }), c.drop({
2549
+ current: u.current,
2550
+ // When dropping something native, we need to extract the latest
2551
+ // `.items` from the "drop" event as it is now accessible
2552
+ updatedSourcePayload: r.type === "external" ? r.getDropPayload(g) : null
2553
+ }), l();
2554
+ }
2555
+ }, {
2556
+ // "dragend" fires when on the drag source (eg a draggable element)
2557
+ // when the drag is finished.
2558
+ // "dragend" will fire after "drop" (if there was a successful drop)
2559
+ // "dragend" does not fire if the draggable source has been removed during the drag
2560
+ // or for external drag sources (eg files)
2561
+ // This "dragend" listener will not fire if there was a successful drop
2562
+ // as we will have already removed the event listener
2563
+ type: "dragend",
2564
+ listener: function(g) {
2565
+ u.current = {
2566
+ dropTargets: u.current.dropTargets,
2567
+ input: ue(g)
2568
+ }, f();
2569
+ }
2570
+ }].concat(qt(oi({
2571
+ onDragEnd: f
2572
+ }))),
2573
+ // Once we have started a managed drag operation it is important that we see / own all drag events
2574
+ // We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)
2575
+ // all "drop" events in the bubble phase on the `document.body`.
2576
+ // This meant that we never saw the "drop" event.
2577
+ {
2578
+ capture: !0
2579
+ }
2580
+ );
2581
+ c.start({
2582
+ nativeSetDragImage: ci(t)
2583
+ });
2584
+ }
2585
+ function Re(e) {
2586
+ var t, r = e.event, n = e.current, i = (t = n[0]) === null || t === void 0 ? void 0 : t.dropEffect;
2587
+ i != null && r.dataTransfer && (r.dataTransfer.dropEffect = i);
2588
+ }
2589
+ function fi(e) {
2590
+ var t = e.event, r = e.dragType, n = e.getDropTargetsOver, i = ue(t);
2591
+ if (r.startedFrom === "external")
2592
+ return {
2593
+ input: i,
2594
+ dropTargets: []
2595
+ };
2596
+ var a = n({
2597
+ input: i,
2598
+ source: r.payload,
2599
+ target: t.target,
2600
+ current: []
2601
+ });
2602
+ return {
2603
+ input: i,
2604
+ dropTargets: a
2605
+ };
2606
+ }
2607
+ var lt = {
2608
+ canStart: Xt,
2609
+ start: di
2610
+ }, Le = /* @__PURE__ */ new Map();
2611
+ function hi(e) {
2612
+ var t = e.typeKey, r = e.mount, n = Le.get(t);
2613
+ if (n)
2614
+ return n.usageCount++, n;
2615
+ var i = {
2616
+ typeKey: t,
2617
+ unmount: r(),
2618
+ usageCount: 1
2619
+ };
2620
+ return Le.set(t, i), i;
2621
+ }
2622
+ function gi(e) {
2623
+ var t = hi(e);
2624
+ return function() {
2625
+ t.usageCount--, !(t.usageCount > 0) && (t.unmount(), Le.delete(e.typeKey));
2626
+ };
2627
+ }
2628
+ function Xe() {
2629
+ for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
2630
+ t[r] = arguments[r];
2631
+ return function() {
2632
+ t.forEach(function(i) {
2633
+ return i();
2634
+ });
2635
+ };
2636
+ }
2637
+ function Ut(e, t) {
2638
+ var r = t.attribute, n = t.value;
2639
+ return e.setAttribute(r, n), function() {
2640
+ return e.removeAttribute(r);
2641
+ };
2642
+ }
2643
+ function dt(e, t) {
2644
+ var r = Object.keys(e);
2645
+ if (Object.getOwnPropertySymbols) {
2646
+ var n = Object.getOwnPropertySymbols(e);
2647
+ t && (n = n.filter(function(i) {
2648
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
2649
+ })), r.push.apply(r, n);
2650
+ }
2651
+ return r;
2652
+ }
2653
+ function F(e) {
2654
+ for (var t = 1; t < arguments.length; t++) {
2655
+ var r = arguments[t] != null ? arguments[t] : {};
2656
+ t % 2 ? dt(Object(r), !0).forEach(function(n) {
2657
+ $e(e, n, r[n]);
2658
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : dt(Object(r)).forEach(function(n) {
2659
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
2660
+ });
2661
+ }
2662
+ return e;
2663
+ }
2664
+ function ke(e, t) {
2665
+ var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
2666
+ if (!r) {
2667
+ if (Array.isArray(e) || (r = pi(e)) || t) {
2668
+ r && (e = r);
2669
+ var n = 0, i = function() {
2670
+ };
2671
+ return { s: i, n: function() {
2672
+ return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
2673
+ }, e: function(o) {
2674
+ throw o;
2675
+ }, f: i };
2676
+ }
2677
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2678
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
2679
+ }
2680
+ var a, u = !0, c = !1;
2681
+ return { s: function() {
2682
+ r = r.call(e);
2683
+ }, n: function() {
2684
+ var o = r.next();
2685
+ return u = o.done, o;
2686
+ }, e: function(o) {
2687
+ c = !0, a = o;
2688
+ }, f: function() {
2689
+ try {
2690
+ u || r.return == null || r.return();
2691
+ } finally {
2692
+ if (c) throw a;
2693
+ }
2694
+ } };
2695
+ }
2696
+ function pi(e, t) {
2697
+ if (e) {
2698
+ if (typeof e == "string") return ft(e, t);
2699
+ var r = {}.toString.call(e).slice(8, -1);
2700
+ return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ft(e, t) : void 0;
2701
+ }
2702
+ }
2703
+ function ft(e, t) {
2704
+ (t == null || t > e.length) && (t = e.length);
2705
+ for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
2706
+ return n;
2707
+ }
2708
+ function Ne(e) {
2709
+ return e.slice(0).reverse();
2710
+ }
2711
+ function mi(e) {
2712
+ var t = e.typeKey, r = e.defaultDropEffect, n = /* @__PURE__ */ new WeakMap(), i = "data-drop-target-for-".concat(t), a = "[".concat(i, "]");
2713
+ function u(h) {
2714
+ return n.set(h.element, h), function() {
2715
+ return n.delete(h.element);
2716
+ };
2717
+ }
2718
+ function c(h) {
2719
+ if (process.env.NODE_ENV !== "production") {
2720
+ var g = n.get(h.element);
2721
+ g && console.warn("You have already registered a [".concat(t, "] dropTarget on the same element"), {
2722
+ existing: g,
2723
+ proposed: h
2724
+ }), h.element instanceof HTMLIFrameElement && console.warn(`
2725
+ We recommend not registering <iframe> elements as drop targets
2726
+ as it can result in some strange browser event ordering.
2727
+ `.replace(/\s{2,}/g, " ").trim());
2728
+ }
2729
+ var p = Xe(Ut(h.element, {
2730
+ attribute: i,
2731
+ value: "true"
2732
+ }), u(h));
2733
+ return ne(p);
2734
+ }
2735
+ function s(h) {
2736
+ var g, p, m, b, O = h.source, x = h.target, w = h.input, M = h.result, S = M === void 0 ? [] : M;
2737
+ if (x == null)
2738
+ return S;
2739
+ if (!(x instanceof Element))
2740
+ return x instanceof Node ? s({
2741
+ source: O,
2742
+ target: x.parentElement,
2743
+ input: w,
2744
+ result: S
2745
+ }) : S;
2746
+ var z = x.closest(a);
2747
+ if (z == null)
2748
+ return S;
2749
+ var E = n.get(z);
2750
+ if (E == null)
2751
+ return S;
2752
+ var y = {
2753
+ input: w,
2754
+ source: O,
2755
+ element: E.element
2756
+ };
2757
+ if (E.canDrop && !E.canDrop(y))
2758
+ return s({
2759
+ source: O,
2760
+ target: E.element.parentElement,
2761
+ input: w,
2762
+ result: S
2763
+ });
2764
+ var D = (g = (p = E.getData) === null || p === void 0 ? void 0 : p.call(E, y)) !== null && g !== void 0 ? g : {}, P = (m = (b = E.getDropEffect) === null || b === void 0 ? void 0 : b.call(E, y)) !== null && m !== void 0 ? m : r, R = {
2765
+ data: D,
2766
+ element: E.element,
2767
+ dropEffect: P,
2768
+ // we are collecting _actual_ drop targets, so these are
2769
+ // being applied _not_ due to stickiness
2770
+ isActiveDueToStickiness: !1
2771
+ };
2772
+ return s({
2773
+ source: O,
2774
+ target: E.element.parentElement,
2775
+ input: w,
2776
+ // Using bubble ordering. Same ordering as `event.getPath()`
2777
+ result: [].concat(qt(S), [R])
2778
+ });
2779
+ }
2780
+ function o(h) {
2781
+ var g = h.eventName, p = h.payload, m = ke(p.location.current.dropTargets), b;
2782
+ try {
2783
+ for (m.s(); !(b = m.n()).done; ) {
2784
+ var O, x = b.value, w = n.get(x.element), M = F(F({}, p), {}, {
2785
+ self: x
2786
+ });
2787
+ w == null || (O = w[g]) === null || O === void 0 || O.call(
2788
+ w,
2789
+ // I cannot seem to get the types right here.
2790
+ // TS doesn't seem to like that one event can need `nativeSetDragImage`
2791
+ // @ts-expect-error
2792
+ M
2793
+ );
2794
+ }
2795
+ } catch (S) {
2796
+ m.e(S);
2797
+ } finally {
2798
+ m.f();
2799
+ }
2800
+ }
2801
+ var f = {
2802
+ onGenerateDragPreview: o,
2803
+ onDrag: o,
2804
+ onDragStart: o,
2805
+ onDrop: o,
2806
+ onDropTargetChange: function(g) {
2807
+ var p = g.payload, m = new Set(p.location.current.dropTargets.map(function(q) {
2808
+ return q.element;
2809
+ })), b = /* @__PURE__ */ new Set(), O = ke(p.location.previous.dropTargets), x;
2810
+ try {
2811
+ for (O.s(); !(x = O.n()).done; ) {
2812
+ var w, M = x.value;
2813
+ b.add(M.element);
2814
+ var S = n.get(M.element), z = m.has(M.element), E = F(F({}, p), {}, {
2815
+ self: M
2816
+ });
2817
+ if (S == null || (w = S.onDropTargetChange) === null || w === void 0 || w.call(S, E), !z) {
2818
+ var y;
2819
+ S == null || (y = S.onDragLeave) === null || y === void 0 || y.call(S, E);
2820
+ }
2821
+ }
2822
+ } catch (q) {
2823
+ O.e(q);
2824
+ } finally {
2825
+ O.f();
2826
+ }
2827
+ var D = ke(p.location.current.dropTargets), P;
2828
+ try {
2829
+ for (D.s(); !(P = D.n()).done; ) {
2830
+ var R, L, $ = P.value;
2831
+ if (!b.has($.element)) {
2832
+ var V = F(F({}, p), {}, {
2833
+ self: $
2834
+ }), A = n.get($.element);
2835
+ A == null || (R = A.onDropTargetChange) === null || R === void 0 || R.call(A, V), A == null || (L = A.onDragEnter) === null || L === void 0 || L.call(A, V);
2836
+ }
2837
+ }
2838
+ } catch (q) {
2839
+ D.e(q);
2840
+ } finally {
2841
+ D.f();
2842
+ }
2843
+ }
2844
+ };
2845
+ function l(h) {
2846
+ f[h.eventName](h);
2847
+ }
2848
+ function d(h) {
2849
+ var g = h.source, p = h.target, m = h.input, b = h.current, O = s({
2850
+ source: g,
2851
+ target: p,
2852
+ input: m
2853
+ });
2854
+ if (O.length >= b.length)
2855
+ return O;
2856
+ for (var x = Ne(b), w = Ne(O), M = [], S = 0; S < x.length; S++) {
2857
+ var z, E = x[S], y = w[S];
2858
+ if (y != null) {
2859
+ M.push(y);
2860
+ continue;
2861
+ }
2862
+ var D = M[S - 1], P = x[S - 1];
2863
+ if ((D == null ? void 0 : D.element) !== (P == null ? void 0 : P.element))
2864
+ break;
2865
+ var R = n.get(E.element);
2866
+ if (!R)
2867
+ break;
2868
+ var L = {
2869
+ input: m,
2870
+ source: g,
2871
+ element: R.element
2872
+ };
2873
+ if (R.canDrop && !R.canDrop(L) || !((z = R.getIsSticky) !== null && z !== void 0 && z.call(R, L)))
2874
+ break;
2875
+ M.push(F(F({}, E), {}, {
2876
+ // making it clear to consumers this drop target is active due to stickiness
2877
+ isActiveDueToStickiness: !0
2878
+ }));
2879
+ }
2880
+ return Ne(M);
2881
+ }
2882
+ return {
2883
+ dropTargetForConsumers: c,
2884
+ getIsOver: d,
2885
+ dispatchEvent: l
2886
+ };
2887
+ }
2888
+ function yi(e, t) {
2889
+ var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
2890
+ if (!r) {
2891
+ if (Array.isArray(e) || (r = vi(e)) || t) {
2892
+ r && (e = r);
2893
+ var n = 0, i = function() {
2894
+ };
2895
+ return { s: i, n: function() {
2896
+ return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
2897
+ }, e: function(o) {
2898
+ throw o;
2899
+ }, f: i };
2900
+ }
2901
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2902
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
2903
+ }
2904
+ var a, u = !0, c = !1;
2905
+ return { s: function() {
2906
+ r = r.call(e);
2907
+ }, n: function() {
2908
+ var o = r.next();
2909
+ return u = o.done, o;
2910
+ }, e: function(o) {
2911
+ c = !0, a = o;
2912
+ }, f: function() {
2913
+ try {
2914
+ u || r.return == null || r.return();
2915
+ } finally {
2916
+ if (c) throw a;
2917
+ }
2918
+ } };
2919
+ }
2920
+ function vi(e, t) {
2921
+ if (e) {
2922
+ if (typeof e == "string") return ht(e, t);
2923
+ var r = {}.toString.call(e).slice(8, -1);
2924
+ return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ht(e, t) : void 0;
2925
+ }
2926
+ }
2927
+ function ht(e, t) {
2928
+ (t == null || t > e.length) && (t = e.length);
2929
+ for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
2930
+ return n;
2931
+ }
2932
+ function gt(e, t) {
2933
+ var r = Object.keys(e);
2934
+ if (Object.getOwnPropertySymbols) {
2935
+ var n = Object.getOwnPropertySymbols(e);
2936
+ t && (n = n.filter(function(i) {
2937
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
2938
+ })), r.push.apply(r, n);
2939
+ }
2940
+ return r;
2941
+ }
2942
+ function bi(e) {
2943
+ for (var t = 1; t < arguments.length; t++) {
2944
+ var r = arguments[t] != null ? arguments[t] : {};
2945
+ t % 2 ? gt(Object(r), !0).forEach(function(n) {
2946
+ $e(e, n, r[n]);
2947
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : gt(Object(r)).forEach(function(n) {
2948
+ Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
2949
+ });
2950
+ }
2951
+ return e;
2952
+ }
2953
+ function wi() {
2954
+ var e = /* @__PURE__ */ new Set(), t = null;
2955
+ function r(a) {
2956
+ t && (!a.canMonitor || a.canMonitor(t.canMonitorArgs)) && t.active.add(a);
2957
+ }
2958
+ function n(a) {
2959
+ var u = bi({}, a);
2960
+ e.add(u), r(u);
2961
+ function c() {
2962
+ e.delete(u), t && t.active.delete(u);
2963
+ }
2964
+ return ne(c);
2965
+ }
2966
+ function i(a) {
2967
+ var u = a.eventName, c = a.payload;
2968
+ if (u === "onGenerateDragPreview") {
2969
+ t = {
2970
+ canMonitorArgs: {
2971
+ initial: c.location.initial,
2972
+ source: c.source
2973
+ },
2974
+ active: /* @__PURE__ */ new Set()
2975
+ };
2976
+ var s = yi(e), o;
2977
+ try {
2978
+ for (s.s(); !(o = s.n()).done; ) {
2979
+ var f = o.value;
2980
+ r(f);
2981
+ }
2982
+ } catch (m) {
2983
+ s.e(m);
2984
+ } finally {
2985
+ s.f();
2986
+ }
2987
+ }
2988
+ if (t) {
2989
+ for (var l = Array.from(t.active), d = 0, h = l; d < h.length; d++) {
2990
+ var g = h[d];
2991
+ if (t.active.has(g)) {
2992
+ var p;
2993
+ (p = g[u]) === null || p === void 0 || p.call(g, c);
2994
+ }
2995
+ }
2996
+ u === "onDrop" && (t.active.clear(), t = null);
2997
+ }
2998
+ }
2999
+ return {
3000
+ dispatchEvent: i,
3001
+ monitorForConsumers: n
3002
+ };
3003
+ }
3004
+ function xi(e) {
3005
+ var t = e.typeKey, r = e.mount, n = e.dispatchEventToSource, i = e.onPostDispatch, a = e.defaultDropEffect, u = wi(), c = mi({
3006
+ typeKey: t,
3007
+ defaultDropEffect: a
3008
+ });
3009
+ function s(l) {
3010
+ n == null || n(l), c.dispatchEvent(l), u.dispatchEvent(l), i == null || i(l);
3011
+ }
3012
+ function o(l) {
3013
+ var d = l.event, h = l.dragType;
3014
+ lt.start({
3015
+ event: d,
3016
+ dragType: h,
3017
+ getDropTargetsOver: c.getIsOver,
3018
+ dispatchEvent: s
3019
+ });
3020
+ }
3021
+ function f() {
3022
+ function l() {
3023
+ var d = {
3024
+ canStart: lt.canStart,
3025
+ start: o
3026
+ };
3027
+ return r(d);
3028
+ }
3029
+ return gi({
3030
+ typeKey: t,
3031
+ mount: l
3032
+ });
3033
+ }
3034
+ return {
3035
+ registerUsage: f,
3036
+ dropTarget: c.dropTargetForConsumers,
3037
+ monitor: u.monitorForConsumers
3038
+ };
3039
+ }
3040
+ var Si = ne(function() {
3041
+ return navigator.userAgent.toLocaleLowerCase().includes("android");
3042
+ }), Oi = "pdnd:android-fallback", pt = "text/plain", Di = "text/uri-list", Ti = "application/vnd.pdnd", he = /* @__PURE__ */ new WeakMap();
3043
+ function Mi(e) {
3044
+ return he.set(e.element, e), function() {
3045
+ he.delete(e.element);
3046
+ };
3047
+ }
3048
+ var mt = Qn(), Ue = xi({
3049
+ typeKey: "element",
3050
+ defaultDropEffect: "move",
3051
+ mount: function(t) {
3052
+ return Xe(mt.bindEvents(), te.bind(document, {
3053
+ type: "dragstart",
3054
+ listener: function(n) {
3055
+ var i, a, u, c, s, o;
3056
+ if (t.canStart(n) && !n.defaultPrevented) {
3057
+ if (!n.dataTransfer) {
3058
+ process.env.NODE_ENV !== "production" && console.warn(`
3059
+ It appears as though you have are not testing DragEvents correctly.
3060
+
3061
+ - If you are unit testing, ensure you have polyfilled DragEvent.
3062
+ - If you are browser testing, ensure you are dispatching drag events correctly.
3063
+
3064
+ Please see our testing guides for more information:
3065
+ https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
3066
+ `.replace(/ {2}/g, ""));
3067
+ return;
3068
+ }
3069
+ var f = n.target;
3070
+ if (!(f instanceof HTMLElement))
3071
+ return null;
3072
+ var l = he.get(f);
3073
+ if (!l)
3074
+ return null;
3075
+ var d = ue(n), h = {
3076
+ element: l.element,
3077
+ dragHandle: (i = l.dragHandle) !== null && i !== void 0 ? i : null,
3078
+ input: d
3079
+ };
3080
+ if (l.canDrag && !l.canDrag(h))
3081
+ return n.preventDefault(), null;
3082
+ if (l.dragHandle) {
3083
+ var g = $t({
3084
+ x: d.clientX,
3085
+ y: d.clientY
3086
+ });
3087
+ if (!l.dragHandle.contains(g))
3088
+ return n.preventDefault(), null;
3089
+ }
3090
+ var p = (a = (u = l.getInitialDataForExternal) === null || u === void 0 ? void 0 : u.call(l, h)) !== null && a !== void 0 ? a : null;
3091
+ if (p)
3092
+ for (var m = 0, b = Object.entries(p); m < b.length; m++) {
3093
+ var O = jt(b[m], 2), x = O[0], w = O[1];
3094
+ n.dataTransfer.setData(x, w ?? "");
3095
+ }
3096
+ Si() && !n.dataTransfer.types.includes(pt) && !n.dataTransfer.types.includes(Di) && n.dataTransfer.setData(pt, Oi), n.dataTransfer.setData(Ti, "");
3097
+ var M = {
3098
+ element: l.element,
3099
+ dragHandle: (c = l.dragHandle) !== null && c !== void 0 ? c : null,
3100
+ data: (s = (o = l.getInitialData) === null || o === void 0 ? void 0 : o.call(l, h)) !== null && s !== void 0 ? s : {}
3101
+ }, S = {
3102
+ type: "element",
3103
+ payload: M,
3104
+ startedFrom: "internal"
3105
+ };
3106
+ t.start({
3107
+ event: n,
3108
+ dragType: S
3109
+ });
3110
+ }
3111
+ }
3112
+ }));
3113
+ },
3114
+ dispatchEventToSource: function(t) {
3115
+ var r, n, i = t.eventName, a = t.payload;
3116
+ (r = he.get(a.source.element)) === null || r === void 0 || (n = r[i]) === null || n === void 0 || n.call(
3117
+ r,
3118
+ // I cannot seem to get the types right here.
3119
+ // TS doesn't seem to like that one event can need `nativeSetDragImage`
3120
+ // @ts-expect-error
3121
+ a
3122
+ );
3123
+ },
3124
+ onPostDispatch: mt.getOnPostDispatch()
3125
+ }), Ei = Ue.dropTarget, Pi = Ue.monitor;
3126
+ function Ri(e) {
3127
+ if (process.env.NODE_ENV !== "production" && e.dragHandle && !e.element.contains(e.dragHandle) && console.warn("Drag handle element must be contained in draggable element", {
3128
+ element: e.element,
3129
+ dragHandle: e.dragHandle
3130
+ }), process.env.NODE_ENV !== "production") {
3131
+ var t = he.get(e.element);
3132
+ t && console.warn("You have already registered a `draggable` on the same element", {
3133
+ existing: t,
3134
+ proposed: e
3135
+ });
3136
+ }
3137
+ var r = Xe(
3138
+ // making the draggable register the adapter rather than drop targets
3139
+ // this is because you *must* have a draggable element to start a drag
3140
+ // but you _might_ not have any drop targets immediately
3141
+ // (You might create drop targets async)
3142
+ Ue.registerUsage(),
3143
+ Mi(e),
3144
+ Ut(e.element, {
3145
+ attribute: "draggable",
3146
+ value: "true"
3147
+ })
3148
+ );
3149
+ return ne(r);
3150
+ }
3151
+ var ki = process.env.NODE_ENV === "production", yt = "Invariant failed";
3152
+ function He(e, t) {
3153
+ if (!e) {
3154
+ if (ki)
3155
+ throw new Error(yt);
3156
+ var r = yt;
3157
+ throw new Error(r);
3158
+ }
3159
+ }
3160
+ function Ni({
3161
+ children: e,
3162
+ onDragStart: t = () => {
3163
+ },
3164
+ onDrag: r = () => {
3165
+ },
3166
+ onDrop: n = () => {
3167
+ },
3168
+ onDragEnter: i = () => {
3169
+ },
3170
+ onDragLeave: a = () => {
3171
+ }
3172
+ }) {
3173
+ const u = ce(null);
3174
+ return ee(() => {
3175
+ const c = u.current;
3176
+ return He(c), Ei({
3177
+ element: c,
3178
+ getData: () => ({ drop: "drop" }),
3179
+ onDragStart: ({ source: s, location: o }) => {
3180
+ const f = me(o), l = Z(s, o);
3181
+ t(f, l, s.data);
3182
+ },
3183
+ onDragEnter: ({ source: s, location: o }) => {
3184
+ const f = me(o), l = Z(s, o);
3185
+ i(f, l, s.data);
3186
+ },
3187
+ onDrag: ({ source: s, location: o }) => {
3188
+ const f = me(o), l = Z(s, o);
3189
+ r(f, l, s.data);
3190
+ },
3191
+ onDrop: ({ source: s, location: o }) => {
3192
+ const f = me(o), l = Z(s, o);
3193
+ n(f, l, s.data);
3194
+ },
3195
+ onDragLeave: ({ source: s, location: o }) => {
3196
+ const f = Z(s, o);
3197
+ a(f, s.data);
3198
+ }
3199
+ });
3200
+ }, [r, a, t, n, i]), /* @__PURE__ */ v("div", { className: "timeline-drop-target", ref: u, children: e });
3201
+ }
3202
+ function me(e) {
3203
+ const t = e.current.dropTargets[0].element.getBoundingClientRect();
3204
+ return {
3205
+ x: e.current.input.pageX - t.x,
3206
+ y: e.current.input.pageY - t.y
3207
+ };
3208
+ }
3209
+ function Ai({
3210
+ x: e,
3211
+ y: t,
3212
+ width: r,
3213
+ height: n,
3214
+ children: i
3215
+ }) {
3216
+ return /* @__PURE__ */ v(
3217
+ "div",
3218
+ {
3219
+ className: "timeline-drop-preview",
3220
+ style: {
3221
+ left: `${e}px`,
3222
+ top: `${t}px`,
3223
+ width: `${r}px`,
3224
+ height: `${n}px`
3225
+ },
3226
+ children: i
3227
+ }
3228
+ );
3229
+ }
3230
+ function zi(e, t, r, n, i, a, u, c, s) {
3231
+ if (n === null)
3232
+ return null;
3233
+ const o = Ye(
3234
+ e,
3235
+ a,
3236
+ c
3237
+ ), f = t.filter((d) => d.id !== r.id).map((d) => Fe(d, e, c, a));
3238
+ let l = null;
3239
+ return l = Ci(
3240
+ e,
3241
+ r,
3242
+ i,
3243
+ a,
3244
+ n
3245
+ ), l = Wi(l, u), l = _i(
3246
+ l,
3247
+ o
3248
+ ), l = Li(
3249
+ l,
3250
+ f,
3251
+ o,
3252
+ s
3253
+ ), l;
3254
+ }
3255
+ function Ci(e, t, r, n, i) {
3256
+ const { width: a, height: u } = Lt(t, e, n), c = i.x + a * r.relative.x, s = i.y + u * r.relative.y;
3257
+ return {
3258
+ x: c,
3259
+ y: s,
3260
+ width: a,
3261
+ height: u
3262
+ };
3263
+ }
3264
+ function _i(e, t) {
3265
+ const r = Math.max(
3266
+ 0,
3267
+ Math.min(e.x, t.width - e.width)
3268
+ ), n = Math.max(
3269
+ 0,
3270
+ Math.min(e.y, t.height - e.height)
3271
+ );
3272
+ return {
3273
+ ...e,
3274
+ x: r,
3275
+ y: n
3276
+ };
3277
+ }
3278
+ function Wi(e, t) {
3279
+ const r = {
3280
+ ...e
3281
+ };
3282
+ return t && t.x && (r.x = vt(r.x, t.x, t.offsetX || 0)), t && t.y && (r.y = vt(r.y, t.y, t.offsetY || 0)), r;
3283
+ }
3284
+ function vt(e, t, r) {
3285
+ return Math.max(
3286
+ r,
3287
+ r + Math.round((e - r) / t) * t
3288
+ );
3289
+ }
3290
+ function Li(e, t, r, n) {
3291
+ const i = {
3292
+ ...e
3293
+ };
3294
+ if (!n) {
3295
+ let a = !0;
3296
+ for (; a; ) {
3297
+ const u = t.find((c) => se(i, c));
3298
+ u !== void 0 ? i.y = u.y + u.height : a = !1;
3299
+ }
3300
+ }
3301
+ return ji(i, r) ? i : null;
3302
+ }
3303
+ function se(e, t) {
3304
+ return !(e.x >= t.x + t.width || t.x >= e.x + e.width || e.y >= t.y + t.height || t.y >= e.y + e.height);
3305
+ }
3306
+ function Hi(e, t) {
3307
+ const r = Math.max(e.x, t.x), n = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height);
3308
+ return r < i && n < a ? {
3309
+ x: r,
3310
+ y: n,
3311
+ width: i - r,
3312
+ height: a - n
3313
+ } : null;
3314
+ }
3315
+ function Ii(e, t) {
3316
+ return !(e.start >= t.end || t.start >= e.end || e.offset >= t.offset + t.size || t.offset >= e.offset + e.size);
3317
+ }
3318
+ function ji(e, t) {
3319
+ return e.x >= 0 && e.y >= 0 && e.x + e.width <= t.width && e.y + e.height <= t.height;
3320
+ }
3321
+ function Yi(e, t, r, n, i) {
3322
+ const a = Fi(
3323
+ e,
3324
+ t,
3325
+ r.capacity,
3326
+ n
3327
+ );
3328
+ if (a) {
3329
+ const u = Bi(
3330
+ e,
3331
+ i.start,
3332
+ i.end,
3333
+ n,
3334
+ a
3335
+ );
3336
+ if (u)
3337
+ return {
3338
+ start: u.lower,
3339
+ end: u.upper,
3340
+ minOffset: a.lower,
3341
+ maxOffset: a.upper
3342
+ };
3343
+ }
3344
+ return null;
3345
+ }
3346
+ function Fi(e, t, r, n) {
3347
+ const i = n.filter((f) => f.start <= e && f.end >= e);
3348
+ if (i.find(
3349
+ (f) => f.offset <= t && f.offset + f.size >= t
3350
+ ))
3351
+ return null;
3352
+ const u = i.filter((f) => f.offset + f.size <= t), c = i.filter((f) => f.offset >= t), s = u.length > 0 ? Math.max(...u.map((f) => f.offset + f.size)) : 0, o = c.length > 0 ? Math.min(...c.map((f) => f.offset)) : r;
3353
+ return {
3354
+ lower: s,
3355
+ upper: o
3356
+ };
3357
+ }
3358
+ function Bi(e, t, r, n, i) {
3359
+ const a = {
3360
+ start: t,
3361
+ end: r,
3362
+ offset: i.lower,
3363
+ size: i.upper - i.lower
3364
+ }, u = n.filter(
3365
+ (l) => Ii(l, a)
3366
+ );
3367
+ if (u.length === 0)
3368
+ return {
3369
+ lower: t,
3370
+ upper: r
3371
+ };
3372
+ const c = u.filter((l) => l.end <= e), s = u.filter((l) => l.start >= e), o = c.length > 0 ? pr(c.map((l) => l.end)) : t, f = s.length > 0 ? mr(s.map((l) => l.start)) : r;
3373
+ return {
3374
+ lower: o,
3375
+ upper: f
3376
+ };
3377
+ }
3378
+ var ye = { exports: {} }, C = {};
3379
+ /**
3380
+ * @license React
3381
+ * react-dom.production.js
3382
+ *
3383
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3384
+ *
3385
+ * This source code is licensed under the MIT license found in the
3386
+ * LICENSE file in the root directory of this source tree.
3387
+ */
3388
+ var bt;
3389
+ function $i() {
3390
+ if (bt) return C;
3391
+ bt = 1;
3392
+ var e = Rt;
3393
+ function t(s) {
3394
+ var o = "https://react.dev/errors/" + s;
3395
+ if (1 < arguments.length) {
3396
+ o += "?args[]=" + encodeURIComponent(arguments[1]);
3397
+ for (var f = 2; f < arguments.length; f++)
3398
+ o += "&args[]=" + encodeURIComponent(arguments[f]);
3399
+ }
3400
+ return "Minified React error #" + s + "; visit " + o + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
3401
+ }
3402
+ function r() {
3403
+ }
3404
+ var n = {
3405
+ d: {
3406
+ f: r,
3407
+ r: function() {
3408
+ throw Error(t(522));
3409
+ },
3410
+ D: r,
3411
+ C: r,
3412
+ L: r,
3413
+ m: r,
3414
+ X: r,
3415
+ S: r,
3416
+ M: r
3417
+ },
3418
+ p: 0,
3419
+ findDOMNode: null
3420
+ }, i = Symbol.for("react.portal");
3421
+ function a(s, o, f) {
3422
+ var l = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
3423
+ return {
3424
+ $$typeof: i,
3425
+ key: l == null ? null : "" + l,
3426
+ children: s,
3427
+ containerInfo: o,
3428
+ implementation: f
3429
+ };
3430
+ }
3431
+ var u = e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
3432
+ function c(s, o) {
3433
+ if (s === "font") return "";
3434
+ if (typeof o == "string")
3435
+ return o === "use-credentials" ? o : "";
3436
+ }
3437
+ return C.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = n, C.createPortal = function(s, o) {
3438
+ var f = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
3439
+ if (!o || o.nodeType !== 1 && o.nodeType !== 9 && o.nodeType !== 11)
3440
+ throw Error(t(299));
3441
+ return a(s, o, null, f);
3442
+ }, C.flushSync = function(s) {
3443
+ var o = u.T, f = n.p;
3444
+ try {
3445
+ if (u.T = null, n.p = 2, s) return s();
3446
+ } finally {
3447
+ u.T = o, n.p = f, n.d.f();
3448
+ }
3449
+ }, C.preconnect = function(s, o) {
3450
+ typeof s == "string" && (o ? (o = o.crossOrigin, o = typeof o == "string" ? o === "use-credentials" ? o : "" : void 0) : o = null, n.d.C(s, o));
3451
+ }, C.prefetchDNS = function(s) {
3452
+ typeof s == "string" && n.d.D(s);
3453
+ }, C.preinit = function(s, o) {
3454
+ if (typeof s == "string" && o && typeof o.as == "string") {
3455
+ var f = o.as, l = c(f, o.crossOrigin), d = typeof o.integrity == "string" ? o.integrity : void 0, h = typeof o.fetchPriority == "string" ? o.fetchPriority : void 0;
3456
+ f === "style" ? n.d.S(
3457
+ s,
3458
+ typeof o.precedence == "string" ? o.precedence : void 0,
3459
+ {
3460
+ crossOrigin: l,
3461
+ integrity: d,
3462
+ fetchPriority: h
3463
+ }
3464
+ ) : f === "script" && n.d.X(s, {
3465
+ crossOrigin: l,
3466
+ integrity: d,
3467
+ fetchPriority: h,
3468
+ nonce: typeof o.nonce == "string" ? o.nonce : void 0
3469
+ });
3470
+ }
3471
+ }, C.preinitModule = function(s, o) {
3472
+ if (typeof s == "string")
3473
+ if (typeof o == "object" && o !== null) {
3474
+ if (o.as == null || o.as === "script") {
3475
+ var f = c(
3476
+ o.as,
3477
+ o.crossOrigin
3478
+ );
3479
+ n.d.M(s, {
3480
+ crossOrigin: f,
3481
+ integrity: typeof o.integrity == "string" ? o.integrity : void 0,
3482
+ nonce: typeof o.nonce == "string" ? o.nonce : void 0
3483
+ });
3484
+ }
3485
+ } else o == null && n.d.M(s);
3486
+ }, C.preload = function(s, o) {
3487
+ if (typeof s == "string" && typeof o == "object" && o !== null && typeof o.as == "string") {
3488
+ var f = o.as, l = c(f, o.crossOrigin);
3489
+ n.d.L(s, f, {
3490
+ crossOrigin: l,
3491
+ integrity: typeof o.integrity == "string" ? o.integrity : void 0,
3492
+ nonce: typeof o.nonce == "string" ? o.nonce : void 0,
3493
+ type: typeof o.type == "string" ? o.type : void 0,
3494
+ fetchPriority: typeof o.fetchPriority == "string" ? o.fetchPriority : void 0,
3495
+ referrerPolicy: typeof o.referrerPolicy == "string" ? o.referrerPolicy : void 0,
3496
+ imageSrcSet: typeof o.imageSrcSet == "string" ? o.imageSrcSet : void 0,
3497
+ imageSizes: typeof o.imageSizes == "string" ? o.imageSizes : void 0,
3498
+ media: typeof o.media == "string" ? o.media : void 0
3499
+ });
3500
+ }
3501
+ }, C.preloadModule = function(s, o) {
3502
+ if (typeof s == "string")
3503
+ if (o) {
3504
+ var f = c(o.as, o.crossOrigin);
3505
+ n.d.m(s, {
3506
+ as: typeof o.as == "string" && o.as !== "script" ? o.as : void 0,
3507
+ crossOrigin: f,
3508
+ integrity: typeof o.integrity == "string" ? o.integrity : void 0
3509
+ });
3510
+ } else n.d.m(s);
3511
+ }, C.requestFormReset = function(s) {
3512
+ n.d.r(s);
3513
+ }, C.unstable_batchedUpdates = function(s, o) {
3514
+ return s(o);
3515
+ }, C.useFormState = function(s, o, f) {
3516
+ return u.H.useFormState(s, o, f);
3517
+ }, C.useFormStatus = function() {
3518
+ return u.H.useHostTransitionStatus();
3519
+ }, C.version = "19.1.0", C;
3520
+ }
3521
+ var _ = {};
3522
+ /**
3523
+ * @license React
3524
+ * react-dom.development.js
3525
+ *
3526
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3527
+ *
3528
+ * This source code is licensed under the MIT license found in the
3529
+ * LICENSE file in the root directory of this source tree.
3530
+ */
3531
+ var wt;
3532
+ function qi() {
3533
+ return wt || (wt = 1, process.env.NODE_ENV !== "production" && function() {
3534
+ function e() {
3535
+ }
3536
+ function t(l) {
3537
+ return "" + l;
3538
+ }
3539
+ function r(l, d, h) {
3540
+ var g = 3 < arguments.length && arguments[3] !== void 0 ? arguments[3] : null;
3541
+ try {
3542
+ t(g);
3543
+ var p = !1;
3544
+ } catch {
3545
+ p = !0;
3546
+ }
3547
+ return p && (console.error(
3548
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
3549
+ typeof Symbol == "function" && Symbol.toStringTag && g[Symbol.toStringTag] || g.constructor.name || "Object"
3550
+ ), t(g)), {
3551
+ $$typeof: o,
3552
+ key: g == null ? null : "" + g,
3553
+ children: l,
3554
+ containerInfo: d,
3555
+ implementation: h
3556
+ };
3557
+ }
3558
+ function n(l, d) {
3559
+ if (l === "font") return "";
3560
+ if (typeof d == "string")
3561
+ return d === "use-credentials" ? d : "";
3562
+ }
3563
+ function i(l) {
3564
+ return l === null ? "`null`" : l === void 0 ? "`undefined`" : l === "" ? "an empty string" : 'something with type "' + typeof l + '"';
3565
+ }
3566
+ function a(l) {
3567
+ return l === null ? "`null`" : l === void 0 ? "`undefined`" : l === "" ? "an empty string" : typeof l == "string" ? JSON.stringify(l) : typeof l == "number" ? "`" + l + "`" : 'something with type "' + typeof l + '"';
3568
+ }
3569
+ function u() {
3570
+ var l = f.H;
3571
+ return l === null && console.error(
3572
+ `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:
3573
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
3574
+ 2. You might be breaking the Rules of Hooks
3575
+ 3. You might have more than one copy of React in the same app
3576
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
3577
+ ), l;
3578
+ }
3579
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
3580
+ var c = Rt, s = {
3581
+ d: {
3582
+ f: e,
3583
+ r: function() {
3584
+ throw Error(
3585
+ "Invalid form element. requestFormReset must be passed a form that was rendered by React."
3586
+ );
3587
+ },
3588
+ D: e,
3589
+ C: e,
3590
+ L: e,
3591
+ m: e,
3592
+ X: e,
3593
+ S: e,
3594
+ M: e
3595
+ },
3596
+ p: 0,
3597
+ findDOMNode: null
3598
+ }, o = Symbol.for("react.portal"), f = c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
3599
+ typeof Map == "function" && Map.prototype != null && typeof Map.prototype.forEach == "function" && typeof Set == "function" && Set.prototype != null && typeof Set.prototype.clear == "function" && typeof Set.prototype.forEach == "function" || console.error(
3600
+ "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
3601
+ ), _.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = s, _.createPortal = function(l, d) {
3602
+ var h = 2 < arguments.length && arguments[2] !== void 0 ? arguments[2] : null;
3603
+ if (!d || d.nodeType !== 1 && d.nodeType !== 9 && d.nodeType !== 11)
3604
+ throw Error("Target container is not a DOM element.");
3605
+ return r(l, d, null, h);
3606
+ }, _.flushSync = function(l) {
3607
+ var d = f.T, h = s.p;
3608
+ try {
3609
+ if (f.T = null, s.p = 2, l)
3610
+ return l();
3611
+ } finally {
3612
+ f.T = d, s.p = h, s.d.f() && console.error(
3613
+ "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
3614
+ );
3615
+ }
3616
+ }, _.preconnect = function(l, d) {
3617
+ typeof l == "string" && l ? d != null && typeof d != "object" ? console.error(
3618
+ "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
3619
+ a(d)
3620
+ ) : d != null && typeof d.crossOrigin != "string" && console.error(
3621
+ "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
3622
+ i(d.crossOrigin)
3623
+ ) : console.error(
3624
+ "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
3625
+ i(l)
3626
+ ), typeof l == "string" && (d ? (d = d.crossOrigin, d = typeof d == "string" ? d === "use-credentials" ? d : "" : void 0) : d = null, s.d.C(l, d));
3627
+ }, _.prefetchDNS = function(l) {
3628
+ if (typeof l != "string" || !l)
3629
+ console.error(
3630
+ "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
3631
+ i(l)
3632
+ );
3633
+ else if (1 < arguments.length) {
3634
+ var d = arguments[1];
3635
+ typeof d == "object" && d.hasOwnProperty("crossOrigin") ? console.error(
3636
+ "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
3637
+ a(d)
3638
+ ) : console.error(
3639
+ "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
3640
+ a(d)
3641
+ );
3642
+ }
3643
+ typeof l == "string" && s.d.D(l);
3644
+ }, _.preinit = function(l, d) {
3645
+ if (typeof l == "string" && l ? d == null || typeof d != "object" ? console.error(
3646
+ "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
3647
+ a(d)
3648
+ ) : d.as !== "style" && d.as !== "script" && console.error(
3649
+ 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
3650
+ a(d.as)
3651
+ ) : console.error(
3652
+ "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
3653
+ i(l)
3654
+ ), typeof l == "string" && d && typeof d.as == "string") {
3655
+ var h = d.as, g = n(h, d.crossOrigin), p = typeof d.integrity == "string" ? d.integrity : void 0, m = typeof d.fetchPriority == "string" ? d.fetchPriority : void 0;
3656
+ h === "style" ? s.d.S(
3657
+ l,
3658
+ typeof d.precedence == "string" ? d.precedence : void 0,
3659
+ {
3660
+ crossOrigin: g,
3661
+ integrity: p,
3662
+ fetchPriority: m
3663
+ }
3664
+ ) : h === "script" && s.d.X(l, {
3665
+ crossOrigin: g,
3666
+ integrity: p,
3667
+ fetchPriority: m,
3668
+ nonce: typeof d.nonce == "string" ? d.nonce : void 0
3669
+ });
3670
+ }
3671
+ }, _.preinitModule = function(l, d) {
3672
+ var h = "";
3673
+ if (typeof l == "string" && l || (h += " The `href` argument encountered was " + i(l) + "."), d !== void 0 && typeof d != "object" ? h += " The `options` argument encountered was " + i(d) + "." : d && "as" in d && d.as !== "script" && (h += " The `as` option encountered was " + a(d.as) + "."), h)
3674
+ console.error(
3675
+ "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
3676
+ h
3677
+ );
3678
+ else
3679
+ switch (h = d && typeof d.as == "string" ? d.as : "script", h) {
3680
+ case "script":
3681
+ break;
3682
+ default:
3683
+ h = a(h), console.error(
3684
+ 'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
3685
+ h,
3686
+ l
3687
+ );
3688
+ }
3689
+ typeof l == "string" && (typeof d == "object" && d !== null ? (d.as == null || d.as === "script") && (h = n(
3690
+ d.as,
3691
+ d.crossOrigin
3692
+ ), s.d.M(l, {
3693
+ crossOrigin: h,
3694
+ integrity: typeof d.integrity == "string" ? d.integrity : void 0,
3695
+ nonce: typeof d.nonce == "string" ? d.nonce : void 0
3696
+ })) : d == null && s.d.M(l));
3697
+ }, _.preload = function(l, d) {
3698
+ var h = "";
3699
+ if (typeof l == "string" && l || (h += " The `href` argument encountered was " + i(l) + "."), d == null || typeof d != "object" ? h += " The `options` argument encountered was " + i(d) + "." : typeof d.as == "string" && d.as || (h += " The `as` option encountered was " + i(d.as) + "."), h && console.error(
3700
+ 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
3701
+ h
3702
+ ), typeof l == "string" && typeof d == "object" && d !== null && typeof d.as == "string") {
3703
+ h = d.as;
3704
+ var g = n(
3705
+ h,
3706
+ d.crossOrigin
3707
+ );
3708
+ s.d.L(l, h, {
3709
+ crossOrigin: g,
3710
+ integrity: typeof d.integrity == "string" ? d.integrity : void 0,
3711
+ nonce: typeof d.nonce == "string" ? d.nonce : void 0,
3712
+ type: typeof d.type == "string" ? d.type : void 0,
3713
+ fetchPriority: typeof d.fetchPriority == "string" ? d.fetchPriority : void 0,
3714
+ referrerPolicy: typeof d.referrerPolicy == "string" ? d.referrerPolicy : void 0,
3715
+ imageSrcSet: typeof d.imageSrcSet == "string" ? d.imageSrcSet : void 0,
3716
+ imageSizes: typeof d.imageSizes == "string" ? d.imageSizes : void 0,
3717
+ media: typeof d.media == "string" ? d.media : void 0
3718
+ });
3719
+ }
3720
+ }, _.preloadModule = function(l, d) {
3721
+ var h = "";
3722
+ typeof l == "string" && l || (h += " The `href` argument encountered was " + i(l) + "."), d !== void 0 && typeof d != "object" ? h += " The `options` argument encountered was " + i(d) + "." : d && "as" in d && typeof d.as != "string" && (h += " The `as` option encountered was " + i(d.as) + "."), h && console.error(
3723
+ 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
3724
+ h
3725
+ ), typeof l == "string" && (d ? (h = n(
3726
+ d.as,
3727
+ d.crossOrigin
3728
+ ), s.d.m(l, {
3729
+ as: typeof d.as == "string" && d.as !== "script" ? d.as : void 0,
3730
+ crossOrigin: h,
3731
+ integrity: typeof d.integrity == "string" ? d.integrity : void 0
3732
+ })) : s.d.m(l));
3733
+ }, _.requestFormReset = function(l) {
3734
+ s.d.r(l);
3735
+ }, _.unstable_batchedUpdates = function(l, d) {
3736
+ return l(d);
3737
+ }, _.useFormState = function(l, d, h) {
3738
+ return u().useFormState(l, d, h);
3739
+ }, _.useFormStatus = function() {
3740
+ return u().useHostTransitionStatus();
3741
+ }, _.version = "19.1.0", typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
3742
+ }()), _;
3743
+ }
3744
+ var xt;
3745
+ function Xi() {
3746
+ if (xt) return ye.exports;
3747
+ xt = 1;
3748
+ function e() {
3749
+ if (!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ > "u" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE != "function")) {
3750
+ if (process.env.NODE_ENV !== "production")
3751
+ throw new Error("^_^");
3752
+ try {
3753
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e);
3754
+ } catch (t) {
3755
+ console.error(t);
3756
+ }
3757
+ }
3758
+ }
3759
+ return process.env.NODE_ENV === "production" ? (e(), ye.exports = $i()) : ye.exports = qi(), ye.exports;
3760
+ }
3761
+ var Ui = Xi(), k = function() {
3762
+ return k = Object.assign || function(e) {
3763
+ for (var t, r = 1, n = arguments.length; r < n; r++) {
3764
+ t = arguments[r];
3765
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
3766
+ }
3767
+ return e;
3768
+ }, k.apply(this, arguments);
3769
+ }, St = {
3770
+ width: "100%",
3771
+ height: "10px",
3772
+ top: "0px",
3773
+ left: "0px",
3774
+ cursor: "row-resize"
3775
+ }, Ot = {
3776
+ width: "10px",
3777
+ height: "100%",
3778
+ top: "0px",
3779
+ left: "0px",
3780
+ cursor: "col-resize"
3781
+ }, ve = {
3782
+ width: "20px",
3783
+ height: "20px",
3784
+ position: "absolute",
3785
+ zIndex: 1
3786
+ }, Gi = {
3787
+ top: k(k({}, St), { top: "-5px" }),
3788
+ right: k(k({}, Ot), { left: void 0, right: "-5px" }),
3789
+ bottom: k(k({}, St), { top: void 0, bottom: "-5px" }),
3790
+ left: k(k({}, Ot), { left: "-5px" }),
3791
+ topRight: k(k({}, ve), { right: "-10px", top: "-10px", cursor: "ne-resize" }),
3792
+ bottomRight: k(k({}, ve), { right: "-10px", bottom: "-10px", cursor: "se-resize" }),
3793
+ bottomLeft: k(k({}, ve), { left: "-10px", bottom: "-10px", cursor: "sw-resize" }),
3794
+ topLeft: k(k({}, ve), { left: "-10px", top: "-10px", cursor: "nw-resize" })
3795
+ }, Ki = Jt(function(e) {
3796
+ var t = e.onResizeStart, r = e.direction, n = e.children, i = e.replaceStyles, a = e.className, u = Ke(function(o) {
3797
+ t(o, r);
3798
+ }, [t, r]), c = Ke(function(o) {
3799
+ t(o, r);
3800
+ }, [t, r]), s = Zt(function() {
3801
+ return k(k({ position: "absolute", userSelect: "none" }, Gi[r]), i ?? {});
3802
+ }, [i, r]);
3803
+ return v("div", { className: a || void 0, style: s, onMouseDown: u, onTouchStart: c, children: n });
3804
+ }), Vi = /* @__PURE__ */ function() {
3805
+ var e = function(t, r) {
3806
+ return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
3807
+ n.__proto__ = i;
3808
+ } || function(n, i) {
3809
+ for (var a in i) Object.prototype.hasOwnProperty.call(i, a) && (n[a] = i[a]);
3810
+ }, e(t, r);
3811
+ };
3812
+ return function(t, r) {
3813
+ if (typeof r != "function" && r !== null)
3814
+ throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
3815
+ e(t, r);
3816
+ function n() {
3817
+ this.constructor = t;
3818
+ }
3819
+ t.prototype = r === null ? Object.create(r) : (n.prototype = r.prototype, new n());
3820
+ };
3821
+ }(), H = function() {
3822
+ return H = Object.assign || function(e) {
3823
+ for (var t, r = 1, n = arguments.length; r < n; r++) {
3824
+ t = arguments[r];
3825
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
3826
+ }
3827
+ return e;
3828
+ }, H.apply(this, arguments);
3829
+ }, Qi = {
3830
+ width: "auto",
3831
+ height: "auto"
3832
+ }, be = function(e, t, r) {
3833
+ return Math.max(Math.min(e, r), t);
3834
+ }, Dt = function(e, t, r) {
3835
+ var n = Math.round(e / t);
3836
+ return n * t + r * (n - 1);
3837
+ }, J = function(e, t) {
3838
+ return new RegExp(e, "i").test(t);
3839
+ }, we = function(e) {
3840
+ return !!(e.touches && e.touches.length);
3841
+ }, Ji = function(e) {
3842
+ return !!((e.clientX || e.clientX === 0) && (e.clientY || e.clientY === 0));
3843
+ }, Tt = function(e, t, r) {
3844
+ r === void 0 && (r = 0);
3845
+ var n = t.reduce(function(a, u, c) {
3846
+ return Math.abs(u - e) < Math.abs(t[a] - e) ? c : a;
3847
+ }, 0), i = Math.abs(t[n] - e);
3848
+ return r === 0 || i < r ? t[n] : e;
3849
+ }, Ae = function(e) {
3850
+ return e = e.toString(), e === "auto" || e.endsWith("px") || e.endsWith("%") || e.endsWith("vh") || e.endsWith("vw") || e.endsWith("vmax") || e.endsWith("vmin") ? e : "".concat(e, "px");
3851
+ }, xe = function(e, t, r, n) {
3852
+ if (e && typeof e == "string") {
3853
+ if (e.endsWith("px"))
3854
+ return Number(e.replace("px", ""));
3855
+ if (e.endsWith("%")) {
3856
+ var i = Number(e.replace("%", "")) / 100;
3857
+ return t * i;
3858
+ }
3859
+ if (e.endsWith("vw")) {
3860
+ var i = Number(e.replace("vw", "")) / 100;
3861
+ return r * i;
3862
+ }
3863
+ if (e.endsWith("vh")) {
3864
+ var i = Number(e.replace("vh", "")) / 100;
3865
+ return n * i;
3866
+ }
3867
+ }
3868
+ return e;
3869
+ }, Zi = function(e, t, r, n, i, a, u) {
3870
+ return n = xe(n, e.width, t, r), i = xe(i, e.height, t, r), a = xe(a, e.width, t, r), u = xe(u, e.height, t, r), {
3871
+ maxWidth: typeof n > "u" ? void 0 : Number(n),
3872
+ maxHeight: typeof i > "u" ? void 0 : Number(i),
3873
+ minWidth: typeof a > "u" ? void 0 : Number(a),
3874
+ minHeight: typeof u > "u" ? void 0 : Number(u)
3875
+ };
3876
+ }, ea = function(e) {
3877
+ return Array.isArray(e) ? e : [e, e];
3878
+ }, ta = [
3879
+ "as",
3880
+ "ref",
3881
+ "style",
3882
+ "className",
3883
+ "grid",
3884
+ "gridGap",
3885
+ "snap",
3886
+ "bounds",
3887
+ "boundsByDirection",
3888
+ "size",
3889
+ "defaultSize",
3890
+ "minWidth",
3891
+ "minHeight",
3892
+ "maxWidth",
3893
+ "maxHeight",
3894
+ "lockAspectRatio",
3895
+ "lockAspectRatioExtraWidth",
3896
+ "lockAspectRatioExtraHeight",
3897
+ "enable",
3898
+ "handleStyles",
3899
+ "handleClasses",
3900
+ "handleWrapperStyle",
3901
+ "handleWrapperClass",
3902
+ "children",
3903
+ "onResizeStart",
3904
+ "onResize",
3905
+ "onResizeStop",
3906
+ "handleComponent",
3907
+ "scale",
3908
+ "resizeRatio",
3909
+ "snapGap"
3910
+ ], Mt = "__resizable_base__", ra = (
3911
+ /** @class */
3912
+ function(e) {
3913
+ Vi(t, e);
3914
+ function t(r) {
3915
+ var n, i, a, u, c = e.call(this, r) || this;
3916
+ return c.ratio = 1, c.resizable = null, c.parentLeft = 0, c.parentTop = 0, c.resizableLeft = 0, c.resizableRight = 0, c.resizableTop = 0, c.resizableBottom = 0, c.targetLeft = 0, c.targetTop = 0, c.delta = {
3917
+ width: 0,
3918
+ height: 0
3919
+ }, c.appendBase = function() {
3920
+ if (!c.resizable || !c.window)
3921
+ return null;
3922
+ var s = c.parentNode;
3923
+ if (!s)
3924
+ return null;
3925
+ var o = c.window.document.createElement("div");
3926
+ return o.style.width = "100%", o.style.height = "100%", o.style.position = "absolute", o.style.transform = "scale(0, 0)", o.style.left = "0", o.style.flex = "0 0 100%", o.classList ? o.classList.add(Mt) : o.className += Mt, s.appendChild(o), o;
3927
+ }, c.removeBase = function(s) {
3928
+ var o = c.parentNode;
3929
+ o && o.removeChild(s);
3930
+ }, c.state = {
3931
+ isResizing: !1,
3932
+ width: (i = (n = c.propsSize) === null || n === void 0 ? void 0 : n.width) !== null && i !== void 0 ? i : "auto",
3933
+ height: (u = (a = c.propsSize) === null || a === void 0 ? void 0 : a.height) !== null && u !== void 0 ? u : "auto",
3934
+ direction: "right",
3935
+ original: {
3936
+ x: 0,
3937
+ y: 0,
3938
+ width: 0,
3939
+ height: 0
3940
+ },
3941
+ backgroundStyle: {
3942
+ height: "100%",
3943
+ width: "100%",
3944
+ backgroundColor: "rgba(0,0,0,0)",
3945
+ cursor: "auto",
3946
+ opacity: 0,
3947
+ position: "fixed",
3948
+ zIndex: 9999,
3949
+ top: "0",
3950
+ left: "0",
3951
+ bottom: "0",
3952
+ right: "0"
3953
+ },
3954
+ flexBasis: void 0
3955
+ }, c.onResizeStart = c.onResizeStart.bind(c), c.onMouseMove = c.onMouseMove.bind(c), c.onMouseUp = c.onMouseUp.bind(c), c;
3956
+ }
3957
+ return Object.defineProperty(t.prototype, "parentNode", {
3958
+ get: function() {
3959
+ return this.resizable ? this.resizable.parentNode : null;
3960
+ },
3961
+ enumerable: !1,
3962
+ configurable: !0
3963
+ }), Object.defineProperty(t.prototype, "window", {
3964
+ get: function() {
3965
+ return !this.resizable || !this.resizable.ownerDocument ? null : this.resizable.ownerDocument.defaultView;
3966
+ },
3967
+ enumerable: !1,
3968
+ configurable: !0
3969
+ }), Object.defineProperty(t.prototype, "propsSize", {
3970
+ get: function() {
3971
+ return this.props.size || this.props.defaultSize || Qi;
3972
+ },
3973
+ enumerable: !1,
3974
+ configurable: !0
3975
+ }), Object.defineProperty(t.prototype, "size", {
3976
+ get: function() {
3977
+ var r = 0, n = 0;
3978
+ if (this.resizable && this.window) {
3979
+ var i = this.resizable.offsetWidth, a = this.resizable.offsetHeight, u = this.resizable.style.position;
3980
+ u !== "relative" && (this.resizable.style.position = "relative"), r = this.resizable.style.width !== "auto" ? this.resizable.offsetWidth : i, n = this.resizable.style.height !== "auto" ? this.resizable.offsetHeight : a, this.resizable.style.position = u;
3981
+ }
3982
+ return { width: r, height: n };
3983
+ },
3984
+ enumerable: !1,
3985
+ configurable: !0
3986
+ }), Object.defineProperty(t.prototype, "sizeStyle", {
3987
+ get: function() {
3988
+ var r = this, n = this.props.size, i = function(c) {
3989
+ var s;
3990
+ if (typeof r.state[c] > "u" || r.state[c] === "auto")
3991
+ return "auto";
3992
+ if (r.propsSize && r.propsSize[c] && (!((s = r.propsSize[c]) === null || s === void 0) && s.toString().endsWith("%"))) {
3993
+ if (r.state[c].toString().endsWith("%"))
3994
+ return r.state[c].toString();
3995
+ var o = r.getParentSize(), f = Number(r.state[c].toString().replace("px", "")), l = f / o[c] * 100;
3996
+ return "".concat(l, "%");
3997
+ }
3998
+ return Ae(r.state[c]);
3999
+ }, a = n && typeof n.width < "u" && !this.state.isResizing ? Ae(n.width) : i("width"), u = n && typeof n.height < "u" && !this.state.isResizing ? Ae(n.height) : i("height");
4000
+ return { width: a, height: u };
4001
+ },
4002
+ enumerable: !1,
4003
+ configurable: !0
4004
+ }), t.prototype.getParentSize = function() {
4005
+ if (!this.parentNode)
4006
+ return this.window ? { width: this.window.innerWidth, height: this.window.innerHeight } : { width: 0, height: 0 };
4007
+ var r = this.appendBase();
4008
+ if (!r)
4009
+ return { width: 0, height: 0 };
4010
+ var n = !1, i = this.parentNode.style.flexWrap;
4011
+ i !== "wrap" && (n = !0, this.parentNode.style.flexWrap = "wrap"), r.style.position = "relative", r.style.minWidth = "100%", r.style.minHeight = "100%";
4012
+ var a = {
4013
+ width: r.offsetWidth,
4014
+ height: r.offsetHeight
4015
+ };
4016
+ return n && (this.parentNode.style.flexWrap = i), this.removeBase(r), a;
4017
+ }, t.prototype.bindEvents = function() {
4018
+ this.window && (this.window.addEventListener("mouseup", this.onMouseUp), this.window.addEventListener("mousemove", this.onMouseMove), this.window.addEventListener("mouseleave", this.onMouseUp), this.window.addEventListener("touchmove", this.onMouseMove, {
4019
+ capture: !0,
4020
+ passive: !1
4021
+ }), this.window.addEventListener("touchend", this.onMouseUp));
4022
+ }, t.prototype.unbindEvents = function() {
4023
+ this.window && (this.window.removeEventListener("mouseup", this.onMouseUp), this.window.removeEventListener("mousemove", this.onMouseMove), this.window.removeEventListener("mouseleave", this.onMouseUp), this.window.removeEventListener("touchmove", this.onMouseMove, !0), this.window.removeEventListener("touchend", this.onMouseUp));
4024
+ }, t.prototype.componentDidMount = function() {
4025
+ if (!(!this.resizable || !this.window)) {
4026
+ var r = this.window.getComputedStyle(this.resizable);
4027
+ this.setState({
4028
+ width: this.state.width || this.size.width,
4029
+ height: this.state.height || this.size.height,
4030
+ flexBasis: r.flexBasis !== "auto" ? r.flexBasis : void 0
4031
+ });
4032
+ }
4033
+ }, t.prototype.componentWillUnmount = function() {
4034
+ this.window && this.unbindEvents();
4035
+ }, t.prototype.createSizeForCssProperty = function(r, n) {
4036
+ var i = this.propsSize && this.propsSize[n];
4037
+ return this.state[n] === "auto" && this.state.original[n] === r && (typeof i > "u" || i === "auto") ? "auto" : r;
4038
+ }, t.prototype.calculateNewMaxFromBoundary = function(r, n) {
4039
+ var i = this.props.boundsByDirection, a = this.state.direction, u = i && J("left", a), c = i && J("top", a), s, o;
4040
+ if (this.props.bounds === "parent") {
4041
+ var f = this.parentNode;
4042
+ f && (s = u ? this.resizableRight - this.parentLeft : f.offsetWidth + (this.parentLeft - this.resizableLeft), o = c ? this.resizableBottom - this.parentTop : f.offsetHeight + (this.parentTop - this.resizableTop));
4043
+ } else this.props.bounds === "window" ? this.window && (s = u ? this.resizableRight : this.window.innerWidth - this.resizableLeft, o = c ? this.resizableBottom : this.window.innerHeight - this.resizableTop) : this.props.bounds && (s = u ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft), o = c ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop));
4044
+ return s && Number.isFinite(s) && (r = r && r < s ? r : s), o && Number.isFinite(o) && (n = n && n < o ? n : o), { maxWidth: r, maxHeight: n };
4045
+ }, t.prototype.calculateNewSizeFromDirection = function(r, n) {
4046
+ var i = this.props.scale || 1, a = ea(this.props.resizeRatio || 1), u = a[0], c = a[1], s = this.state, o = s.direction, f = s.original, l = this.props, d = l.lockAspectRatio, h = l.lockAspectRatioExtraHeight, g = l.lockAspectRatioExtraWidth, p = f.width, m = f.height, b = h || 0, O = g || 0;
4047
+ return J("right", o) && (p = f.width + (r - f.x) * u / i, d && (m = (p - O) / this.ratio + b)), J("left", o) && (p = f.width - (r - f.x) * u / i, d && (m = (p - O) / this.ratio + b)), J("bottom", o) && (m = f.height + (n - f.y) * c / i, d && (p = (m - b) * this.ratio + O)), J("top", o) && (m = f.height - (n - f.y) * c / i, d && (p = (m - b) * this.ratio + O)), { newWidth: p, newHeight: m };
4048
+ }, t.prototype.calculateNewSizeFromAspectRatio = function(r, n, i, a) {
4049
+ var u = this.props, c = u.lockAspectRatio, s = u.lockAspectRatioExtraHeight, o = u.lockAspectRatioExtraWidth, f = typeof a.width > "u" ? 10 : a.width, l = typeof i.width > "u" || i.width < 0 ? r : i.width, d = typeof a.height > "u" ? 10 : a.height, h = typeof i.height > "u" || i.height < 0 ? n : i.height, g = s || 0, p = o || 0;
4050
+ if (c) {
4051
+ var m = (d - g) * this.ratio + p, b = (h - g) * this.ratio + p, O = (f - p) / this.ratio + g, x = (l - p) / this.ratio + g, w = Math.max(f, m), M = Math.min(l, b), S = Math.max(d, O), z = Math.min(h, x);
4052
+ r = be(r, w, M), n = be(n, S, z);
4053
+ } else
4054
+ r = be(r, f, l), n = be(n, d, h);
4055
+ return { newWidth: r, newHeight: n };
4056
+ }, t.prototype.setBoundingClientRect = function() {
4057
+ var r = 1 / (this.props.scale || 1);
4058
+ if (this.props.bounds === "parent") {
4059
+ var n = this.parentNode;
4060
+ if (n) {
4061
+ var i = n.getBoundingClientRect();
4062
+ this.parentLeft = i.left * r, this.parentTop = i.top * r;
4063
+ }
4064
+ }
4065
+ if (this.props.bounds && typeof this.props.bounds != "string") {
4066
+ var a = this.props.bounds.getBoundingClientRect();
4067
+ this.targetLeft = a.left * r, this.targetTop = a.top * r;
4068
+ }
4069
+ if (this.resizable) {
4070
+ var u = this.resizable.getBoundingClientRect(), c = u.left, s = u.top, o = u.right, f = u.bottom;
4071
+ this.resizableLeft = c * r, this.resizableRight = o * r, this.resizableTop = s * r, this.resizableBottom = f * r;
4072
+ }
4073
+ }, t.prototype.onResizeStart = function(r, n) {
4074
+ if (!(!this.resizable || !this.window)) {
4075
+ var i = 0, a = 0;
4076
+ if (r.nativeEvent && Ji(r.nativeEvent) ? (i = r.nativeEvent.clientX, a = r.nativeEvent.clientY) : r.nativeEvent && we(r.nativeEvent) && (i = r.nativeEvent.touches[0].clientX, a = r.nativeEvent.touches[0].clientY), this.props.onResizeStart && this.resizable) {
4077
+ var u = this.props.onResizeStart(r, n, this.resizable);
4078
+ if (u === !1)
4079
+ return;
4080
+ }
4081
+ this.props.size && (typeof this.props.size.height < "u" && this.props.size.height !== this.state.height && this.setState({ height: this.props.size.height }), typeof this.props.size.width < "u" && this.props.size.width !== this.state.width && this.setState({ width: this.props.size.width })), this.ratio = typeof this.props.lockAspectRatio == "number" ? this.props.lockAspectRatio : this.size.width / this.size.height;
4082
+ var c, s = this.window.getComputedStyle(this.resizable);
4083
+ if (s.flexBasis !== "auto") {
4084
+ var o = this.parentNode;
4085
+ if (o) {
4086
+ var f = this.window.getComputedStyle(o).flexDirection;
4087
+ this.flexDir = f.startsWith("row") ? "row" : "column", c = s.flexBasis;
4088
+ }
4089
+ }
4090
+ this.setBoundingClientRect(), this.bindEvents();
4091
+ var l = {
4092
+ original: {
4093
+ x: i,
4094
+ y: a,
4095
+ width: this.size.width,
4096
+ height: this.size.height
4097
+ },
4098
+ isResizing: !0,
4099
+ backgroundStyle: H(H({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(r.target).cursor || "auto" }),
4100
+ direction: n,
4101
+ flexBasis: c
4102
+ };
4103
+ this.setState(l);
4104
+ }
4105
+ }, t.prototype.onMouseMove = function(r) {
4106
+ var n = this;
4107
+ if (!(!this.state.isResizing || !this.resizable || !this.window)) {
4108
+ if (this.window.TouchEvent && we(r))
4109
+ try {
4110
+ r.preventDefault(), r.stopPropagation();
4111
+ } catch {
4112
+ }
4113
+ var i = this.props, a = i.maxWidth, u = i.maxHeight, c = i.minWidth, s = i.minHeight, o = we(r) ? r.touches[0].clientX : r.clientX, f = we(r) ? r.touches[0].clientY : r.clientY, l = this.state, d = l.direction, h = l.original, g = l.width, p = l.height, m = this.getParentSize(), b = Zi(m, this.window.innerWidth, this.window.innerHeight, a, u, c, s);
4114
+ a = b.maxWidth, u = b.maxHeight, c = b.minWidth, s = b.minHeight;
4115
+ var O = this.calculateNewSizeFromDirection(o, f), x = O.newHeight, w = O.newWidth, M = this.calculateNewMaxFromBoundary(a, u);
4116
+ this.props.snap && this.props.snap.x && (w = Tt(w, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (x = Tt(x, this.props.snap.y, this.props.snapGap));
4117
+ var S = this.calculateNewSizeFromAspectRatio(w, x, { width: M.maxWidth, height: M.maxHeight }, { width: c, height: s });
4118
+ if (w = S.newWidth, x = S.newHeight, this.props.grid) {
4119
+ var z = Dt(w, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0), E = Dt(x, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0), y = this.props.snapGap || 0, D = y === 0 || Math.abs(z - w) <= y ? z : w, P = y === 0 || Math.abs(E - x) <= y ? E : x;
4120
+ w = D, x = P;
4121
+ }
4122
+ var R = {
4123
+ width: w - h.width,
4124
+ height: x - h.height
4125
+ };
4126
+ if (this.delta = R, g && typeof g == "string") {
4127
+ if (g.endsWith("%")) {
4128
+ var L = w / m.width * 100;
4129
+ w = "".concat(L, "%");
4130
+ } else if (g.endsWith("vw")) {
4131
+ var $ = w / this.window.innerWidth * 100;
4132
+ w = "".concat($, "vw");
4133
+ } else if (g.endsWith("vh")) {
4134
+ var V = w / this.window.innerHeight * 100;
4135
+ w = "".concat(V, "vh");
4136
+ }
4137
+ }
4138
+ if (p && typeof p == "string") {
4139
+ if (p.endsWith("%")) {
4140
+ var L = x / m.height * 100;
4141
+ x = "".concat(L, "%");
4142
+ } else if (p.endsWith("vw")) {
4143
+ var $ = x / this.window.innerWidth * 100;
4144
+ x = "".concat($, "vw");
4145
+ } else if (p.endsWith("vh")) {
4146
+ var V = x / this.window.innerHeight * 100;
4147
+ x = "".concat(V, "vh");
4148
+ }
4149
+ }
4150
+ var A = {
4151
+ width: this.createSizeForCssProperty(w, "width"),
4152
+ height: this.createSizeForCssProperty(x, "height")
4153
+ };
4154
+ this.flexDir === "row" ? A.flexBasis = A.width : this.flexDir === "column" && (A.flexBasis = A.height);
4155
+ var q = this.state.width !== A.width, Gt = this.state.height !== A.height, Kt = this.state.flexBasis !== A.flexBasis, Ge = q || Gt || Kt;
4156
+ Ge && Ui.flushSync(function() {
4157
+ n.setState(A);
4158
+ }), this.props.onResize && Ge && this.props.onResize(r, d, this.resizable, R);
4159
+ }
4160
+ }, t.prototype.onMouseUp = function(r) {
4161
+ var n, i, a = this.state, u = a.isResizing, c = a.direction;
4162
+ a.original, !(!u || !this.resizable) && (this.props.onResizeStop && this.props.onResizeStop(r, c, this.resizable, this.delta), this.props.size && this.setState({ width: (n = this.props.size.width) !== null && n !== void 0 ? n : "auto", height: (i = this.props.size.height) !== null && i !== void 0 ? i : "auto" }), this.unbindEvents(), this.setState({
4163
+ isResizing: !1,
4164
+ backgroundStyle: H(H({}, this.state.backgroundStyle), { cursor: "auto" })
4165
+ }));
4166
+ }, t.prototype.updateSize = function(r) {
4167
+ var n, i;
4168
+ this.setState({ width: (n = r.width) !== null && n !== void 0 ? n : "auto", height: (i = r.height) !== null && i !== void 0 ? i : "auto" });
4169
+ }, t.prototype.renderResizer = function() {
4170
+ var r = this, n = this.props, i = n.enable, a = n.handleStyles, u = n.handleClasses, c = n.handleWrapperStyle, s = n.handleWrapperClass, o = n.handleComponent;
4171
+ if (!i)
4172
+ return null;
4173
+ var f = Object.keys(i).map(function(l) {
4174
+ return i[l] !== !1 ? v(Ki, { direction: l, onResizeStart: r.onResizeStart, replaceStyles: a && a[l], className: u && u[l], children: o && o[l] ? o[l] : null }, l) : null;
4175
+ });
4176
+ return v("div", { className: s, style: c, children: f });
4177
+ }, t.prototype.render = function() {
4178
+ var r = this, n = Object.keys(this.props).reduce(function(u, c) {
4179
+ return ta.indexOf(c) !== -1 || (u[c] = r.props[c]), u;
4180
+ }, {}), i = H(H(H({ position: "relative", userSelect: this.state.isResizing ? "none" : "auto" }, this.props.style), this.sizeStyle), { maxWidth: this.props.maxWidth, maxHeight: this.props.maxHeight, minWidth: this.props.minWidth, minHeight: this.props.minHeight, boxSizing: "border-box", flexShrink: 0 });
4181
+ this.state.flexBasis && (i.flexBasis = this.state.flexBasis);
4182
+ var a = this.props.as || "div";
4183
+ return K(a, H({ style: i, className: this.props.className }, n, {
4184
+ // `ref` is after `extendsProps` to ensure this one wins over a version
4185
+ // passed in
4186
+ ref: function(u) {
4187
+ u && (r.resizable = u);
4188
+ },
4189
+ children: [this.state.isResizing && v("div", { style: this.state.backgroundStyle }), this.props.children, this.renderResizer()]
4190
+ }));
4191
+ }, t.defaultProps = {
4192
+ as: "div",
4193
+ onResizeStart: function() {
4194
+ },
4195
+ onResize: function() {
4196
+ },
4197
+ onResizeStop: function() {
4198
+ },
4199
+ enable: {
4200
+ top: !0,
4201
+ right: !0,
4202
+ bottom: !0,
4203
+ left: !0,
4204
+ topRight: !0,
4205
+ bottomRight: !0,
4206
+ bottomLeft: !0,
4207
+ topLeft: !0
4208
+ },
4209
+ style: {},
4210
+ grid: [1, 1],
4211
+ gridGap: [0, 0],
4212
+ lockAspectRatio: !1,
4213
+ lockAspectRatioExtraWidth: 0,
4214
+ lockAspectRatioExtraHeight: 0,
4215
+ scale: 1,
4216
+ resizeRatio: 1,
4217
+ snapGap: 0
4218
+ }, t;
4219
+ }(er)
4220
+ );
4221
+ function na({
4222
+ item: e,
4223
+ rectangle: t,
4224
+ boundingRectangle: r,
4225
+ children: n,
4226
+ onDrag: i,
4227
+ onDragStart: a,
4228
+ onDrop: u,
4229
+ onUpdate: c,
4230
+ onResizeStart: s
4231
+ }) {
4232
+ const o = ce(null), f = ce(null), [l, d] = G(t);
4233
+ return ee(() => {
4234
+ d(t);
4235
+ }, [t]), ee(() => (He(o.current), He(f.current), Ri({
4236
+ element: o.current,
4237
+ dragHandle: f.current,
4238
+ onDragStart: ({ source: h, location: g }) => {
4239
+ const p = Z(h, g);
4240
+ a(p.absolute, p.relative);
4241
+ },
4242
+ onDrag: () => {
4243
+ i();
4244
+ },
4245
+ onDrop: () => {
4246
+ u();
4247
+ },
4248
+ getInitialData: () => ({ ...e })
4249
+ })), [e, i, a, u]), /* @__PURE__ */ v(
4250
+ "div",
4251
+ {
4252
+ id: `timeline-item-${e.id}`,
4253
+ className: "timeline-item",
4254
+ "data-timeline-item-id": e.id,
4255
+ ref: o,
4256
+ style: {
4257
+ width: `${l.width}px`,
4258
+ height: `${l.height}px`,
4259
+ minWidth: `${l.width}px`,
4260
+ minHeight: `${l.height}px`,
4261
+ maxWidth: `${l.width}px`,
4262
+ maxHeight: `${l.height}px`,
4263
+ top: `${l.y}px`,
4264
+ left: `${l.x}px`
4265
+ },
4266
+ onMouseDown: (h) => {
4267
+ h.stopPropagation();
4268
+ },
4269
+ onClick: (h) => {
4270
+ h.stopPropagation();
4271
+ },
4272
+ children: /* @__PURE__ */ v(
4273
+ ra,
4274
+ {
4275
+ enable: {
4276
+ right: !0,
4277
+ left: !0,
4278
+ top: !0,
4279
+ bottom: !0
4280
+ },
4281
+ handleClasses: {
4282
+ left: "timeline-item-resize-handle timeline-item-resize-handle-left",
4283
+ right: "timeline-item-resize-handle timeline-item-resize-handle-right"
4284
+ },
4285
+ size: {
4286
+ width: l.width,
4287
+ height: l.height
4288
+ },
4289
+ onResizeStart: () => {
4290
+ s();
4291
+ },
4292
+ onResize: (h, g, p, m) => {
4293
+ d((b) => g === "right" ? {
4294
+ ...b,
4295
+ width: t.width + m.width
4296
+ } : g === "left" ? {
4297
+ ...b,
4298
+ x: t.x - m.width,
4299
+ width: t.width + m.width
4300
+ } : g === "bottom" ? {
4301
+ ...b,
4302
+ height: Math.min(
4303
+ t.height + m.height,
4304
+ r.height - t.y
4305
+ )
4306
+ } : g === "top" ? {
4307
+ ...b,
4308
+ y: t.y - m.height,
4309
+ height: t.height + m.height
4310
+ } : b);
4311
+ },
4312
+ onResizeStop: (h, g, p, m) => {
4313
+ let b = t;
4314
+ g === "right" ? b = {
4315
+ ...t,
4316
+ width: t.width + m.width
4317
+ } : g === "left" ? b = {
4318
+ ...t,
4319
+ x: t.x - m.width,
4320
+ width: t.width + m.width
4321
+ } : g === "bottom" ? b = {
4322
+ ...t,
4323
+ height: Math.min(
4324
+ t.height + m.height,
4325
+ r.height - t.y
4326
+ )
4327
+ } : g === "top" && (b = {
4328
+ ...t,
4329
+ y: t.y - m.height,
4330
+ height: t.height + m.height
4331
+ }), c(b);
4332
+ },
4333
+ style: { overflow: "hidden" },
4334
+ children: /* @__PURE__ */ v("div", { className: "timeline-item-drag-handle", ref: f, children: n })
4335
+ }
4336
+ )
4337
+ }
4338
+ );
4339
+ }
4340
+ function ia({
4341
+ swimlane: e,
4342
+ item: t,
4343
+ settings: r,
4344
+ children: n,
4345
+ onDragStart: i,
4346
+ onDrag: a,
4347
+ onDrop: u,
4348
+ onUpdate: c,
4349
+ onResizeStart: s
4350
+ }) {
4351
+ const o = Fe(t, e, r, r), f = Ye(
4352
+ e,
4353
+ r,
4354
+ r
4355
+ );
4356
+ return /* @__PURE__ */ v(
4357
+ na,
4358
+ {
4359
+ item: t,
4360
+ rectangle: o,
4361
+ boundingRectangle: f,
4362
+ onDrag: a,
4363
+ onDragStart: i,
4364
+ onDrop: u,
4365
+ onUpdate: (l) => {
4366
+ const d = Ht(
4367
+ t,
4368
+ e,
4369
+ l,
4370
+ r,
4371
+ r
4372
+ );
4373
+ c(d);
4374
+ },
4375
+ onResizeStart: s,
4376
+ children: n
4377
+ }
4378
+ );
4379
+ }
4380
+ function aa({ overlap: e }) {
4381
+ return /* @__PURE__ */ v(
4382
+ "div",
4383
+ {
4384
+ style: {
4385
+ position: "absolute",
4386
+ left: `${e.x}px`,
4387
+ top: `${e.y}px`,
4388
+ width: `${e.width - 1}px`,
4389
+ height: `${e.height - 1}px`,
4390
+ background: "rgba(255,0,0, 0.3)",
4391
+ marginLeft: "1px",
4392
+ pointerEvents: "none"
4393
+ }
4394
+ }
4395
+ );
4396
+ }
4397
+ function Et(e) {
4398
+ return "id" in e && "swimlaneId" in e && "start" in e && "end" in e && "size" in e && "offset" in e;
4399
+ }
4400
+ function oa({
4401
+ swimlane: e,
4402
+ items: t,
4403
+ focused: r = !1,
4404
+ onItemUpdate: n = () => {
4405
+ },
4406
+ onMouseUp: i = () => {
4407
+ },
4408
+ onClick: a = () => {
4409
+ },
4410
+ onDoubleClick: u = () => {
4411
+ },
4412
+ onContextMenu: c = () => {
4413
+ },
4414
+ renderItem: s = sa,
4415
+ onResizeStart: o = () => {
4416
+ }
4417
+ }) {
4418
+ const { settings: f } = ge(), l = {
4419
+ x: f.pixelsPerDay,
4420
+ offsetX: f.pixelsPerDay / 2
4421
+ }, d = Ye(
4422
+ e,
4423
+ f,
4424
+ f
4425
+ ), [h, g] = G(null), [p, m] = G(
4426
+ null
4427
+ );
4428
+ function b(y) {
4429
+ const D = y.currentTarget.getBoundingClientRect();
4430
+ return ze(
4431
+ le(
4432
+ f.start,
4433
+ (y.clientX - D.left) / f.pixelsPerDay
4434
+ ),
4435
+ 12
4436
+ );
4437
+ }
4438
+ function O(y) {
4439
+ const D = y.currentTarget.getBoundingClientRect();
4440
+ return (y.pageY - D.top) / D.height * e.capacity;
4441
+ }
4442
+ function x(y, D, P) {
4443
+ if (!Et(P)) return;
4444
+ const R = zi(
4445
+ e,
4446
+ t,
4447
+ P,
4448
+ y,
4449
+ D,
4450
+ f,
4451
+ l,
4452
+ f,
4453
+ f.allowOverlaps
4454
+ );
4455
+ m(R);
4456
+ }
4457
+ function w(y, D, P) {
4458
+ if (!Et(P) || p === null) return;
4459
+ const R = Ht(
4460
+ P,
4461
+ e,
4462
+ p,
4463
+ f,
4464
+ f
4465
+ );
4466
+ n(R), m(null);
4467
+ }
4468
+ function M() {
4469
+ m(null);
4470
+ }
4471
+ function S(y, D) {
4472
+ const P = b(y), R = O(y), L = Yi(
4473
+ P,
4474
+ R,
4475
+ e,
4476
+ t,
4477
+ f
4478
+ );
4479
+ D == "single" ? a(P, L, y) : u(P, L, y);
4480
+ }
4481
+ const z = t.map((y) => ({
4482
+ id: y.id,
4483
+ ...Fe(y, e, f, f)
4484
+ })), E = z.flatMap(
4485
+ (y) => z.map((D) => y.id < D.id ? Hi(y, D) : null)
4486
+ ).filter((y) => y !== null);
4487
+ return /* @__PURE__ */ v(
4488
+ "div",
4489
+ {
4490
+ id: `timeline-swimlane-${e.id}`,
4491
+ className: `timeline-swimlane ${r ? "timeline-swimlane-focused" : ""}`,
4492
+ "data-timeline-swimlane-id": e.id,
4493
+ style: d,
4494
+ onMouseUp: i,
4495
+ onClick: (y) => S(y, "single"),
4496
+ onDoubleClick: (y) => S(y, "double"),
4497
+ onContextMenu: (y) => {
4498
+ c(b(y), y);
4499
+ },
4500
+ children: /* @__PURE__ */ K(
4501
+ Ni,
4502
+ {
4503
+ onDrag: x,
4504
+ onDragLeave: M,
4505
+ onDrop: w,
4506
+ children: [
4507
+ t.map((y, D) => /* @__PURE__ */ v(
4508
+ ia,
4509
+ {
4510
+ item: y,
4511
+ settings: f,
4512
+ swimlane: e,
4513
+ onDragStart: () => {
4514
+ g(y);
4515
+ },
4516
+ onDrag: () => {
4517
+ },
4518
+ onDrop: () => {
4519
+ g(null);
4520
+ },
4521
+ onUpdate: n,
4522
+ onResizeStart: () => {
4523
+ o(y.payload);
4524
+ },
4525
+ children: s(
4526
+ y,
4527
+ h !== null && h.id === y.id
4528
+ )
4529
+ },
4530
+ D
4531
+ )),
4532
+ p && /* @__PURE__ */ v(Ai, { ...p }),
4533
+ E.map((y, D) => /* @__PURE__ */ v(aa, { overlap: y }, D))
4534
+ ]
4535
+ }
4536
+ )
4537
+ }
4538
+ );
4539
+ }
4540
+ function sa(e, t) {
4541
+ return /* @__PURE__ */ K("div", { children: [
4542
+ e.id,
4543
+ " (",
4544
+ I(e.start, "yyyy-mm-dd"),
4545
+ " -",
4546
+ " ",
4547
+ I(e.end, "yyyy-mm-dd"),
4548
+ ")",
4549
+ t ? "dragging" : ""
4550
+ ] });
4551
+ }
4552
+ function ma({
4553
+ lanes: e,
4554
+ items: t,
4555
+ renderItem: r,
4556
+ onItemUpdate: n = () => {
4557
+ },
4558
+ onLaneClick: i = () => {
4559
+ },
4560
+ onLaneDoubleClick: a = () => {
4561
+ },
4562
+ onLaneContextMenu: u = () => {
4563
+ }
4564
+ }) {
4565
+ return /* @__PURE__ */ v("div", { className: "timeline-body", children: e.map((c) => /* @__PURE__ */ v(
4566
+ oa,
4567
+ {
4568
+ swimlane: c,
4569
+ items: t.filter((s) => s.swimlaneId === c.id),
4570
+ renderItem: r,
4571
+ onItemUpdate: n,
4572
+ onClick: (s, o, f) => i(c, s, o, f),
4573
+ onDoubleClick: (s, o, f) => a(c, s, o, f),
4574
+ onContextMenu: (s, o) => u(c, s, o)
4575
+ },
4576
+ c.id
4577
+ )) });
4578
+ }
4579
+ function ya({
4580
+ children: e,
4581
+ onSelect: t
4582
+ }) {
4583
+ const [r, n] = G([]), i = ce(null), [a, u] = G(null), [c, s] = G(null);
4584
+ ee(() => Pi({
4585
+ onDragStart: (d) => {
4586
+ n([d.source.data.id]);
4587
+ }
4588
+ }), []), ee(() => {
4589
+ t(r);
4590
+ }, [t, r]);
4591
+ function o(d) {
4592
+ !d.shiftKey && !d.ctrlKey && n([]), u({ x: d.clientX, y: d.clientY });
4593
+ }
4594
+ function f(d) {
4595
+ if (a) {
4596
+ const h = {
4597
+ x: Math.min(d.clientX, a.x),
4598
+ y: Math.min(d.clientY, a.y),
4599
+ width: Math.abs(d.clientX - a.x),
4600
+ height: Math.abs(d.clientY - a.y)
4601
+ }, g = d.currentTarget.getBoundingClientRect();
4602
+ s({
4603
+ ...h,
4604
+ x: h.x - g.left,
4605
+ y: h.y - g.top
4606
+ }), document.querySelectorAll(".timeline-drop-target").forEach((p) => {
4607
+ se(p.getBoundingClientRect(), h) && p.querySelectorAll(".timeline-item").forEach((m) => {
4608
+ se(m.getBoundingClientRect(), h) ? m.classList.add("timeline-item-marked") : m.classList.remove("timeline-item-marked");
4609
+ });
4610
+ }), (h.width > 5 || h.height > 5) && !i.current && (i.current = Pt, window.addEventListener("click", Pt, !0));
4611
+ }
4612
+ }
4613
+ function l(d) {
4614
+ if (a && c) {
4615
+ d.stopPropagation();
4616
+ const h = {
4617
+ x: Math.min(d.clientX, a.x),
4618
+ y: Math.min(d.clientY, a.y),
4619
+ width: Math.abs(d.clientX - a.x),
4620
+ height: Math.abs(d.clientY - a.y)
4621
+ }, g = Array.from(
4622
+ document.querySelectorAll(".timeline-drop-target")
4623
+ ).filter((p) => se(p.getBoundingClientRect(), h)).map((p) => Array.from(p.querySelectorAll(".timeline-item"))).flatMap((p) => p).filter((p) => se(p.getBoundingClientRect(), h)).map((p) => p instanceof HTMLElement ? Number.parseInt(p.dataset.timelineItemId || "-1") : -1).filter((p) => p > 0);
4624
+ g.length > 0 && (d.shiftKey || d.ctrlKey ? n((p) => Array.from(/* @__PURE__ */ new Set([...p, ...g]))) : n(g)), document.querySelectorAll(".timeline-item-marked").forEach((p) => {
4625
+ p.classList.remove("timeline-item-marked");
4626
+ });
4627
+ }
4628
+ u(null), s(null), requestAnimationFrame(() => {
4629
+ i.current && i.current !== null && (window.removeEventListener("click", i.current, !0), i.current = null);
4630
+ });
4631
+ }
4632
+ return /* @__PURE__ */ K(
4633
+ "div",
4634
+ {
4635
+ onMouseDown: o,
4636
+ onMouseMove: f,
4637
+ onMouseUp: l,
4638
+ style: {
4639
+ position: "relative"
4640
+ },
4641
+ children: [
4642
+ c && /* @__PURE__ */ v(ua, { rect: c }),
4643
+ e
4644
+ ]
4645
+ }
4646
+ );
4647
+ }
4648
+ const Pt = (e) => {
4649
+ e.preventDefault(), e.stopPropagation();
4650
+ };
4651
+ function ua({ rect: e }) {
4652
+ return /* @__PURE__ */ v(
4653
+ "div",
4654
+ {
4655
+ id: "mouse-selection-indicator",
4656
+ style: {
4657
+ border: "1px dashed blue",
4658
+ position: "absolute",
4659
+ top: `${e.y}px`,
4660
+ left: `${e.x}px`,
4661
+ width: `${e.width}px`,
4662
+ height: `${e.height}px`,
4663
+ zIndex: 1e6
4664
+ }
4665
+ }
4666
+ );
4667
+ }
4668
+ const va = () => {
4669
+ const { settings: e } = ge();
4670
+ function t(a) {
4671
+ a instanceof Object ? (a.horz !== void 0 && r(a.horz), a.vert !== void 0 && n(a.vert)) : i(a);
4672
+ }
4673
+ function r(a) {
4674
+ window.requestAnimationFrame(() => {
4675
+ const u = document.getElementById(
4676
+ "timeline-background-date-anchor"
4677
+ );
4678
+ if (u) {
4679
+ const c = Be(a, e.start, e);
4680
+ u.style.setProperty("left", `${c}px`), u.scrollIntoView({
4681
+ block: "nearest",
4682
+ inline: "center",
4683
+ behavior: "smooth"
4684
+ });
4685
+ }
4686
+ });
4687
+ }
4688
+ function n(a) {
4689
+ window.requestAnimationFrame(() => {
4690
+ const u = document.getElementById(
4691
+ `timeline-swimlane-${a}`
4692
+ );
4693
+ u && u.scrollIntoView({ block: "center", behavior: "smooth" });
4694
+ });
4695
+ }
4696
+ function i(a) {
4697
+ window.requestAnimationFrame(() => {
4698
+ const u = document.getElementById(
4699
+ `timeline-item-${a}`
4700
+ );
4701
+ u && u.scrollIntoView({
4702
+ block: "center",
4703
+ inline: "center",
4704
+ behavior: "smooth"
4705
+ });
4706
+ });
4707
+ }
4708
+ return { scrollTo: t, scrollToDate: r, scrollToItem: i, scrollToLane: n };
4709
+ };
4710
+ export {
4711
+ oa as CoreSwimlane,
4712
+ zn as DaysHeader,
4713
+ _n as MonthsHeader,
4714
+ fa as TimelineAside,
4715
+ ha as TimelineBackground,
4716
+ ma as TimelineBody,
4717
+ ga as TimelineHeader,
4718
+ re as TimelineLayout,
4719
+ ya as TimelineSelectionLayer,
4720
+ pa as TimelineWrapper,
4721
+ Cn as WeeksHeader,
4722
+ Be as dateToPixel,
4723
+ se as doOverlap,
4724
+ Yi as getAvailableSpace,
4725
+ zi as getDropPreviewRectangle,
4726
+ Ye as getDropTargetDimensions,
4727
+ Mn as getDropTargetHeight,
4728
+ En as getDropTargetWidth,
4729
+ Z as getGrabPosition,
4730
+ Lt as getItemDimensions,
4731
+ Rn as getItemPosition,
4732
+ Fe as getItemRectangle,
4733
+ Hi as getOverlap,
4734
+ Ht as getUpdatedItem,
4735
+ Et as isCoreItem,
4736
+ ji as isWithinTargetDimensions,
4737
+ Ii as itemsDoOverlap,
4738
+ Pn as offsetToPixel,
4739
+ An as renderDayHeader,
4740
+ kn as renderMonthHeader,
4741
+ Nn as renderWeekHeader,
4742
+ va as useScroll,
4743
+ ge as useTimelineContext
4744
+ };