mn-angular-lib 1.0.178 → 1.0.179
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.
- package/fesm2022/mn-angular-lib-alert.mjs +535 -0
- package/fesm2022/mn-angular-lib-alert.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs +356 -0
- package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-button.mjs +382 -0
- package/fesm2022/mn-angular-lib-button.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-calendar-core.mjs +377 -0
- package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-calendar.mjs +1513 -0
- package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-collection.mjs +2277 -0
- package/fesm2022/mn-angular-lib-collection.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-core.mjs +1232 -0
- package/fesm2022/mn-angular-lib-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-display.mjs +728 -0
- package/fesm2022/mn-angular-lib-display.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-forms.mjs +4260 -0
- package/fesm2022/mn-angular-lib-forms.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-keyboard.mjs +195 -0
- package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal-core.mjs +945 -0
- package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal-ui.mjs +2016 -0
- package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-modal.mjs +126 -0
- package/fesm2022/mn-angular-lib-modal.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs +275 -0
- package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-segmented.mjs +246 -0
- package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -0
- package/fesm2022/mn-angular-lib-tab.mjs +573 -0
- package/fesm2022/mn-angular-lib-tab.mjs.map +1 -0
- package/fesm2022/mn-angular-lib.mjs +21 -15517
- package/fesm2022/mn-angular-lib.mjs.map +1 -1
- package/package.json +66 -1
- package/src/lib/styles/index.css +2 -2
- package/types/mn-angular-lib-alert.d.ts +258 -0
- package/types/mn-angular-lib-bottom-sheet.d.ts +173 -0
- package/types/mn-angular-lib-button.d.ts +318 -0
- package/types/mn-angular-lib-calendar-core.d.ts +378 -0
- package/types/mn-angular-lib-calendar.d.ts +636 -0
- package/types/mn-angular-lib-collection.d.ts +1550 -0
- package/types/mn-angular-lib-core.d.ts +756 -0
- package/types/mn-angular-lib-display.d.ts +1075 -0
- package/types/mn-angular-lib-forms.d.ts +3235 -0
- package/types/mn-angular-lib-keyboard.d.ts +128 -0
- package/types/mn-angular-lib-modal-core.d.ts +1130 -0
- package/types/mn-angular-lib-modal-ui.d.ts +492 -0
- package/types/mn-angular-lib-modal.d.ts +27 -0
- package/types/mn-angular-lib-rich-text-editor.d.ts +157 -0
- package/types/mn-angular-lib-segmented.d.ts +395 -0
- package/types/mn-angular-lib-tab.d.ts +313 -0
- package/types/mn-angular-lib.d.ts +16 -10822
- /package/{src/lib/features → alert/src}/mn-alert/mn-alert-outlet/mn-alert-outlet.css +0 -0
- /package/{src/lib/features → bottom-sheet/src}/mn-bottom-sheet/mn-bottom-sheet.component.css +0 -0
- /package/{src/lib/features → button/src}/mn-skeleton/mn-skeleton.css +0 -0
- /package/{src/lib/features → collection/src}/mn-list/mn-list.component.css +0 -0
- /package/{src/lib/features → forms/src}/mn-checkbox/mn-checkbox.css +0 -0
- /package/{src/lib/features → forms/src}/mn-dropdown/mn-dropdown.css +0 -0
- /package/{src/lib/features → forms/src}/mn-multi-select/mn-multi-select.css +0 -0
- /package/{src/lib/features → keyboard/src}/mn-keyboard/mn-keyboard.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-form-body/mn-form-body.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +0 -0
- /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-wizard-body/mn-wizard-body.component.css +0 -0
- /package/{src/lib/features → rich-text-editor/src}/mn-rich-text-editor/mn-rich-text-editor.component.css +0 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Injectable } from '@angular/core';
|
|
3
|
+
import { provideMnComponentConfig } from 'mn-angular-lib/core';
|
|
4
|
+
import { of } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Available calendar view modes.
|
|
8
|
+
*/
|
|
9
|
+
var CalendarView;
|
|
10
|
+
(function (CalendarView) {
|
|
11
|
+
CalendarView["MONTH"] = "MONTH";
|
|
12
|
+
CalendarView["WEEK"] = "WEEK";
|
|
13
|
+
CalendarView["DAY"] = "DAY";
|
|
14
|
+
})(CalendarView || (CalendarView = {}));
|
|
15
|
+
/**
|
|
16
|
+
* Builds locale-derived day name arrays from a BCP 47 locale string.
|
|
17
|
+
* Uses January 1 2024 (a Monday) as the reference date.
|
|
18
|
+
*/
|
|
19
|
+
function buildDayNames(locale) {
|
|
20
|
+
const base = new Date(2024, 0, 1); // 2024-01-01 is a Monday
|
|
21
|
+
const short = [];
|
|
22
|
+
const long = [];
|
|
23
|
+
for (let i = 0; i < 7; i++) {
|
|
24
|
+
const d = new Date(base);
|
|
25
|
+
d.setDate(base.getDate() + i);
|
|
26
|
+
short.push(d.toLocaleDateString(locale, { weekday: 'short' }));
|
|
27
|
+
long.push(d.toLocaleDateString(locale, { weekday: 'long' }));
|
|
28
|
+
}
|
|
29
|
+
return { short, long };
|
|
30
|
+
}
|
|
31
|
+
/** Default calendar configuration values. */
|
|
32
|
+
const DEFAULT_CALENDAR_CONFIG = (() => {
|
|
33
|
+
const locale = 'en-US';
|
|
34
|
+
const names = buildDayNames(locale);
|
|
35
|
+
return {
|
|
36
|
+
startHour: 7,
|
|
37
|
+
endHour: 22,
|
|
38
|
+
locale,
|
|
39
|
+
todayLabel: 'Today',
|
|
40
|
+
pickDateLabel: 'Pick a date',
|
|
41
|
+
previousLabel: 'Previous',
|
|
42
|
+
nextLabel: 'Next',
|
|
43
|
+
upcomingEventsTitle: 'Upcoming events',
|
|
44
|
+
noUpcomingEvents: 'No upcoming events',
|
|
45
|
+
moreEventsLabel: 'more',
|
|
46
|
+
viewLabels: { MONTH: 'Month', WEEK: 'Week', DAY: 'Day' },
|
|
47
|
+
shortDayNames: names.short,
|
|
48
|
+
longDayNames: names.long,
|
|
49
|
+
mobileBreakpoint: 768,
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
/**
|
|
53
|
+
* Injection token for the resolved calendar configuration.
|
|
54
|
+
*
|
|
55
|
+
* Prefer using {@link MN_CALENDAR_CONFIG} with `provideMnComponentConfig`
|
|
56
|
+
* so that settings can be managed via `mn-config.json5`. This token is
|
|
57
|
+
* kept for backward compatibility and manual `providers` usage.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* providers: [
|
|
62
|
+
* { provide: CALENDAR_CONFIG, useValue: { startHour: 8, endHour: 20, locale: 'nl-NL' } }
|
|
63
|
+
* ]
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
const CALENDAR_CONFIG = new InjectionToken('CalendarConfig', {
|
|
67
|
+
providedIn: 'root',
|
|
68
|
+
factory: () => DEFAULT_CALENDAR_CONFIG
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Injection token resolved via `MnConfigService` (the `mn-config.json5` system).
|
|
72
|
+
*
|
|
73
|
+
* Use the helper {@link provideMnCalendarConfig} in the component's `providers`
|
|
74
|
+
* array so that calendar settings are read from the config file and support
|
|
75
|
+
* `$translate` markers, section scoping, and instance-id overrides.
|
|
76
|
+
*
|
|
77
|
+
* Component name in the config file: `'mn-calendar'`.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```json5
|
|
81
|
+
* // mn-config.json5
|
|
82
|
+
* {
|
|
83
|
+
* defaults: {
|
|
84
|
+
* "mn-calendar": {
|
|
85
|
+
* startHour: 8,
|
|
86
|
+
* endHour: 20,
|
|
87
|
+
* locale: "nl-NL",
|
|
88
|
+
* todayLabel: { $translate: "calendar.today" }
|
|
89
|
+
* }
|
|
90
|
+
* }
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
const MN_CALENDAR_CONFIG = new InjectionToken('MN_CALENDAR_CONFIG');
|
|
95
|
+
/** Component name used to look up calendar settings in `mn-config.json5`. */
|
|
96
|
+
const MN_CALENDAR_COMPONENT_NAME = 'mn-calendar';
|
|
97
|
+
/**
|
|
98
|
+
* Provider helper that wires the calendar into the `mn-config` system.
|
|
99
|
+
*
|
|
100
|
+
* Add this to the `providers` array of the component (or module) that hosts
|
|
101
|
+
* `<mn-calendar-view>`. It reads defaults and overrides from `mn-config.json5`
|
|
102
|
+
* under the key `"mn-calendar"` and provides them via {@link MN_CALENDAR_CONFIG}.
|
|
103
|
+
*
|
|
104
|
+
* @param initial — optional partial defaults merged before config-file values.
|
|
105
|
+
*/
|
|
106
|
+
function provideMnCalendarConfig(initial) {
|
|
107
|
+
return provideMnComponentConfig(MN_CALENDAR_CONFIG, MN_CALENDAR_COMPONENT_NAME, initial);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Merges a partial config with defaults, re-deriving day names from locale when needed.
|
|
111
|
+
*/
|
|
112
|
+
function resolveCalendarConfig(partial) {
|
|
113
|
+
if (!partial)
|
|
114
|
+
return { ...DEFAULT_CALENDAR_CONFIG };
|
|
115
|
+
const locale = partial.locale ?? DEFAULT_CALENDAR_CONFIG.locale;
|
|
116
|
+
const names = buildDayNames(locale);
|
|
117
|
+
return {
|
|
118
|
+
...DEFAULT_CALENDAR_CONFIG,
|
|
119
|
+
...partial,
|
|
120
|
+
locale,
|
|
121
|
+
shortDayNames: partial.shortDayNames ?? names.short,
|
|
122
|
+
longDayNames: partial.longDayNames ?? names.long,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Injection token for the calendar date formatter.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```ts
|
|
131
|
+
* providers: [
|
|
132
|
+
* { provide: CALENDAR_DATE_FORMATTER, useClass: MyCustomFormatter }
|
|
133
|
+
* ]
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
const CALENDAR_DATE_FORMATTER = new InjectionToken('CalendarDateFormatter');
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Default implementation of {@link CalendarDateFormatter} that uses the
|
|
140
|
+
* browser's `Intl.DateTimeFormat` API for locale-aware formatting.
|
|
141
|
+
*
|
|
142
|
+
* The locale is read from the injected {@link CALENDAR_CONFIG}. If no config
|
|
143
|
+
* is provided, `'en-US'` is used as the fallback.
|
|
144
|
+
*
|
|
145
|
+
* This service has no dependency on `@ngx-translate` or any other i18n library,
|
|
146
|
+
* so the calendar library works out of the box. Consumers can replace it with
|
|
147
|
+
* their own implementation via the `CALENDAR_DATE_FORMATTER` injection token.
|
|
148
|
+
*/
|
|
149
|
+
class DefaultCalendarDateFormatter {
|
|
150
|
+
locale;
|
|
151
|
+
constructor() {
|
|
152
|
+
const config = inject(CALENDAR_CONFIG, { optional: true });
|
|
153
|
+
this.locale = config?.locale ?? DEFAULT_CALENDAR_CONFIG.locale;
|
|
154
|
+
}
|
|
155
|
+
/** Formats an hour and minute pair into a locale time string (e.g. "09:00 AM"). */
|
|
156
|
+
formatTimeI(hour, minute) {
|
|
157
|
+
const date = new Date();
|
|
158
|
+
date.setHours(hour, minute, 0, 0);
|
|
159
|
+
return Promise.resolve(date.toLocaleTimeString(this.locale, { hour: '2-digit', minute: '2-digit' }));
|
|
160
|
+
}
|
|
161
|
+
/** Formats the time portion of a Date (e.g. "2:30 PM"). Returns empty string for undefined. */
|
|
162
|
+
formatTime(date) {
|
|
163
|
+
if (!date)
|
|
164
|
+
return Promise.resolve('');
|
|
165
|
+
return Promise.resolve(date.toLocaleTimeString(this.locale, { hour: '2-digit', minute: '2-digit' }));
|
|
166
|
+
}
|
|
167
|
+
/** Formats a Date as a full date-time string (e.g. "May 15, 2026, 02:30 PM"). */
|
|
168
|
+
formatDateTime(date) {
|
|
169
|
+
return of(date.toLocaleString(this.locale, {
|
|
170
|
+
year: 'numeric', month: 'short', day: 'numeric',
|
|
171
|
+
hour: '2-digit', minute: '2-digit'
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
/** Formats a Date as a date-only string (e.g. "May 15, 2026"). */
|
|
175
|
+
formatDate(date) {
|
|
176
|
+
return of(date.toLocaleDateString(this.locale, {
|
|
177
|
+
year: 'numeric', month: 'short', day: 'numeric'
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
/** Formats a Date as `YYYY-MM-DD` for use in `<input type="date">` controls. */
|
|
181
|
+
formatDateForFormControl(date) {
|
|
182
|
+
const y = date.getFullYear();
|
|
183
|
+
const m = String(date.getMonth() + 1).padStart(2, '0');
|
|
184
|
+
const d = String(date.getDate()).padStart(2, '0');
|
|
185
|
+
return `${y}-${m}-${d}`;
|
|
186
|
+
}
|
|
187
|
+
/** Returns `true` if both dates fall on the same calendar day. */
|
|
188
|
+
isSameDay(date1, date2) {
|
|
189
|
+
return date1.getFullYear() === date2.getFullYear()
|
|
190
|
+
&& date1.getMonth() === date2.getMonth()
|
|
191
|
+
&& date1.getDate() === date2.getDate();
|
|
192
|
+
}
|
|
193
|
+
/** Formats a Date as "Month Year" (e.g. "January 2026"). */
|
|
194
|
+
formatMonthName(date) {
|
|
195
|
+
return Promise.resolve(date.toLocaleString(this.locale, { month: 'long', year: 'numeric' }));
|
|
196
|
+
}
|
|
197
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DefaultCalendarDateFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
198
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DefaultCalendarDateFormatter });
|
|
199
|
+
}
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DefaultCalendarDateFormatter, decorators: [{
|
|
201
|
+
type: Injectable
|
|
202
|
+
}], ctorParameters: () => [] });
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Service that computes the visual layout of calendar events within a
|
|
206
|
+
* time-grid (week or day view).
|
|
207
|
+
*
|
|
208
|
+
* Responsibilities:
|
|
209
|
+
* - Splitting multi-day events into per-day segments.
|
|
210
|
+
* - Assigning non-overlapping column indices to concurrent events.
|
|
211
|
+
* - Computing the width (column span) each event should occupy.
|
|
212
|
+
*
|
|
213
|
+
* This service is stateless — all state is passed via method parameters.
|
|
214
|
+
* Provide it per-component (not root) so each view gets its own instance.
|
|
215
|
+
*/
|
|
216
|
+
class CalendarEventLayoutService {
|
|
217
|
+
/**
|
|
218
|
+
* Returns `true` when two time ranges overlap (exclusive boundaries).
|
|
219
|
+
*/
|
|
220
|
+
eventsOverlap(startA, endA, startB, endB) {
|
|
221
|
+
return startA < endB && startB < endA;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Returns all events whose time range overlaps the given `[start, end)` window.
|
|
225
|
+
*/
|
|
226
|
+
getAllEventsOnSpecificTime(events, start, end) {
|
|
227
|
+
return events.filter(e => this.eventsOverlap(e.startTime, e.endTime, start, end));
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Splits multi-day events into per-day segments that fit within the
|
|
231
|
+
* visible hour range (`startHour`–`endHour`) and date range.
|
|
232
|
+
*
|
|
233
|
+
* Single-day events are shallow-copied as-is. Multi-day events produce
|
|
234
|
+
* one segment per day with `continued` / `continuedEnd` flags set.
|
|
235
|
+
*/
|
|
236
|
+
calculateMultiDayEvents(events, startHour, endHour, rangeStart, rangeEnd) {
|
|
237
|
+
const result = [];
|
|
238
|
+
for (const event of events) {
|
|
239
|
+
const eventStart = new Date(event.startTime);
|
|
240
|
+
const eventEnd = new Date(event.endTime);
|
|
241
|
+
if (eventStart.toDateString() === eventEnd.toDateString()) {
|
|
242
|
+
result.push({ ...event });
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
const current = new Date(eventStart);
|
|
246
|
+
let isFirst = true;
|
|
247
|
+
while (current < eventEnd && current < rangeEnd) {
|
|
248
|
+
if (current >= rangeStart) {
|
|
249
|
+
const dayStart = new Date(current);
|
|
250
|
+
const dayEnd = new Date(current);
|
|
251
|
+
if (isFirst) {
|
|
252
|
+
dayEnd.setHours(endHour, 0, 0, 0);
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
dayStart.setHours(startHour, 0, 0, 0);
|
|
256
|
+
if (current.toDateString() === eventEnd.toDateString()) {
|
|
257
|
+
dayEnd.setHours(eventEnd.getHours(), eventEnd.getMinutes(), 0, 0);
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
dayEnd.setHours(endHour, 0, 0, 0);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
result.push({
|
|
264
|
+
...event,
|
|
265
|
+
startTime: isFirst ? eventStart : dayStart,
|
|
266
|
+
endTime: current.toDateString() === eventEnd.toDateString() ? eventEnd : dayEnd,
|
|
267
|
+
continued: !isFirst,
|
|
268
|
+
continuedEnd: current.toDateString() !== eventEnd.toDateString()
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
isFirst = false;
|
|
272
|
+
current.setDate(current.getDate() + 1);
|
|
273
|
+
current.setHours(0, 0, 0, 0);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return result;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Assigns a zero-based `column` index to each event so that overlapping
|
|
280
|
+
* events occupy different columns.
|
|
281
|
+
*
|
|
282
|
+
* Events are processed in start-time order (longest duration first for ties).
|
|
283
|
+
* Each event gets the earliest column not already occupied by an overlapping event.
|
|
284
|
+
*/
|
|
285
|
+
assignColumnsToEvents(events) {
|
|
286
|
+
const sorted = [...events].sort((a, b) => {
|
|
287
|
+
const diff = a.startTime.getTime() - b.startTime.getTime();
|
|
288
|
+
if (diff !== 0)
|
|
289
|
+
return diff;
|
|
290
|
+
return (b.endTime.getTime() - b.startTime.getTime()) - (a.endTime.getTime() - a.startTime.getTime());
|
|
291
|
+
});
|
|
292
|
+
for (const event of sorted) {
|
|
293
|
+
event.column = this.findEarliestPossibleColumn(event, sorted);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Assigns a `width` (column span) to each event, expanding it to fill
|
|
298
|
+
* unused columns to its right within the overlapping group.
|
|
299
|
+
*/
|
|
300
|
+
assignWidthsToEvents(events, scanStart, scanEnd) {
|
|
301
|
+
for (const event of events) {
|
|
302
|
+
const overlapping = this.getAllEventsOnSpecificTime(events, event.startTime, event.endTime);
|
|
303
|
+
const maxCol = Math.max(...overlapping.map(e => e.column ?? 0));
|
|
304
|
+
const biggestPossible = this.findBiggestPossibleWidth(event, events, scanStart, scanEnd);
|
|
305
|
+
event.width = Math.max(1, biggestPossible);
|
|
306
|
+
if ((event.column ?? 0) + event.width > maxCol + 1) {
|
|
307
|
+
event.width = maxCol + 1 - (event.column ?? 0);
|
|
308
|
+
}
|
|
309
|
+
if (event.width < 1)
|
|
310
|
+
event.width = 1;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
/** Finds the lowest column index not occupied by any overlapping event. */
|
|
314
|
+
findEarliestPossibleColumn(event, allEvents) {
|
|
315
|
+
const overlapping = allEvents.filter(e => e !== event
|
|
316
|
+
&& e.column !== undefined
|
|
317
|
+
&& this.eventsOverlap(e.startTime, e.endTime, event.startTime, event.endTime));
|
|
318
|
+
let column = 0;
|
|
319
|
+
while (overlapping.some(e => e.column === column)) {
|
|
320
|
+
column++;
|
|
321
|
+
}
|
|
322
|
+
return column;
|
|
323
|
+
}
|
|
324
|
+
/** Computes the maximum width an event can span without overlapping a neighbour to its right. */
|
|
325
|
+
findBiggestPossibleWidth(event, allEvents, _scanStart, _scanEnd) {
|
|
326
|
+
const overlapping = this.getAllEventsOnSpecificTime(allEvents, event.startTime, event.endTime);
|
|
327
|
+
const maxCol = Math.max(...overlapping.map(e => e.column ?? 0));
|
|
328
|
+
const totalColumns = maxCol + 1;
|
|
329
|
+
const occupiedCols = overlapping
|
|
330
|
+
.filter(e => e !== event && (e.column ?? 0) > (event.column ?? 0))
|
|
331
|
+
.map(e => e.column ?? 0);
|
|
332
|
+
if (occupiedCols.length === 0) {
|
|
333
|
+
return totalColumns - (event.column ?? 0);
|
|
334
|
+
}
|
|
335
|
+
return Math.min(...occupiedCols) - (event.column ?? 0);
|
|
336
|
+
}
|
|
337
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CalendarEventLayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
338
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CalendarEventLayoutService });
|
|
339
|
+
}
|
|
340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CalendarEventLayoutService, decorators: [{
|
|
341
|
+
type: Injectable
|
|
342
|
+
}] });
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Static utility methods for calendar grid positioning.
|
|
346
|
+
*/
|
|
347
|
+
class CalendarUtility {
|
|
348
|
+
/**
|
|
349
|
+
* Converts a weekday (from `Date.getDay()`) to a 1-based Monday-first column index.
|
|
350
|
+
* Monday = 1, Tuesday = 2, …, Sunday = 7.
|
|
351
|
+
*/
|
|
352
|
+
static getCorrectColumn(date) {
|
|
353
|
+
const day = date.getDay();
|
|
354
|
+
return day === 0 ? 7 : day;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Converts an hour + minute pair to a 1-based CSS grid row index
|
|
358
|
+
* within a half-hour grid starting at `startHour`.
|
|
359
|
+
*
|
|
360
|
+
* Each hour occupies two rows (one per 30-minute slot).
|
|
361
|
+
* Formula: `(hour - startHour) * 2 + (minute >= 30 ? 1 : 0) + 1`
|
|
362
|
+
*
|
|
363
|
+
* @returns Grid row number (minimum 1).
|
|
364
|
+
*/
|
|
365
|
+
static getCorrectRow(hour, minute, startHour) {
|
|
366
|
+
const hourOffset = hour - startHour;
|
|
367
|
+
const row = hourOffset * 2 + (minute >= 30 ? 1 : 0) + 1;
|
|
368
|
+
return Math.max(1, row);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Generated bundle index. Do not edit.
|
|
374
|
+
*/
|
|
375
|
+
|
|
376
|
+
export { CALENDAR_CONFIG, CALENDAR_DATE_FORMATTER, CalendarEventLayoutService, CalendarUtility, CalendarView, DEFAULT_CALENDAR_CONFIG, DefaultCalendarDateFormatter, MN_CALENDAR_COMPONENT_NAME, MN_CALENDAR_CONFIG, provideMnCalendarConfig, resolveCalendarConfig };
|
|
377
|
+
//# sourceMappingURL=mn-angular-lib-calendar-core.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mn-angular-lib-calendar-core.mjs","sources":["../../../projects/mn-angular-lib/calendar-core/src/mn-calendar/models/calendar-config.model.ts","../../../projects/mn-angular-lib/calendar-core/src/mn-calendar/services/calendar-date-formatter.ts","../../../projects/mn-angular-lib/calendar-core/src/mn-calendar/services/default-calendar-date-formatter.ts","../../../projects/mn-angular-lib/calendar-core/src/mn-calendar/services/calendar-event-layout.service.ts","../../../projects/mn-angular-lib/calendar-core/src/mn-calendar/utils/calendar-utils.ts","../../../projects/mn-angular-lib/calendar-core/mn-angular-lib-calendar-core.ts"],"sourcesContent":["import {InjectionToken} from '@angular/core';\nimport {CalendarEvent} from './calendar-event.model';\nimport {provideMnComponentConfig} from 'mn-angular-lib/core';\n\n/**\n * Available calendar view modes.\n */\nexport enum CalendarView {\n MONTH = 'MONTH',\n WEEK = 'WEEK',\n DAY = 'DAY'\n}\n\n/**\n * Configuration for the calendar component.\n * All properties are optional — sensible defaults are provided.\n * Can be supplied via the `CALENDAR_CONFIG` injection token or through\n * the `provideMnComponentConfig` helper using component name `'mn-calendar'`.\n */\nexport type CalendarConfig = {\n /** First visible hour in week/day views (0–23). Default: `7`. */\n startHour: number;\n /** Last visible hour in week/day views (1–24, exclusive). Default: `22`. */\n endHour: number;\n /** BCP 47 locale tag used for date/time formatting (e.g. `'en-US'`, `'nl-NL'`). Default: `'en-US'`. */\n locale: string;\n /** Label for the \"Today\" navigation button. Default: `'Today'`. */\n todayLabel: string;\n /** Placeholder for the toolbar's date picker. Default: `'Pick a date'`. */\n pickDateLabel: string;\n /** Accessible name for the toolbar's back arrow. Default: `'Previous'`. */\n previousLabel: string;\n /** Accessible name for the toolbar's forward arrow. Default: `'Next'`. */\n nextLabel: string;\n /** Title shown above the upcoming-events sidebar. Default: `'Upcoming events'`. */\n upcomingEventsTitle: string;\n /** Message shown when there are no upcoming events. Default: `'No upcoming events'`. */\n noUpcomingEvents: string;\n /** Word after the \"+N\" overflow count in a month cell — \"+3 more\". Default: `'more'`. */\n moreEventsLabel: string;\n /** Display labels for each calendar view mode. */\n viewLabels: Record<string, string>;\n /** Abbreviated day names starting from Monday (length 7). Derived from `locale` when not set. */\n shortDayNames: string[];\n /** Full day names starting from Monday (length 7). Derived from `locale` when not set. */\n longDayNames: string[];\n /** Screen-width breakpoint (px) below which only day view is shown. Default: `768`. */\n mobileBreakpoint: number;\n}\n\n/**\n * Builds locale-derived day name arrays from a BCP 47 locale string.\n * Uses January 1 2024 (a Monday) as the reference date.\n */\nfunction buildDayNames(locale: string): { short: string[]; long: string[] } {\n const base = new Date(2024, 0, 1); // 2024-01-01 is a Monday\n const short: string[] = [];\n const long: string[] = [];\n for (let i = 0; i < 7; i++) {\n const d = new Date(base);\n d.setDate(base.getDate() + i);\n short.push(d.toLocaleDateString(locale, { weekday: 'short' }));\n long.push(d.toLocaleDateString(locale, { weekday: 'long' }));\n }\n return { short, long };\n}\n\n/** Default calendar configuration values. */\nexport const DEFAULT_CALENDAR_CONFIG: CalendarConfig = (() => {\n const locale = 'en-US';\n const names = buildDayNames(locale);\n return {\n startHour: 7,\n endHour: 22,\n locale,\n todayLabel: 'Today',\n pickDateLabel: 'Pick a date',\n previousLabel: 'Previous',\n nextLabel: 'Next',\n upcomingEventsTitle: 'Upcoming events',\n noUpcomingEvents: 'No upcoming events',\n moreEventsLabel: 'more',\n viewLabels: { MONTH: 'Month', WEEK: 'Week', DAY: 'Day' },\n shortDayNames: names.short,\n longDayNames: names.long,\n mobileBreakpoint: 768,\n };\n})();\n\n/**\n * Injection token for the resolved calendar configuration.\n *\n * Prefer using {@link MN_CALENDAR_CONFIG} with `provideMnComponentConfig`\n * so that settings can be managed via `mn-config.json5`. This token is\n * kept for backward compatibility and manual `providers` usage.\n *\n * @example\n * ```ts\n * providers: [\n * { provide: CALENDAR_CONFIG, useValue: { startHour: 8, endHour: 20, locale: 'nl-NL' } }\n * ]\n * ```\n */\nexport const CALENDAR_CONFIG = new InjectionToken<CalendarConfig>('CalendarConfig', {\n providedIn: 'root',\n factory: () => DEFAULT_CALENDAR_CONFIG\n});\n\n/**\n * Injection token resolved via `MnConfigService` (the `mn-config.json5` system).\n *\n * Use the helper {@link provideMnCalendarConfig} in the component's `providers`\n * array so that calendar settings are read from the config file and support\n * `$translate` markers, section scoping, and instance-id overrides.\n *\n * Component name in the config file: `'mn-calendar'`.\n *\n * @example\n * ```json5\n * // mn-config.json5\n * {\n * defaults: {\n * \"mn-calendar\": {\n * startHour: 8,\n * endHour: 20,\n * locale: \"nl-NL\",\n * todayLabel: { $translate: \"calendar.today\" }\n * }\n * }\n * }\n * ```\n */\nexport const MN_CALENDAR_CONFIG = new InjectionToken<CalendarConfig>('MN_CALENDAR_CONFIG');\n\n/** Component name used to look up calendar settings in `mn-config.json5`. */\nexport const MN_CALENDAR_COMPONENT_NAME = 'mn-calendar';\n\n/**\n * Provider helper that wires the calendar into the `mn-config` system.\n *\n * Add this to the `providers` array of the component (or module) that hosts\n * `<mn-calendar-view>`. It reads defaults and overrides from `mn-config.json5`\n * under the key `\"mn-calendar\"` and provides them via {@link MN_CALENDAR_CONFIG}.\n *\n * @param initial — optional partial defaults merged before config-file values.\n */\nexport function provideMnCalendarConfig(initial?: Partial<CalendarConfig>) {\n return provideMnComponentConfig<CalendarConfig>(MN_CALENDAR_CONFIG, MN_CALENDAR_COMPONENT_NAME, initial);\n}\n\n/**\n * Merges a partial config with defaults, re-deriving day names from locale when needed.\n */\nexport function resolveCalendarConfig(partial?: Partial<CalendarConfig>): CalendarConfig {\n if (!partial) return { ...DEFAULT_CALENDAR_CONFIG };\n const locale = partial.locale ?? DEFAULT_CALENDAR_CONFIG.locale;\n const names = buildDayNames(locale);\n return {\n ...DEFAULT_CALENDAR_CONFIG,\n ...partial,\n locale,\n shortDayNames: partial.shortDayNames ?? names.short,\n longDayNames: partial.longDayNames ?? names.long,\n };\n}\n\n/**\n * Represents a half-hour row in the week/day time grid.\n */\nexport type HourRow = {\n /** The hour value (e.g. 7, 8, …). */\n hour: number;\n /** CSS grid row start (1-based). */\n topRow: number;\n /** CSS grid row end (1-based, exclusive). */\n bottomRow: number;\n}\n\n/**\n * Represents a single day column in the week view header.\n */\nexport type ColumnDay = {\n /** The date this column represents. */\n date: Date;\n /** Abbreviated day name (e.g. \"Mon\"). */\n dayName: string;\n /** Day-of-month number (1–31). */\n dayNumber: number;\n /** Whether this column is today. */\n isToday: boolean;\n}\n\n/**\n * Represents a single cell in the month grid.\n */\nexport type MonthItem = {\n /** The date this cell represents. */\n date: Date;\n /** Day-of-month number (1–31). */\n dayNumber: number;\n /** Whether this date belongs to the currently focused month. */\n isCurrentMonth: boolean;\n /** Whether this date is today. */\n isToday: boolean;\n /** Events occurring on this date. */\n events: CalendarEvent[];\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\n/**\n * Abstraction for date/time formatting used by calendar components.\n *\n * The library ships a default implementation ({@link DefaultCalendarDateFormatter})\n * that uses `Intl.DateTimeFormat`. Consumers can provide their own implementation\n * (e.g. wrapping `@ngx-translate`) via the {@link CALENDAR_DATE_FORMATTER} token.\n *\n * Locale-independent settings (day names, view labels, \"Today\" label) have been\n * moved to {@link CalendarConfig} so they can be configured declaratively.\n */\nexport type CalendarDateFormatter = {\n /** Formats an hour + minute pair (e.g. `9, 0` → `\"09:00 AM\"`). */\n formatTimeI(hour: number, minute: number): Promise<string>;\n /** Formats the time portion of a Date. Returns `''` for `undefined`. */\n formatTime(date: Date | undefined): Promise<string>;\n /** Formats a full date-time string as an Observable. */\n formatDateTime(date: Date): Observable<string>;\n /** Formats a date-only string as an Observable. */\n formatDate(date: Date): Observable<string>;\n /** Formats a Date as `YYYY-MM-DD` for `<input type=\"date\">`. */\n formatDateForFormControl(date: Date): string;\n /** Returns `true` when both dates fall on the same calendar day. */\n isSameDay(date1: Date, date2: Date): boolean;\n /** Formats a Date as \"Month Year\" (e.g. \"January 2026\"). */\n formatMonthName(date: Date): Promise<string>;\n}\n\n/**\n * Injection token for the calendar date formatter.\n *\n * @example\n * ```ts\n * providers: [\n * { provide: CALENDAR_DATE_FORMATTER, useClass: MyCustomFormatter }\n * ]\n * ```\n */\nexport const CALENDAR_DATE_FORMATTER = new InjectionToken<CalendarDateFormatter>('CalendarDateFormatter');\n","import {Injectable, inject} from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { CalendarDateFormatter } from './calendar-date-formatter';\nimport { CALENDAR_CONFIG, CalendarConfig, DEFAULT_CALENDAR_CONFIG } from '../models/calendar-config.model';\n\n/**\n * Default implementation of {@link CalendarDateFormatter} that uses the\n * browser's `Intl.DateTimeFormat` API for locale-aware formatting.\n *\n * The locale is read from the injected {@link CALENDAR_CONFIG}. If no config\n * is provided, `'en-US'` is used as the fallback.\n *\n * This service has no dependency on `@ngx-translate` or any other i18n library,\n * so the calendar library works out of the box. Consumers can replace it with\n * their own implementation via the `CALENDAR_DATE_FORMATTER` injection token.\n */\n@Injectable()\nexport class DefaultCalendarDateFormatter implements CalendarDateFormatter {\n private readonly locale: string;\n\n constructor() {\n const config = inject<CalendarConfig | null>(CALENDAR_CONFIG, {optional: true});\n\n this.locale = config?.locale ?? DEFAULT_CALENDAR_CONFIG.locale;\n }\n\n /** Formats an hour and minute pair into a locale time string (e.g. \"09:00 AM\"). */\n formatTimeI(hour: number, minute: number): Promise<string> {\n const date = new Date();\n date.setHours(hour, minute, 0, 0);\n return Promise.resolve(\n date.toLocaleTimeString(this.locale, { hour: '2-digit', minute: '2-digit' })\n );\n }\n\n /** Formats the time portion of a Date (e.g. \"2:30 PM\"). Returns empty string for undefined. */\n formatTime(date: Date | undefined): Promise<string> {\n if (!date) return Promise.resolve('');\n return Promise.resolve(\n date.toLocaleTimeString(this.locale, { hour: '2-digit', minute: '2-digit' })\n );\n }\n\n /** Formats a Date as a full date-time string (e.g. \"May 15, 2026, 02:30 PM\"). */\n formatDateTime(date: Date): Observable<string> {\n return of(\n date.toLocaleString(this.locale, {\n year: 'numeric', month: 'short', day: 'numeric',\n hour: '2-digit', minute: '2-digit'\n })\n );\n }\n\n /** Formats a Date as a date-only string (e.g. \"May 15, 2026\"). */\n formatDate(date: Date): Observable<string> {\n return of(\n date.toLocaleDateString(this.locale, {\n year: 'numeric', month: 'short', day: 'numeric'\n })\n );\n }\n\n /** Formats a Date as `YYYY-MM-DD` for use in `<input type=\"date\">` controls. */\n formatDateForFormControl(date: Date): string {\n const y = date.getFullYear();\n const m = String(date.getMonth() + 1).padStart(2, '0');\n const d = String(date.getDate()).padStart(2, '0');\n return `${y}-${m}-${d}`;\n }\n\n /** Returns `true` if both dates fall on the same calendar day. */\n isSameDay(date1: Date, date2: Date): boolean {\n return date1.getFullYear() === date2.getFullYear()\n && date1.getMonth() === date2.getMonth()\n && date1.getDate() === date2.getDate();\n }\n\n /** Formats a Date as \"Month Year\" (e.g. \"January 2026\"). */\n formatMonthName(date: Date): Promise<string> {\n return Promise.resolve(\n date.toLocaleString(this.locale, { month: 'long', year: 'numeric' })\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { CalendarEvent } from '../models/calendar-event.model';\n\n/**\n * Service that computes the visual layout of calendar events within a\n * time-grid (week or day view).\n *\n * Responsibilities:\n * - Splitting multi-day events into per-day segments.\n * - Assigning non-overlapping column indices to concurrent events.\n * - Computing the width (column span) each event should occupy.\n *\n * This service is stateless — all state is passed via method parameters.\n * Provide it per-component (not root) so each view gets its own instance.\n */\n@Injectable()\nexport class CalendarEventLayoutService {\n\n /**\n * Returns `true` when two time ranges overlap (exclusive boundaries).\n */\n eventsOverlap(startA: Date, endA: Date, startB: Date, endB: Date): boolean {\n return startA < endB && startB < endA;\n }\n\n /**\n * Returns all events whose time range overlaps the given `[start, end)` window.\n */\n getAllEventsOnSpecificTime(events: CalendarEvent[], start: Date, end: Date): CalendarEvent[] {\n return events.filter(e =>\n this.eventsOverlap(e.startTime, e.endTime, start, end)\n );\n }\n\n /**\n * Splits multi-day events into per-day segments that fit within the\n * visible hour range (`startHour`–`endHour`) and date range.\n *\n * Single-day events are shallow-copied as-is. Multi-day events produce\n * one segment per day with `continued` / `continuedEnd` flags set.\n */\n calculateMultiDayEvents(\n events: CalendarEvent[],\n startHour: number,\n endHour: number,\n rangeStart: Date,\n rangeEnd: Date\n ): CalendarEvent[] {\n const result: CalendarEvent[] = [];\n\n for (const event of events) {\n const eventStart = new Date(event.startTime);\n const eventEnd = new Date(event.endTime);\n\n if (eventStart.toDateString() === eventEnd.toDateString()) {\n result.push({ ...event });\n continue;\n }\n\n const current = new Date(eventStart);\n let isFirst = true;\n\n while (current < eventEnd && current < rangeEnd) {\n if (current >= rangeStart) {\n const dayStart = new Date(current);\n const dayEnd = new Date(current);\n\n if (isFirst) {\n dayEnd.setHours(endHour, 0, 0, 0);\n } else {\n dayStart.setHours(startHour, 0, 0, 0);\n if (current.toDateString() === eventEnd.toDateString()) {\n dayEnd.setHours(eventEnd.getHours(), eventEnd.getMinutes(), 0, 0);\n } else {\n dayEnd.setHours(endHour, 0, 0, 0);\n }\n }\n\n result.push({\n ...event,\n startTime: isFirst ? eventStart : dayStart,\n endTime: current.toDateString() === eventEnd.toDateString() ? eventEnd : dayEnd,\n continued: !isFirst,\n continuedEnd: current.toDateString() !== eventEnd.toDateString()\n });\n }\n\n isFirst = false;\n current.setDate(current.getDate() + 1);\n current.setHours(0, 0, 0, 0);\n }\n }\n\n return result;\n }\n\n /**\n * Assigns a zero-based `column` index to each event so that overlapping\n * events occupy different columns.\n *\n * Events are processed in start-time order (longest duration first for ties).\n * Each event gets the earliest column not already occupied by an overlapping event.\n */\n assignColumnsToEvents(events: CalendarEvent[]): void {\n const sorted = [...events].sort((a, b) => {\n const diff = a.startTime.getTime() - b.startTime.getTime();\n if (diff !== 0) return diff;\n return (b.endTime.getTime() - b.startTime.getTime()) - (a.endTime.getTime() - a.startTime.getTime());\n });\n\n for (const event of sorted) {\n event.column = this.findEarliestPossibleColumn(event, sorted);\n }\n }\n\n /**\n * Assigns a `width` (column span) to each event, expanding it to fill\n * unused columns to its right within the overlapping group.\n */\n assignWidthsToEvents(events: CalendarEvent[], scanStart: Date, scanEnd: Date): void {\n for (const event of events) {\n const overlapping = this.getAllEventsOnSpecificTime(events, event.startTime, event.endTime);\n const maxCol = Math.max(...overlapping.map(e => e.column ?? 0));\n const biggestPossible = this.findBiggestPossibleWidth(event, events, scanStart, scanEnd);\n event.width = Math.max(1, biggestPossible);\n\n if ((event.column ?? 0) + event.width > maxCol + 1) {\n event.width = maxCol + 1 - (event.column ?? 0);\n }\n if (event.width < 1) event.width = 1;\n }\n }\n\n /** Finds the lowest column index not occupied by any overlapping event. */\n private findEarliestPossibleColumn(event: CalendarEvent, allEvents: CalendarEvent[]): number {\n const overlapping = allEvents.filter(e =>\n e !== event\n && e.column !== undefined\n && this.eventsOverlap(e.startTime, e.endTime, event.startTime, event.endTime)\n );\n\n let column = 0;\n while (overlapping.some(e => e.column === column)) {\n column++;\n }\n return column;\n }\n\n /** Computes the maximum width an event can span without overlapping a neighbour to its right. */\n private findBiggestPossibleWidth(\n event: CalendarEvent,\n allEvents: CalendarEvent[],\n _scanStart: Date,\n _scanEnd: Date\n ): number {\n const overlapping = this.getAllEventsOnSpecificTime(allEvents, event.startTime, event.endTime);\n const maxCol = Math.max(...overlapping.map(e => e.column ?? 0));\n const totalColumns = maxCol + 1;\n\n const occupiedCols = overlapping\n .filter(e => e !== event && (e.column ?? 0) > (event.column ?? 0))\n .map(e => e.column ?? 0);\n\n if (occupiedCols.length === 0) {\n return totalColumns - (event.column ?? 0);\n }\n\n return Math.min(...occupiedCols) - (event.column ?? 0);\n }\n}\n","/**\n * Static utility methods for calendar grid positioning.\n */\nexport class CalendarUtility {\n /**\n * Converts a weekday (from `Date.getDay()`) to a 1-based Monday-first column index.\n * Monday = 1, Tuesday = 2, …, Sunday = 7.\n */\n static getCorrectColumn(date: Date): number {\n const day = date.getDay();\n return day === 0 ? 7 : day;\n }\n\n /**\n * Converts an hour + minute pair to a 1-based CSS grid row index\n * within a half-hour grid starting at `startHour`.\n *\n * Each hour occupies two rows (one per 30-minute slot).\n * Formula: `(hour - startHour) * 2 + (minute >= 30 ? 1 : 0) + 1`\n *\n * @returns Grid row number (minimum 1).\n */\n static getCorrectRow(hour: number, minute: number, startHour: number): number {\n const hourOffset = hour - startHour;\n const row = hourOffset * 2 + (minute >= 30 ? 1 : 0) + 1;\n return Math.max(1, row);\n }\n}\n","/**\n * Generated bundle index. Do not edit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