@invoice-sdk/widget 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts.map +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +136 -136
- package/dist/widget.css +1 -1
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -279,7 +279,7 @@ var _r;
|
|
|
279
279
|
function bs() {
|
|
280
280
|
return _r || (_r = 1, process.env.NODE_ENV === "production" ? Rt.exports = vs() : Rt.exports = _s()), Rt.exports;
|
|
281
281
|
}
|
|
282
|
-
var
|
|
282
|
+
var g = bs();
|
|
283
283
|
const br = (t) => {
|
|
284
284
|
let e;
|
|
285
285
|
const r = /* @__PURE__ */ new Set(), s = (h, f) => {
|
|
@@ -309,7 +309,7 @@ const xr = (t) => {
|
|
|
309
309
|
reset: () => t({ step: 1 })
|
|
310
310
|
})), Ts = 4, Ss = () => {
|
|
311
311
|
const { step: t } = st();
|
|
312
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ g.jsx("div", { className: "w-full relative h-3 bg-gray-200 rounded-full", children: /* @__PURE__ */ g.jsx(
|
|
313
313
|
"div",
|
|
314
314
|
{
|
|
315
315
|
className: "absolute rounded-full bg-green-500",
|
|
@@ -320,8 +320,8 @@ const xr = (t) => {
|
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
) });
|
|
323
|
-
}, As = ({ children: t }) => /* @__PURE__ */
|
|
324
|
-
/* @__PURE__ */
|
|
323
|
+
}, As = ({ children: t }) => /* @__PURE__ */ g.jsxs("div", { className: "max-w-[800px] mx-auto py-10 flex flex-col gap-8", children: [
|
|
324
|
+
/* @__PURE__ */ g.jsx(Ss, {}),
|
|
325
325
|
t
|
|
326
326
|
] });
|
|
327
327
|
var jt = (t) => t.type === "checkbox", qe = (t) => t instanceof Date, ne = (t) => t == null;
|
|
@@ -882,17 +882,17 @@ function Ws(t = {}) {
|
|
|
882
882
|
validatingFields: r.validatingFields,
|
|
883
883
|
isValidating: !oe(r.validatingFields)
|
|
884
884
|
}));
|
|
885
|
-
}, pe = (c, l = [], u, k, v = !0,
|
|
885
|
+
}, pe = (c, l = [], u, k, v = !0, y = !0) => {
|
|
886
886
|
if (k && u && !e.disabled) {
|
|
887
|
-
if (i.action = !0,
|
|
887
|
+
if (i.action = !0, y && Array.isArray(_(s, c))) {
|
|
888
888
|
const A = u(_(s, c), k.argA, k.argB);
|
|
889
889
|
v && D(s, c, A);
|
|
890
890
|
}
|
|
891
|
-
if (
|
|
891
|
+
if (y && Array.isArray(_(r.errors, c))) {
|
|
892
892
|
const A = u(_(r.errors, c), k.argA, k.argB);
|
|
893
893
|
v && D(r.errors, c, A), Us(r.errors, c);
|
|
894
894
|
}
|
|
895
|
-
if ((f.touchedFields || x.touchedFields) &&
|
|
895
|
+
if ((f.touchedFields || x.touchedFields) && y && Array.isArray(_(r.touchedFields, c))) {
|
|
896
896
|
const A = u(_(r.touchedFields, c), k.argA, k.argB);
|
|
897
897
|
v && D(r.touchedFields, c, A);
|
|
898
898
|
}
|
|
@@ -917,33 +917,33 @@ function Ws(t = {}) {
|
|
|
917
917
|
}, re = (c, l, u, k) => {
|
|
918
918
|
const v = _(s, c);
|
|
919
919
|
if (v) {
|
|
920
|
-
const
|
|
921
|
-
Y(
|
|
920
|
+
const y = _(a, c, Y(u) ? _(n, c) : u);
|
|
921
|
+
Y(y) || k && k.defaultChecked || l ? D(a, c, l ? y : Ar(v._f)) : $(c, y), i.mount && Z();
|
|
922
922
|
}
|
|
923
923
|
}, q = (c, l, u, k, v) => {
|
|
924
|
-
let
|
|
924
|
+
let y = !1, A = !1;
|
|
925
925
|
const M = {
|
|
926
926
|
name: c
|
|
927
927
|
};
|
|
928
928
|
if (!e.disabled) {
|
|
929
929
|
if (!u || k) {
|
|
930
|
-
(f.isDirty || x.isDirty) && (A = r.isDirty, r.isDirty = M.isDirty = ie(),
|
|
930
|
+
(f.isDirty || x.isDirty) && (A = r.isDirty, r.isDirty = M.isDirty = ie(), y = A !== M.isDirty);
|
|
931
931
|
const L = Ze(_(n, c), l);
|
|
932
|
-
A = !!_(r.dirtyFields, c), L ? X(r.dirtyFields, c) : D(r.dirtyFields, c, !0), M.dirtyFields = r.dirtyFields,
|
|
932
|
+
A = !!_(r.dirtyFields, c), L ? X(r.dirtyFields, c) : D(r.dirtyFields, c, !0), M.dirtyFields = r.dirtyFields, y = y || (f.dirtyFields || x.dirtyFields) && A !== !L;
|
|
933
933
|
}
|
|
934
934
|
if (u) {
|
|
935
935
|
const L = _(r.touchedFields, c);
|
|
936
|
-
L || (D(r.touchedFields, c, u), M.touchedFields = r.touchedFields,
|
|
936
|
+
L || (D(r.touchedFields, c, u), M.touchedFields = r.touchedFields, y = y || (f.touchedFields || x.touchedFields) && L !== u);
|
|
937
937
|
}
|
|
938
|
-
|
|
938
|
+
y && v && S.state.next(M);
|
|
939
939
|
}
|
|
940
|
-
return
|
|
940
|
+
return y ? M : {};
|
|
941
941
|
}, Xe = (c, l, u, k) => {
|
|
942
|
-
const v = _(r.errors, c),
|
|
943
|
-
if (e.delayError && u ? (d = te(() => R(c, u)), d(e.delayError)) : (clearTimeout(h), d = null, u ? D(r.errors, c, u) : X(r.errors, c)), (u ? !Ze(v, u) : v) || !oe(k) ||
|
|
942
|
+
const v = _(r.errors, c), y = (f.isValid || x.isValid) && fe(l) && r.isValid !== l;
|
|
943
|
+
if (e.delayError && u ? (d = te(() => R(c, u)), d(e.delayError)) : (clearTimeout(h), d = null, u ? D(r.errors, c, u) : X(r.errors, c)), (u ? !Ze(v, u) : v) || !oe(k) || y) {
|
|
944
944
|
const A = {
|
|
945
945
|
...k,
|
|
946
|
-
...
|
|
946
|
+
...y && fe(l) ? { isValid: l } : {},
|
|
947
947
|
errors: r.errors,
|
|
948
948
|
name: c
|
|
949
949
|
};
|
|
@@ -972,14 +972,14 @@ function Ws(t = {}) {
|
|
|
972
972
|
for (const k in c) {
|
|
973
973
|
const v = c[k];
|
|
974
974
|
if (v) {
|
|
975
|
-
const { _f:
|
|
976
|
-
if (
|
|
977
|
-
const M = o.array.has(
|
|
975
|
+
const { _f: y, ...A } = v;
|
|
976
|
+
if (y) {
|
|
977
|
+
const M = o.array.has(y.name), L = v._f && Ds(v._f);
|
|
978
978
|
L && f.validatingFields && z([k], !0);
|
|
979
979
|
const me = await Or(v, o.disabled, a, W, e.shouldUseNativeValidation && !l, M);
|
|
980
|
-
if (L && f.validatingFields && z([k]), me[
|
|
980
|
+
if (L && f.validatingFields && z([k]), me[y.name] && (u.valid = !1, l))
|
|
981
981
|
break;
|
|
982
|
-
!l && (_(me,
|
|
982
|
+
!l && (_(me, y.name) ? M ? zs(r.errors, me, y.name) : D(r.errors, y.name, me[y.name]) : X(r.errors, y.name));
|
|
983
983
|
}
|
|
984
984
|
!oe(A) && await le(A, l, u);
|
|
985
985
|
}
|
|
@@ -997,10 +997,10 @@ function Ws(t = {}) {
|
|
|
997
997
|
const k = _(s, c);
|
|
998
998
|
let v = l;
|
|
999
999
|
if (k) {
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1000
|
+
const y = k._f;
|
|
1001
|
+
y && (!y.disabled && D(a, c, Gr(l, y)), v = Ft(y.ref) && ne(l) ? "" : l, qr(y.ref) ? [...y.ref.options].forEach((A) => A.selected = v.includes(A.value)) : y.refs ? jt(y.ref) ? y.refs.forEach((A) => {
|
|
1002
1002
|
(!A.defaultChecked || !A.disabled) && (Array.isArray(v) ? A.checked = !!v.find((M) => M === A.value) : A.checked = v === A.value || !!v);
|
|
1003
|
-
}) :
|
|
1003
|
+
}) : y.refs.forEach((A) => A.checked = A.value === v) : or(y.ref) ? y.ref.value = "" : (y.ref.value = v, y.ref.type || S.state.next({
|
|
1004
1004
|
name: c,
|
|
1005
1005
|
values: ee(a)
|
|
1006
1006
|
})));
|
|
@@ -1010,19 +1010,19 @@ function Ws(t = {}) {
|
|
|
1010
1010
|
for (const k in l) {
|
|
1011
1011
|
if (!l.hasOwnProperty(k))
|
|
1012
1012
|
return;
|
|
1013
|
-
const v = l[k],
|
|
1014
|
-
(o.array.has(c) || J(v) || A && !A._f) && !qe(v) ? Q(
|
|
1013
|
+
const v = l[k], y = c + "." + k, A = _(s, y);
|
|
1014
|
+
(o.array.has(c) || J(v) || A && !A._f) && !qe(v) ? Q(y, v, u) : $(y, v, u);
|
|
1015
1015
|
}
|
|
1016
1016
|
}, K = (c, l, u = {}) => {
|
|
1017
|
-
const k = _(s, c), v = o.array.has(c),
|
|
1018
|
-
D(a, c,
|
|
1017
|
+
const k = _(s, c), v = o.array.has(c), y = ee(l);
|
|
1018
|
+
D(a, c, y), v ? (S.array.next({
|
|
1019
1019
|
name: c,
|
|
1020
1020
|
values: ee(a)
|
|
1021
1021
|
}), (f.isDirty || f.dirtyFields || x.isDirty || x.dirtyFields) && u.shouldDirty && S.state.next({
|
|
1022
1022
|
name: c,
|
|
1023
1023
|
dirtyFields: ut(n, a),
|
|
1024
|
-
isDirty: ie(c,
|
|
1025
|
-
})) : k && !k._f && !ne(
|
|
1024
|
+
isDirty: ie(c, y)
|
|
1025
|
+
})) : k && !k._f && !ne(y) ? Q(c, y, u) : $(c, y, u), Nr(c, o) && S.state.next({ ...r }), S.state.next({
|
|
1026
1026
|
name: i.mount ? c : void 0,
|
|
1027
1027
|
values: ee(a)
|
|
1028
1028
|
});
|
|
@@ -1030,7 +1030,7 @@ function Ws(t = {}) {
|
|
|
1030
1030
|
i.mount = !0;
|
|
1031
1031
|
const l = c.target;
|
|
1032
1032
|
let u = l.name, k = !0;
|
|
1033
|
-
const v = _(s, u),
|
|
1033
|
+
const v = _(s, u), y = (L) => {
|
|
1034
1034
|
k = Number.isNaN(L) || qe(L) && isNaN(L.getTime()) || Ze(L, _(a, u, L));
|
|
1035
1035
|
}, A = Er(e.mode), M = Er(e.reValidateMode);
|
|
1036
1036
|
if (v) {
|
|
@@ -1046,12 +1046,12 @@ function Ws(t = {}) {
|
|
|
1046
1046
|
return (f.isValid || x.isValid) && (e.mode === "onBlur" ? Ie && Z() : Ie || Z()), fs && S.state.next({ name: u, ...Yt ? {} : Jt });
|
|
1047
1047
|
if (!Ie && Yt && S.state.next({ ...r }), e.resolver) {
|
|
1048
1048
|
const { errors: mr } = await xe([u]);
|
|
1049
|
-
if (
|
|
1049
|
+
if (y(Ct), k) {
|
|
1050
1050
|
const hs = Cr(r.errors, s, u), pr = Cr(mr, s, hs.name || u);
|
|
1051
1051
|
L = pr.error, u = pr.name, me = oe(mr);
|
|
1052
1052
|
}
|
|
1053
1053
|
} else
|
|
1054
|
-
z([u], !0), L = (await Or(v, o.disabled, a, W, e.shouldUseNativeValidation))[u], z([u]),
|
|
1054
|
+
z([u], !0), L = (await Or(v, o.disabled, a, W, e.shouldUseNativeValidation))[u], z([u]), y(Ct), k && (L ? me = !1 : (f.isValid || x.isValid) && (me = await le(s, !0)));
|
|
1055
1055
|
k && (v._f.deps && Ne(v._f.deps), Xe(u, me, L, Jt));
|
|
1056
1056
|
}
|
|
1057
1057
|
}, Pe = (c, l) => {
|
|
@@ -1061,11 +1061,11 @@ function Ws(t = {}) {
|
|
|
1061
1061
|
let u, k;
|
|
1062
1062
|
const v = ft(c);
|
|
1063
1063
|
if (e.resolver) {
|
|
1064
|
-
const
|
|
1065
|
-
u = oe(
|
|
1066
|
-
} else c ? (k = (await Promise.all(v.map(async (
|
|
1067
|
-
const A = _(s,
|
|
1068
|
-
return await le(A && A._f ? { [
|
|
1064
|
+
const y = await Qe(Y(c) ? c : v);
|
|
1065
|
+
u = oe(y), k = c ? !v.some((A) => _(y, A)) : u;
|
|
1066
|
+
} else c ? (k = (await Promise.all(v.map(async (y) => {
|
|
1067
|
+
const A = _(s, y);
|
|
1068
|
+
return await le(A && A._f ? { [y]: A } : A);
|
|
1069
1069
|
}))).every(Boolean), !(!k && !r.isValid) && Z()) : k = u = await le(s);
|
|
1070
1070
|
return S.state.next({
|
|
1071
1071
|
...!Te(c) || (f.isValid || x.isValid) && u !== r.isValid ? {} : { name: c },
|
|
@@ -1088,7 +1088,7 @@ function Ws(t = {}) {
|
|
|
1088
1088
|
errors: c ? r.errors : {}
|
|
1089
1089
|
});
|
|
1090
1090
|
}, H = (c, l, u) => {
|
|
1091
|
-
const k = (_(s, c, { _f: {} })._f || {}).ref, v = _(r.errors, c) || {}, { ref:
|
|
1091
|
+
const k = (_(s, c, { _f: {} })._f || {}).ref, v = _(r.errors, c) || {}, { ref: y, message: A, type: M, ...L } = v;
|
|
1092
1092
|
D(r.errors, c, {
|
|
1093
1093
|
...L,
|
|
1094
1094
|
...l,
|
|
@@ -1155,8 +1155,8 @@ function Ws(t = {}) {
|
|
|
1155
1155
|
ref: (v) => {
|
|
1156
1156
|
if (v) {
|
|
1157
1157
|
we(c, l), u = _(s, c);
|
|
1158
|
-
const
|
|
1159
|
-
if (A ? M.find((L) => L ===
|
|
1158
|
+
const y = Y(v.value) && v.querySelectorAll && v.querySelectorAll("input,select,textarea")[0] || v, A = Vs(y), M = u._f.refs || [];
|
|
1159
|
+
if (A ? M.find((L) => L === y) : y === u._f.ref)
|
|
1160
1160
|
return;
|
|
1161
1161
|
D(s, c, {
|
|
1162
1162
|
_f: {
|
|
@@ -1164,13 +1164,13 @@ function Ws(t = {}) {
|
|
|
1164
1164
|
...A ? {
|
|
1165
1165
|
refs: [
|
|
1166
1166
|
...M.filter(Ht),
|
|
1167
|
-
|
|
1167
|
+
y,
|
|
1168
1168
|
...Array.isArray(_(n, c)) ? [{}] : []
|
|
1169
1169
|
],
|
|
1170
|
-
ref: { type:
|
|
1171
|
-
} : { ref:
|
|
1170
|
+
ref: { type: y.type, name: c }
|
|
1171
|
+
} : { ref: y }
|
|
1172
1172
|
}
|
|
1173
|
-
}), re(c, !1, void 0,
|
|
1173
|
+
}), re(c, !1, void 0, y);
|
|
1174
1174
|
} else
|
|
1175
1175
|
u = _(s, c, {}), u._f && (u._f.mount = !1), (e.shouldUnregister || l.shouldUnregister) && !($r(o.array, c) && i.action) && o.unMount.add(c);
|
|
1176
1176
|
}
|
|
@@ -1189,21 +1189,21 @@ function Ws(t = {}) {
|
|
|
1189
1189
|
if (S.state.next({
|
|
1190
1190
|
isSubmitting: !0
|
|
1191
1191
|
}), e.resolver) {
|
|
1192
|
-
const { errors:
|
|
1193
|
-
r.errors =
|
|
1192
|
+
const { errors: y, values: A } = await xe();
|
|
1193
|
+
r.errors = y, v = A;
|
|
1194
1194
|
} else
|
|
1195
1195
|
await le(s);
|
|
1196
1196
|
if (o.disabled.size)
|
|
1197
|
-
for (const
|
|
1198
|
-
D(v,
|
|
1197
|
+
for (const y of o.disabled)
|
|
1198
|
+
D(v, y, void 0);
|
|
1199
1199
|
if (X(r.errors, "root"), oe(r.errors)) {
|
|
1200
1200
|
S.state.next({
|
|
1201
1201
|
errors: {}
|
|
1202
1202
|
});
|
|
1203
1203
|
try {
|
|
1204
1204
|
await c(v, u);
|
|
1205
|
-
} catch (
|
|
1206
|
-
k =
|
|
1205
|
+
} catch (y) {
|
|
1206
|
+
k = y;
|
|
1207
1207
|
}
|
|
1208
1208
|
} else
|
|
1209
1209
|
l && await l({ ...r.errors }, u), We(), setTimeout(We);
|
|
@@ -1218,7 +1218,7 @@ function Ws(t = {}) {
|
|
|
1218
1218
|
}, cs = (c, l = {}) => {
|
|
1219
1219
|
_(s, c) && (Y(l.defaultValue) ? K(c, ee(_(n, c))) : (K(c, l.defaultValue), D(n, c, ee(l.defaultValue))), l.keepTouched || X(r.touchedFields, c), l.keepDirty || (X(r.dirtyFields, c), r.isDirty = l.defaultValue ? ie(c, ee(_(n, c))) : ie()), l.keepError || (X(r.errors, c), f.isValid && Z()), S.state.next({ ...r }));
|
|
1220
1220
|
}, dr = (c, l = {}) => {
|
|
1221
|
-
const u = c ? ee(c) : n, k = ee(u), v = oe(c),
|
|
1221
|
+
const u = c ? ee(c) : n, k = ee(u), v = oe(c), y = v ? n : k;
|
|
1222
1222
|
if (l.keepDefaultValues || (n = u), !l.keepValues) {
|
|
1223
1223
|
if (l.keepDirtyValues) {
|
|
1224
1224
|
const A = /* @__PURE__ */ new Set([
|
|
@@ -1226,7 +1226,7 @@ function Ws(t = {}) {
|
|
|
1226
1226
|
...Object.keys(ut(n, a))
|
|
1227
1227
|
]);
|
|
1228
1228
|
for (const M of Array.from(A))
|
|
1229
|
-
_(r.dirtyFields, M) ? D(
|
|
1229
|
+
_(r.dirtyFields, M) ? D(y, M, _(a, M)) : K(M, _(y, M));
|
|
1230
1230
|
} else {
|
|
1231
1231
|
if (sr && Y(c))
|
|
1232
1232
|
for (const A of o.mount) {
|
|
@@ -1243,12 +1243,12 @@ function Ws(t = {}) {
|
|
|
1243
1243
|
}
|
|
1244
1244
|
}
|
|
1245
1245
|
for (const A of o.mount)
|
|
1246
|
-
K(A, _(
|
|
1246
|
+
K(A, _(y, A));
|
|
1247
1247
|
}
|
|
1248
|
-
a = ee(
|
|
1249
|
-
values: { ...
|
|
1248
|
+
a = ee(y), S.array.next({
|
|
1249
|
+
values: { ...y }
|
|
1250
1250
|
}), S.state.next({
|
|
1251
|
-
values: { ...
|
|
1251
|
+
values: { ...y }
|
|
1252
1252
|
});
|
|
1253
1253
|
}
|
|
1254
1254
|
o = {
|
|
@@ -4421,7 +4421,7 @@ const Tn = (t, e = {
|
|
|
4421
4421
|
return F;
|
|
4422
4422
|
},
|
|
4423
4423
|
void: Fn
|
|
4424
|
-
}, Symbol.toStringTag, { value: "Module" })), zt = (t) => /* @__PURE__ */
|
|
4424
|
+
}, Symbol.toStringTag, { value: "Module" })), zt = (t) => /* @__PURE__ */ g.jsx(
|
|
4425
4425
|
"button",
|
|
4426
4426
|
{
|
|
4427
4427
|
type: t.type || "button",
|
|
@@ -4447,14 +4447,14 @@ const Tn = (t, e = {
|
|
|
4447
4447
|
}, []);
|
|
4448
4448
|
return ys(() => {
|
|
4449
4449
|
r && o(URL.createObjectURL(r));
|
|
4450
|
-
}, [r]), /* @__PURE__ */
|
|
4451
|
-
/* @__PURE__ */
|
|
4452
|
-
/* @__PURE__ */
|
|
4450
|
+
}, [r]), /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
4451
|
+
/* @__PURE__ */ g.jsxs("div", { className: "flex flex-col", children: [
|
|
4452
|
+
/* @__PURE__ */ g.jsxs("label", { className: "font-medium mb-1 text-gray-700", children: [
|
|
4453
4453
|
t,
|
|
4454
|
-
e && /* @__PURE__ */
|
|
4454
|
+
e && /* @__PURE__ */ g.jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
4455
4455
|
] }),
|
|
4456
|
-
/* @__PURE__ */
|
|
4457
|
-
/* @__PURE__ */
|
|
4456
|
+
/* @__PURE__ */ g.jsxs("div", { className: "flex items-center", children: [
|
|
4457
|
+
/* @__PURE__ */ g.jsx(
|
|
4458
4458
|
"button",
|
|
4459
4459
|
{
|
|
4460
4460
|
type: "button",
|
|
@@ -4463,7 +4463,7 @@ const Tn = (t, e = {
|
|
|
4463
4463
|
children: "Upload file"
|
|
4464
4464
|
}
|
|
4465
4465
|
),
|
|
4466
|
-
/* @__PURE__ */
|
|
4466
|
+
/* @__PURE__ */ g.jsx(
|
|
4467
4467
|
"input",
|
|
4468
4468
|
{
|
|
4469
4469
|
ref: a,
|
|
@@ -4474,22 +4474,22 @@ const Tn = (t, e = {
|
|
|
4474
4474
|
}
|
|
4475
4475
|
)
|
|
4476
4476
|
] }),
|
|
4477
|
-
/* @__PURE__ */
|
|
4477
|
+
/* @__PURE__ */ g.jsx(
|
|
4478
4478
|
"div",
|
|
4479
4479
|
{
|
|
4480
4480
|
className: "mt-2 h-40 w-full bg-gray-200 rounded overflow-hidden flex items-center justify-center cursor-pointer",
|
|
4481
4481
|
onClick: () => i && h(!0),
|
|
4482
|
-
children: i ? (r == null ? void 0 : r.type) === "application/pdf" ? /* @__PURE__ */
|
|
4482
|
+
children: i ? (r == null ? void 0 : r.type) === "application/pdf" ? /* @__PURE__ */ g.jsx(
|
|
4483
4483
|
"object",
|
|
4484
4484
|
{
|
|
4485
4485
|
data: i,
|
|
4486
4486
|
type: "application/pdf",
|
|
4487
4487
|
width: "100%",
|
|
4488
4488
|
height: "100%",
|
|
4489
|
-
children: /* @__PURE__ */
|
|
4489
|
+
children: /* @__PURE__ */ g.jsxs("p", { className: "text-gray-600 text-sm", children: [
|
|
4490
4490
|
"Cannot preview PDF.",
|
|
4491
4491
|
" ",
|
|
4492
|
-
/* @__PURE__ */
|
|
4492
|
+
/* @__PURE__ */ g.jsx(
|
|
4493
4493
|
"a",
|
|
4494
4494
|
{
|
|
4495
4495
|
href: i,
|
|
@@ -4501,30 +4501,30 @@ const Tn = (t, e = {
|
|
|
4501
4501
|
)
|
|
4502
4502
|
] })
|
|
4503
4503
|
}
|
|
4504
|
-
) : /* @__PURE__ */
|
|
4504
|
+
) : /* @__PURE__ */ g.jsx(
|
|
4505
4505
|
"img",
|
|
4506
4506
|
{
|
|
4507
4507
|
src: i,
|
|
4508
4508
|
alt: "Preview",
|
|
4509
4509
|
className: "h-full object-contain"
|
|
4510
4510
|
}
|
|
4511
|
-
) : /* @__PURE__ */
|
|
4511
|
+
) : /* @__PURE__ */ g.jsx("span", { className: "text-gray-500", children: "No file selected" })
|
|
4512
4512
|
}
|
|
4513
4513
|
),
|
|
4514
|
-
n && /* @__PURE__ */
|
|
4514
|
+
n && /* @__PURE__ */ g.jsx("span", { className: "text-red-500 text-sm mt-1", children: n })
|
|
4515
4515
|
] }),
|
|
4516
|
-
d && i && /* @__PURE__ */
|
|
4516
|
+
d && i && /* @__PURE__ */ g.jsx(
|
|
4517
4517
|
"div",
|
|
4518
4518
|
{
|
|
4519
4519
|
className: "fixed inset-0 bg-black bg-opacity-75 z-50 flex items-center justify-center",
|
|
4520
4520
|
onClick: () => h(!1),
|
|
4521
|
-
children: /* @__PURE__ */
|
|
4521
|
+
children: /* @__PURE__ */ g.jsxs(
|
|
4522
4522
|
"div",
|
|
4523
4523
|
{
|
|
4524
4524
|
className: "relative w-full h-full",
|
|
4525
4525
|
onClick: (S) => S.stopPropagation(),
|
|
4526
4526
|
children: [
|
|
4527
|
-
/* @__PURE__ */
|
|
4527
|
+
/* @__PURE__ */ g.jsx(
|
|
4528
4528
|
"button",
|
|
4529
4529
|
{
|
|
4530
4530
|
onClick: () => h(!1),
|
|
@@ -4533,14 +4533,14 @@ const Tn = (t, e = {
|
|
|
4533
4533
|
children: "×"
|
|
4534
4534
|
}
|
|
4535
4535
|
),
|
|
4536
|
-
(r == null ? void 0 : r.type) === "application/pdf" ? /* @__PURE__ */
|
|
4536
|
+
(r == null ? void 0 : r.type) === "application/pdf" ? /* @__PURE__ */ g.jsx(
|
|
4537
4537
|
"object",
|
|
4538
4538
|
{
|
|
4539
4539
|
data: i,
|
|
4540
4540
|
type: "application/pdf",
|
|
4541
4541
|
className: "w-full h-full object-contain"
|
|
4542
4542
|
}
|
|
4543
|
-
) : /* @__PURE__ */
|
|
4543
|
+
) : /* @__PURE__ */ g.jsx(
|
|
4544
4544
|
"img",
|
|
4545
4545
|
{
|
|
4546
4546
|
src: i,
|
|
@@ -4555,19 +4555,19 @@ const Tn = (t, e = {
|
|
|
4555
4555
|
)
|
|
4556
4556
|
] });
|
|
4557
4557
|
}, Me = gs(
|
|
4558
|
-
({ label: t, required: e = !1, error: r, ...s }, n) => /* @__PURE__ */
|
|
4559
|
-
/* @__PURE__ */
|
|
4558
|
+
({ label: t, required: e = !1, error: r, ...s }, n) => /* @__PURE__ */ g.jsxs("div", { className: "flex flex-col", children: [
|
|
4559
|
+
/* @__PURE__ */ g.jsxs(
|
|
4560
4560
|
"label",
|
|
4561
4561
|
{
|
|
4562
4562
|
htmlFor: s.name,
|
|
4563
4563
|
className: "font-medium mb-1 text-gray-700",
|
|
4564
4564
|
children: [
|
|
4565
4565
|
t,
|
|
4566
|
-
e && /* @__PURE__ */
|
|
4566
|
+
e && /* @__PURE__ */ g.jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
4567
4567
|
]
|
|
4568
4568
|
}
|
|
4569
4569
|
),
|
|
4570
|
-
/* @__PURE__ */
|
|
4570
|
+
/* @__PURE__ */ g.jsx(
|
|
4571
4571
|
"input",
|
|
4572
4572
|
{
|
|
4573
4573
|
id: s.name,
|
|
@@ -4576,7 +4576,7 @@ const Tn = (t, e = {
|
|
|
4576
4576
|
className: `border rounded px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 ${r ? "border-red-500" : "border-gray-300"}`
|
|
4577
4577
|
}
|
|
4578
4578
|
),
|
|
4579
|
-
r && /* @__PURE__ */
|
|
4579
|
+
r && /* @__PURE__ */ g.jsx("span", { className: "text-red-500 text-sm mt-1", children: r })
|
|
4580
4580
|
] })
|
|
4581
4581
|
);
|
|
4582
4582
|
Me.displayName = "InputField";
|
|
@@ -4656,22 +4656,22 @@ const Et = Mr((t) => ({
|
|
|
4656
4656
|
// handle optional license
|
|
4657
4657
|
});
|
|
4658
4658
|
};
|
|
4659
|
-
return /* @__PURE__ */
|
|
4659
|
+
return /* @__PURE__ */ g.jsxs(
|
|
4660
4660
|
"form",
|
|
4661
4661
|
{
|
|
4662
4662
|
onSubmit: r(h),
|
|
4663
4663
|
className: "w-full mx-auto p-6 bg-white shadow rounded",
|
|
4664
4664
|
children: [
|
|
4665
|
-
/* @__PURE__ */
|
|
4666
|
-
/* @__PURE__ */
|
|
4667
|
-
/* @__PURE__ */
|
|
4665
|
+
/* @__PURE__ */ g.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-8", children: [
|
|
4666
|
+
/* @__PURE__ */ g.jsxs("div", { className: "space-y-4", children: [
|
|
4667
|
+
/* @__PURE__ */ g.jsx(
|
|
4668
4668
|
De,
|
|
4669
4669
|
{
|
|
4670
4670
|
name: "taxCode",
|
|
4671
4671
|
control: e,
|
|
4672
4672
|
render: ({ field: f }) => {
|
|
4673
4673
|
var x;
|
|
4674
|
-
return /* @__PURE__ */
|
|
4674
|
+
return /* @__PURE__ */ g.jsx(
|
|
4675
4675
|
Me,
|
|
4676
4676
|
{
|
|
4677
4677
|
...f,
|
|
@@ -4683,14 +4683,14 @@ const Et = Mr((t) => ({
|
|
|
4683
4683
|
}
|
|
4684
4684
|
}
|
|
4685
4685
|
),
|
|
4686
|
-
/* @__PURE__ */
|
|
4686
|
+
/* @__PURE__ */ g.jsx(
|
|
4687
4687
|
De,
|
|
4688
4688
|
{
|
|
4689
4689
|
name: "representative",
|
|
4690
4690
|
control: e,
|
|
4691
4691
|
render: ({ field: f }) => {
|
|
4692
4692
|
var x;
|
|
4693
|
-
return /* @__PURE__ */
|
|
4693
|
+
return /* @__PURE__ */ g.jsx(
|
|
4694
4694
|
Me,
|
|
4695
4695
|
{
|
|
4696
4696
|
...f,
|
|
@@ -4702,14 +4702,14 @@ const Et = Mr((t) => ({
|
|
|
4702
4702
|
}
|
|
4703
4703
|
}
|
|
4704
4704
|
),
|
|
4705
|
-
/* @__PURE__ */
|
|
4705
|
+
/* @__PURE__ */ g.jsx(
|
|
4706
4706
|
De,
|
|
4707
4707
|
{
|
|
4708
4708
|
name: "email",
|
|
4709
4709
|
control: e,
|
|
4710
4710
|
render: ({ field: f }) => {
|
|
4711
4711
|
var x;
|
|
4712
|
-
return /* @__PURE__ */
|
|
4712
|
+
return /* @__PURE__ */ g.jsx(
|
|
4713
4713
|
Me,
|
|
4714
4714
|
{
|
|
4715
4715
|
...f,
|
|
@@ -4722,14 +4722,14 @@ const Et = Mr((t) => ({
|
|
|
4722
4722
|
}
|
|
4723
4723
|
}
|
|
4724
4724
|
),
|
|
4725
|
-
/* @__PURE__ */
|
|
4725
|
+
/* @__PURE__ */ g.jsx(
|
|
4726
4726
|
De,
|
|
4727
4727
|
{
|
|
4728
4728
|
name: "address",
|
|
4729
4729
|
control: e,
|
|
4730
4730
|
render: ({ field: f }) => {
|
|
4731
4731
|
var x;
|
|
4732
|
-
return /* @__PURE__ */
|
|
4732
|
+
return /* @__PURE__ */ g.jsx(
|
|
4733
4733
|
Me,
|
|
4734
4734
|
{
|
|
4735
4735
|
...f,
|
|
@@ -4741,14 +4741,14 @@ const Et = Mr((t) => ({
|
|
|
4741
4741
|
}
|
|
4742
4742
|
}
|
|
4743
4743
|
),
|
|
4744
|
-
/* @__PURE__ */
|
|
4744
|
+
/* @__PURE__ */ g.jsx(
|
|
4745
4745
|
De,
|
|
4746
4746
|
{
|
|
4747
4747
|
name: "license",
|
|
4748
4748
|
control: e,
|
|
4749
4749
|
render: ({ field: f }) => {
|
|
4750
4750
|
var x;
|
|
4751
|
-
return /* @__PURE__ */
|
|
4751
|
+
return /* @__PURE__ */ g.jsx(
|
|
4752
4752
|
ia,
|
|
4753
4753
|
{
|
|
4754
4754
|
label: "Giấy phép đăng ký kinh doanh",
|
|
@@ -4762,15 +4762,15 @@ const Et = Mr((t) => ({
|
|
|
4762
4762
|
}
|
|
4763
4763
|
)
|
|
4764
4764
|
] }),
|
|
4765
|
-
/* @__PURE__ */
|
|
4766
|
-
/* @__PURE__ */
|
|
4765
|
+
/* @__PURE__ */ g.jsxs("div", { className: "space-y-4", children: [
|
|
4766
|
+
/* @__PURE__ */ g.jsx(
|
|
4767
4767
|
De,
|
|
4768
4768
|
{
|
|
4769
4769
|
name: "companyName",
|
|
4770
4770
|
control: e,
|
|
4771
4771
|
render: ({ field: f }) => {
|
|
4772
4772
|
var x;
|
|
4773
|
-
return /* @__PURE__ */
|
|
4773
|
+
return /* @__PURE__ */ g.jsx(
|
|
4774
4774
|
Me,
|
|
4775
4775
|
{
|
|
4776
4776
|
...f,
|
|
@@ -4782,14 +4782,14 @@ const Et = Mr((t) => ({
|
|
|
4782
4782
|
}
|
|
4783
4783
|
}
|
|
4784
4784
|
),
|
|
4785
|
-
/* @__PURE__ */
|
|
4785
|
+
/* @__PURE__ */ g.jsx(
|
|
4786
4786
|
De,
|
|
4787
4787
|
{
|
|
4788
4788
|
name: "position",
|
|
4789
4789
|
control: e,
|
|
4790
4790
|
render: ({ field: f }) => {
|
|
4791
4791
|
var x;
|
|
4792
|
-
return /* @__PURE__ */
|
|
4792
|
+
return /* @__PURE__ */ g.jsx(
|
|
4793
4793
|
Me,
|
|
4794
4794
|
{
|
|
4795
4795
|
...f,
|
|
@@ -4800,14 +4800,14 @@ const Et = Mr((t) => ({
|
|
|
4800
4800
|
}
|
|
4801
4801
|
}
|
|
4802
4802
|
),
|
|
4803
|
-
/* @__PURE__ */
|
|
4803
|
+
/* @__PURE__ */ g.jsx(
|
|
4804
4804
|
De,
|
|
4805
4805
|
{
|
|
4806
4806
|
name: "phone",
|
|
4807
4807
|
control: e,
|
|
4808
4808
|
render: ({ field: f }) => {
|
|
4809
4809
|
var x;
|
|
4810
|
-
return /* @__PURE__ */
|
|
4810
|
+
return /* @__PURE__ */ g.jsx(
|
|
4811
4811
|
Me,
|
|
4812
4812
|
{
|
|
4813
4813
|
...f,
|
|
@@ -4821,8 +4821,8 @@ const Et = Mr((t) => ({
|
|
|
4821
4821
|
)
|
|
4822
4822
|
] })
|
|
4823
4823
|
] }),
|
|
4824
|
-
/* @__PURE__ */
|
|
4825
|
-
/* @__PURE__ */
|
|
4824
|
+
/* @__PURE__ */ g.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
|
|
4825
|
+
/* @__PURE__ */ g.jsx(
|
|
4826
4826
|
zt,
|
|
4827
4827
|
{
|
|
4828
4828
|
title: "Back",
|
|
@@ -4832,7 +4832,7 @@ const Et = Mr((t) => ({
|
|
|
4832
4832
|
className: " !bg-gray-200 !text-gray-700 hover:!bg-gray-300 disabled:!bg-gray-200 disabled:!text-gray-500"
|
|
4833
4833
|
}
|
|
4834
4834
|
),
|
|
4835
|
-
/* @__PURE__ */
|
|
4835
|
+
/* @__PURE__ */ g.jsx(
|
|
4836
4836
|
zt,
|
|
4837
4837
|
{
|
|
4838
4838
|
type: "submit",
|
|
@@ -4851,7 +4851,7 @@ const Et = Mr((t) => ({
|
|
|
4851
4851
|
options: t,
|
|
4852
4852
|
value: e,
|
|
4853
4853
|
onChange: r
|
|
4854
|
-
}) => /* @__PURE__ */
|
|
4854
|
+
}) => /* @__PURE__ */ g.jsx(
|
|
4855
4855
|
"fieldset",
|
|
4856
4856
|
{
|
|
4857
4857
|
role: "radiogroup",
|
|
@@ -4859,7 +4859,7 @@ const Et = Mr((t) => ({
|
|
|
4859
4859
|
className: "flex flex-col md:flex-row gap-4 md:gap-20",
|
|
4860
4860
|
children: t.map((s) => {
|
|
4861
4861
|
const n = s.value === e;
|
|
4862
|
-
return /* @__PURE__ */
|
|
4862
|
+
return /* @__PURE__ */ g.jsxs(
|
|
4863
4863
|
"label",
|
|
4864
4864
|
{
|
|
4865
4865
|
className: [
|
|
@@ -4867,7 +4867,7 @@ const Et = Mr((t) => ({
|
|
|
4867
4867
|
n ? "border-green-500 bg-green-50" : "border-gray-300 bg-white hover:bg-gray-50"
|
|
4868
4868
|
].join(" "),
|
|
4869
4869
|
children: [
|
|
4870
|
-
/* @__PURE__ */
|
|
4870
|
+
/* @__PURE__ */ g.jsx(
|
|
4871
4871
|
"input",
|
|
4872
4872
|
{
|
|
4873
4873
|
type: "radio",
|
|
@@ -4878,17 +4878,17 @@ const Et = Mr((t) => ({
|
|
|
4878
4878
|
className: "sr-only"
|
|
4879
4879
|
}
|
|
4880
4880
|
),
|
|
4881
|
-
/* @__PURE__ */
|
|
4881
|
+
/* @__PURE__ */ g.jsx(
|
|
4882
4882
|
"span",
|
|
4883
4883
|
{
|
|
4884
4884
|
className: [
|
|
4885
4885
|
"flex-shrink-0 flex items-center justify-center rounded-full mr-3",
|
|
4886
4886
|
n ? "w-5 h-5 border-2 border-green-500 bg-green-500" : "w-4 h-4 border border-gray-400"
|
|
4887
4887
|
].join(" "),
|
|
4888
|
-
children: n && /* @__PURE__ */
|
|
4888
|
+
children: n && /* @__PURE__ */ g.jsx("span", { className: "block w-2 h-2 bg-white rounded-full" })
|
|
4889
4889
|
}
|
|
4890
4890
|
),
|
|
4891
|
-
/* @__PURE__ */
|
|
4891
|
+
/* @__PURE__ */ g.jsx(
|
|
4892
4892
|
"span",
|
|
4893
4893
|
{
|
|
4894
4894
|
className: n ? "text-green-700 font-medium" : "text-gray-700",
|
|
@@ -4907,9 +4907,9 @@ const Et = Mr((t) => ({
|
|
|
4907
4907
|
{ value: "300", label: "300 đơn/tháng" },
|
|
4908
4908
|
{ value: "500", label: "500 đơn/tháng" }
|
|
4909
4909
|
];
|
|
4910
|
-
return /* @__PURE__ */
|
|
4911
|
-
/* @__PURE__ */
|
|
4912
|
-
/* @__PURE__ */
|
|
4910
|
+
return /* @__PURE__ */ g.jsxs("div", { className: "w-full flex flex-col gap-6", children: [
|
|
4911
|
+
/* @__PURE__ */ g.jsx("h2", { className: "heading", children: "Select subscription package" }),
|
|
4912
|
+
/* @__PURE__ */ g.jsx(
|
|
4913
4913
|
la,
|
|
4914
4914
|
{
|
|
4915
4915
|
options: s,
|
|
@@ -4917,7 +4917,7 @@ const Et = Mr((t) => ({
|
|
|
4917
4917
|
onChange: r
|
|
4918
4918
|
}
|
|
4919
4919
|
),
|
|
4920
|
-
/* @__PURE__ */
|
|
4920
|
+
/* @__PURE__ */ g.jsx("div", { className: "text-right", children: /* @__PURE__ */ g.jsx(
|
|
4921
4921
|
zt,
|
|
4922
4922
|
{
|
|
4923
4923
|
title: "Next",
|
|
@@ -4928,8 +4928,8 @@ const Et = Mr((t) => ({
|
|
|
4928
4928
|
}
|
|
4929
4929
|
) })
|
|
4930
4930
|
] });
|
|
4931
|
-
}, da = ({ checked: t, setChecked: e }) => /* @__PURE__ */
|
|
4932
|
-
/* @__PURE__ */
|
|
4931
|
+
}, da = ({ checked: t, setChecked: e }) => /* @__PURE__ */ g.jsxs("label", { className: "relative inline-flex cursor-pointer items-center", children: [
|
|
4932
|
+
/* @__PURE__ */ g.jsx(
|
|
4933
4933
|
"input",
|
|
4934
4934
|
{
|
|
4935
4935
|
type: "checkbox",
|
|
@@ -4938,14 +4938,14 @@ const Et = Mr((t) => ({
|
|
|
4938
4938
|
onChange: (r) => e(r.target.checked)
|
|
4939
4939
|
}
|
|
4940
4940
|
),
|
|
4941
|
-
/* @__PURE__ */
|
|
4941
|
+
/* @__PURE__ */ g.jsx("div", { className: "border-[#ACADAE] relative h-5 w-5 rounded-full border-2 before:absolute before:left-1/2 before:top-1/2 before:hidden before:h-2.5 before:w-2.5 before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:bg-green-500 peer-checked:border-green-500 peer-checked:before:block" })
|
|
4942
4942
|
] }), fa = [
|
|
4943
4943
|
{ name: "M-Invoice", route: "m-invoice" },
|
|
4944
4944
|
{ name: "FPT", route: "fpt" },
|
|
4945
4945
|
{ name: "Misa", route: "misa" }
|
|
4946
4946
|
], ha = ({ provider: t, handleProviderChange: e }) => {
|
|
4947
4947
|
const r = Et((s) => s.selectedProvider);
|
|
4948
|
-
return /* @__PURE__ */
|
|
4948
|
+
return /* @__PURE__ */ g.jsxs(
|
|
4949
4949
|
"div",
|
|
4950
4950
|
{
|
|
4951
4951
|
"data-checked": r === t.route,
|
|
@@ -4954,14 +4954,14 @@ const Et = Mr((t) => ({
|
|
|
4954
4954
|
`,
|
|
4955
4955
|
onClick: () => e(t.route),
|
|
4956
4956
|
children: [
|
|
4957
|
-
/* @__PURE__ */
|
|
4957
|
+
/* @__PURE__ */ g.jsx(
|
|
4958
4958
|
da,
|
|
4959
4959
|
{
|
|
4960
4960
|
checked: r === t.route,
|
|
4961
4961
|
setChecked: () => e(t.route)
|
|
4962
4962
|
}
|
|
4963
4963
|
),
|
|
4964
|
-
/* @__PURE__ */
|
|
4964
|
+
/* @__PURE__ */ g.jsx("label", { className: "", children: t.name })
|
|
4965
4965
|
]
|
|
4966
4966
|
}
|
|
4967
4967
|
);
|
|
@@ -4969,10 +4969,10 @@ const Et = Mr((t) => ({
|
|
|
4969
4969
|
const t = Et((n) => n.selectedProvider), e = Et((n) => n.setSelectedProvider), r = st((n) => n.nextStep), s = (n) => {
|
|
4970
4970
|
e(n);
|
|
4971
4971
|
};
|
|
4972
|
-
return /* @__PURE__ */
|
|
4973
|
-
/* @__PURE__ */
|
|
4974
|
-
/* @__PURE__ */
|
|
4975
|
-
/* @__PURE__ */
|
|
4972
|
+
return /* @__PURE__ */ g.jsxs("div", { className: "w-full flex flex-col gap-6", children: [
|
|
4973
|
+
/* @__PURE__ */ g.jsx("h2", { className: "heading", children: "Select Provider" }),
|
|
4974
|
+
/* @__PURE__ */ g.jsx("div", { className: "flex gap-20", children: fa.map((n) => /* @__PURE__ */ g.jsx(ha, { provider: n, handleProviderChange: s }, n.route)) }),
|
|
4975
|
+
/* @__PURE__ */ g.jsx("div", { className: "text-right", children: /* @__PURE__ */ g.jsx(
|
|
4976
4976
|
zt,
|
|
4977
4977
|
{
|
|
4978
4978
|
title: "Next",
|
|
@@ -4983,15 +4983,15 @@ const Et = Mr((t) => ({
|
|
|
4983
4983
|
}
|
|
4984
4984
|
) })
|
|
4985
4985
|
] });
|
|
4986
|
-
}, pa = () => /* @__PURE__ */
|
|
4986
|
+
}, pa = () => /* @__PURE__ */ g.jsx("div", { children: "Status" });
|
|
4987
4987
|
function va() {
|
|
4988
|
-
const t = st((
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4988
|
+
const t = st((r) => r.step), e = {
|
|
4989
|
+
1: /* @__PURE__ */ g.jsx(ma, {}),
|
|
4990
|
+
2: /* @__PURE__ */ g.jsx(ca, {}),
|
|
4991
|
+
3: /* @__PURE__ */ g.jsx(ua, {}),
|
|
4992
|
+
4: /* @__PURE__ */ g.jsx(pa, {})
|
|
4993
|
+
};
|
|
4994
|
+
return /* @__PURE__ */ g.jsx("main", { className: "w-screen h-screen fixed z-auto", children: /* @__PURE__ */ g.jsx(As, { children: e[t] }) });
|
|
4995
4995
|
}
|
|
4996
4996
|
export {
|
|
4997
4997
|
va as default
|