@ac-design/design-system 2.2.1 → 2.4.0

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 (77) hide show
  1. package/dist/lib/compat.css +421 -0
  2. package/dist/lib/components/AcAppSwitcher.vue.d.ts +1 -1
  3. package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +23 -23
  4. package/dist/lib/components/AcAreaChart.vue.d.ts +1 -1
  5. package/dist/lib/components/AcBarChart.vue.d.ts +1 -1
  6. package/dist/lib/components/AcButton.vue.d.ts +25 -13
  7. package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +122 -71
  8. package/dist/lib/components/AcCard.vue.d.ts +11 -5
  9. package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
  10. package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
  11. package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +20 -20
  12. package/dist/lib/components/AcCheckBox.vue.d.ts +4 -1
  13. package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +50 -50
  14. package/dist/lib/components/AcCircularProgress.vue.d.ts +1 -1
  15. package/dist/lib/components/AcCodeEditor.vue.d.ts +12 -0
  16. package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +240 -207
  17. package/dist/lib/components/AcColorInput.vue.d.ts +4 -4
  18. package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +72 -66
  19. package/dist/lib/components/AcCostSummary.vue.d.ts +1 -1
  20. package/dist/lib/components/AcDatePicker.vue.d.ts +41 -10
  21. package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +554 -446
  22. package/dist/lib/components/AcDeleteModal.vue.d.ts +1 -1
  23. package/dist/lib/components/AcDonutChart.vue.d.ts +2 -2
  24. package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
  25. package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +8 -8
  26. package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
  27. package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +8 -8
  28. package/dist/lib/components/AcGraphChart.vue.d.ts +2 -2
  29. package/dist/lib/components/AcHeader.vue.d.ts +1 -1
  30. package/dist/lib/components/AcInput.vue.d.ts +86 -44
  31. package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +319 -86
  32. package/dist/lib/components/AcKeyValueInput.vue.d.ts +34 -54
  33. package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +134 -106
  34. package/dist/lib/components/AcLineChart.vue.d.ts +1 -1
  35. package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
  36. package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
  37. package/dist/lib/components/AcMapChart.vue.d.ts +2 -2
  38. package/dist/lib/components/AcModal.vue.d.ts +1 -1
  39. package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
  40. package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
  41. package/dist/lib/components/AcNotificationMenu.vue.d.ts +1 -1
  42. package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +24 -24
  43. package/dist/lib/components/AcNumberInput.vue.d.ts +55 -45
  44. package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +159 -99
  45. package/dist/lib/components/AcRadioCard.js +5 -0
  46. package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
  47. package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
  48. package/dist/lib/components/AcSelect.vue.d.ts +46 -6
  49. package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +309 -197
  50. package/dist/lib/components/AcSidePanel.vue.d.ts +1 -1
  51. package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
  52. package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
  53. package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
  54. package/dist/lib/components/AcSlider.vue.d.ts +2 -2
  55. package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +23 -23
  56. package/dist/lib/components/AcTable.vue.d.ts +50 -5
  57. package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +257 -129
  58. package/dist/lib/components/AcTagInput.vue.d.ts +23 -4
  59. package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +126 -114
  60. package/dist/lib/components/AcTaintInput.js +5 -0
  61. package/dist/lib/components/AcTaintInput.vue.d.ts +44 -0
  62. package/dist/lib/components/AcTaintInput.vue_vue_type_script_setup_true_lang.js +208 -0
  63. package/dist/lib/components/AcTextarea.vue.d.ts +64 -4
  64. package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +159 -68
  65. package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
  66. package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
  67. package/dist/lib/components/AcTimePicker.vue.d.ts +36 -11
  68. package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +232 -168
  69. package/dist/lib/components/AcTooltip.vue.d.ts +3 -3
  70. package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
  71. package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
  72. package/dist/lib/components/index.d.ts +2 -0
  73. package/dist/lib/components/types.d.ts +2 -0
  74. package/dist/lib/composables/useToast.d.ts +2 -2
  75. package/dist/lib/index.d.ts +2 -1
  76. package/dist/lib/index.js +51 -49
  77. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
- import e from "./AcButton.js";
2
- import { fixedFrame as t } from "./fixedFrame.js";
3
- import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as ee, mergeProps as te, nextTick as p, normalizeClass as m, normalizeStyle as ne, onBeforeUnmount as re, onMounted as ie, openBlock as h, reactive as ae, ref as g, renderList as _, resolveDynamicComponent as oe, toDisplayString as v, unref as y, useAttrs as se, useId as ce, useModel as le, watch as ue, withCtx as de } from "vue";
4
- import { Calendar as fe, CalendarRange as pe, ChevronLeft as me, ChevronRight as he, Clock as ge, Timer as _e, X as ve } from "@lucide/vue";
1
+ import { fixedFrame as e } from "./fixedFrame.js";
2
+ import t from "./AcButton.js";
3
+ import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as ee, defineComponent as d, mergeModels as te, mergeProps as ne, nextTick as f, normalizeClass as p, onBeforeUnmount as re, onMounted as ie, openBlock as m, reactive as ae, ref as h, renderList as g, renderSlot as oe, resolveDynamicComponent as se, toDisplayString as _, unref as v, useAttrs as ce, useId as le, useModel as ue, watch as de, withCtx as fe } from "vue";
4
+ import { Calendar as pe, CalendarRange as me, ChevronLeft as he, ChevronRight as ge, Clock as _e, Timer as ve, X as ye } from "@lucide/vue";
5
5
  //#region src/lib/components/AcDatePicker.vue?vue&type=script&setup=true&lang.ts
