@mintplayer/ng-bootstrap 21.0.0 → 21.1.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 (155) hide show
  1. package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs +33 -46
  2. package/fesm2022/mintplayer-ng-bootstrap-accordion.mjs.map +1 -1
  3. package/fesm2022/mintplayer-ng-bootstrap-alert.mjs +12 -30
  4. package/fesm2022/mintplayer-ng-bootstrap-alert.mjs.map +1 -1
  5. package/fesm2022/mintplayer-ng-bootstrap-badge.mjs +6 -18
  6. package/fesm2022/mintplayer-ng-bootstrap-badge.mjs.map +1 -1
  7. package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs +31 -65
  8. package/fesm2022/mintplayer-ng-bootstrap-calendar.mjs.map +1 -1
  9. package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs +200 -132
  10. package/fesm2022/mintplayer-ng-bootstrap-carousel.mjs.map +1 -1
  11. package/fesm2022/mintplayer-ng-bootstrap-close.mjs +5 -7
  12. package/fesm2022/mintplayer-ng-bootstrap-close.mjs.map +1 -1
  13. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +14 -17
  14. package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
  15. package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs +231 -347
  16. package/fesm2022/mintplayer-ng-bootstrap-color-picker.mjs.map +1 -1
  17. package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs +43 -39
  18. package/fesm2022/mintplayer-ng-bootstrap-datatable.mjs.map +1 -1
  19. package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs +7 -35
  20. package/fesm2022/mintplayer-ng-bootstrap-datepicker.mjs.map +1 -1
  21. package/fesm2022/mintplayer-ng-bootstrap-dock.mjs +1 -0
  22. package/fesm2022/mintplayer-ng-bootstrap-dock.mjs.map +1 -1
  23. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +1 -1
  24. package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
  25. package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +46 -86
  26. package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
  27. package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs +7 -7
  28. package/fesm2022/mintplayer-ng-bootstrap-enhanced-paste.mjs.map +1 -1
  29. package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs +7 -6
  30. package/fesm2022/mintplayer-ng-bootstrap-file-upload.mjs.map +1 -1
  31. package/fesm2022/mintplayer-ng-bootstrap-grid.mjs +32 -74
  32. package/fesm2022/mintplayer-ng-bootstrap-grid.mjs.map +1 -1
  33. package/fesm2022/mintplayer-ng-bootstrap-let.mjs +6 -7
  34. package/fesm2022/mintplayer-ng-bootstrap-let.mjs.map +1 -1
  35. package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs +18 -18
  36. package/fesm2022/mintplayer-ng-bootstrap-markdown.mjs.map +1 -1
  37. package/fesm2022/mintplayer-ng-bootstrap-modal.mjs +20 -22
  38. package/fesm2022/mintplayer-ng-bootstrap-modal.mjs.map +1 -1
  39. package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs +16 -10
  40. package/fesm2022/mintplayer-ng-bootstrap-multiselect.mjs.map +1 -1
  41. package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs +8 -28
  42. package/fesm2022/mintplayer-ng-bootstrap-navbar-toggler.mjs.map +1 -1
  43. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +208 -265
  44. package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
  45. package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs +8 -21
  46. package/fesm2022/mintplayer-ng-bootstrap-navigation-lock.mjs.map +1 -1
  47. package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs +43 -38
  48. package/fesm2022/mintplayer-ng-bootstrap-offcanvas.mjs.map +1 -1
  49. package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs +6 -6
  50. package/fesm2022/mintplayer-ng-bootstrap-ordinal-number.mjs.map +1 -1
  51. package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs +59 -120
  52. package/fesm2022/mintplayer-ng-bootstrap-pagination.mjs.map +1 -1
  53. package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs +11 -25
  54. package/fesm2022/mintplayer-ng-bootstrap-placeholder.mjs.map +1 -1
  55. package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs +8 -28
  56. package/fesm2022/mintplayer-ng-bootstrap-playlist-toggler.mjs.map +1 -1
  57. package/fesm2022/mintplayer-ng-bootstrap-popover.mjs +67 -103
  58. package/fesm2022/mintplayer-ng-bootstrap-popover.mjs.map +1 -1
  59. package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs +34 -63
  60. package/fesm2022/mintplayer-ng-bootstrap-progress-bar.mjs.map +1 -1
  61. package/fesm2022/mintplayer-ng-bootstrap-range.mjs +6 -6
  62. package/fesm2022/mintplayer-ng-bootstrap-range.mjs.map +1 -1
  63. package/fesm2022/mintplayer-ng-bootstrap-rating.mjs +19 -47
  64. package/fesm2022/mintplayer-ng-bootstrap-rating.mjs.map +1 -1
  65. package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs +35 -41
  66. package/fesm2022/mintplayer-ng-bootstrap-resizable.mjs.map +1 -1
  67. package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs +205 -779
  68. package/fesm2022/mintplayer-ng-bootstrap-scheduler.mjs.map +1 -1
  69. package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs +34 -39
  70. package/fesm2022/mintplayer-ng-bootstrap-scrollspy.mjs.map +1 -1
  71. package/fesm2022/mintplayer-ng-bootstrap-searchbox.mjs +74 -100
  72. package/fesm2022/mintplayer-ng-bootstrap-searchbox.mjs.map +1 -1
  73. package/fesm2022/mintplayer-ng-bootstrap-select.mjs +37 -79
  74. package/fesm2022/mintplayer-ng-bootstrap-select.mjs.map +1 -1
  75. package/fesm2022/mintplayer-ng-bootstrap-select2.mjs +78 -45
  76. package/fesm2022/mintplayer-ng-bootstrap-select2.mjs.map +1 -1
  77. package/fesm2022/mintplayer-ng-bootstrap-shell.mjs +16 -26
  78. package/fesm2022/mintplayer-ng-bootstrap-shell.mjs.map +1 -1
  79. package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs +14 -40
  80. package/fesm2022/mintplayer-ng-bootstrap-signature-pad.mjs.map +1 -1
  81. package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs +8 -32
  82. package/fesm2022/mintplayer-ng-bootstrap-spinner.mjs.map +1 -1
  83. package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs +70 -76
  84. package/fesm2022/mintplayer-ng-bootstrap-splitter.mjs.map +1 -1
  85. package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs +11 -11
  86. package/fesm2022/mintplayer-ng-bootstrap-sticky-footer.mjs.map +1 -1
  87. package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs +53 -99
  88. package/fesm2022/mintplayer-ng-bootstrap-tab-control.mjs.map +1 -1
  89. package/fesm2022/mintplayer-ng-bootstrap-table.mjs +7 -38
  90. package/fesm2022/mintplayer-ng-bootstrap-table.mjs.map +1 -1
  91. package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs +23 -49
  92. package/fesm2022/mintplayer-ng-bootstrap-timepicker.mjs.map +1 -1
  93. package/fesm2022/mintplayer-ng-bootstrap-toast.mjs +33 -38
  94. package/fesm2022/mintplayer-ng-bootstrap-toast.mjs.map +1 -1
  95. package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs +45 -98
  96. package/fesm2022/mintplayer-ng-bootstrap-toggle-button.mjs.map +1 -1
  97. package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs +12 -24
  98. package/fesm2022/mintplayer-ng-bootstrap-tooltip.mjs.map +1 -1
  99. package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs +21 -43
  100. package/fesm2022/mintplayer-ng-bootstrap-treeview.mjs.map +1 -1
  101. package/fesm2022/mintplayer-ng-bootstrap-trust-html.mjs +6 -6
  102. package/fesm2022/mintplayer-ng-bootstrap-trust-html.mjs.map +1 -1
  103. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +29 -49
  104. package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
  105. package/package.json +5 -5
  106. package/types/mintplayer-ng-bootstrap-accordion.d.ts +11 -15
  107. package/types/mintplayer-ng-bootstrap-alert.d.ts +4 -9
  108. package/types/mintplayer-ng-bootstrap-badge.d.ts +5 -9
  109. package/types/mintplayer-ng-bootstrap-calendar.d.ts +14 -22
  110. package/types/mintplayer-ng-bootstrap-carousel.d.ts +41 -35
  111. package/types/mintplayer-ng-bootstrap-close.d.ts +1 -2
  112. package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +4 -5
  113. package/types/mintplayer-ng-bootstrap-color-picker.d.ts +70 -97
  114. package/types/mintplayer-ng-bootstrap-datatable.d.ts +11 -11
  115. package/types/mintplayer-ng-bootstrap-datepicker.d.ts +6 -13
  116. package/types/mintplayer-ng-bootstrap-dropdown.d.ts +14 -20
  117. package/types/mintplayer-ng-bootstrap-enhanced-paste.d.ts +1 -3
  118. package/types/mintplayer-ng-bootstrap-file-upload.d.ts +1 -1
  119. package/types/mintplayer-ng-bootstrap-grid.d.ts +14 -26
  120. package/types/mintplayer-ng-bootstrap-let.d.ts +0 -2
  121. package/types/mintplayer-ng-bootstrap-markdown.d.ts +1 -5
  122. package/types/mintplayer-ng-bootstrap-modal.d.ts +3 -6
  123. package/types/mintplayer-ng-bootstrap-multiselect.d.ts +6 -6
  124. package/types/mintplayer-ng-bootstrap-navbar-toggler.d.ts +5 -11
  125. package/types/mintplayer-ng-bootstrap-navbar.d.ts +75 -80
  126. package/types/mintplayer-ng-bootstrap-navigation-lock.d.ts +2 -4
  127. package/types/mintplayer-ng-bootstrap-offcanvas.d.ts +12 -14
  128. package/types/mintplayer-ng-bootstrap-ordinal-number.d.ts +1 -2
  129. package/types/mintplayer-ng-bootstrap-pagination.d.ts +17 -31
  130. package/types/mintplayer-ng-bootstrap-placeholder.d.ts +3 -8
  131. package/types/mintplayer-ng-bootstrap-playlist-toggler.d.ts +5 -11
  132. package/types/mintplayer-ng-bootstrap-popover.d.ts +15 -23
  133. package/types/mintplayer-ng-bootstrap-progress-bar.d.ts +19 -22
  134. package/types/mintplayer-ng-bootstrap-range.d.ts +1 -2
  135. package/types/mintplayer-ng-bootstrap-rating.d.ts +8 -14
  136. package/types/mintplayer-ng-bootstrap-resizable.d.ts +7 -11
  137. package/types/mintplayer-ng-bootstrap-scheduler.d.ts +132 -220
  138. package/types/mintplayer-ng-bootstrap-scrollspy.d.ts +14 -15
  139. package/types/mintplayer-ng-bootstrap-searchbox.d.ts +20 -27
  140. package/types/mintplayer-ng-bootstrap-select.d.ts +13 -23
  141. package/types/mintplayer-ng-bootstrap-select2.d.ts +16 -14
  142. package/types/mintplayer-ng-bootstrap-shell.d.ts +6 -12
  143. package/types/mintplayer-ng-bootstrap-signature-pad.d.ts +7 -12
  144. package/types/mintplayer-ng-bootstrap-spinner.d.ts +8 -16
  145. package/types/mintplayer-ng-bootstrap-splitter.d.ts +21 -27
  146. package/types/mintplayer-ng-bootstrap-sticky-footer.d.ts +3 -3
  147. package/types/mintplayer-ng-bootstrap-tab-control.d.ts +29 -37
  148. package/types/mintplayer-ng-bootstrap-table.d.ts +6 -13
  149. package/types/mintplayer-ng-bootstrap-timepicker.d.ts +7 -14
  150. package/types/mintplayer-ng-bootstrap-toast.d.ts +5 -10
  151. package/types/mintplayer-ng-bootstrap-toggle-button.d.ts +22 -36
  152. package/types/mintplayer-ng-bootstrap-tooltip.d.ts +4 -7
  153. package/types/mintplayer-ng-bootstrap-treeview.d.ts +10 -15
  154. package/types/mintplayer-ng-bootstrap-trust-html.d.ts +0 -2
  155. package/types/mintplayer-ng-bootstrap-typeahead.d.ts +14 -17
