@alfadocs/ui-kit 0.25.0 → 0.25.2

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 (178) hide show
  1. package/dist/_chunks/{agenda-card-BmpaUG1h.js → agenda-card-CznB7K8e.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-DiInnVqk.js → agenda-tray-C_bha7oK.js} +4 -4
  3. package/dist/_chunks/{ai-prompt-input-B5MdixzR.js → ai-prompt-input-Bka3jX3i.js} +2 -2
  4. package/dist/_chunks/{alia-sidebar-CUi2UCbY.js → alia-sidebar-CnvXq95r.js} +92 -109
  5. package/dist/_chunks/{audio-recorder-D4xM3H5i.js → audio-recorder-OB6IV9B1.js} +2 -2
  6. package/dist/_chunks/{autocomplete-C7xq06bP.js → autocomplete-CUh0f7Dj.js} +2 -2
  7. package/dist/_chunks/{avatar-BpFohgWG.js → avatar-D_H4emLo.js} +7 -7
  8. package/dist/_chunks/{benefit-card-DXmrAyfn.js → benefit-card-CjYM8vNr.js} +29 -29
  9. package/dist/_chunks/booking-CXngC-1u.js +1743 -0
  10. package/dist/_chunks/{calendar-zy0tUUVG.js → calendar-9eOXumpH.js} +113 -142
  11. package/dist/_chunks/{card-C353dU-H.js → card-DKTMLVrw.js} +11 -11
  12. package/dist/_chunks/{carousel.agent-DnPiqijR.js → carousel.agent-C9swH-Uf.js} +2 -2
  13. package/dist/_chunks/{chat-input-B3XmFGDw.js → chat-input-BfDcz1Yi.js} +2 -2
  14. package/dist/_chunks/{chat-message-W3k8rLOA.js → chat-message-fg221-yx.js} +2 -2
  15. package/dist/_chunks/{command-palette-DkL-aW4O.js → command-palette-11BieSNq.js} +2 -2
  16. package/dist/_chunks/{contact-card-CjG7c-1q.js → contact-card-CeEfEAxh.js} +2 -2
  17. package/dist/_chunks/{date-picker-BIoSLRly.js → date-picker-D0Ry1dMz.js} +26 -27
  18. package/dist/_chunks/{date-range-picker-9gANFNG9.js → date-range-picker-DYgHzMOo.js} +19 -20
  19. package/dist/_chunks/{date-time-picker-DG7BiGdb.js → date-time-picker-CGmGtcyc.js} +10 -11
  20. package/dist/_chunks/{description-list-Bsga4IW8.js → description-list-yl3y3QKg.js} +34 -24
  21. package/dist/_chunks/{dialog-DUomPCRS.js → dialog-BBXqpZIt.js} +2 -2
  22. package/dist/_chunks/{editable-currency-cell-renderer-DJB5MxAI.js → editable-currency-cell-renderer-DSReCae7.js} +7 -7
  23. package/dist/_chunks/{empty-state-3CLJIXSj.js → empty-state-BLy7tigq.js} +13 -33
  24. package/dist/_chunks/eye-LHlSU38h.js +21 -0
  25. package/dist/_chunks/{freemium-paywall-CM6V1zNf.js → freemium-paywall-B9c8Ylww.js} +11 -11
  26. package/dist/_chunks/{header-DqmKROIY.js → header-B8V_sNPy.js} +2 -2
  27. package/dist/_chunks/icon-button-BRHSSFmZ.js +70 -0
  28. package/dist/_chunks/{isSameDay-ecuM8PBB.js → isSameDay-DHG8Xade.js} +4 -4
  29. package/dist/_chunks/{key-value-pair-DBuOCtIc.js → key-value-pair-CqeKiP__.js} +2 -2
  30. package/dist/_chunks/{locale-picker-BxEUUPW7.js → locale-picker-BHxbTNmR.js} +297 -208
  31. package/dist/_chunks/{map-view-CcwycFQX.js → map-view-DyB8tr6c.js} +9 -9
  32. package/dist/_chunks/{matrix-rain-CRPMXcVx.js → matrix-rain-sDOUUwZp.js} +35 -35
  33. package/dist/_chunks/{message-card-i61k1TGc.js → message-card-DjRtA8GG.js} +3 -3
  34. package/dist/_chunks/{message-tray-DrV7G-wR.js → message-tray-DfsAMncP.js} +3 -3
  35. package/dist/_chunks/monitor-D-SFdbrU.js +16 -0
  36. package/dist/_chunks/{notification-card-ejOw5g6g.js → notification-card-B_847w5g.js} +3 -3
  37. package/dist/_chunks/{notification-tray-D_69dXFY.js → notification-tray-6f7smmT1.js} +22 -19
  38. package/dist/_chunks/patient-shell-Bq8CjRYF.js +173 -0
  39. package/dist/_chunks/{payment-form-F7uh0Rqr.js → payment-form-Ds3rxvad.js} +2 -2
  40. package/dist/_chunks/{pdf-viewer-CuYaVR1I.js → pdf-viewer-CIuaocnq.js} +2 -2
  41. package/dist/_chunks/{popover--derJ_wq.js → popover-D0slaBB9.js} +17 -13
  42. package/dist/_chunks/{privacy-lock-BKsI6ReN.js → privacy-lock-BI4vi9Ud.js} +2 -2
  43. package/dist/_chunks/{public-header.agent-BQ3r6Hgq.js → public-header.agent-5U3S9QiC.js} +49 -41
  44. package/dist/_chunks/react-day-picker-D3yzgvDB.js +3127 -0
  45. package/dist/_chunks/{recaptcha-widget-Kp1XntuE.js → recaptcha-widget-BtBNb6tB.js} +2 -2
  46. package/dist/_chunks/{search-bar-DORSAzNt.js → search-bar-BRMW1-WG.js} +2 -2
  47. package/dist/_chunks/{search-input-BtEJAJHa.js → search-input-CIA6pPfn.js} +2 -2
  48. package/dist/_chunks/{sheet-BT0izeoI.js → sheet-D8M8hf8B.js} +2 -2
  49. package/dist/_chunks/{sign-in-with-alfadocs-button-4zZC-I6y.js → sign-in-with-alfadocs-button-BI0fVonM.js} +2 -2
  50. package/dist/_chunks/{slot-grid-CgpYgBkW.js → slot-grid-DoodeQGZ.js} +4 -4
  51. package/dist/_chunks/sparkles-CuYXqQLg.js +23 -0
  52. package/dist/_chunks/{spinner-DirtWZNG.js → spinner-CCByyvcb.js} +2 -2
  53. package/dist/_chunks/stepper-accordion-BfS6lUB9.js +257 -0
  54. package/dist/_chunks/stepper-accordion.agent-C4quJ-MD.js +71 -0
  55. package/dist/_chunks/stethoscope-B8kpbtjh.js +35 -0
  56. package/dist/_chunks/{sun-Eweh5fvi.js → sun-BuXE0xUS.js} +3 -15
  57. package/dist/_chunks/{task-tray-B3A2fRGR.js → task-tray-Bcmrrs8m.js} +3 -3
  58. package/dist/_chunks/{theme-toggle-FrotC2VI.js → theme-toggle-nPzb378f.js} +37 -36
  59. package/dist/_chunks/{timeline-jmd7lfDf.js → timeline-CR7HjZCK.js} +3 -3
  60. package/dist/_chunks/{toast.agent-32WNQ-_x.js → toast.agent-CTF6nIj5.js} +2 -2
  61. package/dist/_chunks/{transcript-panel-DUrjx5sa.js → transcript-panel-QUQ9XJmf.js} +2 -2
  62. package/dist/_chunks/{use-password-requirements-C9vKBSVn.js → use-password-requirements-E0sSfx5X.js} +38 -53
  63. package/dist/_chunks/use-theme-C2dHKUAN.js +145 -0
  64. package/dist/_chunks/{workflow-map-BR6txfFX.js → workflow-map-BKsKdYvZ.js} +5 -5
  65. package/dist/agent-catalog.json +56 -51
  66. package/dist/components/agenda-card/index.js +1 -1
  67. package/dist/components/agenda-tray/index.js +1 -1
  68. package/dist/components/ai-prompt-input/index.js +1 -1
  69. package/dist/components/audio-recorder/index.js +1 -1
  70. package/dist/components/autocomplete/index.js +1 -1
  71. package/dist/components/avatar/index.js +1 -1
  72. package/dist/components/benefit-card/index.js +1 -1
  73. package/dist/components/booking/booking.agent.d.ts +4 -0
  74. package/dist/components/booking/booking.d.ts +91 -0
  75. package/dist/components/booking/index.d.ts +4 -0
  76. package/dist/components/booking/index.js +6 -0
  77. package/dist/components/button/index.js +1 -1
  78. package/dist/components/calendar/index.js +1 -1
  79. package/dist/components/card/index.js +1 -1
  80. package/dist/components/carousel/index.js +1 -1
  81. package/dist/components/chat-input/index.js +1 -1
  82. package/dist/components/chat-message/index.js +1 -1
  83. package/dist/components/command-palette/index.js +1 -1
  84. package/dist/components/contact-card/index.js +1 -1
  85. package/dist/components/data-table/index.js +1 -1
  86. package/dist/components/date-picker/index.js +1 -1
  87. package/dist/components/date-range-picker/index.js +1 -1
  88. package/dist/components/date-time-picker/index.js +1 -1
  89. package/dist/components/description-list/index.js +1 -1
  90. package/dist/components/dialog/index.js +1 -1
  91. package/dist/components/empty-state/index.js +1 -1
  92. package/dist/components/freemium-paywall/index.js +1 -1
  93. package/dist/components/header/index.js +1 -1
  94. package/dist/components/header-settings/index.js +60 -48
  95. package/dist/components/icon-button/index.js +1 -1
  96. package/dist/components/index.d.ts +1 -1
  97. package/dist/components/key-value-pair/index.js +1 -1
  98. package/dist/components/locale-picker/index.js +1 -1
  99. package/dist/components/map-view/index.js +1 -1
  100. package/dist/components/matrix-rain/index.js +1 -1
  101. package/dist/components/message-card/index.js +1 -1
  102. package/dist/components/message-tray/index.js +1 -1
  103. package/dist/components/notification-card/index.js +1 -1
  104. package/dist/components/notification-tray/index.js +1 -1
  105. package/dist/components/password-input/index.js +1 -1
  106. package/dist/components/payment-form/index.js +1 -1
  107. package/dist/components/pdf-viewer/index.js +1 -1
  108. package/dist/components/popover/index.js +1 -1
  109. package/dist/components/privacy-lock/index.js +1 -1
  110. package/dist/components/public-header/index.js +1 -1
  111. package/dist/components/recaptcha-widget/index.js +1 -1
  112. package/dist/components/search-bar/index.js +1 -1
  113. package/dist/components/search-input/index.js +1 -1
  114. package/dist/components/sheet/index.js +1 -1
  115. package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
  116. package/dist/components/slot-grid/index.js +1 -1
  117. package/dist/components/spinner/index.js +1 -1
  118. package/dist/components/stepper-accordion/index.js +4 -3
  119. package/dist/components/task-tray/index.js +1 -1
  120. package/dist/components/theme-toggle/index.js +1 -1
  121. package/dist/components/timeline/index.js +1 -1
  122. package/dist/components/toast/index.js +1 -1
  123. package/dist/components/transcript-panel/index.js +1 -1
  124. package/dist/components/workflow/index.js +1 -1
  125. package/dist/hooks/index.js +1 -1
  126. package/dist/i18n/config.js +1090 -46
  127. package/dist/i18n/locales/ar.d.ts +58 -0
  128. package/dist/i18n/locales/de.d.ts +58 -0
  129. package/dist/i18n/locales/el.d.ts +58 -0
  130. package/dist/i18n/locales/es.d.ts +58 -0
  131. package/dist/i18n/locales/fr.d.ts +58 -0
  132. package/dist/i18n/locales/hi.d.ts +58 -0
  133. package/dist/i18n/locales/ja.d.ts +58 -0
  134. package/dist/i18n/locales/nl.d.ts +58 -0
  135. package/dist/i18n/locales/pl.d.ts +58 -0
  136. package/dist/i18n/locales/pt.d.ts +58 -0
  137. package/dist/i18n/locales/ro.d.ts +58 -0
  138. package/dist/i18n/locales/ru.d.ts +58 -0
  139. package/dist/i18n/locales/sq.d.ts +58 -0
  140. package/dist/i18n/locales/sv.d.ts +58 -0
  141. package/dist/i18n/locales/tr.d.ts +58 -0
  142. package/dist/i18n/locales/zh.d.ts +58 -0
  143. package/dist/i18n/resources.d.ts +116 -0
  144. package/dist/index.js +270 -269
  145. package/dist/locales/ar.json +59 -1
  146. package/dist/locales/de.json +59 -1
  147. package/dist/locales/el.json +59 -1
  148. package/dist/locales/en.json +59 -1
  149. package/dist/locales/es.json +59 -1
  150. package/dist/locales/fr.json +59 -1
  151. package/dist/locales/hi.json +59 -1
  152. package/dist/locales/it.json +59 -1
  153. package/dist/locales/ja.json +59 -1
  154. package/dist/locales/nl.json +59 -1
  155. package/dist/locales/pl.json +59 -1
  156. package/dist/locales/pt.json +59 -1
  157. package/dist/locales/ro.json +59 -1
  158. package/dist/locales/ru.json +59 -1
  159. package/dist/locales/sq.json +59 -1
  160. package/dist/locales/sv.json +59 -1
  161. package/dist/locales/tr.json +59 -1
  162. package/dist/locales/zh.json +59 -1
  163. package/dist/patterns/alia-assistant/index.js +1 -1
  164. package/dist/patterns/patient-shell/index.js +1 -1
  165. package/dist/tokens.css +1 -1
  166. package/package.json +5 -1
  167. package/dist/_chunks/icon-button-C4CGcYuz.js +0 -54
  168. package/dist/_chunks/isSameMonth-5wNF2f4I.js +0 -1307
  169. package/dist/_chunks/patient-shell-B164drIa.js +0 -173
  170. package/dist/_chunks/react-day-picker-C5F3-TTX.js +0 -1827
  171. package/dist/_chunks/stepper-C-sIpRRU.js +0 -7
  172. package/dist/_chunks/stepper-accordion.agent-ckKYZCIP.js +0 -322
  173. package/dist/_chunks/stepper-calendar-BLOJUE0-.js +0 -648
  174. package/dist/_chunks/use-theme-B1cwAXJR.js +0 -145
  175. package/dist/components/stepper-calendar/index.d.ts +0 -4
  176. package/dist/components/stepper-calendar/index.js +0 -6
  177. package/dist/components/stepper-calendar/stepper-calendar.agent.d.ts +0 -4
  178. package/dist/components/stepper-calendar/stepper-calendar.d.ts +0 -62
