inertia-bootstrap-forms 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,29 +1,29 @@
1
- import * as Ke from "vue";
2
- import { defineComponent as V, createElementBlock as v, openBlock as c, normalizeClass as D, renderSlot as F, createElementVNode as m, createCommentVNode as B, toDisplayString as O, computed as C, withDirectives as te, vModelText as nt, normalizeStyle as oe, ref as E, onMounted as Z, watch as z, vModelDynamic as $e, createTextVNode as Y, shallowRef as dt, onBeforeUnmount as ft, nextTick as K, Fragment as X, renderList as ee, reactive as ye, resolveComponent as re, createBlock as be, mergeProps as je, withModifiers as Xe, provide as Ae, inject as ce, withCtx as Pe, createVNode as Ge, h as ct, vModelCheckbox as mt } from "vue";
3
- import { _ as q, f as j, u as R } from "./chunks/_plugin-vue_export-helper-13TPlHFF.js";
4
- import { u as G, a as De, l as Oe, c as pt } from "./chunks/http-DV3dRBe5.js";
5
- import { useForm as ht } from "@inertiajs/vue3";
6
- const vt = "۰۱۲۳۴۵۶۷۸۹", gt = "٠١٢٣٤٥٦٧٨٩";
7
- function Ue(e) {
8
- return String(e ?? "").replace(/[۰-۹٠-٩]/g, (t) => {
9
- const o = vt.indexOf(t);
10
- return String(o !== -1 ? o : gt.indexOf(t));
1
+ import * as xe from "vue";
2
+ import { defineComponent as F, createElementBlock as h, openBlock as m, normalizeClass as q, renderSlot as j, createElementVNode as p, createCommentVNode as M, toDisplayString as V, computed as C, withDirectives as re, vModelText as sn, normalizeStyle as se, ref as E, onMounted as J, watch as H, vModelDynamic as ke, createTextVNode as _, shallowRef as yn, onBeforeUnmount as un, nextTick as W, Fragment as G, renderList as ae, reactive as ie, resolveComponent as oe, createBlock as le, mergeProps as Ke, withModifiers as _e, provide as Ve, inject as pe, withCtx as Qe, createVNode as Ne, h as bn, vModelCheckbox as $n, Teleport as wn } from "vue";
3
+ import { _ as L, f as z, u as U } from "./chunks/_plugin-vue_export-helper-13TPlHFF.js";
4
+ import { u as Q, a as Le, l as De, c as kn } from "./chunks/http-DV3dRBe5.js";
5
+ import { useForm as Sn } from "@inertiajs/vue3";
6
+ const In = "۰۱۲۳۴۵۶۷۸۹", Cn = "٠١٢٣٤٥٦٧٨٩";
7
+ function Je(e) {
8
+ return String(e ?? "").replace(/[۰-۹٠-٩]/g, (n) => {
9
+ const a = In.indexOf(n);
10
+ return String(a !== -1 ? a : Cn.indexOf(n));
11
11
  });
12
12
  }
13
- function Ne(e) {
13
+ function qe(e) {
14
14
  if (e == null || e === "") return "";
15
- const t = Number(e);
16
- return Number.isNaN(t) ? "" : t.toLocaleString("en-US");
15
+ const n = Number(e);
16
+ return Number.isNaN(n) ? "" : n.toLocaleString("en-US");
17
17
  }
18
- function lt(e) {
19
- const t = Ue(e).replace(/\D/g, "");
20
- return t === "" ? null : parseInt(t, 10);
18
+ function dn(e) {
19
+ const n = Je(e).replace(/\D/g, "");
20
+ return n === "" ? null : parseInt(n, 10);
21
21
  }
22
- const yt = V({
22
+ const Tn = F({
23
23
  name: "AmountInput",
24
24
  emits: ["update:modelValue", "change", "input", "focus", "blur"],
25
25
  props: {
26
- ...j,
26
+ ...z,
27
27
  placeholder: { type: String, default: null },
28
28
  unit: { type: String, default: null },
29
29
  min: { type: Number, default: null },
@@ -32,34 +32,34 @@ const yt = V({
32
32
  size: { type: String, default: null },
33
33
  locale: { type: String, default: null }
34
34
  },
35
- setup(e, { emit: t }) {
36
- const o = R(e, t), { t: l } = G(() => e.locale), d = C(() => Ne(o.model.value)), u = C(() => e.unit ?? l("amount.unit")), n = C(() => e.size ? `form-control-${e.size}` : null);
37
- function p(b) {
38
- const w = b.target, $ = w.value.slice(0, w.selectionStart ?? 0), k = Ue($).replace(/\D/g, "").length, M = lt(w.value);
39
- o.model.value = M;
40
- const r = Ne(M);
41
- w.value = r;
42
- let s = 0, i = 0;
43
- for (; s < r.length && i < k; )
44
- /\d/.test(r[s]) && i++, s++;
45
- document.activeElement === w && w.setSelectionRange(s, s), t("input", M, b);
35
+ setup(e, { emit: n }) {
36
+ const a = U(e, n), { t: l } = Q(() => e.locale), c = C(() => qe(a.model.value)), i = C(() => e.unit ?? l("amount.unit")), t = C(() => e.size ? `form-control-${e.size}` : null);
37
+ function u($) {
38
+ const y = $.target, b = y.value.slice(0, y.selectionStart ?? 0), w = Je(b).replace(/\D/g, "").length, T = dn(y.value);
39
+ a.model.value = T;
40
+ const o = qe(T);
41
+ y.value = o;
42
+ let r = 0, s = 0;
43
+ for (; r < o.length && s < w; )
44
+ /\d/.test(o[r]) && s++, r++;
45
+ document.activeElement === y && y.setSelectionRange(r, r), n("input", T, $);
46
46
  }
47
- function h(b) {
48
- let w = o.model.value;
49
- w != null && (e.max !== null && w > e.max && (w = e.max), e.min !== null && w < e.min && (w = e.min), w !== o.model.value && (o.model.value = w)), o.emitChange(w, b);
47
+ function g($) {
48
+ let y = a.model.value;
49
+ y != null && (e.max !== null && y > e.max && (y = e.max), e.min !== null && y < e.min && (y = e.min), y !== a.model.value && (a.model.value = y)), a.emitChange(y, $);
50
50
  }
51
- return { ...o, displayValue: d, unitText: u, sizeClass: n, onInput: p, clamp: h, t: l };
51
+ return { ...a, displayValue: c, unitText: i, sizeClass: t, onInput: u, clamp: g, t: l };
52
52
  }
53
- }), bt = ["name", "id", "value", "placeholder", "required", "readonly", "disabled", "aria-invalid"], $t = {
53
+ }), Mn = ["name", "id", "value", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Bn = {
54
54
  key: 0,
55
55
  class: "input-group-text fanum"
56
56
  };
57
- function wt(e, t, o, l, d, u) {
58
- return c(), v("div", {
59
- class: D(["input-group", { "is-invalid": e.isInvalid }])
57
+ function En(e, n, a, l, c, i) {
58
+ return m(), h("div", {
59
+ class: q(["input-group", { "is-invalid": e.isInvalid }])
60
60
  }, [
61
- F(e.$slots, "prefix"),
62
- m("input", {
61
+ j(e.$slots, "prefix"),
62
+ p("input", {
63
63
  name: e.name,
64
64
  id: e.inputId,
65
65
  value: e.displayValue,
@@ -71,21 +71,21 @@ function wt(e, t, o, l, d, u) {
71
71
  type: "tel",
72
72
  inputmode: "numeric",
73
73
  autocomplete: "off",
74
- class: D(["form-control fanum", [e.sizeClass, e.inputClass, { "is-invalid": e.isInvalid }]]),
75
- onInput: t[0] || (t[0] = (...n) => e.onInput && e.onInput(...n)),
76
- onChange: t[1] || (t[1] = (...n) => e.clamp && e.clamp(...n)),
77
- onFocus: t[2] || (t[2] = (n) => e.$emit("focus", n)),
78
- onBlur: t[3] || (t[3] = (n) => e.$emit("blur", n))
79
- }, null, 42, bt),
80
- e.unitText ? (c(), v("span", $t, O(e.unitText), 1)) : B("", !0),
81
- F(e.$slots, "suffix")
74
+ class: q(["form-control fanum", [e.sizeClass, e.inputClass, { "is-invalid": e.isInvalid }]]),
75
+ onInput: n[0] || (n[0] = (...t) => e.onInput && e.onInput(...t)),
76
+ onChange: n[1] || (n[1] = (...t) => e.clamp && e.clamp(...t)),
77
+ onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
78
+ onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
79
+ }, null, 42, Mn),
80
+ e.unitText ? (m(), h("span", Bn, V(e.unitText), 1)) : M("", !0),
81
+ j(e.$slots, "suffix")
82
82
  ], 2);
83
83
  }
84
- const kt = /* @__PURE__ */ q(yt, [["render", wt]]), St = V({
84
+ const An = /* @__PURE__ */ L(Tn, [["render", En]]), On = F({
85
85
  name: "CaptchaInput",
86
86
  emits: ["update:modelValue", "change", "input", "refresh"],
87
87
  props: {
88
- ...j,
88
+ ...z,
89
89
  name: { type: String, default: "captcha" },
90
90
  /** Endpoint that returns the captcha image. */
91
91
  url: { type: String, default: "/captcha/default" },
@@ -96,34 +96,34 @@ const kt = /* @__PURE__ */ q(yt, [["render", wt]]), St = V({
96
96
  imageHeight: { type: [Number, String], default: 38 },
97
97
  locale: { type: String, default: null }
98
98
  },
99
- setup(e, { emit: t, expose: o }) {
100
- const l = R(e, t), { t: d } = G(() => e.locale), u = De(), n = E(null), p = E(!0);
101
- function h() {
102
- p.value = !0, n.value = `${e.url}${e.url.includes("?") ? "&" : "?"}t=${Date.now()}`, u.timeout(() => {
103
- p.value = !1;
104
- }, 500), t("refresh");
99
+ setup(e, { emit: n, expose: a }) {
100
+ const l = U(e, n), { t: c } = Q(() => e.locale), i = Le(), t = E(null), u = E(!0);
101
+ function g() {
102
+ u.value = !0, t.value = `${e.url}${e.url.includes("?") ? "&" : "?"}t=${Date.now()}`, i.timeout(() => {
103
+ u.value = !1;
104
+ }, 500), n("refresh");
105
105
  }
106
- return Z(h), z(
106
+ return J(g), H(
107
107
  () => {
108
- var b;
109
- return (b = l.form.value) == null ? void 0 : b.processing;
108
+ var $;
109
+ return ($ = l.form.value) == null ? void 0 : $.processing;
110
110
  },
111
- (b, w) => {
112
- e.refreshOnSubmit && w && !b && (l.model.value = null, h());
111
+ ($, y) => {
112
+ e.refreshOnSubmit && y && !$ && (l.model.value = null, g());
113
113
  }
114
- ), o({ refresh: h }), { ...l, t: d, src: n, loading: p, refresh: h };
114
+ ), a({ refresh: g }), { ...l, t: c, src: t, loading: u, refresh: g };
115
115
  }
116
- }), It = ["name", "id", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Ct = ["src", "alt", "width", "height"], Mt = {
116
+ }), Vn = ["name", "id", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Nn = ["src", "alt", "width", "height"], Dn = {
117
117
  key: 1,
118
118
  class: "placeholder-wave w-100",
119
119
  "aria-hidden": "true"
120
- }, Tt = ["disabled", "aria-label"];
121
- function Bt(e, t, o, l, d, u) {
122
- return c(), v("div", {
123
- class: D(["input-group captcha", { "is-invalid": e.isInvalid }])
120
+ }, qn = ["disabled", "aria-label"];
121
+ function Fn(e, n, a, l, c, i) {
122
+ return m(), h("div", {
123
+ class: q(["input-group captcha", { "is-invalid": e.isInvalid }])
124
124
  }, [
125
- te(m("input", {
126
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.model = n),
125
+ re(p("input", {
126
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
127
127
  name: e.name,
128
128
  id: e.inputId,
129
129
  type: "text",
@@ -134,17 +134,17 @@ function Bt(e, t, o, l, d, u) {
134
134
  readonly: e.readonly,
135
135
  disabled: e.isDisabled,
136
136
  "aria-invalid": e.isInvalid || void 0,
137
- class: D(["form-control text-start", { "is-invalid": e.isInvalid }]),
138
- onInput: t[1] || (t[1] = (n) => e.$emit("input", e.model, n)),
139
- onChange: t[2] || (t[2] = (n) => e.emitChange(e.model, n))
140
- }, null, 42, It), [
141
- [nt, e.model]
137
+ class: q(["form-control text-start", { "is-invalid": e.isInvalid }]),
138
+ onInput: n[1] || (n[1] = (t) => e.$emit("input", e.model, t)),
139
+ onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t))
140
+ }, null, 42, Vn), [
141
+ [sn, e.model]
142
142
  ]),
143
- m("span", {
143
+ p("span", {
144
144
  class: "input-group-text p-0 overflow-hidden",
145
- style: oe({ width: e.imageWidth + "px", height: "auto" })
145
+ style: se({ width: e.imageWidth + "px", height: "auto" })
146
146
  }, [
147
- e.src && !e.loading ? (c(), v("img", {
147
+ e.src && !e.loading ? (m(), h("img", {
148
148
  key: 0,
149
149
  src: e.src,
150
150
  alt: e.t("captcha.alt"),
@@ -152,22 +152,22 @@ function Bt(e, t, o, l, d, u) {
152
152
  height: e.imageHeight,
153
153
  class: "captcha-holder",
154
154
  style: { cursor: "pointer", objectFit: "contain" },
155
- onClick: t[3] || (t[3] = (...n) => e.refresh && e.refresh(...n))
156
- }, null, 8, Ct)) : (c(), v("span", Mt, [
157
- m("span", {
155
+ onClick: n[3] || (n[3] = (...t) => e.refresh && e.refresh(...t))
156
+ }, null, 8, Nn)) : (m(), h("span", Dn, [
157
+ p("span", {
158
158
  class: "placeholder w-100",
159
- style: oe({ height: e.imageHeight + "px" })
159
+ style: se({ height: e.imageHeight + "px" })
160
160
  }, null, 4)
161
161
  ]))
162
162
  ], 4),
163
- m("button", {
163
+ p("button", {
164
164
  type: "button",
165
165
  class: "btn-outline theme-secondary btn-icon",
166
166
  disabled: e.isDisabled || e.loading,
167
167
  "aria-label": e.t("captcha.refresh"),
168
- onClick: t[4] || (t[4] = (...n) => e.refresh && e.refresh(...n))
169
- }, t[5] || (t[5] = [
170
- m("svg", {
168
+ onClick: n[4] || (n[4] = (...t) => e.refresh && e.refresh(...t))
169
+ }, n[5] || (n[5] = [
170
+ p("svg", {
171
171
  width: "16",
172
172
  height: "16",
173
173
  viewBox: "0 0 16 16",
@@ -178,31 +178,31 @@ function Bt(e, t, o, l, d, u) {
178
178
  "stroke-linejoin": "round",
179
179
  "aria-hidden": "true"
180
180
  }, [
181
- m("path", { d: "M13.5 3v3.5H10M2.5 13V9.5H6" }),
182
- m("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5" })
181
+ p("path", { d: "M13.5 3v3.5H10M2.5 13V9.5H6" }),
182
+ p("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5" })
183
183
  ], -1)
184
- ]), 8, Tt)
184
+ ]), 8, qn)
185
185
  ], 2);
186
186
  }
187
- const Et = /* @__PURE__ */ q(St, [["render", Bt]]);
188
- function Ve(e, t, o, { type: l = () => e.type } = {}) {
189
- function d() {
187
+ const Ln = /* @__PURE__ */ L(On, [["render", Fn]]);
188
+ function Re(e, n, a, { type: l = () => e.type } = {}) {
189
+ function c() {
190
190
  if (!e.checked) return;
191
- const n = t.model.value;
192
- l() === "radio" ? (n == null || n === "") && (t.model.value = e.value) : Array.isArray(n) ? n.includes(e.value) || (t.model.value = [...n, e.value]) : n || (t.model.value = e.trueValue !== void 0 ? e.trueValue : !0);
191
+ const t = n.model.value;
192
+ l() === "radio" ? (t == null || t === "") && (n.model.value = e.value) : Array.isArray(t) ? t.includes(e.value) || (n.model.value = [...t, e.value]) : t || (n.model.value = e.trueValue !== void 0 ? e.trueValue : !0);
193
193
  }
194
- function u() {
195
- o.value && (o.value.indeterminate = !!e.indeterminate);
194
+ function i() {
195
+ a.value && (a.value.indeterminate = !!e.indeterminate);
196
196
  }
197
- return Z(() => {
198
- d(), u();
199
- }), z(() => e.indeterminate, u), { applyInitialChecked: d };
197
+ return J(() => {
198
+ c(), i();
199
+ }), H(() => e.indeterminate, i), { applyInitialChecked: c };
200
200
  }
201
- const At = V({
201
+ const Rn = F({
202
202
  name: "CheckboxButtonInput",
203
203
  emits: ["update:modelValue", "change", "focus", "blur"],
204
204
  props: {
205
- ...j,
205
+ ...z,
206
206
  type: { type: String, default: "radio", validator: (e) => ["checkbox", "radio"].includes(e) },
207
207
  value: { type: [String, Number, Boolean, Object], default: "yes" },
208
208
  trueValue: { type: null, default: !0 },
@@ -212,19 +212,19 @@ const At = V({
212
212
  variant: { type: String, default: "outline" },
213
213
  theme: { type: String, default: "primary" }
214
214
  },
215
- setup(e, { emit: t }) {
216
- const o = E(null), l = R(e, t, { valued: () => e.value });
217
- return Ve(e, l, o), { ...l, input: o, onChange: (d) => l.emitChange(l.model.value, d) };
215
+ setup(e, { emit: n }) {
216
+ const a = E(null), l = U(e, n, { valued: () => e.value });
217
+ return Re(e, l, a), { ...l, input: a, onChange: (c) => l.emitChange(l.model.value, c) };
218
218
  },
219
219
  expose: ["input"]
220
- }), Ot = ["name", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"];
221
- function Nt(e, t, o, l, d, u) {
222
- return c(), v("label", {
223
- class: D(["btn-check", [`btn-${e.variant}`, `theme-${e.theme}`, { "is-invalid": e.isInvalid, disabled: e.isDisabled }]])
220
+ }), jn = ["name", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"];
221
+ function Pn(e, n, a, l, c, i) {
222
+ return m(), h("label", {
223
+ class: q(["btn-check", [`btn-${e.variant}`, `theme-${e.theme}`, { "is-invalid": e.isInvalid, disabled: e.isDisabled }]])
224
224
  }, [
225
- te(m("input", {
225
+ re(p("input", {
226
226
  ref: "input",
227
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.model = n),
227
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
228
228
  name: e.name,
229
229
  type: e.type,
230
230
  value: e.value,
@@ -234,21 +234,21 @@ function Nt(e, t, o, l, d, u) {
234
234
  disabled: e.isDisabled,
235
235
  "aria-invalid": e.isInvalid || void 0,
236
236
  autocomplete: "off",
237
- class: D({ "is-invalid": e.isInvalid }),
238
- onChange: t[1] || (t[1] = (...n) => e.onChange && e.onChange(...n)),
239
- onFocus: t[2] || (t[2] = (n) => e.$emit("focus", n)),
240
- onBlur: t[3] || (t[3] = (n) => e.$emit("blur", n))
241
- }, null, 42, Ot), [
242
- [$e, e.model]
237
+ class: q({ "is-invalid": e.isInvalid }),
238
+ onChange: n[1] || (n[1] = (...t) => e.onChange && e.onChange(...t)),
239
+ onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
240
+ onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
241
+ }, null, 42, jn), [
242
+ [ke, e.model]
243
243
  ]),
244
- F(e.$slots, "default")
244
+ j(e.$slots, "default")
245
245
  ], 2);
246
246
  }
247
- const Dt = /* @__PURE__ */ q(At, [["render", Nt]]), Vt = V({
247
+ const zn = /* @__PURE__ */ L(Rn, [["render", Pn]]), Un = F({
248
248
  name: "CheckboxInput",
249
249
  emits: ["update:modelValue", "change", "focus", "blur"],
250
250
  props: {
251
- ...j,
251
+ ...z,
252
252
  /** checkbox | radio */
253
253
  type: { type: String, default: "checkbox", validator: (e) => ["checkbox", "radio"].includes(e) },
254
254
  /** Value added to the model (arrays / radios) when this option is checked. */
@@ -260,21 +260,21 @@ const Dt = /* @__PURE__ */ q(At, [["render", Nt]]), Vt = V({
260
260
  indeterminate: { type: Boolean, default: !1 },
261
261
  label: { type: String, default: null }
262
262
  },
263
- setup(e, { emit: t }) {
264
- const o = E(null), l = R(e, t, { valued: () => e.value });
265
- Ve(e, l, o);
266
- function d(u) {
267
- l.emitChange(l.model.value, u);
263
+ setup(e, { emit: n }) {
264
+ const a = E(null), l = U(e, n, { valued: () => e.value });
265
+ Re(e, l, a);
266
+ function c(i) {
267
+ l.emitChange(l.model.value, i);
268
268
  }
269
- return { ...l, input: o, onChange: d };
269
+ return { ...l, input: a, onChange: c };
270
270
  },
271
271
  expose: ["input"]
272
- }), qt = { class: "form-field" }, Ft = ["name", "id", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], Lt = ["for"];
273
- function jt(e, t, o, l, d, u) {
274
- return c(), v("div", qt, [
275
- te(m("input", {
272
+ }), Hn = { class: "form-field" }, Kn = ["name", "id", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], Xn = ["for"];
273
+ function Gn(e, n, a, l, c, i) {
274
+ return m(), h("div", Hn, [
275
+ re(p("input", {
276
276
  ref: "input",
277
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.model = n),
277
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
278
278
  name: e.name,
279
279
  id: e.inputId,
280
280
  type: e.type,
@@ -284,26 +284,26 @@ function jt(e, t, o, l, d, u) {
284
284
  required: e.required,
285
285
  disabled: e.isDisabled,
286
286
  "aria-invalid": e.isInvalid || void 0,
287
- class: D([e.type === "radio" ? "radio" : "check", { "is-invalid": e.isInvalid }]),
288
- onClick: t[1] || (t[1] = (n) => e.readonly && n.preventDefault()),
289
- onChange: t[2] || (t[2] = (...n) => e.onChange && e.onChange(...n)),
290
- onFocus: t[3] || (t[3] = (n) => e.$emit("focus", n)),
291
- onBlur: t[4] || (t[4] = (n) => e.$emit("blur", n))
292
- }, null, 42, Ft), [
293
- [$e, e.model]
287
+ class: q([e.type === "radio" ? "radio" : "check", { "is-invalid": e.isInvalid }]),
288
+ onClick: n[1] || (n[1] = (t) => e.readonly && t.preventDefault()),
289
+ onChange: n[2] || (n[2] = (...t) => e.onChange && e.onChange(...t)),
290
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
291
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
292
+ }, null, 42, Kn), [
293
+ [ke, e.model]
294
294
  ]),
295
- m("label", { for: e.inputId }, [
296
- F(e.$slots, "default", {}, () => [
297
- Y(O(e.label), 1)
295
+ p("label", { for: e.inputId }, [
296
+ j(e.$slots, "default", {}, () => [
297
+ _(V(e.label), 1)
298
298
  ])
299
- ], 8, Lt)
299
+ ], 8, Xn)
300
300
  ]);
301
301
  }
302
- const Rt = /* @__PURE__ */ q(Vt, [["render", jt]]), zt = V({
302
+ const Wn = /* @__PURE__ */ L(Un, [["render", Gn]]), Qn = F({
303
303
  name: "CheckboxToggle",
304
304
  emits: ["update:modelValue", "change", "focus", "blur"],
305
305
  props: {
306
- ...j,
306
+ ...z,
307
307
  type: { type: String, default: "checkbox", validator: (e) => ["checkbox", "radio"].includes(e) },
308
308
  value: { type: [String, Number, Boolean, Object], default: "yes" },
309
309
  trueValue: { type: null, default: !0 },
@@ -314,24 +314,24 @@ const Rt = /* @__PURE__ */ q(Vt, [["render", jt]]), zt = V({
314
314
  formField: { type: Boolean, default: !0 },
315
315
  formFieldCard: { type: Boolean, default: !0 }
316
316
  },
317
- setup(e, { emit: t }) {
318
- const o = E(null), l = R(e, t, { valued: () => e.value });
319
- return Ve(e, l, o), { ...l, input: o, onChange: (d) => l.emitChange(l.model.value, d) };
317
+ setup(e, { emit: n }) {
318
+ const a = E(null), l = U(e, n, { valued: () => e.value });
319
+ return Re(e, l, a), { ...l, input: a, onChange: (c) => l.emitChange(l.model.value, c) };
320
320
  },
321
321
  expose: ["input"]
322
- }), Pt = ["name", "id", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], Ut = ["for"];
323
- function Ht(e, t, o, l, d, u) {
324
- return c(), v("div", {
325
- class: D({
322
+ }), Jn = ["name", "id", "type", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], Zn = ["for"];
323
+ function Yn(e, n, a, l, c, i) {
324
+ return m(), h("div", {
325
+ class: q({
326
326
  "form-field": e.formField,
327
327
  "form-field-card": e.formFieldCard,
328
328
  "is-invalid": e.isInvalid,
329
329
  disabled: e.isDisabled || e.readonly
330
330
  })
331
331
  }, [
332
- te(m("input", {
332
+ re(p("input", {
333
333
  ref: "input",
334
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.model = n),
334
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
335
335
  name: e.name,
336
336
  id: e.inputId,
337
337
  type: e.type,
@@ -341,20 +341,20 @@ function Ht(e, t, o, l, d, u) {
341
341
  required: e.required,
342
342
  disabled: e.isDisabled,
343
343
  "aria-invalid": e.isInvalid || void 0,
344
- class: D([e.type === "radio" ? "radio" : "check", { "is-invalid": e.isInvalid, "visually-hidden": e.hideInput }]),
345
- onClick: t[1] || (t[1] = (n) => e.readonly && n.preventDefault()),
346
- onChange: t[2] || (t[2] = (...n) => e.onChange && e.onChange(...n)),
347
- onFocus: t[3] || (t[3] = (n) => e.$emit("focus", n)),
348
- onBlur: t[4] || (t[4] = (n) => e.$emit("blur", n))
349
- }, null, 42, Pt), [
350
- [$e, e.model]
344
+ class: q([e.type === "radio" ? "radio" : "check", { "is-invalid": e.isInvalid, "visually-hidden": e.hideInput }]),
345
+ onClick: n[1] || (n[1] = (t) => e.readonly && t.preventDefault()),
346
+ onChange: n[2] || (n[2] = (...t) => e.onChange && e.onChange(...t)),
347
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
348
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
349
+ }, null, 42, Jn), [
350
+ [ke, e.model]
351
351
  ]),
352
- m("label", { for: e.inputId }, [
353
- F(e.$slots, "default")
354
- ], 8, Ut)
352
+ p("label", { for: e.inputId }, [
353
+ j(e.$slots, "default")
354
+ ], 8, Zn)
355
355
  ], 2);
356
356
  }
357
- const Kt = /* @__PURE__ */ q(zt, [["render", Ht]]), Re = {}, ge = /* @__PURE__ */ new Map(), We = {
357
+ const xn = /* @__PURE__ */ L(Qn, [["render", Yn]]), Xe = {}, $e = /* @__PURE__ */ new Map(), en = {
358
358
  Combobox: () => import("bootstrap/js/dist/combobox.js"),
359
359
  Menu: () => import("bootstrap/js/dist/menu.js"),
360
360
  Strength: () => import("bootstrap/js/dist/strength.js"),
@@ -362,60 +362,60 @@ const Kt = /* @__PURE__ */ q(zt, [["render", Ht]]), Re = {}, ge = /* @__PURE__ *
362
362
  OtpInput: () => import("bootstrap/js/dist/otp-input.js"),
363
363
  Range: () => import("bootstrap/js/dist/range.js")
364
364
  };
365
- function Xt(e = {}) {
366
- Object.assign(Re, e), ge.clear();
365
+ function _n(e = {}) {
366
+ Object.assign(Xe, e), $e.clear();
367
367
  }
368
- function Gt(e) {
369
- return Re[e] ? Promise.resolve(Re[e]) : We[e] ? (ge.has(e) || ge.set(
368
+ function et(e) {
369
+ return Xe[e] ? Promise.resolve(Xe[e]) : en[e] ? ($e.has(e) || $e.set(
370
370
  e,
371
- We[e]().then((t) => t.default ?? t[e]).catch((t) => {
372
- throw ge.delete(e), t;
371
+ en[e]().then((n) => n.default ?? n[e]).catch((n) => {
372
+ throw $e.delete(e), n;
373
373
  })
374
- ), ge.get(e)) : Promise.reject(new Error(`[inertia-bootstrap-forms] Unknown Bootstrap plugin "${e}"`));
374
+ ), $e.get(e)) : Promise.reject(new Error(`[inertia-bootstrap-forms] Unknown Bootstrap plugin "${e}"`));
375
375
  }
376
- function me(e, t, o, l = {}) {
377
- const d = dt(null);
378
- let u = 0, n = !1, p = null;
379
- function h() {
380
- var $;
381
- u++;
382
- const w = d.value;
383
- if (d.value = null, w) {
376
+ function he(e, n, a, l = {}) {
377
+ const c = yn(null);
378
+ let i = 0, t = !1, u = null;
379
+ function g() {
380
+ var b;
381
+ i++;
382
+ const y = c.value;
383
+ if (c.value = null, y) {
384
384
  try {
385
- ($ = l.onDestroy) == null || $.call(l, w, p);
385
+ (b = l.onDestroy) == null || b.call(l, y, u);
386
386
  } catch {
387
387
  }
388
388
  try {
389
- w.dispose();
389
+ y.dispose();
390
390
  } catch {
391
391
  }
392
392
  }
393
- p = null;
393
+ u = null;
394
394
  }
395
- async function b() {
396
- var r, s, i;
397
- h();
398
- const w = u, $ = await Gt(e);
399
- if (n || w !== u) return null;
400
- const k = t();
401
- if (!k) return null;
402
- (s = (r = $.getInstance) == null ? void 0 : r.call($, k)) == null || s.dispose(), p = k;
403
- const M = new $(k, o());
404
- return d.value = M, (i = l.onCreate) == null || i.call(l, M, k), M;
395
+ async function $() {
396
+ var o, r, s;
397
+ g();
398
+ const y = i, b = await et(e);
399
+ if (t || y !== i) return null;
400
+ const w = n();
401
+ if (!w) return null;
402
+ (r = (o = b.getInstance) == null ? void 0 : o.call(b, w)) == null || r.dispose(), u = w;
403
+ const T = new b(w, a());
404
+ return c.value = T, (s = l.onCreate) == null || s.call(l, T, w), T;
405
405
  }
406
- return Z(() => {
407
- n = !1, b().catch((w) => {
408
- console.error(`[inertia-bootstrap-forms] Could not start Bootstrap ${e}.`, w);
406
+ return J(() => {
407
+ t = !1, $().catch((y) => {
408
+ console.error(`[inertia-bootstrap-forms] Could not start Bootstrap ${e}.`, y);
409
409
  });
410
- }), ft(() => {
411
- n = !0, h();
412
- }), { instance: d, create: b, destroy: h };
410
+ }), un(() => {
411
+ t = !0, g();
412
+ }), { instance: c, create: $, destroy: g };
413
413
  }
414
- const Qe = (e, t) => e.length === t.length && e.every((o, l) => o === t[l]), Wt = V({
414
+ const nn = (e, n) => e.length === n.length && e.every((a, l) => a === n[l]), nt = F({
415
415
  name: "ChipsInput",
416
416
  emits: ["update:modelValue", "change", "add", "remove", "select", "rejected", "focus", "blur"],
417
417
  props: {
418
- ...j,
418
+ ...z,
419
419
  placeholder: { type: String, default: null },
420
420
  /** Character that splits typed / pasted text into chips. Use null to disable. */
421
421
  separator: { type: String, default: "," },
@@ -430,113 +430,113 @@ const Qe = (e, t) => e.length === t.length && e.every((o, l) => o === t[l]), Wt
430
430
  validator: { type: Function, default: null },
431
431
  locale: { type: String, default: null }
432
432
  },
433
- setup(e, { emit: t, expose: o }) {
434
- const l = R(e, t), { t: d } = G(() => e.locale), u = E(null), n = E(null);
435
- let p = !1, h = [];
436
- const b = (r) => Array.isArray(r) ? r.map(String) : typeof r == "string" && r !== "" ? e.separator ? r.split(e.separator).map((s) => s.trim()).filter(Boolean) : [r] : [];
437
- function w() {
438
- const r = k.value;
439
- if (!r) return;
440
- const s = b(l.model.value);
441
- if (Qe(r.getValues(), s)) return;
442
- p = !0;
433
+ setup(e, { emit: n, expose: a }) {
434
+ const l = U(e, n), { t: c } = Q(() => e.locale), i = E(null), t = E(null);
435
+ let u = !1, g = [];
436
+ const $ = (o) => Array.isArray(o) ? o.map(String) : typeof o == "string" && o !== "" ? e.separator ? o.split(e.separator).map((r) => r.trim()).filter(Boolean) : [o] : [];
437
+ function y() {
438
+ const o = w.value;
439
+ if (!o) return;
440
+ const r = $(l.model.value);
441
+ if (nn(o.getValues(), r)) return;
442
+ u = !0;
443
443
  try {
444
- r.clear(), s.forEach((f) => r.add(f));
444
+ o.clear(), r.forEach((f) => o.add(f));
445
445
  } finally {
446
- p = !1;
446
+ u = !1;
447
447
  }
448
- const i = r.getValues();
449
- !Qe(i, s) && Array.isArray(l.model.value) && (l.model.value = i);
448
+ const s = o.getValues();
449
+ !nn(s, r) && Array.isArray(l.model.value) && (l.model.value = s);
450
450
  }
451
- const $ = () => e.readonly || l.isDisabled.value, { instance: k, create: M } = me(
451
+ const b = () => e.readonly || l.isDisabled.value, { instance: w, create: T } = he(
452
452
  "Chips",
453
- () => u.value,
453
+ () => i.value,
454
454
  () => {
455
- const r = {
455
+ const o = {
456
456
  separator: e.separator,
457
457
  allowDuplicates: e.allowDuplicates,
458
458
  maxChips: e.maxChips,
459
- dismissible: e.dismissible && !$(),
459
+ dismissible: e.dismissible && !b(),
460
460
  createOnBlur: e.createOnBlur,
461
- placeholder: e.placeholder ?? d("chips.placeholder")
461
+ placeholder: e.placeholder ?? c("chips.placeholder")
462
462
  };
463
- return e.dismissIcon && (r.dismissIcon = e.dismissIcon), r;
463
+ return e.dismissIcon && (o.dismissIcon = e.dismissIcon), o;
464
464
  },
465
465
  {
466
- onCreate(r, s) {
467
- const i = (f, I) => {
468
- s.addEventListener(f, I), h.push(() => s.removeEventListener(f, I));
466
+ onCreate(o, r) {
467
+ const s = (f, S) => {
468
+ r.addEventListener(f, S), g.push(() => r.removeEventListener(f, S));
469
469
  };
470
- i("add.bs.chips", (f) => {
471
- if (!p) {
470
+ s("add.bs.chips", (f) => {
471
+ if (!u) {
472
472
  if (e.validator && !e.validator(f.value)) {
473
- f.preventDefault(), t("rejected", f.value);
473
+ f.preventDefault(), n("rejected", f.value);
474
474
  return;
475
475
  }
476
- t("add", f.value);
476
+ n("add", f.value);
477
477
  }
478
- }), i("remove.bs.chips", (f) => !p && t("remove", f.value)), i("select.bs.chips", (f) => t("select", f.selected)), i("change.bs.chips", (f) => {
479
- p || (l.model.value = f.values, l.emitChange(f.values, f));
480
- }), w();
478
+ }), s("remove.bs.chips", (f) => !u && n("remove", f.value)), s("select.bs.chips", (f) => n("select", f.selected)), s("change.bs.chips", (f) => {
479
+ u || (l.model.value = f.values, l.emitChange(f.values, f));
480
+ }), y();
481
481
  },
482
482
  onDestroy() {
483
- h.forEach((r) => r()), h = [];
483
+ g.forEach((o) => o()), g = [];
484
484
  }
485
485
  }
486
486
  );
487
- return z(() => l.model.value, w, { deep: !0 }), z(
487
+ return H(() => l.model.value, y, { deep: !0 }), H(
488
488
  () => [e.separator, e.allowDuplicates, e.maxChips, e.dismissible, e.createOnBlur, e.dismissIcon, e.readonly, l.isDisabled.value],
489
489
  async () => {
490
- await K(), M();
490
+ await W(), T();
491
491
  }
492
- ), o({
493
- add: (r) => {
494
- var s;
495
- return (s = k.value) == null ? void 0 : s.add(r);
492
+ ), a({
493
+ add: (o) => {
494
+ var r;
495
+ return (r = w.value) == null ? void 0 : r.add(o);
496
496
  },
497
- remove: (r) => {
498
- var s;
499
- return (s = k.value) == null ? void 0 : s.remove(r);
497
+ remove: (o) => {
498
+ var r;
499
+ return (r = w.value) == null ? void 0 : r.remove(o);
500
500
  },
501
501
  clear: () => {
502
- var r;
503
- return (r = k.value) == null ? void 0 : r.clear();
502
+ var o;
503
+ return (o = w.value) == null ? void 0 : o.clear();
504
504
  },
505
505
  focus: () => {
506
- var r;
507
- return (r = n.value) == null ? void 0 : r.focus();
506
+ var o;
507
+ return (o = t.value) == null ? void 0 : o.focus();
508
508
  }
509
- }), { ...l, t: d, el: u, ghost: n, locked: $ };
509
+ }), { ...l, t: c, el: i, ghost: t, locked: b };
510
510
  }
511
- }), Qt = ["aria-disabled"], Jt = ["id", "placeholder", "disabled", "readonly", "aria-invalid"];
512
- function Zt(e, t, o, l, d, u) {
513
- return c(), v("div", {
511
+ }), tt = ["aria-disabled"], lt = ["id", "placeholder", "disabled", "readonly", "aria-invalid"];
512
+ function at(e, n, a, l, c, i) {
513
+ return m(), h("div", {
514
514
  ref: "el",
515
515
  class: "chip-input",
516
516
  "aria-disabled": e.isDisabled || void 0
517
517
  }, [
518
- m("input", {
518
+ p("input", {
519
519
  ref: "ghost",
520
520
  type: "text",
521
- class: D(["form-ghost", { "is-invalid": e.isInvalid }]),
521
+ class: q(["form-ghost", { "is-invalid": e.isInvalid }]),
522
522
  id: e.inputId,
523
523
  placeholder: e.placeholder ?? e.t("chips.placeholder"),
524
524
  disabled: e.isDisabled,
525
525
  readonly: e.readonly,
526
526
  "aria-invalid": e.isInvalid || void 0,
527
527
  autocomplete: "off",
528
- onFocus: t[0] || (t[0] = (n) => e.$emit("focus", n)),
529
- onBlur: t[1] || (t[1] = (n) => e.$emit("blur", n))
530
- }, null, 42, Jt)
531
- ], 8, Qt);
528
+ onFocus: n[0] || (n[0] = (t) => e.$emit("focus", t)),
529
+ onBlur: n[1] || (n[1] = (t) => e.$emit("blur", t))
530
+ }, null, 42, lt)
531
+ ], 8, tt);
532
532
  }
533
- const Yt = /* @__PURE__ */ q(Wt, [["render", Zt]]), fe = (e) => e !== null && typeof e == "object", Je = (e) => e == null || e === "";
534
- function xt() {
533
+ const ot = /* @__PURE__ */ L(nt, [["render", at]]), me = (e) => e !== null && typeof e == "object", tn = (e) => e == null || e === "";
534
+ function rt() {
535
535
  if (typeof document > "u") return null;
536
536
  const e = document.cookie.match(/(?:^|;\s*)XSRF-TOKEN=([^;]+)/);
537
537
  return e ? decodeURIComponent(e[1]) : null;
538
538
  }
539
- const _t = V({
539
+ const st = F({
540
540
  name: "ComboboxInput",
541
541
  emits: [
542
542
  "update:modelValue",
@@ -552,7 +552,7 @@ const _t = V({
552
552
  "hidden"
553
553
  ],
554
554
  props: {
555
- ...j,
555
+ ...z,
556
556
  /** Strings, numbers or objects ({ id | value, name | label, description, disabled }). */
557
557
  options: { type: Array, default: () => [] },
558
558
  /** Property that holds the value of an option object (default: id → value → name → label). */
@@ -583,7 +583,7 @@ const _t = V({
583
583
  * Multiple select only: show the chosen options themselves (true) instead of the
584
584
  * "N selected" counter (false, default).
585
585
  */
586
- showSelected: { type: Boolean, default: !1 },
586
+ showSelected: { type: Boolean, default: !0 },
587
587
  /** With `showSelected`: above this many chosen options the counter is shown instead. */
588
588
  maxVisible: { type: Number, default: null },
589
589
  /** Separator between the chosen labels (default: "، " for fa, ", " otherwise). */
@@ -596,220 +596,220 @@ const _t = V({
596
596
  hideDropdown: { type: Boolean, default: !1 },
597
597
  locale: { type: String, default: null }
598
598
  },
599
- setup(e, { emit: t, expose: o, slots: l }) {
600
- const d = R(e, t), { t: u, locale: n } = G(() => e.locale), p = De(), h = E(null), b = E(null), w = E(null), $ = E(null), k = E(null), M = E({}), r = ye({ results: null, loading: !1, error: !1 }), s = C(() => {
601
- var a;
602
- return ((a = e.search) == null ? void 0 : a.url) || null;
603
- }), i = C(() => e.searchEnabled || !!s.value), f = (a) => fe(a) ? e.valueKey ? a[e.valueKey] : a.id ?? a.value ?? a.name ?? a.label : a, I = (a) => {
604
- if (!fe(a)) return a;
605
- const g = e.labelKey || e.label;
606
- return (g ? a[g] : a.name ?? a.label ?? a.title ?? a.value) ?? f(a);
607
- }, L = (a) => fe(a) ? a[e.descriptionKey] ?? null : null, T = (a) => String(f(a));
608
- function W(a) {
609
- const g = { ...M.value };
610
- (a || []).forEach((S) => {
611
- g[T(S)] = S;
612
- }), M.value = g;
599
+ setup(e, { emit: n, expose: a, slots: l }) {
600
+ const c = U(e, n), { t: i, locale: t } = Q(() => e.locale), u = Le(), g = E(null), $ = E(null), y = E(null), b = E(null), w = E(null), T = E({}), o = ie({ results: null, loading: !1, error: !1 }), r = C(() => {
601
+ var v;
602
+ return ((v = e.search) == null ? void 0 : v.url) || null;
603
+ }), s = C(() => e.searchEnabled || !!r.value), f = (v) => me(v) ? e.valueKey ? v[e.valueKey] : v.id ?? v.value ?? v.name ?? v.label : v, S = (v) => {
604
+ if (!me(v)) return v;
605
+ const k = e.labelKey || e.label;
606
+ return (k ? v[k] : v.name ?? v.label ?? v.title ?? v.value) ?? f(v);
607
+ }, R = (v) => me(v) ? v[e.descriptionKey] ?? null : null, A = (v) => String(f(v));
608
+ function K(v) {
609
+ const k = { ...T.value };
610
+ (v || []).forEach((D) => {
611
+ k[A(D)] = D;
612
+ }), T.value = k;
613
613
  }
614
- z(() => e.options, (a) => W(a), { immediate: !0, deep: !0 });
615
- const se = C(() => {
616
- const a = d.model.value;
617
- return e.multiple ? Array.isArray(a) ? a : fe(a) ? Object.values(a) : Je(a) ? [] : [a] : Je(a) ? [] : [a];
618
- }), P = C(() => se.value.map((a) => fe(a) ? T(a) : String(a))), we = (a) => {
619
- const g = M.value[a];
620
- return g !== void 0 ? String(I(g)) : a;
621
- }, ke = C(
622
- () => P.value.map((a) => {
623
- const g = M.value[a];
614
+ H(() => e.options, (v) => K(v), { immediate: !0, deep: !0 });
615
+ const ee = C(() => {
616
+ const v = c.model.value;
617
+ return e.multiple ? Array.isArray(v) ? v : me(v) ? Object.values(v) : tn(v) ? [] : [v] : tn(v) ? [] : [v];
618
+ }), P = C(() => ee.value.map((v) => me(v) ? A(v) : String(v))), Se = (v) => {
619
+ const k = T.value[v];
620
+ return k !== void 0 ? String(S(k)) : v;
621
+ }, Ie = C(
622
+ () => P.value.map((v) => {
623
+ const k = T.value[v];
624
624
  return {
625
- key: a,
626
- raw: g,
627
- label: g !== void 0 ? String(I(g)) : a,
628
- description: g !== void 0 ? L(g) : null
625
+ key: v,
626
+ raw: k,
627
+ label: k !== void 0 ? String(S(k)) : v,
628
+ description: k !== void 0 ? R(k) : null
629
629
  };
630
630
  })
631
- ), Se = C(() => e.selectedSeparator ?? (n.value === "fa" ? "، " : ", ")), Q = C(
631
+ ), Ce = C(() => e.selectedSeparator ?? (t.value === "fa" ? "، " : ", ")), ve = C(
632
632
  () => e.multiple && e.showSelected && P.value.length > 1 && (e.maxVisible === null || P.value.length <= e.maxVisible)
633
- ), ie = C(
634
- () => !!l.selection && P.value.length > 0 && (!e.multiple || P.value.length === 1 || Q.value)
635
- ), Ie = C(() => {
636
- const a = P.value;
637
- return a.length ? e.multiple && a.length > 1 ? Q.value ? ke.value.map((g) => g.label).join(Se.value) : (e.selectedText ?? u("select.selectedCount")).replace("{count}", a.length) : we(a[0]) : e.placeholder ?? u("select.placeholder");
638
- }), ue = C(() => ie.value ? "" : Ie.value), x = C(() => P.value.length === 0), ne = C(() => {
639
- let a = r.results ?? e.options;
640
- if (r.results && e.multiple) {
641
- const g = new Set(a.map(T));
642
- a = [...P.value.filter((A) => !g.has(A) && M.value[A] !== void 0).map((A) => M.value[A]), ...a];
633
+ ), Te = C(
634
+ () => !!l.selection && P.value.length > 0 && (!e.multiple || P.value.length === 1 || ve.value)
635
+ ), Me = C(() => {
636
+ const v = P.value;
637
+ return v.length ? e.multiple && v.length > 1 ? ve.value ? Ie.value.map((k) => k.label).join(Ce.value) : (e.selectedText ?? i("select.selectedCount")).replace("{count}", v.length) : Se(v[0]) : e.placeholder ?? i("select.placeholder");
638
+ }), ge = C(() => Te.value ? "" : Me.value), Be = C(() => P.value.length === 0), ye = C(() => {
639
+ let v = o.results ?? e.options;
640
+ if (o.results && e.multiple) {
641
+ const k = new Set(v.map(A));
642
+ v = [...P.value.filter((d) => !k.has(d) && T.value[d] !== void 0).map((d) => T.value[d]), ...v];
643
643
  }
644
- return a.map((g) => ({
645
- raw: g,
646
- key: T(g),
647
- label: I(g),
648
- description: L(g),
649
- disabled: fe(g) && !!g.disabled
644
+ return v.map((k) => ({
645
+ raw: k,
646
+ key: A(k),
647
+ label: S(k),
648
+ description: R(k),
649
+ disabled: me(k) && !!k.disabled
650
650
  }));
651
651
  });
652
- function Ce() {
653
- if (!w.value) return;
654
- const a = new Set(P.value);
655
- w.value.querySelectorAll(".menu-item[data-bs-value]").forEach((g) => {
656
- const S = a.has(g.dataset.bsValue) && g.dataset.bsValue !== "";
657
- g.classList.toggle("selected", S), g.setAttribute("aria-selected", S ? "true" : "false");
652
+ function Z() {
653
+ if (!y.value) return;
654
+ const v = new Set(P.value);
655
+ y.value.querySelectorAll(".menu-item[data-bs-value]").forEach((k) => {
656
+ const D = v.has(k.dataset.bsValue) && k.dataset.bsValue !== "";
657
+ k.classList.toggle("selected", D), k.setAttribute("aria-selected", D ? "true" : "false");
658
658
  });
659
659
  }
660
- function Me() {
661
- $.value && ($.value.textContent = ue.value, $.value.classList.toggle("combobox-placeholder", x.value));
660
+ function ue() {
661
+ b.value && (b.value.textContent = ge.value, b.value.classList.toggle("combobox-placeholder", Be.value));
662
662
  }
663
- function Te() {
664
- var a;
665
- (a = b.value) == null || a.classList.toggle("is-invalid", d.isInvalid.value);
663
+ function Pe() {
664
+ var v;
665
+ (v = $.value) == null || v.classList.toggle("is-invalid", c.isInvalid.value);
666
666
  }
667
- function le() {
668
- Ce(), Me(), Te();
667
+ function ne() {
668
+ Z(), ue(), Pe();
669
669
  }
670
- z([() => d.model.value, ne, ue, d.isInvalid], () => K(le), { flush: "post" });
671
- function pe(a) {
672
- const g = M.value[a];
673
- return g !== void 0 ? f(g) : a;
670
+ H([() => c.model.value, ye, ge, c.isInvalid], () => W(ne), { flush: "post" });
671
+ function te(v) {
672
+ const k = T.value[v];
673
+ return k !== void 0 ? f(k) : v;
674
674
  }
675
- function ae(a) {
676
- let g, S;
675
+ function be(v) {
676
+ let k, D;
677
677
  if (e.multiple) {
678
- const A = a.value || [];
679
- g = A.map(pe), S = A.map((H) => M.value[H]);
680
- } else a.value === "" || a.value === void 0 ? (g = null, S = null) : (g = pe(a.value), S = M.value[a.value]);
681
- d.model.value = g, g === null && t("clear"), t("selected", S), d.emitChange(g, a), K(le), Me();
678
+ const d = v.value || [];
679
+ k = d.map(te), D = d.map((O) => T.value[O]);
680
+ } else v.value === "" || v.value === void 0 ? (k = null, D = null) : (k = te(v.value), D = T.value[v.value]);
681
+ c.model.value = k, k === null && n("clear"), n("selected", D), c.emitChange(k, v), W(ne), ue();
682
682
  }
683
- let de = null, U = null;
684
- p.add(() => {
685
- clearTimeout(de), U == null || U.abort();
683
+ let de = null, X = null;
684
+ u.add(() => {
685
+ clearTimeout(de), X == null || X.abort();
686
686
  });
687
- function he() {
688
- var a;
689
- w.value && (w.value.querySelectorAll(".menu-item[data-bs-value]").forEach((g) => {
690
- g.style.display = "";
691
- }), (a = w.value.querySelector(".combobox-no-results")) == null || a.classList.toggle("d-none", ne.value.length > 0));
687
+ function ce() {
688
+ var v;
689
+ y.value && (y.value.querySelectorAll(".menu-item[data-bs-value]").forEach((k) => {
690
+ k.style.display = "";
691
+ }), (v = y.value.querySelector(".combobox-no-results")) == null || v.classList.toggle("d-none", ye.value.length > 0));
692
692
  }
693
- async function Be(a) {
694
- const g = e.search || {};
695
- if (g.url) {
696
- U == null || U.abort(), U = new AbortController(), r.loading = !0, r.error = !1;
693
+ async function ze(v) {
694
+ const k = e.search || {};
695
+ if (k.url) {
696
+ X == null || X.abort(), X = new AbortController(), o.loading = !0, o.error = !1;
697
697
  try {
698
- const S = new URL(g.url, window.location.origin);
699
- S.searchParams.set(g.param || "query", a);
700
- const A = {
698
+ const D = new URL(k.url, window.location.origin);
699
+ D.searchParams.set(k.param || "query", v);
700
+ const d = {
701
701
  Accept: "application/json",
702
702
  "X-Requested-With": "XMLHttpRequest",
703
- ...g.headers || {}
704
- }, H = xt();
705
- H && !A["X-XSRF-TOKEN"] && (A["X-XSRF-TOKEN"] = H);
706
- const J = await fetch(S, {
707
- method: (g.method || "POST").toUpperCase(),
708
- headers: A,
703
+ ...k.headers || {}
704
+ }, O = rt();
705
+ O && !d["X-XSRF-TOKEN"] && (d["X-XSRF-TOKEN"] = O);
706
+ const I = await fetch(D, {
707
+ method: (k.method || "POST").toUpperCase(),
708
+ headers: d,
709
709
  credentials: "same-origin",
710
- signal: U.signal
710
+ signal: X.signal
711
711
  });
712
- if (!J.ok) throw new Error(`HTTP ${J.status}`);
713
- const _ = await J.json(), Fe = Array.isArray(_) ? _ : (_ == null ? void 0 : _[g.resultsKey || "data"]) ?? (_ == null ? void 0 : _.results) ?? [];
714
- W(Fe), r.results = Fe, r.loading = !1, t("search-success", Fe), await K(), he(), le();
715
- } catch (S) {
716
- if ((S == null ? void 0 : S.name) === "AbortError") return;
717
- r.loading = !1, r.error = !0, r.results = [], t("search-error", S), await K(), he();
712
+ if (!I.ok) throw new Error(`HTTP ${I.status}`);
713
+ const B = await I.json(), N = Array.isArray(B) ? B : (B == null ? void 0 : B[k.resultsKey || "data"]) ?? (B == null ? void 0 : B.results) ?? [];
714
+ K(N), o.results = N, o.loading = !1, n("search-success", N), await W(), ce(), ne();
715
+ } catch (D) {
716
+ if ((D == null ? void 0 : D.name) === "AbortError") return;
717
+ o.loading = !1, o.error = !0, o.results = [], n("search-error", D), await W(), ce();
718
718
  }
719
719
  }
720
720
  }
721
- function Ee(a) {
722
- var A, H;
723
- const g = a.target.value;
724
- if (t("search", g), !s.value) return;
721
+ function Ee(v) {
722
+ var d, O;
723
+ const k = v.target.value;
724
+ if (n("search", k), !r.value) return;
725
725
  clearTimeout(de);
726
- const S = ((A = e.search) == null ? void 0 : A.minChars) ?? 0;
727
- if (g.length < S) {
728
- U == null || U.abort(), r.results = null, r.loading = !1;
726
+ const D = ((d = e.search) == null ? void 0 : d.minChars) ?? 0;
727
+ if (k.length < D) {
728
+ X == null || X.abort(), o.results = null, o.loading = !1;
729
729
  return;
730
730
  }
731
- r.loading = !0, de = setTimeout(() => Be(g), ((H = e.search) == null ? void 0 : H.debounce) ?? 400);
731
+ o.loading = !0, de = setTimeout(() => ze(k), ((O = e.search) == null ? void 0 : O.debounce) ?? 400);
732
732
  }
733
- let ve = [];
734
- const { instance: y, create: N } = me(
733
+ let x = [];
734
+ const { instance: fe, create: Ae } = he(
735
735
  "Combobox",
736
- () => b.value,
736
+ () => $.value,
737
737
  () => ({
738
738
  multiple: e.multiple,
739
- placeholder: e.placeholder ?? u("select.placeholder"),
739
+ placeholder: e.placeholder ?? i("select.placeholder"),
740
740
  placement: e.placement,
741
- search: i.value,
741
+ search: s.value,
742
742
  searchNormalize: e.searchNormalize
743
743
  }),
744
744
  {
745
- onCreate(a, g) {
746
- const S = (A, H, J) => {
747
- A.addEventListener(H, J), ve.push(() => A.removeEventListener(H, J));
745
+ onCreate(v, k) {
746
+ const D = (d, O, I) => {
747
+ d.addEventListener(O, I), x.push(() => d.removeEventListener(O, I));
748
748
  };
749
- S(g, "change.bs.combobox", ae), S(g, "show.bs.combobox", (A) => t("show", A)), S(g, "shown.bs.combobox", (A) => t("shown", A)), S(g, "hide.bs.combobox", (A) => t("hide", A)), S(g, "hidden.bs.combobox", (A) => {
750
- r.results !== null && (r.results = null, r.error = !1, K(() => {
751
- he(), le();
752
- })), t("hidden", A);
753
- }), k.value && (S(k.value, "input", Ee), S(k.value, "keydown", (A) => A.key === "Enter" && A.preventDefault())), le();
749
+ D(k, "change.bs.combobox", be), D(k, "show.bs.combobox", (d) => n("show", d)), D(k, "shown.bs.combobox", (d) => n("shown", d)), D(k, "hide.bs.combobox", (d) => n("hide", d)), D(k, "hidden.bs.combobox", (d) => {
750
+ o.results !== null && (o.results = null, o.error = !1, W(() => {
751
+ ce(), ne();
752
+ })), n("hidden", d);
753
+ }), w.value && (D(w.value, "input", Ee), D(w.value, "keydown", (d) => d.key === "Enter" && d.preventDefault())), ne();
754
754
  },
755
755
  onDestroy() {
756
- ve.forEach((a) => a()), ve = [];
756
+ x.forEach((v) => v()), x = [];
757
757
  }
758
758
  }
759
759
  );
760
- return z(
761
- () => [e.multiple, i.value, e.placement, e.searchNormalize],
760
+ return H(
761
+ () => [e.multiple, s.value, e.placement, e.searchNormalize],
762
762
  async () => {
763
- await K(), N();
763
+ await W(), Ae();
764
764
  }
765
- ), o({
765
+ ), a({
766
766
  show: () => {
767
- var a;
768
- return (a = y.value) == null ? void 0 : a.show();
767
+ var v;
768
+ return (v = fe.value) == null ? void 0 : v.show();
769
769
  },
770
770
  hide: () => {
771
- var a;
772
- return (a = y.value) == null ? void 0 : a.hide();
771
+ var v;
772
+ return (v = fe.value) == null ? void 0 : v.hide();
773
773
  },
774
774
  toggle: () => {
775
- var a;
776
- return (a = y.value) == null ? void 0 : a.toggle();
775
+ var v;
776
+ return (v = fe.value) == null ? void 0 : v.toggle();
777
777
  },
778
778
  clear: () => {
779
- d.model.value = e.multiple ? [] : null, t("clear"), d.emitChange(d.model.value);
779
+ c.model.value = e.multiple ? [] : null, n("clear"), c.emitChange(c.model.value);
780
780
  },
781
781
  focus: () => {
782
- var a;
783
- return (a = b.value) == null ? void 0 : a.focus();
782
+ var v;
783
+ return (v = $.value) == null ? void 0 : v.focus();
784
784
  }
785
785
  }), {
786
- ...d,
787
- t: u,
788
- root: h,
789
- toggle: b,
790
- menu: w,
791
- valueEl: $,
792
- searchInput: k,
793
- remote: r,
794
- hasSearch: i,
795
- rendered: ne,
796
- displayText: Ie,
797
- plainText: ue,
798
- selectedItems: ke,
799
- customSelection: ie,
800
- separator: Se,
786
+ ...c,
787
+ t: i,
788
+ root: g,
789
+ toggle: $,
790
+ menu: y,
791
+ valueEl: b,
792
+ searchInput: w,
793
+ remote: o,
794
+ hasSearch: s,
795
+ rendered: ye,
796
+ displayText: Me,
797
+ plainText: ge,
798
+ selectedItems: Ie,
799
+ customSelection: Te,
800
+ separator: Ce,
801
801
  selectedSet: C(() => new Set(P.value)),
802
- showingPlaceholder: x,
802
+ showingPlaceholder: Be,
803
803
  sizeClass: C(() => e.size ? `form-control-${e.size}` : null)
804
804
  };
805
805
  }
806
- }), en = {
806
+ }), it = {
807
807
  ref: "root",
808
808
  class: "combobox"
809
- }, tn = ["id", "disabled", "aria-invalid", "aria-required"], nn = {
809
+ }, ut = ["id", "disabled", "aria-invalid", "aria-required"], dt = {
810
810
  key: 0,
811
811
  class: "combobox-selection d-flex align-items-center flex-wrap gap-2 text-start"
812
- }, ln = ["textContent"], an = {
812
+ }, ct = ["textContent"], ft = {
813
813
  key: 1,
814
814
  class: "combobox-caret",
815
815
  width: "16",
@@ -821,33 +821,33 @@ const _t = V({
821
821
  "stroke-linecap": "round",
822
822
  "stroke-linejoin": "round",
823
823
  "aria-hidden": "true"
824
- }, on = ["aria-multiselectable"], rn = {
824
+ }, mt = ["aria-multiselectable"], pt = {
825
825
  key: 0,
826
826
  class: "combobox-search"
827
- }, sn = ["placeholder"], un = {
827
+ }, ht = ["placeholder"], vt = {
828
828
  key: 1,
829
829
  class: "menu-header",
830
830
  role: "status"
831
- }, dn = {
831
+ }, gt = {
832
832
  key: 2,
833
833
  class: "menu-header",
834
834
  role: "alert"
835
- }, fn = {
835
+ }, yt = {
836
836
  key: 3,
837
837
  type: "button",
838
838
  class: "menu-item",
839
839
  "data-bs-value": "",
840
840
  role: "option"
841
- }, cn = { class: "menu-item-content" }, mn = ["data-bs-value", "disabled"], pn = { class: "menu-item-content" }, hn = {
841
+ }, bt = { class: "menu-item-content" }, $t = ["data-bs-value", "disabled"], wt = { class: "menu-item-content" }, kt = {
842
842
  key: 0,
843
843
  class: "menu-item-description"
844
- }, vn = { class: "combobox-no-results d-none" };
845
- function gn(e, t, o, l, d, u) {
846
- return c(), v("div", en, [
847
- m("button", {
844
+ }, St = { class: "combobox-no-results d-none" };
845
+ function It(e, n, a, l, c, i) {
846
+ return m(), h("div", it, [
847
+ p("button", {
848
848
  ref: "toggle",
849
849
  type: "button",
850
- class: D(["combobox-toggle form-control", e.sizeClass]),
850
+ class: q(["combobox-toggle form-control", e.sizeClass]),
851
851
  "data-bs-toggle": "combobox",
852
852
  id: e.inputId,
853
853
  disabled: e.isDisabled || e.readonly,
@@ -855,71 +855,71 @@ function gn(e, t, o, l, d, u) {
855
855
  "aria-invalid": e.isInvalid || void 0,
856
856
  "aria-required": e.required || void 0
857
857
  }, [
858
- e.customSelection ? (c(), v("span", nn, [
859
- (c(!0), v(X, null, ee(e.selectedItems, (n, p) => F(e.$slots, "selection", {
860
- key: n.key,
861
- option: n.raw,
862
- label: n.label,
863
- description: n.description,
864
- value: n.key,
865
- index: p,
858
+ e.customSelection ? (m(), h("span", dt, [
859
+ (m(!0), h(G, null, ae(e.selectedItems, (t, u) => j(e.$slots, "selection", {
860
+ key: t.key,
861
+ option: t.raw,
862
+ label: t.label,
863
+ description: t.description,
864
+ value: t.key,
865
+ index: u,
866
866
  multiple: e.multiple
867
867
  }, () => [
868
- Y(O(n.label), 1)
868
+ _(V(t.label), 1)
869
869
  ])), 128))
870
- ])) : B("", !0),
871
- m("span", {
870
+ ])) : M("", !0),
871
+ p("span", {
872
872
  ref: "valueEl",
873
- class: D(["combobox-value", { "combobox-placeholder": e.showingPlaceholder }]),
874
- textContent: O(e.plainText)
875
- }, null, 10, ln),
876
- e.hideDropdown ? B("", !0) : (c(), v("svg", an, t[0] || (t[0] = [
877
- m("path", { d: "m3 6 5 5 5-5" }, null, -1)
873
+ class: q(["combobox-value", { "combobox-placeholder": e.showingPlaceholder }]),
874
+ textContent: V(e.plainText)
875
+ }, null, 10, ct),
876
+ e.hideDropdown ? M("", !0) : (m(), h("svg", ft, n[0] || (n[0] = [
877
+ p("path", { d: "m3 6 5 5 5-5" }, null, -1)
878
878
  ])))
879
- ], 10, tn),
880
- m("div", {
879
+ ], 10, ut),
880
+ p("div", {
881
881
  ref: "menu",
882
882
  class: "menu",
883
883
  role: "listbox",
884
884
  "aria-multiselectable": e.multiple || void 0
885
885
  }, [
886
- e.hasSearch ? (c(), v("div", rn, [
887
- m("input", {
886
+ e.hasSearch ? (m(), h("div", pt, [
887
+ p("input", {
888
888
  ref: "searchInput",
889
889
  type: "search",
890
890
  class: "form-control combobox-search-input",
891
891
  autocomplete: "off",
892
892
  placeholder: e.searchPlaceholder ?? e.t("select.search")
893
- }, null, 8, sn)
894
- ])) : B("", !0),
895
- e.remote.loading ? (c(), v("div", un, O(e.loadingText ?? e.t("select.loading")), 1)) : e.remote.error ? (c(), v("div", dn, O(e.t("select.error")), 1)) : B("", !0),
896
- e.clearable && !e.multiple ? (c(), v("button", fn, [
897
- m("span", cn, [
898
- m("span", null, O(e.clearText ?? e.t("select.clear")), 1)
893
+ }, null, 8, ht)
894
+ ])) : M("", !0),
895
+ e.remote.loading ? (m(), h("div", vt, V(e.loadingText ?? e.t("select.loading")), 1)) : e.remote.error ? (m(), h("div", gt, V(e.t("select.error")), 1)) : M("", !0),
896
+ e.clearable && !e.multiple ? (m(), h("button", yt, [
897
+ p("span", bt, [
898
+ p("span", null, V(e.clearText ?? e.t("select.clear")), 1)
899
899
  ])
900
- ])) : B("", !0),
901
- (c(!0), v(X, null, ee(e.rendered, (n) => (c(), v("button", {
902
- key: n.key,
900
+ ])) : M("", !0),
901
+ (m(!0), h(G, null, ae(e.rendered, (t) => (m(), h("button", {
902
+ key: t.key,
903
903
  type: "button",
904
904
  class: "menu-item",
905
905
  role: "option",
906
- "data-bs-value": n.key,
907
- disabled: n.disabled || void 0
906
+ "data-bs-value": t.key,
907
+ disabled: t.disabled || void 0
908
908
  }, [
909
- m("span", pn, [
910
- F(e.$slots, "option", {
911
- option: n.raw,
912
- label: n.label,
913
- description: n.description,
914
- value: n.key,
915
- selected: e.selectedSet.has(n.key),
916
- disabled: n.disabled
909
+ p("span", wt, [
910
+ j(e.$slots, "option", {
911
+ option: t.raw,
912
+ label: t.label,
913
+ description: t.description,
914
+ value: t.key,
915
+ selected: e.selectedSet.has(t.key),
916
+ disabled: t.disabled
917
917
  }, () => [
918
- m("span", null, O(n.label), 1),
919
- n.description ? (c(), v("span", hn, O(n.description), 1)) : B("", !0)
918
+ p("span", null, V(t.label), 1),
919
+ t.description ? (m(), h("span", kt, V(t.description), 1)) : M("", !0)
920
920
  ])
921
921
  ]),
922
- t[1] || (t[1] = m("svg", {
922
+ n[1] || (n[1] = p("svg", {
923
923
  class: "menu-item-check",
924
924
  width: "16",
925
925
  height: "16",
@@ -931,31 +931,31 @@ function gn(e, t, o, l, d, u) {
931
931
  "stroke-linejoin": "round",
932
932
  "aria-hidden": "true"
933
933
  }, [
934
- m("path", { d: "m3.5 8.5 3 3 6-7" })
934
+ p("path", { d: "m3.5 8.5 3 3 6-7" })
935
935
  ], -1))
936
- ], 8, mn))), 128)),
937
- m("div", vn, O(e.noResultsText ?? e.t("select.noResults")), 1)
938
- ], 8, on)
936
+ ], 8, $t))), 128)),
937
+ p("div", St, V(e.noResultsText ?? e.t("select.noResults")), 1)
938
+ ], 8, mt)
939
939
  ], 512);
940
940
  }
941
- const at = /* @__PURE__ */ q(_t, [["render", gn]]), yn = V({
941
+ const cn = /* @__PURE__ */ L(st, [["render", It]]), Ct = F({
942
942
  name: "TextInput",
943
943
  emits: ["update:modelValue", "change", "input", "focus", "blur"],
944
944
  props: {
945
- ...j,
945
+ ...z,
946
946
  type: { type: String, default: "text" },
947
947
  placeholder: { type: String, default: null },
948
948
  /** sm | lg */
949
949
  size: { type: String, default: null }
950
950
  },
951
- setup(e, { emit: t }) {
952
- const o = R(e, t), l = C(() => e.size ? `form-control-${e.size}` : null);
953
- return { ...o, sizeClass: l, emit: t };
951
+ setup(e, { emit: n }) {
952
+ const a = U(e, n), l = C(() => e.size ? `form-control-${e.size}` : null);
953
+ return { ...a, sizeClass: l, emit: n };
954
954
  }
955
- }), bn = ["name", "id", "type", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
956
- function $n(e, t, o, l, d, u) {
957
- return te((c(), v("input", {
958
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.model = n),
955
+ }), Tt = ["name", "id", "type", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
956
+ function Mt(e, n, a, l, c, i) {
957
+ return re((m(), h("input", {
958
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
959
959
  name: e.name,
960
960
  id: e.inputId,
961
961
  type: e.type,
@@ -964,44 +964,44 @@ function $n(e, t, o, l, d, u) {
964
964
  readonly: e.readonly,
965
965
  disabled: e.isDisabled,
966
966
  "aria-invalid": e.isInvalid || void 0,
967
- class: D(["form-control", [e.sizeClass, { "is-invalid": e.isInvalid }]]),
968
- onInput: t[1] || (t[1] = (n) => e.emit("input", e.model, n)),
969
- onChange: t[2] || (t[2] = (n) => e.emitChange(e.model, n)),
970
- onFocus: t[3] || (t[3] = (n) => e.$emit("focus", n)),
971
- onBlur: t[4] || (t[4] = (n) => e.$emit("blur", n))
972
- }, null, 42, bn)), [
973
- [$e, e.model]
967
+ class: q(["form-control", [e.sizeClass, { "is-invalid": e.isInvalid }]]),
968
+ onInput: n[1] || (n[1] = (t) => e.emit("input", e.model, t)),
969
+ onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
970
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
971
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
972
+ }, null, 42, Tt)), [
973
+ [ke, e.model]
974
974
  ]);
975
975
  }
976
- const qe = /* @__PURE__ */ q(yn, [["render", $n]]), wn = V({
976
+ const je = /* @__PURE__ */ L(Ct, [["render", Mt]]), Bt = F({
977
977
  name: "EmailInput",
978
- components: { TextInput: qe },
978
+ components: { TextInput: je },
979
979
  props: {
980
980
  name: { type: String, default: "email" },
981
981
  placeholder: { type: String, default: null },
982
982
  locale: { type: String, default: null }
983
983
  },
984
984
  setup(e) {
985
- const { t } = G(() => e.locale);
986
- return { t };
985
+ const { t: n } = Q(() => e.locale);
986
+ return { t: n };
987
987
  }
988
988
  });
989
- function kn(e, t, o, l, d, u) {
990
- const n = re("TextInput");
991
- return c(), be(n, {
989
+ function Et(e, n, a, l, c, i) {
990
+ const t = oe("TextInput");
991
+ return m(), le(t, {
992
992
  type: "email",
993
993
  autocomplete: "email",
994
994
  name: e.name,
995
995
  placeholder: e.placeholder ?? e.t("email.placeholder")
996
996
  }, null, 8, ["name", "placeholder"]);
997
997
  }
998
- const Sn = /* @__PURE__ */ q(wn, [["render", kn]]);
999
- let In = 0;
1000
- const Cn = V({
998
+ const At = /* @__PURE__ */ L(Bt, [["render", Et]]);
999
+ let Ot = 0;
1000
+ const Vt = F({
1001
1001
  name: "FileInput",
1002
1002
  emits: ["update:modelValue", "change", "added", "progress", "uploaded", "error", "removed"],
1003
1003
  props: {
1004
- ...j,
1004
+ ...z,
1005
1005
  multiple: { type: Boolean, default: !1 },
1006
1006
  endpoint: { type: String, default: "/upload" },
1007
1007
  accept: { type: String, default: null },
@@ -1010,96 +1010,96 @@ const Cn = V({
1010
1010
  fieldName: { type: String, default: "file" },
1011
1011
  locale: { type: String, default: null }
1012
1012
  },
1013
- setup(e, { emit: t, expose: o }) {
1014
- const l = R(e, t), { t: d } = G(() => e.locale), u = De(), n = E(null), p = E([]), h = /* @__PURE__ */ new Map();
1015
- u.add(() => {
1016
- h.forEach((i) => i.abort()), h.clear(), l.form.value && (l.form.value.uploading = null);
1013
+ setup(e, { emit: n, expose: a }) {
1014
+ const l = U(e, n), { t: c } = Q(() => e.locale), i = Le(), t = E(null), u = E([]), g = /* @__PURE__ */ new Map();
1015
+ i.add(() => {
1016
+ g.forEach((s) => s.abort()), g.clear(), l.form.value && (l.form.value.uploading = null);
1017
1017
  });
1018
- const b = () => p.value.filter((i) => i.path).map((i) => i.path);
1019
- function w(i) {
1020
- const f = e.multiple ? b() : b()[0] ?? null;
1021
- l.model.value = f, l.emitChange(f, i);
1018
+ const $ = () => u.value.filter((s) => s.path).map((s) => s.path);
1019
+ function y(s) {
1020
+ const f = e.multiple ? $() : $()[0] ?? null;
1021
+ l.model.value = f, l.emitChange(f, s);
1022
1022
  }
1023
- function $() {
1024
- const i = l.form.value;
1025
- if (!i) return;
1026
- const f = p.value.filter((I) => I.uploading);
1027
- i.uploading = f.length ? Math.min(99, Math.round(f.reduce((I, L) => I + L.percent, 0) / f.length)) : null;
1023
+ function b() {
1024
+ const s = l.form.value;
1025
+ if (!s) return;
1026
+ const f = u.value.filter((S) => S.uploading);
1027
+ s.uploading = f.length ? Math.min(99, Math.round(f.reduce((S, R) => S + R.percent, 0) / f.length)) : null;
1028
1028
  }
1029
- function k(i) {
1030
- i.error = "", i.percent = 0, i.uploading = !0, $();
1029
+ function w(s) {
1030
+ s.error = "", s.percent = 0, s.uploading = !0, b();
1031
1031
  const f = new FormData();
1032
- f.append(e.fieldName, i.file);
1033
- const I = new XMLHttpRequest();
1034
- h.set(i.id, I), I.open("POST", e.endpoint), Object.entries(Oe(e.headers)).forEach(([T, W]) => I.setRequestHeader(T, W)), I.upload.onprogress = (T) => {
1035
- T.lengthComputable && (i.percent = Math.round(T.loaded / T.total * 100), t("progress", i, i.percent), $());
1032
+ f.append(e.fieldName, s.file);
1033
+ const S = new XMLHttpRequest();
1034
+ g.set(s.id, S), S.open("POST", e.endpoint), Object.entries(De(e.headers)).forEach(([A, K]) => S.setRequestHeader(A, K)), S.upload.onprogress = (A) => {
1035
+ A.lengthComputable && (s.percent = Math.round(A.loaded / A.total * 100), n("progress", s, s.percent), b());
1036
1036
  };
1037
- const L = (T) => {
1038
- i.uploading = !1, i.error = T || d("upload.failed"), h.delete(i.id), $(), t("error", i, i.error);
1037
+ const R = (A) => {
1038
+ s.uploading = !1, s.error = A || c("upload.failed"), g.delete(s.id), b(), n("error", s, s.error);
1039
1039
  };
1040
- I.onerror = () => L(), I.onload = () => {
1041
- var se;
1042
- let T = null;
1040
+ S.onerror = () => R(), S.onload = () => {
1041
+ var ee;
1042
+ let A = null;
1043
1043
  try {
1044
- T = JSON.parse(I.responseText);
1044
+ A = JSON.parse(S.responseText);
1045
1045
  } catch {
1046
1046
  }
1047
- if (I.status < 200 || I.status >= 300) {
1048
- const P = T != null && T.errors ? Object.values(T.errors)[0] : null;
1049
- return L((T == null ? void 0 : T.message) || (Array.isArray(P) ? P[0] : P));
1047
+ if (S.status < 200 || S.status >= 300) {
1048
+ const P = A != null && A.errors ? Object.values(A.errors)[0] : null;
1049
+ return R((A == null ? void 0 : A.message) || (Array.isArray(P) ? P[0] : P));
1050
1050
  }
1051
- const W = ((se = T == null ? void 0 : T.data) == null ? void 0 : se.path) ?? (T == null ? void 0 : T.path);
1052
- if (!W) return L();
1053
- i.path = W, i.percent = 100, i.uploading = !1, h.delete(i.id), $(), w(), t("uploaded", i);
1054
- }, I.send(f);
1051
+ const K = ((ee = A == null ? void 0 : A.data) == null ? void 0 : ee.path) ?? (A == null ? void 0 : A.path);
1052
+ if (!K) return R();
1053
+ s.path = K, s.percent = 100, s.uploading = !1, g.delete(s.id), b(), y(), n("uploaded", s);
1054
+ }, S.send(f);
1055
1055
  }
1056
- function M(i) {
1057
- const f = ye({ id: `f${++In}`, file: i, percent: 0, error: "", path: null, uploading: !1 });
1058
- p.value = e.multiple ? [...p.value, f] : [f], t("added", f), k(f);
1056
+ function T(s) {
1057
+ const f = ie({ id: `f${++Ot}`, file: s, percent: 0, error: "", path: null, uploading: !1 });
1058
+ u.value = e.multiple ? [...u.value, f] : [f], n("added", f), w(f);
1059
1059
  }
1060
- function r(i) {
1061
- Array.from(i.target.files).forEach(M), i.target.value = "";
1060
+ function o(s) {
1061
+ Array.from(s.target.files).forEach(T), s.target.value = "";
1062
1062
  }
1063
- async function s(i) {
1063
+ async function r(s) {
1064
1064
  var f;
1065
- if ((f = h.get(i.id)) == null || f.abort(), h.delete(i.id), p.value = p.value.filter((I) => I.id !== i.id), $(), i.path) {
1066
- w();
1065
+ if ((f = g.get(s.id)) == null || f.abort(), g.delete(s.id), u.value = u.value.filter((S) => S.id !== s.id), b(), s.path) {
1066
+ y();
1067
1067
  try {
1068
1068
  await fetch(e.endpoint, {
1069
1069
  method: "DELETE",
1070
- headers: Oe(e.headers),
1070
+ headers: De(e.headers),
1071
1071
  credentials: "same-origin",
1072
- body: i.path
1072
+ body: s.path
1073
1073
  });
1074
1074
  } catch {
1075
1075
  }
1076
1076
  }
1077
- t("removed", i);
1077
+ n("removed", s);
1078
1078
  }
1079
- return z(
1079
+ return H(
1080
1080
  () => l.model.value,
1081
- (i) => {
1082
- (i == null || i === "" || Array.isArray(i) && !i.length) && p.value.some((I) => I.path) && (p.value = p.value.filter((I) => !I.path));
1081
+ (s) => {
1082
+ (s == null || s === "" || Array.isArray(s) && !s.length) && u.value.some((S) => S.path) && (u.value = u.value.filter((S) => !S.path));
1083
1083
  }
1084
- ), o({ clear: () => p.value.slice().forEach(s) }), { ...l, t: d, input: n, files: p, onSelect: r, remove: s, retry: k, size: (i) => `${Math.round(i / 1024)}KB` };
1084
+ ), a({ clear: () => u.value.slice().forEach(r) }), { ...l, t: c, input: t, files: u, onSelect: o, remove: r, retry: w, size: (s) => `${Math.round(s / 1024)}KB` };
1085
1085
  }
1086
- }), Mn = { class: "file-input-uploader" }, Tn = ["name", "id", "multiple", "accept", "required", "disabled", "aria-invalid"], Bn = {
1086
+ }), Nt = { class: "file-input-uploader" }, Dt = ["name", "id", "multiple", "accept", "required", "disabled", "aria-invalid"], qt = {
1087
1087
  key: 0,
1088
1088
  class: "list-group mt-2"
1089
- }, En = { class: "d-flex align-items-center justify-content-between gap-2" }, An = { class: "text-truncate" }, On = { class: "d-flex align-items-center gap-2" }, Nn = {
1089
+ }, Ft = { class: "d-flex align-items-center justify-content-between gap-2" }, Lt = { class: "text-truncate" }, Rt = { class: "d-flex align-items-center gap-2" }, jt = {
1090
1090
  class: "fg-secondary fanum",
1091
1091
  dir: "ltr"
1092
- }, Dn = ["aria-label", "onClick"], Vn = ["aria-label", "onClick"], qn = ["aria-valuenow"], Fn = {
1092
+ }, Pt = ["aria-label", "onClick"], zt = ["aria-label", "onClick"], Ut = ["aria-valuenow"], Ht = {
1093
1093
  key: 1,
1094
1094
  class: "fg-danger mt-1",
1095
1095
  role: "alert"
1096
1096
  };
1097
- function Ln(e, t, o, l, d, u) {
1098
- return c(), v("div", Mn, [
1099
- m("input", {
1097
+ function Kt(e, n, a, l, c, i) {
1098
+ return m(), h("div", Nt, [
1099
+ p("input", {
1100
1100
  ref: "input",
1101
1101
  type: "file",
1102
- class: D(["form-control", { "is-invalid": e.isInvalid }]),
1102
+ class: q(["form-control", { "is-invalid": e.isInvalid }]),
1103
1103
  name: e.name,
1104
1104
  id: e.inputId,
1105
1105
  multiple: e.multiple,
@@ -1107,25 +1107,25 @@ function Ln(e, t, o, l, d, u) {
1107
1107
  required: e.required && !e.files.length,
1108
1108
  disabled: e.isDisabled || e.readonly,
1109
1109
  "aria-invalid": e.isInvalid || void 0,
1110
- onChange: t[0] || (t[0] = (...n) => e.onSelect && e.onSelect(...n))
1111
- }, null, 42, Tn),
1112
- e.files.length ? (c(), v("ul", Bn, [
1113
- (c(!0), v(X, null, ee(e.files, (n) => (c(), v("li", {
1114
- key: n.id,
1110
+ onChange: n[0] || (n[0] = (...t) => e.onSelect && e.onSelect(...t))
1111
+ }, null, 42, Dt),
1112
+ e.files.length ? (m(), h("ul", qt, [
1113
+ (m(!0), h(G, null, ae(e.files, (t) => (m(), h("li", {
1114
+ key: t.id,
1115
1115
  class: "list-group-item"
1116
1116
  }, [
1117
- m("div", En, [
1118
- m("span", An, O(n.file.name), 1),
1119
- m("span", On, [
1120
- m("span", Nn, O(e.size(n.file.size)), 1),
1121
- n.error ? (c(), v("button", {
1117
+ p("div", Ft, [
1118
+ p("span", Lt, V(t.file.name), 1),
1119
+ p("span", Rt, [
1120
+ p("span", jt, V(e.size(t.file.size)), 1),
1121
+ t.error ? (m(), h("button", {
1122
1122
  key: 0,
1123
1123
  type: "button",
1124
1124
  class: "btn-text theme-secondary btn-icon",
1125
1125
  "aria-label": e.t("file.retry"),
1126
- onClick: (p) => e.retry(n)
1127
- }, t[1] || (t[1] = [
1128
- m("svg", {
1126
+ onClick: (u) => e.retry(t)
1127
+ }, n[1] || (n[1] = [
1128
+ p("svg", {
1129
1129
  width: "16",
1130
1130
  height: "16",
1131
1131
  viewBox: "0 0 16 16",
@@ -1136,18 +1136,18 @@ function Ln(e, t, o, l, d, u) {
1136
1136
  "stroke-linejoin": "round",
1137
1137
  "aria-hidden": "true"
1138
1138
  }, [
1139
- m("path", { d: "M13.5 3v3.5H10" }),
1140
- m("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5M2.5 13V9.5H6" })
1139
+ p("path", { d: "M13.5 3v3.5H10" }),
1140
+ p("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5M2.5 13V9.5H6" })
1141
1141
  ], -1)
1142
- ]), 8, Dn)) : B("", !0),
1143
- n.path || n.error ? (c(), v("button", {
1142
+ ]), 8, Pt)) : M("", !0),
1143
+ t.path || t.error ? (m(), h("button", {
1144
1144
  key: 1,
1145
1145
  type: "button",
1146
1146
  class: "btn-text theme-danger btn-icon",
1147
1147
  "aria-label": e.t("file.remove"),
1148
- onClick: (p) => e.remove(n)
1149
- }, t[2] || (t[2] = [
1150
- m("svg", {
1148
+ onClick: (u) => e.remove(t)
1149
+ }, n[2] || (n[2] = [
1150
+ p("svg", {
1151
1151
  width: "16",
1152
1152
  height: "16",
1153
1153
  viewBox: "0 0 16 16",
@@ -1157,35 +1157,35 @@ function Ln(e, t, o, l, d, u) {
1157
1157
  "stroke-linecap": "round",
1158
1158
  "aria-hidden": "true"
1159
1159
  }, [
1160
- m("path", { d: "m4 4 8 8M12 4l-8 8" })
1160
+ p("path", { d: "m4 4 8 8M12 4l-8 8" })
1161
1161
  ], -1)
1162
- ]), 8, Vn)) : B("", !0)
1162
+ ]), 8, zt)) : M("", !0)
1163
1163
  ])
1164
1164
  ]),
1165
- n.uploading ? (c(), v("div", {
1165
+ t.uploading ? (m(), h("div", {
1166
1166
  key: 0,
1167
1167
  class: "progress mt-2",
1168
1168
  role: "progressbar",
1169
- "aria-valuenow": n.percent,
1169
+ "aria-valuenow": t.percent,
1170
1170
  "aria-valuemin": "0",
1171
1171
  "aria-valuemax": "100"
1172
1172
  }, [
1173
- m("div", {
1173
+ p("div", {
1174
1174
  class: "progress-bar",
1175
- style: oe({ width: n.percent + "%" })
1175
+ style: se({ width: t.percent + "%" })
1176
1176
  }, null, 4)
1177
- ], 8, qn)) : B("", !0),
1178
- n.error ? (c(), v("div", Fn, O(n.error), 1)) : B("", !0)
1177
+ ], 8, Ut)) : M("", !0),
1178
+ t.error ? (m(), h("div", Ht, V(t.error), 1)) : M("", !0)
1179
1179
  ]))), 128))
1180
- ])) : B("", !0)
1180
+ ])) : M("", !0)
1181
1181
  ]);
1182
1182
  }
1183
- const ot = /* @__PURE__ */ q(Cn, [["render", Ln]]), jn = V({
1183
+ const fn = /* @__PURE__ */ L(Vt, [["render", Kt]]), Xt = F({
1184
1184
  name: "FormAdornInput",
1185
1185
  inheritAttrs: !1,
1186
1186
  emits: ["update:modelValue", "change", "input", "focus", "blur"],
1187
1187
  props: {
1188
- ...j,
1188
+ ...z,
1189
1189
  type: { type: String, default: "text" },
1190
1190
  placeholder: { type: String, default: null },
1191
1191
  /** Text shown before the input. */
@@ -1194,37 +1194,37 @@ const ot = /* @__PURE__ */ q(Cn, [["render", Ln]]), jn = V({
1194
1194
  endText: { type: String, default: null },
1195
1195
  size: { type: String, default: null }
1196
1196
  },
1197
- setup(e, { emit: t }) {
1198
- const o = R(e, t), l = E(null), d = C(() => e.size ? `form-control-${e.size}` : null);
1199
- function u(n) {
1200
- var p, h, b;
1201
- (n.target === n.currentTarget || (h = (p = n.target).closest) != null && h.call(p, ".form-adorn-icon, .form-adorn-text")) && ((b = l.value) == null || b.focus());
1197
+ setup(e, { emit: n }) {
1198
+ const a = U(e, n), l = E(null), c = C(() => e.size ? `form-control-${e.size}` : null);
1199
+ function i(t) {
1200
+ var u, g, $;
1201
+ (t.target === t.currentTarget || (g = (u = t.target).closest) != null && g.call(u, ".form-adorn-icon, .form-adorn-text")) && (($ = l.value) == null || $.focus());
1202
1202
  }
1203
- return { ...o, input: l, sizeClass: d, focusInput: u, emit: t, focus: () => {
1204
- var n;
1205
- return (n = l.value) == null ? void 0 : n.focus();
1203
+ return { ...a, input: l, sizeClass: c, focusInput: i, emit: n, focus: () => {
1204
+ var t;
1205
+ return (t = l.value) == null ? void 0 : t.focus();
1206
1206
  } };
1207
1207
  },
1208
1208
  expose: ["focus"]
1209
- }), Rn = {
1209
+ }), Gt = {
1210
1210
  key: 0,
1211
1211
  class: "form-adorn-text"
1212
- }, zn = ["name", "id", "type", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Pn = {
1212
+ }, Wt = ["name", "id", "type", "placeholder", "required", "readonly", "disabled", "aria-invalid"], Qt = {
1213
1213
  key: 0,
1214
1214
  class: "form-adorn-text"
1215
1215
  };
1216
- function Un(e, t, o, l, d, u) {
1217
- return c(), v("div", {
1218
- class: D(["form-control form-adorn", [e.sizeClass, { "is-invalid": e.isInvalid }, e.$attrs.class]]),
1219
- style: oe(e.$attrs.style),
1220
- onClick: t[5] || (t[5] = (...n) => e.focusInput && e.focusInput(...n))
1216
+ function Jt(e, n, a, l, c, i) {
1217
+ return m(), h("div", {
1218
+ class: q(["form-control form-adorn", [e.sizeClass, { "is-invalid": e.isInvalid }, e.$attrs.class]]),
1219
+ style: se(e.$attrs.style),
1220
+ onClick: n[5] || (n[5] = (...t) => e.focusInput && e.focusInput(...t))
1221
1221
  }, [
1222
- F(e.$slots, "start", {}, () => [
1223
- e.startText ? (c(), v("span", Rn, O(e.startText), 1)) : B("", !0)
1222
+ j(e.$slots, "start", {}, () => [
1223
+ e.startText ? (m(), h("span", Gt, V(e.startText), 1)) : M("", !0)
1224
1224
  ]),
1225
- te(m("input", je({
1225
+ re(p("input", Ke({
1226
1226
  ref: "input",
1227
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.model = n)
1227
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t)
1228
1228
  }, { ...e.$attrs, class: void 0, style: void 0 }, {
1229
1229
  name: e.name,
1230
1230
  id: e.inputId,
@@ -1235,30 +1235,30 @@ function Un(e, t, o, l, d, u) {
1235
1235
  disabled: e.isDisabled,
1236
1236
  "aria-invalid": e.isInvalid || void 0,
1237
1237
  class: ["form-ghost", { "is-invalid": e.isInvalid }],
1238
- onInput: t[1] || (t[1] = (n) => e.emit("input", e.model, n)),
1239
- onChange: t[2] || (t[2] = (n) => e.emitChange(e.model, n)),
1240
- onFocus: t[3] || (t[3] = (n) => e.$emit("focus", n)),
1241
- onBlur: t[4] || (t[4] = (n) => e.$emit("blur", n))
1242
- }), null, 16, zn), [
1243
- [$e, e.model]
1238
+ onInput: n[1] || (n[1] = (t) => e.emit("input", e.model, t)),
1239
+ onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
1240
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
1241
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
1242
+ }), null, 16, Wt), [
1243
+ [ke, e.model]
1244
1244
  ]),
1245
- F(e.$slots, "end", {}, () => [
1246
- e.endText ? (c(), v("span", Pn, O(e.endText), 1)) : B("", !0)
1245
+ j(e.$slots, "end", {}, () => [
1246
+ e.endText ? (m(), h("span", Qt, V(e.endText), 1)) : M("", !0)
1247
1247
  ])
1248
1248
  ], 6);
1249
1249
  }
1250
- const He = /* @__PURE__ */ q(jn, [["render", Un]]), Hn = (e) => e !== null && typeof e == "object" && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null);
1251
- function ze(e) {
1252
- return typeof e == "string" ? Ue(e) : Array.isArray(e) ? e.map(ze) : Hn(e) ? Object.keys(e).reduce((t, o) => (t[o] = ze(e[o]), t), {}) : e;
1250
+ const Ze = /* @__PURE__ */ L(Xt, [["render", Jt]]), Zt = (e) => e !== null && typeof e == "object" && (Object.getPrototypeOf(e) === Object.prototype || Object.getPrototypeOf(e) === null);
1251
+ function Ge(e) {
1252
+ return typeof e == "string" ? Je(e) : Array.isArray(e) ? e.map(Ge) : Zt(e) ? Object.keys(e).reduce((n, a) => (n[a] = Ge(e[a]), n), {}) : e;
1253
1253
  }
1254
- function Ze(e, t) {
1254
+ function ln(e, n) {
1255
1255
  try {
1256
- return JSON.stringify(e) === JSON.stringify(t);
1256
+ return JSON.stringify(e) === JSON.stringify(n);
1257
1257
  } catch {
1258
1258
  return !1;
1259
1259
  }
1260
1260
  }
1261
- const Kn = V({
1261
+ const Yt = F({
1262
1262
  name: "FormContainer",
1263
1263
  emits: [
1264
1264
  "update:modelValue",
@@ -1302,154 +1302,154 @@ const Kn = V({
1302
1302
  /** Hide the built-in error / success alerts. */
1303
1303
  hideAlerts: { type: Boolean, default: !1 }
1304
1304
  },
1305
- setup(e, { emit: t, expose: o }) {
1306
- const l = E(null), d = ye({ hasMessage: !1, successMessage: null }), u = ht({
1305
+ setup(e, { emit: n, expose: a }) {
1306
+ const l = E(null), c = ie({ hasMessage: !1, successMessage: null }), i = Sn({
1307
1307
  ...e.options,
1308
1308
  ...e.modelValue
1309
1309
  });
1310
- u.uploading = null, u.getID = function(r = {}) {
1311
- var i;
1312
- const s = [];
1313
- return (i = l.value) != null && i.id && s.push(l.value.id), typeof r == "string" && s.push(r), r.group && (r.group.name && s.push(r.group.name), r.group.index !== void 0 && r.group.index !== null && s.push(r.group.index)), r.name && s.push(r.name), r.value !== void 0 && r.value !== null && r.value !== "" && s.push(r.value), s.join("-");
1310
+ i.uploading = null, i.getID = function(o = {}) {
1311
+ var s;
1312
+ const r = [];
1313
+ return (s = l.value) != null && s.id && r.push(l.value.id), typeof o == "string" && r.push(o), o.group && (o.group.name && r.push(o.group.name), o.group.index !== void 0 && o.group.index !== null && r.push(o.group.index)), o.name && r.push(o.name), o.value !== void 0 && o.value !== null && o.value !== "" && r.push(o.value), r.join("-");
1314
1314
  };
1315
- const n = new Set(Object.keys(u)), p = () => Object.keys(u).filter((r) => !n.has(r) && typeof u[r] != "function" && u[r] !== void 0), h = () => {
1316
- const r = typeof u.data == "function" ? { ...u.data() } : Object.keys(u).reduce((s, i) => (n.has(i) && typeof u[i] != "function" && (s[i] = u[i]), s), {});
1317
- return p().forEach((s) => {
1318
- r[s] = u[s];
1319
- }), r;
1320
- }, b = () => {
1321
- p().forEach((r) => delete u[r]), u.reset();
1315
+ const t = new Set(Object.keys(i)), u = () => Object.keys(i).filter((o) => !t.has(o) && typeof i[o] != "function" && i[o] !== void 0), g = () => {
1316
+ const o = typeof i.data == "function" ? { ...i.data() } : Object.keys(i).reduce((r, s) => (t.has(s) && typeof i[s] != "function" && (r[s] = i[s]), r), {});
1317
+ return u().forEach((r) => {
1318
+ o[r] = i[r];
1319
+ }), o;
1320
+ }, $ = () => {
1321
+ u().forEach((o) => delete i[o]), i.reset();
1322
1322
  };
1323
- z(
1324
- () => h(),
1325
- (r) => {
1326
- t("change", r), t("update:modelValue", r);
1323
+ H(
1324
+ () => g(),
1325
+ (o) => {
1326
+ n("change", o), n("update:modelValue", o);
1327
1327
  },
1328
1328
  { deep: !0 }
1329
- ), z(
1329
+ ), H(
1330
1330
  () => e.modelValue,
1331
- (r) => {
1332
- !r || Ze(r, h()) || Object.keys(r).forEach((s) => {
1333
- Ze(u[s], r[s]) || (u[s] = r[s]);
1331
+ (o) => {
1332
+ !o || ln(o, g()) || Object.keys(o).forEach((r) => {
1333
+ ln(i[r], o[r]) || (i[r] = o[r]);
1334
1334
  });
1335
1335
  },
1336
1336
  { deep: !0 }
1337
1337
  );
1338
- function w(r) {
1339
- const s = Array.from(l.value.querySelectorAll("input, select, textarea")).filter(
1338
+ function y(o) {
1339
+ const r = Array.from(l.value.querySelectorAll("input, select, textarea")).filter(
1340
1340
  (f) => !f.disabled && f.tabIndex !== -1 && f.type !== "hidden" && f.offsetParent !== null
1341
- ), i = s[s.indexOf(r) + 1];
1342
- i && (i.focus(), i.tagName !== "SELECT" && typeof i.select == "function" && i.select());
1341
+ ), s = r[r.indexOf(o) + 1];
1342
+ s && (s.focus(), s.tagName !== "SELECT" && typeof s.select == "function" && s.select());
1343
1343
  }
1344
- function $(r) {
1345
- const s = r.target;
1346
- if (!["INPUT", "TEXTAREA"].includes(s.tagName)) return;
1347
- e.autoTab && s.maxLength > 0 && s.value.length >= s.maxLength && w(s);
1348
- const i = parseInt(s.dataset.autoSubmitLength, 10);
1349
- !isNaN(i) && s.value.length >= i && M();
1344
+ function b(o) {
1345
+ const r = o.target;
1346
+ if (!["INPUT", "TEXTAREA"].includes(r.tagName)) return;
1347
+ e.autoTab && r.maxLength > 0 && r.value.length >= r.maxLength && y(r);
1348
+ const s = parseInt(r.dataset.autoSubmitLength, 10);
1349
+ !isNaN(s) && r.value.length >= s && T();
1350
1350
  }
1351
- function k() {
1352
- b(), u.clearErrors(), d.hasMessage = !1, d.successMessage = null, t("reset");
1351
+ function w() {
1352
+ $(), i.clearErrors(), c.hasMessage = !1, c.successMessage = null, n("reset");
1353
1353
  }
1354
- async function M(r) {
1354
+ async function T(o) {
1355
1355
  if (e.submitHandler)
1356
- return e.submitHandler(r, u);
1357
- t("submit", r), u.transform((s) => {
1358
- const i = { ...e.modelValue, ...s, ...h() };
1359
- return e.normalizeDigits ? ze(i) : i;
1356
+ return e.submitHandler(o, i);
1357
+ n("submit", o), i.transform((r) => {
1358
+ const s = { ...e.modelValue, ...r, ...g() };
1359
+ return e.normalizeDigits ? Ge(s) : s;
1360
1360
  }).submit((e.method || "post").toString().toLowerCase(), e.url, {
1361
1361
  only: e.only,
1362
1362
  ...e.visitOptions,
1363
- onBefore: (s) => {
1364
- var i, f;
1365
- return t("before", s), (f = (i = e.visitOptions).onBefore) == null ? void 0 : f.call(i, s);
1363
+ onBefore: (r) => {
1364
+ var s, f;
1365
+ return n("before", r), (f = (s = e.visitOptions).onBefore) == null ? void 0 : f.call(s, r);
1366
1366
  },
1367
- onStart: (s) => {
1368
- var i, f;
1369
- d.hasMessage = !1, d.successMessage = null, u.clearErrors(), t("start", s), t("onStart", s), (f = (i = e.visitOptions).onStart) == null || f.call(i, s);
1367
+ onStart: (r) => {
1368
+ var s, f;
1369
+ c.hasMessage = !1, c.successMessage = null, i.clearErrors(), n("start", r), n("onStart", r), (f = (s = e.visitOptions).onStart) == null || f.call(s, r);
1370
1370
  },
1371
- onProgress: (s) => {
1372
- var i, f;
1373
- t("progress", s), (f = (i = e.visitOptions).onProgress) == null || f.call(i, s);
1371
+ onProgress: (r) => {
1372
+ var s, f;
1373
+ n("progress", r), (f = (s = e.visitOptions).onProgress) == null || f.call(s, r);
1374
1374
  },
1375
1375
  onCancel: () => {
1376
- var s, i;
1377
- t("cancel"), (i = (s = e.visitOptions).onCancel) == null || i.call(s);
1376
+ var r, s;
1377
+ n("cancel"), (s = (r = e.visitOptions).onCancel) == null || s.call(r);
1378
1378
  },
1379
- onFinish: (s) => {
1380
- var i, f;
1381
- t("finish", s), t("onFinish", s), (f = (i = e.visitOptions).onFinish) == null || f.call(i, s);
1379
+ onFinish: (r) => {
1380
+ var s, f;
1381
+ n("finish", r), n("onFinish", r), (f = (s = e.visitOptions).onFinish) == null || f.call(s, r);
1382
1382
  },
1383
- onError: (s) => {
1384
- var i, f;
1385
- t("error", s), t("onError", s), (f = (i = e.visitOptions).onError) == null || f.call(i, s);
1383
+ onError: (r) => {
1384
+ var s, f;
1385
+ n("error", r), n("onError", r), (f = (s = e.visitOptions).onError) == null || f.call(s, r);
1386
1386
  },
1387
- onSuccess: (s) => {
1388
- var i, f, I;
1389
- e.resetOnSuccess && b(), (i = s == null ? void 0 : s.props) != null && i.message && (d.hasMessage = !0, d.successMessage = s.props.message), t("success", s), t("onSuccess", s), (I = (f = e.visitOptions).onSuccess) == null || I.call(f, s);
1387
+ onSuccess: (r) => {
1388
+ var s, f, S;
1389
+ e.resetOnSuccess && $(), (s = r == null ? void 0 : r.props) != null && s.message && (c.hasMessage = !0, c.successMessage = r.props.message), n("success", r), n("onSuccess", r), (S = (f = e.visitOptions).onSuccess) == null || S.call(f, r);
1390
1390
  }
1391
1391
  });
1392
1392
  }
1393
- return Ae("form", C(() => u)), Ae("formApi", { submit: M, reset: k, el: l }), o({ submit: M, reset: k, form: u, el: l }), { form: u, formEl: l, ui: d, handleInput: $, reset: k, submit: M };
1393
+ return Ve("form", C(() => i)), Ve("formApi", { submit: T, reset: w, el: l }), a({ submit: T, reset: w, form: i, el: l }), { form: i, formEl: l, ui: c, handleInput: b, reset: w, submit: T };
1394
1394
  }
1395
- }), Xn = ["action", "method", "data-bs-validate", "novalidate"], Gn = {
1395
+ }), xt = ["action", "method", "data-bs-validate", "novalidate"], _t = {
1396
1396
  key: 0,
1397
1397
  class: "alert theme-danger",
1398
1398
  role: "alert"
1399
- }, Wn = { class: "list-unstyled p-0 m-0 fanum" }, Qn = ["innerHTML"], Jn = {
1399
+ }, el = { class: "list-unstyled p-0 m-0 fanum" }, nl = ["innerHTML"], tl = {
1400
1400
  key: 0,
1401
1401
  class: "alert theme-success",
1402
1402
  role: "status"
1403
- }, Zn = ["innerHTML"], Yn = { key: 1 };
1404
- function xn(e, t, o, l, d, u) {
1405
- return c(), v("form", {
1403
+ }, ll = ["innerHTML"], al = { key: 1 };
1404
+ function ol(e, n, a, l, c, i) {
1405
+ return m(), h("form", {
1406
1406
  ref: "formEl",
1407
1407
  action: e.url || void 0,
1408
1408
  method: e.method,
1409
1409
  "data-bs-validate": e.validate ? "" : void 0,
1410
1410
  novalidate: !e.validate || e.form.hasErrors ? !0 : void 0,
1411
- class: D({ "form-processing": e.form.processing }),
1412
- onInput: t[0] || (t[0] = (...n) => e.handleInput && e.handleInput(...n)),
1413
- onSubmit: t[1] || (t[1] = Xe((...n) => e.submit && e.submit(...n), ["prevent"])),
1414
- onReset: t[2] || (t[2] = Xe((...n) => e.reset && e.reset(...n), ["prevent"]))
1411
+ class: q({ "form-processing": e.form.processing }),
1412
+ onInput: n[0] || (n[0] = (...t) => e.handleInput && e.handleInput(...t)),
1413
+ onSubmit: n[1] || (n[1] = _e((...t) => e.submit && e.submit(...t), ["prevent"])),
1414
+ onReset: n[2] || (n[2] = _e((...t) => e.reset && e.reset(...t), ["prevent"]))
1415
1415
  }, [
1416
- e.hideAlerts ? B("", !0) : (c(), v(X, { key: 0 }, [
1417
- F(e.$slots, "errors", {
1416
+ e.hideAlerts ? M("", !0) : (m(), h(G, { key: 0 }, [
1417
+ j(e.$slots, "errors", {
1418
1418
  errors: e.form.errors,
1419
1419
  form: e.form
1420
1420
  }, () => [
1421
- e.form.hasErrors ? (c(), v("div", Gn, [
1422
- m("ul", Wn, [
1423
- (c(!0), v(X, null, ee(e.form.errors, (n, p) => (c(), v("li", { key: p }, [
1424
- e.htmlMessages ? (c(), v("span", {
1421
+ e.form.hasErrors ? (m(), h("div", _t, [
1422
+ p("ul", el, [
1423
+ (m(!0), h(G, null, ae(e.form.errors, (t, u) => (m(), h("li", { key: u }, [
1424
+ e.htmlMessages ? (m(), h("span", {
1425
1425
  key: 0,
1426
- innerHTML: n
1427
- }, null, 8, Qn)) : (c(), v(X, { key: 1 }, [
1428
- Y(O(n), 1)
1426
+ innerHTML: t
1427
+ }, null, 8, nl)) : (m(), h(G, { key: 1 }, [
1428
+ _(V(t), 1)
1429
1429
  ], 64))
1430
1430
  ]))), 128))
1431
1431
  ])
1432
- ])) : B("", !0)
1432
+ ])) : M("", !0)
1433
1433
  ]),
1434
- F(e.$slots, "message", {
1434
+ j(e.$slots, "message", {
1435
1435
  message: e.ui.successMessage
1436
1436
  }, () => [
1437
- e.ui.hasMessage && e.ui.successMessage ? (c(), v("div", Jn, [
1438
- e.htmlMessages ? (c(), v("span", {
1437
+ e.ui.hasMessage && e.ui.successMessage ? (m(), h("div", tl, [
1438
+ e.htmlMessages ? (m(), h("span", {
1439
1439
  key: 0,
1440
1440
  innerHTML: e.ui.successMessage
1441
- }, null, 8, Zn)) : (c(), v("span", Yn, O(e.ui.successMessage), 1))
1442
- ])) : B("", !0)
1441
+ }, null, 8, ll)) : (m(), h("span", al, V(e.ui.successMessage), 1))
1442
+ ])) : M("", !0)
1443
1443
  ])
1444
1444
  ], 64)),
1445
- F(e.$slots, "default", {
1445
+ j(e.$slots, "default", {
1446
1446
  form: e.form,
1447
1447
  submit: e.submit,
1448
1448
  reset: e.reset
1449
1449
  })
1450
- ], 42, Xn);
1450
+ ], 42, xt);
1451
1451
  }
1452
- const _n = /* @__PURE__ */ q(Kn, [["render", xn]]), el = V({
1452
+ const rl = /* @__PURE__ */ L(Yt, [["render", ol]]), sl = F({
1453
1453
  name: "FormLabel",
1454
1454
  props: {
1455
1455
  /** id of the control. Detected automatically inside <FormField> or from the next element. */
@@ -1457,36 +1457,36 @@ const _n = /* @__PURE__ */ q(Kn, [["render", xn]]), el = V({
1457
1457
  required: { type: Boolean, default: !1 }
1458
1458
  },
1459
1459
  setup(e) {
1460
- const t = ce("formField", null), o = E(null), l = E(null);
1461
- Z(() => {
1462
- var n, p;
1463
- if (e.for || t != null && t.id) return;
1464
- const u = (n = o.value) == null ? void 0 : n.nextElementSibling;
1465
- u && (l.value = u.id || ((p = u.querySelector("[id]")) == null ? void 0 : p.id) || null);
1460
+ const n = pe("formField", null), a = E(null), l = E(null);
1461
+ J(() => {
1462
+ var t, u;
1463
+ if (e.for || n != null && n.id) return;
1464
+ const i = (t = a.value) == null ? void 0 : t.nextElementSibling;
1465
+ i && (l.value = i.id || ((u = i.querySelector("[id]")) == null ? void 0 : u.id) || null);
1466
1466
  });
1467
- const d = C(() => e.for || (t == null ? void 0 : t.id) || l.value || void 0);
1468
- return { el: o, target: d };
1467
+ const c = C(() => e.for || (n == null ? void 0 : n.id) || l.value || void 0);
1468
+ return { el: a, target: c };
1469
1469
  }
1470
- }), tl = ["for"], nl = {
1470
+ }), il = ["for"], ul = {
1471
1471
  key: 0,
1472
1472
  class: "fg-danger",
1473
1473
  "aria-hidden": "true"
1474
1474
  };
1475
- function ll(e, t, o, l, d, u) {
1476
- return c(), v("label", {
1475
+ function dl(e, n, a, l, c, i) {
1476
+ return m(), h("label", {
1477
1477
  ref: "el",
1478
1478
  class: "form-label",
1479
1479
  for: e.target
1480
1480
  }, [
1481
- F(e.$slots, "default"),
1482
- e.required ? (c(), v("span", nl, " *")) : B("", !0)
1483
- ], 8, tl);
1481
+ j(e.$slots, "default"),
1482
+ e.required ? (m(), h("span", ul, " *")) : M("", !0)
1483
+ ], 8, il);
1484
1484
  }
1485
- const rt = /* @__PURE__ */ q(el, [["render", ll]]);
1486
- let al = 0;
1487
- const ol = V({
1485
+ const mn = /* @__PURE__ */ L(sl, [["render", dl]]);
1486
+ let cl = 0;
1487
+ const fl = F({
1488
1488
  name: "FormField",
1489
- components: { FormLabel: rt },
1489
+ components: { FormLabel: mn },
1490
1490
  props: {
1491
1491
  /** Field key. Used to read the server-side error of the field. */
1492
1492
  name: { type: String, default: null },
@@ -1498,8 +1498,8 @@ const ol = V({
1498
1498
  id: { type: String, default: null }
1499
1499
  },
1500
1500
  setup(e) {
1501
- const t = ce("form", null), o = Ke.useId ? Ke.useId() : `ff-${++al}`, l = C(() => e.id || (e.name ? `${e.name}-${o}` : o));
1502
- Ae("formField", {
1501
+ const n = pe("form", null), a = xe.useId ? xe.useId() : `ff-${++cl}`, l = C(() => e.id || (e.name ? `${e.name}-${a}` : a));
1502
+ Ve("formField", {
1503
1503
  get id() {
1504
1504
  return l.value;
1505
1505
  },
@@ -1507,47 +1507,47 @@ const ol = V({
1507
1507
  return e.name;
1508
1508
  }
1509
1509
  });
1510
- const d = C(() => {
1511
- var u, n;
1512
- return e.error ?? (e.name ? (n = (u = t == null ? void 0 : t.value) == null ? void 0 : u.errors) == null ? void 0 : n[e.name] : null) ?? null;
1510
+ const c = C(() => {
1511
+ var i, t;
1512
+ return e.error ?? (e.name ? (t = (i = n == null ? void 0 : n.value) == null ? void 0 : i.errors) == null ? void 0 : t[e.name] : null) ?? null;
1513
1513
  });
1514
- return { fieldId: l, errorText: d };
1514
+ return { fieldId: l, errorText: c };
1515
1515
  }
1516
- }), rl = { class: "form-field" }, sl = ["id"], il = ["id"];
1517
- function ul(e, t, o, l, d, u) {
1518
- const n = re("FormLabel");
1519
- return c(), v("div", rl, [
1520
- F(e.$slots, "label", {}, () => [
1521
- e.label ? (c(), be(n, {
1516
+ }), ml = { class: "form-field" }, pl = ["id"], hl = ["id"];
1517
+ function vl(e, n, a, l, c, i) {
1518
+ const t = oe("FormLabel");
1519
+ return m(), h("div", ml, [
1520
+ j(e.$slots, "label", {}, () => [
1521
+ e.label ? (m(), le(t, {
1522
1522
  key: 0,
1523
1523
  for: e.fieldId,
1524
1524
  required: e.required
1525
1525
  }, {
1526
- default: Pe(() => [
1527
- Y(O(e.label), 1)
1526
+ default: Qe(() => [
1527
+ _(V(e.label), 1)
1528
1528
  ]),
1529
1529
  _: 1
1530
- }, 8, ["for", "required"])) : B("", !0)
1530
+ }, 8, ["for", "required"])) : M("", !0)
1531
1531
  ]),
1532
- F(e.$slots, "default"),
1533
- F(e.$slots, "help", {}, () => [
1534
- e.help ? (c(), v("div", {
1532
+ j(e.$slots, "default"),
1533
+ j(e.$slots, "help", {}, () => [
1534
+ e.help ? (m(), h("div", {
1535
1535
  key: 0,
1536
1536
  id: e.fieldId + "-help",
1537
1537
  class: "form-text"
1538
- }, O(e.help), 9, sl)) : B("", !0)
1538
+ }, V(e.help), 9, pl)) : M("", !0)
1539
1539
  ]),
1540
- F(e.$slots, "error", { error: e.errorText }, () => [
1541
- e.errorText ? (c(), v("div", {
1540
+ j(e.$slots, "error", { error: e.errorText }, () => [
1541
+ e.errorText ? (m(), h("div", {
1542
1542
  key: 0,
1543
1543
  id: e.fieldId + "-error",
1544
1544
  class: "invalid-feedback d-block",
1545
1545
  role: "alert"
1546
- }, O(e.errorText), 9, il)) : B("", !0)
1546
+ }, V(e.errorText), 9, hl)) : M("", !0)
1547
1547
  ])
1548
1548
  ]);
1549
1549
  }
1550
- const dl = /* @__PURE__ */ q(ol, [["render", ul]]), fl = V({
1550
+ const gl = /* @__PURE__ */ L(fl, [["render", vl]]), yl = F({
1551
1551
  name: "GroupControl",
1552
1552
  props: {
1553
1553
  /** Key of the object / array inside the form that holds the grouped values. */
@@ -1556,66 +1556,66 @@ const dl = /* @__PURE__ */ q(ol, [["render", ul]]), fl = V({
1556
1556
  index: { type: [Number, String], default: null }
1557
1557
  },
1558
1558
  setup(e) {
1559
- const t = ce("form", null), o = E(null), l = E("0"), d = C(() => e.index !== null ? String(e.index) : l.value);
1560
- Z(() => {
1561
- var p, h, b;
1559
+ const n = pe("form", null), a = E(null), l = E("0"), c = C(() => e.index !== null ? String(e.index) : l.value);
1560
+ J(() => {
1561
+ var u, g, $;
1562
1562
  if (e.index !== null) return;
1563
- const n = (b = (h = (p = o.value) == null ? void 0 : p.parentNode) == null ? void 0 : h.parentNode) == null ? void 0 : b.querySelectorAll(".form-control-group");
1564
- n == null || n.forEach((w, $) => {
1565
- w === o.value && (l.value = String($));
1563
+ const t = ($ = (g = (u = a.value) == null ? void 0 : u.parentNode) == null ? void 0 : g.parentNode) == null ? void 0 : $.querySelectorAll(".form-control-group");
1564
+ t == null || t.forEach((y, b) => {
1565
+ y === a.value && (l.value = String(b));
1566
1566
  });
1567
1567
  });
1568
- const u = {
1568
+ const i = {
1569
1569
  get name() {
1570
1570
  return e.name;
1571
1571
  },
1572
1572
  get index() {
1573
- return d.value;
1573
+ return c.value;
1574
1574
  },
1575
- getData(n) {
1576
- var h, b;
1577
- const p = (h = t == null ? void 0 : t.value) == null ? void 0 : h[e.name];
1578
- return p == null ? null : Array.isArray(p) ? ((b = p[Number(d.value)]) == null ? void 0 : b[n]) ?? null : p[n] ?? null;
1575
+ getData(t) {
1576
+ var g, $;
1577
+ const u = (g = n == null ? void 0 : n.value) == null ? void 0 : g[e.name];
1578
+ return u == null ? null : Array.isArray(u) ? (($ = u[Number(c.value)]) == null ? void 0 : $[t]) ?? null : u[t] ?? null;
1579
1579
  },
1580
- setData(n, p) {
1581
- const h = t == null ? void 0 : t.value;
1582
- if (h)
1583
- if ((h[e.name] === null || h[e.name] === void 0) && (h[e.name] = e.index !== null ? [] : {}), Array.isArray(h[e.name])) {
1584
- const b = Number(d.value);
1585
- h[e.name][b] || (h[e.name][b] = {}), h[e.name][b][n] = p;
1580
+ setData(t, u) {
1581
+ const g = n == null ? void 0 : n.value;
1582
+ if (g)
1583
+ if ((g[e.name] === null || g[e.name] === void 0) && (g[e.name] = e.index !== null ? [] : {}), Array.isArray(g[e.name])) {
1584
+ const $ = Number(c.value);
1585
+ g[e.name][$] || (g[e.name][$] = {}), g[e.name][$][t] = u;
1586
1586
  } else
1587
- h[e.name][n] = p;
1587
+ g[e.name][t] = u;
1588
1588
  }
1589
1589
  };
1590
- return Ae("group", C(() => u)), { groupEl: o, index: d };
1590
+ return Ve("group", C(() => i)), { groupEl: a, index: c };
1591
1591
  }
1592
- }), cl = ["data-name", "data-group-id"];
1593
- function ml(e, t, o, l, d, u) {
1594
- return c(), v("div", {
1592
+ }), bl = ["data-name", "data-group-id"];
1593
+ function $l(e, n, a, l, c, i) {
1594
+ return m(), h("div", {
1595
1595
  ref: "groupEl",
1596
1596
  class: "form-control-group",
1597
1597
  "data-name": e.name,
1598
1598
  "data-group-id": e.index
1599
1599
  }, [
1600
- F(e.$slots, "default")
1601
- ], 8, cl);
1600
+ j(e.$slots, "default")
1601
+ ], 8, bl);
1602
1602
  }
1603
- const st = /* @__PURE__ */ q(fl, [["render", ml]]), pl = V({
1603
+ const pn = /* @__PURE__ */ L(yl, [["render", $l]]), wl = F({
1604
1604
  name: "MobileInput",
1605
- components: { TextInput: qe },
1605
+ components: { TextInput: je },
1606
1606
  props: {
1607
1607
  name: { type: String, default: "mobile" },
1608
1608
  placeholder: { type: String, default: null },
1609
1609
  locale: { type: String, default: null }
1610
1610
  },
1611
1611
  setup(e) {
1612
- const { t } = G(() => e.locale);
1613
- return { t };
1612
+ const { t: n } = Q(() => e.locale);
1613
+ return { t: n };
1614
1614
  }
1615
1615
  });
1616
- function hl(e, t, o, l, d, u) {
1617
- const n = re("TextInput");
1618
- return c(), be(n, {
1616
+ function kl(e, n, a, l, c, i) {
1617
+ const t = oe("TextInput");
1618
+ return m(), le(t, {
1619
1619
  type: "tel",
1620
1620
  inputmode: "tel",
1621
1621
  autocomplete: "tel",
@@ -1624,11 +1624,11 @@ function hl(e, t, o, l, d, u) {
1624
1624
  placeholder: e.placeholder ?? e.t("mobile.placeholder")
1625
1625
  }, null, 8, ["name", "placeholder"]);
1626
1626
  }
1627
- const vl = /* @__PURE__ */ q(pl, [["render", hl]]), gl = V({
1627
+ const Sl = /* @__PURE__ */ L(wl, [["render", kl]]), Il = F({
1628
1628
  name: "QuantityInput",
1629
1629
  emits: ["update:modelValue", "change", "input", "increment", "decrement", "focus", "blur"],
1630
1630
  props: {
1631
- ...j,
1631
+ ...z,
1632
1632
  min: { type: Number, default: 0 },
1633
1633
  max: { type: Number, default: null },
1634
1634
  step: { type: Number, default: 1 },
@@ -1636,52 +1636,52 @@ const vl = /* @__PURE__ */ q(pl, [["render", hl]]), gl = V({
1636
1636
  size: { type: String, default: null },
1637
1637
  locale: { type: String, default: null }
1638
1638
  },
1639
- setup(e, { emit: t }) {
1640
- const o = R(e, t), { t: l } = G(() => e.locale), d = C(() => {
1641
- const k = Number(o.model.value);
1642
- return Number.isFinite(k) ? k : e.min;
1643
- }), u = C(() => e.unit ?? l("quantity.unit")), n = C(() => Ne(d.value)), p = C(() => e.readonly || o.isDisabled.value), h = C(() => !p.value && (e.max === null || d.value + e.step <= e.max)), b = C(() => !p.value && d.value - e.step >= e.min);
1644
- function w(k, M, r) {
1645
- let s = k;
1646
- e.max !== null && (s = Math.min(s, e.max)), s = Math.max(s, e.min), o.model.value = s, r && t(r, s), o.emitChange(s, M);
1639
+ setup(e, { emit: n }) {
1640
+ const a = U(e, n), { t: l } = Q(() => e.locale), c = C(() => {
1641
+ const w = Number(a.model.value);
1642
+ return Number.isFinite(w) ? w : e.min;
1643
+ }), i = C(() => e.unit ?? l("quantity.unit")), t = C(() => qe(c.value)), u = C(() => e.readonly || a.isDisabled.value), g = C(() => !u.value && (e.max === null || c.value + e.step <= e.max)), $ = C(() => !u.value && c.value - e.step >= e.min);
1644
+ function y(w, T, o) {
1645
+ let r = w;
1646
+ e.max !== null && (r = Math.min(r, e.max)), r = Math.max(r, e.min), a.model.value = r, o && n(o, r), a.emitChange(r, T);
1647
1647
  }
1648
- function $(k) {
1649
- const M = lt(k.target.value);
1650
- o.model.value = M === null ? e.min : M, k.target.value = Ne(o.model.value), t("input", o.model.value, k);
1648
+ function b(w) {
1649
+ const T = dn(w.target.value);
1650
+ a.model.value = T === null ? e.min : T, w.target.value = qe(a.model.value), n("input", a.model.value, w);
1651
1651
  }
1652
- return Z(() => {
1653
- const k = o.model.value;
1654
- (k == null || k === "") && (o.model.value = e.min);
1652
+ return J(() => {
1653
+ const w = a.model.value;
1654
+ (w == null || w === "") && (a.model.value = e.min);
1655
1655
  }), {
1656
- ...o,
1656
+ ...a,
1657
1657
  t: l,
1658
- unitText: u,
1659
- display: n,
1660
- canIncrement: h,
1661
- canDecrement: b,
1662
- lock: p,
1663
- increment: (k) => h.value && w(d.value + e.step, k, "increment"),
1664
- decrement: (k) => b.value && w(d.value - e.step, k, "decrement"),
1665
- onInput: $,
1666
- clampOnBlur: (k) => w(d.value, k)
1658
+ unitText: i,
1659
+ display: t,
1660
+ canIncrement: g,
1661
+ canDecrement: $,
1662
+ lock: u,
1663
+ increment: (w) => g.value && y(c.value + e.step, w, "increment"),
1664
+ decrement: (w) => $.value && y(c.value - e.step, w, "decrement"),
1665
+ onInput: b,
1666
+ clampOnBlur: (w) => y(c.value, w)
1667
1667
  };
1668
1668
  }
1669
- }), yl = ["disabled", "aria-label"], bl = ["name", "id", "value", "readonly", "disabled", "aria-invalid"], $l = ["disabled", "aria-label"], wl = {
1669
+ }), Cl = ["disabled", "aria-label"], Tl = ["name", "id", "value", "readonly", "disabled", "aria-invalid"], Ml = ["disabled", "aria-label"], Bl = {
1670
1670
  key: 0,
1671
1671
  class: "input-group-text fanum"
1672
1672
  };
1673
- function kl(e, t, o, l, d, u) {
1674
- return c(), v("div", {
1675
- class: D(["input-group input-group-quantity", { "is-invalid": e.isInvalid }])
1673
+ function El(e, n, a, l, c, i) {
1674
+ return m(), h("div", {
1675
+ class: q(["input-group input-group-quantity", { "is-invalid": e.isInvalid }])
1676
1676
  }, [
1677
- m("button", {
1677
+ p("button", {
1678
1678
  type: "button",
1679
1679
  class: "btn-outline theme-secondary btn-icon",
1680
1680
  disabled: !e.canIncrement,
1681
1681
  "aria-label": e.t("quantity.increase"),
1682
- onClick: t[0] || (t[0] = (...n) => e.increment && e.increment(...n))
1683
- }, t[6] || (t[6] = [
1684
- m("svg", {
1682
+ onClick: n[0] || (n[0] = (...t) => e.increment && e.increment(...t))
1683
+ }, n[6] || (n[6] = [
1684
+ p("svg", {
1685
1685
  width: "14",
1686
1686
  height: "14",
1687
1687
  viewBox: "0 0 16 16",
@@ -1691,10 +1691,10 @@ function kl(e, t, o, l, d, u) {
1691
1691
  "stroke-linecap": "round",
1692
1692
  "aria-hidden": "true"
1693
1693
  }, [
1694
- m("path", { d: "M8 3v10M3 8h10" })
1694
+ p("path", { d: "M8 3v10M3 8h10" })
1695
1695
  ], -1)
1696
- ]), 8, yl),
1697
- m("input", {
1696
+ ]), 8, Cl),
1697
+ p("input", {
1698
1698
  name: e.name,
1699
1699
  id: e.inputId,
1700
1700
  value: e.display,
@@ -1704,20 +1704,20 @@ function kl(e, t, o, l, d, u) {
1704
1704
  type: "tel",
1705
1705
  inputmode: "numeric",
1706
1706
  autocomplete: "off",
1707
- class: D(["form-control fanum text-center", { "is-invalid": e.isInvalid }]),
1708
- onInput: t[1] || (t[1] = (...n) => e.onInput && e.onInput(...n)),
1709
- onChange: t[2] || (t[2] = (...n) => e.clampOnBlur && e.clampOnBlur(...n)),
1710
- onFocus: t[3] || (t[3] = (n) => e.$emit("focus", n)),
1711
- onBlur: t[4] || (t[4] = (n) => e.$emit("blur", n))
1712
- }, null, 42, bl),
1713
- m("button", {
1707
+ class: q(["form-control fanum text-center", { "is-invalid": e.isInvalid }]),
1708
+ onInput: n[1] || (n[1] = (...t) => e.onInput && e.onInput(...t)),
1709
+ onChange: n[2] || (n[2] = (...t) => e.clampOnBlur && e.clampOnBlur(...t)),
1710
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
1711
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
1712
+ }, null, 42, Tl),
1713
+ p("button", {
1714
1714
  type: "button",
1715
1715
  class: "btn-outline theme-secondary btn-icon",
1716
1716
  disabled: !e.canDecrement,
1717
1717
  "aria-label": e.t("quantity.decrease"),
1718
- onClick: t[5] || (t[5] = (...n) => e.decrement && e.decrement(...n))
1719
- }, t[7] || (t[7] = [
1720
- m("svg", {
1718
+ onClick: n[5] || (n[5] = (...t) => e.decrement && e.decrement(...t))
1719
+ }, n[7] || (n[7] = [
1720
+ p("svg", {
1721
1721
  width: "14",
1722
1722
  height: "14",
1723
1723
  viewBox: "0 0 16 16",
@@ -1727,19 +1727,19 @@ function kl(e, t, o, l, d, u) {
1727
1727
  "stroke-linecap": "round",
1728
1728
  "aria-hidden": "true"
1729
1729
  }, [
1730
- m("path", { d: "M3 8h10" })
1730
+ p("path", { d: "M3 8h10" })
1731
1731
  ], -1)
1732
- ]), 8, $l),
1733
- e.unitText ? (c(), v("span", wl, O(e.unitText), 1)) : B("", !0),
1734
- F(e.$slots, "suffix")
1732
+ ]), 8, Ml),
1733
+ e.unitText ? (m(), h("span", Bl, V(e.unitText), 1)) : M("", !0),
1734
+ j(e.$slots, "suffix")
1735
1735
  ], 2);
1736
1736
  }
1737
- const it = /* @__PURE__ */ q(gl, [["render", kl]]), Sl = V({
1737
+ const hn = /* @__PURE__ */ L(Il, [["render", El]]), Al = F({
1738
1738
  name: "MultiQuantityInput",
1739
- components: { GroupControl: st, QuantityInput: it },
1739
+ components: { GroupControl: pn, QuantityInput: hn },
1740
1740
  emits: ["update:modelValue", "change", "show", "shown", "hide", "hidden"],
1741
1741
  props: {
1742
- ...j,
1742
+ ...z,
1743
1743
  /** Array of strings or { name, min, max, description, html }. */
1744
1744
  options: { type: Array, default: () => [] },
1745
1745
  min: { type: Number, default: 0 },
@@ -1750,75 +1750,75 @@ const it = /* @__PURE__ */ q(gl, [["render", kl]]), Sl = V({
1750
1750
  placement: { type: String, default: "bottom-start" },
1751
1751
  locale: { type: String, default: null }
1752
1752
  },
1753
- setup(e, { emit: t }) {
1754
- const o = R(e, t), { t: l } = G(() => e.locale), d = E(null), u = C(() => {
1755
- const b = o.model.value;
1756
- return b && typeof b == "object" ? b : {};
1757
- }), n = C(
1758
- () => e.options.reduce((b, w, $) => b + (Number(u.value[$]) || 0), 0)
1759
- ), p = C(() => e.unit ?? l("quantity.unit")), h = C(
1760
- () => e.options.map((b, w) => {
1761
- const $ = typeof b == "object" && b !== null ? b : { name: b }, k = Number(u.value[w]) || 0, M = $.max ?? e.max, r = e.totalMax === null ? 1 / 0 : k + (e.totalMax - n.value);
1753
+ setup(e, { emit: n }) {
1754
+ const a = U(e, n), { t: l } = Q(() => e.locale), c = E(null), i = C(() => {
1755
+ const $ = a.model.value;
1756
+ return $ && typeof $ == "object" ? $ : {};
1757
+ }), t = C(
1758
+ () => e.options.reduce(($, y, b) => $ + (Number(i.value[b]) || 0), 0)
1759
+ ), u = C(() => e.unit ?? l("quantity.unit")), g = C(
1760
+ () => e.options.map(($, y) => {
1761
+ const b = typeof $ == "object" && $ !== null ? $ : { name: $ }, w = Number(i.value[y]) || 0, T = b.max ?? e.max, o = e.totalMax === null ? 1 / 0 : w + (e.totalMax - t.value);
1762
1762
  return {
1763
- key: w,
1764
- name: $.name ?? $.label ?? String(b),
1765
- description: $.description ?? null,
1766
- html: !!$.html,
1767
- min: $.min ?? e.min,
1768
- max: Math.min(M ?? 1 / 0, r) === 1 / 0 ? null : Math.min(M ?? 1 / 0, r)
1763
+ key: y,
1764
+ name: b.name ?? b.label ?? String($),
1765
+ description: b.description ?? null,
1766
+ html: !!b.html,
1767
+ min: b.min ?? e.min,
1768
+ max: Math.min(T ?? 1 / 0, o) === 1 / 0 ? null : Math.min(T ?? 1 / 0, o)
1769
1769
  };
1770
1770
  })
1771
1771
  );
1772
- return Z(() => {
1773
- (!o.model.value || typeof o.model.value != "object") && (o.model.value = e.options.reduce((b, w, $) => (b[$] = typeof w == "object" && (w == null ? void 0 : w.min) || e.min, b), {}));
1774
- }), me(
1772
+ return J(() => {
1773
+ (!a.model.value || typeof a.model.value != "object") && (a.model.value = e.options.reduce(($, y, b) => ($[b] = typeof y == "object" && (y == null ? void 0 : y.min) || e.min, $), {}));
1774
+ }), he(
1775
1775
  "Menu",
1776
- () => d.value,
1776
+ () => c.value,
1777
1777
  () => ({ autoClose: "outside", placement: e.placement }),
1778
1778
  {
1779
- onCreate(b, w) {
1779
+ onCreate($, y) {
1780
1780
  ["show", "shown", "hide", "hidden"].forEach(
1781
- ($) => w.addEventListener(`${$}.bs.menu`, (k) => t($, k))
1781
+ (b) => y.addEventListener(`${b}.bs.menu`, (w) => n(b, w))
1782
1782
  );
1783
1783
  }
1784
1784
  }
1785
- ), { ...o, t: l, toggle: d, total: n, unitText: p, normalized: h };
1785
+ ), { ...a, t: l, toggle: c, total: t, unitText: u, normalized: g };
1786
1786
  }
1787
- }), Il = { class: "multi-quantity-input fanum" }, Cl = ["disabled"], Ml = { class: "combobox-value" }, Tl = { class: "menu p-3" }, Bl = ["innerHTML"], El = { key: 1 }, Al = {
1787
+ }), Ol = { class: "multi-quantity-input fanum" }, Vl = ["disabled"], Nl = { class: "combobox-value" }, Dl = { class: "menu p-3" }, ql = ["innerHTML"], Fl = { key: 1 }, Ll = {
1788
1788
  key: 2,
1789
1789
  class: "form-text mt-0"
1790
1790
  };
1791
- function Ol(e, t, o, l, d, u) {
1792
- const n = re("QuantityInput"), p = re("GroupControl");
1793
- return c(), v("div", Il, [
1794
- m("button", {
1791
+ function Rl(e, n, a, l, c, i) {
1792
+ const t = oe("QuantityInput"), u = oe("GroupControl");
1793
+ return m(), h("div", Ol, [
1794
+ p("button", {
1795
1795
  ref: "toggle",
1796
1796
  type: "button",
1797
- class: D(["form-control combobox-toggle", { "is-invalid": e.isInvalid }]),
1797
+ class: q(["form-control combobox-toggle", { "is-invalid": e.isInvalid }]),
1798
1798
  "data-bs-toggle": "menu",
1799
1799
  "aria-haspopup": "true",
1800
1800
  disabled: e.isDisabled || e.readonly
1801
1801
  }, [
1802
- m("span", Ml, O(e.total) + " " + O(e.unitText), 1)
1803
- ], 10, Cl),
1804
- m("div", Tl, [
1805
- Ge(p, { name: e.name }, {
1806
- default: Pe(() => [
1807
- (c(!0), v(X, null, ee(e.normalized, (h) => (c(), v("div", {
1808
- key: h.key,
1802
+ p("span", Nl, V(e.total) + " " + V(e.unitText), 1)
1803
+ ], 10, Vl),
1804
+ p("div", Dl, [
1805
+ Ne(u, { name: e.name }, {
1806
+ default: Qe(() => [
1807
+ (m(!0), h(G, null, ae(e.normalized, (g) => (m(), h("div", {
1808
+ key: g.key,
1809
1809
  class: "d-flex align-items-center justify-content-between gap-3 py-1"
1810
1810
  }, [
1811
- m("div", null, [
1812
- h.html ? (c(), v("span", {
1811
+ p("div", null, [
1812
+ g.html ? (m(), h("span", {
1813
1813
  key: 0,
1814
- innerHTML: h.name
1815
- }, null, 8, Bl)) : (c(), v("span", El, O(h.name), 1)),
1816
- h.description ? (c(), v("div", Al, O(h.description), 1)) : B("", !0)
1814
+ innerHTML: g.name
1815
+ }, null, 8, ql)) : (m(), h("span", Fl, V(g.name), 1)),
1816
+ g.description ? (m(), h("div", Ll, V(g.description), 1)) : M("", !0)
1817
1817
  ]),
1818
- Ge(n, {
1819
- name: String(h.key),
1820
- min: h.min,
1821
- max: h.max,
1818
+ Ne(t, {
1819
+ name: String(g.key),
1820
+ min: g.min,
1821
+ max: g.max,
1822
1822
  readonly: e.readonly,
1823
1823
  unit: ""
1824
1824
  }, null, 8, ["name", "min", "max", "readonly"])
@@ -1829,11 +1829,11 @@ function Ol(e, t, o, l, d, u) {
1829
1829
  ])
1830
1830
  ]);
1831
1831
  }
1832
- const Nl = /* @__PURE__ */ q(Sl, [["render", Ol]]), Dl = V({
1832
+ const jl = /* @__PURE__ */ L(Al, [["render", Rl]]), Pl = F({
1833
1833
  name: "OTPInput",
1834
1834
  emits: ["update:modelValue", "change", "input", "complete", "focus", "blur"],
1835
1835
  props: {
1836
- ...j,
1836
+ ...z,
1837
1837
  /** Number of characters. */
1838
1838
  length: { type: Number, default: null },
1839
1839
  /** Legacy alias of `length`. */
@@ -1849,80 +1849,80 @@ const Nl = /* @__PURE__ */ q(Sl, [["render", Ol]]), Dl = V({
1849
1849
  autoSubmit: { type: Boolean, default: !1 },
1850
1850
  autofocus: { type: Boolean, default: !1 }
1851
1851
  },
1852
- setup(e, { emit: t, expose: o }) {
1853
- const l = R(e, t), d = E(null), u = E(null);
1854
- let n = !1, p = [];
1855
- const h = () => e.length ?? e.maxLength ?? 6, b = (r) => r == null ? "" : String(r);
1856
- function w() {
1857
- var r;
1858
- (r = u.value) == null || r.classList.toggle("is-invalid", l.isInvalid.value);
1852
+ setup(e, { emit: n, expose: a }) {
1853
+ const l = U(e, n), c = E(null), i = E(null);
1854
+ let t = !1, u = [];
1855
+ const g = () => e.length ?? e.maxLength ?? 6, $ = (o) => o == null ? "" : String(o);
1856
+ function y() {
1857
+ var o;
1858
+ (o = i.value) == null || o.classList.toggle("is-invalid", l.isInvalid.value);
1859
1859
  }
1860
- function $() {
1861
- const r = k.value;
1862
- if (!r) return;
1863
- const s = b(l.model.value);
1864
- if (r.getValue() !== s) {
1865
- n = !0;
1860
+ function b() {
1861
+ const o = w.value;
1862
+ if (!o) return;
1863
+ const r = $(l.model.value);
1864
+ if (o.getValue() !== r) {
1865
+ t = !0;
1866
1866
  try {
1867
- r.setValue(s);
1867
+ o.setValue(r);
1868
1868
  } finally {
1869
- n = !1;
1869
+ t = !1;
1870
1870
  }
1871
1871
  }
1872
1872
  }
1873
- const { instance: k, create: M } = me(
1873
+ const { instance: w, create: T } = he(
1874
1874
  "OtpInput",
1875
- () => d.value,
1875
+ () => c.value,
1876
1876
  () => ({
1877
- length: h(),
1877
+ length: g(),
1878
1878
  type: e.type,
1879
1879
  mask: e.mask,
1880
1880
  groups: e.groups,
1881
1881
  separator: e.separator
1882
1882
  }),
1883
1883
  {
1884
- onCreate(r, s) {
1885
- const i = (f, I) => {
1886
- s.addEventListener(f, I), p.push(() => s.removeEventListener(f, I));
1884
+ onCreate(o, r) {
1885
+ const s = (f, S) => {
1886
+ r.addEventListener(f, S), u.push(() => r.removeEventListener(f, S));
1887
1887
  };
1888
- i("input.bs.otpInput", (f) => {
1889
- n || (l.model.value = f.value, t("input", f.value, f), l.emitChange(f.value, f));
1890
- }), i("complete.bs.otpInput", (f) => {
1891
- var I, L;
1892
- n || (t("complete", f.value), e.autoSubmit && ((L = (I = l.formApi) == null ? void 0 : I.submit) == null || L.call(I)));
1893
- }), $(), w(), e.autofocus && r.focus();
1888
+ s("input.bs.otpInput", (f) => {
1889
+ t || (l.model.value = f.value, n("input", f.value, f), l.emitChange(f.value, f));
1890
+ }), s("complete.bs.otpInput", (f) => {
1891
+ var S, R;
1892
+ t || (n("complete", f.value), e.autoSubmit && ((R = (S = l.formApi) == null ? void 0 : S.submit) == null || R.call(S)));
1893
+ }), b(), y(), e.autofocus && o.focus();
1894
1894
  },
1895
1895
  onDestroy() {
1896
- p.forEach((r) => r()), p = [];
1896
+ u.forEach((o) => o()), u = [];
1897
1897
  }
1898
1898
  }
1899
1899
  );
1900
- return Z(() => {
1901
- u.value && (u.value.value = b(l.model.value));
1902
- }), z(() => l.model.value, $), z(l.isInvalid, w, { flush: "post" }), z(
1903
- () => [h(), e.type, e.mask, e.groups, e.separator],
1900
+ return J(() => {
1901
+ i.value && (i.value.value = $(l.model.value));
1902
+ }), H(() => l.model.value, b), H(l.isInvalid, y, { flush: "post" }), H(
1903
+ () => [g(), e.type, e.mask, e.groups, e.separator],
1904
1904
  async () => {
1905
- await K(), M();
1905
+ await W(), T();
1906
1906
  },
1907
1907
  { deep: !0 }
1908
- ), o({
1908
+ ), a({
1909
1909
  focus: () => {
1910
- var r;
1911
- return (r = k.value) == null ? void 0 : r.focus();
1910
+ var o;
1911
+ return (o = w.value) == null ? void 0 : o.focus();
1912
1912
  },
1913
1913
  clear: () => {
1914
- var r;
1915
- (r = k.value) == null || r.clear(), l.model.value = "";
1914
+ var o;
1915
+ (o = w.value) == null || o.clear(), l.model.value = "";
1916
1916
  }
1917
- }), { ...l, el: d, input: u };
1917
+ }), { ...l, el: c, input: i };
1918
1918
  }
1919
- }), Vl = {
1919
+ }), zl = {
1920
1920
  ref: "el",
1921
1921
  class: "otp fanum"
1922
- }, ql = ["name", "id", "disabled", "readonly", "required", "aria-invalid"];
1923
- function Fl(e, t, o, l, d, u) {
1924
- return c(), v("div", Vl, [
1925
- m("input", {
1922
+ }, Ul = ["name", "id", "disabled", "readonly", "required", "aria-invalid"];
1923
+ function Hl(e, n, a, l, c, i) {
1924
+ return m(), h("div", zl, [
1925
+ p("input", {
1926
1926
  ref: "input",
1927
1927
  type: "text",
1928
1928
  name: e.name,
@@ -1931,21 +1931,21 @@ function Fl(e, t, o, l, d, u) {
1931
1931
  readonly: e.readonly,
1932
1932
  required: e.required,
1933
1933
  "aria-invalid": e.isInvalid || void 0,
1934
- onFocus: t[0] || (t[0] = (n) => e.$emit("focus", n)),
1935
- onBlur: t[1] || (t[1] = (n) => e.$emit("blur", n))
1936
- }, null, 40, ql)
1934
+ onFocus: n[0] || (n[0] = (t) => e.$emit("focus", t)),
1935
+ onBlur: n[1] || (n[1] = (t) => e.$emit("blur", t))
1936
+ }, null, 40, Ul)
1937
1937
  ], 512);
1938
1938
  }
1939
- const Ll = /* @__PURE__ */ q(Dl, [["render", Fl]]), Ye = {
1939
+ const Kl = /* @__PURE__ */ L(Pl, [["render", Hl]]), an = {
1940
1940
  en: { weak: "Weak", fair: "Fair", good: "Good", strong: "Strong" },
1941
1941
  fa: { weak: "ضعیف", fair: "متوسط", good: "خوب", strong: "قوی" }
1942
- }, jl = V({
1942
+ }, Xl = F({
1943
1943
  name: "PasswordInput",
1944
- components: { TextInput: qe, FormAdornInput: He },
1944
+ components: { TextInput: je, FormAdornInput: Ze },
1945
1945
  inheritAttrs: !1,
1946
1946
  emits: ["toggle", "strength"],
1947
1947
  props: {
1948
- ...j,
1948
+ ...z,
1949
1949
  name: { type: String, default: "password" },
1950
1950
  placeholder: { type: String, default: null },
1951
1951
  /** Show a "reveal password" button. */
@@ -1961,54 +1961,54 @@ const Ll = /* @__PURE__ */ q(Dl, [["render", Fl]]), Ye = {
1961
1961
  size: { type: String, default: null },
1962
1962
  locale: { type: String, default: null }
1963
1963
  },
1964
- setup(e, { emit: t, expose: o }) {
1965
- const { t: l, locale: d } = G(() => e.locale), u = R(e, () => {
1966
- }), n = E(null), p = E(null), h = E(!1), b = C(() => ({
1967
- ...Ye[d.value] || Ye.en,
1964
+ setup(e, { emit: n, expose: a }) {
1965
+ const { t: l, locale: c } = Q(() => e.locale), i = U(e, () => {
1966
+ }), t = E(null), u = E(null), g = E(!1), $ = C(() => ({
1967
+ ...an[c.value] || an.en,
1968
1968
  ...e.strengthMessages || {}
1969
1969
  }));
1970
- function w() {
1971
- h.value = !h.value, t("toggle", h.value);
1970
+ function y() {
1971
+ g.value = !g.value, n("toggle", g.value);
1972
1972
  }
1973
- let $ = [];
1974
- const { instance: k, create: M } = me(
1973
+ let b = [];
1974
+ const { instance: w, create: T } = he(
1975
1975
  "Strength",
1976
- () => e.strength ? p.value : null,
1976
+ () => e.strength ? u.value : null,
1977
1977
  () => {
1978
- var s;
1978
+ var r;
1979
1979
  return {
1980
1980
  ...e.strengthOptions,
1981
- input: (s = n.value) == null ? void 0 : s.querySelector("input"),
1982
- messages: b.value
1981
+ input: (r = t.value) == null ? void 0 : r.querySelector("input"),
1982
+ messages: $.value
1983
1983
  };
1984
1984
  },
1985
1985
  {
1986
- onCreate(s, i) {
1987
- const f = (I) => t("strength", I.strength ?? null, I.score ?? 0);
1988
- i.addEventListener("strengthChange.bs.strength", f), $.push(() => i.removeEventListener("strengthChange.bs.strength", f));
1986
+ onCreate(r, s) {
1987
+ const f = (S) => n("strength", S.strength ?? null, S.score ?? 0);
1988
+ s.addEventListener("strengthChange.bs.strength", f), b.push(() => s.removeEventListener("strengthChange.bs.strength", f));
1989
1989
  },
1990
1990
  onDestroy() {
1991
- $.forEach((s) => s()), $ = [];
1991
+ b.forEach((r) => r()), b = [];
1992
1992
  }
1993
1993
  }
1994
1994
  );
1995
- z(
1996
- () => u.model.value,
1997
- () => K(() => {
1998
- var s;
1999
- return (s = k.value) == null ? void 0 : s.evaluate();
1995
+ H(
1996
+ () => i.model.value,
1997
+ () => W(() => {
1998
+ var r;
1999
+ return (r = w.value) == null ? void 0 : r.evaluate();
2000
2000
  })
2001
- ), z(
2002
- () => [e.strength, e.toggle, e.strengthText, b.value, e.strengthOptions],
2001
+ ), H(
2002
+ () => [e.strength, e.toggle, e.strengthText, $.value, e.strengthOptions],
2003
2003
  async () => {
2004
- await K(), e.strength && M();
2004
+ await W(), e.strength && T();
2005
2005
  },
2006
2006
  { deep: !0 }
2007
- ), o({ strength: () => {
2008
- var s, i;
2009
- return ((i = (s = k.value) == null ? void 0 : s.getStrength) == null ? void 0 : i.call(s)) ?? null;
2007
+ ), a({ strength: () => {
2008
+ var r, s;
2009
+ return ((s = (r = w.value) == null ? void 0 : r.getStrength) == null ? void 0 : s.call(r)) ?? null;
2010
2010
  } });
2011
- const r = C(() => ({
2011
+ const o = C(() => ({
2012
2012
  name: e.name,
2013
2013
  modelValue: e.modelValue,
2014
2014
  id: e.id,
@@ -2019,12 +2019,12 @@ const Ll = /* @__PURE__ */ q(Dl, [["render", Fl]]), Ye = {
2019
2019
  size: e.size,
2020
2020
  placeholder: e.placeholder ?? l("password.placeholder")
2021
2021
  }));
2022
- return { t: l, root: n, meter: p, visible: h, toggleVisible: w, forwarded: r };
2022
+ return { t: l, root: t, meter: u, visible: g, toggleVisible: y, forwarded: o };
2023
2023
  }
2024
- }), Rl = {
2024
+ }), Gl = {
2025
2025
  ref: "root",
2026
2026
  class: "password-input"
2027
- }, zl = ["aria-label", "aria-pressed"], Pl = {
2027
+ }, Wl = ["aria-label", "aria-pressed"], Ql = {
2028
2028
  key: 0,
2029
2029
  width: "16",
2030
2030
  height: "16",
@@ -2035,7 +2035,7 @@ const Ll = /* @__PURE__ */ q(Dl, [["render", Fl]]), Ye = {
2035
2035
  "stroke-linecap": "round",
2036
2036
  "stroke-linejoin": "round",
2037
2037
  "aria-hidden": "true"
2038
- }, Ul = {
2038
+ }, Jl = {
2039
2039
  key: 1,
2040
2040
  width: "16",
2041
2041
  height: "16",
@@ -2046,63 +2046,63 @@ const Ll = /* @__PURE__ */ q(Dl, [["render", Fl]]), Ye = {
2046
2046
  "stroke-linecap": "round",
2047
2047
  "stroke-linejoin": "round",
2048
2048
  "aria-hidden": "true"
2049
- }, Hl = {
2049
+ }, Zl = {
2050
2050
  ref: "meter",
2051
2051
  class: "strength",
2052
2052
  "aria-hidden": "true"
2053
- }, Kl = {
2053
+ }, Yl = {
2054
2054
  key: 0,
2055
2055
  class: "strength-text",
2056
2056
  "aria-live": "polite"
2057
2057
  };
2058
- function Xl(e, t, o, l, d, u) {
2059
- const n = re("FormAdornInput"), p = re("TextInput");
2060
- return c(), v("div", Rl, [
2061
- e.toggle ? (c(), be(n, je({ key: 0 }, { ...e.$attrs, ...e.forwarded }, {
2058
+ function xl(e, n, a, l, c, i) {
2059
+ const t = oe("FormAdornInput"), u = oe("TextInput");
2060
+ return m(), h("div", Gl, [
2061
+ e.toggle ? (m(), le(t, Ke({ key: 0 }, { ...e.$attrs, ...e.forwarded }, {
2062
2062
  type: e.visible ? "text" : "password",
2063
2063
  autocomplete: "current-password"
2064
2064
  }), {
2065
- end: Pe(() => [
2066
- m("button", {
2065
+ end: Qe(() => [
2066
+ p("button", {
2067
2067
  type: "button",
2068
2068
  class: "btn-text theme-secondary btn-icon",
2069
2069
  "aria-label": e.visible ? e.t("password.hide") : e.t("password.show"),
2070
2070
  "aria-pressed": e.visible,
2071
- onClick: t[0] || (t[0] = (...h) => e.toggleVisible && e.toggleVisible(...h))
2071
+ onClick: n[0] || (n[0] = (...g) => e.toggleVisible && e.toggleVisible(...g))
2072
2072
  }, [
2073
- e.visible ? (c(), v("svg", Ul, t[2] || (t[2] = [
2074
- m("path", { d: "M2 2l12 12M6.6 3.7A7 7 0 0 1 8 3.5C12.5 3.5 15 8 15 8a11 11 0 0 1-2.2 2.6M4 5.4A11 11 0 0 0 1 8s2.5 4.5 7 4.5c1 0 1.9-.2 2.7-.6" }, null, -1)
2075
- ]))) : (c(), v("svg", Pl, t[1] || (t[1] = [
2076
- m("path", { d: "M1 8s2.5-4.5 7-4.5S15 8 15 8s-2.5 4.5-7 4.5S1 8 1 8Z" }, null, -1),
2077
- m("circle", {
2073
+ e.visible ? (m(), h("svg", Jl, n[2] || (n[2] = [
2074
+ p("path", { d: "M2 2l12 12M6.6 3.7A7 7 0 0 1 8 3.5C12.5 3.5 15 8 15 8a11 11 0 0 1-2.2 2.6M4 5.4A11 11 0 0 0 1 8s2.5 4.5 7 4.5c1 0 1.9-.2 2.7-.6" }, null, -1)
2075
+ ]))) : (m(), h("svg", Ql, n[1] || (n[1] = [
2076
+ p("path", { d: "M1 8s2.5-4.5 7-4.5S15 8 15 8s-2.5 4.5-7 4.5S1 8 1 8Z" }, null, -1),
2077
+ p("circle", {
2078
2078
  cx: "8",
2079
2079
  cy: "8",
2080
2080
  r: "2"
2081
2081
  }, null, -1)
2082
2082
  ])))
2083
- ], 8, zl)
2083
+ ], 8, Wl)
2084
2084
  ]),
2085
2085
  _: 1
2086
- }, 16, ["type"])) : (c(), be(p, je({ key: 1 }, { ...e.$attrs, ...e.forwarded }, {
2086
+ }, 16, ["type"])) : (m(), le(u, Ke({ key: 1 }, { ...e.$attrs, ...e.forwarded }, {
2087
2087
  type: "password",
2088
2088
  autocomplete: "current-password"
2089
2089
  }), null, 16)),
2090
- e.strength ? (c(), v(X, { key: 2 }, [
2091
- m("div", Hl, t[3] || (t[3] = [
2092
- m("div", { class: "strength-segment" }, null, -1),
2093
- m("div", { class: "strength-segment" }, null, -1),
2094
- m("div", { class: "strength-segment" }, null, -1),
2095
- m("div", { class: "strength-segment" }, null, -1)
2090
+ e.strength ? (m(), h(G, { key: 2 }, [
2091
+ p("div", Zl, n[3] || (n[3] = [
2092
+ p("div", { class: "strength-segment" }, null, -1),
2093
+ p("div", { class: "strength-segment" }, null, -1),
2094
+ p("div", { class: "strength-segment" }, null, -1),
2095
+ p("div", { class: "strength-segment" }, null, -1)
2096
2096
  ]), 512),
2097
- e.strengthText ? (c(), v("div", Kl)) : B("", !0)
2098
- ], 64)) : B("", !0)
2097
+ e.strengthText ? (m(), h("div", Yl)) : M("", !0)
2098
+ ], 64)) : M("", !0)
2099
2099
  ], 512);
2100
2100
  }
2101
- const Gl = /* @__PURE__ */ q(jl, [["render", Xl]]), Wl = V({
2101
+ const _l = /* @__PURE__ */ L(Xl, [["render", xl]]), ea = F({
2102
2102
  name: "RangeInput",
2103
2103
  emits: ["update:modelValue", "change", "input", "focus", "blur"],
2104
2104
  props: {
2105
- ...j,
2105
+ ...z,
2106
2106
  min: { type: Number, default: 0 },
2107
2107
  max: { type: Number, default: 100 },
2108
2108
  step: { type: Number, default: 1 },
@@ -2113,47 +2113,47 @@ const Gl = /* @__PURE__ */ q(jl, [["render", Xl]]), Wl = V({
2113
2113
  /** Tick marks: numbers or { value, label } objects. */
2114
2114
  ticks: { type: Array, default: () => [] }
2115
2115
  },
2116
- setup(e, { emit: t }) {
2117
- const o = R(e, t), l = E(null), d = E(null), u = C(() => {
2118
- const $ = Number(o.model.value);
2119
- return o.model.value === null || o.model.value === void 0 || Number.isNaN($) ? e.min : $;
2120
- }), n = C(() => e.ticks.length ? `${o.inputId.value}-ticks` : void 0), p = C(
2121
- () => e.ticks.map(($) => typeof $ == "object" && $ !== null ? $ : { value: $, label: e.formatter ? e.formatter($) : String($) })
2116
+ setup(e, { emit: n }) {
2117
+ const a = U(e, n), l = E(null), c = E(null), i = C(() => {
2118
+ const b = Number(a.model.value);
2119
+ return a.model.value === null || a.model.value === void 0 || Number.isNaN(b) ? e.min : b;
2120
+ }), t = C(() => e.ticks.length ? `${a.inputId.value}-ticks` : void 0), u = C(
2121
+ () => e.ticks.map((b) => typeof b == "object" && b !== null ? b : { value: b, label: e.formatter ? e.formatter(b) : String(b) })
2122
2122
  );
2123
- function h($) {
2124
- const k = Number($.target.value);
2125
- o.model.value = k, t("input", k, $);
2123
+ function g(b) {
2124
+ const w = Number(b.target.value);
2125
+ a.model.value = w, n("input", w, b);
2126
2126
  }
2127
- const { instance: b, create: w } = me(
2127
+ const { instance: $, create: y } = he(
2128
2128
  "Range",
2129
2129
  () => l.value,
2130
2130
  () => ({ bubble: e.bubble, formatter: e.formatter })
2131
2131
  );
2132
- return z(
2133
- () => [o.model.value, e.min, e.max],
2134
- () => K(() => {
2135
- var $;
2136
- return ($ = b.value) == null ? void 0 : $.update();
2132
+ return H(
2133
+ () => [a.model.value, e.min, e.max],
2134
+ () => W(() => {
2135
+ var b;
2136
+ return (b = $.value) == null ? void 0 : b.update();
2137
2137
  }),
2138
2138
  { flush: "post" }
2139
- ), z(
2139
+ ), H(
2140
2140
  () => [e.bubble, e.formatter, e.ticks, e.min, e.max],
2141
2141
  async () => {
2142
- await K(), w();
2142
+ await W(), y();
2143
2143
  },
2144
2144
  { deep: !0 }
2145
- ), { ...o, el: l, input: d, current: u, listId: n, tickItems: p, onInput: h };
2145
+ ), { ...a, el: l, input: c, current: i, listId: t, tickItems: u, onInput: g };
2146
2146
  }
2147
- }), Ql = {
2147
+ }), na = {
2148
2148
  ref: "el",
2149
2149
  class: "form-range"
2150
- }, Jl = ["name", "id", "min", "max", "step", "list", "disabled", "aria-invalid", "value"], Zl = ["id"], Yl = ["value", "label"];
2151
- function xl(e, t, o, l, d, u) {
2152
- return c(), v("div", Ql, [
2153
- m("input", {
2150
+ }, ta = ["name", "id", "min", "max", "step", "list", "disabled", "aria-invalid", "value"], la = ["id"], aa = ["value", "label"];
2151
+ function oa(e, n, a, l, c, i) {
2152
+ return m(), h("div", na, [
2153
+ p("input", {
2154
2154
  ref: "input",
2155
2155
  type: "range",
2156
- class: D(["form-range-input", { "is-invalid": e.isInvalid }]),
2156
+ class: q(["form-range-input", { "is-invalid": e.isInvalid }]),
2157
2157
  name: e.name,
2158
2158
  id: e.inputId,
2159
2159
  min: e.min,
@@ -2163,34 +2163,34 @@ function xl(e, t, o, l, d, u) {
2163
2163
  disabled: e.isDisabled || e.readonly,
2164
2164
  "aria-invalid": e.isInvalid || void 0,
2165
2165
  value: e.current,
2166
- onInput: t[0] || (t[0] = (...n) => e.onInput && e.onInput(...n)),
2167
- onChange: t[1] || (t[1] = (n) => e.emitChange(Number(n.target.value), n)),
2168
- onFocus: t[2] || (t[2] = (n) => e.$emit("focus", n)),
2169
- onBlur: t[3] || (t[3] = (n) => e.$emit("blur", n))
2170
- }, null, 42, Jl),
2171
- e.listId ? (c(), v("datalist", {
2166
+ onInput: n[0] || (n[0] = (...t) => e.onInput && e.onInput(...t)),
2167
+ onChange: n[1] || (n[1] = (t) => e.emitChange(Number(t.target.value), t)),
2168
+ onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
2169
+ onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
2170
+ }, null, 42, ta),
2171
+ e.listId ? (m(), h("datalist", {
2172
2172
  key: 0,
2173
2173
  id: e.listId
2174
2174
  }, [
2175
- (c(!0), v(X, null, ee(e.tickItems, (n) => (c(), v("option", {
2176
- key: n.value,
2177
- value: n.value,
2178
- label: n.label
2179
- }, null, 8, Yl))), 128))
2180
- ], 8, Zl)) : B("", !0)
2175
+ (m(!0), h(G, null, ae(e.tickItems, (t) => (m(), h("option", {
2176
+ key: t.value,
2177
+ value: t.value,
2178
+ label: t.label
2179
+ }, null, 8, aa))), 128))
2180
+ ], 8, la)) : M("", !0)
2181
2181
  ], 512);
2182
2182
  }
2183
- const ut = /* @__PURE__ */ q(Wl, [["render", xl]]), _l = V({
2183
+ const vn = /* @__PURE__ */ L(ea, [["render", oa]]), ra = F({
2184
2184
  name: "SimpleUploader",
2185
2185
  inheritAttrs: !0,
2186
- setup(e, { attrs: t, slots: o }) {
2187
- return () => ct(ot, t, o);
2186
+ setup(e, { attrs: n, slots: a }) {
2187
+ return () => bn(fn, n, a);
2188
2188
  }
2189
- }), ea = V({
2189
+ }), sa = F({
2190
2190
  name: "StarRatingInput",
2191
2191
  emits: ["update:modelValue", "change", "hover"],
2192
2192
  props: {
2193
- ...j,
2193
+ ...z,
2194
2194
  /** Initial rating used when the model is empty. */
2195
2195
  value: { type: Number, default: 0 },
2196
2196
  maxStars: { type: Number, default: 5 },
@@ -2200,62 +2200,62 @@ const ut = /* @__PURE__ */ q(Wl, [["render", xl]]), _l = V({
2200
2200
  /** Allow clicking the current rating again to reset it to 0. */
2201
2201
  clearable: { type: Boolean, default: !1 }
2202
2202
  },
2203
- setup(e, { emit: t }) {
2204
- const o = R(e, t), l = E(null), d = E(null), u = E(!1);
2205
- Z(() => {
2206
- l.value && (u.value = getComputedStyle(l.value).direction === "rtl");
2203
+ setup(e, { emit: n }) {
2204
+ const a = U(e, n), l = E(null), c = E(null), i = E(!1);
2205
+ J(() => {
2206
+ l.value && (i.value = getComputedStyle(l.value).direction === "rtl");
2207
2207
  });
2208
- const n = C(() => e.readonly || o.isDisabled.value), p = C(() => {
2209
- const f = Number(o.model.value);
2210
- return o.model.value === null || o.model.value === void 0 || Number.isNaN(f) ? e.value : f;
2211
- }), h = C(() => d.value ?? p.value), b = C(() => 1 / e.precision), w = (f) => Math.max(0, Math.min(1, h.value - (f - 1))) * 100;
2212
- function $(f) {
2213
- const I = l.value.getBoundingClientRect(), L = u.value ? I.right - f.clientX : f.clientX - I.left, T = I.width / e.maxStars, W = Math.ceil(L / T * e.precision) / e.precision;
2214
- return Math.min(e.maxStars, Math.max(b.value, W));
2208
+ const t = C(() => e.readonly || a.isDisabled.value), u = C(() => {
2209
+ const f = Number(a.model.value);
2210
+ return a.model.value === null || a.model.value === void 0 || Number.isNaN(f) ? e.value : f;
2211
+ }), g = C(() => c.value ?? u.value), $ = C(() => 1 / e.precision), y = (f) => Math.max(0, Math.min(1, g.value - (f - 1))) * 100;
2212
+ function b(f) {
2213
+ const S = l.value.getBoundingClientRect(), R = i.value ? S.right - f.clientX : f.clientX - S.left, A = S.width / e.maxStars, K = Math.ceil(R / A * e.precision) / e.precision;
2214
+ return Math.min(e.maxStars, Math.max($.value, K));
2215
2215
  }
2216
- function k(f) {
2217
- n.value || (d.value = $(f), t("hover", d.value));
2216
+ function w(f) {
2217
+ t.value || (c.value = b(f), n("hover", c.value));
2218
2218
  }
2219
- function M() {
2220
- d.value = null;
2219
+ function T() {
2220
+ c.value = null;
2221
2221
  }
2222
- function r(f, I) {
2223
- if (n.value) return;
2224
- const L = e.clearable && f === p.value ? 0 : f;
2225
- o.model.value = L, o.emitChange(L, I);
2222
+ function o(f, S) {
2223
+ if (t.value) return;
2224
+ const R = e.clearable && f === u.value ? 0 : f;
2225
+ a.model.value = R, a.emitChange(R, S);
2226
2226
  }
2227
- function s(f) {
2228
- n.value || r($(f), f);
2227
+ function r(f) {
2228
+ t.value || o(b(f), f);
2229
2229
  }
2230
- function i(f) {
2231
- if (n.value) return;
2232
- const I = u.value ? "ArrowLeft" : "ArrowRight", L = u.value ? "ArrowRight" : "ArrowLeft";
2233
- let T = null;
2234
- f.key === I || f.key === "ArrowUp" ? T = p.value + b.value : f.key === L || f.key === "ArrowDown" ? T = p.value - b.value : f.key === "Home" ? T = 0 : f.key === "End" && (T = e.maxStars), T !== null && (f.preventDefault(), r(Math.min(e.maxStars, Math.max(0, Number(T.toFixed(4)))), f));
2230
+ function s(f) {
2231
+ if (t.value) return;
2232
+ const S = i.value ? "ArrowLeft" : "ArrowRight", R = i.value ? "ArrowRight" : "ArrowLeft";
2233
+ let A = null;
2234
+ f.key === S || f.key === "ArrowUp" ? A = u.value + $.value : f.key === R || f.key === "ArrowDown" ? A = u.value - $.value : f.key === "Home" ? A = 0 : f.key === "End" && (A = e.maxStars), A !== null && (f.preventDefault(), o(Math.min(e.maxStars, Math.max(0, Number(A.toFixed(4)))), f));
2235
2235
  }
2236
2236
  return {
2237
- ...o,
2237
+ ...a,
2238
2238
  container: l,
2239
- rating: h,
2240
- stored: p,
2241
- fillOf: w,
2242
- onMove: k,
2243
- leave: M,
2244
- onClick: s,
2245
- onKeydown: i,
2246
- locked: n,
2247
- display: C(() => h.value.toFixed(1))
2239
+ rating: g,
2240
+ stored: u,
2241
+ fillOf: y,
2242
+ onMove: w,
2243
+ leave: T,
2244
+ onClick: r,
2245
+ onKeydown: s,
2246
+ locked: t,
2247
+ display: C(() => g.value.toFixed(1))
2248
2248
  };
2249
2249
  }
2250
- }), ta = ["tabindex", "aria-valuemax", "aria-valuenow", "aria-readonly", "aria-invalid"], na = ["name", "value"], la = {
2250
+ }), ia = ["tabindex", "aria-valuemax", "aria-valuenow", "aria-readonly", "aria-invalid"], ua = ["name", "value"], da = {
2251
2251
  key: 1,
2252
2252
  class: "rating-value fanum"
2253
2253
  };
2254
- function aa(e, t, o, l, d, u) {
2255
- return c(), v("div", {
2256
- class: D(["star-rating d-flex align-items-center gap-2", { "is-invalid": e.isInvalid }])
2254
+ function ca(e, n, a, l, c, i) {
2255
+ return m(), h("div", {
2256
+ class: q(["star-rating d-flex align-items-center gap-2", { "is-invalid": e.isInvalid }])
2257
2257
  }, [
2258
- m("div", {
2258
+ p("div", {
2259
2259
  ref: "container",
2260
2260
  class: "star-rating-container d-flex position-relative",
2261
2261
  role: "slider",
@@ -2265,37 +2265,37 @@ function aa(e, t, o, l, d, u) {
2265
2265
  "aria-valuenow": e.stored,
2266
2266
  "aria-readonly": e.locked || void 0,
2267
2267
  "aria-invalid": e.isInvalid || void 0,
2268
- style: oe({ cursor: e.locked ? "default" : "pointer" }),
2269
- onPointermove: t[0] || (t[0] = (...n) => e.onMove && e.onMove(...n)),
2270
- onPointerleave: t[1] || (t[1] = (...n) => e.leave && e.leave(...n)),
2271
- onClick: t[2] || (t[2] = (...n) => e.onClick && e.onClick(...n)),
2272
- onKeydown: t[3] || (t[3] = (...n) => e.onKeydown && e.onKeydown(...n))
2268
+ style: se({ cursor: e.locked ? "default" : "pointer" }),
2269
+ onPointermove: n[0] || (n[0] = (...t) => e.onMove && e.onMove(...t)),
2270
+ onPointerleave: n[1] || (n[1] = (...t) => e.leave && e.leave(...t)),
2271
+ onClick: n[2] || (n[2] = (...t) => e.onClick && e.onClick(...t)),
2272
+ onKeydown: n[3] || (n[3] = (...t) => e.onKeydown && e.onKeydown(...t))
2273
2273
  }, [
2274
- (c(!0), v(X, null, ee(e.maxStars, (n) => (c(), v("span", {
2275
- key: n,
2274
+ (m(!0), h(G, null, ae(e.maxStars, (t) => (m(), h("span", {
2275
+ key: t,
2276
2276
  class: "star-wrapper position-relative d-inline-block fs-2xl lh-1"
2277
2277
  }, [
2278
- t[4] || (t[4] = m("span", {
2278
+ n[4] || (n[4] = p("span", {
2279
2279
  class: "star-bg fg-secondary opacity-50",
2280
2280
  "aria-hidden": "true"
2281
2281
  }, "★", -1)),
2282
- m("span", {
2282
+ p("span", {
2283
2283
  class: "star-overlay fg-warning",
2284
2284
  "aria-hidden": "true",
2285
- style: oe({ position: "absolute", top: 0, insetInlineStart: 0, overflow: "hidden", whiteSpace: "nowrap", width: e.fillOf(n) + "%" })
2285
+ style: se({ position: "absolute", top: 0, insetInlineStart: 0, overflow: "hidden", whiteSpace: "nowrap", width: e.fillOf(t) + "%" })
2286
2286
  }, "★", 4)
2287
2287
  ]))), 128))
2288
- ], 44, ta),
2289
- e.name ? (c(), v("input", {
2288
+ ], 44, ia),
2289
+ e.name ? (m(), h("input", {
2290
2290
  key: 0,
2291
2291
  type: "hidden",
2292
2292
  name: e.name,
2293
2293
  value: e.stored
2294
- }, null, 8, na)) : B("", !0),
2295
- e.showValue && e.rating > 0 ? (c(), v("span", la, O(e.display), 1)) : B("", !0)
2294
+ }, null, 8, ua)) : M("", !0),
2295
+ e.showValue && e.rating > 0 ? (m(), h("span", da, V(e.display), 1)) : M("", !0)
2296
2296
  ], 2);
2297
2297
  }
2298
- const oa = /* @__PURE__ */ q(ea, [["render", aa]]), ra = V({
2298
+ const fa = /* @__PURE__ */ L(sa, [["render", ca]]), ma = F({
2299
2299
  name: "SubmitButton",
2300
2300
  emits: ["click"],
2301
2301
  props: {
@@ -2308,80 +2308,80 @@ const oa = /* @__PURE__ */ q(ea, [["render", aa]]), ra = V({
2308
2308
  theme: { type: String, default: "primary" },
2309
2309
  locale: { type: String, default: null }
2310
2310
  },
2311
- setup(e, { emit: t }) {
2312
- const o = ce("form", null), l = C(() => (o == null ? void 0 : o.value) ?? null), { t: d } = G(() => e.locale), u = C(
2311
+ setup(e, { emit: n }) {
2312
+ const a = pe("form", null), l = C(() => (a == null ? void 0 : a.value) ?? null), { t: c } = Q(() => e.locale), i = C(
2313
2313
  () => {
2314
- var p, h;
2315
- return e.loading !== null ? e.loading : !!((p = l.value) != null && p.processing || (h = l.value) != null && h.uploading);
2314
+ var u, g;
2315
+ return e.loading !== null ? e.loading : !!((u = l.value) != null && u.processing || (g = l.value) != null && g.uploading);
2316
2316
  }
2317
- ), n = C(() => [
2317
+ ), t = C(() => [
2318
2318
  e.variant ? `btn-${e.variant}` : null,
2319
2319
  e.theme && e.variant ? `theme-${e.theme}` : null
2320
2320
  ]);
2321
- return { form: l, busy: u, classes: n, t: d, onClick: (p) => t("click", p) };
2321
+ return { form: l, busy: i, classes: t, t: c, onClick: (u) => n("click", u) };
2322
2322
  }
2323
- }), sa = ["disabled", "aria-busy"], ia = {
2323
+ }), pa = ["disabled", "aria-busy"], ha = {
2324
2324
  key: 0,
2325
2325
  class: "spinner-border spinner-sm me-2",
2326
2326
  role: "status",
2327
2327
  "aria-hidden": "true"
2328
- }, ua = {
2328
+ }, va = {
2329
2329
  key: 0,
2330
2330
  class: "fanum"
2331
2331
  };
2332
- function da(e, t, o, l, d, u) {
2333
- var n;
2334
- return c(), v("button", {
2332
+ function ga(e, n, a, l, c, i) {
2333
+ var t;
2334
+ return m(), h("button", {
2335
2335
  type: "submit",
2336
- class: D(e.classes),
2336
+ class: q(e.classes),
2337
2337
  disabled: e.disabled || e.busy,
2338
2338
  "aria-busy": e.busy || void 0,
2339
- onClick: t[0] || (t[0] = (...p) => e.onClick && e.onClick(...p))
2339
+ onClick: n[0] || (n[0] = (...u) => e.onClick && e.onClick(...u))
2340
2340
  }, [
2341
- e.busy ? (c(), v("span", ia)) : B("", !0),
2342
- F(e.$slots, "default", {
2341
+ e.busy ? (m(), h("span", ha)) : M("", !0),
2342
+ j(e.$slots, "default", {
2343
2343
  form: e.form,
2344
2344
  loading: e.busy
2345
2345
  }, () => [
2346
- Y(O(e.t("submit.default")), 1)
2346
+ _(V(e.t("submit.default")), 1)
2347
2347
  ]),
2348
- F(e.$slots, "progress", {
2349
- progress: (n = e.form) == null ? void 0 : n.uploading
2348
+ j(e.$slots, "progress", {
2349
+ progress: (t = e.form) == null ? void 0 : t.uploading
2350
2350
  }, () => {
2351
- var p;
2351
+ var u;
2352
2352
  return [
2353
- (p = e.form) != null && p.uploading ? (c(), v("span", ua, O(e.form.uploading) + "%", 1)) : B("", !0)
2353
+ (u = e.form) != null && u.uploading ? (m(), h("span", va, V(e.form.uploading) + "%", 1)) : M("", !0)
2354
2354
  ];
2355
2355
  })
2356
- ], 10, sa);
2356
+ ], 10, pa);
2357
2357
  }
2358
- const fa = /* @__PURE__ */ q(ra, [["render", da]]), ca = V({
2358
+ const ya = /* @__PURE__ */ L(ma, [["render", ga]]), ba = F({
2359
2359
  name: "SwitchInput",
2360
2360
  emits: ["update:modelValue", "change", "focus", "blur"],
2361
2361
  props: {
2362
- ...j,
2362
+ ...z,
2363
2363
  value: { type: [String, Number, Boolean, Object], default: null },
2364
2364
  trueValue: { type: null, default: !0 },
2365
2365
  falseValue: { type: null, default: !1 },
2366
2366
  checked: { type: Boolean, default: !1 },
2367
2367
  label: { type: String, default: null }
2368
2368
  },
2369
- setup(e, { emit: t }) {
2370
- const o = E(null), l = R(e, t, { valued: () => e.value });
2371
- return Ve(e, l, o, { type: () => "checkbox" }), {
2369
+ setup(e, { emit: n }) {
2370
+ const a = E(null), l = U(e, n, { valued: () => e.value });
2371
+ return Re(e, l, a, { type: () => "checkbox" }), {
2372
2372
  ...l,
2373
- input: o,
2374
- onChange: (d) => l.emitChange(l.model.value, d)
2373
+ input: a,
2374
+ onChange: (c) => l.emitChange(l.model.value, c)
2375
2375
  };
2376
2376
  },
2377
2377
  expose: ["input"]
2378
- }), ma = { class: "form-field" }, pa = { class: "switch" }, ha = ["name", "id", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], va = ["for"];
2379
- function ga(e, t, o, l, d, u) {
2380
- return c(), v("div", ma, [
2381
- m("div", pa, [
2382
- te(m("input", {
2378
+ }), $a = { class: "form-field" }, wa = { class: "switch" }, ka = ["name", "id", "value", "true-value", "false-value", "required", "disabled", "aria-invalid"], Sa = ["for"];
2379
+ function Ia(e, n, a, l, c, i) {
2380
+ return m(), h("div", $a, [
2381
+ p("div", wa, [
2382
+ re(p("input", {
2383
2383
  ref: "input",
2384
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.model = n),
2384
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
2385
2385
  name: e.name,
2386
2386
  id: e.inputId,
2387
2387
  type: "checkbox",
@@ -2393,38 +2393,38 @@ function ga(e, t, o, l, d, u) {
2393
2393
  required: e.required,
2394
2394
  disabled: e.isDisabled,
2395
2395
  "aria-invalid": e.isInvalid || void 0,
2396
- class: D({ "is-invalid": e.isInvalid }),
2397
- onChange: t[1] || (t[1] = (...n) => e.onChange && e.onChange(...n)),
2398
- onFocus: t[2] || (t[2] = (n) => e.$emit("focus", n)),
2399
- onBlur: t[3] || (t[3] = (n) => e.$emit("blur", n))
2400
- }, null, 42, ha), [
2401
- [mt, e.model]
2396
+ class: q({ "is-invalid": e.isInvalid }),
2397
+ onChange: n[1] || (n[1] = (...t) => e.onChange && e.onChange(...t)),
2398
+ onFocus: n[2] || (n[2] = (t) => e.$emit("focus", t)),
2399
+ onBlur: n[3] || (n[3] = (t) => e.$emit("blur", t))
2400
+ }, null, 42, ka), [
2401
+ [$n, e.model]
2402
2402
  ])
2403
2403
  ]),
2404
- m("label", { for: e.inputId }, [
2405
- F(e.$slots, "default", {}, () => [
2406
- Y(O(e.label), 1)
2404
+ p("label", { for: e.inputId }, [
2405
+ j(e.$slots, "default", {}, () => [
2406
+ _(V(e.label), 1)
2407
2407
  ])
2408
- ], 8, va)
2408
+ ], 8, Sa)
2409
2409
  ]);
2410
2410
  }
2411
- const ya = /* @__PURE__ */ q(ca, [["render", ga]]), ba = V({
2411
+ const Ca = /* @__PURE__ */ L(ba, [["render", Ia]]), Ta = F({
2412
2412
  name: "TextAreaInput",
2413
2413
  emits: ["update:modelValue", "change", "input", "focus", "blur"],
2414
2414
  props: {
2415
- ...j,
2415
+ ...z,
2416
2416
  rows: { type: [Number, String], default: 3 },
2417
2417
  placeholder: { type: String, default: null },
2418
2418
  size: { type: String, default: null }
2419
2419
  },
2420
- setup(e, { emit: t }) {
2421
- const o = R(e, t), l = C(() => e.size ? `form-control-${e.size}` : null);
2422
- return { ...o, sizeClass: l, emit: t };
2420
+ setup(e, { emit: n }) {
2421
+ const a = U(e, n), l = C(() => e.size ? `form-control-${e.size}` : null);
2422
+ return { ...a, sizeClass: l, emit: n };
2423
2423
  }
2424
- }), $a = ["name", "id", "rows", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
2425
- function wa(e, t, o, l, d, u) {
2426
- return te((c(), v("textarea", {
2427
- "onUpdate:modelValue": t[0] || (t[0] = (n) => e.model = n),
2424
+ }), Ma = ["name", "id", "rows", "placeholder", "required", "readonly", "disabled", "aria-invalid"];
2425
+ function Ba(e, n, a, l, c, i) {
2426
+ return re((m(), h("textarea", {
2427
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => e.model = t),
2428
2428
  name: e.name,
2429
2429
  id: e.inputId,
2430
2430
  rows: e.rows,
@@ -2433,16 +2433,183 @@ function wa(e, t, o, l, d, u) {
2433
2433
  readonly: e.readonly,
2434
2434
  disabled: e.isDisabled,
2435
2435
  "aria-invalid": e.isInvalid || void 0,
2436
- class: D(["form-control", [e.sizeClass, { "is-invalid": e.isInvalid }]]),
2437
- onInput: t[1] || (t[1] = (n) => e.emit("input", e.model, n)),
2438
- onChange: t[2] || (t[2] = (n) => e.emitChange(e.model, n)),
2439
- onFocus: t[3] || (t[3] = (n) => e.$emit("focus", n)),
2440
- onBlur: t[4] || (t[4] = (n) => e.$emit("blur", n))
2441
- }, null, 42, $a)), [
2442
- [nt, e.model]
2436
+ class: q(["form-control", [e.sizeClass, { "is-invalid": e.isInvalid }]]),
2437
+ onInput: n[1] || (n[1] = (t) => e.emit("input", e.model, t)),
2438
+ onChange: n[2] || (n[2] = (t) => e.emitChange(e.model, t)),
2439
+ onFocus: n[3] || (n[3] = (t) => e.$emit("focus", t)),
2440
+ onBlur: n[4] || (n[4] = (t) => e.$emit("blur", t))
2441
+ }, null, 42, Ma)), [
2442
+ [sn, e.model]
2443
2443
  ]);
2444
2444
  }
2445
- const ka = /* @__PURE__ */ q(ba, [["render", wa]]), Le = {
2445
+ const Ea = /* @__PURE__ */ L(Ta, [["render", Ba]]), Fe = ie({}), we = ie({});
2446
+ function Aa(e, n) {
2447
+ Fe[e] = n;
2448
+ }
2449
+ function Oa(e, n) {
2450
+ var a;
2451
+ ((a = Fe[e]) == null ? void 0 : a.owner) === n && delete Fe[e];
2452
+ }
2453
+ function Va(e) {
2454
+ return we[e] = (we[e] || 0) + 1, () => {
2455
+ we[e] = Math.max(0, (we[e] || 1) - 1);
2456
+ };
2457
+ }
2458
+ const on = (e) => String(Math.floor(e)).padStart(2, "0"), We = (e) => `${on(e / 60)}:${on(e % 60)}`, Na = F({
2459
+ name: "VoiceRecorderResultArea",
2460
+ props: {
2461
+ /** channel / name of the recorder to display. */
2462
+ for: { type: String, required: !0 },
2463
+ showList: { type: Boolean, default: !0 },
2464
+ showProblem: { type: Boolean, default: !0 },
2465
+ /** Extra classes of the list-group. */
2466
+ listClass: { type: [String, Array, Object], default: null },
2467
+ /** Classes of the error alert. */
2468
+ alertClass: { type: [String, Array, Object], default: "alert theme-danger mb-2" },
2469
+ /** Used by the recorder itself for its built-in output; does not count as an external area. */
2470
+ internal: { type: Boolean, default: !1 }
2471
+ },
2472
+ setup(e) {
2473
+ const n = E(null), a = C(() => Fe[e.for] ?? null);
2474
+ let l = null;
2475
+ J(() => {
2476
+ e.internal || (l = Va(e.for));
2477
+ }), un(() => l == null ? void 0 : l());
2478
+ const c = (t) => {
2479
+ var u, g;
2480
+ return ((g = (u = a.value) == null ? void 0 : u.t) == null ? void 0 : g.call(u, t)) ?? t;
2481
+ };
2482
+ function i(t) {
2483
+ var u;
2484
+ (u = n.value) == null || u.querySelectorAll("audio").forEach((g) => {
2485
+ g !== t.target && g.pause();
2486
+ });
2487
+ }
2488
+ return { root: n, channel: a, t: c, onPlay: i, formatTime: We };
2489
+ }
2490
+ }), Da = {
2491
+ key: 0,
2492
+ ref: "root",
2493
+ class: "voice-recorder-results"
2494
+ }, qa = ["data-code"], Fa = { class: "row gx-3 align-items-center" }, La = { class: "col-12 sm:col-4" }, Ra = ["src"], ja = {
2495
+ key: 0,
2496
+ class: "col-auto"
2497
+ }, Pa = {
2498
+ class: "fg-secondary fanum",
2499
+ dir: "ltr"
2500
+ }, za = { class: "col" }, Ua = ["aria-valuenow"], Ha = {
2501
+ key: 1,
2502
+ class: "fg-danger",
2503
+ role: "alert"
2504
+ }, Ka = {
2505
+ key: 1,
2506
+ class: "col-auto"
2507
+ }, Xa = ["aria-label", "onClick"], Ga = { class: "col-auto" }, Wa = ["aria-label", "onClick"];
2508
+ function Qa(e, n, a, l, c, i) {
2509
+ return e.channel && (e.showProblem && e.channel.problem || e.showList && e.channel.items.length) ? (m(), h("div", Da, [
2510
+ e.showProblem && e.channel.problem ? (m(), h("div", {
2511
+ key: 0,
2512
+ class: q(e.alertClass),
2513
+ role: "alert",
2514
+ "data-code": e.channel.problem.code
2515
+ }, V(e.channel.problem.message), 11, qa)) : M("", !0),
2516
+ e.showList && e.channel.items.length ? (m(), h("ul", {
2517
+ key: 1,
2518
+ class: q(["list-group", e.listClass])
2519
+ }, [
2520
+ (m(!0), h(G, null, ae(e.channel.items, (t) => (m(), h("li", {
2521
+ key: t.id,
2522
+ class: "list-group-item"
2523
+ }, [
2524
+ j(e.$slots, "item", {
2525
+ item: t,
2526
+ time: t.seconds !== null ? e.formatTime(t.seconds) : null,
2527
+ locked: e.channel.locked,
2528
+ remove: () => e.channel.remove(t),
2529
+ retry: () => e.channel.retry(t)
2530
+ }, () => [
2531
+ p("div", Fa, [
2532
+ p("div", La, [
2533
+ p("audio", {
2534
+ class: "flex-grow-1 w-100",
2535
+ controls: "",
2536
+ preload: "metadata",
2537
+ src: t.src,
2538
+ onPlay: n[0] || (n[0] = (...u) => e.onPlay && e.onPlay(...u))
2539
+ }, null, 40, Ra)
2540
+ ]),
2541
+ t.seconds !== null ? (m(), h("div", ja, [
2542
+ p("span", Pa, V(e.formatTime(t.seconds)), 1)
2543
+ ])) : M("", !0),
2544
+ p("div", za, [
2545
+ t.status === "uploading" ? (m(), h("div", {
2546
+ key: 0,
2547
+ class: "progress",
2548
+ role: "progressbar",
2549
+ "aria-valuenow": t.percent,
2550
+ "aria-valuemin": "0",
2551
+ "aria-valuemax": "100"
2552
+ }, [
2553
+ p("div", {
2554
+ class: "progress-bar",
2555
+ style: se({ width: t.percent + "%" })
2556
+ }, null, 4)
2557
+ ], 8, Ua)) : M("", !0),
2558
+ t.status === "error" ? (m(), h("div", Ha, V(t.error), 1)) : M("", !0)
2559
+ ]),
2560
+ t.status === "error" ? (m(), h("div", Ka, [
2561
+ p("button", {
2562
+ type: "button",
2563
+ class: "btn-text theme-secondary btn-icon",
2564
+ "aria-label": e.t("retry"),
2565
+ onClick: (u) => e.channel.retry(t)
2566
+ }, n[1] || (n[1] = [
2567
+ p("svg", {
2568
+ width: "16",
2569
+ height: "16",
2570
+ viewBox: "0 0 16 16",
2571
+ fill: "none",
2572
+ stroke: "currentColor",
2573
+ "stroke-width": "1.5",
2574
+ "stroke-linecap": "round",
2575
+ "stroke-linejoin": "round",
2576
+ "aria-hidden": "true"
2577
+ }, [
2578
+ p("path", { d: "M13.5 3v3.5H10" }),
2579
+ p("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5M2.5 13V9.5H6" })
2580
+ ], -1)
2581
+ ]), 8, Xa)
2582
+ ])) : M("", !0),
2583
+ p("div", Ga, [
2584
+ e.channel.locked ? M("", !0) : (m(), h("button", {
2585
+ key: 0,
2586
+ type: "button",
2587
+ class: "btn-text theme-danger btn-icon",
2588
+ "aria-label": e.t("remove"),
2589
+ onClick: (u) => e.channel.remove(t)
2590
+ }, n[2] || (n[2] = [
2591
+ p("svg", {
2592
+ width: "16",
2593
+ height: "16",
2594
+ viewBox: "0 0 16 16",
2595
+ fill: "none",
2596
+ stroke: "currentColor",
2597
+ "stroke-width": "1.5",
2598
+ "stroke-linecap": "round",
2599
+ "stroke-linejoin": "round",
2600
+ "aria-hidden": "true"
2601
+ }, [
2602
+ p("path", { d: "M2.5 4.5h11M6 4.5V3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1.5M4 4.5l.6 8.1a1 1 0 0 0 1 .9h4.8a1 1 0 0 0 1-.9l.6-8.1" })
2603
+ ], -1)
2604
+ ]), 8, Wa))
2605
+ ])
2606
+ ])
2607
+ ])
2608
+ ]))), 128))
2609
+ ], 2)) : M("", !0)
2610
+ ], 512)) : M("", !0);
2611
+ }
2612
+ const gn = /* @__PURE__ */ L(Na, [["render", Qa]]), Ue = {
2446
2613
  en: {
2447
2614
  start: "Record voice",
2448
2615
  stop: "Stop recording",
@@ -2466,7 +2633,7 @@ const ka = /* @__PURE__ */ q(ba, [["render", wa]]), Le = {
2466
2633
  fa: {
2467
2634
  start: "ضبط صدا",
2468
2635
  stop: "پایان ضبط",
2469
- idle: "برای ضبط صدا اینجا کلیک کنید",
2636
+ idle: "برای ضبط روی میکروفن بزنید",
2470
2637
  starting: "در انتظار اجازه دسترسی به میکروفن…",
2471
2638
  recording: "در حال ضبط…",
2472
2639
  uploading: "در حال ارسال…",
@@ -2483,15 +2650,15 @@ const ka = /* @__PURE__ */ q(ba, [["render", wa]]), Le = {
2483
2650
  unknown: "شروع ضبط ممکن نشد.",
2484
2651
  uploadFailed: "خطا در ارسال"
2485
2652
  }
2486
- }, Sa = ["audio/ogg;codecs=opus", "audio/webm;codecs=opus", "audio/mp4", "audio/webm", "audio/ogg"];
2487
- let xe = 0;
2488
- function _e() {
2489
- return typeof MediaRecorder > "u" || !MediaRecorder.isTypeSupported ? "" : Sa.find((e) => MediaRecorder.isTypeSupported(e)) || "";
2653
+ }, Ja = ["audio/ogg;codecs=opus", "audio/webm;codecs=opus", "audio/mp4", "audio/webm", "audio/ogg"];
2654
+ let He = 0;
2655
+ function rn() {
2656
+ return typeof MediaRecorder > "u" || !MediaRecorder.isTypeSupported ? "" : Ja.find((e) => MediaRecorder.isTypeSupported(e)) || "";
2490
2657
  }
2491
- function Ia(e = "") {
2658
+ function Za(e = "") {
2492
2659
  return /ogg/.test(e) ? "ogg" : /webm/.test(e) ? "webm" : /mp4|aac|m4a/.test(e) ? "m4a" : /mpeg|mp3/.test(e) ? "mp3" : /wav/.test(e) ? "wav" : "audio";
2493
2660
  }
2494
- function Ca(e) {
2661
+ function Ya(e) {
2495
2662
  switch (e == null ? void 0 : e.name) {
2496
2663
  case "NotAllowedError":
2497
2664
  case "PermissionDeniedError":
@@ -2511,11 +2678,12 @@ function Ca(e) {
2511
2678
  return "unknown";
2512
2679
  }
2513
2680
  }
2514
- const et = (e) => String(Math.floor(e)).padStart(2, "0"), tt = (e) => `${et(e / 60)}:${et(e % 60)}`, Ma = V({
2681
+ const xa = F({
2515
2682
  name: "VoiceRecorderInput",
2683
+ components: { VoiceRecorderResultArea: gn },
2516
2684
  emits: ["update:modelValue", "change", "start", "stop", "recorded", "progress", "uploaded", "removed", "error"],
2517
2685
  props: {
2518
- ...j,
2686
+ ...z,
2519
2687
  /** box | button */
2520
2688
  variant: { type: String, default: "box", validator: (e) => ["box", "button"].includes(e) },
2521
2689
  url: { type: String, default: "/upload" },
@@ -2528,247 +2696,255 @@ const et = (e) => String(Math.floor(e)).padStart(2, "0"), tt = (e) => `${et(e /
2528
2696
  /** Bitrate of the recording; 32 kbps opus is plenty for speech and keeps files tiny. */
2529
2697
  audioBitsPerSecond: { type: Number, default: 32e3 },
2530
2698
  audioConstraints: { type: Object, default: () => ({ echoCancellation: !0, noiseSuppression: !0, autoGainControl: !0 }) },
2531
- /** Classes of the button in `variant="button"` (idle) … */
2532
- buttonClass: { type: [String, Array, Object], default: "btn-solid theme-primary" },
2699
+ /** Classes of the button (idle) … */
2700
+ buttonClass: { type: [String, Array, Object], default: "btn-solid theme-inverse" },
2701
+ /** … while there is a problem to show … */
2533
2702
  problemClass: { type: [String, Array, Object], default: "btn-solid theme-danger" },
2534
2703
  /** … and while recording. */
2535
2704
  recordingClass: { type: [String, Array, Object], default: "btn-solid theme-danger" },
2705
+ /** Show the list of recordings (in the built-in output, in `result-target` and in the result areas). */
2536
2706
  showList: { type: Boolean, default: !0 },
2537
2707
  /** Ask the server to delete the file (DELETE {url}) when a recording is removed. */
2538
2708
  deleteOnRemove: { type: Boolean, default: !0 },
2539
2709
  /** (storedValue) => playable URL — used for recordings that come from the form data (edit pages). */
2540
2710
  playbackUrl: { type: Function, default: (e) => e },
2711
+ /**
2712
+ * Key that <VoiceRecorderResultArea for="…"> uses to find this recorder. Defaults to `name`.
2713
+ * Set it when two recorders share the same name or have no name.
2714
+ */
2715
+ channel: { type: String, default: null },
2716
+ /** CSS selector (or element) the list and errors are moved into, e.g. "#voice-results". It must exist in the page. */
2717
+ resultTarget: { type: [String, Object], default: null },
2718
+ /** Force the built-in output on / off. null = automatic: hidden while a <VoiceRecorderResultArea> is attached. */
2719
+ inlineResults: { type: Boolean, default: null },
2541
2720
  startText: { type: String, default: null },
2542
2721
  stopText: { type: String, default: null },
2543
2722
  locale: { type: String, default: null }
2544
2723
  },
2545
- setup(e, { emit: t, expose: o }) {
2546
- const l = R(e, t), { locale: d } = G(() => e.locale), u = De(), n = (y) => (Le[d.value] || Le.en)[y] ?? Le.en[y] ?? y, p = E(null), h = E([]), b = E(!1), w = E(!1), $ = E(0), k = E(null), M = E(!0), r = /* @__PURE__ */ new Map();
2547
- let s = null, i = null, f = [], I = null, L = 0, T = !1;
2548
- const W = C(() => e.readonly || l.isDisabled.value), se = C(() => tt($.value)), P = C(() => h.value.some((y) => y.status === "uploading")), we = C(() => !M.value || W.value), ke = C(() => w.value ? n("starting") : b.value ? n("recording") : P.value ? n("uploading") : n("idle")), Se = C(
2549
- () => b.value ? e.stopText ?? n("stop") : e.startText ?? n("start")
2724
+ setup(e, { emit: n, expose: a }) {
2725
+ const l = U(e, n), { locale: c } = Q(() => e.locale), i = Le(), t = (d) => (Ue[c.value] || Ue.en)[d] ?? Ue.en[d] ?? d, u = `voice-${++He}`, g = e.channel ?? e.name ?? u, $ = E(null), y = E([]), b = E(!1), w = E(!1), T = E(0), o = E(null), r = E(!0), s = E(!1), f = /* @__PURE__ */ new Map();
2726
+ let S = null, R = null, A = [], K = null, ee = 0, P = !1;
2727
+ const Se = C(() => e.readonly || l.isDisabled.value), Ie = C(() => We(T.value)), Ce = C(() => y.value.some((d) => d.status === "uploading")), ve = C(() => !r.value || Se.value), Te = C(() => (we[g] || 0) > 0), Me = C(() => !e.resultTarget && (e.inlineResults ?? !Te.value)), ge = C(
2728
+ () => b.value ? e.recordingClass : o.value ? e.problemClass : e.buttonClass
2729
+ ), Be = C(() => w.value ? t("starting") : b.value ? t("recording") : Ce.value ? t("uploading") : t("idle")), ye = C(
2730
+ () => b.value ? e.stopText ?? t("stop") : e.startText ?? t("start")
2550
2731
  );
2551
- function Q(y, N, a = null) {
2552
- k.value = { code: y, message: n(y) }, t("error", { code: y, message: k.value.message, error: N ?? null, item: a });
2732
+ function Z(d, O, I = null) {
2733
+ o.value = { code: d, message: t(d) }, n("error", { code: d, message: o.value.message, error: O ?? null, item: I });
2553
2734
  }
2554
- const ie = () => {
2555
- k.value = null;
2556
- }, Ie = () => {
2557
- const y = l.model.value;
2558
- return e.multiple ? Array.isArray(y) ? y : y ? [y] : [] : y ? [y] : [];
2735
+ const ue = () => {
2736
+ o.value = null;
2737
+ }, Pe = () => {
2738
+ const d = l.model.value;
2739
+ return e.multiple ? Array.isArray(d) ? d : d ? [d] : [] : d ? [d] : [];
2559
2740
  };
2560
- function ue(y) {
2561
- const N = h.value.filter((g) => g.path).map((g) => g.path), a = e.multiple ? N : N[0] ?? null;
2562
- l.model.value = a, l.emitChange(a, y);
2741
+ function ne(d) {
2742
+ const O = y.value.filter((B) => B.path).map((B) => B.path), I = e.multiple ? O : O[0] ?? null;
2743
+ l.model.value = I, l.emitChange(I, d);
2563
2744
  }
2564
- function x() {
2565
- const y = l.form.value;
2566
- if (!y) return;
2567
- const N = h.value.filter((a) => a.status === "uploading");
2568
- y.uploading = N.length ? Math.min(99, Math.round(N.reduce((a, g) => a + g.percent, 0) / N.length)) : null;
2745
+ function te() {
2746
+ const d = l.form.value;
2747
+ if (!d) return;
2748
+ const O = y.value.filter((I) => I.status === "uploading");
2749
+ d.uploading = O.length ? Math.min(99, Math.round(O.reduce((I, B) => I + B.percent, 0) / O.length)) : null;
2569
2750
  }
2570
- function ne(y) {
2571
- y.local && y.src && URL.revokeObjectURL(y.src);
2751
+ function be(d) {
2752
+ d.local && d.src && URL.revokeObjectURL(d.src);
2572
2753
  }
2573
- function Ce() {
2574
- const y = Ie();
2575
- !y.length && h.value.some((a) => a.path) && (h.value.filter((a) => a.path).forEach(ne), h.value = h.value.filter((a) => !a.path));
2576
- const N = new Set(h.value.map((a) => a.path).filter(Boolean));
2577
- y.forEach((a) => {
2578
- N.has(a) || h.value.push(
2579
- ye({ id: `v${++xe}`, path: a, src: e.playbackUrl(a), status: "done", percent: 100, seconds: null, error: "", local: !1, file: null })
2754
+ function de() {
2755
+ const d = Pe();
2756
+ !d.length && y.value.some((I) => I.path) && (y.value.filter((I) => I.path).forEach(be), y.value = y.value.filter((I) => !I.path));
2757
+ const O = new Set(y.value.map((I) => I.path).filter(Boolean));
2758
+ d.forEach((I) => {
2759
+ O.has(I) || y.value.push(
2760
+ ie({ id: `v${++He}`, path: I, src: e.playbackUrl(I), status: "done", percent: 100, seconds: null, error: "", local: !1, file: null })
2580
2761
  );
2581
2762
  });
2582
2763
  }
2583
- Z(() => {
2584
- var y;
2585
- M.value = typeof navigator < "u" && !!((y = navigator.mediaDevices) != null && y.getUserMedia) && typeof MediaRecorder < "u", M.value ? Me() : Q(typeof window < "u" && window.isSecureContext === !1 ? "insecure" : "unsupported"), Ce();
2586
- }), z(() => l.model.value, Ce, { deep: !0 });
2587
- async function Me() {
2588
- var y;
2764
+ J(() => {
2765
+ var d;
2766
+ s.value = !0, Aa(g, { owner: u, items: y, problem: o, locked: Se, t, remove: D, retry: k }), i.add(() => Oa(g, u)), r.value = typeof navigator < "u" && !!((d = navigator.mediaDevices) != null && d.getUserMedia) && typeof MediaRecorder < "u", r.value ? X() : Z(typeof window < "u" && window.isSecureContext === !1 ? "insecure" : "unsupported"), de();
2767
+ }), H(() => l.model.value, de, { deep: !0 });
2768
+ async function X() {
2769
+ var d;
2589
2770
  try {
2590
- const N = await ((y = navigator.permissions) == null ? void 0 : y.query({ name: "microphone" }));
2591
- if (!N || u.isDisposed()) return;
2592
- const a = () => {
2593
- var g;
2594
- N.state === "denied" ? Q("denied") : ((g = k.value) == null ? void 0 : g.code) === "denied" && ie();
2771
+ const O = await ((d = navigator.permissions) == null ? void 0 : d.query({ name: "microphone" }));
2772
+ if (!O || i.isDisposed()) return;
2773
+ const I = () => {
2774
+ var B;
2775
+ O.state === "denied" ? Z("denied") : ((B = o.value) == null ? void 0 : B.code) === "denied" && ue();
2595
2776
  };
2596
- a(), N.addEventListener("change", a), u.add(() => N.removeEventListener("change", a));
2777
+ I(), O.addEventListener("change", I), i.add(() => O.removeEventListener("change", I));
2597
2778
  } catch {
2598
2779
  }
2599
2780
  }
2600
- function Te() {
2601
- i == null || i.getTracks().forEach((y) => y.stop()), i = null;
2781
+ function ce() {
2782
+ R == null || R.getTracks().forEach((d) => d.stop()), R = null;
2602
2783
  }
2603
- function le() {
2604
- $.value = (Date.now() - L) / 1e3, e.maxDuration && $.value >= e.maxDuration && ae();
2784
+ function ze() {
2785
+ T.value = (Date.now() - ee) / 1e3, e.maxDuration && T.value >= e.maxDuration && x();
2605
2786
  }
2606
- async function pe() {
2607
- if (b.value || w.value || we.value) return;
2608
- ie(), w.value = !0;
2609
- let y;
2787
+ async function Ee() {
2788
+ if (b.value || w.value || ve.value) return;
2789
+ ue(), w.value = !0;
2790
+ let d;
2610
2791
  try {
2611
- y = await navigator.mediaDevices.getUserMedia({
2792
+ d = await navigator.mediaDevices.getUserMedia({
2612
2793
  audio: Object.keys(e.audioConstraints || {}).length ? e.audioConstraints : !0
2613
2794
  });
2614
- } catch (g) {
2615
- return w.value = !1, Q(Ca(g), g);
2795
+ } catch (B) {
2796
+ return w.value = !1, Z(Ya(B), B);
2616
2797
  }
2617
- if (w.value = !1, u.isDisposed()) {
2618
- y.getTracks().forEach((g) => g.stop());
2798
+ if (w.value = !1, i.isDisposed()) {
2799
+ d.getTracks().forEach((B) => B.stop());
2619
2800
  return;
2620
2801
  }
2621
- const N = _e();
2622
- let a;
2802
+ const O = rn();
2803
+ let I;
2623
2804
  try {
2624
- a = new MediaRecorder(y, { ...N ? { mimeType: N } : {}, audioBitsPerSecond: e.audioBitsPerSecond });
2805
+ I = new MediaRecorder(d, { ...O ? { mimeType: O } : {}, audioBitsPerSecond: e.audioBitsPerSecond });
2625
2806
  } catch {
2626
2807
  try {
2627
- a = new MediaRecorder(y);
2628
- } catch (S) {
2629
- return y.getTracks().forEach((A) => A.stop()), Q("recorder", S);
2808
+ I = new MediaRecorder(d);
2809
+ } catch (N) {
2810
+ return d.getTracks().forEach((Y) => Y.stop()), Z("recorder", N);
2630
2811
  }
2631
2812
  }
2632
- i = y, s = a, f = [], T = !1, a.ondataavailable = (g) => {
2633
- var S;
2634
- (S = g.data) != null && S.size && f.push(g.data);
2635
- }, a.onerror = (g) => {
2636
- T = !0, Q("recorder", g.error), ae();
2637
- }, a.onstop = () => de(a), y.getAudioTracks().forEach(
2638
- (g) => g.addEventListener("ended", () => {
2639
- b.value && (Q("disconnected"), ae());
2813
+ R = d, S = I, A = [], P = !1, I.ondataavailable = (B) => {
2814
+ var N;
2815
+ (N = B.data) != null && N.size && A.push(B.data);
2816
+ }, I.onerror = (B) => {
2817
+ P = !0, Z("recorder", B.error), x();
2818
+ }, I.onstop = () => fe(I), d.getAudioTracks().forEach(
2819
+ (B) => B.addEventListener("ended", () => {
2820
+ b.value && (Z("disconnected"), x());
2640
2821
  })
2641
- ), a.start(500), L = Date.now(), $.value = 0, b.value = !0, I = setInterval(le, 250), t("start");
2822
+ ), I.start(500), ee = Date.now(), T.value = 0, b.value = !0, K = setInterval(ze, 250), n("start");
2642
2823
  }
2643
- function ae() {
2644
- if (clearInterval(I), I = null, s && s.state !== "inactive")
2824
+ function x() {
2825
+ if (clearInterval(K), K = null, S && S.state !== "inactive")
2645
2826
  try {
2646
- s.stop();
2827
+ S.stop();
2647
2828
  } catch {
2648
- de(s);
2829
+ fe(S);
2649
2830
  }
2650
2831
  b.value = !1;
2651
2832
  }
2652
- function de(y) {
2653
- clearInterval(I), I = null, b.value = !1;
2654
- const N = (Date.now() - L) / 1e3, a = f;
2655
- if (f = [], Te(), s = null, T) return;
2656
- t("stop", N);
2657
- const g = y.mimeType || _e() || "audio/webm", S = new Blob(a, { type: g });
2658
- if (!S.size || N < 0.4) return Q("tooShort");
2659
- he(S, N);
2833
+ function fe(d) {
2834
+ clearInterval(K), K = null, b.value = !1;
2835
+ const O = (Date.now() - ee) / 1e3, I = A;
2836
+ if (A = [], ce(), S = null, P) return;
2837
+ n("stop", O);
2838
+ const B = d.mimeType || rn() || "audio/webm", N = new Blob(I, { type: B });
2839
+ if (!N.size || O < 0.4) return Z("tooShort");
2840
+ v(N, O);
2660
2841
  }
2661
- function U() {
2662
- return b.value ? ae() : pe();
2842
+ function Ae() {
2843
+ return b.value ? x() : Ee();
2663
2844
  }
2664
- function he(y, N) {
2665
- e.multiple || h.value.slice().forEach((S) => Ee(S, !1));
2666
- const a = new File([y], `voice-${Date.now()}.${Ia(y.type)}`, { type: y.type }), g = ye({
2667
- id: `v${++xe}`,
2668
- file: a,
2669
- src: URL.createObjectURL(a),
2670
- seconds: Math.round(N),
2845
+ function v(d, O) {
2846
+ e.multiple || y.value.slice().forEach((N) => D(N, !1));
2847
+ const I = new File([d], `voice-${Date.now()}.${Za(d.type)}`, { type: d.type }), B = ie({
2848
+ id: `v${++He}`,
2849
+ file: I,
2850
+ src: URL.createObjectURL(I),
2851
+ seconds: Math.round(O),
2671
2852
  status: "uploading",
2672
2853
  percent: 0,
2673
2854
  path: null,
2674
2855
  error: "",
2675
2856
  local: !0
2676
2857
  });
2677
- h.value = [...h.value, g], t("recorded", g), Be(g);
2858
+ y.value = [...y.value, B], n("recorded", B), k(B);
2678
2859
  }
2679
- function Be(y) {
2680
- y.status = "uploading", y.percent = 0, y.error = "", x();
2681
- const N = new FormData();
2682
- N.append(e.fieldName, y.file, y.file.name);
2683
- const a = new XMLHttpRequest();
2684
- r.set(y.id, a), a.open("POST", e.url), Object.entries(Oe(e.headers)).forEach(([S, A]) => a.setRequestHeader(S, A)), a.upload.onprogress = (S) => {
2685
- S.lengthComputable && (y.percent = Math.round(S.loaded / S.total * 100), t("progress", y, y.percent), x());
2860
+ function k(d) {
2861
+ d.status = "uploading", d.percent = 0, d.error = "", te();
2862
+ const O = new FormData();
2863
+ O.append(e.fieldName, d.file, d.file.name);
2864
+ const I = new XMLHttpRequest();
2865
+ f.set(d.id, I), I.open("POST", e.url), Object.entries(De(e.headers)).forEach(([N, Y]) => I.setRequestHeader(N, Y)), I.upload.onprogress = (N) => {
2866
+ N.lengthComputable && (d.percent = Math.round(N.loaded / N.total * 100), n("progress", d, d.percent), te());
2686
2867
  };
2687
- const g = (S) => {
2688
- r.delete(y.id), y.status = "error", y.error = S || n("uploadFailed"), x(), Q("uploadFailed", null, y), k.value = { code: "uploadFailed", message: y.error };
2868
+ const B = (N) => {
2869
+ f.delete(d.id), d.status = "error", d.error = N || t("uploadFailed"), te(), Z("uploadFailed", null, d), o.value = { code: "uploadFailed", message: d.error };
2689
2870
  };
2690
- a.onerror = () => g(), a.onload = () => {
2691
- let S = null;
2871
+ I.onerror = () => B(), I.onload = () => {
2872
+ let N = null;
2692
2873
  try {
2693
- S = JSON.parse(a.responseText);
2874
+ N = JSON.parse(I.responseText);
2694
2875
  } catch {
2695
2876
  }
2696
- if (a.status < 200 || a.status >= 300) {
2697
- const J = S != null && S.errors ? Object.values(S.errors)[0] : null;
2698
- return g((S == null ? void 0 : S.message) || (Array.isArray(J) ? J[0] : J));
2877
+ if (I.status < 200 || I.status >= 300) {
2878
+ const Oe = N != null && N.errors ? Object.values(N.errors)[0] : null;
2879
+ return B((N == null ? void 0 : N.message) || (Array.isArray(Oe) ? Oe[0] : Oe));
2699
2880
  }
2700
- const A = (S == null ? void 0 : S.data) ?? S, H = (A == null ? void 0 : A.path) ?? (A == null ? void 0 : A.url);
2701
- if (!H) return g();
2702
- r.delete(y.id), y.path = H, y.status = "done", y.percent = 100, x(), ie(), ue(), t("uploaded", y, S);
2703
- }, a.send(N);
2881
+ const Y = (N == null ? void 0 : N.data) ?? N, Ye = (Y == null ? void 0 : Y.path) ?? (Y == null ? void 0 : Y.url);
2882
+ if (!Ye) return B();
2883
+ f.delete(d.id), d.path = Ye, d.status = "done", d.percent = 100, te(), ue(), ne(), n("uploaded", d, N);
2884
+ }, I.send(O);
2704
2885
  }
2705
- async function Ee(y, N = !0) {
2706
- var a;
2707
- if ((a = r.get(y.id)) == null || a.abort(), r.delete(y.id), ne(y), h.value = h.value.filter((g) => g.id !== y.id), x(), y.path && (ue(), e.deleteOnRemove))
2886
+ async function D(d, O = !0) {
2887
+ var I;
2888
+ if ((I = f.get(d.id)) == null || I.abort(), f.delete(d.id), be(d), y.value = y.value.filter((B) => B.id !== d.id), te(), d.path && (ne(), e.deleteOnRemove))
2708
2889
  try {
2709
2890
  await fetch(e.url, {
2710
2891
  method: "DELETE",
2711
- headers: Oe(e.headers),
2892
+ headers: De(e.headers),
2712
2893
  credentials: "same-origin",
2713
- body: y.path
2894
+ body: d.path
2714
2895
  });
2715
2896
  } catch {
2716
2897
  }
2717
- N && t("removed", y);
2898
+ O && n("removed", d);
2718
2899
  }
2719
- function ve(y) {
2720
- var N;
2721
- (N = p.value) == null || N.querySelectorAll("audio").forEach((a) => {
2722
- a !== y.target && a.pause();
2723
- });
2724
- }
2725
- return u.add(() => {
2726
- if (T = !0, clearInterval(I), s && s.state !== "inactive")
2900
+ return i.add(() => {
2901
+ if (P = !0, clearInterval(K), S && S.state !== "inactive")
2727
2902
  try {
2728
- s.stop();
2903
+ S.stop();
2729
2904
  } catch {
2730
2905
  }
2731
- Te(), r.forEach((y) => y.abort()), r.clear(), h.value.forEach(ne), l.form.value && (l.form.value.uploading = null);
2732
- }), o({ start: pe, stop: ae, toggle: U }), {
2906
+ ce(), f.forEach((d) => d.abort()), f.clear(), y.value.forEach(be), l.form.value && (l.form.value.uploading = null);
2907
+ }), a({ start: Ee, stop: x, toggle: Ae, channel: g }), {
2733
2908
  ...l,
2734
- t: n,
2735
- root: p,
2736
- items: h,
2909
+ t,
2910
+ root: $,
2911
+ items: y,
2737
2912
  recording: b,
2738
2913
  starting: w,
2739
- seconds: $,
2740
- time: se,
2741
- problem: k,
2742
- supported: M,
2743
- blocked: we,
2744
- statusText: ke,
2745
- buttonLabel: Se,
2746
- toggle: U,
2747
- upload: Be,
2748
- remove: Ee,
2749
- onPlay: ve,
2750
- formatTime: tt
2914
+ seconds: T,
2915
+ time: Ie,
2916
+ problem: o,
2917
+ supported: r,
2918
+ blocked: ve,
2919
+ mounted: s,
2920
+ channelKey: g,
2921
+ showInline: Me,
2922
+ stateClass: ge,
2923
+ statusText: Be,
2924
+ buttonLabel: ye,
2925
+ toggle: Ae,
2926
+ formatTime: We
2751
2927
  };
2752
2928
  }
2753
- }), Ta = ["id"], Ba = {
2929
+ }), _a = ["id"], eo = {
2754
2930
  key: 0,
2755
- class: "card w-100"
2756
- }, Ea = { class: "card-body" }, Aa = { class: "row gx-5" }, Oa = {
2931
+ class: "voice-recorder-box p-5"
2932
+ }, no = { class: "card-body" }, to = { class: "row gx-5" }, lo = {
2757
2933
  key: 0,
2758
2934
  class: "col-auto mx-auto"
2759
- }, Na = ["data-code"], Da = { class: "col-12 text-center" }, Va = { class: "row gx-5 align-items-center" }, qa = { class: "col-auto" }, Fa = ["disabled", "aria-label", "aria-pressed"], La = {
2935
+ }, ao = { class: "col-12 text-center" }, oo = { class: "row gx-5 align-items-center" }, ro = { class: "col-auto" }, so = ["disabled", "aria-label", "aria-pressed"], io = {
2760
2936
  key: 0,
2761
2937
  class: "spinner-border spinner-sm",
2762
2938
  role: "status",
2763
2939
  "aria-hidden": "true"
2764
- }, ja = {
2940
+ }, uo = {
2765
2941
  key: 1,
2766
2942
  width: "18",
2767
2943
  height: "18",
2768
2944
  viewBox: "0 0 16 16",
2769
2945
  fill: "currentColor",
2770
2946
  "aria-hidden": "true"
2771
- }, Ra = {
2947
+ }, co = {
2772
2948
  key: 2,
2773
2949
  width: "18",
2774
2950
  height: "18",
@@ -2779,38 +2955,22 @@ const et = (e) => String(Math.floor(e)).padStart(2, "0"), tt = (e) => `${et(e /
2779
2955
  "stroke-linecap": "round",
2780
2956
  "stroke-linejoin": "round",
2781
2957
  "aria-hidden": "true"
2782
- }, za = { class: "col" }, Pa = { class: "flex-grow-1 text-center" }, Ua = {
2958
+ }, fo = { class: "col" }, mo = { class: "flex-grow-1 text-center" }, po = {
2783
2959
  class: "fw-semibold",
2784
2960
  role: "status",
2785
2961
  "aria-live": "polite"
2786
- }, Ha = {
2962
+ }, ho = {
2787
2963
  class: "fg-secondary fanum",
2788
2964
  dir: "ltr"
2789
- }, Ka = {
2965
+ }, vo = {
2790
2966
  key: 0,
2791
2967
  class: "col-auto"
2792
- }, Xa = {
2793
- key: 0,
2794
- class: "list-group mt-2"
2795
- }, Ga = { class: "row gx-3 align-items-center" }, Wa = { class: "col-12 sm:col-4" }, Qa = ["src"], Ja = {
2796
- key: 0,
2797
- class: "col-auto"
2798
- }, Za = {
2799
- class: "fg-secondary fanum",
2800
- dir: "ltr"
2801
- }, Ya = { class: "col" }, xa = ["aria-valuenow"], _a = {
2802
- key: 1,
2803
- class: "fg-danger",
2804
- role: "alert"
2805
- }, eo = {
2806
- key: 1,
2807
- class: "col-auto"
2808
- }, to = ["aria-label", "onClick"], no = { class: "col-auto" }, lo = ["aria-label", "onClick"], ao = ["disabled", "aria-pressed"], oo = {
2968
+ }, go = ["disabled", "aria-pressed"], yo = {
2809
2969
  key: 0,
2810
2970
  class: "spinner-border spinner-sm me-2",
2811
2971
  role: "status",
2812
2972
  "aria-hidden": "true"
2813
- }, ro = {
2973
+ }, bo = {
2814
2974
  key: 1,
2815
2975
  class: "me-2",
2816
2976
  width: "16",
@@ -2818,7 +2978,7 @@ const et = (e) => String(Math.floor(e)).padStart(2, "0"), tt = (e) => `${et(e /
2818
2978
  viewBox: "0 0 16 16",
2819
2979
  fill: "currentColor",
2820
2980
  "aria-hidden": "true"
2821
- }, so = {
2981
+ }, $o = {
2822
2982
  key: 2,
2823
2983
  class: "me-2",
2824
2984
  width: "16",
@@ -2830,299 +2990,241 @@ const et = (e) => String(Math.floor(e)).padStart(2, "0"), tt = (e) => `${et(e /
2830
2990
  "stroke-linecap": "round",
2831
2991
  "stroke-linejoin": "round",
2832
2992
  "aria-hidden": "true"
2833
- }, io = {
2993
+ }, wo = {
2834
2994
  key: 3,
2835
2995
  class: "ms-2 fanum",
2836
2996
  dir: "ltr"
2837
2997
  };
2838
- function uo(e, t, o, l, d, u) {
2839
- return c(), v("div", {
2998
+ function ko(e, n, a, l, c, i) {
2999
+ const t = oe("VoiceRecorderResultArea");
3000
+ return m(), h("div", {
2840
3001
  ref: "root",
2841
- class: D(["voice-recorder", { "is-invalid": e.isInvalid }]),
3002
+ class: q(["voice-recorder", { "is-invalid": e.isInvalid }]),
2842
3003
  id: e.inputId
2843
3004
  }, [
2844
- e.variant === "box" ? (c(), v("div", Ba, [
2845
- m("div", Ea, [
2846
- m("div", Aa, [
2847
- e.problem ? (c(), v("div", Oa, [
2848
- m("div", {
2849
- class: "alert theme-danger p-1 text-center mb-4",
2850
- role: "alert",
2851
- "data-code": e.problem.code
2852
- }, O(e.problem.message), 9, Na)
2853
- ])) : B("", !0),
2854
- m("div", Da, [
2855
- m("div", {
2856
- class: "btn btn-subtle theme-inverse mx-auto",
2857
- onClick: t[0] || (t[0] = (...n) => e.toggle && e.toggle(...n))
3005
+ e.variant === "box" ? (m(), h("div", eo, [
3006
+ p("div", no, [
3007
+ p("div", to, [
3008
+ e.showInline && e.problem ? (m(), h("div", lo, [
3009
+ Ne(t, {
3010
+ for: e.channelKey,
3011
+ internal: "",
3012
+ "show-list": !1,
3013
+ "alert-class": "alert theme-danger p-1 text-center mb-4"
3014
+ }, null, 8, ["for"])
3015
+ ])) : M("", !0),
3016
+ p("div", ao, [
3017
+ p("div", {
3018
+ class: "btn btn-subtle mx-auto p-3",
3019
+ onClick: n[0] || (n[0] = (...u) => e.toggle && e.toggle(...u))
2858
3020
  }, [
2859
- m("div", Va, [
2860
- m("div", qa, [
2861
- m("button", {
3021
+ p("div", oo, [
3022
+ p("div", ro, [
3023
+ p("button", {
2862
3024
  type: "button",
2863
- class: D(["btn", e.recording ? e.recordingClass : e.buttonClass]),
3025
+ class: q(["btn", e.stateClass]),
2864
3026
  disabled: e.blocked || e.starting,
2865
3027
  "aria-label": e.buttonLabel,
2866
3028
  "aria-pressed": e.recording
2867
3029
  }, [
2868
- e.starting ? (c(), v("span", La)) : e.recording ? (c(), v("svg", ja, t[3] || (t[3] = [
2869
- m("rect", {
3030
+ e.starting ? (m(), h("span", io)) : e.recording ? (m(), h("svg", uo, n[2] || (n[2] = [
3031
+ p("rect", {
2870
3032
  x: "3.5",
2871
3033
  y: "3.5",
2872
3034
  width: "9",
2873
3035
  height: "9",
2874
3036
  rx: "1.5"
2875
3037
  }, null, -1)
2876
- ]))) : (c(), v("svg", Ra, t[4] || (t[4] = [
2877
- m("rect", {
3038
+ ]))) : (m(), h("svg", co, n[3] || (n[3] = [
3039
+ p("rect", {
2878
3040
  x: "5.5",
2879
3041
  y: "1.5",
2880
3042
  width: "5",
2881
3043
  height: "8",
2882
3044
  rx: "2.5"
2883
3045
  }, null, -1),
2884
- m("path", { d: "M3 7.5a5 5 0 0 0 10 0M8 12.5v2" }, null, -1)
3046
+ p("path", { d: "M3 7.5a5 5 0 0 0 10 0M8 12.5v2" }, null, -1)
2885
3047
  ])))
2886
- ], 10, Fa)
3048
+ ], 10, so)
2887
3049
  ]),
2888
- m("div", za, [
2889
- m("div", Pa, [
2890
- m("div", Ua, O(e.statusText), 1),
2891
- m("div", Ha, [
2892
- Y(O(e.time) + " ", 1),
2893
- e.maxDuration ? (c(), v(X, { key: 0 }, [
2894
- Y(" / " + O(e.formatTime(e.maxDuration)), 1)
2895
- ], 64)) : B("", !0)
3050
+ p("div", fo, [
3051
+ p("div", mo, [
3052
+ p("div", po, V(e.statusText), 1),
3053
+ p("div", ho, [
3054
+ _(V(e.time) + " ", 1),
3055
+ e.maxDuration ? (m(), h(G, { key: 0 }, [
3056
+ _(" / " + V(e.formatTime(e.maxDuration)), 1)
3057
+ ], 64)) : M("", !0)
2896
3058
  ])
2897
3059
  ])
2898
3060
  ]),
2899
- e.recording ? (c(), v("div", Ka, t[5] || (t[5] = [
2900
- m("span", {
3061
+ e.recording ? (m(), h("div", vo, n[4] || (n[4] = [
3062
+ p("span", {
2901
3063
  class: "spinner-grow spinner-sm fg-danger",
2902
3064
  role: "status",
2903
3065
  "aria-hidden": "true"
2904
3066
  }, null, -1)
2905
- ]))) : B("", !0)
3067
+ ]))) : M("", !0)
2906
3068
  ])
2907
3069
  ])
2908
3070
  ])
2909
3071
  ]),
2910
- e.showList && e.items.length ? (c(), v("ul", Xa, [
2911
- (c(!0), v(X, null, ee(e.items, (n) => (c(), v("li", {
2912
- key: n.id,
2913
- class: "list-group-item"
2914
- }, [
2915
- m("div", Ga, [
2916
- m("div", Wa, [
2917
- m("audio", {
2918
- class: "align-middle w-100",
2919
- controls: "",
2920
- preload: "metadata",
2921
- src: n.src,
2922
- onPlay: t[1] || (t[1] = (...p) => e.onPlay && e.onPlay(...p))
2923
- }, null, 40, Qa)
2924
- ]),
2925
- n.seconds !== null ? (c(), v("div", Ja, [
2926
- m("span", Za, O(e.formatTime(n.seconds)), 1)
2927
- ])) : B("", !0),
2928
- m("div", Ya, [
2929
- n.status === "uploading" ? (c(), v("div", {
2930
- key: 0,
2931
- class: "progress",
2932
- role: "progressbar",
2933
- "aria-valuenow": n.percent,
2934
- "aria-valuemin": "0",
2935
- "aria-valuemax": "100"
2936
- }, [
2937
- m("div", {
2938
- class: "progress-bar",
2939
- style: oe({ width: n.percent + "%" })
2940
- }, null, 4)
2941
- ], 8, xa)) : B("", !0),
2942
- n.status === "error" ? (c(), v("div", _a, O(n.error), 1)) : B("", !0)
2943
- ]),
2944
- n.status === "error" ? (c(), v("div", eo, [
2945
- m("button", {
2946
- type: "button",
2947
- class: "btn-text theme-secondary btn-icon",
2948
- "aria-label": e.t("retry"),
2949
- onClick: (p) => e.upload(n)
2950
- }, t[6] || (t[6] = [
2951
- m("svg", {
2952
- width: "16",
2953
- height: "16",
2954
- viewBox: "0 0 16 16",
2955
- fill: "none",
2956
- stroke: "currentColor",
2957
- "stroke-width": "1.5",
2958
- "stroke-linecap": "round",
2959
- "stroke-linejoin": "round",
2960
- "aria-hidden": "true"
2961
- }, [
2962
- m("path", { d: "M13.5 3v3.5H10" }),
2963
- m("path", { d: "M3.2 6.5A5.5 5.5 0 0 1 13 6.5M12.8 9.5A5.5 5.5 0 0 1 3 9.5M2.5 13V9.5H6" })
2964
- ], -1)
2965
- ]), 8, to)
2966
- ])) : B("", !0),
2967
- m("div", no, [
2968
- e.locked ? B("", !0) : (c(), v("button", {
2969
- key: 0,
2970
- type: "button",
2971
- class: "btn-text theme-danger btn-icon",
2972
- "aria-label": e.t("remove"),
2973
- onClick: (p) => e.remove(n)
2974
- }, t[7] || (t[7] = [
2975
- m("svg", {
2976
- width: "16",
2977
- height: "16",
2978
- viewBox: "0 0 16 16",
2979
- fill: "none",
2980
- stroke: "currentColor",
2981
- "stroke-width": "1.5",
2982
- "stroke-linecap": "round",
2983
- "stroke-linejoin": "round",
2984
- "aria-hidden": "true"
2985
- }, [
2986
- m("path", { d: "M2.5 4.5h11M6 4.5V3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1.5M4 4.5l.6 8.1a1 1 0 0 0 1 .9h4.8a1 1 0 0 0 1-.9l.6-8.1" })
2987
- ], -1)
2988
- ]), 8, lo))
2989
- ])
2990
- ])
2991
- ]))), 128))
2992
- ])) : B("", !0)
3072
+ e.showInline && e.showList ? (m(), le(t, {
3073
+ key: 0,
3074
+ class: "d-block mt-2",
3075
+ for: e.channelKey,
3076
+ internal: "",
3077
+ "show-problem": !1
3078
+ }, null, 8, ["for"])) : M("", !0)
2993
3079
  ])
2994
- ])) : (c(), v("button", {
2995
- key: 1,
2996
- type: "button",
2997
- disabled: e.blocked || e.starting,
2998
- "aria-pressed": e.recording,
2999
- class: D({
3000
- [e.recordingClass]: e.recording,
3001
- [e.buttonClass]: !e.problem && !e.recording,
3002
- [e.problemClass]: e.problem
3003
- }),
3004
- onClick: t[2] || (t[2] = (...n) => e.toggle && e.toggle(...n))
3080
+ ])) : (m(), h(G, { key: 1 }, [
3081
+ p("button", {
3082
+ type: "button",
3083
+ disabled: e.blocked || e.starting,
3084
+ "aria-pressed": e.recording,
3085
+ class: q(e.stateClass),
3086
+ onClick: n[1] || (n[1] = (...u) => e.toggle && e.toggle(...u))
3087
+ }, [
3088
+ j(e.$slots, "default", {
3089
+ recording: e.recording,
3090
+ starting: e.starting,
3091
+ seconds: e.seconds,
3092
+ time: e.time
3093
+ }, () => [
3094
+ e.starting ? (m(), h("span", yo)) : e.recording ? (m(), h("svg", bo, n[5] || (n[5] = [
3095
+ p("rect", {
3096
+ x: "3.5",
3097
+ y: "3.5",
3098
+ width: "9",
3099
+ height: "9",
3100
+ rx: "1.5"
3101
+ }, null, -1)
3102
+ ]))) : (m(), h("svg", $o, n[6] || (n[6] = [
3103
+ p("rect", {
3104
+ x: "5.5",
3105
+ y: "1.5",
3106
+ width: "5",
3107
+ height: "8",
3108
+ rx: "2.5"
3109
+ }, null, -1),
3110
+ p("path", { d: "M3 7.5a5 5 0 0 0 10 0M8 12.5v2" }, null, -1)
3111
+ ]))),
3112
+ _(" " + V(e.buttonLabel) + " ", 1),
3113
+ e.recording ? (m(), h("span", wo, V(e.time), 1)) : M("", !0)
3114
+ ])
3115
+ ], 10, go),
3116
+ e.showInline ? (m(), le(t, {
3117
+ key: 0,
3118
+ class: "d-block mt-2",
3119
+ for: e.channelKey,
3120
+ internal: "",
3121
+ "show-list": e.showList
3122
+ }, null, 8, ["for", "show-list"])) : M("", !0)
3123
+ ], 64)),
3124
+ e.resultTarget && e.mounted ? (m(), le(wn, {
3125
+ key: 2,
3126
+ to: e.resultTarget
3005
3127
  }, [
3006
- F(e.$slots, "default", {
3007
- recording: e.recording,
3008
- starting: e.starting,
3009
- seconds: e.seconds,
3010
- time: e.time
3011
- }, () => [
3012
- e.starting ? (c(), v("span", oo)) : e.recording ? (c(), v("svg", ro, t[8] || (t[8] = [
3013
- m("rect", {
3014
- x: "3.5",
3015
- y: "3.5",
3016
- width: "9",
3017
- height: "9",
3018
- rx: "1.5"
3019
- }, null, -1)
3020
- ]))) : (c(), v("svg", so, t[9] || (t[9] = [
3021
- m("rect", {
3022
- x: "5.5",
3023
- y: "1.5",
3024
- width: "5",
3025
- height: "8",
3026
- rx: "2.5"
3027
- }, null, -1),
3028
- m("path", { d: "M3 7.5a5 5 0 0 0 10 0M8 12.5v2" }, null, -1)
3029
- ]))),
3030
- Y(" " + O(e.buttonLabel) + " ", 1),
3031
- e.recording ? (c(), v("span", io, O(e.time), 1)) : B("", !0)
3032
- ])
3033
- ], 10, ao))
3034
- ], 10, Ta);
3128
+ Ne(t, {
3129
+ for: e.channelKey,
3130
+ internal: "",
3131
+ "show-list": e.showList
3132
+ }, null, 8, ["for", "show-list"])
3133
+ ], 8, ["to"])) : M("", !0)
3134
+ ], 10, _a);
3035
3135
  }
3036
- const fo = /* @__PURE__ */ q(Ma, [["render", uo]]);
3037
- function $o() {
3038
- const e = ce("form", null), t = ce("formApi", null);
3136
+ const So = /* @__PURE__ */ L(xa, [["render", ko]]);
3137
+ function Vo() {
3138
+ const e = pe("form", null), n = pe("formApi", null);
3039
3139
  return {
3040
3140
  form: e,
3041
- submit: (...o) => {
3141
+ submit: (...a) => {
3042
3142
  var l;
3043
- return (l = t == null ? void 0 : t.submit) == null ? void 0 : l.call(t, ...o);
3143
+ return (l = n == null ? void 0 : n.submit) == null ? void 0 : l.call(n, ...a);
3044
3144
  },
3045
3145
  reset: () => {
3046
- var o;
3047
- return (o = t == null ? void 0 : t.reset) == null ? void 0 : o.call(t);
3146
+ var a;
3147
+ return (a = n == null ? void 0 : n.reset) == null ? void 0 : a.call(n);
3048
3148
  }
3049
3149
  };
3050
3150
  }
3051
- const co = at, mo = ut, po = He, ho = {
3052
- AmountInput: kt,
3053
- CaptchaInput: Et,
3054
- VoiceRecorderInput: fo,
3055
- CheckboxButtonInput: Dt,
3056
- CheckboxInput: Rt,
3057
- CheckboxToggle: Kt,
3058
- ChipsInput: Yt,
3059
- ComboboxInput: at,
3060
- EmailInput: Sn,
3061
- FileInput: ot,
3062
- FormAdornInput: He,
3063
- FormContainer: _n,
3064
- FormField: dl,
3065
- FormLabel: rt,
3066
- GroupControl: st,
3067
- MobileInput: vl,
3068
- MultiQuantityInput: Nl,
3069
- OTPInput: Ll,
3070
- PasswordInput: Gl,
3071
- QuantityInput: it,
3072
- RangeInput: ut,
3073
- SimpleUploader: _l,
3074
- StarRatingInput: oa,
3075
- SubmitButton: fa,
3076
- SwitchInput: ya,
3077
- TextAreaInput: ka,
3078
- TextInput: qe,
3151
+ const Io = cn, Co = vn, To = Ze, Mo = {
3152
+ AmountInput: An,
3153
+ CaptchaInput: Ln,
3154
+ VoiceRecorderInput: So,
3155
+ VoiceRecorderResultArea: gn,
3156
+ CheckboxButtonInput: zn,
3157
+ CheckboxInput: Wn,
3158
+ CheckboxToggle: xn,
3159
+ ChipsInput: ot,
3160
+ ComboboxInput: cn,
3161
+ EmailInput: At,
3162
+ FileInput: fn,
3163
+ FormAdornInput: Ze,
3164
+ FormContainer: rl,
3165
+ FormField: gl,
3166
+ FormLabel: mn,
3167
+ GroupControl: pn,
3168
+ MobileInput: Sl,
3169
+ MultiQuantityInput: jl,
3170
+ OTPInput: Kl,
3171
+ PasswordInput: _l,
3172
+ QuantityInput: hn,
3173
+ RangeInput: vn,
3174
+ SimpleUploader: ra,
3175
+ StarRatingInput: fa,
3176
+ SubmitButton: ya,
3177
+ SwitchInput: Ca,
3178
+ TextAreaInput: Ea,
3179
+ TextInput: je,
3079
3180
  // aliases
3080
- Select2Input: co,
3081
- RangeSliderInput: mo,
3082
- FormAdorn: po
3083
- }, wo = {
3084
- install(e, t = {}) {
3085
- (t.locale || t.messages) && pt(t), t.bootstrap && Xt(t.bootstrap), Object.entries(ho).forEach(([o, l]) => e.component(o, l));
3181
+ Select2Input: Io,
3182
+ RangeSliderInput: Co,
3183
+ FormAdorn: To
3184
+ }, No = {
3185
+ install(e, n = {}) {
3186
+ (n.locale || n.messages) && kn(n), n.bootstrap && _n(n.bootstrap), Object.entries(Mo).forEach(([a, l]) => e.component(a, l));
3086
3187
  }
3087
3188
  };
3088
3189
  export {
3089
- kt as AmountInput,
3090
- Et as CaptchaInput,
3091
- Dt as CheckboxButtonInput,
3092
- Rt as CheckboxInput,
3093
- Kt as CheckboxToggle,
3094
- Yt as ChipsInput,
3095
- at as ComboboxInput,
3096
- Sn as EmailInput,
3097
- ot as FileInput,
3098
- po as FormAdorn,
3099
- He as FormAdornInput,
3100
- _n as FormContainer,
3101
- dl as FormField,
3102
- rt as FormLabel,
3103
- st as GroupControl,
3104
- vl as MobileInput,
3105
- Nl as MultiQuantityInput,
3106
- Ll as OTPInput,
3107
- Gl as PasswordInput,
3108
- it as QuantityInput,
3109
- ut as RangeInput,
3110
- mo as RangeSliderInput,
3111
- co as Select2Input,
3112
- _l as SimpleUploader,
3113
- oa as StarRatingInput,
3114
- fa as SubmitButton,
3115
- ya as SwitchInput,
3116
- ka as TextAreaInput,
3117
- qe as TextInput,
3118
- fo as VoiceRecorderInput,
3119
- Xt as configureBootstrap,
3120
- pt as configureI18n,
3121
- wo as default,
3122
- j as fieldProps,
3123
- Ue as toEnglishDigits,
3124
- me as useBsInstance,
3125
- De as useDisposables,
3126
- R as useField,
3127
- $o as useFormApi
3190
+ An as AmountInput,
3191
+ Ln as CaptchaInput,
3192
+ zn as CheckboxButtonInput,
3193
+ Wn as CheckboxInput,
3194
+ xn as CheckboxToggle,
3195
+ ot as ChipsInput,
3196
+ cn as ComboboxInput,
3197
+ At as EmailInput,
3198
+ fn as FileInput,
3199
+ To as FormAdorn,
3200
+ Ze as FormAdornInput,
3201
+ rl as FormContainer,
3202
+ gl as FormField,
3203
+ mn as FormLabel,
3204
+ pn as GroupControl,
3205
+ Sl as MobileInput,
3206
+ jl as MultiQuantityInput,
3207
+ Kl as OTPInput,
3208
+ _l as PasswordInput,
3209
+ hn as QuantityInput,
3210
+ vn as RangeInput,
3211
+ Co as RangeSliderInput,
3212
+ Io as Select2Input,
3213
+ ra as SimpleUploader,
3214
+ fa as StarRatingInput,
3215
+ ya as SubmitButton,
3216
+ Ca as SwitchInput,
3217
+ Ea as TextAreaInput,
3218
+ je as TextInput,
3219
+ So as VoiceRecorderInput,
3220
+ gn as VoiceRecorderResultArea,
3221
+ _n as configureBootstrap,
3222
+ kn as configureI18n,
3223
+ No as default,
3224
+ z as fieldProps,
3225
+ Je as toEnglishDigits,
3226
+ he as useBsInstance,
3227
+ Le as useDisposables,
3228
+ U as useField,
3229
+ Vo as useFormApi
3128
3230
  };