@innosolutions/inno-calendar 1.0.72 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/CHANGELOG.md +93 -0
  2. package/LICENSE +48 -48
  3. package/README.md +333 -305
  4. package/dist/components/event/event-card.d.ts +3 -27
  5. package/dist/components/event/event-card.d.ts.map +1 -1
  6. package/dist/components/header/calendar-header.d.ts +14 -3
  7. package/dist/components/header/calendar-header.d.ts.map +1 -1
  8. package/dist/components/index.cjs +1 -1
  9. package/dist/components/index.d.ts +7 -6
  10. package/dist/components/index.d.ts.map +1 -1
  11. package/dist/components/index.mjs +48 -57
  12. package/dist/components/index.mjs.map +1 -1
  13. package/dist/components/inno-calendar.d.ts +139 -72
  14. package/dist/components/inno-calendar.d.ts.map +1 -1
  15. package/dist/components/primitives/field-layer.d.ts +12 -0
  16. package/dist/components/primitives/field-layer.d.ts.map +1 -0
  17. package/dist/components/primitives/index.d.ts +3 -0
  18. package/dist/components/primitives/index.d.ts.map +1 -1
  19. package/dist/components/primitives/quick-create.d.ts +44 -0
  20. package/dist/components/primitives/quick-create.d.ts.map +1 -0
  21. package/dist/components/primitives/recurrence-field.d.ts +102 -0
  22. package/dist/components/primitives/recurrence-field.d.ts.map +1 -0
  23. package/dist/components/primitives/when-row.d.ts +41 -0
  24. package/dist/components/primitives/when-row.d.ts.map +1 -0
  25. package/dist/components/shell/calendar-settings.d.ts +28 -0
  26. package/dist/components/shell/calendar-settings.d.ts.map +1 -0
  27. package/dist/components/shell/calendar-sidebar.d.ts +27 -0
  28. package/dist/components/shell/calendar-sidebar.d.ts.map +1 -0
  29. package/dist/components/shell/filter-panel.d.ts +10 -0
  30. package/dist/components/shell/filter-panel.d.ts.map +1 -0
  31. package/dist/components/shell/index.d.ts +5 -0
  32. package/dist/components/shell/index.d.ts.map +1 -0
  33. package/dist/components/shell/mini-month.d.ts +16 -0
  34. package/dist/components/shell/mini-month.d.ts.map +1 -0
  35. package/dist/components/ui/index.d.ts +0 -2
  36. package/dist/components/ui/index.d.ts.map +1 -1
  37. package/dist/components/views/agenda-view.d.ts +14 -15
  38. package/dist/components/views/agenda-view.d.ts.map +1 -1
  39. package/dist/components/views/day-events-expansion.d.ts +1 -1
  40. package/dist/components/views/day-events-expansion.d.ts.map +1 -1
  41. package/dist/components/views/day-view.d.ts +2 -6
  42. package/dist/components/views/day-view.d.ts.map +1 -1
  43. package/dist/components/views/index.d.ts +2 -1
  44. package/dist/components/views/index.d.ts.map +1 -1
  45. package/dist/components/views/month-view.d.ts +2 -12
  46. package/dist/components/views/month-view.d.ts.map +1 -1
  47. package/dist/components/views/resource-columns-view.d.ts +23 -0
  48. package/dist/components/views/resource-columns-view.d.ts.map +1 -0
  49. package/dist/components/views/timeline-view.d.ts +2 -6
  50. package/dist/components/views/timeline-view.d.ts.map +1 -1
  51. package/dist/components/views/week-view.d.ts +10 -6
  52. package/dist/components/views/week-view.d.ts.map +1 -1
  53. package/dist/components/views/year-view.d.ts +2 -6
  54. package/dist/components/views/year-view.d.ts.map +1 -1
  55. package/dist/core/constants.d.ts +32 -1
  56. package/dist/core/constants.d.ts.map +1 -1
  57. package/dist/core/context/drag-drop-context.d.ts +15 -1
  58. package/dist/core/context/drag-drop-context.d.ts.map +1 -1
  59. package/dist/core/context/event-card-context.d.ts +16 -0
  60. package/dist/core/context/event-card-context.d.ts.map +1 -0
  61. package/dist/core/context/inno-calendar-provider.d.ts +10 -1
  62. package/dist/core/context/inno-calendar-provider.d.ts.map +1 -1
  63. package/dist/core/context/slot-selection-context.d.ts +16 -0
  64. package/dist/core/context/slot-selection-context.d.ts.map +1 -1
  65. package/dist/core/index.cjs +1 -1
  66. package/dist/core/index.d.ts +3 -1
  67. package/dist/core/index.d.ts.map +1 -1
  68. package/dist/core/index.mjs +160 -155
  69. package/dist/core/index.mjs.map +1 -1
  70. package/dist/core/types.d.ts +44 -514
  71. package/dist/core/types.d.ts.map +1 -1
  72. package/dist/core/utils/date-input.d.ts +8 -0
  73. package/dist/core/utils/date-input.d.ts.map +1 -0
  74. package/dist/core/utils/grid-utils.d.ts.map +1 -1
  75. package/dist/core/utils/index.d.ts +1 -0
  76. package/dist/core/utils/index.d.ts.map +1 -1
  77. package/dist/core/utils/time-format.d.ts +24 -0
  78. package/dist/core/utils/time-format.d.ts.map +1 -0
  79. package/dist/core/utils/view-storage.d.ts +2 -2
  80. package/dist/core/utils/view-storage.d.ts.map +1 -1
  81. package/dist/core/z-layers.d.ts +21 -0
  82. package/dist/core/z-layers.d.ts.map +1 -0
  83. package/dist/index.cjs +1 -1
  84. package/dist/index.d.ts +0 -1
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.mjs +227 -234
  87. package/dist/index.mjs.map +1 -1
  88. package/dist/inno-calendar-B6qXIqxY.js +7433 -0
  89. package/dist/inno-calendar-B6qXIqxY.js.map +1 -0
  90. package/dist/inno-calendar-BnCt65PZ.cjs +11 -0
  91. package/dist/inno-calendar-BnCt65PZ.cjs.map +1 -0
  92. package/dist/lib/index.cjs +1 -1
  93. package/dist/lib/index.mjs +1 -1
  94. package/dist/position-utils-BzSoogFQ.cjs +2 -0
  95. package/dist/position-utils-BzSoogFQ.cjs.map +1 -0
  96. package/dist/position-utils-CBSmf90e.js +1106 -0
  97. package/dist/position-utils-CBSmf90e.js.map +1 -0
  98. package/dist/styles/index.css +1 -1
  99. package/dist/use-slot-selection-CxPvMluJ.cjs +2 -0
  100. package/dist/use-slot-selection-CxPvMluJ.cjs.map +1 -0
  101. package/dist/use-slot-selection-IXHnP8C1.js +357 -0
  102. package/dist/use-slot-selection-IXHnP8C1.js.map +1 -0
  103. package/dist/utils-B6yFEsav.js +9 -0
  104. package/dist/utils-B6yFEsav.js.map +1 -0
  105. package/dist/utils-IjLH3w2e.cjs +2 -0
  106. package/dist/utils-IjLH3w2e.cjs.map +1 -0
  107. package/dist/utils.cjs +1 -1
  108. package/dist/utils.d.ts +1 -1
  109. package/dist/utils.d.ts.map +1 -1
  110. package/dist/utils.mjs +99 -96
  111. package/dist/z-layers-Bavypndz.cjs +2 -0
  112. package/dist/z-layers-Bavypndz.cjs.map +1 -0
  113. package/dist/z-layers-r5PdtThu.js +637 -0
  114. package/dist/z-layers-r5PdtThu.js.map +1 -0
  115. package/package.json +117 -138
  116. package/AGENT.md +0 -1783
  117. package/dist/agenda-widget-B0t3TCcV.js +0 -4141
  118. package/dist/agenda-widget-B0t3TCcV.js.map +0 -1
  119. package/dist/agenda-widget-i2tjGr5U.cjs +0 -2
  120. package/dist/agenda-widget-i2tjGr5U.cjs.map +0 -1
  121. package/dist/components/calendar.d.ts +0 -45
  122. package/dist/components/calendar.d.ts.map +0 -1
  123. package/dist/components/event/event-page-transition.d.ts +0 -32
  124. package/dist/components/event/event-page-transition.d.ts.map +0 -1
  125. package/dist/components/filters/calendar-filter-sidebar.d.ts +0 -54
  126. package/dist/components/filters/calendar-filter-sidebar.d.ts.map +0 -1
  127. package/dist/components/filters/index.d.ts +0 -9
  128. package/dist/components/filters/index.d.ts.map +0 -1
  129. package/dist/components/filters/schedule-type-filter.d.ts +0 -31
  130. package/dist/components/filters/schedule-type-filter.d.ts.map +0 -1
  131. package/dist/components/filters/user-filter.d.ts +0 -31
  132. package/dist/components/filters/user-filter.d.ts.map +0 -1
  133. package/dist/components/header/components/index.d.ts +0 -8
  134. package/dist/components/header/components/index.d.ts.map +0 -1
  135. package/dist/components/integrated-calendar.d.ts +0 -37
  136. package/dist/components/integrated-calendar.d.ts.map +0 -1
  137. package/dist/components/settings/badge-variant-setting.d.ts +0 -25
  138. package/dist/components/settings/badge-variant-setting.d.ts.map +0 -1
  139. package/dist/components/settings/index.d.ts +0 -10
  140. package/dist/components/settings/index.d.ts.map +0 -1
  141. package/dist/components/settings/slot-duration-setting.d.ts +0 -20
  142. package/dist/components/settings/slot-duration-setting.d.ts.map +0 -1
  143. package/dist/components/settings/visible-hours-setting.d.ts +0 -23
  144. package/dist/components/settings/visible-hours-setting.d.ts.map +0 -1
  145. package/dist/components/settings/working-hours-setting.d.ts +0 -41
  146. package/dist/components/settings/working-hours-setting.d.ts.map +0 -1
  147. package/dist/components/ui/dialog.d.ts +0 -35
  148. package/dist/components/ui/dialog.d.ts.map +0 -1
  149. package/dist/components/ui/select.d.ts +0 -12
  150. package/dist/components/ui/select.d.ts.map +0 -1
  151. package/dist/components/widget/agenda-dropdown.d.ts +0 -20
  152. package/dist/components/widget/agenda-dropdown.d.ts.map +0 -1
  153. package/dist/components/widget/agenda-widget.d.ts +0 -27
  154. package/dist/components/widget/agenda-widget.d.ts.map +0 -1
  155. package/dist/components/widget/index.d.ts +0 -6
  156. package/dist/components/widget/index.d.ts.map +0 -1
  157. package/dist/index-D2U2F80P.cjs +0 -2
  158. package/dist/index-D2U2F80P.cjs.map +0 -1
  159. package/dist/index-DtaLkIY8.js +0 -2777
  160. package/dist/index-DtaLkIY8.js.map +0 -1
  161. package/dist/position-utils-D_KpwRus.js +0 -1053
  162. package/dist/position-utils-D_KpwRus.js.map +0 -1
  163. package/dist/position-utils-ksZ_IjXC.cjs +0 -2
  164. package/dist/position-utils-ksZ_IjXC.cjs.map +0 -1
  165. package/dist/presets/default/default-calendar.d.ts +0 -44
  166. package/dist/presets/default/default-calendar.d.ts.map +0 -1
  167. package/dist/presets/default/index.d.ts +0 -2
  168. package/dist/presets/default/index.d.ts.map +0 -1
  169. package/dist/presets/index.cjs +0 -2
  170. package/dist/presets/index.cjs.map +0 -1
  171. package/dist/presets/index.d.ts +0 -3
  172. package/dist/presets/index.d.ts.map +0 -1
  173. package/dist/presets/index.mjs +0 -6
  174. package/dist/presets/index.mjs.map +0 -1
  175. package/dist/presets/tailwind/index.d.ts +0 -2
  176. package/dist/presets/tailwind/index.d.ts.map +0 -1
  177. package/dist/presets/tailwind/tailwind-calendar.d.ts +0 -122
  178. package/dist/presets/tailwind/tailwind-calendar.d.ts.map +0 -1
  179. package/dist/slot-selection-context-CLYZU6ul.cjs +0 -2
  180. package/dist/slot-selection-context-CLYZU6ul.cjs.map +0 -1
  181. package/dist/slot-selection-context-Ct5cVcKW.js +0 -611
  182. package/dist/slot-selection-context-Ct5cVcKW.js.map +0 -1
  183. package/dist/tailwind-calendar-BbUb61uY.cjs +0 -2
  184. package/dist/tailwind-calendar-BbUb61uY.cjs.map +0 -1
  185. package/dist/tailwind-calendar-DrwGVSF-.js +0 -400
  186. package/dist/tailwind-calendar-DrwGVSF-.js.map +0 -1
  187. package/dist/use-calendar-BK0nQYJq.cjs +0 -2
  188. package/dist/use-calendar-BK0nQYJq.cjs.map +0 -1
  189. package/dist/use-calendar-DJI35SSd.js +0 -175
  190. package/dist/use-calendar-DJI35SSd.js.map +0 -1
  191. package/dist/use-slot-selection-CCE11R4j.cjs +0 -2
  192. package/dist/use-slot-selection-CCE11R4j.cjs.map +0 -1
  193. package/dist/use-slot-selection-CX1w8EdM.js +0 -188
  194. package/dist/use-slot-selection-CX1w8EdM.js.map +0 -1
  195. package/dist/week-view-BXmaRChB.cjs +0 -11
  196. package/dist/week-view-BXmaRChB.cjs.map +0 -1
  197. package/dist/week-view-BeasFcyR.js +0 -3520
  198. package/dist/week-view-BeasFcyR.js.map +0 -1