6
- var ye = ["for"], be = {
7
- key: 0,
6
+ var be = ["for"], xe = { key: 0 }, Se = {
7
+ key: 1,
8
8
  class: "text-danger",
9
9
  "aria-hidden": "true"
10
- }, xe = { class: "relative" }, Se = [
10
+ }, Ce = [
11
11
  "id",
12
12
  "disabled",
13
13
  "aria-expanded",
@@ -15,7 +15,13 @@ var ye = ["for"], be = {
15
15
  "aria-describedby",
16
16
  "aria-invalid",
17
17
  "aria-required"
18
- ], Ce = ["aria-label"], we = ["name", "value"], Te = ["aria-label"], Ee = {
18
+ ], we = ["aria-label"], Te = [
19
+ "role",
20
+ "aria-modal",
21
+ "aria-label",
22
+ "aria-describedby",
23
+ "inert"
24
+ ], Ee = {
19
25
  key: 0,
20
26
  class: "flex shrink-0 flex-wrap gap-1 border-b border-border p-2 sm:w-44 sm:flex-col sm:flex-nowrap sm:border-r sm:border-b-0",
21
27
  role: "group",
@@ -74,9 +80,13 @@ var ye = ["for"], be = {
74
80
  class: "mb-1 text-center text-xs font-medium text-heading"
75
81
  }, Xe = { class: "flex h-48 items-stretch justify-center gap-1" }, Ze = {
76
82
  key: 0,
83
+ class: "mx-2 mt-6 h-32 w-px shrink-0 self-center bg-border",
84
+ "aria-hidden": "true"
85
+ }, Qe = {
86
+ key: 1,
77
87
  class: "mt-6 self-center font-bold text-heading/50",
78
88
  "aria-hidden": "true"
79
- }, Qe = { class: "flex h-full min-w-10 flex-1 flex-col items-center" }, $e = {
89
+ }, $e = {
80
90
  class: "mb-2 text-xm font-bold tracking-wider text-heading/50 uppercase",
81
91
  "aria-hidden": "true"
82
92
  }, et = [
@@ -87,17 +97,20 @@ var ye = ["for"], be = {
87
97
  "tabindex",
88
98
  "aria-selected",
89
99
  "onClick"
90
- ], rt = { class: "mt-3 text-center text-xs text-muted" }, it = {
100
+ ], rt = {
101
+ key: 0,
102
+ class: "mt-3 text-center text-xs text-muted"
103
+ }, it = {
91
104
  key: 2,
92
105
  class: "flex flex-wrap items-center gap-2 border-t border-border px-3 py-3"
93
106
  }, at = ["disabled"], ot = {
94
107
  key: 1,
95
108
  class: "basis-full text-xs text-danger-strong",
96
109
  role: "alert"
97
- }, b = /*@__PURE__*/ f({
110
+ }, st = ["name", "value"], y = /*@__PURE__*/ d({
98
111
  inheritAttrs: !1,
99
112
  __name: "AcDatePicker",
100
- props: /*@__PURE__*/ ee({
113
+ props: /*@__PURE__*/ te({
101
114
  label: { default: "" },
102
115
  placeholder: { default: "" },
103
116
  mode: { default: "date" },
@@ -134,7 +147,31 @@ var ye = ["for"], be = {
134
147
  errorMsg: { default: "" },
135
148
  hint: { default: "" },
136
149
  size: { default: "normal" },
137
- name: { default: "" }
150
+ name: { default: "" },
151
+ inline: {
152
+ type: Boolean,
153
+ default: !1
154
+ },
155
+ autoApply: {
156
+ type: Boolean,
157
+ default: !1
158
+ },
159
+ hourCycle: { default: 24 },
160
+ showTimeZone: {
161
+ type: Boolean,
162
+ default: !0
163
+ },
164
+ valueType: { default: "string" },
165
+ fieldClass: {
166
+ type: [
167
+ Boolean,
168
+ null,
169
+ String,
170
+ Object,
171
+ Array
172
+ ],
173
+ default: void 0
174
+ }
138
175
  }, {
139
176
  modelValue: { default: null },
140
177
  modelModifiers: {},
@@ -145,8 +182,8 @@ var ye = ["for"], be = {
145
182
  openModifiers: {}
146
183
  }),
147
184
  emits: ["update:modelValue", "update:open"],
148
- setup(f, { expose: ee }) {
149
- let b = f, st = le(f, "modelValue"), x = le(f, "open"), ct = /^\d{4}-\d{2}-\d{2}$/, lt = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, ut = {
185
+ setup(d, { expose: te }) {
186
+ let y = d, ct = ue(d, "modelValue"), b = ue(d, "open"), lt = /^\d{4}-\d{2}-\d{2}$/, ut = /^(\d{4}-\d{2}-\d{2})T(\d{2}):(\d{2})(?::(\d{2}))?$/, dt = {
150
187
  w: 604800,
151
188
  d: 86400,
152
189
  h: 3600,
@@ -156,176 +193,211 @@ var ye = ["for"], be = {
156
193
  us: 1e-6,
157
194
  µs: 1e-6,
158
195
  ns: 1e-9
159
- }, dt = Date.UTC(2023, 0, 1), ft = {
196
+ }, ft = Date.UTC(2023, 0, 1), pt = {
160
197
  h: "Hrs",
161
198
  m: "Min",
162
- s: "Sec"
163
- }, pt = [{
199
+ s: "Sec",
200
+ p: "AM/PM"
201
+ }, mt = [{
164
202
  key: "date",
165
203
  label: "Date",
166
- icon: fe
204
+ icon: pe
167
205
  }, {
168
206
  key: "time",
169
207
  label: "Time",
170
- icon: ge
171
- }], S = ce(), mt = se(), ht = a(() => ({
172
- class: mt.class,
173
- style: mt.style
174
- })), gt = a(() => {
175
- let { class: e, style: t, ...n } = mt;
208
+ icon: _e
209
+ }], x = le(), ht = ce(), gt = a(() => ({
210
+ class: ht.class,
211
+ style: ht.style
212
+ })), _t = a(() => {
213
+ let { class: e, style: t, ...n } = ht;
176
214
  return n;
177
- }), _t = `${S}-label`, vt = `${S}-value`, yt = `${S}-month`, bt = `${S}-msg`, xt = `${S}-hint`, St = /* @__PURE__ */ new Map(), Ct = g(null), wt = g(null), C = g(null), w = g({
215
+ }), vt = `${x}-label`, yt = `${x}-value`, bt = `${x}-month`, xt = `${x}-msg`, St = `${x}-hint`, Ct = /* @__PURE__ */ new Map(), wt = h(null), Tt = h(null), S = h(null), C = h({
178
216
  left: 0,
179
217
  maxHeight: 480,
180
218
  minWidth: 0
181
- }), T = g("2026-01-01"), E = g("days"), D = g(2020), O = g(0), k = g("date"), A = g("2026-01-01"), j = g(null), M = g(null), N = g(null), P = ae({
219
+ }), w = h("2026-01-01"), T = h("days"), E = h(2020), D = h(0), O = h("date"), k = h("2026-01-01"), Et = h(null), A = h(null), j = h(null), M = ae({
182
220
  h: 0,
183
221
  m: 0,
184
222
  s: 0
185
- }), F = ae({
223
+ }), Dt = ae({
186
224
  h: 23,
187
225
  m: 59,
188
226
  s: 59
189
- }), I = ae({
227
+ }), N = ae({
190
228
  d: 0,
191
229
  h: 0,
192
230
  m: 0
193
- }), L = a(() => b.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), R = a(() => b.range && b.mode !== "duration"), z = a(() => b.mode === "datetime"), Tt = a(() => b.weekStartsOn ?? un()), Et = a(() => new Intl.DateTimeFormat(b.locale, {
231
+ }), P = a(() => y.timeZone || Intl.DateTimeFormat().resolvedOptions().timeZone), F = a(() => y.range && y.mode !== "duration"), I = a(() => y.mode === "datetime"), Ot = a(() => y.weekStartsOn ?? gn()), kt = a(() => new Intl.DateTimeFormat(y.locale, {
194
232
  year: "numeric",
195
233
  month: "short",
196
234
  day: "numeric",
197
235
  timeZone: "UTC"
198
- })), Dt = a(() => new Intl.DateTimeFormat(b.locale, {
236
+ })), At = a(() => new Intl.DateTimeFormat(y.locale, {
199
237
  year: "numeric",
200
238
  month: "short",
201
239
  day: "numeric",
202
240
  hour: "2-digit",
203
241
  minute: "2-digit",
204
- second: b.showSeconds ? "2-digit" : void 0,
205
- hourCycle: "h23",
206
- timeZone: L.value,
207
- timeZoneName: "short"
208
- })), Ot = a(() => new Intl.DateTimeFormat(b.locale, {
242
+ second: y.showSeconds ? "2-digit" : void 0,
243
+ hourCycle: y.hourCycle === 12 ? "h12" : "h23",
244
+ timeZone: P.value,
245
+ timeZoneName: y.showTimeZone ? "short" : void 0
246
+ })), jt = a(() => new Intl.DateTimeFormat(y.locale, {
209
247
  month: "long",
210
248
  year: "numeric",
211
249
  timeZone: "UTC"
212
- })), kt = a(() => new Intl.DateTimeFormat(b.locale, {
250
+ })), Mt = a(() => new Intl.DateTimeFormat(y.locale, {
213
251
  weekday: "long",
214
252
  year: "numeric",
215
253
  month: "long",
216
254
  day: "numeric",
217
255
  timeZone: "UTC"
218
- })), At = a(() => new Intl.DateTimeFormat(b.locale, {
256
+ })), Nt = a(() => new Intl.DateTimeFormat(y.locale, {
219
257
  day: "numeric",
220
258
  timeZone: "UTC"
221
- })), jt = a(() => {
222
- let e = new Intl.DateTimeFormat(b.locale, {
259
+ })), Pt = a(() => {
260
+ let e = new Intl.DateTimeFormat(y.locale, {
223
261
  weekday: "short",
224
262
  timeZone: "UTC"
225
- }), t = new Intl.DateTimeFormat(b.locale, {
263
+ }), t = new Intl.DateTimeFormat(y.locale, {
226
264
  weekday: "long",
227
265
  timeZone: "UTC"
228
266
  });
229
267
  return Array.from({ length: 7 }, (n, r) => {
230
- let i = new Date(dt + (Tt.value + r) % 7 * 864e5);
268
+ let i = new Date(ft + (Ot.value + r) % 7 * 864e5);
231
269
  return {
232
270
  short: e.format(i),
233
271
  long: t.format(i)
234
272
  };
235
273
  });
236
- }), Mt = a(() => new Intl.DateTimeFormat(b.locale, {
237
- timeZone: L.value,
274
+ }), Ft = a(() => new Intl.DateTimeFormat(y.locale, {
275
+ timeZone: P.value,
238
276
  timeZoneName: "short"
239
- }).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? L.value), Nt = a(() => Z(Date.now()).day), B = a(() => b.minDate ? pn(b.minDate) : null), V = a(() => b.maxDate ? pn(b.maxDate) : null), Pt = a(() => b.minDate ? Q(b.minDate) : null), Ft = a(() => b.maxDate ? ct.test(b.maxDate) ? fn(Y(b.maxDate, 1), 0, 0, 0) - 1e3 : Q(b.maxDate) : null), H = a(() => {
240
- let e = st.value;
241
- return R.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
242
- }), It = a(() => H.value.some(Boolean)), Lt = a(() => {
243
- let [e, t] = H.value;
277
+ }).formatToParts(Date.now()).find((e) => e.type === "timeZoneName")?.value ?? P.value), It = a(() => Y(Date.now()).day), L = a(() => y.minDate ? yn(y.minDate) : null), R = a(() => y.maxDate ? yn(y.maxDate) : null), Lt = a(() => y.minDate ? X(y.minDate) : null), Rt = a(() => y.maxDate ? lt.test(y.maxDate) ? vn(q(y.maxDate, 1), 0, 0, 0) - 1e3 : X(y.maxDate) : null), zt = a({
278
+ get() {
279
+ let e = ct.value;
280
+ if (y.range || y.mode === "duration" || Array.isArray(e)) return e ?? null;
281
+ if (y.valueType === "string" && !(e instanceof Date)) return e || null;
282
+ let t = Bt(e);
283
+ return t ? y.mode === "date" ? `${t.getFullYear()}-${U(t.getMonth() + 1)}-${U(t.getDate())}` : t.toISOString().replace(/\.\d{3}Z$/, "Z") : null;
284
+ },
285
+ set(e) {
286
+ if (y.range || y.mode === "duration" || Array.isArray(e) || y.valueType === "string" && !(ct.value instanceof Date)) {
287
+ ct.value = e;
288
+ return;
289
+ }
290
+ if (!e) {
291
+ ct.value = y.valueType === "local" ? "" : null;
292
+ return;
293
+ }
294
+ let t;
295
+ if (y.mode === "date") {
296
+ t = Bt(ct.value) ?? /* @__PURE__ */ new Date();
297
+ let [n, r, i] = e.split("-").map(Number);
298
+ t.setFullYear(n, r - 1, i);
299
+ } else t = new Date(e);
300
+ ct.value = y.valueType === "local" ? Vt(t) : t;
301
+ }
302
+ });
303
+ function Bt(e) {
304
+ if (!e) return null;
305
+ let t = e instanceof Date ? new Date(e) : new Date(String(e));
306
+ return Number.isNaN(t.getTime()) ? null : t;
307
+ }
308
+ function Vt(e) {
309
+ return `${e.getFullYear()}-${U(e.getMonth() + 1)}-${U(e.getDate())}T${U(e.getHours())}:${U(e.getMinutes())}`;
310
+ }
311
+ let z = a(() => {
312
+ let e = zt.value;
313
+ return F.value ? Array.isArray(e) ? [e[0] || null, e[1] || null] : [null, null] : [typeof e == "string" && e ? e : null];
314
+ }), Ht = a(() => z.value.some(Boolean)), Ut = a(() => {
315
+ let [e, t] = z.value;
244
316
  if (!e) return "";
245
- if (b.mode === "duration") {
246
- let t = hn(e);
247
- return t === null ? e : _n(t);
317
+ if (y.mode === "duration") {
318
+ let t = bn(e);
319
+ return t === null ? e : Sn(t);
248
320
  }
249
- if (b.mode === "date") {
250
- let n = pn(e), r = t ? pn(t) : null;
251
- return n ? R.value ? r ? Et.value.formatRange(J(n), J(r)) : `${Et.value.format(J(n))} –` : Et.value.format(J(n)) : e;
321
+ if (y.mode === "date") {
322
+ let n = yn(e), r = t ? yn(t) : null;
323
+ return n ? F.value ? r ? kt.value.formatRange(K(n), K(r)) : `${kt.value.format(K(n))} –` : kt.value.format(K(n)) : e;
252
324
  }
253
- let n = Q(e), r = t ? Q(t) : null;
254
- return n === null ? e : R.value ? r === null ? `${Dt.value.format(n)} –` : Dt.value.formatRange(n, r) : Dt.value.format(n);
255
- }), Rt = a(() => H.value.filter(Boolean).join("/")), zt = a(() => {
256
- let e = (ln(T.value) - Tt.value + 7) % 7, t = Y(T.value, -e), n = Math.ceil((e + cn(T.value)) / 7);
257
- return Array.from({ length: n }, (e, n) => Array.from({ length: 7 }, (e, r) => Y(t, n * 7 + r)));
258
- }), U = a(() => q(T.value).y), Bt = a(() => q(T.value).m - 1), Vt = a(() => {
259
- let e = new Intl.DateTimeFormat(b.locale, {
325
+ let n = X(e), r = t ? X(t) : null;
326
+ return n === null ? e : F.value ? r === null ? `${At.value.format(n)} –` : At.value.formatRange(n, r) : At.value.format(n);
327
+ }), Wt = a(() => z.value.filter(Boolean).join("/")), Gt = a(() => {
328
+ let e = (hn(w.value) - Ot.value + 7) % 7, t = q(w.value, -e), n = Math.ceil((e + mn(w.value)) / 7);
329
+ return Array.from({ length: n }, (e, n) => Array.from({ length: 7 }, (e, r) => q(t, n * 7 + r)));
330
+ }), B = a(() => G(w.value).y), Kt = a(() => G(w.value).m - 1), qt = a(() => {
331
+ let e = new Intl.DateTimeFormat(y.locale, {
260
332
  month: "short",
261
333
  timeZone: "UTC"
262
- }), t = new Intl.DateTimeFormat(b.locale, {
334
+ }), t = new Intl.DateTimeFormat(y.locale, {
263
335
  month: "long",
264
336
  year: "numeric",
265
337
  timeZone: "UTC"
266
338
  });
267
339
  return Array.from({ length: 12 }, (n, r) => {
268
- let i = K(U.value, r + 1, 1);
340
+ let i = W(B.value, r + 1, 1);
269
341
  return {
270
342
  value: r,
271
- text: e.format(J(i)),
272
- label: t.format(J(i)),
273
- disabled: yn(i, K(U.value, r + 2, 0)),
274
- selected: r === Bt.value
343
+ text: e.format(K(i)),
344
+ label: t.format(K(i)),
345
+ disabled: wn(i, W(B.value, r + 2, 0)),
346
+ selected: r === Kt.value
275
347
  };
276
348
  });
277
- }), Ht = a(() => Array.from({ length: 12 }, (e, t) => {
278
- let n = D.value + t;
349
+ }), Jt = a(() => Array.from({ length: 12 }, (e, t) => {
350
+ let n = E.value + t;
279
351
  return {
280
352
  value: n,
281
353
  text: String(n),
282
354
  label: String(n),
283
- disabled: yn(K(n, 1, 1), K(n, 12, 31)),
284
- selected: n === U.value
355
+ disabled: wn(W(n, 1, 1), W(n, 12, 31)),
356
+ selected: n === B.value
285
357
  };
286
- })), Ut = a(() => E.value === "months" ? Vt.value : Ht.value), Wt = a(() => [
358
+ })), Yt = a(() => T.value === "months" ? qt.value : Jt.value), Xt = a(() => [
287
359
  0,
288
360
  4,
289
361
  8
290
- ].map((e) => Ut.value.slice(e, e + 4))), Gt = a(() => Ut.value.some((e) => e.value === O.value) ? O.value : Ut.value[0].value), W = a(() => E.value === "days" ? Ot.value.format(J(T.value)) : E.value === "months" ? String(U.value) : `${D.value}–${D.value + 9}`), Kt = a(() => E.value === "days" ? ["Previous month", "Next month"] : E.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), qt = a(() => !R.value || !M.value ? null : N.value ?? j.value ?? null), G = a(() => M.value ? fn(M.value, P.h, P.m, P.s) : null), Jt = a(() => N.value ? fn(N.value, F.h, F.m, F.s) : null), Yt = a(() => {
291
- if (!z.value) return "";
292
- let e = R.value ? [G.value, Jt.value] : [G.value];
362
+ ].map((e) => Yt.value.slice(e, e + 4))), Zt = a(() => Yt.value.some((e) => e.value === D.value) ? D.value : Yt.value[0].value), V = a(() => T.value === "days" ? jt.value.format(K(w.value)) : T.value === "months" ? String(B.value) : `${E.value}–${E.value + 9}`), Qt = a(() => T.value === "days" ? ["Previous month", "Next month"] : T.value === "months" ? ["Previous year", "Next year"] : ["Previous years", "Next years"]), $t = a(() => !F.value || !A.value ? null : j.value ?? Et.value ?? null), H = a(() => A.value ? vn(A.value, M.h, M.m, M.s) : null), en = a(() => j.value ? vn(j.value, Dt.h, Dt.m, Dt.s) : null), tn = a(() => {
363
+ if (!I.value) return "";
364
+ let e = F.value ? [H.value, en.value] : [H.value];
293
365
  for (let t of e) if (t !== null) {
294
- if (Pt.value !== null && t < Pt.value) return `Choose a time from ${Dt.value.format(Pt.value)}`;
295
- if (Ft.value !== null && t > Ft.value) return `Choose a time up to ${Dt.value.format(Ft.value)}`;
366
+ if (Lt.value !== null && t < Lt.value) return `Choose a time from ${At.value.format(Lt.value)}`;
367
+ if (Rt.value !== null && t > Rt.value) return `Choose a time up to ${At.value.format(Rt.value)}`;
296
368
  }
297
- return R.value && G.value !== null && Jt.value !== null && Jt.value < G.value ? "The end must be after the start" : "";
298
- }), Xt = a(() => b.mode === "duration" ? !0 : !M.value || R.value && !N.value ? !1 : !Yt.value), Zt = a(() => I.d * 86400 + I.h * 3600 + I.m * 60), Qt = a(() => {
369
+ return F.value && H.value !== null && en.value !== null && en.value < H.value ? "The end must be after the start" : "";
370
+ }), nn = a(() => y.mode === "duration" ? !0 : y.inline && !I.value ? !1 : !F.value || I.value && (!y.autoApply || !!tn.value)), rn = a(() => y.mode === "duration" ? !0 : !A.value || F.value && !j.value ? !1 : !tn.value), an = a(() => N.d * 86400 + N.h * 3600 + N.m * 60), on = a(() => {
299
371
  let e = [{
300
372
  key: "start",
301
- label: R.value ? "Start" : "Time",
302
- clock: P
373
+ label: F.value ? "Start" : "Time",
374
+ clock: M
303
375
  }];
304
- return R.value && e.push({
376
+ return F.value && e.push({
305
377
  key: "end",
306
378
  label: "End",
307
- clock: F
379
+ clock: Dt
308
380
  }), e.map((e) => ({
309
381
  ...e,
310
- spinners: wn(e.clock, e.label)
382
+ spinners: On(e.clock, e.label)
311
383
  }));
312
- }), $t = a(() => [
313
- Cn("d", "Days", 0, 999, !1, !1, () => I.d, (e) => I.d = e),
314
- Cn("h", "Hours", 0, 23, !1, !1, () => I.h, (e) => I.h = e),
315
- Cn("m", "Minutes", 0, 59, !1, !1, () => I.m, (e) => I.m = e)
316
- ]), en = g(!1), tn = a(() => x.value || en.value), nn = a(() => [b.hint && xt, b.errorMsg && bt].filter(Boolean).join(" ") || void 0), rn = a(() => {
317
- if (b.mode === "duration") return b.label || "Choose duration";
318
- let e = R.value ? "date range" : z.value ? "date and time" : "date";
319
- return b.label ? `${b.label}: choose ${e}` : `Choose ${e}`;
320
- }), an = a(() => b.mode === "duration" ? _e : R.value ? pe : fe);
321
- function on(e) {
384
+ }), sn = a(() => [
385
+ Q("d", "Days", 0, 999, !1, !1, () => N.d, (e) => N.d = e),
386
+ Q("h", "Hours", 0, 23, !1, !1, () => N.h, (e) => N.h = e),
387
+ Q("m", "Minutes", 0, 59, !1, !1, () => N.m, (e) => N.m = e)
388
+ ]), cn = h(!1), ln = a(() => b.value || cn.value), un = a(() => [y.hint && St, y.errorMsg && xt].filter(Boolean).join(" ") || void 0), dn = a(() => {
389
+ if (y.mode === "duration") return y.label || "Choose duration";
390
+ let e = F.value ? "date range" : I.value ? "date and time" : "date";
391
+ return y.label ? `${y.label}: choose ${e}` : `Choose ${e}`;
392
+ }), fn = a(() => y.mode === "duration" ? ve : F.value ? me : pe);
393
+ function U(e) {
322
394
  return String(e).padStart(2, "0");
323
395
  }
324
- function K(e, t, n) {
396
+ function W(e, t, n) {
325
397
  let r = new Date(Date.UTC(e, t - 1, n));
326
- return `${r.getUTCFullYear()}-${on(r.getUTCMonth() + 1)}-${on(r.getUTCDate())}`;
398
+ return `${r.getUTCFullYear()}-${U(r.getUTCMonth() + 1)}-${U(r.getUTCDate())}`;
327
399
  }
328
- function q(e) {
400
+ function G(e) {
329
401
  let [t, n, r] = e.split("-").map(Number);
330
402
  return {
331
403
  y: t,
@@ -333,39 +405,39 @@ var ye = ["for"], be = {
333
405
  d: r
334
406
  };
335
407
  }
336
- function J(e) {
337
- let { y: t, m: n, d: r } = q(e);
408
+ function K(e) {
409
+ let { y: t, m: n, d: r } = G(e);
338
410
  return new Date(Date.UTC(t, n - 1, r));
339
411
  }
340
- function Y(e, t) {
341
- let { y: n, m: r, d: i } = q(e);
342
- return K(n, r, i + t);
412
+ function q(e, t) {
413
+ let { y: n, m: r, d: i } = G(e);
414
+ return W(n, r, i + t);
343
415
  }
344
- function sn(e, t) {
345
- let { y: n, m: r, d: i } = q(e), a = new Date(Date.UTC(n, r - 1 + t + 1, 0)).getUTCDate();
346
- return K(n, r + t, Math.min(i, a));
416
+ function pn(e, t) {
417
+ let { y: n, m: r, d: i } = G(e), a = new Date(Date.UTC(n, r - 1 + t + 1, 0)).getUTCDate();
418
+ return W(n, r + t, Math.min(i, a));
347
419
  }
348
- function X(e) {
420
+ function J(e) {
349
421
  return `${e.slice(0, 7)}-01`;
350
422
  }
351
- function cn(e) {
352
- let { y: t, m: n } = q(e);
423
+ function mn(e) {
424
+ let { y: t, m: n } = G(e);
353
425
  return new Date(Date.UTC(t, n, 0)).getUTCDate();
354
426
  }
355
- function ln(e) {
356
- return J(e).getUTCDay();
427
+ function hn(e) {
428
+ return K(e).getUTCDay();
357
429
  }
358
- function un() {
430
+ function gn() {
359
431
  try {
360
- let e = new Intl.Locale(b.locale ?? navigator.language), t = (e.getWeekInfo?.() ?? e.weekInfo)?.firstDay;
432
+ let e = new Intl.Locale(y.locale ?? navigator.language), t = (e.getWeekInfo?.() ?? e.weekInfo)?.firstDay;
361
433
  if (t) return t % 7;
362
434
  } catch {}
363
435
  return 0;
364
436
  }
365
- function Z(e) {
366
- let t = St.get(L.value);
437
+ function Y(e) {
438
+ let t = Ct.get(P.value);
367
439
  t || (t = new Intl.DateTimeFormat("en-US", {
368
- timeZone: L.value,
440
+ timeZone: P.value,
369
441
  hourCycle: "h23",
370
442
  year: "numeric",
371
443
  month: "2-digit",
@@ -373,53 +445,53 @@ var ye = ["for"], be = {
373
445
  hour: "2-digit",
374
446
  minute: "2-digit",
375
447
  second: "2-digit"
376
- }), St.set(L.value, t));
448
+ }), Ct.set(P.value, t));
377
449
  let n = {};
378
450
  for (let { type: r, value: i } of t.formatToParts(e)) r !== "literal" && (n[r] = Number(i));
379
451
  return {
380
- day: K(n.year, n.month, n.day),
452
+ day: W(n.year, n.month, n.day),
381
453
  h: n.hour % 24,
382
454
  m: n.minute,
383
455
  s: n.second
384
456
  };
385
457
  }
386
- function dn(e) {
387
- let t = Z(e), { y: n, m: r, d: i } = q(t.day);
458
+ function _n(e) {
459
+ let t = Y(e), { y: n, m: r, d: i } = G(t.day);
388
460
  return Date.UTC(n, r - 1, i, t.h, t.m, t.s) - Math.floor(e / 1e3) * 1e3;
389
461
  }
390
- function fn(e, t, n, r) {
391
- let { y: i, m: a, d: o } = q(e), s = Date.UTC(i, a - 1, o, t, n, r), c = dn(s), l = s - c, u = dn(l);
462
+ function vn(e, t, n, r) {
463
+ let { y: i, m: a, d: o } = G(e), s = Date.UTC(i, a - 1, o, t, n, r), c = _n(s), l = s - c, u = _n(l);
392
464
  return u === c ? l : s - u;
393
465
  }
394
- function Q(e) {
395
- let t = lt.exec(e);
396
- if (t) return fn(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
397
- if (ct.test(e)) return fn(e, 0, 0, 0);
466
+ function X(e) {
467
+ let t = ut.exec(e);
468
+ if (t) return vn(t[1], Number(t[2]), Number(t[3]), Number(t[4] ?? 0));
469
+ if (lt.test(e)) return vn(e, 0, 0, 0);
398
470
  let n = Date.parse(e);
399
471
  return Number.isNaN(n) ? null : n;
400
472
  }
401
- function pn(e) {
402
- if (ct.test(e)) return e;
403
- let t = Q(e);
404
- return t === null ? null : Z(t).day;
473
+ function yn(e) {
474
+ if (lt.test(e)) return e;
475
+ let t = X(e);
476
+ return t === null ? null : Y(t).day;
405
477
  }
406
- function mn(e) {
478
+ function Z(e) {
407
479
  return new Date(e).toISOString().replace(/\.000Z$/, "Z");
408
480
  }
409
- function hn(e) {
481
+ function bn(e) {
410
482
  let t = e.replace(/\s+/g, "");
411
483
  if (!t) return null;
412
484
  if (t === "0") return 0;
413
485
  let n = /(\d+(?:\.\d+)?)(ns|us|µs|ms|w|d|h|m|s)/y, r = 0, i = 0, a;
414
- for (; a = n.exec(t);) r += Number(a[1]) * ut[a[2]], i = n.lastIndex;
486
+ for (; a = n.exec(t);) r += Number(a[1]) * dt[a[2]], i = n.lastIndex;
415
487
  return i === t.length ? r : null;
416
488
  }
417
- function gn(e) {
489
+ function xn(e) {
418
490
  if (e <= 0) return null;
419
491
  let t = Math.floor(e / 3600), n = Math.floor(e % 3600 / 60), r = Math.round(e % 60);
420
492
  return `${t ? `${t}h` : ""}${n ? `${n}m` : ""}${r ? `${r}s` : ""}` || null;
421
493
  }
422
- function _n(e) {
494
+ function Sn(e) {
423
495
  let t = Math.floor(e / 86400), n = Math.floor(e % 86400 / 3600), r = Math.floor(e % 3600 / 60), i = Math.round(e % 60);
424
496
  return [
425
497
  t && `${t}d`,
@@ -428,26 +500,26 @@ var ye = ["for"], be = {
428
500
  i && `${i}s`
429
501
  ].filter(Boolean).join(" ") || "0m";
430
502
  }
431
- function vn(e) {
432
- return B.value && e < B.value || V.value && e > V.value ? !0 : b.isDateDisabled?.(e) ?? !1;
503
+ function Cn(e) {
504
+ return L.value && e < L.value || R.value && e > R.value ? !0 : y.isDateDisabled?.(e) ?? !1;
433
505
  }
434
- function yn(e, t) {
435
- return !!B.value && t < B.value || !!V.value && e > V.value;
506
+ function wn(e, t) {
507
+ return !!L.value && t < L.value || !!R.value && e > R.value;
436
508
  }
437
- function bn(e) {
438
- return e === M.value || R.value && e === (N.value ?? qt.value);
509
+ function Tn(e) {
510
+ return e === A.value || F.value && e === (j.value ?? $t.value);
439
511
  }
440
- function xn(e) {
441
- let t = M.value, n = qt.value;
512
+ function En(e) {
513
+ let t = A.value, n = $t.value;
442
514
  if (!t || !n) return !1;
443
515
  let [r, i] = t <= n ? [t, n] : [n, t];
444
516
  return e >= r && e <= i;
445
517
  }
446
- function Sn(e) {
447
- let t = M.value, n = qt.value, [r, i] = t <= n ? [t, n] : [n, t];
518
+ function Dn(e) {
519
+ let t = A.value, n = $t.value, [r, i] = t <= n ? [t, n] : [n, t];
448
520
  return [e === r && "rounded-l-8", e === i && "rounded-r-8"];
449
521
  }
450
- function Cn(e, t, n, r, i, a, o, s) {
522
+ function Q(e, t, n, r, i, a, o, s) {
451
523
  return {
452
524
  key: e,
453
525
  label: t,
@@ -459,68 +531,83 @@ var ye = ["for"], be = {
459
531
  set: s
460
532
  };
461
533
  }
462
- function wn(e, t) {
463
- let n = [Cn("h", `${t} hours`, 0, 23, !0, !0, () => e.h, (t) => e.h = t), Cn("m", `${t} minutes`, 0, 59, !0, !0, () => e.m, (t) => e.m = t)];
464
- return b.showSeconds && n.push(Cn("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n;
465
- }
466
- function Tn(e) {
467
- return e.padded ? on(e.get()) : String(e.get());
468
- }
469
- function En(e, t) {
534
+ function On(e, t) {
535
+ let n = y.hourCycle === 12, r = [n ? {
536
+ ...Q("h", `${t} hours`, 0, 11, !0, !0, () => e.h % 12, (t) => e.h = t + (e.h >= 12 ? 12 : 0)),
537
+ text: (e) => U(e || 12)
538
+ } : Q("h", `${t} hours`, 0, 23, !0, !0, () => e.h, (t) => e.h = t), Q("m", `${t} minutes`, 0, 59, !0, !0, () => e.m, (t) => e.m = t)];
539
+ return y.showSeconds && r.push(Q("s", `${t} seconds`, 0, 59, !0, !0, () => e.s, (t) => e.s = t)), n && r.push({
540
+ ...Q("p", `${t} AM or PM`, 0, 12, !1, !1, () => e.h >= 12 ? 12 : 0, (t) => e.h = e.h % 12 + t),
541
+ values: [0, 12],
542
+ text: (e) => e ? "PM" : "AM"
543
+ }), r;
544
+ }
545
+ function kn(e) {
546
+ return e.padded ? U(e.get()) : String(e.get());
547
+ }
548
+ function An(e, t) {
470
549
  let n = t.get(), r = t.max - t.min + 1, i = null;
471
- e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = Tn(t));
550
+ e.key === "ArrowUp" ? i = n + 1 : e.key === "ArrowDown" ? i = n - 1 : e.key === "PageUp" ? i = n + 10 : e.key === "PageDown" ? i = n - 10 : e.key === "Home" ? i = t.min : e.key === "End" && (i = t.max), i !== null && (e.preventDefault(), i = t.wrap ? ((i - t.min) % r + r) % r + t.min : Math.min(t.max, Math.max(t.min, i)), t.set(i), e.target.value = kn(t));
472
551
  }
473
- function Dn(e, t) {
552
+ function jn(e, t) {
474
553
  let n = e.target, r = n.value.replace(/\D/g, "").slice(0, String(t.max).length);
475
554
  if (n.value = r, !r) return;
476
555
  let i = Number(r);
477
556
  i > t.max && (i = Number(r.slice(-1))), t.set(Math.max(t.min, i));
478
557
  }
479
- function On(e, t) {
480
- e.target.value = Tn(t);
558
+ function Mn(e, t) {
559
+ e.target.value = kn(t);
481
560
  }
482
- function kn() {
483
- if (j.value = null, E.value = "days", k.value = "date", b.mode === "duration") {
484
- let e = H.value[0] ? hn(H.value[0]) ?? 0 : 0;
485
- I.d = Math.floor(e / 86400), I.h = Math.floor(e % 86400 / 3600), I.m = Math.floor(e % 3600 / 60);
561
+ function Nn(e = !0) {
562
+ if (Et.value = null, e && (T.value = "days", O.value = "date"), y.mode === "duration") {
563
+ let e = z.value[0] ? bn(z.value[0]) ?? 0 : 0;
564
+ N.d = Math.floor(e / 86400), N.h = Math.floor(e % 86400 / 3600), N.m = Math.floor(e % 3600 / 60);
486
565
  return;
487
566
  }
488
- let [e, t] = H.value;
489
- if (M.value = null, N.value = null, Object.assign(P, {
567
+ let [t, n] = z.value;
568
+ if (A.value = null, j.value = null, Object.assign(M, {
490
569
  h: 0,
491
570
  m: 0,
492
571
  s: 0
493
- }), Object.assign(F, {
572
+ }), Object.assign(Dt, {
494
573
  h: 23,
495
574
  m: 59,
496
- s: b.showSeconds ? 59 : 0
497
- }), z.value) {
498
- let n = e ? Q(e) : null, r = t ? Q(t) : null;
499
- if (n !== null) {
500
- let e = Z(n);
501
- M.value = e.day, Object.assign(P, {
502
- h: e.h,
503
- m: e.m,
504
- s: e.s
575
+ s: y.showSeconds ? 59 : 0
576
+ }), y.autoApply) {
577
+ let e = Y(Date.now());
578
+ Object.assign(M, {
579
+ h: e.h,
580
+ m: e.m,
581
+ s: 0
582
+ });
583
+ }
584
+ if (I.value) {
585
+ let e = t ? X(t) : null, r = n ? X(n) : null;
586
+ if (e !== null) {
587
+ let t = Y(e);
588
+ A.value = t.day, Object.assign(M, {
589
+ h: t.h,
590
+ m: t.m,
591
+ s: t.s
505
592
  });
506
593
  }
507
594
  if (r !== null) {
508
- let e = Z(r);
509
- N.value = e.day, Object.assign(F, {
595
+ let e = Y(r);
596
+ j.value = e.day, Object.assign(Dt, {
510
597
  h: e.h,
511
598
  m: e.m,
512
599
  s: e.s
513
600
  });
514
601
  }
515
- } else M.value = e ? pn(e) : null, N.value = t ? pn(t) : null;
516
- let n = M.value ?? Nt.value;
517
- !M.value && B.value && n < B.value && (n = B.value), !M.value && V.value && n > V.value && (n = V.value), A.value = n, T.value = X(n);
518
- }
519
- function An() {
520
- let e = wt.value;
521
- if (!e) return;
522
- let n = e.getBoundingClientRect(), r = t(), i = C.value?.offsetWidth ?? 300, a = C.value?.offsetHeight ?? 380, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = Math.max(8, Math.min(n.left - r.left, r.width - i - 8)), u = Math.min(n.width, 448);
523
- w.value = c ? {
602
+ } else A.value = t ? yn(t) : null, j.value = n ? yn(n) : null;
603
+ let r = A.value ?? It.value;
604
+ !A.value && L.value && r < L.value && (r = L.value), !A.value && R.value && r > R.value && (r = R.value), k.value = r, w.value = J(r);
605
+ }
606
+ function Pn() {
607
+ let t = Tt.value;
608
+ if (!t) return;
609
+ let n = t.getBoundingClientRect(), r = e(), i = S.value?.offsetWidth ?? 300, a = S.value?.offsetHeight ?? 380, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = Math.max(8, Math.min(n.left - r.left, r.width - i - 8)), u = Math.min(n.width, 448);
610
+ C.value = c ? {
524
611
  bottom: r.bottom - n.top + 6,
525
612
  left: l,
526
613
  maxHeight: Math.max(200, s),
@@ -532,117 +619,123 @@ var ye = ["for"], be = {
532
619
  minWidth: u
533
620
  };
534
621
  }
535
- function jn() {
536
- b.disabled || x.value || (x.value = !0);
622
+ function Fn() {
623
+ y.disabled || b.value || (b.value = !0);
537
624
  }
538
- function Mn(e = !0) {
539
- x.value && (x.value = !1, e && wt.value?.focus());
625
+ function In(e = !0) {
626
+ b.value && (b.value = !1, e && Tt.value?.focus());
540
627
  }
541
- async function Nn() {
542
- kn(), An(), or(), await p(), An(), b.mode === "duration" ? C.value?.querySelector("input")?.focus() : Pn();
628
+ async function Ln() {
629
+ Nn(), Pn(), fr(), await f(), Pn(), y.mode === "duration" ? S.value?.querySelector("input")?.focus() : Rn();
543
630
  }
544
- function Pn() {
545
- p(() => C.value?.querySelector(`[data-day="${A.value}"]`)?.focus());
631
+ function Rn() {
632
+ f(() => S.value?.querySelector(`[data-day="${k.value}"]`)?.focus());
633
+ }
634
+ function $(e, t = !0) {
635
+ zt.value = e, t && In();
636
+ }
637
+ function zn() {
638
+ y.autoApply && I.value && (F.value || (A.value ??= k.value), rn.value && $(F.value ? [Z(H.value), Z(en.value)] : Z(H.value), !1));
546
639
  }
547
- function $(e) {
548
- st.value = e, Mn();
640
+ function Bn() {
641
+ y.inline ? Nn(!1) : In();
549
642
  }
550
- function Fn(e) {
551
- if (!vn(e)) {
552
- if (A.value = e, X(e) !== T.value && (T.value = X(e), Pn()), !R.value) {
553
- M.value = e, z.value || $(e);
643
+ function Vn(e) {
644
+ if (!Cn(e)) {
645
+ if (k.value = e, J(e) !== w.value && (w.value = J(e), Rn()), !F.value) {
646
+ A.value = e, I.value ? zn() : $(e);
554
647
  return;
555
648
  }
556
- if (!M.value || N.value) {
557
- M.value = e, N.value = null;
649
+ if (!A.value || j.value) {
650
+ A.value = e, j.value = null;
558
651
  return;
559
652
  }
560
- e < M.value ? (N.value = M.value, M.value = e) : N.value = e, j.value = null, z.value || $([M.value, N.value]);
653
+ e < A.value ? (j.value = A.value, A.value = e) : j.value = e, Et.value = null, I.value ? zn() : $([A.value, j.value]);
561
654
  }
562
655
  }
563
- function In() {
564
- if (Xt.value) {
565
- if (b.mode === "duration") return $(gn(Zt.value));
566
- if (!z.value) return $(R.value ? [M.value, N.value] : M.value);
567
- $(R.value ? [mn(G.value), mn(Jt.value)] : mn(G.value));
656
+ function Hn() {
657
+ if (rn.value) {
658
+ if (y.mode === "duration") return $(xn(an.value));
659
+ if (!I.value) return $(F.value ? [A.value, j.value] : A.value);
660
+ $(F.value ? [Z(H.value), Z(en.value)] : Z(H.value));
568
661
  }
569
662
  }
570
- function Ln() {
571
- let e = Z(Date.now());
572
- M.value = e.day, Object.assign(P, {
663
+ function Un() {
664
+ let e = Y(Date.now());
665
+ A.value = e.day, Object.assign(M, {
573
666
  h: e.h,
574
667
  m: e.m,
575
- s: b.showSeconds ? e.s : 0
576
- }), A.value = e.day, T.value = X(e.day), E.value = "days", k.value === "time" && p(() => Zn("smooth"));
668
+ s: y.showSeconds ? e.s : 0
669
+ }), k.value = e.day, w.value = J(e.day), T.value = "days", zn(), O.value === "time" && f(() => rr("smooth"));
577
670
  }
578
- function Rn() {
579
- Fn(Nt.value);
671
+ function Wn() {
672
+ Vn(It.value);
580
673
  }
581
- function zn(e) {
674
+ function Gn(e) {
582
675
  if (e.value) return $(e.value());
583
676
  if (!e.duration) return;
584
- if (b.mode === "duration") return $(gn(hn(e.duration) ?? 0));
585
- let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (hn(e.duration) ?? 0) * 1e3;
586
- if (b.mode === "date") return $(R.value ? [Z(n).day, Z(t).day] : Z(n).day);
587
- $(R.value ? [mn(n), mn(t)] : mn(n));
677
+ if (y.mode === "duration") return $(xn(bn(e.duration) ?? 0));
678
+ let t = Math.floor(Date.now() / 1e3) * 1e3, n = t - (bn(e.duration) ?? 0) * 1e3;
679
+ if (y.mode === "date") return $(F.value ? [Y(n).day, Y(t).day] : Y(n).day);
680
+ $(F.value ? [Z(n), Z(t)] : Z(n));
588
681
  }
589
- function Bn() {
590
- st.value = null, wt.value?.focus();
682
+ function Kn() {
683
+ zt.value = null, Tt.value?.focus();
591
684
  }
592
- function Vn(e) {
593
- T.value = sn(T.value, e), A.value = sn(A.value, e);
685
+ function qn(e) {
686
+ w.value = pn(w.value, e), k.value = pn(k.value, e);
594
687
  }
595
- function Hn(e) {
596
- E.value === "days" ? Vn(e) : E.value === "months" ? T.value = sn(T.value, 12 * e) : D.value += 10 * e;
688
+ function Jn(e) {
689
+ T.value === "days" ? qn(e) : T.value === "months" ? w.value = pn(w.value, 12 * e) : E.value += 10 * e;
597
690
  }
598
- function Un() {
599
- E.value = "months", O.value = Bt.value, Gn();
691
+ function Yn() {
692
+ T.value = "months", D.value = Kt.value, Zn();
600
693
  }
601
- function Wn() {
602
- E.value = "years", D.value = Math.floor(U.value / 10) * 10, O.value = U.value, Gn();
694
+ function Xn() {
695
+ T.value = "years", E.value = Math.floor(B.value / 10) * 10, D.value = B.value, Zn();
603
696
  }
604
- function Gn() {
605
- p(() => C.value?.querySelector(`[data-pick="${Gt.value}"]`)?.focus());
697
+ function Zn() {
698
+ f(() => S.value?.querySelector(`[data-pick="${Zt.value}"]`)?.focus());
606
699
  }
607
- function Kn(e) {
700
+ function Qn(e) {
608
701
  if (!e.disabled) {
609
- if (E.value === "years") {
610
- T.value = K(e.value, Bt.value + 1, 1), Un();
702
+ if (T.value === "years") {
703
+ w.value = W(e.value, Kt.value + 1, 1), Yn();
611
704
  return;
612
705
  }
613
- T.value = K(U.value, e.value + 1, 1), A.value = K(U.value, e.value + 1, Math.min(q(A.value).d, cn(T.value))), E.value = "days", Pn();
706
+ w.value = W(B.value, e.value + 1, 1), k.value = W(B.value, e.value + 1, Math.min(G(k.value).d, mn(w.value))), T.value = "days", Rn();
614
707
  }
615
708
  }
616
- function qn(e) {
709
+ function $n(e) {
617
710
  if (e.key === "Escape") {
618
- e.preventDefault(), e.stopPropagation(), E.value === "years" ? Un() : (E.value = "days", Pn());
711
+ e.preventDefault(), e.stopPropagation(), T.value === "years" ? Yn() : (T.value = "days", Rn());
619
712
  return;
620
713
  }
621
714
  if (e.key === "Enter" || e.key === " ") {
622
715
  e.preventDefault();
623
- let t = Ut.value.find((e) => e.value === O.value);
624
- t && Kn(t);
716
+ let t = Yt.value.find((e) => e.value === D.value);
717
+ t && Qn(t);
625
718
  return;
626
719
  }
627
- let t = E.value === "years", n = t ? D.value : 0, r = {
720
+ let t = T.value === "years", n = t ? E.value : 0, r = {
628
721
  ArrowLeft: -1,
629
722
  ArrowRight: 1,
630
723
  ArrowUp: -4,
631
724
  ArrowDown: 4
632
725
  }, i;
633
- if (e.key in r) i = O.value + r[e.key];
726
+ if (e.key in r) i = D.value + r[e.key];
634
727
  else if (e.key === "Home") i = n;
635
728
  else if (e.key === "End") i = n + 11;
636
729
  else if (e.key === "PageUp" || e.key === "PageDown") {
637
- e.preventDefault(), Hn(e.key === "PageUp" ? -1 : 1), t && (O.value += e.key === "PageUp" ? -10 : 10), Gn();
730
+ e.preventDefault(), Jn(e.key === "PageUp" ? -1 : 1), t && (D.value += e.key === "PageUp" ? -10 : 10), Zn();
638
731
  return;
639
732
  } else return;
640
- e.preventDefault(), t ? i < D.value ? D.value -= 10 : i > D.value + 11 && (D.value += 10) : i = Math.max(0, Math.min(11, i)), O.value = i, Gn();
733
+ e.preventDefault(), t ? i < E.value ? E.value -= 10 : i > E.value + 11 && (E.value += 10) : i = Math.max(0, Math.min(11, i)), D.value = i, Zn();
641
734
  }
642
- function Jn(e) {
643
- k.value = e, e === "time" && p(() => Zn("instant"));
735
+ function er(e) {
736
+ O.value = e, e === "time" && f(() => rr("instant"));
644
737
  }
645
- function Yn(e) {
738
+ function tr(e) {
646
739
  if (![
647
740
  "ArrowLeft",
648
741
  "ArrowRight",
@@ -650,15 +743,15 @@ var ye = ["for"], be = {
650
743
  "End"
651
744
  ].includes(e.key)) return;
652
745
  e.preventDefault();
653
- let t = e.key === "Home" ? "date" : e.key === "End" || k.value === "date" ? "time" : "date";
654
- Jn(t), p(() => C.value?.querySelector(`[data-tab="${t}"]`)?.focus());
746
+ let t = e.key === "Home" ? "date" : e.key === "End" || O.value === "date" ? "time" : "date";
747
+ er(t), f(() => S.value?.querySelector(`[data-tab="${t}"]`)?.focus());
655
748
  }
656
- function Xn(e) {
657
- return Array.from({ length: e.max - e.min + 1 }, (t, n) => e.min + n);
749
+ function nr(e) {
750
+ return e.values ?? Array.from({ length: e.max - e.min + 1 }, (t, n) => e.min + n);
658
751
  }
659
- function Zn(e) {
752
+ function rr(e) {
660
753
  let t = e === "smooth" && !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
661
- C.value?.querySelectorAll("[data-time-list]").forEach((e) => {
754
+ S.value?.querySelectorAll("[data-time-list]").forEach((e) => {
662
755
  let n = e.querySelector("[aria-selected=true]");
663
756
  n && e.scrollTo({
664
757
  top: n.offsetTop - (e.clientHeight - n.offsetHeight) / 2,
@@ -666,347 +759,362 @@ var ye = ["for"], be = {
666
759
  });
667
760
  });
668
761
  }
669
- function Qn(e) {
670
- C.value?.querySelector(`[data-time-list="${e}"] [aria-selected=true]`)?.focus({ preventScroll: !0 });
762
+ function ir(e) {
763
+ S.value?.querySelector(`[data-time-list="${e}"] [aria-selected=true]`)?.focus({ preventScroll: !0 });
671
764
  }
672
- function $n(e, t, n) {
673
- e.set(t), p(() => {
674
- Zn("smooth"), Qn(n);
765
+ function ar(e, t, n) {
766
+ e.set(t), zn(), f(() => {
767
+ rr("smooth"), ir(n);
675
768
  });
676
769
  }
677
- function er(e, t, n) {
770
+ function or(e, t, n) {
678
771
  if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
679
772
  e.preventDefault();
680
- let t = [...C.value?.querySelectorAll("[data-time-list]") ?? []].map((e) => e.dataset.timeList), r = t[t.indexOf(n) + (e.key === "ArrowRight" ? 1 : -1)];
681
- r && Qn(r);
773
+ let t = [...S.value?.querySelectorAll("[data-time-list]") ?? []].map((e) => e.dataset.timeList), r = t[t.indexOf(n) + (e.key === "ArrowRight" ? 1 : -1)];
774
+ r && ir(r);
682
775
  return;
683
776
  }
684
- let r = t.get(), i = {
685
- ArrowUp: r - 1,
686
- ArrowDown: r + 1,
687
- PageUp: r - 5,
688
- PageDown: r + 5,
689
- Home: t.min,
690
- End: t.max
777
+ let r = nr(t), i = r.indexOf(t.get()), a = {
778
+ ArrowUp: i - 1,
779
+ ArrowDown: i + 1,
780
+ PageUp: i - 5,
781
+ PageDown: i + 5,
782
+ Home: 0,
783
+ End: r.length - 1
691
784
  };
692
- e.key in i && (e.preventDefault(), $n(t, Math.min(t.max, Math.max(t.min, i[e.key])), n));
693
- }
694
- function tr(e) {
695
- let t = A.value, n = (ln(t) - Tt.value + 7) % 7, r = {
696
- ArrowLeft: () => Y(t, -1),
697
- ArrowRight: () => Y(t, 1),
698
- ArrowUp: () => Y(t, -7),
699
- ArrowDown: () => Y(t, 7),
700
- Home: () => Y(t, -n),
701
- End: () => Y(t, 6 - n),
702
- PageUp: () => sn(t, e.shiftKey ? -12 : -1),
703
- PageDown: () => sn(t, e.shiftKey ? 12 : 1)
785
+ e.key in a && (e.preventDefault(), ar(t, r[Math.min(r.length - 1, Math.max(0, a[e.key]))], n));
786
+ }
787
+ function sr(e) {
788
+ let t = k.value, n = (hn(t) - Ot.value + 7) % 7, r = {
789
+ ArrowLeft: () => q(t, -1),
790
+ ArrowRight: () => q(t, 1),
791
+ ArrowUp: () => q(t, -7),
792
+ ArrowDown: () => q(t, 7),
793
+ Home: () => q(t, -n),
794
+ End: () => q(t, 6 - n),
795
+ PageUp: () => pn(t, e.shiftKey ? -12 : -1),
796
+ PageDown: () => pn(t, e.shiftKey ? 12 : 1)
704
797
  };
705
798
  if (e.key === "Enter" || e.key === " ") {
706
- e.preventDefault(), Fn(t);
799
+ e.preventDefault(), Vn(t);
707
800
  return;
708
801
  }
709
802
  let i = r[e.key];
710
- i && (e.preventDefault(), A.value = i(), T.value = X(A.value), R.value && M.value && !N.value && (j.value = A.value), Pn());
803
+ i && (e.preventDefault(), k.value = i(), w.value = J(k.value), F.value && A.value && !j.value && (Et.value = k.value), Rn());
711
804
  }
712
- function nr(e) {
805
+ function cr(e) {
806
+ if (y.inline) return;
713
807
  if (e.key === "Escape") {
714
- e.preventDefault(), e.stopPropagation(), Mn();
808
+ e.preventDefault(), e.stopPropagation(), In();
715
809
  return;
716
810
  }
717
- if (e.key !== "Tab" || !C.value) return;
718
- let t = [...C.value.querySelectorAll("button:not([disabled]), input:not([disabled])")].filter((e) => e.tabIndex >= 0);
811
+ if (e.key !== "Tab" || !S.value) return;
812
+ let t = [...S.value.querySelectorAll("button:not([disabled]), input:not([disabled])")].filter((e) => e.tabIndex >= 0);
719
813
  if (!t.length) return;
720
814
  let n = t[0], r = t[t.length - 1];
721
815
  e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
722
816
  }
723
- function rr(e) {
724
- (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), jn());
817
+ function lr(e) {
818
+ (e.key === "ArrowDown" || e.key === "ArrowUp" && e.altKey) && (e.preventDefault(), Fn());
725
819
  }
726
- function ir(e) {
820
+ function ur(e) {
727
821
  let t = e.target;
728
- Ct.value?.contains(t) || C.value?.contains(t) || Mn(!1);
822
+ wt.value?.contains(t) || S.value?.contains(t) || In(!1);
729
823
  }
730
- function ar(e) {
731
- e?.target instanceof Node && C.value?.contains(e.target) || An();
824
+ function dr(e) {
825
+ e?.target instanceof Node && S.value?.contains(e.target) || Pn();
732
826
  }
733
- function or() {
734
- document.addEventListener("pointerdown", ir, !0), window.addEventListener("scroll", ar, !0), window.addEventListener("resize", ar);
827
+ function fr() {
828
+ document.addEventListener("pointerdown", ur, !0), window.addEventListener("scroll", dr, !0), window.addEventListener("resize", dr);
735
829
  }
736
- function sr() {
737
- document.removeEventListener("pointerdown", ir, !0), window.removeEventListener("scroll", ar, !0), window.removeEventListener("resize", ar);
830
+ function pr() {
831
+ document.removeEventListener("pointerdown", ur, !0), window.removeEventListener("scroll", dr, !0), window.removeEventListener("resize", dr);
738
832
  }
739
- return ue(x, (e) => e ? Nn() : sr()), ie(() => {
740
- x.value && Nn();
741
- }), re(sr), ee({ focus: () => wt.value?.focus() }), (t, a) => (h(), c("div", te({
833
+ return de(b, (e) => e ? Ln() : pr()), de(zt, () => y.inline && Nn(!1)), ie(() => {
834
+ y.inline ? Nn() : b.value && Ln();
835
+ }), re(pr), te({ focus: () => y.inline ? Rn() : Tt.value?.focus() }), (e, a) => (m(), c("div", ne({
742
836
  ref_key: "root",
743
- ref: Ct
744
- }, ht.value, {
745
- class: ["w-full", f.disabled && "opacity-50"],
837
+ ref: wt
838
+ }, gt.value, {
839
+ class: ["w-full", d.disabled && "opacity-50"],
746
840
  "data-ac-ds": "",
747
841
  "data-testid": "ac-date-picker"
748
842
  }), [
749
- f.label ? (h(), c("label", {
843
+ d.label || e.$slots["label-icon"] || e.$slots["label-extra"] ? (m(), c("label", {
750
844
  key: 0,
751
- id: _t,
752
- for: `${y(S)}-trigger`,
845
+ id: vt,
846
+ for: d.inline ? void 0 : `${v(x)}-trigger`,
753
847
  class: "mb-2 flex items-center gap-1 text-base font-medium text-heading"
754
- }, [l("span", null, v(f.label), 1), f.required ? (h(), c("span", be, "*")) : s("", !0)], 8, ye)) : s("", !0),
755
- f.hint ? (h(), c("p", {
848
+ }, [
849
+ oe(e.$slots, "label-icon"),
850
+ d.label ? (m(), c("span", xe, _(d.label), 1)) : s("", !0),
851
+ oe(e.$slots, "label-extra"),
852
+ d.required ? (m(), c("span", Se, "*")) : s("", !0)
853
+ ], 8, be)) : s("", !0),
854
+ d.hint ? (m(), c("p", {
756
855
  key: 1,
757
- id: xt,
856
+ id: St,
758
857
  class: "mb-2 text-base text-muted"
759
- }, v(f.hint), 1)) : s("", !0),
760
- l("div", xe, [l("button", te({
761
- id: `${y(S)}-trigger`,
858
+ }, _(d.hint), 1)) : s("", !0),
859
+ d.inline ? s("", !0) : (m(), c("div", {
860
+ key: 2,
861
+ class: p(["relative", d.fieldClass])
862
+ }, [l("button", ne({
863
+ id: `${v(x)}-trigger`,
762
864
  ref_key: "trigger",
763
- ref: wt
764
- }, gt.value, {
865
+ ref: Tt
866
+ }, _t.value, {
765
867
  type: "button",
766
- disabled: f.disabled,
868
+ disabled: d.disabled,
767
869
  "aria-haspopup": "dialog",
768
- "aria-expanded": x.value,
769
- "aria-labelledby": f.label ? `${_t} ${vt}` : vt,
770
- "aria-describedby": nn.value,
771
- "aria-invalid": !!f.errorMsg || void 0,
772
- "aria-required": f.required || void 0,
773
- class: ["flex w-full items-center rounded-10 border bg-background text-left text-base font-normal text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
774
- f.size === "small" ? "h-9 pl-3" : "h-10.5 pl-4",
775
- f.clearable && It.value && !f.disabled ? "pr-20" : "pr-10",
776
- f.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
777
- f.errorMsg ? ["border-danger/60", tn.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : tn.value ? "focus-ring" : ["border-border", !f.disabled && "hover:border-accent-active"]
870
+ "aria-expanded": b.value,
871
+ "aria-labelledby": d.label || e.$slots["label-icon"] || e.$slots["label-extra"] ? `${vt} ${yt}` : yt,
872
+ "aria-describedby": un.value,
873
+ "aria-invalid": !!d.errorMsg || void 0,
874
+ "aria-required": d.required || void 0,
875
+ class: ["flex w-full items-center rounded-10 border bg-background text-left text-heading transition-[color,background-color,border-color,box-shadow] duration-200 outline-none disabled:cursor-not-allowed", [
876
+ d.size === "small" ? "h-9 pl-3 text-base font-normal" : d.size === "large" ? "h-[50px] pl-4 text-lg font-medium" : "h-10.5 pl-4 text-base font-normal",
877
+ d.clearable && Ht.value && !d.disabled ? "pr-20" : "pr-10",
878
+ d.disabled ? "" : "cursor-pointer hover:bg-accent-hover",
879
+ d.errorMsg ? ["border-danger/60", ln.value && "border-danger shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-danger)_20%,transparent)]"] : ln.value ? "focus-ring" : ["border-border", !d.disabled && "hover:border-accent-active"]
778
880
  ]],
779
- onClick: a[0] ||= (e) => x.value ? Mn() : jn(),
780
- onKeydown: rr,
781
- onFocus: a[1] ||= (e) => en.value = !0,
782
- onBlur: a[2] ||= (e) => en.value = !1
881
+ onClick: a[0] ||= (e) => b.value ? In() : Fn(),
882
+ onKeydown: lr,
883
+ onFocus: a[1] ||= (e) => cn.value = !0,
884
+ onBlur: a[2] ||= (e) => cn.value = !1
783
885
  }), [l("span", {
784
- id: vt,
785
- class: m(["truncate tabular-nums", !Lt.value && "text-muted/80"])
786
- }, v(Lt.value || f.placeholder || (f.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Se), l("span", { class: m(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", f.size === "small" ? "right-3" : "right-4"]) }, [f.clearable && It.value && !f.disabled ? (h(), c("button", {
886
+ id: yt,
887
+ class: p(["truncate tabular-nums", !Ut.value && "text-muted/80"])
888
+ }, _(Ut.value || d.placeholder || (d.mode === "duration" ? "Choose duration" : "Choose date")), 3)], 16, Ce), l("span", { class: p(["pointer-events-none absolute inset-y-0 flex items-center gap-4 text-muted", d.size === "small" ? "right-3" : "right-4"]) }, [d.clearable && Ht.value && !d.disabled ? (m(), c("button", {
787
889
  key: 0,
788
890
  type: "button",
789
891
  class: "pointer-events-auto inline-flex cursor-pointer items-center justify-center rounded-full p-1 transition-colors duration-200 hover:bg-accent-hover hover:text-primary active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
790
- "aria-label": f.label ? `Clear ${f.label}` : "Clear",
791
- onClick: Bn
792
- }, [d(y(ve), {
892
+ "aria-label": d.label ? `Clear ${d.label}` : "Clear",
893
+ onClick: Kn
894
+ }, [ee(v(ye), {
793
895
  class: "size-4",
794
896
  "aria-hidden": "true"
795
- })], 8, Ce)) : s("", !0), (h(), o(oe(an.value), {
796
- class: m(["size-4", x.value && "text-heading"]),
897
+ })], 8, we)) : s("", !0), (m(), o(se(fn.value), {
898
+ class: p(["size-4", b.value && "text-heading"]),
797
899
  "aria-hidden": "true"
798
- }, null, 8, ["class"]))], 2)]),
799
- f.errorMsg ? (h(), c("p", {
800
- key: 2,
801
- id: bt,
802
- class: "mt-1 text-base text-danger-strong",
803
- role: "alert"
804
- }, v(f.errorMsg), 1)) : s("", !0),
805
- f.name ? (h(), c("input", {
806
- key: 3,
807
- type: "hidden",
808
- name: f.name,
809
- value: Rt.value
810
- }, null, 8, we)) : s("", !0),
811
- (h(), o(r, { to: "body" }, [d(i, {
900
+ }, null, 8, ["class"]))], 2)], 2)),
901
+ (m(), o(r, {
902
+ to: "body",
903
+ disabled: d.inline
904
+ }, [ee(i, {
812
905
  "enter-active-class": "transition duration-150 ease-out motion-reduce:transition-opacity",
813
906
  "enter-from-class": "opacity-0 scale-95",
814
907
  "leave-active-class": "transition duration-100 ease-in",
815
908
  "leave-to-class": "opacity-0"
816
909
  }, {
817
- default: de(() => [x.value ? (h(), c("div", {
910
+ default: fe(() => [b.value || d.inline ? (m(), c("div", ne({
818
911
  key: 0,
819
912
  ref_key: "panel",
820
- ref: C,
821
- role: "dialog",
822
- "aria-modal": "true",
823
- "aria-label": rn.value,
824
- class: "ac-scrollbar fixed z-[90] flex max-w-[calc(100vw-16px)] flex-col rounded-10 border border-border bg-surface shadow-sm sm:flex-row",
825
- style: ne({
826
- top: w.value.top === void 0 ? void 0 : `${w.value.top}px`,
827
- bottom: w.value.bottom === void 0 ? void 0 : `${w.value.bottom}px`,
828
- left: `${w.value.left}px`,
829
- maxHeight: `${w.value.maxHeight}px`,
830
- minWidth: `${w.value.minWidth}px`
831
- }),
913
+ ref: S,
914
+ role: d.inline ? "group" : "dialog",
915
+ "aria-modal": d.inline ? void 0 : "true",
916
+ "aria-label": dn.value,
917
+ "aria-describedby": d.inline ? un.value : void 0,
918
+ inert: d.inline && d.disabled
919
+ }, d.inline ? _t.value : void 0, {
920
+ class: ["flex flex-col sm:flex-row", !d.inline && "ac-scrollbar fixed z-[90] max-w-[calc(100vw-16px)] rounded-10 border border-border bg-surface shadow-sm"],
921
+ style: d.inline ? void 0 : {
922
+ top: C.value.top === void 0 ? void 0 : `${C.value.top}px`,
923
+ bottom: C.value.bottom === void 0 ? void 0 : `${C.value.bottom}px`,
924
+ left: `${C.value.left}px`,
925
+ maxHeight: `${C.value.maxHeight}px`,
926
+ minWidth: `${C.value.minWidth}px`
927
+ },
832
928
  "data-ac-ds": "",
833
929
  "data-testid": "ac-date-picker-panel",
834
- onKeydown: nr
835
- }, [f.presets.length ? (h(), c("div", Ee, [(h(!0), c(n, null, _(f.presets, (e) => (h(), c("button", {
930
+ onKeydown: cr
931
+ }), [d.presets.length ? (m(), c("div", Ee, [(m(!0), c(n, null, g(d.presets, (e) => (m(), c("button", {
836
932
  key: e.label,
837
933
  type: "button",
838
934
  class: "cursor-pointer rounded-8 px-3 py-2 text-left text-base text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset max-sm:rounded-full max-sm:border max-sm:border-border max-sm:px-2.5 max-sm:py-1 max-sm:text-xs",
839
- onClick: (t) => zn(e)
840
- }, v(e.label), 9, De))), 128))])) : s("", !0), l("div", { class: m(["max-w-full min-w-0 flex-auto max-sm:w-auto", f.mode === "duration" ? "w-72" : "w-[calc(328px*var(--ac-scale))]"]) }, [f.mode === "duration" ? (h(), c("div", Oe, [
841
- l("p", ke, v(f.label || "Duration"), 1),
842
- l("p", Ae, v(_n(Zt.value)), 1),
843
- l("div", je, [(h(!0), c(n, null, _($t.value, (e) => (h(), c("label", {
935
+ onClick: (t) => Gn(e)
936
+ }, _(e.label), 9, De))), 128))])) : s("", !0), l("div", { class: p(["max-w-full min-w-0 flex-auto max-sm:w-auto", d.inline ? "w-full" : d.mode === "duration" ? "w-72" : "w-[calc(328px*var(--ac-scale))]"]) }, [d.mode === "duration" ? (m(), c("div", Oe, [
937
+ l("p", ke, _(d.label || "Duration"), 1),
938
+ l("p", Ae, _(Sn(an.value)), 1),
939
+ l("div", je, [(m(!0), c(n, null, g(sn.value, (e) => (m(), c("label", {
844
940
  key: e.key,
845
941
  class: "block"
846
- }, [l("span", Me, v(e.label), 1), l("input", {
942
+ }, [l("span", Me, _(e.label), 1), l("input", {
847
943
  type: "text",
848
944
  inputmode: "numeric",
849
945
  role: "spinbutton",
850
946
  autocomplete: "off",
851
- value: Tn(e),
947
+ value: kn(e),
852
948
  "aria-valuenow": e.get(),
853
949
  "aria-valuemin": e.min,
854
950
  "aria-valuemax": e.max,
855
951
  class: "h-10 w-full rounded-10 border border-border bg-background px-2.5 text-center text-base text-heading tabular-nums transition-[border-color,box-shadow] duration-200 outline-none hover:border-accent-active focus:focus-ring",
856
- onKeydown: (t) => En(t, e),
857
- onInput: (t) => Dn(t, e),
858
- onBlur: (t) => On(t, e),
952
+ onKeydown: (t) => An(t, e),
953
+ onInput: (t) => jn(t, e),
954
+ onBlur: (t) => Mn(t, e),
859
955
  onFocus: a[3] ||= (e) => e.target.select()
860
956
  }, null, 40, Ne)]))), 128))]),
861
- a[10] ||= l("p", { class: "mt-2 text-xs text-muted" }, "↑ ↓ to adjust, or type a number.", -1)
862
- ])) : (h(), c(n, { key: 1 }, [z.value ? (h(), c("div", {
957
+ a[9] ||= l("p", { class: "mt-2 text-xs text-muted" }, "↑ ↓ to adjust, or type a number.", -1)
958
+ ])) : (m(), c(n, { key: 1 }, [I.value ? (m(), c("div", {
863
959
  key: 0,
864
960
  role: "tablist",
865
961
  "aria-label": "Date or time",
866
962
  class: "flex border-b border-border",
867
- onKeydown: Yn
868
- }, [(h(), c(n, null, _(pt, (e) => l("button", {
869
- id: `${y(S)}-tab-${e.key}`,
963
+ onKeydown: tr
964
+ }, [(m(), c(n, null, g(mt, (e) => l("button", {
965
+ id: `${v(x)}-tab-${e.key}`,
870
966
  key: e.key,
871
967
  type: "button",
872
968
  role: "tab",
873
969
  "data-tab": e.key,
874
- "aria-selected": k.value === e.key,
875
- "aria-controls": `${y(S)}-tabpanel`,
876
- tabindex: k.value === e.key ? 0 : -1,
877
- class: m(["flex flex-1 cursor-pointer items-center justify-center gap-2 px-4 py-2 text-base font-medium transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset", k.value === e.key ? "bg-primary text-white focus-visible:ring-white/70" : "text-heading hover:bg-accent-hover focus-visible:ring-ring active:bg-accent-active"]),
878
- onClick: (t) => Jn(e.key)
879
- }, [(h(), o(oe(e.icon), {
970
+ "aria-selected": O.value === e.key,
971
+ "aria-controls": `${v(x)}-tabpanel`,
972
+ tabindex: O.value === e.key ? 0 : -1,
973
+ class: p(["flex flex-1 cursor-pointer items-center justify-center gap-2 px-4 py-2 text-base font-medium transition-colors duration-200 focus-visible:ring-2 focus-visible:outline-none focus-visible:ring-inset", O.value === e.key ? "bg-primary text-white focus-visible:ring-white/70" : "text-heading hover:bg-accent-hover focus-visible:ring-ring active:bg-accent-active"]),
974
+ onClick: (t) => er(e.key)
975
+ }, [(m(), o(se(e.icon), {
880
976
  class: "size-4",
881
977
  "aria-hidden": "true"
882
- })), u(" " + v(e.label), 1)], 10, Pe)), 64))], 32)) : s("", !0), l("div", {
883
- id: `${y(S)}-tabpanel`,
978
+ })), u(" " + _(e.label), 1)], 10, Pe)), 64))], 32)) : s("", !0), l("div", {
979
+ id: `${v(x)}-tabpanel`,
884
980
  class: "p-3",
885
- role: z.value ? "tabpanel" : void 0,
886
- "aria-labelledby": z.value ? `${y(S)}-tab-${k.value}` : void 0
887
- }, [k.value === "date" ? (h(), c(n, { key: 0 }, [l("div", Ie, [
981
+ role: I.value ? "tabpanel" : void 0,
982
+ "aria-labelledby": I.value ? `${v(x)}-tab-${O.value}` : void 0
983
+ }, [O.value === "date" ? (m(), c(n, { key: 0 }, [l("div", Ie, [
888
984
  l("button", {
889
985
  type: "button",
890
986
  class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
891
- "aria-label": Kt.value[0],
892
- onClick: a[4] ||= (e) => Hn(-1)
893
- }, [d(y(me), {
987
+ "aria-label": Qt.value[0],
988
+ onClick: a[4] ||= (e) => Jn(-1)
989
+ }, [ee(v(he), {
894
990
  class: "size-4",
895
991
  "aria-hidden": "true"
896
992
  })], 8, Le),
897
993
  l("span", {
898
- id: yt,
994
+ id: bt,
899
995
  class: "sr-only",
900
996
  "aria-live": "polite"
901
- }, v(W.value), 1),
902
- E.value === "years" ? (h(), c("span", ze, v(W.value), 1)) : (h(), c("button", {
997
+ }, _(V.value), 1),
998
+ T.value === "years" ? (m(), c("span", ze, _(V.value), 1)) : (m(), c("button", {
903
999
  key: 0,
904
1000
  type: "button",
905
1001
  class: "cursor-pointer rounded-10 bg-accent px-4 py-2 text-base font-semibold text-heading tabular-nums transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
906
- "aria-label": E.value === "days" ? `${W.value}, choose month` : `${W.value}, choose year`,
907
- onClick: a[5] ||= (e) => E.value === "days" ? Un() : Wn()
908
- }, v(W.value), 9, Re)),
1002
+ "aria-label": T.value === "days" ? `${V.value}, choose month` : `${V.value}, choose year`,
1003
+ onClick: a[5] ||= (e) => T.value === "days" ? Yn() : Xn()
1004
+ }, _(V.value), 9, Re)),
909
1005
  l("button", {
910
1006
  type: "button",
911
1007
  class: "inline-flex cursor-pointer items-center justify-center rounded-8 p-2 text-muted transition-colors duration-200 hover:bg-accent-hover hover:text-heading active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
912
- "aria-label": Kt.value[1],
913
- onClick: a[6] ||= (e) => Hn(1)
914
- }, [d(y(he), {
1008
+ "aria-label": Qt.value[1],
1009
+ onClick: a[6] ||= (e) => Jn(1)
1010
+ }, [ee(v(ge), {
915
1011
  class: "size-4",
916
1012
  "aria-hidden": "true"
917
1013
  })], 8, Be)
918
- ]), E.value === "days" ? (h(), c("table", {
1014
+ ]), T.value === "days" ? (m(), c("table", {
919
1015
  key: 0,
920
1016
  role: "grid",
921
- "aria-labelledby": yt,
1017
+ "aria-labelledby": bt,
922
1018
  class: "w-full table-fixed border-collapse",
923
- onKeydown: tr
924
- }, [l("thead", null, [l("tr", null, [(h(!0), c(n, null, _(jt.value, (e) => (h(), c("th", {
1019
+ onKeydown: sr
1020
+ }, [l("thead", null, [l("tr", null, [(m(!0), c(n, null, g(Pt.value, (e) => (m(), c("th", {
925
1021
  key: e.long,
926
1022
  scope: "col",
927
1023
  abbr: e.long,
928
1024
  class: "pt-2 pb-2 text-center text-xs font-medium text-heading"
929
- }, v(e.short.slice(0, 2)), 9, Ve))), 128))])]), l("tbody", { onMouseleave: a[7] ||= (e) => j.value = null }, [(h(!0), c(n, null, _(zt.value, (e, t) => (h(), c("tr", { key: t }, [(h(!0), c(n, null, _(e, (e) => (h(), c("td", {
1025
+ }, _(e.short.slice(0, 2)), 9, Ve))), 128))])]), l("tbody", { onMouseleave: a[7] ||= (e) => Et.value = null }, [(m(!0), c(n, null, g(Gt.value, (e, t) => (m(), c("tr", { key: t }, [(m(!0), c(n, null, g(e, (e) => (m(), c("td", {
930
1026
  key: e,
931
1027
  role: "gridcell",
932
- "aria-selected": bn(e) || xn(e),
1028
+ "aria-selected": Tn(e) || En(e),
933
1029
  class: "p-0 py-0.5"
934
- }, [l("div", { class: m(["px-0.5", xn(e) && X(e) === T.value && ["bg-primary/10", ...Sn(e)]]) }, [l("button", {
1030
+ }, [l("div", { class: p(["px-0.5", En(e) && J(e) === w.value && ["bg-primary/10", ...Dn(e)]]) }, [l("button", {
935
1031
  type: "button",
936
1032
  "data-day": e,
937
- tabindex: e === A.value ? 0 : -1,
938
- "aria-label": kt.value.format(J(e)),
939
- "aria-disabled": vn(e) || void 0,
940
- "aria-current": e === Nt.value ? "date" : void 0,
941
- class: m(["relative flex aspect-square w-full items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", [X(e) !== T.value && "invisible", vn(e) ? "cursor-not-allowed text-muted/50 line-through" : bn(e) ? "cursor-pointer bg-primary font-semibold text-white" : e === Nt.value ? "cursor-pointer bg-accent font-medium text-heading hover:bg-accent-hover active:bg-accent-active" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]]),
942
- onClick: (t) => Fn(e),
943
- onMouseenter: (t) => R.value && M.value && !N.value && (j.value = e)
944
- }, v(At.value.format(J(e))), 43, Ue)], 2)], 8, He))), 128))]))), 128))], 32)], 32)) : (h(), c("div", {
1033
+ tabindex: e === k.value ? 0 : -1,
1034
+ "aria-label": Mt.value.format(K(e)),
1035
+ "aria-disabled": Cn(e) || void 0,
1036
+ "aria-current": e === It.value ? "date" : void 0,
1037
+ class: p(["relative flex aspect-square w-full items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", [J(e) !== w.value && "invisible", Cn(e) ? "cursor-not-allowed text-muted/50 line-through" : Tn(e) ? "cursor-pointer bg-primary font-semibold text-white" : e === It.value ? "cursor-pointer bg-accent font-medium text-heading hover:bg-accent-hover active:bg-accent-active" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]]),
1038
+ onClick: (t) => Vn(e),
1039
+ onMouseenter: (t) => F.value && A.value && !j.value && (Et.value = e)
1040
+ }, _(Nt.value.format(K(e))), 43, Ue)], 2)], 8, He))), 128))]))), 128))], 32)], 32)) : (m(), c("div", {
945
1041
  key: 1,
946
1042
  role: "grid",
947
- "aria-label": E.value === "months" ? `Months of ${W.value}` : `Years ${W.value}`,
1043
+ "aria-label": T.value === "months" ? `Months of ${V.value}` : `Years ${V.value}`,
948
1044
  class: "grid gap-2",
949
- onKeydown: qn
950
- }, [(h(!0), c(n, null, _(Wt.value, (e, t) => (h(), c("div", {
1045
+ onKeydown: $n
1046
+ }, [(m(!0), c(n, null, g(Xt.value, (e, t) => (m(), c("div", {
951
1047
  key: t,
952
1048
  role: "row",
953
1049
  class: "grid grid-cols-4 gap-2"
954
- }, [(h(!0), c(n, null, _(e, (e) => (h(), c("button", {
1050
+ }, [(m(!0), c(n, null, g(e, (e) => (m(), c("button", {
955
1051
  key: e.value,
956
1052
  type: "button",
957
1053
  role: "gridcell",
958
1054
  "data-pick": e.value,
959
- tabindex: e.value === Gt.value ? 0 : -1,
1055
+ tabindex: e.value === Zt.value ? 0 : -1,
960
1056
  "aria-label": e.label,
961
1057
  "aria-selected": e.selected,
962
1058
  "aria-disabled": e.disabled || void 0,
963
- class: m(["rounded-8 px-4 py-3 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", e.disabled ? "cursor-not-allowed text-muted/50 line-through" : e.selected ? "cursor-pointer bg-primary font-semibold text-white" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]),
964
- onClick: (t) => Kn(e),
965
- onFocus: (t) => O.value = e.value
966
- }, v(e.text), 43, Ge))), 128))]))), 128))], 40, We))], 64)) : (h(), c(n, { key: 1 }, [l("div", Ke, [(h(!0), c(n, null, _(Qt.value, (e, t) => (h(), c(n, { key: e.key }, [t > 0 ? (h(), c("span", qe)) : s("", !0), l("div", {
1059
+ class: p(["rounded-8 px-4 py-3 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface motion-reduce:transition-none", e.disabled ? "cursor-not-allowed text-muted/50 line-through" : e.selected ? "cursor-pointer bg-primary font-semibold text-white" : "cursor-pointer text-heading hover:bg-accent-hover hover:font-semibold active:bg-accent-active"]),
1060
+ onClick: (t) => Qn(e),
1061
+ onFocus: (t) => D.value = e.value
1062
+ }, _(e.text), 43, Ge))), 128))]))), 128))], 40, We))], 64)) : (m(), c(n, { key: 1 }, [l("div", Ke, [(m(!0), c(n, null, g(on.value, (e, t) => (m(), c(n, { key: e.key }, [t > 0 ? (m(), c("span", qe)) : s("", !0), l("div", {
967
1063
  class: "flex min-w-0 flex-1 flex-col",
968
1064
  role: "group",
969
1065
  "aria-label": `${e.label} time`
970
- }, [R.value ? (h(), c("p", Ye, v(e.label), 1)) : s("", !0), l("div", Xe, [(h(!0), c(n, null, _(e.spinners, (t, r) => (h(), c(n, { key: t.key }, [r > 0 ? (h(), c("span", Ze, ":")) : s("", !0), l("div", Qe, [l("span", $e, v(ft[t.key]), 1), l("div", {
1066
+ }, [F.value ? (m(), c("p", Ye, _(e.label), 1)) : s("", !0), l("div", Xe, [(m(!0), c(n, null, g(e.spinners, (t, r) => (m(), c(n, { key: t.key }, [t.key === "p" ? (m(), c("span", Ze)) : r > 0 ? (m(), c("span", Qe, ":")) : s("", !0), l("div", { class: p(["flex h-full flex-1 flex-col items-center", t.key === "p" ? "min-w-12" : "min-w-10"]) }, [l("span", $e, _(pt[t.key]), 1), l("div", {
971
1067
  role: "listbox",
972
1068
  "aria-label": t.label,
973
1069
  "data-time-list": `${e.key}-${t.key}`,
974
1070
  class: "relative min-h-0 w-full flex-1 scroll-smooth overflow-x-hidden overflow-y-auto [scrollbar-width:none] motion-reduce:scroll-auto [&::-webkit-scrollbar]:hidden",
975
- onKeydown: (n) => er(n, t, `${e.key}-${t.key}`)
976
- }, [l("div", tt, [(h(!0), c(n, null, _(Xn(t), (n) => (h(), c("button", {
1071
+ onKeydown: (n) => or(n, t, `${e.key}-${t.key}`)
1072
+ }, [l("div", tt, [(m(!0), c(n, null, g(nr(t), (n) => (m(), c("button", {
977
1073
  key: n,
978
1074
  type: "button",
979
1075
  role: "option",
980
1076
  tabindex: n === t.get() ? 0 : -1,
981
1077
  "aria-selected": n === t.get(),
982
- class: m(["inline-flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-8 text-base tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", n === t.get() ? "scale-110 bg-primary font-bold text-white" : "text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]),
983
- onClick: (r) => $n(t, n, `${e.key}-${t.key}`)
984
- }, v(on(n)), 11, nt))), 128))])], 40, et)])], 64))), 128))])], 8, Je)], 64))), 128))]), l("p", rt, [u("Times in " + v(Mt.value), 1), Mt.value === L.value ? s("", !0) : (h(), c(n, { key: 0 }, [u(" (" + v(L.value) + ")", 1)], 64))])], 64))], 8, Fe)], 64)), z.value || f.mode === "duration" || !R.value ? (h(), c("div", it, [
985
- f.mode !== "duration" && !R.value ? (h(), c("button", {
1078
+ class: p(["inline-flex h-10 shrink-0 cursor-pointer items-center justify-center rounded-8 tabular-nums transition-all duration-200 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset motion-reduce:transition-none", [t.key === "p" ? "w-12 text-xs font-bold" : "w-10 text-base", n === t.get() ? ["bg-primary text-white", t.key !== "p" && "scale-110 font-bold"] : "text-heading hover:bg-accent-hover hover:font-bold active:bg-accent-active"]]),
1079
+ onClick: (r) => ar(t, n, `${e.key}-${t.key}`)
1080
+ }, _(t.text ? t.text(n) : U(n)), 11, nt))), 128))])], 40, et)], 2)], 64))), 128))])], 8, Je)], 64))), 128))]), d.showTimeZone ? (m(), c("p", rt, [u("Times in " + _(Ft.value), 1), Ft.value === P.value ? s("", !0) : (m(), c(n, { key: 0 }, [u(" (" + _(P.value) + ")", 1)], 64))])) : s("", !0)], 64))], 8, Fe)], 64)), nn.value ? (m(), c("div", it, [
1081
+ d.mode !== "duration" && !F.value ? (m(), c("button", {
986
1082
  key: 0,
987
1083
  type: "button",
988
1084
  class: "cursor-pointer rounded-8 bg-accent px-3 py-1.5 text-xs font-medium text-heading transition-colors duration-200 hover:bg-accent-hover active:bg-accent-active focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",
989
- disabled: vn(Nt.value),
990
- onClick: a[8] ||= (e) => z.value ? Ln() : Rn()
991
- }, v(z.value ? "Now" : "Today"), 9, at)) : s("", !0),
992
- Yt.value ? (h(), c("p", ot, v(Yt.value), 1)) : s("", !0),
993
- a[11] ||= l("span", { class: "flex-1" }, null, -1),
994
- z.value || f.mode === "duration" ? (h(), c(n, { key: 2 }, [d(e, {
1085
+ disabled: Cn(It.value),
1086
+ onClick: a[8] ||= (e) => I.value ? Un() : Wn()
1087
+ }, _(I.value ? "Now" : "Today"), 9, at)) : s("", !0),
1088
+ tn.value ? (m(), c("p", ot, _(tn.value), 1)) : s("", !0),
1089
+ a[10] ||= l("span", { class: "flex-1" }, null, -1),
1090
+ I.value && !d.autoApply || d.mode === "duration" ? (m(), c(n, { key: 2 }, [ee(t, {
995
1091
  title: "Cancel",
996
1092
  color: "white",
997
1093
  size: "small",
998
- onClick: a[9] ||= (e) => Mn()
999
- }), d(e, {
1094
+ onClick: Bn
1095
+ }), ee(t, {
1000
1096
  title: "Apply",
1001
1097
  size: "small",
1002
- disabled: !Xt.value,
1003
- onClick: In
1098
+ disabled: !rn.value,
1099
+ onClick: Hn
1004
1100
  }, null, 8, ["disabled"])], 64)) : s("", !0)
1005
- ])) : s("", !0)], 2)], 44, Te)) : s("", !0)]),
1101
+ ])) : s("", !0)], 2)], 16, Te)) : s("", !0)]),
1006
1102
  _: 1
1007
- })]))
1103
+ })], 8, ["disabled"])),
1104
+ d.errorMsg ? (m(), c("p", {
1105
+ key: 3,
1106
+ id: xt,
1107
+ class: "mt-1 text-base text-danger-strong",
1108
+ role: "alert"
1109
+ }, _(d.errorMsg), 1)) : s("", !0),
1110
+ d.name ? (m(), c("input", {
1111
+ key: 4,
1112
+ type: "hidden",
1113
+ name: d.name,
1114
+ value: Wt.value
1115
+ }, null, 8, st)) : s("", !0)
1008
1116
  ], 16));
1009
1117
  }
1010
1118
  });
1011
1119
  //#endregion
1012
- export { b as default };
1120
+ export { y as default };