@@ -1,1827 +0,0 @@
1
- import { c as rn } from "./createLucideIcon-CrFbzy84.js";
2
- import h, { createContext as on, useContext as sn, useCallback as $, useRef as ke, useLayoutEffect as an, useState as Be, useEffect as fn, useMemo as De } from "react";
3
- import { c as rt, a as ot, g as dn, m as ae, f as de, d as st, k as at, j as it, r as ln, i as cn, h as un, s as hn, b as yn, t as mn } from "./isSameMonth-5wNF2f4I.js";
4
- import { c as te, t as F, n as Pe, i as Mn, s as kn } from "./isSameDay-ecuM8PBB.js";
5
- import { jsx as Ze } from "react/jsx-runtime";
6
- import { C as Dn } from "./chevron-left-CX1jqD2M.js";
7
- import { C as vn } from "./chevron-right-BrpYejk0.js";
8
- import { c as ve } from "./index-D2ZczOXr.js";
9
- /**
10
- * @license lucide-react v1.8.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */
15
- const gn = [
16
- ["path", { d: "M8 2v4", key: "1cmpym" }],
17
- ["path", { d: "M16 2v4", key: "4m81vk" }],
18
- ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
19
- ["path", { d: "M3 10h18", key: "8toen8" }]
20
- ], bo = rn("calendar", gn);
21
- function bn(e, t, r = "long") {
22
- return new Intl.DateTimeFormat("en-US", {
23
- // Enforces engine to render the time. Without the option JavaScriptCore omits it.
24
- hour: "numeric",
25
- timeZone: e,
26
- timeZoneName: r
27
- }).format(t).split(/\s/g).slice(2).join(" ");
28
- }
29
- const Ye = {}, le = {};
30
- function re(e, t) {
31
- try {
32
- const n = (Ye[e] || (Ye[e] = new Intl.DateTimeFormat("en-US", {
33
- timeZone: e,
34
- timeZoneName: "longOffset"
35
- }).format))(t).split("GMT")[1];
36
- return n in le ? le[n] : Je(n, n.split(":"));
37
- } catch {
38
- if (e in le) return le[e];
39
- const r = e == null ? void 0 : e.match(On);
40
- return r ? Je(e, r.slice(1)) : NaN;
41
- }
42
- }
43
- const On = /([+-]\d\d):?(\d\d)?/;
44
- function Je(e, t) {
45
- const r = +(t[0] || 0), n = +(t[1] || 0), o = +(t[2] || 0) / 60;
46
- return le[e] = r * 60 + n > 0 ? r * 60 + n + o : r * 60 - n - o;
47
- }
48
- class Z extends Date {
49
- //#region static
50
- constructor(...t) {
51
- super(), t.length > 1 && typeof t[t.length - 1] == "string" && (this.timeZone = t.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(re(this.timeZone, this)) ? this.setTime(NaN) : t.length ? typeof t[0] == "number" && (t.length === 1 || t.length === 2 && typeof t[1] != "number") ? this.setTime(t[0]) : typeof t[0] == "string" ? this.setTime(+new Date(t[0])) : t[0] instanceof Date ? this.setTime(+t[0]) : (this.setTime(+new Date(...t)), ft(this), Fe(this)) : this.setTime(Date.now());
52
- }
53
- static tz(t, ...r) {
54
- return r.length ? new Z(...r, t) : new Z(Date.now(), t);
55
- }
56
- //#endregion
57
- //#region time zone
58
- withTimeZone(t) {
59
- return new Z(+this, t);
60
- }
61
- getTimezoneOffset() {
62
- const t = -re(this.timeZone, this);
63
- return t > 0 ? Math.floor(t) : Math.ceil(t);
64
- }
65
- //#endregion
66
- //#region time
67
- setTime(t) {
68
- return Date.prototype.setTime.apply(this, arguments), Fe(this), +this;
69
- }
70
- //#endregion
71
- //#region date-fns integration
72
- [Symbol.for("constructDateFrom")](t) {
73
- return new Z(+new Date(t), this.timeZone);
74
- }
75
- //#endregion
76
- }
77
- const Qe = /^(get|set)(?!UTC)/;
78
- Object.getOwnPropertyNames(Date.prototype).forEach((e) => {
79
- if (!Qe.test(e)) return;
80
- const t = e.replace(Qe, "$1UTC");
81
- Z.prototype[t] && (e.startsWith("get") ? Z.prototype[e] = function() {
82
- return this.internal[t]();
83
- } : (Z.prototype[e] = function() {
84
- return Date.prototype[t].apply(this.internal, arguments), pn(this), +this;
85
- }, Z.prototype[t] = function() {
86
- return Date.prototype[t].apply(this, arguments), Fe(this), +this;
87
- }));
88
- });
89
- function Fe(e) {
90
- e.internal.setTime(+e), e.internal.setUTCSeconds(e.internal.getUTCSeconds() - Math.round(-re(e.timeZone, e) * 60));
91
- }
92
- function pn(e) {
93
- Date.prototype.setFullYear.call(e, e.internal.getUTCFullYear(), e.internal.getUTCMonth(), e.internal.getUTCDate()), Date.prototype.setHours.call(e, e.internal.getUTCHours(), e.internal.getUTCMinutes(), e.internal.getUTCSeconds(), e.internal.getUTCMilliseconds()), ft(e);
94
- }
95
- function ft(e) {
96
- const t = re(e.timeZone, e), r = t > 0 ? Math.floor(t) : Math.ceil(t), n = /* @__PURE__ */ new Date(+e);
97
- n.setUTCHours(n.getUTCHours() - 1);
98
- const o = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset(), s = -(/* @__PURE__ */ new Date(+n)).getTimezoneOffset(), a = o - s, i = Date.prototype.getHours.apply(e) !== e.internal.getUTCHours();
99
- a && i && e.internal.setUTCMinutes(e.internal.getUTCMinutes() + a);
100
- const f = o - r;
101
- f && Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + f);
102
- const d = /* @__PURE__ */ new Date(+e);
103
- d.setUTCSeconds(0);
104
- const l = o > 0 ? d.getSeconds() : (d.getSeconds() - 60) % 60, u = Math.round(-(re(e.timeZone, e) * 60)) % 60;
105
- (u || l) && (e.internal.setUTCSeconds(e.internal.getUTCSeconds() + u), Date.prototype.setUTCSeconds.call(e, Date.prototype.getUTCSeconds.call(e) + u + l));
106
- const y = re(e.timeZone, e), m = y > 0 ? Math.floor(y) : Math.ceil(y), W = -(/* @__PURE__ */ new Date(+e)).getTimezoneOffset() - m, b = m !== r, S = W - f;
107
- if (b && S) {
108
- Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + S);
109
- const g = re(e.timeZone, e), D = g > 0 ? Math.floor(g) : Math.ceil(g), N = m - D;
110
- N && (e.internal.setUTCMinutes(e.internal.getUTCMinutes() + N), Date.prototype.setUTCMinutes.call(e, Date.prototype.getUTCMinutes.call(e) + N));
111
- }
112
- }
113
- class B extends Z {
114
- //#region static
115
- static tz(t, ...r) {
116
- return r.length ? new B(...r, t) : new B(Date.now(), t);
117
- }
118
- //#endregion
119
- //#region representation
120
- toISOString() {
121
- const [t, r, n] = this.tzComponents(), o = `${t}${r}:${n}`;
122
- return this.internal.toISOString().slice(0, -1) + o;
123
- }
124
- toString() {
125
- return `${this.toDateString()} ${this.toTimeString()}`;
126
- }
127
- toDateString() {
128
- const [t, r, n, o] = this.internal.toUTCString().split(" ");
129
- return `${t == null ? void 0 : t.slice(0, -1)} ${n} ${r} ${o}`;
130
- }
131
- toTimeString() {
132
- const t = this.internal.toUTCString().split(" ")[4], [r, n, o] = this.tzComponents();
133
- return `${t} GMT${r}${n}${o} (${bn(this.timeZone, this)})`;
134
- }
135
- toLocaleString(t, r) {
136
- return Date.prototype.toLocaleString.call(this, t, {
137
- ...r,
138
- timeZone: (r == null ? void 0 : r.timeZone) || this.timeZone
139
- });
140
- }
141
- toLocaleDateString(t, r) {
142
- return Date.prototype.toLocaleDateString.call(this, t, {
143
- ...r,
144
- timeZone: (r == null ? void 0 : r.timeZone) || this.timeZone
145
- });
146
- }
147
- toLocaleTimeString(t, r) {
148
- return Date.prototype.toLocaleTimeString.call(this, t, {
149
- ...r,
150
- timeZone: (r == null ? void 0 : r.timeZone) || this.timeZone
151
- });
152
- }
153
- //#endregion
154
- //#region private
155
- tzComponents() {
156
- const t = this.getTimezoneOffset(), r = t > 0 ? "-" : "+", n = String(Math.floor(Math.abs(t) / 60)).padStart(2, "0"), o = String(Math.abs(t) % 60).padStart(2, "0");
157
- return [r, n, o];
158
- }
159
- //#endregion
160
- withTimeZone(t) {
161
- return new B(+this, t);
162
- }
163
- //#region date-fns integration
164
- [Symbol.for("constructDateFrom")](t) {
165
- return new B(+new Date(t), this.timeZone);
166
- }
167
- //#endregion
168
- }
169
- function wn(e, t, r) {
170
- return rt(e, t * 7, r);
171
- }
172
- function Wn(e, t, r) {
173
- return ot(e, t * 12, r);
174
- }
175
- function Nn(e, t) {
176
- let r, n = t == null ? void 0 : t.in;
177
- return e.forEach((o) => {
178
- !n && typeof o == "object" && (n = te.bind(null, o));
179
- const s = F(o, n);
180
- (!r || r < s || isNaN(+s)) && (r = s);
181
- }), te(n, r || NaN);
182
- }
183
- function Cn(e, t) {
184
- let r, n = t == null ? void 0 : t.in;
185
- return e.forEach((o) => {
186
- !n && typeof o == "object" && (n = te.bind(null, o));
187
- const s = F(o, n);
188
- (!r || r > s || isNaN(+s)) && (r = s);
189
- }), te(n, r || NaN);
190
- }
191
- function dt(e, t, r) {
192
- const [n, o] = Pe(
193
- r == null ? void 0 : r.in,
194
- e,
195
- t
196
- ), s = n.getFullYear() - o.getFullYear(), a = n.getMonth() - o.getMonth();
197
- return s * 12 + a;
198
- }
199
- function Sn(e, t) {
200
- const r = F(e, t == null ? void 0 : t.in), n = r.getMonth();
201
- return r.setFullYear(r.getFullYear(), n + 1, 0), r.setHours(23, 59, 59, 999), r;
202
- }
203
- function lt(e, t) {
204
- const [r, n] = Pe(e, t.start, t.end);
205
- return { start: r, end: n };
206
- }
207
- function Yn(e, t) {
208
- const { start: r, end: n } = lt(t == null ? void 0 : t.in, e);
209
- let o = +r > +n;
210
- const s = o ? +r : +n, a = o ? n : r;
211
- a.setHours(0, 0, 0, 0), a.setDate(1);
212
- let i = 1;
213
- const f = [];
214
- for (; +a <= s; )
215
- f.push(te(r, a)), a.setMonth(a.getMonth() + i);
216
- return o ? f.reverse() : f;
217
- }
218
- function _n(e, t) {
219
- const r = F(e, t == null ? void 0 : t.in), n = r.getFullYear();
220
- return r.setFullYear(n + 1, 0, 0), r.setHours(23, 59, 59, 999), r;
221
- }
222
- function Tn(e, t) {
223
- const { start: r, end: n } = lt(t == null ? void 0 : t.in, e);
224
- let o = +r > +n;
225
- const s = o ? +r : +n, a = o ? n : r;
226
- a.setHours(0, 0, 0, 0), a.setMonth(0, 1);
227
- let i = 1;
228
- const f = [];
229
- for (; +a <= s; )
230
- f.push(te(r, a)), a.setFullYear(a.getFullYear() + i);
231
- return o ? f.reverse() : f;
232
- }
233
- function ct(e, t) {
234
- var i, f, d, l;
235
- const r = dn(), n = (t == null ? void 0 : t.weekStartsOn) ?? ((f = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : f.weekStartsOn) ?? r.weekStartsOn ?? ((l = (d = r.locale) == null ? void 0 : d.options) == null ? void 0 : l.weekStartsOn) ?? 0, o = F(e, t == null ? void 0 : t.in), s = o.getDay(), a = (s < n ? -7 : 0) + 6 - (s - n);
236
- return o.setDate(o.getDate() + a), o.setHours(23, 59, 59, 999), o;
237
- }
238
- function En(e, t) {
239
- return ct(e, { ...t, weekStartsOn: 1 });
240
- }
241
- function xn(e, t) {
242
- const r = F(e, t == null ? void 0 : t.in), n = r.getFullYear(), o = r.getMonth(), s = te(r, 0);
243
- return s.setFullYear(n, o + 1, 0), s.setHours(0, 0, 0, 0), s.getDate();
244
- }
245
- function In(e, t) {
246
- return F(e, t == null ? void 0 : t.in).getMonth();
247
- }
248
- function Bn(e, t) {
249
- return F(e, t == null ? void 0 : t.in).getFullYear();
250
- }
251
- function Fn(e, t) {
252
- return +F(e) > +F(t);
253
- }
254
- function Pn(e, t) {
255
- return +F(e) < +F(t);
256
- }
257
- function An(e, t, r) {
258
- const [n, o] = Pe(
259
- r == null ? void 0 : r.in,
260
- e,
261
- t
262
- );
263
- return n.getFullYear() === o.getFullYear();
264
- }
265
- function zn(e, t, r) {
266
- const n = F(e, r == null ? void 0 : r.in), o = n.getFullYear(), s = n.getDate(), a = te(e, 0);
267
- a.setFullYear(o, t, 15), a.setHours(0, 0, 0, 0);
268
- const i = xn(a);
269
- return n.setMonth(t, Math.min(s, i)), n;
270
- }
271
- function Hn(e, t, r) {
272
- const n = F(e, r == null ? void 0 : r.in);
273
- return isNaN(+n) ? te(e, NaN) : (n.setFullYear(t), n);
274
- }
275
- const Xe = 5, jn = 4;
276
- function $n(e, t) {
277
- const r = t.startOfMonth(e), n = r.getDay() > 0 ? r.getDay() : 7, o = t.addDays(e, -n + 1), s = t.addDays(o, Xe * 7 - 1);
278
- return t.getMonth(e) === t.getMonth(s) ? Xe : jn;
279
- }
280
- function ut(e, t) {
281
- const r = t.startOfMonth(e), n = r.getDay();
282
- return n === 1 ? r : n === 0 ? t.addDays(r, -6) : t.addDays(r, -1 * (n - 1));
283
- }
284
- function qn(e, t) {
285
- const r = ut(e, t), n = $n(e, t);
286
- return t.addDays(r, n * 7 - 1);
287
- }
288
- const ht = {
289
- ...ae,
290
- labels: {
291
- labelDayButton: (e, t, r, n) => {
292
- let o;
293
- n && typeof n.format == "function" ? o = n.format.bind(n) : o = (a, i) => de(a, i, { locale: ae, ...r });
294
- let s = o(e, "PPPP");
295
- return t.today && (s = `Today, ${s}`), t.selected && (s = `${s}, selected`), s;
296
- },
297
- labelMonthDropdown: "Choose the Month",
298
- labelNext: "Go to the Next Month",
299
- labelPrevious: "Go to the Previous Month",
300
- labelWeekNumber: (e) => `Week ${e}`,
301
- labelYearDropdown: "Choose the Year",
302
- labelGrid: (e, t, r) => {
303
- let n;
304
- return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o, s) => de(o, s, { locale: ae, ...t }), n(e, "LLLL yyyy");
305
- },
306
- labelGridcell: (e, t, r, n) => {
307
- let o;
308
- n && typeof n.format == "function" ? o = n.format.bind(n) : o = (a, i) => de(a, i, { locale: ae, ...r });
309
- let s = o(e, "PPPP");
310
- return t != null && t.today && (s = `Today, ${s}`), s;
311
- },
312
- labelNav: "Navigation bar",
313
- labelWeekNumberHeader: "Week Number",
314
- labelWeekday: (e, t, r) => {
315
- let n;
316
- return r && typeof r.format == "function" ? n = r.format.bind(r) : n = (o, s) => de(o, s, { locale: ae, ...t }), n(e, "cccc");
317
- }
318
- }
319
- };
320
- class z {
321
- /**
322
- * Creates an instance of `DateLib`.
323
- *
324
- * @param options Configuration options for the date library.
325
- * @param overrides Custom overrides for the date library functions.
326
- */
327
- constructor(t, r) {
328
- this.Date = Date, this.today = () => {
329
- var n;
330
- return (n = this.overrides) != null && n.today ? this.overrides.today() : this.options.timeZone ? B.tz(this.options.timeZone) : new this.Date();
331
- }, this.newDate = (n, o, s) => {
332
- var a;
333
- return (a = this.overrides) != null && a.newDate ? this.overrides.newDate(n, o, s) : this.options.timeZone ? new B(n, o, s, this.options.timeZone) : new Date(n, o, s);
334
- }, this.addDays = (n, o) => {
335
- var s;
336
- return (s = this.overrides) != null && s.addDays ? this.overrides.addDays(n, o) : rt(n, o);
337
- }, this.addMonths = (n, o) => {
338
- var s;
339
- return (s = this.overrides) != null && s.addMonths ? this.overrides.addMonths(n, o) : ot(n, o);
340
- }, this.addWeeks = (n, o) => {
341
- var s;
342
- return (s = this.overrides) != null && s.addWeeks ? this.overrides.addWeeks(n, o) : wn(n, o);
343
- }, this.addYears = (n, o) => {
344
- var s;
345
- return (s = this.overrides) != null && s.addYears ? this.overrides.addYears(n, o) : Wn(n, o);
346
- }, this.differenceInCalendarDays = (n, o) => {
347
- var s;
348
- return (s = this.overrides) != null && s.differenceInCalendarDays ? this.overrides.differenceInCalendarDays(n, o) : st(n, o);
349
- }, this.differenceInCalendarMonths = (n, o) => {
350
- var s;
351
- return (s = this.overrides) != null && s.differenceInCalendarMonths ? this.overrides.differenceInCalendarMonths(n, o) : dt(n, o);
352
- }, this.eachMonthOfInterval = (n) => {
353
- var o;
354
- return (o = this.overrides) != null && o.eachMonthOfInterval ? this.overrides.eachMonthOfInterval(n) : Yn(n);
355
- }, this.eachYearOfInterval = (n) => {
356
- var i;
357
- const o = (i = this.overrides) != null && i.eachYearOfInterval ? this.overrides.eachYearOfInterval(n) : Tn(n), s = new Set(o.map((f) => this.getYear(f)));
358
- if (s.size === o.length)
359
- return o;
360
- const a = [];
361
- return s.forEach((f) => {
362
- a.push(new Date(f, 0, 1));
363
- }), a;
364
- }, this.endOfBroadcastWeek = (n) => {
365
- var o;
366
- return (o = this.overrides) != null && o.endOfBroadcastWeek ? this.overrides.endOfBroadcastWeek(n) : qn(n, this);
367
- }, this.endOfISOWeek = (n) => {
368
- var o;
369
- return (o = this.overrides) != null && o.endOfISOWeek ? this.overrides.endOfISOWeek(n) : En(n);
370
- }, this.endOfMonth = (n) => {
371
- var o;
372
- return (o = this.overrides) != null && o.endOfMonth ? this.overrides.endOfMonth(n) : Sn(n);
373
- }, this.endOfWeek = (n, o) => {
374
- var s;
375
- return (s = this.overrides) != null && s.endOfWeek ? this.overrides.endOfWeek(n, o) : ct(n, this.options);
376
- }, this.endOfYear = (n) => {
377
- var o;
378
- return (o = this.overrides) != null && o.endOfYear ? this.overrides.endOfYear(n) : _n(n);
379
- }, this.format = (n, o, s) => {
380
- var i;
381
- const a = (i = this.overrides) != null && i.format ? this.overrides.format(n, o, this.options) : de(n, o, this.options);
382
- return this.options.numerals && this.options.numerals !== "latn" ? this.replaceDigits(a) : a;
383
- }, this.getISOWeek = (n) => {
384
- var o;
385
- return (o = this.overrides) != null && o.getISOWeek ? this.overrides.getISOWeek(n) : at(n);
386
- }, this.getMonth = (n, o) => {
387
- var s;
388
- return (s = this.overrides) != null && s.getMonth ? this.overrides.getMonth(n, this.options) : In(n, this.options);
389
- }, this.getYear = (n, o) => {
390
- var s;
391
- return (s = this.overrides) != null && s.getYear ? this.overrides.getYear(n, this.options) : Bn(n, this.options);
392
- }, this.getWeek = (n, o) => {
393
- var s;
394
- return (s = this.overrides) != null && s.getWeek ? this.overrides.getWeek(n, this.options) : it(n, this.options);
395
- }, this.isAfter = (n, o) => {
396
- var s;
397
- return (s = this.overrides) != null && s.isAfter ? this.overrides.isAfter(n, o) : Fn(n, o);
398
- }, this.isBefore = (n, o) => {
399
- var s;
400
- return (s = this.overrides) != null && s.isBefore ? this.overrides.isBefore(n, o) : Pn(n, o);
401
- }, this.isDate = (n) => {
402
- var o;
403
- return (o = this.overrides) != null && o.isDate ? this.overrides.isDate(n) : ln(n);
404
- }, this.isSameDay = (n, o) => {
405
- var s;
406
- return (s = this.overrides) != null && s.isSameDay ? this.overrides.isSameDay(n, o) : Mn(n, o);
407
- }, this.isSameMonth = (n, o) => {
408
- var s;
409
- return (s = this.overrides) != null && s.isSameMonth ? this.overrides.isSameMonth(n, o) : cn(n, o);
410
- }, this.isSameYear = (n, o) => {
411
- var s;
412
- return (s = this.overrides) != null && s.isSameYear ? this.overrides.isSameYear(n, o) : An(n, o);
413
- }, this.max = (n) => {
414
- var o;
415
- return (o = this.overrides) != null && o.max ? this.overrides.max(n) : Nn(n);
416
- }, this.min = (n) => {
417
- var o;
418
- return (o = this.overrides) != null && o.min ? this.overrides.min(n) : Cn(n);
419
- }, this.setMonth = (n, o) => {
420
- var s;
421
- return (s = this.overrides) != null && s.setMonth ? this.overrides.setMonth(n, o) : zn(n, o);
422
- }, this.setYear = (n, o) => {
423
- var s;
424
- return (s = this.overrides) != null && s.setYear ? this.overrides.setYear(n, o) : Hn(n, o);
425
- }, this.startOfBroadcastWeek = (n, o) => {
426
- var s;
427
- return (s = this.overrides) != null && s.startOfBroadcastWeek ? this.overrides.startOfBroadcastWeek(n, this) : ut(n, this);
428
- }, this.startOfDay = (n) => {
429
- var o;
430
- return (o = this.overrides) != null && o.startOfDay ? this.overrides.startOfDay(n) : kn(n);
431
- }, this.startOfISOWeek = (n) => {
432
- var o;
433
- return (o = this.overrides) != null && o.startOfISOWeek ? this.overrides.startOfISOWeek(n) : un(n);
434
- }, this.startOfMonth = (n) => {
435
- var o;
436
- return (o = this.overrides) != null && o.startOfMonth ? this.overrides.startOfMonth(n) : hn(n);
437
- }, this.startOfWeek = (n, o) => {
438
- var s;
439
- return (s = this.overrides) != null && s.startOfWeek ? this.overrides.startOfWeek(n, this.options) : yn(n, this.options);
440
- }, this.startOfYear = (n) => {
441
- var o;
442
- return (o = this.overrides) != null && o.startOfYear ? this.overrides.startOfYear(n) : mn(n);
443
- }, this.options = { locale: ht, ...t }, this.overrides = r;
444
- }
445
- /**
446
- * Generates a mapping of Arabic digits (0-9) to the target numbering system
447
- * digits.
448
- *
449
- * @since 9.5.0
450
- * @returns A record mapping Arabic digits to the target numerals.
451
- */
452
- getDigitMap() {
453
- const { numerals: t = "latn" } = this.options, r = new Intl.NumberFormat("en-US", {
454
- numberingSystem: t
455
- }), n = {};
456
- for (let o = 0; o < 10; o++)
457
- n[o.toString()] = r.format(o);
458
- return n;
459
- }
460
- /**
461
- * Replaces Arabic digits in a string with the target numbering system digits.
462
- *
463
- * @since 9.5.0
464
- * @param input The string containing Arabic digits.
465
- * @returns The string with digits replaced.
466
- */
467
- replaceDigits(t) {
468
- const r = this.getDigitMap();
469
- return t.replace(/\d/g, (n) => r[n] || n);
470
- }
471
- /**
472
- * Formats a number using the configured numbering system.
473
- *
474
- * @since 9.5.0
475
- * @param value The number to format.
476
- * @returns The formatted number as a string.
477
- */
478
- formatNumber(t) {
479
- return this.replaceDigits(t.toString());
480
- }
481
- /**
482
- * Returns the preferred ordering for month and year labels for the current
483
- * locale.
484
- */
485
- getMonthYearOrder() {
486
- var r;
487
- const t = (r = this.options.locale) == null ? void 0 : r.code;
488
- return t && z.yearFirstLocales.has(t) ? "year-first" : "month-first";
489
- }
490
- /**
491
- * Formats the month/year pair respecting locale conventions.
492
- *
493
- * @since 9.11.0
494
- */
495
- formatMonthYear(t) {
496
- const { locale: r, timeZone: n, numerals: o } = this.options, s = r == null ? void 0 : r.code;
497
- if (s && z.yearFirstLocales.has(s))
498
- try {
499
- return new Intl.DateTimeFormat(s, {
500
- month: "long",
501
- year: "numeric",
502
- timeZone: n,
503
- numberingSystem: o
504
- }).format(t);
505
- } catch {
506
- }
507
- const a = this.getMonthYearOrder() === "year-first" ? "y LLLL" : "LLLL y";
508
- return this.format(t, a);
509
- }
510
- }
511
- z.yearFirstLocales = /* @__PURE__ */ new Set([
512
- "eu",
513
- "hu",
514
- "ja",
515
- "ja-Hira",
516
- "ja-JP",
517
- "ko",
518
- "ko-KR",
519
- "lt",
520
- "lt-LT",
521
- "lv",
522
- "lv-LV",
523
- "mn",
524
- "mn-MN",
525
- "zh",
526
- "zh-CN",
527
- "zh-HK",
528
- "zh-TW"
529
- ]);
530
- const J = new z();
531
- class yt {
532
- constructor(t, r, n = J) {
533
- this.date = t, this.displayMonth = r, this.outside = !!(r && !n.isSameMonth(t, r)), this.dateLib = n, this.isoDate = n.format(t, "yyyy-MM-dd"), this.displayMonthId = n.format(r, "yyyy-MM"), this.dateMonthId = n.format(t, "yyyy-MM");
534
- }
535
- /**
536
- * Checks if this day is equal to another `CalendarDay`, considering both the
537
- * date and the displayed month.
538
- *
539
- * @param day The `CalendarDay` to compare with.
540
- * @returns `true` if the days are equal, otherwise `false`.
541
- */
542
- isEqualTo(t) {
543
- return this.dateLib.isSameDay(t.date, this.date) && this.dateLib.isSameMonth(t.displayMonth, this.displayMonth);
544
- }
545
- }
546
- class Gn {
547
- constructor(t, r) {
548
- this.date = t, this.weeks = r;
549
- }
550
- }
551
- class Rn {
552
- constructor(t, r) {
553
- this.days = r, this.weekNumber = t;
554
- }
555
- }
556
- function Un(e) {
557
- return h.createElement("button", { ...e });
558
- }
559
- function Vn(e) {
560
- return h.createElement("span", { ...e });
561
- }
562
- function Kn(e) {
563
- const { size: t = 24, orientation: r = "left", className: n } = e;
564
- return (
565
- // biome-ignore lint/a11y/noSvgWithoutTitle: handled by the parent component
566
- h.createElement(
567
- "svg",
568
- { className: n, width: t, height: t, viewBox: "0 0 24 24" },
569
- r === "up" && h.createElement("polygon", { points: "6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28" }),
570
- r === "down" && h.createElement("polygon", { points: "6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72" }),
571
- r === "left" && h.createElement("polygon", { points: "16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20" }),
572
- r === "right" && h.createElement("polygon", { points: "8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20" })
573
- )
574
- );
575
- }
576
- function Zn(e) {
577
- const { day: t, modifiers: r, ...n } = e;
578
- return h.createElement("td", { ...n });
579
- }
580
- function Jn(e) {
581
- const { day: t, modifiers: r, ...n } = e, o = h.useRef(null);
582
- return h.useEffect(() => {
583
- var s;
584
- r.focused && ((s = o.current) == null || s.focus());
585
- }, [r.focused]), h.createElement("button", { ref: o, ...n });
586
- }
587
- var M;
588
- (function(e) {
589
- e.Root = "root", e.Chevron = "chevron", e.Day = "day", e.DayButton = "day_button", e.CaptionLabel = "caption_label", e.Dropdowns = "dropdowns", e.Dropdown = "dropdown", e.DropdownRoot = "dropdown_root", e.Footer = "footer", e.MonthGrid = "month_grid", e.MonthCaption = "month_caption", e.MonthsDropdown = "months_dropdown", e.Month = "month", e.Months = "months", e.Nav = "nav", e.NextMonthButton = "button_next", e.PreviousMonthButton = "button_previous", e.Week = "week", e.Weeks = "weeks", e.Weekday = "weekday", e.Weekdays = "weekdays", e.WeekNumber = "week_number", e.WeekNumberHeader = "week_number_header", e.YearsDropdown = "years_dropdown";
590
- })(M || (M = {}));
591
- var E;
592
- (function(e) {
593
- e.disabled = "disabled", e.hidden = "hidden", e.outside = "outside", e.focused = "focused", e.today = "today";
594
- })(E || (E = {}));
595
- var V;
596
- (function(e) {
597
- e.range_end = "range_end", e.range_middle = "range_middle", e.range_start = "range_start", e.selected = "selected";
598
- })(V || (V = {}));
599
- var A;
600
- (function(e) {
601
- e.weeks_before_enter = "weeks_before_enter", e.weeks_before_exit = "weeks_before_exit", e.weeks_after_enter = "weeks_after_enter", e.weeks_after_exit = "weeks_after_exit", e.caption_after_enter = "caption_after_enter", e.caption_after_exit = "caption_after_exit", e.caption_before_enter = "caption_before_enter", e.caption_before_exit = "caption_before_exit";
602
- })(A || (A = {}));
603
- function Qn(e) {
604
- const { options: t, className: r, components: n, classNames: o, ...s } = e, a = [o[M.Dropdown], r].join(" "), i = t == null ? void 0 : t.find(({ value: f }) => f === s.value);
605
- return h.createElement(
606
- "span",
607
- { "data-disabled": s.disabled, className: o[M.DropdownRoot] },
608
- h.createElement(n.Select, { className: a, ...s }, t == null ? void 0 : t.map(({ value: f, label: d, disabled: l }) => h.createElement(n.Option, { key: f, value: f, disabled: l }, d))),
609
- h.createElement(
610
- "span",
611
- { className: o[M.CaptionLabel], "aria-hidden": !0 },
612
- i == null ? void 0 : i.label,
613
- h.createElement(n.Chevron, { orientation: "down", size: 18, className: o[M.Chevron] })
614
- )
615
- );
616
- }
617
- function Xn(e) {
618
- return h.createElement("div", { ...e });
619
- }
620
- function Ln(e) {
621
- return h.createElement("div", { ...e });
622
- }
623
- function er(e) {
624
- const { calendarMonth: t, displayIndex: r, ...n } = e;
625
- return h.createElement("div", { ...n }, e.children);
626
- }
627
- function tr(e) {
628
- const { calendarMonth: t, displayIndex: r, ...n } = e;
629
- return h.createElement("div", { ...n });
630
- }
631
- function nr(e) {
632
- return h.createElement("table", { ...e });
633
- }
634
- function rr(e) {
635
- return h.createElement("div", { ...e });
636
- }
637
- const mt = on(void 0);
638
- function ce() {
639
- const e = sn(mt);
640
- if (e === void 0)
641
- throw new Error("useDayPicker() must be used within a custom component.");
642
- return e;
643
- }
644
- function or(e) {
645
- const { components: t } = ce();
646
- return h.createElement(t.Dropdown, { ...e });
647
- }
648
- function sr(e) {
649
- const { onPreviousClick: t, onNextClick: r, previousMonth: n, nextMonth: o, ...s } = e, { components: a, classNames: i, labels: { labelPrevious: f, labelNext: d } } = ce(), l = $((y) => {
650
- o && (r == null || r(y));
651
- }, [o, r]), u = $((y) => {
652
- n && (t == null || t(y));
653
- }, [n, t]);
654
- return h.createElement(
655
- "nav",
656
- { ...s },
657
- h.createElement(
658
- a.PreviousMonthButton,
659
- { type: "button", className: i[M.PreviousMonthButton], tabIndex: n ? void 0 : -1, "aria-disabled": n ? void 0 : !0, "aria-label": f(n), onClick: u },
660
- h.createElement(a.Chevron, { disabled: n ? void 0 : !0, className: i[M.Chevron], orientation: "left" })
661
- ),
662
- h.createElement(
663
- a.NextMonthButton,
664
- { type: "button", className: i[M.NextMonthButton], tabIndex: o ? void 0 : -1, "aria-disabled": o ? void 0 : !0, "aria-label": d(o), onClick: l },
665
- h.createElement(a.Chevron, { disabled: o ? void 0 : !0, orientation: "right", className: i[M.Chevron] })
666
- )
667
- );
668
- }
669
- function ar(e) {
670
- const { components: t } = ce();
671
- return h.createElement(t.Button, { ...e });
672
- }
673
- function ir(e) {
674
- return h.createElement("option", { ...e });
675
- }
676
- function fr(e) {
677
- const { components: t } = ce();
678
- return h.createElement(t.Button, { ...e });
679
- }
680
- function dr(e) {
681
- const { rootRef: t, ...r } = e;
682
- return h.createElement("div", { ...r, ref: t });
683
- }
684
- function lr(e) {
685
- return h.createElement("select", { ...e });
686
- }
687
- function cr(e) {
688
- const { week: t, ...r } = e;
689
- return h.createElement("tr", { ...r });
690
- }
691
- function ur(e) {
692
- return h.createElement("th", { ...e });
693
- }
694
- function hr(e) {
695
- return h.createElement(
696
- "thead",
697
- { "aria-hidden": !0 },
698
- h.createElement("tr", { ...e })
699
- );
700
- }
701
- function yr(e) {
702
- const { week: t, ...r } = e;
703
- return h.createElement("th", { ...r });
704
- }
705
- function mr(e) {
706
- return h.createElement("th", { ...e });
707
- }
708
- function Mr(e) {
709
- return h.createElement("tbody", { ...e });
710
- }
711
- function kr(e) {
712
- const { components: t } = ce();
713
- return h.createElement(t.Dropdown, { ...e });
714
- }
715
- const Dr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
716
- __proto__: null,
717
- Button: Un,
718
- CaptionLabel: Vn,
719
- Chevron: Kn,
720
- Day: Zn,
721
- DayButton: Jn,
722
- Dropdown: Qn,
723
- DropdownNav: Xn,
724
- Footer: Ln,
725
- Month: er,
726
- MonthCaption: tr,
727
- MonthGrid: nr,
728
- Months: rr,
729
- MonthsDropdown: or,
730
- Nav: sr,
731
- NextMonthButton: ar,
732
- Option: ir,
733
- PreviousMonthButton: fr,
734
- Root: dr,
735
- Select: lr,
736
- Week: cr,
737
- WeekNumber: yr,
738
- WeekNumberHeader: mr,
739
- Weekday: ur,
740
- Weekdays: hr,
741
- Weeks: Mr,
742
- YearsDropdown: kr
743
- }, Symbol.toStringTag, { value: "Module" }));
744
- function L(e, t, r = !1, n = J) {
745
- let { from: o, to: s } = e;
746
- const { differenceInCalendarDays: a, isSameDay: i } = n;
747
- return o && s ? (a(s, o) < 0 && ([o, s] = [s, o]), a(t, o) >= (r ? 1 : 0) && a(s, t) >= (r ? 1 : 0)) : !r && s ? i(s, t) : !r && o ? i(o, t) : !1;
748
- }
749
- function Ae(e) {
750
- return !!(e && typeof e == "object" && "before" in e && "after" in e);
751
- }
752
- function ge(e) {
753
- return !!(e && typeof e == "object" && "from" in e);
754
- }
755
- function ze(e) {
756
- return !!(e && typeof e == "object" && "after" in e);
757
- }
758
- function He(e) {
759
- return !!(e && typeof e == "object" && "before" in e);
760
- }
761
- function Mt(e) {
762
- return !!(e && typeof e == "object" && "dayOfWeek" in e);
763
- }
764
- function kt(e, t) {
765
- return Array.isArray(e) && e.every(t.isDate);
766
- }
767
- function ee(e, t, r = J) {
768
- const n = Array.isArray(t) ? t : [t], { isSameDay: o, differenceInCalendarDays: s, isAfter: a } = r;
769
- return n.some((i) => {
770
- if (typeof i == "boolean")
771
- return i;
772
- if (r.isDate(i))
773
- return o(e, i);
774
- if (kt(i, r))
775
- return i.some((f) => o(e, f));
776
- if (ge(i))
777
- return L(i, e, !1, r);
778
- if (Mt(i))
779
- return Array.isArray(i.dayOfWeek) ? i.dayOfWeek.includes(e.getDay()) : i.dayOfWeek === e.getDay();
780
- if (Ae(i)) {
781
- const f = s(i.before, e), d = s(i.after, e), l = f > 0, u = d < 0;
782
- return a(i.before, i.after) ? u && l : l || u;
783
- }
784
- return ze(i) ? s(e, i.after) > 0 : He(i) ? s(i.before, e) > 0 : typeof i == "function" ? i(e) : !1;
785
- });
786
- }
787
- function vr(e, t, r, n, o) {
788
- const { disabled: s, hidden: a, modifiers: i, showOutsideDays: f, broadcastCalendar: d, today: l = o.today() } = t, { isSameDay: u, isSameMonth: y, startOfMonth: m, isBefore: p, endOfMonth: W, isAfter: b } = o, S = r && m(r), g = n && W(n), D = {
789
- [E.focused]: [],
790
- [E.outside]: [],
791
- [E.disabled]: [],
792
- [E.hidden]: [],
793
- [E.today]: []
794
- }, N = {};
795
- for (const v of e) {
796
- const { date: c, displayMonth: w } = v, T = !!(w && !y(c, w)), I = !!(S && p(c, S)), x = !!(g && b(c, g)), H = !!(s && ee(c, s, o)), ne = !!(a && ee(c, a, o)) || I || x || // Broadcast calendar will show outside days as default
797
- !d && !f && T || d && f === !1 && T, Q = u(c, l);
798
- T && D.outside.push(v), H && D.disabled.push(v), ne && D.hidden.push(v), Q && D.today.push(v), i && Object.keys(i).forEach((j) => {
799
- const oe = i == null ? void 0 : i[j];
800
- oe && ee(c, oe, o) && (N[j] ? N[j].push(v) : N[j] = [v]);
801
- });
802
- }
803
- return (v) => {
804
- const c = {
805
- [E.focused]: !1,
806
- [E.disabled]: !1,
807
- [E.hidden]: !1,
808
- [E.outside]: !1,
809
- [E.today]: !1
810
- }, w = {};
811
- for (const T in D) {
812
- const I = D[T];
813
- c[T] = I.some((x) => x === v);
814
- }
815
- for (const T in N)
816
- w[T] = N[T].some((I) => I === v);
817
- return {
818
- ...c,
819
- // custom modifiers should override all the previous ones
820
- ...w
821
- };
822
- };
823
- }
824
- function gr(e, t, r = {}) {
825
- return Object.entries(e).filter(([, o]) => o === !0).reduce((o, [s]) => (r[s] ? o.push(r[s]) : t[E[s]] ? o.push(t[E[s]]) : t[V[s]] && o.push(t[V[s]]), o), [t[M.Day]]);
826
- }
827
- function br(e) {
828
- return {
829
- ...Dr,
830
- ...e
831
- };
832
- }
833
- function Or(e) {
834
- const t = {
835
- "data-mode": e.mode ?? void 0,
836
- "data-required": "required" in e ? e.required : void 0,
837
- "data-multiple-months": e.numberOfMonths && e.numberOfMonths > 1 || void 0,
838
- "data-week-numbers": e.showWeekNumber || void 0,
839
- "data-broadcast-calendar": e.broadcastCalendar || void 0,
840
- "data-nav-layout": e.navLayout || void 0
841
- };
842
- return Object.entries(e).forEach(([r, n]) => {
843
- r.startsWith("data-") && (t[r] = n);
844
- }), t;
845
- }
846
- function pr() {
847
- const e = {};
848
- for (const t in M)
849
- e[M[t]] = `rdp-${M[t]}`;
850
- for (const t in E)
851
- e[E[t]] = `rdp-${E[t]}`;
852
- for (const t in V)
853
- e[V[t]] = `rdp-${V[t]}`;
854
- for (const t in A)
855
- e[A[t]] = `rdp-${A[t]}`;
856
- return e;
857
- }
858
- function Dt(e, t, r) {
859
- return (r ?? new z(t)).formatMonthYear(e);
860
- }
861
- const wr = Dt;
862
- function Wr(e, t, r) {
863
- return (r ?? new z(t)).format(e, "d");
864
- }
865
- function Nr(e, t = J) {
866
- return t.format(e, "LLLL");
867
- }
868
- function Cr(e, t, r) {
869
- return (r ?? new z(t)).format(e, "cccccc");
870
- }
871
- function Sr(e, t = J) {
872
- return e < 10 ? t.formatNumber(`0${e.toLocaleString()}`) : t.formatNumber(`${e.toLocaleString()}`);
873
- }
874
- function Yr() {
875
- return "";
876
- }
877
- function vt(e, t = J) {
878
- return t.format(e, "yyyy");
879
- }
880
- const _r = vt, Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
881
- __proto__: null,
882
- formatCaption: Dt,
883
- formatDay: Wr,
884
- formatMonthCaption: wr,
885
- formatMonthDropdown: Nr,
886
- formatWeekNumber: Sr,
887
- formatWeekNumberHeader: Yr,
888
- formatWeekdayName: Cr,
889
- formatYearCaption: _r,
890
- formatYearDropdown: vt
891
- }, Symbol.toStringTag, { value: "Module" }));
892
- function Er(e) {
893
- return e != null && e.formatMonthCaption && !e.formatCaption && (e.formatCaption = e.formatMonthCaption), e != null && e.formatYearCaption && !e.formatYearDropdown && (e.formatYearDropdown = e.formatYearCaption), {
894
- ...Tr,
895
- ...e
896
- };
897
- }
898
- function je(e, t, r, n) {
899
- let o = (n ?? new z(r)).format(e, "PPPP");
900
- return t.today && (o = `Today, ${o}`), t.selected && (o = `${o}, selected`), o;
901
- }
902
- const xr = je;
903
- function $e(e, t, r) {
904
- return (r ?? new z(t)).formatMonthYear(e);
905
- }
906
- const Ir = $e;
907
- function gt(e, t, r, n) {
908
- let o = (n ?? new z(r)).format(e, "PPPP");
909
- return t != null && t.today && (o = `Today, ${o}`), o;
910
- }
911
- function bt(e) {
912
- return "Choose the Month";
913
- }
914
- function Ot() {
915
- return "";
916
- }
917
- const Br = "Go to the Next Month";
918
- function pt(e, t) {
919
- return Br;
920
- }
921
- function wt(e) {
922
- return "Go to the Previous Month";
923
- }
924
- function Wt(e, t, r) {
925
- return (r ?? new z(t)).format(e, "cccc");
926
- }
927
- function Nt(e, t) {
928
- return `Week ${e}`;
929
- }
930
- function Ct(e) {
931
- return "Week Number";
932
- }
933
- function St(e) {
934
- return "Choose the Year";
935
- }
936
- const Fr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
937
- __proto__: null,
938
- labelCaption: Ir,
939
- labelDay: xr,
940
- labelDayButton: je,
941
- labelGrid: $e,
942
- labelGridcell: gt,
943
- labelMonthDropdown: bt,
944
- labelNav: Ot,
945
- labelNext: pt,
946
- labelPrevious: wt,
947
- labelWeekNumber: Nt,
948
- labelWeekNumberHeader: Ct,
949
- labelWeekday: Wt,
950
- labelYearDropdown: St
951
- }, Symbol.toStringTag, { value: "Module" })), U = (e, t, r) => t || (r ? typeof r == "function" ? r : (...n) => r : e);
952
- function Pr(e, t) {
953
- var n;
954
- const r = ((n = t.locale) == null ? void 0 : n.labels) ?? {};
955
- return {
956
- ...Fr,
957
- ...e ?? {},
958
- labelDayButton: U(je, e == null ? void 0 : e.labelDayButton, r.labelDayButton),
959
- labelMonthDropdown: U(bt, e == null ? void 0 : e.labelMonthDropdown, r.labelMonthDropdown),
960
- labelNext: U(pt, e == null ? void 0 : e.labelNext, r.labelNext),
961
- labelPrevious: U(wt, e == null ? void 0 : e.labelPrevious, r.labelPrevious),
962
- labelWeekNumber: U(Nt, e == null ? void 0 : e.labelWeekNumber, r.labelWeekNumber),
963
- labelYearDropdown: U(St, e == null ? void 0 : e.labelYearDropdown, r.labelYearDropdown),
964
- labelGrid: U($e, e == null ? void 0 : e.labelGrid, r.labelGrid),
965
- labelGridcell: U(gt, e == null ? void 0 : e.labelGridcell, r.labelGridcell),
966
- labelNav: U(Ot, e == null ? void 0 : e.labelNav, r.labelNav),
967
- labelWeekNumberHeader: U(Ct, e == null ? void 0 : e.labelWeekNumberHeader, r.labelWeekNumberHeader),
968
- labelWeekday: U(Wt, e == null ? void 0 : e.labelWeekday, r.labelWeekday)
969
- };
970
- }
971
- function Ar(e, t, r, n, o) {
972
- const { startOfMonth: s, startOfYear: a, endOfYear: i, eachMonthOfInterval: f, getMonth: d } = o;
973
- return f({
974
- start: a(e),
975
- end: i(e)
976
- }).map((y) => {
977
- const m = n.formatMonthDropdown(y, o), p = d(y), W = t && y < s(t) || r && y > s(r) || !1;
978
- return { value: p, label: m, disabled: W };
979
- });
980
- }
981
- function zr(e, t = {}, r = {}) {
982
- let n = { ...t == null ? void 0 : t[M.Day] };
983
- return Object.entries(e).filter(([, o]) => o === !0).forEach(([o]) => {
984
- n = {
985
- ...n,
986
- ...r == null ? void 0 : r[o]
987
- };
988
- }), n;
989
- }
990
- function Hr(e, t, r, n) {
991
- const o = n ?? e.today(), s = r ? e.startOfBroadcastWeek(o, e) : t ? e.startOfISOWeek(o) : e.startOfWeek(o), a = [];
992
- for (let i = 0; i < 7; i++) {
993
- const f = e.addDays(s, i);
994
- a.push(f);
995
- }
996
- return a;
997
- }
998
- function jr(e, t, r, n, o = !1) {
999
- if (!e || !t)
1000
- return;
1001
- const { startOfYear: s, endOfYear: a, eachYearOfInterval: i, getYear: f } = n, d = s(e), l = a(t), u = i({ start: d, end: l });
1002
- return o && u.reverse(), u.map((y) => {
1003
- const m = r.formatYearDropdown(y, n);
1004
- return {
1005
- value: f(y),
1006
- label: m,
1007
- disabled: !1
1008
- };
1009
- });
1010
- }
1011
- function $r(e, t = {}) {
1012
- var i;
1013
- const { weekStartsOn: r, locale: n } = t, o = r ?? ((i = n == null ? void 0 : n.options) == null ? void 0 : i.weekStartsOn) ?? 0, s = (f) => {
1014
- const d = typeof f == "number" || typeof f == "string" ? new Date(f) : f;
1015
- return new B(d.getFullYear(), d.getMonth(), d.getDate(), 12, 0, 0, e);
1016
- }, a = (f) => {
1017
- const d = s(f);
1018
- return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 0, 0, 0, 0);
1019
- };
1020
- return {
1021
- today: () => s(B.tz(e)),
1022
- newDate: (f, d, l) => new B(f, d, l, 12, 0, 0, e),
1023
- startOfDay: (f) => s(f),
1024
- startOfWeek: (f, d) => {
1025
- const l = s(f), u = (d == null ? void 0 : d.weekStartsOn) ?? o, y = (l.getDay() - u + 7) % 7;
1026
- return l.setDate(l.getDate() - y), l;
1027
- },
1028
- startOfISOWeek: (f) => {
1029
- const d = s(f), l = (d.getDay() - 1 + 7) % 7;
1030
- return d.setDate(d.getDate() - l), d;
1031
- },
1032
- startOfMonth: (f) => {
1033
- const d = s(f);
1034
- return d.setDate(1), d;
1035
- },
1036
- startOfYear: (f) => {
1037
- const d = s(f);
1038
- return d.setMonth(0, 1), d;
1039
- },
1040
- endOfWeek: (f, d) => {
1041
- const l = s(f), m = ((((d == null ? void 0 : d.weekStartsOn) ?? o) + 6) % 7 - l.getDay() + 7) % 7;
1042
- return l.setDate(l.getDate() + m), l;
1043
- },
1044
- endOfISOWeek: (f) => {
1045
- const d = s(f), l = (7 - d.getDay()) % 7;
1046
- return d.setDate(d.getDate() + l), d;
1047
- },
1048
- endOfMonth: (f) => {
1049
- const d = s(f);
1050
- return d.setMonth(d.getMonth() + 1, 0), d;
1051
- },
1052
- endOfYear: (f) => {
1053
- const d = s(f);
1054
- return d.setMonth(11, 31), d;
1055
- },
1056
- eachMonthOfInterval: (f) => {
1057
- const d = s(f.start), l = s(f.end), u = [], y = new B(d.getFullYear(), d.getMonth(), 1, 12, 0, 0, e), m = l.getFullYear() * 12 + l.getMonth();
1058
- for (; y.getFullYear() * 12 + y.getMonth() <= m; )
1059
- u.push(new B(y, e)), y.setMonth(y.getMonth() + 1, 1);
1060
- return u;
1061
- },
1062
- // Normalize to noon once before arithmetic (avoid DST/midnight edge cases),
1063
- // mutate the same TZDate, and return it.
1064
- addDays: (f, d) => {
1065
- const l = s(f);
1066
- return l.setDate(l.getDate() + d), l;
1067
- },
1068
- addWeeks: (f, d) => {
1069
- const l = s(f);
1070
- return l.setDate(l.getDate() + d * 7), l;
1071
- },
1072
- addMonths: (f, d) => {
1073
- const l = s(f);
1074
- return l.setMonth(l.getMonth() + d), l;
1075
- },
1076
- addYears: (f, d) => {
1077
- const l = s(f);
1078
- return l.setFullYear(l.getFullYear() + d), l;
1079
- },
1080
- eachYearOfInterval: (f) => {
1081
- const d = s(f.start), l = s(f.end), u = [], y = new B(d.getFullYear(), 0, 1, 12, 0, 0, e);
1082
- for (; y.getFullYear() <= l.getFullYear(); )
1083
- u.push(new B(y, e)), y.setFullYear(y.getFullYear() + 1, 0, 1);
1084
- return u;
1085
- },
1086
- getWeek: (f, d) => {
1087
- var u;
1088
- const l = a(f);
1089
- return it(l, {
1090
- weekStartsOn: (d == null ? void 0 : d.weekStartsOn) ?? o,
1091
- firstWeekContainsDate: (d == null ? void 0 : d.firstWeekContainsDate) ?? ((u = n == null ? void 0 : n.options) == null ? void 0 : u.firstWeekContainsDate) ?? 1
1092
- });
1093
- },
1094
- getISOWeek: (f) => {
1095
- const d = a(f);
1096
- return at(d);
1097
- },
1098
- differenceInCalendarDays: (f, d) => {
1099
- const l = a(f), u = a(d);
1100
- return st(l, u);
1101
- },
1102
- differenceInCalendarMonths: (f, d) => {
1103
- const l = a(f), u = a(d);
1104
- return dt(l, u);
1105
- }
1106
- };
1107
- }
1108
- const ue = (e) => e instanceof HTMLElement ? e : null, _e = (e) => [
1109
- ...e.querySelectorAll("[data-animated-month]") ?? []
1110
- ], qr = (e) => ue(e.querySelector("[data-animated-month]")), Te = (e) => ue(e.querySelector("[data-animated-caption]")), Ee = (e) => ue(e.querySelector("[data-animated-weeks]")), Gr = (e) => ue(e.querySelector("[data-animated-nav]")), Rr = (e) => ue(e.querySelector("[data-animated-weekdays]"));
1111
- function Ur(e, t, { classNames: r, months: n, focused: o, dateLib: s }) {
1112
- const a = ke(null), i = ke(n), f = ke(!1);
1113
- an(() => {
1114
- const d = i.current;
1115
- if (i.current = n, !t || !e.current || // safety check because the ref can be set to anything by consumers
1116
- !(e.current instanceof HTMLElement) || // validation required for the animation to work as expected
1117
- n.length === 0 || d.length === 0 || n.length !== d.length)
1118
- return;
1119
- const l = s.isSameMonth(n[0].date, d[0].date), u = s.isAfter(n[0].date, d[0].date), y = u ? r[A.caption_after_enter] : r[A.caption_before_enter], m = u ? r[A.weeks_after_enter] : r[A.weeks_before_enter], p = a.current, W = e.current.cloneNode(!0);
1120
- if (W instanceof HTMLElement ? (_e(W).forEach((D) => {
1121
- if (!(D instanceof HTMLElement))
1122
- return;
1123
- const N = qr(D);
1124
- N && D.contains(N) && D.removeChild(N);
1125
- const v = Te(D);
1126
- v && v.classList.remove(y);
1127
- const c = Ee(D);
1128
- c && c.classList.remove(m);
1129
- }), a.current = W) : a.current = null, f.current || l || // skip animation if a day is focused because it can cause issues to the animation and is better for a11y
1130
- o)
1131
- return;
1132
- const b = p instanceof HTMLElement ? _e(p) : [], S = _e(e.current);
1133
- if (S != null && S.every((g) => g instanceof HTMLElement) && b && b.every((g) => g instanceof HTMLElement)) {
1134
- f.current = !0, e.current.style.isolation = "isolate";
1135
- const g = Gr(e.current);
1136
- g && (g.style.zIndex = "1"), S.forEach((D, N) => {
1137
- const v = b[N];
1138
- if (!v)
1139
- return;
1140
- D.style.position = "relative", D.style.overflow = "hidden";
1141
- const c = Te(D);
1142
- c && c.classList.add(y);
1143
- const w = Ee(D);
1144
- w && w.classList.add(m);
1145
- const T = () => {
1146
- f.current = !1, e.current && (e.current.style.isolation = ""), g && (g.style.zIndex = ""), c && c.classList.remove(y), w && w.classList.remove(m), D.style.position = "", D.style.overflow = "", D.contains(v) && D.removeChild(v);
1147
- };
1148
- v.style.pointerEvents = "none", v.style.position = "absolute", v.style.overflow = "hidden", v.setAttribute("aria-hidden", "true");
1149
- const I = Rr(v);
1150
- I && (I.style.opacity = "0");
1151
- const x = Te(v);
1152
- x && (x.classList.add(u ? r[A.caption_before_exit] : r[A.caption_after_exit]), x.addEventListener("animationend", T));
1153
- const H = Ee(v);
1154
- H && H.classList.add(u ? r[A.weeks_before_exit] : r[A.weeks_after_exit]), D.insertBefore(v, D.firstChild);
1155
- });
1156
- }
1157
- });
1158
- }
1159
- function Vr(e, t, r, n) {
1160
- const o = e[0], s = e[e.length - 1], { ISOWeek: a, fixedWeeks: i, broadcastCalendar: f } = r ?? {}, { addDays: d, differenceInCalendarDays: l, differenceInCalendarMonths: u, endOfBroadcastWeek: y, endOfISOWeek: m, endOfMonth: p, endOfWeek: W, isAfter: b, startOfBroadcastWeek: S, startOfISOWeek: g, startOfWeek: D } = n, N = f ? S(o, n) : a ? g(o) : D(o), v = f ? y(s) : a ? m(p(s)) : W(p(s)), c = t && (f ? y(t) : a ? m(t) : W(t)), w = c && b(v, c) ? c : v, T = l(w, N), I = u(s, o) + 1, x = [];
1161
- for (let Q = 0; Q <= T; Q++) {
1162
- const j = d(N, Q);
1163
- x.push(j);
1164
- }
1165
- const ne = (f ? 35 : 42) * I;
1166
- if (i && x.length < ne) {
1167
- const Q = ne - x.length;
1168
- for (let j = 0; j < Q; j++) {
1169
- const oe = d(x[x.length - 1], 1);
1170
- x.push(oe);
1171
- }
1172
- }
1173
- return x;
1174
- }
1175
- function Kr(e) {
1176
- const t = [];
1177
- return e.reduce((r, n) => {
1178
- const o = n.weeks.reduce((s, a) => s.concat(a.days.slice()), t.slice());
1179
- return r.concat(o.slice());
1180
- }, t.slice());
1181
- }
1182
- function Zr(e, t, r, n) {
1183
- const { numberOfMonths: o = 1 } = r, s = [];
1184
- for (let a = 0; a < o; a++) {
1185
- const i = n.addMonths(e, a);
1186
- if (t && i > t)
1187
- break;
1188
- s.push(i);
1189
- }
1190
- return s;
1191
- }
1192
- function Le(e, t, r, n) {
1193
- const { month: o, defaultMonth: s, today: a = n.today(), numberOfMonths: i = 1 } = e;
1194
- let f = o || s || a;
1195
- const { differenceInCalendarMonths: d, addMonths: l, startOfMonth: u } = n;
1196
- if (r && d(r, f) < i - 1) {
1197
- const y = -1 * (i - 1);
1198
- f = l(r, y);
1199
- }
1200
- return t && d(f, t) < 0 && (f = t), u(f);
1201
- }
1202
- function Jr(e, t, r, n) {
1203
- const { addDays: o, endOfBroadcastWeek: s, endOfISOWeek: a, endOfMonth: i, endOfWeek: f, getISOWeek: d, getWeek: l, startOfBroadcastWeek: u, startOfISOWeek: y, startOfWeek: m } = n, p = e.reduce((W, b) => {
1204
- const S = r.broadcastCalendar ? u(b, n) : r.ISOWeek ? y(b) : m(b), g = r.broadcastCalendar ? s(b) : r.ISOWeek ? a(i(b)) : f(i(b)), D = t.filter((w) => w >= S && w <= g), N = r.broadcastCalendar ? 35 : 42;
1205
- if (r.fixedWeeks && D.length < N) {
1206
- const w = t.filter((T) => {
1207
- const I = N - D.length;
1208
- return T > g && T <= o(g, I);
1209
- });
1210
- D.push(...w);
1211
- }
1212
- const v = D.reduce((w, T) => {
1213
- const I = r.ISOWeek ? d(T) : l(T), x = w.find((ne) => ne.weekNumber === I), H = new yt(T, b, n);
1214
- return x ? x.days.push(H) : w.push(new Rn(I, [H])), w;
1215
- }, []), c = new Gn(b, v);
1216
- return W.push(c), W;
1217
- }, []);
1218
- return r.reverseMonths ? p.reverse() : p;
1219
- }
1220
- function Qr(e, t) {
1221
- let { startMonth: r, endMonth: n } = e;
1222
- const { startOfYear: o, startOfDay: s, startOfMonth: a, endOfMonth: i, addYears: f, endOfYear: d, newDate: l, today: u } = t, { fromYear: y, toYear: m, fromMonth: p, toMonth: W } = e;
1223
- !r && p && (r = p), !r && y && (r = t.newDate(y, 0, 1)), !n && W && (n = W), !n && m && (n = l(m, 11, 31));
1224
- const b = e.captionLayout === "dropdown" || e.captionLayout === "dropdown-years";
1225
- return r ? r = a(r) : y ? r = l(y, 0, 1) : !r && b && (r = o(f(e.today ?? u(), -100))), n ? n = i(n) : m ? n = l(m, 11, 31) : !n && b && (n = d(e.today ?? u())), [
1226
- r && s(r),
1227
- n && s(n)
1228
- ];
1229
- }
1230
- function Xr(e, t, r, n) {
1231
- if (r.disableNavigation)
1232
- return;
1233
- const { pagedNavigation: o, numberOfMonths: s = 1 } = r, { startOfMonth: a, addMonths: i, differenceInCalendarMonths: f } = n, d = o ? s : 1, l = a(e);
1234
- if (!t)
1235
- return i(l, d);
1236
- if (!(f(t, e) < s))
1237
- return i(l, d);
1238
- }
1239
- function Lr(e, t, r, n) {
1240
- if (r.disableNavigation)
1241
- return;
1242
- const { pagedNavigation: o, numberOfMonths: s } = r, { startOfMonth: a, addMonths: i, differenceInCalendarMonths: f } = n, d = o ? s ?? 1 : 1, l = a(e);
1243
- if (!t)
1244
- return i(l, -d);
1245
- if (!(f(l, t) <= 0))
1246
- return i(l, -d);
1247
- }
1248
- function eo(e) {
1249
- const t = [];
1250
- return e.reduce((r, n) => r.concat(n.weeks.slice()), t.slice());
1251
- }
1252
- function be(e, t) {
1253
- const [r, n] = Be(e);
1254
- return [t === void 0 ? r : t, n];
1255
- }
1256
- function to(e, t) {
1257
- var N;
1258
- const [r, n] = Qr(e, t), { startOfMonth: o, endOfMonth: s } = t, a = Le(e, r, n, t), [i, f] = be(
1259
- a,
1260
- // initialMonth is always computed from props.month if provided
1261
- e.month ? a : void 0
1262
- );
1263
- fn(() => {
1264
- const v = Le(e, r, n, t);
1265
- f(v);
1266
- }, [e.timeZone]);
1267
- const { months: d, weeks: l, days: u, previousMonth: y, nextMonth: m } = De(() => {
1268
- const v = Zr(i, n, { numberOfMonths: e.numberOfMonths }, t), c = Vr(v, e.endMonth ? s(e.endMonth) : void 0, {
1269
- ISOWeek: e.ISOWeek,
1270
- fixedWeeks: e.fixedWeeks,
1271
- broadcastCalendar: e.broadcastCalendar
1272
- }, t), w = Jr(v, c, {
1273
- broadcastCalendar: e.broadcastCalendar,
1274
- fixedWeeks: e.fixedWeeks,
1275
- ISOWeek: e.ISOWeek,
1276
- reverseMonths: e.reverseMonths
1277
- }, t), T = eo(w), I = Kr(w), x = Lr(i, r, e, t), H = Xr(i, n, e, t);
1278
- return {
1279
- months: w,
1280
- weeks: T,
1281
- days: I,
1282
- previousMonth: x,
1283
- nextMonth: H
1284
- };
1285
- }, [
1286
- t,
1287
- i.getTime(),
1288
- n == null ? void 0 : n.getTime(),
1289
- r == null ? void 0 : r.getTime(),
1290
- e.disableNavigation,
1291
- e.broadcastCalendar,
1292
- (N = e.endMonth) == null ? void 0 : N.getTime(),
1293
- e.fixedWeeks,
1294
- e.ISOWeek,
1295
- e.numberOfMonths,
1296
- e.pagedNavigation,
1297
- e.reverseMonths
1298
- ]), { disableNavigation: p, onMonthChange: W } = e, b = (v) => l.some((c) => c.days.some((w) => w.isEqualTo(v))), S = (v) => {
1299
- if (p)
1300
- return;
1301
- let c = o(v);
1302
- r && c < o(r) && (c = o(r)), n && c > o(n) && (c = o(n)), f(c), W == null || W(c);
1303
- };
1304
- return {
1305
- months: d,
1306
- weeks: l,
1307
- days: u,
1308
- navStart: r,
1309
- navEnd: n,
1310
- previousMonth: y,
1311
- nextMonth: m,
1312
- goToMonth: S,
1313
- goToDay: (v) => {
1314
- b(v) || S(v.date);
1315
- }
1316
- };
1317
- }
1318
- var K;
1319
- (function(e) {
1320
- e[e.Today = 0] = "Today", e[e.Selected = 1] = "Selected", e[e.LastFocused = 2] = "LastFocused", e[e.FocusedModifier = 3] = "FocusedModifier";
1321
- })(K || (K = {}));
1322
- function et(e) {
1323
- return !e[E.disabled] && !e[E.hidden] && !e[E.outside];
1324
- }
1325
- function no(e, t, r, n) {
1326
- let o, s = -1;
1327
- for (const a of e) {
1328
- const i = t(a);
1329
- et(i) && (i[E.focused] && s < K.FocusedModifier ? (o = a, s = K.FocusedModifier) : n != null && n.isEqualTo(a) && s < K.LastFocused ? (o = a, s = K.LastFocused) : r(a.date) && s < K.Selected ? (o = a, s = K.Selected) : i[E.today] && s < K.Today && (o = a, s = K.Today));
1330
- }
1331
- return o || (o = e.find((a) => et(t(a)))), o;
1332
- }
1333
- function ro(e, t, r, n, o, s, a) {
1334
- const { ISOWeek: i, broadcastCalendar: f } = s, { addDays: d, addMonths: l, addWeeks: u, addYears: y, endOfBroadcastWeek: m, endOfISOWeek: p, endOfWeek: W, max: b, min: S, startOfBroadcastWeek: g, startOfISOWeek: D, startOfWeek: N } = a;
1335
- let c = {
1336
- day: d,
1337
- week: u,
1338
- month: l,
1339
- year: y,
1340
- startOfWeek: (w) => f ? g(w, a) : i ? D(w) : N(w),
1341
- endOfWeek: (w) => f ? m(w) : i ? p(w) : W(w)
1342
- }[e](r, t === "after" ? 1 : -1);
1343
- return t === "before" && n ? c = b([n, c]) : t === "after" && o && (c = S([o, c])), c;
1344
- }
1345
- function Yt(e, t, r, n, o, s, a, i = 0) {
1346
- if (i > 365)
1347
- return;
1348
- const f = ro(e, t, r.date, n, o, s, a), d = !!(s.disabled && ee(f, s.disabled, a)), l = !!(s.hidden && ee(f, s.hidden, a)), u = f, y = new yt(f, u, a);
1349
- return !d && !l ? y : Yt(e, t, y, n, o, s, a, i + 1);
1350
- }
1351
- function oo(e, t, r, n, o) {
1352
- const { autoFocus: s } = e, [a, i] = Be(), f = no(t.days, r, n || (() => !1), a), [d, l] = Be(s ? f : void 0);
1353
- return {
1354
- isFocusTarget: (W) => !!(f != null && f.isEqualTo(W)),
1355
- setFocused: l,
1356
- focused: d,
1357
- blur: () => {
1358
- i(d), l(void 0);
1359
- },
1360
- moveFocus: (W, b) => {
1361
- if (!d)
1362
- return;
1363
- const S = Yt(W, b, d, t.navStart, t.navEnd, e, o);
1364
- S && (e.disableNavigation && !t.days.some((D) => D.isEqualTo(S)) || (t.goToDay(S), l(S)));
1365
- }
1366
- };
1367
- }
1368
- function so(e, t) {
1369
- const { selected: r, required: n, onSelect: o } = e, [s, a] = be(r, o ? r : void 0), i = o ? r : s, { isSameDay: f } = t, d = (m) => (i == null ? void 0 : i.some((p) => f(p, m))) ?? !1, { min: l, max: u } = e;
1370
- return {
1371
- selected: i,
1372
- select: (m, p, W) => {
1373
- let b = [...i ?? []];
1374
- if (d(m)) {
1375
- if ((i == null ? void 0 : i.length) === l || n && (i == null ? void 0 : i.length) === 1)
1376
- return;
1377
- b = i == null ? void 0 : i.filter((S) => !f(S, m));
1378
- } else
1379
- (i == null ? void 0 : i.length) === u ? b = [m] : b = [...b, m];
1380
- return o || a(b), o == null || o(b, m, p, W), b;
1381
- },
1382
- isSelected: d
1383
- };
1384
- }
1385
- function ao(e, t, r = 0, n = 0, o = !1, s = J) {
1386
- const { from: a, to: i } = t || {}, { isSameDay: f, isAfter: d, isBefore: l } = s;
1387
- let u;
1388
- if (!a && !i)
1389
- u = { from: e, to: r > 0 ? void 0 : e };
1390
- else if (a && !i)
1391
- f(a, e) ? r === 0 ? u = { from: a, to: e } : o ? u = { from: a, to: void 0 } : u = void 0 : l(e, a) ? u = { from: e, to: a } : u = { from: a, to: e };
1392
- else if (a && i)
1393
- if (f(a, e) && f(i, e))
1394
- o ? u = { from: a, to: i } : u = void 0;
1395
- else if (f(a, e))
1396
- u = { from: a, to: r > 0 ? void 0 : e };
1397
- else if (f(i, e))
1398
- u = { from: e, to: r > 0 ? void 0 : e };
1399
- else if (l(e, a))
1400
- u = { from: e, to: i };
1401
- else if (d(e, a))
1402
- u = { from: a, to: e };
1403
- else if (d(e, i))
1404
- u = { from: a, to: e };
1405
- else
1406
- throw new Error("Invalid range");
1407
- if (u != null && u.from && (u != null && u.to)) {
1408
- const y = s.differenceInCalendarDays(u.to, u.from);
1409
- n > 0 && y > n ? u = { from: e, to: void 0 } : r > 1 && y < r && (u = { from: e, to: void 0 });
1410
- }
1411
- return u;
1412
- }
1413
- function io(e, t, r = J) {
1414
- const n = Array.isArray(t) ? t : [t];
1415
- let o = e.from;
1416
- const s = r.differenceInCalendarDays(e.to, e.from), a = Math.min(s, 6);
1417
- for (let i = 0; i <= a; i++) {
1418
- if (n.includes(o.getDay()))
1419
- return !0;
1420
- o = r.addDays(o, 1);
1421
- }
1422
- return !1;
1423
- }
1424
- function tt(e, t, r = J) {
1425
- return L(e, t.from, !1, r) || L(e, t.to, !1, r) || L(t, e.from, !1, r) || L(t, e.to, !1, r);
1426
- }
1427
- function fo(e, t, r = J) {
1428
- const n = Array.isArray(t) ? t : [t];
1429
- if (n.filter((i) => typeof i != "function").some((i) => typeof i == "boolean" ? i : r.isDate(i) ? L(e, i, !1, r) : kt(i, r) ? i.some((f) => L(e, f, !1, r)) : ge(i) ? i.from && i.to ? tt(e, { from: i.from, to: i.to }, r) : !1 : Mt(i) ? io(e, i.dayOfWeek, r) : Ae(i) ? r.isAfter(i.before, i.after) ? tt(e, {
1430
- from: r.addDays(i.after, 1),
1431
- to: r.addDays(i.before, -1)
1432
- }, r) : ee(e.from, i, r) || ee(e.to, i, r) : ze(i) || He(i) ? ee(e.from, i, r) || ee(e.to, i, r) : !1))
1433
- return !0;
1434
- const a = n.filter((i) => typeof i == "function");
1435
- if (a.length) {
1436
- let i = e.from;
1437
- const f = r.differenceInCalendarDays(e.to, e.from);
1438
- for (let d = 0; d <= f; d++) {
1439
- if (a.some((l) => l(i)))
1440
- return !0;
1441
- i = r.addDays(i, 1);
1442
- }
1443
- }
1444
- return !1;
1445
- }
1446
- function lo(e, t) {
1447
- const { disabled: r, excludeDisabled: n, resetOnSelect: o, selected: s, required: a, onSelect: i } = e, [f, d] = be(s, i ? s : void 0), l = i ? s : f;
1448
- return {
1449
- selected: l,
1450
- select: (m, p, W) => {
1451
- const { min: b, max: S } = e;
1452
- let g;
1453
- if (m) {
1454
- const D = l == null ? void 0 : l.from, N = l == null ? void 0 : l.to, v = !!D && !!N, c = !!D && !!N && t.isSameDay(D, N) && t.isSameDay(m, D);
1455
- o && (v || !(l != null && l.from)) ? !a && c ? g = void 0 : g = { from: m, to: void 0 } : g = ao(m, l, b, S, a, t);
1456
- }
1457
- return n && r && (g != null && g.from) && g.to && fo({ from: g.from, to: g.to }, r, t) && (g.from = m, g.to = void 0), i || d(g), i == null || i(g, m, p, W), g;
1458
- },
1459
- isSelected: (m) => l && L(l, m, !1, t)
1460
- };
1461
- }
1462
- function co(e, t) {
1463
- const { selected: r, required: n, onSelect: o } = e, [s, a] = be(r, o ? r : void 0), i = o ? r : s, { isSameDay: f } = t;
1464
- return {
1465
- selected: i,
1466
- select: (u, y, m) => {
1467
- let p = u;
1468
- return !n && i && i && f(u, i) && (p = void 0), o || a(p), o == null || o(p, u, y, m), p;
1469
- },
1470
- isSelected: (u) => i ? f(i, u) : !1
1471
- };
1472
- }
1473
- function uo(e, t) {
1474
- const r = co(e, t), n = so(e, t), o = lo(e, t);
1475
- switch (e.mode) {
1476
- case "single":
1477
- return r;
1478
- case "multiple":
1479
- return n;
1480
- case "range":
1481
- return o;
1482
- default:
1483
- return;
1484
- }
1485
- }
1486
- function q(e, t) {
1487
- return e instanceof B && e.timeZone === t ? e : new B(e, t);
1488
- }
1489
- function se(e, t, r) {
1490
- return q(e, t);
1491
- }
1492
- function nt(e, t, r) {
1493
- return typeof e == "boolean" || typeof e == "function" ? e : e instanceof Date ? se(e, t) : Array.isArray(e) ? e.map((n) => n instanceof Date ? se(n, t) : n) : ge(e) ? {
1494
- ...e,
1495
- from: e.from ? q(e.from, t) : e.from,
1496
- to: e.to ? q(e.to, t) : e.to
1497
- } : Ae(e) ? {
1498
- before: se(e.before, t),
1499
- after: se(e.after, t)
1500
- } : ze(e) ? {
1501
- after: se(e.after, t)
1502
- } : He(e) ? {
1503
- before: se(e.before, t)
1504
- } : e;
1505
- }
1506
- function xe(e, t, r) {
1507
- return e && (Array.isArray(e) ? e.map((n) => nt(n, t)) : nt(e, t));
1508
- }
1509
- function Oo(e) {
1510
- var Ke;
1511
- let t = e;
1512
- const r = t.timeZone;
1513
- if (r && (t = {
1514
- ...e,
1515
- timeZone: r
1516
- }, t.today && (t.today = q(t.today, r)), t.month && (t.month = q(t.month, r)), t.defaultMonth && (t.defaultMonth = q(t.defaultMonth, r)), t.startMonth && (t.startMonth = q(t.startMonth, r)), t.endMonth && (t.endMonth = q(t.endMonth, r)), t.mode === "single" && t.selected ? t.selected = q(t.selected, r) : t.mode === "multiple" && t.selected ? t.selected = (Ke = t.selected) == null ? void 0 : Ke.map((O) => q(O, r)) : t.mode === "range" && t.selected && (t.selected = {
1517
- from: t.selected.from ? q(t.selected.from, r) : t.selected.from,
1518
- to: t.selected.to ? q(t.selected.to, r) : t.selected.to
1519
- }), t.disabled !== void 0 && (t.disabled = xe(t.disabled, r)), t.hidden !== void 0 && (t.hidden = xe(t.hidden, r)), t.modifiers)) {
1520
- const O = {};
1521
- Object.keys(t.modifiers).forEach((_) => {
1522
- var k;
1523
- O[_] = xe((k = t.modifiers) == null ? void 0 : k[_], r);
1524
- }), t.modifiers = O;
1525
- }
1526
- const { components: n, formatters: o, labels: s, dateLib: a, locale: i, classNames: f } = De(() => {
1527
- const O = { ...ht, ...t.locale }, _ = t.broadcastCalendar ? 1 : t.weekStartsOn, k = t.noonSafe && t.timeZone ? $r(t.timeZone, {
1528
- weekStartsOn: _,
1529
- locale: O
1530
- }) : void 0, Y = t.dateLib && k ? { ...k, ...t.dateLib } : t.dateLib ?? k, P = new z({
1531
- locale: O,
1532
- weekStartsOn: _,
1533
- firstWeekContainsDate: t.firstWeekContainsDate,
1534
- useAdditionalWeekYearTokens: t.useAdditionalWeekYearTokens,
1535
- useAdditionalDayOfYearTokens: t.useAdditionalDayOfYearTokens,
1536
- timeZone: t.timeZone,
1537
- numerals: t.numerals
1538
- }, Y);
1539
- return {
1540
- dateLib: P,
1541
- components: br(t.components),
1542
- formatters: Er(t.formatters),
1543
- labels: Pr(t.labels, P.options),
1544
- locale: O,
1545
- classNames: { ...pr(), ...t.classNames }
1546
- };
1547
- }, [
1548
- t.locale,
1549
- t.broadcastCalendar,
1550
- t.weekStartsOn,
1551
- t.firstWeekContainsDate,
1552
- t.useAdditionalWeekYearTokens,
1553
- t.useAdditionalDayOfYearTokens,
1554
- t.timeZone,
1555
- t.numerals,
1556
- t.dateLib,
1557
- t.noonSafe,
1558
- t.components,
1559
- t.formatters,
1560
- t.labels,
1561
- t.classNames
1562
- ]);
1563
- t.today || (t = { ...t, today: a.today() });
1564
- const { captionLayout: d, mode: l, navLayout: u, numberOfMonths: y = 1, onDayBlur: m, onDayClick: p, onDayFocus: W, onDayKeyDown: b, onDayMouseEnter: S, onDayMouseLeave: g, onNextClick: D, onPrevClick: N, showWeekNumber: v, styles: c } = t, { formatCaption: w, formatDay: T, formatMonthDropdown: I, formatWeekNumber: x, formatWeekNumberHeader: H, formatWeekdayName: ne, formatYearDropdown: Q } = o, j = to(t, a), { days: oe, months: he, navStart: Oe, navEnd: pe, previousMonth: G, nextMonth: R, goToMonth: X } = j, we = vr(oe, t, Oe, pe, a), { isSelected: ie, select: fe, selected: ye } = uo(t, a) ?? {}, { blur: qe, focused: me, isFocusTarget: _t, moveFocus: Ge, setFocused: Me } = oo(t, j, we, ie ?? (() => !1), a), { labelDayButton: Tt, labelGridcell: Et, labelGrid: xt, labelMonthDropdown: It, labelNav: Re, labelPrevious: Bt, labelNext: Ft, labelWeekday: Pt, labelWeekNumber: At, labelWeekNumberHeader: zt, labelYearDropdown: Ht } = s, jt = De(() => Hr(a, t.ISOWeek, t.broadcastCalendar, t.today), [a, t.ISOWeek, t.broadcastCalendar, t.today]), Ue = l !== void 0 || p !== void 0, We = $(() => {
1565
- G && (X(G), N == null || N(G));
1566
- }, [G, X, N]), Ne = $(() => {
1567
- R && (X(R), D == null || D(R));
1568
- }, [X, R, D]), $t = $((O, _) => (k) => {
1569
- k.preventDefault(), k.stopPropagation(), Me(O), !_.disabled && (fe == null || fe(O.date, _, k), p == null || p(O.date, _, k));
1570
- }, [fe, p, Me]), qt = $((O, _) => (k) => {
1571
- Me(O), W == null || W(O.date, _, k);
1572
- }, [W, Me]), Gt = $((O, _) => (k) => {
1573
- qe(), m == null || m(O.date, _, k);
1574
- }, [qe, m]), Rt = $((O, _) => (k) => {
1575
- const Y = {
1576
- ArrowLeft: [
1577
- k.shiftKey ? "month" : "day",
1578
- t.dir === "rtl" ? "after" : "before"
1579
- ],
1580
- ArrowRight: [
1581
- k.shiftKey ? "month" : "day",
1582
- t.dir === "rtl" ? "before" : "after"
1583
- ],
1584
- ArrowDown: [k.shiftKey ? "year" : "week", "after"],
1585
- ArrowUp: [k.shiftKey ? "year" : "week", "before"],
1586
- PageUp: [k.shiftKey ? "year" : "month", "before"],
1587
- PageDown: [k.shiftKey ? "year" : "month", "after"],
1588
- Home: ["startOfWeek", "before"],
1589
- End: ["endOfWeek", "after"]
1590
- };
1591
- if (Y[k.key]) {
1592
- k.preventDefault(), k.stopPropagation();
1593
- const [P, C] = Y[k.key];
1594
- Ge(P, C);
1595
- }
1596
- b == null || b(O.date, _, k);
1597
- }, [Ge, b, t.dir]), Ut = $((O, _) => (k) => {
1598
- S == null || S(O.date, _, k);
1599
- }, [S]), Vt = $((O, _) => (k) => {
1600
- g == null || g(O.date, _, k);
1601
- }, [g]), Kt = $((O) => (_) => {
1602
- const k = Number(_.target.value), Y = a.setMonth(a.startOfMonth(O), k);
1603
- X(Y);
1604
- }, [a, X]), Zt = $((O) => (_) => {
1605
- const k = Number(_.target.value), Y = a.setYear(a.startOfMonth(O), k);
1606
- X(Y);
1607
- }, [a, X]), { className: Jt, style: Qt } = De(() => ({
1608
- className: [f[M.Root], t.className].filter(Boolean).join(" "),
1609
- style: { ...c == null ? void 0 : c[M.Root], ...t.style }
1610
- }), [f, t.className, t.style, c]), Xt = Or(t), Ve = ke(null);
1611
- Ur(Ve, !!t.animate, {
1612
- classNames: f,
1613
- months: he,
1614
- focused: me,
1615
- dateLib: a
1616
- });
1617
- const Lt = {
1618
- dayPickerProps: t,
1619
- selected: ye,
1620
- select: fe,
1621
- isSelected: ie,
1622
- months: he,
1623
- nextMonth: R,
1624
- previousMonth: G,
1625
- goToMonth: X,
1626
- getModifiers: we,
1627
- components: n,
1628
- classNames: f,
1629
- styles: c,
1630
- labels: s,
1631
- formatters: o
1632
- };
1633
- return h.createElement(
1634
- mt.Provider,
1635
- { value: Lt },
1636
- h.createElement(
1637
- n.Root,
1638
- { rootRef: t.animate ? Ve : void 0, className: Jt, style: Qt, dir: t.dir, id: t.id, lang: t.lang ?? i.code, nonce: t.nonce, title: t.title, role: t.role, "aria-label": t["aria-label"], "aria-labelledby": t["aria-labelledby"], ...Xt },
1639
- h.createElement(
1640
- n.Months,
1641
- { className: f[M.Months], style: c == null ? void 0 : c[M.Months] },
1642
- !t.hideNavigation && !u && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: f[M.Nav], style: c == null ? void 0 : c[M.Nav], "aria-label": Re(), onPreviousClick: We, onNextClick: Ne, previousMonth: G, nextMonth: R }),
1643
- he.map((O, _) => h.createElement(
1644
- n.Month,
1645
- {
1646
- "data-animated-month": t.animate ? "true" : void 0,
1647
- className: f[M.Month],
1648
- style: c == null ? void 0 : c[M.Month],
1649
- // biome-ignore lint/suspicious/noArrayIndexKey: breaks animation
1650
- key: _,
1651
- displayIndex: _,
1652
- calendarMonth: O
1653
- },
1654
- u === "around" && !t.hideNavigation && _ === 0 && h.createElement(
1655
- n.PreviousMonthButton,
1656
- { type: "button", className: f[M.PreviousMonthButton], tabIndex: G ? void 0 : -1, "aria-disabled": G ? void 0 : !0, "aria-label": Bt(G), onClick: We, "data-animated-button": t.animate ? "true" : void 0 },
1657
- h.createElement(n.Chevron, { disabled: G ? void 0 : !0, className: f[M.Chevron], orientation: t.dir === "rtl" ? "right" : "left" })
1658
- ),
1659
- h.createElement(n.MonthCaption, { "data-animated-caption": t.animate ? "true" : void 0, className: f[M.MonthCaption], style: c == null ? void 0 : c[M.MonthCaption], calendarMonth: O, displayIndex: _ }, d != null && d.startsWith("dropdown") ? h.createElement(
1660
- n.DropdownNav,
1661
- { className: f[M.Dropdowns], style: c == null ? void 0 : c[M.Dropdowns] },
1662
- (() => {
1663
- const k = d === "dropdown" || d === "dropdown-months" ? h.createElement(n.MonthsDropdown, { key: "month", className: f[M.MonthsDropdown], "aria-label": It(), classNames: f, components: n, disabled: !!t.disableNavigation, onChange: Kt(O.date), options: Ar(O.date, Oe, pe, o, a), style: c == null ? void 0 : c[M.Dropdown], value: a.getMonth(O.date) }) : h.createElement("span", { key: "month" }, I(O.date, a)), Y = d === "dropdown" || d === "dropdown-years" ? h.createElement(n.YearsDropdown, { key: "year", className: f[M.YearsDropdown], "aria-label": Ht(a.options), classNames: f, components: n, disabled: !!t.disableNavigation, onChange: Zt(O.date), options: jr(Oe, pe, o, a, !!t.reverseYears), style: c == null ? void 0 : c[M.Dropdown], value: a.getYear(O.date) }) : h.createElement("span", { key: "year" }, Q(O.date, a));
1664
- return a.getMonthYearOrder() === "year-first" ? [Y, k] : [k, Y];
1665
- })(),
1666
- h.createElement("span", { role: "status", "aria-live": "polite", style: {
1667
- border: 0,
1668
- clip: "rect(0 0 0 0)",
1669
- height: "1px",
1670
- margin: "-1px",
1671
- overflow: "hidden",
1672
- padding: 0,
1673
- position: "absolute",
1674
- width: "1px",
1675
- whiteSpace: "nowrap",
1676
- wordWrap: "normal"
1677
- } }, w(O.date, a.options, a))
1678
- ) : h.createElement(n.CaptionLabel, { className: f[M.CaptionLabel], role: "status", "aria-live": "polite" }, w(O.date, a.options, a))),
1679
- u === "around" && !t.hideNavigation && _ === y - 1 && h.createElement(
1680
- n.NextMonthButton,
1681
- { type: "button", className: f[M.NextMonthButton], tabIndex: R ? void 0 : -1, "aria-disabled": R ? void 0 : !0, "aria-label": Ft(R), onClick: Ne, "data-animated-button": t.animate ? "true" : void 0 },
1682
- h.createElement(n.Chevron, { disabled: R ? void 0 : !0, className: f[M.Chevron], orientation: t.dir === "rtl" ? "left" : "right" })
1683
- ),
1684
- _ === y - 1 && u === "after" && !t.hideNavigation && h.createElement(n.Nav, { "data-animated-nav": t.animate ? "true" : void 0, className: f[M.Nav], style: c == null ? void 0 : c[M.Nav], "aria-label": Re(), onPreviousClick: We, onNextClick: Ne, previousMonth: G, nextMonth: R }),
1685
- h.createElement(
1686
- n.MonthGrid,
1687
- { role: "grid", "aria-multiselectable": l === "multiple" || l === "range", "aria-label": xt(O.date, a.options, a) || void 0, className: f[M.MonthGrid], style: c == null ? void 0 : c[M.MonthGrid] },
1688
- !t.hideWeekdays && h.createElement(
1689
- n.Weekdays,
1690
- { "data-animated-weekdays": t.animate ? "true" : void 0, className: f[M.Weekdays], style: c == null ? void 0 : c[M.Weekdays] },
1691
- v && h.createElement(n.WeekNumberHeader, { "aria-label": zt(a.options), className: f[M.WeekNumberHeader], style: c == null ? void 0 : c[M.WeekNumberHeader], scope: "col" }, H()),
1692
- jt.map((k) => h.createElement(n.Weekday, { "aria-label": Pt(k, a.options, a), className: f[M.Weekday], key: String(k), style: c == null ? void 0 : c[M.Weekday], scope: "col" }, ne(k, a.options, a)))
1693
- ),
1694
- h.createElement(n.Weeks, { "data-animated-weeks": t.animate ? "true" : void 0, className: f[M.Weeks], style: c == null ? void 0 : c[M.Weeks] }, O.weeks.map((k) => h.createElement(
1695
- n.Week,
1696
- { className: f[M.Week], key: k.weekNumber, style: c == null ? void 0 : c[M.Week], week: k },
1697
- v && h.createElement(n.WeekNumber, { week: k, style: c == null ? void 0 : c[M.WeekNumber], "aria-label": At(k.weekNumber, {
1698
- locale: i
1699
- }), className: f[M.WeekNumber], scope: "row", role: "rowheader" }, x(k.weekNumber, a)),
1700
- k.days.map((Y) => {
1701
- const { date: P } = Y, C = we(Y);
1702
- if (C[E.focused] = !C.hidden && !!(me != null && me.isEqualTo(Y)), C[V.selected] = (ie == null ? void 0 : ie(P)) || C.selected, ge(ye)) {
1703
- const { from: Ce, to: Se } = ye;
1704
- C[V.range_start] = !!(Ce && Se && a.isSameDay(P, Ce)), C[V.range_end] = !!(Ce && Se && a.isSameDay(P, Se)), C[V.range_middle] = L(ye, P, !0, a);
1705
- }
1706
- const en = zr(C, c, t.modifiersStyles), tn = gr(C, f, t.modifiersClassNames), nn = !Ue && !C.hidden ? Et(P, C, a.options, a) : void 0;
1707
- return h.createElement(n.Day, { key: `${Y.isoDate}_${Y.displayMonthId}`, day: Y, modifiers: C, className: tn.join(" "), style: en, role: "gridcell", "aria-selected": C.selected || void 0, "aria-label": nn, "data-day": Y.isoDate, "data-month": Y.outside ? Y.dateMonthId : void 0, "data-selected": C.selected || void 0, "data-disabled": C.disabled || void 0, "data-hidden": C.hidden || void 0, "data-outside": Y.outside || void 0, "data-focused": C.focused || void 0, "data-today": C.today || void 0 }, !C.hidden && Ue ? h.createElement(n.DayButton, { className: f[M.DayButton], style: c == null ? void 0 : c[M.DayButton], type: "button", day: Y, modifiers: C, disabled: !C.focused && C.disabled || void 0, "aria-disabled": C.focused && C.disabled || void 0, tabIndex: _t(Y) ? 0 : -1, "aria-label": Tt(P, C, a.options, a), onClick: $t(Y, C), onBlur: Gt(Y, C), onFocus: qt(Y, C), onKeyDown: Rt(Y, C), onMouseEnter: Ut(Y, C), onMouseLeave: Vt(Y, C) }, T(P, a.options, a)) : !C.hidden && T(Y.date, a.options, a));
1708
- })
1709
- )))
1710
- )
1711
- ))
1712
- ),
1713
- t.footer && h.createElement(n.Footer, { className: f[M.Footer], style: c == null ? void 0 : c[M.Footer], role: "status", "aria-live": "polite" }, t.footer)
1714
- )
1715
- );
1716
- }
1717
- function po(e) {
1718
- return ae;
1719
- }
1720
- const Ie = {
1721
- en: "dd/MM/yyyy",
1722
- "en-us": "MM/dd/yyyy",
1723
- de: "dd.MM.yyyy",
1724
- fr: "dd/MM/yyyy",
1725
- es: "dd/MM/yyyy",
1726
- it: "dd/MM/yyyy",
1727
- pt: "dd/MM/yyyy",
1728
- nl: "dd-MM-yyyy",
1729
- pl: "dd.MM.yyyy",
1730
- cs: "dd.MM.yyyy",
1731
- da: "dd.MM.yyyy",
1732
- sv: "yyyy-MM-dd",
1733
- fi: "dd.MM.yyyy",
1734
- nb: "dd.MM.yyyy",
1735
- ja: "yyyy/MM/dd",
1736
- zh: "yyyy/MM/dd",
1737
- ko: "yyyy.MM.dd",
1738
- ar: "dd/MM/yyyy",
1739
- he: "dd.MM.yyyy"
1740
- };
1741
- function wo(e) {
1742
- const t = e.toLowerCase();
1743
- return Ie[t] ?? Ie[t.split("-")[0]] ?? Ie.en;
1744
- }
1745
- function Wo(e, t, r) {
1746
- const n = [];
1747
- return e && n.push({ before: e }), t && n.push({ after: t }), Array.isArray(r) ? n.push(...r) : typeof r == "function" && n.push(r), n.length === 1 ? n[0] : n;
1748
- }
1749
- function No({ orientation: e }) {
1750
- return e === "left" ? /* @__PURE__ */ Ze(Dn, { className: "ds:size-4 ds:rtl:-scale-x-100" }) : /* @__PURE__ */ Ze(vn, { className: "ds:size-4 ds:rtl:-scale-x-100" });
1751
- }
1752
- const Co = ve(
1753
- [
1754
- "ds:relative ds:flex ds:items-center ds:w-full",
1755
- // Soft-chrome look — matches `INPUT_SURFACE_CHROME` so the trigger
1756
- // shares the fill + halo with TextInput / Select / NumberInput.
1757
- "ds:rounded-[var(--radius-sm)] ds:border ds:bg-input ds:text-foreground",
1758
- "ds:shadow-[var(--shadow-input)]",
1759
- "ds:placeholder:text-muted-foreground",
1760
- "ds:transition-[colors,box-shadow] ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
1761
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
1762
- "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
1763
- "ds:disabled:cursor-not-allowed ds:disabled:opacity-50"
1764
- ].join(" "),
1765
- {
1766
- variants: {
1767
- size: {
1768
- sm: "ds:h-8 ds:text-[length:var(--font-size-sm)] ds:ps-3 ds:pe-10",
1769
- md: "ds:h-[var(--min-target-size)] ds:text-[length:var(--font-size-base)] ds:ps-3 ds:pe-10",
1770
- lg: "ds:h-12 ds:text-[length:var(--font-size-lg)] ds:ps-4 ds:pe-12"
1771
- },
1772
- tone: {
1773
- default: "ds:border-border",
1774
- error: "ds:border-destructive"
1775
- }
1776
- },
1777
- defaultVariants: {
1778
- size: "md",
1779
- tone: "default"
1780
- }
1781
- }
1782
- ), So = ve(
1783
- "ds:absolute ds:inset-y-0 ds:end-0 ds:flex ds:items-center ds:pointer-events-none ds:text-muted-foreground",
1784
- {
1785
- variants: {
1786
- size: {
1787
- sm: "ds:pe-3 ds:[&_svg]:size-4",
1788
- md: "ds:pe-3 ds:[&_svg]:size-4",
1789
- lg: "ds:pe-4 ds:[&_svg]:size-5"
1790
- }
1791
- },
1792
- defaultVariants: { size: "md" }
1793
- }
1794
- ), Yo = ve(
1795
- [
1796
- "ds:z-[var(--z-popover)] ds:rounded-[var(--radius-md)]",
1797
- "ds:border ds:border-border ds:bg-background ds:shadow-[var(--shadow-lg)]",
1798
- "ds:p-[var(--spacing-md)]"
1799
- ].join(" ")
1800
- ), _o = ve(
1801
- [
1802
- "ds:w-full ds:text-start ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
1803
- "ds:rounded-[var(--radius-sm)] ds:text-[length:var(--font-size-sm)] ds:text-foreground",
1804
- "ds:hover:bg-muted ds:cursor-pointer",
1805
- "ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none",
1806
- "ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid",
1807
- "ds:focus-visible:outline-ring ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]"
1808
- ].join(" ")
1809
- );
1810
- export {
1811
- bo as C,
1812
- Oo as D,
1813
- wn as a,
1814
- Wo as b,
1815
- Sn as c,
1816
- So as d,
1817
- ct as e,
1818
- No as f,
1819
- po as g,
1820
- Yo as h,
1821
- Pn as i,
1822
- Fn as j,
1823
- wo as k,
1824
- _o as p,
1825
- Co as t
1826
- };
1827
- //# sourceMappingURL=react-day-picker-C5F3-TTX.js.map