@paolojulian.dev/design-system 4.5.1 → 4.6.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.
package/dist/index.es.js CHANGED
@@ -1,640 +1,700 @@
1
- import { jsx as n, jsxs as _, Fragment as Bt } from "react/jsx-runtime";
2
- import { cn as m } from "./utils.es.js";
3
- import { forwardRef as Ne, useId as Qe, useRef as ne, useState as G, useMemo as Ee, useEffect as Me, Children as Kt } from "react";
4
- import { C as Rt, a as At, b as Lt } from "./chevron-right-icon-CDCRryr1.js";
5
- const Pa = ({
1
+ import { jsx as a, jsxs as _, Fragment as wt } from "react/jsx-runtime";
2
+ import { cn as h } from "./utils.es.js";
3
+ import { forwardRef as oe, useId as Oe, useRef as me, useState as re, useMemo as tt, useEffect as Ce, Children as Xt } from "react";
4
+ import { C as qt, a as Pt, b as Ft } from "./chevron-right-icon-CDCRryr1.js";
5
+ const en = ({
6
6
  children: e,
7
7
  gap: t = void 0,
8
- alignItems: a = void 0,
8
+ alignItems: n = void 0,
9
9
  justifyContent: r = void 0,
10
- className: o = ""
11
- }) => /* @__PURE__ */ n(
10
+ className: l = ""
11
+ }) => /* @__PURE__ */ a(
12
12
  "div",
13
13
  {
14
- className: m("flex flex-row", o),
14
+ className: h("flex flex-row", l),
15
15
  style: {
16
16
  gap: t,
17
- alignItems: a,
17
+ alignItems: n,
18
18
  justifyContent: r
19
19
  },
20
20
  children: e
21
21
  }
22
- ), jt = ({
22
+ ), Zt = ({
23
23
  children: e,
24
24
  gap: t = void 0,
25
- alignItems: a = void 0,
25
+ alignItems: n = void 0,
26
26
  justifyContent: r = void 0,
27
- className: o = ""
28
- }) => /* @__PURE__ */ n(
27
+ className: l = ""
28
+ }) => /* @__PURE__ */ a(
29
29
  "div",
30
30
  {
31
- className: m("flex flex-col", o),
31
+ className: h("flex flex-col", l),
32
32
  style: {
33
33
  gap: t,
34
- alignItems: a,
34
+ alignItems: n,
35
35
  justifyContent: r
36
36
  },
37
37
  children: e
38
38
  }
39
- ), Ht = Ne(
39
+ ), Jt = oe(
40
40
  ({
41
41
  as: e = "span",
42
42
  variant: t = "neutral",
43
- size: a = "sm",
43
+ size: n = "sm",
44
44
  appearance: r = "subtle",
45
- leftIcon: o,
46
- rightIcon: c,
47
- children: d,
48
- className: g,
49
- ...v
45
+ isPinging: l = !1,
46
+ leftIcon: s,
47
+ rightIcon: d,
48
+ children: m,
49
+ className: y,
50
+ ...b
50
51
  }, u) => /* @__PURE__ */ _(
51
52
  e,
52
53
  {
53
- ...v,
54
+ ...b,
54
55
  ref: u,
55
- className: m(
56
+ className: h(
56
57
  "p-badge",
57
58
  `p-badge--${t}`,
58
- `p-badge--${a}`,
59
+ `p-badge--${n}`,
59
60
  `p-badge--${r}`,
60
- g
61
+ l && "p-badge--pinging",
62
+ y
61
63
  ),
62
64
  children: [
63
- o && /* @__PURE__ */ n("span", { className: "p-badge__icon", "aria-hidden": "true", children: o }),
64
- /* @__PURE__ */ n("span", { className: "p-badge__label", children: d }),
65
- c && /* @__PURE__ */ n("span", { className: "p-badge__icon", "aria-hidden": "true", children: c })
65
+ s && /* @__PURE__ */ a("span", { className: "p-badge__icon", "aria-hidden": "true", children: s }),
66
+ /* @__PURE__ */ a("span", { className: "p-badge__label", children: m }),
67
+ d && /* @__PURE__ */ a("span", { className: "p-badge__icon", "aria-hidden": "true", children: d })
66
68
  ]
67
69
  }
68
70
  )
69
71
  );
70
- Ht.displayName = "PBadge";
71
- const Ut = Ne(
72
+ Jt.displayName = "PBadge";
73
+ const Qt = oe(
72
74
  ({
73
75
  variant: e = "primary",
74
76
  size: t = "md",
75
- fullWidth: a = !1,
77
+ fullWidth: n = !1,
76
78
  isActive: r = !1,
77
- isLoading: o = !1,
78
- leftIcon: c,
79
- rightIcon: d,
80
- children: g,
81
- className: v,
79
+ isLoading: l = !1,
80
+ isPinging: s = !1,
81
+ leftIcon: d,
82
+ rightIcon: m,
83
+ children: y,
84
+ className: b,
82
85
  ...u
83
- }, h) => {
84
- const f = !!("disabled" in u && u.disabled || o), x = m(
86
+ }, v) => {
87
+ const N = !!("disabled" in u && u.disabled || l), F = h(
85
88
  "p-button",
86
89
  `p-button--${e}`,
87
90
  `p-button--${t}`,
88
- a && "p-button--full-width",
91
+ n && "p-button--full-width",
89
92
  r && "p-button--active",
90
- v
91
- ), R = /* @__PURE__ */ _(Bt, { children: [
92
- o ? /* @__PURE__ */ n("span", { className: "p-button__spinner", "aria-hidden": "true" }) : c && /* @__PURE__ */ n("span", { className: "p-button__icon", "aria-hidden": "true", children: c }),
93
- /* @__PURE__ */ n("span", { className: "p-button__label", children: g }),
94
- !o && d && /* @__PURE__ */ n("span", { className: "p-button__icon", "aria-hidden": "true", children: d })
93
+ s && "p-button--pinging",
94
+ b
95
+ ), k = /* @__PURE__ */ _(wt, { children: [
96
+ l ? /* @__PURE__ */ a("span", { className: "p-button__spinner", "aria-hidden": "true" }) : d && /* @__PURE__ */ a("span", { className: "p-button__icon", "aria-hidden": "true", children: d }),
97
+ /* @__PURE__ */ a("span", { className: "p-button__label", children: y }),
98
+ !l && m && /* @__PURE__ */ a("span", { className: "p-button__icon", "aria-hidden": "true", children: m })
95
99
  ] });
96
100
  if ("href" in u && typeof u.href == "string") {
97
- const { disabled: A, onClick: I, ...C } = u, P = (U) => {
98
- if (f) {
99
- U.preventDefault();
101
+ const { disabled: B, onClick: A, ...I } = u, T = (V) => {
102
+ if (N) {
103
+ V.preventDefault();
100
104
  return;
101
105
  }
102
- I == null || I(U);
106
+ A == null || A(V);
103
107
  };
104
- return /* @__PURE__ */ n(
108
+ return /* @__PURE__ */ a(
105
109
  "a",
106
110
  {
107
- ...C,
108
- ref: h,
109
- className: x,
110
- "aria-disabled": f || void 0,
111
- "aria-busy": o || void 0,
111
+ ...I,
112
+ ref: v,
113
+ className: F,
114
+ "aria-disabled": N || void 0,
115
+ "aria-busy": l || void 0,
112
116
  "data-active": r || void 0,
113
- "data-disabled": A || void 0,
114
- tabIndex: f ? -1 : C.tabIndex,
115
- onClick: P,
116
- children: R
117
+ "data-disabled": B || void 0,
118
+ tabIndex: N ? -1 : I.tabIndex,
119
+ onClick: T,
120
+ children: k
117
121
  }
118
122
  );
119
123
  }
120
- const { type: T = "button", disabled: k, ...w } = u;
121
- return /* @__PURE__ */ n(
124
+ const { type: g = "button", disabled: $, ...j } = u;
125
+ return /* @__PURE__ */ a(
122
126
  "button",
123
127
  {
124
- ...w,
125
- ref: h,
126
- type: T,
127
- disabled: !!(k || o),
128
- className: x,
129
- "aria-busy": o || void 0,
128
+ ...j,
129
+ ref: v,
130
+ type: g,
131
+ disabled: !!($ || l),
132
+ className: F,
133
+ "aria-busy": l || void 0,
130
134
  "data-active": r || void 0,
131
- children: R
135
+ children: k
132
136
  }
133
137
  );
134
138
  }
135
139
  );
136
- Ut.displayName = "PButton";
137
- function Vt(e) {
138
- var t, a, r = "";
140
+ Qt.displayName = "PButton";
141
+ function zt(e) {
142
+ var t, n, r = "";
139
143
  if (typeof e == "string" || typeof e == "number") r += e;
140
- else if (typeof e == "object") if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (a = Vt(e[t])) && (r && (r += " "), r += a);
144
+ else if (typeof e == "object") if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (n = zt(e[t])) && (r && (r += " "), r += n);
141
145
  else for (t in e) e[t] && (r && (r += " "), r += t);
142
146
  return r;
143
147
  }
144
- function Wt() {
145
- for (var e, t, a = 0, r = ""; a < arguments.length; ) (e = arguments[a++]) && (t = Vt(e)) && (r && (r += " "), r += t);
148
+ function Et() {
149
+ for (var e, t, n = 0, r = ""; n < arguments.length; ) (e = arguments[n++]) && (t = zt(e)) && (r && (r += " "), r += t);
146
150
  return r;
147
151
  }
148
- const Dt = (e) => typeof e == "boolean" ? "".concat(e) : e === 0 ? "0" : e, wt = Wt, qt = (e, t) => (a) => {
152
+ const Yt = (e) => typeof e == "boolean" ? "".concat(e) : e === 0 ? "0" : e, Ct = Et, ea = (e, t) => (n) => {
149
153
  var r;
150
- if ((t == null ? void 0 : t.variants) == null) return wt(e, a == null ? void 0 : a.class, a == null ? void 0 : a.className);
151
- const { variants: o, defaultVariants: c } = t, d = Object.keys(o).map((u) => {
152
- const h = a == null ? void 0 : a[u], f = c == null ? void 0 : c[u];
153
- if (h === null) return null;
154
- const x = Dt(h) || Dt(f);
155
- return o[u][x];
156
- }), g = a && Object.entries(a).reduce((u, h) => {
157
- let [f, x] = h;
158
- return x === void 0 || (u[f] = x), u;
159
- }, {}), v = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((u, h) => {
160
- let { class: f, className: x, ...R } = h;
161
- return Object.entries(R).every((T) => {
162
- let [k, w] = T;
163
- return Array.isArray(w) ? w.includes({
164
- ...c,
165
- ...g
166
- }[k]) : {
167
- ...c,
168
- ...g
169
- }[k] === w;
154
+ if ((t == null ? void 0 : t.variants) == null) return Ct(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
155
+ const { variants: l, defaultVariants: s } = t, d = Object.keys(l).map((b) => {
156
+ const u = n == null ? void 0 : n[b], v = s == null ? void 0 : s[b];
157
+ if (u === null) return null;
158
+ const N = Yt(u) || Yt(v);
159
+ return l[b][N];
160
+ }), m = n && Object.entries(n).reduce((b, u) => {
161
+ let [v, N] = u;
162
+ return N === void 0 || (b[v] = N), b;
163
+ }, {}), y = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((b, u) => {
164
+ let { class: v, className: N, ...F } = u;
165
+ return Object.entries(F).every((k) => {
166
+ let [g, $] = k;
167
+ return Array.isArray($) ? $.includes({
168
+ ...s,
169
+ ...m
170
+ }[g]) : {
171
+ ...s,
172
+ ...m
173
+ }[g] === $;
170
174
  }) ? [
171
- ...u,
172
- f,
173
- x
174
- ] : u;
175
+ ...b,
176
+ v,
177
+ N
178
+ ] : b;
175
179
  }, []);
176
- return wt(e, d, v, a == null ? void 0 : a.class, a == null ? void 0 : a.className);
177
- }, Ot = {
180
+ return Ct(e, d, y, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
181
+ }, ta = {
178
182
  serif: "p-typography--serif",
179
183
  body: "p-typography--body",
180
184
  "body-wide": "p-typography--body-wide",
181
185
  heading: "p-typography--heading",
182
186
  "heading-lg": "p-typography--heading-lg",
183
187
  "heading-xl": "p-typography--heading-xl"
184
- }, Gt = qt("p-typography", {
188
+ }, aa = ea("p-typography", {
185
189
  variants: {
186
- variant: Ot
190
+ variant: ta
187
191
  },
188
192
  defaultVariants: {
189
193
  variant: "body"
190
194
  }
191
195
  });
192
- function ot({
196
+ function Ke({
193
197
  as: e = "p",
194
198
  children: t,
195
- className: a = "",
199
+ className: n = "",
196
200
  variant: r,
197
- ...o
201
+ ...l
198
202
  }) {
199
- return /* @__PURE__ */ n(
203
+ return /* @__PURE__ */ a(
200
204
  e,
201
205
  {
202
- className: m(Gt({ variant: r, className: a })),
203
- ...o,
206
+ className: h(aa({ variant: r, className: n })),
207
+ ...l,
204
208
  children: t
205
209
  }
206
210
  );
207
211
  }
208
- function Ve(e) {
212
+ function Ge(e) {
209
213
  return e != null && e !== !1 && e !== "";
210
214
  }
211
- function Mt(e, t) {
212
- return Ve(e) ? typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ n(ot, { className: t, variant: "body-wide", children: e }) : /* @__PURE__ */ n("span", { className: m(t, "p-card__meta-custom"), children: e }) : null;
215
+ function St(e, t) {
216
+ return Ge(e) ? typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ a(Ke, { className: t, variant: "body-wide", children: e }) : /* @__PURE__ */ a("span", { className: h(t, "p-card__meta-custom"), children: e }) : null;
213
217
  }
214
- function et(e) {
218
+ function at(e) {
215
219
  return typeof e == "number" ? `${e}px` : e;
216
220
  }
217
- const Xt = Ne(
221
+ const na = oe(
218
222
  ({
219
223
  prefix: e,
220
224
  eyebrow: t,
221
- title: a,
225
+ title: n,
222
226
  description: r,
223
- media: o,
224
- actions: c,
227
+ media: l,
228
+ actions: s,
225
229
  density: d = "default",
226
- fullWidth: g = !1,
227
- width: v,
228
- minWidth: u,
229
- height: h,
230
- minHeight: f,
231
- className: x,
232
- style: R,
233
- children: T,
234
- ...k
235
- }, w) => {
236
- const A = "href" in k && typeof k.href == "string", I = m(
230
+ fullWidth: m = !1,
231
+ width: y,
232
+ minWidth: b,
233
+ height: u,
234
+ minHeight: v,
235
+ className: N,
236
+ style: F,
237
+ children: k,
238
+ ...g
239
+ }, $) => {
240
+ const j = "href" in g && typeof g.href == "string", B = h(
237
241
  "p-card",
238
242
  d !== "default" && `p-card--${d}`,
239
- g && "p-card--full-width",
240
- v !== void 0 && "p-card--custom-width",
241
- u !== void 0 && "p-card--custom-min-width",
242
- h !== void 0 && "p-card--custom-height",
243
- f !== void 0 && "p-card--custom-min-height",
244
- A && "p-card--interactive",
245
- x
246
- ), C = {
247
- ...R,
248
- ...v !== void 0 ? { "--p-card-width": et(v) } : {},
249
- ...u !== void 0 ? { "--p-card-min-width": et(u) } : {},
250
- ...h !== void 0 ? { "--p-card-height": et(h) } : {},
251
- ...f !== void 0 ? { "--p-card-min-height": et(f) } : {}
252
- }, P = /* @__PURE__ */ _(Bt, { children: [
253
- Ve(o) && /* @__PURE__ */ n("div", { className: "p-card__media", children: o }),
254
- (Ve(e) || Ve(t)) && /* @__PURE__ */ _("div", { className: "p-card__meta", children: [
255
- Mt(e, "p-card__prefix"),
256
- Mt(t, "p-card__eyebrow")
243
+ m && "p-card--full-width",
244
+ y !== void 0 && "p-card--custom-width",
245
+ b !== void 0 && "p-card--custom-min-width",
246
+ u !== void 0 && "p-card--custom-height",
247
+ v !== void 0 && "p-card--custom-min-height",
248
+ j && "p-card--interactive",
249
+ N
250
+ ), A = {
251
+ ...F,
252
+ ...y !== void 0 ? { "--p-card-width": at(y) } : {},
253
+ ...b !== void 0 ? { "--p-card-min-width": at(b) } : {},
254
+ ...u !== void 0 ? { "--p-card-height": at(u) } : {},
255
+ ...v !== void 0 ? { "--p-card-min-height": at(v) } : {}
256
+ }, I = /* @__PURE__ */ _(wt, { children: [
257
+ Ge(l) && /* @__PURE__ */ a("div", { className: "p-card__media", children: l }),
258
+ (Ge(e) || Ge(t)) && /* @__PURE__ */ _("div", { className: "p-card__meta", children: [
259
+ St(e, "p-card__prefix"),
260
+ St(t, "p-card__eyebrow")
257
261
  ] }),
258
262
  /* @__PURE__ */ _("div", { className: "p-card__body", children: [
259
- /* @__PURE__ */ n(ot, { as: "h3", className: "p-card__title", variant: "heading", children: A ? /* @__PURE__ */ n("a", { ...k, className: "p-card__link", children: a }) : a }),
260
- Ve(r) ? /* @__PURE__ */ n(ot, { className: "p-card__description", variant: "body", children: r }) : null
263
+ /* @__PURE__ */ a(Ke, { as: "h3", className: "p-card__title", variant: "heading", children: j ? /* @__PURE__ */ a("a", { ...g, className: "p-card__link", children: n }) : n }),
264
+ Ge(r) ? /* @__PURE__ */ a(Ke, { className: "p-card__description", variant: "body", children: r }) : null
261
265
  ] }),
262
- Ve(T) && /* @__PURE__ */ n("div", { className: "p-card__content", children: T }),
263
- Ve(c) && /* @__PURE__ */ n("div", { className: "p-card__actions", children: c })
266
+ Ge(k) && /* @__PURE__ */ a("div", { className: "p-card__content", children: k }),
267
+ Ge(s) && /* @__PURE__ */ a("div", { className: "p-card__actions", children: s })
264
268
  ] });
265
- return A ? /* @__PURE__ */ n("article", { ref: w, className: I, style: C, children: P }) : /* @__PURE__ */ n(
269
+ return j ? /* @__PURE__ */ a("article", { ref: $, className: B, style: A, children: I }) : /* @__PURE__ */ a(
266
270
  "article",
267
271
  {
268
- ...k,
269
- ref: w,
270
- className: I,
271
- style: C,
272
- children: P
272
+ ...g,
273
+ ref: $,
274
+ className: B,
275
+ style: A,
276
+ children: I
277
+ }
278
+ );
279
+ }
280
+ );
281
+ na.displayName = "PCard";
282
+ function ra(e) {
283
+ return typeof e == "number" ? `${e}px` : e;
284
+ }
285
+ function la(e) {
286
+ return e ? typeof e == "number" ? {
287
+ mobile: 1,
288
+ tablet: Math.min(e, 2),
289
+ desktop: e
290
+ } : {
291
+ mobile: e.mobile ?? 1,
292
+ tablet: e.tablet ?? e.mobile ?? 2,
293
+ desktop: e.desktop ?? e.tablet ?? e.mobile ?? 2
294
+ } : {
295
+ mobile: 1,
296
+ tablet: 2,
297
+ desktop: 2
298
+ };
299
+ }
300
+ const ia = oe(
301
+ ({
302
+ as: e = "div",
303
+ columns: t,
304
+ minCardWidth: n,
305
+ gap: r = "none",
306
+ align: l = "stretch",
307
+ className: s,
308
+ style: d,
309
+ children: m,
310
+ ...y
311
+ }, b) => {
312
+ const u = la(t), v = {
313
+ ...d,
314
+ "--p-card-grid-mobile-columns": u.mobile,
315
+ "--p-card-grid-tablet-columns": u.tablet,
316
+ "--p-card-grid-desktop-columns": u.desktop,
317
+ ...n !== void 0 ? { "--p-card-grid-min-card-width": ra(n) } : {}
318
+ };
319
+ return /* @__PURE__ */ a(
320
+ e,
321
+ {
322
+ ...y,
323
+ ref: b,
324
+ className: h(
325
+ "p-card-grid",
326
+ `p-card-grid--gap-${r}`,
327
+ l === "start" && "p-card-grid--align-start",
328
+ n !== void 0 && "p-card-grid--auto-fit",
329
+ s
330
+ ),
331
+ style: v,
332
+ children: m
273
333
  }
274
334
  );
275
335
  }
276
336
  );
277
- Xt.displayName = "PCard";
278
- function Zt() {
279
- return /* @__PURE__ */ n("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "m5 8 5 5 5-5" }) });
337
+ ia.displayName = "PCardGrid";
338
+ function sa() {
339
+ return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m5 8 5 5 5-5" }) });
280
340
  }
281
- function Jt() {
282
- return /* @__PURE__ */ n("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ n("path", { d: "m4 10 4 4 8-8" }) });
341
+ function oa() {
342
+ return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m4 10 4 4 8-8" }) });
283
343
  }
284
- function It() {
344
+ function Tt() {
285
345
  return /* @__PURE__ */ _("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: [
286
- /* @__PURE__ */ n("path", { d: "m5 5 10 10" }),
287
- /* @__PURE__ */ n("path", { d: "m15 5-10 10" })
346
+ /* @__PURE__ */ a("path", { d: "m5 5 10 10" }),
347
+ /* @__PURE__ */ a("path", { d: "m15 5-10 10" })
288
348
  ] });
289
349
  }
290
- function $t(e) {
350
+ function Bt(e) {
291
351
  return e.trim().toLocaleLowerCase();
292
352
  }
293
- function pt(e, t) {
294
- const a = $t(t);
295
- return a ? e.filter((r) => {
296
- const o = [
353
+ function ht(e, t) {
354
+ const n = Bt(t);
355
+ return n ? e.filter((r) => {
356
+ const l = [
297
357
  r.label,
298
358
  r.value,
299
359
  r.description,
300
360
  r.group,
301
361
  ...r.keywords ?? []
302
362
  ].filter(Boolean).join(" ");
303
- return $t(o).includes(a);
363
+ return Bt(l).includes(n);
304
364
  }) : e;
305
365
  }
306
- function zt(e) {
366
+ function Rt(e) {
307
367
  return e.findIndex((t) => !t.disabled);
308
368
  }
309
- function ht(e, t) {
310
- const a = e.findIndex((r) => r.value === t && !r.disabled);
311
- return a >= 0 ? a : zt(e);
369
+ function bt(e, t) {
370
+ const n = e.findIndex((r) => r.value === t && !r.disabled);
371
+ return n >= 0 ? n : Rt(e);
312
372
  }
313
- function Ct(e, t, a) {
314
- var o;
373
+ function At(e, t, n) {
374
+ var l;
315
375
  if (!e.length)
316
376
  return -1;
317
377
  let r = t;
318
- for (let c = 0; c < e.length; c += 1)
319
- if (r = (r + a + e.length) % e.length, !((o = e[r]) != null && o.disabled))
378
+ for (let s = 0; s < e.length; s += 1)
379
+ if (r = (r + n + e.length) % e.length, !((l = e[r]) != null && l.disabled))
320
380
  return r;
321
381
  return -1;
322
382
  }
323
- function Et(e, t) {
383
+ function ca(e, t) {
324
384
  if (typeof e == "function") {
325
385
  e(t);
326
386
  return;
327
387
  }
328
388
  e && (e.current = t);
329
389
  }
330
- const Qt = Ne(
390
+ const da = oe(
331
391
  ({
332
392
  label: e,
333
393
  options: t,
334
- value: a,
394
+ value: n,
335
395
  defaultValue: r,
336
- selectedOption: o,
337
- onValueChange: c,
396
+ selectedOption: l,
397
+ onValueChange: s,
338
398
  query: d,
339
- defaultQuery: g,
340
- onQueryChange: v,
341
- filterMode: u = "local",
342
- isLoading: h = !1,
343
- isLoadingMore: f = !1,
344
- hasMore: x = !1,
345
- onLoadMore: R,
346
- placeholder: T = "Select an option",
347
- searchPlaceholder: k = "Search options",
348
- emptyText: w = "No options found.",
349
- loadingText: A = "Loading options...",
350
- loadingMoreText: I = "Loading more options...",
351
- loadMoreText: C = "Load more options",
352
- helperText: P,
353
- isError: U = !1,
354
- errorMessage: he,
355
- name: Ie,
356
- disabled: me = !1,
357
- readOnly: $e = !1,
358
- required: oe = !1,
359
- clearable: le = !0,
360
- className: ee,
361
- inputClassName: se,
362
- id: Be,
363
- style: Re,
364
- ...ze
365
- }, We) => {
366
- const Z = Qe(), Y = Be ?? Z, ke = `${Y}-label`, N = `${Y}-input`, B = `${Y}-listbox`, j = `${Y}-helper`, L = `${Y}-error`, $ = ne(null), V = ne(null), S = ne(null), J = ne(null), ge = ne(null), te = ne(null), fe = a !== void 0, xe = d !== void 0, [Ce, qe] = G(r ?? ""), q = fe ? a : Ce, F = (o == null ? void 0 : o.value) === q ? o : t.find((i) => i.value === q) ?? null, [Oe, ie] = G(g ?? (F == null ? void 0 : F.label) ?? ""), E = xe ? d : Oe, [D, Q] = G(!1), [ce, Fe] = G(!1), z = Ee(
367
- () => u === "local" ? pt(t, E) : t,
368
- [u, t, E]
369
- ), [De, be] = G(() => ht(t, q)), _e = D ? z[De] : void 0, Ae = _e ? `${B}-option-${De}` : void 0, de = `${Y}-modal-title`, ye = U && he ? L : P ? j : void 0, Le = !!F, ue = le && Le && !me && !$e, Ye = D ? E : (F == null ? void 0 : F.label) ?? E, Ke = h && z.length === 0, Ge = f || h && z.length > 0, Xe = !!(x && R && !h && !f);
370
- Me(() => {
371
- !D && !xe && ie((F == null ? void 0 : F.label) ?? "");
372
- }, [D, xe, F]), Me(() => {
373
- D && be((i) => z[i] && !z[i].disabled ? i : ht(z, q));
374
- }, [z, D, q]), Me(() => {
375
- var i;
376
- D && ((i = ge.current) == null || i.scrollIntoView({ block: "nearest" }));
377
- }, [De, D]), Me(() => {
378
- var Te, Pe;
379
- const i = globalThis, p = (Te = i.matchMedia) == null ? void 0 : Te.call(i, "(max-width: 64rem)");
380
- if (!p)
399
+ defaultQuery: m,
400
+ onQueryChange: y,
401
+ filterMode: b = "local",
402
+ isLoading: u = !1,
403
+ isLoadingMore: v = !1,
404
+ hasMore: N = !1,
405
+ onLoadMore: F,
406
+ placeholder: k = "Select an option",
407
+ searchPlaceholder: g = "Search options",
408
+ emptyText: $ = "No options found.",
409
+ loadingText: j = "Loading options...",
410
+ loadingMoreText: B = "Loading more options...",
411
+ loadMoreText: A = "Load more options",
412
+ helperText: I,
413
+ isError: T = !1,
414
+ errorMessage: V,
415
+ name: S,
416
+ disabled: z = !1,
417
+ readOnly: ee = !1,
418
+ required: O = !1,
419
+ clearable: X = !0,
420
+ className: p,
421
+ inputClassName: M,
422
+ id: x,
423
+ style: W,
424
+ ...pe
425
+ }, w) => {
426
+ const D = Oe(), H = x ?? D, he = `${H}-label`, Y = `${H}-input`, R = `${H}-listbox`, te = `${H}-helper`, Z = `${H}-error`, G = me(null), J = me(null), q = me(null), ce = me(null), De = me(null), be = me(null), xe = n !== void 0, Fe = d !== void 0, [Se, Xe] = re(r ?? ""), le = xe ? n : Se, U = (l == null ? void 0 : l.value) === le ? l : t.find((c) => c.value === le) ?? null, [Ze, ge] = re(m ?? (U == null ? void 0 : U.label) ?? ""), de = Fe ? d : Ze, [L, ue] = re(!1), [ye, Te] = re(!1), Q = tt(
427
+ () => b === "local" ? ht(t, de) : t,
428
+ [b, t, de]
429
+ ), [Ie, Me] = re(() => bt(t, le)), $e = L ? Q[Ie] : void 0, je = $e ? `${R}-option-${Ie}` : void 0, ve = `${H}-modal-title`, we = T && V ? Z : I ? te : void 0, He = !!U, Ne = X && He && !z && !ee, Be = L ? de : (U == null ? void 0 : U.label) ?? de, We = u && Q.length === 0, Je = v || u && Q.length > 0, Qe = !!(N && F && !u && !v);
430
+ Ce(() => {
431
+ !L && !Fe && ge((U == null ? void 0 : U.label) ?? "");
432
+ }, [L, Fe, U]), Ce(() => {
433
+ L && Me((c) => Q[c] && !Q[c].disabled ? c : bt(Q, le));
434
+ }, [Q, L, le]), Ce(() => {
435
+ var c;
436
+ L && ((c = De.current) == null || c.scrollIntoView({ block: "nearest" }));
437
+ }, [Ie, L]), Ce(() => {
438
+ var Ve, Le;
439
+ const c = globalThis, f = (Ve = c.matchMedia) == null ? void 0 : Ve.call(c, "(max-width: 64rem)");
440
+ if (!f)
381
441
  return;
382
- const W = () => Fe(p.matches);
383
- return W(), (Pe = p.addEventListener) == null || Pe.call(p, "change", W), () => {
384
- var je;
385
- return (je = p.removeEventListener) == null ? void 0 : je.call(p, "change", W);
442
+ const ne = () => Te(f.matches);
443
+ return ne(), (Le = f.addEventListener) == null || Le.call(f, "change", ne), () => {
444
+ var Ue;
445
+ return (Ue = f.removeEventListener) == null ? void 0 : Ue.call(f, "change", ne);
386
446
  };
387
- }, []), Me(() => {
388
- var i;
389
- !D || !ce || (i = S.current) == null || i.focus();
390
- }, [ce, D]), Me(() => {
391
- J.current && J.current.setCustomValidity(oe && !q ? "Select an option." : "");
392
- }, [oe, q]);
393
- const s = (i) => {
394
- $.current = i, Et(We, i);
395
- }, y = (i, p) => {
396
- xe || ie(i), v == null || v(i, { source: p });
397
- }, H = () => {
398
- !x || !R || h || f || R({ query: E, optionCount: z.length });
447
+ }, []), Ce(() => {
448
+ var c;
449
+ !L || !ye || (c = q.current) == null || c.focus();
450
+ }, [ye, L]), Ce(() => {
451
+ ce.current && ce.current.setCustomValidity(O && !le ? "Select an option." : "");
452
+ }, [O, le]);
453
+ const o = (c) => {
454
+ G.current = c, ca(w, c);
455
+ }, C = (c, f) => {
456
+ Fe || ge(c), y == null || y(c, { source: f });
457
+ }, ae = () => {
458
+ !N || !F || u || v || F({ query: de, optionCount: Q.length });
399
459
  };
400
- Me(() => {
401
- if (!D || !te.current)
460
+ Ce(() => {
461
+ if (!L || !be.current)
402
462
  return;
403
- const { scrollHeight: i, clientHeight: p } = te.current;
404
- i <= p + 48 && H();
463
+ const { scrollHeight: c, clientHeight: f } = be.current;
464
+ c <= f + 48 && ae();
405
465
  });
406
- const l = (i) => {
407
- const p = (i == null ? void 0 : i.value) ?? "";
408
- fe || qe(p), y((i == null ? void 0 : i.label) ?? "", i ? "selection" : "clear"), c == null || c(p, i);
409
- }, b = (i = E) => {
410
- if (me || $e)
466
+ const i = (c) => {
467
+ const f = (c == null ? void 0 : c.value) ?? "";
468
+ xe || Xe(f), C((c == null ? void 0 : c.label) ?? "", c ? "selection" : "clear"), s == null || s(f, c);
469
+ }, P = (c = de) => {
470
+ if (z || ee)
411
471
  return;
412
- const p = u === "local" ? pt(t, i) : t;
413
- y(i, "open"), be(ht(p, q)), Q(!0);
414
- }, K = () => {
415
- Q(!1), y((F == null ? void 0 : F.label) ?? "", "reset");
416
- }, ve = (i) => {
417
- const p = i.currentTarget.value, W = u === "local" ? pt(t, p) : t;
418
- y(p, "input"), be(zt(W)), Q(!0);
419
- }, ae = (i) => {
420
- if (i.key === "ArrowDown") {
421
- if (i.preventDefault(), !D) {
422
- b("");
472
+ const f = b === "local" ? ht(t, c) : t;
473
+ C(c, "open"), Me(bt(f, le)), ue(!0);
474
+ }, E = () => {
475
+ ue(!1), C((U == null ? void 0 : U.label) ?? "", "reset");
476
+ }, Pe = (c) => {
477
+ const f = c.currentTarget.value, ne = b === "local" ? ht(t, f) : t;
478
+ C(f, "input"), Me(Rt(ne)), ue(!0);
479
+ }, _e = (c) => {
480
+ if (c.key === "ArrowDown") {
481
+ if (c.preventDefault(), !L) {
482
+ P("");
423
483
  return;
424
484
  }
425
- be((p) => Ct(z, p, 1));
485
+ Me((f) => At(Q, f, 1));
426
486
  return;
427
487
  }
428
- if (i.key === "ArrowUp") {
429
- if (i.preventDefault(), !D) {
430
- b("");
488
+ if (c.key === "ArrowUp") {
489
+ if (c.preventDefault(), !L) {
490
+ P("");
431
491
  return;
432
492
  }
433
- be((p) => Ct(z, p, -1));
493
+ Me((f) => At(Q, f, -1));
434
494
  return;
435
495
  }
436
- if (i.key === "Enter") {
437
- if (!D) {
438
- b(E);
496
+ if (c.key === "Enter") {
497
+ if (!L) {
498
+ P(de);
439
499
  return;
440
500
  }
441
- _e && !_e.disabled && (i.preventDefault(), l(_e), Q(!1));
501
+ $e && !$e.disabled && (c.preventDefault(), i($e), ue(!1));
442
502
  return;
443
503
  }
444
- if (i.key === "Escape" && D) {
445
- i.preventDefault(), K();
504
+ if (c.key === "Escape" && L) {
505
+ c.preventDefault(), E();
446
506
  return;
447
507
  }
448
- i.key === "Tab" && K();
449
- }, Se = (i, p) => {
450
- var W;
451
- i.preventDefault(), !p.disabled && (l(p), Q(!1), (W = V.current) == null || W.focus());
452
- }, ct = (i) => {
453
- var p;
454
- i.preventDefault(), i.stopPropagation(), l(null), Q(!1), (p = V.current) == null || p.focus();
455
- }, dt = (i) => {
456
- const p = i.currentTarget;
457
- p.scrollHeight - p.scrollTop - p.clientHeight <= 48 && H();
458
- }, ut = (i) => {
459
- if (!D)
508
+ c.key === "Tab" && E();
509
+ }, Ae = (c, f) => {
510
+ var ne;
511
+ c.preventDefault(), !f.disabled && (i(f), ue(!1), (ne = J.current) == null || ne.focus());
512
+ }, dt = (c) => {
513
+ var f;
514
+ c.preventDefault(), c.stopPropagation(), i(null), ue(!1), (f = J.current) == null || f.focus();
515
+ }, ut = (c) => {
516
+ const f = c.currentTarget;
517
+ f.scrollHeight - f.scrollTop - f.clientHeight <= 48 && ae();
518
+ }, pt = (c) => {
519
+ if (!L)
460
520
  return;
461
- i.currentTarget.contains(i.relatedTarget) || K();
462
- }, xt = z.reduce(
463
- (i, p) => {
464
- const W = p.group ?? null, Te = i.find((Pe) => Pe.group === W);
465
- return Te ? (Te.options.push(p), i) : (i.push({ group: W, options: [p] }), i);
521
+ c.currentTarget.contains(c.relatedTarget) || E();
522
+ }, It = Q.reduce(
523
+ (c, f) => {
524
+ const ne = f.group ?? null, Ve = c.find((Le) => Le.group === ne);
525
+ return Ve ? (Ve.options.push(f), c) : (c.push({ group: ne, options: [f] }), c);
466
526
  },
467
527
  []
468
528
  );
469
529
  return /* @__PURE__ */ _(
470
530
  "div",
471
531
  {
472
- ...ze,
473
- ref: s,
474
- id: Y,
475
- style: Re,
476
- onBlur: ut,
477
- className: m(
532
+ ...pe,
533
+ ref: o,
534
+ id: H,
535
+ style: W,
536
+ onBlur: pt,
537
+ className: h(
478
538
  "p-combobox",
479
- D && "p-combobox--open",
480
- U && "p-combobox--error",
481
- me && "p-combobox--disabled",
482
- $e && "p-combobox--readonly",
483
- ee
539
+ L && "p-combobox--open",
540
+ T && "p-combobox--error",
541
+ z && "p-combobox--disabled",
542
+ ee && "p-combobox--readonly",
543
+ p
484
544
  ),
485
545
  children: [
486
546
  /* @__PURE__ */ _("div", { className: "p-combobox__field", children: [
487
- /* @__PURE__ */ n(
547
+ /* @__PURE__ */ a(
488
548
  "input",
489
549
  {
490
- ref: V,
491
- id: N,
550
+ ref: J,
551
+ id: Y,
492
552
  role: "combobox",
493
553
  type: "text",
494
- value: Ye,
495
- placeholder: D ? k : " ",
496
- disabled: me,
497
- readOnly: $e,
554
+ value: Be,
555
+ placeholder: L ? g : " ",
556
+ disabled: z,
557
+ readOnly: ee,
498
558
  required: !1,
499
559
  "aria-autocomplete": "list",
500
- "aria-controls": B,
501
- "aria-describedby": ye,
502
- "aria-activedescendant": Ae,
503
- "aria-expanded": D,
560
+ "aria-controls": R,
561
+ "aria-describedby": we,
562
+ "aria-activedescendant": je,
563
+ "aria-expanded": L,
504
564
  "aria-haspopup": "listbox",
505
- "aria-invalid": U || void 0,
506
- "aria-labelledby": ke,
565
+ "aria-invalid": T || void 0,
566
+ "aria-labelledby": he,
507
567
  autoComplete: "off",
508
- className: m("p-combobox__input", (ue || Le) && "p-combobox__input--adorned", se),
509
- onChange: ve,
510
- onClick: () => b(""),
511
- onKeyDown: ae
568
+ className: h("p-combobox__input", (Ne || He) && "p-combobox__input--adorned", M),
569
+ onChange: Pe,
570
+ onClick: () => P(""),
571
+ onKeyDown: _e
512
572
  }
513
573
  ),
514
- /* @__PURE__ */ n(
574
+ /* @__PURE__ */ a(
515
575
  "label",
516
576
  {
517
- id: ke,
518
- htmlFor: N,
519
- className: m("p-combobox__label p-combobox__floating-label", U && "p-combobox__label--error"),
577
+ id: he,
578
+ htmlFor: Y,
579
+ className: h("p-combobox__label p-combobox__floating-label", T && "p-combobox__label--error"),
520
580
  children: e
521
581
  }
522
582
  ),
523
- /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "p-combobox__label p-combobox__placeholder-label", children: T || e }),
524
- ue ? /* @__PURE__ */ n(
583
+ /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "p-combobox__label p-combobox__placeholder-label", children: k || e }),
584
+ Ne ? /* @__PURE__ */ a(
525
585
  "button",
526
586
  {
527
587
  type: "button",
528
588
  className: "p-combobox__clear",
529
589
  "aria-label": `Clear ${e}`,
530
- onMouseDown: ct,
531
- children: /* @__PURE__ */ n(It, {})
590
+ onMouseDown: dt,
591
+ children: /* @__PURE__ */ a(Tt, {})
532
592
  }
533
593
  ) : null,
534
- /* @__PURE__ */ n("span", { className: "p-combobox__chevron", "aria-hidden": "true", children: /* @__PURE__ */ n(Zt, {}) }),
535
- D ? /* @__PURE__ */ _(
594
+ /* @__PURE__ */ a("span", { className: "p-combobox__chevron", "aria-hidden": "true", children: /* @__PURE__ */ a(sa, {}) }),
595
+ L ? /* @__PURE__ */ _(
536
596
  "div",
537
597
  {
538
598
  className: "p-combobox__panel",
539
- role: ce ? "dialog" : void 0,
540
- "aria-modal": ce || void 0,
541
- "aria-labelledby": ce ? de : void 0,
599
+ role: ye ? "dialog" : void 0,
600
+ "aria-modal": ye || void 0,
601
+ "aria-labelledby": ye ? ve : void 0,
542
602
  children: [
543
603
  /* @__PURE__ */ _("div", { className: "p-combobox__modal-header", children: [
544
- /* @__PURE__ */ n("div", { id: de, className: "p-combobox__modal-title", children: e }),
545
- /* @__PURE__ */ n("button", { type: "button", className: "p-combobox__modal-close", "aria-label": `Close ${e}`, onClick: K, children: /* @__PURE__ */ n(It, {}) })
604
+ /* @__PURE__ */ a("div", { id: ve, className: "p-combobox__modal-title", children: e }),
605
+ /* @__PURE__ */ a("button", { type: "button", className: "p-combobox__modal-close", "aria-label": `Close ${e}`, onClick: E, children: /* @__PURE__ */ a(Tt, {}) })
546
606
  ] }),
547
- /* @__PURE__ */ n("div", { className: "p-combobox__modal-search", children: /* @__PURE__ */ n(
607
+ /* @__PURE__ */ a("div", { className: "p-combobox__modal-search", children: /* @__PURE__ */ a(
548
608
  "input",
549
609
  {
550
- ref: S,
610
+ ref: q,
551
611
  role: "combobox",
552
612
  type: "search",
553
- value: E,
554
- placeholder: k,
555
- "aria-activedescendant": Ae,
613
+ value: de,
614
+ placeholder: g,
615
+ "aria-activedescendant": je,
556
616
  "aria-autocomplete": "list",
557
- "aria-controls": B,
558
- "aria-expanded": D,
617
+ "aria-controls": R,
618
+ "aria-expanded": L,
559
619
  "aria-haspopup": "listbox",
560
620
  "aria-label": `Search ${e}`,
561
621
  autoComplete: "off",
562
622
  className: "p-combobox__modal-input",
563
- onChange: ve,
564
- onKeyDown: ae
623
+ onChange: Pe,
624
+ onKeyDown: _e
565
625
  }
566
626
  ) }),
567
627
  /* @__PURE__ */ _(
568
628
  "div",
569
629
  {
570
- id: B,
571
- ref: (i) => {
572
- te.current = i;
630
+ id: R,
631
+ ref: (c) => {
632
+ be.current = c;
573
633
  },
574
634
  role: "listbox",
575
- "aria-busy": h || f || void 0,
576
- "aria-labelledby": ke,
635
+ "aria-busy": u || v || void 0,
636
+ "aria-labelledby": he,
577
637
  className: "p-combobox__list",
578
- onScroll: dt,
638
+ onScroll: ut,
579
639
  children: [
580
- Ke ? /* @__PURE__ */ _("div", { className: "p-combobox__status", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
581
- /* @__PURE__ */ n("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
582
- /* @__PURE__ */ n("span", { children: A })
640
+ We ? /* @__PURE__ */ _("div", { className: "p-combobox__status", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
641
+ /* @__PURE__ */ a("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
642
+ /* @__PURE__ */ a("span", { children: j })
583
643
  ] }) : null,
584
- xt.length ? xt.map((i) => /* @__PURE__ */ _("div", { className: "p-combobox__group", children: [
585
- i.group ? /* @__PURE__ */ n("div", { className: "p-combobox__group-label", children: i.group }) : null,
586
- i.options.map((p) => {
587
- const W = z.indexOf(p), Te = W === De, Pe = p.value === q;
644
+ It.length ? It.map((c) => /* @__PURE__ */ _("div", { className: "p-combobox__group", children: [
645
+ c.group ? /* @__PURE__ */ a("div", { className: "p-combobox__group-label", children: c.group }) : null,
646
+ c.options.map((f) => {
647
+ const ne = Q.indexOf(f), Ve = ne === Ie, Le = f.value === le;
588
648
  return /* @__PURE__ */ _(
589
649
  "div",
590
650
  {
591
- ref: Te ? (je) => {
592
- ge.current = je;
651
+ ref: Ve ? (Ue) => {
652
+ De.current = Ue;
593
653
  } : void 0,
594
- id: `${B}-option-${W}`,
654
+ id: `${R}-option-${ne}`,
595
655
  role: "option",
596
- "aria-disabled": p.disabled || void 0,
597
- "aria-selected": Pe,
598
- className: m(
656
+ "aria-disabled": f.disabled || void 0,
657
+ "aria-selected": Le,
658
+ className: h(
599
659
  "p-combobox__option",
600
- Te && "p-combobox__option--active",
601
- Pe && "p-combobox__option--selected",
602
- p.disabled && "p-combobox__option--disabled"
660
+ Ve && "p-combobox__option--active",
661
+ Le && "p-combobox__option--selected",
662
+ f.disabled && "p-combobox__option--disabled"
603
663
  ),
604
- onMouseDown: (je) => Se(je, p),
664
+ onMouseDown: (Ue) => Ae(Ue, f),
605
665
  children: [
606
- /* @__PURE__ */ n("span", { className: "p-combobox__option-check", children: Pe ? /* @__PURE__ */ n(Jt, {}) : null }),
666
+ /* @__PURE__ */ a("span", { className: "p-combobox__option-check", children: Le ? /* @__PURE__ */ a(oa, {}) : null }),
607
667
  /* @__PURE__ */ _("span", { className: "p-combobox__option-content", children: [
608
- /* @__PURE__ */ n("span", { className: "p-combobox__option-label", children: p.label }),
609
- p.description ? /* @__PURE__ */ n("span", { className: "p-combobox__option-description", children: p.description }) : null
668
+ /* @__PURE__ */ a("span", { className: "p-combobox__option-label", children: f.label }),
669
+ f.description ? /* @__PURE__ */ a("span", { className: "p-combobox__option-description", children: f.description }) : null
610
670
  ] }),
611
- p.meta ? /* @__PURE__ */ n("span", { className: "p-combobox__option-meta", children: p.meta }) : null
671
+ f.meta ? /* @__PURE__ */ a("span", { className: "p-combobox__option-meta", children: f.meta }) : null
612
672
  ]
613
673
  },
614
- p.value
674
+ f.value
615
675
  );
616
676
  })
617
- ] }, i.group ?? "ungrouped")) : Ke ? null : /* @__PURE__ */ n("div", { className: "p-combobox__empty", role: "option", "aria-disabled": "true", "aria-selected": "false", children: w }),
618
- Ge ? /* @__PURE__ */ _("div", { className: "p-combobox__status p-combobox__status--footer", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
619
- /* @__PURE__ */ n("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
620
- /* @__PURE__ */ n("span", { children: I })
677
+ ] }, c.group ?? "ungrouped")) : We ? null : /* @__PURE__ */ a("div", { className: "p-combobox__empty", role: "option", "aria-disabled": "true", "aria-selected": "false", children: $ }),
678
+ Je ? /* @__PURE__ */ _("div", { className: "p-combobox__status p-combobox__status--footer", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
679
+ /* @__PURE__ */ a("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
680
+ /* @__PURE__ */ a("span", { children: B })
621
681
  ] }) : null
622
682
  ]
623
683
  }
624
684
  ),
625
- Xe ? /* @__PURE__ */ n("div", { className: "p-combobox__footer", children: /* @__PURE__ */ n("button", { type: "button", className: "p-combobox__load-more", onMouseDown: (i) => i.preventDefault(), onClick: H, children: C }) }) : null
685
+ Qe ? /* @__PURE__ */ a("div", { className: "p-combobox__footer", children: /* @__PURE__ */ a("button", { type: "button", className: "p-combobox__load-more", onMouseDown: (c) => c.preventDefault(), onClick: ae, children: A }) }) : null
626
686
  ]
627
687
  }
628
688
  ) : null
629
689
  ] }),
630
- /* @__PURE__ */ n(
690
+ /* @__PURE__ */ a(
631
691
  "input",
632
692
  {
633
- ref: J,
693
+ ref: ce,
634
694
  type: "text",
635
- name: Ie,
636
- value: q ?? "",
637
- required: oe,
695
+ name: S,
696
+ value: le ?? "",
697
+ required: O,
638
698
  tabIndex: -1,
639
699
  "aria-hidden": "true",
640
700
  className: "p-combobox__hidden-input",
@@ -642,17 +702,17 @@ const Qt = Ne(
642
702
  }
643
703
  }
644
704
  ),
645
- D ? /* @__PURE__ */ n("div", { className: "p-combobox__backdrop", "aria-hidden": "true", onMouseDown: K }) : null,
646
- U && he ? /* @__PURE__ */ n("p", { id: L, role: "alert", className: "p-combobox__message p-combobox__message--error", children: he }) : null,
647
- !U && P ? /* @__PURE__ */ n("p", { id: j, className: "p-combobox__message", children: P }) : null
705
+ L ? /* @__PURE__ */ a("div", { className: "p-combobox__backdrop", "aria-hidden": "true", onMouseDown: E }) : null,
706
+ T && V ? /* @__PURE__ */ a("p", { id: Z, role: "alert", className: "p-combobox__message p-combobox__message--error", children: V }) : null,
707
+ !T && I ? /* @__PURE__ */ a("p", { id: te, className: "p-combobox__message", children: I }) : null
648
708
  ]
649
709
  }
650
710
  );
651
711
  }
652
712
  );
653
- Qt.displayName = "PCombobox";
654
- const ea = new Intl.DateTimeFormat(void 0, { weekday: "short" });
655
- function nt(e) {
713
+ da.displayName = "PCombobox";
714
+ const ua = new Intl.DateTimeFormat(void 0, { weekday: "short" });
715
+ function lt(e) {
656
716
  if (!e)
657
717
  return null;
658
718
  if (e instanceof Date)
@@ -660,63 +720,63 @@ function nt(e) {
660
720
  const t = e.split("-").map(Number);
661
721
  if (t.length !== 3 || t.some(Number.isNaN))
662
722
  return null;
663
- const [a, r, o] = t, c = new Date(a, r - 1, o);
664
- return c.getFullYear() !== a || c.getMonth() !== r - 1 || c.getDate() !== o ? null : c;
723
+ const [n, r, l] = t, s = new Date(n, r - 1, l);
724
+ return s.getFullYear() !== n || s.getMonth() !== r - 1 || s.getDate() !== l ? null : s;
665
725
  }
666
- function Je(e) {
726
+ function et(e) {
667
727
  if (!e)
668
728
  return "";
669
- const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
670
- return `${t}-${a}-${r}`;
729
+ const t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
730
+ return `${t}-${n}-${r}`;
671
731
  }
672
- function re(e) {
732
+ function fe(e) {
673
733
  return new Date(e.getFullYear(), e.getMonth(), 1);
674
734
  }
675
- function it(e) {
735
+ function ct(e) {
676
736
  return new Date(e.getFullYear(), e.getMonth() + 1, 0);
677
737
  }
678
- function kt(e, t) {
738
+ function Mt(e, t) {
679
739
  return new Date(e.getFullYear(), e.getMonth() + t, 1);
680
740
  }
681
- function Ft(e, t) {
682
- const a = kt(e, t), r = it(a).getDate();
683
- return new Date(a.getFullYear(), a.getMonth(), Math.min(e.getDate(), r));
741
+ function Vt(e, t) {
742
+ const n = Mt(e, t), r = ct(n).getDate();
743
+ return new Date(n.getFullYear(), n.getMonth(), Math.min(e.getDate(), r));
684
744
  }
685
- function pe(e, t) {
745
+ function ke(e, t) {
686
746
  return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
687
747
  }
688
- function Ze(e, t) {
689
- return !!(e && t && Je(e) === Je(t));
748
+ function Ee(e, t) {
749
+ return !!(e && t && et(e) === et(t));
690
750
  }
691
- function He() {
751
+ function ze() {
692
752
  const e = /* @__PURE__ */ new Date();
693
753
  return new Date(e.getFullYear(), e.getMonth(), e.getDate());
694
754
  }
695
- function ta(e, t) {
696
- const a = re(e), r = (a.getDay() - t + 7) % 7, o = pe(a, -r);
697
- return Array.from({ length: 42 }, (c, d) => pe(o, d));
755
+ function pa(e, t) {
756
+ const n = fe(e), r = (n.getDay() - t + 7) % 7, l = ke(n, -r);
757
+ return Array.from({ length: 42 }, (s, d) => ke(l, d));
698
758
  }
699
- function mt(e) {
759
+ function _t(e) {
700
760
  const t = typeof e.value == "function" ? e.value() : e.value;
701
- return nt(t);
761
+ return lt(t);
702
762
  }
703
- function aa(e, t) {
763
+ function ha(e, t) {
704
764
  return new Intl.DateTimeFormat(t, { month: "long", year: "numeric" }).format(e);
705
765
  }
706
- function na(e) {
707
- return Array.from({ length: 12 }, (t, a) => ({
708
- label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, a, 1)),
709
- value: a
766
+ function ba(e) {
767
+ return Array.from({ length: 12 }, (t, n) => ({
768
+ label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, n, 1)),
769
+ value: n
710
770
  }));
711
771
  }
712
- function ra(e, t) {
772
+ function _a(e, t) {
713
773
  return new Intl.DateTimeFormat(t, {
714
774
  month: "short",
715
775
  day: "numeric",
716
776
  year: "numeric"
717
777
  }).format(e);
718
778
  }
719
- function oa(e, t) {
779
+ function ma(e, t) {
720
780
  return new Intl.DateTimeFormat(t, {
721
781
  weekday: "long",
722
782
  month: "long",
@@ -724,181 +784,181 @@ function oa(e, t) {
724
784
  year: "numeric"
725
785
  }).format(e);
726
786
  }
727
- function la(e, t) {
728
- const a = new Date(2024, 0, 7);
729
- return Array.from({ length: 7 }, (r, o) => {
730
- const c = pe(a, e + o);
731
- return ea.formatToParts(c).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(c) : "";
787
+ function fa(e, t) {
788
+ const n = new Date(2024, 0, 7);
789
+ return Array.from({ length: 7 }, (r, l) => {
790
+ const s = ke(n, e + l);
791
+ return ua.formatToParts(s).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(s) : "";
732
792
  });
733
793
  }
734
- function gt(e, t) {
794
+ function mt(e, t) {
735
795
  return !!(t && e.getTime() < t.getTime());
736
796
  }
737
797
  function ft(e, t) {
738
798
  return !!(t && e.getTime() > t.getTime());
739
799
  }
740
- function Yt(e, t) {
800
+ function Lt(e, t) {
741
801
  return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
742
802
  }
743
- function bt(e, t, a) {
744
- const r = re(e), o = it(e);
745
- return !!(t && o < t || a && r > a);
803
+ function gt(e, t, n) {
804
+ const r = fe(e), l = ct(e);
805
+ return !!(t && l < t || n && r > n);
746
806
  }
747
- function sa(e, t, a) {
748
- return t && it(e) < t ? re(t) : a && re(e) > a ? re(a) : re(e);
807
+ function ga(e, t, n) {
808
+ return t && ct(e) < t ? fe(t) : n && fe(e) > n ? fe(n) : fe(e);
749
809
  }
750
- function ia(e, t, a, r) {
751
- const o = re(e), c = it(e);
810
+ function ya(e, t, n, r) {
811
+ const l = fe(e), s = ct(e);
752
812
  let d = new Date(
753
- o.getFullYear(),
754
- o.getMonth(),
755
- Math.min(t.getDate(), c.getDate())
813
+ l.getFullYear(),
814
+ l.getMonth(),
815
+ Math.min(t.getDate(), s.getDate())
756
816
  );
757
- return a && d < a && (d = Yt(a, o) ? a : o), r && d > r && (d = Yt(r, o) ? r : c), d;
817
+ return n && d < n && (d = Lt(n, l) ? n : l), r && d > r && (d = Lt(r, l) ? r : s), d;
758
818
  }
759
- function ca(e, t, a, r) {
760
- const o = e.getFullYear(), c = Math.min(o, r.getFullYear() - 100), d = Math.max(o, r.getFullYear() + 20), g = (t == null ? void 0 : t.getFullYear()) ?? c, v = (a == null ? void 0 : a.getFullYear()) ?? d, u = Math.min(g, v, o), h = Math.max(g, v, o);
761
- return Array.from({ length: h - u + 1 }, (f, x) => u + x);
819
+ function va(e, t, n, r) {
820
+ const l = e.getFullYear(), s = Math.min(l, r.getFullYear() - 100), d = Math.max(l, r.getFullYear() + 20), m = (t == null ? void 0 : t.getFullYear()) ?? s, y = (n == null ? void 0 : n.getFullYear()) ?? d, b = Math.min(m, y, l), u = Math.max(m, y, l);
821
+ return Array.from({ length: u - b + 1 }, (v, N) => b + N);
762
822
  }
763
- const da = Ne(
823
+ const Na = oe(
764
824
  ({
765
825
  label: e,
766
826
  value: t,
767
- defaultValue: a,
827
+ defaultValue: n,
768
828
  onValueChange: r,
769
- presets: o = [],
770
- customLabel: c = "Custom",
829
+ presets: l = [],
830
+ customLabel: s = "Custom",
771
831
  showCustom: d = !0,
772
- presetColumns: g = "auto",
773
- placeholder: v = "Select date",
774
- helperText: u,
775
- isError: h = !1,
776
- errorMessage: f,
777
- min: x,
778
- max: R,
779
- name: T,
780
- disabled: k = !1,
781
- readOnly: w = !1,
782
- required: A = !1,
783
- locale: I,
784
- weekStartsOn: C = 0,
785
- className: P,
786
- id: U,
787
- style: he,
788
- ...Ie
789
- }, me) => {
790
- const $e = Qe(), oe = U ?? $e, le = `${oe}-label`, ee = `${oe}-panel`, se = `${oe}-helper`, Be = `${oe}-error`, Re = t !== void 0, [ze, We] = G(a ?? ""), [Z, Y] = G(!1), ke = Re ? t : ze, N = nt(ke), B = Ee(He, []), j = nt(x), L = nt(R), [$, V] = G(() => re(N ?? B)), [S, J] = G(() => N ?? B), ge = ne(null), te = ne({}), fe = ne(!1), xe = ta($, C), Ce = la(C, I), qe = Ee(() => na(I), [I]), q = ca($, j, L, B), F = o.length > 0, Oe = F ? d : !0, ie = g === "auto" ? void 0 : {
791
- "--p-date-picker-preset-columns": String(g)
792
- }, E = h && f ? Be : u ? se : void 0, D = N ? ra(N, I) : v, Q = F ? o.some((s) => Ze(mt(s), N)) : !1, ce = Z || !!(N && !Q), Fe = kt($, -1), z = kt($, 1), De = bt(Fe, j, L), be = bt(z, j, L);
793
- Me(() => {
794
- var s;
795
- Z && fe.current && ((s = te.current[Je(S)]) == null || s.focus(), fe.current = !1);
796
- }, [S, Z, $]);
797
- const _e = (s, y) => {
798
- const H = Je(s);
799
- Re || We(H), s && V(re(s)), r == null || r(H, { date: s, source: y });
800
- }, Ae = (s) => {
801
- if (k || w)
832
+ presetColumns: m = "auto",
833
+ placeholder: y = "Select date",
834
+ helperText: b,
835
+ isError: u = !1,
836
+ errorMessage: v,
837
+ min: N,
838
+ max: F,
839
+ name: k,
840
+ disabled: g = !1,
841
+ readOnly: $ = !1,
842
+ required: j = !1,
843
+ locale: B,
844
+ weekStartsOn: A = 0,
845
+ className: I,
846
+ id: T,
847
+ style: V,
848
+ ...S
849
+ }, z) => {
850
+ const ee = Oe(), O = T ?? ee, X = `${O}-label`, p = `${O}-panel`, M = `${O}-helper`, x = `${O}-error`, W = t !== void 0, [pe, w] = re(n ?? ""), [D, H] = re(!1), he = W ? t : pe, Y = lt(he), R = tt(ze, []), te = lt(N), Z = lt(F), [G, J] = re(() => fe(Y ?? R)), [q, ce] = re(() => Y ?? R), De = me(null), be = me({}), xe = me(!1), Fe = pa(G, A), Se = fa(A, B), Xe = tt(() => ba(B), [B]), le = va(G, te, Z, R), U = l.length > 0, Ze = U ? d : !0, ge = m === "auto" ? void 0 : {
851
+ "--p-date-picker-preset-columns": String(m)
852
+ }, de = u && v ? x : b ? M : void 0, L = Y ? _a(Y, B) : y, ue = U ? l.some((o) => Ee(_t(o), Y)) : !1, ye = D || !!(Y && !ue), Te = Mt(G, -1), Q = Mt(G, 1), Ie = gt(Te, te, Z), Me = gt(Q, te, Z);
853
+ Ce(() => {
854
+ var o;
855
+ D && xe.current && ((o = be.current[et(q)]) == null || o.focus(), xe.current = !1);
856
+ }, [q, D, G]);
857
+ const $e = (o, C) => {
858
+ const ae = et(o);
859
+ W || w(ae), o && J(fe(o)), r == null || r(ae, { date: o, source: C });
860
+ }, je = (o) => {
861
+ if (g || $)
802
862
  return;
803
- const y = N ?? B;
804
- ge.current = s, fe.current = !0, J(y), V(re(y)), Y(!0);
805
- }, de = (s = !1) => {
806
- var y;
807
- Y(!1), s && ((y = ge.current) == null || y.focus());
808
- }, ye = (s) => {
809
- const y = sa(s, j, L);
810
- V(y), J(ia(y, S, j, L));
811
- }, Le = (s) => {
812
- const { value: y } = s.currentTarget;
813
- ye(new Date($.getFullYear(), Number(y), 1));
814
- }, ue = (s) => {
815
- const { value: y } = s.currentTarget;
816
- ye(new Date(Number(y), $.getMonth(), 1));
817
- }, Ye = (s) => {
818
- if (k || w)
863
+ const C = Y ?? R;
864
+ De.current = o, xe.current = !0, ce(C), J(fe(C)), H(!0);
865
+ }, ve = (o = !1) => {
866
+ var C;
867
+ H(!1), o && ((C = De.current) == null || C.focus());
868
+ }, we = (o) => {
869
+ const C = ga(o, te, Z);
870
+ J(C), ce(ya(C, q, te, Z));
871
+ }, He = (o) => {
872
+ const { value: C } = o.currentTarget;
873
+ we(new Date(G.getFullYear(), Number(C), 1));
874
+ }, Ne = (o) => {
875
+ const { value: C } = o.currentTarget;
876
+ we(new Date(Number(C), G.getMonth(), 1));
877
+ }, Be = (o) => {
878
+ if (g || $)
819
879
  return;
820
- const y = mt(s);
821
- _e(y, "preset"), de();
822
- }, Ke = (s) => {
823
- k || w || gt(s, j) || ft(s, L) || (J(s), _e(s, "calendar"), de(!0));
824
- }, Ge = (s) => {
825
- gt(s, j) || ft(s, L) || (fe.current = !0, J(s), V(re(s)));
826
- }, Xe = (s) => (y) => {
827
- if (y.key === "Escape") {
828
- y.preventDefault(), de(!0);
880
+ const C = _t(o);
881
+ $e(C, "preset"), ve();
882
+ }, We = (o) => {
883
+ g || $ || mt(o, te) || ft(o, Z) || (ce(o), $e(o, "calendar"), ve(!0));
884
+ }, Je = (o) => {
885
+ mt(o, te) || ft(o, Z) || (xe.current = !0, ce(o), J(fe(o)));
886
+ }, Qe = (o) => (C) => {
887
+ if (C.key === "Escape") {
888
+ C.preventDefault(), ve(!0);
829
889
  return;
830
890
  }
831
- const H = (s.getDay() - C + 7) % 7, b = {
832
- ArrowLeft: pe(s, -1),
833
- ArrowRight: pe(s, 1),
834
- ArrowUp: pe(s, -7),
835
- ArrowDown: pe(s, 7),
836
- Home: pe(s, -H),
837
- End: pe(s, 6 - H),
838
- PageUp: Ft(s, -1),
839
- PageDown: Ft(s, 1)
840
- }[y.key];
841
- b && (y.preventDefault(), Ge(b));
891
+ const ae = (o.getDay() - A + 7) % 7, P = {
892
+ ArrowLeft: ke(o, -1),
893
+ ArrowRight: ke(o, 1),
894
+ ArrowUp: ke(o, -7),
895
+ ArrowDown: ke(o, 7),
896
+ Home: ke(o, -ae),
897
+ End: ke(o, 6 - ae),
898
+ PageUp: Vt(o, -1),
899
+ PageDown: Vt(o, 1)
900
+ }[C.key];
901
+ P && (C.preventDefault(), Je(P));
842
902
  };
843
903
  return /* @__PURE__ */ _(
844
904
  "div",
845
905
  {
846
- ...Ie,
847
- ref: me,
848
- id: oe,
849
- style: ie ? { ...he, ...ie } : he,
850
- className: m(
906
+ ...S,
907
+ ref: z,
908
+ id: O,
909
+ style: ge ? { ...V, ...ge } : V,
910
+ className: h(
851
911
  "p-date-picker",
852
- F && "p-date-picker--with-presets",
853
- h && "p-date-picker--error",
854
- k && "p-date-picker--disabled",
855
- P
912
+ U && "p-date-picker--with-presets",
913
+ u && "p-date-picker--error",
914
+ g && "p-date-picker--disabled",
915
+ I
856
916
  ),
857
917
  children: [
858
- F ? /* @__PURE__ */ _("div", { id: le, className: "p-date-picker__label", children: [
859
- /* @__PURE__ */ n("span", { children: e }),
860
- /* @__PURE__ */ n("span", { className: m("p-date-picker__label-value", !N && "p-date-picker__label-value--empty"), children: D })
918
+ U ? /* @__PURE__ */ _("div", { id: X, className: "p-date-picker__label", children: [
919
+ /* @__PURE__ */ a("span", { children: e }),
920
+ /* @__PURE__ */ a("span", { className: h("p-date-picker__label-value", !Y && "p-date-picker__label-value--empty"), children: L })
861
921
  ] }) : null,
862
- F ? /* @__PURE__ */ _(
922
+ U ? /* @__PURE__ */ _(
863
923
  "div",
864
924
  {
865
- "aria-describedby": E,
866
- "aria-labelledby": le,
867
- className: m(
925
+ "aria-describedby": de,
926
+ "aria-labelledby": X,
927
+ className: h(
868
928
  "p-date-picker__presets",
869
- g !== "auto" && "p-date-picker__presets--fixed"
929
+ m !== "auto" && "p-date-picker__presets--fixed"
870
930
  ),
871
931
  role: "group",
872
932
  children: [
873
- o.map((s) => {
874
- const y = mt(s), H = Ze(y, N);
875
- return /* @__PURE__ */ n(
933
+ l.map((o) => {
934
+ const C = _t(o), ae = Ee(C, Y);
935
+ return /* @__PURE__ */ a(
876
936
  "button",
877
937
  {
878
938
  type: "button",
879
- className: m("p-date-picker__preset", H && "p-date-picker__preset--active"),
880
- disabled: k,
881
- "aria-pressed": H,
882
- onClick: () => Ye(s),
883
- children: s.label
939
+ className: h("p-date-picker__preset", ae && "p-date-picker__preset--active"),
940
+ disabled: g,
941
+ "aria-pressed": ae,
942
+ onClick: () => Be(o),
943
+ children: o.label
884
944
  },
885
- s.label
945
+ o.label
886
946
  );
887
947
  }),
888
- Oe ? /* @__PURE__ */ n(
948
+ Ze ? /* @__PURE__ */ a(
889
949
  "button",
890
950
  {
891
951
  type: "button",
892
- className: m(
952
+ className: h(
893
953
  "p-date-picker__preset",
894
- ce && "p-date-picker__preset--active"
954
+ ye && "p-date-picker__preset--active"
895
955
  ),
896
- disabled: k,
897
- "aria-controls": ee,
898
- "aria-expanded": Z,
899
- "aria-pressed": ce,
900
- onClick: (s) => Z ? de(!0) : Ae(s.currentTarget),
901
- children: c
956
+ disabled: g,
957
+ "aria-controls": p,
958
+ "aria-expanded": D,
959
+ "aria-pressed": ye,
960
+ onClick: (o) => D ? ve(!0) : je(o.currentTarget),
961
+ children: s
902
962
  }
903
963
  ) : null
904
964
  ]
@@ -907,169 +967,169 @@ const da = Ne(
907
967
  "button",
908
968
  {
909
969
  type: "button",
910
- className: m(
970
+ className: h(
911
971
  "p-date-picker__trigger",
912
- !N && "p-date-picker__trigger--empty",
913
- N && "p-date-picker__trigger--filled",
914
- Z && "p-date-picker__trigger--open"
972
+ !Y && "p-date-picker__trigger--empty",
973
+ Y && "p-date-picker__trigger--filled",
974
+ D && "p-date-picker__trigger--open"
915
975
  ),
916
- disabled: k,
917
- "aria-controls": ee,
918
- "aria-describedby": E,
919
- "aria-expanded": Z,
976
+ disabled: g,
977
+ "aria-controls": p,
978
+ "aria-describedby": de,
979
+ "aria-expanded": D,
920
980
  "aria-haspopup": "dialog",
921
- "aria-label": `${e}: ${D}`,
922
- onClick: (s) => Z ? de(!0) : Ae(s.currentTarget),
981
+ "aria-label": `${e}: ${L}`,
982
+ onClick: (o) => D ? ve(!0) : je(o.currentTarget),
923
983
  children: [
924
- /* @__PURE__ */ n(
984
+ /* @__PURE__ */ a(
925
985
  "span",
926
986
  {
927
- id: le,
928
- className: m(
987
+ id: X,
988
+ className: h(
929
989
  "p-date-picker__trigger-label p-date-picker__trigger-floating-label",
930
- h && "p-date-picker__trigger-label--error"
990
+ u && "p-date-picker__trigger-label--error"
931
991
  ),
932
992
  "aria-hidden": "true",
933
993
  children: e
934
994
  }
935
995
  ),
936
- /* @__PURE__ */ n(
996
+ /* @__PURE__ */ a(
937
997
  "span",
938
998
  {
939
- className: m(
999
+ className: h(
940
1000
  "p-date-picker__trigger-label p-date-picker__trigger-placeholder-label",
941
- h && "p-date-picker__trigger-label--error"
1001
+ u && "p-date-picker__trigger-label--error"
942
1002
  ),
943
1003
  "aria-hidden": "true",
944
1004
  children: e
945
1005
  }
946
1006
  ),
947
- /* @__PURE__ */ n("span", { className: "p-date-picker__trigger-value", children: D }),
948
- /* @__PURE__ */ n("span", { className: "p-date-picker__trigger-icon", children: /* @__PURE__ */ n(Rt, {}) })
1007
+ /* @__PURE__ */ a("span", { className: "p-date-picker__trigger-value", children: L }),
1008
+ /* @__PURE__ */ a("span", { className: "p-date-picker__trigger-icon", children: /* @__PURE__ */ a(qt, {}) })
949
1009
  ]
950
1010
  }
951
1011
  ),
952
- /* @__PURE__ */ n("input", { type: "hidden", name: T, value: ke ?? "", required: A }),
953
- Z && /* @__PURE__ */ _(
1012
+ /* @__PURE__ */ a("input", { type: "hidden", name: k, value: he ?? "", required: j }),
1013
+ D && /* @__PURE__ */ _(
954
1014
  "div",
955
1015
  {
956
- id: ee,
1016
+ id: p,
957
1017
  className: "p-date-picker__panel",
958
1018
  role: "dialog",
959
- "aria-labelledby": `${ee}-title`,
960
- onKeyDown: (s) => {
961
- s.key === "Escape" && de();
1019
+ "aria-labelledby": `${p}-title`,
1020
+ onKeyDown: (o) => {
1021
+ o.key === "Escape" && ve();
962
1022
  },
963
1023
  children: [
964
1024
  /* @__PURE__ */ _("div", { className: "p-date-picker__calendar-header", children: [
965
- /* @__PURE__ */ n(
1025
+ /* @__PURE__ */ a(
966
1026
  "button",
967
1027
  {
968
1028
  type: "button",
969
1029
  className: "p-date-picker__nav",
970
1030
  "aria-label": "Previous month",
971
- disabled: De,
972
- onClick: () => ye(Fe),
973
- children: /* @__PURE__ */ n(At, {})
1031
+ disabled: Ie,
1032
+ onClick: () => we(Te),
1033
+ children: /* @__PURE__ */ a(Pt, {})
974
1034
  }
975
1035
  ),
976
1036
  /* @__PURE__ */ _("div", { className: "p-date-picker__month", children: [
977
- /* @__PURE__ */ n("span", { id: `${ee}-title`, className: "p-date-picker__month-label", children: aa($, I) }),
978
- /* @__PURE__ */ n(
1037
+ /* @__PURE__ */ a("span", { id: `${p}-title`, className: "p-date-picker__month-label", children: ha(G, B) }),
1038
+ /* @__PURE__ */ a(
979
1039
  "select",
980
1040
  {
981
1041
  className: "p-date-picker__month-select p-date-picker__calendar-select",
982
1042
  "aria-label": "Month",
983
- value: $.getMonth(),
984
- onChange: Le,
985
- children: qe.map((s) => /* @__PURE__ */ n(
1043
+ value: G.getMonth(),
1044
+ onChange: He,
1045
+ children: Xe.map((o) => /* @__PURE__ */ a(
986
1046
  "option",
987
1047
  {
988
- value: s.value,
989
- disabled: bt(new Date($.getFullYear(), s.value, 1), j, L),
990
- children: s.label
1048
+ value: o.value,
1049
+ disabled: gt(new Date(G.getFullYear(), o.value, 1), te, Z),
1050
+ children: o.label
991
1051
  },
992
- s.value
1052
+ o.value
993
1053
  ))
994
1054
  }
995
1055
  ),
996
- /* @__PURE__ */ n(
1056
+ /* @__PURE__ */ a(
997
1057
  "select",
998
1058
  {
999
1059
  className: "p-date-picker__year-select p-date-picker__calendar-select",
1000
1060
  "aria-label": "Year",
1001
- value: $.getFullYear(),
1002
- onChange: ue,
1003
- children: q.map((s) => /* @__PURE__ */ n("option", { value: s, children: s }, s))
1061
+ value: G.getFullYear(),
1062
+ onChange: Ne,
1063
+ children: le.map((o) => /* @__PURE__ */ a("option", { value: o, children: o }, o))
1004
1064
  }
1005
1065
  )
1006
1066
  ] }),
1007
- /* @__PURE__ */ n(
1067
+ /* @__PURE__ */ a(
1008
1068
  "button",
1009
1069
  {
1010
1070
  type: "button",
1011
1071
  className: "p-date-picker__nav",
1012
1072
  "aria-label": "Next month",
1013
- disabled: be,
1014
- onClick: () => ye(z),
1015
- children: /* @__PURE__ */ n(Lt, {})
1073
+ disabled: Me,
1074
+ onClick: () => we(Q),
1075
+ children: /* @__PURE__ */ a(Ft, {})
1016
1076
  }
1017
1077
  )
1018
1078
  ] }),
1019
- /* @__PURE__ */ n("div", { className: "p-date-picker__weekdays", "aria-hidden": "true", children: Ce.map((s) => /* @__PURE__ */ n("span", { children: s }, s)) }),
1020
- /* @__PURE__ */ n("div", { className: "p-date-picker__grid", role: "grid", "aria-labelledby": `${ee}-title`, children: xe.map((s) => {
1021
- const y = Je(s), H = s.getMonth() !== $.getMonth(), l = Ze(s, N), b = Ze(s, B), K = gt(s, j) || ft(s, L);
1022
- return /* @__PURE__ */ n(
1079
+ /* @__PURE__ */ a("div", { className: "p-date-picker__weekdays", "aria-hidden": "true", children: Se.map((o) => /* @__PURE__ */ a("span", { children: o }, o)) }),
1080
+ /* @__PURE__ */ a("div", { className: "p-date-picker__grid", role: "grid", "aria-labelledby": `${p}-title`, children: Fe.map((o) => {
1081
+ const C = et(o), ae = o.getMonth() !== G.getMonth(), i = Ee(o, Y), P = Ee(o, R), E = mt(o, te) || ft(o, Z);
1082
+ return /* @__PURE__ */ a(
1023
1083
  "button",
1024
1084
  {
1025
- ref: (ve) => {
1026
- te.current[y] = ve;
1085
+ ref: (Pe) => {
1086
+ be.current[C] = Pe;
1027
1087
  },
1028
1088
  type: "button",
1029
1089
  role: "gridcell",
1030
- "data-date": y,
1031
- className: m(
1090
+ "data-date": C,
1091
+ className: h(
1032
1092
  "p-date-picker__day",
1033
- H && "p-date-picker__day--outside",
1034
- b && "p-date-picker__day--today",
1035
- l && "p-date-picker__day--selected"
1093
+ ae && "p-date-picker__day--outside",
1094
+ P && "p-date-picker__day--today",
1095
+ i && "p-date-picker__day--selected"
1036
1096
  ),
1037
- disabled: K,
1038
- "aria-label": oa(s, I),
1039
- "aria-selected": l,
1040
- tabIndex: Ze(s, S) ? 0 : -1,
1041
- onClick: () => Ke(s),
1042
- onKeyDown: Xe(s),
1043
- children: s.getDate()
1097
+ disabled: E,
1098
+ "aria-label": ma(o, B),
1099
+ "aria-selected": i,
1100
+ tabIndex: Ee(o, q) ? 0 : -1,
1101
+ onClick: () => We(o),
1102
+ onKeyDown: Qe(o),
1103
+ children: o.getDate()
1044
1104
  },
1045
- y
1105
+ C
1046
1106
  );
1047
1107
  }) })
1048
1108
  ]
1049
1109
  }
1050
1110
  ),
1051
- h && f ? /* @__PURE__ */ n("p", { id: Be, role: "alert", className: "p-date-picker__message p-date-picker__message--error", children: f }) : null,
1052
- !h && u ? /* @__PURE__ */ n("p", { id: se, className: "p-date-picker__message", children: u }) : null
1111
+ u && v ? /* @__PURE__ */ a("p", { id: x, role: "alert", className: "p-date-picker__message p-date-picker__message--error", children: v }) : null,
1112
+ !u && b ? /* @__PURE__ */ a("p", { id: M, className: "p-date-picker__message", children: b }) : null
1053
1113
  ]
1054
1114
  }
1055
1115
  );
1056
1116
  }
1057
1117
  );
1058
- da.displayName = "PDatePicker";
1059
- const Ba = {
1060
- today: { label: "Today", value: () => He() },
1061
- yesterday: { label: "Yesterday", value: () => pe(He(), -1) },
1062
- tomorrow: { label: "Tomorrow", value: () => pe(He(), 1) },
1063
- startOfMonth: { label: "Start of month", value: () => re(He()) },
1118
+ Na.displayName = "PDatePicker";
1119
+ const tn = {
1120
+ today: { label: "Today", value: () => ze() },
1121
+ yesterday: { label: "Yesterday", value: () => ke(ze(), -1) },
1122
+ tomorrow: { label: "Tomorrow", value: () => ke(ze(), 1) },
1123
+ startOfMonth: { label: "Start of month", value: () => fe(ze()) },
1064
1124
  endOfMonth: {
1065
1125
  label: "End of month",
1066
1126
  value: () => {
1067
- const e = He();
1127
+ const e = ze();
1068
1128
  return new Date(e.getFullYear(), e.getMonth() + 1, 0);
1069
1129
  }
1070
1130
  }
1071
- }, ua = new Intl.DateTimeFormat(void 0, { weekday: "short" });
1072
- function lt(e) {
1131
+ }, ka = new Intl.DateTimeFormat(void 0, { weekday: "short" });
1132
+ function st(e) {
1073
1133
  if (!e)
1074
1134
  return null;
1075
1135
  if (e instanceof Date)
@@ -1077,56 +1137,56 @@ function lt(e) {
1077
1137
  const t = e.split("-").map(Number);
1078
1138
  if (t.length !== 3 || t.some(Number.isNaN))
1079
1139
  return null;
1080
- const [a, r, o] = t, c = new Date(a, r - 1, o);
1081
- return c.getFullYear() !== a || c.getMonth() !== r - 1 || c.getDate() !== o ? null : c;
1140
+ const [n, r, l] = t, s = new Date(n, r - 1, l);
1141
+ return s.getFullYear() !== n || s.getMonth() !== r - 1 || s.getDate() !== l ? null : s;
1082
1142
  }
1083
- function M(e) {
1143
+ function K(e) {
1084
1144
  if (!e)
1085
1145
  return "";
1086
- const t = e.getFullYear(), a = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
1087
- return `${t}-${a}-${r}`;
1146
+ const t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
1147
+ return `${t}-${n}-${r}`;
1088
1148
  }
1089
- function X(e) {
1149
+ function se(e) {
1090
1150
  return new Date(e.getFullYear(), e.getMonth(), 1);
1091
1151
  }
1092
- function Ue(e) {
1152
+ function Re(e) {
1093
1153
  return new Date(e.getFullYear(), e.getMonth() + 1, 0);
1094
1154
  }
1095
- function st(e, t) {
1155
+ function ot(e, t) {
1096
1156
  return new Date(e.getFullYear(), e.getMonth() + t, 1);
1097
1157
  }
1098
- function St(e, t) {
1099
- const a = st(e, t), r = Ue(a).getDate();
1100
- return new Date(a.getFullYear(), a.getMonth(), Math.min(e.getDate(), r));
1158
+ function Kt(e, t) {
1159
+ const n = ot(e, t), r = Re(n).getDate();
1160
+ return new Date(n.getFullYear(), n.getMonth(), Math.min(e.getDate(), r));
1101
1161
  }
1102
- function O(e, t) {
1162
+ function ie(e, t) {
1103
1163
  return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
1104
1164
  }
1105
- function we() {
1165
+ function Ye() {
1106
1166
  const e = /* @__PURE__ */ new Date();
1107
1167
  return new Date(e.getFullYear(), e.getMonth(), e.getDate());
1108
1168
  }
1109
- function pa(e, t) {
1110
- const a = X(e), r = (a.getDay() - t + 7) % 7, o = O(a, -r);
1111
- return Array.from({ length: 42 }, (c, d) => O(o, d));
1169
+ function Da(e, t) {
1170
+ const n = se(e), r = (n.getDay() - t + 7) % 7, l = ie(n, -r);
1171
+ return Array.from({ length: 42 }, (s, d) => ie(l, d));
1112
1172
  }
1113
- function ha(e, t) {
1173
+ function xa(e, t) {
1114
1174
  return new Intl.DateTimeFormat(t, { month: "long", year: "numeric" }).format(e);
1115
1175
  }
1116
- function ma(e) {
1117
- return Array.from({ length: 12 }, (t, a) => ({
1118
- label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, a, 1)),
1119
- value: a
1176
+ function Ma(e) {
1177
+ return Array.from({ length: 12 }, (t, n) => ({
1178
+ label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, n, 1)),
1179
+ value: n
1120
1180
  }));
1121
1181
  }
1122
- function tt(e, t) {
1182
+ function nt(e, t) {
1123
1183
  return new Intl.DateTimeFormat(t, {
1124
1184
  month: "short",
1125
1185
  day: "numeric",
1126
1186
  year: "numeric"
1127
1187
  }).format(e);
1128
1188
  }
1129
- function ga(e, t) {
1189
+ function $a(e, t) {
1130
1190
  return new Intl.DateTimeFormat(t, {
1131
1191
  weekday: "long",
1132
1192
  month: "long",
@@ -1134,231 +1194,231 @@ function ga(e, t) {
1134
1194
  year: "numeric"
1135
1195
  }).format(e);
1136
1196
  }
1137
- function fa(e, t) {
1138
- const a = new Date(2024, 0, 7);
1139
- return Array.from({ length: 7 }, (r, o) => {
1140
- const c = O(a, e + o);
1141
- return ua.formatToParts(c).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(c) : "";
1197
+ function wa(e, t) {
1198
+ const n = new Date(2024, 0, 7);
1199
+ return Array.from({ length: 7 }, (r, l) => {
1200
+ const s = ie(n, e + l);
1201
+ return ka.formatToParts(s).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(s) : "";
1142
1202
  });
1143
1203
  }
1144
- function at(e, t) {
1145
- return !!(e && t && M(e) === M(t));
1204
+ function rt(e, t) {
1205
+ return !!(e && t && K(e) === K(t));
1146
1206
  }
1147
- function _t(e, t) {
1207
+ function yt(e, t) {
1148
1208
  return !!(t && e.getTime() < t.getTime());
1149
1209
  }
1150
- function yt(e, t) {
1210
+ function vt(e, t) {
1151
1211
  return !!(t && e.getTime() > t.getTime());
1152
1212
  }
1153
- function Tt(e, t) {
1213
+ function jt(e, t) {
1154
1214
  return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
1155
1215
  }
1156
- function vt(e, t, a) {
1157
- const r = X(e), o = Ue(e);
1158
- return !!(t && o < t || a && r > a);
1216
+ function Nt(e, t, n) {
1217
+ const r = se(e), l = Re(e);
1218
+ return !!(t && l < t || n && r > n);
1159
1219
  }
1160
- function ba(e, t, a) {
1161
- return t && Ue(e) < t ? X(t) : a && X(e) > a ? X(a) : X(e);
1220
+ function Pa(e, t, n) {
1221
+ return t && Re(e) < t ? se(t) : n && se(e) > n ? se(n) : se(e);
1162
1222
  }
1163
- function _a(e, t, a, r) {
1164
- const o = X(e), c = Ue(e);
1223
+ function Fa(e, t, n, r) {
1224
+ const l = se(e), s = Re(e);
1165
1225
  let d = new Date(
1166
- o.getFullYear(),
1167
- o.getMonth(),
1168
- Math.min(t.getDate(), c.getDate())
1226
+ l.getFullYear(),
1227
+ l.getMonth(),
1228
+ Math.min(t.getDate(), s.getDate())
1169
1229
  );
1170
- return a && d < a && (d = Tt(a, o) ? a : o), r && d > r && (d = Tt(r, o) ? r : c), d;
1230
+ return n && d < n && (d = jt(n, l) ? n : l), r && d > r && (d = jt(r, l) ? r : s), d;
1171
1231
  }
1172
- function ya(e, t, a, r) {
1173
- const o = e.getFullYear(), c = Math.min(o, r.getFullYear() - 100), d = Math.max(o, r.getFullYear() + 20), g = (t == null ? void 0 : t.getFullYear()) ?? c, v = (a == null ? void 0 : a.getFullYear()) ?? d, u = Math.min(g, v, o), h = Math.max(g, v, o);
1174
- return Array.from({ length: h - u + 1 }, (f, x) => u + x);
1232
+ function Ia(e, t, n, r) {
1233
+ const l = e.getFullYear(), s = Math.min(l, r.getFullYear() - 100), d = Math.max(l, r.getFullYear() + 20), m = (t == null ? void 0 : t.getFullYear()) ?? s, y = (n == null ? void 0 : n.getFullYear()) ?? d, b = Math.min(m, y, l), u = Math.max(m, y, l);
1234
+ return Array.from({ length: u - b + 1 }, (v, N) => b + N);
1175
1235
  }
1176
- function va(e, t, a) {
1177
- return !!(t && a && e > t && e < a);
1236
+ function Ya(e, t, n) {
1237
+ return !!(t && n && e > t && e < n);
1178
1238
  }
1179
- function Na(e, t) {
1239
+ function Ca(e, t) {
1180
1240
  return !e && !t ? {} : e && t && t < e ? {
1181
- start: M(t),
1182
- end: M(e)
1241
+ start: K(t),
1242
+ end: K(e)
1183
1243
  } : {
1184
- start: M(e),
1185
- end: M(t)
1244
+ start: K(e),
1245
+ end: K(t)
1186
1246
  };
1187
1247
  }
1188
- function Nt(e) {
1248
+ function kt(e) {
1189
1249
  return typeof e.value == "function" ? e.value() : e.value;
1190
1250
  }
1191
- function rt(e) {
1251
+ function it(e) {
1192
1252
  return {
1193
- startDate: lt(e == null ? void 0 : e.start),
1194
- endDate: lt(e == null ? void 0 : e.end)
1253
+ startDate: st(e == null ? void 0 : e.start),
1254
+ endDate: st(e == null ? void 0 : e.end)
1195
1255
  };
1196
1256
  }
1197
- function Pt(e, t) {
1257
+ function Ht(e, t) {
1198
1258
  return !!(e != null && e.start && (e != null && e.end) && e.start === (t == null ? void 0 : t.start) && e.end === (t == null ? void 0 : t.end));
1199
1259
  }
1200
- function ka(e, t, a) {
1201
- const { startDate: r, endDate: o } = rt(e);
1202
- return r && o ? `${tt(r, a)} - ${tt(o, a)}` : r ? `${tt(r, a)} -` : o ? `- ${tt(o, a)}` : t;
1260
+ function Sa(e, t, n) {
1261
+ const { startDate: r, endDate: l } = it(e);
1262
+ return r && l ? `${nt(r, n)} - ${nt(l, n)}` : r ? `${nt(r, n)} -` : l ? `- ${nt(l, n)}` : t;
1203
1263
  }
1204
- const xa = Ne(
1264
+ const Ta = oe(
1205
1265
  ({
1206
1266
  label: e,
1207
1267
  value: t,
1208
- defaultValue: a,
1268
+ defaultValue: n,
1209
1269
  onValueChange: r,
1210
- presets: o = [],
1211
- customLabel: c = "Custom",
1270
+ presets: l = [],
1271
+ customLabel: s = "Custom",
1212
1272
  showCustom: d = !0,
1213
- presetColumns: g = "auto",
1214
- placeholder: v = "Select range",
1215
- helperText: u,
1216
- isError: h = !1,
1217
- errorMessage: f,
1218
- min: x,
1219
- max: R,
1220
- nameStart: T,
1221
- nameEnd: k,
1222
- disabled: w = !1,
1223
- readOnly: A = !1,
1224
- required: I = !1,
1225
- locale: C,
1226
- weekStartsOn: P = 0,
1227
- className: U,
1228
- id: he,
1229
- style: Ie,
1230
- ...me
1231
- }, $e) => {
1232
- const oe = Qe(), le = he ?? oe, ee = `${le}-label`, se = `${le}-panel`, Be = `${le}-helper`, Re = `${le}-error`, ze = t !== void 0, [We, Z] = G(a ?? {}), [Y, ke] = G(!1), N = ze ? t : We, { startDate: B, endDate: j } = rt(N), L = Ee(we, []), $ = lt(x), V = lt(R), [S, J] = G(() => X(B ?? L)), [ge, te] = G(() => B ?? L), fe = ne(null), xe = ne({}), Ce = ne(!1), qe = pa(S, P), q = fa(P, C), F = Ee(() => ma(C), [C]), Oe = ya(S, $, V, L), ie = o.length > 0, E = ie ? d : !0, D = g === "auto" ? void 0 : {
1233
- "--p-date-range-picker-preset-columns": String(g)
1234
- }, Q = !!(N != null && N.start && (N != null && N.end)), ce = h && f ? Re : u ? Be : void 0, Fe = ka(N, v, C), z = ie ? o.some((l) => Pt(Nt(l), N)) : !1, De = Y || !!(Q && !z), be = st(S, -1), _e = st(S, 1), Ae = vt(be, $, V), de = vt(_e, $, V);
1235
- Me(() => {
1236
- var l;
1237
- Y && Ce.current && ((l = xe.current[M(ge)]) == null || l.focus(), Ce.current = !1);
1238
- }, [ge, Y, S]);
1239
- const ye = (l, b) => {
1240
- const { startDate: K, endDate: ve } = rt(l), ae = Na(K, ve);
1241
- ze || Z(ae);
1242
- const Se = rt(ae);
1243
- Se.startDate && J(X(Se.startDate)), r == null || r(ae, {
1244
- startDate: Se.startDate,
1245
- endDate: Se.endDate,
1246
- source: b
1273
+ presetColumns: m = "auto",
1274
+ placeholder: y = "Select range",
1275
+ helperText: b,
1276
+ isError: u = !1,
1277
+ errorMessage: v,
1278
+ min: N,
1279
+ max: F,
1280
+ nameStart: k,
1281
+ nameEnd: g,
1282
+ disabled: $ = !1,
1283
+ readOnly: j = !1,
1284
+ required: B = !1,
1285
+ locale: A,
1286
+ weekStartsOn: I = 0,
1287
+ className: T,
1288
+ id: V,
1289
+ style: S,
1290
+ ...z
1291
+ }, ee) => {
1292
+ const O = Oe(), X = V ?? O, p = `${X}-label`, M = `${X}-panel`, x = `${X}-helper`, W = `${X}-error`, pe = t !== void 0, [w, D] = re(n ?? {}), [H, he] = re(!1), Y = pe ? t : w, { startDate: R, endDate: te } = it(Y), Z = tt(Ye, []), G = st(N), J = st(F), [q, ce] = re(() => se(R ?? Z)), [De, be] = re(() => R ?? Z), xe = me(null), Fe = me({}), Se = me(!1), Xe = Da(q, I), le = wa(I, A), U = tt(() => Ma(A), [A]), Ze = Ia(q, G, J, Z), ge = l.length > 0, de = ge ? d : !0, L = m === "auto" ? void 0 : {
1293
+ "--p-date-range-picker-preset-columns": String(m)
1294
+ }, ue = !!(Y != null && Y.start && (Y != null && Y.end)), ye = u && v ? W : b ? x : void 0, Te = Sa(Y, y, A), Q = ge ? l.some((i) => Ht(kt(i), Y)) : !1, Ie = H || !!(ue && !Q), Me = ot(q, -1), $e = ot(q, 1), je = Nt(Me, G, J), ve = Nt($e, G, J);
1295
+ Ce(() => {
1296
+ var i;
1297
+ H && Se.current && ((i = Fe.current[K(De)]) == null || i.focus(), Se.current = !1);
1298
+ }, [De, H, q]);
1299
+ const we = (i, P) => {
1300
+ const { startDate: E, endDate: Pe } = it(i), _e = Ca(E, Pe);
1301
+ pe || D(_e);
1302
+ const Ae = it(_e);
1303
+ Ae.startDate && ce(se(Ae.startDate)), r == null || r(_e, {
1304
+ startDate: Ae.startDate,
1305
+ endDate: Ae.endDate,
1306
+ source: P
1247
1307
  });
1248
- }, Le = (l) => {
1249
- if (w || A)
1308
+ }, He = (i) => {
1309
+ if ($ || j)
1250
1310
  return;
1251
- const b = B ?? L;
1252
- fe.current = l, Ce.current = !0, te(b), J(X(b)), ke(!0);
1253
- }, ue = (l = !1) => {
1254
- var b;
1255
- ke(!1), l && ((b = fe.current) == null || b.focus());
1256
- }, Ye = (l) => {
1257
- const b = ba(l, $, V);
1258
- J(b), te(_a(b, ge, $, V));
1259
- }, Ke = (l) => {
1260
- const { value: b } = l.currentTarget;
1261
- Ye(new Date(S.getFullYear(), Number(b), 1));
1262
- }, Ge = (l) => {
1263
- const { value: b } = l.currentTarget;
1264
- Ye(new Date(Number(b), S.getMonth(), 1));
1265
- }, Xe = (l) => {
1266
- w || A || (ye(Nt(l), "preset"), ue());
1267
- }, s = (l) => {
1268
- if (!(w || A || _t(l, $) || yt(l, V))) {
1269
- if (!B || j) {
1270
- te(l), ye({ start: M(l), end: "" }, "calendar");
1311
+ const P = R ?? Z;
1312
+ xe.current = i, Se.current = !0, be(P), ce(se(P)), he(!0);
1313
+ }, Ne = (i = !1) => {
1314
+ var P;
1315
+ he(!1), i && ((P = xe.current) == null || P.focus());
1316
+ }, Be = (i) => {
1317
+ const P = Pa(i, G, J);
1318
+ ce(P), be(Fa(P, De, G, J));
1319
+ }, We = (i) => {
1320
+ const { value: P } = i.currentTarget;
1321
+ Be(new Date(q.getFullYear(), Number(P), 1));
1322
+ }, Je = (i) => {
1323
+ const { value: P } = i.currentTarget;
1324
+ Be(new Date(Number(P), q.getMonth(), 1));
1325
+ }, Qe = (i) => {
1326
+ $ || j || (we(kt(i), "preset"), Ne());
1327
+ }, o = (i) => {
1328
+ if (!($ || j || yt(i, G) || vt(i, J))) {
1329
+ if (!R || te) {
1330
+ be(i), we({ start: K(i), end: "" }, "calendar");
1271
1331
  return;
1272
1332
  }
1273
- te(l), ye({ start: M(B), end: M(l) }, "calendar"), ue(!0);
1333
+ be(i), we({ start: K(R), end: K(i) }, "calendar"), Ne(!0);
1274
1334
  }
1275
- }, y = (l) => {
1276
- _t(l, $) || yt(l, V) || (Ce.current = !0, te(l), J(X(l)));
1277
- }, H = (l) => (b) => {
1278
- if (b.key === "Escape") {
1279
- b.preventDefault(), ue(!0);
1335
+ }, C = (i) => {
1336
+ yt(i, G) || vt(i, J) || (Se.current = !0, be(i), ce(se(i)));
1337
+ }, ae = (i) => (P) => {
1338
+ if (P.key === "Escape") {
1339
+ P.preventDefault(), Ne(!0);
1280
1340
  return;
1281
1341
  }
1282
- const K = (l.getDay() - P + 7) % 7, ae = {
1283
- ArrowLeft: O(l, -1),
1284
- ArrowRight: O(l, 1),
1285
- ArrowUp: O(l, -7),
1286
- ArrowDown: O(l, 7),
1287
- Home: O(l, -K),
1288
- End: O(l, 6 - K),
1289
- PageUp: St(l, -1),
1290
- PageDown: St(l, 1)
1291
- }[b.key];
1292
- ae && (b.preventDefault(), y(ae));
1342
+ const E = (i.getDay() - I + 7) % 7, _e = {
1343
+ ArrowLeft: ie(i, -1),
1344
+ ArrowRight: ie(i, 1),
1345
+ ArrowUp: ie(i, -7),
1346
+ ArrowDown: ie(i, 7),
1347
+ Home: ie(i, -E),
1348
+ End: ie(i, 6 - E),
1349
+ PageUp: Kt(i, -1),
1350
+ PageDown: Kt(i, 1)
1351
+ }[P.key];
1352
+ _e && (P.preventDefault(), C(_e));
1293
1353
  };
1294
1354
  return /* @__PURE__ */ _(
1295
1355
  "div",
1296
1356
  {
1297
- ...me,
1298
- ref: $e,
1299
- id: le,
1300
- style: D ? { ...Ie, ...D } : Ie,
1301
- className: m(
1357
+ ...z,
1358
+ ref: ee,
1359
+ id: X,
1360
+ style: L ? { ...S, ...L } : S,
1361
+ className: h(
1302
1362
  "p-date-range-picker",
1303
- ie && "p-date-range-picker--with-presets",
1304
- h && "p-date-range-picker--error",
1305
- w && "p-date-range-picker--disabled",
1306
- U
1363
+ ge && "p-date-range-picker--with-presets",
1364
+ u && "p-date-range-picker--error",
1365
+ $ && "p-date-range-picker--disabled",
1366
+ T
1307
1367
  ),
1308
1368
  children: [
1309
- ie ? /* @__PURE__ */ _("div", { id: ee, className: "p-date-range-picker__label", children: [
1310
- /* @__PURE__ */ n("span", { children: e }),
1311
- /* @__PURE__ */ n(
1369
+ ge ? /* @__PURE__ */ _("div", { id: p, className: "p-date-range-picker__label", children: [
1370
+ /* @__PURE__ */ a("span", { children: e }),
1371
+ /* @__PURE__ */ a(
1312
1372
  "span",
1313
1373
  {
1314
- className: m(
1374
+ className: h(
1315
1375
  "p-date-range-picker__label-value",
1316
- !Q && "p-date-range-picker__label-value--empty"
1376
+ !ue && "p-date-range-picker__label-value--empty"
1317
1377
  ),
1318
- children: Fe
1378
+ children: Te
1319
1379
  }
1320
1380
  )
1321
1381
  ] }) : null,
1322
- ie ? /* @__PURE__ */ _(
1382
+ ge ? /* @__PURE__ */ _(
1323
1383
  "div",
1324
1384
  {
1325
- "aria-describedby": ce,
1326
- "aria-labelledby": ee,
1327
- className: m(
1385
+ "aria-describedby": ye,
1386
+ "aria-labelledby": p,
1387
+ className: h(
1328
1388
  "p-date-range-picker__presets",
1329
- g !== "auto" && "p-date-range-picker__presets--fixed"
1389
+ m !== "auto" && "p-date-range-picker__presets--fixed"
1330
1390
  ),
1331
1391
  role: "group",
1332
1392
  children: [
1333
- o.map((l) => {
1334
- const b = Nt(l), K = Pt(b, N);
1335
- return /* @__PURE__ */ n(
1393
+ l.map((i) => {
1394
+ const P = kt(i), E = Ht(P, Y);
1395
+ return /* @__PURE__ */ a(
1336
1396
  "button",
1337
1397
  {
1338
1398
  type: "button",
1339
- className: m("p-date-range-picker__preset", K && "p-date-range-picker__preset--active"),
1340
- disabled: w,
1341
- "aria-pressed": K,
1342
- onClick: () => Xe(l),
1343
- children: l.label
1399
+ className: h("p-date-range-picker__preset", E && "p-date-range-picker__preset--active"),
1400
+ disabled: $,
1401
+ "aria-pressed": E,
1402
+ onClick: () => Qe(i),
1403
+ children: i.label
1344
1404
  },
1345
- l.label
1405
+ i.label
1346
1406
  );
1347
1407
  }),
1348
- E ? /* @__PURE__ */ n(
1408
+ de ? /* @__PURE__ */ a(
1349
1409
  "button",
1350
1410
  {
1351
1411
  type: "button",
1352
- className: m(
1412
+ className: h(
1353
1413
  "p-date-range-picker__preset",
1354
- De && "p-date-range-picker__preset--active"
1414
+ Ie && "p-date-range-picker__preset--active"
1355
1415
  ),
1356
- disabled: w,
1357
- "aria-controls": se,
1358
- "aria-expanded": Y,
1359
- "aria-pressed": De,
1360
- onClick: (l) => Y ? ue(!0) : Le(l.currentTarget),
1361
- children: c
1416
+ disabled: $,
1417
+ "aria-controls": M,
1418
+ "aria-expanded": H,
1419
+ "aria-pressed": Ie,
1420
+ onClick: (i) => H ? Ne(!0) : He(i.currentTarget),
1421
+ children: s
1362
1422
  }
1363
1423
  ) : null
1364
1424
  ]
@@ -1367,316 +1427,853 @@ const xa = Ne(
1367
1427
  "button",
1368
1428
  {
1369
1429
  type: "button",
1370
- className: m(
1430
+ className: h(
1371
1431
  "p-date-range-picker__trigger",
1372
- !Q && "p-date-range-picker__trigger--empty",
1373
- Q && "p-date-range-picker__trigger--filled",
1374
- Y && "p-date-range-picker__trigger--open"
1432
+ !ue && "p-date-range-picker__trigger--empty",
1433
+ ue && "p-date-range-picker__trigger--filled",
1434
+ H && "p-date-range-picker__trigger--open"
1375
1435
  ),
1376
- disabled: w,
1377
- "aria-controls": se,
1378
- "aria-describedby": ce,
1379
- "aria-expanded": Y,
1436
+ disabled: $,
1437
+ "aria-controls": M,
1438
+ "aria-describedby": ye,
1439
+ "aria-expanded": H,
1380
1440
  "aria-haspopup": "dialog",
1381
- "aria-label": `${e}: ${Fe}`,
1382
- onClick: (l) => Y ? ue(!0) : Le(l.currentTarget),
1441
+ "aria-label": `${e}: ${Te}`,
1442
+ onClick: (i) => H ? Ne(!0) : He(i.currentTarget),
1383
1443
  children: [
1384
- /* @__PURE__ */ n(
1444
+ /* @__PURE__ */ a(
1385
1445
  "span",
1386
1446
  {
1387
- id: ee,
1388
- className: m(
1447
+ id: p,
1448
+ className: h(
1389
1449
  "p-date-range-picker__trigger-label p-date-range-picker__trigger-floating-label",
1390
- h && "p-date-range-picker__trigger-label--error"
1450
+ u && "p-date-range-picker__trigger-label--error"
1391
1451
  ),
1392
1452
  "aria-hidden": "true",
1393
1453
  children: e
1394
1454
  }
1395
1455
  ),
1396
- /* @__PURE__ */ n(
1456
+ /* @__PURE__ */ a(
1397
1457
  "span",
1398
1458
  {
1399
- className: m(
1459
+ className: h(
1400
1460
  "p-date-range-picker__trigger-label p-date-range-picker__trigger-placeholder-label",
1401
- h && "p-date-range-picker__trigger-label--error"
1461
+ u && "p-date-range-picker__trigger-label--error"
1402
1462
  ),
1403
1463
  "aria-hidden": "true",
1404
1464
  children: e
1405
1465
  }
1406
1466
  ),
1407
- /* @__PURE__ */ n("span", { className: "p-date-range-picker__trigger-value", children: Fe }),
1408
- /* @__PURE__ */ n("span", { className: "p-date-range-picker__trigger-icon", children: /* @__PURE__ */ n(Rt, {}) })
1467
+ /* @__PURE__ */ a("span", { className: "p-date-range-picker__trigger-value", children: Te }),
1468
+ /* @__PURE__ */ a("span", { className: "p-date-range-picker__trigger-icon", children: /* @__PURE__ */ a(qt, {}) })
1409
1469
  ]
1410
1470
  }
1411
1471
  ),
1412
- /* @__PURE__ */ n("input", { type: "hidden", name: T, value: (N == null ? void 0 : N.start) ?? "", required: I }),
1413
- /* @__PURE__ */ n("input", { type: "hidden", name: k, value: (N == null ? void 0 : N.end) ?? "", required: I }),
1414
- Y && /* @__PURE__ */ _(
1472
+ /* @__PURE__ */ a("input", { type: "hidden", name: k, value: (Y == null ? void 0 : Y.start) ?? "", required: B }),
1473
+ /* @__PURE__ */ a("input", { type: "hidden", name: g, value: (Y == null ? void 0 : Y.end) ?? "", required: B }),
1474
+ H && /* @__PURE__ */ _(
1415
1475
  "div",
1416
1476
  {
1417
- id: se,
1477
+ id: M,
1418
1478
  className: "p-date-range-picker__panel",
1419
1479
  role: "dialog",
1420
- "aria-labelledby": `${se}-title`,
1421
- onKeyDown: (l) => {
1422
- l.key === "Escape" && ue();
1480
+ "aria-labelledby": `${M}-title`,
1481
+ onKeyDown: (i) => {
1482
+ i.key === "Escape" && Ne();
1423
1483
  },
1424
1484
  children: [
1425
1485
  /* @__PURE__ */ _("div", { className: "p-date-range-picker__calendar-header", children: [
1426
- /* @__PURE__ */ n(
1486
+ /* @__PURE__ */ a(
1427
1487
  "button",
1428
1488
  {
1429
1489
  type: "button",
1430
1490
  className: "p-date-range-picker__nav",
1431
1491
  "aria-label": "Previous month",
1432
- disabled: Ae,
1433
- onClick: () => Ye(be),
1434
- children: /* @__PURE__ */ n(At, {})
1492
+ disabled: je,
1493
+ onClick: () => Be(Me),
1494
+ children: /* @__PURE__ */ a(Pt, {})
1435
1495
  }
1436
1496
  ),
1437
1497
  /* @__PURE__ */ _("div", { className: "p-date-range-picker__month", children: [
1438
- /* @__PURE__ */ n("span", { id: `${se}-title`, className: "p-date-range-picker__month-label", children: ha(S, C) }),
1439
- /* @__PURE__ */ n(
1498
+ /* @__PURE__ */ a("span", { id: `${M}-title`, className: "p-date-range-picker__month-label", children: xa(q, A) }),
1499
+ /* @__PURE__ */ a(
1440
1500
  "select",
1441
1501
  {
1442
1502
  className: "p-date-range-picker__month-select p-date-range-picker__calendar-select",
1443
1503
  "aria-label": "Month",
1444
- value: S.getMonth(),
1445
- onChange: Ke,
1446
- children: F.map((l) => /* @__PURE__ */ n(
1504
+ value: q.getMonth(),
1505
+ onChange: We,
1506
+ children: U.map((i) => /* @__PURE__ */ a(
1447
1507
  "option",
1448
1508
  {
1449
- value: l.value,
1450
- disabled: vt(new Date(S.getFullYear(), l.value, 1), $, V),
1451
- children: l.label
1509
+ value: i.value,
1510
+ disabled: Nt(new Date(q.getFullYear(), i.value, 1), G, J),
1511
+ children: i.label
1452
1512
  },
1453
- l.value
1513
+ i.value
1454
1514
  ))
1455
1515
  }
1456
1516
  ),
1457
- /* @__PURE__ */ n(
1517
+ /* @__PURE__ */ a(
1458
1518
  "select",
1459
1519
  {
1460
1520
  className: "p-date-range-picker__year-select p-date-range-picker__calendar-select",
1461
1521
  "aria-label": "Year",
1462
- value: S.getFullYear(),
1463
- onChange: Ge,
1464
- children: Oe.map((l) => /* @__PURE__ */ n("option", { value: l, children: l }, l))
1522
+ value: q.getFullYear(),
1523
+ onChange: Je,
1524
+ children: Ze.map((i) => /* @__PURE__ */ a("option", { value: i, children: i }, i))
1465
1525
  }
1466
1526
  )
1467
1527
  ] }),
1468
- /* @__PURE__ */ n(
1528
+ /* @__PURE__ */ a(
1469
1529
  "button",
1470
1530
  {
1471
1531
  type: "button",
1472
1532
  className: "p-date-range-picker__nav",
1473
1533
  "aria-label": "Next month",
1474
- disabled: de,
1475
- onClick: () => Ye(_e),
1476
- children: /* @__PURE__ */ n(Lt, {})
1534
+ disabled: ve,
1535
+ onClick: () => Be($e),
1536
+ children: /* @__PURE__ */ a(Ft, {})
1477
1537
  }
1478
1538
  )
1479
1539
  ] }),
1480
- /* @__PURE__ */ n("div", { className: "p-date-range-picker__weekdays", "aria-hidden": "true", children: q.map((l) => /* @__PURE__ */ n("span", { children: l }, l)) }),
1481
- /* @__PURE__ */ n("div", { className: "p-date-range-picker__grid", role: "grid", "aria-labelledby": `${se}-title`, children: qe.map((l) => {
1482
- const b = M(l), K = l.getMonth() !== S.getMonth(), ve = at(l, B), ae = at(l, j), Se = va(l, B, j), ct = at(l, L), dt = _t(l, $) || yt(l, V);
1483
- return /* @__PURE__ */ n(
1540
+ /* @__PURE__ */ a("div", { className: "p-date-range-picker__weekdays", "aria-hidden": "true", children: le.map((i) => /* @__PURE__ */ a("span", { children: i }, i)) }),
1541
+ /* @__PURE__ */ a("div", { className: "p-date-range-picker__grid", role: "grid", "aria-labelledby": `${M}-title`, children: Xe.map((i) => {
1542
+ const P = K(i), E = i.getMonth() !== q.getMonth(), Pe = rt(i, R), _e = rt(i, te), Ae = Ya(i, R, te), dt = rt(i, Z), ut = yt(i, G) || vt(i, J);
1543
+ return /* @__PURE__ */ a(
1484
1544
  "button",
1485
1545
  {
1486
- ref: (ut) => {
1487
- xe.current[b] = ut;
1546
+ ref: (pt) => {
1547
+ Fe.current[P] = pt;
1488
1548
  },
1489
1549
  type: "button",
1490
1550
  role: "gridcell",
1491
- "data-date": b,
1492
- className: m(
1551
+ "data-date": P,
1552
+ className: h(
1493
1553
  "p-date-range-picker__day",
1494
- K && "p-date-range-picker__day--outside",
1495
- ct && "p-date-range-picker__day--today",
1496
- Se && "p-date-range-picker__day--in-range",
1497
- (ve || ae) && "p-date-range-picker__day--selected"
1554
+ E && "p-date-range-picker__day--outside",
1555
+ dt && "p-date-range-picker__day--today",
1556
+ Ae && "p-date-range-picker__day--in-range",
1557
+ (Pe || _e) && "p-date-range-picker__day--selected"
1498
1558
  ),
1499
- disabled: dt,
1500
- "aria-label": ga(l, C),
1501
- "aria-selected": ve || ae,
1502
- tabIndex: at(l, ge) ? 0 : -1,
1503
- onClick: () => s(l),
1504
- onKeyDown: H(l),
1505
- children: l.getDate()
1559
+ disabled: ut,
1560
+ "aria-label": $a(i, A),
1561
+ "aria-selected": Pe || _e,
1562
+ tabIndex: rt(i, De) ? 0 : -1,
1563
+ onClick: () => o(i),
1564
+ onKeyDown: ae(i),
1565
+ children: i.getDate()
1506
1566
  },
1507
- b
1567
+ P
1508
1568
  );
1509
1569
  }) })
1510
1570
  ]
1511
1571
  }
1512
1572
  ),
1513
- h && f ? /* @__PURE__ */ n("p", { id: Re, role: "alert", className: "p-date-range-picker__message p-date-range-picker__message--error", children: f }) : null,
1514
- !h && u ? /* @__PURE__ */ n("p", { id: Be, className: "p-date-range-picker__message", children: u }) : null
1573
+ u && v ? /* @__PURE__ */ a("p", { id: W, role: "alert", className: "p-date-range-picker__message p-date-range-picker__message--error", children: v }) : null,
1574
+ !u && b ? /* @__PURE__ */ a("p", { id: x, className: "p-date-range-picker__message", children: b }) : null
1515
1575
  ]
1516
1576
  }
1517
1577
  );
1518
1578
  }
1519
1579
  );
1520
- xa.displayName = "PDateRangePicker";
1521
- const Ra = {
1580
+ Ta.displayName = "PDateRangePicker";
1581
+ const an = {
1522
1582
  thisWeek: {
1523
1583
  label: "This week",
1524
1584
  value: () => {
1525
- const e = we(), t = O(e, -e.getDay());
1585
+ const e = Ye(), t = ie(e, -e.getDay());
1526
1586
  return {
1527
- start: M(t),
1528
- end: M(O(t, 6))
1587
+ start: K(t),
1588
+ end: K(ie(t, 6))
1529
1589
  };
1530
1590
  }
1531
1591
  },
1532
1592
  last7Days: {
1533
1593
  label: "Last 7 days",
1534
1594
  value: () => {
1535
- const e = we();
1595
+ const e = Ye();
1536
1596
  return {
1537
- start: M(O(e, -6)),
1538
- end: M(e)
1597
+ start: K(ie(e, -6)),
1598
+ end: K(e)
1539
1599
  };
1540
1600
  }
1541
1601
  },
1542
1602
  last14Days: {
1543
1603
  label: "Last 14 days",
1544
1604
  value: () => {
1545
- const e = we();
1605
+ const e = Ye();
1546
1606
  return {
1547
- start: M(O(e, -13)),
1548
- end: M(e)
1607
+ start: K(ie(e, -13)),
1608
+ end: K(e)
1549
1609
  };
1550
1610
  }
1551
1611
  },
1552
1612
  last30Days: {
1553
1613
  label: "Last 30 days",
1554
1614
  value: () => {
1555
- const e = we();
1615
+ const e = Ye();
1556
1616
  return {
1557
- start: M(O(e, -29)),
1558
- end: M(e)
1617
+ start: K(ie(e, -29)),
1618
+ end: K(e)
1559
1619
  };
1560
1620
  }
1561
1621
  },
1562
1622
  thisMonth: {
1563
1623
  label: "This month",
1564
1624
  value: () => {
1565
- const e = we(), t = X(e), a = Ue(e);
1625
+ const e = Ye(), t = se(e), n = Re(e);
1566
1626
  return {
1567
- start: M(t),
1568
- end: M(a)
1627
+ start: K(t),
1628
+ end: K(n)
1569
1629
  };
1570
1630
  }
1571
1631
  },
1572
1632
  lastMonth: {
1573
1633
  label: "Last month",
1574
1634
  value: () => {
1575
- const e = we(), t = st(e, -1);
1635
+ const e = Ye(), t = ot(e, -1);
1576
1636
  return {
1577
- start: M(X(t)),
1578
- end: M(Ue(t))
1637
+ start: K(se(t)),
1638
+ end: K(Re(t))
1579
1639
  };
1580
1640
  }
1581
1641
  },
1582
1642
  monthToDate: {
1583
1643
  label: "Month to date",
1584
1644
  value: () => {
1585
- const e = we(), t = X(e);
1645
+ const e = Ye(), t = se(e);
1586
1646
  return {
1587
- start: M(t),
1588
- end: M(e)
1647
+ start: K(t),
1648
+ end: K(e)
1589
1649
  };
1590
1650
  }
1591
1651
  },
1592
1652
  yearToDate: {
1593
1653
  label: "Year to date",
1594
1654
  value: () => {
1595
- const e = we();
1655
+ const e = Ye();
1596
1656
  return {
1597
- start: M(new Date(e.getFullYear(), 0, 1)),
1598
- end: M(e)
1657
+ start: K(new Date(e.getFullYear(), 0, 1)),
1658
+ end: K(e)
1599
1659
  };
1600
1660
  }
1601
1661
  }
1602
- }, Da = Ne(
1662
+ }, Ba = oe(
1603
1663
  ({
1604
1664
  as: e = "span",
1605
1665
  variant: t = "primary",
1606
- appearance: a = "text",
1666
+ appearance: n = "text",
1607
1667
  color: r,
1608
- textColor: o,
1609
- children: c,
1668
+ textColor: l,
1669
+ children: s,
1610
1670
  className: d,
1611
- style: g,
1612
- ...v
1613
- }, u) => {
1614
- const h = {
1615
- ...g,
1671
+ style: m,
1672
+ ...y
1673
+ }, b) => {
1674
+ const u = {
1675
+ ...m,
1616
1676
  ...r ? { "--p-highlight-color": r, "--p-highlight-bg": r } : {},
1617
- ...o ? { "--p-highlight-text": o } : {}
1677
+ ...l ? { "--p-highlight-text": l } : {}
1618
1678
  };
1619
- return /* @__PURE__ */ n(
1679
+ return /* @__PURE__ */ a(
1620
1680
  e,
1621
1681
  {
1622
- ...v,
1623
- ref: u,
1624
- className: m(
1682
+ ...y,
1683
+ ref: b,
1684
+ className: h(
1625
1685
  "p-highlight",
1626
1686
  `p-highlight--${t}`,
1627
- a === "background" && "p-highlight--background",
1687
+ n === "background" && "p-highlight--background",
1628
1688
  d
1629
1689
  ),
1630
- style: h,
1631
- children: c
1690
+ style: u,
1691
+ children: s
1632
1692
  }
1633
1693
  );
1634
1694
  }
1635
1695
  );
1636
- Da.displayName = "PHighlight";
1637
- const wa = Ne(
1696
+ Ba.displayName = "PHighlight";
1697
+ const Aa = oe(
1638
1698
  ({
1639
1699
  children: e,
1640
1700
  ariaLabel: t = "Horizontal content",
1641
- gap: a,
1701
+ gap: n,
1642
1702
  snap: r = !0,
1643
- className: o,
1644
- scrollerClassName: c,
1703
+ className: l,
1704
+ scrollerClassName: s,
1645
1705
  listClassName: d,
1646
- itemClassName: g,
1647
- style: v,
1648
- ...u
1649
- }, h) => {
1650
- const f = {
1651
- ...v,
1652
- ...a ? { "--p-horizontal-slider-gap": a } : {}
1706
+ itemClassName: m,
1707
+ style: y,
1708
+ ...b
1709
+ }, u) => {
1710
+ const v = {
1711
+ ...y,
1712
+ ...n ? { "--p-horizontal-slider-gap": n } : {}
1653
1713
  };
1654
- return /* @__PURE__ */ n(
1714
+ return /* @__PURE__ */ a(
1655
1715
  "div",
1656
1716
  {
1657
- ...u,
1658
- ref: h,
1659
- className: m("p-horizontal-slider", !r && "p-horizontal-slider--no-snap", o),
1660
- style: f,
1661
- children: /* @__PURE__ */ n(
1717
+ ...b,
1718
+ ref: u,
1719
+ className: h("p-horizontal-slider", !r && "p-horizontal-slider--no-snap", l),
1720
+ style: v,
1721
+ children: /* @__PURE__ */ a(
1662
1722
  "div",
1663
1723
  {
1664
1724
  "aria-label": t,
1665
- className: m("p-horizontal-slider__scroller", c),
1725
+ className: h("p-horizontal-slider__scroller", s),
1666
1726
  role: "region",
1667
1727
  tabIndex: 0,
1668
- children: /* @__PURE__ */ n("ul", { className: m("p-horizontal-slider__list", d), children: Kt.map(e, (x) => /* @__PURE__ */ n("li", { className: m("p-horizontal-slider__item", g), children: x })) })
1728
+ children: /* @__PURE__ */ a("ul", { className: h("p-horizontal-slider__list", d), children: Xt.map(e, (N) => /* @__PURE__ */ a("li", { className: h("p-horizontal-slider__item", m), children: N })) })
1669
1729
  }
1670
1730
  )
1671
1731
  }
1672
1732
  );
1673
1733
  }
1674
1734
  );
1675
- wa.displayName = "PHorizontalSlider";
1676
- function Aa({ title: e }) {
1677
- return /* @__PURE__ */ n(jt, { className: "pt-2 border-t border-white text-white", children: /* @__PURE__ */ n(ot, { className: "uppercase", variant: "body-wide", children: e }) });
1735
+ Aa.displayName = "PHorizontalSlider";
1736
+ function Va() {
1737
+ return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m5 8 5 5 5-5" }) });
1738
+ }
1739
+ function Gt(e) {
1740
+ return Array.isArray(e) ? e[0] ?? "" : e ?? "";
1741
+ }
1742
+ const Ot = oe(
1743
+ ({
1744
+ className: e,
1745
+ selectClassName: t,
1746
+ label: n,
1747
+ options: r,
1748
+ placeholder: l = "Select an option",
1749
+ helperText: s,
1750
+ id: d,
1751
+ isError: m = !1,
1752
+ errorMessage: y,
1753
+ density: b = "standard",
1754
+ variant: u = "floating",
1755
+ hideLabel: v = !1,
1756
+ disabled: N,
1757
+ required: F,
1758
+ value: k,
1759
+ defaultValue: g,
1760
+ onChange: $,
1761
+ onValueChange: j,
1762
+ style: B,
1763
+ ...A
1764
+ }, I) => {
1765
+ const T = Oe(), V = d ?? T, S = `${V}-error`, z = `${V}-helper`, ee = k !== void 0, [O, X] = re(Gt(g)), M = Gt(ee ? k : O) !== "", x = [
1766
+ m && y ? S : null,
1767
+ !m && s ? z : null
1768
+ ].filter(Boolean).join(" ") || void 0, W = r.reduce(
1769
+ (w, D) => {
1770
+ const H = D.group ?? null, he = w.find((Y) => Y.group === H);
1771
+ return he ? (he.options.push(D), w) : (w.push({ group: H, options: [D] }), w);
1772
+ },
1773
+ []
1774
+ ), pe = (w) => {
1775
+ const { value: D } = w.currentTarget;
1776
+ ee || X(D), $ == null || $(w), j == null || j(
1777
+ D,
1778
+ r.find((H) => String(H.value) === D) ?? null
1779
+ );
1780
+ };
1781
+ return /* @__PURE__ */ _(
1782
+ "div",
1783
+ {
1784
+ className: h(
1785
+ "p-select",
1786
+ `p-select--${b}`,
1787
+ `p-select--${u}`,
1788
+ M && "p-select--filled",
1789
+ m && "p-select--error",
1790
+ N && "p-select--disabled",
1791
+ e
1792
+ ),
1793
+ style: B,
1794
+ children: [
1795
+ /* @__PURE__ */ _("div", { className: "p-select__field", children: [
1796
+ /* @__PURE__ */ _(
1797
+ "select",
1798
+ {
1799
+ ...A,
1800
+ id: V,
1801
+ ref: I,
1802
+ value: k,
1803
+ defaultValue: k === void 0 ? g ?? "" : void 0,
1804
+ disabled: N,
1805
+ required: F,
1806
+ "aria-invalid": m || void 0,
1807
+ "aria-describedby": x,
1808
+ "aria-required": F,
1809
+ "aria-disabled": N,
1810
+ className: h("p-select__control", m && "p-select__control--error", t),
1811
+ onChange: pe,
1812
+ children: [
1813
+ l ? /* @__PURE__ */ a("option", { value: "", disabled: F, "aria-label": l, children: "" }) : null,
1814
+ W.map(
1815
+ (w) => w.group ? /* @__PURE__ */ a("optgroup", { label: w.group, children: w.options.map((D) => /* @__PURE__ */ a("option", { value: D.value, disabled: D.disabled, children: D.label }, String(D.value))) }, w.group) : w.options.map((D) => /* @__PURE__ */ a("option", { value: D.value, disabled: D.disabled, children: D.label }, String(D.value)))
1816
+ )
1817
+ ]
1818
+ }
1819
+ ),
1820
+ u === "floating" ? /* @__PURE__ */ _(wt, { children: [
1821
+ /* @__PURE__ */ a(
1822
+ "span",
1823
+ {
1824
+ "aria-hidden": "true",
1825
+ className: h(
1826
+ "p-select__label p-select__floating-label",
1827
+ v && "p-select__label--hidden",
1828
+ m && "p-select__label--error"
1829
+ ),
1830
+ children: n
1831
+ }
1832
+ ),
1833
+ /* @__PURE__ */ a(
1834
+ "label",
1835
+ {
1836
+ htmlFor: V,
1837
+ className: h("p-select__label p-select__placeholder-label", v && "p-select__label--hidden"),
1838
+ children: l || n
1839
+ }
1840
+ )
1841
+ ] }) : /* @__PURE__ */ a(
1842
+ "label",
1843
+ {
1844
+ htmlFor: V,
1845
+ className: h("p-select__label p-select__inline-label", v && "p-select__label--hidden"),
1846
+ children: n
1847
+ }
1848
+ ),
1849
+ /* @__PURE__ */ a("span", { className: "p-select__chevron", "aria-hidden": "true", children: /* @__PURE__ */ a(Va, {}) })
1850
+ ] }),
1851
+ m && y ? /* @__PURE__ */ a("p", { id: S, role: "alert", className: "p-select__message p-select__message--error", children: y }) : null,
1852
+ !m && s ? /* @__PURE__ */ a("p", { id: z, className: "p-select__message", children: s }) : null
1853
+ ]
1854
+ }
1855
+ );
1856
+ }
1857
+ );
1858
+ Ot.displayName = "PSelect";
1859
+ function $t(e, t) {
1860
+ return Number.isFinite(e) ? t ? Math.min(Math.max(1, Math.trunc(e)), Math.max(1, t)) : Math.max(1, Math.trunc(e)) : 1;
1861
+ }
1862
+ function qe(e, t) {
1863
+ return Array.from({ length: t - e + 1 }, (n, r) => e + r);
1864
+ }
1865
+ function La(e, t, n, r) {
1866
+ const l = Math.max(1, t), s = $t(e, l), d = Math.max(0, Math.trunc(n)), m = Math.max(1, Math.trunc(r)), y = m * 2 + d * 2 + 3;
1867
+ if (l <= y)
1868
+ return qe(1, l);
1869
+ const b = y - m - 1, u = qe(1, m), v = qe(l - m + 1, l), N = b, F = l - b + 1;
1870
+ if (s <= N - d)
1871
+ return [...qe(1, N), "ellipsis", ...v];
1872
+ if (s >= F + d)
1873
+ return [...u, "ellipsis", ...qe(F, l)];
1874
+ const k = s - d, g = s + d;
1875
+ return [
1876
+ ...u,
1877
+ "ellipsis",
1878
+ ...qe(k, g),
1879
+ "ellipsis",
1880
+ ...v
1881
+ ];
1882
+ }
1883
+ function Ka(e, t, n, r, l) {
1884
+ if (n !== void 0 && r) {
1885
+ if (n <= 0)
1886
+ return `No ${l}`;
1887
+ const s = (e - 1) * r + 1, d = Math.min(n, e * r);
1888
+ return `Showing ${s}-${d} of ${n} ${l}`;
1889
+ }
1890
+ return t ? `Page ${e} of ${t}` : `Page ${e}`;
1891
+ }
1892
+ function Dt({
1893
+ className: e,
1894
+ children: t,
1895
+ ...n
1896
+ }) {
1897
+ return /* @__PURE__ */ a("button", { ...n, type: "button", className: h("p-pagination__button", e), children: t });
1898
+ }
1899
+ const ja = oe(
1900
+ ({
1901
+ page: e,
1902
+ pageCount: t,
1903
+ totalItems: n,
1904
+ pageSize: r,
1905
+ pageSizeOptions: l,
1906
+ itemLabel: s = "items",
1907
+ density: d = "standard",
1908
+ siblingCount: m = 1,
1909
+ boundaryCount: y = 1,
1910
+ disabled: b = !1,
1911
+ isLoading: u = !1,
1912
+ hasPreviousPage: v,
1913
+ hasNextPage: N,
1914
+ showRowsPerPage: F = !0,
1915
+ onPageChange: k,
1916
+ onPageSizeChange: g,
1917
+ className: $,
1918
+ summary: j,
1919
+ ...B
1920
+ }, A) => {
1921
+ const I = t ? Math.max(1, Math.trunc(t)) : void 0, T = $t(e, I), V = b || u, S = !V && !!k, z = S && (v ?? T > 1), ee = S && (N ?? (I ? T < I : !0)), O = I ? La(T, I, m, y) : [], X = !!(F && r && (l != null && l.length) && g), p = j ?? Ka(T, I, n, r, s), M = (x) => {
1922
+ if (V)
1923
+ return;
1924
+ const W = $t(x, I);
1925
+ W === T && I || k == null || k(W);
1926
+ };
1927
+ return /* @__PURE__ */ _(
1928
+ "nav",
1929
+ {
1930
+ ...B,
1931
+ ref: A,
1932
+ className: h(
1933
+ "p-pagination",
1934
+ `p-pagination--${d}`,
1935
+ u && "p-pagination--loading",
1936
+ $
1937
+ ),
1938
+ "aria-label": B["aria-label"] ?? "Pagination",
1939
+ "aria-busy": u || void 0,
1940
+ children: [
1941
+ /* @__PURE__ */ a("div", { className: "p-pagination__summary", "aria-live": "polite", children: p }),
1942
+ /* @__PURE__ */ _("div", { className: "p-pagination__controls", children: [
1943
+ /* @__PURE__ */ _(
1944
+ Dt,
1945
+ {
1946
+ className: "p-pagination__button--previous",
1947
+ disabled: !z,
1948
+ "aria-label": "Go to previous page",
1949
+ onClick: () => M(T - 1),
1950
+ children: [
1951
+ /* @__PURE__ */ a(Pt, {}),
1952
+ /* @__PURE__ */ a("span", { children: "Previous" })
1953
+ ]
1954
+ }
1955
+ ),
1956
+ I ? /* @__PURE__ */ a("div", { className: "p-pagination__pages", "aria-label": "Pages", children: O.map(
1957
+ (x, W) => x === "ellipsis" ? /* @__PURE__ */ a("span", { className: "p-pagination__ellipsis", "aria-hidden": "true", children: "..." }, `ellipsis-${W}`) : /* @__PURE__ */ a(
1958
+ Dt,
1959
+ {
1960
+ className: h("p-pagination__page", x === T && "p-pagination__page--current"),
1961
+ "aria-label": `Go to page ${x}`,
1962
+ "aria-current": x === T ? "page" : void 0,
1963
+ disabled: !S || x === T,
1964
+ onClick: () => M(x),
1965
+ children: x
1966
+ },
1967
+ x
1968
+ )
1969
+ ) }) : /* @__PURE__ */ _("div", { className: "p-pagination__cursor-page", "aria-live": "polite", children: [
1970
+ "Page ",
1971
+ T
1972
+ ] }),
1973
+ /* @__PURE__ */ _(
1974
+ Dt,
1975
+ {
1976
+ className: "p-pagination__button--next",
1977
+ disabled: !ee,
1978
+ "aria-label": "Go to next page",
1979
+ onClick: () => M(T + 1),
1980
+ children: [
1981
+ /* @__PURE__ */ a("span", { children: "Next" }),
1982
+ /* @__PURE__ */ a(Ft, {})
1983
+ ]
1984
+ }
1985
+ )
1986
+ ] }),
1987
+ X ? /* @__PURE__ */ a(
1988
+ Ot,
1989
+ {
1990
+ className: "p-pagination__page-size",
1991
+ label: "Rows per page",
1992
+ placeholder: "",
1993
+ density: "compact",
1994
+ variant: "inline",
1995
+ hideLabel: !0,
1996
+ value: r,
1997
+ disabled: V,
1998
+ options: (l == null ? void 0 : l.map((x) => ({ value: x, label: `${x} / page` }))) ?? [],
1999
+ onValueChange: (x) => g == null ? void 0 : g(Number(x))
2000
+ }
2001
+ ) : null
2002
+ ]
2003
+ }
2004
+ );
2005
+ }
2006
+ );
2007
+ ja.displayName = "PPagination";
2008
+ function Wt(e) {
2009
+ return e.label ? e.label : e.mobileLabel ? e.mobileLabel : typeof e.header == "string" ? e.header : e.id;
2010
+ }
2011
+ function xt(e, t, n) {
2012
+ return t.cell ? t.cell(e, n) : typeof t.accessor == "function" ? t.accessor(e) : t.accessor ? e[t.accessor] : null;
2013
+ }
2014
+ function Ha(e) {
2015
+ return e === "ascending" ? "descending" : "ascending";
2016
+ }
2017
+ function Ga(e) {
2018
+ return !!(e && typeof e == "object" && "closest" in e && typeof e.closest == "function");
2019
+ }
2020
+ function Wa(e) {
2021
+ return !!(e && typeof e == "object" && "contains" in e && typeof e.contains == "function");
2022
+ }
2023
+ function Ut(e, t) {
2024
+ if (!Wa(t) || !Ga(e))
2025
+ return !1;
2026
+ const n = e.closest(
2027
+ [
2028
+ "a",
2029
+ "button",
2030
+ "input",
2031
+ "select",
2032
+ "textarea",
2033
+ "summary",
2034
+ '[contenteditable="true"]',
2035
+ '[role="button"]',
2036
+ '[role="link"]',
2037
+ '[role="menuitem"]',
2038
+ "[data-p-table-ignore-row-click]"
2039
+ ].join(",")
2040
+ );
2041
+ return !!(n && n !== t && t.contains(n));
2042
+ }
2043
+ function Ua({
2044
+ columns: e,
2045
+ rows: t,
2046
+ caption: n,
2047
+ captionHidden: r = !1,
2048
+ summary: l,
2049
+ density: s = "standard",
2050
+ stickyHeader: d = !0,
2051
+ stickyFirstColumn: m = !0,
2052
+ isLoading: y = !1,
2053
+ loadingLabel: b = "Loading table data...",
2054
+ emptyState: u = {
2055
+ title: "No records found",
2056
+ description: "Try adjusting the filters or checking back later."
2057
+ },
2058
+ errorState: v,
2059
+ getRowId: N,
2060
+ getRowTone: F,
2061
+ onRowClick: k,
2062
+ renderRowActions: g,
2063
+ onSortChange: $,
2064
+ className: j,
2065
+ tableClassName: B,
2066
+ ...A
2067
+ }, I) {
2068
+ const T = t.length > 0, V = !!g, S = v ?? (!y && !T ? u : null), z = e.filter((p) => !p.hideOnMobile), ee = e.length + (V ? 1 : 0), O = (p, M, x) => {
2069
+ Ut(x.target, x.currentTarget) || k == null || k(p, M, x);
2070
+ }, X = (p, M, x) => {
2071
+ Ut(x.target, x.currentTarget) || x.key !== "Enter" && x.key !== " " || (x.preventDefault(), k == null || k(p, M, x));
2072
+ };
2073
+ return /* @__PURE__ */ _(
2074
+ "div",
2075
+ {
2076
+ ...A,
2077
+ ref: I,
2078
+ className: h(
2079
+ "p-table",
2080
+ `p-table--${s}`,
2081
+ d && "p-table--sticky-header",
2082
+ m && "p-table--sticky-first-column",
2083
+ k && "p-table--interactive",
2084
+ j
2085
+ ),
2086
+ children: [
2087
+ /* @__PURE__ */ a("div", { className: "p-table__header", children: /* @__PURE__ */ _("div", { className: "p-table__header-copy", children: [
2088
+ /* @__PURE__ */ a("h3", { className: h("p-table__caption", r && "p-table__caption--hidden"), children: n }),
2089
+ l ? /* @__PURE__ */ a("div", { className: "p-table__summary", children: l }) : null
2090
+ ] }) }),
2091
+ /* @__PURE__ */ a("div", { className: "p-table__viewport", children: /* @__PURE__ */ _("table", { className: h("p-table__table", B), children: [
2092
+ /* @__PURE__ */ a("caption", { className: "p-table__native-caption", children: n }),
2093
+ /* @__PURE__ */ _("colgroup", { children: [
2094
+ e.map((p) => /* @__PURE__ */ a(
2095
+ "col",
2096
+ {
2097
+ className: h(
2098
+ "p-table__col",
2099
+ p.priority && `p-table__col--priority-${p.priority}`,
2100
+ p.hideOnTablet && "p-table__col--hide-tablet",
2101
+ p.hideOnMobile && "p-table__col--hide-mobile"
2102
+ ),
2103
+ style: p.width ? { width: p.width } : void 0
2104
+ },
2105
+ p.id
2106
+ )),
2107
+ V ? /* @__PURE__ */ a("col", { className: "p-table__actions-col" }) : null
2108
+ ] }),
2109
+ /* @__PURE__ */ a("thead", { className: "p-table__head", children: /* @__PURE__ */ _("tr", { children: [
2110
+ e.map((p) => {
2111
+ const M = Ha(p.sortDirection), x = p.sortDirection ?? (p.sortable ? "none" : void 0);
2112
+ return /* @__PURE__ */ a(
2113
+ "th",
2114
+ {
2115
+ scope: "col",
2116
+ "aria-sort": x,
2117
+ className: h(
2118
+ "p-table__cell p-table__head-cell",
2119
+ p.align && `p-table__cell--${p.align}`,
2120
+ p.priority && `p-table__cell--priority-${p.priority}`,
2121
+ p.hideOnTablet && "p-table__cell--hide-tablet",
2122
+ p.hideOnMobile && "p-table__cell--hide-mobile"
2123
+ ),
2124
+ children: p.sortable ? /* @__PURE__ */ _(
2125
+ "button",
2126
+ {
2127
+ type: "button",
2128
+ className: "p-table__sort-button",
2129
+ "aria-label": `Sort by ${Wt(p)}`,
2130
+ onClick: () => $ == null ? void 0 : $(p.id, M),
2131
+ children: [
2132
+ /* @__PURE__ */ a("span", { children: p.header }),
2133
+ /* @__PURE__ */ a(
2134
+ "span",
2135
+ {
2136
+ className: h(
2137
+ "p-table__sort-mark",
2138
+ p.sortDirection && `p-table__sort-mark--${p.sortDirection}`
2139
+ ),
2140
+ "aria-hidden": "true"
2141
+ }
2142
+ )
2143
+ ]
2144
+ }
2145
+ ) : p.header
2146
+ },
2147
+ p.id
2148
+ );
2149
+ }),
2150
+ V ? /* @__PURE__ */ a("th", { scope: "col", className: "p-table__cell p-table__head-cell p-table__actions-head", children: /* @__PURE__ */ a("span", { className: "p-table__sr-only", children: "Actions" }) }) : null
2151
+ ] }) }),
2152
+ /* @__PURE__ */ a("tbody", { className: "p-table__body", children: y ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ _("td", { className: "p-table__state-cell", colSpan: ee, children: [
2153
+ /* @__PURE__ */ a("span", { className: "p-table__loading-mark", "aria-hidden": "true" }),
2154
+ /* @__PURE__ */ a("span", { children: b })
2155
+ ] }) }) : S ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { className: "p-table__state-cell", colSpan: ee, children: /* @__PURE__ */ _("div", { className: h("p-table__state", S.tone && `p-table__state--${S.tone}`), children: [
2156
+ /* @__PURE__ */ a("strong", { children: S.title }),
2157
+ S.description ? /* @__PURE__ */ a("span", { children: S.description }) : null,
2158
+ S.action ? /* @__PURE__ */ a("div", { className: "p-table__state-action", children: S.action }) : null
2159
+ ] }) }) }) : t.map((p, M) => {
2160
+ const x = (N == null ? void 0 : N(p, M)) ?? String(M), W = F == null ? void 0 : F(p, M), pe = e.map((w) => /* @__PURE__ */ a(
2161
+ "td",
2162
+ {
2163
+ className: h(
2164
+ "p-table__cell p-table__body-cell",
2165
+ w.align && `p-table__cell--${w.align}`,
2166
+ w.priority && `p-table__cell--priority-${w.priority}`,
2167
+ w.hideOnTablet && "p-table__cell--hide-tablet",
2168
+ w.hideOnMobile && "p-table__cell--hide-mobile"
2169
+ ),
2170
+ children: xt(p, w, M)
2171
+ },
2172
+ w.id
2173
+ ));
2174
+ return /* @__PURE__ */ _(
2175
+ "tr",
2176
+ {
2177
+ className: h("p-table__row", W && `p-table__row--${W}`),
2178
+ tabIndex: k ? 0 : void 0,
2179
+ onClick: k ? (w) => O(p, M, w) : void 0,
2180
+ onKeyDown: k ? (w) => X(p, M, w) : void 0,
2181
+ children: [
2182
+ pe,
2183
+ V ? /* @__PURE__ */ a("td", { className: "p-table__cell p-table__body-cell p-table__actions-cell", children: g == null ? void 0 : g(p, M) }) : null
2184
+ ]
2185
+ },
2186
+ x
2187
+ );
2188
+ }) })
2189
+ ] }) }),
2190
+ /* @__PURE__ */ a("ul", { className: "p-table__mobile-list", "aria-label": `${n} rows`, children: y ? /* @__PURE__ */ _("li", { className: "p-table__mobile-state", children: [
2191
+ /* @__PURE__ */ a("span", { className: "p-table__loading-mark", "aria-hidden": "true" }),
2192
+ /* @__PURE__ */ a("span", { children: b })
2193
+ ] }) : S ? /* @__PURE__ */ a("li", { className: "p-table__mobile-state", children: /* @__PURE__ */ _("div", { className: h("p-table__state", S.tone && `p-table__state--${S.tone}`), children: [
2194
+ /* @__PURE__ */ a("strong", { children: S.title }),
2195
+ S.description ? /* @__PURE__ */ a("span", { children: S.description }) : null,
2196
+ S.action ? /* @__PURE__ */ a("div", { className: "p-table__state-action", children: S.action }) : null
2197
+ ] }) }) : t.map((p, M) => {
2198
+ const x = (N == null ? void 0 : N(p, M)) ?? String(M), W = z.find((D) => D.priority === "primary") ?? z[0], pe = z.filter((D) => D.id !== (W == null ? void 0 : W.id)), w = F == null ? void 0 : F(p, M);
2199
+ return /* @__PURE__ */ _(
2200
+ "li",
2201
+ {
2202
+ className: h("p-table__mobile-row", w && `p-table__mobile-row--${w}`),
2203
+ role: k ? "button" : void 0,
2204
+ tabIndex: k ? 0 : void 0,
2205
+ onClick: k ? (D) => O(p, M, D) : void 0,
2206
+ onKeyDown: k ? (D) => X(p, M, D) : void 0,
2207
+ children: [
2208
+ W ? /* @__PURE__ */ a("div", { className: "p-table__mobile-title", children: xt(p, W, M) }) : null,
2209
+ /* @__PURE__ */ a("dl", { className: "p-table__mobile-fields", children: pe.map((D) => /* @__PURE__ */ _("div", { className: "p-table__mobile-field", children: [
2210
+ /* @__PURE__ */ a("dt", { children: Wt(D) }),
2211
+ /* @__PURE__ */ a("dd", { children: xt(p, D, M) })
2212
+ ] }, D.id)) }),
2213
+ V ? /* @__PURE__ */ a("div", { className: "p-table__mobile-actions", children: g == null ? void 0 : g(p, M) }) : null
2214
+ ]
2215
+ },
2216
+ x
2217
+ );
2218
+ }) })
2219
+ ]
2220
+ }
2221
+ );
2222
+ }
2223
+ const qa = oe(Ua);
2224
+ qa.displayName = "PTable";
2225
+ function nn({
2226
+ title: e,
2227
+ index: t = "01",
2228
+ variant: n = "default",
2229
+ className: r
2230
+ }) {
2231
+ return n === "indexed" ? /* @__PURE__ */ _(
2232
+ "div",
2233
+ {
2234
+ className: h("p-section-header p-section-header--indexed", r),
2235
+ children: [
2236
+ /* @__PURE__ */ a(
2237
+ Ke,
2238
+ {
2239
+ as: "span",
2240
+ className: "p-section-header__mark",
2241
+ variant: "body",
2242
+ "aria-hidden": "true",
2243
+ children: "—"
2244
+ }
2245
+ ),
2246
+ /* @__PURE__ */ a(
2247
+ Ke,
2248
+ {
2249
+ as: "span",
2250
+ className: "p-section-header__index",
2251
+ variant: "body",
2252
+ children: t
2253
+ }
2254
+ ),
2255
+ /* @__PURE__ */ a(
2256
+ Ke,
2257
+ {
2258
+ as: "span",
2259
+ className: "p-section-header__divider",
2260
+ variant: "body",
2261
+ "aria-hidden": "true",
2262
+ children: "\\"
2263
+ }
2264
+ ),
2265
+ /* @__PURE__ */ a(Ke, { as: "h2", className: "p-section-header__title", variant: "body", children: e })
2266
+ ]
2267
+ }
2268
+ ) : /* @__PURE__ */ a(
2269
+ Zt,
2270
+ {
2271
+ className: h("p-section-header p-section-header--default", r),
2272
+ children: /* @__PURE__ */ a(Ke, { className: "p-section-header__title", variant: "body-wide", children: e })
2273
+ }
2274
+ );
1678
2275
  }
1679
- function Ma() {
2276
+ function za() {
1680
2277
  return /* @__PURE__ */ _(
1681
2278
  "svg",
1682
2279
  {
@@ -1691,13 +2288,13 @@ function Ma() {
1691
2288
  focusable: "false",
1692
2289
  className: "p-text-input__icon",
1693
2290
  children: [
1694
- /* @__PURE__ */ n("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
1695
- /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
2291
+ /* @__PURE__ */ a("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
2292
+ /* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "3" })
1696
2293
  ]
1697
2294
  }
1698
2295
  );
1699
2296
  }
1700
- function Ia() {
2297
+ function Ra() {
1701
2298
  return /* @__PURE__ */ _(
1702
2299
  "svg",
1703
2300
  {
@@ -1712,190 +2309,190 @@ function Ia() {
1712
2309
  focusable: "false",
1713
2310
  className: "p-text-input__icon",
1714
2311
  children: [
1715
- /* @__PURE__ */ n("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
1716
- /* @__PURE__ */ n("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
1717
- /* @__PURE__ */ n("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
1718
- /* @__PURE__ */ n("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
2312
+ /* @__PURE__ */ a("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
2313
+ /* @__PURE__ */ a("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
2314
+ /* @__PURE__ */ a("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
2315
+ /* @__PURE__ */ a("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
1719
2316
  ]
1720
2317
  }
1721
2318
  );
1722
2319
  }
1723
- const $a = Ne(
2320
+ const Oa = oe(
1724
2321
  ({
1725
2322
  className: e,
1726
2323
  inputClassName: t,
1727
- type: a,
2324
+ type: n,
1728
2325
  label: r,
1729
- helperText: o,
1730
- id: c,
2326
+ helperText: l,
2327
+ id: s,
1731
2328
  isError: d = !1,
1732
- errorMessage: g,
1733
- rightAdornment: v,
1734
- disabled: u,
1735
- readOnly: h,
1736
- style: f,
1737
- ...x
1738
- }, R) => {
1739
- const T = Qe(), k = c ?? T, w = `${k}-error`, A = `${k}-helper`, I = a === "password", C = !!v && !I, [P, U] = G(!1), he = I ? P ? "text" : "password" : a ?? "text", Ie = [
1740
- d && g ? w : null,
1741
- !d && o ? A : null
2329
+ errorMessage: m,
2330
+ rightAdornment: y,
2331
+ disabled: b,
2332
+ readOnly: u,
2333
+ style: v,
2334
+ ...N
2335
+ }, F) => {
2336
+ const k = Oe(), g = s ?? k, $ = `${g}-error`, j = `${g}-helper`, B = n === "password", A = !!y && !B, [I, T] = re(!1), V = B ? I ? "text" : "password" : n ?? "text", S = [
2337
+ d && m ? $ : null,
2338
+ !d && l ? j : null
1742
2339
  ].filter(Boolean).join(" ") || void 0;
1743
- return /* @__PURE__ */ _("div", { className: m("p-text-input", e), style: f, children: [
2340
+ return /* @__PURE__ */ _("div", { className: h("p-text-input", e), style: v, children: [
1744
2341
  /* @__PURE__ */ _("div", { className: "p-text-input__field", children: [
1745
- /* @__PURE__ */ n(
2342
+ /* @__PURE__ */ a(
1746
2343
  "input",
1747
2344
  {
1748
- ...x,
1749
- id: k,
1750
- ref: R,
1751
- type: he,
1752
- disabled: u,
1753
- readOnly: h,
2345
+ ...N,
2346
+ id: g,
2347
+ ref: F,
2348
+ type: V,
2349
+ disabled: b,
2350
+ readOnly: u,
1754
2351
  placeholder: " ",
1755
2352
  "aria-invalid": d || void 0,
1756
- "aria-describedby": Ie,
1757
- "aria-required": x.required,
1758
- "aria-disabled": u,
1759
- "aria-readonly": h,
1760
- autoComplete: x.autoComplete ?? (I ? "current-password" : void 0),
1761
- className: m(
2353
+ "aria-describedby": S,
2354
+ "aria-required": N.required,
2355
+ "aria-disabled": b,
2356
+ "aria-readonly": u,
2357
+ autoComplete: N.autoComplete ?? (B ? "current-password" : void 0),
2358
+ className: h(
1762
2359
  "p-text-input__control",
1763
- (I || C) && "p-text-input__control--adorned",
2360
+ (B || A) && "p-text-input__control--adorned",
1764
2361
  d && "p-text-input__control--error",
1765
- C && a === "date" && "p-text-input__control--date-adorned",
2362
+ A && n === "date" && "p-text-input__control--date-adorned",
1766
2363
  t
1767
2364
  )
1768
2365
  }
1769
2366
  ),
1770
- /* @__PURE__ */ n(
2367
+ /* @__PURE__ */ a(
1771
2368
  "span",
1772
2369
  {
1773
2370
  "aria-hidden": "true",
1774
- className: m(
2371
+ className: h(
1775
2372
  "p-text-input__label p-text-input__floating-label",
1776
2373
  d && "p-text-input__label--error"
1777
2374
  ),
1778
2375
  children: r
1779
2376
  }
1780
2377
  ),
1781
- /* @__PURE__ */ n(
2378
+ /* @__PURE__ */ a(
1782
2379
  "label",
1783
2380
  {
1784
- htmlFor: k,
2381
+ htmlFor: g,
1785
2382
  className: "p-text-input__label p-text-input__placeholder-label",
1786
2383
  children: r
1787
2384
  }
1788
2385
  ),
1789
- I && /* @__PURE__ */ n(
2386
+ B && /* @__PURE__ */ a(
1790
2387
  "button",
1791
2388
  {
1792
2389
  type: "button",
1793
- onClick: () => U((me) => !me),
1794
- disabled: u,
2390
+ onClick: () => T((z) => !z),
2391
+ disabled: b,
1795
2392
  className: "p-text-input__action",
1796
- "aria-label": P ? "Hide password" : "Show password",
1797
- "aria-pressed": P,
1798
- "aria-controls": k,
1799
- children: P ? /* @__PURE__ */ n(Ma, {}) : /* @__PURE__ */ n(Ia, {})
2393
+ "aria-label": I ? "Hide password" : "Show password",
2394
+ "aria-pressed": I,
2395
+ "aria-controls": g,
2396
+ children: I ? /* @__PURE__ */ a(za, {}) : /* @__PURE__ */ a(Ra, {})
1800
2397
  }
1801
2398
  ),
1802
- C && /* @__PURE__ */ n("span", { "aria-hidden": "true", className: "p-text-input__adornment", children: v })
2399
+ A && /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "p-text-input__adornment", children: y })
1803
2400
  ] }),
1804
- d && g && /* @__PURE__ */ n(
2401
+ d && m && /* @__PURE__ */ a(
1805
2402
  "p",
1806
2403
  {
1807
- id: w,
2404
+ id: $,
1808
2405
  role: "alert",
1809
2406
  className: "p-text-input__message p-text-input__message--error",
1810
- children: g
2407
+ children: m
1811
2408
  }
1812
2409
  ),
1813
- !d && o && /* @__PURE__ */ n(
2410
+ !d && l && /* @__PURE__ */ a(
1814
2411
  "p",
1815
2412
  {
1816
- id: A,
2413
+ id: j,
1817
2414
  className: "p-text-input__message p-text-input__message--helper",
1818
- children: o
2415
+ children: l
1819
2416
  }
1820
2417
  )
1821
2418
  ] });
1822
2419
  }
1823
2420
  );
1824
- $a.displayName = "PTextInput";
1825
- const Ca = Ne(
2421
+ Oa.displayName = "PTextInput";
2422
+ const Xa = oe(
1826
2423
  ({
1827
2424
  className: e,
1828
2425
  textareaClassName: t,
1829
- label: a,
2426
+ label: n,
1830
2427
  helperText: r,
1831
- id: o,
1832
- isError: c = !1,
2428
+ id: l,
2429
+ isError: s = !1,
1833
2430
  errorMessage: d,
1834
- disabled: g,
1835
- readOnly: v,
1836
- rows: u = 4,
1837
- style: h,
1838
- ...f
1839
- }, x) => {
1840
- const R = Qe(), T = o ?? R, k = `${T}-error`, w = `${T}-helper`, A = [
1841
- c && d ? k : null,
1842
- !c && r ? w : null
2431
+ disabled: m,
2432
+ readOnly: y,
2433
+ rows: b = 4,
2434
+ style: u,
2435
+ ...v
2436
+ }, N) => {
2437
+ const F = Oe(), k = l ?? F, g = `${k}-error`, $ = `${k}-helper`, j = [
2438
+ s && d ? g : null,
2439
+ !s && r ? $ : null
1843
2440
  ].filter(Boolean).join(" ") || void 0;
1844
- return /* @__PURE__ */ _("div", { className: m("p-text-area", e), style: h, children: [
1845
- /* @__PURE__ */ n(
2441
+ return /* @__PURE__ */ _("div", { className: h("p-text-area", e), style: u, children: [
2442
+ /* @__PURE__ */ a(
1846
2443
  "textarea",
1847
2444
  {
1848
- ...f,
1849
- id: T,
1850
- ref: x,
1851
- rows: u,
1852
- disabled: g,
1853
- readOnly: v,
2445
+ ...v,
2446
+ id: k,
2447
+ ref: N,
2448
+ rows: b,
2449
+ disabled: m,
2450
+ readOnly: y,
1854
2451
  placeholder: " ",
1855
- "aria-invalid": c || void 0,
1856
- "aria-describedby": A,
1857
- "aria-required": f.required,
1858
- "aria-disabled": g,
1859
- "aria-readonly": v,
1860
- className: m(
2452
+ "aria-invalid": s || void 0,
2453
+ "aria-describedby": j,
2454
+ "aria-required": v.required,
2455
+ "aria-disabled": m,
2456
+ "aria-readonly": y,
2457
+ className: h(
1861
2458
  "p-text-area__control",
1862
- c && "p-text-area__control--error",
2459
+ s && "p-text-area__control--error",
1863
2460
  t
1864
2461
  )
1865
2462
  }
1866
2463
  ),
1867
- /* @__PURE__ */ n(
2464
+ /* @__PURE__ */ a(
1868
2465
  "span",
1869
2466
  {
1870
2467
  "aria-hidden": "true",
1871
- className: m(
2468
+ className: h(
1872
2469
  "p-text-area__label p-text-area__floating-label",
1873
- c && "p-text-area__label--error"
2470
+ s && "p-text-area__label--error"
1874
2471
  ),
1875
- children: a
2472
+ children: n
1876
2473
  }
1877
2474
  ),
1878
- /* @__PURE__ */ n(
2475
+ /* @__PURE__ */ a(
1879
2476
  "label",
1880
2477
  {
1881
- htmlFor: T,
2478
+ htmlFor: k,
1882
2479
  className: "p-text-area__label p-text-area__placeholder-label",
1883
- children: a
2480
+ children: n
1884
2481
  }
1885
2482
  ),
1886
- c && d && /* @__PURE__ */ n(
2483
+ s && d && /* @__PURE__ */ a(
1887
2484
  "p",
1888
2485
  {
1889
- id: k,
2486
+ id: g,
1890
2487
  role: "alert",
1891
2488
  className: "p-text-area__message p-text-area__message--error",
1892
2489
  children: d
1893
2490
  }
1894
2491
  ),
1895
- !c && r && /* @__PURE__ */ n(
2492
+ !s && r && /* @__PURE__ */ a(
1896
2493
  "p",
1897
2494
  {
1898
- id: w,
2495
+ id: $,
1899
2496
  className: "p-text-area__message p-text-area__message--helper",
1900
2497
  children: r
1901
2498
  }
@@ -1903,23 +2500,27 @@ const Ca = Ne(
1903
2500
  ] });
1904
2501
  }
1905
2502
  );
1906
- Ca.displayName = "PTextArea";
2503
+ Xa.displayName = "PTextArea";
1907
2504
  export {
1908
- Ht as PBadge,
1909
- Ut as PButton,
1910
- Xt as PCard,
1911
- Qt as PCombobox,
1912
- da as PDatePicker,
1913
- Ba as PDatePickerPresets,
1914
- xa as PDateRangePicker,
1915
- Ra as PDateRangePickerPresets,
1916
- Da as PHighlight,
1917
- wa as PHorizontalSlider,
1918
- Aa as PSectionHeader,
1919
- Ca as PTextArea,
1920
- $a as PTextInput,
1921
- ot as PTypography,
1922
- Pa as Row,
1923
- jt as Stack
2505
+ Jt as PBadge,
2506
+ Qt as PButton,
2507
+ na as PCard,
2508
+ ia as PCardGrid,
2509
+ da as PCombobox,
2510
+ Na as PDatePicker,
2511
+ tn as PDatePickerPresets,
2512
+ Ta as PDateRangePicker,
2513
+ an as PDateRangePickerPresets,
2514
+ Ba as PHighlight,
2515
+ Aa as PHorizontalSlider,
2516
+ ja as PPagination,
2517
+ nn as PSectionHeader,
2518
+ Ot as PSelect,
2519
+ qa as PTable,
2520
+ Xa as PTextArea,
2521
+ Oa as PTextInput,
2522
+ Ke as PTypography,
2523
+ en as Row,
2524
+ Zt as Stack
1924
2525
  };
1925
2526
  //# sourceMappingURL=index.es.js.map