@@ -1,32 +1,25 @@
1
- import { AsyncPipe } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { EventEmitter, Input, Output, Component } from '@angular/core';
4
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import { BehaviorSubject, map, filter, take } from 'rxjs';
6
- import * as i2 from '@mintplayer/ng-bootstrap/calendar-month';
7
- import { BsMonthNamePipe, BsWeekdayNamePipe } from '@mintplayer/ng-bootstrap/calendar-month';
2
+ import { inject, signal, model, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { BsCalendarMonthService, BsMonthNamePipe, BsWeekdayNamePipe } from '@mintplayer/ng-bootstrap/calendar-month';
4
+ import { DomSanitizer } from '@angular/platform-browser';
8
5
  import { BsUcFirstPipe } from '@mintplayer/ng-bootstrap/uc-first';
9
- import * as i1 from '@angular/platform-browser';
10
6
 
11
7
  /// <reference types="./types" />
12
8
  class BsCalendarComponent {
13
- constructor(sanitizer, calendarMonthService, destroy) {
14
- this.sanitizer = sanitizer;
15
- this.calendarMonthService = calendarMonthService;
16
- this.destroy = destroy;
17
- //#region CurrentMonth
18
- this.currentMonth$ = new BehaviorSubject(new Date());
19
- this.currentMonthChange = new EventEmitter();
20
- //#endregion
21
- //#region SelectedDate
22
- this.selectedDate$ = new BehaviorSubject(new Date());
23
- this.selectedDateChange = new EventEmitter();
24
- this.weeks$ = this.currentMonth$
25
- .pipe(map((month) => this.calendarMonthService.getWeeks(month)));
26
- this.shownDays$ = this.weeks$
27
- .pipe(filter((weeks) => weeks.length > 1))
28
- .pipe(map((weeks) => weeks[1].days))
29
- .pipe(map((days) => {
9
+ constructor() {
10
+ this.sanitizer = inject(DomSanitizer);
11
+ this.calendarMonthService = inject(BsCalendarMonthService);
12
+ this.chevronLeft = signal(undefined, ...(ngDevMode ? [{ debugName: "chevronLeft" }] : []));
13
+ this.chevronRight = signal(undefined, ...(ngDevMode ? [{ debugName: "chevronRight" }] : []));
14
+ this.currentMonth = model(new Date(), ...(ngDevMode ? [{ debugName: "currentMonth" }] : []));
15
+ this.selectedDate = model(new Date(), ...(ngDevMode ? [{ debugName: "selectedDate" }] : []));
16
+ this.disableDateFn = input(undefined, ...(ngDevMode ? [{ debugName: "disableDateFn" }] : []));
17
+ this.weeks = computed(() => this.calendarMonthService.getWeeks(this.currentMonth()), ...(ngDevMode ? [{ debugName: "weeks" }] : []));
18
+ this.shownDays = computed(() => {
19
+ const weeks = this.weeks();
20
+ if (weeks.length <= 1)
21
+ return [];
22
+ const days = weeks[1].days;
30
23
  const firstDay = days[0];
31
24
  if (firstDay) {
32
25
  return days.map((d) => {
@@ -40,40 +33,22 @@ class BsCalendarComponent {
40
33
  else {
41
34
  return [];
42
35
  }
43
- }));
44
- this.selectedDate$.pipe(takeUntilDestroyed())
45
- .subscribe(date => this.selectedDateChange.emit(date));
46
- this.currentMonth$.pipe(takeUntilDestroyed())
47
- .subscribe(month => this.currentMonthChange.emit(month));
36
+ }, ...(ngDevMode ? [{ debugName: "shownDays" }] : []));
48
37
  import('bootstrap-icons/icons/chevron-left.svg').then((icon) => {
49
- this.chevronLeft = sanitizer.bypassSecurityTrustHtml(icon.default);
38
+ this.chevronLeft.set(this.sanitizer.bypassSecurityTrustHtml(icon.default));
50
39
  });
51
40
  import('bootstrap-icons/icons/chevron-right.svg').then((icon) => {
52
- this.chevronRight = sanitizer.bypassSecurityTrustHtml(icon.default);
41
+ this.chevronRight.set(this.sanitizer.bypassSecurityTrustHtml(icon.default));
53
42
  });
54
43
  }
55
- get currentMonth() {
56
- return this.currentMonth$.value;
57
- }
58
- set currentMonth(value) {
59
- this.currentMonth$.next(value);
60
- }
61
- get selectedDate() {
62
- return this.selectedDate$.value;
63
- }
64
- set selectedDate(value) {
65
- this.selectedDate$.next(value);
66
- }
67
44
  previousMonth() {
68
- this.currentMonth$.pipe(take(1), takeUntilDestroyed(this.destroy)).subscribe((month) => {
69
- this.currentMonth$.next(new Date(month.getFullYear(), month.getMonth() - 1, 1));
70
- });
45
+ const month = this.currentMonth();
46
+ this.currentMonth.set(new Date(month.getFullYear(), month.getMonth() - 1, 1));
71
47
  return false;
72
48
  }
73
49
  nextMonth() {
74
- this.currentMonth$.pipe(take(1), takeUntilDestroyed(this.destroy)).subscribe((month) => {
75
- this.currentMonth$.next(new Date(month.getFullYear(), month.getMonth() + 1, 1));
76
- });
50
+ const month = this.currentMonth();
51
+ this.currentMonth.set(new Date(month.getFullYear(), month.getMonth() + 1, 1));
77
52
  return false;
78
53
  }
79
54
  isSameDate(date1, date2) {
@@ -86,27 +61,18 @@ class BsCalendarComponent {
86
61
  date1.getDate() === date2.getDate());
87
62
  }
88
63
  goto(day) {
89
- if (day && day.isInMonth && (!this.disableDateFn || !this.disableDateFn(day.date))) {
90
- this.selectedDate$.next(day.date);
64
+ const disableFn = this.disableDateFn();
65
+ if (day && day.isInMonth && (!disableFn || !disableFn(day.date))) {
66
+ this.selectedDate.set(day.date);
91
67
  }
92
68
  }
93
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsCalendarComponent, deps: [{ token: i1.DomSanitizer }, { token: i2.BsCalendarMonthService }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component }); }
94
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BsCalendarComponent, isStandalone: true, selector: "bs-calendar", inputs: { currentMonth: "currentMonth", selectedDate: "selectedDate", disableDateFn: "disableDateFn" }, outputs: { currentMonthChange: "currentMonthChange", selectedDateChange: "selectedDateChange" }, ngImport: i0, template: "<table class=\"table w-auto mb-0\">\n <tr>\n <td>\n <button class=\"btn btn-default\" (click)=\"previousMonth()\">\n <span [innerHTML]=\"chevronLeft\" class=\"fw-bolder\"></span>\n </button>\n </td>\n <td colspan=\"6\" class=\"fw-bolder\">\n {{ currentMonth$ | async | monthName | bsUcFirst }}\n {{ (currentMonth$ | async)?.getFullYear() }}\n </td>\n <td>\n <button class=\"btn btn-default border-bottom-0\" (click)=\"nextMonth()\">\n <span [innerHTML]=\"chevronRight\" class=\"fw-bolder\"></span>\n </button>\n </td>\n </tr>\n <tr>\n <th></th>\n @for (dayOfWeek of shownDays$ | async; track dayOfWeek.long) {\n <th [title]=\"dayOfWeek.long\">\n {{ dayOfWeek.short }}\n </th>\n }\n </tr>\n @for (week of (weeks$ | async); track week.number) {\n <tr>\n <th>\n {{ week.number }}\n </th>\n @for (day of week.days; track day?.date) {\n @let showSpan = (day !== null) && day.isInMonth;\n @let disabled = disableDateFn && day && disableDateFn(day.date);\n <td [class.selected]=\"day === null ? false : !day.isInMonth ? false : isSameDate(selectedDate$ | async, day.date)\" [class.cursor-pointer]=\"showSpan && !disabled\" (click)=\"goto(day)\">\n @if (showSpan) {\n <span [class.text-muted]=\"disabled\">{{ day.dayOfMonth }}</span>\n }\n </td>\n }\n </tr>\n }\n</table>", styles: [".text-muted{color:#9ea7af!important}table{border-collapse:collapse;border:1px solid var(--bs-border-color);background:#fff}table td,table th{width:40px;height:40px;text-align:center;cursor:default}table td span,table th span{white-space:nowrap}table td.selected{background-color:#0d6efd;color:#fff}table th{background-color:#f8f9fa}table tr{border-top:none}table tr:first-child>td{border-bottom:1px solid var(--bs-border-color)}table tr:nth-of-type(2)>th:not(:nth-of-type(1)){border-bottom:1px solid var(--bs-border-color)}table tr:not(:nth-of-type(2))>th:nth-of-type(1){border-right:1px solid var(--bs-border-color)}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: BsUcFirstPipe, name: "bsUcFirst" }, { kind: "pipe", type: BsMonthNamePipe, name: "monthName" }] }); }
69
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsCalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
70
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: BsCalendarComponent, isStandalone: true, selector: "bs-calendar", inputs: { currentMonth: { classPropertyName: "currentMonth", publicName: "currentMonth", isSignal: true, isRequired: false, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: true, isRequired: false, transformFunction: null }, disableDateFn: { classPropertyName: "disableDateFn", publicName: "disableDateFn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentMonth: "currentMonthChange", selectedDate: "selectedDateChange" }, ngImport: i0, template: "<table class=\"table w-auto mb-0\">\n <tr>\n <td>\n <button type=\"button\" class=\"btn btn-default\" (click)=\"previousMonth()\">\n <span [innerHTML]=\"chevronLeft()\" class=\"fw-bolder\"></span>\n </button>\n </td>\n <td colspan=\"6\" class=\"fw-bolder\">\n {{ currentMonth() | monthName | bsUcFirst }}\n {{ currentMonth().getFullYear() }}\n </td>\n <td>\n <button type=\"button\" class=\"btn btn-default border-bottom-0\" (click)=\"nextMonth()\">\n <span [innerHTML]=\"chevronRight()\" class=\"fw-bolder\"></span>\n </button>\n </td>\n </tr>\n <tr>\n <th></th>\n @for (dayOfWeek of shownDays(); track dayOfWeek.long) {\n <th [title]=\"dayOfWeek.long\">\n {{ dayOfWeek.short }}\n </th>\n }\n </tr>\n @for (week of weeks(); track week.number) {\n <tr>\n <th>\n {{ week.number }}\n </th>\n @for (day of week.days; track day?.date) {\n @let showSpan = (day !== null) && day.isInMonth;\n @let disableFn = disableDateFn();\n @let disabled = disableFn && day && disableFn(day.date);\n <td [class.selected]=\"day === null ? false : !day.isInMonth ? false : isSameDate(selectedDate(), day.date)\" [class.cursor-pointer]=\"showSpan && !disabled\" (click)=\"goto(day)\">\n @if (showSpan) {\n <span [class.text-muted]=\"disabled\">{{ day.dayOfMonth }}</span>\n }\n </td>\n }\n </tr>\n }\n</table>\n", styles: [".text-muted{color:#9ea7af!important}table{border-collapse:collapse;border:1px solid var(--bs-border-color);background:#fff}table td,table th{width:40px;height:40px;text-align:center;cursor:default}table td span,table th span{white-space:nowrap}table td.selected{background-color:#0d6efd;color:#fff}table th{background-color:#f8f9fa}table tr{border-top:none}table tr:first-child>td{border-bottom:1px solid var(--bs-border-color)}table tr:nth-of-type(2)>th:not(:nth-of-type(1)){border-bottom:1px solid var(--bs-border-color)}table tr:not(:nth-of-type(2))>th:nth-of-type(1){border-right:1px solid var(--bs-border-color)}\n"], dependencies: [{ kind: "pipe", type: BsUcFirstPipe, name: "bsUcFirst" }, { kind: "pipe", type: BsMonthNamePipe, name: "monthName" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
95
71
  }
96
72
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: BsCalendarComponent, decorators: [{
97
73
  type: Component,
98
- args: [{ selector: 'bs-calendar', standalone: true, imports: [AsyncPipe, BsUcFirstPipe, BsMonthNamePipe, BsWeekdayNamePipe], template: "<table class=\"table w-auto mb-0\">\n <tr>\n <td>\n <button class=\"btn btn-default\" (click)=\"previousMonth()\">\n <span [innerHTML]=\"chevronLeft\" class=\"fw-bolder\"></span>\n </button>\n </td>\n <td colspan=\"6\" class=\"fw-bolder\">\n {{ currentMonth$ | async | monthName | bsUcFirst }}\n {{ (currentMonth$ | async)?.getFullYear() }}\n </td>\n <td>\n <button class=\"btn btn-default border-bottom-0\" (click)=\"nextMonth()\">\n <span [innerHTML]=\"chevronRight\" class=\"fw-bolder\"></span>\n </button>\n </td>\n </tr>\n <tr>\n <th></th>\n @for (dayOfWeek of shownDays$ | async; track dayOfWeek.long) {\n <th [title]=\"dayOfWeek.long\">\n {{ dayOfWeek.short }}\n </th>\n }\n </tr>\n @for (week of (weeks$ | async); track week.number) {\n <tr>\n <th>\n {{ week.number }}\n </th>\n @for (day of week.days; track day?.date) {\n @let showSpan = (day !== null) && day.isInMonth;\n @let disabled = disableDateFn && day && disableDateFn(day.date);\n <td [class.selected]=\"day === null ? false : !day.isInMonth ? false : isSameDate(selectedDate$ | async, day.date)\" [class.cursor-pointer]=\"showSpan && !disabled\" (click)=\"goto(day)\">\n @if (showSpan) {\n <span [class.text-muted]=\"disabled\">{{ day.dayOfMonth }}</span>\n }\n </td>\n }\n </tr>\n }\n</table>", styles: [".text-muted{color:#9ea7af!important}table{border-collapse:collapse;border:1px solid var(--bs-border-color);background:#fff}table td,table th{width:40px;height:40px;text-align:center;cursor:default}table td span,table th span{white-space:nowrap}table td.selected{background-color:#0d6efd;color:#fff}table th{background-color:#f8f9fa}table tr{border-top:none}table tr:first-child>td{border-bottom:1px solid var(--bs-border-color)}table tr:nth-of-type(2)>th:not(:nth-of-type(1)){border-bottom:1px solid var(--bs-border-color)}table tr:not(:nth-of-type(2))>th:nth-of-type(1){border-right:1px solid var(--bs-border-color)}\n"] }]
99
- }], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: i2.BsCalendarMonthService }, { type: i0.DestroyRef }], propDecorators: { currentMonthChange: [{
100
- type: Output
101
- }], currentMonth: [{
102
- type: Input
103
- }], selectedDateChange: [{
104
- type: Output
105
- }], selectedDate: [{
106
- type: Input
107
- }], disableDateFn: [{
108
- type: Input
109
- }] } });
74
+ args: [{ selector: 'bs-calendar', standalone: true, imports: [BsUcFirstPipe, BsMonthNamePipe, BsWeekdayNamePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<table class=\"table w-auto mb-0\">\n <tr>\n <td>\n <button type=\"button\" class=\"btn btn-default\" (click)=\"previousMonth()\">\n <span [innerHTML]=\"chevronLeft()\" class=\"fw-bolder\"></span>\n </button>\n </td>\n <td colspan=\"6\" class=\"fw-bolder\">\n {{ currentMonth() | monthName | bsUcFirst }}\n {{ currentMonth().getFullYear() }}\n </td>\n <td>\n <button type=\"button\" class=\"btn btn-default border-bottom-0\" (click)=\"nextMonth()\">\n <span [innerHTML]=\"chevronRight()\" class=\"fw-bolder\"></span>\n </button>\n </td>\n </tr>\n <tr>\n <th></th>\n @for (dayOfWeek of shownDays(); track dayOfWeek.long) {\n <th [title]=\"dayOfWeek.long\">\n {{ dayOfWeek.short }}\n </th>\n }\n </tr>\n @for (week of weeks(); track week.number) {\n <tr>\n <th>\n {{ week.number }}\n </th>\n @for (day of week.days; track day?.date) {\n @let showSpan = (day !== null) && day.isInMonth;\n @let disableFn = disableDateFn();\n @let disabled = disableFn && day && disableFn(day.date);\n <td [class.selected]=\"day === null ? false : !day.isInMonth ? false : isSameDate(selectedDate(), day.date)\" [class.cursor-pointer]=\"showSpan && !disabled\" (click)=\"goto(day)\">\n @if (showSpan) {\n <span [class.text-muted]=\"disabled\">{{ day.dayOfMonth }}</span>\n }\n </td>\n }\n </tr>\n }\n</table>\n", styles: [".text-muted{color:#9ea7af!important}table{border-collapse:collapse;border:1px solid var(--bs-border-color);background:#fff}table td,table th{width:40px;height:40px;text-align:center;cursor:default}table td span,table th span{white-space:nowrap}table td.selected{background-color:#0d6efd;color:#fff}table th{background-color:#f8f9fa}table tr{border-top:none}table tr:first-child>td{border-bottom:1px solid var(--bs-border-color)}table tr:nth-of-type(2)>th:not(:nth-of-type(1)){border-bottom:1px solid var(--bs-border-color)}table tr:not(:nth-of-type(2))>th:nth-of-type(1){border-right:1px solid var(--bs-border-color)}\n"] }]
75
+ }], ctorParameters: () => [], propDecorators: { currentMonth: [{ type: i0.Input, args: [{ isSignal: true, alias: "currentMonth", required: false }] }, { type: i0.Output, args: ["currentMonthChange"] }], selectedDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectedDate", required: false }] }, { type: i0.Output, args: ["selectedDateChange"] }], disableDateFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableDateFn", required: false }] }] } });
110
76
 
