@mngh/jalali-datepicker 1.0.1 → 1.0.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 (35) hide show
  1. package/dist/components/DayCell.d.ts +20 -7
  2. package/dist/components/DayCell.d.ts.map +1 -1
  3. package/dist/components/Header.d.ts +3 -7
  4. package/dist/components/Header.d.ts.map +1 -1
  5. package/dist/components/JalaliDatePicker.d.ts +1 -5
  6. package/dist/components/JalaliDatePicker.d.ts.map +1 -1
  7. package/dist/components/MonthYearPicker.d.ts +2 -4
  8. package/dist/components/MonthYearPicker.d.ts.map +1 -1
  9. package/dist/components/footer/CalendarFooter.d.ts +13 -6
  10. package/dist/components/footer/CalendarFooter.d.ts.map +1 -1
  11. package/dist/index.cjs +1 -1
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.ts +0 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.mjs +815 -1085
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/plugins/time-picker/TimePicker.d.ts +18 -1
  18. package/dist/plugins/time-picker/TimePicker.d.ts.map +1 -1
  19. package/dist/plugins/time-picker/index.d.ts +2 -2
  20. package/dist/plugins/time-picker/index.d.ts.map +1 -1
  21. package/dist/theme/ThemeProvider.d.ts +12 -2
  22. package/dist/theme/ThemeProvider.d.ts.map +1 -1
  23. package/dist/theme/tokens.d.ts +3 -3
  24. package/dist/theme/tokens.d.ts.map +1 -1
  25. package/dist/theme/types.d.ts +37 -6
  26. package/dist/theme/types.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/plugins/presets/PresetsBar.d.ts +0 -4
  29. package/dist/plugins/presets/PresetsBar.d.ts.map +0 -1
  30. package/dist/plugins/presets/default-presets.d.ts +0 -6
  31. package/dist/plugins/presets/default-presets.d.ts.map +0 -1
  32. package/dist/plugins/presets/index.d.ts +0 -4
  33. package/dist/plugins/presets/index.d.ts.map +0 -1
  34. package/dist/plugins/presets/types.d.ts +0 -38
  35. package/dist/plugins/presets/types.d.ts.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import e, { createContext as t, useCallback as n, useContext as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
2
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
1
+ import { createContext as e, useCallback as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
2
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
3
  //#region src/core/constants.ts
4
- var d = [
4
+ var u = [
5
5
  "فروردین",
6
6
  "اردیبهشت",
7
7
  "خرداد",
@@ -14,7 +14,7 @@ var d = [
14
14
  "دی",
15
15
  "بهمن",
16
16
  "اسفند"
17
- ], f = [
17
+ ], d = [
18
18
  "Farvardin",
19
19
  "Ordibehesht",
20
20
  "Khordad",
@@ -27,7 +27,7 @@ var d = [
27
27
  "Dey",
28
28
  "Bahman",
29
29
  "Esfand"
30
- ], p = [
30
+ ], f = [
31
31
  "ش",
32
32
  "ی",
33
33
  "د",
@@ -35,7 +35,7 @@ var d = [
35
35
  "چ",
36
36
  "پ",
37
37
  "ج"
38
- ], m = [
38
+ ], p = [
39
39
  "شنبه",
40
40
  "یکشنبه",
41
41
  "دوشنبه",
@@ -46,7 +46,7 @@ var d = [
46
46
  ];
47
47
  //#endregion
48
48
  //#region src/core/jalali-math.ts
49
- function h(e) {
49
+ function m(e) {
50
50
  let t = [
51
51
  -61,
52
52
  9,
@@ -80,11 +80,11 @@ function h(e) {
80
80
  let a = (i + 1) % 33 - 1;
81
81
  return a === -1 && (a = 4), a % 4 == 0;
82
82
  }
83
- function g(e, t) {
83
+ function h(e, t) {
84
84
  if (t < 0 || t > 11) throw RangeError("Month index must be between 0 (Farvardin) and 11 (Esfand).");
85
- return t <= 5 ? 31 : t <= 10 || h(e) ? 30 : 29;
85
+ return t <= 5 ? 31 : t <= 10 || m(e) ? 30 : 29;
86
86
  }
87
- function _(e, t, n) {
87
+ function g(e, t, n) {
88
88
  let r = [
89
89
  0,
90
90
  31,
@@ -107,7 +107,7 @@ function _(e, t, n) {
107
107
  day: o
108
108
  };
109
109
  }
110
- function v(e, t, n) {
110
+ function _(e, t, n) {
111
111
  let r, i, a, o = e + 1595, s = -355668 + 365 * o + Math.floor(o / 33) * 8 + Math.floor((o % 33 + 3) / 4) + n + (t < 6 ? t * 31 : (t - 6) * 30 + 186);
112
112
  r = 400 * Math.floor(s / 146097), s %= 146097, s > 36524 && (r += 100 * Math.floor(--s / 36524), s %= 36524, s >= 365 && s++), r += 4 * Math.floor(s / 1461), s %= 1461, s > 365 && (r += Math.floor((s - 1) / 365), s = (s - 1) % 365), a = s + 1;
113
113
  let c = [
@@ -129,29 +129,29 @@ function v(e, t, n) {
129
129
  let l = new Date(r, i - 1, a);
130
130
  return l.setHours(0, 0, 0, 0), l;
131
131
  }
132
- function y() {
132
+ function v() {
133
133
  let e = /* @__PURE__ */ new Date();
134
- return _(e.getFullYear(), e.getMonth() + 1, e.getDate());
134
+ return g(e.getFullYear(), e.getMonth() + 1, e.getDate());
135
135
  }
136
- function b(e, t) {
136
+ function y(e, t) {
137
137
  return !e || !t ? !1 : e.year === t.year && e.month === t.month && e.day === t.day;
138
138
  }
139
139
  //#endregion
140
140
  //#region src/core/calendar-grid.ts
141
- function x(e) {
142
- return e instanceof Date ? _(e.getFullYear(), e.getMonth() + 1, e.getDate()) : e;
141
+ function b(e) {
142
+ return e instanceof Date ? g(e.getFullYear(), e.getMonth() + 1, e.getDate()) : e;
143
143
  }
144
- function S(e) {
145
- let { year: t, month: n, firstDayOfWeek: r = 0, selectedDate: i, minDate: a, maxDate: o, isDateDisabled: s } = e, c = [], l = y(), u = i ? x(i) : null, d = a ? x(a) : null, f = o ? x(o) : null, p = ((v(t, n, 1).getDay() + 1) % 7 - r + 7) % 7, m = n === 0 ? 11 : n - 1, h = n === 0 ? t - 1 : t, _ = g(h, m);
144
+ function x(e) {
145
+ let { year: t, month: n, firstDayOfWeek: r = 0, selectedDate: i, minDate: a, maxDate: o, isDateDisabled: s } = e, c = [], l = v(), u = i ? b(i) : null, d = a ? b(a) : null, f = o ? b(o) : null, p = ((_(t, n, 1).getDay() + 1) % 7 - r + 7) % 7, m = n === 0 ? 11 : n - 1, g = n === 0 ? t - 1 : t, x = h(g, m);
146
146
  for (let e = p - 1; e >= 0; e--) {
147
147
  let t = {
148
- year: h,
148
+ year: g,
149
149
  month: m,
150
- day: _ - e
150
+ day: x - e
151
151
  };
152
152
  c.push(E(t, !1));
153
153
  }
154
- let S = g(t, n);
154
+ let S = h(t, n);
155
155
  for (let e = 1; e <= S; e++) {
156
156
  let r = {
157
157
  year: t,
@@ -170,13 +170,13 @@ function S(e) {
170
170
  c.push(E(t, !1));
171
171
  }
172
172
  function E(e, t) {
173
- let n = v(e.year, e.month, e.day), r = b(e, l), i = u ? b(e, u) : !1, a = !1;
173
+ let n = _(e.year, e.month, e.day), r = y(e, l), i = u ? y(e, u) : !1, a = !1;
174
174
  if (d) {
175
- let e = v(d.year, d.month, d.day);
175
+ let e = _(d.year, d.month, d.day);
176
176
  n.getTime() < e.getTime() && (a = !0);
177
177
  }
178
178
  if (f) {
179
- let e = v(f.year, f.month, f.day);
179
+ let e = _(f.year, f.month, f.day);
180
180
  n.getTime() > e.getTime() && (a = !0);
181
181
  }
182
182
  return s && s(e, n) && (a = !0), {
@@ -193,34 +193,34 @@ function S(e) {
193
193
  }
194
194
  //#endregion
195
195
  //#region src/core/jalali-helpers.ts
196
- function C(e) {
197
- return _(e.getFullYear(), e.getMonth() + 1, e.getDate());
196
+ function S(e) {
197
+ return g(e.getFullYear(), e.getMonth() + 1, e.getDate());
198
198
  }
199
- function w(e, t = 0, n = 0, r = 0) {
200
- let i = v(e.year, e.month, e.day);
199
+ function C(e, t = 0, n = 0, r = 0) {
200
+ let i = _(e.year, e.month, e.day);
201
201
  return i.setHours(t, n, r, 0), i;
202
202
  }
203
- function T(e, t, n) {
204
- return (v(e, t, n).getDay() + 1) % 7;
203
+ function w(e, t, n) {
204
+ return (_(e, t, n).getDay() + 1) % 7;
205
205
  }
206
- function E(e, t) {
207
- let n = v(e.year, e.month, e.day);
208
- return n.setDate(n.getDate() + t), _(n.getFullYear(), n.getMonth() + 1, n.getDate());
206
+ function T(e, t) {
207
+ let n = _(e.year, e.month, e.day);
208
+ return n.setDate(n.getDate() + t), g(n.getFullYear(), n.getMonth() + 1, n.getDate());
209
209
  }
210
- var D = E;
211
- function O(e, t) {
210
+ var E = T;
211
+ function D(e, t) {
212
212
  return e.year === t.year ? e.month === t.month ? e.day === t.day ? 0 : e.day < t.day ? -1 : 1 : e.month < t.month ? -1 : 1 : e.year < t.year ? -1 : 1;
213
213
  }
214
- function k(e, t, n, r = !0) {
215
- let i = O(t, n) <= 0 ? t : n, a = O(t, n) <= 0 ? n : t, o = O(e, i), s = O(e, a);
214
+ function O(e, t, n, r = !0) {
215
+ let i = D(t, n) <= 0 ? t : n, a = D(t, n) <= 0 ? n : t, o = D(e, i), s = D(e, a);
216
216
  return r ? o >= 0 && s <= 0 : o > 0 && s < 0;
217
217
  }
218
- function A(e) {
219
- let t = E(e, -T(e.year, e.month, e.day));
220
- return [t, E(t, 6)];
218
+ function k(e) {
219
+ let t = T(e, -w(e.year, e.month, e.day));
220
+ return [t, T(t, 6)];
221
221
  }
222
- function j(e) {
223
- let t = g(e.year, e.month);
222
+ function A(e) {
223
+ let t = h(e.year, e.month);
224
224
  return [{
225
225
  year: e.year,
226
226
  month: e.month,
@@ -233,65 +233,65 @@ function j(e) {
233
233
  }
234
234
  //#endregion
235
235
  //#region src/hooks/useJalaliDatePicker.ts
236
- function M(e = {}) {
237
- let { mode: t = "single", value: r, defaultValue: i, initialViewDate: o, onChange: c, minDate: l, maxDate: u, isDateDisabled: d, firstDayOfWeek: f = 0 } = e, p = a(() => y(), []), [m, h] = s(() => i === void 0 ? t === "single" ? null : t === "range" ? [null, null] : [] : i), g = r === void 0 ? m : r, [_, v] = s(() => o ? o.year : i && !Array.isArray(i) ? i.year : p.year), [x, C] = s(() => o ? o.month : i && !Array.isArray(i) ? i.month : p.month), [w, T] = s(null), E = n((e, t) => {
238
- v(e), C(t);
239
- }, []), D = n(() => {
240
- x === 0 ? (v((e) => e - 1), C(11)) : C((e) => e - 1);
241
- }, [x]), O = n(() => {
242
- x === 11 ? (v((e) => e + 1), C(0)) : C((e) => e + 1);
243
- }, [x]), A = n(() => {
244
- let e = y();
245
- v(e.year), C(e.month);
246
- }, []), j = n((e) => {
247
- let n;
248
- if (t === "single") n = e;
249
- else if (t === "range") {
250
- let [t, r] = g || [null, null];
251
- n = !t || t && r ? [e, null] : e.year < t.year || e.year === t.year && e.month < t.month || e.year === t.year && e.month === t.month && e.day < t.day ? [e, t] : [t, e];
236
+ function j(e = {}) {
237
+ let { mode: n = "single", value: r, defaultValue: a, initialViewDate: s, onChange: c, minDate: l, maxDate: u, isDateDisabled: d, firstDayOfWeek: f = 0 } = e, p = i(() => v(), []), [m, h] = o(() => a === void 0 ? n === "single" ? null : n === "range" ? [null, null] : [] : a), g = r === void 0 ? m : r, [_, b] = o(() => s ? s.year : a && !Array.isArray(a) ? a.year : p.year), [S, C] = o(() => s ? s.month : a && !Array.isArray(a) ? a.month : p.month), [w, T] = o(null), E = t((e, t) => {
238
+ b(e), C(t);
239
+ }, []), D = t(() => {
240
+ S === 0 ? (b((e) => e - 1), C(11)) : C((e) => e - 1);
241
+ }, [S]), k = t(() => {
242
+ S === 11 ? (b((e) => e + 1), C(0)) : C((e) => e + 1);
243
+ }, [S]), A = t(() => {
244
+ let e = v();
245
+ b(e.year), C(e.month);
246
+ }, []), j = t((e) => {
247
+ let t;
248
+ if (n === "single") t = e;
249
+ else if (n === "range") {
250
+ let [n, r] = g || [null, null];
251
+ t = !n || n && r ? [e, null] : e.year < n.year || e.year === n.year && e.month < n.month || e.year === n.year && e.month === n.month && e.day < n.day ? [e, n] : [n, e];
252
252
  } else {
253
- let t = g || [];
254
- n = t.some((t) => b(t, e)) ? t.filter((t) => !b(t, e)) : [...t, e];
253
+ let n = g || [];
254
+ t = n.some((t) => y(t, e)) ? n.filter((t) => !y(t, e)) : [...n, e];
255
255
  }
256
- r === void 0 && h(n), c?.(n);
256
+ r === void 0 && h(t), c?.(t);
257
257
  }, [
258
- t,
258
+ n,
259
259
  g,
260
260
  r,
261
261
  c
262
- ]), M = n(() => {
263
- let e = t === "single" ? null : t === "range" ? [null, null] : [];
262
+ ]), M = t(() => {
263
+ let e = n === "single" ? null : n === "range" ? [null, null] : [];
264
264
  r === void 0 && h(e), c?.(e);
265
265
  }, [
266
- t,
266
+ n,
267
267
  r,
268
268
  c
269
269
  ]);
270
270
  return {
271
271
  selected: g,
272
272
  viewYear: _,
273
- viewMonth: x,
274
- grid: a(() => {
275
- let e = S({
273
+ viewMonth: S,
274
+ grid: i(() => {
275
+ let e = x({
276
276
  year: _,
277
- month: x,
277
+ month: S,
278
278
  firstDayOfWeek: f,
279
279
  minDate: l,
280
280
  maxDate: u,
281
281
  isDateDisabled: d
282
282
  });
283
- if (t === "single") {
283
+ if (n === "single") {
284
284
  let t = g;
285
285
  return e.map((e) => ({
286
286
  ...e,
287
- isSelected: t ? b(e.jalali, t) : !1
287
+ isSelected: t ? y(e.jalali, t) : !1
288
288
  }));
289
289
  }
290
- if (t === "range") {
290
+ if (n === "range") {
291
291
  let [t, n] = g || [null, null], r = n ?? (t && w ? w : null);
292
292
  return e.map((e) => {
293
- let n = t ? b(e.jalali, t) : !1, i = r ? b(e.jalali, r) : !1, a = !1;
294
- return t && r && (a = k(e.jalali, t, r)), {
293
+ let n = t ? y(e.jalali, t) : !1, i = r ? y(e.jalali, r) : !1, a = !1;
294
+ return t && r && (a = O(e.jalali, t, r)), {
295
295
  ...e,
296
296
  isSelected: n || i,
297
297
  isInRange: a,
@@ -300,27 +300,27 @@ function M(e = {}) {
300
300
  };
301
301
  });
302
302
  }
303
- if (t === "multiple") {
303
+ if (n === "multiple") {
304
304
  let t = g || [];
305
305
  return e.map((e) => ({
306
306
  ...e,
307
- isSelected: t.some((t) => b(t, e.jalali))
307
+ isSelected: t.some((t) => y(t, e.jalali))
308
308
  }));
309
309
  }
310
310
  return e;
311
311
  }, [
312
312
  _,
313
- x,
313
+ S,
314
314
  f,
315
315
  l,
316
316
  u,
317
317
  d,
318
- t,
318
+ n,
319
319
  g,
320
320
  w
321
321
  ]),
322
322
  goToPrevMonth: D,
323
- goToNextMonth: O,
323
+ goToNextMonth: k,
324
324
  goToToday: A,
325
325
  setView: E,
326
326
  selectDate: j,
@@ -331,7 +331,7 @@ function M(e = {}) {
331
331
  }
332
332
  //#endregion
333
333
  //#region src/a11y/keyboard-navigation.ts
334
- function N(e) {
334
+ function M(e) {
335
335
  let { currentFocused: t, key: n, isRtl: r = !0 } = e, { year: i, month: a, day: o } = t, s = !1, c = !0, l = r ? 1 : -1, u = r ? -1 : 1;
336
336
  switch (n) {
337
337
  case "ArrowRight":
@@ -350,7 +350,7 @@ function N(e) {
350
350
  o = 1;
351
351
  break;
352
352
  case "End":
353
- o = g(i, a);
353
+ o = h(i, a);
354
354
  break;
355
355
  case "PageUp":
356
356
  a === 0 ? (--i, a = 11) : --a, s = !0;
@@ -364,8 +364,8 @@ function N(e) {
364
364
  handled: !1
365
365
  };
366
366
  }
367
- for (; o < 1;) a === 0 ? (--i, a = 11) : --a, o += g(i, a), s = !0;
368
- for (; o > g(i, a);) o -= g(i, a), a === 11 ? (i += 1, a = 0) : a += 1, s = !0;
367
+ for (; o < 1;) a === 0 ? (--i, a = 11) : --a, o += h(i, a), s = !0;
368
+ for (; o > h(i, a);) o -= h(i, a), a === 11 ? (i += 1, a = 0) : a += 1, s = !0;
369
369
  return {
370
370
  nextDate: {
371
371
  year: i,
@@ -378,44 +378,44 @@ function N(e) {
378
378
  }
379
379
  //#endregion
380
380
  //#region src/a11y/aria-helpers.ts
381
- function P(e) {
382
- let t = m[(v(e.year, e.month, e.day).getDay() + 1) % 7], n = d[e.month];
381
+ function ee(e) {
382
+ let t = p[(_(e.year, e.month, e.day).getDay() + 1) % 7], n = u[e.month];
383
383
  return `${t}، ${e.day} ${n} ${e.year}`;
384
384
  }
385
385
  //#endregion
386
386
  //#region src/a11y/useCalendarKeyboard.ts
387
- function F(e) {
388
- let { viewYear: t, viewMonth: r, selectedDate: i, onSelectDate: a, onViewChange: o, isRtl: c = !0 } = e, [l, u] = s(() => i ?? {
389
- year: t,
387
+ function te(e) {
388
+ let { viewYear: n, viewMonth: r, selectedDate: i, onSelectDate: a, onViewChange: s, isRtl: c = !0 } = e, [l, u] = o(() => i ?? {
389
+ year: n,
390
390
  month: r,
391
391
  day: 1
392
392
  });
393
393
  return {
394
394
  focusedDate: l,
395
395
  setFocusedDate: u,
396
- handleKeyDown: n((e) => {
396
+ handleKeyDown: t((e) => {
397
397
  if (e.key === "Enter" || e.key === " ") {
398
398
  e.preventDefault(), a(l);
399
399
  return;
400
400
  }
401
- let t = N({
401
+ let t = M({
402
402
  currentFocused: l,
403
403
  key: e.key,
404
404
  isRtl: c
405
405
  });
406
- t.handled && (e.preventDefault(), u(t.nextDate), t.viewChanged && o(t.nextDate.year, t.nextDate.month));
406
+ t.handled && (e.preventDefault(), u(t.nextDate), t.viewChanged && s(t.nextDate.year, t.nextDate.month));
407
407
  }, [
408
408
  l,
409
409
  c,
410
410
  a,
411
- o
411
+ s
412
412
  ]),
413
- getCellTabIndex: n((e) => b(e, l) ? 0 : -1, [l])
413
+ getCellTabIndex: t((e) => y(e, l) ? 0 : -1, [l])
414
414
  };
415
415
  }
416
416
  //#endregion
417
417
  //#region src/formatters/persian-digits.ts
418
- var I = [
418
+ var N = [
419
419
  "۰",
420
420
  "۱",
421
421
  "۲",
@@ -426,7 +426,7 @@ var I = [
426
426
  "۷",
427
427
  "۸",
428
428
  "۹"
429
- ], ee = {
429
+ ], P = {
430
430
  "۰": "0",
431
431
  "۱": "1",
432
432
  "۲": "2",
@@ -448,61 +448,81 @@ var I = [
448
448
  "٨": "8",
449
449
  "٩": "9"
450
450
  };
451
- function L(e) {
452
- return String(e).replace(/[0-9]/g, (e) => I[+e]);
451
+ function F(e) {
452
+ return String(e).replace(/[0-9]/g, (e) => N[+e]);
453
453
  }
454
- function R(e) {
455
- return e.replace(/[۰-۹٠-٩]/g, (e) => ee[e] ?? e);
454
+ function I(e) {
455
+ return e.replace(/[۰-۹٠-٩]/g, (e) => P[e] ?? e);
456
456
  }
457
457
  //#endregion
458
458
  //#region src/formatters/jalali-formatter.ts
459
- function z(e, t = "YYYY/MM/DD", n = {}) {
459
+ function L(e, t = "YYYY/MM/DD", n = {}) {
460
460
  if (!e) return "";
461
- let { digitType: r = "persian" } = n, i = (v(e.year, e.month, e.day).getDay() + 1) % 7, a = String(e.year), o = a.slice(-2), s = e.month + 1, c = s < 10 ? `0${s}` : String(s), l = d[e.month], u = e.day < 10 ? `0${e.day}` : String(e.day), f = m[i], p = t.replace(/\bYYYY\b/g, a).replace(/\bYY\b/g, o).replace(/\bMMMM\b/g, l).replace(/\bMM\b/g, c).replace(/\bM\b/g, String(s)).replace(/\bdddd\b/g, f).replace(/\bDD\b/g, u).replace(/\bD\b/g, String(e.day));
462
- return r === "persian" && (p = p.replace(/\d+/g, (e) => L(e))), p;
461
+ let { digitType: r = "persian" } = n, i = (_(e.year, e.month, e.day).getDay() + 1) % 7, a = String(e.year), o = a.slice(-2), s = e.month + 1, c = s < 10 ? `0${s}` : String(s), l = u[e.month], d = e.day < 10 ? `0${e.day}` : String(e.day), f = p[i], m = t.replace(/\bYYYY\b/g, a).replace(/\bYY\b/g, o).replace(/\bMMMM\b/g, l).replace(/\bMM\b/g, c).replace(/\bM\b/g, String(s)).replace(/\bdddd\b/g, f).replace(/\bDD\b/g, d).replace(/\bD\b/g, String(e.day));
462
+ return r === "persian" && (m = m.replace(/\d+/g, (e) => F(e))), m;
463
463
  }
464
464
  //#endregion
465
465
  //#region src/theme/tokens.ts
466
- var B = {
467
- primaryColor: "#0284c7",
468
- primaryHover: "#0369a1",
469
- primaryActive: "#075985",
470
- primaryContrastText: "#ffffff",
471
- rangeBetweenBg: "#e0f2fe",
472
- rangeBetweenText: "#0369a1",
473
- surfaceBg: "#ffffff",
474
- surfaceBorder: "#e2e8f0",
475
- headerBg: "#f8fafc",
476
- textPrimary: "#0f172a",
477
- textSecondary: "#475569",
478
- textMuted: "#94a3b8",
479
- textDisabled: "#cbd5e1",
480
- todayIndicatorColor: "#0284c7",
481
- borderRadius: "8px",
482
- cellSize: "36px",
483
- shadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
484
- fontFamily: "inherit"
485
- }, te = {
486
- primaryColor: "#38bdf8",
487
- primaryHover: "#7dd3fc",
488
- primaryActive: "#bae6fd",
489
- primaryContrastText: "#0f172a",
490
- rangeBetweenBg: "#082f49",
491
- rangeBetweenText: "#7dd3fc",
492
- surfaceBg: "#0f172a",
493
- surfaceBorder: "#334155",
494
- headerBg: "#1e293b",
495
- textPrimary: "#f8fafc",
496
- textSecondary: "#cbd5e1",
497
- textMuted: "#64748b",
498
- textDisabled: "#475569",
499
- todayIndicatorColor: "#38bdf8",
500
- borderRadius: "8px",
501
- cellSize: "36px",
502
- shadow: "0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5)",
503
- fontFamily: "inherit"
466
+ var R = {
467
+ mode: "light",
468
+ colors: {
469
+ primary: "#2563eb",
470
+ primaryHover: "#1d4ed8",
471
+ primaryText: "#ffffff",
472
+ background: "#ffffff",
473
+ backgroundHover: "#f1f5f9",
474
+ surface: "#f8fafc",
475
+ border: "#e2e8f0",
476
+ textPrimary: "#0f172a",
477
+ textSecondary: "#64748b",
478
+ textDisabled: "#cbd5e1",
479
+ holiday: "#ef4444",
480
+ holidayBackground: "#fef2f2",
481
+ rangeBackground: "#dbeafe",
482
+ todayBorder: "#3b82f6"
483
+ },
484
+ radii: {
485
+ sm: "4px",
486
+ md: "8px",
487
+ lg: "12px",
488
+ full: "9999px"
489
+ },
490
+ shadows: {
491
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
492
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
493
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.1)"
494
+ }
495
+ }, ne = {
496
+ mode: "dark",
497
+ colors: {
498
+ primary: "#3b82f6",
499
+ primaryHover: "#60a5fa",
500
+ primaryText: "#ffffff",
501
+ background: "#0f172a",
502
+ backgroundHover: "#1e293b",
503
+ surface: "#1e293b",
504
+ border: "#334155",
505
+ textPrimary: "#f8fafc",
506
+ textSecondary: "#94a3b8",
507
+ textDisabled: "#475569",
508
+ holiday: "#f87171",
509
+ holidayBackground: "#451a1a",
510
+ rangeBackground: "#1e3a8a",
511
+ todayBorder: "#60a5fa"
512
+ },
513
+ radii: {
514
+ sm: "4px",
515
+ md: "8px",
516
+ lg: "12px",
517
+ full: "9999px"
518
+ },
519
+ shadows: {
520
+ sm: "0 1px 2px 0 rgba(0, 0, 0, 0.3)",
521
+ md: "0 4px 6px -1px rgba(0, 0, 0, 0.4)",
522
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.5)"
523
+ }
504
524
  };
505
- function V(e) {
525
+ function re(e) {
506
526
  let t = {};
507
527
  for (let [n, r] of Object.entries(e)) if (r !== void 0) {
508
528
  let e = `--pdp-${n.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
@@ -512,97 +532,163 @@ function V(e) {
512
532
  }
513
533
  //#endregion
514
534
  //#region src/theme/ThemeProvider.tsx
515
- var ne = t({
516
- tokens: B,
535
+ var z = e({
536
+ theme: R,
517
537
  mode: "light"
518
- }), re = ({ mode: e = "light", customTokens: t, children: n }) => {
519
- let r = a(() => ({
520
- ...e === "dark" ? te : B,
521
- ...t
522
- }), [e, t]), i = a(() => V(r), [r]);
523
- return /* @__PURE__ */ l(ne.Provider, {
524
- value: {
525
- tokens: r,
526
- mode: e
527
- },
528
- children: /* @__PURE__ */ l("div", {
529
- className: "pdp-theme-root",
530
- dir: "rtl",
531
- style: {
532
- ...i,
533
- display: "inline-block",
534
- fontFamily: r.fontFamily
538
+ }), B = () => n(z) || {
539
+ theme: R,
540
+ mode: "light"
541
+ }, ie = ({ children: e, mode: t = "light", customTheme: n }) => {
542
+ let r = t === "dark" ? ne : R, a = i(() => n ? {
543
+ mode: t,
544
+ theme: {
545
+ ...r,
546
+ ...n,
547
+ mode: t,
548
+ colors: {
549
+ ...r.colors,
550
+ ...n.colors || {}
551
+ },
552
+ radii: {
553
+ ...r.radii,
554
+ ...n.radii || {}
535
555
  },
536
- children: n
537
- })
556
+ shadows: {
557
+ ...r.shadows,
558
+ ...n.shadows || {}
559
+ }
560
+ }
561
+ } : {
562
+ theme: r,
563
+ mode: t
564
+ }, [
565
+ r,
566
+ n,
567
+ t
568
+ ]);
569
+ return /* @__PURE__ */ c(z.Provider, {
570
+ value: a,
571
+ children: e
538
572
  });
539
- }, ie = () => r(ne), ae = ({ year: e, month: t, onPrevMonth: n, onNextMonth: r, onTogglePicker: i, classNames: a, styles: o }) => /* @__PURE__ */ u("div", {
540
- className: a?.header,
541
- style: {
573
+ }, ae = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick: i, isPickerOpen: a }) => {
574
+ let { theme: o } = B(), s = {
575
+ background: "transparent",
576
+ border: "none",
577
+ cursor: "pointer",
578
+ padding: "6px",
579
+ borderRadius: o.radii.md,
542
580
  display: "flex",
543
581
  alignItems: "center",
544
- justifyContent: "space-between",
545
- marginBottom: "12px",
546
- padding: "0 4px",
547
- height: "28px",
548
- ...o?.header
549
- },
550
- children: [
551
- /* @__PURE__ */ l("button", {
552
- type: "button",
553
- "aria-label": "ماه قبل",
554
- onClick: n,
555
- className: a?.navButton,
556
- style: {
557
- width: "28px",
558
- height: "28px",
559
- borderRadius: "6px",
560
- border: "1px solid var(--pdp-surface-border, #e2e8f0)",
561
- backgroundColor: "var(--pdp-surface-bg, #ffffff)",
562
- color: "var(--pdp-text-primary, #0f172a)",
563
- cursor: "pointer",
564
- ...o?.navButton
565
- },
566
- children: "›"
567
- }),
568
- /* @__PURE__ */ u("button", {
569
- type: "button",
570
- onClick: i,
571
- className: a?.headerTitle,
572
- style: {
573
- background: "none",
574
- border: "none",
575
- cursor: "pointer",
576
- fontSize: "15px",
577
- fontWeight: 600,
578
- color: "var(--pdp-text-primary, #0f172a)",
579
- display: "flex",
580
- gap: "6px",
581
- ...o?.headerTitle
582
- },
583
- children: [/* @__PURE__ */ l("span", { children: d[t] }), /* @__PURE__ */ l("span", { children: L(e) })]
584
- }),
585
- /* @__PURE__ */ l("button", {
586
- type: "button",
587
- "aria-label": "ماه بعد",
588
- onClick: r,
589
- className: a?.navButton,
590
- style: {
591
- width: "28px",
592
- height: "28px",
593
- borderRadius: "6px",
594
- border: "1px solid var(--pdp-surface-border, #e2e8f0)",
595
- backgroundColor: "var(--pdp-surface-bg, #ffffff)",
596
- color: "var(--pdp-text-primary, #0f172a)",
597
- cursor: "pointer",
598
- ...o?.navButton
599
- },
600
- children: "‹"
601
- })
602
- ]
603
- }), oe = ({ firstDayOfWeek: e = 0, classNames: t, styles: n }) => {
604
- let r = [...p.slice(e), ...p.slice(0, e)];
582
+ justifyContent: "center",
583
+ color: o.colors.textPrimary,
584
+ transition: "all 0.15s cubic-bezier(0.4, 0, 0.2, 1)"
585
+ };
605
586
  return /* @__PURE__ */ l("div", {
587
+ style: {
588
+ display: "flex",
589
+ alignItems: "center",
590
+ justifyContent: "space-between",
591
+ padding: "8px 12px",
592
+ borderBottom: `1px solid ${o.colors.border}`,
593
+ userSelect: "none",
594
+ height: "42px",
595
+ boxSizing: "border-box"
596
+ },
597
+ children: [
598
+ /* @__PURE__ */ c("button", {
599
+ type: "button",
600
+ onClick: n,
601
+ "aria-label": "ماه قبل",
602
+ style: s,
603
+ onMouseEnter: (e) => {
604
+ e.currentTarget.style.backgroundColor = o.colors.backgroundHover, e.currentTarget.style.transform = "scale(1.1)";
605
+ },
606
+ onMouseLeave: (e) => {
607
+ e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.transform = "scale(1)";
608
+ },
609
+ children: /* @__PURE__ */ c("svg", {
610
+ width: "18",
611
+ height: "18",
612
+ viewBox: "0 0 24 24",
613
+ fill: "none",
614
+ stroke: "currentColor",
615
+ strokeWidth: "2.2",
616
+ strokeLinecap: "round",
617
+ strokeLinejoin: "round",
618
+ children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
619
+ })
620
+ }),
621
+ /* @__PURE__ */ l("button", {
622
+ type: "button",
623
+ onClick: i,
624
+ style: {
625
+ background: a ? o.colors.backgroundHover : "transparent",
626
+ border: "none",
627
+ cursor: "pointer",
628
+ padding: "6px 10px",
629
+ borderRadius: o.radii.md,
630
+ fontSize: "0.9rem",
631
+ fontWeight: 700,
632
+ color: o.colors.textPrimary,
633
+ display: "flex",
634
+ alignItems: "center",
635
+ gap: "6px",
636
+ transition: "all 0.15s ease"
637
+ },
638
+ onMouseEnter: (e) => {
639
+ e.currentTarget.style.backgroundColor = o.colors.backgroundHover;
640
+ },
641
+ onMouseLeave: (e) => {
642
+ a || (e.currentTarget.style.backgroundColor = "transparent");
643
+ },
644
+ children: [/* @__PURE__ */ l("span", { children: [
645
+ t,
646
+ " ",
647
+ F(e)
648
+ ] }), /* @__PURE__ */ c("svg", {
649
+ width: "14",
650
+ height: "14",
651
+ viewBox: "0 0 24 24",
652
+ fill: "none",
653
+ stroke: "currentColor",
654
+ strokeWidth: "2.2",
655
+ strokeLinecap: "round",
656
+ strokeLinejoin: "round",
657
+ style: {
658
+ transform: a ? "rotate(180deg)" : "rotate(0deg)",
659
+ transition: "transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)"
660
+ },
661
+ children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
662
+ })]
663
+ }),
664
+ /* @__PURE__ */ c("button", {
665
+ type: "button",
666
+ onClick: r,
667
+ "aria-label": "ماه بعد",
668
+ style: s,
669
+ onMouseEnter: (e) => {
670
+ e.currentTarget.style.backgroundColor = o.colors.backgroundHover, e.currentTarget.style.transform = "scale(1.1)";
671
+ },
672
+ onMouseLeave: (e) => {
673
+ e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.transform = "scale(1)";
674
+ },
675
+ children: /* @__PURE__ */ c("svg", {
676
+ width: "18",
677
+ height: "18",
678
+ viewBox: "0 0 24 24",
679
+ fill: "none",
680
+ stroke: "currentColor",
681
+ strokeWidth: "2.2",
682
+ strokeLinecap: "round",
683
+ strokeLinejoin: "round",
684
+ children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
685
+ })
686
+ })
687
+ ]
688
+ });
689
+ }, oe = ({ firstDayOfWeek: e = 0, classNames: t, styles: n }) => {
690
+ let r = [...f.slice(e), ...f.slice(0, e)];
691
+ return /* @__PURE__ */ c("div", {
606
692
  role: "row",
607
693
  "aria-label": "روزهای هفته",
608
694
  className: t?.weekdays,
@@ -614,7 +700,7 @@ var ne = t({
614
700
  textAlign: "center",
615
701
  ...n?.weekdays
616
702
  },
617
- children: r.map((e, r) => /* @__PURE__ */ l("div", {
703
+ children: r.map((e, r) => /* @__PURE__ */ c("div", {
618
704
  role: "columnheader",
619
705
  className: t?.weekdayCell,
620
706
  style: {
@@ -627,651 +713,314 @@ var ne = t({
627
713
  children: e
628
714
  }, r))
629
715
  });
630
- }, se = ({ cell: e, tabIndex: t, digitType: n = "persian", isHoliday: r = !1, holidayTitle: i, events: a = [], classNames: o, styles: c, onSelect: d, onHover: f, onFocus: p }) => {
631
- let { jalali: m, isCurrentMonth: h, isToday: g, isSelected: _, isDisabled: v, isInRange: y, isRangeStart: b, isRangeEnd: x } = e, [S, C] = s(!1), w = n === "persian" ? L(e.dayNumber) : e.dayNumber, T = P(m);
632
- r && i && (T += ` (${i})`);
633
- let E = "transparent", D = h ? r ? "var(--pdp-holiday-color, #ef4444)" : "var(--pdp-text-primary, #0f172a)" : "var(--pdp-text-disabled, #cbd5e1)";
634
- y && !_ && (E = "var(--pdp-range-between-bg, #e0f2fe)", D = "var(--pdp-range-between-text, #0369a1)"), (_ || b || x) && (E = "var(--pdp-primary-color, #0284c7)", D = "var(--pdp-primary-contrast-text, #ffffff)");
635
- let O = [
636
- o?.dayCell,
637
- g && o?.todayCell,
638
- _ && o?.selectedCell,
639
- y && !_ && o?.rangeBetweenCell,
640
- v && o?.disabledCell,
641
- r && o?.holidayCell
642
- ].filter(Boolean).join(" "), k = {
643
- width: "var(--pdp-cell-size, 36px)",
644
- height: "var(--pdp-cell-size, 36px)",
645
- display: "inline-flex",
646
- flexDirection: "column",
647
- alignItems: "center",
648
- justifyContent: "center",
649
- borderRadius: b || x || !y && _ ? "var(--pdp-border-radius, 8px)" : "4px",
650
- border: g && !_ ? "1px solid var(--pdp-today-indicator-color, #0284c7)" : "none",
651
- backgroundColor: E,
652
- color: D,
653
- fontWeight: g || _ || r ? 700 : 400,
654
- fontSize: "14px",
655
- cursor: v ? "not-allowed" : "pointer",
656
- opacity: v ? .4 : 1,
657
- transition: "background-color 0.15s ease, color 0.15s ease",
658
- outline: "none",
659
- position: "relative",
660
- ...c?.dayCell,
661
- ...g ? c?.todayCell : {},
662
- ..._ ? c?.selectedCell : {},
663
- ...y && !_ ? c?.rangeBetweenCell : {},
664
- ...v ? c?.disabledCell : {},
665
- ...r ? c?.holidayCell : {}
666
- }, A = a.length > 0, j = A ? a[0].color ?? "var(--pdp-primary-color, #0284c7)" : void 0;
667
- return /* @__PURE__ */ u("div", {
716
+ }, V = (e) => {
717
+ let { theme: t } = B(), n = e.cell, r = n?.jalali ?? {
718
+ year: 1403,
719
+ month: 1,
720
+ day: e.day ?? (n && "day" in n ? n.day : 1)
721
+ }, i = r.day, a = n?.isCurrentMonth ?? e.isCurrentMonth ?? !0, o = n?.isSelected ?? e.isSelected ?? !1, s = n?.isToday ?? e.isToday ?? !1, l = e.isHoliday ?? (n && "isHoliday" in n ? n.isHoliday : !1), u = n?.isInRange ?? e.isInRange ?? !1, d = n?.isRangeStart ?? e.isRangeStart ?? !1, f = n?.isRangeEnd ?? e.isRangeEnd ?? !1, p = n?.isDisabled ?? e.disabled ?? !1, m = "transparent", h = a ? t.colors.textPrimary : t.colors.textDisabled;
722
+ return u && a && (m = t.colors.rangeBackground), o || d || f ? (m = t.colors.primary, h = t.colors.primaryText) : l && a && (h = t.colors.holiday), /* @__PURE__ */ c("button", {
723
+ type: "button",
724
+ tabIndex: e.tabIndex ?? 0,
725
+ disabled: p || !a,
726
+ onClick: () => {
727
+ p || !a || (e.onClick && e.onClick(), e.onSelect && e.onSelect(r));
728
+ },
729
+ onFocus: () => e.onFocus?.(r),
668
730
  style: {
669
- position: "relative",
670
- display: "inline-flex"
731
+ width: "36px",
732
+ height: "36px",
733
+ display: "flex",
734
+ alignItems: "center",
735
+ justifyContent: "center",
736
+ border: s && !o && !d && !f ? `1.5px solid ${t.colors.todayBorder}` : "none",
737
+ borderRadius: d || f || o ? t.radii.md : u ? "0px" : t.radii.md,
738
+ backgroundColor: m,
739
+ color: h,
740
+ cursor: p || !a ? "default" : "pointer",
741
+ fontSize: "0.85rem",
742
+ fontWeight: o || s ? 700 : 500,
743
+ transition: "all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",
744
+ opacity: a ? 1 : .3,
745
+ outline: "none",
746
+ ...e.styles?.dayCell
671
747
  },
672
- onMouseEnter: () => {
673
- C(!0), v || f?.(m);
748
+ onMouseEnter: (n) => {
749
+ e.onHover?.(r), a && !p && !o && !d && !f && (n.currentTarget.style.backgroundColor = l ? t.colors.holidayBackground : t.colors.backgroundHover, n.currentTarget.style.transform = "scale(1.08)");
674
750
  },
675
- onMouseLeave: () => {
676
- C(!1), f?.(null);
751
+ onMouseLeave: (e) => {
752
+ !o && !d && !f && (e.currentTarget.style.backgroundColor = u ? t.colors.rangeBackground : "transparent", e.currentTarget.style.transform = "scale(1)");
677
753
  },
678
- children: [/* @__PURE__ */ u("button", {
679
- type: "button",
680
- role: "gridcell",
681
- tabIndex: v ? -1 : t,
682
- "aria-selected": _ || b || x,
683
- "aria-disabled": v,
684
- "aria-label": T,
685
- disabled: v,
686
- onClick: () => !v && d(m),
687
- onFocus: () => !v && p?.(m),
688
- className: O || void 0,
689
- style: k,
690
- children: [/* @__PURE__ */ l("span", {
691
- style: { lineHeight: 1 },
692
- children: w
693
- }), A && !_ && /* @__PURE__ */ l("div", {
694
- className: o?.eventBadge,
695
- style: {
696
- display: "flex",
697
- gap: "2px",
698
- position: "absolute",
699
- bottom: "3px",
700
- ...c?.eventBadge
701
- },
702
- children: a.slice(0, 3).map((e, t) => /* @__PURE__ */ l("span", { style: {
703
- width: "4px",
704
- height: "4px",
705
- borderRadius: "50%",
706
- backgroundColor: e.color ?? j,
707
- display: "inline-block"
708
- } }, t))
709
- })]
710
- }), S && (A || r && i) && /* @__PURE__ */ u("div", {
711
- role: "tooltip",
712
- style: {
713
- position: "absolute",
714
- bottom: "calc(100% + 6px)",
715
- left: "50%",
716
- transform: "translateX(-50%)",
717
- zIndex: 100,
718
- backgroundColor: "#0f172a",
719
- color: "#f8fafc",
720
- padding: "6px 10px",
721
- borderRadius: "6px",
722
- fontSize: "11px",
723
- whiteSpace: "nowrap",
724
- boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.3)",
725
- pointerEvents: "none",
726
- display: "flex",
727
- flexDirection: "column",
728
- gap: "2px",
729
- minWidth: "max-content",
730
- maxWidth: "200px",
731
- textAlign: "center"
732
- },
733
- children: [
734
- r && i && /* @__PURE__ */ l("div", {
735
- style: {
736
- color: "#f87171",
737
- fontWeight: 600
738
- },
739
- children: i
740
- }),
741
- a.map((e) => /* @__PURE__ */ u("div", {
742
- style: {
743
- display: "flex",
744
- alignItems: "center",
745
- gap: "4px",
746
- justifyContent: "center"
747
- },
748
- children: [e.color && /* @__PURE__ */ l("span", { style: {
749
- width: "6px",
750
- height: "6px",
751
- borderRadius: "50%",
752
- backgroundColor: e.color,
753
- display: "inline-block"
754
- } }), /* @__PURE__ */ l("span", {
755
- style: { fontWeight: 500 },
756
- children: e.title
757
- })]
758
- }, e.id)),
759
- /* @__PURE__ */ l("div", { style: {
760
- position: "absolute",
761
- top: "100%",
762
- left: "50%",
763
- transform: "translateX(-50%)",
764
- borderWidth: "4px",
765
- borderStyle: "solid",
766
- borderColor: "#0f172a transparent transparent transparent"
767
- } })
768
- ]
769
- })]
754
+ children: e.digitType === "latin" ? i : F(i)
770
755
  });
771
- }, ce = ({ currentYear: e, currentMonth: t, onSelectMonth: n, onSelectYear: r, onClose: i }) => {
772
- let [a, o] = s("months"), [c, f] = s(Math.floor(e / 12) * 12), p = Array.from({ length: 12 }, (e, t) => c + t);
773
- return /* @__PURE__ */ u("div", {
756
+ }, se = ({ currentYear: e, currentMonth: t, onSelectMonth: n, onSelectYear: i }) => {
757
+ let { theme: o } = B(), s = a(null);
758
+ return r(() => {
759
+ s.current && s.current.scrollIntoView({
760
+ behavior: "smooth",
761
+ inline: "center",
762
+ block: "nearest"
763
+ });
764
+ }, [e]), /* @__PURE__ */ l("div", {
774
765
  style: {
775
- padding: "8px",
776
- backgroundColor: "var(--pdp-surface-bg, #ffffff)",
777
- borderRadius: "var(--pdp-border-radius, 8px)"
766
+ display: "flex",
767
+ flexDirection: "column",
768
+ gap: "10px",
769
+ padding: "12px",
770
+ width: "100%",
771
+ height: "280px",
772
+ boxSizing: "border-box",
773
+ justifyContent: "space-between"
778
774
  },
779
- children: [
780
- /* @__PURE__ */ u("div", {
781
- style: {
782
- display: "flex",
783
- justifyContent: "space-between",
784
- alignItems: "center",
785
- marginBottom: "12px"
786
- },
787
- children: [
788
- /* @__PURE__ */ l("button", {
789
- type: "button",
790
- onClick: () => a === "years" ? f((e) => e - 12) : null,
791
- style: {
792
- background: "none",
793
- border: "none",
794
- cursor: "pointer",
795
- fontSize: "16px",
796
- color: "var(--pdp-text-primary)"
797
- },
798
- children: "‹"
799
- }),
800
- /* @__PURE__ */ u("div", {
801
- style: {
802
- display: "flex",
803
- gap: "8px"
804
- },
805
- children: [/* @__PURE__ */ l("button", {
806
- type: "button",
807
- onClick: () => o("months"),
808
- style: {
809
- fontWeight: a === "months" ? 700 : 400,
810
- background: "none",
811
- border: "none",
812
- cursor: "pointer",
813
- color: "var(--pdp-primary-color, #0284c7)"
814
- },
815
- children: d[t]
816
- }), /* @__PURE__ */ l("button", {
817
- type: "button",
818
- onClick: () => o("years"),
819
- style: {
820
- fontWeight: a === "years" ? 700 : 400,
821
- background: "none",
822
- border: "none",
823
- cursor: "pointer",
824
- color: "var(--pdp-primary-color, #0284c7)"
825
- },
826
- children: L(e)
827
- })]
828
- }),
829
- /* @__PURE__ */ l("button", {
830
- type: "button",
831
- onClick: () => a === "years" ? f((e) => e + 12) : null,
832
- style: {
833
- background: "none",
834
- border: "none",
835
- cursor: "pointer",
836
- fontSize: "16px",
837
- color: "var(--pdp-text-primary)"
838
- },
839
- children: "›"
840
- })
841
- ]
842
- }),
843
- a === "months" && /* @__PURE__ */ l("div", {
844
- style: {
845
- display: "grid",
846
- gridTemplateColumns: "repeat(3, 1fr)",
847
- gap: "8px"
848
- },
849
- children: d.map((e, r) => /* @__PURE__ */ l("button", {
775
+ children: [/* @__PURE__ */ c("div", {
776
+ style: {
777
+ display: "flex",
778
+ gap: "6px",
779
+ overflowX: "auto",
780
+ paddingBottom: "4px",
781
+ scrollbarWidth: "none"
782
+ },
783
+ children: Array.from({ length: 35 }, (t, n) => e - 17 + n).map((t) => {
784
+ let n = t === e;
785
+ return /* @__PURE__ */ c("button", {
786
+ ref: n ? s : void 0,
850
787
  type: "button",
851
- onClick: () => {
852
- n(r), i();
853
- },
788
+ onClick: () => i(t),
854
789
  style: {
855
- padding: "8px 4px",
856
- borderRadius: "6px",
790
+ padding: "6px 12px",
791
+ borderRadius: o.radii.md,
857
792
  border: "none",
793
+ background: n ? o.colors.primary : "transparent",
794
+ color: n ? o.colors.primaryText : o.colors.textPrimary,
858
795
  cursor: "pointer",
859
- backgroundColor: t === r ? "var(--pdp-primary-color, #0284c7)" : "transparent",
860
- color: t === r ? "#ffffff" : "var(--pdp-text-primary, #0f172a)",
861
- fontSize: "13px"
796
+ fontWeight: n ? 700 : 500,
797
+ fontSize: "0.85rem",
798
+ whiteSpace: "nowrap",
799
+ transition: "all 0.15s ease",
800
+ flexShrink: 0
862
801
  },
863
- children: e
864
- }, e))
865
- }),
866
- a === "years" && /* @__PURE__ */ l("div", {
867
- style: {
868
- display: "grid",
869
- gridTemplateColumns: "repeat(3, 1fr)",
870
- gap: "8px"
871
- },
872
- children: p.map((t) => /* @__PURE__ */ l("button", {
873
- type: "button",
874
- onClick: () => {
875
- r(t), o("months");
802
+ onMouseEnter: (e) => {
803
+ n || (e.currentTarget.style.backgroundColor = o.colors.backgroundHover);
876
804
  },
805
+ onMouseLeave: (e) => {
806
+ n || (e.currentTarget.style.backgroundColor = "transparent");
807
+ },
808
+ children: F(t)
809
+ }, t);
810
+ })
811
+ }), /* @__PURE__ */ c("div", {
812
+ style: {
813
+ display: "grid",
814
+ gridTemplateColumns: "repeat(3, 1fr)",
815
+ gridTemplateRows: "repeat(4, 1fr)",
816
+ gap: "8px",
817
+ flex: 1
818
+ },
819
+ children: u.map((e, r) => {
820
+ let i = r + 1 === t;
821
+ return /* @__PURE__ */ c("button", {
822
+ type: "button",
823
+ onClick: () => n(r + 1),
877
824
  style: {
878
- padding: "8px 4px",
879
- borderRadius: "6px",
825
+ borderRadius: o.radii.md,
880
826
  border: "none",
827
+ background: i ? o.colors.primary : o.colors.surface,
828
+ color: i ? o.colors.primaryText : o.colors.textPrimary,
881
829
  cursor: "pointer",
882
- backgroundColor: e === t ? "var(--pdp-primary-color, #0284c7)" : "transparent",
883
- color: e === t ? "#ffffff" : "var(--pdp-text-primary, #0f172a)",
884
- fontSize: "13px"
830
+ fontWeight: i ? 700 : 500,
831
+ fontSize: "0.85rem",
832
+ display: "flex",
833
+ alignItems: "center",
834
+ justifyContent: "center",
835
+ transition: "all 0.15s ease"
885
836
  },
886
- children: L(t)
887
- }, t))
837
+ onMouseEnter: (e) => {
838
+ i || (e.currentTarget.style.backgroundColor = o.colors.backgroundHover, e.currentTarget.style.transform = "translateY(-1px)");
839
+ },
840
+ onMouseLeave: (e) => {
841
+ i || (e.currentTarget.style.backgroundColor = o.colors.surface, e.currentTarget.style.transform = "translateY(0)");
842
+ },
843
+ children: e
844
+ }, e);
888
845
  })
889
- ]
846
+ })]
890
847
  });
891
- };
892
- //#endregion
893
- //#region src/plugins/time-picker/time-utils.ts
894
- function H(e, t = "persian") {
895
- let n = e < 10 ? `0${e}` : `${e}`;
896
- return t === "persian" ? L(n) : n;
897
- }
898
- function U() {
899
- let e = /* @__PURE__ */ new Date();
900
- return {
901
- hour: e.getHours(),
902
- minute: e.getMinutes(),
903
- second: e.getSeconds()
904
- };
905
- }
906
- function le(e) {
907
- return {
908
- hour: Math.max(0, Math.min(23, e.hour)),
909
- minute: Math.max(0, Math.min(59, e.minute)),
910
- second: e.second === void 0 ? void 0 : Math.max(0, Math.min(59, e.second))
911
- };
912
- }
913
- function ue(e, t = !1, n = "persian") {
914
- if (!e) return "";
915
- let r = H(e.hour, n), i = H(e.minute, n);
916
- return t && e.second !== void 0 ? `${r}:${i}:${H(e.second, n)}` : `${r}:${i}`;
917
- }
918
- //#endregion
919
- //#region src/components/footer/CalendarFooter.tsx
920
- var de = ({ selectedDate: e, selectedRange: t, selectedDates: n, selectedTime: r, mode: i = "single", digitType: a = "persian", showStatusText: o = !0, showActions: s = !0, onToday: c, onClear: d, onConfirm: f, classNames: p, styles: m }) => {
921
- let h = () => {
922
- let o = "هیچ تاریخی انتخاب نشده است";
923
- if (i === "single" && e) o = z(e, "dddd D MMMM YYYY", { digitType: a }), r && (o += ` - ${ue(r, !1, a)}`);
924
- else if (i === "range") {
925
- let [e, n] = t || [null, null];
926
- e && n ? o = `${z(e, "YYYY/MM/DD", { digitType: a })} تا ${z(n, "YYYY/MM/DD", { digitType: a })}` : e && (o = `شروع: ${z(e, "YYYY/MM/DD", { digitType: a })} (پایان را انتخاب کنید)`);
927
- } else i === "multiple" && n && n.length > 0 && (o = `${a === "persian" ? L(n.length) : n.length} روز انتخاب شده`);
928
- return o;
848
+ }, ce = ({ onTodayClick: e, onClearClick: t, showClear: n = !0 }) => {
849
+ let { theme: r } = B(), i = {
850
+ padding: "6px 14px",
851
+ borderRadius: r.radii.md,
852
+ border: `1px solid ${r.colors.border}`,
853
+ background: "transparent",
854
+ color: r.colors.textPrimary,
855
+ fontSize: "0.8rem",
856
+ fontWeight: 600,
857
+ cursor: "pointer",
858
+ transition: "all 0.15s ease"
929
859
  };
930
- return /* @__PURE__ */ u("div", {
931
- className: p?.footer,
860
+ return /* @__PURE__ */ l("div", {
932
861
  style: {
933
- marginTop: "8px",
934
- paddingTop: "8px",
935
- borderTop: "1px solid var(--pdp-surface-border, #e2e8f0)",
936
862
  display: "flex",
937
- flexDirection: "column",
938
- gap: "6px",
939
- ...m?.footer
863
+ alignItems: "center",
864
+ justifyContent: "space-between",
865
+ padding: "10px 12px",
866
+ borderTop: `1px solid ${r.colors.border}`,
867
+ marginTop: "6px"
940
868
  },
941
- children: [o && /* @__PURE__ */ l("div", {
942
- "aria-live": "polite",
869
+ children: [e && /* @__PURE__ */ c("button", {
870
+ type: "button",
871
+ onClick: e,
943
872
  style: {
944
- fontSize: "12px",
945
- color: "var(--pdp-text-secondary, #475569)",
946
- textAlign: "center",
947
- minHeight: "18px",
948
- fontWeight: 500
873
+ ...i,
874
+ borderColor: r.colors.primary,
875
+ color: r.colors.primary
949
876
  },
950
- children: h()
951
- }), s && /* @__PURE__ */ u("div", {
952
- style: {
953
- display: "flex",
954
- justifyContent: "space-between",
955
- alignItems: "center",
956
- gap: "8px"
877
+ onMouseEnter: (e) => {
878
+ e.currentTarget.style.backgroundColor = r.colors.backgroundHover;
957
879
  },
958
- children: [/* @__PURE__ */ u("div", {
959
- style: {
960
- display: "flex",
961
- gap: "4px"
962
- },
963
- children: [c && /* @__PURE__ */ l("button", {
964
- type: "button",
965
- onClick: c,
966
- style: {
967
- padding: "3px 8px",
968
- fontSize: "11px",
969
- borderRadius: "4px",
970
- border: "1px solid var(--pdp-surface-border, #e2e8f0)",
971
- backgroundColor: "transparent",
972
- color: "var(--pdp-text-primary, #0f172a)",
973
- cursor: "pointer"
974
- },
975
- children: "امروز"
976
- }), d && /* @__PURE__ */ l("button", {
977
- type: "button",
978
- onClick: d,
979
- style: {
980
- padding: "3px 8px",
981
- fontSize: "11px",
982
- borderRadius: "4px",
983
- border: "1px solid var(--pdp-surface-border, #e2e8f0)",
984
- backgroundColor: "transparent",
985
- color: "var(--pdp-text-muted, #94a3b8)",
986
- cursor: "pointer"
987
- },
988
- children: "پاک کردن"
989
- })]
990
- }), f && /* @__PURE__ */ l("button", {
991
- type: "button",
992
- onClick: f,
993
- style: {
994
- padding: "4px 12px",
995
- fontSize: "12px",
996
- fontWeight: 600,
997
- borderRadius: "6px",
998
- border: "none",
999
- backgroundColor: "var(--pdp-primary-color, #0284c7)",
1000
- color: "var(--pdp-primary-contrast-text, #ffffff)",
1001
- cursor: "pointer"
1002
- },
1003
- children: "تایید"
1004
- })]
880
+ onMouseLeave: (e) => {
881
+ e.currentTarget.style.backgroundColor = "transparent";
882
+ },
883
+ children: "برو به امروز"
884
+ }), n && t && /* @__PURE__ */ c("button", {
885
+ type: "button",
886
+ onClick: t,
887
+ style: i,
888
+ onMouseEnter: (e) => {
889
+ e.currentTarget.style.backgroundColor = r.colors.backgroundHover, e.currentTarget.style.color = r.colors.holiday;
890
+ },
891
+ onMouseLeave: (e) => {
892
+ e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.color = r.colors.textPrimary;
893
+ },
894
+ children: "پاک کردن"
1005
895
  })]
1006
896
  });
1007
- }, fe = ({ value: t, defaultValue: r, onChange: i, minuteStep: a = 1, hourStep: o = 1, showSeconds: s = !1, digitType: d = "persian", disabled: f = !1, styles: p, classNames: m }) => {
1008
- let [h, g] = e.useState(r ?? U()), _ = t === void 0 ? h : t ?? U(), v = n((e) => {
1009
- let n = le(e);
1010
- t === void 0 && g(n), i?.(n);
1011
- }, [t, i]), y = (e) => {
1012
- let t = (_.hour + e * o + 24) % 24;
1013
- v({
1014
- ..._,
1015
- hour: t
897
+ }, le = ({ value: e, hours: t, minutes: n, seconds: r, hour: i = e?.hour ?? t ?? 0, minute: a = e?.minute ?? n ?? 0, second: o = e?.second ?? r ?? 0, minuteStep: u = 1, hourStep: d = 1, showSeconds: f = !1, onChange: p }) => {
898
+ let { theme: m } = B(), h = (e) => {
899
+ p({
900
+ hour: parseInt(e.target.value, 10),
901
+ minute: a,
902
+ second: o
1016
903
  });
1017
- }, b = (e) => {
1018
- let t = (_.minute + e * a + 60) % 60;
1019
- v({
1020
- ..._,
1021
- minute: t
904
+ }, g = (e) => {
905
+ p({
906
+ hour: i,
907
+ minute: parseInt(e.target.value, 10),
908
+ second: o
1022
909
  });
1023
- }, x = (e) => {
1024
- if (!s) return;
1025
- let t = ((_.second ?? 0) + e + 60) % 60;
1026
- v({
1027
- ..._,
1028
- second: t
910
+ }, _ = (e) => {
911
+ p({
912
+ hour: i,
913
+ minute: a,
914
+ second: parseInt(e.target.value, 10)
1029
915
  });
1030
- }, S = {
1031
- background: "none",
1032
- border: "none",
1033
- cursor: f ? "not-allowed" : "pointer",
1034
- color: "var(--pdp-primary-color, #0284c7)",
1035
- fontSize: "12px",
1036
- padding: "2px 6px",
1037
- lineHeight: 1
1038
- }, C = {
1039
- display: "flex",
1040
- flexDirection: "column",
1041
- alignItems: "center",
1042
- justifyContent: "center"
1043
- }, w = {
1044
- fontSize: "15px",
916
+ }, v = {
917
+ background: m.colors.surface,
918
+ color: m.colors.textPrimary,
919
+ border: `1px solid ${m.colors.border}`,
920
+ borderRadius: m.radii.sm,
921
+ padding: "4px 6px",
922
+ fontSize: "0.85rem",
1045
923
  fontWeight: 600,
1046
- color: "var(--pdp-text-primary, #0f172a)",
1047
- minWidth: "24px",
1048
- textAlign: "center"
924
+ outline: "none",
925
+ cursor: "pointer",
926
+ direction: "ltr"
1049
927
  };
1050
- return /* @__PURE__ */ u("div", {
1051
- role: "group",
1052
- "aria-label": "Time Selection",
1053
- className: m?.timePicker,
928
+ return /* @__PURE__ */ l("div", {
1054
929
  style: {
1055
930
  display: "flex",
1056
931
  alignItems: "center",
1057
932
  justifyContent: "center",
1058
933
  gap: "6px",
1059
934
  padding: "8px 12px",
1060
- borderTop: "1px solid var(--pdp-surface-border, #e2e8f0)",
1061
- backgroundColor: "var(--pdp-header-bg, #f8fafc)",
1062
- borderRadius: "0 0 var(--pdp-border-radius, 8px) var(--pdp-border-radius, 8px)",
1063
- direction: "ltr",
1064
- ...p?.timePicker
935
+ borderTop: `1px solid ${m.colors.border}`,
936
+ direction: "ltr"
1065
937
  },
1066
938
  children: [
1067
- /* @__PURE__ */ u("div", {
1068
- style: C,
1069
- children: [
1070
- /* @__PURE__ */ l("button", {
1071
- type: "button",
1072
- disabled: f,
1073
- onClick: () => y(1),
1074
- style: S,
1075
- "aria-label": "Increase Hour",
1076
- children: "▼"
1077
- }),
1078
- /* @__PURE__ */ l("span", {
1079
- style: w,
1080
- children: H(_.hour, d)
1081
- }),
1082
- /* @__PURE__ */ l("button", {
1083
- type: "button",
1084
- disabled: f,
1085
- onClick: () => y(-1),
1086
- style: S,
1087
- "aria-label": "Decrease Hour",
1088
- children: "▲"
1089
- })
1090
- ]
939
+ /* @__PURE__ */ c("span", {
940
+ style: {
941
+ fontSize: "0.8rem",
942
+ color: m.colors.textSecondary,
943
+ marginRight: "4px"
944
+ },
945
+ children: "زمان:"
946
+ }),
947
+ /* @__PURE__ */ c("select", {
948
+ value: i,
949
+ onChange: h,
950
+ style: v,
951
+ children: Array.from({ length: Math.ceil(24 / d) }, (e, t) => t * d).map((e) => /* @__PURE__ */ c("option", {
952
+ value: e,
953
+ children: String(e).padStart(2, "0")
954
+ }, e))
1091
955
  }),
1092
- /* @__PURE__ */ l("span", {
956
+ /* @__PURE__ */ c("span", {
1093
957
  style: {
1094
- fontWeight: 700,
1095
- color: "var(--pdp-text-secondary, #475569)"
958
+ color: m.colors.textSecondary,
959
+ fontWeight: 700
1096
960
  },
1097
961
  children: ":"
1098
962
  }),
1099
- /* @__PURE__ */ u("div", {
1100
- style: C,
1101
- children: [
1102
- /* @__PURE__ */ l("button", {
1103
- type: "button",
1104
- disabled: f,
1105
- onClick: () => b(1),
1106
- style: S,
1107
- "aria-label": "Increase Minute",
1108
- children: "▲"
1109
- }),
1110
- /* @__PURE__ */ l("span", {
1111
- style: w,
1112
- children: H(_.minute, d)
1113
- }),
1114
- /* @__PURE__ */ l("button", {
1115
- type: "button",
1116
- disabled: f,
1117
- onClick: () => b(-1),
1118
- style: S,
1119
- "aria-label": "Decrease Minute",
1120
- children: "▼"
1121
- })
1122
- ]
963
+ /* @__PURE__ */ c("select", {
964
+ value: a,
965
+ onChange: g,
966
+ style: v,
967
+ children: Array.from({ length: Math.ceil(60 / u) }, (e, t) => t * u).map((e) => /* @__PURE__ */ c("option", {
968
+ value: e,
969
+ children: String(e).padStart(2, "0")
970
+ }, e))
1123
971
  }),
1124
- s && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("span", {
972
+ f && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
1125
973
  style: {
1126
- fontWeight: 700,
1127
- color: "var(--pdp-text-secondary, #475569)"
974
+ color: m.colors.textSecondary,
975
+ fontWeight: 700
1128
976
  },
1129
977
  children: ":"
1130
- }), /* @__PURE__ */ u("div", {
1131
- style: C,
1132
- children: [
1133
- /* @__PURE__ */ l("button", {
1134
- type: "button",
1135
- disabled: f,
1136
- onClick: () => x(1),
1137
- style: S,
1138
- "aria-label": "Increase Second",
1139
- children: "▲"
1140
- }),
1141
- /* @__PURE__ */ l("span", {
1142
- style: w,
1143
- children: H(_.second ?? 0, d)
1144
- }),
1145
- /* @__PURE__ */ l("button", {
1146
- type: "button",
1147
- disabled: f,
1148
- onClick: () => x(-1),
1149
- style: S,
1150
- "aria-label": "Decrease Second",
1151
- children: "▼"
1152
- })
1153
- ]
978
+ }), /* @__PURE__ */ c("select", {
979
+ value: o,
980
+ onChange: _,
981
+ style: v,
982
+ children: Array.from({ length: 60 }, (e, t) => /* @__PURE__ */ c("option", {
983
+ value: t,
984
+ children: String(t).padStart(2, "0")
985
+ }, t))
1154
986
  })] })
1155
987
  ]
1156
988
  });
1157
989
  };
1158
990
  //#endregion
1159
- //#region src/plugins/presets/default-presets.ts
1160
- function pe(e = "persian") {
1161
- let t = (t) => e === "persian" ? L(t) : `${t}`;
1162
- return [
1163
- {
1164
- id: "today",
1165
- label: "امروز",
1166
- getValue: () => y()
1167
- },
1168
- {
1169
- id: "this_week",
1170
- label: "این هفته",
1171
- getValue: () => A(y())
1172
- },
1173
- {
1174
- id: "last_7_days",
1175
- label: `${t(7)} روز گذشته`,
1176
- getValue: () => {
1177
- let e = y();
1178
- return [E(e, -6), e];
1179
- }
1180
- },
1181
- {
1182
- id: "this_month",
1183
- label: "این ماه",
1184
- getValue: () => j(y())
1185
- },
1186
- {
1187
- id: "last_month",
1188
- label: "ماه گذشته",
1189
- getValue: () => {
1190
- let e = y(), t = e.year, n = e.month - 1;
1191
- n < 0 && (n = 11, --t);
1192
- let r = g(t, n);
1193
- return [{
1194
- year: t,
1195
- month: n,
1196
- day: 1
1197
- }, {
1198
- year: t,
1199
- month: n,
1200
- day: r
1201
- }];
1202
- }
1203
- },
1204
- {
1205
- id: "last_30_days",
1206
- label: `${t(30)} روز گذشته`,
1207
- getValue: () => {
1208
- let e = y();
1209
- return [E(e, -29), e];
1210
- }
1211
- }
1212
- ];
991
+ //#region src/plugins/time-picker/time-utils.ts
992
+ function H(e, t = "persian") {
993
+ let n = e < 10 ? `0${e}` : `${e}`;
994
+ return t === "persian" ? F(n) : n;
1213
995
  }
1214
- var me = pe("persian"), he = ({ presets: e, onSelectPreset: t, selectedValue: n, orientation: r = "vertical", digitType: i = "persian", disabled: o = !1, classNames: s, styles: c }) => {
1215
- let u = a(() => e ?? pe(i), [e, i]), d = (e) => {
1216
- if (!n) return !1;
1217
- let t = e.getValue();
1218
- if (!Array.isArray(t) && !Array.isArray(n)) return b(t, n);
1219
- if (Array.isArray(t) && Array.isArray(n)) {
1220
- let [e, r] = t, [i, a] = n;
1221
- return !e || !r || !i || !a ? !1 : b(e, i) && b(r, a);
1222
- }
1223
- return !1;
1224
- }, f = {
1225
- display: "flex",
1226
- flexDirection: r === "vertical" ? "column" : "row",
1227
- gap: "4px",
1228
- padding: "8px",
1229
- backgroundColor: "var(--pdp-header-bg, #f8fafc)",
1230
- borderLeft: r === "vertical" ? "1px solid var(--pdp-surface-border, #e2e8f0)" : "none",
1231
- borderBottom: r === "horizontal" ? "1px solid var(--pdp-surface-border, #e2e8f0)" : "none",
1232
- overflowX: r === "horizontal" ? "auto" : "visible",
1233
- maxHeight: r === "vertical" ? "280px" : "none",
1234
- overflowY: r === "vertical" ? "auto" : "visible",
1235
- minWidth: r === "vertical" ? "110px" : "auto",
1236
- ...c?.presetsBar
996
+ function U() {
997
+ let e = /* @__PURE__ */ new Date();
998
+ return {
999
+ hour: e.getHours(),
1000
+ minute: e.getMinutes(),
1001
+ second: e.getSeconds()
1237
1002
  };
1238
- return /* @__PURE__ */ l("div", {
1239
- role: "group",
1240
- "aria-label": "کلیدهای میانبر تاریخ",
1241
- className: s?.presetsBar,
1242
- style: f,
1243
- children: u.map((e) => {
1244
- let n = d(e);
1245
- return /* @__PURE__ */ l("button", {
1246
- type: "button",
1247
- disabled: o,
1248
- onClick: () => t(e.getValue()),
1249
- style: {
1250
- padding: "6px 10px",
1251
- fontSize: "12px",
1252
- fontWeight: n ? 600 : 400,
1253
- textAlign: "right",
1254
- border: "none",
1255
- borderRadius: "var(--pdp-border-radius, 6px)",
1256
- cursor: o ? "not-allowed" : "pointer",
1257
- backgroundColor: n ? "var(--pdp-primary-color, #0284c7)" : "transparent",
1258
- color: n ? "var(--pdp-primary-contrast-text, #ffffff)" : "var(--pdp-text-primary, #0f172a)",
1259
- whiteSpace: "nowrap",
1260
- transition: "background-color 0.15s ease, color 0.15s ease"
1261
- },
1262
- children: e.label
1263
- }, e.id);
1264
- })
1265
- });
1266
- };
1003
+ }
1004
+ function ue(e) {
1005
+ return {
1006
+ hour: Math.max(0, Math.min(23, e.hour)),
1007
+ minute: Math.max(0, Math.min(59, e.minute)),
1008
+ second: e.second === void 0 ? void 0 : Math.max(0, Math.min(59, e.second))
1009
+ };
1010
+ }
1011
+ function de(e, t = !1, n = "persian") {
1012
+ if (!e) return "";
1013
+ let r = H(e.hour, n), i = H(e.minute, n);
1014
+ return t && e.second !== void 0 ? `${r}:${i}:${H(e.second, n)}` : `${r}:${i}`;
1015
+ }
1267
1016
  //#endregion
1268
1017
  //#region src/components/masked-input/mask-utils.ts
1269
- function ge(e, t = "persian") {
1270
- let n = R(e).replace(/\D/g, "").slice(0, 8), r = "";
1271
- return n.length > 0 && (r = n.slice(0, 4)), n.length >= 5 && (r += `/${n.slice(4, 6)}`), n.length >= 7 && (r += `/${n.slice(6, 8)}`), t === "persian" ? L(r) : r;
1018
+ function W(e, t = "persian") {
1019
+ let n = I(e).replace(/\D/g, "").slice(0, 8), r = "";
1020
+ return n.length > 0 && (r = n.slice(0, 4)), n.length >= 5 && (r += `/${n.slice(4, 6)}`), n.length >= 7 && (r += `/${n.slice(6, 8)}`), t === "persian" ? F(r) : r;
1272
1021
  }
1273
- function W(e, t, n, r) {
1274
- let i = R(e).trim();
1022
+ function G(e, t, n, r) {
1023
+ let i = I(e).trim();
1275
1024
  if (!i) return {
1276
1025
  isValid: !0,
1277
1026
  date: null
@@ -1288,7 +1037,7 @@ function W(e, t, n, r) {
1288
1037
  date: null,
1289
1038
  error: "INVALID_MONTH"
1290
1039
  };
1291
- let l = s - 1, u = g(o, l);
1040
+ let l = s - 1, u = h(o, l);
1292
1041
  if (c < 1 || c > u) return {
1293
1042
  isValid: !1,
1294
1043
  date: null,
@@ -1299,11 +1048,11 @@ function W(e, t, n, r) {
1299
1048
  month: l,
1300
1049
  day: c
1301
1050
  };
1302
- return t && O(d, t) < 0 ? {
1051
+ return t && D(d, t) < 0 ? {
1303
1052
  isValid: !1,
1304
1053
  date: d,
1305
1054
  error: "OUT_OF_MIN_BOUNDS"
1306
- } : n && O(d, n) > 0 ? {
1055
+ } : n && D(d, n) > 0 ? {
1307
1056
  isValid: !1,
1308
1057
  date: d,
1309
1058
  error: "OUT_OF_MAX_BOUNDS"
@@ -1318,37 +1067,37 @@ function W(e, t, n, r) {
1318
1067
  }
1319
1068
  //#endregion
1320
1069
  //#region src/components/masked-input/MaskedDateInput.tsx
1321
- var _e = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a, digitType: c = "persian", minDate: d, maxDate: f, isDateDisabled: p, clearable: m = !0, placeholder: h = "۱۴۰۵/۰۱/۱۵", disabled: g = !1, style: _, ...v }) => {
1322
- let [y, b] = s(t), x = e === void 0 ? y : e, [S, C] = s(() => x ? z(x, "YYYY/MM/DD", { digitType: c }) : ""), [w, T] = s(!1), E = o(null);
1323
- i(() => {
1324
- e !== void 0 && (C(e ? z(e, "YYYY/MM/DD", { digitType: c }) : ""), T(!1));
1325
- }, [e, c]);
1070
+ var fe = ({ value: e, defaultValue: n = null, onChange: i, onValidationError: s, digitType: u = "persian", minDate: d, maxDate: f, isDateDisabled: p, clearable: m = !0, placeholder: h = "۱۴۰۵/۰۱/۱۵", disabled: g = !1, style: _, ...v }) => {
1071
+ let [y, b] = o(n), x = e === void 0 ? y : e, [S, C] = o(() => x ? L(x, "YYYY/MM/DD", { digitType: u }) : ""), [w, T] = o(!1), E = a(null);
1072
+ r(() => {
1073
+ e !== void 0 && (C(e ? L(e, "YYYY/MM/DD", { digitType: u }) : ""), T(!1));
1074
+ }, [e, u]);
1326
1075
  let D = (t) => {
1327
- let n = t.target.value, i = ge(n, c);
1328
- if (C(i), i.length === 10 || i.length === 0) {
1329
- let t = W(i, d, f, p);
1330
- t.isValid ? (T(!1), a?.(null), e === void 0 && b(t.date), r?.(t.date)) : (T(!0), a?.(t.error));
1331
- } else T(!1), a?.(null);
1332
- }, O = n(() => {
1333
- C(""), T(!1), a?.(null), e === void 0 && b(null), r?.(null), E.current?.focus();
1076
+ let n = t.target.value, r = W(n, u);
1077
+ if (C(r), r.length === 10 || r.length === 0) {
1078
+ let t = G(r, d, f, p);
1079
+ t.isValid ? (T(!1), s?.(null), e === void 0 && b(t.date), i?.(t.date)) : (T(!0), s?.(t.error));
1080
+ } else T(!1), s?.(null);
1081
+ }, O = t(() => {
1082
+ C(""), T(!1), s?.(null), e === void 0 && b(null), i?.(null), E.current?.focus();
1334
1083
  }, [
1335
1084
  e,
1336
- r,
1337
- a
1085
+ i,
1086
+ s
1338
1087
  ]);
1339
- return /* @__PURE__ */ u("div", {
1088
+ return /* @__PURE__ */ l("div", {
1340
1089
  style: {
1341
1090
  position: "relative",
1342
1091
  display: "inline-flex",
1343
1092
  alignItems: "center",
1344
1093
  direction: "rtl"
1345
1094
  },
1346
- children: [/* @__PURE__ */ l("input", {
1095
+ children: [/* @__PURE__ */ c("input", {
1347
1096
  ref: E,
1348
1097
  type: "text",
1349
1098
  inputMode: "numeric",
1350
1099
  disabled: g,
1351
- placeholder: c === "persian" ? h : "1405/01/15",
1100
+ placeholder: u === "persian" ? h : "1405/01/15",
1352
1101
  value: S,
1353
1102
  onChange: D,
1354
1103
  style: {
@@ -1368,7 +1117,7 @@ var _e = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a,
1368
1117
  ..._
1369
1118
  },
1370
1119
  ...v
1371
- }), m && S && !g && /* @__PURE__ */ l("button", {
1120
+ }), m && S && !g && /* @__PURE__ */ c("button", {
1372
1121
  type: "button",
1373
1122
  "aria-label": "پاک کردن",
1374
1123
  onClick: O,
@@ -1392,12 +1141,12 @@ var _e = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a,
1392
1141
  };
1393
1142
  //#endregion
1394
1143
  //#region src/events/event-utils.ts
1395
- function ve(e, t) {
1396
- return !t || t.length === 0 ? [] : t.filter((t) => b(t.date, e));
1144
+ function pe(e, t) {
1145
+ return !t || t.length === 0 ? [] : t.filter((t) => y(t.date, e));
1397
1146
  }
1398
1147
  //#endregion
1399
1148
  //#region src/holidays/iran-holidays.ts
1400
- var G = {
1149
+ var K = {
1401
1150
  "0-1": "جشن نوروز / سال نو",
1402
1151
  "0-2": "عید نوروز",
1403
1152
  "0-3": "عید نوروز",
@@ -1409,10 +1158,10 @@ var G = {
1409
1158
  "10-22": "پیروزی انقلاب اسلامی",
1410
1159
  "11-29": "روز ملی شدن صنعت نفت"
1411
1160
  };
1412
- function ye(e) {
1413
- return v(e.year, e.month, e.day).getDay() === 5;
1161
+ function me(e) {
1162
+ return _(e.year, e.month, e.day).getDay() === 5;
1414
1163
  }
1415
- function be(e, t) {
1164
+ function he(e, t) {
1416
1165
  if (t && t.length > 0) {
1417
1166
  let n = t.find((t) => t.date.year === e.year && t.date.month === e.month && t.date.day === e.day);
1418
1167
  if (n) return {
@@ -1422,11 +1171,11 @@ function be(e, t) {
1422
1171
  };
1423
1172
  }
1424
1173
  let n = `${e.month}-${e.day}`;
1425
- return G[n] ? {
1426
- title: G[n],
1174
+ return K[n] ? {
1175
+ title: K[n],
1427
1176
  type: "solar",
1428
1177
  isOff: !0
1429
- } : ye(e) ? {
1178
+ } : me(e) ? {
1430
1179
  title: "جمعه (تعطیل پایان هفته)",
1431
1180
  type: "solar",
1432
1181
  isOff: !0
@@ -1434,107 +1183,101 @@ function be(e, t) {
1434
1183
  }
1435
1184
  //#endregion
1436
1185
  //#region src/components/JalaliDatePicker.tsx
1437
- function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDate: p, maxDate: m, isDateDisabled: h, firstDayOfWeek: g = 0, variant: _ = "inline", placeholder: v = "انتخاب تاریخ...", digitType: y = "persian", className: x, style: T, classNames: E, styles: D, showFooter: O = !1, showStatusText: A = !0, showActions: j = !0, onConfirm: N, enableTime: P = !1, timeValue: I, defaultTimeValue: ee, onTimeChange: R, minuteStep: B = 1, hourStep: te = 1, showSeconds: V = !1, enablePresets: ne = !1, presets: re, presetsOrientation: ie = "vertical", numberOfMonths: H = 1, useMaskedInput: le = !1, events: pe, showHolidays: me = !1, customHolidays: ge }) {
1438
- let [W, G] = s(_ === "inline"), [ye, xe] = s(!1), Se = o(null), K = _ === "modal", Ce = a(() => {
1439
- if (t !== void 0) {
1440
- if (!t) return null;
1441
- if (t instanceof Date) return C(t);
1442
- if (Array.isArray(t)) {
1186
+ function ge({ mode: e = "single", value: n, defaultValue: d, onChange: f, minDate: p, maxDate: m, isDateDisabled: h, firstDayOfWeek: g = 0, variant: _ = "inline", placeholder: v = "انتخاب تاریخ...", digitType: b = "persian", className: w, style: T, classNames: E, styles: D, showFooter: k = !1, showStatusText: A = !0, showActions: M = !0, onConfirm: ee, enableTime: N = !1, timeValue: P, defaultTimeValue: I, onTimeChange: R, minuteStep: ne = 1, hourStep: re = 1, showSeconds: z = !1, numberOfMonths: B = 1, useMaskedInput: ie = !1, events: H, showHolidays: ue = !1, customHolidays: W }) {
1187
+ let [G, K] = o(_ === "inline"), [me, ge] = o(!1), _e = a(null), q = _ === "modal", ve = i(() => {
1188
+ if (n !== void 0) {
1189
+ if (!n) return null;
1190
+ if (n instanceof Date) return S(n);
1191
+ if (Array.isArray(n)) {
1443
1192
  if (e === "range") {
1444
- let [e, n] = t;
1445
- return [e ? C(e) : null, n ? C(n) : null];
1193
+ let [e, t] = n;
1194
+ return [e ? S(e) : null, t ? S(t) : null];
1446
1195
  }
1447
- if (e === "multiple") return t.map((e) => C(e));
1196
+ if (e === "multiple") return n.map((e) => S(e));
1448
1197
  }
1449
1198
  return null;
1450
1199
  }
1451
- }, [t, e]), we = a(() => {
1452
- if (r !== void 0) {
1453
- if (!r) return null;
1454
- if (r instanceof Date) return C(r);
1455
- if (Array.isArray(r)) {
1200
+ }, [n, e]), ye = i(() => {
1201
+ if (d !== void 0) {
1202
+ if (!d) return null;
1203
+ if (d instanceof Date) return S(d);
1204
+ if (Array.isArray(d)) {
1456
1205
  if (e === "range") {
1457
- let [e, t] = r;
1458
- return [e ? C(e) : null, t ? C(t) : null];
1206
+ let [e, t] = d;
1207
+ return [e ? S(e) : null, t ? S(t) : null];
1459
1208
  }
1460
- if (e === "multiple") return r.map((e) => C(e));
1209
+ if (e === "multiple") return d.map((e) => S(e));
1461
1210
  }
1462
1211
  return null;
1463
1212
  }
1464
- }, [r, e]), Te = a(() => p ? C(p) : void 0, [p]), Ee = a(() => m ? C(m) : void 0, [m]), [De, Oe] = s(() => ee ?? U()), q = I === void 0 ? De : I ?? U(), ke = n((e) => {
1465
- I === void 0 && Oe(e), R?.(e);
1466
- }, [I, R]), Ae = n((t) => {
1213
+ }, [d, e]), be = i(() => p ? S(p) : void 0, [p]), xe = i(() => m ? S(m) : void 0, [m]), [Se, Ce] = o(() => I ?? U()), J = P === void 0 ? Se : P ?? U(), we = t((e) => {
1214
+ P === void 0 && Ce(e), R?.(e);
1215
+ }, [P, R]), Te = t((t) => {
1467
1216
  if (!t) return null;
1468
- let n = P ? q.hour : 0, r = P ? q.minute : 0, i = P && V ? q.second ?? 0 : 0;
1469
- if (e === "single" && !Array.isArray(t)) return w(t, n, r, i);
1217
+ let n = N ? J.hour : 0, r = N ? J.minute : 0, i = N && z ? J.second ?? 0 : 0;
1218
+ if (e === "single" && !Array.isArray(t)) return C(t, n, r, i);
1470
1219
  if (e === "range" && Array.isArray(t)) {
1471
1220
  let [e, n] = t;
1472
- return [e ? w(e, 0, 0, 0) : null, n ? w(n, 23, 59, 59) : null];
1221
+ return [e ? C(e, 0, 0, 0) : null, n ? C(n, 23, 59, 59) : null];
1473
1222
  }
1474
- return e === "multiple" && Array.isArray(t) ? t.map((e) => w(e, n, r, i)) : null;
1223
+ return e === "multiple" && Array.isArray(t) ? t.map((e) => C(e, n, r, i)) : null;
1475
1224
  }, [
1476
1225
  e,
1477
- P,
1478
- q,
1479
- V
1480
- ]), { selected: J, viewYear: Y, viewMonth: X, grid: je, goToPrevMonth: Me, goToNextMonth: Ne, setView: Z, goToToday: Pe, selectDate: Q, setHoverDate: Fe, hoverDate: Ie, clear: Le } = M({
1226
+ N,
1227
+ J,
1228
+ z
1229
+ ]), { selected: Y, viewYear: X, viewMonth: Z, grid: Ee, goToPrevMonth: De, goToNextMonth: Oe, setView: Q, goToToday: ke, selectDate: Ae, setHoverDate: je, hoverDate: Me, clear: Ne } = j({
1481
1230
  mode: e,
1482
- value: Ce,
1483
- defaultValue: we,
1484
- minDate: Te,
1485
- maxDate: Ee,
1231
+ value: ve,
1232
+ defaultValue: ye,
1233
+ minDate: be,
1234
+ maxDate: xe,
1486
1235
  firstDayOfWeek: g,
1487
- isDateDisabled: h ? (e) => h(w(e)) : void 0,
1236
+ isDateDisabled: h ? (e) => h(C(e)) : void 0,
1488
1237
  onChange: (e) => {
1489
- f?.(Ae(e));
1238
+ f?.(Te(e));
1490
1239
  }
1491
- }), Re = e === "single" ? J : null, ze = (t) => {
1492
- Q(t), _ === "popover" && e === "single" && !P && G(!1);
1493
- }, { handleKeyDown: Be, getCellTabIndex: Ve, setFocusedDate: He } = F({
1494
- viewYear: Y,
1495
- viewMonth: X,
1496
- selectedDate: Re,
1497
- onSelectDate: ze,
1498
- onViewChange: Z,
1240
+ }), Pe = e === "single" ? Y : null, Fe = (t) => {
1241
+ Ae(t), _ === "popover" && e === "single" && !N && K(!1);
1242
+ }, { handleKeyDown: Ie, getCellTabIndex: Le, setFocusedDate: Re } = te({
1243
+ viewYear: X,
1244
+ viewMonth: Z,
1245
+ selectedDate: Pe,
1246
+ onSelectDate: Fe,
1247
+ onViewChange: Q,
1499
1248
  isRtl: !0
1500
1249
  });
1501
- i(() => {
1502
- if (!K || !W) return;
1250
+ r(() => {
1251
+ if (!q || !G) return;
1503
1252
  let e = document.body.style.overflow;
1504
1253
  document.body.style.overflow = "hidden";
1505
1254
  let t = (e) => {
1506
- e.key === "Escape" && G(!1);
1255
+ e.key === "Escape" && K(!1);
1507
1256
  };
1508
1257
  return window.addEventListener("keydown", t), () => {
1509
1258
  document.body.style.overflow = e, window.removeEventListener("keydown", t);
1510
1259
  };
1511
- }, [K, W]);
1512
- let Ue = (t) => {
1513
- if (e === "single" && !Array.isArray(t)) Q(t), Z(t.year, t.month), _ === "popover" && !P && G(!1);
1514
- else if (e === "range" && Array.isArray(t)) {
1515
- let [e, n] = t;
1516
- e && n && (Q(e), Q(n), Z(e.year, e.month));
1517
- }
1518
- }, $ = a(() => X === 11 ? {
1519
- year: Y + 1,
1260
+ }, [q, G]);
1261
+ let $ = i(() => Z === 11 ? {
1262
+ year: X + 1,
1520
1263
  month: 0
1521
1264
  } : {
1522
- year: Y,
1523
- month: X + 1
1524
- }, [Y, X]), We = a(() => {
1525
- if (H !== 2) return [];
1526
- let t = S({
1265
+ year: X,
1266
+ month: Z + 1
1267
+ }, [X, Z]), ze = i(() => {
1268
+ if (B !== 2) return [];
1269
+ let t = x({
1527
1270
  year: $.year,
1528
1271
  month: $.month,
1529
1272
  firstDayOfWeek: g,
1530
- minDate: Te,
1531
- maxDate: Ee
1273
+ minDate: be,
1274
+ maxDate: xe
1532
1275
  });
1533
1276
  if (e !== "range") return t;
1534
- let [n, r] = J || [null, null], i = r ?? (n && Ie ? Ie : null);
1277
+ let [n, r] = Y || [null, null], i = r ?? (n && Me ? Me : null);
1535
1278
  return t.map((e) => {
1536
- let t = n ? b(e.jalali, n) : !1, r = i ? b(e.jalali, i) : !1, a = !1;
1537
- return n && i && (a = k(e.jalali, n, i)), {
1279
+ let t = n ? y(e.jalali, n) : !1, r = i ? y(e.jalali, i) : !1, a = !1;
1280
+ return n && i && (a = O(e.jalali, n, i)), {
1538
1281
  ...e,
1539
1282
  isSelected: t || r,
1540
1283
  isInRange: a,
@@ -1543,54 +1286,52 @@ function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
1543
1286
  };
1544
1287
  });
1545
1288
  }, [
1546
- H,
1289
+ B,
1547
1290
  $,
1548
1291
  g,
1549
- Te,
1550
- Ee,
1292
+ be,
1293
+ xe,
1551
1294
  e,
1552
- J,
1553
- Ie
1554
- ]), Ge = a(() => {
1555
- if (!J) return "";
1295
+ Y,
1296
+ Me
1297
+ ]), Be = i(() => {
1298
+ if (!Y) return "";
1556
1299
  if (e === "single") {
1557
- let e = z(J, "YYYY/MM/DD", { digitType: y });
1558
- return P && q ? `${e} ${ue(q, V, y)}` : e;
1300
+ let e = L(Y, "YYYY/MM/DD", { digitType: b });
1301
+ return N && J ? `${e} ${de(J, z, b)}` : e;
1559
1302
  }
1560
1303
  if (e === "range") {
1561
- let [e, t] = J || [null, null];
1562
- if (e && t) return `${z(e, "YYYY/MM/DD", { digitType: y })} - ${z(t, "YYYY/MM/DD", { digitType: y })}`;
1563
- if (e) return z(e, "YYYY/MM/DD", { digitType: y });
1304
+ let [e, t] = Y || [null, null];
1305
+ if (e && t) return `${L(e, "YYYY/MM/DD", { digitType: b })} - ${L(t, "YYYY/MM/DD", { digitType: b })}`;
1306
+ if (e) return L(e, "YYYY/MM/DD", { digitType: b });
1564
1307
  }
1565
1308
  return "";
1566
1309
  }, [
1567
- J,
1310
+ Y,
1568
1311
  e,
1569
- y,
1570
- P,
1571
- q,
1572
- V
1573
- ]), Ke = (e, t, n, r = !0, i = !0) => /* @__PURE__ */ u("div", {
1312
+ b,
1313
+ N,
1314
+ J,
1315
+ z
1316
+ ]), Ve = (e, t, n, r = !0, i = !0) => /* @__PURE__ */ l("div", {
1574
1317
  style: { minWidth: "270px" },
1575
1318
  children: [
1576
- /* @__PURE__ */ l(ae, {
1319
+ /* @__PURE__ */ c(ae, {
1577
1320
  year: e,
1578
- month: t,
1579
- onPrevMonth: r ? Me : () => {},
1580
- onNextMonth: i ? Ne : () => {},
1581
- onTogglePicker: () => H === 1 && xe(!0),
1582
- onGoToToday: Pe,
1583
- classNames: E,
1584
- styles: D
1321
+ monthName: u[t],
1322
+ onPrevMonth: r ? De : () => {},
1323
+ onNextMonth: i ? Oe : () => {},
1324
+ onTitleClick: () => ge((e) => !e),
1325
+ isPickerOpen: me
1585
1326
  }),
1586
- /* @__PURE__ */ l(oe, {
1327
+ /* @__PURE__ */ c(oe, {
1587
1328
  firstDayOfWeek: g,
1588
1329
  classNames: E,
1589
1330
  styles: D
1590
1331
  }),
1591
- /* @__PURE__ */ l("div", {
1332
+ /* @__PURE__ */ c("div", {
1592
1333
  role: "grid",
1593
- "aria-label": `${d[t]} ${L(e)}`,
1334
+ "aria-label": `${u[t]} ${F(e)}`,
1594
1335
  className: E?.grid,
1595
1336
  style: {
1596
1337
  display: "grid",
@@ -1599,156 +1340,145 @@ function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
1599
1340
  ...D?.grid
1600
1341
  },
1601
1342
  children: n.map((e, t) => {
1602
- let n = me ? be(e.jalali, ge) : null, r = ve(e.jalali, pe);
1603
- return /* @__PURE__ */ l(se, {
1343
+ let n = ue ? he(e.jalali, W) : null, r = pe(e.jalali, H);
1344
+ return /* @__PURE__ */ c(V, {
1604
1345
  cell: e,
1605
- digitType: y,
1346
+ digitType: b,
1606
1347
  isHoliday: !!n,
1607
1348
  holidayTitle: n?.title,
1608
1349
  events: r,
1609
1350
  classNames: E,
1610
1351
  styles: D,
1611
- tabIndex: Ve(e.jalali),
1612
- onSelect: ze,
1613
- onHover: Fe,
1614
- onFocus: He
1352
+ tabIndex: Le(e.jalali),
1353
+ onSelect: Fe,
1354
+ onHover: je,
1355
+ onFocus: Re
1615
1356
  }, t);
1616
1357
  })
1617
1358
  })
1618
1359
  ]
1619
- }), qe = /* @__PURE__ */ u("div", {
1620
- role: K ? "dialog" : "region",
1621
- "aria-modal": K ? !0 : void 0,
1360
+ }), He = /* @__PURE__ */ l("div", {
1361
+ role: q ? "dialog" : "region",
1362
+ "aria-modal": q ? !0 : void 0,
1622
1363
  "aria-label": "تقویم شمسی",
1623
- onKeyDown: Be,
1624
- onClick: (e) => K && e.stopPropagation(),
1364
+ onKeyDown: Ie,
1365
+ onClick: (e) => q && e.stopPropagation(),
1625
1366
  className: E?.calendar,
1626
1367
  style: {
1627
- position: _ === "popover" ? "absolute" : K ? "relative" : "static",
1368
+ position: _ === "popover" ? "absolute" : q ? "relative" : "static",
1628
1369
  top: _ === "popover" ? "calc(100% + 4px)" : void 0,
1629
1370
  right: _ === "popover" ? 0 : void 0,
1630
- zIndex: K ? 1001 : 50,
1371
+ zIndex: q ? 1001 : 50,
1631
1372
  padding: "16px",
1632
1373
  backgroundColor: "var(--pdp-surface-bg, #ffffff)",
1633
1374
  borderRadius: "var(--pdp-border-radius, 12px)",
1634
1375
  border: "1px solid var(--pdp-surface-border, #e2e8f0)",
1635
- boxShadow: K ? "0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3)" : "var(--pdp-shadow)",
1376
+ boxShadow: q ? "0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3)" : "var(--pdp-shadow)",
1636
1377
  width: "fit-content",
1637
1378
  userSelect: "none",
1638
1379
  display: "flex",
1639
- flexDirection: ie === "horizontal" ? "column" : "row",
1380
+ flexDirection: "column",
1640
1381
  gap: "12px",
1641
1382
  ...D?.calendar
1642
1383
  },
1643
- children: [
1644
- K && /* @__PURE__ */ l("button", {
1645
- type: "button",
1646
- "aria-label": "بستن",
1647
- onClick: () => G(!1),
1648
- style: {
1649
- position: "absolute",
1650
- top: "10px",
1651
- left: "10px",
1652
- background: "none",
1653
- border: "none",
1654
- cursor: "pointer",
1655
- fontSize: "16px",
1656
- color: "var(--pdp-text-muted, #94a3b8)",
1657
- lineHeight: 1,
1658
- zIndex: 10
1659
- },
1660
- children: "✕"
1661
- }),
1662
- ne && /* @__PURE__ */ l(he, {
1663
- presets: re,
1664
- orientation: ie,
1665
- digitType: y,
1666
- selectedValue: J,
1667
- onSelectPreset: Ue,
1668
- classNames: E,
1669
- styles: D
1670
- }),
1671
- /* @__PURE__ */ l("div", {
1672
- style: {
1673
- display: "flex",
1674
- flexDirection: "column",
1675
- gap: "8px"
1384
+ children: [q && /* @__PURE__ */ c("button", {
1385
+ type: "button",
1386
+ "aria-label": "بستن",
1387
+ onClick: () => K(!1),
1388
+ style: {
1389
+ position: "absolute",
1390
+ top: "10px",
1391
+ left: "10px",
1392
+ background: "none",
1393
+ border: "none",
1394
+ cursor: "pointer",
1395
+ fontSize: "16px",
1396
+ color: "var(--pdp-text-muted, #94a3b8)",
1397
+ lineHeight: 1,
1398
+ zIndex: 10
1399
+ },
1400
+ children: "✕"
1401
+ }), /* @__PURE__ */ c("div", {
1402
+ style: {
1403
+ display: "flex",
1404
+ flexDirection: "column",
1405
+ gap: "8px"
1406
+ },
1407
+ children: me ? /* @__PURE__ */ c(se, {
1408
+ currentYear: X,
1409
+ currentMonth: Z,
1410
+ onSelectMonth: (e) => {
1411
+ Q(X, e), ge(!1);
1676
1412
  },
1677
- children: ye ? /* @__PURE__ */ l(ce, {
1678
- currentYear: Y,
1679
- currentMonth: X,
1680
- onSelectMonth: (e) => Z(Y, e),
1681
- onSelectYear: (e) => Z(e, X),
1682
- onClose: () => xe(!1)
1683
- }) : /* @__PURE__ */ u(c, { children: [
1684
- /* @__PURE__ */ u("div", {
1685
- style: {
1686
- display: "flex",
1687
- gap: "16px",
1688
- alignItems: "flex-start"
1689
- },
1690
- children: [Ke(Y, X, je, !0, H === 1), H === 2 && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: {
1691
- width: "1px",
1692
- backgroundColor: "var(--pdp-surface-border, #e2e8f0)",
1693
- alignSelf: "stretch"
1694
- } }), Ke($.year, $.month, We, !1, !0)] })]
1695
- }),
1696
- P && /* @__PURE__ */ l(fe, {
1697
- value: q,
1698
- onChange: ke,
1699
- minuteStep: B,
1700
- hourStep: te,
1701
- showSeconds: V,
1702
- digitType: y,
1703
- classNames: E,
1704
- styles: D
1705
- }),
1706
- O && /* @__PURE__ */ l(de, {
1707
- mode: e,
1708
- digitType: y,
1709
- showStatusText: A,
1710
- showActions: j,
1711
- selectedDate: e === "single" ? J : null,
1712
- selectedRange: e === "range" ? J : void 0,
1713
- selectedDates: e === "multiple" ? J : void 0,
1714
- selectedTime: P ? q : void 0,
1715
- onToday: Pe,
1716
- onClear: Le,
1717
- onConfirm: () => {
1718
- _ !== "inline" && G(!1), N?.();
1719
- },
1720
- classNames: E,
1721
- styles: D
1722
- })
1723
- ] })
1724
- })
1725
- ]
1413
+ onSelectYear: (e) => Q(e, Z)
1414
+ }) : /* @__PURE__ */ l(s, { children: [
1415
+ /* @__PURE__ */ l("div", {
1416
+ style: {
1417
+ display: "flex",
1418
+ gap: "16px",
1419
+ alignItems: "flex-start"
1420
+ },
1421
+ children: [Ve(X, Z, Ee, !0, B === 1), B === 2 && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: {
1422
+ width: "1px",
1423
+ backgroundColor: "var(--pdp-surface-border, #e2e8f0)",
1424
+ alignSelf: "stretch"
1425
+ } }), Ve($.year, $.month, ze, !1, !0)] })]
1426
+ }),
1427
+ N && /* @__PURE__ */ c(le, {
1428
+ value: J,
1429
+ onChange: we,
1430
+ minuteStep: ne,
1431
+ hourStep: re,
1432
+ showSeconds: z,
1433
+ digitType: b,
1434
+ classNames: E,
1435
+ styles: D
1436
+ }),
1437
+ k && /* @__PURE__ */ c(ce, {
1438
+ mode: e,
1439
+ digitType: b,
1440
+ showStatusText: A,
1441
+ showActions: M,
1442
+ selectedDate: e === "single" ? Y : null,
1443
+ selectedRange: e === "range" ? Y : void 0,
1444
+ selectedDates: e === "multiple" ? Y : void 0,
1445
+ selectedTime: N ? J : void 0,
1446
+ onToday: ke,
1447
+ onClear: Ne,
1448
+ onConfirm: () => {
1449
+ _ !== "inline" && K(!1), ee?.();
1450
+ },
1451
+ classNames: E,
1452
+ styles: D
1453
+ })
1454
+ ] })
1455
+ })]
1726
1456
  });
1727
- return /* @__PURE__ */ u("div", {
1728
- ref: Se,
1729
- className: x ?? E?.root,
1457
+ return /* @__PURE__ */ l("div", {
1458
+ ref: _e,
1459
+ className: w ?? E?.root,
1730
1460
  style: {
1731
1461
  position: "relative",
1732
1462
  display: "inline-block",
1733
1463
  ...T,
1734
1464
  ...D?.root
1735
1465
  },
1736
- children: [_ !== "inline" && (le && e === "single" && _ === "popover" ? /* @__PURE__ */ l(_e, {
1737
- value: Re,
1738
- digitType: y,
1466
+ children: [_ !== "inline" && (ie && e === "single" && _ === "popover" ? /* @__PURE__ */ c(fe, {
1467
+ value: Pe,
1468
+ digitType: b,
1739
1469
  placeholder: v,
1740
1470
  onChange: (e) => {
1741
- e ? (Q(e), Z(e.year, e.month)) : Le();
1471
+ e ? (Ae(e), Q(e.year, e.month)) : Ne();
1742
1472
  },
1743
- onClick: () => G(!0),
1473
+ onClick: () => K(!0),
1744
1474
  className: E?.input,
1745
1475
  style: D?.input
1746
- }) : /* @__PURE__ */ l("input", {
1476
+ }) : /* @__PURE__ */ c("input", {
1747
1477
  type: "text",
1748
1478
  readOnly: !0,
1749
1479
  placeholder: v,
1750
- value: Ge,
1751
- onClick: () => G(!0),
1480
+ value: Be,
1481
+ onClick: () => K(!0),
1752
1482
  className: E?.input,
1753
1483
  style: {
1754
1484
  padding: "8px 12px",
@@ -1760,12 +1490,12 @@ function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
1760
1490
  textAlign: "right",
1761
1491
  direction: "rtl",
1762
1492
  fontSize: "14px",
1763
- minWidth: P ? "200px" : H === 2 ? "240px" : "150px",
1493
+ minWidth: N ? "200px" : B === 2 ? "240px" : "150px",
1764
1494
  ...D?.input
1765
1495
  }
1766
- })), W && (K ? /* @__PURE__ */ l("div", {
1496
+ })), G && (q ? /* @__PURE__ */ c("div", {
1767
1497
  role: "presentation",
1768
- onClick: () => G(!1),
1498
+ onClick: () => K(!1),
1769
1499
  className: E?.modalBackdrop,
1770
1500
  style: {
1771
1501
  position: "fixed",
@@ -1783,26 +1513,26 @@ function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
1783
1513
  direction: "rtl",
1784
1514
  ...D?.modalBackdrop
1785
1515
  },
1786
- children: qe
1787
- }) : qe)]
1516
+ children: He
1517
+ }) : He)]
1788
1518
  });
1789
1519
  }
1790
1520
  //#endregion
1791
1521
  //#region src/components/dual-calendar/DualMonthCalendar.tsx
1792
- var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDate: i, firstDayOfWeek: o = 0, digitType: c = "persian", minDate: f, maxDate: p, isDateDisabled: m }) => {
1793
- let [h, g] = s(t), _ = e === void 0 ? h : e, [v, x] = s(null), C = a(() => y(), []), [w, T] = s(() => i || (_[0] ? {
1522
+ var _e = ({ value: e, defaultValue: n = [null, null], onChange: r, initialViewDate: a, firstDayOfWeek: s = 0, digitType: d = "persian", minDate: f, maxDate: p, isDateDisabled: m }) => {
1523
+ let [h, g] = o(n), _ = e === void 0 ? h : e, [b, S] = o(null), C = i(() => v(), []), [w, T] = o(() => a || (_[0] ? {
1794
1524
  year: _[0].year,
1795
1525
  month: _[0].month
1796
1526
  } : {
1797
1527
  year: C.year,
1798
1528
  month: C.month
1799
- })), E = a(() => w.month === 11 ? {
1529
+ })), E = i(() => w.month === 11 ? {
1800
1530
  year: w.year + 1,
1801
1531
  month: 0
1802
1532
  } : {
1803
1533
  year: w.year,
1804
1534
  month: w.month + 1
1805
- }, [w]), D = () => {
1535
+ }, [w]), k = () => {
1806
1536
  T((e) => e.month === 0 ? {
1807
1537
  year: e.year - 1,
1808
1538
  month: 11
@@ -1818,25 +1548,25 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1818
1548
  year: e.year,
1819
1549
  month: e.month + 1
1820
1550
  });
1821
- }, j = n((t) => {
1551
+ }, j = t((t) => {
1822
1552
  let [n, i] = _, a;
1823
- !n || n && i ? a = [t, null] : (a = O(t, n) < 0 ? [t, n] : [n, t], x(null)), e === void 0 && g(a), r?.(a);
1553
+ !n || n && i ? a = [t, null] : (a = D(t, n) < 0 ? [t, n] : [n, t], S(null)), e === void 0 && g(a), r?.(a);
1824
1554
  }, [
1825
1555
  _,
1826
1556
  e,
1827
1557
  r
1828
- ]), M = n((e, t) => {
1829
- let n = S({
1558
+ ]), M = t((e, t) => {
1559
+ let n = x({
1830
1560
  year: e,
1831
1561
  month: t,
1832
- firstDayOfWeek: o,
1562
+ firstDayOfWeek: s,
1833
1563
  minDate: f,
1834
1564
  maxDate: p,
1835
1565
  isDateDisabled: m
1836
- }), [r, i] = _, a = i ?? (r && v ? v : null);
1566
+ }), [r, i] = _, a = i ?? (r && b ? b : null);
1837
1567
  return n.map((e) => {
1838
- let t = r ? b(e.jalali, r) : !1, n = a ? b(e.jalali, a) : !1, i = !1;
1839
- return r && a && (i = k(e.jalali, r, a)), {
1568
+ let t = r ? y(e.jalali, r) : !1, n = a ? y(e.jalali, a) : !1, i = !1;
1569
+ return r && a && (i = O(e.jalali, r, a)), {
1840
1570
  ...e,
1841
1571
  isSelected: t || n,
1842
1572
  isInRange: i,
@@ -1845,21 +1575,21 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1845
1575
  };
1846
1576
  });
1847
1577
  }, [
1848
- o,
1578
+ s,
1849
1579
  f,
1850
1580
  p,
1851
1581
  m,
1852
1582
  _,
1853
- v
1854
- ]), N = a(() => M(w.year, w.month), [
1583
+ b
1584
+ ]), ee = i(() => M(w.year, w.month), [
1855
1585
  M,
1856
1586
  w.year,
1857
1587
  w.month
1858
- ]), P = a(() => M(E.year, E.month), [
1588
+ ]), te = i(() => M(E.year, E.month), [
1859
1589
  M,
1860
1590
  E.year,
1861
1591
  E.month
1862
- ]), F = (e, t, n, r) => /* @__PURE__ */ u("div", {
1592
+ ]), N = (e, t, n, r) => /* @__PURE__ */ l("div", {
1863
1593
  style: {
1864
1594
  display: "flex",
1865
1595
  flexDirection: "column",
@@ -1867,7 +1597,7 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1867
1597
  minWidth: "270px"
1868
1598
  },
1869
1599
  children: [
1870
- /* @__PURE__ */ u("div", {
1600
+ /* @__PURE__ */ l("div", {
1871
1601
  style: {
1872
1602
  display: "flex",
1873
1603
  alignItems: "center",
@@ -1876,10 +1606,10 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1876
1606
  height: "32px"
1877
1607
  },
1878
1608
  children: [
1879
- r ? /* @__PURE__ */ l("button", {
1609
+ r ? /* @__PURE__ */ c("button", {
1880
1610
  type: "button",
1881
1611
  "aria-label": "ماه قبل",
1882
- onClick: D,
1612
+ onClick: k,
1883
1613
  style: {
1884
1614
  width: "28px",
1885
1615
  height: "28px",
@@ -1890,20 +1620,20 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1890
1620
  cursor: "pointer"
1891
1621
  },
1892
1622
  children: "›"
1893
- }) : /* @__PURE__ */ l("div", { style: { width: "28px" } }),
1894
- /* @__PURE__ */ u("div", {
1623
+ }) : /* @__PURE__ */ c("div", { style: { width: "28px" } }),
1624
+ /* @__PURE__ */ l("div", {
1895
1625
  style: {
1896
1626
  fontWeight: 600,
1897
1627
  fontSize: "14px",
1898
1628
  color: "var(--pdp-text-primary, #0f172a)"
1899
1629
  },
1900
1630
  children: [
1901
- d[t],
1631
+ u[t],
1902
1632
  " ",
1903
- L(e)
1633
+ F(e)
1904
1634
  ]
1905
1635
  }),
1906
- r ? /* @__PURE__ */ l("div", { style: { width: "28px" } }) : /* @__PURE__ */ l("button", {
1636
+ r ? /* @__PURE__ */ c("div", { style: { width: "28px" } }) : /* @__PURE__ */ c("button", {
1907
1637
  type: "button",
1908
1638
  "aria-label": "ماه بعد",
1909
1639
  onClick: A,
@@ -1920,26 +1650,26 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1920
1650
  })
1921
1651
  ]
1922
1652
  }),
1923
- /* @__PURE__ */ l(oe, { firstDayOfWeek: o }),
1924
- /* @__PURE__ */ l("div", {
1653
+ /* @__PURE__ */ c(oe, { firstDayOfWeek: s }),
1654
+ /* @__PURE__ */ c("div", {
1925
1655
  role: "grid",
1926
- "aria-label": `${d[t]} ${L(e)}`,
1656
+ "aria-label": `${u[t]} ${F(e)}`,
1927
1657
  style: {
1928
1658
  display: "grid",
1929
1659
  gridTemplateColumns: "repeat(7, var(--pdp-cell-size, 36px))",
1930
1660
  gap: "4px"
1931
1661
  },
1932
- children: n.map((e, t) => /* @__PURE__ */ l(se, {
1662
+ children: n.map((e, t) => /* @__PURE__ */ c(V, {
1933
1663
  cell: e,
1934
- digitType: c,
1664
+ digitType: d,
1935
1665
  tabIndex: 0,
1936
1666
  onSelect: j,
1937
- onHover: x
1667
+ onHover: S
1938
1668
  }, t))
1939
1669
  })
1940
1670
  ]
1941
1671
  });
1942
- return /* @__PURE__ */ u("div", {
1672
+ return /* @__PURE__ */ l("div", {
1943
1673
  role: "region",
1944
1674
  "aria-label": "تقویم دوقلو شمسی",
1945
1675
  style: {
@@ -1955,16 +1685,16 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1955
1685
  direction: "rtl"
1956
1686
  },
1957
1687
  children: [
1958
- F(w.year, w.month, N, !0),
1959
- /* @__PURE__ */ l("div", { style: {
1688
+ N(w.year, w.month, ee, !0),
1689
+ /* @__PURE__ */ c("div", { style: {
1960
1690
  width: "1px",
1961
1691
  backgroundColor: "var(--pdp-surface-border, #e2e8f0)"
1962
1692
  } }),
1963
- F(E.year, E.month, P, !1)
1693
+ N(E.year, E.month, te, !1)
1964
1694
  ]
1965
1695
  });
1966
1696
  };
1967
1697
  //#endregion
1968
- export { me as DEFAULT_DATE_PICKER_PRESETS, re as DatePickerThemeProvider, se as DayCell, Se as DualMonthCalendar, ae as Header, f as JALALI_MONTH_NAMES_EN, xe as JalaliDatePicker, _e as MaskedDateInput, ce as MonthYearPicker, d as PERSIAN_MONTH_NAMES, m as PERSIAN_WEEK_DAYS_LONG, p as PERSIAN_WEEK_DAYS_SHORT, he as PresetsBar, fe as TimePicker, oe as Weekdays, E as addDaysToJalali, D as addJalaliDays, ge as applyDateMask, N as calculateNextFocusedDate, le as clampTime, O as compareJalaliDates, te as darkThemeTokens, z as formatJalaliDate, H as formatTimeSegment, ue as formatTimeString, S as generateJalaliCalendarGrid, P as getAriaDayLabel, U as getCurrentTime, g as getDaysInJalaliMonth, pe as getDefaultJalaliPresets, ve as getEventsForDate, T as getJalaliDayOfWeek, j as getJalaliMonthRange, A as getJalaliWeekRange, y as getTodayJalali, _ as gregorianToJalali, k as isJalaliDateBetween, h as isJalaliLeapYear, b as isSameJalaliDay, v as jalaliToGregorian, w as jalaliToJsDate, C as jsDateToJalali, B as lightThemeTokens, W as parseAndValidateJalaliString, x as toJalaliDate, R as toLatinDigits, L as toPersianDigits, V as tokensToCssVariables, F as useCalendarKeyboard, ie as useDatePickerTheme, M as useJalaliDatePicker };
1698
+ export { ie as DatePickerThemeProvider, V as DayCell, _e as DualMonthCalendar, ae as Header, d as JALALI_MONTH_NAMES_EN, ge as JalaliDatePicker, fe as MaskedDateInput, se as MonthYearPicker, u as PERSIAN_MONTH_NAMES, p as PERSIAN_WEEK_DAYS_LONG, f as PERSIAN_WEEK_DAYS_SHORT, le as TimePicker, oe as Weekdays, T as addDaysToJalali, E as addJalaliDays, W as applyDateMask, M as calculateNextFocusedDate, ue as clampTime, D as compareJalaliDates, ne as darkTheme, L as formatJalaliDate, H as formatTimeSegment, de as formatTimeString, x as generateJalaliCalendarGrid, ee as getAriaDayLabel, U as getCurrentTime, h as getDaysInJalaliMonth, pe as getEventsForDate, w as getJalaliDayOfWeek, A as getJalaliMonthRange, k as getJalaliWeekRange, v as getTodayJalali, g as gregorianToJalali, O as isJalaliDateBetween, m as isJalaliLeapYear, y as isSameJalaliDay, _ as jalaliToGregorian, C as jalaliToJsDate, S as jsDateToJalali, R as lightTheme, G as parseAndValidateJalaliString, b as toJalaliDate, I as toLatinDigits, F as toPersianDigits, re as tokensToCssVariables, te as useCalendarKeyboard, j as useJalaliDatePicker, B as useTheme };
1969
1699
 
1970
1700
  //# sourceMappingURL=index.mjs.map