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