111
77
  /**
112
78
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-bootstrap-calendar.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/calendar/src/calendar.component.ts","../../../../libs/mintplayer-ng-bootstrap/calendar/src/calendar.component.html","../../../../libs/mintplayer-ng-bootstrap/calendar/mintplayer-ng-bootstrap-calendar.ts"],"sourcesContent":["/// <reference types=\"./types\" />\n\nimport { AsyncPipe } from '@angular/common';\nimport { Component, DestroyRef, EventEmitter, Input, Output } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { BehaviorSubject, filter, map, Observable, take } from 'rxjs';\nimport { BsCalendarMonthService, BsMonthNamePipe, BsWeekdayNamePipe, DateDayOfMonth, Week, WeekDay } from '@mintplayer/ng-bootstrap/calendar-month';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { BsUcFirstPipe } from '@mintplayer/ng-bootstrap/uc-first';\n\n@Component({\n selector: 'bs-calendar',\n standalone: true,\n templateUrl: './calendar.component.html',\n styleUrls: ['./calendar.component.scss'],\n imports: [AsyncPipe, BsUcFirstPipe, BsMonthNamePipe, BsWeekdayNamePipe]\n})\nexport class BsCalendarComponent {\n constructor(private sanitizer: DomSanitizer, private calendarMonthService: BsCalendarMonthService, private destroy: DestroyRef) {\n this.weeks$ = this.currentMonth$\n .pipe(map((month) => this.calendarMonthService.getWeeks(month)));\n this.shownDays$ = this.weeks$\n .pipe(filter((weeks) => weeks.length > 1))\n .pipe(map((weeks) => weeks[1].days))\n .pipe(\n map((days) => {\n const firstDay = days[0];\n if (firstDay) {\n return days.map((d) => {\n const date = new Date(\n firstDay.date.getFullYear(),\n firstDay.date.getMonth(),\n d?.dayOfMonth\n );\n return <WeekDay>{\n short: date.toLocaleString('default', { weekday: 'short' }),\n long: date.toLocaleString('default', { weekday: 'long' })\n };\n });\n } else {\n return [];\n }\n })\n );\n this.selectedDate$.pipe(takeUntilDestroyed())\n .subscribe(date => this.selectedDateChange.emit(date));\n this.currentMonth$.pipe(takeUntilDestroyed())\n .subscribe(month => this.currentMonthChange.emit(month));\n import('bootstrap-icons/icons/chevron-left.svg').then((icon) => {\n this.chevronLeft = sanitizer.bypassSecurityTrustHtml(icon.default);\n });\n import('bootstrap-icons/icons/chevron-right.svg').then((icon) => {\n this.chevronRight = sanitizer.bypassSecurityTrustHtml(icon.default);\n });\n }\n\n chevronLeft?: SafeHtml;\n chevronRight?: SafeHtml;\n weeks$: Observable<Week[]>;\n shownDays$: Observable<WeekDay[]>;\n\n //#region CurrentMonth\n currentMonth$ = new BehaviorSubject<Date>(new Date());\n @Output() public currentMonthChange = new EventEmitter<Date>();\n get currentMonth() {\n return this.currentMonth$.value;\n }\n @Input() set currentMonth(value: Date) {\n this.currentMonth$.next(value);\n }\n //#endregion\n //#region SelectedDate\n selectedDate$ = new BehaviorSubject<Date>(new Date());\n @Output() public selectedDateChange = new EventEmitter<Date>();\n get selectedDate() {\n return this.selectedDate$.value;\n }\n @Input() set selectedDate(value: Date) {\n this.selectedDate$.next(value);\n }\n //#endregion\n\n @Input() disableDateFn?: (date: Date) => boolean;\n\n previousMonth() {\n this.currentMonth$.pipe(take(1), takeUntilDestroyed(this.destroy)).subscribe((month) => {\n this.currentMonth$.next(\n new Date(month.getFullYear(), month.getMonth() - 1, 1)\n );\n });\n\n return false;\n }\n\n nextMonth() {\n this.currentMonth$.pipe(take(1), takeUntilDestroyed(this.destroy)).subscribe((month) => {\n this.currentMonth$.next(\n new Date(month.getFullYear(), month.getMonth() + 1, 1)\n );\n });\n\n return false;\n }\n\n isSameDate(date1: Date | null, date2: Date | null) {\n if (date1 === null && date2 === null) return true;\n if (date1 === null || date2 === null) return false;\n\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n }\n\n goto(day: DateDayOfMonth | null) {\n if (day && day.isInMonth && (!this.disableDateFn || !this.disableDateFn(day.date))) {\n this.selectedDate$.next(day.date);\n }\n }\n}\n","<table class=\"table w-auto mb-0\">\n <tr>\n <td>\n <button class=\"btn btn-default\" (click)=\"previousMonth()\">\n <span [innerHTML]=\"chevronLeft\" class=\"fw-bolder\"></span>\n </button>\n </td>\n <td colspan=\"6\" class=\"fw-bolder\">\n {{ currentMonth$ | async | monthName | bsUcFirst }}\n {{ (currentMonth$ | async)?.getFullYear() }}\n </td>\n <td>\n <button class=\"btn btn-default border-bottom-0\" (click)=\"nextMonth()\">\n <span [innerHTML]=\"chevronRight\" class=\"fw-bolder\"></span>\n </button>\n </td>\n </tr>\n <tr>\n <th></th>\n @for (dayOfWeek of shownDays$ | async; track dayOfWeek.long) {\n <th [title]=\"dayOfWeek.long\">\n {{ dayOfWeek.short }}\n </th>\n }\n </tr>\n @for (week of (weeks$ | async); track week.number) {\n <tr>\n <th>\n {{ week.number }}\n </th>\n @for (day of week.days; track day?.date) {\n @let showSpan = (day !== null) && day.isInMonth;\n @let disabled = disableDateFn && day && disableDateFn(day.date);\n <td [class.selected]=\"day === null ? false : !day.isInMonth ? false : isSameDate(selectedDate$ | async, day.date)\" [class.cursor-pointer]=\"showSpan && !disabled\" (click)=\"goto(day)\">\n @if (showSpan) {\n <span [class.text-muted]=\"disabled\">{{ day.dayOfMonth }}</span>\n }\n </td>\n }\n </tr>\n }\n</table>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;MAiBa,mBAAmB,CAAA;AAC9B,IAAA,WAAA,CAAoB,SAAuB,EAAU,oBAA4C,EAAU,OAAmB,EAAA;QAA1G,IAAA,CAAA,SAAS,GAAT,SAAS;QAAwB,IAAA,CAAA,oBAAoB,GAApB,oBAAoB;QAAkC,IAAA,CAAA,OAAO,GAAP,OAAO;;QA4ClH,IAAA,CAAA,aAAa,GAAG,IAAI,eAAe,CAAO,IAAI,IAAI,EAAE,CAAC;AACpC,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,YAAY,EAAQ;;;QAS9D,IAAA,CAAA,aAAa,GAAG,IAAI,eAAe,CAAO,IAAI,IAAI,EAAE,CAAC;AACpC,QAAA,IAAA,CAAA,kBAAkB,GAAG,IAAI,YAAY,EAAQ;AAtD5D,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;AAChB,aAAA,IAAI,CAAC,GAAG,CAAC,CAAC,KAA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,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,gRCjBhC,yoDAyCQ,EAAA,MAAA,EAAA,CAAA,6mBAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,ED1BI,SAAS,EAAA,IAAA,EAAA,OAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAE,aAAa,6CAAE,eAAe,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAExC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAP/B,SAAS;+BACE,aAAa,EAAA,UAAA,EACX,IAAI,EAAA,OAAA,EAGP,CAAC,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,CAAC,EAAA,QAAA,EAAA,yoDAAA,EAAA,MAAA,EAAA,CAAA,6mBAAA,CAAA,EAAA;;sBAgDtE;;sBAIA;;sBAMA;;sBAIA;;sBAKA;;;AElFH;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-bootstrap-calendar.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/calendar/src/calendar.component.ts","../../../../libs/mintplayer-ng-bootstrap/calendar/src/calendar.component.html","../../../../libs/mintplayer-ng-bootstrap/calendar/mintplayer-ng-bootstrap-calendar.ts"],"sourcesContent":["/// <reference types=\"./types\" />\n\nimport { ChangeDetectionStrategy, Component, computed, inject, input, model, signal } from '@angular/core';\nimport { BsCalendarMonthService, BsMonthNamePipe, BsWeekdayNamePipe, DateDayOfMonth, WeekDay } from '@mintplayer/ng-bootstrap/calendar-month';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { BsUcFirstPipe } from '@mintplayer/ng-bootstrap/uc-first';\n\n@Component({\n selector: 'bs-calendar',\n standalone: true,\n templateUrl: './calendar.component.html',\n styleUrls: ['./calendar.component.scss'],\n imports: [BsUcFirstPipe, BsMonthNamePipe, BsWeekdayNamePipe],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsCalendarComponent {\n private sanitizer = inject(DomSanitizer);\n private calendarMonthService = inject(BsCalendarMonthService);\n\n constructor() {\n import('bootstrap-icons/icons/chevron-left.svg').then((icon) => {\n this.chevronLeft.set(this.sanitizer.bypassSecurityTrustHtml(icon.default));\n });\n import('bootstrap-icons/icons/chevron-right.svg').then((icon) => {\n this.chevronRight.set(this.sanitizer.bypassSecurityTrustHtml(icon.default));\n });\n }\n\n chevronLeft = signal<SafeHtml | undefined>(undefined);\n chevronRight = signal<SafeHtml | undefined>(undefined);\n\n currentMonth = model<Date>(new Date());\n selectedDate = model<Date>(new Date());\n disableDateFn = input<((date: Date) => boolean) | undefined>(undefined);\n\n weeks = computed(() => this.calendarMonthService.getWeeks(this.currentMonth()));\n\n shownDays = computed<WeekDay[]>(() => {\n const weeks = this.weeks();\n if (weeks.length <= 1) return [];\n const days = weeks[1].days;\n const firstDay = days[0];\n if (firstDay) {\n return days.map((d) => {\n const date = new Date(\n firstDay.date.getFullYear(),\n firstDay.date.getMonth(),\n d?.dayOfMonth\n );\n return <WeekDay>{\n short: date.toLocaleString('default', { weekday: 'short' }),\n long: date.toLocaleString('default', { weekday: 'long' })\n };\n });\n } else {\n return [];\n }\n });\n\n previousMonth() {\n const month = this.currentMonth();\n this.currentMonth.set(new Date(month.getFullYear(), month.getMonth() - 1, 1));\n return false;\n }\n\n nextMonth() {\n const month = this.currentMonth();\n this.currentMonth.set(new Date(month.getFullYear(), month.getMonth() + 1, 1));\n return false;\n }\n\n isSameDate(date1: Date | null, date2: Date | null) {\n if (date1 === null && date2 === null) return true;\n if (date1 === null || date2 === null) return false;\n\n return (\n date1.getFullYear() === date2.getFullYear() &&\n date1.getMonth() === date2.getMonth() &&\n date1.getDate() === date2.getDate()\n );\n }\n\n goto(day: DateDayOfMonth | null) {\n const disableFn = this.disableDateFn();\n if (day && day.isInMonth && (!disableFn || !disableFn(day.date))) {\n this.selectedDate.set(day.date);\n }\n }\n}\n","<table class=\"table w-auto mb-0\">\n <tr>\n <td>\n <button type=\"button\" class=\"btn btn-default\" (click)=\"previousMonth()\">\n <span [innerHTML]=\"chevronLeft()\" class=\"fw-bolder\"></span>\n </button>\n </td>\n <td colspan=\"6\" class=\"fw-bolder\">\n {{ currentMonth() | monthName | bsUcFirst }}\n {{ currentMonth().getFullYear() }}\n </td>\n <td>\n <button type=\"button\" class=\"btn btn-default border-bottom-0\" (click)=\"nextMonth()\">\n <span [innerHTML]=\"chevronRight()\" class=\"fw-bolder\"></span>\n </button>\n </td>\n </tr>\n <tr>\n <th></th>\n @for (dayOfWeek of shownDays(); track dayOfWeek.long) {\n <th [title]=\"dayOfWeek.long\">\n {{ dayOfWeek.short }}\n </th>\n }\n </tr>\n @for (week of weeks(); track week.number) {\n <tr>\n <th>\n {{ week.number }}\n </th>\n @for (day of week.days; track day?.date) {\n @let showSpan = (day !== null) && day.isInMonth;\n @let disableFn = disableDateFn();\n @let disabled = disableFn && day && disableFn(day.date);\n <td [class.selected]=\"day === null ? false : !day.isInMonth ? false : isSameDate(selectedDate(), day.date)\" [class.cursor-pointer]=\"showSpan && !disabled\" (click)=\"goto(day)\">\n @if (showSpan) {\n <span [class.text-muted]=\"disabled\">{{ day.dayOfMonth }}</span>\n }\n </td>\n }\n </tr>\n }\n</table>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;MAea,mBAAmB,CAAA;AAI9B,IAAA,WAAA,GAAA;AAHQ,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;AAChC,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAW7D,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAuB,SAAS,uDAAC;AACrD,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAuB,SAAS,wDAAC;A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