@formatica/vue 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +1,42 @@
1
- import { titleCase as Ie, evaluateCondition as se, getRule as Le, extractFields as P, sanitizeHtml as Ae, isFieldNode as Ce } from "@formatica/core";
1
+ import { titleCase as Ie, evaluateCondition as ie, getRule as Le, extractFields as U, sanitizeHtml as Ae, isFieldNode as Ce } from "@formatica/core";
2
2
  export * from "@formatica/core";
3
- import { reactive as te, inject as q, provide as ie, ref as D, computed as x, watch as J, isRef as Ne, defineComponent as j, openBlock as c, createElementBlock as f, normalizeClass as F, Fragment as O, renderList as G, createElementVNode as p, normalizeStyle as z, createCommentVNode as T, toDisplayString as L, withKeys as he, withModifiers as Y, createTextVNode as _, onMounted as ue, withDirectives as de, vModelText as ve, nextTick as ae, onBeforeUnmount as Ve, unref as H, createVNode as Z, Transition as le, withCtx as W, renderSlot as De, TransitionGroup as Me, createBlock as U, resolveDynamicComponent as Se, mergeProps as Ee, vShow as Re, resolveComponent as je } from "vue";
4
- import { getCountries as xe, getCountryCallingCode as ke, parsePhoneNumber as ze, AsYouType as Oe } from "libphonenumber-js";
5
- const Be = Symbol("FormaticaComponents"), ne = /* @__PURE__ */ new Map();
6
- function Fe(e, u) {
7
- ne.set(e, u);
3
+ import { inject as Y, provide as ue, ref as M, reactive as ee, computed as x, watch as W, isRef as Ne, defineComponent as j, openBlock as d, createElementBlock as f, normalizeClass as T, Fragment as z, renderList as G, createElementVNode as h, normalizeStyle as O, createCommentVNode as I, toDisplayString as A, withKeys as he, withModifiers as J, createTextVNode as Q, onMounted as de, withDirectives as ce, vModelText as ye, nextTick as te, onBeforeUnmount as Ve, unref as q, createVNode as Z, Transition as ae, withCtx as _, renderSlot as De, TransitionGroup as Me, createBlock as H, resolveDynamicComponent as Se, mergeProps as Ee, vShow as Re, resolveComponent as je } from "vue";
4
+ import { getCountries as xe, getCountryCallingCode as ke, parsePhoneNumber as Oe, AsYouType as ze } from "libphonenumber-js";
5
+ const Be = Symbol("FormaticaComponents"), le = /* @__PURE__ */ new Map();
6
+ function Fe(e, i) {
7
+ le.set(e, i);
8
8
  }
9
9
  function Bl(e) {
10
- ne.delete(e);
10
+ le.delete(e);
11
11
  }
12
12
  function Ke(e) {
13
- return ne.get(e);
13
+ return le.get(e);
14
14
  }
15
15
  function Pe(e) {
16
- return ne.has(e);
16
+ return le.has(e);
17
17
  }
18
18
  function Fl() {
19
- return Array.from(ne.keys());
20
- }
21
- const Te = Symbol("Formatica");
22
- function Tl(e = {}) {
23
- return {
24
- install(u) {
25
- if (u.provide(Te, te(e)), e.components)
26
- for (const [t, a] of Object.entries(e.components))
27
- Fe(t, a);
28
- }
29
- };
19
+ return Array.from(le.keys());
30
20
  }
31
21
  function Ue() {
32
22
  const e = /* @__PURE__ */ new Map();
33
- function u(a, s) {
34
- e.has(a) || e.set(a, /* @__PURE__ */ new Set());
35
- const o = e.get(a);
36
- return o ? (o.add(s), () => {
37
- o.delete(s);
23
+ function i(t, u) {
24
+ e.has(t) || e.set(t, /* @__PURE__ */ new Set());
25
+ const n = e.get(t);
26
+ return n ? (n.add(u), () => {
27
+ n.delete(u);
38
28
  }) : () => {
39
29
  };
40
30
  }
41
- function t(a, s) {
42
- const o = e.get(a);
43
- if (o)
44
- for (const d of o)
45
- d(s);
31
+ function a(t, u) {
32
+ const n = e.get(t);
33
+ if (n)
34
+ for (const c of n)
35
+ c(u);
46
36
  }
47
- return { on: u, emit: t };
37
+ return { on: i, emit: a };
48
38
  }
49
- const ye = Symbol("FormaticaI18n"), He = {
39
+ const pe = Symbol("FormaticaI18n"), He = {
50
40
  required: "This field is required",
51
41
  email: "Please enter a valid email address",
52
42
  url: "Please enter a valid URL",
@@ -65,176 +55,179 @@ const ye = Symbol("FormaticaI18n"), He = {
65
55
  };
66
56
  function Ge(e) {
67
57
  const {
68
- locale: u,
69
- fallbackLocale: t = "en",
70
- fieldTranslations: a = {},
71
- formTranslations: s = {}
58
+ locale: i,
59
+ fallbackLocale: a = "en",
60
+ fieldTranslations: t = {},
61
+ formTranslations: u = {}
72
62
  } = e;
73
- function o(r, i) {
74
- const k = a[r];
63
+ function n(r, s) {
64
+ const k = t[r];
75
65
  if (k) {
76
- const g = k[u.value];
77
- if (g) {
78
- const m = g[i];
79
- if (typeof m == "string") return m;
66
+ const S = k[i.value];
67
+ if (S) {
68
+ const y = S[s];
69
+ if (typeof y == "string") return y;
80
70
  }
81
- const $ = k[t];
82
- if ($) {
83
- const m = $[i];
84
- if (typeof m == "string") return m;
71
+ const F = k[a];
72
+ if (F) {
73
+ const y = F[s];
74
+ if (typeof y == "string") return y;
85
75
  }
86
76
  }
87
- return i === "label" ? Ie(r) : "";
77
+ return s === "label" ? Ie(r) : "";
88
78
  }
89
- function d(r, i) {
90
- var g, $;
91
- const k = a[r];
79
+ function c(r, s) {
80
+ var S, F;
81
+ const k = t[r];
92
82
  if (k) {
93
- const m = k[u.value];
94
- if ((g = m == null ? void 0 : m.options) != null && g[i]) return m.options[i];
95
- const C = k[t];
96
- if (($ = C == null ? void 0 : C.options) != null && $[i]) return C.options[i];
83
+ const y = k[i.value];
84
+ if ((S = y == null ? void 0 : y.options) != null && S[s]) return y.options[s];
85
+ const v = k[a];
86
+ if ((F = v == null ? void 0 : v.options) != null && F[s]) return v.options[s];
97
87
  }
98
- return i;
88
+ return s;
99
89
  }
100
- function l(r, i) {
101
- var m, C;
102
- const k = (m = s[u.value]) == null ? void 0 : m.messages;
90
+ function l(r, s) {
91
+ var y, v;
92
+ const k = (y = u[i.value]) == null ? void 0 : y.messages;
103
93
  if (k != null && k[r])
104
- return fe(k[r], i ?? {});
105
- const g = (C = s[t]) == null ? void 0 : C.messages;
106
- if (g != null && g[r])
107
- return fe(g[r], i ?? {});
108
- const $ = He[r];
109
- return $ ? fe($, i ?? {}) : `Validation failed: ${r}`;
94
+ return me(k[r], s ?? {});
95
+ const S = (v = u[a]) == null ? void 0 : v.messages;
96
+ if (S != null && S[r])
97
+ return me(S[r], s ?? {});
98
+ const F = He[r];
99
+ return F ? me(F, s ?? {}) : `Validation failed: ${r}`;
110
100
  }
111
- const n = {
112
- locale: u,
113
- fallbackLocale: t,
114
- t: o,
115
- tOption: d,
101
+ const o = {
102
+ locale: i,
103
+ fallbackLocale: a,
104
+ t: n,
105
+ tOption: c,
116
106
  tValidation: l
117
107
  };
118
- return ie(ye, n), n;
108
+ return ue(pe, o), o;
119
109
  }
120
110
  function Ze() {
121
- return q(ye);
111
+ return Y(pe);
122
112
  }
123
- function fe(e, u) {
124
- return e.replace(/\{(\w+)\}/g, (t, a) => u[a] !== void 0 ? String(u[a]) : `{${a}}`);
113
+ function me(e, i) {
114
+ return e.replace(/\{(\w+)\}/g, (a, t) => i[t] !== void 0 ? String(i[t]) : `{${t}}`);
125
115
  }
126
116
  function we(e) {
127
- return e.split("|").map((u) => {
128
- const [t, ...a] = u.split(":"), s = {};
129
- if (a.length > 0) {
130
- const d = a.join(":").split(",");
131
- t === "between" && d.length === 2 ? (s.min = d[0], s.max = d[1]) : d.length === 1 ? s[t] = d[0] : s.values = d;
117
+ return e.split("|").map((i) => {
118
+ const [a, ...t] = i.split(":"), u = a ?? "", n = {};
119
+ if (t.length > 0) {
120
+ const l = t.join(":").split(",");
121
+ u === "between" && l.length === 2 ? (n.min = l[0], n.max = l[1]) : l.length === 1 ? n[u] = l[0] : n.values = l;
132
122
  }
133
- return { name: t, params: s };
123
+ return { name: u, params: n };
134
124
  });
135
125
  }
136
126
  function qe(e) {
137
- const u = e.rules;
138
- if (!u) {
139
- const a = [];
140
- return e.required && a.push({ name: "required" }), a;
127
+ const i = e.rules;
128
+ if (!i) {
129
+ const t = [];
130
+ return e.required && t.push({ name: "required" }), t;
141
131
  }
142
- if (typeof u == "string")
143
- return we(u);
144
- if (Array.isArray(u))
145
- return u.flatMap((a) => typeof a == "string" ? we(a) : []);
146
- const t = [];
147
- for (const [a, s] of Object.entries(u)) {
148
- if (s === !1) continue;
149
- const o = {};
150
- typeof s == "object" && s !== null && !Array.isArray(s) ? Object.assign(o, s) : s !== !0 && (o[a] = s), t.push({ name: a, params: o });
132
+ if (typeof i == "string")
133
+ return we(i);
134
+ if (Array.isArray(i))
135
+ return i.flatMap((t) => typeof t == "string" ? we(t) : []);
136
+ const a = [];
137
+ for (const [t, u] of Object.entries(i)) {
138
+ if (u === !1) continue;
139
+ const n = {};
140
+ typeof u == "object" && u !== null && !Array.isArray(u) ? Object.assign(n, u) : u !== !0 && (n[t] = u), a.push({ name: t, params: n });
151
141
  }
152
- return t;
142
+ return a;
153
143
  }
154
- function Ye(e, u) {
155
- let t = null, a = null;
156
- return (...s) => new Promise((o) => {
157
- t !== null && (clearTimeout(t), a && a([])), a = o, t = setTimeout(async () => {
158
- t = null;
159
- const d = await e(...s);
160
- o(d), a = null;
161
- }, u);
144
+ function Ye(e, i) {
145
+ let a = null, t = null;
146
+ return (...u) => new Promise((n) => {
147
+ a !== null && (clearTimeout(a), t && t([])), t = n, a = setTimeout(async () => {
148
+ a = null;
149
+ const c = await e(...u);
150
+ n(c), t = null;
151
+ }, i);
162
152
  });
163
153
  }
164
154
  function Je(e) {
165
- const { fields: u, values: t, settings: a } = e, s = D({}), o = /* @__PURE__ */ new Map();
166
- function d(g, $) {
167
- const m = `${g}:${$}`;
168
- o.has(m) || o.set(
169
- m,
170
- Ye(async (...h) => l(h[0], h[1]), $)
155
+ const { fields: i, values: a, settings: t } = e, u = M({}), n = /* @__PURE__ */ new Map();
156
+ function c(S, F) {
157
+ const y = `${S}:${F}`;
158
+ n.has(y) || n.set(
159
+ y,
160
+ Ye(async (...g) => l(
161
+ g[0],
162
+ g[1]
163
+ ), F)
171
164
  );
172
- const C = o.get(m);
173
- if (!C) throw new Error(`Debounced validator not found for ${m}`);
174
- return C;
165
+ const v = n.get(y);
166
+ if (!v) throw new Error(`Debounced validator not found for ${y}`);
167
+ return v;
175
168
  }
176
- async function l(g, $) {
177
- var A;
178
- const m = u.value.find((V) => V.name === g);
179
- if (!m) return [];
180
- const C = qe(m), h = t.value[g], y = [];
181
- for (const V of C) {
182
- if ((A = V.params) != null && A.when) {
183
- const v = V.params.when;
184
- if (("field" in v || "and" in v || "or" in v) && !se(
185
- v,
186
- t.value
169
+ async function l(S, F) {
170
+ var N;
171
+ const y = i.value.find((B) => B.name === S);
172
+ if (!y) return [];
173
+ const v = qe(y), g = a.value[S], p = [];
174
+ for (const B of v) {
175
+ if ((N = B.params) != null && N.when) {
176
+ const V = B.params.when;
177
+ if (("field" in V || "and" in V || "or" in V) && !ie(
178
+ V,
179
+ a.value
187
180
  ))
188
181
  continue;
189
182
  }
190
- if (V.optional && We(h)) continue;
191
- let b;
192
- if (V.validator)
193
- b = await V.validator(h, V.params ?? {}, $);
183
+ if (B.optional && We(g)) continue;
184
+ let C;
185
+ if (B.validator)
186
+ C = await B.validator(g, B.params ?? {}, F);
194
187
  else {
195
- const v = Le(V.name);
196
- if (!v) continue;
197
- b = await v(h, V.params ?? {}, $);
188
+ const V = Le(B.name);
189
+ if (!V) continue;
190
+ C = await V(g, B.params ?? {}, F);
198
191
  }
199
- if (b !== !0) {
200
- const v = V.message ? _e(V.message, V.params ?? {}) : typeof b == "string" ? b : `Validation failed for rule: ${V.name}`;
201
- if (y.push(v), V.bail) break;
192
+ if (C !== !0) {
193
+ const V = B.message ? _e(B.message, B.params ?? {}) : typeof C == "string" ? C : `Validation failed for rule: ${B.name}`;
194
+ if (p.push(V), B.bail) break;
202
195
  }
203
196
  }
204
- return s.value[g] = y, y;
197
+ return u.value[S] = p, p;
205
198
  }
206
- async function n(g, $) {
207
- const m = a == null ? void 0 : a.debounce;
208
- return m && m > 0 ? d(g, m)(g, $) : l(g, $);
199
+ async function o(S, F) {
200
+ const y = t == null ? void 0 : t.debounce;
201
+ return y && y > 0 ? c(S, y)(S, F) : l(S, F);
209
202
  }
210
- async function r(g) {
211
- const $ = {}, m = u.value.map(async (C) => {
212
- const h = await l(C.name, g);
213
- h.length > 0 && ($[C.name] = h);
203
+ async function r(S) {
204
+ const F = {}, y = i.value.map(async (v) => {
205
+ const g = await l(v.name, S);
206
+ g.length > 0 && (F[v.name] = g);
214
207
  });
215
- return await Promise.all(m), s.value = { ...$ }, $;
208
+ return await Promise.all(y), u.value = { ...F }, F;
216
209
  }
217
- function i(g) {
218
- delete s.value[g];
210
+ function s(S) {
211
+ delete u.value[S];
219
212
  }
220
213
  function k() {
221
- s.value = {};
214
+ u.value = {};
222
215
  }
223
216
  return {
224
- errors: s,
225
- validateField: n,
217
+ errors: u,
218
+ validateField: o,
226
219
  validateAll: r,
227
- clearFieldErrors: i,
220
+ clearFieldErrors: s,
228
221
  clearAllErrors: k
229
222
  };
230
223
  }
231
224
  function We(e) {
232
225
  return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
233
226
  }
234
- function _e(e, u) {
235
- return e.replace(/\{(\w+)\}/g, (t, a) => u[a] !== void 0 ? String(u[a]) : `{${a}}`);
227
+ function _e(e, i) {
228
+ return e.replace(/\{(\w+)\}/g, (a, t) => i[t] !== void 0 ? String(i[t]) : `{${t}}`);
236
229
  }
237
- const ce = Symbol("FormaticaContext");
230
+ const fe = Symbol("FormaticaContext");
238
231
  function Qe(e) {
239
232
  switch (e.type) {
240
233
  case "tags":
@@ -254,200 +247,200 @@ function Qe(e) {
254
247
  return "";
255
248
  }
256
249
  }
257
- function me(e) {
258
- const u = {};
259
- for (const t of e)
260
- u[t.name] = t.defaultValue ?? Qe(t);
261
- return u;
250
+ function be(e) {
251
+ const i = {};
252
+ for (const a of e)
253
+ i[a.name] = a.defaultValue ?? Qe(a);
254
+ return i;
262
255
  }
263
256
  function Xe(e) {
264
- const u = {};
265
- for (const t of e)
266
- t.translations && (u[t.name] = t.translations);
267
- return u;
257
+ const i = {};
258
+ for (const a of e)
259
+ a.translations && (i[a.name] = a.translations);
260
+ return i;
268
261
  }
269
- function et(e, u) {
270
- const t = D((u == null ? void 0 : u.locale) ?? "en"), a = (u == null ? void 0 : u.fallbackLocale) ?? "en";
271
- let s = e;
272
- const o = D(P(e.fields)), d = te(me(P(e.fields))), l = te({}), n = te({}), r = te({}), i = D(!1), k = D(0), g = x(() => Object.values(l).every((w) => w.length === 0)), $ = x(() => Object.values(r).some(Boolean)), m = Ue();
273
- function C() {
274
- return { values: { ...d }, getFieldValue: (w) => d[w] };
262
+ function et(e, i) {
263
+ const a = M((i == null ? void 0 : i.locale) ?? "en"), t = (i == null ? void 0 : i.fallbackLocale) ?? "en";
264
+ let u = e;
265
+ const n = M(U(e.fields)), c = ee(be(U(e.fields))), l = ee({}), o = ee({}), r = ee({}), s = M(!1), k = M(0), S = x(() => Object.values(l).every(($) => $.length === 0)), F = x(() => Object.values(r).some(Boolean)), y = Ue();
266
+ function v() {
267
+ return { values: { ...c }, getFieldValue: ($) => c[$] };
275
268
  }
276
- const h = x(() => ({ ...d })), y = Je({
277
- fields: o,
278
- values: h,
269
+ const g = x(() => ({ ...c })), p = Je({
270
+ fields: n,
271
+ values: g,
279
272
  settings: e.settings
280
273
  });
281
274
  Ge({
282
- locale: t,
283
- fallbackLocale: a,
284
- fieldTranslations: Xe(P(e.fields)),
275
+ locale: a,
276
+ fallbackLocale: t,
277
+ fieldTranslations: Xe(U(e.fields)),
285
278
  formTranslations: e.translations
286
279
  });
287
- let A = me(P(e.fields));
288
- J(
289
- () => ({ ...d }),
290
- (w, I) => {
291
- var M;
292
- if (I) {
293
- for (const E of Object.keys(w))
294
- w[E] !== I[E] && (r[E] = !0, m.emit("field:change", {
295
- field: E,
296
- value: w[E],
297
- previousValue: I[E]
298
- }), (M = e.settings) != null && M.validateOnChange && B(E));
299
- m.emit("change", { values: w });
280
+ let N = be(U(e.fields));
281
+ W(
282
+ () => ({ ...c }),
283
+ ($, L) => {
284
+ var E;
285
+ if (L) {
286
+ for (const R of Object.keys($))
287
+ $[R] !== L[R] && (r[R] = !0, y.emit("field:change", {
288
+ field: R,
289
+ value: $[R],
290
+ previousValue: L[R]
291
+ }), (E = e.settings) != null && E.validateOnChange && b(R));
292
+ y.emit("change", { values: $ });
300
293
  }
301
294
  },
302
295
  { deep: !0 }
303
296
  );
304
- const V = /* @__PURE__ */ new Map();
305
- function b(w) {
306
- const I = w.name;
297
+ const B = /* @__PURE__ */ new Map();
298
+ function C($) {
299
+ const L = $.name;
307
300
  return {
308
- name: I,
301
+ name: L,
309
302
  value: x({
310
- get: () => d[I],
311
- set: (M) => {
312
- d[I] = M;
303
+ get: () => c[L],
304
+ set: (E) => {
305
+ c[L] = E;
313
306
  }
314
307
  }),
315
- errors: x(() => l[I] ?? []),
308
+ errors: x(() => l[L] ?? []),
316
309
  touched: x({
317
- get: () => n[I] ?? !1,
318
- set: (M) => {
319
- n[I] = M;
310
+ get: () => o[L] ?? !1,
311
+ set: (E) => {
312
+ o[L] = E;
320
313
  }
321
314
  }),
322
315
  dirty: x({
323
- get: () => r[I] ?? !1,
324
- set: (M) => {
325
- r[I] = M;
316
+ get: () => r[L] ?? !1,
317
+ set: (E) => {
318
+ r[L] = E;
326
319
  }
327
320
  }),
328
321
  disabled: x(
329
- () => typeof w.disabled == "function" ? w.disabled(C()) : w.disabled ?? !1
322
+ () => typeof $.disabled == "function" ? $.disabled(v()) : $.disabled ?? !1
330
323
  ),
331
- visible: x(() => w.condition ? se(w.condition, d) : typeof w.visible == "function" ? w.visible(C()) : w.visible ?? !0),
332
- schema: w,
333
- validate: () => B(I),
324
+ visible: x(() => $.condition ? ie($.condition, c) : typeof $.visible == "function" ? $.visible(v()) : $.visible ?? !0),
325
+ schema: $,
326
+ validate: () => b(L),
334
327
  reset: () => {
335
- d[I] = A[I] ?? null, delete l[I], n[I] = !1, r[I] = !1;
328
+ c[L] = N[L] ?? null, delete l[L], o[L] = !1, r[L] = !1;
336
329
  },
337
330
  clear: () => {
338
- d[I] = null, delete l[I];
331
+ c[L] = null, delete l[L];
339
332
  }
340
333
  };
341
334
  }
342
- function v() {
343
- V.clear();
344
- for (const w of P(s.fields))
345
- V.set(w.name, b(w));
335
+ function V() {
336
+ B.clear();
337
+ for (const $ of U(u.fields))
338
+ B.set($.name, C($));
346
339
  }
347
- v();
348
- async function B(w) {
349
- const I = await y.validateField(w, C());
350
- return l[w] = I, m.emit("validate:field", {
351
- field: w,
352
- valid: I.length === 0,
353
- errors: I
354
- }), I;
340
+ V();
341
+ async function b($) {
342
+ const L = await p.validateField($, v());
343
+ return l[$] = L, y.emit("validate:field", {
344
+ field: $,
345
+ valid: L.length === 0,
346
+ errors: L
347
+ }), L;
355
348
  }
356
- async function S() {
357
- const w = await y.validateAll(C());
358
- for (const M of Object.keys(l))
359
- M in w || delete l[M];
360
- for (const [M, E] of Object.entries(w))
361
- l[M] = E;
362
- const I = Object.values(w).every((M) => M.length === 0);
363
- return m.emit("validate", { valid: I, errors: { ...w } }), I;
349
+ async function m() {
350
+ const $ = await p.validateAll(v());
351
+ for (const E of Object.keys(l))
352
+ E in $ || delete l[E];
353
+ for (const [E, R] of Object.entries($))
354
+ l[E] = R;
355
+ const L = Object.values($).every((E) => E.length === 0);
356
+ return y.emit("validate", { valid: L, errors: { ...$ } }), L;
364
357
  }
365
- async function N(w) {
366
- i.value = !0, k.value += 1;
358
+ async function w($) {
359
+ s.value = !0, k.value += 1;
367
360
  try {
368
- for (const M of P(s.fields)) n[M.name] = !0;
369
- if (!await S()) {
370
- m.emit("submit:error", {
371
- values: { ...d },
361
+ for (const E of U(u.fields)) o[E.name] = !0;
362
+ if (!await m()) {
363
+ y.emit("submit:error", {
364
+ values: { ...c },
372
365
  error: new Error("Validation failed")
373
366
  });
374
367
  return;
375
368
  }
376
- m.emit("submit", { values: { ...d } }), w && await w({ ...d }, C()), m.emit("submit:success", { values: { ...d }, result: void 0 });
377
- } catch (I) {
378
- throw m.emit("submit:error", { values: { ...d }, error: I }), I;
369
+ y.emit("submit", { values: { ...c } }), $ && await $({ ...c }, v()), y.emit("submit:success", { values: { ...c }, result: void 0 });
370
+ } catch (L) {
371
+ throw y.emit("submit:error", { values: { ...c }, error: L }), L;
379
372
  } finally {
380
- i.value = !1;
373
+ s.value = !1;
381
374
  }
382
375
  }
383
- function R() {
384
- for (const w of P(s.fields))
385
- d[w.name] = A[w.name] ?? null, delete l[w.name], n[w.name] = !1, r[w.name] = !1;
386
- y.clearAllErrors(), m.emit("reset", void 0);
376
+ function D() {
377
+ for (const $ of U(u.fields))
378
+ c[$.name] = N[$.name] ?? null, delete l[$.name], o[$.name] = !1, r[$.name] = !1;
379
+ p.clearAllErrors(), y.emit("reset", void 0);
387
380
  }
388
- function Q() {
389
- for (const w of P(s.fields))
390
- d[w.name] = null, delete l[w.name];
391
- y.clearAllErrors();
381
+ function P() {
382
+ for (const $ of U(u.fields))
383
+ c[$.name] = null, delete l[$.name];
384
+ p.clearAllErrors();
392
385
  }
393
- function ee(w) {
394
- s = w;
395
- const I = P(w.fields);
396
- o.value = I, A = me(I);
397
- for (const E of I)
398
- E.name in d || (d[E.name] = E.defaultValue ?? null);
399
- const M = new Set(I.map((E) => E.name));
400
- for (const E of Object.keys(d))
401
- M.has(E) || (delete d[E], delete l[E], delete n[E], delete r[E]);
402
- v();
386
+ function re($) {
387
+ u = $;
388
+ const L = U($.fields);
389
+ n.value = L, N = be(L);
390
+ for (const R of L)
391
+ R.name in c || (c[R.name] = R.defaultValue ?? null);
392
+ const E = new Set(L.map((R) => R.name));
393
+ for (const R of Object.keys(c))
394
+ E.has(R) || (delete c[R], delete l[R], delete o[R], delete r[R]);
395
+ V();
403
396
  }
404
- const ge = {
405
- values: d,
397
+ const se = {
398
+ values: c,
406
399
  errors: l,
407
- touched: n,
400
+ touched: o,
408
401
  dirty: r,
409
- isValid: g,
410
- isDirty: $,
411
- isSubmitting: i,
402
+ isValid: S,
403
+ isDirty: F,
404
+ isSubmitting: s,
412
405
  submitCount: k,
413
- validate: S,
414
- validateField: B,
415
- submit: N,
416
- reset: R,
417
- clear: Q,
418
- setError: (w, I) => {
419
- l[w] = I;
406
+ validate: m,
407
+ validateField: b,
408
+ submit: w,
409
+ reset: D,
410
+ clear: P,
411
+ setError: ($, L) => {
412
+ l[$] = L;
420
413
  },
421
- clearError: (w) => {
422
- delete l[w], y.clearFieldErrors(w);
414
+ clearError: ($) => {
415
+ delete l[$], p.clearFieldErrors($);
423
416
  },
424
417
  clearErrors: () => {
425
- for (const w of Object.keys(l)) delete l[w];
426
- y.clearAllErrors();
418
+ for (const $ of Object.keys(l)) delete l[$];
419
+ p.clearAllErrors();
427
420
  },
428
- getField: (w) => V.get(w),
429
- setFieldValue: (w, I) => {
430
- d[w] = I;
421
+ getField: ($) => B.get($),
422
+ setFieldValue: ($, L) => {
423
+ c[$] = L;
431
424
  },
432
- setFieldDisabled: (w, I) => {
433
- const M = P(s.fields).find((E) => E.name === w);
434
- M && (M.disabled = I);
425
+ setFieldDisabled: ($, L) => {
426
+ const E = U(u.fields).find((R) => R.name === $);
427
+ E && (E.disabled = L);
435
428
  },
436
- setFieldVisible: (w, I) => {
437
- const M = P(s.fields).find((E) => E.name === w);
438
- M && (M.visible = I);
429
+ setFieldVisible: ($, L) => {
430
+ const E = U(u.fields).find((R) => R.name === $);
431
+ E && (E.visible = L);
439
432
  },
440
- on: m.on,
441
- locale: t,
442
- setLocale: (w) => {
443
- t.value = w;
433
+ on: y.on,
434
+ locale: a,
435
+ setLocale: ($) => {
436
+ a.value = $;
444
437
  },
445
- schema: s,
446
- updateSchema: ee
438
+ schema: u,
439
+ updateSchema: re
447
440
  };
448
- return ie(ce, ge), ge;
441
+ return ue(fe, se), se;
449
442
  }
450
- const pe = Symbol("FormaticaTheme"), be = {
443
+ const ge = Symbol("FormaticaTheme"), ve = {
451
444
  name: "default",
452
445
  colors: {
453
446
  primary: "#3b82f6",
@@ -500,51 +493,51 @@ const pe = Symbol("FormaticaTheme"), be = {
500
493
  }
501
494
  };
502
495
  function tt(e) {
503
- const u = Ne(e) ? x(() => e.value ?? be) : D(e ?? be), t = x(() => {
504
- const o = u.value.components ?? {};
496
+ const i = Ne(e) ? x(() => e.value ?? ve) : M(e ?? ve), a = x(() => {
497
+ const n = i.value.components ?? {};
505
498
  return {
506
- form: o.form ?? "fc-form",
507
- field: o.field ?? "fc-field",
508
- label: o.label ?? "fc-label",
509
- input: o.input ?? "fc-input",
510
- error: o.error ?? "fc-error",
511
- helpText: o.helpText ?? "fc-help-text",
512
- group: o.group ?? "fc-group",
513
- row: o.row ?? "fc-row",
514
- steps: o.steps ?? "fc-steps",
515
- tabs: o.tabs ?? "fc-tabs",
516
- button: o.button ?? "fc-button"
499
+ form: n.form ?? "fc-form",
500
+ field: n.field ?? "fc-field",
501
+ label: n.label ?? "fc-label",
502
+ input: n.input ?? "fc-input",
503
+ error: n.error ?? "fc-error",
504
+ helpText: n.helpText ?? "fc-help-text",
505
+ group: n.group ?? "fc-group",
506
+ row: n.row ?? "fc-row",
507
+ steps: n.steps ?? "fc-steps",
508
+ tabs: n.tabs ?? "fc-tabs",
509
+ button: n.button ?? "fc-button"
517
510
  };
518
- }), a = x(() => {
519
- const o = u.value, d = {};
520
- if (o.colors)
521
- for (const [l, n] of Object.entries(o.colors))
522
- n && (d[`--fc-color-${X(l)}`] = n);
523
- if (o.typography)
524
- for (const [l, n] of Object.entries(o.typography))
525
- n && (d[`--fc-${X(l)}`] = n);
526
- if (o.spacing)
527
- for (const [l, n] of Object.entries(o.spacing))
528
- n && (d[`--fc-${X(l)}`] = n);
529
- if (o.borders)
530
- for (const [l, n] of Object.entries(o.borders))
531
- n && (d[`--fc-border-${X(l)}`] = n);
532
- if (o.shadows)
533
- for (const [l, n] of Object.entries(o.shadows))
534
- n && (d[`--fc-shadow-${X(l)}`] = n);
535
- if (o.transitions)
536
- for (const [l, n] of Object.entries(o.transitions))
537
- n && (d[`--fc-transition-${X(l)}`] = n);
538
- return o.cssVars && Object.assign(d, o.cssVars), d;
539
- }), s = {
540
- config: u.value,
541
- classes: t,
542
- cssVars: a
511
+ }), t = x(() => {
512
+ const n = i.value, c = {};
513
+ if (n.colors)
514
+ for (const [l, o] of Object.entries(n.colors))
515
+ o && (c[`--fc-color-${X(l)}`] = o);
516
+ if (n.typography)
517
+ for (const [l, o] of Object.entries(n.typography))
518
+ o && (c[`--fc-${X(l)}`] = o);
519
+ if (n.spacing)
520
+ for (const [l, o] of Object.entries(n.spacing))
521
+ o && (c[`--fc-${X(l)}`] = o);
522
+ if (n.borders)
523
+ for (const [l, o] of Object.entries(n.borders))
524
+ o && (c[`--fc-border-${X(l)}`] = o);
525
+ if (n.shadows)
526
+ for (const [l, o] of Object.entries(n.shadows))
527
+ o && (c[`--fc-shadow-${X(l)}`] = o);
528
+ if (n.transitions)
529
+ for (const [l, o] of Object.entries(n.transitions))
530
+ o && (c[`--fc-transition-${X(l)}`] = o);
531
+ return n.cssVars && Object.assign(c, n.cssVars), c;
532
+ }), u = {
533
+ config: i.value,
534
+ classes: a,
535
+ cssVars: t
543
536
  };
544
- return ie(pe, s), s;
537
+ return ue(ge, u), u;
545
538
  }
546
539
  function K() {
547
- const e = q(pe);
540
+ const e = Y(ge);
548
541
  return e || at();
549
542
  }
550
543
  function at() {
@@ -560,12 +553,22 @@ function at() {
560
553
  steps: "fc-steps",
561
554
  tabs: "fc-tabs",
562
555
  button: "fc-button"
563
- })), u = x(() => ({}));
564
- return { config: be, classes: e, cssVars: u };
556
+ })), i = x(() => ({}));
557
+ return { config: ve, classes: e, cssVars: i };
565
558
  }
566
559
  function X(e) {
567
560
  return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
568
561
  }
562
+ const Te = Symbol("Formatica");
563
+ function Tl(e = {}) {
564
+ return {
565
+ install(i) {
566
+ if (i.provide(Te, ee(e)), e.components)
567
+ for (const [a, t] of Object.entries(e.components))
568
+ Fe(a, t);
569
+ }
570
+ };
571
+ }
569
572
  const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disabled", "onClick", "onKeydown"], ot = {
570
573
  key: 0,
571
574
  class: "h-3 w-3",
@@ -585,69 +588,69 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
585
588
  maxSelect: {}
586
589
  },
587
590
  emits: ["update:modelValue", "blur"],
588
- setup(e, { emit: u }) {
589
- const t = e, a = u;
591
+ setup(e, { emit: i }) {
592
+ const a = e, t = i;
590
593
  K();
591
- function s(n) {
592
- return t.modelValue.includes(n);
593
- }
594
- function o(n) {
595
- return !!(t.disabled || n.disabled || t.maxSelect && !s(n.value) && t.modelValue.length >= t.maxSelect);
596
- }
597
- function d(n) {
598
- if (o(n)) return;
599
- const r = [...t.modelValue], i = r.indexOf(n.value);
600
- if (i >= 0) {
601
- if (t.minSelect && r.length <= t.minSelect) return;
602
- r.splice(i, 1);
594
+ function u(o) {
595
+ return a.modelValue.includes(o);
596
+ }
597
+ function n(o) {
598
+ return !!(a.disabled || o.disabled || a.maxSelect && !u(o.value) && a.modelValue.length >= a.maxSelect);
599
+ }
600
+ function c(o) {
601
+ if (n(o)) return;
602
+ const r = [...a.modelValue], s = r.indexOf(o.value);
603
+ if (s >= 0) {
604
+ if (a.minSelect && r.length <= a.minSelect) return;
605
+ r.splice(s, 1);
603
606
  } else
604
- r.push(n.value);
605
- a("update:modelValue", r);
607
+ r.push(o.value);
608
+ t("update:modelValue", r);
606
609
  }
607
- function l(n, r) {
608
- (n.key === " " || n.key === "Enter") && (n.preventDefault(), d(r));
610
+ function l(o, r) {
611
+ (o.key === " " || o.key === "Enter") && (o.preventDefault(), c(r));
609
612
  }
610
- return (n, r) => (c(), f("div", {
613
+ return (o, r) => (d(), f("div", {
611
614
  role: "group",
612
- class: F(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
615
+ class: T(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
613
616
  }, [
614
- (c(!0), f(O, null, G(e.options, (i) => (c(), f("label", {
615
- key: String(i.value),
616
- class: F([
617
+ (d(!0), f(z, null, G(e.options, (s) => (d(), f("label", {
618
+ key: String(s.value),
619
+ class: T([
617
620
  "inline-flex items-center gap-2 select-none",
618
- o(i) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
621
+ n(s) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
619
622
  ])
620
623
  }, [
621
- p("input", {
624
+ h("input", {
622
625
  type: "checkbox",
623
- checked: s(i.value),
624
- disabled: o(i),
626
+ checked: u(s.value),
627
+ disabled: n(s),
625
628
  class: "sr-only",
626
- onChange: (k) => d(i),
627
- onBlur: r[0] || (r[0] = (k) => a("blur", k))
629
+ onChange: (k) => c(s),
630
+ onBlur: r[0] || (r[0] = (k) => t("blur", k))
628
631
  }, null, 40, lt),
629
- p("div", {
632
+ h("div", {
630
633
  role: "checkbox",
631
- "aria-checked": s(i.value),
632
- "aria-disabled": o(i) || void 0,
634
+ "aria-checked": u(s.value),
635
+ "aria-disabled": n(s) || void 0,
633
636
  tabindex: "0",
634
- class: F([
637
+ class: T([
635
638
  "flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",
636
- s(i.value) ? "text-white" : "border-gray-300 bg-white"
639
+ u(s.value) ? "text-white" : "border-gray-300 bg-white"
637
640
  ]),
638
- style: z(s(i.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
639
- onClick: (k) => d(i),
640
- onKeydown: (k) => l(k, i)
641
+ style: O(u(s.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
642
+ onClick: (k) => c(s),
643
+ onKeydown: (k) => l(k, s)
641
644
  }, [
642
- s(i.value) ? (c(), f("svg", ot, [...r[1] || (r[1] = [
643
- p("path", {
645
+ u(s.value) ? (d(), f("svg", ot, [...r[1] || (r[1] = [
646
+ h("path", {
644
647
  d: "M2 6l3 3 5-5",
645
648
  "stroke-linecap": "round",
646
649
  "stroke-linejoin": "round"
647
650
  }, null, -1)
648
- ])])) : T("", !0)
651
+ ])])) : I("", !0)
649
652
  ], 46, nt),
650
- p("span", rt, L(i.label), 1)
653
+ h("span", rt, A(s.label), 1)
651
654
  ], 2))), 128))
652
655
  ], 2));
653
656
  }
@@ -670,52 +673,52 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
670
673
  disabled: { type: Boolean, default: !1 }
671
674
  },
672
675
  emits: ["update:modelValue", "blur"],
673
- setup(e, { emit: u }) {
674
- const t = e, a = u;
676
+ setup(e, { emit: i }) {
677
+ const a = e, t = i;
675
678
  K();
676
- const s = x(() => [
679
+ const u = x(() => [
677
680
  "inline-flex items-center gap-2 select-none",
678
- t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
681
+ a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
679
682
  ]);
680
- function o() {
681
- t.disabled || a("update:modelValue", !t.modelValue);
683
+ function n() {
684
+ a.disabled || t("update:modelValue", !a.modelValue);
682
685
  }
683
- function d(l) {
684
- (l.key === " " || l.key === "Enter") && (l.preventDefault(), o());
686
+ function c(l) {
687
+ (l.key === " " || l.key === "Enter") && (l.preventDefault(), n());
685
688
  }
686
- return (l, n) => (c(), f("label", {
687
- class: F(s.value)
689
+ return (l, o) => (d(), f("label", {
690
+ class: T(u.value)
688
691
  }, [
689
- p("input", {
692
+ h("input", {
690
693
  type: "checkbox",
691
694
  checked: e.modelValue,
692
695
  disabled: e.disabled,
693
696
  class: "sr-only",
694
- onChange: o,
695
- onBlur: n[0] || (n[0] = (r) => a("blur", r))
697
+ onChange: n,
698
+ onBlur: o[0] || (o[0] = (r) => t("blur", r))
696
699
  }, null, 40, it),
697
- p("div", {
700
+ h("div", {
698
701
  role: "checkbox",
699
702
  "aria-checked": e.modelValue,
700
703
  "aria-disabled": e.disabled || void 0,
701
704
  tabindex: "0",
702
- class: F([
705
+ class: T([
703
706
  "flex h-5 w-5 shrink-0 items-center justify-center rounded border-2 transition-colors duration-200",
704
707
  e.modelValue ? "text-white" : "border-gray-300 bg-white"
705
708
  ]),
706
- style: z(e.modelValue ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
707
- onClick: o,
708
- onKeydown: d
709
+ style: O(e.modelValue ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
710
+ onClick: n,
711
+ onKeydown: c
709
712
  }, [
710
- e.modelValue ? (c(), f("svg", dt, [...n[1] || (n[1] = [
711
- p("path", {
713
+ e.modelValue ? (d(), f("svg", dt, [...o[1] || (o[1] = [
714
+ h("path", {
712
715
  d: "M2 6l3 3 5-5",
713
716
  "stroke-linecap": "round",
714
717
  "stroke-linejoin": "round"
715
718
  }, null, -1)
716
- ])])) : T("", !0)
719
+ ])])) : I("", !0)
717
720
  ], 46, ut),
718
- e.checkboxLabel ? (c(), f("span", ct, L(e.checkboxLabel), 1)) : T("", !0)
721
+ e.checkboxLabel ? (d(), f("span", ct, A(e.checkboxLabel), 1)) : I("", !0)
719
722
  ], 2));
720
723
  }
721
724
  }), mt = ["value", "min", "max", "placeholder", "disabled", "aria-disabled"], bt = /* @__PURE__ */ j({
@@ -729,40 +732,40 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
729
732
  disabled: { type: Boolean, default: !1 }
730
733
  },
731
734
  emits: ["update:modelValue", "blur", "focus"],
732
- setup(e, { emit: u }) {
733
- const t = e, a = u, s = K(), o = x(
735
+ setup(e, { emit: i }) {
736
+ const a = e, t = i, u = K(), n = x(
734
737
  () => [
735
738
  "w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
736
739
  "focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-date-input",
737
740
  "transition-colors duration-200",
738
- t.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
739
- s.classes.value.input
741
+ a.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
742
+ u.classes.value.input
740
743
  ].filter(Boolean).join(" ")
741
744
  );
742
- function d(l) {
743
- const n = l.target;
744
- a("update:modelValue", n.value);
745
+ function c(l) {
746
+ const o = l.target;
747
+ t("update:modelValue", o.value);
745
748
  }
746
- return (l, n) => (c(), f("input", {
749
+ return (l, o) => (d(), f("input", {
747
750
  type: "date",
748
751
  value: e.modelValue,
749
752
  min: e.minDate,
750
753
  max: e.maxDate,
751
754
  placeholder: e.placeholder,
752
755
  disabled: e.disabled,
753
- class: F(o.value),
756
+ class: T(n.value),
754
757
  "aria-disabled": e.disabled || void 0,
755
- onInput: d,
756
- onBlur: n[0] || (n[0] = (r) => a("blur", r)),
757
- onFocus: n[1] || (n[1] = (r) => a("focus", r))
758
+ onInput: c,
759
+ onBlur: o[0] || (o[0] = (r) => t("blur", r)),
760
+ onFocus: o[1] || (o[1] = (r) => t("focus", r))
758
761
  }, null, 42, mt));
759
762
  }
760
- }), oe = (e, u) => {
761
- const t = e.__vccOpts || e;
762
- for (const [a, s] of u)
763
- t[a] = s;
764
- return t;
765
- }, vt = /* @__PURE__ */ oe(bt, [["__scopeId", "data-v-7d4bc9b7"]]), yt = ["aria-disabled", "onKeydown"], pt = {
763
+ }), ne = (e, i) => {
764
+ const a = e.__vccOpts || e;
765
+ for (const [t, u] of i)
766
+ a[t] = u;
767
+ return a;
768
+ }, vt = /* @__PURE__ */ ne(bt, [["__scopeId", "data-v-7d4bc9b7"]]), yt = ["aria-disabled", "onKeydown"], pt = {
766
769
  key: 0,
767
770
  class: "mt-1 text-xs text-gray-400"
768
771
  }, gt = ["accept", "multiple"], ht = {
@@ -779,76 +782,76 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
779
782
  disabled: { type: Boolean, default: !1 }
780
783
  },
781
784
  emits: ["update:modelValue", "blur"],
782
- setup(e, { emit: u }) {
783
- const t = e, a = u;
785
+ setup(e, { emit: i }) {
786
+ const a = e, t = i;
784
787
  K();
785
- const s = D(null), o = D(!1), d = x(() => t.modelValue ? Array.isArray(t.modelValue) ? t.modelValue : [t.modelValue] : []);
786
- function l(h) {
787
- return h < 1024 ? `${h} B` : h < 1024 * 1024 ? `${(h / 1024).toFixed(1)} KB` : `${(h / (1024 * 1024)).toFixed(1)} MB`;
788
- }
789
- function n(h) {
790
- let y = h;
791
- if (t.maxSize) {
792
- const A = t.maxSize;
793
- y = y.filter((V) => V.size <= A);
788
+ const u = M(null), n = M(!1), c = x(() => a.modelValue ? Array.isArray(a.modelValue) ? a.modelValue : [a.modelValue] : []);
789
+ function l(g) {
790
+ return g < 1024 ? `${g} B` : g < 1024 * 1024 ? `${(g / 1024).toFixed(1)} KB` : `${(g / (1024 * 1024)).toFixed(1)} MB`;
791
+ }
792
+ function o(g) {
793
+ let p = g;
794
+ if (a.maxSize) {
795
+ const N = a.maxSize;
796
+ p = p.filter((B) => B.size <= N);
794
797
  }
795
- if (t.multiple && t.maxFiles) {
796
- const A = t.maxFiles - d.value.length;
797
- y = y.slice(0, Math.max(0, A));
798
+ if (a.multiple && a.maxFiles) {
799
+ const N = a.maxFiles - c.value.length;
800
+ p = p.slice(0, Math.max(0, N));
798
801
  }
799
- return y;
802
+ return p;
800
803
  }
801
- function r(h) {
802
- const y = n(h);
803
- y.length !== 0 && (t.multiple ? a("update:modelValue", [...d.value, ...y]) : a("update:modelValue", y[0]));
804
+ function r(g) {
805
+ const p = o(g);
806
+ p.length !== 0 && (a.multiple ? t("update:modelValue", [...c.value, ...p]) : t("update:modelValue", p[0] ?? null));
804
807
  }
805
- function i(h) {
806
- const y = h.target;
807
- y.files && (r(Array.from(y.files)), y.value = "");
808
+ function s(g) {
809
+ const p = g.target;
810
+ p.files && (r(Array.from(p.files)), p.value = "");
808
811
  }
809
- function k(h) {
810
- if (t.disabled) return;
811
- const y = d.value.filter((A, V) => V !== h);
812
- t.multiple ? a("update:modelValue", y.length ? y : []) : a("update:modelValue", null);
812
+ function k(g) {
813
+ if (a.disabled) return;
814
+ const p = c.value.filter((N, B) => B !== g);
815
+ a.multiple ? t("update:modelValue", p.length ? p : []) : t("update:modelValue", null);
813
816
  }
814
- function g(h) {
815
- h.preventDefault(), t.disabled || (o.value = !0);
817
+ function S(g) {
818
+ g.preventDefault(), a.disabled || (n.value = !0);
816
819
  }
817
- function $() {
818
- o.value = !1;
820
+ function F() {
821
+ n.value = !1;
819
822
  }
820
- function m(h) {
821
- var y;
822
- h.preventDefault(), o.value = !1, !(t.disabled || !((y = h.dataTransfer) != null && y.files)) && r(Array.from(h.dataTransfer.files));
823
+ function y(g) {
824
+ var p;
825
+ g.preventDefault(), n.value = !1, !(a.disabled || !((p = g.dataTransfer) != null && p.files)) && r(Array.from(g.dataTransfer.files));
823
826
  }
824
- function C() {
825
- var h;
826
- t.disabled || (h = s.value) == null || h.click();
827
+ function v() {
828
+ var g;
829
+ a.disabled || (g = u.value) == null || g.click();
827
830
  }
828
- return (h, y) => (c(), f("div", {
829
- class: F(e.disabled ? "opacity-50 cursor-not-allowed" : "")
831
+ return (g, p) => (d(), f("div", {
832
+ class: T(e.disabled ? "opacity-50 cursor-not-allowed" : "")
830
833
  }, [
831
- p("div", {
834
+ h("div", {
832
835
  role: "button",
833
836
  tabindex: "0",
834
837
  "aria-disabled": e.disabled || void 0,
835
- class: F([
838
+ class: T([
836
839
  "flex flex-col items-center justify-center rounded-lg border-2 border-dashed p-6 text-center transition-colors duration-200",
837
- o.value ? "" : "border-gray-300 bg-gray-50",
840
+ n.value ? "" : "border-gray-300 bg-gray-50",
838
841
  e.disabled ? "pointer-events-none" : "cursor-pointer hover:border-gray-400"
839
842
  ]),
840
- style: z(o.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)" } : {}),
841
- onClick: C,
843
+ style: O(n.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)" } : {}),
844
+ onClick: v,
842
845
  onKeydown: [
843
- he(C, ["enter"]),
844
- he(Y(C, ["prevent"]), ["space"])
846
+ he(v, ["enter"]),
847
+ he(J(v, ["prevent"]), ["space"])
845
848
  ],
846
- onDragover: g,
847
- onDragleave: $,
848
- onDrop: m,
849
- onBlur: y[0] || (y[0] = (A) => a("blur", A))
849
+ onDragover: S,
850
+ onDragleave: F,
851
+ onDrop: y,
852
+ onBlur: p[0] || (p[0] = (N) => t("blur", N))
850
853
  }, [
851
- y[1] || (y[1] = p("svg", {
854
+ p[1] || (p[1] = h("svg", {
852
855
  class: "mb-2 h-8 w-8 text-gray-400",
853
856
  fill: "none",
854
857
  viewBox: "0 0 24 24",
@@ -856,37 +859,37 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
856
859
  "stroke-width": "1.5",
857
860
  "aria-hidden": "true"
858
861
  }, [
859
- p("path", {
862
+ h("path", {
860
863
  "stroke-linecap": "round",
861
864
  "stroke-linejoin": "round",
862
865
  d: "M12 16v-8m0 0l-3 3m3-3l3 3M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1"
863
866
  })
864
867
  ], -1)),
865
- y[2] || (y[2] = p("p", { class: "text-sm text-gray-600" }, [
866
- _(" Drop files here or "),
867
- p("span", {
868
+ p[2] || (p[2] = h("p", { class: "text-sm text-gray-600" }, [
869
+ Q(" Drop files here or "),
870
+ h("span", {
868
871
  class: "font-medium",
869
872
  style: { color: "var(--fc-color-primary, #3b82f6)" }
870
873
  }, "browse")
871
874
  ], -1)),
872
- e.accept ? (c(), f("p", pt, "Accepted: " + L(e.accept), 1)) : T("", !0)
875
+ e.accept ? (d(), f("p", pt, "Accepted: " + A(e.accept), 1)) : I("", !0)
873
876
  ], 46, yt),
874
- p("input", {
877
+ h("input", {
875
878
  ref_key: "fileInputRef",
876
- ref: s,
879
+ ref: u,
877
880
  type: "file",
878
881
  accept: e.accept,
879
882
  multiple: e.multiple,
880
883
  class: "hidden",
881
- onChange: i
884
+ onChange: s
882
885
  }, null, 40, gt),
883
- d.value.length > 0 ? (c(), f("ul", ht, [
884
- (c(!0), f(O, null, G(d.value, (A, V) => (c(), f("li", {
885
- key: `${A.name}-${V}`,
886
+ c.value.length > 0 ? (d(), f("ul", ht, [
887
+ (d(!0), f(z, null, G(c.value, (N, B) => (d(), f("li", {
888
+ key: `${N.name}-${B}`,
886
889
  class: "flex items-center justify-between rounded-md border border-gray-200 bg-white px-3 py-2 text-sm"
887
890
  }, [
888
- p("div", xt, [
889
- y[3] || (y[3] = p("svg", {
891
+ h("div", xt, [
892
+ p[3] || (p[3] = h("svg", {
890
893
  class: "h-4 w-4 shrink-0 text-gray-400",
891
894
  fill: "none",
892
895
  viewBox: "0 0 24 24",
@@ -894,24 +897,24 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
894
897
  "stroke-width": "2",
895
898
  "aria-hidden": "true"
896
899
  }, [
897
- p("path", {
900
+ h("path", {
898
901
  "stroke-linecap": "round",
899
902
  "stroke-linejoin": "round",
900
903
  d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
901
904
  })
902
905
  ], -1)),
903
- p("span", kt, L(A.name), 1),
904
- p("span", wt, "(" + L(l(A.size)) + ")", 1)
906
+ h("span", kt, A(N.name), 1),
907
+ h("span", wt, "(" + A(l(N.size)) + ")", 1)
905
908
  ]),
906
- e.disabled ? T("", !0) : (c(), f("button", {
909
+ e.disabled ? I("", !0) : (d(), f("button", {
907
910
  key: 0,
908
911
  type: "button",
909
912
  class: "ml-2 shrink-0 text-gray-400 hover:text-red-500 transition-colors duration-200",
910
913
  "aria-label": "Remove file",
911
- onClick: Y((b) => k(V), ["stop"])
914
+ onClick: J((C) => k(B), ["stop"])
912
915
  }, " × ", 8, $t))
913
916
  ]))), 128))
914
- ])) : T("", !0)
917
+ ])) : I("", !0)
915
918
  ], 2));
916
919
  }
917
920
  }), Vt = {
@@ -937,31 +940,31 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
937
940
  readonly: { type: Boolean, default: !1 }
938
941
  },
939
942
  emits: ["update:modelValue", "blur", "focus"],
940
- setup(e, { emit: u }) {
941
- const t = e, a = u, s = K(), o = x(() => !!t.prefix || !!t.suffix), d = x(
943
+ setup(e, { emit: i }) {
944
+ const a = e, t = i, u = K(), n = x(() => !!a.prefix || !!a.suffix), c = x(
942
945
  () => [
943
946
  "w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
944
947
  "placeholder:text-gray-400",
945
948
  "focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-number-input",
946
949
  "transition-colors duration-200",
947
- t.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
948
- t.prefix ? "rounded-l-none" : "",
949
- t.suffix ? "rounded-r-none" : "",
950
- s.classes.value.input
950
+ a.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
951
+ a.prefix ? "rounded-l-none" : "",
952
+ a.suffix ? "rounded-r-none" : "",
953
+ u.classes.value.input
951
954
  ].filter(Boolean).join(" ")
952
955
  );
953
- function l(n) {
954
- const i = n.target.value;
955
- if (i === "") {
956
- a("update:modelValue", null);
956
+ function l(o) {
957
+ const s = o.target.value;
958
+ if (s === "") {
959
+ t("update:modelValue", null);
957
960
  return;
958
961
  }
959
- let k = parseFloat(i);
960
- Number.isNaN(k) || (t.precision !== void 0 && (k = parseFloat(k.toFixed(t.precision))), a("update:modelValue", k));
962
+ let k = parseFloat(s);
963
+ Number.isNaN(k) || (a.precision !== void 0 && (k = parseFloat(k.toFixed(a.precision))), t("update:modelValue", k));
961
964
  }
962
- return (n, r) => o.value ? (c(), f("div", Vt, [
963
- e.prefix ? (c(), f("span", St, L(e.prefix), 1)) : T("", !0),
964
- p("input", {
965
+ return (o, r) => n.value ? (d(), f("div", Vt, [
966
+ e.prefix ? (d(), f("span", St, A(e.prefix), 1)) : I("", !0),
967
+ h("input", {
965
968
  type: "number",
966
969
  value: e.modelValue ?? "",
967
970
  min: e.min,
@@ -969,15 +972,15 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
969
972
  step: e.step,
970
973
  disabled: e.disabled,
971
974
  readonly: e.readonly,
972
- class: F(d.value),
975
+ class: T(c.value),
973
976
  "aria-disabled": e.disabled || void 0,
974
977
  "aria-readonly": e.readonly || void 0,
975
978
  onInput: l,
976
- onBlur: r[0] || (r[0] = (i) => a("blur", i)),
977
- onFocus: r[1] || (r[1] = (i) => a("focus", i))
979
+ onBlur: r[0] || (r[0] = (s) => t("blur", s)),
980
+ onFocus: r[1] || (r[1] = (s) => t("focus", s))
978
981
  }, null, 42, Bt),
979
- e.suffix ? (c(), f("span", Ft, L(e.suffix), 1)) : T("", !0)
980
- ])) : (c(), f("input", {
982
+ e.suffix ? (d(), f("span", Ft, A(e.suffix), 1)) : I("", !0)
983
+ ])) : (d(), f("input", {
981
984
  key: 1,
982
985
  type: "number",
983
986
  value: e.modelValue ?? "",
@@ -986,18 +989,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
986
989
  step: e.step,
987
990
  disabled: e.disabled,
988
991
  readonly: e.readonly,
989
- class: F(d.value),
992
+ class: T(c.value),
990
993
  "aria-disabled": e.disabled || void 0,
991
994
  "aria-readonly": e.readonly || void 0,
992
995
  onInput: l,
993
- onBlur: r[2] || (r[2] = (i) => a("blur", i)),
994
- onFocus: r[3] || (r[3] = (i) => a("focus", i))
996
+ onBlur: r[2] || (r[2] = (s) => t("blur", s)),
997
+ onFocus: r[3] || (r[3] = (s) => t("focus", s))
995
998
  }, null, 42, Tt));
996
999
  }
997
- }), Lt = /* @__PURE__ */ oe(It, [["__scopeId", "data-v-4e51299b"]]), At = { class: "relative" }, Nt = ["disabled"], Dt = { class: "text-lg leading-none" }, Mt = { class: "text-xs text-gray-500 dark:text-gray-400 font-medium" }, Et = ["value", "placeholder", "disabled"], Rt = {
1000
+ }), Lt = /* @__PURE__ */ ne(It, [["__scopeId", "data-v-4e51299b"]]), At = { class: "relative" }, Nt = ["disabled"], Dt = { class: "text-lg leading-none" }, Mt = { class: "text-xs text-gray-500 dark:text-gray-400 font-medium" }, Et = ["value", "placeholder", "disabled"], Rt = {
998
1001
  key: 1,
999
1002
  class: "absolute left-0 top-full z-50 mt-1 w-72 rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-xl overflow-hidden"
1000
- }, jt = { class: "border-b border-gray-200 dark:border-gray-700 p-2" }, zt = { class: "max-h-48 overflow-y-auto" }, Ot = ["onMousedown"], Kt = { class: "text-lg leading-none" }, Pt = { class: "flex-1 truncate text-xs" }, Ut = { class: "text-[11px] text-gray-400 dark:text-gray-500 font-mono" }, Ht = {
1003
+ }, jt = { class: "border-b border-gray-200 dark:border-gray-700 p-2" }, Ot = { class: "max-h-48 overflow-y-auto" }, zt = ["onMousedown"], Kt = { class: "text-lg leading-none" }, Pt = { class: "flex-1 truncate text-xs" }, Ut = { class: "text-[11px] text-gray-400 dark:text-gray-500 font-mono" }, Ht = {
1001
1004
  key: 0,
1002
1005
  class: "px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500"
1003
1006
  }, Gt = /* @__PURE__ */ j({
@@ -1011,8 +1014,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1011
1014
  disabled: { type: Boolean, default: !1 }
1012
1015
  },
1013
1016
  emits: ["update:modelValue", "blur"],
1014
- setup(e, { emit: u }) {
1015
- const t = e, a = u, s = {
1017
+ setup(e, { emit: i }) {
1018
+ const a = e, t = i, u = {
1016
1019
  AF: "Afghanistan",
1017
1020
  AL: "Albania",
1018
1021
  DZ: "Algeria",
@@ -1132,148 +1135,148 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1132
1135
  VN: "Vietnam",
1133
1136
  ZW: "Zimbabwe"
1134
1137
  };
1135
- function o(b) {
1136
- return b.toUpperCase().split("").map((v) => String.fromCodePoint(127462 + v.charCodeAt(0) - 65)).join("");
1137
- }
1138
- const d = x(() => {
1139
- var v;
1140
- return ((v = t.countries) != null && v.length ? t.countries.filter(
1141
- (B) => xe().includes(B)
1142
- ) : xe()).map((B) => ({
1143
- code: B,
1144
- name: s[B] ?? B,
1145
- dialCode: `+${ke(B)}`,
1146
- flag: o(B)
1147
- })).sort((B, S) => B.name.localeCompare(S.name));
1148
- }), l = D(t.defaultCountry), n = D(""), r = D(!1), i = D(""), k = D(null), g = x(() => {
1149
- const b = i.value.toLowerCase();
1150
- return b ? d.value.filter(
1151
- (v) => v.name.toLowerCase().includes(b) || v.code.toLowerCase().includes(b) || v.dialCode.includes(b)
1152
- ) : d.value;
1153
- }), $ = x(
1154
- () => d.value.find((b) => b.code === l.value) ?? d.value[0]
1138
+ function n(C) {
1139
+ return C.toUpperCase().split("").map((V) => String.fromCodePoint(127462 + V.charCodeAt(0) - 65)).join("");
1140
+ }
1141
+ const c = x(() => {
1142
+ var V;
1143
+ return ((V = a.countries) != null && V.length ? a.countries.filter(
1144
+ (b) => xe().includes(b)
1145
+ ) : xe()).map((b) => ({
1146
+ code: b,
1147
+ name: u[b] ?? b,
1148
+ dialCode: `+${ke(b)}`,
1149
+ flag: n(b)
1150
+ })).sort((b, m) => b.name.localeCompare(m.name));
1151
+ }), l = M(a.defaultCountry), o = M(""), r = M(!1), s = M(""), k = M(null), S = x(() => {
1152
+ const C = s.value.toLowerCase();
1153
+ return C ? c.value.filter(
1154
+ (V) => V.name.toLowerCase().includes(C) || V.code.toLowerCase().includes(C) || V.dialCode.includes(C)
1155
+ ) : c.value;
1156
+ }), F = x(
1157
+ () => c.value.find((C) => C.code === l.value) ?? c.value[0]
1155
1158
  );
1156
- ue(() => {
1157
- t.modelValue && m(t.modelValue);
1158
- }), J(
1159
- () => t.modelValue,
1160
- (b) => {
1161
- b && m(b);
1159
+ de(() => {
1160
+ a.modelValue && y(a.modelValue);
1161
+ }), W(
1162
+ () => a.modelValue,
1163
+ (C) => {
1164
+ C && y(C);
1162
1165
  }
1163
1166
  );
1164
- function m(b) {
1167
+ function y(C) {
1165
1168
  try {
1166
- const v = ze(b);
1167
- if (v != null && v.country) {
1168
- l.value = v.country, n.value = v.nationalNumber;
1169
+ const V = Oe(C);
1170
+ if (V != null && V.country) {
1171
+ l.value = V.country, o.value = V.nationalNumber;
1169
1172
  return;
1170
1173
  }
1171
1174
  } catch {
1172
1175
  }
1173
- n.value = b.replace(/^\+\d+\s*/, "");
1176
+ o.value = C.replace(/^\+\d+\s*/, "");
1174
1177
  }
1175
- function C() {
1176
- if (!n.value.trim()) {
1177
- a("update:modelValue", "");
1178
+ function v() {
1179
+ if (!o.value.trim()) {
1180
+ t("update:modelValue", "");
1178
1181
  return;
1179
1182
  }
1180
- const b = new Oe(l.value);
1181
- b.input(`+${ke(l.value)}${n.value}`);
1182
- const v = b.getNumber();
1183
- a("update:modelValue", (v == null ? void 0 : v.format("E.164")) ?? n.value);
1184
- }
1185
- function h(b) {
1186
- const v = b.target;
1187
- n.value = v.value, C();
1188
- }
1189
- function y(b) {
1190
- l.value = b, r.value = !1, i.value = "", C();
1191
- }
1192
- function A() {
1193
- t.disabled || (r.value = !0, i.value = "", ae(() => {
1194
- var b;
1195
- return (b = k.value) == null ? void 0 : b.focus();
1183
+ const C = new ze(l.value);
1184
+ C.input(`+${ke(l.value)}${o.value}`);
1185
+ const V = C.getNumber();
1186
+ t("update:modelValue", (V == null ? void 0 : V.format("E.164")) ?? o.value);
1187
+ }
1188
+ function g(C) {
1189
+ const V = C.target;
1190
+ o.value = V.value, v();
1191
+ }
1192
+ function p(C) {
1193
+ l.value = C, r.value = !1, s.value = "", v();
1194
+ }
1195
+ function N() {
1196
+ a.disabled || (r.value = !0, s.value = "", te(() => {
1197
+ var C;
1198
+ return (C = k.value) == null ? void 0 : C.focus();
1196
1199
  }));
1197
1200
  }
1198
- function V() {
1199
- r.value = !1, i.value = "";
1201
+ function B() {
1202
+ r.value = !1, s.value = "";
1200
1203
  }
1201
- return (b, v) => {
1202
- var B, S;
1203
- return c(), f("div", At, [
1204
- p("div", {
1205
- class: F([
1204
+ return (C, V) => {
1205
+ var b, m;
1206
+ return d(), f("div", At, [
1207
+ h("div", {
1208
+ class: T([
1206
1209
  "flex items-stretch rounded-lg border transition-colors",
1207
1210
  e.disabled ? "opacity-50 cursor-not-allowed bg-gray-50 dark:bg-gray-800 border-gray-200 dark:border-gray-700" : "border-gray-300 dark:border-gray-600 focus-within:border-primary-500 focus-within:ring-2 focus-within:ring-primary-500/20"
1208
1211
  ])
1209
1212
  }, [
1210
- e.showDialCode ? (c(), f("button", {
1213
+ e.showDialCode ? (d(), f("button", {
1211
1214
  key: 0,
1212
1215
  type: "button",
1213
1216
  disabled: e.disabled,
1214
1217
  class: "flex items-center gap-1.5 px-3 border-r border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 rounded-l-lg hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors shrink-0",
1215
- onMousedown: v[0] || (v[0] = Y((N) => r.value ? V() : A(), ["prevent"]))
1218
+ onMousedown: V[0] || (V[0] = J((w) => r.value ? B() : N(), ["prevent"]))
1216
1219
  }, [
1217
- p("span", Dt, L((B = $.value) == null ? void 0 : B.flag), 1),
1218
- p("span", Mt, L((S = $.value) == null ? void 0 : S.dialCode), 1),
1219
- (c(), f("svg", {
1220
- class: F(["h-3 w-3 text-gray-400 transition-transform", r.value ? "rotate-180" : ""]),
1220
+ h("span", Dt, A((b = F.value) == null ? void 0 : b.flag), 1),
1221
+ h("span", Mt, A((m = F.value) == null ? void 0 : m.dialCode), 1),
1222
+ (d(), f("svg", {
1223
+ class: T(["h-3 w-3 text-gray-400 transition-transform", r.value ? "rotate-180" : ""]),
1221
1224
  viewBox: "0 0 24 24",
1222
1225
  fill: "none",
1223
1226
  stroke: "currentColor",
1224
1227
  "stroke-width": "2",
1225
1228
  "stroke-linecap": "round",
1226
1229
  "stroke-linejoin": "round"
1227
- }, [...v[3] || (v[3] = [
1228
- p("polyline", { points: "6 9 12 15 18 9" }, null, -1)
1230
+ }, [...V[3] || (V[3] = [
1231
+ h("polyline", { points: "6 9 12 15 18 9" }, null, -1)
1229
1232
  ])], 2))
1230
- ], 40, Nt)) : T("", !0),
1231
- p("input", {
1233
+ ], 40, Nt)) : I("", !0),
1234
+ h("input", {
1232
1235
  type: "tel",
1233
- value: n.value,
1236
+ value: o.value,
1234
1237
  placeholder: e.placeholder || "Phone number",
1235
1238
  disabled: e.disabled,
1236
1239
  autocomplete: "tel-national",
1237
- class: F(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0", e.showDialCode ? "rounded-r-lg" : "rounded-lg"]),
1238
- onInput: h,
1239
- onBlur: v[1] || (v[1] = (N) => a("blur", N))
1240
+ class: T(["flex-1 bg-transparent px-3 py-2 text-sm text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 outline-none min-w-0", e.showDialCode ? "rounded-r-lg" : "rounded-lg"]),
1241
+ onInput: g,
1242
+ onBlur: V[1] || (V[1] = (w) => t("blur", w))
1240
1243
  }, null, 42, Et)
1241
1244
  ], 2),
1242
- r.value ? (c(), f("div", {
1245
+ r.value ? (d(), f("div", {
1243
1246
  key: 0,
1244
1247
  class: "fixed inset-0 z-40",
1245
- onMousedown: V
1246
- }, null, 32)) : T("", !0),
1247
- r.value ? (c(), f("div", Rt, [
1248
- p("div", jt, [
1249
- de(p("input", {
1248
+ onMousedown: B
1249
+ }, null, 32)) : I("", !0),
1250
+ r.value ? (d(), f("div", Rt, [
1251
+ h("div", jt, [
1252
+ ce(h("input", {
1250
1253
  ref_key: "searchInputRef",
1251
1254
  ref: k,
1252
- "onUpdate:modelValue": v[2] || (v[2] = (N) => i.value = N),
1255
+ "onUpdate:modelValue": V[2] || (V[2] = (w) => s.value = w),
1253
1256
  type: "text",
1254
1257
  placeholder: "Search country...",
1255
1258
  class: "w-full rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-800 px-3 py-1.5 text-xs text-gray-900 dark:text-white placeholder-gray-400 outline-none focus:border-primary-500"
1256
1259
  }, null, 512), [
1257
- [ve, i.value]
1260
+ [ye, s.value]
1258
1261
  ])
1259
1262
  ]),
1260
- p("div", zt, [
1261
- (c(!0), f(O, null, G(g.value, (N) => (c(), f("button", {
1262
- key: N.code,
1263
+ h("div", Ot, [
1264
+ (d(!0), f(z, null, G(S.value, (w) => (d(), f("button", {
1265
+ key: w.code,
1263
1266
  type: "button",
1264
- class: F([
1267
+ class: T([
1265
1268
  "flex w-full items-center gap-3 px-3 py-2 text-left text-sm transition-colors hover:bg-gray-50 dark:hover:bg-gray-800",
1266
- N.code === l.value ? "bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300" : "text-gray-700 dark:text-gray-300"
1269
+ w.code === l.value ? "bg-primary-50 dark:bg-primary-950/30 text-primary-700 dark:text-primary-300" : "text-gray-700 dark:text-gray-300"
1267
1270
  ]),
1268
- onMousedown: Y((R) => y(N.code), ["prevent"])
1271
+ onMousedown: J((D) => p(w.code), ["prevent"])
1269
1272
  }, [
1270
- p("span", Kt, L(N.flag), 1),
1271
- p("span", Pt, L(N.name), 1),
1272
- p("span", Ut, L(N.dialCode), 1)
1273
- ], 42, Ot))), 128)),
1274
- g.value.length === 0 ? (c(), f("p", Ht, " No countries found ")) : T("", !0)
1273
+ h("span", Kt, A(w.flag), 1),
1274
+ h("span", Pt, A(w.name), 1),
1275
+ h("span", Ut, A(w.dialCode), 1)
1276
+ ], 42, zt))), 128)),
1277
+ S.value.length === 0 ? (d(), f("p", Ht, " No countries found ")) : I("", !0)
1275
1278
  ])
1276
- ])) : T("", !0)
1279
+ ])) : I("", !0)
1277
1280
  ]);
1278
1281
  };
1279
1282
  }
@@ -1290,56 +1293,56 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1290
1293
  disabled: { type: Boolean, default: !1 }
1291
1294
  },
1292
1295
  emits: ["update:modelValue", "blur"],
1293
- setup(e, { emit: u }) {
1294
- const t = e, a = u;
1296
+ setup(e, { emit: i }) {
1297
+ const a = e, t = i;
1295
1298
  K();
1296
- function s(n) {
1297
- return t.modelValue === n;
1299
+ function u(o) {
1300
+ return a.modelValue === o;
1298
1301
  }
1299
- function o(n) {
1300
- return t.disabled || !!n.disabled;
1302
+ function n(o) {
1303
+ return a.disabled || !!o.disabled;
1301
1304
  }
1302
- function d(n) {
1303
- o(n) || a("update:modelValue", n.value);
1305
+ function c(o) {
1306
+ n(o) || t("update:modelValue", o.value);
1304
1307
  }
1305
- function l(n, r) {
1306
- (n.key === " " || n.key === "Enter") && (n.preventDefault(), d(r));
1308
+ function l(o, r) {
1309
+ (o.key === " " || o.key === "Enter") && (o.preventDefault(), c(r));
1307
1310
  }
1308
- return (n, r) => (c(), f("div", {
1311
+ return (o, r) => (d(), f("div", {
1309
1312
  role: "radiogroup",
1310
- class: F(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
1313
+ class: T(e.inline ? "flex flex-wrap gap-4" : "flex flex-col gap-2")
1311
1314
  }, [
1312
- (c(!0), f(O, null, G(e.options, (i) => (c(), f("label", {
1313
- key: String(i.value),
1314
- class: F([
1315
+ (d(!0), f(z, null, G(e.options, (s) => (d(), f("label", {
1316
+ key: String(s.value),
1317
+ class: T([
1315
1318
  "inline-flex items-center gap-2 select-none",
1316
- o(i) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
1319
+ n(s) ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
1317
1320
  ])
1318
1321
  }, [
1319
- p("input", {
1322
+ h("input", {
1320
1323
  type: "radio",
1321
- checked: s(i.value),
1322
- disabled: o(i),
1324
+ checked: u(s.value),
1325
+ disabled: n(s),
1323
1326
  class: "sr-only",
1324
- onChange: (k) => d(i),
1325
- onBlur: r[0] || (r[0] = (k) => a("blur", k))
1327
+ onChange: (k) => c(s),
1328
+ onBlur: r[0] || (r[0] = (k) => t("blur", k))
1326
1329
  }, null, 40, Zt),
1327
- p("div", {
1330
+ h("div", {
1328
1331
  role: "radio",
1329
- "aria-checked": s(i.value),
1330
- "aria-disabled": o(i) || void 0,
1332
+ "aria-checked": u(s.value),
1333
+ "aria-disabled": n(s) || void 0,
1331
1334
  tabindex: "0",
1332
- class: F([
1335
+ class: T([
1333
1336
  "flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-200",
1334
- s(i.value) ? "" : "border-gray-300"
1337
+ u(s.value) ? "" : "border-gray-300"
1335
1338
  ]),
1336
- style: z(s(i.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1337
- onClick: (k) => d(i),
1338
- onKeydown: (k) => l(k, i)
1339
+ style: O(u(s.value) ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1340
+ onClick: (k) => c(s),
1341
+ onKeydown: (k) => l(k, s)
1339
1342
  }, [
1340
- s(i.value) ? (c(), f("div", Yt)) : T("", !0)
1343
+ u(s.value) ? (d(), f("div", Yt)) : I("", !0)
1341
1344
  ], 46, qt),
1342
- p("span", Jt, L(i.label), 1)
1345
+ h("span", Jt, A(s.label), 1)
1343
1346
  ], 2))), 128))
1344
1347
  ], 2));
1345
1348
  }
@@ -1373,174 +1376,177 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1373
1376
  disabled: { type: Boolean, default: !1 }
1374
1377
  },
1375
1378
  emits: ["update:modelValue", "blur"],
1376
- setup(e, { emit: u }) {
1377
- const t = e, a = u, s = K(), o = D(!1), d = D(""), l = D(-1), n = D(null), r = D(null), i = x(() => t.modelValue === null || t.modelValue === void 0 ? [] : Array.isArray(t.modelValue) ? t.modelValue : [t.modelValue]), k = x(() => {
1378
- if (i.value.length === 0 || t.multiple) return "";
1379
- const S = t.options.find((N) => N.value === i.value[0]);
1380
- return (S == null ? void 0 : S.label) ?? String(i.value[0]);
1381
- }), g = x(() => {
1382
- if (!d.value) return t.options;
1383
- const S = d.value.toLowerCase();
1384
- return t.options.filter((N) => N.label.toLowerCase().includes(S));
1379
+ setup(e, { emit: i }) {
1380
+ const a = e, t = i, u = K(), n = M(!1), c = M(""), l = M(-1), o = M(null), r = M(null), s = x(() => a.modelValue === null || a.modelValue === void 0 ? [] : Array.isArray(a.modelValue) ? a.modelValue : [a.modelValue]), k = x(() => {
1381
+ if (s.value.length === 0 || a.multiple) return "";
1382
+ const m = a.options.find((w) => w.value === s.value[0]);
1383
+ return (m == null ? void 0 : m.label) ?? String(s.value[0]);
1384
+ }), S = x(() => {
1385
+ if (!c.value) return a.options;
1386
+ const m = c.value.toLowerCase();
1387
+ return a.options.filter((w) => w.label.toLowerCase().includes(m));
1385
1388
  });
1386
- function $(S) {
1387
- return i.value.includes(S);
1389
+ function F(m) {
1390
+ return s.value.includes(m);
1388
1391
  }
1389
- function m() {
1390
- t.disabled || (o.value ? h() : C());
1392
+ function y() {
1393
+ a.disabled || (n.value ? g() : v());
1391
1394
  }
1392
- function C() {
1393
- o.value = !0, l.value = -1, d.value = "", ae(() => {
1394
- var S;
1395
- return (S = r.value) == null ? void 0 : S.focus();
1395
+ function v() {
1396
+ n.value = !0, l.value = -1, c.value = "", te(() => {
1397
+ var m;
1398
+ return (m = r.value) == null ? void 0 : m.focus();
1396
1399
  });
1397
1400
  }
1398
- function h() {
1399
- o.value = !1, d.value = "";
1401
+ function g() {
1402
+ n.value = !1, c.value = "";
1400
1403
  }
1401
- function y(S) {
1402
- if (!S.disabled)
1403
- if (t.multiple) {
1404
- const N = [...i.value], R = N.indexOf(S.value);
1405
- R >= 0 ? N.splice(R, 1) : N.push(S.value), a("update:modelValue", N);
1404
+ function p(m) {
1405
+ if (!m.disabled)
1406
+ if (a.multiple) {
1407
+ const w = [...s.value], D = w.indexOf(m.value);
1408
+ D >= 0 ? w.splice(D, 1) : w.push(m.value), t("update:modelValue", w);
1406
1409
  } else
1407
- a("update:modelValue", S.value), h();
1410
+ t("update:modelValue", m.value), g();
1408
1411
  }
1409
- function A(S) {
1410
- if (t.disabled) return;
1411
- const N = i.value.filter((R) => R !== S);
1412
- a("update:modelValue", N.length ? N : t.multiple ? [] : null);
1412
+ function N(m) {
1413
+ if (a.disabled) return;
1414
+ const w = s.value.filter((D) => D !== m);
1415
+ t("update:modelValue", w.length ? w : a.multiple ? [] : null);
1413
1416
  }
1414
- function V(S) {
1415
- S.stopPropagation(), a("update:modelValue", t.multiple ? [] : null);
1417
+ function B(m) {
1418
+ m.stopPropagation(), t("update:modelValue", a.multiple ? [] : null);
1416
1419
  }
1417
- function b(S) {
1418
- if (!o.value) {
1419
- (S.key === "Enter" || S.key === " " || S.key === "ArrowDown") && (S.preventDefault(), C());
1420
+ function C(m) {
1421
+ if (!n.value) {
1422
+ (m.key === "Enter" || m.key === " " || m.key === "ArrowDown") && (m.preventDefault(), v());
1420
1423
  return;
1421
1424
  }
1422
- switch (S.key) {
1425
+ switch (m.key) {
1423
1426
  case "ArrowDown":
1424
- S.preventDefault(), l.value = Math.min(
1427
+ m.preventDefault(), l.value = Math.min(
1425
1428
  l.value + 1,
1426
- g.value.length - 1
1429
+ S.value.length - 1
1427
1430
  );
1428
1431
  break;
1429
1432
  case "ArrowUp":
1430
- S.preventDefault(), l.value = Math.max(l.value - 1, 0);
1433
+ m.preventDefault(), l.value = Math.max(l.value - 1, 0);
1431
1434
  break;
1432
1435
  case "Enter":
1433
- S.preventDefault(), l.value >= 0 && g.value[l.value] && y(g.value[l.value]);
1436
+ if (m.preventDefault(), l.value >= 0) {
1437
+ const w = S.value[l.value];
1438
+ w && p(w);
1439
+ }
1434
1440
  break;
1435
1441
  case "Escape":
1436
- S.preventDefault(), h();
1442
+ m.preventDefault(), g();
1437
1443
  break;
1438
1444
  }
1439
1445
  }
1440
- function v(S) {
1441
- n.value && !n.value.contains(S.target) && h();
1446
+ function V(m) {
1447
+ o.value && !o.value.contains(m.target) && g();
1442
1448
  }
1443
- function B(S) {
1444
- const N = t.options.find((R) => R.value === S);
1445
- return (N == null ? void 0 : N.label) ?? String(S);
1449
+ function b(m) {
1450
+ const w = a.options.find((D) => D.value === m);
1451
+ return (w == null ? void 0 : w.label) ?? String(m);
1446
1452
  }
1447
- return ue(() => document.addEventListener("mousedown", v)), Ve(() => document.removeEventListener("mousedown", v)), J(o, (S) => {
1448
- S || a("blur", new FocusEvent("blur"));
1449
- }), (S, N) => (c(), f("div", {
1453
+ return de(() => document.addEventListener("mousedown", V)), Ve(() => document.removeEventListener("mousedown", V)), W(n, (m) => {
1454
+ m || t("blur", new FocusEvent("blur"));
1455
+ }), (m, w) => (d(), f("div", {
1450
1456
  ref_key: "containerRef",
1451
- ref: n,
1452
- class: F([
1457
+ ref: o,
1458
+ class: T([
1453
1459
  "relative w-full",
1454
- H(s).classes.value.input,
1460
+ q(u).classes.value.input,
1455
1461
  e.disabled ? "opacity-50 cursor-not-allowed" : ""
1456
1462
  ])
1457
1463
  }, [
1458
- p("div", {
1464
+ h("div", {
1459
1465
  role: "combobox",
1460
- "aria-expanded": o.value,
1466
+ "aria-expanded": n.value,
1461
1467
  "aria-haspopup": "listbox",
1462
1468
  tabindex: "0",
1463
- class: F([
1469
+ class: T([
1464
1470
  "flex min-h-[38px] w-full cursor-pointer items-center rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm",
1465
1471
  "transition-colors duration-200",
1466
- o.value ? "ring-2 ring-blue-500/20" : "",
1472
+ n.value ? "ring-2 ring-blue-500/20" : "",
1467
1473
  e.disabled ? "pointer-events-none bg-gray-100" : ""
1468
1474
  ]),
1469
- style: z(o.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1470
- onClick: m,
1471
- onKeydown: b
1475
+ style: O(n.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1476
+ onClick: y,
1477
+ onKeydown: C
1472
1478
  }, [
1473
- p("div", Qt, [
1474
- e.multiple ? (c(!0), f(O, { key: 0 }, G(i.value, (R) => (c(), f("span", {
1475
- key: String(R),
1479
+ h("div", Qt, [
1480
+ e.multiple ? (d(!0), f(z, { key: 0 }, G(s.value, (D) => (d(), f("span", {
1481
+ key: String(D),
1476
1482
  class: "inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",
1477
1483
  style: { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)", color: "var(--fc-color-primary, #3b82f6)" }
1478
1484
  }, [
1479
- _(L(B(R)) + " ", 1),
1480
- p("button", {
1485
+ Q(A(b(D)) + " ", 1),
1486
+ h("button", {
1481
1487
  type: "button",
1482
1488
  class: "ml-0.5",
1483
1489
  style: { color: "var(--fc-color-primary, #3b82f6)" },
1484
1490
  "aria-label": "Remove",
1485
- onClick: Y((Q) => A(R), ["stop"])
1491
+ onClick: J((P) => N(D), ["stop"])
1486
1492
  }, " × ", 8, Xt)
1487
- ]))), 128)) : k.value ? (c(), f("span", ea, L(k.value), 1)) : (c(), f("span", ta, L(e.placeholder), 1))
1493
+ ]))), 128)) : k.value ? (d(), f("span", ea, A(k.value), 1)) : (d(), f("span", ta, A(e.placeholder), 1))
1488
1494
  ]),
1489
- e.clearable && i.value.length > 0 && !e.disabled ? (c(), f("button", {
1495
+ e.clearable && s.value.length > 0 && !e.disabled ? (d(), f("button", {
1490
1496
  key: 0,
1491
1497
  type: "button",
1492
1498
  class: "ml-1 shrink-0 text-gray-400 hover:text-gray-600 transition-colors duration-200",
1493
1499
  "aria-label": "Clear selection",
1494
- onClick: V
1495
- }, " × ")) : T("", !0),
1496
- (c(), f("svg", {
1497
- class: F(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200", o.value ? "rotate-180" : ""]),
1500
+ onClick: B
1501
+ }, " × ")) : I("", !0),
1502
+ (d(), f("svg", {
1503
+ class: T(["ml-1 h-4 w-4 shrink-0 text-gray-400 transition-transform duration-200", n.value ? "rotate-180" : ""]),
1498
1504
  viewBox: "0 0 20 20",
1499
1505
  fill: "currentColor",
1500
1506
  "aria-hidden": "true"
1501
- }, [...N[1] || (N[1] = [
1502
- p("path", {
1507
+ }, [...w[1] || (w[1] = [
1508
+ h("path", {
1503
1509
  "fill-rule": "evenodd",
1504
1510
  d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
1505
1511
  "clip-rule": "evenodd"
1506
1512
  }, null, -1)
1507
1513
  ])], 2))
1508
1514
  ], 46, _t),
1509
- o.value ? (c(), f("div", aa, [
1510
- e.searchable ? (c(), f("div", la, [
1511
- de(p("input", {
1515
+ n.value ? (d(), f("div", aa, [
1516
+ e.searchable ? (d(), f("div", la, [
1517
+ ce(h("input", {
1512
1518
  ref_key: "searchInputRef",
1513
1519
  ref: r,
1514
- "onUpdate:modelValue": N[0] || (N[0] = (R) => d.value = R),
1520
+ "onUpdate:modelValue": w[0] || (w[0] = (D) => c.value = D),
1515
1521
  type: "text",
1516
1522
  class: "w-full rounded border border-gray-300 px-2 py-1 text-sm focus:outline-none fc-select-search",
1517
1523
  placeholder: "Search...",
1518
- onKeydown: b
1524
+ onKeydown: C
1519
1525
  }, null, 544), [
1520
- [ve, d.value]
1526
+ [ye, c.value]
1521
1527
  ])
1522
- ])) : T("", !0),
1523
- p("ul", na, [
1524
- (c(!0), f(O, null, G(g.value, (R, Q) => (c(), f("li", {
1525
- key: String(R.value),
1528
+ ])) : I("", !0),
1529
+ h("ul", na, [
1530
+ (d(!0), f(z, null, G(S.value, (D, P) => (d(), f("li", {
1531
+ key: String(D.value),
1526
1532
  role: "option",
1527
- "aria-selected": $(R.value),
1528
- class: F([
1533
+ "aria-selected": F(D.value),
1534
+ class: T([
1529
1535
  "cursor-pointer px-3 py-2 text-sm transition-colors duration-200",
1530
- $(R.value) ? "" : "text-gray-900",
1531
- l.value === Q ? "bg-gray-100" : "",
1532
- R.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-50"
1536
+ F(D.value) ? "" : "text-gray-900",
1537
+ l.value === P ? "bg-gray-100" : "",
1538
+ D.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-50"
1533
1539
  ]),
1534
- style: z($(R.value) ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
1535
- onClick: (ee) => y(R),
1536
- onMouseenter: (ee) => l.value = Q
1537
- }, L(R.label), 47, oa))), 128)),
1538
- g.value.length === 0 ? (c(), f("li", ra, " No options found ")) : T("", !0)
1540
+ style: O(F(D.value) ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
1541
+ onClick: (re) => p(D),
1542
+ onMouseenter: (re) => l.value = P
1543
+ }, A(D.label), 47, oa))), 128)),
1544
+ S.value.length === 0 ? (d(), f("li", ra, " No options found ")) : I("", !0)
1539
1545
  ])
1540
- ])) : T("", !0)
1546
+ ])) : I("", !0)
1541
1547
  ], 2));
1542
1548
  }
1543
- }), ia = /* @__PURE__ */ oe(sa, [["__scopeId", "data-v-b34f2a7d"]]), ua = ["value", "min", "max", "step", "disabled", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-disabled"], da = { class: "mt-1 flex justify-between text-xs text-gray-400" }, ca = /* @__PURE__ */ j({
1549
+ }), ia = /* @__PURE__ */ ne(sa, [["__scopeId", "data-v-816d5094"]]), ua = ["value", "min", "max", "step", "disabled", "aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-disabled"], da = { class: "mt-1 flex justify-between text-xs text-gray-400" }, ca = /* @__PURE__ */ j({
1544
1550
  __name: "SliderInput",
1545
1551
  props: {
1546
1552
  modelValue: {},
@@ -1551,29 +1557,29 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1551
1557
  disabled: { type: Boolean, default: !1 }
1552
1558
  },
1553
1559
  emits: ["update:modelValue", "blur"],
1554
- setup(e, { emit: u }) {
1555
- const t = e, a = u;
1560
+ setup(e, { emit: i }) {
1561
+ const a = e, t = i;
1556
1562
  K();
1557
- const s = D(!1), o = x(() => {
1558
- const l = t.max - t.min;
1559
- return l === 0 ? 0 : (t.modelValue - t.min) / l * 100;
1563
+ const u = M(!1), n = x(() => {
1564
+ const l = a.max - a.min;
1565
+ return l === 0 ? 0 : (a.modelValue - a.min) / l * 100;
1560
1566
  });
1561
- function d(l) {
1562
- const n = l.target;
1563
- a("update:modelValue", parseFloat(n.value));
1567
+ function c(l) {
1568
+ const o = l.target;
1569
+ t("update:modelValue", parseFloat(o.value));
1564
1570
  }
1565
- return (l, n) => (c(), f("div", {
1566
- class: F([
1571
+ return (l, o) => (d(), f("div", {
1572
+ class: T([
1567
1573
  "relative w-full py-2",
1568
1574
  e.disabled ? "opacity-50 cursor-not-allowed" : ""
1569
1575
  ])
1570
1576
  }, [
1571
- e.showTooltip && s.value ? (c(), f("div", {
1577
+ e.showTooltip && u.value ? (d(), f("div", {
1572
1578
  key: 0,
1573
1579
  class: "absolute -top-8 rounded bg-gray-800 px-2 py-1 text-xs text-white shadow-sm transition-opacity duration-200",
1574
- style: z({ left: `calc(${o.value}% - 16px)` })
1575
- }, L(e.modelValue), 5)) : T("", !0),
1576
- p("input", {
1580
+ style: O({ left: `calc(${n.value}% - 16px)` })
1581
+ }, A(e.modelValue), 5)) : I("", !0),
1582
+ h("input", {
1577
1583
  type: "range",
1578
1584
  value: e.modelValue,
1579
1585
  min: e.min,
@@ -1586,19 +1592,19 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1586
1592
  "aria-disabled": e.disabled || void 0,
1587
1593
  class: "h-2 w-full cursor-pointer appearance-none rounded-full bg-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500/20 disabled:pointer-events-none",
1588
1594
  style: { accentColor: "var(--fc-color-primary, #3b82f6)" },
1589
- onInput: d,
1590
- onMousedown: n[0] || (n[0] = (r) => s.value = !0),
1591
- onMouseup: n[1] || (n[1] = (r) => s.value = !1),
1592
- onTouchstart: n[2] || (n[2] = (r) => s.value = !0),
1593
- onTouchend: n[3] || (n[3] = (r) => s.value = !1),
1594
- onFocus: n[4] || (n[4] = (r) => s.value = !0),
1595
- onBlur: n[5] || (n[5] = (r) => {
1596
- s.value = !1, a("blur", r);
1595
+ onInput: c,
1596
+ onMousedown: o[0] || (o[0] = (r) => u.value = !0),
1597
+ onMouseup: o[1] || (o[1] = (r) => u.value = !1),
1598
+ onTouchstart: o[2] || (o[2] = (r) => u.value = !0),
1599
+ onTouchend: o[3] || (o[3] = (r) => u.value = !1),
1600
+ onFocus: o[4] || (o[4] = (r) => u.value = !0),
1601
+ onBlur: o[5] || (o[5] = (r) => {
1602
+ u.value = !1, t("blur", r);
1597
1603
  })
1598
1604
  }, null, 40, ua),
1599
- p("div", da, [
1600
- p("span", null, L(e.min), 1),
1601
- p("span", null, L(e.max), 1)
1605
+ h("div", da, [
1606
+ h("span", null, A(e.min), 1),
1607
+ h("span", null, A(e.max), 1)
1602
1608
  ])
1603
1609
  ], 2));
1604
1610
  }
@@ -1617,55 +1623,55 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1617
1623
  disabled: { type: Boolean, default: !1 }
1618
1624
  },
1619
1625
  emits: ["update:modelValue", "blur"],
1620
- setup(e, { emit: u }) {
1621
- const t = e, a = u;
1626
+ setup(e, { emit: i }) {
1627
+ const a = e, t = i;
1622
1628
  K();
1623
- const s = x(() => [
1629
+ const u = x(() => [
1624
1630
  "inline-flex items-center gap-2 select-none",
1625
- t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
1631
+ a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
1626
1632
  ]);
1627
- function o() {
1628
- t.disabled || a("update:modelValue", !t.modelValue);
1633
+ function n() {
1634
+ a.disabled || t("update:modelValue", !a.modelValue);
1629
1635
  }
1630
- function d(l) {
1631
- (l.key === " " || l.key === "Enter") && (l.preventDefault(), o());
1636
+ function c(l) {
1637
+ (l.key === " " || l.key === "Enter") && (l.preventDefault(), n());
1632
1638
  }
1633
- return (l, n) => (c(), f("label", {
1634
- class: F(s.value)
1639
+ return (l, o) => (d(), f("label", {
1640
+ class: T(u.value)
1635
1641
  }, [
1636
- e.inactiveLabel ? (c(), f("span", fa, L(e.inactiveLabel), 1)) : T("", !0),
1637
- p("input", {
1642
+ e.inactiveLabel ? (d(), f("span", fa, A(e.inactiveLabel), 1)) : I("", !0),
1643
+ h("input", {
1638
1644
  type: "checkbox",
1639
1645
  checked: e.modelValue,
1640
1646
  disabled: e.disabled,
1641
1647
  class: "sr-only",
1642
- onChange: o,
1643
- onBlur: n[0] || (n[0] = (r) => a("blur", r))
1648
+ onChange: n,
1649
+ onBlur: o[0] || (o[0] = (r) => t("blur", r))
1644
1650
  }, null, 40, ma),
1645
- p("button", {
1651
+ h("button", {
1646
1652
  type: "button",
1647
1653
  role: "switch",
1648
1654
  "aria-checked": e.modelValue,
1649
1655
  "aria-disabled": e.disabled || void 0,
1650
1656
  tabindex: "0",
1651
- class: F([
1657
+ class: T([
1652
1658
  "relative inline-flex h-6 w-11 shrink-0 rounded-full border-2 border-transparent transition-colors duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",
1653
1659
  e.modelValue ? "" : "bg-gray-300",
1654
1660
  e.disabled ? "pointer-events-none" : "focus:outline-none focus:ring-2 focus:ring-blue-500/20"
1655
1661
  ]),
1656
- style: z(e.modelValue ? { backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1657
- onClick: o,
1658
- onKeydown: d
1662
+ style: O(e.modelValue ? { backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1663
+ onClick: n,
1664
+ onKeydown: c
1659
1665
  }, [
1660
- p("span", {
1661
- class: F([
1666
+ h("span", {
1667
+ class: T([
1662
1668
  "pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow-sm transition-transform duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]",
1663
1669
  e.modelValue ? "translate-x-5" : "translate-x-0"
1664
1670
  ]),
1665
1671
  "aria-hidden": "true"
1666
1672
  }, null, 2)
1667
1673
  ], 46, ba),
1668
- e.activeLabel ? (c(), f("span", va, L(e.activeLabel), 1)) : T("", !0)
1674
+ e.activeLabel ? (d(), f("span", va, A(e.activeLabel), 1)) : I("", !0)
1669
1675
  ], 2));
1670
1676
  }
1671
1677
  }), pa = ["onClick"], ga = ["placeholder", "disabled"], ha = {
@@ -1682,119 +1688,121 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1682
1688
  disabled: { type: Boolean, default: !1 }
1683
1689
  },
1684
1690
  emits: ["update:modelValue", "blur"],
1685
- setup(e, { emit: u }) {
1686
- const t = e, a = x(() => Array.isArray(t.modelValue) ? t.modelValue : []), s = u, o = K(), d = D(""), l = D(!1), n = D(!1), r = D(-1), i = D(null), k = D(null), g = x(() => !t.maxTags || a.value.length < t.maxTags), $ = x(() => {
1687
- if (!d.value || t.suggestions.length === 0) return [];
1688
- const V = d.value.toLowerCase();
1689
- return t.suggestions.filter(
1690
- (b) => b.toLowerCase().includes(V) && !a.value.includes(b)
1691
+ setup(e, { emit: i }) {
1692
+ const a = e, t = x(() => Array.isArray(a.modelValue) ? a.modelValue : []), u = i, n = K(), c = M(""), l = M(!1), o = M(!1), r = M(-1), s = M(null), k = M(null), S = x(() => !a.maxTags || t.value.length < a.maxTags), F = x(() => {
1693
+ if (!c.value || a.suggestions.length === 0) return [];
1694
+ const B = c.value.toLowerCase();
1695
+ return a.suggestions.filter(
1696
+ (C) => C.toLowerCase().includes(B) && !t.value.includes(C)
1691
1697
  );
1692
1698
  });
1693
- function m(V) {
1694
- const b = V.trim();
1695
- !b || !g.value || a.value.includes(b) || (s("update:modelValue", [...a.value, b]), d.value = "", n.value = !1, r.value = -1);
1696
- }
1697
- function C(V) {
1698
- if (t.disabled) return;
1699
- const b = a.value.filter((v, B) => B !== V);
1700
- s("update:modelValue", b);
1701
- }
1702
- function h(V) {
1703
- if (V.key === "Enter" || V.key === ",") {
1704
- V.preventDefault(), r.value >= 0 && $.value[r.value] ? m($.value[r.value]) : m(d.value);
1699
+ function y(B) {
1700
+ const C = B.trim();
1701
+ !C || !S.value || t.value.includes(C) || (u("update:modelValue", [...t.value, C]), c.value = "", o.value = !1, r.value = -1);
1702
+ }
1703
+ function v(B) {
1704
+ if (a.disabled) return;
1705
+ const C = t.value.filter((V, b) => b !== B);
1706
+ u("update:modelValue", C);
1707
+ }
1708
+ function g(B) {
1709
+ if (B.key === "Enter" || B.key === ",") {
1710
+ B.preventDefault();
1711
+ const C = r.value >= 0 ? F.value[r.value] : void 0;
1712
+ y(C || c.value);
1705
1713
  return;
1706
1714
  }
1707
- if (V.key === "Backspace" && d.value === "" && a.value.length > 0) {
1708
- C(a.value.length - 1);
1715
+ if (B.key === "Backspace" && c.value === "" && t.value.length > 0) {
1716
+ v(t.value.length - 1);
1709
1717
  return;
1710
1718
  }
1711
- if (V.key === "ArrowDown" && n.value) {
1712
- V.preventDefault(), r.value = Math.min(
1719
+ if (B.key === "ArrowDown" && o.value) {
1720
+ B.preventDefault(), r.value = Math.min(
1713
1721
  r.value + 1,
1714
- $.value.length - 1
1722
+ F.value.length - 1
1715
1723
  );
1716
1724
  return;
1717
1725
  }
1718
- if (V.key === "ArrowUp" && n.value) {
1719
- V.preventDefault(), r.value = Math.max(r.value - 1, 0);
1726
+ if (B.key === "ArrowUp" && o.value) {
1727
+ B.preventDefault(), r.value = Math.max(r.value - 1, 0);
1720
1728
  return;
1721
1729
  }
1722
- V.key === "Escape" && (n.value = !1, r.value = -1);
1730
+ B.key === "Escape" && (o.value = !1, r.value = -1);
1723
1731
  }
1724
- function y() {
1725
- n.value = d.value.length > 0 && $.value.length > 0, r.value = -1;
1732
+ function p() {
1733
+ o.value = c.value.length > 0 && F.value.length > 0, r.value = -1;
1726
1734
  }
1727
- function A(V) {
1728
- i.value && !i.value.contains(V.target) && (n.value = !1);
1735
+ function N(B) {
1736
+ s.value && !s.value.contains(B.target) && (o.value = !1);
1729
1737
  }
1730
- return ue(() => document.addEventListener("mousedown", A)), Ve(() => document.removeEventListener("mousedown", A)), J(d, () => {
1731
- ae(y);
1732
- }), (V, b) => (c(), f("div", {
1738
+ return de(() => document.addEventListener("mousedown", N)), Ve(() => document.removeEventListener("mousedown", N)), W(c, () => {
1739
+ te(p);
1740
+ }), (B, C) => (d(), f("div", {
1733
1741
  ref_key: "containerRef",
1734
- ref: i,
1735
- class: F([
1742
+ ref: s,
1743
+ class: T([
1736
1744
  "relative w-full",
1737
1745
  e.disabled ? "opacity-50 cursor-not-allowed" : ""
1738
1746
  ])
1739
1747
  }, [
1740
- p("div", {
1741
- class: F([
1748
+ h("div", {
1749
+ class: T([
1742
1750
  "flex flex-wrap items-center gap-1.5 rounded-md border bg-white px-2 py-1.5 text-sm transition-colors duration-200",
1743
1751
  l.value ? "ring-2 ring-blue-500/20" : "border-gray-300",
1744
- H(o).classes.value.input
1752
+ q(n).classes.value.input
1745
1753
  ]),
1746
- style: z(l.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1747
- onClick: b[3] || (b[3] = (v) => {
1748
- var B;
1749
- return (B = k.value) == null ? void 0 : B.focus();
1754
+ style: O(l.value ? { borderColor: "var(--fc-color-primary, #3b82f6)" } : {}),
1755
+ onClick: C[3] || (C[3] = (V) => {
1756
+ var b;
1757
+ return (b = k.value) == null ? void 0 : b.focus();
1750
1758
  })
1751
1759
  }, [
1752
- (c(!0), f(O, null, G(a.value, (v, B) => (c(), f("span", {
1753
- key: v,
1760
+ (d(!0), f(z, null, G(t.value, (V, b) => (d(), f("span", {
1761
+ key: V,
1754
1762
  class: "inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs",
1755
1763
  style: { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 15%, white)", color: "var(--fc-color-primary, #3b82f6)" }
1756
1764
  }, [
1757
- _(L(v) + " ", 1),
1758
- e.disabled ? T("", !0) : (c(), f("button", {
1765
+ Q(A(V) + " ", 1),
1766
+ e.disabled ? I("", !0) : (d(), f("button", {
1759
1767
  key: 0,
1760
1768
  type: "button",
1761
1769
  class: "ml-0.5 transition-colors duration-200",
1762
1770
  style: { color: "var(--fc-color-primary, #3b82f6)" },
1763
1771
  "aria-label": "Remove tag",
1764
- onClick: Y((S) => C(B), ["stop"])
1772
+ onClick: J((m) => v(b), ["stop"])
1765
1773
  }, " × ", 8, pa))
1766
1774
  ]))), 128)),
1767
- de(p("input", {
1775
+ ce(h("input", {
1768
1776
  ref_key: "inputRef",
1769
1777
  ref: k,
1770
- "onUpdate:modelValue": b[0] || (b[0] = (v) => d.value = v),
1778
+ "onUpdate:modelValue": C[0] || (C[0] = (V) => c.value = V),
1771
1779
  type: "text",
1772
- placeholder: a.value.length === 0 ? e.placeholder : "",
1780
+ placeholder: t.value.length === 0 ? e.placeholder : "",
1773
1781
  disabled: e.disabled,
1774
1782
  class: "min-w-[80px] flex-1 border-0 bg-transparent p-0 text-sm outline-none placeholder:text-gray-400",
1775
- onKeydown: h,
1776
- onFocus: b[1] || (b[1] = (v) => l.value = !0),
1777
- onBlur: b[2] || (b[2] = (v) => {
1778
- l.value = !1, s("blur", v);
1783
+ onKeydown: g,
1784
+ onFocus: C[1] || (C[1] = (V) => l.value = !0),
1785
+ onBlur: C[2] || (C[2] = (V) => {
1786
+ l.value = !1, u("blur", V);
1779
1787
  })
1780
1788
  }, null, 40, ga), [
1781
- [ve, d.value]
1789
+ [ye, c.value]
1782
1790
  ])
1783
1791
  ], 6),
1784
- n.value && $.value.length > 0 ? (c(), f("ul", ha, [
1785
- (c(!0), f(O, null, G($.value, (v, B) => (c(), f("li", {
1786
- key: v,
1792
+ o.value && F.value.length > 0 ? (d(), f("ul", ha, [
1793
+ (d(!0), f(z, null, G(F.value, (V, b) => (d(), f("li", {
1794
+ key: V,
1787
1795
  role: "option",
1788
- "aria-selected": r.value === B,
1789
- class: F([
1796
+ "aria-selected": r.value === b,
1797
+ class: T([
1790
1798
  "cursor-pointer px-3 py-2 text-sm transition-colors duration-200",
1791
- r.value !== B ? "text-gray-900 hover:bg-gray-50" : ""
1799
+ r.value !== b ? "text-gray-900 hover:bg-gray-50" : ""
1792
1800
  ]),
1793
- style: z(r.value === B ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
1794
- onMousedown: Y((S) => m(v), ["prevent"]),
1795
- onMouseenter: (S) => r.value = B
1796
- }, L(v), 47, xa))), 128))
1797
- ])) : T("", !0)
1801
+ style: O(r.value === b ? { backgroundColor: "color-mix(in srgb, var(--fc-color-primary, #3b82f6) 8%, white)", color: "var(--fc-color-primary, #3b82f6)" } : {}),
1802
+ onMousedown: J((m) => y(V), ["prevent"]),
1803
+ onMouseenter: (m) => r.value = b
1804
+ }, A(V), 47, xa))), 128))
1805
+ ])) : I("", !0)
1798
1806
  ], 2));
1799
1807
  }
1800
1808
  }), wa = ["value", "rows", "maxlength", "placeholder", "disabled", "readonly", "aria-disabled", "aria-readonly"], $a = /* @__PURE__ */ j({
@@ -1809,52 +1817,52 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1809
1817
  readonly: { type: Boolean, default: !1 }
1810
1818
  },
1811
1819
  emits: ["update:modelValue", "blur", "focus"],
1812
- setup(e, { emit: u }) {
1813
- const t = e, a = u, s = K(), o = D(null), d = x(
1820
+ setup(e, { emit: i }) {
1821
+ const a = e, t = i, u = K(), n = M(null), c = x(
1814
1822
  () => [
1815
1823
  "w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
1816
1824
  "placeholder:text-gray-400 resize-y",
1817
1825
  "focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-textarea-input",
1818
1826
  "transition-colors duration-200",
1819
- t.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
1820
- t.autoResize ? "resize-none overflow-hidden" : "",
1821
- s.classes.value.input
1827
+ a.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
1828
+ a.autoResize ? "resize-none overflow-hidden" : "",
1829
+ u.classes.value.input
1822
1830
  ].filter(Boolean).join(" ")
1823
1831
  );
1824
1832
  function l() {
1825
- if (!t.autoResize || !o.value) return;
1826
- const r = o.value;
1833
+ if (!a.autoResize || !n.value) return;
1834
+ const r = n.value;
1827
1835
  r.style.height = "auto", r.style.height = `${r.scrollHeight}px`;
1828
1836
  }
1829
- function n(r) {
1830
- const i = r.target;
1831
- a("update:modelValue", i.value), t.autoResize && ae(l);
1837
+ function o(r) {
1838
+ const s = r.target;
1839
+ t("update:modelValue", s.value), a.autoResize && te(l);
1832
1840
  }
1833
- return J(
1834
- () => t.modelValue,
1841
+ return W(
1842
+ () => a.modelValue,
1835
1843
  () => {
1836
- t.autoResize && ae(l);
1844
+ a.autoResize && te(l);
1837
1845
  }
1838
- ), ue(() => {
1839
- t.autoResize && l();
1840
- }), (r, i) => (c(), f("textarea", {
1846
+ ), de(() => {
1847
+ a.autoResize && l();
1848
+ }), (r, s) => (d(), f("textarea", {
1841
1849
  ref_key: "textareaRef",
1842
- ref: o,
1850
+ ref: n,
1843
1851
  value: e.modelValue,
1844
1852
  rows: e.rows,
1845
1853
  maxlength: e.maxLength,
1846
1854
  placeholder: e.placeholder,
1847
1855
  disabled: e.disabled,
1848
1856
  readonly: e.readonly,
1849
- class: F(d.value),
1857
+ class: T(c.value),
1850
1858
  "aria-disabled": e.disabled || void 0,
1851
1859
  "aria-readonly": e.readonly || void 0,
1852
- onInput: n,
1853
- onBlur: i[0] || (i[0] = (k) => a("blur", k)),
1854
- onFocus: i[1] || (i[1] = (k) => a("focus", k))
1860
+ onInput: o,
1861
+ onBlur: s[0] || (s[0] = (k) => t("blur", k)),
1862
+ onFocus: s[1] || (s[1] = (k) => t("focus", k))
1855
1863
  }, null, 42, wa));
1856
1864
  }
1857
- }), Ca = /* @__PURE__ */ oe($a, [["__scopeId", "data-v-67f80d90"]]), Va = {
1865
+ }), Ca = /* @__PURE__ */ ne($a, [["__scopeId", "data-v-67f80d90"]]), Va = {
1858
1866
  key: 0,
1859
1867
  class: "flex items-stretch"
1860
1868
  }, Sa = {
@@ -1877,41 +1885,41 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1877
1885
  mask: {}
1878
1886
  },
1879
1887
  emits: ["update:modelValue", "blur", "focus"],
1880
- setup(e, { emit: u }) {
1881
- const t = e, a = u, s = K(), o = x(() => !!t.prefix || !!t.suffix), d = x(
1888
+ setup(e, { emit: i }) {
1889
+ const a = e, t = i, u = K(), n = x(() => !!a.prefix || !!a.suffix), c = x(
1882
1890
  () => [
1883
1891
  "w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm",
1884
1892
  "placeholder:text-gray-400",
1885
1893
  "focus:outline-none focus:ring-2 focus:ring-blue-500/20 fc-text-input",
1886
1894
  "transition-colors duration-200",
1887
- t.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
1888
- t.prefix ? "rounded-l-none" : "",
1889
- t.suffix ? "rounded-r-none" : "",
1890
- s.classes.value.input
1895
+ a.disabled ? "opacity-50 cursor-not-allowed bg-gray-100" : "",
1896
+ a.prefix ? "rounded-l-none" : "",
1897
+ a.suffix ? "rounded-r-none" : "",
1898
+ u.classes.value.input
1891
1899
  ].filter(Boolean).join(" ")
1892
1900
  );
1893
- function l(n) {
1894
- const r = n.target;
1895
- a("update:modelValue", r.value);
1901
+ function l(o) {
1902
+ const r = o.target;
1903
+ t("update:modelValue", r.value);
1896
1904
  }
1897
- return (n, r) => o.value ? (c(), f("div", Va, [
1898
- e.prefix ? (c(), f("span", Sa, L(e.prefix), 1)) : T("", !0),
1899
- p("input", {
1905
+ return (o, r) => n.value ? (d(), f("div", Va, [
1906
+ e.prefix ? (d(), f("span", Sa, A(e.prefix), 1)) : I("", !0),
1907
+ h("input", {
1900
1908
  type: e.inputType,
1901
1909
  value: e.modelValue,
1902
1910
  placeholder: e.placeholder,
1903
1911
  maxlength: e.maxLength,
1904
1912
  disabled: e.disabled,
1905
1913
  readonly: e.readonly,
1906
- class: F(d.value),
1914
+ class: T(c.value),
1907
1915
  "aria-disabled": e.disabled || void 0,
1908
1916
  "aria-readonly": e.readonly || void 0,
1909
1917
  onInput: l,
1910
- onBlur: r[0] || (r[0] = (i) => a("blur", i)),
1911
- onFocus: r[1] || (r[1] = (i) => a("focus", i))
1918
+ onBlur: r[0] || (r[0] = (s) => t("blur", s)),
1919
+ onFocus: r[1] || (r[1] = (s) => t("focus", s))
1912
1920
  }, null, 42, Ba),
1913
- e.suffix ? (c(), f("span", Fa, L(e.suffix), 1)) : T("", !0)
1914
- ])) : (c(), f("input", {
1921
+ e.suffix ? (d(), f("span", Fa, A(e.suffix), 1)) : I("", !0)
1922
+ ])) : (d(), f("input", {
1915
1923
  key: 1,
1916
1924
  type: e.inputType,
1917
1925
  value: e.modelValue,
@@ -1919,15 +1927,15 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1919
1927
  maxlength: e.maxLength,
1920
1928
  disabled: e.disabled,
1921
1929
  readonly: e.readonly,
1922
- class: F(d.value),
1930
+ class: T(c.value),
1923
1931
  "aria-disabled": e.disabled || void 0,
1924
1932
  "aria-readonly": e.readonly || void 0,
1925
1933
  onInput: l,
1926
- onBlur: r[2] || (r[2] = (i) => a("blur", i)),
1927
- onFocus: r[3] || (r[3] = (i) => a("focus", i))
1934
+ onBlur: r[2] || (r[2] = (s) => t("blur", s)),
1935
+ onFocus: r[3] || (r[3] = (s) => t("focus", s))
1928
1936
  }, null, 42, Ta));
1929
1937
  }
1930
- }), La = /* @__PURE__ */ oe(Ia, [["__scopeId", "data-v-a42b4343"]]), Aa = {
1938
+ }), La = /* @__PURE__ */ ne(Ia, [["__scopeId", "data-v-a42b4343"]]), Aa = {
1931
1939
  key: 0,
1932
1940
  class: "mb-1.5 flex items-center gap-1"
1933
1941
  }, Na = ["for"], Da = {
@@ -1938,7 +1946,7 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1938
1946
  key: 0,
1939
1947
  role: "tooltip",
1940
1948
  class: "absolute bottom-full left-1/2 z-10 mb-2 -translate-x-1/2 rounded-md bg-gray-900 px-3 py-1.5 text-xs text-white shadow-lg whitespace-nowrap"
1941
- }, Ra = ["id"], ja = ["id"], za = /* @__PURE__ */ j({
1949
+ }, Ra = ["id"], ja = ["id"], Oa = /* @__PURE__ */ j({
1942
1950
  __name: "BaseField",
1943
1951
  props: {
1944
1952
  fieldSchema: {},
@@ -1947,59 +1955,59 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
1947
1955
  touched: { type: Boolean, default: !1 }
1948
1956
  },
1949
1957
  setup(e) {
1950
- const u = e, t = q(ye), a = q(pe), s = D(!1), o = x(() => {
1951
- if (t) {
1952
- const g = t.t(u.fieldName, "label");
1953
- if (g) return g;
1958
+ const i = e, a = Y(pe), t = Y(ge), u = M(!1), n = x(() => {
1959
+ if (a) {
1960
+ const S = a.t(i.fieldName, "label");
1961
+ if (S) return S;
1954
1962
  }
1955
- return u.fieldSchema.label ?? u.fieldName;
1956
- }), d = x(() => {
1957
- if (t) {
1958
- const g = t.t(u.fieldName, "helpText");
1959
- if (g) return g;
1963
+ return i.fieldSchema.label ?? i.fieldName;
1964
+ }), c = x(() => {
1965
+ if (a) {
1966
+ const S = a.t(i.fieldName, "helpText");
1967
+ if (S) return S;
1960
1968
  }
1961
- return u.fieldSchema.helpText ?? "";
1969
+ return i.fieldSchema.helpText ?? "";
1962
1970
  }), l = x(() => {
1963
- if (t) {
1964
- const g = t.t(u.fieldName, "tooltip");
1965
- if (g) return g;
1971
+ if (a) {
1972
+ const S = a.t(i.fieldName, "tooltip");
1973
+ if (S) return S;
1966
1974
  }
1967
- return u.fieldSchema.tooltip ?? "";
1968
- }), n = x(() => u.touched && u.errors.length > 0), r = x(() => [
1969
- (a == null ? void 0 : a.classes.value.field) ?? "fc-field",
1970
- u.fieldSchema.className ?? "",
1971
- u.fieldSchema.disabled ? "opacity-50 cursor-not-allowed" : "",
1972
- u.fieldSchema.readOnly ? "fc-readonly" : ""
1973
- ]), i = x(() => `fc-field-${u.fieldName}`), k = x(() => `fc-error-${u.fieldName}`);
1974
- return (g, $) => {
1975
- var m, C;
1976
- return c(), f("div", {
1977
- class: F([r.value, "relative mb-4"]),
1978
- style: z(e.fieldSchema.style)
1975
+ return i.fieldSchema.tooltip ?? "";
1976
+ }), o = x(() => i.touched && i.errors.length > 0), r = x(() => [
1977
+ (t == null ? void 0 : t.classes.value.field) ?? "fc-field",
1978
+ i.fieldSchema.className ?? "",
1979
+ i.fieldSchema.disabled ? "opacity-50 cursor-not-allowed" : "",
1980
+ i.fieldSchema.readOnly ? "fc-readonly" : ""
1981
+ ]), s = x(() => `fc-field-${i.fieldName}`), k = x(() => `fc-error-${i.fieldName}`);
1982
+ return (S, F) => {
1983
+ var y, v;
1984
+ return d(), f("div", {
1985
+ class: T([r.value, "relative mb-4"]),
1986
+ style: O(e.fieldSchema.style)
1979
1987
  }, [
1980
- e.fieldSchema.type !== "hidden" ? (c(), f("div", Aa, [
1981
- p("label", {
1982
- for: i.value,
1983
- class: F([((m = H(a)) == null ? void 0 : m.classes.value.label) ?? "fc-label", "block text-sm font-medium text-gray-700"])
1988
+ e.fieldSchema.type !== "hidden" ? (d(), f("div", Aa, [
1989
+ h("label", {
1990
+ for: s.value,
1991
+ class: T([((y = q(t)) == null ? void 0 : y.classes.value.label) ?? "fc-label", "block text-sm font-medium text-gray-700"])
1984
1992
  }, [
1985
- _(L(o.value) + " ", 1),
1986
- e.fieldSchema.required ? (c(), f("span", Da, "*")) : T("", !0)
1993
+ Q(A(n.value) + " ", 1),
1994
+ e.fieldSchema.required ? (d(), f("span", Da, "*")) : I("", !0)
1987
1995
  ], 10, Na),
1988
- l.value ? (c(), f("span", {
1996
+ l.value ? (d(), f("span", {
1989
1997
  key: 0,
1990
1998
  class: "relative inline-flex",
1991
- onMouseenter: $[0] || ($[0] = (h) => s.value = !0),
1992
- onMouseleave: $[1] || ($[1] = (h) => s.value = !1),
1993
- onFocusin: $[2] || ($[2] = (h) => s.value = !0),
1994
- onFocusout: $[3] || ($[3] = (h) => s.value = !1)
1999
+ onMouseenter: F[0] || (F[0] = (g) => u.value = !0),
2000
+ onMouseleave: F[1] || (F[1] = (g) => u.value = !1),
2001
+ onFocusin: F[2] || (F[2] = (g) => u.value = !0),
2002
+ onFocusout: F[3] || (F[3] = (g) => u.value = !1)
1995
2003
  }, [
1996
- p("button", {
2004
+ h("button", {
1997
2005
  type: "button",
1998
2006
  class: "inline-flex h-4 w-4 items-center justify-center rounded-full bg-gray-200 text-gray-500 text-xs hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40",
1999
2007
  "aria-label": `Info: ${l.value}`,
2000
2008
  tabindex: "0"
2001
2009
  }, " i ", 8, Ma),
2002
- Z(le, {
2010
+ Z(ae, {
2003
2011
  "enter-active-class": "motion-safe:transition motion-safe:duration-200 motion-safe:ease-out",
2004
2012
  "enter-from-class": "opacity-0 scale-95",
2005
2013
  "enter-to-class": "opacity-100 scale-100",
@@ -2007,18 +2015,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2007
2015
  "leave-from-class": "opacity-100 scale-100",
2008
2016
  "leave-to-class": "opacity-0 scale-95"
2009
2017
  }, {
2010
- default: W(() => [
2011
- s.value ? (c(), f("div", Ea, [
2012
- _(L(l.value) + " ", 1),
2013
- $[4] || ($[4] = p("div", { class: "absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900" }, null, -1))
2014
- ])) : T("", !0)
2018
+ default: _(() => [
2019
+ u.value ? (d(), f("div", Ea, [
2020
+ Q(A(l.value) + " ", 1),
2021
+ F[4] || (F[4] = h("div", { class: "absolute left-1/2 top-full -translate-x-1/2 border-4 border-transparent border-t-gray-900" }, null, -1))
2022
+ ])) : I("", !0)
2015
2023
  ]),
2016
2024
  _: 1
2017
2025
  })
2018
- ], 32)) : T("", !0)
2019
- ])) : T("", !0),
2020
- p("div", { id: i.value }, [
2021
- De(g.$slots, "default")
2026
+ ], 32)) : I("", !0)
2027
+ ])) : I("", !0),
2028
+ h("div", { id: s.value }, [
2029
+ De(S.$slots, "default")
2022
2030
  ], 8, Ra),
2023
2031
  Z(Me, {
2024
2032
  tag: "div",
@@ -2030,27 +2038,27 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2030
2038
  "leave-to-class": "opacity-0 -translate-y-1 max-h-0",
2031
2039
  class: ""
2032
2040
  }, {
2033
- default: W(() => [
2034
- (c(!0), f(O, null, G(n.value ? e.errors : [], (h, y) => {
2035
- var A;
2036
- return c(), f("p", {
2037
- key: h + y,
2038
- id: y === 0 ? k.value : void 0,
2039
- class: F([((A = H(a)) == null ? void 0 : A.classes.value.error) ?? "fc-error", "mt-1 text-xs text-red-500"]),
2041
+ default: _(() => [
2042
+ (d(!0), f(z, null, G(o.value ? e.errors : [], (g, p) => {
2043
+ var N;
2044
+ return d(), f("p", {
2045
+ key: g + p,
2046
+ id: p === 0 ? k.value : void 0,
2047
+ class: T([((N = q(t)) == null ? void 0 : N.classes.value.error) ?? "fc-error", "mt-1 text-xs text-red-500"]),
2040
2048
  role: "alert"
2041
- }, L(h), 11, ja);
2049
+ }, A(g), 11, ja);
2042
2050
  }), 128))
2043
2051
  ]),
2044
2052
  _: 1
2045
2053
  }),
2046
- d.value && !n.value ? (c(), f("p", {
2054
+ c.value && !o.value ? (d(), f("p", {
2047
2055
  key: 1,
2048
- class: F([((C = H(a)) == null ? void 0 : C.classes.value.helpText) ?? "fc-help-text", "mt-1 text-xs text-gray-400"])
2049
- }, L(d.value), 3)) : T("", !0)
2056
+ class: T([((v = q(t)) == null ? void 0 : v.classes.value.helpText) ?? "fc-help-text", "mt-1 text-xs text-gray-400"])
2057
+ }, A(c.value), 3)) : I("", !0)
2050
2058
  ], 6);
2051
2059
  };
2052
2060
  }
2053
- }), Oa = {
2061
+ }), za = {
2054
2062
  key: 1,
2055
2063
  class: "rounded-md border border-dashed border-amber-400 bg-amber-50 px-3 py-2 text-xs text-amber-700"
2056
2064
  }, $e = /* @__PURE__ */ j({
@@ -2059,68 +2067,68 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2059
2067
  name: {}
2060
2068
  },
2061
2069
  setup(e) {
2062
- const u = e, t = q(ce);
2063
- if (!t)
2070
+ const i = e, a = Y(fe);
2071
+ if (!a)
2064
2072
  throw new Error(
2065
2073
  "FormField must be used inside a FormBuilder (FormContextKey not provided)"
2066
2074
  );
2067
- const a = q(
2075
+ const t = a, u = Y(
2068
2076
  Be,
2069
2077
  null
2070
- ), s = x(
2071
- () => P(t.schema.fields).find((m) => m.name === u.name)
2072
- ), o = x(() => {
2073
- var h;
2074
- const m = s.value;
2075
- if (!m) return;
2076
- const C = (h = a == null ? void 0 : a.value) == null ? void 0 : h[m.type];
2077
- return C || Ke(m.type);
2078
- }), d = x(() => t.values[u.name]), l = x(() => t.errors[u.name] ?? []), n = x(() => t.touched[u.name] ?? !1), r = x(() => {
2079
- const m = s.value;
2080
- return m ? m.condition ? se(m.condition, t.values) : typeof m.visible == "function" ? m.visible({
2081
- values: { ...t.values },
2082
- getFieldValue: (C) => t.values[C]
2083
- }) : m.visible ?? !0 : !1;
2084
- }), i = x(() => {
2085
- const m = s.value;
2086
- return m ? typeof m.disabled == "function" ? m.disabled({
2078
+ ), n = x(
2079
+ () => U(t.schema.fields).find((v) => v.name === i.name)
2080
+ ), c = x(() => {
2081
+ var p;
2082
+ const v = n.value;
2083
+ if (!v) return;
2084
+ const g = (p = u == null ? void 0 : u.value) == null ? void 0 : p[v.type];
2085
+ return g || Ke(v.type);
2086
+ }), l = x(() => t.values[i.name]), o = x(() => t.errors[i.name] ?? []), r = x(() => t.touched[i.name] ?? !1), s = x(() => {
2087
+ const v = n.value;
2088
+ return v ? v.condition ? ie(v.condition, t.values) : typeof v.visible == "function" ? v.visible({
2087
2089
  values: { ...t.values },
2088
- getFieldValue: (C) => t.values[C]
2089
- }) : m.disabled ?? !1 : !1;
2090
+ getFieldValue: (g) => t.values[g]
2091
+ }) : v.visible ?? !0 : !1;
2090
2092
  }), k = x(() => {
2091
- const m = s.value;
2092
- if (!m) return {};
2093
+ const v = n.value;
2094
+ return v ? typeof v.disabled == "function" ? v.disabled({
2095
+ values: { ...t.values },
2096
+ getFieldValue: (g) => t.values[g]
2097
+ }) : v.disabled ?? !1 : !1;
2098
+ }), S = x(() => {
2099
+ const v = n.value;
2100
+ if (!v) return {};
2093
2101
  const {
2094
- name: C,
2095
- label: h,
2096
- helpText: y,
2097
- tooltip: A,
2098
- condition: V,
2099
- translations: b,
2100
- meta: v,
2101
- rules: B,
2102
- visible: S,
2103
- className: N,
2104
- style: R,
2105
- defaultValue: Q,
2106
- ...ee
2107
- } = m;
2102
+ name: g,
2103
+ label: p,
2104
+ helpText: N,
2105
+ tooltip: B,
2106
+ condition: C,
2107
+ translations: V,
2108
+ meta: b,
2109
+ rules: m,
2110
+ visible: w,
2111
+ className: D,
2112
+ style: P,
2113
+ defaultValue: re,
2114
+ ...se
2115
+ } = v;
2108
2116
  return {
2109
- ...ee,
2110
- modelValue: d.value,
2111
- disabled: i.value,
2112
- readonly: m.readOnly ?? !1,
2113
- placeholder: m.placeholder ?? ""
2117
+ ...se,
2118
+ modelValue: l.value,
2119
+ disabled: k.value,
2120
+ readonly: v.readOnly ?? !1,
2121
+ placeholder: v.placeholder ?? ""
2114
2122
  };
2115
2123
  });
2116
- function g(m) {
2117
- t.setFieldValue(u.name, m);
2124
+ function F(v) {
2125
+ t.setFieldValue(i.name, v);
2118
2126
  }
2119
- function $() {
2120
- var m;
2121
- t.touched[u.name] = !0, ((m = t.schema.settings) == null ? void 0 : m.validateOnBlur) !== !1 && t.validateField(u.name);
2127
+ function y() {
2128
+ var v;
2129
+ t.touched[i.name] = !0, ((v = t.schema.settings) == null ? void 0 : v.validateOnBlur) !== !1 && t.validateField(i.name);
2122
2130
  }
2123
- return (m, C) => (c(), U(le, {
2131
+ return (v, g) => (d(), H(ae, {
2124
2132
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",
2125
2133
  "enter-from-class": "opacity-0 max-h-0",
2126
2134
  "enter-to-class": "opacity-100 max-h-96",
@@ -2128,24 +2136,24 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2128
2136
  "leave-from-class": "opacity-100 max-h-96",
2129
2137
  "leave-to-class": "opacity-0 max-h-0"
2130
2138
  }, {
2131
- default: W(() => [
2132
- r.value && s.value ? (c(), U(za, {
2139
+ default: _(() => [
2140
+ s.value && n.value ? (d(), H(Oa, {
2133
2141
  key: 0,
2134
- "field-schema": s.value,
2142
+ "field-schema": n.value,
2135
2143
  "field-name": e.name,
2136
- errors: l.value,
2137
- touched: n.value
2144
+ errors: o.value,
2145
+ touched: r.value
2138
2146
  }, {
2139
- default: W(() => [
2140
- o.value ? (c(), U(Se(o.value), Ee({ key: 0 }, k.value, {
2141
- "aria-invalid": n.value && l.value.length > 0 ? !0 : void 0,
2142
- "aria-describedby": n.value && l.value.length > 0 ? `fc-error-${e.name}` : void 0,
2143
- "onUpdate:modelValue": g,
2144
- onBlur: $
2145
- }), null, 16, ["aria-invalid", "aria-describedby"])) : (c(), f("div", Oa, ' No component registered for field type "' + L(s.value.type) + '" ', 1))
2147
+ default: _(() => [
2148
+ c.value ? (d(), H(Se(c.value), Ee({ key: 0 }, S.value, {
2149
+ "aria-invalid": r.value && o.value.length > 0 ? !0 : void 0,
2150
+ "aria-describedby": r.value && o.value.length > 0 ? `fc-error-${e.name}` : void 0,
2151
+ "onUpdate:modelValue": F,
2152
+ onBlur: y
2153
+ }), null, 16, ["aria-invalid", "aria-describedby"])) : (d(), f("div", za, ' No component registered for field type "' + A(n.value.type) + '" ', 1))
2146
2154
  ]),
2147
2155
  _: 1
2148
- }, 8, ["field-schema", "field-name", "errors", "touched"])) : T("", !0)
2156
+ }, 8, ["field-schema", "field-name", "errors", "touched"])) : I("", !0)
2149
2157
  ]),
2150
2158
  _: 1
2151
2159
  }));
@@ -2160,19 +2168,19 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2160
2168
  className: {}
2161
2169
  },
2162
2170
  setup(e) {
2163
- return (u, t) => (c(), f("div", {
2164
- class: F([e.className ?? "", "relative my-4"]),
2171
+ return (i, a) => (d(), f("div", {
2172
+ class: T([e.className ?? "", "relative my-4"]),
2165
2173
  role: "separator"
2166
2174
  }, [
2167
- t[0] || (t[0] = p("div", {
2175
+ a[0] || (a[0] = h("div", {
2168
2176
  class: "absolute inset-0 flex items-center",
2169
2177
  "aria-hidden": "true"
2170
2178
  }, [
2171
- p("div", { class: "w-full border-t border-gray-200" })
2179
+ h("div", { class: "w-full border-t border-gray-200" })
2172
2180
  ], -1)),
2173
- e.label ? (c(), f("div", Ka, [
2174
- p("span", Pa, L(e.label), 1)
2175
- ])) : T("", !0)
2181
+ e.label ? (d(), f("div", Ka, [
2182
+ h("span", Pa, A(e.label), 1)
2183
+ ])) : I("", !0)
2176
2184
  ], 2));
2177
2185
  }
2178
2186
  }), Ha = ["aria-labelledby"], Ga = {
@@ -2192,53 +2200,53 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2192
2200
  className: {}
2193
2201
  },
2194
2202
  setup(e) {
2195
- const u = e, t = D(u.collapsed);
2196
- function a() {
2197
- u.collapsible && (t.value = !t.value);
2203
+ const i = e, a = M(i.collapsed);
2204
+ function t() {
2205
+ i.collapsible && (a.value = !a.value);
2198
2206
  }
2199
- const s = x(
2200
- () => u.title ? `fc-group-${u.title.toLowerCase().replace(/\s+/g, "-")}` : void 0
2207
+ const u = x(
2208
+ () => i.title ? `fc-group-${i.title.toLowerCase().replace(/\s+/g, "-")}` : void 0
2201
2209
  );
2202
- return (o, d) => (c(), f("fieldset", {
2203
- class: F([[e.className ?? ""], "rounded-lg border border-gray-200 bg-white"]),
2204
- "aria-labelledby": s.value
2210
+ return (n, c) => (d(), f("fieldset", {
2211
+ class: T([[e.className ?? ""], "rounded-lg border border-gray-200 bg-white"]),
2212
+ "aria-labelledby": u.value
2205
2213
  }, [
2206
- e.title || e.description ? (c(), f("div", Ga, [
2207
- (c(), U(Se(e.collapsible ? "button" : "div"), {
2214
+ e.title || e.description ? (d(), f("div", Ga, [
2215
+ (d(), H(Se(e.collapsible ? "button" : "div"), {
2208
2216
  type: e.collapsible ? "button" : void 0,
2209
- class: F(["flex w-full items-center justify-between text-left", e.collapsible ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded" : ""]),
2210
- "aria-expanded": e.collapsible ? !t.value : void 0,
2211
- "aria-controls": e.collapsible ? `fc-group-body-${s.value}` : void 0,
2212
- onClick: a
2217
+ class: T(["flex w-full items-center justify-between text-left", e.collapsible ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-blue-500/40 rounded" : ""]),
2218
+ "aria-expanded": e.collapsible ? !a.value : void 0,
2219
+ "aria-controls": e.collapsible ? `fc-group-body-${u.value}` : void 0,
2220
+ onClick: t
2213
2221
  }, {
2214
- default: W(() => [
2215
- p("div", null, [
2216
- e.title ? (c(), f("legend", {
2222
+ default: _(() => [
2223
+ h("div", null, [
2224
+ e.title ? (d(), f("legend", {
2217
2225
  key: 0,
2218
- id: s.value,
2226
+ id: u.value,
2219
2227
  class: "text-sm font-semibold text-gray-800"
2220
- }, L(e.title), 9, Za)) : T("", !0),
2221
- e.description ? (c(), f("p", qa, L(e.description), 1)) : T("", !0)
2228
+ }, A(e.title), 9, Za)) : I("", !0),
2229
+ e.description ? (d(), f("p", qa, A(e.description), 1)) : I("", !0)
2222
2230
  ]),
2223
- e.collapsible ? (c(), f("svg", {
2231
+ e.collapsible ? (d(), f("svg", {
2224
2232
  key: 0,
2225
- class: F(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200", t.value ? "" : "rotate-180"]),
2233
+ class: T(["h-4 w-4 shrink-0 text-gray-400 motion-safe:transition-transform motion-safe:duration-200", a.value ? "" : "rotate-180"]),
2226
2234
  xmlns: "http://www.w3.org/2000/svg",
2227
2235
  viewBox: "0 0 20 20",
2228
2236
  fill: "currentColor",
2229
2237
  "aria-hidden": "true"
2230
- }, [...d[0] || (d[0] = [
2231
- p("path", {
2238
+ }, [...c[0] || (c[0] = [
2239
+ h("path", {
2232
2240
  "fill-rule": "evenodd",
2233
2241
  d: "M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",
2234
2242
  "clip-rule": "evenodd"
2235
2243
  }, null, -1)
2236
- ])], 2)) : T("", !0)
2244
+ ])], 2)) : I("", !0)
2237
2245
  ]),
2238
2246
  _: 1
2239
2247
  }, 8, ["type", "class", "aria-expanded", "aria-controls"]))
2240
- ])) : T("", !0),
2241
- Z(le, {
2248
+ ])) : I("", !0),
2249
+ Z(ae, {
2242
2250
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-300 motion-safe:ease-out",
2243
2251
  "enter-from-class": "max-h-0 opacity-0 overflow-hidden",
2244
2252
  "enter-to-class": "max-h-[2000px] opacity-100 overflow-hidden",
@@ -2246,14 +2254,14 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2246
2254
  "leave-from-class": "max-h-[2000px] opacity-100 overflow-hidden",
2247
2255
  "leave-to-class": "max-h-0 opacity-0 overflow-hidden"
2248
2256
  }, {
2249
- default: W(() => [
2250
- de(p("div", {
2251
- id: e.collapsible ? `fc-group-body-${s.value}` : void 0,
2257
+ default: _(() => [
2258
+ ce(h("div", {
2259
+ id: e.collapsible ? `fc-group-body-${u.value}` : void 0,
2252
2260
  class: "p-4"
2253
2261
  }, [
2254
- Z(re, { nodes: e.children }, null, 8, ["nodes"])
2262
+ Z(oe, { nodes: e.children }, null, 8, ["nodes"])
2255
2263
  ], 8, Ya), [
2256
- [Re, !t.value]
2264
+ [Re, !a.value]
2257
2265
  ])
2258
2266
  ]),
2259
2267
  _: 1
@@ -2267,10 +2275,10 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2267
2275
  className: {}
2268
2276
  },
2269
2277
  setup(e) {
2270
- const u = e, t = x(() => Ae(u.content));
2271
- return (a, s) => (c(), f("div", {
2272
- class: F([e.className ?? "", "fc-html prose prose-sm max-w-none text-gray-700"]),
2273
- innerHTML: t.value
2278
+ const i = e, a = x(() => Ae(i.content));
2279
+ return (t, u) => (d(), f("div", {
2280
+ class: T([e.className ?? "", "fc-html prose prose-sm max-w-none text-gray-700"]),
2281
+ innerHTML: a.value
2274
2282
  }, null, 10, Wa));
2275
2283
  }
2276
2284
  }), Qa = /* @__PURE__ */ j({
@@ -2282,18 +2290,18 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2282
2290
  className: {}
2283
2291
  },
2284
2292
  setup(e) {
2285
- const u = e, t = x(() => ({
2293
+ const i = e, a = x(() => ({
2286
2294
  start: "items-start",
2287
2295
  center: "items-center",
2288
2296
  end: "items-end",
2289
2297
  stretch: "items-stretch"
2290
- })[u.align] ?? "items-stretch"), a = x(() => u.gap ? typeof u.gap == "number" ? `${u.gap}px` : u.gap : "");
2291
- return (s, o) => (c(), f("div", {
2292
- class: F(["grid grid-cols-12", [t.value, e.className ?? ""]]),
2293
- style: z(a.value ? { gap: a.value } : { gap: "1rem" }),
2298
+ })[i.align] ?? "items-stretch"), t = x(() => i.gap ? typeof i.gap == "number" ? `${i.gap}px` : i.gap : "");
2299
+ return (u, n) => (d(), f("div", {
2300
+ class: T(["grid grid-cols-12", [a.value, e.className ?? ""]]),
2301
+ style: O(t.value ? { gap: t.value } : { gap: "1rem" }),
2294
2302
  role: "group"
2295
2303
  }, [
2296
- Z(re, { nodes: e.children }, null, 8, ["nodes"])
2304
+ Z(oe, { nodes: e.children }, null, 8, ["nodes"])
2297
2305
  ], 6));
2298
2306
  }
2299
2307
  }), Xa = {
@@ -2323,84 +2331,84 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2323
2331
  className: {}
2324
2332
  },
2325
2333
  setup(e) {
2326
- const u = e, t = q(ce), a = D(0), s = D(/* @__PURE__ */ new Set()), o = x(() => u.steps), d = x(() => o.value.length), l = x(() => a.value === 0), n = x(() => a.value === d.value - 1);
2327
- function r(m) {
2328
- const C = [];
2329
- function h(y) {
2330
- for (const A of y)
2331
- if (Ce(A))
2332
- C.push(A.name);
2333
- else if (A.type === "row" || A.type === "group")
2334
- h(A.children);
2335
- else if (A.type === "steps")
2336
- for (const V of A.steps) h(V.children);
2337
- else if (A.type === "tabs")
2338
- for (const V of A.tabs) h(V.children);
2334
+ const i = e, a = Y(fe), t = M(0), u = M(/* @__PURE__ */ new Set()), n = x(() => i.steps), c = x(() => n.value.length), l = x(() => t.value === 0), o = x(() => t.value === c.value - 1);
2335
+ function r(y) {
2336
+ const v = [];
2337
+ function g(p) {
2338
+ for (const N of p)
2339
+ if (Ce(N))
2340
+ v.push(N.name);
2341
+ else if (N.type === "row" || N.type === "group")
2342
+ g(N.children);
2343
+ else if (N.type === "steps")
2344
+ for (const B of N.steps) g(B.children);
2345
+ else if (N.type === "tabs")
2346
+ for (const B of N.tabs) g(B.children);
2339
2347
  }
2340
- return h(m.children), C;
2341
- }
2342
- async function i() {
2343
- if (!t || !u.linear) return !0;
2344
- const m = o.value[a.value];
2345
- if (!m) return !0;
2346
- const C = r(m);
2347
- let h = !0;
2348
- for (const y of C) {
2349
- const A = await t.validateField(y);
2350
- t.touched[y] = !0, A.length > 0 && (h = !1);
2348
+ return g(y.children), v;
2349
+ }
2350
+ async function s() {
2351
+ if (!a || !i.linear) return !0;
2352
+ const y = n.value[t.value];
2353
+ if (!y) return !0;
2354
+ const v = r(y);
2355
+ let g = !0;
2356
+ for (const p of v) {
2357
+ const N = await a.validateField(p);
2358
+ a.touched[p] = !0, N.length > 0 && (g = !1);
2351
2359
  }
2352
- return h;
2360
+ return g;
2353
2361
  }
2354
2362
  async function k() {
2355
- n.value || u.linear && !await i() || (s.value.add(a.value), a.value++);
2363
+ o.value || i.linear && !await s() || (u.value.add(t.value), t.value++);
2356
2364
  }
2357
- function g() {
2358
- l.value || a.value--;
2365
+ function S() {
2366
+ l.value || t.value--;
2359
2367
  }
2360
- function $(m) {
2361
- u.linear && m > a.value || (a.value = m);
2368
+ function F(y) {
2369
+ i.linear && y > t.value || (t.value = y);
2362
2370
  }
2363
- return (m, C) => (c(), f("div", {
2364
- class: F([e.className ?? "", "space-y-6"])
2371
+ return (y, v) => (d(), f("div", {
2372
+ class: T([e.className ?? "", "space-y-6"])
2365
2373
  }, [
2366
- p("nav", Xa, [
2367
- p("ol", el, [
2368
- (c(!0), f(O, null, G(o.value, (h, y) => (c(), f("li", {
2369
- key: y,
2374
+ h("nav", Xa, [
2375
+ h("ol", el, [
2376
+ (d(!0), f(z, null, G(n.value, (g, p) => (d(), f("li", {
2377
+ key: p,
2370
2378
  class: "flex items-center"
2371
2379
  }, [
2372
- p("button", {
2380
+ h("button", {
2373
2381
  type: "button",
2374
- disabled: e.linear && y > a.value,
2375
- "aria-current": y === a.value ? "step" : void 0,
2376
- "aria-label": `Step ${y + 1}: ${h.title}`,
2377
- class: F(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40", [
2378
- s.value.has(y) && y !== a.value ? "border-green-500 bg-green-500 text-white" : y !== a.value ? "border-gray-300 bg-white text-gray-500" : "text-white",
2379
- e.linear && y > a.value ? "cursor-not-allowed" : "cursor-pointer hover:shadow-md"
2382
+ disabled: e.linear && p > t.value,
2383
+ "aria-current": p === t.value ? "step" : void 0,
2384
+ "aria-label": `Step ${p + 1}: ${g.title}`,
2385
+ class: T(["relative flex h-8 w-8 shrink-0 items-center justify-center rounded-full border-2 text-xs font-semibold motion-safe:transition-all motion-safe:duration-300 focus:outline-none focus:ring-2 focus:ring-blue-500/40", [
2386
+ u.value.has(p) && p !== t.value ? "border-green-500 bg-green-500 text-white" : p !== t.value ? "border-gray-300 bg-white text-gray-500" : "text-white",
2387
+ e.linear && p > t.value ? "cursor-not-allowed" : "cursor-pointer hover:shadow-md"
2380
2388
  ]]),
2381
- style: z(y === a.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
2382
- onClick: (A) => $(y)
2389
+ style: O(p === t.value ? { borderColor: "var(--fc-color-primary, #3b82f6)", backgroundColor: "var(--fc-color-primary, #3b82f6)" } : {}),
2390
+ onClick: (N) => F(p)
2383
2391
  }, [
2384
- s.value.has(y) && y !== a.value ? (c(), f("svg", al, [...C[0] || (C[0] = [
2385
- p("path", {
2392
+ u.value.has(p) && p !== t.value ? (d(), f("svg", al, [...v[0] || (v[0] = [
2393
+ h("path", {
2386
2394
  "fill-rule": "evenodd",
2387
2395
  d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",
2388
2396
  "clip-rule": "evenodd"
2389
2397
  }, null, -1)
2390
- ])])) : (c(), f("span", ll, L(y + 1), 1))
2398
+ ])])) : (d(), f("span", ll, A(p + 1), 1))
2391
2399
  ], 14, tl),
2392
- y < o.value.length - 1 ? (c(), f("div", {
2400
+ p < n.value.length - 1 ? (d(), f("div", {
2393
2401
  key: 0,
2394
- class: F(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12", s.value.has(y) ? "bg-green-500" : "bg-gray-200"])
2395
- }, null, 2)) : T("", !0)
2402
+ class: T(["mx-1 h-0.5 w-8 motion-safe:transition-colors motion-safe:duration-300 sm:w-12", u.value.has(p) ? "bg-green-500" : "bg-gray-200"])
2403
+ }, null, 2)) : I("", !0)
2396
2404
  ]))), 128))
2397
2405
  ])
2398
2406
  ]),
2399
- o.value[a.value] ? (c(), f("div", nl, [
2400
- p("h3", ol, L(o.value[a.value].title), 1),
2401
- o.value[a.value].description ? (c(), f("p", rl, L(o.value[a.value].description), 1)) : T("", !0)
2402
- ])) : T("", !0),
2403
- Z(le, {
2407
+ n.value[t.value] ? (d(), f("div", nl, [
2408
+ h("h3", ol, A(n.value[t.value].title), 1),
2409
+ n.value[t.value].description ? (d(), f("p", rl, A(n.value[t.value].description), 1)) : I("", !0)
2410
+ ])) : I("", !0),
2411
+ Z(ae, {
2404
2412
  mode: "out-in",
2405
2413
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out",
2406
2414
  "enter-from-class": "opacity-0 translate-x-2",
@@ -2409,24 +2417,24 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2409
2417
  "leave-from-class": "opacity-100 translate-x-0",
2410
2418
  "leave-to-class": "opacity-0 -translate-x-2"
2411
2419
  }, {
2412
- default: W(() => [
2413
- o.value[a.value] ? (c(), f("div", { key: a.value }, [
2414
- Z(re, {
2415
- nodes: o.value[a.value].children
2420
+ default: _(() => [
2421
+ n.value[t.value] ? (d(), f("div", { key: t.value }, [
2422
+ Z(oe, {
2423
+ nodes: n.value[t.value].children
2416
2424
  }, null, 8, ["nodes"])
2417
- ])) : T("", !0)
2425
+ ])) : I("", !0)
2418
2426
  ]),
2419
2427
  _: 1
2420
2428
  }),
2421
- p("div", sl, [
2422
- p("button", {
2429
+ h("div", sl, [
2430
+ h("button", {
2423
2431
  type: "button",
2424
2432
  disabled: l.value,
2425
2433
  class: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50 fc-steps-prev-btn",
2426
- onClick: g
2434
+ onClick: S
2427
2435
  }, " Previous ", 8, il),
2428
- p("span", ul, L(a.value + 1) + " / " + L(d.value), 1),
2429
- n.value ? (c(), f("div", dl)) : (c(), f("button", {
2436
+ h("span", ul, A(t.value + 1) + " / " + A(c.value), 1),
2437
+ o.value ? (d(), f("div", dl)) : (d(), f("button", {
2430
2438
  key: 0,
2431
2439
  type: "button",
2432
2440
  class: "rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 fc-steps-next-btn",
@@ -2451,57 +2459,57 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2451
2459
  className: {}
2452
2460
  },
2453
2461
  setup(e) {
2454
- const u = e, t = D(0), a = x(() => u.tabs);
2455
- function s(l) {
2456
- const n = a.value[l];
2457
- n != null && n.disabled || (t.value = l);
2458
- }
2459
- function o(l, n) {
2460
- var g;
2461
- const r = a.value.length;
2462
- let i = n;
2462
+ const i = e, a = M(0), t = x(() => i.tabs);
2463
+ function u(l) {
2464
+ const o = t.value[l];
2465
+ o != null && o.disabled || (a.value = l);
2466
+ }
2467
+ function n(l, o) {
2468
+ var S;
2469
+ const r = t.value.length;
2470
+ let s = o;
2463
2471
  if (l.key === "ArrowRight" || l.key === "ArrowDown")
2464
- l.preventDefault(), i = (n + 1) % r;
2472
+ l.preventDefault(), s = (o + 1) % r;
2465
2473
  else if (l.key === "ArrowLeft" || l.key === "ArrowUp")
2466
- l.preventDefault(), i = (n - 1 + r) % r;
2474
+ l.preventDefault(), s = (o - 1 + r) % r;
2467
2475
  else if (l.key === "Home")
2468
- l.preventDefault(), i = 0;
2476
+ l.preventDefault(), s = 0;
2469
2477
  else if (l.key === "End")
2470
- l.preventDefault(), i = r - 1;
2478
+ l.preventDefault(), s = r - 1;
2471
2479
  else
2472
2480
  return;
2473
- for (; (g = a.value[i]) != null && g.disabled && i !== n; )
2474
- l.key === "ArrowLeft" || l.key === "ArrowUp" ? i = (i - 1 + r) % r : i = (i + 1) % r;
2475
- s(i);
2476
- const k = document.getElementById(`fc-tab-${i}`);
2481
+ for (; (S = t.value[s]) != null && S.disabled && s !== o; )
2482
+ l.key === "ArrowLeft" || l.key === "ArrowUp" ? s = (s - 1 + r) % r : s = (s + 1) % r;
2483
+ u(s);
2484
+ const k = document.getElementById(`fc-tab-${s}`);
2477
2485
  k == null || k.focus();
2478
2486
  }
2479
- const d = x(() => `fc-tabpanel-${t.value}`);
2480
- return (l, n) => (c(), f("div", {
2481
- class: F(e.className ?? "")
2487
+ const c = x(() => `fc-tabpanel-${a.value}`);
2488
+ return (l, o) => (d(), f("div", {
2489
+ class: T(e.className ?? "")
2482
2490
  }, [
2483
- p("div", fl, [
2484
- (c(!0), f(O, null, G(a.value, (r, i) => (c(), f("button", {
2485
- key: i,
2486
- id: `fc-tab-${i}`,
2491
+ h("div", fl, [
2492
+ (d(!0), f(z, null, G(t.value, (r, s) => (d(), f("button", {
2493
+ key: s,
2494
+ id: `fc-tab-${s}`,
2487
2495
  type: "button",
2488
2496
  role: "tab",
2489
- "aria-selected": i === t.value,
2490
- "aria-controls": d.value,
2497
+ "aria-selected": s === a.value,
2498
+ "aria-controls": c.value,
2491
2499
  "aria-disabled": r.disabled || void 0,
2492
- tabindex: i === t.value ? 0 : -1,
2493
- class: F(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40", [
2494
- i !== t.value ? r.disabled ? "cursor-not-allowed text-gray-300" : "text-gray-500 hover:text-gray-700" : ""
2500
+ tabindex: s === a.value ? 0 : -1,
2501
+ class: T(["relative px-4 py-2.5 text-sm font-medium motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500/40", [
2502
+ s !== a.value ? r.disabled ? "cursor-not-allowed text-gray-300" : "text-gray-500 hover:text-gray-700" : ""
2495
2503
  ]]),
2496
- style: z(i === t.value ? { color: "var(--fc-color-primary, #3b82f6)" } : {}),
2497
- onClick: (k) => s(i),
2498
- onKeydown: (k) => o(k, i)
2504
+ style: O(s === a.value ? { color: "var(--fc-color-primary, #3b82f6)" } : {}),
2505
+ onClick: (k) => u(s),
2506
+ onKeydown: (k) => n(k, s)
2499
2507
  }, [
2500
- _(L(r.title) + " ", 1),
2501
- i === t.value ? (c(), f("span", bl)) : T("", !0)
2508
+ Q(A(r.title) + " ", 1),
2509
+ s === a.value ? (d(), f("span", bl)) : I("", !0)
2502
2510
  ], 46, ml))), 128))
2503
2511
  ]),
2504
- Z(le, {
2512
+ Z(ae, {
2505
2513
  mode: "out-in",
2506
2514
  "enter-active-class": "motion-safe:transition-all motion-safe:duration-200 motion-safe:ease-out",
2507
2515
  "enter-from-class": "opacity-0 translate-y-1",
@@ -2510,65 +2518,65 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2510
2518
  "leave-from-class": "opacity-100 translate-y-0",
2511
2519
  "leave-to-class": "opacity-0 -translate-y-1"
2512
2520
  }, {
2513
- default: W(() => [
2514
- a.value[t.value] ? (c(), f("div", {
2515
- key: t.value,
2516
- id: d.value,
2521
+ default: _(() => [
2522
+ t.value[a.value] ? (d(), f("div", {
2523
+ key: a.value,
2524
+ id: c.value,
2517
2525
  role: "tabpanel",
2518
- "aria-labelledby": `fc-tab-${t.value}`,
2526
+ "aria-labelledby": `fc-tab-${a.value}`,
2519
2527
  tabindex: "0",
2520
2528
  class: "pt-4"
2521
2529
  }, [
2522
- Z(re, {
2523
- nodes: a.value[t.value].children
2530
+ Z(oe, {
2531
+ nodes: t.value[a.value].children
2524
2532
  }, null, 8, ["nodes"])
2525
- ], 8, vl)) : T("", !0)
2533
+ ], 8, vl)) : I("", !0)
2526
2534
  ]),
2527
2535
  _: 1
2528
2536
  })
2529
2537
  ], 2));
2530
2538
  }
2531
- }), re = /* @__PURE__ */ j({
2539
+ }), oe = /* @__PURE__ */ j({
2532
2540
  __name: "LayoutRenderer",
2533
2541
  props: {
2534
2542
  nodes: {}
2535
2543
  },
2536
2544
  setup(e) {
2537
- const u = q(ce);
2538
- function t(s) {
2539
- return u ? se(s.condition, u.values) : !0;
2545
+ const i = Y(fe);
2546
+ function a(u) {
2547
+ return i ? ie(u.condition, i.values) : !0;
2540
2548
  }
2541
- function a(s) {
2542
- return s === "full" ? { gridColumn: "1 / -1" } : s === "auto" ? { gridColumn: "auto" } : typeof s == "number" ? { gridColumn: `span ${s} / span ${s}` } : { gridColumn: "span 12 / span 12" };
2549
+ function t(u) {
2550
+ return u === "full" ? { gridColumn: "1 / -1" } : u === "auto" ? { gridColumn: "auto" } : typeof u == "number" ? { gridColumn: `span ${u} / span ${u}` } : { gridColumn: "span 12 / span 12" };
2543
2551
  }
2544
- return (s, o) => {
2545
- const d = je("LayoutRenderer", !0);
2546
- return c(!0), f(O, null, G(e.nodes, (l, n) => {
2552
+ return (u, n) => {
2553
+ const c = je("LayoutRenderer", !0);
2554
+ return d(!0), f(z, null, G(e.nodes, (l, o) => {
2547
2555
  var r;
2548
- return c(), f(O, { key: n }, [
2549
- H(Ce)(l) ? (c(), f("div", {
2556
+ return d(), f(z, { key: o }, [
2557
+ q(Ce)(l) ? (d(), f("div", {
2550
2558
  key: 0,
2551
- class: F(l.className ?? ""),
2552
- style: z(a(l.span))
2559
+ class: T(l.className ?? ""),
2560
+ style: O(t(l.span))
2553
2561
  }, [
2554
2562
  Z($e, {
2555
2563
  name: l.name
2556
2564
  }, null, 8, ["name"])
2557
- ], 6)) : l.type === "field" ? (c(), f("div", {
2565
+ ], 6)) : l.type === "field" ? (d(), f("div", {
2558
2566
  key: 1,
2559
- class: F(l.className ?? ""),
2560
- style: z(a(l.span))
2567
+ class: T(l.className ?? ""),
2568
+ style: O(t(l.span))
2561
2569
  }, [
2562
2570
  Z($e, {
2563
2571
  name: l.name
2564
2572
  }, null, 8, ["name"])
2565
- ], 6)) : l.type === "row" ? (c(), U(Qa, {
2573
+ ], 6)) : l.type === "row" ? (d(), H(Qa, {
2566
2574
  key: 2,
2567
2575
  children: l.children,
2568
2576
  gap: l.gap,
2569
2577
  align: l.align,
2570
2578
  "class-name": l.className
2571
- }, null, 8, ["children", "gap", "align", "class-name"])) : l.type === "group" ? (c(), U(Ja, {
2579
+ }, null, 8, ["children", "gap", "align", "class-name"])) : l.type === "group" ? (d(), H(Ja, {
2572
2580
  key: 3,
2573
2581
  title: l.title,
2574
2582
  description: l.description,
@@ -2576,32 +2584,32 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2576
2584
  collapsed: l.collapsed,
2577
2585
  children: l.children,
2578
2586
  "class-name": l.className
2579
- }, null, 8, ["title", "description", "collapsible", "collapsed", "children", "class-name"])) : l.type === "steps" ? (c(), U(cl, {
2587
+ }, null, 8, ["title", "description", "collapsible", "collapsed", "children", "class-name"])) : l.type === "steps" ? (d(), H(cl, {
2580
2588
  key: 4,
2581
2589
  steps: l.steps,
2582
2590
  linear: l.linear,
2583
2591
  "class-name": l.className
2584
- }, null, 8, ["steps", "linear", "class-name"])) : l.type === "tabs" ? (c(), U(yl, {
2592
+ }, null, 8, ["steps", "linear", "class-name"])) : l.type === "tabs" ? (d(), H(yl, {
2585
2593
  key: 5,
2586
2594
  tabs: l.tabs,
2587
2595
  "class-name": l.className
2588
- }, null, 8, ["tabs", "class-name"])) : l.type === "divider" ? (c(), U(Ua, {
2596
+ }, null, 8, ["tabs", "class-name"])) : l.type === "divider" ? (d(), H(Ua, {
2589
2597
  key: 6,
2590
2598
  label: l.label,
2591
2599
  "class-name": l.className
2592
- }, null, 8, ["label", "class-name"])) : l.type === "html" ? (c(), U(_a, {
2600
+ }, null, 8, ["label", "class-name"])) : l.type === "html" ? (d(), H(_a, {
2593
2601
  key: 7,
2594
2602
  content: l.content,
2595
2603
  "class-name": l.className
2596
- }, null, 8, ["content", "class-name"])) : l.type === "conditional" ? (c(), f(O, { key: 8 }, [
2597
- t(l) ? (c(), U(d, {
2604
+ }, null, 8, ["content", "class-name"])) : l.type === "conditional" ? (d(), f(z, { key: 8 }, [
2605
+ a(l) ? (d(), H(c, {
2598
2606
  key: 0,
2599
2607
  nodes: l.children
2600
- }, null, 8, ["nodes"])) : (r = l.elseChildren) != null && r.length ? (c(), U(d, {
2608
+ }, null, 8, ["nodes"])) : (r = l.elseChildren) != null && r.length ? (d(), H(c, {
2601
2609
  key: 1,
2602
2610
  nodes: l.elseChildren
2603
- }, null, 8, ["nodes"])) : T("", !0)
2604
- ], 64)) : T("", !0)
2611
+ }, null, 8, ["nodes"])) : I("", !0)
2612
+ ], 64)) : I("", !0)
2605
2613
  ], 64);
2606
2614
  }), 128);
2607
2615
  };
@@ -2631,10 +2639,10 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2631
2639
  components: {}
2632
2640
  },
2633
2641
  emits: ["submit", "error", "update:modelValue"],
2634
- setup(e, { expose: u, emit: t }) {
2635
- const a = e, s = t, o = q(Te, void 0), d = x(() => a.theme ?? (o == null ? void 0 : o.theme)), l = x(() => a.locale ?? (o == null ? void 0 : o.locale) ?? "en"), n = x(
2636
- () => a.fallbackLocale ?? (o == null ? void 0 : o.fallbackLocale) ?? "en"
2637
- ), r = x(() => a.components ?? (o == null ? void 0 : o.components) ?? {}), i = [
2642
+ setup(e, { expose: i, emit: a }) {
2643
+ const t = e, u = a, n = Y(Te, void 0), c = x(() => t.theme ?? (n == null ? void 0 : n.theme)), l = x(() => t.locale ?? (n == null ? void 0 : n.locale) ?? "en"), o = x(
2644
+ () => t.fallbackLocale ?? (n == null ? void 0 : n.fallbackLocale) ?? "en"
2645
+ ), r = x(() => t.components ?? (n == null ? void 0 : n.components) ?? {}), s = [
2638
2646
  ["text", La],
2639
2647
  ["number", Lt],
2640
2648
  ["textarea", Ca],
@@ -2649,106 +2657,127 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2649
2657
  ["tags", ka],
2650
2658
  ["phone", Gt]
2651
2659
  ];
2652
- for (const [b, v] of i)
2653
- Pe(b) || Fe(b, v);
2654
- ie(Be, r), tt(d);
2655
- const k = K(), g = et(a.schema, {
2660
+ for (const [b, m] of s)
2661
+ Pe(b) || Fe(b, m);
2662
+ ue(Be, r), tt(c);
2663
+ const k = K();
2664
+ function S(b) {
2665
+ return b.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
2666
+ }
2667
+ const F = x(() => {
2668
+ const b = c.value;
2669
+ if (!b) return {};
2670
+ const m = {};
2671
+ if (b.colors)
2672
+ for (const [w, D] of Object.entries(b.colors))
2673
+ D && (m[`--fc-color-${S(w)}`] = D);
2674
+ if (b.borders)
2675
+ for (const [w, D] of Object.entries(b.borders))
2676
+ D && (m[`--fc-border-${S(w)}`] = D);
2677
+ if (b.spacing)
2678
+ for (const [w, D] of Object.entries(b.spacing))
2679
+ D && (m[`--fc-${S(w)}`] = D);
2680
+ if (b.typography)
2681
+ for (const [w, D] of Object.entries(b.typography))
2682
+ D && (m[`--fc-${S(w)}`] = D);
2683
+ return b.cssVars && Object.assign(m, b.cssVars), m;
2684
+ }), y = et(t.schema, {
2656
2685
  locale: l.value,
2657
- fallbackLocale: n.value
2686
+ fallbackLocale: o.value
2658
2687
  });
2659
- if (a.modelValue)
2660
- for (const [b, v] of Object.entries(a.modelValue))
2661
- g.setFieldValue(b, v);
2662
- J(
2663
- () => a.modelValue,
2688
+ if (t.modelValue)
2689
+ for (const [b, m] of Object.entries(t.modelValue))
2690
+ y.setFieldValue(b, m);
2691
+ W(
2692
+ () => t.modelValue,
2664
2693
  (b) => {
2665
2694
  if (b)
2666
- for (const [v, B] of Object.entries(b))
2667
- g.values[v] !== B && g.setFieldValue(v, B);
2695
+ for (const [m, w] of Object.entries(b))
2696
+ y.values[m] !== w && y.setFieldValue(m, w);
2668
2697
  },
2669
2698
  { deep: !0 }
2670
- ), J(
2671
- () => ({ ...g.values }),
2699
+ ), W(
2700
+ () => ({ ...y.values }),
2672
2701
  (b) => {
2673
- s("update:modelValue", b);
2702
+ u("update:modelValue", b);
2674
2703
  },
2675
2704
  { deep: !0 }
2676
- ), J(l, (b) => {
2677
- b && g.setLocale(b);
2705
+ ), W(l, (b) => {
2706
+ b && y.setLocale(b);
2678
2707
  }), Ze();
2679
- const $ = x(() => {
2680
- var S, N;
2681
- const b = a.schema.translations;
2708
+ const v = x(() => {
2709
+ var D, P;
2710
+ const b = t.schema.translations;
2682
2711
  if (!b) return "";
2683
- const v = b[l.value];
2684
- if ((S = v == null ? void 0 : v.messages) != null && S.title) return v.messages.title;
2685
- const B = b[n.value];
2686
- return ((N = B == null ? void 0 : B.messages) == null ? void 0 : N.title) ?? "";
2687
- }), m = x(() => {
2688
- var S, N;
2689
- const b = a.schema.translations;
2712
+ const m = b[l.value];
2713
+ if ((D = m == null ? void 0 : m.messages) != null && D.title) return m.messages.title;
2714
+ const w = b[o.value];
2715
+ return ((P = w == null ? void 0 : w.messages) == null ? void 0 : P.title) ?? "";
2716
+ }), g = x(() => {
2717
+ var D, P;
2718
+ const b = t.schema.translations;
2690
2719
  if (!b) return "";
2691
- const v = b[l.value];
2692
- if ((S = v == null ? void 0 : v.messages) != null && S.description) return v.messages.description;
2693
- const B = b[n.value];
2694
- return ((N = B == null ? void 0 : B.messages) == null ? void 0 : N.description) ?? "";
2695
- }), C = x(() => {
2696
- const b = a.schema.translations;
2720
+ const m = b[l.value];
2721
+ if ((D = m == null ? void 0 : m.messages) != null && D.description) return m.messages.description;
2722
+ const w = b[o.value];
2723
+ return ((P = w == null ? void 0 : w.messages) == null ? void 0 : P.description) ?? "";
2724
+ }), p = x(() => {
2725
+ const b = t.schema.translations;
2697
2726
  if (!b) return "Submit";
2698
- const v = b[l.value];
2699
- if (v != null && v.submit) return v.submit;
2700
- const B = b[n.value];
2701
- return (B == null ? void 0 : B.submit) ?? "Submit";
2702
- }), h = x(() => {
2703
- const b = a.schema.translations;
2727
+ const m = b[l.value];
2728
+ if (m != null && m.submit) return m.submit;
2729
+ const w = b[o.value];
2730
+ return (w == null ? void 0 : w.submit) ?? "Submit";
2731
+ }), N = x(() => {
2732
+ const b = t.schema.translations;
2704
2733
  if (!b) return "Reset";
2705
- const v = b[l.value];
2706
- if (v != null && v.reset) return v.reset;
2707
- const B = b[n.value];
2708
- return (B == null ? void 0 : B.reset) ?? "Reset";
2709
- }), y = x(() => {
2710
- var b, v;
2711
- return (v = (b = a.layout) == null ? void 0 : b.nodes) != null && v.length ? a.layout.nodes : a.schema.fields;
2734
+ const m = b[l.value];
2735
+ if (m != null && m.reset) return m.reset;
2736
+ const w = b[o.value];
2737
+ return (w == null ? void 0 : w.reset) ?? "Reset";
2738
+ }), B = x(() => {
2739
+ var b, m;
2740
+ return (m = (b = t.layout) == null ? void 0 : b.nodes) != null && m.length ? t.layout.nodes : t.schema.fields;
2712
2741
  });
2713
- async function A() {
2742
+ async function C() {
2714
2743
  try {
2715
- await g.submit(async (b) => {
2716
- s("submit", b);
2744
+ await y.submit(async (b) => {
2745
+ u("submit", b);
2717
2746
  });
2718
2747
  } catch (b) {
2719
- s("error", b);
2748
+ u("error", b);
2720
2749
  }
2721
2750
  }
2722
2751
  function V() {
2723
- g.reset();
2752
+ y.reset();
2724
2753
  }
2725
- return u({ form: g }), (b, v) => (c(), f("form", {
2726
- class: F([H(k).classes.value.form, "fc-form-builder"]),
2727
- style: z(H(k).cssVars.value),
2754
+ return i({ form: y }), (b, m) => (d(), f("form", {
2755
+ class: T([q(k).classes.value.form, "fc-form-builder"]),
2756
+ style: O(F.value),
2728
2757
  novalidate: "",
2729
- onSubmit: Y(A, ["prevent"]),
2730
- onReset: Y(V, ["prevent"])
2758
+ onSubmit: J(C, ["prevent"]),
2759
+ onReset: J(V, ["prevent"])
2731
2760
  }, [
2732
- $.value || m.value ? (c(), f("div", pl, [
2733
- $.value ? (c(), f("h2", gl, L($.value), 1)) : T("", !0),
2734
- m.value ? (c(), f("p", hl, L(m.value), 1)) : T("", !0)
2735
- ])) : T("", !0),
2736
- Z(re, { nodes: y.value }, null, 8, ["nodes"]),
2737
- p("div", xl, [
2738
- p("button", {
2761
+ v.value || g.value ? (d(), f("div", pl, [
2762
+ v.value ? (d(), f("h2", gl, A(v.value), 1)) : I("", !0),
2763
+ g.value ? (d(), f("p", hl, A(g.value), 1)) : I("", !0)
2764
+ ])) : I("", !0),
2765
+ Z(oe, { nodes: B.value }, null, 8, ["nodes"]),
2766
+ h("div", xl, [
2767
+ h("button", {
2739
2768
  type: "submit",
2740
- disabled: H(g).isSubmitting.value,
2741
- class: F([H(k).classes.value.button, "fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),
2769
+ disabled: q(y).isSubmitting.value,
2770
+ class: T([q(k).classes.value.button, "fc-submit-btn rounded-md px-4 py-2 text-sm font-medium text-white motion-safe:transition-colors motion-safe:duration-150 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"]),
2742
2771
  style: { "background-color": "var(--fc-color-primary, #3b82f6)" }
2743
2772
  }, [
2744
- H(g).isSubmitting.value ? (c(), f("span", wl)) : T("", !0),
2745
- _(" " + L(C.value), 1)
2773
+ q(y).isSubmitting.value ? (d(), f("span", wl)) : I("", !0),
2774
+ Q(" " + A(p.value), 1)
2746
2775
  ], 10, kl),
2747
- p("button", {
2776
+ h("button", {
2748
2777
  type: "reset",
2749
- disabled: H(g).isSubmitting.value,
2778
+ disabled: q(y).isSubmitting.value,
2750
2779
  class: "rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 motion-safe:transition-colors motion-safe:duration-150 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500/40 disabled:cursor-not-allowed disabled:opacity-50"
2751
- }, L(h.value), 9, $l)
2780
+ }, A(N.value), 9, $l)
2752
2781
  ])
2753
2782
  ], 38));
2754
2783
  }
@@ -2756,8 +2785,8 @@ const lt = ["checked", "disabled", "onChange"], nt = ["aria-checked", "aria-disa
2756
2785
  export {
2757
2786
  Il as FormBuilder,
2758
2787
  Be as FormComponentsKey,
2759
- ce as FormContextKey,
2760
- ye as FormI18nKey,
2788
+ fe as FormContextKey,
2789
+ pe as FormI18nKey,
2761
2790
  Te as FormaticaKey,
2762
2791
  Tl as createFormatica,
2763
2792
  Ke as getFieldComponent,