@mngh/jalali-datepicker 1.0.1 → 1.0.3

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 +812 -1091
  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 -7
  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,161 +448,236 @@ 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"
504
- };
505
- function V(e) {
506
- let t = {};
507
- for (let [n, r] of Object.entries(e)) if (r !== void 0) {
508
- let e = `--pdp-${n.replace(/([A-Z])/g, "-$1").toLowerCase()}`;
509
- t[e] = r;
466
+ var R = {
467
+ mode: "light",
468
+ colors: {
469
+ primary: "#4f46e5",
470
+ primaryHover: "#4338ca",
471
+ primaryText: "#ffffff",
472
+ background: "#ffffff",
473
+ backgroundHover: "#f8fafc",
474
+ surface: "#f1f5f9",
475
+ border: "#e2e8f0",
476
+ textPrimary: "#0f172a",
477
+ textSecondary: "#64748b",
478
+ textDisabled: "#cbd5e1",
479
+ holiday: "#e11d48",
480
+ holidayBackground: "#fff1f2",
481
+ rangeBackground: "#e0e7ff",
482
+ todayBorder: "#4f46e5"
483
+ },
484
+ radii: {
485
+ sm: "6px",
486
+ md: "10px",
487
+ lg: "14px",
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.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04)",
493
+ lg: "0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03)"
510
494
  }
511
- return t;
512
- }
513
- //#endregion
514
- //#region src/theme/ThemeProvider.tsx
515
- var ne = t({
516
- tokens: B,
495
+ }, z = {
496
+ mode: "dark",
497
+ colors: {
498
+ primary: "#6366f1",
499
+ primaryHover: "#4f46e5",
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: "#fb7185",
509
+ holidayBackground: "#4c0519",
510
+ rangeBackground: "#312e81",
511
+ todayBorder: "#818cf8"
512
+ },
513
+ radii: {
514
+ sm: "6px",
515
+ md: "10px",
516
+ lg: "14px",
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
+ }
524
+ }, ne = e({
525
+ theme: R,
517
526
  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
527
+ }), B = () => n(ne) || {
528
+ theme: R,
529
+ mode: "light"
530
+ }, V = ({ children: e, mode: t = "light", customTheme: n }) => {
531
+ let r = t === "dark" ? z : R, a = i(() => n ? {
532
+ mode: t,
533
+ theme: {
534
+ ...r,
535
+ ...n,
536
+ mode: t,
537
+ colors: {
538
+ ...r.colors,
539
+ ...n.colors || {}
540
+ },
541
+ radii: {
542
+ ...r.radii,
543
+ ...n.radii || {}
535
544
  },
536
- children: n
537
- })
545
+ shadows: {
546
+ ...r.shadows,
547
+ ...n.shadows || {}
548
+ }
549
+ }
550
+ } : {
551
+ theme: r,
552
+ mode: t
553
+ }, [
554
+ r,
555
+ n,
556
+ t
557
+ ]);
558
+ return /* @__PURE__ */ c(ne.Provider, {
559
+ value: a,
560
+ children: e
538
561
  });
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: {
562
+ }, re = ({ year: e, monthName: t, onPrevMonth: n, onNextMonth: r, onTitleClick: i, isPickerOpen: a }) => {
563
+ let { theme: o } = B(), s = {
564
+ background: "transparent",
565
+ border: "none",
566
+ cursor: "pointer",
567
+ padding: "6px",
568
+ borderRadius: o.radii.md,
542
569
  display: "flex",
543
570
  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)];
571
+ justifyContent: "center",
572
+ color: o.colors.textPrimary,
573
+ transition: "all 0.15s cubic-bezier(0.4, 0, 0.2, 1)"
574
+ };
605
575
  return /* @__PURE__ */ l("div", {
576
+ style: {
577
+ display: "flex",
578
+ alignItems: "center",
579
+ justifyContent: "space-between",
580
+ padding: "8px 12px",
581
+ borderBottom: `1px solid ${o.colors.border}`,
582
+ userSelect: "none",
583
+ height: "42px",
584
+ boxSizing: "border-box"
585
+ },
586
+ children: [
587
+ /* @__PURE__ */ c("button", {
588
+ type: "button",
589
+ onClick: n,
590
+ "aria-label": "ماه قبل",
591
+ style: s,
592
+ onMouseEnter: (e) => {
593
+ e.currentTarget.style.backgroundColor = o.colors.backgroundHover, e.currentTarget.style.transform = "scale(1.1)";
594
+ },
595
+ onMouseLeave: (e) => {
596
+ e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.transform = "scale(1)";
597
+ },
598
+ children: /* @__PURE__ */ c("svg", {
599
+ width: "18",
600
+ height: "18",
601
+ viewBox: "0 0 24 24",
602
+ fill: "none",
603
+ stroke: "currentColor",
604
+ strokeWidth: "2.2",
605
+ strokeLinecap: "round",
606
+ strokeLinejoin: "round",
607
+ children: /* @__PURE__ */ c("polyline", { points: "9 18 15 12 9 6" })
608
+ })
609
+ }),
610
+ /* @__PURE__ */ l("button", {
611
+ type: "button",
612
+ onClick: i,
613
+ style: {
614
+ background: a ? o.colors.backgroundHover : "transparent",
615
+ border: "none",
616
+ cursor: "pointer",
617
+ padding: "6px 10px",
618
+ borderRadius: o.radii.md,
619
+ fontSize: "0.9rem",
620
+ fontWeight: 700,
621
+ color: o.colors.textPrimary,
622
+ display: "flex",
623
+ alignItems: "center",
624
+ gap: "6px",
625
+ transition: "all 0.15s ease"
626
+ },
627
+ onMouseEnter: (e) => {
628
+ e.currentTarget.style.backgroundColor = o.colors.backgroundHover;
629
+ },
630
+ onMouseLeave: (e) => {
631
+ a || (e.currentTarget.style.backgroundColor = "transparent");
632
+ },
633
+ children: [/* @__PURE__ */ l("span", { children: [
634
+ t,
635
+ " ",
636
+ F(e)
637
+ ] }), /* @__PURE__ */ c("svg", {
638
+ width: "14",
639
+ height: "14",
640
+ viewBox: "0 0 24 24",
641
+ fill: "none",
642
+ stroke: "currentColor",
643
+ strokeWidth: "2.2",
644
+ strokeLinecap: "round",
645
+ strokeLinejoin: "round",
646
+ style: {
647
+ transform: a ? "rotate(180deg)" : "rotate(0deg)",
648
+ transition: "transform 0.2s cubic-bezier(0.4, 0, 0.2, 1)"
649
+ },
650
+ children: /* @__PURE__ */ c("polyline", { points: "6 9 12 15 18 9" })
651
+ })]
652
+ }),
653
+ /* @__PURE__ */ c("button", {
654
+ type: "button",
655
+ onClick: r,
656
+ "aria-label": "ماه بعد",
657
+ style: s,
658
+ onMouseEnter: (e) => {
659
+ e.currentTarget.style.backgroundColor = o.colors.backgroundHover, e.currentTarget.style.transform = "scale(1.1)";
660
+ },
661
+ onMouseLeave: (e) => {
662
+ e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.transform = "scale(1)";
663
+ },
664
+ children: /* @__PURE__ */ c("svg", {
665
+ width: "18",
666
+ height: "18",
667
+ viewBox: "0 0 24 24",
668
+ fill: "none",
669
+ stroke: "currentColor",
670
+ strokeWidth: "2.2",
671
+ strokeLinecap: "round",
672
+ strokeLinejoin: "round",
673
+ children: /* @__PURE__ */ c("polyline", { points: "15 18 9 12 15 6" })
674
+ })
675
+ })
676
+ ]
677
+ });
678
+ }, ie = ({ firstDayOfWeek: e = 0, classNames: t, styles: n }) => {
679
+ let r = [...f.slice(e), ...f.slice(0, e)];
680
+ return /* @__PURE__ */ c("div", {
606
681
  role: "row",
607
682
  "aria-label": "روزهای هفته",
608
683
  className: t?.weekdays,
@@ -614,7 +689,7 @@ var ne = t({
614
689
  textAlign: "center",
615
690
  ...n?.weekdays
616
691
  },
617
- children: r.map((e, r) => /* @__PURE__ */ l("div", {
692
+ children: r.map((e, r) => /* @__PURE__ */ c("div", {
618
693
  role: "columnheader",
619
694
  className: t?.weekdayCell,
620
695
  style: {
@@ -627,651 +702,316 @@ var ne = t({
627
702
  children: e
628
703
  }, r))
629
704
  });
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", {
705
+ }, ae = (e) => {
706
+ let { theme: t } = B(), n = e.cell, r = n?.jalali ?? {
707
+ year: 1403,
708
+ month: 1,
709
+ day: e.day ?? (n && "day" in n ? n.day : 1)
710
+ }, 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;
711
+ u && a && (m = t.colors.rangeBackground, h = t.colors.primary), o || d || f ? (m = t.colors.primary, h = t.colors.primaryText) : l && a && (h = t.colors.holiday);
712
+ let g = t.radii.md;
713
+ return d ? g = `${t.radii.md} 0 0 ${t.radii.md}` : f ? g = `0 ${t.radii.md} ${t.radii.md} 0` : u && (g = "0px"), /* @__PURE__ */ c("button", {
714
+ type: "button",
715
+ tabIndex: e.tabIndex ?? 0,
716
+ disabled: p || !a,
717
+ onClick: () => {
718
+ p || !a || (e.onClick && e.onClick(), e.onSelect && e.onSelect(r));
719
+ },
720
+ onFocus: () => e.onFocus?.(r),
668
721
  style: {
669
- position: "relative",
670
- display: "inline-flex"
722
+ width: "36px",
723
+ height: "36px",
724
+ display: "flex",
725
+ alignItems: "center",
726
+ justifyContent: "center",
727
+ border: s && !o && !d && !f ? `1.5px solid ${t.colors.todayBorder}` : "none",
728
+ borderRadius: g,
729
+ backgroundColor: m,
730
+ color: h,
731
+ cursor: p || !a ? "default" : "pointer",
732
+ fontSize: "0.875rem",
733
+ fontWeight: o || s || d || f ? 700 : 500,
734
+ transition: "all 0.15s cubic-bezier(0.4, 0, 0.2, 1)",
735
+ opacity: a ? 1 : .3,
736
+ outline: "none",
737
+ ...e.styles?.dayCell
671
738
  },
672
- onMouseEnter: () => {
673
- C(!0), v || f?.(m);
739
+ onMouseEnter: (n) => {
740
+ 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
741
  },
675
- onMouseLeave: () => {
676
- C(!1), f?.(null);
742
+ onMouseLeave: (e) => {
743
+ !o && !d && !f && (e.currentTarget.style.backgroundColor = u ? t.colors.rangeBackground : "transparent", e.currentTarget.style.transform = "scale(1)");
677
744
  },
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
- })]
745
+ children: e.digitType === "latin" ? i : F(i)
770
746
  });
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", {
747
+ }, oe = ({ currentYear: e, currentMonth: t, onSelectMonth: n, onSelectYear: i }) => {
748
+ let { theme: o } = B(), s = a(null);
749
+ return r(() => {
750
+ s.current && s.current.scrollIntoView({
751
+ behavior: "smooth",
752
+ inline: "center",
753
+ block: "nearest"
754
+ });
755
+ }, [e]), /* @__PURE__ */ l("div", {
774
756
  style: {
775
- padding: "8px",
776
- backgroundColor: "var(--pdp-surface-bg, #ffffff)",
777
- borderRadius: "var(--pdp-border-radius, 8px)"
757
+ display: "flex",
758
+ flexDirection: "column",
759
+ gap: "10px",
760
+ padding: "12px",
761
+ width: "100%",
762
+ height: "280px",
763
+ boxSizing: "border-box",
764
+ justifyContent: "space-between"
778
765
  },
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", {
766
+ children: [/* @__PURE__ */ c("div", {
767
+ style: {
768
+ display: "flex",
769
+ gap: "6px",
770
+ overflowX: "auto",
771
+ paddingBottom: "4px",
772
+ scrollbarWidth: "none"
773
+ },
774
+ children: Array.from({ length: 35 }, (t, n) => e - 17 + n).map((t) => {
775
+ let n = t === e;
776
+ return /* @__PURE__ */ c("button", {
777
+ ref: n ? s : void 0,
850
778
  type: "button",
851
- onClick: () => {
852
- n(r), i();
853
- },
779
+ onClick: () => i(t),
854
780
  style: {
855
- padding: "8px 4px",
856
- borderRadius: "6px",
781
+ padding: "6px 12px",
782
+ borderRadius: o.radii.md,
857
783
  border: "none",
784
+ background: n ? o.colors.primary : "transparent",
785
+ color: n ? o.colors.primaryText : o.colors.textPrimary,
858
786
  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"
787
+ fontWeight: n ? 700 : 500,
788
+ fontSize: "0.85rem",
789
+ whiteSpace: "nowrap",
790
+ transition: "all 0.15s ease",
791
+ flexShrink: 0
862
792
  },
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");
793
+ onMouseEnter: (e) => {
794
+ n || (e.currentTarget.style.backgroundColor = o.colors.backgroundHover);
876
795
  },
796
+ onMouseLeave: (e) => {
797
+ n || (e.currentTarget.style.backgroundColor = "transparent");
798
+ },
799
+ children: F(t)
800
+ }, t);
801
+ })
802
+ }), /* @__PURE__ */ c("div", {
803
+ style: {
804
+ display: "grid",
805
+ gridTemplateColumns: "repeat(3, 1fr)",
806
+ gridTemplateRows: "repeat(4, 1fr)",
807
+ gap: "8px",
808
+ flex: 1
809
+ },
810
+ children: u.map((e, r) => {
811
+ let i = r + 1 === t;
812
+ return /* @__PURE__ */ c("button", {
813
+ type: "button",
814
+ onClick: () => n(r + 1),
877
815
  style: {
878
- padding: "8px 4px",
879
- borderRadius: "6px",
816
+ borderRadius: o.radii.md,
880
817
  border: "none",
818
+ background: i ? o.colors.primary : o.colors.surface,
819
+ color: i ? o.colors.primaryText : o.colors.textPrimary,
881
820
  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"
821
+ fontWeight: i ? 700 : 500,
822
+ fontSize: "0.85rem",
823
+ display: "flex",
824
+ alignItems: "center",
825
+ justifyContent: "center",
826
+ transition: "all 0.15s ease"
885
827
  },
886
- children: L(t)
887
- }, t))
828
+ onMouseEnter: (e) => {
829
+ i || (e.currentTarget.style.backgroundColor = o.colors.backgroundHover, e.currentTarget.style.transform = "translateY(-1px)");
830
+ },
831
+ onMouseLeave: (e) => {
832
+ i || (e.currentTarget.style.backgroundColor = o.colors.surface, e.currentTarget.style.transform = "translateY(0)");
833
+ },
834
+ children: e
835
+ }, e);
888
836
  })
889
- ]
837
+ })]
890
838
  });
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;
839
+ }, se = ({ onTodayClick: e, onClearClick: t, showClear: n = !0 }) => {
840
+ let { theme: r } = B(), i = {
841
+ padding: "6px 14px",
842
+ borderRadius: r.radii.md,
843
+ border: `1px solid ${r.colors.border}`,
844
+ background: "transparent",
845
+ color: r.colors.textPrimary,
846
+ fontSize: "0.8rem",
847
+ fontWeight: 600,
848
+ cursor: "pointer",
849
+ transition: "all 0.15s ease"
929
850
  };
930
- return /* @__PURE__ */ u("div", {
931
- className: p?.footer,
851
+ return /* @__PURE__ */ l("div", {
932
852
  style: {
933
- marginTop: "8px",
934
- paddingTop: "8px",
935
- borderTop: "1px solid var(--pdp-surface-border, #e2e8f0)",
936
853
  display: "flex",
937
- flexDirection: "column",
938
- gap: "6px",
939
- ...m?.footer
854
+ alignItems: "center",
855
+ justifyContent: "space-between",
856
+ padding: "10px 12px",
857
+ borderTop: `1px solid ${r.colors.border}`,
858
+ marginTop: "6px"
940
859
  },
941
- children: [o && /* @__PURE__ */ l("div", {
942
- "aria-live": "polite",
860
+ children: [e && /* @__PURE__ */ c("button", {
861
+ type: "button",
862
+ onClick: e,
943
863
  style: {
944
- fontSize: "12px",
945
- color: "var(--pdp-text-secondary, #475569)",
946
- textAlign: "center",
947
- minHeight: "18px",
948
- fontWeight: 500
864
+ ...i,
865
+ borderColor: r.colors.primary,
866
+ color: r.colors.primary
949
867
  },
950
- children: h()
951
- }), s && /* @__PURE__ */ u("div", {
952
- style: {
953
- display: "flex",
954
- justifyContent: "space-between",
955
- alignItems: "center",
956
- gap: "8px"
868
+ onMouseEnter: (e) => {
869
+ e.currentTarget.style.backgroundColor = r.colors.backgroundHover;
957
870
  },
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
- })]
871
+ onMouseLeave: (e) => {
872
+ e.currentTarget.style.backgroundColor = "transparent";
873
+ },
874
+ children: "برو به امروز"
875
+ }), n && t && /* @__PURE__ */ c("button", {
876
+ type: "button",
877
+ onClick: t,
878
+ style: i,
879
+ onMouseEnter: (e) => {
880
+ e.currentTarget.style.backgroundColor = r.colors.backgroundHover, e.currentTarget.style.color = r.colors.holiday;
881
+ },
882
+ onMouseLeave: (e) => {
883
+ e.currentTarget.style.backgroundColor = "transparent", e.currentTarget.style.color = r.colors.textPrimary;
884
+ },
885
+ children: "پاک کردن"
1005
886
  })]
1006
887
  });
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
888
+ }, ce = ({ 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 }) => {
889
+ let { theme: m } = B(), h = (e) => {
890
+ p({
891
+ hour: parseInt(e.target.value, 10),
892
+ minute: a,
893
+ second: o
1016
894
  });
1017
- }, b = (e) => {
1018
- let t = (_.minute + e * a + 60) % 60;
1019
- v({
1020
- ..._,
1021
- minute: t
895
+ }, g = (e) => {
896
+ p({
897
+ hour: i,
898
+ minute: parseInt(e.target.value, 10),
899
+ second: o
1022
900
  });
1023
- }, x = (e) => {
1024
- if (!s) return;
1025
- let t = ((_.second ?? 0) + e + 60) % 60;
1026
- v({
1027
- ..._,
1028
- second: t
901
+ }, _ = (e) => {
902
+ p({
903
+ hour: i,
904
+ minute: a,
905
+ second: parseInt(e.target.value, 10)
1029
906
  });
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",
907
+ }, v = {
908
+ background: m.colors.surface,
909
+ color: m.colors.textPrimary,
910
+ border: `1px solid ${m.colors.border}`,
911
+ borderRadius: m.radii.sm,
912
+ padding: "4px 6px",
913
+ fontSize: "0.85rem",
1045
914
  fontWeight: 600,
1046
- color: "var(--pdp-text-primary, #0f172a)",
1047
- minWidth: "24px",
1048
- textAlign: "center"
915
+ outline: "none",
916
+ cursor: "pointer",
917
+ direction: "ltr"
1049
918
  };
1050
- return /* @__PURE__ */ u("div", {
1051
- role: "group",
1052
- "aria-label": "Time Selection",
1053
- className: m?.timePicker,
919
+ return /* @__PURE__ */ l("div", {
1054
920
  style: {
1055
921
  display: "flex",
1056
922
  alignItems: "center",
1057
923
  justifyContent: "center",
1058
924
  gap: "6px",
1059
925
  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
926
+ borderTop: `1px solid ${m.colors.border}`,
927
+ direction: "ltr"
1065
928
  },
1066
929
  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
- ]
930
+ /* @__PURE__ */ c("span", {
931
+ style: {
932
+ fontSize: "0.8rem",
933
+ color: m.colors.textSecondary,
934
+ marginRight: "4px"
935
+ },
936
+ children: "زمان:"
937
+ }),
938
+ /* @__PURE__ */ c("select", {
939
+ value: i,
940
+ onChange: h,
941
+ style: v,
942
+ children: Array.from({ length: Math.ceil(24 / d) }, (e, t) => t * d).map((e) => /* @__PURE__ */ c("option", {
943
+ value: e,
944
+ children: String(e).padStart(2, "0")
945
+ }, e))
1091
946
  }),
1092
- /* @__PURE__ */ l("span", {
947
+ /* @__PURE__ */ c("span", {
1093
948
  style: {
1094
- fontWeight: 700,
1095
- color: "var(--pdp-text-secondary, #475569)"
949
+ color: m.colors.textSecondary,
950
+ fontWeight: 700
1096
951
  },
1097
952
  children: ":"
1098
953
  }),
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
- ]
954
+ /* @__PURE__ */ c("select", {
955
+ value: a,
956
+ onChange: g,
957
+ style: v,
958
+ children: Array.from({ length: Math.ceil(60 / u) }, (e, t) => t * u).map((e) => /* @__PURE__ */ c("option", {
959
+ value: e,
960
+ children: String(e).padStart(2, "0")
961
+ }, e))
1123
962
  }),
1124
- s && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("span", {
963
+ f && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
1125
964
  style: {
1126
- fontWeight: 700,
1127
- color: "var(--pdp-text-secondary, #475569)"
965
+ color: m.colors.textSecondary,
966
+ fontWeight: 700
1128
967
  },
1129
968
  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
- ]
969
+ }), /* @__PURE__ */ c("select", {
970
+ value: o,
971
+ onChange: _,
972
+ style: v,
973
+ children: Array.from({ length: 60 }, (e, t) => /* @__PURE__ */ c("option", {
974
+ value: t,
975
+ children: String(t).padStart(2, "0")
976
+ }, t))
1154
977
  })] })
1155
978
  ]
1156
979
  });
1157
980
  };
1158
981
  //#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
- ];
982
+ //#region src/plugins/time-picker/time-utils.ts
983
+ function H(e, t = "persian") {
984
+ let n = e < 10 ? `0${e}` : `${e}`;
985
+ return t === "persian" ? F(n) : n;
1213
986
  }
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
987
+ function U() {
988
+ let e = /* @__PURE__ */ new Date();
989
+ return {
990
+ hour: e.getHours(),
991
+ minute: e.getMinutes(),
992
+ second: e.getSeconds()
1237
993
  };
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
- };
994
+ }
995
+ function le(e) {
996
+ return {
997
+ hour: Math.max(0, Math.min(23, e.hour)),
998
+ minute: Math.max(0, Math.min(59, e.minute)),
999
+ second: e.second === void 0 ? void 0 : Math.max(0, Math.min(59, e.second))
1000
+ };
1001
+ }
1002
+ function ue(e, t = !1, n = "persian") {
1003
+ if (!e) return "";
1004
+ let r = H(e.hour, n), i = H(e.minute, n);
1005
+ return t && e.second !== void 0 ? `${r}:${i}:${H(e.second, n)}` : `${r}:${i}`;
1006
+ }
1267
1007
  //#endregion
1268
1008
  //#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;
1009
+ function W(e, t = "persian") {
1010
+ let n = I(e).replace(/\D/g, "").slice(0, 8), r = "";
1011
+ 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
1012
  }
1273
- function W(e, t, n, r) {
1274
- let i = R(e).trim();
1013
+ function de(e, t, n, r) {
1014
+ let i = I(e).trim();
1275
1015
  if (!i) return {
1276
1016
  isValid: !0,
1277
1017
  date: null
@@ -1288,7 +1028,7 @@ function W(e, t, n, r) {
1288
1028
  date: null,
1289
1029
  error: "INVALID_MONTH"
1290
1030
  };
1291
- let l = s - 1, u = g(o, l);
1031
+ let l = s - 1, u = h(o, l);
1292
1032
  if (c < 1 || c > u) return {
1293
1033
  isValid: !1,
1294
1034
  date: null,
@@ -1299,11 +1039,11 @@ function W(e, t, n, r) {
1299
1039
  month: l,
1300
1040
  day: c
1301
1041
  };
1302
- return t && O(d, t) < 0 ? {
1042
+ return t && D(d, t) < 0 ? {
1303
1043
  isValid: !1,
1304
1044
  date: d,
1305
1045
  error: "OUT_OF_MIN_BOUNDS"
1306
- } : n && O(d, n) > 0 ? {
1046
+ } : n && D(d, n) > 0 ? {
1307
1047
  isValid: !1,
1308
1048
  date: d,
1309
1049
  error: "OUT_OF_MAX_BOUNDS"
@@ -1318,37 +1058,37 @@ function W(e, t, n, r) {
1318
1058
  }
1319
1059
  //#endregion
1320
1060
  //#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]);
1061
+ 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 }) => {
1062
+ 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);
1063
+ r(() => {
1064
+ e !== void 0 && (C(e ? L(e, "YYYY/MM/DD", { digitType: u }) : ""), T(!1));
1065
+ }, [e, u]);
1326
1066
  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();
1067
+ let n = t.target.value, r = W(n, u);
1068
+ if (C(r), r.length === 10 || r.length === 0) {
1069
+ let t = de(r, d, f, p);
1070
+ t.isValid ? (T(!1), s?.(null), e === void 0 && b(t.date), i?.(t.date)) : (T(!0), s?.(t.error));
1071
+ } else T(!1), s?.(null);
1072
+ }, O = t(() => {
1073
+ C(""), T(!1), s?.(null), e === void 0 && b(null), i?.(null), E.current?.focus();
1334
1074
  }, [
1335
1075
  e,
1336
- r,
1337
- a
1076
+ i,
1077
+ s
1338
1078
  ]);
1339
- return /* @__PURE__ */ u("div", {
1079
+ return /* @__PURE__ */ l("div", {
1340
1080
  style: {
1341
1081
  position: "relative",
1342
1082
  display: "inline-flex",
1343
1083
  alignItems: "center",
1344
1084
  direction: "rtl"
1345
1085
  },
1346
- children: [/* @__PURE__ */ l("input", {
1086
+ children: [/* @__PURE__ */ c("input", {
1347
1087
  ref: E,
1348
1088
  type: "text",
1349
1089
  inputMode: "numeric",
1350
1090
  disabled: g,
1351
- placeholder: c === "persian" ? h : "1405/01/15",
1091
+ placeholder: u === "persian" ? h : "1405/01/15",
1352
1092
  value: S,
1353
1093
  onChange: D,
1354
1094
  style: {
@@ -1368,7 +1108,7 @@ var _e = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a,
1368
1108
  ..._
1369
1109
  },
1370
1110
  ...v
1371
- }), m && S && !g && /* @__PURE__ */ l("button", {
1111
+ }), m && S && !g && /* @__PURE__ */ c("button", {
1372
1112
  type: "button",
1373
1113
  "aria-label": "پاک کردن",
1374
1114
  onClick: O,
@@ -1392,8 +1132,8 @@ var _e = ({ value: e, defaultValue: t = null, onChange: r, onValidationError: a,
1392
1132
  };
1393
1133
  //#endregion
1394
1134
  //#region src/events/event-utils.ts
1395
- function ve(e, t) {
1396
- return !t || t.length === 0 ? [] : t.filter((t) => b(t.date, e));
1135
+ function pe(e, t) {
1136
+ return !t || t.length === 0 ? [] : t.filter((t) => y(t.date, e));
1397
1137
  }
1398
1138
  //#endregion
1399
1139
  //#region src/holidays/iran-holidays.ts
@@ -1409,10 +1149,10 @@ var G = {
1409
1149
  "10-22": "پیروزی انقلاب اسلامی",
1410
1150
  "11-29": "روز ملی شدن صنعت نفت"
1411
1151
  };
1412
- function ye(e) {
1413
- return v(e.year, e.month, e.day).getDay() === 5;
1152
+ function K(e) {
1153
+ return _(e.year, e.month, e.day).getDay() === 5;
1414
1154
  }
1415
- function be(e, t) {
1155
+ function me(e, t) {
1416
1156
  if (t && t.length > 0) {
1417
1157
  let n = t.find((t) => t.date.year === e.year && t.date.month === e.month && t.date.day === e.day);
1418
1158
  if (n) return {
@@ -1426,7 +1166,7 @@ function be(e, t) {
1426
1166
  title: G[n],
1427
1167
  type: "solar",
1428
1168
  isOff: !0
1429
- } : ye(e) ? {
1169
+ } : K(e) ? {
1430
1170
  title: "جمعه (تعطیل پایان هفته)",
1431
1171
  type: "solar",
1432
1172
  isOff: !0
@@ -1434,107 +1174,101 @@ function be(e, t) {
1434
1174
  }
1435
1175
  //#endregion
1436
1176
  //#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)) {
1177
+ function he({ 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: z = 1, hourStep: ne = 1, showSeconds: B = !1, numberOfMonths: V = 1, useMaskedInput: H = !1, events: le, showHolidays: W = !1, customHolidays: de }) {
1178
+ let [G, K] = o(_ === "inline"), [he, ge] = o(!1), _e = a(null), q = _ === "modal", ve = i(() => {
1179
+ if (n !== void 0) {
1180
+ if (!n) return null;
1181
+ if (n instanceof Date) return S(n);
1182
+ if (Array.isArray(n)) {
1443
1183
  if (e === "range") {
1444
- let [e, n] = t;
1445
- return [e ? C(e) : null, n ? C(n) : null];
1184
+ let [e, t] = n;
1185
+ return [e ? S(e) : null, t ? S(t) : null];
1446
1186
  }
1447
- if (e === "multiple") return t.map((e) => C(e));
1187
+ if (e === "multiple") return n.map((e) => S(e));
1448
1188
  }
1449
1189
  return null;
1450
1190
  }
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)) {
1191
+ }, [n, e]), ye = i(() => {
1192
+ if (d !== void 0) {
1193
+ if (!d) return null;
1194
+ if (d instanceof Date) return S(d);
1195
+ if (Array.isArray(d)) {
1456
1196
  if (e === "range") {
1457
- let [e, t] = r;
1458
- return [e ? C(e) : null, t ? C(t) : null];
1197
+ let [e, t] = d;
1198
+ return [e ? S(e) : null, t ? S(t) : null];
1459
1199
  }
1460
- if (e === "multiple") return r.map((e) => C(e));
1200
+ if (e === "multiple") return d.map((e) => S(e));
1461
1201
  }
1462
1202
  return null;
1463
1203
  }
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) => {
1204
+ }, [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) => {
1205
+ P === void 0 && Ce(e), R?.(e);
1206
+ }, [P, R]), Te = t((t) => {
1467
1207
  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);
1208
+ let n = N ? J.hour : 0, r = N ? J.minute : 0, i = N && B ? J.second ?? 0 : 0;
1209
+ if (e === "single" && !Array.isArray(t)) return C(t, n, r, i);
1470
1210
  if (e === "range" && Array.isArray(t)) {
1471
1211
  let [e, n] = t;
1472
- return [e ? w(e, 0, 0, 0) : null, n ? w(n, 23, 59, 59) : null];
1212
+ return [e ? C(e, 0, 0, 0) : null, n ? C(n, 23, 59, 59) : null];
1473
1213
  }
1474
- return e === "multiple" && Array.isArray(t) ? t.map((e) => w(e, n, r, i)) : null;
1214
+ return e === "multiple" && Array.isArray(t) ? t.map((e) => C(e, n, r, i)) : null;
1475
1215
  }, [
1476
1216
  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({
1217
+ N,
1218
+ J,
1219
+ B
1220
+ ]), { 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
1221
  mode: e,
1482
- value: Ce,
1483
- defaultValue: we,
1484
- minDate: Te,
1485
- maxDate: Ee,
1222
+ value: ve,
1223
+ defaultValue: ye,
1224
+ minDate: be,
1225
+ maxDate: xe,
1486
1226
  firstDayOfWeek: g,
1487
- isDateDisabled: h ? (e) => h(w(e)) : void 0,
1227
+ isDateDisabled: h ? (e) => h(C(e)) : void 0,
1488
1228
  onChange: (e) => {
1489
- f?.(Ae(e));
1229
+ f?.(Te(e));
1490
1230
  }
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,
1231
+ }), Pe = e === "single" ? Y : null, Fe = (t) => {
1232
+ Ae(t), _ === "popover" && e === "single" && !N && K(!1);
1233
+ }, { handleKeyDown: Ie, getCellTabIndex: Le, setFocusedDate: Re } = te({
1234
+ viewYear: X,
1235
+ viewMonth: Z,
1236
+ selectedDate: Pe,
1237
+ onSelectDate: Fe,
1238
+ onViewChange: Q,
1499
1239
  isRtl: !0
1500
1240
  });
1501
- i(() => {
1502
- if (!K || !W) return;
1241
+ r(() => {
1242
+ if (!q || !G) return;
1503
1243
  let e = document.body.style.overflow;
1504
1244
  document.body.style.overflow = "hidden";
1505
1245
  let t = (e) => {
1506
- e.key === "Escape" && G(!1);
1246
+ e.key === "Escape" && K(!1);
1507
1247
  };
1508
1248
  return window.addEventListener("keydown", t), () => {
1509
1249
  document.body.style.overflow = e, window.removeEventListener("keydown", t);
1510
1250
  };
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,
1251
+ }, [q, G]);
1252
+ let $ = i(() => Z === 11 ? {
1253
+ year: X + 1,
1520
1254
  month: 0
1521
1255
  } : {
1522
- year: Y,
1523
- month: X + 1
1524
- }, [Y, X]), We = a(() => {
1525
- if (H !== 2) return [];
1526
- let t = S({
1256
+ year: X,
1257
+ month: Z + 1
1258
+ }, [X, Z]), ze = i(() => {
1259
+ if (V !== 2) return [];
1260
+ let t = x({
1527
1261
  year: $.year,
1528
1262
  month: $.month,
1529
1263
  firstDayOfWeek: g,
1530
- minDate: Te,
1531
- maxDate: Ee
1264
+ minDate: be,
1265
+ maxDate: xe
1532
1266
  });
1533
1267
  if (e !== "range") return t;
1534
- let [n, r] = J || [null, null], i = r ?? (n && Ie ? Ie : null);
1268
+ let [n, r] = Y || [null, null], i = r ?? (n && Me ? Me : null);
1535
1269
  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)), {
1270
+ let t = n ? y(e.jalali, n) : !1, r = i ? y(e.jalali, i) : !1, a = !1;
1271
+ return n && i && (a = O(e.jalali, n, i)), {
1538
1272
  ...e,
1539
1273
  isSelected: t || r,
1540
1274
  isInRange: a,
@@ -1543,54 +1277,52 @@ function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
1543
1277
  };
1544
1278
  });
1545
1279
  }, [
1546
- H,
1280
+ V,
1547
1281
  $,
1548
1282
  g,
1549
- Te,
1550
- Ee,
1283
+ be,
1284
+ xe,
1551
1285
  e,
1552
- J,
1553
- Ie
1554
- ]), Ge = a(() => {
1555
- if (!J) return "";
1286
+ Y,
1287
+ Me
1288
+ ]), Be = i(() => {
1289
+ if (!Y) return "";
1556
1290
  if (e === "single") {
1557
- let e = z(J, "YYYY/MM/DD", { digitType: y });
1558
- return P && q ? `${e} ${ue(q, V, y)}` : e;
1291
+ let e = L(Y, "YYYY/MM/DD", { digitType: b });
1292
+ return N && J ? `${e} ${ue(J, B, b)}` : e;
1559
1293
  }
1560
1294
  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 });
1295
+ let [e, t] = Y || [null, null];
1296
+ if (e && t) return `${L(e, "YYYY/MM/DD", { digitType: b })} - ${L(t, "YYYY/MM/DD", { digitType: b })}`;
1297
+ if (e) return L(e, "YYYY/MM/DD", { digitType: b });
1564
1298
  }
1565
1299
  return "";
1566
1300
  }, [
1567
- J,
1301
+ Y,
1568
1302
  e,
1569
- y,
1570
- P,
1571
- q,
1572
- V
1573
- ]), Ke = (e, t, n, r = !0, i = !0) => /* @__PURE__ */ u("div", {
1303
+ b,
1304
+ N,
1305
+ J,
1306
+ B
1307
+ ]), Ve = (e, t, n, r = !0, i = !0) => /* @__PURE__ */ l("div", {
1574
1308
  style: { minWidth: "270px" },
1575
1309
  children: [
1576
- /* @__PURE__ */ l(ae, {
1310
+ /* @__PURE__ */ c(re, {
1577
1311
  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
1312
+ monthName: u[t],
1313
+ onPrevMonth: r ? De : () => {},
1314
+ onNextMonth: i ? Oe : () => {},
1315
+ onTitleClick: () => ge((e) => !e),
1316
+ isPickerOpen: he
1585
1317
  }),
1586
- /* @__PURE__ */ l(oe, {
1318
+ /* @__PURE__ */ c(ie, {
1587
1319
  firstDayOfWeek: g,
1588
1320
  classNames: E,
1589
1321
  styles: D
1590
1322
  }),
1591
- /* @__PURE__ */ l("div", {
1323
+ /* @__PURE__ */ c("div", {
1592
1324
  role: "grid",
1593
- "aria-label": `${d[t]} ${L(e)}`,
1325
+ "aria-label": `${u[t]} ${F(e)}`,
1594
1326
  className: E?.grid,
1595
1327
  style: {
1596
1328
  display: "grid",
@@ -1599,156 +1331,145 @@ function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
1599
1331
  ...D?.grid
1600
1332
  },
1601
1333
  children: n.map((e, t) => {
1602
- let n = me ? be(e.jalali, ge) : null, r = ve(e.jalali, pe);
1603
- return /* @__PURE__ */ l(se, {
1334
+ let n = W ? me(e.jalali, de) : null, r = pe(e.jalali, le);
1335
+ return /* @__PURE__ */ c(ae, {
1604
1336
  cell: e,
1605
- digitType: y,
1337
+ digitType: b,
1606
1338
  isHoliday: !!n,
1607
1339
  holidayTitle: n?.title,
1608
1340
  events: r,
1609
1341
  classNames: E,
1610
1342
  styles: D,
1611
- tabIndex: Ve(e.jalali),
1612
- onSelect: ze,
1613
- onHover: Fe,
1614
- onFocus: He
1343
+ tabIndex: Le(e.jalali),
1344
+ onSelect: Fe,
1345
+ onHover: je,
1346
+ onFocus: Re
1615
1347
  }, t);
1616
1348
  })
1617
1349
  })
1618
1350
  ]
1619
- }), qe = /* @__PURE__ */ u("div", {
1620
- role: K ? "dialog" : "region",
1621
- "aria-modal": K ? !0 : void 0,
1351
+ }), He = /* @__PURE__ */ l("div", {
1352
+ role: q ? "dialog" : "region",
1353
+ "aria-modal": q ? !0 : void 0,
1622
1354
  "aria-label": "تقویم شمسی",
1623
- onKeyDown: Be,
1624
- onClick: (e) => K && e.stopPropagation(),
1355
+ onKeyDown: Ie,
1356
+ onClick: (e) => q && e.stopPropagation(),
1625
1357
  className: E?.calendar,
1626
1358
  style: {
1627
- position: _ === "popover" ? "absolute" : K ? "relative" : "static",
1359
+ position: _ === "popover" ? "absolute" : q ? "relative" : "static",
1628
1360
  top: _ === "popover" ? "calc(100% + 4px)" : void 0,
1629
1361
  right: _ === "popover" ? 0 : void 0,
1630
- zIndex: K ? 1001 : 50,
1362
+ zIndex: q ? 1001 : 50,
1631
1363
  padding: "16px",
1632
1364
  backgroundColor: "var(--pdp-surface-bg, #ffffff)",
1633
1365
  borderRadius: "var(--pdp-border-radius, 12px)",
1634
1366
  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)",
1367
+ 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
1368
  width: "fit-content",
1637
1369
  userSelect: "none",
1638
1370
  display: "flex",
1639
- flexDirection: ie === "horizontal" ? "column" : "row",
1371
+ flexDirection: "column",
1640
1372
  gap: "12px",
1641
1373
  ...D?.calendar
1642
1374
  },
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"
1375
+ children: [q && /* @__PURE__ */ c("button", {
1376
+ type: "button",
1377
+ "aria-label": "بستن",
1378
+ onClick: () => K(!1),
1379
+ style: {
1380
+ position: "absolute",
1381
+ top: "10px",
1382
+ left: "10px",
1383
+ background: "none",
1384
+ border: "none",
1385
+ cursor: "pointer",
1386
+ fontSize: "16px",
1387
+ color: "var(--pdp-text-muted, #94a3b8)",
1388
+ lineHeight: 1,
1389
+ zIndex: 10
1390
+ },
1391
+ children: "✕"
1392
+ }), /* @__PURE__ */ c("div", {
1393
+ style: {
1394
+ display: "flex",
1395
+ flexDirection: "column",
1396
+ gap: "8px"
1397
+ },
1398
+ children: he ? /* @__PURE__ */ c(oe, {
1399
+ currentYear: X,
1400
+ currentMonth: Z,
1401
+ onSelectMonth: (e) => {
1402
+ Q(X, e), ge(!1);
1676
1403
  },
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
- ]
1404
+ onSelectYear: (e) => Q(e, Z)
1405
+ }) : /* @__PURE__ */ l(s, { children: [
1406
+ /* @__PURE__ */ l("div", {
1407
+ style: {
1408
+ display: "flex",
1409
+ gap: "16px",
1410
+ alignItems: "flex-start"
1411
+ },
1412
+ children: [Ve(X, Z, Ee, !0, V === 1), V === 2 && /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: {
1413
+ width: "1px",
1414
+ backgroundColor: "var(--pdp-surface-border, #e2e8f0)",
1415
+ alignSelf: "stretch"
1416
+ } }), Ve($.year, $.month, ze, !1, !0)] })]
1417
+ }),
1418
+ N && /* @__PURE__ */ c(ce, {
1419
+ value: J,
1420
+ onChange: we,
1421
+ minuteStep: z,
1422
+ hourStep: ne,
1423
+ showSeconds: B,
1424
+ digitType: b,
1425
+ classNames: E,
1426
+ styles: D
1427
+ }),
1428
+ k && /* @__PURE__ */ c(se, {
1429
+ mode: e,
1430
+ digitType: b,
1431
+ showStatusText: A,
1432
+ showActions: M,
1433
+ selectedDate: e === "single" ? Y : null,
1434
+ selectedRange: e === "range" ? Y : void 0,
1435
+ selectedDates: e === "multiple" ? Y : void 0,
1436
+ selectedTime: N ? J : void 0,
1437
+ onToday: ke,
1438
+ onClear: Ne,
1439
+ onConfirm: () => {
1440
+ _ !== "inline" && K(!1), ee?.();
1441
+ },
1442
+ classNames: E,
1443
+ styles: D
1444
+ })
1445
+ ] })
1446
+ })]
1726
1447
  });
1727
- return /* @__PURE__ */ u("div", {
1728
- ref: Se,
1729
- className: x ?? E?.root,
1448
+ return /* @__PURE__ */ l("div", {
1449
+ ref: _e,
1450
+ className: w ?? E?.root,
1730
1451
  style: {
1731
1452
  position: "relative",
1732
1453
  display: "inline-block",
1733
1454
  ...T,
1734
1455
  ...D?.root
1735
1456
  },
1736
- children: [_ !== "inline" && (le && e === "single" && _ === "popover" ? /* @__PURE__ */ l(_e, {
1737
- value: Re,
1738
- digitType: y,
1457
+ children: [_ !== "inline" && (H && e === "single" && _ === "popover" ? /* @__PURE__ */ c(fe, {
1458
+ value: Pe,
1459
+ digitType: b,
1739
1460
  placeholder: v,
1740
1461
  onChange: (e) => {
1741
- e ? (Q(e), Z(e.year, e.month)) : Le();
1462
+ e ? (Ae(e), Q(e.year, e.month)) : Ne();
1742
1463
  },
1743
- onClick: () => G(!0),
1464
+ onClick: () => K(!0),
1744
1465
  className: E?.input,
1745
1466
  style: D?.input
1746
- }) : /* @__PURE__ */ l("input", {
1467
+ }) : /* @__PURE__ */ c("input", {
1747
1468
  type: "text",
1748
1469
  readOnly: !0,
1749
1470
  placeholder: v,
1750
- value: Ge,
1751
- onClick: () => G(!0),
1471
+ value: Be,
1472
+ onClick: () => K(!0),
1752
1473
  className: E?.input,
1753
1474
  style: {
1754
1475
  padding: "8px 12px",
@@ -1760,12 +1481,12 @@ function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
1760
1481
  textAlign: "right",
1761
1482
  direction: "rtl",
1762
1483
  fontSize: "14px",
1763
- minWidth: P ? "200px" : H === 2 ? "240px" : "150px",
1484
+ minWidth: N ? "200px" : V === 2 ? "240px" : "150px",
1764
1485
  ...D?.input
1765
1486
  }
1766
- })), W && (K ? /* @__PURE__ */ l("div", {
1487
+ })), G && (q ? /* @__PURE__ */ c("div", {
1767
1488
  role: "presentation",
1768
- onClick: () => G(!1),
1489
+ onClick: () => K(!1),
1769
1490
  className: E?.modalBackdrop,
1770
1491
  style: {
1771
1492
  position: "fixed",
@@ -1783,26 +1504,26 @@ function xe({ mode: e = "single", value: t, defaultValue: r, onChange: f, minDat
1783
1504
  direction: "rtl",
1784
1505
  ...D?.modalBackdrop
1785
1506
  },
1786
- children: qe
1787
- }) : qe)]
1507
+ children: He
1508
+ }) : He)]
1788
1509
  });
1789
1510
  }
1790
1511
  //#endregion
1791
1512
  //#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] ? {
1513
+ var ge = ({ value: e, defaultValue: n = [null, null], onChange: r, initialViewDate: a, firstDayOfWeek: s = 0, digitType: d = "persian", minDate: f, maxDate: p, isDateDisabled: m }) => {
1514
+ let [h, g] = o(n), _ = e === void 0 ? h : e, [b, S] = o(null), C = i(() => v(), []), [w, T] = o(() => a || (_[0] ? {
1794
1515
  year: _[0].year,
1795
1516
  month: _[0].month
1796
1517
  } : {
1797
1518
  year: C.year,
1798
1519
  month: C.month
1799
- })), E = a(() => w.month === 11 ? {
1520
+ })), E = i(() => w.month === 11 ? {
1800
1521
  year: w.year + 1,
1801
1522
  month: 0
1802
1523
  } : {
1803
1524
  year: w.year,
1804
1525
  month: w.month + 1
1805
- }, [w]), D = () => {
1526
+ }, [w]), k = () => {
1806
1527
  T((e) => e.month === 0 ? {
1807
1528
  year: e.year - 1,
1808
1529
  month: 11
@@ -1818,25 +1539,25 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1818
1539
  year: e.year,
1819
1540
  month: e.month + 1
1820
1541
  });
1821
- }, j = n((t) => {
1542
+ }, j = t((t) => {
1822
1543
  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);
1544
+ !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
1545
  }, [
1825
1546
  _,
1826
1547
  e,
1827
1548
  r
1828
- ]), M = n((e, t) => {
1829
- let n = S({
1549
+ ]), M = t((e, t) => {
1550
+ let n = x({
1830
1551
  year: e,
1831
1552
  month: t,
1832
- firstDayOfWeek: o,
1553
+ firstDayOfWeek: s,
1833
1554
  minDate: f,
1834
1555
  maxDate: p,
1835
1556
  isDateDisabled: m
1836
- }), [r, i] = _, a = i ?? (r && v ? v : null);
1557
+ }), [r, i] = _, a = i ?? (r && b ? b : null);
1837
1558
  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)), {
1559
+ let t = r ? y(e.jalali, r) : !1, n = a ? y(e.jalali, a) : !1, i = !1;
1560
+ return r && a && (i = O(e.jalali, r, a)), {
1840
1561
  ...e,
1841
1562
  isSelected: t || n,
1842
1563
  isInRange: i,
@@ -1845,21 +1566,21 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1845
1566
  };
1846
1567
  });
1847
1568
  }, [
1848
- o,
1569
+ s,
1849
1570
  f,
1850
1571
  p,
1851
1572
  m,
1852
1573
  _,
1853
- v
1854
- ]), N = a(() => M(w.year, w.month), [
1574
+ b
1575
+ ]), ee = i(() => M(w.year, w.month), [
1855
1576
  M,
1856
1577
  w.year,
1857
1578
  w.month
1858
- ]), P = a(() => M(E.year, E.month), [
1579
+ ]), te = i(() => M(E.year, E.month), [
1859
1580
  M,
1860
1581
  E.year,
1861
1582
  E.month
1862
- ]), F = (e, t, n, r) => /* @__PURE__ */ u("div", {
1583
+ ]), N = (e, t, n, r) => /* @__PURE__ */ l("div", {
1863
1584
  style: {
1864
1585
  display: "flex",
1865
1586
  flexDirection: "column",
@@ -1867,7 +1588,7 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1867
1588
  minWidth: "270px"
1868
1589
  },
1869
1590
  children: [
1870
- /* @__PURE__ */ u("div", {
1591
+ /* @__PURE__ */ l("div", {
1871
1592
  style: {
1872
1593
  display: "flex",
1873
1594
  alignItems: "center",
@@ -1876,10 +1597,10 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1876
1597
  height: "32px"
1877
1598
  },
1878
1599
  children: [
1879
- r ? /* @__PURE__ */ l("button", {
1600
+ r ? /* @__PURE__ */ c("button", {
1880
1601
  type: "button",
1881
1602
  "aria-label": "ماه قبل",
1882
- onClick: D,
1603
+ onClick: k,
1883
1604
  style: {
1884
1605
  width: "28px",
1885
1606
  height: "28px",
@@ -1890,20 +1611,20 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1890
1611
  cursor: "pointer"
1891
1612
  },
1892
1613
  children: "›"
1893
- }) : /* @__PURE__ */ l("div", { style: { width: "28px" } }),
1894
- /* @__PURE__ */ u("div", {
1614
+ }) : /* @__PURE__ */ c("div", { style: { width: "28px" } }),
1615
+ /* @__PURE__ */ l("div", {
1895
1616
  style: {
1896
1617
  fontWeight: 600,
1897
1618
  fontSize: "14px",
1898
1619
  color: "var(--pdp-text-primary, #0f172a)"
1899
1620
  },
1900
1621
  children: [
1901
- d[t],
1622
+ u[t],
1902
1623
  " ",
1903
- L(e)
1624
+ F(e)
1904
1625
  ]
1905
1626
  }),
1906
- r ? /* @__PURE__ */ l("div", { style: { width: "28px" } }) : /* @__PURE__ */ l("button", {
1627
+ r ? /* @__PURE__ */ c("div", { style: { width: "28px" } }) : /* @__PURE__ */ c("button", {
1907
1628
  type: "button",
1908
1629
  "aria-label": "ماه بعد",
1909
1630
  onClick: A,
@@ -1920,26 +1641,26 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1920
1641
  })
1921
1642
  ]
1922
1643
  }),
1923
- /* @__PURE__ */ l(oe, { firstDayOfWeek: o }),
1924
- /* @__PURE__ */ l("div", {
1644
+ /* @__PURE__ */ c(ie, { firstDayOfWeek: s }),
1645
+ /* @__PURE__ */ c("div", {
1925
1646
  role: "grid",
1926
- "aria-label": `${d[t]} ${L(e)}`,
1647
+ "aria-label": `${u[t]} ${F(e)}`,
1927
1648
  style: {
1928
1649
  display: "grid",
1929
1650
  gridTemplateColumns: "repeat(7, var(--pdp-cell-size, 36px))",
1930
1651
  gap: "4px"
1931
1652
  },
1932
- children: n.map((e, t) => /* @__PURE__ */ l(se, {
1653
+ children: n.map((e, t) => /* @__PURE__ */ c(ae, {
1933
1654
  cell: e,
1934
- digitType: c,
1655
+ digitType: d,
1935
1656
  tabIndex: 0,
1936
1657
  onSelect: j,
1937
- onHover: x
1658
+ onHover: S
1938
1659
  }, t))
1939
1660
  })
1940
1661
  ]
1941
1662
  });
1942
- return /* @__PURE__ */ u("div", {
1663
+ return /* @__PURE__ */ l("div", {
1943
1664
  role: "region",
1944
1665
  "aria-label": "تقویم دوقلو شمسی",
1945
1666
  style: {
@@ -1955,16 +1676,16 @@ var Se = ({ value: e, defaultValue: t = [null, null], onChange: r, initialViewDa
1955
1676
  direction: "rtl"
1956
1677
  },
1957
1678
  children: [
1958
- F(w.year, w.month, N, !0),
1959
- /* @__PURE__ */ l("div", { style: {
1679
+ N(w.year, w.month, ee, !0),
1680
+ /* @__PURE__ */ c("div", { style: {
1960
1681
  width: "1px",
1961
1682
  backgroundColor: "var(--pdp-surface-border, #e2e8f0)"
1962
1683
  } }),
1963
- F(E.year, E.month, P, !1)
1684
+ N(E.year, E.month, te, !1)
1964
1685
  ]
1965
1686
  });
1966
1687
  };
1967
1688
  //#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 };
1689
+ export { V as DatePickerThemeProvider, ae as DayCell, ge as DualMonthCalendar, re as Header, d as JALALI_MONTH_NAMES_EN, he as JalaliDatePicker, fe as MaskedDateInput, oe as MonthYearPicker, u as PERSIAN_MONTH_NAMES, p as PERSIAN_WEEK_DAYS_LONG, f as PERSIAN_WEEK_DAYS_SHORT, ce as TimePicker, ie as Weekdays, T as addDaysToJalali, E as addJalaliDays, W as applyDateMask, M as calculateNextFocusedDate, le as clampTime, D as compareJalaliDates, z as darkTheme, L as formatJalaliDate, H as formatTimeSegment, ue 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, de as parseAndValidateJalaliString, b as toJalaliDate, I as toLatinDigits, F as toPersianDigits, te as useCalendarKeyboard, j as useJalaliDatePicker, B as useTheme };
1969
1690
 
1970
1691
  //# sourceMappingURL=index.mjs.map