@ericbutera/kaleido 0.1.8 → 0.1.12
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/components/admin/adminLayoutConfig.d.ts +9 -0
- package/dist/components/featureFlags/FeatureFlagStatus.d.ts +9 -0
- package/dist/featureFlags/defaults.d.ts +3 -0
- package/dist/featureFlags/index.d.ts +2 -0
- package/dist/featureFlags/useFeatureFlag.d.ts +86 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1199 -1041
- package/dist/pages/admin/FeatureFlags.d.ts +1 -0
- package/dist/pages/index.d.ts +1 -0
- package/package.json +72 -72
- package/dist/auth/lib/featureFlags.d.ts +0 -21
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { faEnvelope as
|
|
4
|
-
import { FontAwesomeIcon as
|
|
5
|
-
import { useLocation as
|
|
6
|
-
import { useForm as
|
|
7
|
-
var De = { exports: {} },
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
-
if (
|
|
11
|
-
|
|
1
|
+
import D, { createContext as vr, useContext as zt, useEffect as Me, useState as se, useRef as yr, useMemo as xr } from "react";
|
|
2
|
+
import ct from "react-hot-toast";
|
|
3
|
+
import { faEnvelope as _r, faRightToBracket as br, faStore as wr, faSort as jr, faSortUp as Nr, faSortDown as kr } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
+
import { FontAwesomeIcon as je } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import { useLocation as dt, Link as ne, useNavigate as Ne, useSearchParams as ut } from "react-router-dom";
|
|
6
|
+
import { useForm as Fe } from "react-hook-form";
|
|
7
|
+
var De = { exports: {} }, Ae = {};
|
|
8
|
+
var vt;
|
|
9
|
+
function Er() {
|
|
10
|
+
if (vt) return Ae;
|
|
11
|
+
vt = 1;
|
|
12
12
|
var r = /* @__PURE__ */ Symbol.for("react.transitional.element"), e = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
13
13
|
function t(s, n, a) {
|
|
14
14
|
var d = null;
|
|
@@ -25,21 +25,21 @@ function xr() {
|
|
|
25
25
|
props: a
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return Ae.Fragment = e, Ae.jsx = t, Ae.jsxs = t, Ae;
|
|
29
29
|
}
|
|
30
30
|
var Re = {};
|
|
31
|
-
var
|
|
32
|
-
function
|
|
33
|
-
return
|
|
31
|
+
var yt;
|
|
32
|
+
function Cr() {
|
|
33
|
+
return yt || (yt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
34
34
|
function r(m) {
|
|
35
35
|
if (m == null) return null;
|
|
36
36
|
if (typeof m == "function")
|
|
37
37
|
return m.$$typeof === q ? null : m.displayName || m.name || null;
|
|
38
38
|
if (typeof m == "string") return m;
|
|
39
39
|
switch (m) {
|
|
40
|
-
case
|
|
40
|
+
case x:
|
|
41
41
|
return "Fragment";
|
|
42
|
-
case
|
|
42
|
+
case A:
|
|
43
43
|
return "Profiler";
|
|
44
44
|
case M:
|
|
45
45
|
return "StrictMode";
|
|
@@ -47,7 +47,7 @@ function _r() {
|
|
|
47
47
|
return "Suspense";
|
|
48
48
|
case B:
|
|
49
49
|
return "SuspenseList";
|
|
50
|
-
case
|
|
50
|
+
case de:
|
|
51
51
|
return "Activity";
|
|
52
52
|
}
|
|
53
53
|
if (typeof m == "object")
|
|
@@ -58,14 +58,14 @@ function _r() {
|
|
|
58
58
|
return "Portal";
|
|
59
59
|
case I:
|
|
60
60
|
return m.displayName || "Context";
|
|
61
|
-
case
|
|
61
|
+
case j:
|
|
62
62
|
return (m._context.displayName || "Context") + ".Consumer";
|
|
63
63
|
case L:
|
|
64
64
|
var E = m.render;
|
|
65
65
|
return m = m.displayName, m || (m = E.displayName || E.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
66
66
|
case W:
|
|
67
67
|
return E = m.displayName || null, E !== null ? E : r(m.type) || "Memo";
|
|
68
|
-
case
|
|
68
|
+
case H:
|
|
69
69
|
E = m._payload, m = m._init;
|
|
70
70
|
try {
|
|
71
71
|
return r(m(E));
|
|
@@ -86,17 +86,17 @@ function _r() {
|
|
|
86
86
|
}
|
|
87
87
|
if (E) {
|
|
88
88
|
E = console;
|
|
89
|
-
var $ = E.error,
|
|
89
|
+
var $ = E.error, Z = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
90
90
|
return $.call(
|
|
91
91
|
E,
|
|
92
92
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
93
|
-
|
|
93
|
+
Z
|
|
94
94
|
), e(m);
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
function s(m) {
|
|
98
|
-
if (m ===
|
|
99
|
-
if (typeof m == "object" && m !== null && m.$$typeof ===
|
|
98
|
+
if (m === x) return "<>";
|
|
99
|
+
if (typeof m == "object" && m !== null && m.$$typeof === H)
|
|
100
100
|
return "<...>";
|
|
101
101
|
try {
|
|
102
102
|
var E = r(m);
|
|
@@ -121,7 +121,7 @@ function _r() {
|
|
|
121
121
|
}
|
|
122
122
|
function u(m, E) {
|
|
123
123
|
function $() {
|
|
124
|
-
|
|
124
|
+
ke || (ke = !0, console.error(
|
|
125
125
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
126
126
|
E
|
|
127
127
|
));
|
|
@@ -137,14 +137,14 @@ function _r() {
|
|
|
137
137
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
138
138
|
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function l(m, E, $, Z, Ze, He) {
|
|
141
141
|
var V = $.ref;
|
|
142
142
|
return m = {
|
|
143
143
|
$$typeof: v,
|
|
144
144
|
type: m,
|
|
145
145
|
key: E,
|
|
146
146
|
props: $,
|
|
147
|
-
_owner:
|
|
147
|
+
_owner: Z
|
|
148
148
|
}, (V !== void 0 ? V : null) !== null ? Object.defineProperty(m, "ref", {
|
|
149
149
|
enumerable: !1,
|
|
150
150
|
get: i
|
|
@@ -167,16 +167,16 @@ function _r() {
|
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
169
169
|
writable: !0,
|
|
170
|
-
value:
|
|
170
|
+
value: He
|
|
171
171
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
172
172
|
}
|
|
173
|
-
function c(m, E, $,
|
|
173
|
+
function c(m, E, $, Z, Ze, He) {
|
|
174
174
|
var V = E.children;
|
|
175
175
|
if (V !== void 0)
|
|
176
|
-
if (
|
|
177
|
-
if (
|
|
178
|
-
for (
|
|
179
|
-
f(V[
|
|
176
|
+
if (Z)
|
|
177
|
+
if (G(V)) {
|
|
178
|
+
for (Z = 0; Z < V.length; Z++)
|
|
179
|
+
f(V[Z]);
|
|
180
180
|
Object.freeze && Object.freeze(V);
|
|
181
181
|
} else
|
|
182
182
|
console.error(
|
|
@@ -185,46 +185,46 @@ function _r() {
|
|
|
185
185
|
else f(V);
|
|
186
186
|
if (Y.call(E, "key")) {
|
|
187
187
|
V = r(m);
|
|
188
|
-
var pe = Object.keys(E).filter(function(
|
|
189
|
-
return
|
|
188
|
+
var pe = Object.keys(E).filter(function(gr) {
|
|
189
|
+
return gr !== "key";
|
|
190
190
|
});
|
|
191
|
-
|
|
191
|
+
Z = 0 < pe.length ? "{key: someKey, " + pe.join(": ..., ") + ": ...}" : "{key: someKey}", Se[V + Z] || (pe = 0 < pe.length ? "{" + pe.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
192
192
|
`A props object containing a "key" prop is being spread into JSX:
|
|
193
193
|
let props = %s;
|
|
194
194
|
<%s {...props} />
|
|
195
195
|
React keys must be passed directly to JSX without using spread:
|
|
196
196
|
let props = %s;
|
|
197
197
|
<%s key={someKey} {...props} />`,
|
|
198
|
-
|
|
198
|
+
Z,
|
|
199
199
|
V,
|
|
200
200
|
pe,
|
|
201
201
|
V
|
|
202
|
-
),
|
|
202
|
+
), Se[V + Z] = !0);
|
|
203
203
|
}
|
|
204
204
|
if (V = null, $ !== void 0 && (t($), V = "" + $), d(E) && (t(E.key), V = "" + E.key), "key" in E) {
|
|
205
205
|
$ = {};
|
|
206
|
-
for (var
|
|
207
|
-
|
|
206
|
+
for (var Je in E)
|
|
207
|
+
Je !== "key" && ($[Je] = E[Je]);
|
|
208
208
|
} else $ = E;
|
|
209
209
|
return V && u(
|
|
210
210
|
$,
|
|
211
211
|
typeof m == "function" ? m.displayName || m.name || "Unknown" : m
|
|
212
|
-
),
|
|
212
|
+
), l(
|
|
213
213
|
m,
|
|
214
214
|
V,
|
|
215
215
|
$,
|
|
216
216
|
n(),
|
|
217
217
|
Ze,
|
|
218
|
-
|
|
218
|
+
He
|
|
219
219
|
);
|
|
220
220
|
}
|
|
221
221
|
function f(m) {
|
|
222
|
-
h(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof ===
|
|
222
|
+
h(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof === H && (m._payload.status === "fulfilled" ? h(m._payload.value) && m._payload.value._store && (m._payload.value._store.validated = 1) : m._store && (m._store.validated = 1));
|
|
223
223
|
}
|
|
224
224
|
function h(m) {
|
|
225
225
|
return typeof m == "object" && m !== null && m.$$typeof === v;
|
|
226
226
|
}
|
|
227
|
-
var p =
|
|
227
|
+
var p = D, v = /* @__PURE__ */ Symbol.for("react.transitional.element"), w = /* @__PURE__ */ Symbol.for("react.portal"), x = /* @__PURE__ */ Symbol.for("react.fragment"), M = /* @__PURE__ */ Symbol.for("react.strict_mode"), A = /* @__PURE__ */ Symbol.for("react.profiler"), j = /* @__PURE__ */ Symbol.for("react.consumer"), I = /* @__PURE__ */ Symbol.for("react.context"), L = /* @__PURE__ */ Symbol.for("react.forward_ref"), O = /* @__PURE__ */ Symbol.for("react.suspense"), B = /* @__PURE__ */ Symbol.for("react.suspense_list"), W = /* @__PURE__ */ Symbol.for("react.memo"), H = /* @__PURE__ */ Symbol.for("react.lazy"), de = /* @__PURE__ */ Symbol.for("react.activity"), q = /* @__PURE__ */ Symbol.for("react.client.reference"), P = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, G = Array.isArray, U = console.createTask ? console.createTask : function() {
|
|
228
228
|
return null;
|
|
229
229
|
};
|
|
230
230
|
p = {
|
|
@@ -232,40 +232,40 @@ React keys must be passed directly to JSX without using spread:
|
|
|
232
232
|
return m();
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
var
|
|
235
|
+
var ke, te = {}, Ee = p.react_stack_bottom_frame.bind(
|
|
236
236
|
p,
|
|
237
237
|
a
|
|
238
|
-
)(),
|
|
239
|
-
Re.Fragment =
|
|
240
|
-
var
|
|
238
|
+
)(), Ce = U(s(a)), Se = {};
|
|
239
|
+
Re.Fragment = x, Re.jsx = function(m, E, $) {
|
|
240
|
+
var Z = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
241
241
|
return c(
|
|
242
242
|
m,
|
|
243
243
|
E,
|
|
244
244
|
$,
|
|
245
245
|
!1,
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
Z ? Error("react-stack-top-frame") : Ee,
|
|
247
|
+
Z ? U(s(m)) : Ce
|
|
248
248
|
);
|
|
249
249
|
}, Re.jsxs = function(m, E, $) {
|
|
250
|
-
var
|
|
250
|
+
var Z = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
251
251
|
return c(
|
|
252
252
|
m,
|
|
253
253
|
E,
|
|
254
254
|
$,
|
|
255
255
|
!0,
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
Z ? Error("react-stack-top-frame") : Ee,
|
|
257
|
+
Z ? U(s(m)) : Ce
|
|
258
258
|
);
|
|
259
259
|
};
|
|
260
260
|
})()), Re;
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
function
|
|
264
|
-
return
|
|
262
|
+
var xt;
|
|
263
|
+
function Sr() {
|
|
264
|
+
return xt || (xt = 1, process.env.NODE_ENV === "production" ? De.exports = Er() : De.exports = Cr()), De.exports;
|
|
265
265
|
}
|
|
266
|
-
var
|
|
267
|
-
const
|
|
268
|
-
function
|
|
266
|
+
var o = Sr();
|
|
267
|
+
const ft = vr(null);
|
|
268
|
+
function Ar({
|
|
269
269
|
client: r,
|
|
270
270
|
config: e = {},
|
|
271
271
|
children: t
|
|
@@ -275,25 +275,25 @@ function wr({
|
|
|
275
275
|
registrationEnabled: !0,
|
|
276
276
|
OAuthButton: void 0
|
|
277
277
|
}, ...e };
|
|
278
|
-
return /* @__PURE__ */
|
|
278
|
+
return /* @__PURE__ */ o.jsx(ft.Provider, { value: { client: r, config: n }, children: t });
|
|
279
279
|
}
|
|
280
|
-
function
|
|
281
|
-
const r =
|
|
280
|
+
function le() {
|
|
281
|
+
const r = zt(ft);
|
|
282
282
|
if (!r)
|
|
283
283
|
throw new Error(
|
|
284
284
|
"useAuthApi must be used within AuthProvider. Wrap your app with <AuthProvider client={yourApiClient}>"
|
|
285
285
|
);
|
|
286
286
|
return r.client;
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
const r =
|
|
288
|
+
function Ut() {
|
|
289
|
+
const r = zt(ft);
|
|
290
290
|
if (!r)
|
|
291
291
|
throw new Error(
|
|
292
292
|
"useAuthConfig must be used within AuthProvider. Wrap your app with <AuthProvider client={yourApiClient}>"
|
|
293
293
|
);
|
|
294
294
|
return r.config;
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function ht(r, e, t = "An error occurred", s = !0) {
|
|
297
297
|
const n = r;
|
|
298
298
|
if (n?.errors && Object.entries(n.errors).forEach(([a, d]) => {
|
|
299
299
|
e(a, {
|
|
@@ -302,35 +302,35 @@ function ct(r, e, t = "An error occurred", s = !0) {
|
|
|
302
302
|
});
|
|
303
303
|
}), s) {
|
|
304
304
|
const a = n?.message || t;
|
|
305
|
-
|
|
305
|
+
ct.error(a);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function Vt(r, e, t = "/") {
|
|
309
309
|
const s = new URLSearchParams(e.search), n = s.get("origin") || s.get("redirect");
|
|
310
310
|
r(n || t, { replace: !0 });
|
|
311
311
|
}
|
|
312
|
-
function
|
|
313
|
-
return /* @__PURE__ */
|
|
312
|
+
function ce({ children: r }) {
|
|
313
|
+
return /* @__PURE__ */ o.jsx("div", { className: "min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/10 to-secondary/10", children: /* @__PURE__ */ o.jsx("div", { className: "card bg-base-100 shadow-soft hover:shadow-medium transition-shadow border border-base-300 w-full max-w-md mx-4", children: /* @__PURE__ */ o.jsx("div", { className: "card-body p-8", children: r }) }) });
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
const e =
|
|
317
|
-
return /* @__PURE__ */
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
315
|
+
function Rr() {
|
|
316
|
+
const e = dt().state.email;
|
|
317
|
+
return /* @__PURE__ */ o.jsxs(ce, { children: [
|
|
318
|
+
/* @__PURE__ */ o.jsxs("h2", { className: "card-title text-2xl mb-4", children: [
|
|
319
|
+
/* @__PURE__ */ o.jsx(je, { icon: _r }),
|
|
320
320
|
"Check Your Email"
|
|
321
321
|
] }),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ o.jsxs("div", { className: "mt-4 text-sm text-center", children: [
|
|
323
|
+
/* @__PURE__ */ o.jsxs("p", { children: [
|
|
324
324
|
"We've sent a confirmation link to ",
|
|
325
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ o.jsx("strong", { children: e }),
|
|
326
326
|
"."
|
|
327
327
|
] }),
|
|
328
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ o.jsx("p", { className: "mt-2", children: "Click the link in the email to activate your account." })
|
|
329
329
|
] }),
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
333
|
-
|
|
330
|
+
/* @__PURE__ */ o.jsx("div", { className: "divider" }),
|
|
331
|
+
/* @__PURE__ */ o.jsxs("div", { className: "join w-full justify-center", children: [
|
|
332
|
+
/* @__PURE__ */ o.jsx(
|
|
333
|
+
ne,
|
|
334
334
|
{
|
|
335
335
|
to: "/resend-confirmation",
|
|
336
336
|
state: { email: e },
|
|
@@ -339,81 +339,81 @@ function kr() {
|
|
|
339
339
|
children: "Resend Confirmation"
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ o.jsx(ne, { to: "/", className: "btn join-item", children: "Home" })
|
|
343
343
|
] })
|
|
344
344
|
] });
|
|
345
345
|
}
|
|
346
|
-
function
|
|
347
|
-
const { register: r, handleSubmit: e } =
|
|
346
|
+
function Tr() {
|
|
347
|
+
const { register: r, handleSubmit: e } = Fe({
|
|
348
348
|
defaultValues: { email: "" }
|
|
349
|
-
}), { useForgotPassword: t } =
|
|
349
|
+
}), { useForgotPassword: t } = le(), s = t(), n = async (a) => {
|
|
350
350
|
try {
|
|
351
351
|
await s.mutateAsync(a.email);
|
|
352
352
|
} catch {
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
|
-
return /* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
/* @__PURE__ */
|
|
355
|
+
return /* @__PURE__ */ o.jsxs(ce, { children: [
|
|
356
|
+
/* @__PURE__ */ o.jsx("h2", { className: "text-2xl font-bold mb-4", children: "Forgot Password" }),
|
|
357
|
+
/* @__PURE__ */ o.jsxs("form", { onSubmit: e(n), children: [
|
|
358
|
+
/* @__PURE__ */ o.jsx("label", { className: "label", children: "Email" }),
|
|
359
|
+
/* @__PURE__ */ o.jsx(
|
|
360
360
|
"input",
|
|
361
361
|
{
|
|
362
362
|
className: "input input-bordered w-full",
|
|
363
363
|
...r("email", { required: !0 })
|
|
364
364
|
}
|
|
365
365
|
),
|
|
366
|
-
/* @__PURE__ */
|
|
366
|
+
/* @__PURE__ */ o.jsx("button", { className: "btn btn-primary mt-4", children: "Send Reset" })
|
|
367
367
|
] })
|
|
368
368
|
] });
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function Or() {
|
|
371
371
|
const {
|
|
372
372
|
register: r,
|
|
373
373
|
handleSubmit: e,
|
|
374
374
|
setError: t,
|
|
375
375
|
formState: { errors: s, isSubmitting: n }
|
|
376
|
-
} =
|
|
376
|
+
} = Fe({
|
|
377
377
|
defaultValues: { email: "", password: "" }
|
|
378
|
-
}), a =
|
|
379
|
-
|
|
380
|
-
p &&
|
|
378
|
+
}), a = Ne(), d = dt(), { useLoginUser: u, useCurrentUser: i } = le(), { oauthEnabled: l, registrationEnabled: c, OAuthButton: f } = Ut(), h = u(), { user: p } = i();
|
|
379
|
+
Me(() => {
|
|
380
|
+
p && Vt(a, d);
|
|
381
381
|
}, [p, a, d]);
|
|
382
382
|
const v = async (w) => {
|
|
383
383
|
try {
|
|
384
384
|
await h.mutateAsync(w, t), a("/");
|
|
385
|
-
} catch (
|
|
386
|
-
const M =
|
|
385
|
+
} catch (x) {
|
|
386
|
+
const M = x?.response?.status;
|
|
387
387
|
if (M == 401)
|
|
388
388
|
t("root", {
|
|
389
389
|
type: "server",
|
|
390
390
|
message: "Invalid email or password"
|
|
391
391
|
});
|
|
392
392
|
else if (M == 422) {
|
|
393
|
-
const
|
|
394
|
-
t("root", { type: "server", message:
|
|
393
|
+
const A = x?.response?.data, j = A && (A.error || A.message) || "Too many login attempts. Please try again later.";
|
|
394
|
+
t("root", { type: "server", message: j });
|
|
395
395
|
} else {
|
|
396
|
-
const
|
|
397
|
-
|
|
396
|
+
const A = x?.response?.data ?? x;
|
|
397
|
+
ht(A, t, "Failed to sign in");
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
return /* @__PURE__ */
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
|
|
401
|
+
return /* @__PURE__ */ o.jsxs(ce, { children: [
|
|
402
|
+
/* @__PURE__ */ o.jsxs("div", { className: "text-center mb-6", children: [
|
|
403
|
+
/* @__PURE__ */ o.jsx("div", { className: "inline-flex items-center justify-center w-16 h-16 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ o.jsx(
|
|
404
|
+
je,
|
|
405
405
|
{
|
|
406
|
-
icon:
|
|
406
|
+
icon: br,
|
|
407
407
|
className: "text-3xl text-primary"
|
|
408
408
|
}
|
|
409
409
|
) }),
|
|
410
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ o.jsx("h2", { className: "text-3xl font-bold mb-2", children: "Welcome Back" })
|
|
411
411
|
] }),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
s.root && /* @__PURE__ */
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
/* @__PURE__ */
|
|
412
|
+
/* @__PURE__ */ o.jsxs("form", { onSubmit: e(v), children: [
|
|
413
|
+
s.root && /* @__PURE__ */ o.jsx("div", { className: "alert alert-error alert-soft mb-4", children: /* @__PURE__ */ o.jsx("span", { children: s.root.message }) }),
|
|
414
|
+
/* @__PURE__ */ o.jsxs("fieldset", { className: "fieldset", children: [
|
|
415
|
+
/* @__PURE__ */ o.jsx("label", { className: "label", htmlFor: "login-email", children: /* @__PURE__ */ o.jsx("span", { className: "label-text", children: "Email" }) }),
|
|
416
|
+
/* @__PURE__ */ o.jsx(
|
|
417
417
|
"input",
|
|
418
418
|
{
|
|
419
419
|
id: "login-email",
|
|
@@ -423,9 +423,9 @@ function Nr() {
|
|
|
423
423
|
...r("email", { required: "Email is required" })
|
|
424
424
|
}
|
|
425
425
|
),
|
|
426
|
-
s.email && /* @__PURE__ */
|
|
427
|
-
/* @__PURE__ */
|
|
428
|
-
/* @__PURE__ */
|
|
426
|
+
s.email && /* @__PURE__ */ o.jsx("span", { className: "text-error text-sm", children: s.email.message }),
|
|
427
|
+
/* @__PURE__ */ o.jsx("label", { className: "label mt-4", htmlFor: "login-password", children: /* @__PURE__ */ o.jsx("span", { className: "label-text", children: "Password" }) }),
|
|
428
|
+
/* @__PURE__ */ o.jsx(
|
|
429
429
|
"input",
|
|
430
430
|
{
|
|
431
431
|
id: "login-password",
|
|
@@ -436,8 +436,8 @@ function Nr() {
|
|
|
436
436
|
...r("password", { required: "Password is required" })
|
|
437
437
|
}
|
|
438
438
|
),
|
|
439
|
-
s.password && /* @__PURE__ */
|
|
440
|
-
/* @__PURE__ */
|
|
439
|
+
s.password && /* @__PURE__ */ o.jsx("span", { className: "text-error text-sm", children: s.password.message }),
|
|
440
|
+
/* @__PURE__ */ o.jsx(
|
|
441
441
|
"button",
|
|
442
442
|
{
|
|
443
443
|
type: "submit",
|
|
@@ -448,12 +448,12 @@ function Nr() {
|
|
|
448
448
|
)
|
|
449
449
|
] })
|
|
450
450
|
] }),
|
|
451
|
-
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
/* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
|
|
451
|
+
l && f && /* @__PURE__ */ o.jsx(f, { text: "Sign in with Google" }),
|
|
452
|
+
/* @__PURE__ */ o.jsx("div", { className: "divider" }),
|
|
453
|
+
/* @__PURE__ */ o.jsxs("div", { className: "join w-full justify-center", children: [
|
|
454
|
+
/* @__PURE__ */ o.jsx(ne, { className: "btn join-item", to: "/", children: "Home" }),
|
|
455
|
+
/* @__PURE__ */ o.jsx(
|
|
456
|
+
ne,
|
|
457
457
|
{
|
|
458
458
|
className: "btn join-item",
|
|
459
459
|
to: "/signup",
|
|
@@ -461,30 +461,30 @@ function Nr() {
|
|
|
461
461
|
children: "Create Account"
|
|
462
462
|
}
|
|
463
463
|
),
|
|
464
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ o.jsx(ne, { className: "btn join-item", to: "/forgot-password", children: "Forgot password" })
|
|
465
465
|
] })
|
|
466
466
|
] });
|
|
467
467
|
}
|
|
468
|
-
function
|
|
469
|
-
const r =
|
|
470
|
-
return
|
|
468
|
+
function Pr() {
|
|
469
|
+
const r = Ne(), { useTokenRefresh: e } = le(), t = e?.();
|
|
470
|
+
return Me(() => {
|
|
471
471
|
t?.mutateAsync?.().finally(() => r("/"));
|
|
472
|
-
}, [r, t]), /* @__PURE__ */
|
|
472
|
+
}, [r, t]), /* @__PURE__ */ o.jsx("div", { children: "Processing OAuth callback..." });
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
const e =
|
|
474
|
+
function Ir() {
|
|
475
|
+
const e = dt().state?.email, { register: t, handleSubmit: s } = Fe({
|
|
476
476
|
defaultValues: { email: e ?? "" }
|
|
477
|
-
}), { useResendConfirmationEmail: n } =
|
|
477
|
+
}), { useResendConfirmationEmail: n } = le(), a = n(), d = Ne(), u = async (i) => {
|
|
478
478
|
try {
|
|
479
479
|
await a.mutateAsync(i), d("/confirm-email", { state: { email: i.email } });
|
|
480
480
|
} catch {
|
|
481
481
|
}
|
|
482
482
|
};
|
|
483
|
-
return /* @__PURE__ */
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
/* @__PURE__ */
|
|
486
|
-
/* @__PURE__ */
|
|
487
|
-
/* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ o.jsxs(ce, { children: [
|
|
484
|
+
/* @__PURE__ */ o.jsx("h2", { className: "text-2xl font-bold mb-4", children: "Resend Confirmation" }),
|
|
485
|
+
/* @__PURE__ */ o.jsxs("form", { onSubmit: s(u), children: [
|
|
486
|
+
/* @__PURE__ */ o.jsx("label", { className: "label", children: "Email" }),
|
|
487
|
+
/* @__PURE__ */ o.jsx(
|
|
488
488
|
"input",
|
|
489
489
|
{
|
|
490
490
|
type: "email",
|
|
@@ -492,21 +492,21 @@ function Cr() {
|
|
|
492
492
|
...t("email", { required: !0 })
|
|
493
493
|
}
|
|
494
494
|
),
|
|
495
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ o.jsx("button", { className: "btn btn-primary mt-4", children: "Resend" })
|
|
496
496
|
] })
|
|
497
497
|
] });
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
const { register: r, handleSubmit: e } =
|
|
499
|
+
function Mr() {
|
|
500
|
+
const { register: r, handleSubmit: e } = Fe({ defaultValues: { token: "", password: "" } }), { useResetPassword: t } = le(), s = t(), n = Ne(), [a] = ut(), d = a.get("token") || void 0, u = async (i) => {
|
|
501
501
|
try {
|
|
502
502
|
await s.mutateAsync(i), n("/");
|
|
503
503
|
} catch {
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
|
-
return /* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
/* @__PURE__ */
|
|
506
|
+
return /* @__PURE__ */ o.jsxs(ce, { children: [
|
|
507
|
+
/* @__PURE__ */ o.jsx("h2", { className: "text-2xl font-bold mb-4", children: "Reset Password" }),
|
|
508
|
+
/* @__PURE__ */ o.jsxs("form", { onSubmit: e(u), children: [
|
|
509
|
+
/* @__PURE__ */ o.jsx(
|
|
510
510
|
"input",
|
|
511
511
|
{
|
|
512
512
|
type: "hidden",
|
|
@@ -514,29 +514,94 @@ function Sr() {
|
|
|
514
514
|
defaultValue: d
|
|
515
515
|
}
|
|
516
516
|
),
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
517
|
+
/* @__PURE__ */ o.jsx("label", { className: "label", children: "New password" }),
|
|
518
|
+
/* @__PURE__ */ o.jsx(
|
|
519
519
|
"input",
|
|
520
520
|
{
|
|
521
521
|
className: "input input-bordered w-full",
|
|
522
522
|
...r("password", { required: !0 })
|
|
523
523
|
}
|
|
524
524
|
),
|
|
525
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ o.jsx("button", { className: "btn btn-primary mt-4", children: "Reset" })
|
|
526
526
|
] })
|
|
527
527
|
] });
|
|
528
528
|
}
|
|
529
|
-
|
|
529
|
+
var Lr = {
|
|
530
|
+
prefix: "fab",
|
|
531
|
+
iconName: "google",
|
|
532
|
+
icon: [512, 512, [], "f1a0", "M500 261.8C500 403.3 403.1 504 260 504 122.8 504 12 393.2 12 256S122.8 8 260 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9c-88.3-85.2-252.5-21.2-252.5 118.2 0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9l-140.8 0 0-85.3 236.1 0c2.3 12.7 3.9 24.9 3.9 41.4z"]
|
|
533
|
+
};
|
|
534
|
+
function $r({
|
|
535
|
+
redirectUrl: r = "",
|
|
536
|
+
text: e = "Continue with Google",
|
|
537
|
+
className: t = "",
|
|
538
|
+
disabled: s = !1
|
|
539
|
+
}) {
|
|
540
|
+
const n = () => {
|
|
541
|
+
s || (window.location.href = `${r}/oauth/google`);
|
|
542
|
+
};
|
|
543
|
+
return /* @__PURE__ */ o.jsxs(
|
|
544
|
+
"button",
|
|
545
|
+
{
|
|
546
|
+
onClick: n,
|
|
547
|
+
className: `btn btn-outline w-full gap-2 ${s ? "opacity-50 cursor-not-allowed" : ""} ${t}`,
|
|
548
|
+
type: "button",
|
|
549
|
+
disabled: s,
|
|
550
|
+
children: [
|
|
551
|
+
/* @__PURE__ */ o.jsx(je, { icon: Lr, className: "text-lg" }),
|
|
552
|
+
e
|
|
553
|
+
]
|
|
554
|
+
}
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
const Bt = "registration", Wt = "oauth", Fr = "api_clients";
|
|
558
|
+
let Le = null;
|
|
559
|
+
function Zr(r) {
|
|
560
|
+
Le = r;
|
|
561
|
+
}
|
|
562
|
+
function mt(r) {
|
|
563
|
+
if (!Le)
|
|
564
|
+
throw new Error(
|
|
565
|
+
"Feature flags not configured. Call configureFeatureFlags() in your app setup."
|
|
566
|
+
);
|
|
567
|
+
return Le.useFeatureFlags(r);
|
|
568
|
+
}
|
|
569
|
+
function et(r) {
|
|
570
|
+
const { data: e = [] } = mt();
|
|
571
|
+
return e.find((t) => t.feature_key === r)?.enabled ?? !1;
|
|
572
|
+
}
|
|
573
|
+
function qt() {
|
|
574
|
+
if (!Le)
|
|
575
|
+
throw new Error(
|
|
576
|
+
"Feature flags not configured. Call configureFeatureFlags() in your app setup."
|
|
577
|
+
);
|
|
578
|
+
return Le.useUpdateFeatureFlag();
|
|
579
|
+
}
|
|
580
|
+
const gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
581
|
+
__proto__: null,
|
|
582
|
+
FLAG_API_CLIENTS: Fr,
|
|
583
|
+
FLAG_OAUTH: Wt,
|
|
584
|
+
FLAG_REGISTRATION: Bt,
|
|
585
|
+
configureFeatureFlags: Zr,
|
|
586
|
+
useFeatureFlag: et,
|
|
587
|
+
useFeatureFlags: mt,
|
|
588
|
+
useUpdateFeatureFlag: qt
|
|
589
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
590
|
+
function Dr({ redirectUrl: r = "" }) {
|
|
530
591
|
const {
|
|
531
592
|
register: e,
|
|
532
593
|
handleSubmit: t,
|
|
533
594
|
setError: s,
|
|
534
595
|
watch: n,
|
|
535
596
|
formState: { errors: a, isSubmitting: d }
|
|
536
|
-
} =
|
|
597
|
+
} = Fe({
|
|
537
598
|
defaultValues: { name: "", email: "", password: "", confirmPassword: "" }
|
|
538
|
-
}), u =
|
|
539
|
-
if (
|
|
599
|
+
}), u = Ne(), i = et(Bt), l = et(Wt), { useRegisterUser: c } = le(), f = c(), [h, p] = se(null), v = async (w) => {
|
|
600
|
+
if (p(null), !i) {
|
|
601
|
+
p("Registrations are temporarily disabled");
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
if (w.password !== w.confirmPassword) {
|
|
540
605
|
s("confirmPassword", {
|
|
541
606
|
type: "manual",
|
|
542
607
|
message: "Passwords do not match"
|
|
@@ -544,21 +609,21 @@ function Rr({ redirectUrl: r = "" }) {
|
|
|
544
609
|
return;
|
|
545
610
|
}
|
|
546
611
|
try {
|
|
547
|
-
await
|
|
548
|
-
} catch (
|
|
549
|
-
|
|
612
|
+
await f.mutateAsync(w, s), u("/confirm-email", { state: { email: w.email } });
|
|
613
|
+
} catch (x) {
|
|
614
|
+
ht(x, s, "Failed to register account", !1);
|
|
550
615
|
}
|
|
551
616
|
};
|
|
552
|
-
return /* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ o.jsxs(ce, { children: [
|
|
618
|
+
/* @__PURE__ */ o.jsxs("h2", { className: "card-title text-2xl mb-4", children: [
|
|
619
|
+
/* @__PURE__ */ o.jsx(je, { icon: wr, className: "text-primary mr-2" }),
|
|
555
620
|
"Sign Up"
|
|
556
621
|
] }),
|
|
557
|
-
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
/* @__PURE__ */
|
|
561
|
-
/* @__PURE__ */
|
|
622
|
+
h && /* @__PURE__ */ o.jsx("div", { role: "alert", className: "alert alert-warning alert-soft mb-4", children: /* @__PURE__ */ o.jsx("span", { children: h }) }),
|
|
623
|
+
/* @__PURE__ */ o.jsx("form", { onSubmit: t(v), children: /* @__PURE__ */ o.jsxs("fieldset", { className: "fieldset", children: [
|
|
624
|
+
/* @__PURE__ */ o.jsx("legend", { className: "fieldset-legend", children: "Account Details" }),
|
|
625
|
+
/* @__PURE__ */ o.jsx("label", { className: "label", htmlFor: "signup-name", children: /* @__PURE__ */ o.jsx("span", { className: "label-text", children: "Name" }) }),
|
|
626
|
+
/* @__PURE__ */ o.jsx(
|
|
562
627
|
"input",
|
|
563
628
|
{
|
|
564
629
|
id: "signup-name",
|
|
@@ -574,9 +639,9 @@ function Rr({ redirectUrl: r = "" }) {
|
|
|
574
639
|
})
|
|
575
640
|
}
|
|
576
641
|
),
|
|
577
|
-
a.name && /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
/* @__PURE__ */
|
|
642
|
+
a.name && /* @__PURE__ */ o.jsx("span", { className: "text-error text-sm", children: a.name.message }),
|
|
643
|
+
/* @__PURE__ */ o.jsx("label", { className: "label", htmlFor: "signup-email", children: /* @__PURE__ */ o.jsx("span", { className: "label-text", children: "Email" }) }),
|
|
644
|
+
/* @__PURE__ */ o.jsx(
|
|
580
645
|
"input",
|
|
581
646
|
{
|
|
582
647
|
id: "signup-email",
|
|
@@ -592,9 +657,9 @@ function Rr({ redirectUrl: r = "" }) {
|
|
|
592
657
|
})
|
|
593
658
|
}
|
|
594
659
|
),
|
|
595
|
-
a.email && /* @__PURE__ */
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
/* @__PURE__ */
|
|
660
|
+
a.email && /* @__PURE__ */ o.jsx("span", { className: "text-error text-sm", children: a.email.message }),
|
|
661
|
+
/* @__PURE__ */ o.jsx("label", { className: "label", htmlFor: "signup-password", children: /* @__PURE__ */ o.jsx("span", { className: "label-text", children: "Password" }) }),
|
|
662
|
+
/* @__PURE__ */ o.jsx(
|
|
598
663
|
"input",
|
|
599
664
|
{
|
|
600
665
|
id: "signup-password",
|
|
@@ -610,9 +675,9 @@ function Rr({ redirectUrl: r = "" }) {
|
|
|
610
675
|
})
|
|
611
676
|
}
|
|
612
677
|
),
|
|
613
|
-
a.password && /* @__PURE__ */
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
/* @__PURE__ */
|
|
678
|
+
a.password && /* @__PURE__ */ o.jsx("span", { className: "text-error text-sm", children: a.password.message }),
|
|
679
|
+
/* @__PURE__ */ o.jsx("label", { className: "label", htmlFor: "signup-confirm", children: /* @__PURE__ */ o.jsx("span", { className: "label-text", children: "Confirm Password" }) }),
|
|
680
|
+
/* @__PURE__ */ o.jsx(
|
|
616
681
|
"input",
|
|
617
682
|
{
|
|
618
683
|
id: "signup-confirm",
|
|
@@ -621,40 +686,49 @@ function Rr({ redirectUrl: r = "" }) {
|
|
|
621
686
|
className: `input input-bordered w-full ${a.confirmPassword ? "input-error" : ""}`,
|
|
622
687
|
...e("confirmPassword", {
|
|
623
688
|
required: "Please confirm password",
|
|
624
|
-
validate: (
|
|
689
|
+
validate: (w) => w === n("password") || "Passwords do not match"
|
|
625
690
|
})
|
|
626
691
|
}
|
|
627
692
|
),
|
|
628
|
-
a.confirmPassword && /* @__PURE__ */
|
|
629
|
-
/* @__PURE__ */
|
|
693
|
+
a.confirmPassword && /* @__PURE__ */ o.jsx("span", { className: "text-error text-sm", children: a.confirmPassword.message }),
|
|
694
|
+
/* @__PURE__ */ o.jsx(
|
|
630
695
|
"button",
|
|
631
696
|
{
|
|
632
697
|
type: "submit",
|
|
633
698
|
className: "btn btn-primary w-full mt-4",
|
|
634
|
-
disabled: d || !
|
|
699
|
+
disabled: d || !i,
|
|
635
700
|
children: d ? "Creating Account…" : "Sign Up"
|
|
636
701
|
}
|
|
637
702
|
)
|
|
638
703
|
] }) }),
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
704
|
+
l && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
705
|
+
/* @__PURE__ */ o.jsx("div", { className: "divider", children: "OR" }),
|
|
706
|
+
/* @__PURE__ */ o.jsx(
|
|
707
|
+
$r,
|
|
708
|
+
{
|
|
709
|
+
redirectUrl: r,
|
|
710
|
+
text: "Sign up with Google"
|
|
711
|
+
}
|
|
712
|
+
)
|
|
713
|
+
] }),
|
|
714
|
+
!i && /* @__PURE__ */ o.jsx("div", { className: "mt-4 text-center text-sm text-neutral-content-500", children: "Registrations are currently disabled. If you need an account, please contact an administrator." }),
|
|
715
|
+
/* @__PURE__ */ o.jsx("div", { className: "divider" }),
|
|
716
|
+
/* @__PURE__ */ o.jsxs("div", { className: "join w-full justify-center", children: [
|
|
717
|
+
/* @__PURE__ */ o.jsx(ne, { className: "btn join-item", to: "/", children: "Home" }),
|
|
718
|
+
/* @__PURE__ */ o.jsx(ne, { to: "/login", className: "btn join-item", children: "Login" }),
|
|
719
|
+
/* @__PURE__ */ o.jsx(ne, { to: "/forgot-password", className: "btn join-item", children: "Forgot Password" })
|
|
646
720
|
] })
|
|
647
721
|
] });
|
|
648
722
|
}
|
|
649
|
-
function
|
|
650
|
-
const r =
|
|
723
|
+
function zr() {
|
|
724
|
+
const r = Ne(), [e] = ut(), [t, s] = se(!1), [n, a] = se(null), [d, u] = se(!1), { useVerifyEmail: i } = le(), l = i(), c = e.get("token"), f = async () => {
|
|
651
725
|
if (!c) {
|
|
652
726
|
a("No token provided.");
|
|
653
727
|
return;
|
|
654
728
|
}
|
|
655
729
|
s(!0);
|
|
656
730
|
try {
|
|
657
|
-
await
|
|
731
|
+
await l.mutateAsync(c), ct.success("Email verified! You can now log in."), r("/login");
|
|
658
732
|
} catch (h) {
|
|
659
733
|
const p = h?.response?.data, v = p?.error || p?.message || h?.message || "Verification failed.", w = String(v).toLowerCase();
|
|
660
734
|
(w.includes("invalid") || w.includes("expired")) && u(!0), a(String(v));
|
|
@@ -662,12 +736,12 @@ function Ar() {
|
|
|
662
736
|
s(!1);
|
|
663
737
|
}
|
|
664
738
|
};
|
|
665
|
-
return
|
|
739
|
+
return Me(() => {
|
|
666
740
|
c && f();
|
|
667
|
-
}, [c]), /* @__PURE__ */
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
-
/* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
741
|
+
}, [c]), /* @__PURE__ */ o.jsxs(ce, { children: [
|
|
742
|
+
/* @__PURE__ */ o.jsx("h2", { className: "text-2xl font-bold mb-4", children: "Verify Email" }),
|
|
743
|
+
/* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-center gap-4", children: [
|
|
744
|
+
/* @__PURE__ */ o.jsx(
|
|
671
745
|
"button",
|
|
672
746
|
{
|
|
673
747
|
className: "btn btn-primary",
|
|
@@ -676,10 +750,10 @@ function Ar() {
|
|
|
676
750
|
children: t ? "Verifying…" : "Verify"
|
|
677
751
|
}
|
|
678
752
|
),
|
|
679
|
-
n && /* @__PURE__ */
|
|
680
|
-
d && /* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
753
|
+
n && /* @__PURE__ */ o.jsx("div", { className: "text-sm text-center text-error mt-2", children: n }),
|
|
754
|
+
d && /* @__PURE__ */ o.jsxs("div", { className: "mt-2 flex flex-col items-center gap-2", children: [
|
|
755
|
+
/* @__PURE__ */ o.jsx("p", { className: "text-sm mb-2", children: "Token is invalid or expired. Request a new confirmation email." }),
|
|
756
|
+
/* @__PURE__ */ o.jsx(
|
|
683
757
|
"button",
|
|
684
758
|
{
|
|
685
759
|
className: "btn btn-secondary",
|
|
@@ -691,42 +765,65 @@ function Ar() {
|
|
|
691
765
|
] })
|
|
692
766
|
] });
|
|
693
767
|
}
|
|
694
|
-
const
|
|
768
|
+
const vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
695
769
|
__proto__: null,
|
|
696
|
-
AuthLayout:
|
|
697
|
-
AuthProvider:
|
|
698
|
-
ConfirmEmail:
|
|
699
|
-
ForgotPassword:
|
|
700
|
-
Login:
|
|
701
|
-
OAuthCallback:
|
|
702
|
-
ResendConfirmation:
|
|
703
|
-
Reset:
|
|
704
|
-
SignUp:
|
|
705
|
-
Verify:
|
|
706
|
-
handleFormError:
|
|
707
|
-
redirectToOrigin:
|
|
708
|
-
useAuthApi:
|
|
709
|
-
useAuthConfig:
|
|
770
|
+
AuthLayout: ce,
|
|
771
|
+
AuthProvider: Ar,
|
|
772
|
+
ConfirmEmail: Rr,
|
|
773
|
+
ForgotPassword: Tr,
|
|
774
|
+
Login: Or,
|
|
775
|
+
OAuthCallback: Pr,
|
|
776
|
+
ResendConfirmation: Ir,
|
|
777
|
+
Reset: Mr,
|
|
778
|
+
SignUp: Dr,
|
|
779
|
+
Verify: zr,
|
|
780
|
+
handleFormError: ht,
|
|
781
|
+
redirectToOrigin: Vt,
|
|
782
|
+
useAuthApi: le,
|
|
783
|
+
useAuthConfig: Ut
|
|
710
784
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
711
|
-
|
|
785
|
+
let Ue = {};
|
|
786
|
+
function yn(r) {
|
|
787
|
+
Ue = { ...Ue, ...r };
|
|
788
|
+
}
|
|
789
|
+
function Ur() {
|
|
790
|
+
return /* @__PURE__ */ o.jsx("header", { className: "bg-base-300 p-4", children: /* @__PURE__ */ o.jsx("div", { className: "container mx-auto font-semibold", children: "Kaleido" }) });
|
|
791
|
+
}
|
|
792
|
+
function Vr() {
|
|
793
|
+
return /* @__PURE__ */ o.jsx("div", { className: "text-sm text-muted", children: "No admin navigation provided." });
|
|
794
|
+
}
|
|
795
|
+
function Br() {
|
|
796
|
+
return Ue.SiteNavigation ?? Ur;
|
|
797
|
+
}
|
|
798
|
+
function Wr() {
|
|
799
|
+
return Ue.AdminNav ?? Vr;
|
|
800
|
+
}
|
|
801
|
+
function pt({
|
|
712
802
|
title: r,
|
|
713
803
|
children: e
|
|
714
804
|
}) {
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
/* @__PURE__ */
|
|
805
|
+
const t = Br(), s = Wr();
|
|
806
|
+
return /* @__PURE__ */ o.jsxs("div", { className: "min-h-screen bg-base-200", children: [
|
|
807
|
+
/* @__PURE__ */ o.jsx(t, {}),
|
|
808
|
+
/* @__PURE__ */ o.jsxs("div", { className: "container mx-auto p-6", children: [
|
|
809
|
+
r && /* @__PURE__ */ o.jsx("div", { className: "mb-4", children: /* @__PURE__ */ o.jsx("h1", { className: "text-2xl font-bold", children: r }) }),
|
|
810
|
+
/* @__PURE__ */ o.jsxs("div", { className: "grid grid-cols-12 gap-6", children: [
|
|
811
|
+
/* @__PURE__ */ o.jsx("aside", { className: "col-span-12 md:col-span-3", children: /* @__PURE__ */ o.jsx("div", { className: "card bg-base-100 p-4", children: /* @__PURE__ */ o.jsx(s, {}) }) }),
|
|
812
|
+
/* @__PURE__ */ o.jsx("main", { className: "col-span-12 md:col-span-9", children: e })
|
|
813
|
+
] })
|
|
814
|
+
] })
|
|
718
815
|
] });
|
|
719
816
|
}
|
|
720
|
-
function
|
|
817
|
+
function qr({
|
|
721
818
|
icon: r,
|
|
722
819
|
title: e,
|
|
723
820
|
message: t,
|
|
724
821
|
action: s
|
|
725
822
|
}) {
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
r && /* @__PURE__ */
|
|
729
|
-
|
|
823
|
+
return /* @__PURE__ */ o.jsx("div", { className: "min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/10 to-secondary/10", children: /* @__PURE__ */ o.jsx("div", { className: "card bg-base-100 shadow-soft hover:shadow-medium transition-shadow border border-base-300 w-full max-w-md mx-4", children: /* @__PURE__ */ o.jsxs("div", { className: "card-body p-8", children: [
|
|
824
|
+
/* @__PURE__ */ o.jsxs("h2", { className: "card-title text-2xl mb-4", children: [
|
|
825
|
+
r && /* @__PURE__ */ o.jsx(
|
|
826
|
+
je,
|
|
730
827
|
{
|
|
731
828
|
icon: r,
|
|
732
829
|
className: "text-neutral-content-300 mb-4"
|
|
@@ -734,11 +831,11 @@ function Tr({
|
|
|
734
831
|
),
|
|
735
832
|
e
|
|
736
833
|
] }),
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
s && /* @__PURE__ */
|
|
834
|
+
/* @__PURE__ */ o.jsx("div", { className: "mt-4 text-sm text-center", children: t }),
|
|
835
|
+
s && /* @__PURE__ */ o.jsx("div", { children: s })
|
|
739
836
|
] }) }) });
|
|
740
837
|
}
|
|
741
|
-
function
|
|
838
|
+
function Yr({
|
|
742
839
|
isOpen: r,
|
|
743
840
|
title: e,
|
|
744
841
|
handleSubmit: t,
|
|
@@ -748,7 +845,7 @@ function Or({
|
|
|
748
845
|
onSave: d,
|
|
749
846
|
onClose: u,
|
|
750
847
|
onCancel: i,
|
|
751
|
-
children:
|
|
848
|
+
children: l,
|
|
752
849
|
maxWidth: c = "2xl",
|
|
753
850
|
submitLabel: f = "Save",
|
|
754
851
|
cancelLabel: h = "Cancel"
|
|
@@ -757,25 +854,25 @@ function Or({
|
|
|
757
854
|
const p = s || n, v = () => {
|
|
758
855
|
p || (i && i(), u());
|
|
759
856
|
}, w = `max-w-${c}`;
|
|
760
|
-
return /* @__PURE__ */
|
|
857
|
+
return /* @__PURE__ */ o.jsx("div", { className: "modal modal-open", onClick: v, children: /* @__PURE__ */ o.jsxs(
|
|
761
858
|
"div",
|
|
762
859
|
{
|
|
763
860
|
className: `modal-box ${w}`,
|
|
764
|
-
onClick: (
|
|
861
|
+
onClick: (x) => x.stopPropagation(),
|
|
765
862
|
children: [
|
|
766
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ o.jsxs("h3", { className: "font-bold text-lg mb-4", children: [
|
|
767
864
|
e,
|
|
768
|
-
p && /* @__PURE__ */
|
|
865
|
+
p && /* @__PURE__ */ o.jsx("span", { className: "loading loading-spinner loading-xs ml-2" })
|
|
769
866
|
] }),
|
|
770
|
-
a !== void 0 && a > 0 && a < 100 && /* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
867
|
+
a !== void 0 && a > 0 && a < 100 && /* @__PURE__ */ o.jsxs("div", { className: "mb-4", children: [
|
|
868
|
+
/* @__PURE__ */ o.jsxs("div", { className: "flex items-center justify-between mb-2", children: [
|
|
869
|
+
/* @__PURE__ */ o.jsx("span", { className: "text-sm", children: "Uploading..." }),
|
|
870
|
+
/* @__PURE__ */ o.jsxs("span", { className: "text-sm font-semibold", children: [
|
|
774
871
|
a,
|
|
775
872
|
"%"
|
|
776
873
|
] })
|
|
777
874
|
] }),
|
|
778
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ o.jsx(
|
|
779
876
|
"progress",
|
|
780
877
|
{
|
|
781
878
|
className: "progress progress-primary w-full",
|
|
@@ -784,10 +881,10 @@ function Or({
|
|
|
784
881
|
}
|
|
785
882
|
)
|
|
786
883
|
] }),
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ o.jsxs("form", { onSubmit: t((x) => d(x, { onClose: u })), children: [
|
|
885
|
+
l,
|
|
886
|
+
/* @__PURE__ */ o.jsxs("div", { className: "modal-action", children: [
|
|
887
|
+
/* @__PURE__ */ o.jsx(
|
|
791
888
|
"button",
|
|
792
889
|
{
|
|
793
890
|
type: "button",
|
|
@@ -797,14 +894,14 @@ function Or({
|
|
|
797
894
|
children: h
|
|
798
895
|
}
|
|
799
896
|
),
|
|
800
|
-
/* @__PURE__ */
|
|
897
|
+
/* @__PURE__ */ o.jsxs(
|
|
801
898
|
"button",
|
|
802
899
|
{
|
|
803
900
|
type: "submit",
|
|
804
901
|
className: "btn btn-primary",
|
|
805
902
|
disabled: p,
|
|
806
903
|
children: [
|
|
807
|
-
p && /* @__PURE__ */
|
|
904
|
+
p && /* @__PURE__ */ o.jsx("span", { className: "loading loading-spinner loading-xs" }),
|
|
808
905
|
f
|
|
809
906
|
]
|
|
810
907
|
}
|
|
@@ -815,102 +912,102 @@ function Or({
|
|
|
815
912
|
}
|
|
816
913
|
) });
|
|
817
914
|
}
|
|
818
|
-
var
|
|
819
|
-
function
|
|
820
|
-
var e =
|
|
915
|
+
var Gr = typeof global == "object" && global && global.Object === Object && global, Qr = typeof self == "object" && self && self.Object === Object && self, Yt = Gr || Qr || Function("return this")(), Ve = Yt.Symbol, Gt = Object.prototype, Hr = Gt.hasOwnProperty, Jr = Gt.toString, Te = Ve ? Ve.toStringTag : void 0;
|
|
916
|
+
function Xr(r) {
|
|
917
|
+
var e = Hr.call(r, Te), t = r[Te];
|
|
821
918
|
try {
|
|
822
|
-
r[
|
|
919
|
+
r[Te] = void 0;
|
|
823
920
|
var s = !0;
|
|
824
921
|
} catch {
|
|
825
922
|
}
|
|
826
|
-
var n =
|
|
827
|
-
return s && (e ? r[
|
|
923
|
+
var n = Jr.call(r);
|
|
924
|
+
return s && (e ? r[Te] = t : delete r[Te]), n;
|
|
828
925
|
}
|
|
829
|
-
var
|
|
830
|
-
function
|
|
831
|
-
return
|
|
926
|
+
var Kr = Object.prototype, es = Kr.toString;
|
|
927
|
+
function ts(r) {
|
|
928
|
+
return es.call(r);
|
|
832
929
|
}
|
|
833
|
-
var
|
|
834
|
-
function
|
|
835
|
-
return r == null ? r === void 0 ?
|
|
930
|
+
var rs = "[object Null]", ss = "[object Undefined]", _t = Ve ? Ve.toStringTag : void 0;
|
|
931
|
+
function ns(r) {
|
|
932
|
+
return r == null ? r === void 0 ? ss : rs : _t && _t in Object(r) ? Xr(r) : ts(r);
|
|
836
933
|
}
|
|
837
|
-
function
|
|
934
|
+
function as(r) {
|
|
838
935
|
return r != null && typeof r == "object";
|
|
839
936
|
}
|
|
840
|
-
var
|
|
841
|
-
function
|
|
842
|
-
return typeof r == "symbol" ||
|
|
937
|
+
var is = "[object Symbol]";
|
|
938
|
+
function os(r) {
|
|
939
|
+
return typeof r == "symbol" || as(r) && ns(r) == is;
|
|
843
940
|
}
|
|
844
|
-
var
|
|
845
|
-
function
|
|
846
|
-
for (var e = r.length; e-- &&
|
|
941
|
+
var ls = /\s/;
|
|
942
|
+
function cs(r) {
|
|
943
|
+
for (var e = r.length; e-- && ls.test(r.charAt(e)); )
|
|
847
944
|
;
|
|
848
945
|
return e;
|
|
849
946
|
}
|
|
850
|
-
var
|
|
851
|
-
function
|
|
852
|
-
return r && r.slice(0,
|
|
947
|
+
var ds = /^\s+/;
|
|
948
|
+
function us(r) {
|
|
949
|
+
return r && r.slice(0, cs(r) + 1).replace(ds, "");
|
|
853
950
|
}
|
|
854
|
-
function
|
|
951
|
+
function tt(r) {
|
|
855
952
|
var e = typeof r;
|
|
856
953
|
return r != null && (e == "object" || e == "function");
|
|
857
954
|
}
|
|
858
|
-
var
|
|
859
|
-
function
|
|
955
|
+
var bt = NaN, fs = /^[-+]0x[0-9a-f]+$/i, hs = /^0b[01]+$/i, ms = /^0o[0-7]+$/i, ps = parseInt;
|
|
956
|
+
function wt(r) {
|
|
860
957
|
if (typeof r == "number")
|
|
861
958
|
return r;
|
|
862
|
-
if (
|
|
863
|
-
return
|
|
864
|
-
if (
|
|
959
|
+
if (os(r))
|
|
960
|
+
return bt;
|
|
961
|
+
if (tt(r)) {
|
|
865
962
|
var e = typeof r.valueOf == "function" ? r.valueOf() : r;
|
|
866
|
-
r =
|
|
963
|
+
r = tt(e) ? e + "" : e;
|
|
867
964
|
}
|
|
868
965
|
if (typeof r != "string")
|
|
869
966
|
return r === 0 ? r : +r;
|
|
870
|
-
r =
|
|
871
|
-
var t =
|
|
872
|
-
return t ||
|
|
967
|
+
r = us(r);
|
|
968
|
+
var t = hs.test(r);
|
|
969
|
+
return t || ms.test(r) ? ps(r.slice(2), t ? 2 : 8) : fs.test(r) ? bt : +r;
|
|
873
970
|
}
|
|
874
|
-
var
|
|
875
|
-
return
|
|
876
|
-
},
|
|
877
|
-
function
|
|
878
|
-
var s, n, a, d, u, i,
|
|
971
|
+
var Xe = function() {
|
|
972
|
+
return Yt.Date.now();
|
|
973
|
+
}, gs = "Expected a function", vs = Math.max, ys = Math.min;
|
|
974
|
+
function xs(r, e, t) {
|
|
975
|
+
var s, n, a, d, u, i, l = 0, c = !1, f = !1, h = !0;
|
|
879
976
|
if (typeof r != "function")
|
|
880
|
-
throw new TypeError(
|
|
881
|
-
e =
|
|
977
|
+
throw new TypeError(gs);
|
|
978
|
+
e = wt(e) || 0, tt(t) && (c = !!t.leading, f = "maxWait" in t, a = f ? vs(wt(t.maxWait) || 0, e) : a, h = "trailing" in t ? !!t.trailing : h);
|
|
882
979
|
function p(O) {
|
|
883
980
|
var B = s, W = n;
|
|
884
|
-
return s = n = void 0,
|
|
981
|
+
return s = n = void 0, l = O, d = r.apply(W, B), d;
|
|
885
982
|
}
|
|
886
983
|
function v(O) {
|
|
887
|
-
return
|
|
984
|
+
return l = O, u = setTimeout(M, e), c ? p(O) : d;
|
|
888
985
|
}
|
|
889
986
|
function w(O) {
|
|
890
|
-
var B = O - i, W = O -
|
|
891
|
-
return f ?
|
|
987
|
+
var B = O - i, W = O - l, H = e - B;
|
|
988
|
+
return f ? ys(H, a - W) : H;
|
|
892
989
|
}
|
|
893
|
-
function
|
|
894
|
-
var B = O - i, W = O -
|
|
990
|
+
function x(O) {
|
|
991
|
+
var B = O - i, W = O - l;
|
|
895
992
|
return i === void 0 || B >= e || B < 0 || f && W >= a;
|
|
896
993
|
}
|
|
897
994
|
function M() {
|
|
898
|
-
var O =
|
|
899
|
-
if (
|
|
900
|
-
return
|
|
995
|
+
var O = Xe();
|
|
996
|
+
if (x(O))
|
|
997
|
+
return A(O);
|
|
901
998
|
u = setTimeout(M, w(O));
|
|
902
999
|
}
|
|
903
|
-
function
|
|
1000
|
+
function A(O) {
|
|
904
1001
|
return u = void 0, h && s ? p(O) : (s = n = void 0, d);
|
|
905
1002
|
}
|
|
906
|
-
function
|
|
907
|
-
u !== void 0 && clearTimeout(u),
|
|
1003
|
+
function j() {
|
|
1004
|
+
u !== void 0 && clearTimeout(u), l = 0, s = i = n = u = void 0;
|
|
908
1005
|
}
|
|
909
1006
|
function I() {
|
|
910
|
-
return u === void 0 ? d :
|
|
1007
|
+
return u === void 0 ? d : A(Xe());
|
|
911
1008
|
}
|
|
912
1009
|
function L() {
|
|
913
|
-
var O =
|
|
1010
|
+
var O = Xe(), B = x(O);
|
|
914
1011
|
if (s = arguments, n = this, i = O, B) {
|
|
915
1012
|
if (u === void 0)
|
|
916
1013
|
return v(i);
|
|
@@ -919,9 +1016,9 @@ function ns(r, e, t) {
|
|
|
919
1016
|
}
|
|
920
1017
|
return u === void 0 && (u = setTimeout(M, e)), d;
|
|
921
1018
|
}
|
|
922
|
-
return L.cancel =
|
|
1019
|
+
return L.cancel = j, L.flush = I, L;
|
|
923
1020
|
}
|
|
924
|
-
function
|
|
1021
|
+
function xn(r, e) {
|
|
925
1022
|
const t = e?.defaultPage ?? 1, s = e?.defaultPerPage ?? 25, n = {};
|
|
926
1023
|
r.page !== void 0 && r.page !== null && r.page !== t && (n.page = Number(r.page)), r.per_page !== void 0 && r.per_page !== null && r.per_page !== s && (n.per_page = Number(r.per_page));
|
|
927
1024
|
const a = {};
|
|
@@ -929,19 +1026,19 @@ function en(r, e) {
|
|
|
929
1026
|
const d = r.q ?? r.q, u = {};
|
|
930
1027
|
return Object.keys(n).length && (u.pagination = n), d != null && String(d) !== "" && (u.q = d), Object.keys(a).length && (u.sort = a), u;
|
|
931
1028
|
}
|
|
932
|
-
function
|
|
1029
|
+
function jt(r, e) {
|
|
933
1030
|
const t = {};
|
|
934
1031
|
for (const [s, n] of r.entries())
|
|
935
1032
|
t[s] = n;
|
|
936
1033
|
return t;
|
|
937
1034
|
}
|
|
938
|
-
function
|
|
1035
|
+
function ze(r) {
|
|
939
1036
|
const e = new URLSearchParams();
|
|
940
1037
|
return Object.entries(r || {}).forEach(([t, s]) => {
|
|
941
1038
|
s != null && e.set(t, String(s));
|
|
942
1039
|
}), e;
|
|
943
1040
|
}
|
|
944
|
-
function
|
|
1041
|
+
function Qt({
|
|
945
1042
|
page: r,
|
|
946
1043
|
perPage: e,
|
|
947
1044
|
total: t,
|
|
@@ -953,7 +1050,7 @@ function Ut({
|
|
|
953
1050
|
if (d <= 1) return null;
|
|
954
1051
|
const u = (p) => {
|
|
955
1052
|
p !== r && p >= 1 && p <= d && s(p);
|
|
956
|
-
}, i = (p) => /* @__PURE__ */
|
|
1053
|
+
}, i = (p) => /* @__PURE__ */ o.jsx(
|
|
957
1054
|
"button",
|
|
958
1055
|
{
|
|
959
1056
|
className: `join-item btn ${p === r ? "btn-active" : ""}`,
|
|
@@ -961,15 +1058,15 @@ function Ut({
|
|
|
961
1058
|
children: p
|
|
962
1059
|
},
|
|
963
1060
|
p
|
|
964
|
-
),
|
|
965
|
-
let c = r - Math.floor(
|
|
1061
|
+
), l = Math.max(1, Math.min(a, d));
|
|
1062
|
+
let c = r - Math.floor(l / 2);
|
|
966
1063
|
c < 1 && (c = 1);
|
|
967
|
-
let f = c +
|
|
968
|
-
f > d && (f = d, c = Math.max(1, f -
|
|
1064
|
+
let f = c + l - 1;
|
|
1065
|
+
f > d && (f = d, c = Math.max(1, f - l + 1));
|
|
969
1066
|
const h = [];
|
|
970
1067
|
for (let p = c; p <= f; p++) h.push(p);
|
|
971
|
-
return /* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
1068
|
+
return /* @__PURE__ */ o.jsx("div", { className: `flex justify-center ${n}`, children: /* @__PURE__ */ o.jsxs("div", { className: "join", children: [
|
|
1069
|
+
/* @__PURE__ */ o.jsx(
|
|
973
1070
|
"button",
|
|
974
1071
|
{
|
|
975
1072
|
className: "join-item btn",
|
|
@@ -979,7 +1076,7 @@ function Ut({
|
|
|
979
1076
|
}
|
|
980
1077
|
),
|
|
981
1078
|
h.map((p) => i(p)),
|
|
982
|
-
/* @__PURE__ */
|
|
1079
|
+
/* @__PURE__ */ o.jsx(
|
|
983
1080
|
"button",
|
|
984
1081
|
{
|
|
985
1082
|
className: "join-item btn",
|
|
@@ -990,7 +1087,7 @@ function Ut({
|
|
|
990
1087
|
)
|
|
991
1088
|
] }) });
|
|
992
1089
|
}
|
|
993
|
-
function
|
|
1090
|
+
function Ht({
|
|
994
1091
|
title: r,
|
|
995
1092
|
actions: e,
|
|
996
1093
|
paramsSchema: t,
|
|
@@ -1001,52 +1098,52 @@ function Vt({
|
|
|
1001
1098
|
onRowClick: u,
|
|
1002
1099
|
paginationType: i = "pages"
|
|
1003
1100
|
}) {
|
|
1004
|
-
const [
|
|
1005
|
-
|
|
1006
|
-
JSON.stringify(f) !== JSON.stringify(I.current) && (
|
|
1101
|
+
const [l, c] = ut(), f = jt(l), { data: h, isLoading: p, raw: v } = s(f), w = v?.metadata?.total ?? 0, x = f.page ?? 1, M = f.per_page ?? 20, [A, j] = se(f), I = yr(f);
|
|
1102
|
+
Me(() => {
|
|
1103
|
+
JSON.stringify(f) !== JSON.stringify(I.current) && (j(f), I.current = f);
|
|
1007
1104
|
}, [f]);
|
|
1008
|
-
const L =
|
|
1009
|
-
() =>
|
|
1010
|
-
c(
|
|
1105
|
+
const L = xr(
|
|
1106
|
+
() => xs((P) => {
|
|
1107
|
+
c(ze(P));
|
|
1011
1108
|
}, 300),
|
|
1012
1109
|
[c]
|
|
1013
1110
|
);
|
|
1014
|
-
|
|
1111
|
+
Me(() => () => L.cancel(), [L]);
|
|
1015
1112
|
const O = (P, Y) => {
|
|
1016
|
-
const
|
|
1017
|
-
...
|
|
1113
|
+
const G = {
|
|
1114
|
+
...A,
|
|
1018
1115
|
[P]: Y === "" ? void 0 : Y,
|
|
1019
1116
|
// Reset to page 1 when filters change
|
|
1020
1117
|
page: 1
|
|
1021
1118
|
};
|
|
1022
|
-
|
|
1119
|
+
j(G), L(G);
|
|
1023
1120
|
}, B = (P) => {
|
|
1024
1121
|
const Y = {
|
|
1025
|
-
...
|
|
1122
|
+
...A,
|
|
1026
1123
|
...P,
|
|
1027
1124
|
// Reset to page 1 when filters change
|
|
1028
1125
|
page: 1
|
|
1029
1126
|
};
|
|
1030
|
-
|
|
1127
|
+
j(Y), L(Y);
|
|
1031
1128
|
}, W = () => {
|
|
1032
|
-
L.cancel(), c(
|
|
1033
|
-
},
|
|
1034
|
-
const P =
|
|
1035
|
-
|
|
1036
|
-
},
|
|
1129
|
+
L.cancel(), c(ze(A));
|
|
1130
|
+
}, H = () => {
|
|
1131
|
+
const P = jt(new URLSearchParams());
|
|
1132
|
+
j(P), L.cancel(), c(ze(P));
|
|
1133
|
+
}, de = (P) => {
|
|
1037
1134
|
const Y = { ...f, page: P };
|
|
1038
|
-
c(
|
|
1135
|
+
c(ze(Y));
|
|
1039
1136
|
}, q = r || e || n;
|
|
1040
|
-
return /* @__PURE__ */
|
|
1041
|
-
q && /* @__PURE__ */
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
r && /* @__PURE__ */
|
|
1044
|
-
e && /* @__PURE__ */
|
|
1137
|
+
return /* @__PURE__ */ o.jsx("div", { className: "card bg-base-100 shadow-xl", children: /* @__PURE__ */ o.jsxs("div", { className: "card-body", children: [
|
|
1138
|
+
q && /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col gap-4 mb-4", children: [
|
|
1139
|
+
/* @__PURE__ */ o.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
1140
|
+
r && /* @__PURE__ */ o.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ o.jsx("h2", { className: "card-title m-0 text-2xl font-bold", children: r }) }),
|
|
1141
|
+
e && /* @__PURE__ */ o.jsx("div", { className: "flex items-center gap-3", children: e })
|
|
1045
1142
|
] }),
|
|
1046
|
-
n && /* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */
|
|
1048
|
-
/* @__PURE__ */
|
|
1049
|
-
/* @__PURE__ */
|
|
1143
|
+
n && /* @__PURE__ */ o.jsxs("div", { className: "flex flex-wrap items-center justify-end gap-2 bg-base-200/50 p-2 rounded-lg w-full", children: [
|
|
1144
|
+
/* @__PURE__ */ o.jsx("div", { className: "flex flex-wrap gap-2 justify-end flex-1", children: n(A, O) }),
|
|
1145
|
+
/* @__PURE__ */ o.jsxs("div", { className: "join", children: [
|
|
1146
|
+
/* @__PURE__ */ o.jsx(
|
|
1050
1147
|
"button",
|
|
1051
1148
|
{
|
|
1052
1149
|
className: "join-item btn btn-sm btn-neutral",
|
|
@@ -1054,70 +1151,70 @@ function Vt({
|
|
|
1054
1151
|
children: "Search"
|
|
1055
1152
|
}
|
|
1056
1153
|
),
|
|
1057
|
-
/* @__PURE__ */
|
|
1154
|
+
/* @__PURE__ */ o.jsx(
|
|
1058
1155
|
"button",
|
|
1059
1156
|
{
|
|
1060
1157
|
className: "join-item btn btn-sm btn-ghost border-base-300",
|
|
1061
|
-
onClick:
|
|
1158
|
+
onClick: H,
|
|
1062
1159
|
children: "Clear"
|
|
1063
1160
|
}
|
|
1064
1161
|
)
|
|
1065
1162
|
] })
|
|
1066
1163
|
] })
|
|
1067
1164
|
] }),
|
|
1068
|
-
p ? /* @__PURE__ */
|
|
1069
|
-
/* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1071
|
-
const
|
|
1072
|
-
return /* @__PURE__ */
|
|
1165
|
+
p ? /* @__PURE__ */ o.jsx("div", { className: "flex justify-center items-center py-10", children: /* @__PURE__ */ o.jsx("span", { className: "loading loading-spinner loading-lg" }) }) : h.length === 0 ? /* @__PURE__ */ o.jsx("div", { className: "text-center py-8", children: d }) : /* @__PURE__ */ o.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ o.jsxs("table", { className: "table table-zebra w-full", children: [
|
|
1166
|
+
/* @__PURE__ */ o.jsx("thead", { children: /* @__PURE__ */ o.jsx("tr", { children: a.map((P) => /* @__PURE__ */ o.jsx("th", { className: P.className, children: typeof P.header == "function" ? P.header(f, O, B) : P.header }, P.key)) }) }),
|
|
1167
|
+
/* @__PURE__ */ o.jsx("tbody", { children: h.map((P, Y) => {
|
|
1168
|
+
const G = P.id !== void 0 ? String(P.id) : `row-${Y}`;
|
|
1169
|
+
return /* @__PURE__ */ o.jsx(
|
|
1073
1170
|
"tr",
|
|
1074
1171
|
{
|
|
1075
1172
|
className: u ? "cursor-pointer hover:bg-base-200" : "",
|
|
1076
1173
|
onClick: () => u?.(P),
|
|
1077
|
-
children: a.map((U) => /* @__PURE__ */
|
|
1174
|
+
children: a.map((U) => /* @__PURE__ */ o.jsx(
|
|
1078
1175
|
"td",
|
|
1079
1176
|
{
|
|
1080
1177
|
className: U.className,
|
|
1081
1178
|
children: U.render ? U.render(P) : P[U.key]
|
|
1082
1179
|
},
|
|
1083
|
-
`${
|
|
1180
|
+
`${G}-${U.key}`
|
|
1084
1181
|
))
|
|
1085
1182
|
},
|
|
1086
|
-
|
|
1183
|
+
G
|
|
1087
1184
|
);
|
|
1088
1185
|
}) })
|
|
1089
1186
|
] }) }),
|
|
1090
|
-
i !== "none" && /* @__PURE__ */
|
|
1091
|
-
|
|
1187
|
+
i !== "none" && /* @__PURE__ */ o.jsx("div", { className: "mt-4", children: /* @__PURE__ */ o.jsx(
|
|
1188
|
+
Qt,
|
|
1092
1189
|
{
|
|
1093
|
-
page:
|
|
1190
|
+
page: x,
|
|
1094
1191
|
perPage: M,
|
|
1095
1192
|
total: w,
|
|
1096
|
-
onPageChange:
|
|
1193
|
+
onPageChange: de
|
|
1097
1194
|
}
|
|
1098
1195
|
) })
|
|
1099
1196
|
] }) });
|
|
1100
1197
|
}
|
|
1101
|
-
function
|
|
1198
|
+
function _s({
|
|
1102
1199
|
errors: r,
|
|
1103
1200
|
className: e = ""
|
|
1104
1201
|
}) {
|
|
1105
|
-
return !Array.isArray(r) || r.length === 0 ? null : /* @__PURE__ */
|
|
1202
|
+
return !Array.isArray(r) || r.length === 0 ? null : /* @__PURE__ */ o.jsx("div", { className: `alert alert-error mb-4 ${e}`.trim(), children: /* @__PURE__ */ o.jsx("ul", { className: "list-disc list-inside", children: r.map((t, s) => /* @__PURE__ */ o.jsx("li", { children: t }, s)) }) });
|
|
1106
1203
|
}
|
|
1107
|
-
var
|
|
1204
|
+
var bs = Object.defineProperty, Be = Object.getOwnPropertySymbols, Jt = Object.prototype.hasOwnProperty, Xt = Object.prototype.propertyIsEnumerable, Nt = (r, e, t) => e in r ? bs(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, rt = (r, e) => {
|
|
1108
1205
|
for (var t in e || (e = {}))
|
|
1109
|
-
|
|
1110
|
-
if (
|
|
1111
|
-
for (var t of
|
|
1112
|
-
|
|
1206
|
+
Jt.call(e, t) && Nt(r, t, e[t]);
|
|
1207
|
+
if (Be)
|
|
1208
|
+
for (var t of Be(e))
|
|
1209
|
+
Xt.call(e, t) && Nt(r, t, e[t]);
|
|
1113
1210
|
return r;
|
|
1114
|
-
},
|
|
1211
|
+
}, st = (r, e) => {
|
|
1115
1212
|
var t = {};
|
|
1116
1213
|
for (var s in r)
|
|
1117
|
-
|
|
1118
|
-
if (r != null &&
|
|
1119
|
-
for (var s of
|
|
1120
|
-
e.indexOf(s) < 0 &&
|
|
1214
|
+
Jt.call(r, s) && e.indexOf(s) < 0 && (t[s] = r[s]);
|
|
1215
|
+
if (r != null && Be)
|
|
1216
|
+
for (var s of Be(r))
|
|
1217
|
+
e.indexOf(s) < 0 && Xt.call(r, s) && (t[s] = r[s]);
|
|
1121
1218
|
return t;
|
|
1122
1219
|
};
|
|
1123
1220
|
var ue;
|
|
@@ -1128,8 +1225,8 @@ var ue;
|
|
|
1128
1225
|
// error correction level, data codeword bytes, and mask number.
|
|
1129
1226
|
// This is a low-level API that most users should not use directly.
|
|
1130
1227
|
// A mid-level API is the encodeSegments() function.
|
|
1131
|
-
constructor(i,
|
|
1132
|
-
if (this.version = i, this.errorCorrectionLevel =
|
|
1228
|
+
constructor(i, l, c, f) {
|
|
1229
|
+
if (this.version = i, this.errorCorrectionLevel = l, this.modules = [], this.isFunction = [], i < S.MIN_VERSION || i > S.MAX_VERSION)
|
|
1133
1230
|
throw new RangeError("Version value out of range");
|
|
1134
1231
|
if (f < -1 || f > 7)
|
|
1135
1232
|
throw new RangeError("Mask value out of range");
|
|
@@ -1145,8 +1242,8 @@ var ue;
|
|
|
1145
1242
|
let v = 1e9;
|
|
1146
1243
|
for (let w = 0; w < 8; w++) {
|
|
1147
1244
|
this.applyMask(w), this.drawFormatBits(w);
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1245
|
+
const x = this.getPenaltyScore();
|
|
1246
|
+
x < v && (f = w, v = x), this.applyMask(w);
|
|
1150
1247
|
}
|
|
1151
1248
|
}
|
|
1152
1249
|
n(0 <= f && f <= 7), this.mask = f, this.applyMask(f), this.drawFormatBits(f), this.isFunction = [];
|
|
@@ -1157,17 +1254,17 @@ var ue;
|
|
|
1157
1254
|
// Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
|
|
1158
1255
|
// QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
|
|
1159
1256
|
// ecl argument if it can be done without increasing the version.
|
|
1160
|
-
static encodeText(i,
|
|
1257
|
+
static encodeText(i, l) {
|
|
1161
1258
|
const c = r.QrSegment.makeSegments(i);
|
|
1162
|
-
return S.encodeSegments(c,
|
|
1259
|
+
return S.encodeSegments(c, l);
|
|
1163
1260
|
}
|
|
1164
1261
|
// Returns a QR Code representing the given binary data at the given error correction level.
|
|
1165
1262
|
// This function always encodes using the binary segment mode, not any text mode. The maximum number of
|
|
1166
1263
|
// bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
|
|
1167
1264
|
// The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
|
|
1168
|
-
static encodeBinary(i,
|
|
1265
|
+
static encodeBinary(i, l) {
|
|
1169
1266
|
const c = r.QrSegment.makeBytes(i);
|
|
1170
|
-
return S.encodeSegments([c],
|
|
1267
|
+
return S.encodeSegments([c], l);
|
|
1171
1268
|
}
|
|
1172
1269
|
/*-- Static factory functions (mid level) --*/
|
|
1173
1270
|
// Returns a QR Code representing the given segments with the given encoding parameters.
|
|
@@ -1179,43 +1276,43 @@ var ue;
|
|
|
1179
1276
|
// This function allows the user to create a custom sequence of segments that switches
|
|
1180
1277
|
// between modes (such as alphanumeric and byte) to encode text in less space.
|
|
1181
1278
|
// This is a mid-level API; the high-level API is encodeText() and encodeBinary().
|
|
1182
|
-
static encodeSegments(i,
|
|
1279
|
+
static encodeSegments(i, l, c = 1, f = 40, h = -1, p = !0) {
|
|
1183
1280
|
if (!(S.MIN_VERSION <= c && c <= f && f <= S.MAX_VERSION) || h < -1 || h > 7)
|
|
1184
1281
|
throw new RangeError("Invalid value");
|
|
1185
1282
|
let v, w;
|
|
1186
1283
|
for (v = c; ; v++) {
|
|
1187
|
-
const
|
|
1188
|
-
if (I <=
|
|
1284
|
+
const j = S.getNumDataCodewords(v, l) * 8, I = d.getTotalBits(i, v);
|
|
1285
|
+
if (I <= j) {
|
|
1189
1286
|
w = I;
|
|
1190
1287
|
break;
|
|
1191
1288
|
}
|
|
1192
1289
|
if (v >= f)
|
|
1193
1290
|
throw new RangeError("Data too long");
|
|
1194
1291
|
}
|
|
1195
|
-
for (const
|
|
1196
|
-
p && w <= S.getNumDataCodewords(v,
|
|
1197
|
-
let
|
|
1198
|
-
for (const
|
|
1199
|
-
t(
|
|
1200
|
-
for (const I of
|
|
1201
|
-
|
|
1292
|
+
for (const j of [S.Ecc.MEDIUM, S.Ecc.QUARTILE, S.Ecc.HIGH])
|
|
1293
|
+
p && w <= S.getNumDataCodewords(v, j) * 8 && (l = j);
|
|
1294
|
+
let x = [];
|
|
1295
|
+
for (const j of i) {
|
|
1296
|
+
t(j.mode.modeBits, 4, x), t(j.numChars, j.mode.numCharCountBits(v), x);
|
|
1297
|
+
for (const I of j.getData())
|
|
1298
|
+
x.push(I);
|
|
1202
1299
|
}
|
|
1203
|
-
n(
|
|
1204
|
-
const M = S.getNumDataCodewords(v,
|
|
1205
|
-
n(
|
|
1206
|
-
for (let
|
|
1207
|
-
t(
|
|
1208
|
-
let
|
|
1209
|
-
for (;
|
|
1210
|
-
|
|
1211
|
-
return
|
|
1300
|
+
n(x.length == w);
|
|
1301
|
+
const M = S.getNumDataCodewords(v, l) * 8;
|
|
1302
|
+
n(x.length <= M), t(0, Math.min(4, M - x.length), x), t(0, (8 - x.length % 8) % 8, x), n(x.length % 8 == 0);
|
|
1303
|
+
for (let j = 236; x.length < M; j ^= 253)
|
|
1304
|
+
t(j, 8, x);
|
|
1305
|
+
let A = [];
|
|
1306
|
+
for (; A.length * 8 < x.length; )
|
|
1307
|
+
A.push(0);
|
|
1308
|
+
return x.forEach((j, I) => A[I >>> 3] |= j << 7 - (I & 7)), new S(v, l, A, h);
|
|
1212
1309
|
}
|
|
1213
1310
|
/*-- Accessor methods --*/
|
|
1214
1311
|
// Returns the color of the module (pixel) at the given coordinates, which is false
|
|
1215
1312
|
// for light or true for dark. The top left corner has the coordinates (x=0, y=0).
|
|
1216
1313
|
// If the given coordinates are out of bounds, then false (light) is returned.
|
|
1217
|
-
getModule(i,
|
|
1218
|
-
return 0 <= i && i < this.size && 0 <=
|
|
1314
|
+
getModule(i, l) {
|
|
1315
|
+
return 0 <= i && i < this.size && 0 <= l && l < this.size && this.modules[l][i];
|
|
1219
1316
|
}
|
|
1220
1317
|
// Modified to expose modules for easy access
|
|
1221
1318
|
getModules() {
|
|
@@ -1227,20 +1324,20 @@ var ue;
|
|
|
1227
1324
|
for (let c = 0; c < this.size; c++)
|
|
1228
1325
|
this.setFunctionModule(6, c, c % 2 == 0), this.setFunctionModule(c, 6, c % 2 == 0);
|
|
1229
1326
|
this.drawFinderPattern(3, 3), this.drawFinderPattern(this.size - 4, 3), this.drawFinderPattern(3, this.size - 4);
|
|
1230
|
-
const i = this.getAlignmentPatternPositions(),
|
|
1231
|
-
for (let c = 0; c <
|
|
1232
|
-
for (let f = 0; f <
|
|
1233
|
-
c == 0 && f == 0 || c == 0 && f ==
|
|
1327
|
+
const i = this.getAlignmentPatternPositions(), l = i.length;
|
|
1328
|
+
for (let c = 0; c < l; c++)
|
|
1329
|
+
for (let f = 0; f < l; f++)
|
|
1330
|
+
c == 0 && f == 0 || c == 0 && f == l - 1 || c == l - 1 && f == 0 || this.drawAlignmentPattern(i[c], i[f]);
|
|
1234
1331
|
this.drawFormatBits(0), this.drawVersion();
|
|
1235
1332
|
}
|
|
1236
1333
|
// Draws two copies of the format bits (with its own error correction code)
|
|
1237
1334
|
// based on the given mask and this object's error correction level field.
|
|
1238
1335
|
drawFormatBits(i) {
|
|
1239
|
-
const
|
|
1240
|
-
let c =
|
|
1336
|
+
const l = this.errorCorrectionLevel.formatBits << 3 | i;
|
|
1337
|
+
let c = l;
|
|
1241
1338
|
for (let h = 0; h < 10; h++)
|
|
1242
1339
|
c = c << 1 ^ (c >>> 9) * 1335;
|
|
1243
|
-
const f = (
|
|
1340
|
+
const f = (l << 10 | c) ^ 21522;
|
|
1244
1341
|
n(f >>> 15 == 0);
|
|
1245
1342
|
for (let h = 0; h <= 5; h++)
|
|
1246
1343
|
this.setFunctionModule(8, h, s(f, h));
|
|
@@ -1261,72 +1358,72 @@ var ue;
|
|
|
1261
1358
|
let i = this.version;
|
|
1262
1359
|
for (let c = 0; c < 12; c++)
|
|
1263
1360
|
i = i << 1 ^ (i >>> 11) * 7973;
|
|
1264
|
-
const
|
|
1265
|
-
n(
|
|
1361
|
+
const l = this.version << 12 | i;
|
|
1362
|
+
n(l >>> 18 == 0);
|
|
1266
1363
|
for (let c = 0; c < 18; c++) {
|
|
1267
|
-
const f = s(
|
|
1364
|
+
const f = s(l, c), h = this.size - 11 + c % 3, p = Math.floor(c / 3);
|
|
1268
1365
|
this.setFunctionModule(h, p, f), this.setFunctionModule(p, h, f);
|
|
1269
1366
|
}
|
|
1270
1367
|
}
|
|
1271
1368
|
// Draws a 9*9 finder pattern including the border separator,
|
|
1272
1369
|
// with the center module at (x, y). Modules can be out of bounds.
|
|
1273
|
-
drawFinderPattern(i,
|
|
1370
|
+
drawFinderPattern(i, l) {
|
|
1274
1371
|
for (let c = -4; c <= 4; c++)
|
|
1275
1372
|
for (let f = -4; f <= 4; f++) {
|
|
1276
|
-
const h = Math.max(Math.abs(f), Math.abs(c)), p = i + f, v =
|
|
1373
|
+
const h = Math.max(Math.abs(f), Math.abs(c)), p = i + f, v = l + c;
|
|
1277
1374
|
0 <= p && p < this.size && 0 <= v && v < this.size && this.setFunctionModule(p, v, h != 2 && h != 4);
|
|
1278
1375
|
}
|
|
1279
1376
|
}
|
|
1280
1377
|
// Draws a 5*5 alignment pattern, with the center module
|
|
1281
1378
|
// at (x, y). All modules must be in bounds.
|
|
1282
|
-
drawAlignmentPattern(i,
|
|
1379
|
+
drawAlignmentPattern(i, l) {
|
|
1283
1380
|
for (let c = -2; c <= 2; c++)
|
|
1284
1381
|
for (let f = -2; f <= 2; f++)
|
|
1285
|
-
this.setFunctionModule(i + f,
|
|
1382
|
+
this.setFunctionModule(i + f, l + c, Math.max(Math.abs(f), Math.abs(c)) != 1);
|
|
1286
1383
|
}
|
|
1287
1384
|
// Sets the color of a module and marks it as a function module.
|
|
1288
1385
|
// Only used by the constructor. Coordinates must be in bounds.
|
|
1289
|
-
setFunctionModule(i,
|
|
1290
|
-
this.modules[
|
|
1386
|
+
setFunctionModule(i, l, c) {
|
|
1387
|
+
this.modules[l][i] = c, this.isFunction[l][i] = !0;
|
|
1291
1388
|
}
|
|
1292
1389
|
/*-- Private helper methods for constructor: Codewords and masking --*/
|
|
1293
1390
|
// Returns a new byte string representing the given data with the appropriate error correction
|
|
1294
1391
|
// codewords appended to it, based on this object's version and error correction level.
|
|
1295
1392
|
addEccAndInterleave(i) {
|
|
1296
|
-
const
|
|
1297
|
-
if (i.length != S.getNumDataCodewords(
|
|
1393
|
+
const l = this.version, c = this.errorCorrectionLevel;
|
|
1394
|
+
if (i.length != S.getNumDataCodewords(l, c))
|
|
1298
1395
|
throw new RangeError("Invalid argument");
|
|
1299
|
-
const f = S.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][
|
|
1300
|
-
let
|
|
1396
|
+
const f = S.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][l], h = S.ECC_CODEWORDS_PER_BLOCK[c.ordinal][l], p = Math.floor(S.getNumRawDataModules(l) / 8), v = f - p % f, w = Math.floor(p / f);
|
|
1397
|
+
let x = [];
|
|
1301
1398
|
const M = S.reedSolomonComputeDivisor(h);
|
|
1302
|
-
for (let
|
|
1303
|
-
let L = i.slice(I, I + w - h + (
|
|
1399
|
+
for (let j = 0, I = 0; j < f; j++) {
|
|
1400
|
+
let L = i.slice(I, I + w - h + (j < v ? 0 : 1));
|
|
1304
1401
|
I += L.length;
|
|
1305
1402
|
const O = S.reedSolomonComputeRemainder(L, M);
|
|
1306
|
-
|
|
1403
|
+
j < v && L.push(0), x.push(L.concat(O));
|
|
1307
1404
|
}
|
|
1308
|
-
let
|
|
1309
|
-
for (let
|
|
1310
|
-
|
|
1311
|
-
(
|
|
1405
|
+
let A = [];
|
|
1406
|
+
for (let j = 0; j < x[0].length; j++)
|
|
1407
|
+
x.forEach((I, L) => {
|
|
1408
|
+
(j != w - h || L >= v) && A.push(I[j]);
|
|
1312
1409
|
});
|
|
1313
|
-
return n(
|
|
1410
|
+
return n(A.length == p), A;
|
|
1314
1411
|
}
|
|
1315
1412
|
// Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
|
|
1316
1413
|
// data area of this QR Code. Function modules need to be marked off before this is called.
|
|
1317
1414
|
drawCodewords(i) {
|
|
1318
1415
|
if (i.length != Math.floor(S.getNumRawDataModules(this.version) / 8))
|
|
1319
1416
|
throw new RangeError("Invalid argument");
|
|
1320
|
-
let
|
|
1417
|
+
let l = 0;
|
|
1321
1418
|
for (let c = this.size - 1; c >= 1; c -= 2) {
|
|
1322
1419
|
c == 6 && (c = 5);
|
|
1323
1420
|
for (let f = 0; f < this.size; f++)
|
|
1324
1421
|
for (let h = 0; h < 2; h++) {
|
|
1325
1422
|
const p = c - h, w = (c + 1 & 2) == 0 ? this.size - 1 - f : f;
|
|
1326
|
-
!this.isFunction[w][p] &&
|
|
1423
|
+
!this.isFunction[w][p] && l < i.length * 8 && (this.modules[w][p] = s(i[l >>> 3], 7 - (l & 7)), l++);
|
|
1327
1424
|
}
|
|
1328
1425
|
}
|
|
1329
|
-
n(
|
|
1426
|
+
n(l == i.length * 8);
|
|
1330
1427
|
}
|
|
1331
1428
|
// XORs the codeword modules in this QR Code with the given mask pattern.
|
|
1332
1429
|
// The function modules must be marked and the codeword bits must be drawn
|
|
@@ -1336,38 +1433,38 @@ var ue;
|
|
|
1336
1433
|
applyMask(i) {
|
|
1337
1434
|
if (i < 0 || i > 7)
|
|
1338
1435
|
throw new RangeError("Mask value out of range");
|
|
1339
|
-
for (let
|
|
1436
|
+
for (let l = 0; l < this.size; l++)
|
|
1340
1437
|
for (let c = 0; c < this.size; c++) {
|
|
1341
1438
|
let f;
|
|
1342
1439
|
switch (i) {
|
|
1343
1440
|
case 0:
|
|
1344
|
-
f = (c +
|
|
1441
|
+
f = (c + l) % 2 == 0;
|
|
1345
1442
|
break;
|
|
1346
1443
|
case 1:
|
|
1347
|
-
f =
|
|
1444
|
+
f = l % 2 == 0;
|
|
1348
1445
|
break;
|
|
1349
1446
|
case 2:
|
|
1350
1447
|
f = c % 3 == 0;
|
|
1351
1448
|
break;
|
|
1352
1449
|
case 3:
|
|
1353
|
-
f = (c +
|
|
1450
|
+
f = (c + l) % 3 == 0;
|
|
1354
1451
|
break;
|
|
1355
1452
|
case 4:
|
|
1356
|
-
f = (Math.floor(c / 3) + Math.floor(
|
|
1453
|
+
f = (Math.floor(c / 3) + Math.floor(l / 2)) % 2 == 0;
|
|
1357
1454
|
break;
|
|
1358
1455
|
case 5:
|
|
1359
|
-
f = c *
|
|
1456
|
+
f = c * l % 2 + c * l % 3 == 0;
|
|
1360
1457
|
break;
|
|
1361
1458
|
case 6:
|
|
1362
|
-
f = (c *
|
|
1459
|
+
f = (c * l % 2 + c * l % 3) % 2 == 0;
|
|
1363
1460
|
break;
|
|
1364
1461
|
case 7:
|
|
1365
|
-
f = ((c +
|
|
1462
|
+
f = ((c + l) % 2 + c * l % 3) % 2 == 0;
|
|
1366
1463
|
break;
|
|
1367
1464
|
default:
|
|
1368
1465
|
throw new Error("Unreachable");
|
|
1369
1466
|
}
|
|
1370
|
-
!this.isFunction[
|
|
1467
|
+
!this.isFunction[l][c] && f && (this.modules[l][c] = !this.modules[l][c]);
|
|
1371
1468
|
}
|
|
1372
1469
|
}
|
|
1373
1470
|
// Calculates and returns the penalty score based on state of this QR Code's current modules.
|
|
@@ -1376,14 +1473,14 @@ var ue;
|
|
|
1376
1473
|
let i = 0;
|
|
1377
1474
|
for (let h = 0; h < this.size; h++) {
|
|
1378
1475
|
let p = !1, v = 0, w = [0, 0, 0, 0, 0, 0, 0];
|
|
1379
|
-
for (let
|
|
1380
|
-
this.modules[h][
|
|
1476
|
+
for (let x = 0; x < this.size; x++)
|
|
1477
|
+
this.modules[h][x] == p ? (v++, v == 5 ? i += S.PENALTY_N1 : v > 5 && i++) : (this.finderPenaltyAddHistory(v, w), p || (i += this.finderPenaltyCountPatterns(w) * S.PENALTY_N3), p = this.modules[h][x], v = 1);
|
|
1381
1478
|
i += this.finderPenaltyTerminateAndCount(p, v, w) * S.PENALTY_N3;
|
|
1382
1479
|
}
|
|
1383
1480
|
for (let h = 0; h < this.size; h++) {
|
|
1384
1481
|
let p = !1, v = 0, w = [0, 0, 0, 0, 0, 0, 0];
|
|
1385
|
-
for (let
|
|
1386
|
-
this.modules[
|
|
1482
|
+
for (let x = 0; x < this.size; x++)
|
|
1483
|
+
this.modules[x][h] == p ? (v++, v == 5 ? i += S.PENALTY_N1 : v > 5 && i++) : (this.finderPenaltyAddHistory(v, w), p || (i += this.finderPenaltyCountPatterns(w) * S.PENALTY_N3), p = this.modules[x][h], v = 1);
|
|
1387
1484
|
i += this.finderPenaltyTerminateAndCount(p, v, w) * S.PENALTY_N3;
|
|
1388
1485
|
}
|
|
1389
1486
|
for (let h = 0; h < this.size - 1; h++)
|
|
@@ -1391,10 +1488,10 @@ var ue;
|
|
|
1391
1488
|
const v = this.modules[h][p];
|
|
1392
1489
|
v == this.modules[h][p + 1] && v == this.modules[h + 1][p] && v == this.modules[h + 1][p + 1] && (i += S.PENALTY_N2);
|
|
1393
1490
|
}
|
|
1394
|
-
let
|
|
1491
|
+
let l = 0;
|
|
1395
1492
|
for (const h of this.modules)
|
|
1396
|
-
|
|
1397
|
-
const c = this.size * this.size, f = Math.ceil(Math.abs(
|
|
1493
|
+
l = h.reduce((p, v) => p + (v ? 1 : 0), l);
|
|
1494
|
+
const c = this.size * this.size, f = Math.ceil(Math.abs(l * 20 - c * 10) / c) - 1;
|
|
1398
1495
|
return n(0 <= f && f <= 9), i += f * S.PENALTY_N4, n(0 <= i && i <= 2568888), i;
|
|
1399
1496
|
}
|
|
1400
1497
|
/*-- Private helper functions --*/
|
|
@@ -1405,9 +1502,9 @@ var ue;
|
|
|
1405
1502
|
if (this.version == 1)
|
|
1406
1503
|
return [];
|
|
1407
1504
|
{
|
|
1408
|
-
const i = Math.floor(this.version / 7) + 2,
|
|
1505
|
+
const i = Math.floor(this.version / 7) + 2, l = this.version == 32 ? 26 : Math.ceil((this.version * 4 + 4) / (i * 2 - 2)) * 2;
|
|
1409
1506
|
let c = [6];
|
|
1410
|
-
for (let f = this.size - 7; c.length < i; f -=
|
|
1507
|
+
for (let f = this.size - 7; c.length < i; f -= l)
|
|
1411
1508
|
c.splice(1, 0, f);
|
|
1412
1509
|
return c;
|
|
1413
1510
|
}
|
|
@@ -1418,70 +1515,70 @@ var ue;
|
|
|
1418
1515
|
static getNumRawDataModules(i) {
|
|
1419
1516
|
if (i < S.MIN_VERSION || i > S.MAX_VERSION)
|
|
1420
1517
|
throw new RangeError("Version number out of range");
|
|
1421
|
-
let
|
|
1518
|
+
let l = (16 * i + 128) * i + 64;
|
|
1422
1519
|
if (i >= 2) {
|
|
1423
1520
|
const c = Math.floor(i / 7) + 2;
|
|
1424
|
-
|
|
1521
|
+
l -= (25 * c - 10) * c - 55, i >= 7 && (l -= 36);
|
|
1425
1522
|
}
|
|
1426
|
-
return n(208 <=
|
|
1523
|
+
return n(208 <= l && l <= 29648), l;
|
|
1427
1524
|
}
|
|
1428
1525
|
// Returns the number of 8-bit data (i.e. not error correction) codewords contained in any
|
|
1429
1526
|
// QR Code of the given version number and error correction level, with remainder bits discarded.
|
|
1430
1527
|
// This stateless pure function could be implemented as a (40*4)-cell lookup table.
|
|
1431
|
-
static getNumDataCodewords(i,
|
|
1432
|
-
return Math.floor(S.getNumRawDataModules(i) / 8) - S.ECC_CODEWORDS_PER_BLOCK[
|
|
1528
|
+
static getNumDataCodewords(i, l) {
|
|
1529
|
+
return Math.floor(S.getNumRawDataModules(i) / 8) - S.ECC_CODEWORDS_PER_BLOCK[l.ordinal][i] * S.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][i];
|
|
1433
1530
|
}
|
|
1434
1531
|
// Returns a Reed-Solomon ECC generator polynomial for the given degree. This could be
|
|
1435
1532
|
// implemented as a lookup table over all possible parameter values, instead of as an algorithm.
|
|
1436
1533
|
static reedSolomonComputeDivisor(i) {
|
|
1437
1534
|
if (i < 1 || i > 255)
|
|
1438
1535
|
throw new RangeError("Degree out of range");
|
|
1439
|
-
let
|
|
1536
|
+
let l = [];
|
|
1440
1537
|
for (let f = 0; f < i - 1; f++)
|
|
1441
|
-
|
|
1442
|
-
|
|
1538
|
+
l.push(0);
|
|
1539
|
+
l.push(1);
|
|
1443
1540
|
let c = 1;
|
|
1444
1541
|
for (let f = 0; f < i; f++) {
|
|
1445
|
-
for (let h = 0; h <
|
|
1446
|
-
|
|
1542
|
+
for (let h = 0; h < l.length; h++)
|
|
1543
|
+
l[h] = S.reedSolomonMultiply(l[h], c), h + 1 < l.length && (l[h] ^= l[h + 1]);
|
|
1447
1544
|
c = S.reedSolomonMultiply(c, 2);
|
|
1448
1545
|
}
|
|
1449
|
-
return
|
|
1546
|
+
return l;
|
|
1450
1547
|
}
|
|
1451
1548
|
// Returns the Reed-Solomon error correction codeword for the given data and divisor polynomials.
|
|
1452
|
-
static reedSolomonComputeRemainder(i,
|
|
1453
|
-
let c =
|
|
1549
|
+
static reedSolomonComputeRemainder(i, l) {
|
|
1550
|
+
let c = l.map((f) => 0);
|
|
1454
1551
|
for (const f of i) {
|
|
1455
1552
|
const h = f ^ c.shift();
|
|
1456
|
-
c.push(0),
|
|
1553
|
+
c.push(0), l.forEach((p, v) => c[v] ^= S.reedSolomonMultiply(p, h));
|
|
1457
1554
|
}
|
|
1458
1555
|
return c;
|
|
1459
1556
|
}
|
|
1460
1557
|
// Returns the product of the two given field elements modulo GF(2^8/0x11D). The arguments and result
|
|
1461
1558
|
// are unsigned 8-bit integers. This could be implemented as a lookup table of 256*256 entries of uint8.
|
|
1462
|
-
static reedSolomonMultiply(i,
|
|
1463
|
-
if (i >>> 8 ||
|
|
1559
|
+
static reedSolomonMultiply(i, l) {
|
|
1560
|
+
if (i >>> 8 || l >>> 8)
|
|
1464
1561
|
throw new RangeError("Byte out of range");
|
|
1465
1562
|
let c = 0;
|
|
1466
1563
|
for (let f = 7; f >= 0; f--)
|
|
1467
|
-
c = c << 1 ^ (c >>> 7) * 285, c ^= (
|
|
1564
|
+
c = c << 1 ^ (c >>> 7) * 285, c ^= (l >>> f & 1) * i;
|
|
1468
1565
|
return n(c >>> 8 == 0), c;
|
|
1469
1566
|
}
|
|
1470
1567
|
// Can only be called immediately after a light run is added, and
|
|
1471
1568
|
// returns either 0, 1, or 2. A helper function for getPenaltyScore().
|
|
1472
1569
|
finderPenaltyCountPatterns(i) {
|
|
1473
|
-
const
|
|
1474
|
-
n(
|
|
1475
|
-
const c =
|
|
1476
|
-
return (c && i[0] >=
|
|
1570
|
+
const l = i[1];
|
|
1571
|
+
n(l <= this.size * 3);
|
|
1572
|
+
const c = l > 0 && i[2] == l && i[3] == l * 3 && i[4] == l && i[5] == l;
|
|
1573
|
+
return (c && i[0] >= l * 4 && i[6] >= l ? 1 : 0) + (c && i[6] >= l * 4 && i[0] >= l ? 1 : 0);
|
|
1477
1574
|
}
|
|
1478
1575
|
// Must be called at the end of a line (row or column) of modules. A helper function for getPenaltyScore().
|
|
1479
|
-
finderPenaltyTerminateAndCount(i,
|
|
1480
|
-
return i && (this.finderPenaltyAddHistory(
|
|
1576
|
+
finderPenaltyTerminateAndCount(i, l, c) {
|
|
1577
|
+
return i && (this.finderPenaltyAddHistory(l, c), l = 0), l += this.size, this.finderPenaltyAddHistory(l, c), this.finderPenaltyCountPatterns(c);
|
|
1481
1578
|
}
|
|
1482
1579
|
// Pushes the given value to the front and drops the last value. A helper function for getPenaltyScore().
|
|
1483
|
-
finderPenaltyAddHistory(i,
|
|
1484
|
-
|
|
1580
|
+
finderPenaltyAddHistory(i, l) {
|
|
1581
|
+
l[0] == 0 && (i += this.size), l.pop(), l.unshift(i);
|
|
1485
1582
|
}
|
|
1486
1583
|
};
|
|
1487
1584
|
e.MIN_VERSION = 1, e.MAX_VERSION = 40, e.PENALTY_N1 = 3, e.PENALTY_N2 = 3, e.PENALTY_N3 = 40, e.PENALTY_N4 = 10, e.ECC_CODEWORDS_PER_BLOCK = [
|
|
@@ -1507,11 +1604,11 @@ var ue;
|
|
|
1507
1604
|
[-1, 1, 1, 2, 4, 4, 4, 5, 6, 8, 8, 11, 11, 16, 16, 18, 16, 19, 21, 25, 25, 25, 34, 30, 32, 35, 37, 40, 42, 45, 48, 51, 54, 57, 60, 63, 66, 70, 74, 77, 81]
|
|
1508
1605
|
// High
|
|
1509
1606
|
], r.QrCode = e;
|
|
1510
|
-
function t(u, i,
|
|
1607
|
+
function t(u, i, l) {
|
|
1511
1608
|
if (i < 0 || i > 31 || u >>> i)
|
|
1512
1609
|
throw new RangeError("Value out of range");
|
|
1513
1610
|
for (let c = i - 1; c >= 0; c--)
|
|
1514
|
-
|
|
1611
|
+
l.push(u >>> c & 1);
|
|
1515
1612
|
}
|
|
1516
1613
|
function s(u, i) {
|
|
1517
1614
|
return (u >>> i & 1) != 0;
|
|
@@ -1520,13 +1617,13 @@ var ue;
|
|
|
1520
1617
|
if (!u)
|
|
1521
1618
|
throw new Error("Assertion error");
|
|
1522
1619
|
}
|
|
1523
|
-
const a = class
|
|
1620
|
+
const a = class F {
|
|
1524
1621
|
/*-- Constructor (low level) and fields --*/
|
|
1525
1622
|
// Creates a new QR Code segment with the given attributes and data.
|
|
1526
1623
|
// The character count (numChars) must agree with the mode and the bit buffer length,
|
|
1527
1624
|
// but the constraint isn't checked. The given bit buffer is cloned and stored.
|
|
1528
|
-
constructor(i,
|
|
1529
|
-
if (this.mode = i, this.numChars =
|
|
1625
|
+
constructor(i, l, c) {
|
|
1626
|
+
if (this.mode = i, this.numChars = l, this.bitData = c, l < 0)
|
|
1530
1627
|
throw new RangeError("Invalid argument");
|
|
1531
1628
|
this.bitData = c.slice();
|
|
1532
1629
|
}
|
|
@@ -1535,66 +1632,66 @@ var ue;
|
|
|
1535
1632
|
// byte mode. All input byte arrays are acceptable. Any text string
|
|
1536
1633
|
// can be converted to UTF-8 bytes and encoded as a byte mode segment.
|
|
1537
1634
|
static makeBytes(i) {
|
|
1538
|
-
let
|
|
1635
|
+
let l = [];
|
|
1539
1636
|
for (const c of i)
|
|
1540
|
-
t(c, 8,
|
|
1541
|
-
return new
|
|
1637
|
+
t(c, 8, l);
|
|
1638
|
+
return new F(F.Mode.BYTE, i.length, l);
|
|
1542
1639
|
}
|
|
1543
1640
|
// Returns a segment representing the given string of decimal digits encoded in numeric mode.
|
|
1544
1641
|
static makeNumeric(i) {
|
|
1545
|
-
if (!
|
|
1642
|
+
if (!F.isNumeric(i))
|
|
1546
1643
|
throw new RangeError("String contains non-numeric characters");
|
|
1547
|
-
let
|
|
1644
|
+
let l = [];
|
|
1548
1645
|
for (let c = 0; c < i.length; ) {
|
|
1549
1646
|
const f = Math.min(i.length - c, 3);
|
|
1550
|
-
t(parseInt(i.substring(c, c + f), 10), f * 3 + 1,
|
|
1647
|
+
t(parseInt(i.substring(c, c + f), 10), f * 3 + 1, l), c += f;
|
|
1551
1648
|
}
|
|
1552
|
-
return new
|
|
1649
|
+
return new F(F.Mode.NUMERIC, i.length, l);
|
|
1553
1650
|
}
|
|
1554
1651
|
// Returns a segment representing the given text string encoded in alphanumeric mode.
|
|
1555
1652
|
// The characters allowed are: 0 to 9, A to Z (uppercase only), space,
|
|
1556
1653
|
// dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
1557
1654
|
static makeAlphanumeric(i) {
|
|
1558
|
-
if (!
|
|
1655
|
+
if (!F.isAlphanumeric(i))
|
|
1559
1656
|
throw new RangeError("String contains unencodable characters in alphanumeric mode");
|
|
1560
|
-
let
|
|
1657
|
+
let l = [], c;
|
|
1561
1658
|
for (c = 0; c + 2 <= i.length; c += 2) {
|
|
1562
|
-
let f =
|
|
1563
|
-
f +=
|
|
1659
|
+
let f = F.ALPHANUMERIC_CHARSET.indexOf(i.charAt(c)) * 45;
|
|
1660
|
+
f += F.ALPHANUMERIC_CHARSET.indexOf(i.charAt(c + 1)), t(f, 11, l);
|
|
1564
1661
|
}
|
|
1565
|
-
return c < i.length && t(
|
|
1662
|
+
return c < i.length && t(F.ALPHANUMERIC_CHARSET.indexOf(i.charAt(c)), 6, l), new F(F.Mode.ALPHANUMERIC, i.length, l);
|
|
1566
1663
|
}
|
|
1567
1664
|
// Returns a new mutable list of zero or more segments to represent the given Unicode text string.
|
|
1568
1665
|
// The result may use various segment modes and switch modes to optimize the length of the bit stream.
|
|
1569
1666
|
static makeSegments(i) {
|
|
1570
|
-
return i == "" ? [] :
|
|
1667
|
+
return i == "" ? [] : F.isNumeric(i) ? [F.makeNumeric(i)] : F.isAlphanumeric(i) ? [F.makeAlphanumeric(i)] : [F.makeBytes(F.toUtf8ByteArray(i))];
|
|
1571
1668
|
}
|
|
1572
1669
|
// Returns a segment representing an Extended Channel Interpretation
|
|
1573
1670
|
// (ECI) designator with the given assignment value.
|
|
1574
1671
|
static makeEci(i) {
|
|
1575
|
-
let
|
|
1672
|
+
let l = [];
|
|
1576
1673
|
if (i < 0)
|
|
1577
1674
|
throw new RangeError("ECI assignment value out of range");
|
|
1578
1675
|
if (i < 128)
|
|
1579
|
-
t(i, 8,
|
|
1676
|
+
t(i, 8, l);
|
|
1580
1677
|
else if (i < 16384)
|
|
1581
|
-
t(2, 2,
|
|
1678
|
+
t(2, 2, l), t(i, 14, l);
|
|
1582
1679
|
else if (i < 1e6)
|
|
1583
|
-
t(6, 3,
|
|
1680
|
+
t(6, 3, l), t(i, 21, l);
|
|
1584
1681
|
else
|
|
1585
1682
|
throw new RangeError("ECI assignment value out of range");
|
|
1586
|
-
return new
|
|
1683
|
+
return new F(F.Mode.ECI, 0, l);
|
|
1587
1684
|
}
|
|
1588
1685
|
// Tests whether the given string can be encoded as a segment in numeric mode.
|
|
1589
1686
|
// A string is encodable iff each character is in the range 0 to 9.
|
|
1590
1687
|
static isNumeric(i) {
|
|
1591
|
-
return
|
|
1688
|
+
return F.NUMERIC_REGEX.test(i);
|
|
1592
1689
|
}
|
|
1593
1690
|
// Tests whether the given string can be encoded as a segment in alphanumeric mode.
|
|
1594
1691
|
// A string is encodable iff each character is in the following set: 0 to 9, A to Z
|
|
1595
1692
|
// (uppercase only), space, dollar, percent, asterisk, plus, hyphen, period, slash, colon.
|
|
1596
1693
|
static isAlphanumeric(i) {
|
|
1597
|
-
return
|
|
1694
|
+
return F.ALPHANUMERIC_REGEX.test(i);
|
|
1598
1695
|
}
|
|
1599
1696
|
/*-- Methods --*/
|
|
1600
1697
|
// Returns a new copy of the data bits of this segment.
|
|
@@ -1603,10 +1700,10 @@ var ue;
|
|
|
1603
1700
|
}
|
|
1604
1701
|
// (Package-private) Calculates and returns the number of bits needed to encode the given segments at
|
|
1605
1702
|
// the given version. The result is infinity if a segment has too many characters to fit its length field.
|
|
1606
|
-
static getTotalBits(i,
|
|
1703
|
+
static getTotalBits(i, l) {
|
|
1607
1704
|
let c = 0;
|
|
1608
1705
|
for (const f of i) {
|
|
1609
|
-
const h = f.mode.numCharCountBits(
|
|
1706
|
+
const h = f.mode.numCharCountBits(l);
|
|
1610
1707
|
if (f.numChars >= 1 << h)
|
|
1611
1708
|
return 1 / 0;
|
|
1612
1709
|
c += 4 + h + f.bitData.length;
|
|
@@ -1616,10 +1713,10 @@ var ue;
|
|
|
1616
1713
|
// Returns a new array of bytes representing the given string encoded in UTF-8.
|
|
1617
1714
|
static toUtf8ByteArray(i) {
|
|
1618
1715
|
i = encodeURI(i);
|
|
1619
|
-
let
|
|
1716
|
+
let l = [];
|
|
1620
1717
|
for (let c = 0; c < i.length; c++)
|
|
1621
|
-
i.charAt(c) != "%" ?
|
|
1622
|
-
return
|
|
1718
|
+
i.charAt(c) != "%" ? l.push(i.charCodeAt(c)) : (l.push(parseInt(i.substring(c + 1, c + 3), 16)), c += 2);
|
|
1719
|
+
return l;
|
|
1623
1720
|
}
|
|
1624
1721
|
};
|
|
1625
1722
|
a.NUMERIC_REGEX = /^[0-9]*$/, a.ALPHANUMERIC_REGEX = /^[A-Z0-9 $%*+.\/:-]*$/, a.ALPHANUMERIC_CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";
|
|
@@ -1656,13 +1753,13 @@ var ue;
|
|
|
1656
1753
|
})(r.QrSegment || (r.QrSegment = {}));
|
|
1657
1754
|
})(ue || (ue = {}));
|
|
1658
1755
|
var ve = ue;
|
|
1659
|
-
var
|
|
1756
|
+
var ws = {
|
|
1660
1757
|
L: ve.QrCode.Ecc.LOW,
|
|
1661
1758
|
M: ve.QrCode.Ecc.MEDIUM,
|
|
1662
1759
|
Q: ve.QrCode.Ecc.QUARTILE,
|
|
1663
1760
|
H: ve.QrCode.Ecc.HIGH
|
|
1664
|
-
},
|
|
1665
|
-
function
|
|
1761
|
+
}, Kt = 128, er = "L", tr = "#FFFFFF", rr = "#000000", sr = !1, nr = 1, js = 4, Ns = 0, ks = 0.1;
|
|
1762
|
+
function ar(r, e = 0) {
|
|
1666
1763
|
const t = [];
|
|
1667
1764
|
return r.forEach(function(s, n) {
|
|
1668
1765
|
let a = null;
|
|
@@ -1685,25 +1782,25 @@ function Xt(r, e = 0) {
|
|
|
1685
1782
|
});
|
|
1686
1783
|
}), t.join("");
|
|
1687
1784
|
}
|
|
1688
|
-
function
|
|
1785
|
+
function ir(r, e) {
|
|
1689
1786
|
return r.slice().map((t, s) => s < e.y || s >= e.y + e.h ? t : t.map((n, a) => a < e.x || a >= e.x + e.w ? n : !1));
|
|
1690
1787
|
}
|
|
1691
|
-
function
|
|
1788
|
+
function Es(r, e, t, s) {
|
|
1692
1789
|
if (s == null)
|
|
1693
1790
|
return null;
|
|
1694
|
-
const n = r.length + t * 2, a = Math.floor(e *
|
|
1791
|
+
const n = r.length + t * 2, a = Math.floor(e * ks), d = n / e, u = (s.width || a) * d, i = (s.height || a) * d, l = s.x == null ? r.length / 2 - u / 2 : s.x * d, c = s.y == null ? r.length / 2 - i / 2 : s.y * d, f = s.opacity == null ? 1 : s.opacity;
|
|
1695
1792
|
let h = null;
|
|
1696
1793
|
if (s.excavate) {
|
|
1697
|
-
let v = Math.floor(
|
|
1698
|
-
h = { x: v, y: w, w:
|
|
1794
|
+
let v = Math.floor(l), w = Math.floor(c), x = Math.ceil(u + l - v), M = Math.ceil(i + c - w);
|
|
1795
|
+
h = { x: v, y: w, w: x, h: M };
|
|
1699
1796
|
}
|
|
1700
1797
|
const p = s.crossOrigin;
|
|
1701
|
-
return { x:
|
|
1798
|
+
return { x: l, y: c, h: i, w: u, excavation: h, opacity: f, crossOrigin: p };
|
|
1702
1799
|
}
|
|
1703
|
-
function
|
|
1704
|
-
return e != null ? Math.max(Math.floor(e), 0) : r ?
|
|
1800
|
+
function Cs(r, e) {
|
|
1801
|
+
return e != null ? Math.max(Math.floor(e), 0) : r ? js : Ns;
|
|
1705
1802
|
}
|
|
1706
|
-
function
|
|
1803
|
+
function or({
|
|
1707
1804
|
value: r,
|
|
1708
1805
|
level: e,
|
|
1709
1806
|
minVersion: t,
|
|
@@ -1713,20 +1810,20 @@ function er({
|
|
|
1713
1810
|
size: d,
|
|
1714
1811
|
boostLevel: u
|
|
1715
1812
|
}) {
|
|
1716
|
-
let i =
|
|
1717
|
-
const v = (Array.isArray(r) ? r : [r]).reduce((w,
|
|
1813
|
+
let i = D.useMemo(() => {
|
|
1814
|
+
const v = (Array.isArray(r) ? r : [r]).reduce((w, x) => (w.push(...ve.QrSegment.makeSegments(x)), w), []);
|
|
1718
1815
|
return ve.QrCode.encodeSegments(
|
|
1719
1816
|
v,
|
|
1720
|
-
|
|
1817
|
+
ws[e],
|
|
1721
1818
|
t,
|
|
1722
1819
|
void 0,
|
|
1723
1820
|
void 0,
|
|
1724
1821
|
u
|
|
1725
1822
|
);
|
|
1726
1823
|
}, [r, e, t, u]);
|
|
1727
|
-
const { cells:
|
|
1824
|
+
const { cells: l, margin: c, numCells: f, calculatedImageSettings: h } = D.useMemo(() => {
|
|
1728
1825
|
let p = i.getModules();
|
|
1729
|
-
const v =
|
|
1826
|
+
const v = Cs(s, n), w = p.length + v * 2, x = Es(
|
|
1730
1827
|
p,
|
|
1731
1828
|
d,
|
|
1732
1829
|
v,
|
|
@@ -1736,38 +1833,38 @@ function er({
|
|
|
1736
1833
|
cells: p,
|
|
1737
1834
|
margin: v,
|
|
1738
1835
|
numCells: w,
|
|
1739
|
-
calculatedImageSettings:
|
|
1836
|
+
calculatedImageSettings: x
|
|
1740
1837
|
};
|
|
1741
1838
|
}, [i, d, a, s, n]);
|
|
1742
1839
|
return {
|
|
1743
1840
|
qrcode: i,
|
|
1744
1841
|
margin: c,
|
|
1745
|
-
cells:
|
|
1842
|
+
cells: l,
|
|
1746
1843
|
numCells: f,
|
|
1747
1844
|
calculatedImageSettings: h
|
|
1748
1845
|
};
|
|
1749
1846
|
}
|
|
1750
|
-
var
|
|
1847
|
+
var Ss = (function() {
|
|
1751
1848
|
try {
|
|
1752
1849
|
new Path2D().addPath(new Path2D());
|
|
1753
1850
|
} catch {
|
|
1754
1851
|
return !1;
|
|
1755
1852
|
}
|
|
1756
1853
|
return !0;
|
|
1757
|
-
})(),
|
|
1854
|
+
})(), As = D.forwardRef(
|
|
1758
1855
|
function(e, t) {
|
|
1759
1856
|
const s = e, {
|
|
1760
1857
|
value: n,
|
|
1761
|
-
size: a =
|
|
1762
|
-
level: d =
|
|
1763
|
-
bgColor: u =
|
|
1764
|
-
fgColor: i =
|
|
1765
|
-
includeMargin:
|
|
1766
|
-
minVersion: c =
|
|
1858
|
+
size: a = Kt,
|
|
1859
|
+
level: d = er,
|
|
1860
|
+
bgColor: u = tr,
|
|
1861
|
+
fgColor: i = rr,
|
|
1862
|
+
includeMargin: l = sr,
|
|
1863
|
+
minVersion: c = nr,
|
|
1767
1864
|
boostLevel: f,
|
|
1768
1865
|
marginSize: h,
|
|
1769
1866
|
imageSettings: p
|
|
1770
|
-
} = s, w =
|
|
1867
|
+
} = s, w = st(s, [
|
|
1771
1868
|
"value",
|
|
1772
1869
|
"size",
|
|
1773
1870
|
"level",
|
|
@@ -1778,40 +1875,40 @@ var hs = (function() {
|
|
|
1778
1875
|
"boostLevel",
|
|
1779
1876
|
"marginSize",
|
|
1780
1877
|
"imageSettings"
|
|
1781
|
-
]), { style:
|
|
1782
|
-
(
|
|
1783
|
-
|
|
1878
|
+
]), { style: x } = w, M = st(w, ["style"]), A = p?.src, j = D.useRef(null), I = D.useRef(null), L = D.useCallback(
|
|
1879
|
+
(G) => {
|
|
1880
|
+
j.current = G, typeof t == "function" ? t(G) : t && (t.current = G);
|
|
1784
1881
|
},
|
|
1785
1882
|
[t]
|
|
1786
|
-
), [O, B] =
|
|
1883
|
+
), [O, B] = D.useState(!1), { margin: W, cells: H, numCells: de, calculatedImageSettings: q } = or({
|
|
1787
1884
|
value: n,
|
|
1788
1885
|
level: d,
|
|
1789
1886
|
minVersion: c,
|
|
1790
1887
|
boostLevel: f,
|
|
1791
|
-
includeMargin:
|
|
1888
|
+
includeMargin: l,
|
|
1792
1889
|
marginSize: h,
|
|
1793
1890
|
imageSettings: p,
|
|
1794
1891
|
size: a
|
|
1795
1892
|
});
|
|
1796
|
-
|
|
1797
|
-
if (
|
|
1798
|
-
const
|
|
1893
|
+
D.useEffect(() => {
|
|
1894
|
+
if (j.current != null) {
|
|
1895
|
+
const G = j.current, U = G.getContext("2d");
|
|
1799
1896
|
if (!U)
|
|
1800
1897
|
return;
|
|
1801
|
-
let
|
|
1802
|
-
const te = I.current,
|
|
1803
|
-
|
|
1804
|
-
|
|
1898
|
+
let ke = H;
|
|
1899
|
+
const te = I.current, Ee = q != null && te !== null && te.complete && te.naturalHeight !== 0 && te.naturalWidth !== 0;
|
|
1900
|
+
Ee && q.excavation != null && (ke = ir(
|
|
1901
|
+
H,
|
|
1805
1902
|
q.excavation
|
|
1806
1903
|
));
|
|
1807
|
-
const
|
|
1808
|
-
|
|
1809
|
-
const
|
|
1810
|
-
U.scale(
|
|
1811
|
-
m.forEach(function($,
|
|
1812
|
-
$ && U.fillRect(
|
|
1904
|
+
const Ce = window.devicePixelRatio || 1;
|
|
1905
|
+
G.height = G.width = a * Ce;
|
|
1906
|
+
const Se = a / de * Ce;
|
|
1907
|
+
U.scale(Se, Se), U.fillStyle = u, U.fillRect(0, 0, de, de), U.fillStyle = i, Ss ? U.fill(new Path2D(ar(ke, W))) : H.forEach(function(m, E) {
|
|
1908
|
+
m.forEach(function($, Z) {
|
|
1909
|
+
$ && U.fillRect(Z + W, E + W, 1, 1);
|
|
1813
1910
|
});
|
|
1814
|
-
}), q && (U.globalAlpha = q.opacity),
|
|
1911
|
+
}), q && (U.globalAlpha = q.opacity), Ee && U.drawImage(
|
|
1815
1912
|
te,
|
|
1816
1913
|
q.x + W,
|
|
1817
1914
|
q.y + W,
|
|
@@ -1819,16 +1916,16 @@ var hs = (function() {
|
|
|
1819
1916
|
q.h
|
|
1820
1917
|
);
|
|
1821
1918
|
}
|
|
1822
|
-
}),
|
|
1919
|
+
}), D.useEffect(() => {
|
|
1823
1920
|
B(!1);
|
|
1824
|
-
}, [
|
|
1825
|
-
const P =
|
|
1921
|
+
}, [A]);
|
|
1922
|
+
const P = rt({ height: a, width: a }, x);
|
|
1826
1923
|
let Y = null;
|
|
1827
|
-
return
|
|
1924
|
+
return A != null && (Y = /* @__PURE__ */ D.createElement(
|
|
1828
1925
|
"img",
|
|
1829
1926
|
{
|
|
1830
|
-
src:
|
|
1831
|
-
key:
|
|
1927
|
+
src: A,
|
|
1928
|
+
key: A,
|
|
1832
1929
|
style: { display: "none" },
|
|
1833
1930
|
onLoad: () => {
|
|
1834
1931
|
B(!0);
|
|
@@ -1836,9 +1933,9 @@ var hs = (function() {
|
|
|
1836
1933
|
ref: I,
|
|
1837
1934
|
crossOrigin: q?.crossOrigin
|
|
1838
1935
|
}
|
|
1839
|
-
)), /* @__PURE__ */
|
|
1936
|
+
)), /* @__PURE__ */ D.createElement(D.Fragment, null, /* @__PURE__ */ D.createElement(
|
|
1840
1937
|
"canvas",
|
|
1841
|
-
|
|
1938
|
+
rt({
|
|
1842
1939
|
style: P,
|
|
1843
1940
|
height: a,
|
|
1844
1941
|
width: a,
|
|
@@ -1848,22 +1945,22 @@ var hs = (function() {
|
|
|
1848
1945
|
), Y);
|
|
1849
1946
|
}
|
|
1850
1947
|
);
|
|
1851
|
-
|
|
1852
|
-
var
|
|
1948
|
+
As.displayName = "QRCodeCanvas";
|
|
1949
|
+
var lr = D.forwardRef(
|
|
1853
1950
|
function(e, t) {
|
|
1854
1951
|
const s = e, {
|
|
1855
1952
|
value: n,
|
|
1856
|
-
size: a =
|
|
1857
|
-
level: d =
|
|
1858
|
-
bgColor: u =
|
|
1859
|
-
fgColor: i =
|
|
1860
|
-
includeMargin:
|
|
1861
|
-
minVersion: c =
|
|
1953
|
+
size: a = Kt,
|
|
1954
|
+
level: d = er,
|
|
1955
|
+
bgColor: u = tr,
|
|
1956
|
+
fgColor: i = rr,
|
|
1957
|
+
includeMargin: l = sr,
|
|
1958
|
+
minVersion: c = nr,
|
|
1862
1959
|
boostLevel: f,
|
|
1863
1960
|
title: h,
|
|
1864
1961
|
marginSize: p,
|
|
1865
1962
|
imageSettings: v
|
|
1866
|
-
} = s, w =
|
|
1963
|
+
} = s, w = st(s, [
|
|
1867
1964
|
"value",
|
|
1868
1965
|
"size",
|
|
1869
1966
|
"level",
|
|
@@ -1875,59 +1972,59 @@ var tr = F.forwardRef(
|
|
|
1875
1972
|
"title",
|
|
1876
1973
|
"marginSize",
|
|
1877
1974
|
"imageSettings"
|
|
1878
|
-
]), { margin:
|
|
1975
|
+
]), { margin: x, cells: M, numCells: A, calculatedImageSettings: j } = or({
|
|
1879
1976
|
value: n,
|
|
1880
1977
|
level: d,
|
|
1881
1978
|
minVersion: c,
|
|
1882
1979
|
boostLevel: f,
|
|
1883
|
-
includeMargin:
|
|
1980
|
+
includeMargin: l,
|
|
1884
1981
|
marginSize: p,
|
|
1885
1982
|
imageSettings: v,
|
|
1886
1983
|
size: a
|
|
1887
1984
|
});
|
|
1888
1985
|
let I = M, L = null;
|
|
1889
|
-
v != null &&
|
|
1986
|
+
v != null && j != null && (j.excavation != null && (I = ir(
|
|
1890
1987
|
M,
|
|
1891
|
-
|
|
1892
|
-
)), L = /* @__PURE__ */
|
|
1988
|
+
j.excavation
|
|
1989
|
+
)), L = /* @__PURE__ */ D.createElement(
|
|
1893
1990
|
"image",
|
|
1894
1991
|
{
|
|
1895
1992
|
href: v.src,
|
|
1896
|
-
height:
|
|
1897
|
-
width:
|
|
1898
|
-
x:
|
|
1899
|
-
y:
|
|
1993
|
+
height: j.h,
|
|
1994
|
+
width: j.w,
|
|
1995
|
+
x: j.x + x,
|
|
1996
|
+
y: j.y + x,
|
|
1900
1997
|
preserveAspectRatio: "none",
|
|
1901
|
-
opacity:
|
|
1902
|
-
crossOrigin:
|
|
1998
|
+
opacity: j.opacity,
|
|
1999
|
+
crossOrigin: j.crossOrigin
|
|
1903
2000
|
}
|
|
1904
2001
|
));
|
|
1905
|
-
const O =
|
|
1906
|
-
return /* @__PURE__ */
|
|
2002
|
+
const O = ar(I, x);
|
|
2003
|
+
return /* @__PURE__ */ D.createElement(
|
|
1907
2004
|
"svg",
|
|
1908
|
-
|
|
2005
|
+
rt({
|
|
1909
2006
|
height: a,
|
|
1910
2007
|
width: a,
|
|
1911
|
-
viewBox: `0 0 ${
|
|
2008
|
+
viewBox: `0 0 ${A} ${A}`,
|
|
1912
2009
|
ref: t,
|
|
1913
2010
|
role: "img"
|
|
1914
2011
|
}, w),
|
|
1915
|
-
!!h && /* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
2012
|
+
!!h && /* @__PURE__ */ D.createElement("title", null, h),
|
|
2013
|
+
/* @__PURE__ */ D.createElement(
|
|
1917
2014
|
"path",
|
|
1918
2015
|
{
|
|
1919
2016
|
fill: u,
|
|
1920
|
-
d: `M0,0 h${
|
|
2017
|
+
d: `M0,0 h${A}v${A}H0z`,
|
|
1921
2018
|
shapeRendering: "crispEdges"
|
|
1922
2019
|
}
|
|
1923
2020
|
),
|
|
1924
|
-
/* @__PURE__ */
|
|
2021
|
+
/* @__PURE__ */ D.createElement("path", { fill: i, d: O, shapeRendering: "crispEdges" }),
|
|
1925
2022
|
L
|
|
1926
2023
|
);
|
|
1927
2024
|
}
|
|
1928
2025
|
);
|
|
1929
|
-
|
|
1930
|
-
const
|
|
2026
|
+
lr.displayName = "QRCodeSVG";
|
|
2027
|
+
const Rs = (r, e = "qr-code", t = 4) => {
|
|
1931
2028
|
const s = document.getElementById(r);
|
|
1932
2029
|
if (!s) return;
|
|
1933
2030
|
let n = new XMLSerializer().serializeToString(s);
|
|
@@ -1940,16 +2037,16 @@ const ps = (r, e = "qr-code", t = 4) => {
|
|
|
1940
2037
|
/<svg(\s+)/,
|
|
1941
2038
|
`<svg viewBox="0 0 ${a} ${d}" `
|
|
1942
2039
|
)), /width="[^"]*"/.test(n) ? n = n.replace(/width="[^"]*"/, `width="${u}"`) : n = n.replace(/<svg(\s+)/, `<svg width="${u}" `), /height="[^"]*"/.test(n) ? n = n.replace(/height="[^"]*"/, `height="${i}"`) : n = n.replace(/<svg(\s+)/, `<svg height="${i}" `);
|
|
1943
|
-
const
|
|
1944
|
-
|
|
1945
|
-
const c =
|
|
2040
|
+
const l = document.createElement("canvas");
|
|
2041
|
+
l.width = u, l.height = i;
|
|
2042
|
+
const c = l.getContext("2d"), f = new Image();
|
|
1946
2043
|
f.onload = () => {
|
|
1947
|
-
c?.drawImage(f, 0, 0,
|
|
1948
|
-
const h =
|
|
2044
|
+
c?.drawImage(f, 0, 0, l.width, l.height);
|
|
2045
|
+
const h = l.toDataURL("image/png"), p = document.createElement("a");
|
|
1949
2046
|
p.download = `${e}.png`, p.href = h, p.click();
|
|
1950
2047
|
}, f.src = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(n)));
|
|
1951
2048
|
};
|
|
1952
|
-
function
|
|
2049
|
+
function Ts({
|
|
1953
2050
|
id: r = "qr-code",
|
|
1954
2051
|
value: e,
|
|
1955
2052
|
size: t = 200,
|
|
@@ -1958,15 +2055,15 @@ function gs({
|
|
|
1958
2055
|
showDownloads: a = !0
|
|
1959
2056
|
}) {
|
|
1960
2057
|
const d = n || e.replace(/[^a-z0-9_-]/gi, "-").slice(0, 40) || "qr-code";
|
|
1961
|
-
return /* @__PURE__ */
|
|
1962
|
-
/* @__PURE__ */
|
|
1963
|
-
a && /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ o.jsxs("div", { className: "flex flex-col items-start ", children: [
|
|
2059
|
+
/* @__PURE__ */ o.jsx("div", { className: "bg-base-100 p-4 rounded-lg", children: /* @__PURE__ */ o.jsx(lr, { id: r, value: e, size: t, level: s }) }),
|
|
2060
|
+
a && /* @__PURE__ */ o.jsx("div", { className: "join justify-center self-center", children: /* @__PURE__ */ o.jsx(Os, { id: r, fileBase: d }) })
|
|
1964
2061
|
] });
|
|
1965
2062
|
}
|
|
1966
|
-
function
|
|
1967
|
-
const [t, s] =
|
|
1968
|
-
return /* @__PURE__ */
|
|
1969
|
-
/* @__PURE__ */
|
|
2063
|
+
function Os({ id: r, fileBase: e }) {
|
|
2064
|
+
const [t, s] = se(8), n = (a) => a === 8 ? "large" : a === 4 ? "medium" : "small";
|
|
2065
|
+
return /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
2066
|
+
/* @__PURE__ */ o.jsxs(
|
|
1970
2067
|
"select",
|
|
1971
2068
|
{
|
|
1972
2069
|
className: "select join-item",
|
|
@@ -1974,24 +2071,24 @@ function vs({ id: r, fileBase: e }) {
|
|
|
1974
2071
|
onChange: (a) => s(Number(a.target.value)),
|
|
1975
2072
|
"aria-label": "Download scale",
|
|
1976
2073
|
children: [
|
|
1977
|
-
/* @__PURE__ */
|
|
1978
|
-
/* @__PURE__ */
|
|
1979
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ o.jsx("option", { value: 8, children: "Large" }),
|
|
2075
|
+
/* @__PURE__ */ o.jsx("option", { value: 4, children: "Medium" }),
|
|
2076
|
+
/* @__PURE__ */ o.jsx("option", { value: 2, children: "Small" })
|
|
1980
2077
|
]
|
|
1981
2078
|
}
|
|
1982
2079
|
),
|
|
1983
|
-
/* @__PURE__ */
|
|
2080
|
+
/* @__PURE__ */ o.jsx(
|
|
1984
2081
|
"button",
|
|
1985
2082
|
{
|
|
1986
2083
|
className: "btn btn-secondary join-item",
|
|
1987
|
-
onClick: () =>
|
|
2084
|
+
onClick: () => Rs(r, `${e}-${n(t)}`, t),
|
|
1988
2085
|
title: `Download ${t}x`,
|
|
1989
2086
|
children: "Download"
|
|
1990
2087
|
}
|
|
1991
2088
|
)
|
|
1992
2089
|
] });
|
|
1993
2090
|
}
|
|
1994
|
-
function
|
|
2091
|
+
function Pe(r) {
|
|
1995
2092
|
if (!r) return "";
|
|
1996
2093
|
try {
|
|
1997
2094
|
return new Date(r).toLocaleString();
|
|
@@ -2036,15 +2133,15 @@ var T;
|
|
|
2036
2133
|
}
|
|
2037
2134
|
r.joinValues = s, r.jsonStringifyReplacer = (n, a) => typeof a == "bigint" ? a.toString() : a;
|
|
2038
2135
|
})(T || (T = {}));
|
|
2039
|
-
var
|
|
2136
|
+
var kt;
|
|
2040
2137
|
(function(r) {
|
|
2041
2138
|
r.mergeShapes = (e, t) => ({
|
|
2042
2139
|
...e,
|
|
2043
2140
|
...t
|
|
2044
2141
|
// second overwrites first
|
|
2045
2142
|
});
|
|
2046
|
-
})(
|
|
2047
|
-
const
|
|
2143
|
+
})(kt || (kt = {}));
|
|
2144
|
+
const _ = T.arrayToEnum([
|
|
2048
2145
|
"string",
|
|
2049
2146
|
"nan",
|
|
2050
2147
|
"number",
|
|
@@ -2068,23 +2165,23 @@ const x = T.arrayToEnum([
|
|
|
2068
2165
|
]), re = (r) => {
|
|
2069
2166
|
switch (typeof r) {
|
|
2070
2167
|
case "undefined":
|
|
2071
|
-
return
|
|
2168
|
+
return _.undefined;
|
|
2072
2169
|
case "string":
|
|
2073
|
-
return
|
|
2170
|
+
return _.string;
|
|
2074
2171
|
case "number":
|
|
2075
|
-
return Number.isNaN(r) ?
|
|
2172
|
+
return Number.isNaN(r) ? _.nan : _.number;
|
|
2076
2173
|
case "boolean":
|
|
2077
|
-
return
|
|
2174
|
+
return _.boolean;
|
|
2078
2175
|
case "function":
|
|
2079
|
-
return
|
|
2176
|
+
return _.function;
|
|
2080
2177
|
case "bigint":
|
|
2081
|
-
return
|
|
2178
|
+
return _.bigint;
|
|
2082
2179
|
case "symbol":
|
|
2083
|
-
return
|
|
2180
|
+
return _.symbol;
|
|
2084
2181
|
case "object":
|
|
2085
|
-
return Array.isArray(r) ?
|
|
2182
|
+
return Array.isArray(r) ? _.array : r === null ? _.null : r.then && typeof r.then == "function" && r.catch && typeof r.catch == "function" ? _.promise : typeof Map < "u" && r instanceof Map ? _.map : typeof Set < "u" && r instanceof Set ? _.set : typeof Date < "u" && r instanceof Date ? _.date : _.object;
|
|
2086
2183
|
default:
|
|
2087
|
-
return
|
|
2184
|
+
return _.unknown;
|
|
2088
2185
|
}
|
|
2089
2186
|
}, g = T.arrayToEnum([
|
|
2090
2187
|
"invalid_type",
|
|
@@ -2133,8 +2230,8 @@ class ee extends Error {
|
|
|
2133
2230
|
else {
|
|
2134
2231
|
let u = s, i = 0;
|
|
2135
2232
|
for (; i < d.path.length; ) {
|
|
2136
|
-
const
|
|
2137
|
-
i === d.path.length - 1 ? (u[
|
|
2233
|
+
const l = d.path[i];
|
|
2234
|
+
i === d.path.length - 1 ? (u[l] = u[l] || { _errors: [] }, u[l]._errors.push(t(d))) : u[l] = u[l] || { _errors: [] }, u = u[l], i++;
|
|
2138
2235
|
}
|
|
2139
2236
|
}
|
|
2140
2237
|
};
|
|
@@ -2168,11 +2265,11 @@ class ee extends Error {
|
|
|
2168
2265
|
}
|
|
2169
2266
|
}
|
|
2170
2267
|
ee.create = (r) => new ee(r);
|
|
2171
|
-
const
|
|
2268
|
+
const nt = (r, e) => {
|
|
2172
2269
|
let t;
|
|
2173
2270
|
switch (r.code) {
|
|
2174
2271
|
case g.invalid_type:
|
|
2175
|
-
r.received ===
|
|
2272
|
+
r.received === _.undefined ? t = "Required" : t = `Expected ${r.expected}, received ${r.received}`;
|
|
2176
2273
|
break;
|
|
2177
2274
|
case g.invalid_literal:
|
|
2178
2275
|
t = `Invalid literal value, expected ${JSON.stringify(r.expected, T.jsonStringifyReplacer)}`;
|
|
@@ -2224,11 +2321,11 @@ const tt = (r, e) => {
|
|
|
2224
2321
|
}
|
|
2225
2322
|
return { message: t };
|
|
2226
2323
|
};
|
|
2227
|
-
let
|
|
2228
|
-
function
|
|
2229
|
-
return
|
|
2324
|
+
let Ps = nt;
|
|
2325
|
+
function Is() {
|
|
2326
|
+
return Ps;
|
|
2230
2327
|
}
|
|
2231
|
-
const
|
|
2328
|
+
const Ms = (r) => {
|
|
2232
2329
|
const { data: e, path: t, errorMaps: s, issueData: n } = r, a = [...t, ...n.path || []], d = {
|
|
2233
2330
|
...n,
|
|
2234
2331
|
path: a
|
|
@@ -2240,9 +2337,9 @@ const _s = (r) => {
|
|
|
2240
2337
|
message: n.message
|
|
2241
2338
|
};
|
|
2242
2339
|
let u = "";
|
|
2243
|
-
const i = s.filter((
|
|
2244
|
-
for (const
|
|
2245
|
-
u =
|
|
2340
|
+
const i = s.filter((l) => !!l).slice().reverse();
|
|
2341
|
+
for (const l of i)
|
|
2342
|
+
u = l(d, { data: e, defaultError: u }).message;
|
|
2246
2343
|
return {
|
|
2247
2344
|
...n,
|
|
2248
2345
|
path: a,
|
|
@@ -2250,7 +2347,7 @@ const _s = (r) => {
|
|
|
2250
2347
|
};
|
|
2251
2348
|
};
|
|
2252
2349
|
function y(r, e) {
|
|
2253
|
-
const t =
|
|
2350
|
+
const t = Is(), s = Ms({
|
|
2254
2351
|
issueData: e,
|
|
2255
2352
|
data: r.data,
|
|
2256
2353
|
path: r.path,
|
|
@@ -2261,13 +2358,13 @@ function y(r, e) {
|
|
|
2261
2358
|
// then schema-bound map if available
|
|
2262
2359
|
t,
|
|
2263
2360
|
// then global override map
|
|
2264
|
-
t ===
|
|
2361
|
+
t === nt ? void 0 : nt
|
|
2265
2362
|
// then global default map
|
|
2266
2363
|
].filter((n) => !!n)
|
|
2267
2364
|
});
|
|
2268
2365
|
r.common.issues.push(s);
|
|
2269
2366
|
}
|
|
2270
|
-
class
|
|
2367
|
+
class Q {
|
|
2271
2368
|
constructor() {
|
|
2272
2369
|
this.value = "valid";
|
|
2273
2370
|
}
|
|
@@ -2281,7 +2378,7 @@ class H {
|
|
|
2281
2378
|
const s = [];
|
|
2282
2379
|
for (const n of t) {
|
|
2283
2380
|
if (n.status === "aborted")
|
|
2284
|
-
return
|
|
2381
|
+
return N;
|
|
2285
2382
|
n.status === "dirty" && e.dirty(), s.push(n.value);
|
|
2286
2383
|
}
|
|
2287
2384
|
return { status: e.value, value: s };
|
|
@@ -2295,27 +2392,27 @@ class H {
|
|
|
2295
2392
|
value: d
|
|
2296
2393
|
});
|
|
2297
2394
|
}
|
|
2298
|
-
return
|
|
2395
|
+
return Q.mergeObjectSync(e, s);
|
|
2299
2396
|
}
|
|
2300
2397
|
static mergeObjectSync(e, t) {
|
|
2301
2398
|
const s = {};
|
|
2302
2399
|
for (const n of t) {
|
|
2303
2400
|
const { key: a, value: d } = n;
|
|
2304
2401
|
if (a.status === "aborted" || d.status === "aborted")
|
|
2305
|
-
return
|
|
2402
|
+
return N;
|
|
2306
2403
|
a.status === "dirty" && e.dirty(), d.status === "dirty" && e.dirty(), a.value !== "__proto__" && (typeof d.value < "u" || n.alwaysSet) && (s[a.value] = d.value);
|
|
2307
2404
|
}
|
|
2308
2405
|
return { status: e.value, value: s };
|
|
2309
2406
|
}
|
|
2310
2407
|
}
|
|
2311
|
-
const
|
|
2408
|
+
const N = Object.freeze({
|
|
2312
2409
|
status: "aborted"
|
|
2313
|
-
}),
|
|
2410
|
+
}), Ie = (r) => ({ status: "dirty", value: r }), J = (r) => ({ status: "valid", value: r }), Et = (r) => r.status === "aborted", Ct = (r) => r.status === "dirty", ye = (r) => r.status === "valid", We = (r) => typeof Promise < "u" && r instanceof Promise;
|
|
2314
2411
|
var b;
|
|
2315
2412
|
(function(r) {
|
|
2316
2413
|
r.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, r.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
2317
2414
|
})(b || (b = {}));
|
|
2318
|
-
class
|
|
2415
|
+
class ie {
|
|
2319
2416
|
constructor(e, t, s, n) {
|
|
2320
2417
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = s, this._key = n;
|
|
2321
2418
|
}
|
|
@@ -2323,7 +2420,7 @@ class ae {
|
|
|
2323
2420
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
2324
2421
|
}
|
|
2325
2422
|
}
|
|
2326
|
-
const
|
|
2423
|
+
const St = (r, e) => {
|
|
2327
2424
|
if (ye(e))
|
|
2328
2425
|
return { success: !0, data: e.value };
|
|
2329
2426
|
if (!r.common.issues.length)
|
|
@@ -2349,7 +2446,7 @@ function C(r) {
|
|
|
2349
2446
|
return d.code === "invalid_enum_value" ? { message: i ?? u.defaultError } : typeof u.data > "u" ? { message: i ?? s ?? u.defaultError } : d.code !== "invalid_type" ? { message: u.defaultError } : { message: i ?? t ?? u.defaultError };
|
|
2350
2447
|
}, description: n };
|
|
2351
2448
|
}
|
|
2352
|
-
class
|
|
2449
|
+
class R {
|
|
2353
2450
|
get description() {
|
|
2354
2451
|
return this._def.description;
|
|
2355
2452
|
}
|
|
@@ -2368,7 +2465,7 @@ class A {
|
|
|
2368
2465
|
}
|
|
2369
2466
|
_processInputParams(e) {
|
|
2370
2467
|
return {
|
|
2371
|
-
status: new
|
|
2468
|
+
status: new Q(),
|
|
2372
2469
|
ctx: {
|
|
2373
2470
|
common: e.parent.common,
|
|
2374
2471
|
data: e.data,
|
|
@@ -2381,7 +2478,7 @@ class A {
|
|
|
2381
2478
|
}
|
|
2382
2479
|
_parseSync(e) {
|
|
2383
2480
|
const t = this._parse(e);
|
|
2384
|
-
if (
|
|
2481
|
+
if (We(t))
|
|
2385
2482
|
throw new Error("Synchronous parse encountered promise.");
|
|
2386
2483
|
return t;
|
|
2387
2484
|
}
|
|
@@ -2408,7 +2505,7 @@ class A {
|
|
|
2408
2505
|
data: e,
|
|
2409
2506
|
parsedType: re(e)
|
|
2410
2507
|
}, n = this._parseSync({ data: e, path: s.path, parent: s });
|
|
2411
|
-
return
|
|
2508
|
+
return St(s, n);
|
|
2412
2509
|
}
|
|
2413
2510
|
"~validate"(e) {
|
|
2414
2511
|
const t = {
|
|
@@ -2460,8 +2557,8 @@ class A {
|
|
|
2460
2557
|
parent: null,
|
|
2461
2558
|
data: e,
|
|
2462
2559
|
parsedType: re(e)
|
|
2463
|
-
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (
|
|
2464
|
-
return
|
|
2560
|
+
}, n = this._parse({ data: e, path: s.path, parent: s }), a = await (We(n) ? n : Promise.resolve(n));
|
|
2561
|
+
return St(s, a);
|
|
2465
2562
|
}
|
|
2466
2563
|
refine(e, t) {
|
|
2467
2564
|
const s = (n) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(n) : t;
|
|
@@ -2479,7 +2576,7 @@ class A {
|
|
|
2479
2576
|
_refinement(e) {
|
|
2480
2577
|
return new be({
|
|
2481
2578
|
schema: this,
|
|
2482
|
-
typeName:
|
|
2579
|
+
typeName: k.ZodEffects,
|
|
2483
2580
|
effect: { type: "refinement", refinement: e }
|
|
2484
2581
|
});
|
|
2485
2582
|
}
|
|
@@ -2494,7 +2591,7 @@ class A {
|
|
|
2494
2591
|
};
|
|
2495
2592
|
}
|
|
2496
2593
|
optional() {
|
|
2497
|
-
return
|
|
2594
|
+
return ae.create(this, this._def);
|
|
2498
2595
|
}
|
|
2499
2596
|
nullable() {
|
|
2500
2597
|
return we.create(this, this._def);
|
|
@@ -2506,45 +2603,45 @@ class A {
|
|
|
2506
2603
|
return X.create(this);
|
|
2507
2604
|
}
|
|
2508
2605
|
promise() {
|
|
2509
|
-
return
|
|
2606
|
+
return Qe.create(this, this._def);
|
|
2510
2607
|
}
|
|
2511
2608
|
or(e) {
|
|
2512
|
-
return
|
|
2609
|
+
return Ye.create([this, e], this._def);
|
|
2513
2610
|
}
|
|
2514
2611
|
and(e) {
|
|
2515
|
-
return
|
|
2612
|
+
return Ge.create(this, e, this._def);
|
|
2516
2613
|
}
|
|
2517
2614
|
transform(e) {
|
|
2518
2615
|
return new be({
|
|
2519
2616
|
...C(this._def),
|
|
2520
2617
|
schema: this,
|
|
2521
|
-
typeName:
|
|
2618
|
+
typeName: k.ZodEffects,
|
|
2522
2619
|
effect: { type: "transform", transform: e }
|
|
2523
2620
|
});
|
|
2524
2621
|
}
|
|
2525
2622
|
default(e) {
|
|
2526
2623
|
const t = typeof e == "function" ? e : () => e;
|
|
2527
|
-
return new
|
|
2624
|
+
return new it({
|
|
2528
2625
|
...C(this._def),
|
|
2529
2626
|
innerType: this,
|
|
2530
2627
|
defaultValue: t,
|
|
2531
|
-
typeName:
|
|
2628
|
+
typeName: k.ZodDefault
|
|
2532
2629
|
});
|
|
2533
2630
|
}
|
|
2534
2631
|
brand() {
|
|
2535
|
-
return new
|
|
2536
|
-
typeName:
|
|
2632
|
+
return new nn({
|
|
2633
|
+
typeName: k.ZodBranded,
|
|
2537
2634
|
type: this,
|
|
2538
2635
|
...C(this._def)
|
|
2539
2636
|
});
|
|
2540
2637
|
}
|
|
2541
2638
|
catch(e) {
|
|
2542
2639
|
const t = typeof e == "function" ? e : () => e;
|
|
2543
|
-
return new
|
|
2640
|
+
return new ot({
|
|
2544
2641
|
...C(this._def),
|
|
2545
2642
|
innerType: this,
|
|
2546
2643
|
catchValue: t,
|
|
2547
|
-
typeName:
|
|
2644
|
+
typeName: k.ZodCatch
|
|
2548
2645
|
});
|
|
2549
2646
|
}
|
|
2550
2647
|
describe(e) {
|
|
@@ -2555,10 +2652,10 @@ class A {
|
|
|
2555
2652
|
});
|
|
2556
2653
|
}
|
|
2557
2654
|
pipe(e) {
|
|
2558
|
-
return
|
|
2655
|
+
return gt.create(this, e);
|
|
2559
2656
|
}
|
|
2560
2657
|
readonly() {
|
|
2561
|
-
return
|
|
2658
|
+
return lt.create(this);
|
|
2562
2659
|
}
|
|
2563
2660
|
isOptional() {
|
|
2564
2661
|
return this.safeParse(void 0).success;
|
|
@@ -2567,28 +2664,28 @@ class A {
|
|
|
2567
2664
|
return this.safeParse(null).success;
|
|
2568
2665
|
}
|
|
2569
2666
|
}
|
|
2570
|
-
const
|
|
2571
|
-
let
|
|
2572
|
-
const
|
|
2573
|
-
function
|
|
2667
|
+
const Ls = /^c[^\s-]{8,}$/i, $s = /^[0-9a-z]+$/, Fs = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Zs = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Ds = /^[a-z0-9_-]{21}$/i, zs = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Us = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Vs = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Bs = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
2668
|
+
let Ke;
|
|
2669
|
+
const Ws = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, qs = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ys = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Gs = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Qs = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Hs = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, cr = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Js = new RegExp(`^${cr}$`);
|
|
2670
|
+
function dr(r) {
|
|
2574
2671
|
let e = "[0-5]\\d";
|
|
2575
2672
|
r.precision ? e = `${e}\\.\\d{${r.precision}}` : r.precision == null && (e = `${e}(\\.\\d+)?`);
|
|
2576
2673
|
const t = r.precision ? "+" : "?";
|
|
2577
2674
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
|
|
2578
2675
|
}
|
|
2579
|
-
function
|
|
2580
|
-
return new RegExp(`^${
|
|
2676
|
+
function Xs(r) {
|
|
2677
|
+
return new RegExp(`^${dr(r)}$`);
|
|
2581
2678
|
}
|
|
2582
|
-
function
|
|
2583
|
-
let e = `${
|
|
2679
|
+
function Ks(r) {
|
|
2680
|
+
let e = `${cr}T${dr(r)}`;
|
|
2584
2681
|
const t = [];
|
|
2585
2682
|
return t.push(r.local ? "Z?" : "Z"), r.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
|
|
2586
2683
|
}
|
|
2587
|
-
function
|
|
2588
|
-
return !!((e === "v4" || !e) &&
|
|
2684
|
+
function en(r, e) {
|
|
2685
|
+
return !!((e === "v4" || !e) && Ws.test(r) || (e === "v6" || !e) && Ys.test(r));
|
|
2589
2686
|
}
|
|
2590
|
-
function
|
|
2591
|
-
if (!
|
|
2687
|
+
function tn(r, e) {
|
|
2688
|
+
if (!zs.test(r))
|
|
2592
2689
|
return !1;
|
|
2593
2690
|
try {
|
|
2594
2691
|
const [t] = r.split(".");
|
|
@@ -2600,20 +2697,20 @@ function Fs(r, e) {
|
|
|
2600
2697
|
return !1;
|
|
2601
2698
|
}
|
|
2602
2699
|
}
|
|
2603
|
-
function
|
|
2604
|
-
return !!((e === "v4" || !e) &&
|
|
2700
|
+
function rn(r, e) {
|
|
2701
|
+
return !!((e === "v4" || !e) && qs.test(r) || (e === "v6" || !e) && Gs.test(r));
|
|
2605
2702
|
}
|
|
2606
|
-
class K extends
|
|
2703
|
+
class K extends R {
|
|
2607
2704
|
_parse(e) {
|
|
2608
|
-
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !==
|
|
2705
|
+
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== _.string) {
|
|
2609
2706
|
const a = this._getOrReturnCtx(e);
|
|
2610
2707
|
return y(a, {
|
|
2611
2708
|
code: g.invalid_type,
|
|
2612
|
-
expected:
|
|
2709
|
+
expected: _.string,
|
|
2613
2710
|
received: a.parsedType
|
|
2614
|
-
}),
|
|
2711
|
+
}), N;
|
|
2615
2712
|
}
|
|
2616
|
-
const s = new
|
|
2713
|
+
const s = new Q();
|
|
2617
2714
|
let n;
|
|
2618
2715
|
for (const a of this._def.checks)
|
|
2619
2716
|
if (a.kind === "min")
|
|
@@ -2652,43 +2749,43 @@ class K extends A {
|
|
|
2652
2749
|
message: a.message
|
|
2653
2750
|
}), s.dirty());
|
|
2654
2751
|
} else if (a.kind === "email")
|
|
2655
|
-
|
|
2752
|
+
Vs.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2656
2753
|
validation: "email",
|
|
2657
2754
|
code: g.invalid_string,
|
|
2658
2755
|
message: a.message
|
|
2659
2756
|
}), s.dirty());
|
|
2660
2757
|
else if (a.kind === "emoji")
|
|
2661
|
-
|
|
2758
|
+
Ke || (Ke = new RegExp(Bs, "u")), Ke.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2662
2759
|
validation: "emoji",
|
|
2663
2760
|
code: g.invalid_string,
|
|
2664
2761
|
message: a.message
|
|
2665
2762
|
}), s.dirty());
|
|
2666
2763
|
else if (a.kind === "uuid")
|
|
2667
|
-
|
|
2764
|
+
Zs.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2668
2765
|
validation: "uuid",
|
|
2669
2766
|
code: g.invalid_string,
|
|
2670
2767
|
message: a.message
|
|
2671
2768
|
}), s.dirty());
|
|
2672
2769
|
else if (a.kind === "nanoid")
|
|
2673
|
-
|
|
2770
|
+
Ds.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2674
2771
|
validation: "nanoid",
|
|
2675
2772
|
code: g.invalid_string,
|
|
2676
2773
|
message: a.message
|
|
2677
2774
|
}), s.dirty());
|
|
2678
2775
|
else if (a.kind === "cuid")
|
|
2679
|
-
|
|
2776
|
+
Ls.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2680
2777
|
validation: "cuid",
|
|
2681
2778
|
code: g.invalid_string,
|
|
2682
2779
|
message: a.message
|
|
2683
2780
|
}), s.dirty());
|
|
2684
2781
|
else if (a.kind === "cuid2")
|
|
2685
|
-
|
|
2782
|
+
$s.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2686
2783
|
validation: "cuid2",
|
|
2687
2784
|
code: g.invalid_string,
|
|
2688
2785
|
message: a.message
|
|
2689
2786
|
}), s.dirty());
|
|
2690
2787
|
else if (a.kind === "ulid")
|
|
2691
|
-
|
|
2788
|
+
Fs.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2692
2789
|
validation: "ulid",
|
|
2693
2790
|
code: g.invalid_string,
|
|
2694
2791
|
message: a.message
|
|
@@ -2719,39 +2816,39 @@ class K extends A {
|
|
|
2719
2816
|
code: g.invalid_string,
|
|
2720
2817
|
validation: { endsWith: a.value },
|
|
2721
2818
|
message: a.message
|
|
2722
|
-
}), s.dirty()) : a.kind === "datetime" ?
|
|
2819
|
+
}), s.dirty()) : a.kind === "datetime" ? Ks(a).test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2723
2820
|
code: g.invalid_string,
|
|
2724
2821
|
validation: "datetime",
|
|
2725
2822
|
message: a.message
|
|
2726
|
-
}), s.dirty()) : a.kind === "date" ?
|
|
2823
|
+
}), s.dirty()) : a.kind === "date" ? Js.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2727
2824
|
code: g.invalid_string,
|
|
2728
2825
|
validation: "date",
|
|
2729
2826
|
message: a.message
|
|
2730
|
-
}), s.dirty()) : a.kind === "time" ?
|
|
2827
|
+
}), s.dirty()) : a.kind === "time" ? Xs(a).test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2731
2828
|
code: g.invalid_string,
|
|
2732
2829
|
validation: "time",
|
|
2733
2830
|
message: a.message
|
|
2734
|
-
}), s.dirty()) : a.kind === "duration" ?
|
|
2831
|
+
}), s.dirty()) : a.kind === "duration" ? Us.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2735
2832
|
validation: "duration",
|
|
2736
2833
|
code: g.invalid_string,
|
|
2737
2834
|
message: a.message
|
|
2738
|
-
}), s.dirty()) : a.kind === "ip" ?
|
|
2835
|
+
}), s.dirty()) : a.kind === "ip" ? en(e.data, a.version) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2739
2836
|
validation: "ip",
|
|
2740
2837
|
code: g.invalid_string,
|
|
2741
2838
|
message: a.message
|
|
2742
|
-
}), s.dirty()) : a.kind === "jwt" ?
|
|
2839
|
+
}), s.dirty()) : a.kind === "jwt" ? tn(e.data, a.alg) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2743
2840
|
validation: "jwt",
|
|
2744
2841
|
code: g.invalid_string,
|
|
2745
2842
|
message: a.message
|
|
2746
|
-
}), s.dirty()) : a.kind === "cidr" ?
|
|
2843
|
+
}), s.dirty()) : a.kind === "cidr" ? rn(e.data, a.version) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2747
2844
|
validation: "cidr",
|
|
2748
2845
|
code: g.invalid_string,
|
|
2749
2846
|
message: a.message
|
|
2750
|
-
}), s.dirty()) : a.kind === "base64" ?
|
|
2847
|
+
}), s.dirty()) : a.kind === "base64" ? Qs.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2751
2848
|
validation: "base64",
|
|
2752
2849
|
code: g.invalid_string,
|
|
2753
2850
|
message: a.message
|
|
2754
|
-
}), s.dirty()) : a.kind === "base64url" ?
|
|
2851
|
+
}), s.dirty()) : a.kind === "base64url" ? Hs.test(e.data) || (n = this._getOrReturnCtx(e, n), y(n, {
|
|
2755
2852
|
validation: "base64url",
|
|
2756
2853
|
code: g.invalid_string,
|
|
2757
2854
|
message: a.message
|
|
@@ -2982,29 +3079,29 @@ class K extends A {
|
|
|
2982
3079
|
}
|
|
2983
3080
|
K.create = (r) => new K({
|
|
2984
3081
|
checks: [],
|
|
2985
|
-
typeName:
|
|
3082
|
+
typeName: k.ZodString,
|
|
2986
3083
|
coerce: r?.coerce ?? !1,
|
|
2987
3084
|
...C(r)
|
|
2988
3085
|
});
|
|
2989
|
-
function
|
|
3086
|
+
function sn(r, e) {
|
|
2990
3087
|
const t = (r.toString().split(".")[1] || "").length, s = (e.toString().split(".")[1] || "").length, n = t > s ? t : s, a = Number.parseInt(r.toFixed(n).replace(".", "")), d = Number.parseInt(e.toFixed(n).replace(".", ""));
|
|
2991
3088
|
return a % d / 10 ** n;
|
|
2992
3089
|
}
|
|
2993
|
-
class fe extends
|
|
3090
|
+
class fe extends R {
|
|
2994
3091
|
constructor() {
|
|
2995
3092
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
2996
3093
|
}
|
|
2997
3094
|
_parse(e) {
|
|
2998
|
-
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !==
|
|
3095
|
+
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== _.number) {
|
|
2999
3096
|
const a = this._getOrReturnCtx(e);
|
|
3000
3097
|
return y(a, {
|
|
3001
3098
|
code: g.invalid_type,
|
|
3002
|
-
expected:
|
|
3099
|
+
expected: _.number,
|
|
3003
3100
|
received: a.parsedType
|
|
3004
|
-
}),
|
|
3101
|
+
}), N;
|
|
3005
3102
|
}
|
|
3006
3103
|
let s;
|
|
3007
|
-
const n = new
|
|
3104
|
+
const n = new Q();
|
|
3008
3105
|
for (const a of this._def.checks)
|
|
3009
3106
|
a.kind === "int" ? T.isInteger(e.data) || (s = this._getOrReturnCtx(e, s), y(s, {
|
|
3010
3107
|
code: g.invalid_type,
|
|
@@ -3025,7 +3122,7 @@ class fe extends A {
|
|
|
3025
3122
|
inclusive: a.inclusive,
|
|
3026
3123
|
exact: !1,
|
|
3027
3124
|
message: a.message
|
|
3028
|
-
}), n.dirty()) : a.kind === "multipleOf" ?
|
|
3125
|
+
}), n.dirty()) : a.kind === "multipleOf" ? sn(e.data, a.value) !== 0 && (s = this._getOrReturnCtx(e, s), y(s, {
|
|
3029
3126
|
code: g.not_multiple_of,
|
|
3030
3127
|
multipleOf: a.value,
|
|
3031
3128
|
message: a.message
|
|
@@ -3158,11 +3255,11 @@ class fe extends A {
|
|
|
3158
3255
|
}
|
|
3159
3256
|
fe.create = (r) => new fe({
|
|
3160
3257
|
checks: [],
|
|
3161
|
-
typeName:
|
|
3258
|
+
typeName: k.ZodNumber,
|
|
3162
3259
|
coerce: r?.coerce || !1,
|
|
3163
3260
|
...C(r)
|
|
3164
3261
|
});
|
|
3165
|
-
class he extends
|
|
3262
|
+
class he extends R {
|
|
3166
3263
|
constructor() {
|
|
3167
3264
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
3168
3265
|
}
|
|
@@ -3173,10 +3270,10 @@ class he extends A {
|
|
|
3173
3270
|
} catch {
|
|
3174
3271
|
return this._getInvalidInput(e);
|
|
3175
3272
|
}
|
|
3176
|
-
if (this._getType(e) !==
|
|
3273
|
+
if (this._getType(e) !== _.bigint)
|
|
3177
3274
|
return this._getInvalidInput(e);
|
|
3178
3275
|
let s;
|
|
3179
|
-
const n = new
|
|
3276
|
+
const n = new Q();
|
|
3180
3277
|
for (const a of this._def.checks)
|
|
3181
3278
|
a.kind === "min" ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (s = this._getOrReturnCtx(e, s), y(s, {
|
|
3182
3279
|
code: g.too_small,
|
|
@@ -3201,9 +3298,9 @@ class he extends A {
|
|
|
3201
3298
|
const t = this._getOrReturnCtx(e);
|
|
3202
3299
|
return y(t, {
|
|
3203
3300
|
code: g.invalid_type,
|
|
3204
|
-
expected:
|
|
3301
|
+
expected: _.bigint,
|
|
3205
3302
|
received: t.parsedType
|
|
3206
|
-
}),
|
|
3303
|
+
}), N;
|
|
3207
3304
|
}
|
|
3208
3305
|
gte(e, t) {
|
|
3209
3306
|
return this.setLimit("min", e, !0, b.toString(t));
|
|
@@ -3291,45 +3388,45 @@ class he extends A {
|
|
|
3291
3388
|
}
|
|
3292
3389
|
he.create = (r) => new he({
|
|
3293
3390
|
checks: [],
|
|
3294
|
-
typeName:
|
|
3391
|
+
typeName: k.ZodBigInt,
|
|
3295
3392
|
coerce: r?.coerce ?? !1,
|
|
3296
3393
|
...C(r)
|
|
3297
3394
|
});
|
|
3298
|
-
class
|
|
3395
|
+
class qe extends R {
|
|
3299
3396
|
_parse(e) {
|
|
3300
|
-
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !==
|
|
3397
|
+
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== _.boolean) {
|
|
3301
3398
|
const s = this._getOrReturnCtx(e);
|
|
3302
3399
|
return y(s, {
|
|
3303
3400
|
code: g.invalid_type,
|
|
3304
|
-
expected:
|
|
3401
|
+
expected: _.boolean,
|
|
3305
3402
|
received: s.parsedType
|
|
3306
|
-
}),
|
|
3403
|
+
}), N;
|
|
3307
3404
|
}
|
|
3308
3405
|
return J(e.data);
|
|
3309
3406
|
}
|
|
3310
3407
|
}
|
|
3311
|
-
|
|
3312
|
-
typeName:
|
|
3408
|
+
qe.create = (r) => new qe({
|
|
3409
|
+
typeName: k.ZodBoolean,
|
|
3313
3410
|
coerce: r?.coerce || !1,
|
|
3314
3411
|
...C(r)
|
|
3315
3412
|
});
|
|
3316
|
-
class xe extends
|
|
3413
|
+
class xe extends R {
|
|
3317
3414
|
_parse(e) {
|
|
3318
|
-
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !==
|
|
3415
|
+
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== _.date) {
|
|
3319
3416
|
const a = this._getOrReturnCtx(e);
|
|
3320
3417
|
return y(a, {
|
|
3321
3418
|
code: g.invalid_type,
|
|
3322
|
-
expected:
|
|
3419
|
+
expected: _.date,
|
|
3323
3420
|
received: a.parsedType
|
|
3324
|
-
}),
|
|
3421
|
+
}), N;
|
|
3325
3422
|
}
|
|
3326
3423
|
if (Number.isNaN(e.data.getTime())) {
|
|
3327
3424
|
const a = this._getOrReturnCtx(e);
|
|
3328
3425
|
return y(a, {
|
|
3329
3426
|
code: g.invalid_date
|
|
3330
|
-
}),
|
|
3427
|
+
}), N;
|
|
3331
3428
|
}
|
|
3332
|
-
const s = new
|
|
3429
|
+
const s = new Q();
|
|
3333
3430
|
let n;
|
|
3334
3431
|
for (const a of this._def.checks)
|
|
3335
3432
|
a.kind === "min" ? e.data.getTime() < a.value && (n = this._getOrReturnCtx(e, n), y(n, {
|
|
@@ -3388,61 +3485,61 @@ class xe extends A {
|
|
|
3388
3485
|
xe.create = (r) => new xe({
|
|
3389
3486
|
checks: [],
|
|
3390
3487
|
coerce: r?.coerce || !1,
|
|
3391
|
-
typeName:
|
|
3488
|
+
typeName: k.ZodDate,
|
|
3392
3489
|
...C(r)
|
|
3393
3490
|
});
|
|
3394
|
-
class
|
|
3491
|
+
class At extends R {
|
|
3395
3492
|
_parse(e) {
|
|
3396
|
-
if (this._getType(e) !==
|
|
3493
|
+
if (this._getType(e) !== _.symbol) {
|
|
3397
3494
|
const s = this._getOrReturnCtx(e);
|
|
3398
3495
|
return y(s, {
|
|
3399
3496
|
code: g.invalid_type,
|
|
3400
|
-
expected:
|
|
3497
|
+
expected: _.symbol,
|
|
3401
3498
|
received: s.parsedType
|
|
3402
|
-
}),
|
|
3499
|
+
}), N;
|
|
3403
3500
|
}
|
|
3404
3501
|
return J(e.data);
|
|
3405
3502
|
}
|
|
3406
3503
|
}
|
|
3407
|
-
|
|
3408
|
-
typeName:
|
|
3504
|
+
At.create = (r) => new At({
|
|
3505
|
+
typeName: k.ZodSymbol,
|
|
3409
3506
|
...C(r)
|
|
3410
3507
|
});
|
|
3411
|
-
class
|
|
3508
|
+
class Rt extends R {
|
|
3412
3509
|
_parse(e) {
|
|
3413
|
-
if (this._getType(e) !==
|
|
3510
|
+
if (this._getType(e) !== _.undefined) {
|
|
3414
3511
|
const s = this._getOrReturnCtx(e);
|
|
3415
3512
|
return y(s, {
|
|
3416
3513
|
code: g.invalid_type,
|
|
3417
|
-
expected:
|
|
3514
|
+
expected: _.undefined,
|
|
3418
3515
|
received: s.parsedType
|
|
3419
|
-
}),
|
|
3516
|
+
}), N;
|
|
3420
3517
|
}
|
|
3421
3518
|
return J(e.data);
|
|
3422
3519
|
}
|
|
3423
3520
|
}
|
|
3424
|
-
|
|
3425
|
-
typeName:
|
|
3521
|
+
Rt.create = (r) => new Rt({
|
|
3522
|
+
typeName: k.ZodUndefined,
|
|
3426
3523
|
...C(r)
|
|
3427
3524
|
});
|
|
3428
|
-
class
|
|
3525
|
+
class Tt extends R {
|
|
3429
3526
|
_parse(e) {
|
|
3430
|
-
if (this._getType(e) !==
|
|
3527
|
+
if (this._getType(e) !== _.null) {
|
|
3431
3528
|
const s = this._getOrReturnCtx(e);
|
|
3432
3529
|
return y(s, {
|
|
3433
3530
|
code: g.invalid_type,
|
|
3434
|
-
expected:
|
|
3531
|
+
expected: _.null,
|
|
3435
3532
|
received: s.parsedType
|
|
3436
|
-
}),
|
|
3533
|
+
}), N;
|
|
3437
3534
|
}
|
|
3438
3535
|
return J(e.data);
|
|
3439
3536
|
}
|
|
3440
3537
|
}
|
|
3441
|
-
|
|
3442
|
-
typeName:
|
|
3538
|
+
Tt.create = (r) => new Tt({
|
|
3539
|
+
typeName: k.ZodNull,
|
|
3443
3540
|
...C(r)
|
|
3444
3541
|
});
|
|
3445
|
-
class
|
|
3542
|
+
class Ot extends R {
|
|
3446
3543
|
constructor() {
|
|
3447
3544
|
super(...arguments), this._any = !0;
|
|
3448
3545
|
}
|
|
@@ -3450,11 +3547,11 @@ class Et extends A {
|
|
|
3450
3547
|
return J(e.data);
|
|
3451
3548
|
}
|
|
3452
3549
|
}
|
|
3453
|
-
|
|
3454
|
-
typeName:
|
|
3550
|
+
Ot.create = (r) => new Ot({
|
|
3551
|
+
typeName: k.ZodAny,
|
|
3455
3552
|
...C(r)
|
|
3456
3553
|
});
|
|
3457
|
-
class
|
|
3554
|
+
class Pt extends R {
|
|
3458
3555
|
constructor() {
|
|
3459
3556
|
super(...arguments), this._unknown = !0;
|
|
3460
3557
|
}
|
|
@@ -3462,50 +3559,50 @@ class Ct extends A {
|
|
|
3462
3559
|
return J(e.data);
|
|
3463
3560
|
}
|
|
3464
3561
|
}
|
|
3465
|
-
|
|
3466
|
-
typeName:
|
|
3562
|
+
Pt.create = (r) => new Pt({
|
|
3563
|
+
typeName: k.ZodUnknown,
|
|
3467
3564
|
...C(r)
|
|
3468
3565
|
});
|
|
3469
|
-
class
|
|
3566
|
+
class oe extends R {
|
|
3470
3567
|
_parse(e) {
|
|
3471
3568
|
const t = this._getOrReturnCtx(e);
|
|
3472
3569
|
return y(t, {
|
|
3473
3570
|
code: g.invalid_type,
|
|
3474
|
-
expected:
|
|
3571
|
+
expected: _.never,
|
|
3475
3572
|
received: t.parsedType
|
|
3476
|
-
}),
|
|
3573
|
+
}), N;
|
|
3477
3574
|
}
|
|
3478
3575
|
}
|
|
3479
|
-
|
|
3480
|
-
typeName:
|
|
3576
|
+
oe.create = (r) => new oe({
|
|
3577
|
+
typeName: k.ZodNever,
|
|
3481
3578
|
...C(r)
|
|
3482
3579
|
});
|
|
3483
|
-
class
|
|
3580
|
+
class It extends R {
|
|
3484
3581
|
_parse(e) {
|
|
3485
|
-
if (this._getType(e) !==
|
|
3582
|
+
if (this._getType(e) !== _.undefined) {
|
|
3486
3583
|
const s = this._getOrReturnCtx(e);
|
|
3487
3584
|
return y(s, {
|
|
3488
3585
|
code: g.invalid_type,
|
|
3489
|
-
expected:
|
|
3586
|
+
expected: _.void,
|
|
3490
3587
|
received: s.parsedType
|
|
3491
|
-
}),
|
|
3588
|
+
}), N;
|
|
3492
3589
|
}
|
|
3493
3590
|
return J(e.data);
|
|
3494
3591
|
}
|
|
3495
3592
|
}
|
|
3496
|
-
|
|
3497
|
-
typeName:
|
|
3593
|
+
It.create = (r) => new It({
|
|
3594
|
+
typeName: k.ZodVoid,
|
|
3498
3595
|
...C(r)
|
|
3499
3596
|
});
|
|
3500
|
-
class X extends
|
|
3597
|
+
class X extends R {
|
|
3501
3598
|
_parse(e) {
|
|
3502
3599
|
const { ctx: t, status: s } = this._processInputParams(e), n = this._def;
|
|
3503
|
-
if (t.parsedType !==
|
|
3600
|
+
if (t.parsedType !== _.array)
|
|
3504
3601
|
return y(t, {
|
|
3505
3602
|
code: g.invalid_type,
|
|
3506
|
-
expected:
|
|
3603
|
+
expected: _.array,
|
|
3507
3604
|
received: t.parsedType
|
|
3508
|
-
}),
|
|
3605
|
+
}), N;
|
|
3509
3606
|
if (n.exactLength !== null) {
|
|
3510
3607
|
const d = t.data.length > n.exactLength.value, u = t.data.length < n.exactLength.value;
|
|
3511
3608
|
(d || u) && (y(t, {
|
|
@@ -3533,9 +3630,9 @@ class X extends A {
|
|
|
3533
3630
|
exact: !1,
|
|
3534
3631
|
message: n.maxLength.message
|
|
3535
3632
|
}), s.dirty()), t.common.async)
|
|
3536
|
-
return Promise.all([...t.data].map((d, u) => n.type._parseAsync(new
|
|
3537
|
-
const a = [...t.data].map((d, u) => n.type._parseSync(new
|
|
3538
|
-
return
|
|
3633
|
+
return Promise.all([...t.data].map((d, u) => n.type._parseAsync(new ie(t, d, t.path, u)))).then((d) => Q.mergeArray(s, d));
|
|
3634
|
+
const a = [...t.data].map((d, u) => n.type._parseSync(new ie(t, d, t.path, u)));
|
|
3635
|
+
return Q.mergeArray(s, a);
|
|
3539
3636
|
}
|
|
3540
3637
|
get element() {
|
|
3541
3638
|
return this._def.type;
|
|
@@ -3567,7 +3664,7 @@ X.create = (r, e) => new X({
|
|
|
3567
3664
|
minLength: null,
|
|
3568
3665
|
maxLength: null,
|
|
3569
3666
|
exactLength: null,
|
|
3570
|
-
typeName:
|
|
3667
|
+
typeName: k.ZodArray,
|
|
3571
3668
|
...C(e)
|
|
3572
3669
|
});
|
|
3573
3670
|
function ge(r) {
|
|
@@ -3575,7 +3672,7 @@ function ge(r) {
|
|
|
3575
3672
|
const e = {};
|
|
3576
3673
|
for (const t in r.shape) {
|
|
3577
3674
|
const s = r.shape[t];
|
|
3578
|
-
e[t] =
|
|
3675
|
+
e[t] = ae.create(ge(s));
|
|
3579
3676
|
}
|
|
3580
3677
|
return new z({
|
|
3581
3678
|
...r._def,
|
|
@@ -3584,9 +3681,9 @@ function ge(r) {
|
|
|
3584
3681
|
} else return r instanceof X ? new X({
|
|
3585
3682
|
...r._def,
|
|
3586
3683
|
type: ge(r.element)
|
|
3587
|
-
}) : r instanceof
|
|
3684
|
+
}) : r instanceof ae ? ae.create(ge(r.unwrap())) : r instanceof we ? we.create(ge(r.unwrap())) : r instanceof me ? me.create(r.items.map((e) => ge(e))) : r;
|
|
3588
3685
|
}
|
|
3589
|
-
class z extends
|
|
3686
|
+
class z extends R {
|
|
3590
3687
|
constructor() {
|
|
3591
3688
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
3592
3689
|
}
|
|
@@ -3597,49 +3694,49 @@ class z extends A {
|
|
|
3597
3694
|
return this._cached = { shape: e, keys: t }, this._cached;
|
|
3598
3695
|
}
|
|
3599
3696
|
_parse(e) {
|
|
3600
|
-
if (this._getType(e) !==
|
|
3601
|
-
const
|
|
3602
|
-
return y(
|
|
3697
|
+
if (this._getType(e) !== _.object) {
|
|
3698
|
+
const l = this._getOrReturnCtx(e);
|
|
3699
|
+
return y(l, {
|
|
3603
3700
|
code: g.invalid_type,
|
|
3604
|
-
expected:
|
|
3605
|
-
received:
|
|
3606
|
-
}),
|
|
3701
|
+
expected: _.object,
|
|
3702
|
+
received: l.parsedType
|
|
3703
|
+
}), N;
|
|
3607
3704
|
}
|
|
3608
3705
|
const { status: s, ctx: n } = this._processInputParams(e), { shape: a, keys: d } = this._getCached(), u = [];
|
|
3609
|
-
if (!(this._def.catchall instanceof
|
|
3610
|
-
for (const
|
|
3611
|
-
d.includes(
|
|
3706
|
+
if (!(this._def.catchall instanceof oe && this._def.unknownKeys === "strip"))
|
|
3707
|
+
for (const l in n.data)
|
|
3708
|
+
d.includes(l) || u.push(l);
|
|
3612
3709
|
const i = [];
|
|
3613
|
-
for (const
|
|
3614
|
-
const c = a[
|
|
3710
|
+
for (const l of d) {
|
|
3711
|
+
const c = a[l], f = n.data[l];
|
|
3615
3712
|
i.push({
|
|
3616
|
-
key: { status: "valid", value:
|
|
3617
|
-
value: c._parse(new
|
|
3618
|
-
alwaysSet:
|
|
3713
|
+
key: { status: "valid", value: l },
|
|
3714
|
+
value: c._parse(new ie(n, f, n.path, l)),
|
|
3715
|
+
alwaysSet: l in n.data
|
|
3619
3716
|
});
|
|
3620
3717
|
}
|
|
3621
|
-
if (this._def.catchall instanceof
|
|
3622
|
-
const
|
|
3623
|
-
if (
|
|
3718
|
+
if (this._def.catchall instanceof oe) {
|
|
3719
|
+
const l = this._def.unknownKeys;
|
|
3720
|
+
if (l === "passthrough")
|
|
3624
3721
|
for (const c of u)
|
|
3625
3722
|
i.push({
|
|
3626
3723
|
key: { status: "valid", value: c },
|
|
3627
3724
|
value: { status: "valid", value: n.data[c] }
|
|
3628
3725
|
});
|
|
3629
|
-
else if (
|
|
3726
|
+
else if (l === "strict")
|
|
3630
3727
|
u.length > 0 && (y(n, {
|
|
3631
3728
|
code: g.unrecognized_keys,
|
|
3632
3729
|
keys: u
|
|
3633
3730
|
}), s.dirty());
|
|
3634
|
-
else if (
|
|
3731
|
+
else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
|
|
3635
3732
|
} else {
|
|
3636
|
-
const
|
|
3733
|
+
const l = this._def.catchall;
|
|
3637
3734
|
for (const c of u) {
|
|
3638
3735
|
const f = n.data[c];
|
|
3639
3736
|
i.push({
|
|
3640
3737
|
key: { status: "valid", value: c },
|
|
3641
|
-
value:
|
|
3642
|
-
new
|
|
3738
|
+
value: l._parse(
|
|
3739
|
+
new ie(n, f, n.path, c)
|
|
3643
3740
|
//, ctx.child(key), value, getParsedType(value)
|
|
3644
3741
|
),
|
|
3645
3742
|
alwaysSet: c in n.data
|
|
@@ -3647,17 +3744,17 @@ class z extends A {
|
|
|
3647
3744
|
}
|
|
3648
3745
|
}
|
|
3649
3746
|
return n.common.async ? Promise.resolve().then(async () => {
|
|
3650
|
-
const
|
|
3747
|
+
const l = [];
|
|
3651
3748
|
for (const c of i) {
|
|
3652
3749
|
const f = await c.key, h = await c.value;
|
|
3653
|
-
|
|
3750
|
+
l.push({
|
|
3654
3751
|
key: f,
|
|
3655
3752
|
value: h,
|
|
3656
3753
|
alwaysSet: c.alwaysSet
|
|
3657
3754
|
});
|
|
3658
3755
|
}
|
|
3659
|
-
return
|
|
3660
|
-
}).then((
|
|
3756
|
+
return l;
|
|
3757
|
+
}).then((l) => Q.mergeObjectSync(s, l)) : Q.mergeObjectSync(s, i);
|
|
3661
3758
|
}
|
|
3662
3759
|
get shape() {
|
|
3663
3760
|
return this._def.shape();
|
|
@@ -3729,7 +3826,7 @@ class z extends A {
|
|
|
3729
3826
|
...this._def.shape(),
|
|
3730
3827
|
...e._def.shape()
|
|
3731
3828
|
}),
|
|
3732
|
-
typeName:
|
|
3829
|
+
typeName: k.ZodObject
|
|
3733
3830
|
});
|
|
3734
3831
|
}
|
|
3735
3832
|
// merge<
|
|
@@ -3839,7 +3936,7 @@ class z extends A {
|
|
|
3839
3936
|
t[s] = this.shape[s];
|
|
3840
3937
|
else {
|
|
3841
3938
|
let a = this.shape[s];
|
|
3842
|
-
for (; a instanceof
|
|
3939
|
+
for (; a instanceof ae; )
|
|
3843
3940
|
a = a._def.innerType;
|
|
3844
3941
|
t[s] = a;
|
|
3845
3942
|
}
|
|
@@ -3849,31 +3946,31 @@ class z extends A {
|
|
|
3849
3946
|
});
|
|
3850
3947
|
}
|
|
3851
3948
|
keyof() {
|
|
3852
|
-
return
|
|
3949
|
+
return ur(T.objectKeys(this.shape));
|
|
3853
3950
|
}
|
|
3854
3951
|
}
|
|
3855
3952
|
z.create = (r, e) => new z({
|
|
3856
3953
|
shape: () => r,
|
|
3857
3954
|
unknownKeys: "strip",
|
|
3858
|
-
catchall:
|
|
3859
|
-
typeName:
|
|
3955
|
+
catchall: oe.create(),
|
|
3956
|
+
typeName: k.ZodObject,
|
|
3860
3957
|
...C(e)
|
|
3861
3958
|
});
|
|
3862
3959
|
z.strictCreate = (r, e) => new z({
|
|
3863
3960
|
shape: () => r,
|
|
3864
3961
|
unknownKeys: "strict",
|
|
3865
|
-
catchall:
|
|
3866
|
-
typeName:
|
|
3962
|
+
catchall: oe.create(),
|
|
3963
|
+
typeName: k.ZodObject,
|
|
3867
3964
|
...C(e)
|
|
3868
3965
|
});
|
|
3869
3966
|
z.lazycreate = (r, e) => new z({
|
|
3870
3967
|
shape: r,
|
|
3871
3968
|
unknownKeys: "strip",
|
|
3872
|
-
catchall:
|
|
3873
|
-
typeName:
|
|
3969
|
+
catchall: oe.create(),
|
|
3970
|
+
typeName: k.ZodObject,
|
|
3874
3971
|
...C(e)
|
|
3875
3972
|
});
|
|
3876
|
-
class
|
|
3973
|
+
class Ye extends R {
|
|
3877
3974
|
_parse(e) {
|
|
3878
3975
|
const { ctx: t } = this._processInputParams(e), s = this._def.options;
|
|
3879
3976
|
function n(a) {
|
|
@@ -3887,7 +3984,7 @@ class We extends A {
|
|
|
3887
3984
|
return y(t, {
|
|
3888
3985
|
code: g.invalid_union,
|
|
3889
3986
|
unionErrors: d
|
|
3890
|
-
}),
|
|
3987
|
+
}), N;
|
|
3891
3988
|
}
|
|
3892
3989
|
if (t.common.async)
|
|
3893
3990
|
return Promise.all(s.map(async (a) => {
|
|
@@ -3912,7 +4009,7 @@ class We extends A {
|
|
|
3912
4009
|
let a;
|
|
3913
4010
|
const d = [];
|
|
3914
4011
|
for (const i of s) {
|
|
3915
|
-
const
|
|
4012
|
+
const l = {
|
|
3916
4013
|
...t,
|
|
3917
4014
|
common: {
|
|
3918
4015
|
...t.common,
|
|
@@ -3922,11 +4019,11 @@ class We extends A {
|
|
|
3922
4019
|
}, c = i._parseSync({
|
|
3923
4020
|
data: t.data,
|
|
3924
4021
|
path: t.path,
|
|
3925
|
-
parent:
|
|
4022
|
+
parent: l
|
|
3926
4023
|
});
|
|
3927
4024
|
if (c.status === "valid")
|
|
3928
4025
|
return c;
|
|
3929
|
-
c.status === "dirty" && !a && (a = { result: c, ctx:
|
|
4026
|
+
c.status === "dirty" && !a && (a = { result: c, ctx: l }), l.common.issues.length && d.push(l.common.issues);
|
|
3930
4027
|
}
|
|
3931
4028
|
if (a)
|
|
3932
4029
|
return t.common.issues.push(...a.ctx.common.issues), a.result;
|
|
@@ -3934,53 +4031,53 @@ class We extends A {
|
|
|
3934
4031
|
return y(t, {
|
|
3935
4032
|
code: g.invalid_union,
|
|
3936
4033
|
unionErrors: u
|
|
3937
|
-
}),
|
|
4034
|
+
}), N;
|
|
3938
4035
|
}
|
|
3939
4036
|
}
|
|
3940
4037
|
get options() {
|
|
3941
4038
|
return this._def.options;
|
|
3942
4039
|
}
|
|
3943
4040
|
}
|
|
3944
|
-
|
|
4041
|
+
Ye.create = (r, e) => new Ye({
|
|
3945
4042
|
options: r,
|
|
3946
|
-
typeName:
|
|
4043
|
+
typeName: k.ZodUnion,
|
|
3947
4044
|
...C(e)
|
|
3948
4045
|
});
|
|
3949
|
-
function
|
|
4046
|
+
function at(r, e) {
|
|
3950
4047
|
const t = re(r), s = re(e);
|
|
3951
4048
|
if (r === e)
|
|
3952
4049
|
return { valid: !0, data: r };
|
|
3953
|
-
if (t ===
|
|
4050
|
+
if (t === _.object && s === _.object) {
|
|
3954
4051
|
const n = T.objectKeys(e), a = T.objectKeys(r).filter((u) => n.indexOf(u) !== -1), d = { ...r, ...e };
|
|
3955
4052
|
for (const u of a) {
|
|
3956
|
-
const i =
|
|
4053
|
+
const i = at(r[u], e[u]);
|
|
3957
4054
|
if (!i.valid)
|
|
3958
4055
|
return { valid: !1 };
|
|
3959
4056
|
d[u] = i.data;
|
|
3960
4057
|
}
|
|
3961
4058
|
return { valid: !0, data: d };
|
|
3962
|
-
} else if (t ===
|
|
4059
|
+
} else if (t === _.array && s === _.array) {
|
|
3963
4060
|
if (r.length !== e.length)
|
|
3964
4061
|
return { valid: !1 };
|
|
3965
4062
|
const n = [];
|
|
3966
4063
|
for (let a = 0; a < r.length; a++) {
|
|
3967
|
-
const d = r[a], u = e[a], i =
|
|
4064
|
+
const d = r[a], u = e[a], i = at(d, u);
|
|
3968
4065
|
if (!i.valid)
|
|
3969
4066
|
return { valid: !1 };
|
|
3970
4067
|
n.push(i.data);
|
|
3971
4068
|
}
|
|
3972
4069
|
return { valid: !0, data: n };
|
|
3973
|
-
} else return t ===
|
|
4070
|
+
} else return t === _.date && s === _.date && +r == +e ? { valid: !0, data: r } : { valid: !1 };
|
|
3974
4071
|
}
|
|
3975
|
-
class
|
|
4072
|
+
class Ge extends R {
|
|
3976
4073
|
_parse(e) {
|
|
3977
4074
|
const { status: t, ctx: s } = this._processInputParams(e), n = (a, d) => {
|
|
3978
|
-
if (
|
|
3979
|
-
return
|
|
3980
|
-
const u =
|
|
3981
|
-
return u.valid ? ((
|
|
4075
|
+
if (Et(a) || Et(d))
|
|
4076
|
+
return N;
|
|
4077
|
+
const u = at(a.value, d.value);
|
|
4078
|
+
return u.valid ? ((Ct(a) || Ct(d)) && t.dirty(), { status: t.value, value: u.data }) : (y(s, {
|
|
3982
4079
|
code: g.invalid_intersection_types
|
|
3983
|
-
}),
|
|
4080
|
+
}), N);
|
|
3984
4081
|
};
|
|
3985
4082
|
return s.common.async ? Promise.all([
|
|
3986
4083
|
this._def.left._parseAsync({
|
|
@@ -4004,21 +4101,21 @@ class qe extends A {
|
|
|
4004
4101
|
}));
|
|
4005
4102
|
}
|
|
4006
4103
|
}
|
|
4007
|
-
|
|
4104
|
+
Ge.create = (r, e, t) => new Ge({
|
|
4008
4105
|
left: r,
|
|
4009
4106
|
right: e,
|
|
4010
|
-
typeName:
|
|
4107
|
+
typeName: k.ZodIntersection,
|
|
4011
4108
|
...C(t)
|
|
4012
4109
|
});
|
|
4013
|
-
class me extends
|
|
4110
|
+
class me extends R {
|
|
4014
4111
|
_parse(e) {
|
|
4015
4112
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
4016
|
-
if (s.parsedType !==
|
|
4113
|
+
if (s.parsedType !== _.array)
|
|
4017
4114
|
return y(s, {
|
|
4018
4115
|
code: g.invalid_type,
|
|
4019
|
-
expected:
|
|
4116
|
+
expected: _.array,
|
|
4020
4117
|
received: s.parsedType
|
|
4021
|
-
}),
|
|
4118
|
+
}), N;
|
|
4022
4119
|
if (s.data.length < this._def.items.length)
|
|
4023
4120
|
return y(s, {
|
|
4024
4121
|
code: g.too_small,
|
|
@@ -4026,7 +4123,7 @@ class me extends A {
|
|
|
4026
4123
|
inclusive: !0,
|
|
4027
4124
|
exact: !1,
|
|
4028
4125
|
type: "array"
|
|
4029
|
-
}),
|
|
4126
|
+
}), N;
|
|
4030
4127
|
!this._def.rest && s.data.length > this._def.items.length && (y(s, {
|
|
4031
4128
|
code: g.too_big,
|
|
4032
4129
|
maximum: this._def.items.length,
|
|
@@ -4036,9 +4133,9 @@ class me extends A {
|
|
|
4036
4133
|
}), t.dirty());
|
|
4037
4134
|
const a = [...s.data].map((d, u) => {
|
|
4038
4135
|
const i = this._def.items[u] || this._def.rest;
|
|
4039
|
-
return i ? i._parse(new
|
|
4136
|
+
return i ? i._parse(new ie(s, d, s.path, u)) : null;
|
|
4040
4137
|
}).filter((d) => !!d);
|
|
4041
|
-
return s.common.async ? Promise.all(a).then((d) =>
|
|
4138
|
+
return s.common.async ? Promise.all(a).then((d) => Q.mergeArray(t, d)) : Q.mergeArray(t, a);
|
|
4042
4139
|
}
|
|
4043
4140
|
get items() {
|
|
4044
4141
|
return this._def.items;
|
|
@@ -4055,12 +4152,12 @@ me.create = (r, e) => {
|
|
|
4055
4152
|
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
4056
4153
|
return new me({
|
|
4057
4154
|
items: r,
|
|
4058
|
-
typeName:
|
|
4155
|
+
typeName: k.ZodTuple,
|
|
4059
4156
|
rest: null,
|
|
4060
4157
|
...C(e)
|
|
4061
4158
|
});
|
|
4062
4159
|
};
|
|
4063
|
-
class
|
|
4160
|
+
class Mt extends R {
|
|
4064
4161
|
get keySchema() {
|
|
4065
4162
|
return this._def.keyType;
|
|
4066
4163
|
}
|
|
@@ -4069,54 +4166,54 @@ class Rt extends A {
|
|
|
4069
4166
|
}
|
|
4070
4167
|
_parse(e) {
|
|
4071
4168
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
4072
|
-
if (s.parsedType !==
|
|
4169
|
+
if (s.parsedType !== _.map)
|
|
4073
4170
|
return y(s, {
|
|
4074
4171
|
code: g.invalid_type,
|
|
4075
|
-
expected:
|
|
4172
|
+
expected: _.map,
|
|
4076
4173
|
received: s.parsedType
|
|
4077
|
-
}),
|
|
4078
|
-
const n = this._def.keyType, a = this._def.valueType, d = [...s.data.entries()].map(([u, i],
|
|
4079
|
-
key: n._parse(new
|
|
4080
|
-
value: a._parse(new
|
|
4174
|
+
}), N;
|
|
4175
|
+
const n = this._def.keyType, a = this._def.valueType, d = [...s.data.entries()].map(([u, i], l) => ({
|
|
4176
|
+
key: n._parse(new ie(s, u, s.path, [l, "key"])),
|
|
4177
|
+
value: a._parse(new ie(s, i, s.path, [l, "value"]))
|
|
4081
4178
|
}));
|
|
4082
4179
|
if (s.common.async) {
|
|
4083
4180
|
const u = /* @__PURE__ */ new Map();
|
|
4084
4181
|
return Promise.resolve().then(async () => {
|
|
4085
4182
|
for (const i of d) {
|
|
4086
|
-
const
|
|
4087
|
-
if (
|
|
4088
|
-
return
|
|
4089
|
-
(
|
|
4183
|
+
const l = await i.key, c = await i.value;
|
|
4184
|
+
if (l.status === "aborted" || c.status === "aborted")
|
|
4185
|
+
return N;
|
|
4186
|
+
(l.status === "dirty" || c.status === "dirty") && t.dirty(), u.set(l.value, c.value);
|
|
4090
4187
|
}
|
|
4091
4188
|
return { status: t.value, value: u };
|
|
4092
4189
|
});
|
|
4093
4190
|
} else {
|
|
4094
4191
|
const u = /* @__PURE__ */ new Map();
|
|
4095
4192
|
for (const i of d) {
|
|
4096
|
-
const
|
|
4097
|
-
if (
|
|
4098
|
-
return
|
|
4099
|
-
(
|
|
4193
|
+
const l = i.key, c = i.value;
|
|
4194
|
+
if (l.status === "aborted" || c.status === "aborted")
|
|
4195
|
+
return N;
|
|
4196
|
+
(l.status === "dirty" || c.status === "dirty") && t.dirty(), u.set(l.value, c.value);
|
|
4100
4197
|
}
|
|
4101
4198
|
return { status: t.value, value: u };
|
|
4102
4199
|
}
|
|
4103
4200
|
}
|
|
4104
4201
|
}
|
|
4105
|
-
|
|
4202
|
+
Mt.create = (r, e, t) => new Mt({
|
|
4106
4203
|
valueType: e,
|
|
4107
4204
|
keyType: r,
|
|
4108
|
-
typeName:
|
|
4205
|
+
typeName: k.ZodMap,
|
|
4109
4206
|
...C(t)
|
|
4110
4207
|
});
|
|
4111
|
-
class
|
|
4208
|
+
class $e extends R {
|
|
4112
4209
|
_parse(e) {
|
|
4113
4210
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
4114
|
-
if (s.parsedType !==
|
|
4211
|
+
if (s.parsedType !== _.set)
|
|
4115
4212
|
return y(s, {
|
|
4116
4213
|
code: g.invalid_type,
|
|
4117
|
-
expected:
|
|
4214
|
+
expected: _.set,
|
|
4118
4215
|
received: s.parsedType
|
|
4119
|
-
}),
|
|
4216
|
+
}), N;
|
|
4120
4217
|
const n = this._def;
|
|
4121
4218
|
n.minSize !== null && s.data.size < n.minSize.value && (y(s, {
|
|
4122
4219
|
code: g.too_small,
|
|
@@ -4135,25 +4232,25 @@ class Me extends A {
|
|
|
4135
4232
|
}), t.dirty());
|
|
4136
4233
|
const a = this._def.valueType;
|
|
4137
4234
|
function d(i) {
|
|
4138
|
-
const
|
|
4235
|
+
const l = /* @__PURE__ */ new Set();
|
|
4139
4236
|
for (const c of i) {
|
|
4140
4237
|
if (c.status === "aborted")
|
|
4141
|
-
return
|
|
4142
|
-
c.status === "dirty" && t.dirty(),
|
|
4238
|
+
return N;
|
|
4239
|
+
c.status === "dirty" && t.dirty(), l.add(c.value);
|
|
4143
4240
|
}
|
|
4144
|
-
return { status: t.value, value:
|
|
4241
|
+
return { status: t.value, value: l };
|
|
4145
4242
|
}
|
|
4146
|
-
const u = [...s.data.values()].map((i,
|
|
4243
|
+
const u = [...s.data.values()].map((i, l) => a._parse(new ie(s, i, s.path, l)));
|
|
4147
4244
|
return s.common.async ? Promise.all(u).then((i) => d(i)) : d(u);
|
|
4148
4245
|
}
|
|
4149
4246
|
min(e, t) {
|
|
4150
|
-
return new
|
|
4247
|
+
return new $e({
|
|
4151
4248
|
...this._def,
|
|
4152
4249
|
minSize: { value: e, message: b.toString(t) }
|
|
4153
4250
|
});
|
|
4154
4251
|
}
|
|
4155
4252
|
max(e, t) {
|
|
4156
|
-
return new
|
|
4253
|
+
return new $e({
|
|
4157
4254
|
...this._def,
|
|
4158
4255
|
maxSize: { value: e, message: b.toString(t) }
|
|
4159
4256
|
});
|
|
@@ -4165,14 +4262,14 @@ class Me extends A {
|
|
|
4165
4262
|
return this.min(1, e);
|
|
4166
4263
|
}
|
|
4167
4264
|
}
|
|
4168
|
-
|
|
4265
|
+
$e.create = (r, e) => new $e({
|
|
4169
4266
|
valueType: r,
|
|
4170
4267
|
minSize: null,
|
|
4171
4268
|
maxSize: null,
|
|
4172
|
-
typeName:
|
|
4269
|
+
typeName: k.ZodSet,
|
|
4173
4270
|
...C(e)
|
|
4174
4271
|
});
|
|
4175
|
-
class
|
|
4272
|
+
class Lt extends R {
|
|
4176
4273
|
get schema() {
|
|
4177
4274
|
return this._def.getter();
|
|
4178
4275
|
}
|
|
@@ -4181,12 +4278,12 @@ class At extends A {
|
|
|
4181
4278
|
return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
|
|
4182
4279
|
}
|
|
4183
4280
|
}
|
|
4184
|
-
|
|
4281
|
+
Lt.create = (r, e) => new Lt({
|
|
4185
4282
|
getter: r,
|
|
4186
|
-
typeName:
|
|
4283
|
+
typeName: k.ZodLazy,
|
|
4187
4284
|
...C(e)
|
|
4188
4285
|
});
|
|
4189
|
-
class
|
|
4286
|
+
class $t extends R {
|
|
4190
4287
|
_parse(e) {
|
|
4191
4288
|
if (e.data !== this._def.value) {
|
|
4192
4289
|
const t = this._getOrReturnCtx(e);
|
|
@@ -4194,7 +4291,7 @@ class Tt extends A {
|
|
|
4194
4291
|
received: t.data,
|
|
4195
4292
|
code: g.invalid_literal,
|
|
4196
4293
|
expected: this._def.value
|
|
4197
|
-
}),
|
|
4294
|
+
}), N;
|
|
4198
4295
|
}
|
|
4199
4296
|
return { status: "valid", value: e.data };
|
|
4200
4297
|
}
|
|
@@ -4202,19 +4299,19 @@ class Tt extends A {
|
|
|
4202
4299
|
return this._def.value;
|
|
4203
4300
|
}
|
|
4204
4301
|
}
|
|
4205
|
-
|
|
4302
|
+
$t.create = (r, e) => new $t({
|
|
4206
4303
|
value: r,
|
|
4207
|
-
typeName:
|
|
4304
|
+
typeName: k.ZodLiteral,
|
|
4208
4305
|
...C(e)
|
|
4209
4306
|
});
|
|
4210
|
-
function
|
|
4307
|
+
function ur(r, e) {
|
|
4211
4308
|
return new _e({
|
|
4212
4309
|
values: r,
|
|
4213
|
-
typeName:
|
|
4310
|
+
typeName: k.ZodEnum,
|
|
4214
4311
|
...C(e)
|
|
4215
4312
|
});
|
|
4216
4313
|
}
|
|
4217
|
-
class _e extends
|
|
4314
|
+
class _e extends R {
|
|
4218
4315
|
_parse(e) {
|
|
4219
4316
|
if (typeof e.data != "string") {
|
|
4220
4317
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
@@ -4222,7 +4319,7 @@ class _e extends A {
|
|
|
4222
4319
|
expected: T.joinValues(s),
|
|
4223
4320
|
received: t.parsedType,
|
|
4224
4321
|
code: g.invalid_type
|
|
4225
|
-
}),
|
|
4322
|
+
}), N;
|
|
4226
4323
|
}
|
|
4227
4324
|
if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
|
|
4228
4325
|
const t = this._getOrReturnCtx(e), s = this._def.values;
|
|
@@ -4230,7 +4327,7 @@ class _e extends A {
|
|
|
4230
4327
|
received: t.data,
|
|
4231
4328
|
code: g.invalid_enum_value,
|
|
4232
4329
|
options: s
|
|
4233
|
-
}),
|
|
4330
|
+
}), N;
|
|
4234
4331
|
}
|
|
4235
4332
|
return J(e.data);
|
|
4236
4333
|
}
|
|
@@ -4268,17 +4365,17 @@ class _e extends A {
|
|
|
4268
4365
|
});
|
|
4269
4366
|
}
|
|
4270
4367
|
}
|
|
4271
|
-
_e.create =
|
|
4272
|
-
class
|
|
4368
|
+
_e.create = ur;
|
|
4369
|
+
class Ft extends R {
|
|
4273
4370
|
_parse(e) {
|
|
4274
4371
|
const t = T.getValidEnumValues(this._def.values), s = this._getOrReturnCtx(e);
|
|
4275
|
-
if (s.parsedType !==
|
|
4372
|
+
if (s.parsedType !== _.string && s.parsedType !== _.number) {
|
|
4276
4373
|
const n = T.objectValues(t);
|
|
4277
4374
|
return y(s, {
|
|
4278
4375
|
expected: T.joinValues(n),
|
|
4279
4376
|
received: s.parsedType,
|
|
4280
4377
|
code: g.invalid_type
|
|
4281
|
-
}),
|
|
4378
|
+
}), N;
|
|
4282
4379
|
}
|
|
4283
4380
|
if (this._cache || (this._cache = new Set(T.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
|
|
4284
4381
|
const n = T.objectValues(t);
|
|
@@ -4286,7 +4383,7 @@ class Ot extends A {
|
|
|
4286
4383
|
received: s.data,
|
|
4287
4384
|
code: g.invalid_enum_value,
|
|
4288
4385
|
options: n
|
|
4289
|
-
}),
|
|
4386
|
+
}), N;
|
|
4290
4387
|
}
|
|
4291
4388
|
return J(e.data);
|
|
4292
4389
|
}
|
|
@@ -4294,41 +4391,41 @@ class Ot extends A {
|
|
|
4294
4391
|
return this._def.values;
|
|
4295
4392
|
}
|
|
4296
4393
|
}
|
|
4297
|
-
|
|
4394
|
+
Ft.create = (r, e) => new Ft({
|
|
4298
4395
|
values: r,
|
|
4299
|
-
typeName:
|
|
4396
|
+
typeName: k.ZodNativeEnum,
|
|
4300
4397
|
...C(e)
|
|
4301
4398
|
});
|
|
4302
|
-
class
|
|
4399
|
+
class Qe extends R {
|
|
4303
4400
|
unwrap() {
|
|
4304
4401
|
return this._def.type;
|
|
4305
4402
|
}
|
|
4306
4403
|
_parse(e) {
|
|
4307
4404
|
const { ctx: t } = this._processInputParams(e);
|
|
4308
|
-
if (t.parsedType !==
|
|
4405
|
+
if (t.parsedType !== _.promise && t.common.async === !1)
|
|
4309
4406
|
return y(t, {
|
|
4310
4407
|
code: g.invalid_type,
|
|
4311
|
-
expected:
|
|
4408
|
+
expected: _.promise,
|
|
4312
4409
|
received: t.parsedType
|
|
4313
|
-
}),
|
|
4314
|
-
const s = t.parsedType ===
|
|
4410
|
+
}), N;
|
|
4411
|
+
const s = t.parsedType === _.promise ? t.data : Promise.resolve(t.data);
|
|
4315
4412
|
return J(s.then((n) => this._def.type.parseAsync(n, {
|
|
4316
4413
|
path: t.path,
|
|
4317
4414
|
errorMap: t.common.contextualErrorMap
|
|
4318
4415
|
})));
|
|
4319
4416
|
}
|
|
4320
4417
|
}
|
|
4321
|
-
|
|
4418
|
+
Qe.create = (r, e) => new Qe({
|
|
4322
4419
|
type: r,
|
|
4323
|
-
typeName:
|
|
4420
|
+
typeName: k.ZodPromise,
|
|
4324
4421
|
...C(e)
|
|
4325
4422
|
});
|
|
4326
|
-
class be extends
|
|
4423
|
+
class be extends R {
|
|
4327
4424
|
innerType() {
|
|
4328
4425
|
return this._def.schema;
|
|
4329
4426
|
}
|
|
4330
4427
|
sourceType() {
|
|
4331
|
-
return this._def.schema._def.typeName ===
|
|
4428
|
+
return this._def.schema._def.typeName === k.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
4332
4429
|
}
|
|
4333
4430
|
_parse(e) {
|
|
4334
4431
|
const { status: t, ctx: s } = this._processInputParams(e), n = this._def.effect || null, a = {
|
|
@@ -4344,23 +4441,23 @@ class be extends A {
|
|
|
4344
4441
|
if (s.common.async)
|
|
4345
4442
|
return Promise.resolve(d).then(async (u) => {
|
|
4346
4443
|
if (t.value === "aborted")
|
|
4347
|
-
return
|
|
4444
|
+
return N;
|
|
4348
4445
|
const i = await this._def.schema._parseAsync({
|
|
4349
4446
|
data: u,
|
|
4350
4447
|
path: s.path,
|
|
4351
4448
|
parent: s
|
|
4352
4449
|
});
|
|
4353
|
-
return i.status === "aborted" ?
|
|
4450
|
+
return i.status === "aborted" ? N : i.status === "dirty" || t.value === "dirty" ? Ie(i.value) : i;
|
|
4354
4451
|
});
|
|
4355
4452
|
{
|
|
4356
4453
|
if (t.value === "aborted")
|
|
4357
|
-
return
|
|
4454
|
+
return N;
|
|
4358
4455
|
const u = this._def.schema._parseSync({
|
|
4359
4456
|
data: d,
|
|
4360
4457
|
path: s.path,
|
|
4361
4458
|
parent: s
|
|
4362
4459
|
});
|
|
4363
|
-
return u.status === "aborted" ?
|
|
4460
|
+
return u.status === "aborted" ? N : u.status === "dirty" || t.value === "dirty" ? Ie(u.value) : u;
|
|
4364
4461
|
}
|
|
4365
4462
|
}
|
|
4366
4463
|
if (n.type === "refinement") {
|
|
@@ -4378,9 +4475,9 @@ class be extends A {
|
|
|
4378
4475
|
path: s.path,
|
|
4379
4476
|
parent: s
|
|
4380
4477
|
});
|
|
4381
|
-
return u.status === "aborted" ?
|
|
4478
|
+
return u.status === "aborted" ? N : (u.status === "dirty" && t.dirty(), d(u.value), { status: t.value, value: u.value });
|
|
4382
4479
|
} else
|
|
4383
|
-
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((u) => u.status === "aborted" ?
|
|
4480
|
+
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((u) => u.status === "aborted" ? N : (u.status === "dirty" && t.dirty(), d(u.value).then(() => ({ status: t.value, value: u.value }))));
|
|
4384
4481
|
}
|
|
4385
4482
|
if (n.type === "transform")
|
|
4386
4483
|
if (s.common.async === !1) {
|
|
@@ -4390,7 +4487,7 @@ class be extends A {
|
|
|
4390
4487
|
parent: s
|
|
4391
4488
|
});
|
|
4392
4489
|
if (!ye(d))
|
|
4393
|
-
return
|
|
4490
|
+
return N;
|
|
4394
4491
|
const u = n.transform(d.value, a);
|
|
4395
4492
|
if (u instanceof Promise)
|
|
4396
4493
|
throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
@@ -4399,38 +4496,38 @@ class be extends A {
|
|
|
4399
4496
|
return this._def.schema._parseAsync({ data: s.data, path: s.path, parent: s }).then((d) => ye(d) ? Promise.resolve(n.transform(d.value, a)).then((u) => ({
|
|
4400
4497
|
status: t.value,
|
|
4401
4498
|
value: u
|
|
4402
|
-
})) :
|
|
4499
|
+
})) : N);
|
|
4403
4500
|
T.assertNever(n);
|
|
4404
4501
|
}
|
|
4405
4502
|
}
|
|
4406
4503
|
be.create = (r, e, t) => new be({
|
|
4407
4504
|
schema: r,
|
|
4408
|
-
typeName:
|
|
4505
|
+
typeName: k.ZodEffects,
|
|
4409
4506
|
effect: e,
|
|
4410
4507
|
...C(t)
|
|
4411
4508
|
});
|
|
4412
4509
|
be.createWithPreprocess = (r, e, t) => new be({
|
|
4413
4510
|
schema: e,
|
|
4414
4511
|
effect: { type: "preprocess", transform: r },
|
|
4415
|
-
typeName:
|
|
4512
|
+
typeName: k.ZodEffects,
|
|
4416
4513
|
...C(t)
|
|
4417
4514
|
});
|
|
4418
|
-
class
|
|
4515
|
+
class ae extends R {
|
|
4419
4516
|
_parse(e) {
|
|
4420
|
-
return this._getType(e) ===
|
|
4517
|
+
return this._getType(e) === _.undefined ? J(void 0) : this._def.innerType._parse(e);
|
|
4421
4518
|
}
|
|
4422
4519
|
unwrap() {
|
|
4423
4520
|
return this._def.innerType;
|
|
4424
4521
|
}
|
|
4425
4522
|
}
|
|
4426
|
-
|
|
4523
|
+
ae.create = (r, e) => new ae({
|
|
4427
4524
|
innerType: r,
|
|
4428
|
-
typeName:
|
|
4525
|
+
typeName: k.ZodOptional,
|
|
4429
4526
|
...C(e)
|
|
4430
4527
|
});
|
|
4431
|
-
class we extends
|
|
4528
|
+
class we extends R {
|
|
4432
4529
|
_parse(e) {
|
|
4433
|
-
return this._getType(e) ===
|
|
4530
|
+
return this._getType(e) === _.null ? J(null) : this._def.innerType._parse(e);
|
|
4434
4531
|
}
|
|
4435
4532
|
unwrap() {
|
|
4436
4533
|
return this._def.innerType;
|
|
@@ -4438,14 +4535,14 @@ class we extends A {
|
|
|
4438
4535
|
}
|
|
4439
4536
|
we.create = (r, e) => new we({
|
|
4440
4537
|
innerType: r,
|
|
4441
|
-
typeName:
|
|
4538
|
+
typeName: k.ZodNullable,
|
|
4442
4539
|
...C(e)
|
|
4443
4540
|
});
|
|
4444
|
-
class
|
|
4541
|
+
class it extends R {
|
|
4445
4542
|
_parse(e) {
|
|
4446
4543
|
const { ctx: t } = this._processInputParams(e);
|
|
4447
4544
|
let s = t.data;
|
|
4448
|
-
return t.parsedType ===
|
|
4545
|
+
return t.parsedType === _.undefined && (s = this._def.defaultValue()), this._def.innerType._parse({
|
|
4449
4546
|
data: s,
|
|
4450
4547
|
path: t.path,
|
|
4451
4548
|
parent: t
|
|
@@ -4455,13 +4552,13 @@ class st extends A {
|
|
|
4455
4552
|
return this._def.innerType;
|
|
4456
4553
|
}
|
|
4457
4554
|
}
|
|
4458
|
-
|
|
4555
|
+
it.create = (r, e) => new it({
|
|
4459
4556
|
innerType: r,
|
|
4460
|
-
typeName:
|
|
4557
|
+
typeName: k.ZodDefault,
|
|
4461
4558
|
defaultValue: typeof e.default == "function" ? e.default : () => e.default,
|
|
4462
4559
|
...C(e)
|
|
4463
4560
|
});
|
|
4464
|
-
class
|
|
4561
|
+
class ot extends R {
|
|
4465
4562
|
_parse(e) {
|
|
4466
4563
|
const { ctx: t } = this._processInputParams(e), s = {
|
|
4467
4564
|
...t,
|
|
@@ -4476,7 +4573,7 @@ class nt extends A {
|
|
|
4476
4573
|
...s
|
|
4477
4574
|
}
|
|
4478
4575
|
});
|
|
4479
|
-
return
|
|
4576
|
+
return We(n) ? n.then((a) => ({
|
|
4480
4577
|
status: "valid",
|
|
4481
4578
|
value: a.status === "valid" ? a.value : this._def.catchValue({
|
|
4482
4579
|
get error() {
|
|
@@ -4498,30 +4595,30 @@ class nt extends A {
|
|
|
4498
4595
|
return this._def.innerType;
|
|
4499
4596
|
}
|
|
4500
4597
|
}
|
|
4501
|
-
|
|
4598
|
+
ot.create = (r, e) => new ot({
|
|
4502
4599
|
innerType: r,
|
|
4503
|
-
typeName:
|
|
4600
|
+
typeName: k.ZodCatch,
|
|
4504
4601
|
catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
|
|
4505
4602
|
...C(e)
|
|
4506
4603
|
});
|
|
4507
|
-
class
|
|
4604
|
+
class Zt extends R {
|
|
4508
4605
|
_parse(e) {
|
|
4509
|
-
if (this._getType(e) !==
|
|
4606
|
+
if (this._getType(e) !== _.nan) {
|
|
4510
4607
|
const s = this._getOrReturnCtx(e);
|
|
4511
4608
|
return y(s, {
|
|
4512
4609
|
code: g.invalid_type,
|
|
4513
|
-
expected:
|
|
4610
|
+
expected: _.nan,
|
|
4514
4611
|
received: s.parsedType
|
|
4515
|
-
}),
|
|
4612
|
+
}), N;
|
|
4516
4613
|
}
|
|
4517
4614
|
return { status: "valid", value: e.data };
|
|
4518
4615
|
}
|
|
4519
4616
|
}
|
|
4520
|
-
|
|
4521
|
-
typeName:
|
|
4617
|
+
Zt.create = (r) => new Zt({
|
|
4618
|
+
typeName: k.ZodNaN,
|
|
4522
4619
|
...C(r)
|
|
4523
4620
|
});
|
|
4524
|
-
class
|
|
4621
|
+
class nn extends R {
|
|
4525
4622
|
_parse(e) {
|
|
4526
4623
|
const { ctx: t } = this._processInputParams(e), s = t.data;
|
|
4527
4624
|
return this._def.type._parse({
|
|
@@ -4534,7 +4631,7 @@ class Vs extends A {
|
|
|
4534
4631
|
return this._def.type;
|
|
4535
4632
|
}
|
|
4536
4633
|
}
|
|
4537
|
-
class
|
|
4634
|
+
class gt extends R {
|
|
4538
4635
|
_parse(e) {
|
|
4539
4636
|
const { status: t, ctx: s } = this._processInputParams(e);
|
|
4540
4637
|
if (s.common.async)
|
|
@@ -4544,7 +4641,7 @@ class dt extends A {
|
|
|
4544
4641
|
path: s.path,
|
|
4545
4642
|
parent: s
|
|
4546
4643
|
});
|
|
4547
|
-
return a.status === "aborted" ?
|
|
4644
|
+
return a.status === "aborted" ? N : a.status === "dirty" ? (t.dirty(), Ie(a.value)) : this._def.out._parseAsync({
|
|
4548
4645
|
data: a.value,
|
|
4549
4646
|
path: s.path,
|
|
4550
4647
|
parent: s
|
|
@@ -4556,7 +4653,7 @@ class dt extends A {
|
|
|
4556
4653
|
path: s.path,
|
|
4557
4654
|
parent: s
|
|
4558
4655
|
});
|
|
4559
|
-
return n.status === "aborted" ?
|
|
4656
|
+
return n.status === "aborted" ? N : n.status === "dirty" ? (t.dirty(), {
|
|
4560
4657
|
status: "dirty",
|
|
4561
4658
|
value: n.value
|
|
4562
4659
|
}) : this._def.out._parseSync({
|
|
@@ -4567,73 +4664,73 @@ class dt extends A {
|
|
|
4567
4664
|
}
|
|
4568
4665
|
}
|
|
4569
4666
|
static create(e, t) {
|
|
4570
|
-
return new
|
|
4667
|
+
return new gt({
|
|
4571
4668
|
in: e,
|
|
4572
4669
|
out: t,
|
|
4573
|
-
typeName:
|
|
4670
|
+
typeName: k.ZodPipeline
|
|
4574
4671
|
});
|
|
4575
4672
|
}
|
|
4576
4673
|
}
|
|
4577
|
-
class
|
|
4674
|
+
class lt extends R {
|
|
4578
4675
|
_parse(e) {
|
|
4579
4676
|
const t = this._def.innerType._parse(e), s = (n) => (ye(n) && (n.value = Object.freeze(n.value)), n);
|
|
4580
|
-
return
|
|
4677
|
+
return We(t) ? t.then((n) => s(n)) : s(t);
|
|
4581
4678
|
}
|
|
4582
4679
|
unwrap() {
|
|
4583
4680
|
return this._def.innerType;
|
|
4584
4681
|
}
|
|
4585
4682
|
}
|
|
4586
|
-
|
|
4683
|
+
lt.create = (r, e) => new lt({
|
|
4587
4684
|
innerType: r,
|
|
4588
|
-
typeName:
|
|
4685
|
+
typeName: k.ZodReadonly,
|
|
4589
4686
|
...C(e)
|
|
4590
4687
|
});
|
|
4591
|
-
var
|
|
4688
|
+
var k;
|
|
4592
4689
|
(function(r) {
|
|
4593
4690
|
r.ZodString = "ZodString", r.ZodNumber = "ZodNumber", r.ZodNaN = "ZodNaN", r.ZodBigInt = "ZodBigInt", r.ZodBoolean = "ZodBoolean", r.ZodDate = "ZodDate", r.ZodSymbol = "ZodSymbol", r.ZodUndefined = "ZodUndefined", r.ZodNull = "ZodNull", r.ZodAny = "ZodAny", r.ZodUnknown = "ZodUnknown", r.ZodNever = "ZodNever", r.ZodVoid = "ZodVoid", r.ZodArray = "ZodArray", r.ZodObject = "ZodObject", r.ZodUnion = "ZodUnion", r.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", r.ZodIntersection = "ZodIntersection", r.ZodTuple = "ZodTuple", r.ZodRecord = "ZodRecord", r.ZodMap = "ZodMap", r.ZodSet = "ZodSet", r.ZodFunction = "ZodFunction", r.ZodLazy = "ZodLazy", r.ZodLiteral = "ZodLiteral", r.ZodEnum = "ZodEnum", r.ZodEffects = "ZodEffects", r.ZodNativeEnum = "ZodNativeEnum", r.ZodOptional = "ZodOptional", r.ZodNullable = "ZodNullable", r.ZodDefault = "ZodDefault", r.ZodCatch = "ZodCatch", r.ZodPromise = "ZodPromise", r.ZodBranded = "ZodBranded", r.ZodPipeline = "ZodPipeline", r.ZodReadonly = "ZodReadonly";
|
|
4594
|
-
})(
|
|
4595
|
-
const
|
|
4691
|
+
})(k || (k = {}));
|
|
4692
|
+
const Oe = K.create;
|
|
4596
4693
|
fe.create;
|
|
4597
4694
|
he.create;
|
|
4598
|
-
|
|
4695
|
+
qe.create;
|
|
4599
4696
|
xe.create;
|
|
4600
|
-
|
|
4697
|
+
oe.create;
|
|
4601
4698
|
X.create;
|
|
4602
|
-
const
|
|
4603
|
-
|
|
4604
|
-
|
|
4699
|
+
const an = z.create;
|
|
4700
|
+
Ye.create;
|
|
4701
|
+
Ge.create;
|
|
4605
4702
|
me.create;
|
|
4606
4703
|
_e.create;
|
|
4607
|
-
|
|
4608
|
-
|
|
4704
|
+
Qe.create;
|
|
4705
|
+
ae.create;
|
|
4609
4706
|
we.create;
|
|
4610
|
-
const
|
|
4707
|
+
const Dt = {
|
|
4611
4708
|
string: ((r) => K.create({ ...r, coerce: !0 })),
|
|
4612
4709
|
number: ((r) => fe.create({ ...r, coerce: !0 })),
|
|
4613
|
-
boolean: ((r) =>
|
|
4710
|
+
boolean: ((r) => qe.create({
|
|
4614
4711
|
...r,
|
|
4615
4712
|
coerce: !0
|
|
4616
4713
|
})),
|
|
4617
4714
|
bigint: ((r) => he.create({ ...r, coerce: !0 })),
|
|
4618
4715
|
date: ((r) => xe.create({ ...r, coerce: !0 }))
|
|
4619
|
-
},
|
|
4620
|
-
q:
|
|
4621
|
-
task_type:
|
|
4622
|
-
status:
|
|
4623
|
-
from_date:
|
|
4624
|
-
to_date:
|
|
4625
|
-
page:
|
|
4626
|
-
per_page:
|
|
4716
|
+
}, on = an({
|
|
4717
|
+
q: Oe().optional(),
|
|
4718
|
+
task_type: Oe().optional(),
|
|
4719
|
+
status: Oe().optional(),
|
|
4720
|
+
from_date: Oe().optional(),
|
|
4721
|
+
to_date: Oe().optional(),
|
|
4722
|
+
page: Dt.number().int().positive().default(1),
|
|
4723
|
+
per_page: Dt.number().int().positive().default(20)
|
|
4627
4724
|
});
|
|
4628
|
-
function
|
|
4725
|
+
function fr(r) {
|
|
4629
4726
|
return { data: [], isLoading: !1, raw: { metadata: { total: 0 } } };
|
|
4630
4727
|
}
|
|
4631
|
-
function
|
|
4728
|
+
function hr(r) {
|
|
4632
4729
|
return { data: null, isLoading: !1 };
|
|
4633
4730
|
}
|
|
4634
|
-
function
|
|
4731
|
+
function mr({ setSelectedTask: r }) {
|
|
4635
4732
|
const e = (s) => {
|
|
4636
|
-
const { data: n, raw: a, isLoading: d } =
|
|
4733
|
+
const { data: n, raw: a, isLoading: d } = fr();
|
|
4637
4734
|
return {
|
|
4638
4735
|
data: n ?? [],
|
|
4639
4736
|
isLoading: d,
|
|
@@ -4646,7 +4743,7 @@ function or({ setSelectedTask: r }) {
|
|
|
4646
4743
|
{
|
|
4647
4744
|
key: "attempts",
|
|
4648
4745
|
header: "Attempts",
|
|
4649
|
-
render: (s) => /* @__PURE__ */
|
|
4746
|
+
render: (s) => /* @__PURE__ */ o.jsxs("span", { children: [
|
|
4650
4747
|
s.attempts,
|
|
4651
4748
|
"/",
|
|
4652
4749
|
s.max_attempts
|
|
@@ -4656,24 +4753,24 @@ function or({ setSelectedTask: r }) {
|
|
|
4656
4753
|
key: "error",
|
|
4657
4754
|
header: "Error",
|
|
4658
4755
|
className: "max-w-xs truncate",
|
|
4659
|
-
render: (s) => /* @__PURE__ */
|
|
4756
|
+
render: (s) => /* @__PURE__ */ o.jsx("span", { title: s.error || "", children: s.error })
|
|
4660
4757
|
},
|
|
4661
4758
|
{
|
|
4662
4759
|
key: "created_at",
|
|
4663
4760
|
header: "Created",
|
|
4664
|
-
render: (s) =>
|
|
4761
|
+
render: (s) => Pe(s.created_at)
|
|
4665
4762
|
}
|
|
4666
4763
|
];
|
|
4667
|
-
return /* @__PURE__ */
|
|
4668
|
-
|
|
4764
|
+
return /* @__PURE__ */ o.jsx(
|
|
4765
|
+
Ht,
|
|
4669
4766
|
{
|
|
4670
4767
|
title: "Background Tasks",
|
|
4671
|
-
paramsSchema:
|
|
4768
|
+
paramsSchema: on,
|
|
4672
4769
|
useQuery: e,
|
|
4673
4770
|
columns: t,
|
|
4674
4771
|
onRowClick: r,
|
|
4675
|
-
renderFilters: (s, n) => /* @__PURE__ */
|
|
4676
|
-
/* @__PURE__ */
|
|
4772
|
+
renderFilters: (s, n) => /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
4773
|
+
/* @__PURE__ */ o.jsx(
|
|
4677
4774
|
"input",
|
|
4678
4775
|
{
|
|
4679
4776
|
type: "search",
|
|
@@ -4683,38 +4780,38 @@ function or({ setSelectedTask: r }) {
|
|
|
4683
4780
|
onChange: (a) => n("q", a.target.value)
|
|
4684
4781
|
}
|
|
4685
4782
|
),
|
|
4686
|
-
/* @__PURE__ */
|
|
4783
|
+
/* @__PURE__ */ o.jsxs(
|
|
4687
4784
|
"select",
|
|
4688
4785
|
{
|
|
4689
4786
|
className: "select select-sm select-bordered w-40",
|
|
4690
4787
|
value: s.task_type || "",
|
|
4691
4788
|
onChange: (a) => n("task_type", a.target.value),
|
|
4692
4789
|
children: [
|
|
4693
|
-
/* @__PURE__ */
|
|
4694
|
-
/* @__PURE__ */
|
|
4695
|
-
/* @__PURE__ */
|
|
4696
|
-
/* @__PURE__ */
|
|
4697
|
-
/* @__PURE__ */
|
|
4698
|
-
/* @__PURE__ */
|
|
4790
|
+
/* @__PURE__ */ o.jsx("option", { value: "", children: "All Types" }),
|
|
4791
|
+
/* @__PURE__ */ o.jsx("option", { value: "email_registration", children: "Email Registration" }),
|
|
4792
|
+
/* @__PURE__ */ o.jsx("option", { value: "email_password_reset", children: "Email Password Reset" }),
|
|
4793
|
+
/* @__PURE__ */ o.jsx("option", { value: "email_notification", children: "Email Notification" }),
|
|
4794
|
+
/* @__PURE__ */ o.jsx("option", { value: "resize_image", children: "Resize Image" }),
|
|
4795
|
+
/* @__PURE__ */ o.jsx("option", { value: "zip_import", children: "Zip Import" })
|
|
4699
4796
|
]
|
|
4700
4797
|
}
|
|
4701
4798
|
),
|
|
4702
|
-
/* @__PURE__ */
|
|
4799
|
+
/* @__PURE__ */ o.jsxs(
|
|
4703
4800
|
"select",
|
|
4704
4801
|
{
|
|
4705
4802
|
className: "select select-sm select-bordered w-40",
|
|
4706
4803
|
value: s.status || "",
|
|
4707
4804
|
onChange: (a) => n("status", a.target.value),
|
|
4708
4805
|
children: [
|
|
4709
|
-
/* @__PURE__ */
|
|
4710
|
-
/* @__PURE__ */
|
|
4711
|
-
/* @__PURE__ */
|
|
4712
|
-
/* @__PURE__ */
|
|
4713
|
-
/* @__PURE__ */
|
|
4806
|
+
/* @__PURE__ */ o.jsx("option", { value: "", children: "All Statuses" }),
|
|
4807
|
+
/* @__PURE__ */ o.jsx("option", { value: "pending", children: "Pending" }),
|
|
4808
|
+
/* @__PURE__ */ o.jsx("option", { value: "running", children: "Running" }),
|
|
4809
|
+
/* @__PURE__ */ o.jsx("option", { value: "completed", children: "Completed" }),
|
|
4810
|
+
/* @__PURE__ */ o.jsx("option", { value: "failed", children: "Failed" })
|
|
4714
4811
|
]
|
|
4715
4812
|
}
|
|
4716
4813
|
),
|
|
4717
|
-
/* @__PURE__ */
|
|
4814
|
+
/* @__PURE__ */ o.jsx(
|
|
4718
4815
|
"input",
|
|
4719
4816
|
{
|
|
4720
4817
|
type: "date",
|
|
@@ -4727,7 +4824,7 @@ function or({ setSelectedTask: r }) {
|
|
|
4727
4824
|
}
|
|
4728
4825
|
}
|
|
4729
4826
|
),
|
|
4730
|
-
/* @__PURE__ */
|
|
4827
|
+
/* @__PURE__ */ o.jsx(
|
|
4731
4828
|
"input",
|
|
4732
4829
|
{
|
|
4733
4830
|
type: "date",
|
|
@@ -4745,68 +4842,68 @@ function or({ setSelectedTask: r }) {
|
|
|
4745
4842
|
}
|
|
4746
4843
|
);
|
|
4747
4844
|
}
|
|
4748
|
-
function
|
|
4749
|
-
const s =
|
|
4845
|
+
function pr({ selectedTask: r, setSelectedTask: e }) {
|
|
4846
|
+
const s = hr(r?.id).data ?? null;
|
|
4750
4847
|
if (!r) return null;
|
|
4751
4848
|
const n = s?.payload ?? r.payload ?? null;
|
|
4752
|
-
return /* @__PURE__ */
|
|
4849
|
+
return /* @__PURE__ */ o.jsx(
|
|
4753
4850
|
"div",
|
|
4754
4851
|
{
|
|
4755
4852
|
className: "modal modal-open",
|
|
4756
4853
|
role: "dialog",
|
|
4757
4854
|
onClick: () => e(null),
|
|
4758
|
-
children: /* @__PURE__ */
|
|
4759
|
-
/* @__PURE__ */
|
|
4855
|
+
children: /* @__PURE__ */ o.jsxs("div", { className: "modal-box max-w-3xl", onClick: (a) => a.stopPropagation(), children: [
|
|
4856
|
+
/* @__PURE__ */ o.jsxs("h3", { className: "font-bold text-lg", children: [
|
|
4760
4857
|
"Task #",
|
|
4761
4858
|
r.id,
|
|
4762
4859
|
" — ",
|
|
4763
4860
|
r.task_type
|
|
4764
4861
|
] }),
|
|
4765
|
-
/* @__PURE__ */
|
|
4766
|
-
/* @__PURE__ */
|
|
4767
|
-
/* @__PURE__ */
|
|
4862
|
+
/* @__PURE__ */ o.jsxs("div", { className: "mt-4 grid grid-cols-2 gap-4 text-sm", children: [
|
|
4863
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
4864
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Status:" }),
|
|
4768
4865
|
" ",
|
|
4769
4866
|
r.status
|
|
4770
4867
|
] }),
|
|
4771
|
-
/* @__PURE__ */
|
|
4772
|
-
/* @__PURE__ */
|
|
4868
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
4869
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Attempts:" }),
|
|
4773
4870
|
" ",
|
|
4774
4871
|
r.attempts,
|
|
4775
4872
|
"/",
|
|
4776
4873
|
r.max_attempts
|
|
4777
4874
|
] }),
|
|
4778
|
-
/* @__PURE__ */
|
|
4779
|
-
/* @__PURE__ */
|
|
4875
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
4876
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Scheduled:" }),
|
|
4780
4877
|
" ",
|
|
4781
4878
|
r.scheduled_for ?? "—"
|
|
4782
4879
|
] }),
|
|
4783
|
-
/* @__PURE__ */
|
|
4784
|
-
/* @__PURE__ */
|
|
4880
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
4881
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Started:" }),
|
|
4785
4882
|
" ",
|
|
4786
|
-
|
|
4883
|
+
Pe(r.started_at)
|
|
4787
4884
|
] }),
|
|
4788
|
-
/* @__PURE__ */
|
|
4789
|
-
/* @__PURE__ */
|
|
4885
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
4886
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Completed:" }),
|
|
4790
4887
|
" ",
|
|
4791
|
-
|
|
4888
|
+
Pe(r.completed_at)
|
|
4792
4889
|
] }),
|
|
4793
|
-
/* @__PURE__ */
|
|
4794
|
-
/* @__PURE__ */
|
|
4890
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
4891
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Created:" }),
|
|
4795
4892
|
" ",
|
|
4796
|
-
|
|
4893
|
+
Pe(r.created_at)
|
|
4797
4894
|
] }),
|
|
4798
|
-
/* @__PURE__ */
|
|
4799
|
-
/* @__PURE__ */
|
|
4895
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
4896
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Updated:" }),
|
|
4800
4897
|
" ",
|
|
4801
|
-
|
|
4898
|
+
Pe(r.updated_at)
|
|
4802
4899
|
] }),
|
|
4803
|
-
/* @__PURE__ */
|
|
4804
|
-
/* @__PURE__ */
|
|
4805
|
-
/* @__PURE__ */
|
|
4900
|
+
/* @__PURE__ */ o.jsxs("div", { className: "col-span-2", children: [
|
|
4901
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Error:" }),
|
|
4902
|
+
/* @__PURE__ */ o.jsx("div", { className: "whitespace-pre-wrap", children: r.error ?? "—" })
|
|
4806
4903
|
] }),
|
|
4807
|
-
/* @__PURE__ */
|
|
4808
|
-
/* @__PURE__ */
|
|
4809
|
-
/* @__PURE__ */
|
|
4904
|
+
/* @__PURE__ */ o.jsxs("div", { className: "col-span-2", children: [
|
|
4905
|
+
/* @__PURE__ */ o.jsx("strong", { children: "Payload:" }),
|
|
4906
|
+
/* @__PURE__ */ o.jsx("pre", { className: "bg-base-200 p-2 rounded max-h-48 overflow-auto text-xs", children: (() => {
|
|
4810
4907
|
const a = n;
|
|
4811
4908
|
if (a == null) return "—";
|
|
4812
4909
|
try {
|
|
@@ -4818,35 +4915,94 @@ function lr({ selectedTask: r, setSelectedTask: e }) {
|
|
|
4818
4915
|
})() })
|
|
4819
4916
|
] })
|
|
4820
4917
|
] }),
|
|
4821
|
-
/* @__PURE__ */
|
|
4918
|
+
/* @__PURE__ */ o.jsx("div", { className: "modal-action", children: /* @__PURE__ */ o.jsx("button", { className: "btn", onClick: () => e(null), children: "Close" }) })
|
|
4822
4919
|
] })
|
|
4823
4920
|
}
|
|
4824
4921
|
);
|
|
4825
4922
|
}
|
|
4826
|
-
const
|
|
4923
|
+
const wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4827
4924
|
__proto__: null,
|
|
4828
|
-
AdminLayout:
|
|
4829
|
-
AlertCard:
|
|
4830
|
-
GenericFormModal:
|
|
4831
|
-
GenericList:
|
|
4832
|
-
ModalErrors:
|
|
4833
|
-
Pagination:
|
|
4834
|
-
QRCodeGenerator:
|
|
4835
|
-
TasksList:
|
|
4836
|
-
TasksModal:
|
|
4925
|
+
AdminLayout: pt,
|
|
4926
|
+
AlertCard: qr,
|
|
4927
|
+
GenericFormModal: Yr,
|
|
4928
|
+
GenericList: Ht,
|
|
4929
|
+
ModalErrors: _s,
|
|
4930
|
+
Pagination: Qt,
|
|
4931
|
+
QRCodeGenerator: Ts,
|
|
4932
|
+
TasksList: mr,
|
|
4933
|
+
TasksModal: pr
|
|
4837
4934
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4838
|
-
function
|
|
4839
|
-
const [
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4935
|
+
function ln() {
|
|
4936
|
+
const { data: r = [], isLoading: e, refetch: t } = mt(), s = qt(), [n, a] = se({}), d = async (u) => {
|
|
4937
|
+
const i = r.find((c) => c.feature_key === u);
|
|
4938
|
+
if (!i) return;
|
|
4939
|
+
const l = !i.enabled;
|
|
4940
|
+
a((c) => ({ ...c, [u]: !0 }));
|
|
4941
|
+
try {
|
|
4942
|
+
await s.mutateAsync({ key: u, enabled: l }), t && await t();
|
|
4943
|
+
} catch (c) {
|
|
4944
|
+
console.error("Failed to update feature flag", c), ct.error("Failed to update feature flag");
|
|
4945
|
+
} finally {
|
|
4946
|
+
a((c) => {
|
|
4947
|
+
const f = { ...c };
|
|
4948
|
+
return delete f[u], f;
|
|
4949
|
+
});
|
|
4950
|
+
}
|
|
4951
|
+
};
|
|
4952
|
+
return e ? /* @__PURE__ */ o.jsx("div", { className: "p-6", children: "Loading..." }) : /* @__PURE__ */ o.jsxs(pt, { title: "Feature Flags", children: [
|
|
4953
|
+
/* @__PURE__ */ o.jsx("div", { className: "flex items-center justify-between mb-6", children: /* @__PURE__ */ o.jsxs("div", { children: [
|
|
4954
|
+
/* @__PURE__ */ o.jsx("h1", { className: "text-2xl font-bold", children: "Feature Flags" }),
|
|
4955
|
+
/* @__PURE__ */ o.jsx("p", { className: "text-sm text-base-content/60 mt-1", children: "Configure which features are enabled in the application" })
|
|
4956
|
+
] }) }),
|
|
4957
|
+
/* @__PURE__ */ o.jsx("div", { className: "bg-base-100 rounded-lg shadow", children: /* @__PURE__ */ o.jsx("div", { className: "divide-y", children: r.map((u) => {
|
|
4958
|
+
const i = u.enabled, l = !!n[u.feature_key];
|
|
4959
|
+
return /* @__PURE__ */ o.jsxs(
|
|
4960
|
+
"div",
|
|
4961
|
+
{
|
|
4962
|
+
className: `p-4 flex items-center justify-between ${l ? "bg-warning/10" : ""}`,
|
|
4963
|
+
children: [
|
|
4964
|
+
/* @__PURE__ */ o.jsx("div", { className: "flex-1", children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4965
|
+
/* @__PURE__ */ o.jsx("h3", { className: "font-semibold text-lg", children: u.feature_key }),
|
|
4966
|
+
l && /* @__PURE__ */ o.jsx("span", { className: "badge badge-warning badge-sm", children: "saving" })
|
|
4967
|
+
] }) }),
|
|
4968
|
+
/* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
4969
|
+
/* @__PURE__ */ o.jsx(
|
|
4970
|
+
"span",
|
|
4971
|
+
{
|
|
4972
|
+
className: `text-sm font-medium ${i ? "text-success" : "text-base-content/50"}`,
|
|
4973
|
+
children: i ? "Enabled" : "Disabled"
|
|
4974
|
+
}
|
|
4975
|
+
),
|
|
4976
|
+
/* @__PURE__ */ o.jsx(
|
|
4977
|
+
"input",
|
|
4978
|
+
{
|
|
4979
|
+
type: "checkbox",
|
|
4980
|
+
className: "toggle toggle-success",
|
|
4981
|
+
checked: i,
|
|
4982
|
+
onChange: () => d(u.feature_key)
|
|
4983
|
+
}
|
|
4984
|
+
)
|
|
4985
|
+
] })
|
|
4986
|
+
]
|
|
4987
|
+
},
|
|
4988
|
+
u.feature_key
|
|
4989
|
+
);
|
|
4990
|
+
}) }) })
|
|
4991
|
+
] });
|
|
4992
|
+
}
|
|
4993
|
+
function cn() {
|
|
4994
|
+
const [r, e] = se(null);
|
|
4995
|
+
return /* @__PURE__ */ o.jsxs(pt, { title: "Tasks", children: [
|
|
4996
|
+
/* @__PURE__ */ o.jsx(mr, { setSelectedTask: e }),
|
|
4997
|
+
/* @__PURE__ */ o.jsx(pr, { selectedTask: r, setSelectedTask: e })
|
|
4843
4998
|
] });
|
|
4844
4999
|
}
|
|
4845
|
-
const
|
|
5000
|
+
const jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4846
5001
|
__proto__: null,
|
|
4847
|
-
|
|
5002
|
+
AdminFeatureFlags: ln,
|
|
5003
|
+
AdminTasks: cn
|
|
4848
5004
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4849
|
-
function
|
|
5005
|
+
function Nn({
|
|
4850
5006
|
label: r,
|
|
4851
5007
|
field: e,
|
|
4852
5008
|
params: t,
|
|
@@ -4854,24 +5010,24 @@ function an({
|
|
|
4854
5010
|
setFilters: n,
|
|
4855
5011
|
className: a = ""
|
|
4856
5012
|
}) {
|
|
4857
|
-
const d = t.sort_by, u = t.sort_order, i = d === e,
|
|
5013
|
+
const d = t.sort_by, u = t.sort_order, i = d === e, l = i ? u === "asc" ? Nr : kr : jr, c = () => {
|
|
4858
5014
|
let f = "asc";
|
|
4859
5015
|
i && u === "asc" && (f = "desc"), n ? n({
|
|
4860
5016
|
sort_by: e,
|
|
4861
5017
|
sort_order: f
|
|
4862
5018
|
}) : (s("sort_by", e), s("sort_order", f));
|
|
4863
5019
|
};
|
|
4864
|
-
return /* @__PURE__ */
|
|
5020
|
+
return /* @__PURE__ */ o.jsxs(
|
|
4865
5021
|
"div",
|
|
4866
5022
|
{
|
|
4867
5023
|
className: `cursor-pointer hover:bg-base-200 transition-colors flex items-center gap-2 select-none ${a}`,
|
|
4868
5024
|
onClick: c,
|
|
4869
5025
|
children: [
|
|
4870
5026
|
r,
|
|
4871
|
-
/* @__PURE__ */
|
|
4872
|
-
|
|
5027
|
+
/* @__PURE__ */ o.jsx(
|
|
5028
|
+
je,
|
|
4873
5029
|
{
|
|
4874
|
-
icon:
|
|
5030
|
+
icon: l,
|
|
4875
5031
|
className: i ? "text-primary" : "text-base-content/30"
|
|
4876
5032
|
}
|
|
4877
5033
|
)
|
|
@@ -4879,13 +5035,13 @@ function an({
|
|
|
4879
5035
|
}
|
|
4880
5036
|
);
|
|
4881
5037
|
}
|
|
4882
|
-
function
|
|
5038
|
+
function kn() {
|
|
4883
5039
|
return {
|
|
4884
|
-
useList: (r) =>
|
|
4885
|
-
useGet: (r) =>
|
|
5040
|
+
useList: (r) => fr(),
|
|
5041
|
+
useGet: (r) => hr()
|
|
4886
5042
|
};
|
|
4887
5043
|
}
|
|
4888
|
-
function
|
|
5044
|
+
function En(r, e) {
|
|
4889
5045
|
const t = {};
|
|
4890
5046
|
e.defaults && Object.assign(t, e.defaults);
|
|
4891
5047
|
for (const [s, n] of Object.entries(r || {}))
|
|
@@ -4904,19 +5060,21 @@ function ln(r, e) {
|
|
|
4904
5060
|
return t;
|
|
4905
5061
|
}
|
|
4906
5062
|
export {
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
5063
|
+
pt as AdminLayout,
|
|
5064
|
+
Ar as AuthProvider,
|
|
5065
|
+
Ht as GenericList,
|
|
5066
|
+
Qt as Pagination,
|
|
5067
|
+
Nn as SortHeader,
|
|
5068
|
+
vn as auth,
|
|
5069
|
+
xn as buildApiQuery,
|
|
5070
|
+
wn as components,
|
|
5071
|
+
yn as configureAdminLayout,
|
|
5072
|
+
gn as featureFlags,
|
|
5073
|
+
jn as pages,
|
|
5074
|
+
jt as parseParams,
|
|
5075
|
+
ze as toSearchParams,
|
|
5076
|
+
le as useAuthApi,
|
|
5077
|
+
Ut as useAuthConfig,
|
|
5078
|
+
kn as useTasksApi,
|
|
5079
|
+
En as validateParams
|
|
4922
5080
|
};
|