@@ -0,0 +1,1106 @@
1
+ import { isValidElement as tt } from "react";
2
+ const et = "inno-calendar-preferences";
3
+ function H(t) {
4
+ if (t == null || typeof t == "boolean") return "";
5
+ if (typeof t == "string") return t;
6
+ if (typeof t == "number") return String(t);
7
+ if (Array.isArray(t)) return t.map(H).join("");
8
+ if (tt(t)) {
9
+ const e = t.props;
10
+ return H(e.children);
11
+ }
12
+ return "";
13
+ }
14
+ const B = "inno-calendar";
15
+ function P(t) {
16
+ if (t?.enabled === !1) return null;
17
+ const e = t?.storageKey ?? B;
18
+ return {
19
+ gridKey: `${e}-view`,
20
+ resourceKey: `${e}-resource-view`
21
+ };
22
+ }
23
+ const A = "inno-calendar-view", v = "inno-calendar-resource-view", nt = [
24
+ "day",
25
+ "week",
26
+ "month",
27
+ "year",
28
+ "4day",
29
+ "agenda"
30
+ ], rt = [
31
+ "timeline-day",
32
+ "timeline-3day",
33
+ "timeline-week",
34
+ "resource-day",
35
+ "resource-week"
36
+ ];
37
+ function $(t) {
38
+ return typeof t == "string" && nt.includes(t);
39
+ }
40
+ function x(t) {
41
+ return typeof t == "string" && rt.includes(t);
42
+ }
43
+ function F() {
44
+ return typeof window < "u" && typeof window.localStorage < "u";
45
+ }
46
+ function K(t) {
47
+ if (!F()) return null;
48
+ try {
49
+ return window.localStorage.getItem(t);
50
+ } catch {
51
+ return console.warn(`[InnoCalendar] Failed to read "${t}" from localStorage`), null;
52
+ }
53
+ }
54
+ function G(t, e) {
55
+ if (F())
56
+ try {
57
+ window.localStorage.setItem(t, e);
58
+ } catch {
59
+ console.warn(`[InnoCalendar] Failed to write "${t}" to localStorage`);
60
+ }
61
+ }
62
+ function z(t) {
63
+ if (F())
64
+ try {
65
+ window.localStorage.removeItem(t);
66
+ } catch {
67
+ console.warn(`[InnoCalendar] Failed to remove "${t}" from localStorage`);
68
+ }
69
+ }
70
+ function at(t, e = A) {
71
+ $(t) && G(e, t);
72
+ }
73
+ function ot(t = A) {
74
+ const e = K(t);
75
+ return $(e) ? e : null;
76
+ }
77
+ function bt(t = A) {
78
+ z(t);
79
+ }
80
+ function st(t, e = v) {
81
+ x(t) && G(e, t);
82
+ }
83
+ function ut(t = v) {
84
+ const e = K(t);
85
+ return x(e) ? e : null;
86
+ }
87
+ function Mt(t = v) {
88
+ z(t);
89
+ }
90
+ function It(t, e) {
91
+ const n = P(e);
92
+ if (n) {
93
+ if ($(t)) {
94
+ at(t, n.gridKey);
95
+ return;
96
+ }
97
+ x(t) && st(t, n.resourceKey);
98
+ }
99
+ }
100
+ function it() {
101
+ if (!F()) return null;
102
+ try {
103
+ const t = window.localStorage.getItem(et);
104
+ if (!t) return null;
105
+ const n = JSON.parse(t)?.view;
106
+ return $(n) || x(n) ? n : null;
107
+ } catch {
108
+ return null;
109
+ }
110
+ }
111
+ function Ht(t) {
112
+ const e = P(t);
113
+ if (!e) return null;
114
+ const n = !t?.storageKey || t.storageKey === B ? it() : null;
115
+ return ot(e.gridKey) ?? ut(e.resourceKey) ?? n;
116
+ }
117
+ const kt = 640, $t = '[data-ic-layer],[data-radix-popper-content-wrapper],[data-radix-portal],[role="dialog"],[role="alertdialog"]', xt = "inline-flex h-9 shrink-0 items-center rounded-md border border-border px-4 text-sm font-medium hover:bg-accent hover:text-accent-foreground", Ft = "flex size-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground", Ct = [
118
+ "day",
119
+ "week",
120
+ "month",
121
+ "year",
122
+ "agenda",
123
+ "resource-day",
124
+ "resource-week",
125
+ "timeline-day",
126
+ "timeline-week"
127
+ ], Rt = {
128
+ startHour: 8,
129
+ endHour: 18,
130
+ firstDayOfWeek: 1,
131
+ // Monday
132
+ slotDuration: 30,
133
+ showWeekends: !0,
134
+ timeFormat: "24h",
135
+ badgeVariant: "colored",
136
+ showCanceledEvents: !1
137
+ }, _t = {
138
+ startHour: 0,
139
+ endHour: 24
140
+ }, Ot = {
141
+ startHour: 8,
142
+ endHour: 18
143
+ }, At = {
144
+ day: {
145
+ type: "day",
146
+ slotMinTime: "00:00",
147
+ slotMaxTime: "24:00",
148
+ slotDuration: "00:30:00",
149
+ scrollTime: "08:00:00",
150
+ allDaySlot: !0
151
+ },
152
+ "4day": {
153
+ type: "4day",
154
+ slotMinTime: "00:00",
155
+ slotMaxTime: "24:00",
156
+ slotDuration: "00:30:00",
157
+ scrollTime: "08:00:00",
158
+ dayMaxEventRows: 3,
159
+ allDaySlot: !0
160
+ },
161
+ week: {
162
+ type: "week",
163
+ slotMinTime: "00:00",
164
+ slotMaxTime: "24:00",
165
+ slotDuration: "00:30:00",
166
+ scrollTime: "08:00:00",
167
+ dayMaxEventRows: 3,
168
+ allDaySlot: !0
169
+ },
170
+ month: {
171
+ type: "month",
172
+ dayMaxEventRows: 4,
173
+ eventMaxStack: 3,
174
+ allDaySlot: !1
175
+ },
176
+ year: {
177
+ type: "year",
178
+ dayMaxEventRows: 2,
179
+ allDaySlot: !1
180
+ },
181
+ agenda: {
182
+ type: "agenda",
183
+ allDaySlot: !1
184
+ },
185
+ "resource-day": {
186
+ type: "resource-day",
187
+ slotMinTime: "00:00",
188
+ slotMaxTime: "24:00",
189
+ slotDuration: "00:30:00",
190
+ scrollTime: "08:00:00",
191
+ allDaySlot: !0
192
+ },
193
+ "resource-week": {
194
+ type: "resource-week",
195
+ slotMinTime: "00:00",
196
+ slotMaxTime: "24:00",
197
+ slotDuration: "00:30:00",
198
+ scrollTime: "08:00:00",
199
+ allDaySlot: !0
200
+ },
201
+ "timeline-day": {
202
+ type: "timeline-day",
203
+ slotDuration: "01:00:00"
204
+ },
205
+ "timeline-3day": {
206
+ type: "timeline-3day",
207
+ slotDuration: "01:00:00"
208
+ },
209
+ "timeline-week": {
210
+ type: "timeline-week",
211
+ slotDuration: "01:00:00"
212
+ }
213
+ }, vt = {
214
+ blue: "#3b82f6",
215
+ green: "#22c55e",
216
+ red: "#ef4444",
217
+ yellow: "#eab308",
218
+ purple: "#a855f7",
219
+ orange: "#f97316",
220
+ pink: "#ec4899",
221
+ teal: "#14b8a6",
222
+ gray: "#6b7280",
223
+ indigo: "#6366f1"
224
+ }, Wt = {
225
+ blue: { bg: "bg-blue-100", text: "text-blue-800", border: "border-blue-300" },
226
+ green: { bg: "bg-green-100", text: "text-green-800", border: "border-green-300" },
227
+ red: { bg: "bg-red-100", text: "text-red-800", border: "border-red-300" },
228
+ yellow: { bg: "bg-yellow-100", text: "text-yellow-800", border: "border-yellow-300" },
229
+ purple: { bg: "bg-purple-100", text: "text-purple-800", border: "border-purple-300" },
230
+ orange: { bg: "bg-orange-100", text: "text-orange-800", border: "border-orange-300" },
231
+ pink: { bg: "bg-pink-100", text: "text-pink-800", border: "border-pink-300" },
232
+ teal: { bg: "bg-teal-100", text: "text-teal-800", border: "border-teal-300" },
233
+ gray: { bg: "bg-gray-100", text: "text-gray-800", border: "border-gray-300" },
234
+ indigo: { bg: "bg-indigo-100", text: "text-indigo-800", border: "border-indigo-300" }
235
+ }, Lt = {
236
+ "#3b82f6": "blue",
237
+ "#22c55e": "green",
238
+ "#ef4444": "red",
239
+ "#eab308": "yellow",
240
+ "#a855f7": "purple",
241
+ "#f97316": "orange",
242
+ "#ec4899": "pink",
243
+ "#14b8a6": "teal",
244
+ "#6b7280": "gray",
245
+ "#6366f1": "indigo"
246
+ }, Yt = 24, Ut = 60, ct = 60 * 1e3, lt = 60 * ct, Vt = 24 * lt, C = 48, Nt = 32, Bt = 56, Pt = 200, ft = 20;
247
+ function d(t) {
248
+ const e = new Date(t);
249
+ return e.setHours(0, 0, 0, 0), e;
250
+ }
251
+ function p(t) {
252
+ const e = new Date(t);
253
+ return e.setHours(23, 59, 59, 999), e;
254
+ }
255
+ function i(t, e) {
256
+ const n = new Date(t);
257
+ return n.setDate(n.getDate() + e), n;
258
+ }
259
+ function Kt(t, e) {
260
+ return i(t, -e);
261
+ }
262
+ function w(t, e) {
263
+ return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate();
264
+ }
265
+ function j(t) {
266
+ return w(t, /* @__PURE__ */ new Date());
267
+ }
268
+ function Gt(t) {
269
+ return t.getDay();
270
+ }
271
+ function J(t) {
272
+ const e = t.getDay();
273
+ return e === 0 || e === 6;
274
+ }
275
+ function m(t, e = 1) {
276
+ const n = new Date(t), r = n.getDay(), a = (r < e ? 7 : 0) + r - e;
277
+ return n.setDate(n.getDate() - a), n.setHours(0, 0, 0, 0), n;
278
+ }
279
+ function T(t, e = 1) {
280
+ const n = m(t, e);
281
+ return n.setDate(n.getDate() + 6), n.setHours(23, 59, 59, 999), n;
282
+ }
283
+ function k(t, e) {
284
+ return i(t, e * 7);
285
+ }
286
+ function zt(t, e) {
287
+ return i(t, -e * 7);
288
+ }
289
+ function jt(t) {
290
+ const e = new Date(Date.UTC(t.getFullYear(), t.getMonth(), t.getDate())), n = e.getUTCDay() || 7;
291
+ e.setUTCDate(e.getUTCDate() + 4 - n);
292
+ const r = new Date(Date.UTC(e.getUTCFullYear(), 0, 1));
293
+ return Math.ceil(((e.getTime() - r.getTime()) / 864e5 + 1) / 7);
294
+ }
295
+ function Jt(t, e, n = 1) {
296
+ const r = m(t, n), a = m(e, n);
297
+ return w(r, a);
298
+ }
299
+ function S(t) {
300
+ const e = new Date(t);
301
+ return e.setDate(1), e.setHours(0, 0, 0, 0), e;
302
+ }
303
+ function b(t) {
304
+ const e = new Date(t.getFullYear(), t.getMonth() + 1, 0);
305
+ return e.setHours(23, 59, 59, 999), e;
306
+ }
307
+ function R(t, e) {
308
+ const n = new Date(t);
309
+ return n.setMonth(n.getMonth() + e), n;
310
+ }
311
+ function Xt(t, e) {
312
+ return R(t, -e);
313
+ }
314
+ function qt(t) {
315
+ return new Date(t.getFullYear(), t.getMonth() + 1, 0).getDate();
316
+ }
317
+ function W(t, e) {
318
+ return t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
319
+ }
320
+ function X(t) {
321
+ return new Date(t.getFullYear(), 0, 1, 0, 0, 0, 0);
322
+ }
323
+ function dt(t) {
324
+ return new Date(t.getFullYear(), 11, 31, 23, 59, 59, 999);
325
+ }
326
+ function L(t, e) {
327
+ const n = new Date(t);
328
+ return n.setFullYear(n.getFullYear() + e), n;
329
+ }
330
+ function Qt(t, e) {
331
+ return L(t, -e);
332
+ }
333
+ function Zt(t, e) {
334
+ return t.getFullYear() === e.getFullYear();
335
+ }
336
+ function gt(t, e) {
337
+ const n = new Date(t);
338
+ return n.setHours(n.getHours() + e), n;
339
+ }
340
+ function te(t, e) {
341
+ const n = new Date(t);
342
+ return n.setMinutes(n.getMinutes() + e), n;
343
+ }
344
+ function ee(t, e, n = 0, r = 0) {
345
+ const a = new Date(t);
346
+ return a.setHours(e, n, r, 0), a;
347
+ }
348
+ function ne(t) {
349
+ return t.getHours() + t.getMinutes() / 60;
350
+ }
351
+ function re(t, e) {
352
+ return t.getTime() < e.getTime();
353
+ }
354
+ function ae(t, e) {
355
+ return t.getTime() > e.getTime();
356
+ }
357
+ function oe(t, e, n) {
358
+ const r = t.getTime();
359
+ return r >= e.getTime() && r <= n.getTime();
360
+ }
361
+ function se(t) {
362
+ if (t.length !== 0)
363
+ return t.reduce((e, n) => n < e ? n : e);
364
+ }
365
+ function ue(t) {
366
+ if (t.length !== 0)
367
+ return t.reduce((e, n) => n > e ? n : e);
368
+ }
369
+ function Y(t, e) {
370
+ return t.getTime() - e.getTime();
371
+ }
372
+ function ie(t, e) {
373
+ return Math.floor(Y(t, e) / 6e4);
374
+ }
375
+ function ce(t, e) {
376
+ return Math.floor(Y(t, e) / 36e5);
377
+ }
378
+ function le(t, e) {
379
+ const n = d(t), r = d(e);
380
+ return Math.floor(Y(n, r) / 864e5);
381
+ }
382
+ function I(t, e = "24h") {
383
+ const n = t.getHours(), r = t.getMinutes();
384
+ if (e === "12h") {
385
+ const a = n >= 12 ? "PM" : "AM";
386
+ return `${n % 12 || 12}:${r.toString().padStart(2, "0")} ${a}`;
387
+ }
388
+ return `${n.toString().padStart(2, "0")}:${r.toString().padStart(2, "0")}`;
389
+ }
390
+ function fe(t) {
391
+ const e = t.getFullYear(), n = (t.getMonth() + 1).toString().padStart(2, "0"), r = t.getDate().toString().padStart(2, "0");
392
+ return `${e}-${n}-${r}`;
393
+ }
394
+ function de(t) {
395
+ return new Date(t);
396
+ }
397
+ function mt(t, e) {
398
+ const n = [];
399
+ let r = d(t);
400
+ const a = d(e);
401
+ for (; r <= a; )
402
+ n.push(new Date(r)), r = i(r, 1);
403
+ return n;
404
+ }
405
+ function ge(t, e) {
406
+ const n = [];
407
+ let r = new Date(t);
408
+ for (; r <= e; )
409
+ n.push(new Date(r)), r = gt(r, 1);
410
+ return n;
411
+ }
412
+ function me(t = "en-US", e = "short") {
413
+ const n = new Intl.DateTimeFormat(t, { weekday: e }), r = [], a = new Date(2024, 0, 7);
414
+ for (let o = 0; o < 7; o++)
415
+ r.push(n.format(i(a, o)));
416
+ return r;
417
+ }
418
+ function De(t = "en-US", e = "long") {
419
+ const n = new Intl.DateTimeFormat(t, { month: e }), r = [];
420
+ for (let a = 0; a < 12; a++)
421
+ r.push(n.format(new Date(2024, a, 1)));
422
+ return r;
423
+ }
424
+ function ye(t) {
425
+ const e = [];
426
+ for (let n = t.startHour; n <= t.endHour; n++)
427
+ e.push(n);
428
+ return e;
429
+ }
430
+ function he(t, e = "24h") {
431
+ if (e === "12h") {
432
+ const n = t >= 12 ? "PM" : "AM";
433
+ return `${t % 12 || 12} ${n}`;
434
+ }
435
+ return `${String(t).padStart(2, "0")}:00`;
436
+ }
437
+ function pe(t, e = 1) {
438
+ const n = m(t, e), r = [];
439
+ for (let a = 0; a < 7; a++)
440
+ r.push(i(n, a));
441
+ return r;
442
+ }
443
+ function we(t, e = 1) {
444
+ const n = S(t), r = b(t), a = m(n, e), o = T(r, e), s = t.getMonth();
445
+ return mt(a, o).map((c) => ({
446
+ date: c,
447
+ isCurrentMonth: c.getMonth() === s,
448
+ isWeekend: c.getDay() === 0 || c.getDay() === 6
449
+ }));
450
+ }
451
+ function U(t) {
452
+ if (t.isAllDay === !0) return !0;
453
+ if (t.isAllDay === !1) return !1;
454
+ const e = t.startDate.getHours(), n = t.startDate.getMinutes(), r = t.endDate.getHours(), a = t.endDate.getMinutes(), o = e === 0 && n === 0, s = r === 0 && a === 0 || // midnight next day
455
+ r === 23 && a >= 59;
456
+ return !!(o && s);
457
+ }
458
+ function Te(t) {
459
+ const e = [], n = [];
460
+ for (const r of t)
461
+ U(r) ? n.push(r) : w(r.startDate, r.endDate) ? e.push(r) : n.push(r);
462
+ return { singleDay: e, multiDay: n };
463
+ }
464
+ function Ee(t, e, n) {
465
+ return t.filter((r) => r.startDate <= n && r.endDate >= e);
466
+ }
467
+ function Se(t, e, n) {
468
+ if (!n) return !0;
469
+ const r = t.getDay(), a = n[r];
470
+ return !a || !(a.enabled !== !1) || a.from === a.to ? !1 : e >= a.from && e < a.to;
471
+ }
472
+ function be(t, e) {
473
+ const n = t.getDay(), r = e[n];
474
+ return !r || !(r.enabled !== !1) || r.from === r.to ? null : { from: r.from, to: r.to };
475
+ }
476
+ function Me(t) {
477
+ const e = [];
478
+ for (let n = 0; n < 12; n++)
479
+ e.push(new Date(t, n, 1));
480
+ return e;
481
+ }
482
+ function Dt(t, e, n) {
483
+ const r = d(e), a = p(n);
484
+ return t.filter((o) => {
485
+ const s = o.startDate, u = o.endDate;
486
+ return s <= a && u >= r;
487
+ });
488
+ }
489
+ function yt(t, e) {
490
+ return e.length === 0 ? t : t.filter(
491
+ (n) => n.scheduleTypeId !== void 0 && e.includes(n.scheduleTypeId)
492
+ );
493
+ }
494
+ function ht(t, e) {
495
+ return e.length === 0 ? t : t.filter(
496
+ (n) => n.resourceId !== void 0 && e.includes(n.resourceId)
497
+ );
498
+ }
499
+ function pt(t, e) {
500
+ if (!e.trim()) return t;
501
+ const n = e.toLowerCase();
502
+ return t.filter((r) => {
503
+ const a = H(r.title).toLowerCase().includes(n), o = H(r.description).toLowerCase().includes(n);
504
+ return a || o;
505
+ });
506
+ }
507
+ function wt(t) {
508
+ return t.filter((e) => !e.isCanceled);
509
+ }
510
+ function Ie(t, e) {
511
+ let n = [...t];
512
+ return e.dateRange && (n = Dt(
513
+ n,
514
+ e.dateRange.startDate,
515
+ e.dateRange.endDate
516
+ )), e.scheduleTypeIds && e.scheduleTypeIds.length > 0 && (n = yt(n, e.scheduleTypeIds)), e.resourceIds && e.resourceIds.length > 0 && (n = ht(n, e.resourceIds)), e.search && (n = pt(n, e.search)), e.showCanceled || (n = wt(n)), n;
517
+ }
518
+ function He(t) {
519
+ return [...t].sort((e, n) => e.startDate.getTime() - n.startDate.getTime());
520
+ }
521
+ function ke(t) {
522
+ return [...t].sort((e, n) => e.endDate.getTime() - n.endDate.getTime());
523
+ }
524
+ function $e(t) {
525
+ return [...t].sort((e, n) => {
526
+ const r = e.endDate.getTime() - e.startDate.getTime();
527
+ return n.endDate.getTime() - n.startDate.getTime() - r;
528
+ });
529
+ }
530
+ function xe(t) {
531
+ const e = /* @__PURE__ */ new Map();
532
+ for (const n of t) {
533
+ const r = d(n.startDate).toISOString(), a = e.get(r) ?? [];
534
+ a.push(n), e.set(r, a);
535
+ }
536
+ return e;
537
+ }
538
+ function Fe(t) {
539
+ const e = /* @__PURE__ */ new Map();
540
+ for (const n of t) {
541
+ const r = e.get(n.scheduleTypeId) ?? [];
542
+ r.push(n), e.set(n.scheduleTypeId, r);
543
+ }
544
+ return e;
545
+ }
546
+ function Ce(t) {
547
+ const e = /* @__PURE__ */ new Map();
548
+ for (const n of t) {
549
+ const r = e.get(n.resourceId) ?? [];
550
+ r.push(n), e.set(n.resourceId, r);
551
+ }
552
+ return e;
553
+ }
554
+ function Re(t, e) {
555
+ return t.filter((n) => {
556
+ const r = d(e), a = p(e);
557
+ return n.startDate <= a && n.endDate >= r;
558
+ });
559
+ }
560
+ function _e(t) {
561
+ return t.filter((e) => e.isAllDay);
562
+ }
563
+ function Oe(t) {
564
+ return t.filter((e) => !e.isAllDay);
565
+ }
566
+ function Ae(t) {
567
+ return t.filter((e) => e.isMultiDay ? !0 : !w(e.startDate, e.endDate));
568
+ }
569
+ function ve(t) {
570
+ return t.isMultiDay ? !0 : !w(t.startDate, t.endDate);
571
+ }
572
+ function We(t) {
573
+ return Math.floor((t.endDate.getTime() - t.startDate.getTime()) / 6e4);
574
+ }
575
+ function Le(t, e = "blue") {
576
+ return t.color ?? e;
577
+ }
578
+ function Ye(t, e, n = "blue") {
579
+ if (t.color) return t.color;
580
+ if (t.scheduleTypeId !== void 0 && e) {
581
+ const r = e.get(t.scheduleTypeId);
582
+ if (r) return r;
583
+ }
584
+ return n;
585
+ }
586
+ function Ue(t) {
587
+ if (U(t)) {
588
+ if (w(t.startDate, t.endDate))
589
+ return "All day";
590
+ const n = t.startDate.toLocaleDateString(void 0, {
591
+ month: "short",
592
+ day: "numeric"
593
+ }), r = t.endDate.toLocaleDateString(void 0, {
594
+ month: "short",
595
+ day: "numeric"
596
+ });
597
+ return `All day · ${n} – ${r}`;
598
+ }
599
+ if (!w(t.startDate, t.endDate)) {
600
+ const n = t.startDate.toLocaleDateString(void 0, {
601
+ month: "short",
602
+ day: "numeric"
603
+ }), r = t.endDate.toLocaleDateString(void 0, {
604
+ month: "short",
605
+ day: "numeric"
606
+ });
607
+ return `${n}, ${I(t.startDate)} – ${r}, ${I(t.endDate)}`;
608
+ }
609
+ return `${I(t.startDate)} - ${I(t.endDate)}`;
610
+ }
611
+ function Ve(t) {
612
+ return !U(t);
613
+ }
614
+ function O(t, { locale: e, hour12: n = !1 } = {}) {
615
+ return new Intl.DateTimeFormat(e, {
616
+ hour: "2-digit",
617
+ minute: "2-digit",
618
+ ...n ? { hour12: !0 } : { hourCycle: "h23" }
619
+ }).format(t);
620
+ }
621
+ function Ne(t, e, n = {}) {
622
+ return `${O(t, n)} – ${O(e, n)}`;
623
+ }
624
+ function Be(t, { locale: e, hour12: n = !1 } = {}) {
625
+ if (!n) return O(t, { locale: e, hour12: n });
626
+ const r = t.getMinutes() !== 0;
627
+ return new Intl.DateTimeFormat(e, {
628
+ hour: "numeric",
629
+ ...r && { minute: "2-digit" },
630
+ hour12: !0
631
+ }).format(t).replace(/\s+/g, "").toLowerCase();
632
+ }
633
+ function Tt(t, e, n = 1) {
634
+ switch (e) {
635
+ case "day":
636
+ case "resource-day":
637
+ case "timeline-day":
638
+ return {
639
+ startDate: d(t),
640
+ endDate: p(t)
641
+ };
642
+ case "week":
643
+ case "resource-week":
644
+ case "timeline-week":
645
+ return {
646
+ startDate: m(t, n),
647
+ endDate: T(t, n)
648
+ };
649
+ case "month": {
650
+ const r = S(t), a = b(t);
651
+ return {
652
+ startDate: m(r, n),
653
+ endDate: T(a, n)
654
+ };
655
+ }
656
+ case "timeline-3day":
657
+ return {
658
+ startDate: d(t),
659
+ endDate: p(i(t, 2))
660
+ };
661
+ case "year":
662
+ return {
663
+ startDate: X(t),
664
+ endDate: dt(t)
665
+ };
666
+ case "4day":
667
+ return {
668
+ startDate: d(t),
669
+ endDate: p(i(t, 3))
670
+ };
671
+ case "agenda":
672
+ return {
673
+ startDate: d(t),
674
+ endDate: p(i(t, 29))
675
+ };
676
+ default:
677
+ return {
678
+ startDate: d(t),
679
+ endDate: p(t)
680
+ };
681
+ }
682
+ }
683
+ function Pe(t, e) {
684
+ switch (e) {
685
+ case "day":
686
+ case "resource-day":
687
+ case "timeline-day":
688
+ return i(t, 1);
689
+ case "timeline-3day":
690
+ return i(t, 3);
691
+ case "4day":
692
+ return i(t, 4);
693
+ case "week":
694
+ case "resource-week":
695
+ case "timeline-week":
696
+ return k(t, 1);
697
+ case "month":
698
+ return R(t, 1);
699
+ case "year":
700
+ return L(t, 1);
701
+ case "agenda":
702
+ return k(t, 1);
703
+ default:
704
+ return i(t, 1);
705
+ }
706
+ }
707
+ function Ke(t, e) {
708
+ switch (e) {
709
+ case "day":
710
+ case "resource-day":
711
+ case "timeline-day":
712
+ return i(t, -1);
713
+ case "timeline-3day":
714
+ return i(t, -3);
715
+ case "4day":
716
+ return i(t, -4);
717
+ case "week":
718
+ case "resource-week":
719
+ case "timeline-week":
720
+ return k(t, -1);
721
+ case "month":
722
+ return R(t, -1);
723
+ case "year":
724
+ return L(t, -1);
725
+ case "agenda":
726
+ return k(t, -1);
727
+ default:
728
+ return i(t, -1);
729
+ }
730
+ }
731
+ function Ge() {
732
+ return d(/* @__PURE__ */ new Date());
733
+ }
734
+ function ze(t, e = 1) {
735
+ const n = S(t), r = b(t), a = m(n, e), o = T(r, e), s = [];
736
+ let u = a;
737
+ for (; u <= o; )
738
+ s.push({
739
+ date: new Date(u),
740
+ isToday: j(u),
741
+ isCurrentMonth: W(u, t),
742
+ isWeekend: J(u),
743
+ dayOfWeek: u.getDay()
744
+ }), u = i(u, 1);
745
+ return s;
746
+ }
747
+ function je(t, e = 1) {
748
+ const n = m(t, e), r = [];
749
+ for (let a = 0; a < 7; a++) {
750
+ const o = i(n, a);
751
+ r.push({
752
+ date: o,
753
+ isToday: j(o),
754
+ isCurrentMonth: W(o, t),
755
+ isWeekend: J(o),
756
+ dayOfWeek: o.getDay()
757
+ });
758
+ }
759
+ return r;
760
+ }
761
+ function Je(t) {
762
+ const e = X(t), n = [];
763
+ for (let r = 0; r < 12; r++) {
764
+ const a = R(e, r);
765
+ n.push({
766
+ date: a,
767
+ isToday: W(a, /* @__PURE__ */ new Date()),
768
+ isCurrentMonth: !0,
769
+ isWeekend: !1,
770
+ dayOfWeek: a.getDay()
771
+ });
772
+ }
773
+ return n;
774
+ }
775
+ function Xe(t, e, n = 30) {
776
+ const r = [], a = 60 / n;
777
+ for (let o = t; o < e; o++)
778
+ for (let s = 0; s < a; s++) {
779
+ const u = s * n;
780
+ r.push({
781
+ hour: o,
782
+ minute: u,
783
+ label: `${o.toString().padStart(2, "0")}:${u.toString().padStart(2, "0")}`
784
+ });
785
+ }
786
+ return r;
787
+ }
788
+ function qe(t, e, n = "24h") {
789
+ const r = [];
790
+ for (let a = t; a <= e; a++) {
791
+ let o;
792
+ if (n === "12h") {
793
+ const s = a >= 12 ? "PM" : "AM";
794
+ o = `${a % 12 || 12} ${s}`;
795
+ } else
796
+ o = `${a.toString().padStart(2, "0")}:00`;
797
+ r.push({ hour: a, label: o });
798
+ }
799
+ return r;
800
+ }
801
+ function Qe(t, e, n = "en-US") {
802
+ const r = new Intl.DateTimeFormat(n, {
803
+ weekday: "short",
804
+ month: "short",
805
+ day: "numeric"
806
+ }), a = new Intl.DateTimeFormat(n, { month: "short", day: "numeric" });
807
+ switch (e) {
808
+ case "day":
809
+ case "resource-day":
810
+ case "timeline-day":
811
+ return r.format(t);
812
+ case "4day": {
813
+ const o = d(t), s = i(t, 3);
814
+ return `${a.format(o)} - ${a.format(s)}`;
815
+ }
816
+ case "timeline-3day": {
817
+ const o = d(t), s = i(t, 2);
818
+ return `${a.format(o)} - ${a.format(s)}`;
819
+ }
820
+ case "week":
821
+ case "resource-week":
822
+ case "timeline-week": {
823
+ const o = m(t, 1), s = T(t, 1);
824
+ return `${a.format(o)} - ${a.format(s)}`;
825
+ }
826
+ case "month": {
827
+ const o = S(t), s = b(t);
828
+ return `${a.format(o)} - ${a.format(s)}`;
829
+ }
830
+ case "year":
831
+ return `Jan 1 - Dec 31, ${t.getFullYear()}`;
832
+ case "agenda": {
833
+ const o = S(t), s = b(t);
834
+ return `${a.format(o)} - ${a.format(s)}`;
835
+ }
836
+ default:
837
+ return "";
838
+ }
839
+ }
840
+ function Ze(t, e, n, r = 1) {
841
+ const a = Tt(e, n, r);
842
+ return t.filter((o) => o.startDate <= a.endDate && o.endDate >= a.startDate).length;
843
+ }
844
+ function tn(t, e, n = "en-US") {
845
+ const r = new Intl.DateTimeFormat(n, { month: "long", year: "numeric" }), a = new Intl.DateTimeFormat(n, {
846
+ weekday: "long",
847
+ month: "long",
848
+ day: "numeric",
849
+ year: "numeric"
850
+ });
851
+ switch (e) {
852
+ case "day":
853
+ case "resource-day":
854
+ case "timeline-day":
855
+ return a.format(t);
856
+ case "week":
857
+ case "resource-week":
858
+ case "timeline-week": {
859
+ const o = m(t, 1), s = T(t, 1), u = new Intl.DateTimeFormat(n, { month: "short" }).format(o), c = new Intl.DateTimeFormat(n, { month: "short" }).format(s), l = o.getFullYear();
860
+ return u === c ? `${u} ${o.getDate()} - ${s.getDate()}, ${l}` : `${u} ${o.getDate()} - ${c} ${s.getDate()}, ${l}`;
861
+ }
862
+ case "month":
863
+ return r.format(t);
864
+ case "year":
865
+ return t.getFullYear().toString();
866
+ case "4day": {
867
+ const o = d(t), s = i(t, 3), u = new Intl.DateTimeFormat(n, { month: "short" }).format(o), c = new Intl.DateTimeFormat(n, { month: "short" }).format(s);
868
+ return u === c ? `${u} ${o.getDate()} - ${s.getDate()}, ${o.getFullYear()}` : `${u} ${o.getDate()} - ${c} ${s.getDate()}, ${o.getFullYear()}`;
869
+ }
870
+ case "agenda":
871
+ return `Agenda - ${r.format(t)}`;
872
+ default:
873
+ return r.format(t);
874
+ }
875
+ }
876
+ function en(t = 1, e = "short", n = "en-US") {
877
+ const r = new Intl.DateTimeFormat(n, { weekday: e }), a = [], o = new Date(2024, 0, 7);
878
+ for (let s = 0; s < 7; s++) {
879
+ const u = (t + s) % 7, c = i(o, u);
880
+ a.push({
881
+ dayOfWeek: u,
882
+ label: r.format(c)
883
+ });
884
+ }
885
+ return a;
886
+ }
887
+ function Et(t, e, n, r = C) {
888
+ const { startHour: a, endHour: o } = n, s = o - a, u = s * r, c = t.startDate.getHours() + t.startDate.getMinutes() / 60, l = t.endDate.getHours() + t.endDate.getMinutes() / 60, g = Math.max(c, a), h = Math.min(l, o), D = (g - a) / s * u, y = (h - a) / s * u, f = Math.max(y - D, ft);
889
+ return {
890
+ top: D,
891
+ height: f,
892
+ left: 0,
893
+ width: 100,
894
+ zIndex: 1
895
+ };
896
+ }
897
+ function nn(t, e, n, r = C) {
898
+ if (t.length === 0) return [];
899
+ const a = [...t].sort((l, g) => {
900
+ const h = l.startDate.getTime() - g.startDate.getTime();
901
+ if (h !== 0) return h;
902
+ const D = l.endDate.getTime() - l.startDate.getTime();
903
+ return g.endDate.getTime() - g.startDate.getTime() - D;
904
+ }), o = [];
905
+ let s = [], u = 0;
906
+ for (const l of a)
907
+ s.length === 0 || l.startDate.getTime() < u ? (s.push(l), u = Math.max(u, l.endDate.getTime())) : (o.push(s), s = [l], u = l.endDate.getTime());
908
+ s.length > 0 && o.push(s);
909
+ const c = [];
910
+ for (const l of o) {
911
+ const g = [];
912
+ for (const f of l) {
913
+ const q = f.startDate.getTime(), Q = f.endDate.getTime();
914
+ let E = -1;
915
+ for (let M = 0; M < g.length; M++) {
916
+ const _ = g[M];
917
+ if (!_) continue;
918
+ const N = _[_.length - 1];
919
+ if (N && N.endTime <= q) {
920
+ E = M;
921
+ break;
922
+ }
923
+ }
924
+ E === -1 && (E = g.length, g.push([]));
925
+ const V = g[E];
926
+ V && V.push({ event: f, endTime: Q });
927
+ const Z = Et(f, e, n, r);
928
+ c.push({
929
+ event: f,
930
+ position: Z,
931
+ column: E,
932
+ columnSpan: 1
933
+ });
934
+ }
935
+ const D = 100 / g.length, y = new Set(l.map((f) => f.id));
936
+ for (const f of c)
937
+ y.has(f.event.id) && (f.position.left = f.column * D, f.position.width = D * f.columnSpan, f.position.zIndex = f.column + 1);
938
+ }
939
+ return c;
940
+ }
941
+ function rn(t, e, n, r = C, a = 30) {
942
+ const { startHour: o, endHour: s } = n, u = s - o, c = u * r, l = t / c * u, h = (o + l) * 60, D = Math.round(h / a) * a, y = new Date(e);
943
+ return y.setHours(0, 0, 0, 0), y.setMinutes(D), y;
944
+ }
945
+ function an(t, e, n = C) {
946
+ const { startHour: r, endHour: a } = e, o = a - r, s = o * n, u = t.getHours() + t.getMinutes() / 60;
947
+ return (Math.max(r, Math.min(u, a)) - r) / o * s;
948
+ }
949
+ function on(t, e) {
950
+ return t.startDate < e.endDate && t.endDate > e.startDate;
951
+ }
952
+ function sn(t) {
953
+ if (t.length === 0) return [];
954
+ const e = [...t].sort((o, s) => o.startDate.getTime() - s.startDate.getTime()), n = [];
955
+ let r = [], a = 0;
956
+ for (const o of e)
957
+ r.length === 0 || o.startDate.getTime() < a ? (r.push(o), a = Math.max(a, o.endDate.getTime())) : (r.length > 0 && n.push(r), r = [o], a = o.endDate.getTime());
958
+ return r.length > 0 && n.push(r), n;
959
+ }
960
+ function un(t, e, n) {
961
+ const r = Math.max(0, Math.min(t, e)), a = Math.min(n, Math.max(t, e));
962
+ return {
963
+ top: r,
964
+ height: a - r
965
+ };
966
+ }
967
+ export {
968
+ fe as $,
969
+ U as A,
970
+ le as B,
971
+ Ct as C,
972
+ Ot as D,
973
+ vt as E,
974
+ ce as F,
975
+ Y as G,
976
+ Lt as H,
977
+ ie as I,
978
+ mt as J,
979
+ ge as K,
980
+ p as L,
981
+ Ut as M,
982
+ b as N,
983
+ T as O,
984
+ et as P,
985
+ dt as Q,
986
+ v as R,
987
+ on as S,
988
+ Dt as T,
989
+ ht as U,
990
+ yt as V,
991
+ pt as W,
992
+ wt as X,
993
+ O as Y,
994
+ Be as Z,
995
+ Ne as _,
996
+ A as a,
997
+ Te as a$,
998
+ Ue as a0,
999
+ he as a1,
1000
+ I as a2,
1001
+ qe as a3,
1002
+ ze as a4,
1003
+ we as a5,
1004
+ Xe as a6,
1005
+ je as a7,
1006
+ Je as a8,
1007
+ _e as a9,
1008
+ re as aA,
1009
+ oe as aB,
1010
+ $ as aC,
1011
+ ve as aD,
1012
+ x as aE,
1013
+ w as aF,
1014
+ W as aG,
1015
+ Jt as aH,
1016
+ Zt as aI,
1017
+ j as aJ,
1018
+ J as aK,
1019
+ Se as aL,
1020
+ ue as aM,
1021
+ se as aN,
1022
+ Pe as aO,
1023
+ Ke as aP,
1024
+ Ge as aQ,
1025
+ de as aR,
1026
+ H as aS,
1027
+ ot as aT,
1028
+ Ht as aU,
1029
+ it as aV,
1030
+ ut as aW,
1031
+ Ye as aX,
1032
+ at as aY,
1033
+ st as aZ,
1034
+ It as a_,
1035
+ Gt as aa,
1036
+ qt as ab,
1037
+ ne as ac,
1038
+ Le as ad,
1039
+ We as ae,
1040
+ Ze as af,
1041
+ Re as ag,
1042
+ Ee as ah,
1043
+ De as ai,
1044
+ Ae as aj,
1045
+ sn as ak,
1046
+ Qe as al,
1047
+ Oe as am,
1048
+ Tt as an,
1049
+ tn as ao,
1050
+ ye as ap,
1051
+ pe as aq,
1052
+ jt as ar,
1053
+ en as as,
1054
+ me as at,
1055
+ be as au,
1056
+ Me as av,
1057
+ xe as aw,
1058
+ Ce as ax,
1059
+ Fe as ay,
1060
+ ae as az,
1061
+ Bt as b,
1062
+ ee as b0,
1063
+ Ve as b1,
1064
+ $e as b2,
1065
+ ke as b3,
1066
+ He as b4,
1067
+ d as b5,
1068
+ S as b6,
1069
+ m as b7,
1070
+ X as b8,
1071
+ Kt as b9,
1072
+ Xt as ba,
1073
+ zt as bb,
1074
+ Qt as bc,
1075
+ an as bd,
1076
+ rn as be,
1077
+ kt as bf,
1078
+ $t as bg,
1079
+ xt as bh,
1080
+ Ft as bi,
1081
+ C as c,
1082
+ Rt as d,
1083
+ Pt as e,
1084
+ Nt as f,
1085
+ At as g,
1086
+ _t as h,
1087
+ Wt as i,
1088
+ Yt as j,
1089
+ ft as k,
1090
+ Vt as l,
1091
+ lt as m,
1092
+ ct as n,
1093
+ i as o,
1094
+ gt as p,
1095
+ te as q,
1096
+ R as r,
1097
+ k as s,
1098
+ L as t,
1099
+ Ie as u,
1100
+ Et as v,
1101
+ nn as w,
1102
+ un as x,
1103
+ bt as y,
1104
+ Mt as z
1105
+ };
1106
+ //# sourceMappingURL=position-utils-CBSmf90e.js.map