@abduljebar/text-editor 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts.map +1 -1
- package/dist/components/StatusBar.d.ts +0 -1
- package/dist/components/StatusBar.d.ts.map +1 -1
- package/dist/components/TextEditor.d.ts +0 -1
- package/dist/components/TextEditor.d.ts.map +1 -1
- package/dist/components/Toolbar.d.ts +0 -1
- package/dist/components/Toolbar.d.ts.map +1 -1
- package/dist/index.js +254 -254
- package/package.json +1 -1
- package/dist/index.css +0 -1
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function sn() {
|
|
|
51
51
|
return u.$$typeof === Dt ? null : u.displayName || u.name || null;
|
|
52
52
|
if (typeof u == "string") return u;
|
|
53
53
|
switch (u) {
|
|
54
|
-
case
|
|
54
|
+
case T:
|
|
55
55
|
return "Fragment";
|
|
56
56
|
case L:
|
|
57
57
|
return "Profiler";
|
|
@@ -100,16 +100,16 @@ function sn() {
|
|
|
100
100
|
}
|
|
101
101
|
if (_) {
|
|
102
102
|
_ = console;
|
|
103
|
-
var z = _.error,
|
|
103
|
+
var z = _.error, Z = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
|
|
104
104
|
return z.call(
|
|
105
105
|
_,
|
|
106
106
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
|
-
|
|
107
|
+
Z
|
|
108
108
|
), t(u);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
function r(u) {
|
|
112
|
-
if (u ===
|
|
112
|
+
if (u === T) return "<>";
|
|
113
113
|
if (typeof u == "object" && u !== null && u.$$typeof === de)
|
|
114
114
|
return "<...>";
|
|
115
115
|
try {
|
|
@@ -151,15 +151,15 @@ function sn() {
|
|
|
151
151
|
"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."
|
|
152
152
|
)), u = this.props.ref, u !== void 0 ? u : null;
|
|
153
153
|
}
|
|
154
|
-
function d(u, _, z,
|
|
155
|
-
var
|
|
154
|
+
function d(u, _, z, Z, X, pe) {
|
|
155
|
+
var E = z.ref;
|
|
156
156
|
return u = {
|
|
157
|
-
$$typeof:
|
|
157
|
+
$$typeof: x,
|
|
158
158
|
type: u,
|
|
159
159
|
key: _,
|
|
160
160
|
props: z,
|
|
161
|
-
_owner:
|
|
162
|
-
}, (
|
|
161
|
+
_owner: Z
|
|
162
|
+
}, (E !== void 0 ? E : null) !== null ? Object.defineProperty(u, "ref", {
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
get: f
|
|
165
165
|
}) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
|
|
@@ -184,91 +184,91 @@ function sn() {
|
|
|
184
184
|
value: pe
|
|
185
185
|
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
186
186
|
}
|
|
187
|
-
function l(u, _, z,
|
|
188
|
-
var
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
if (Ut(
|
|
192
|
-
for (
|
|
193
|
-
|
|
194
|
-
Object.freeze && Object.freeze(
|
|
187
|
+
function l(u, _, z, Z, X, pe) {
|
|
188
|
+
var E = _.children;
|
|
189
|
+
if (E !== void 0)
|
|
190
|
+
if (Z)
|
|
191
|
+
if (Ut(E)) {
|
|
192
|
+
for (Z = 0; Z < E.length; Z++)
|
|
193
|
+
g(E[Z]);
|
|
194
|
+
Object.freeze && Object.freeze(E);
|
|
195
195
|
} else
|
|
196
196
|
console.error(
|
|
197
197
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
198
|
);
|
|
199
|
-
else
|
|
199
|
+
else g(E);
|
|
200
200
|
if (je.call(_, "key")) {
|
|
201
|
-
|
|
201
|
+
E = e(u);
|
|
202
202
|
var M = Object.keys(_).filter(function(Ft) {
|
|
203
203
|
return Ft !== "key";
|
|
204
204
|
});
|
|
205
|
-
|
|
205
|
+
Z = 0 < M.length ? "{key: someKey, " + M.join(": ..., ") + ": ...}" : "{key: someKey}", Ce[E + Z] || (M = 0 < M.length ? "{" + M.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
207
207
|
let props = %s;
|
|
208
208
|
<%s {...props} />
|
|
209
209
|
React keys must be passed directly to JSX without using spread:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s key={someKey} {...props} />`,
|
|
212
|
+
Z,
|
|
212
213
|
E,
|
|
213
|
-
y,
|
|
214
214
|
M,
|
|
215
|
-
|
|
216
|
-
), Ce[
|
|
215
|
+
E
|
|
216
|
+
), Ce[E + Z] = !0);
|
|
217
217
|
}
|
|
218
|
-
if (
|
|
218
|
+
if (E = null, z !== void 0 && (n(z), E = "" + z), c(_) && (n(_.key), E = "" + _.key), "key" in _) {
|
|
219
219
|
z = {};
|
|
220
220
|
for (var me in _)
|
|
221
221
|
me !== "key" && (z[me] = _[me]);
|
|
222
222
|
} else z = _;
|
|
223
|
-
return
|
|
223
|
+
return E && a(
|
|
224
224
|
z,
|
|
225
225
|
typeof u == "function" ? u.displayName || u.name || "Unknown" : u
|
|
226
226
|
), d(
|
|
227
227
|
u,
|
|
228
|
-
|
|
228
|
+
E,
|
|
229
229
|
z,
|
|
230
230
|
o(),
|
|
231
231
|
X,
|
|
232
232
|
pe
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function g(u) {
|
|
236
236
|
p(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === de && (u._payload.status === "fulfilled" ? p(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
|
|
237
237
|
}
|
|
238
238
|
function p(u) {
|
|
239
|
-
return typeof u == "object" && u !== null && u.$$typeof ===
|
|
239
|
+
return typeof u == "object" && u !== null && u.$$typeof === x;
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var v = Lt, x = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), j = Symbol.for("react.context"), C = Symbol.for("react.forward_ref"), Rt = Symbol.for("react.suspense"), Pt = Symbol.for("react.suspense_list"), Ct = Symbol.for("react.memo"), de = Symbol.for("react.lazy"), Nt = Symbol.for("react.activity"), Dt = Symbol.for("react.client.reference"), fe = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, je = Object.prototype.hasOwnProperty, Ut = Array.isArray, he = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
v = {
|
|
245
245
|
react_stack_bottom_frame: function(u) {
|
|
246
246
|
return u();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var Se, Oe = {}, Re =
|
|
250
|
-
|
|
249
|
+
var Se, Oe = {}, Re = v.react_stack_bottom_frame.bind(
|
|
250
|
+
v,
|
|
251
251
|
i
|
|
252
252
|
)(), Pe = he(r(i)), Ce = {};
|
|
253
|
-
J.Fragment =
|
|
254
|
-
var
|
|
253
|
+
J.Fragment = T, J.jsx = function(u, _, z) {
|
|
254
|
+
var Z = 1e4 > fe.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return l(
|
|
256
256
|
u,
|
|
257
257
|
_,
|
|
258
258
|
z,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
Z ? Error("react-stack-top-frame") : Re,
|
|
261
|
+
Z ? he(r(u)) : Pe
|
|
262
262
|
);
|
|
263
263
|
}, J.jsxs = function(u, _, z) {
|
|
264
|
-
var
|
|
264
|
+
var Z = 1e4 > fe.recentlyCreatedOwnerStacks++;
|
|
265
265
|
return l(
|
|
266
266
|
u,
|
|
267
267
|
_,
|
|
268
268
|
z,
|
|
269
269
|
!0,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
Z ? Error("react-stack-top-frame") : Re,
|
|
271
|
+
Z ? he(r(u)) : Pe
|
|
272
272
|
);
|
|
273
273
|
};
|
|
274
274
|
})()), J;
|
|
@@ -294,10 +294,10 @@ const un = ({
|
|
|
294
294
|
"justifyLeft",
|
|
295
295
|
"justifyCenter",
|
|
296
296
|
"justifyRight"
|
|
297
|
-
],
|
|
297
|
+
], g = [];
|
|
298
298
|
l.forEach((p) => {
|
|
299
|
-
document.queryCommandState(p) &&
|
|
300
|
-
}), c(
|
|
299
|
+
document.queryCommandState(p) && g.push(p);
|
|
300
|
+
}), c(g);
|
|
301
301
|
};
|
|
302
302
|
ut(() => (document.addEventListener("selectionchange", a), () => document.removeEventListener("selectionchange", a)), []);
|
|
303
303
|
const f = () => {
|
|
@@ -322,10 +322,10 @@ const un = ({
|
|
|
322
322
|
{ separator: !0 },
|
|
323
323
|
{ command: "createLink", icon: /* @__PURE__ */ m.jsx(on, { size: 18 }), title: "Insert Link" }
|
|
324
324
|
];
|
|
325
|
-
return /* @__PURE__ */ m.jsxs("div", { className: "
|
|
326
|
-
/* @__PURE__ */ m.jsx("div", { className: "
|
|
325
|
+
return /* @__PURE__ */ m.jsxs("div", { className: "flex flex-wrap justify-between items-center p-3 bg-gray-50 border-b border-gray-200", children: [
|
|
326
|
+
/* @__PURE__ */ m.jsx("div", { className: "flex flex-wrap items-center gap-1", children: d.map((l, g) => {
|
|
327
327
|
if ("separator" in l)
|
|
328
|
-
return /* @__PURE__ */ m.jsx("div", { className: "
|
|
328
|
+
return /* @__PURE__ */ m.jsx("div", { className: "w-px h-6 bg-gray-300 mx-2 inline" }, g);
|
|
329
329
|
const p = i.includes(l.command);
|
|
330
330
|
return /* @__PURE__ */ m.jsx(
|
|
331
331
|
"button",
|
|
@@ -333,20 +333,21 @@ const un = ({
|
|
|
333
333
|
onClick: () => l.command === "createLink" ? f() : e(l.command, l.value),
|
|
334
334
|
title: l.title,
|
|
335
335
|
type: "button",
|
|
336
|
-
className: `
|
|
336
|
+
className: `w-9 h-9 flex items-center justify-center rounded-md border border-gray-300 text-gray-700 hover:bg-gray-100 active:bg-gray-200 transition
|
|
337
|
+
${p ? "bg-blue-100 text-blue-600 border-blue-300" : "bg-white"}`,
|
|
337
338
|
children: l.icon
|
|
338
339
|
},
|
|
339
|
-
|
|
340
|
+
g
|
|
340
341
|
);
|
|
341
342
|
}) }),
|
|
342
|
-
/* @__PURE__ */ m.jsxs("div", { className: "
|
|
343
|
+
/* @__PURE__ */ m.jsxs("div", { className: "flex items-center gap-2 mt-2 sm:mt-0", children: [
|
|
343
344
|
/* @__PURE__ */ m.jsxs(
|
|
344
345
|
"button",
|
|
345
346
|
{
|
|
346
347
|
onClick: t,
|
|
347
348
|
disabled: !o,
|
|
348
349
|
title: "Save Document",
|
|
349
|
-
className: "
|
|
350
|
+
className: "flex items-center gap-1 px-3 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed transition",
|
|
350
351
|
children: [
|
|
351
352
|
/* @__PURE__ */ m.jsx(Vt, { size: 16 }),
|
|
352
353
|
" Save"
|
|
@@ -358,7 +359,7 @@ const un = ({
|
|
|
358
359
|
{
|
|
359
360
|
onClick: n,
|
|
360
361
|
title: "Export as HTML",
|
|
361
|
-
className: "
|
|
362
|
+
className: "flex items-center gap-1 px-3 py-2 bg-green-600 text-white text-sm font-medium rounded-md hover:bg-green-700 transition",
|
|
362
363
|
children: [
|
|
363
364
|
/* @__PURE__ */ m.jsx(Wt, { size: 16 }),
|
|
364
365
|
" Export"
|
|
@@ -370,7 +371,7 @@ const un = ({
|
|
|
370
371
|
{
|
|
371
372
|
onClick: r,
|
|
372
373
|
title: "Clear Editor",
|
|
373
|
-
className: "
|
|
374
|
+
className: "flex items-center gap-1 px-3 py-2 bg-red-600 text-white text-sm font-medium rounded-md hover:bg-red-700 transition",
|
|
374
375
|
children: [
|
|
375
376
|
/* @__PURE__ */ m.jsx(Bt, { size: 16 }),
|
|
376
377
|
" Clear"
|
|
@@ -383,19 +384,18 @@ const un = ({
|
|
|
383
384
|
wordCount: e,
|
|
384
385
|
characterCount: t,
|
|
385
386
|
hasUnsavedChanges: n
|
|
386
|
-
}) => /* @__PURE__ */ m.jsx("div", { className: "
|
|
387
|
-
/* @__PURE__ */ m.jsxs("div", {
|
|
387
|
+
}) => /* @__PURE__ */ m.jsx("div", { className: "flex justify-between items-center px-5 py-3 bg-gray-50 border-t border-gray-200 text-sm text-gray-600", children: /* @__PURE__ */ m.jsxs("div", { className: "flex items-center gap-6", children: [
|
|
388
|
+
/* @__PURE__ */ m.jsxs("div", { children: [
|
|
388
389
|
"Words: ",
|
|
389
|
-
/* @__PURE__ */ m.jsx("
|
|
390
|
+
/* @__PURE__ */ m.jsx("strong", { className: "text-gray-800", children: e })
|
|
390
391
|
] }),
|
|
391
|
-
/* @__PURE__ */ m.jsxs("div", {
|
|
392
|
+
/* @__PURE__ */ m.jsxs("div", { children: [
|
|
392
393
|
"Characters: ",
|
|
393
|
-
/* @__PURE__ */ m.jsx("
|
|
394
|
+
/* @__PURE__ */ m.jsx("strong", { className: "text-gray-800", children: t })
|
|
394
395
|
] }),
|
|
395
|
-
/* @__PURE__ */ m.jsxs("div", {
|
|
396
|
-
"Status:",
|
|
397
|
-
" ",
|
|
398
|
-
/* @__PURE__ */ m.jsx("span", { className: n ? "status-unsaved" : "status-saved", children: n ? "Unsaved Changes" : "Saved" })
|
|
396
|
+
/* @__PURE__ */ m.jsxs("div", { children: [
|
|
397
|
+
"Status: ",
|
|
398
|
+
/* @__PURE__ */ m.jsx("strong", { className: n ? "text-orange-600" : "text-green-600", children: n ? "Unsaved Changes" : "Saved" })
|
|
399
399
|
] })
|
|
400
400
|
] }) });
|
|
401
401
|
function s(e, t, n) {
|
|
@@ -443,10 +443,10 @@ function dn(e) {
|
|
|
443
443
|
const t = Object.values(e).filter((r) => typeof r == "number");
|
|
444
444
|
return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
|
|
445
445
|
}
|
|
446
|
-
function
|
|
446
|
+
function ve(e, t) {
|
|
447
447
|
return typeof t == "bigint" ? t.toString() : t;
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function ye(e) {
|
|
450
450
|
return {
|
|
451
451
|
get value() {
|
|
452
452
|
{
|
|
@@ -456,10 +456,10 @@ function $e(e) {
|
|
|
456
456
|
}
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function $e(e) {
|
|
460
460
|
return e == null;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function Ze(e) {
|
|
463
463
|
const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
|
|
464
464
|
return e.slice(t, n);
|
|
465
465
|
}
|
|
@@ -514,7 +514,7 @@ const ft = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
|
514
514
|
function oe(e) {
|
|
515
515
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
516
516
|
}
|
|
517
|
-
const hn =
|
|
517
|
+
const hn = ye(() => {
|
|
518
518
|
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
|
|
519
519
|
return !1;
|
|
520
520
|
try {
|
|
@@ -567,7 +567,7 @@ const _n = {
|
|
|
567
567
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
568
568
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
569
569
|
};
|
|
570
|
-
function
|
|
570
|
+
function gn(e, t) {
|
|
571
571
|
const n = e._zod.def, r = F(e._zod.def, {
|
|
572
572
|
get shape() {
|
|
573
573
|
const o = {};
|
|
@@ -582,7 +582,7 @@ function vn(e, t) {
|
|
|
582
582
|
});
|
|
583
583
|
return O(e, r);
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function vn(e, t) {
|
|
586
586
|
const n = e._zod.def, r = F(e._zod.def, {
|
|
587
587
|
get shape() {
|
|
588
588
|
const o = { ...e._zod.def.shape };
|
|
@@ -664,7 +664,7 @@ function zn(e, t, n) {
|
|
|
664
664
|
});
|
|
665
665
|
return O(t, r);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function yn(e, t, n) {
|
|
668
668
|
const r = F(t._zod.def, {
|
|
669
669
|
get shape() {
|
|
670
670
|
const o = t._zod.def.shape, i = { ...o };
|
|
@@ -714,7 +714,7 @@ function D(e, t, n) {
|
|
|
714
714
|
}
|
|
715
715
|
return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function Ee(e) {
|
|
718
718
|
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
|
|
719
719
|
}
|
|
720
720
|
function q(...e) {
|
|
@@ -733,18 +733,18 @@ const mt = (e, t) => {
|
|
|
733
733
|
}), Object.defineProperty(e, "issues", {
|
|
734
734
|
value: t,
|
|
735
735
|
enumerable: !1
|
|
736
|
-
}), e.message = JSON.stringify(t,
|
|
736
|
+
}), e.message = JSON.stringify(t, ve, 2), Object.defineProperty(e, "toString", {
|
|
737
737
|
value: () => e.message,
|
|
738
738
|
enumerable: !1
|
|
739
739
|
});
|
|
740
|
-
}, _t = s("$ZodError", mt),
|
|
741
|
-
function
|
|
740
|
+
}, _t = s("$ZodError", mt), gt = s("$ZodError", mt, { Parent: Error });
|
|
741
|
+
function $n(e, t = (n) => n.message) {
|
|
742
742
|
const n = {}, r = [];
|
|
743
743
|
for (const o of e.issues)
|
|
744
744
|
o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
|
|
745
745
|
return { formErrors: r, fieldErrors: n };
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function Zn(e, t) {
|
|
748
748
|
const n = t || function(i) {
|
|
749
749
|
return i.message;
|
|
750
750
|
}, r = { _errors: [] }, o = (i) => {
|
|
@@ -767,7 +767,7 @@ function En(e, t) {
|
|
|
767
767
|
};
|
|
768
768
|
return o(e), r;
|
|
769
769
|
}
|
|
770
|
-
const
|
|
770
|
+
const xe = (e) => (t, n, r, o) => {
|
|
771
771
|
const i = r ? Object.assign(r, { async: !1 }) : { async: !1 }, c = t._zod.run({ value: n, issues: [] }, i);
|
|
772
772
|
if (c instanceof Promise)
|
|
773
773
|
throw new B();
|
|
@@ -776,7 +776,7 @@ const Te = (e) => (t, n, r, o) => {
|
|
|
776
776
|
throw ft(a, o?.callee), a;
|
|
777
777
|
}
|
|
778
778
|
return c.value;
|
|
779
|
-
},
|
|
779
|
+
}, Te = (e) => async (t, n, r, o) => {
|
|
780
780
|
const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
781
781
|
let c = t._zod.run({ value: n, issues: [] }, i);
|
|
782
782
|
if (c instanceof Promise && (c = await c), c.issues.length) {
|
|
@@ -792,20 +792,20 @@ const Te = (e) => (t, n, r, o) => {
|
|
|
792
792
|
success: !1,
|
|
793
793
|
error: new (e ?? _t)(i.issues.map((c) => D(c, o, N())))
|
|
794
794
|
} : { success: !0, data: i.value };
|
|
795
|
-
},
|
|
795
|
+
}, En = /* @__PURE__ */ ae(gt), ue = (e) => async (t, n, r) => {
|
|
796
796
|
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
797
797
|
let i = t._zod.run({ value: n, issues: [] }, o);
|
|
798
798
|
return i instanceof Promise && (i = await i), i.issues.length ? {
|
|
799
799
|
success: !1,
|
|
800
800
|
error: new e(i.issues.map((c) => D(c, o, N())))
|
|
801
801
|
} : { success: !0, data: i.value };
|
|
802
|
-
},
|
|
803
|
-
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
804
|
-
return Te(e)(t, n, o);
|
|
805
|
-
}, An = (e) => (t, n, r) => Te(e)(t, n, r), In = (e) => async (t, n, r) => {
|
|
802
|
+
}, xn = /* @__PURE__ */ ue(gt), Tn = (e) => (t, n, r) => {
|
|
806
803
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
807
804
|
return xe(e)(t, n, o);
|
|
808
|
-
},
|
|
805
|
+
}, An = (e) => (t, n, r) => xe(e)(t, n, r), In = (e) => async (t, n, r) => {
|
|
806
|
+
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
807
|
+
return Te(e)(t, n, o);
|
|
808
|
+
}, jn = (e) => async (t, n, r) => Te(e)(t, n, r), Sn = (e) => (t, n, r) => {
|
|
809
809
|
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
810
810
|
return ae(e)(t, n, o);
|
|
811
811
|
}, On = (e) => (t, n, r) => ae(e)(t, n, r), Rn = (e) => async (t, n, r) => {
|
|
@@ -815,7 +815,7 @@ const Te = (e) => (t, n, r, o) => {
|
|
|
815
815
|
function Yn() {
|
|
816
816
|
return new RegExp(Bn, "u");
|
|
817
817
|
}
|
|
818
|
-
const Jn = /^(?:(?: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])$/, Gn = /^(([0-9a-fA-F]{1,4}:){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}|:))$/, qn = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, Hn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Xn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,
|
|
818
|
+
const Jn = /^(?:(?: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])$/, Gn = /^(([0-9a-fA-F]{1,4}:){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}|:))$/, qn = /^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/, Hn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Xn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, vt = /^[A-Za-z0-9_-]*$/, Kn = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Qn = /^\+(?:[0-9]){6,14}[0-9]$/, bt = "(?:(?:\\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])))", er = /* @__PURE__ */ new RegExp(`^${bt}$`);
|
|
819
819
|
function wt(e) {
|
|
820
820
|
const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
|
|
821
821
|
return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
@@ -856,7 +856,7 @@ const rr = (e) => {
|
|
|
856
856
|
continue: !t.abort
|
|
857
857
|
});
|
|
858
858
|
};
|
|
859
|
-
}),
|
|
859
|
+
}), yt = /* @__PURE__ */ s("$ZodCheckGreaterThan", (e, t) => {
|
|
860
860
|
I.init(e, t);
|
|
861
861
|
const n = kt[typeof t.value];
|
|
862
862
|
e._zod.onattach.push((r) => {
|
|
@@ -950,7 +950,7 @@ const rr = (e) => {
|
|
|
950
950
|
var n;
|
|
951
951
|
I.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
952
952
|
const o = r.value;
|
|
953
|
-
return
|
|
953
|
+
return !$e(o) && o.length !== void 0;
|
|
954
954
|
}), e._zod.onattach.push((r) => {
|
|
955
955
|
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
956
956
|
t.maximum < o && (r._zod.bag.maximum = t.maximum);
|
|
@@ -958,7 +958,7 @@ const rr = (e) => {
|
|
|
958
958
|
const o = r.value;
|
|
959
959
|
if (o.length <= t.maximum)
|
|
960
960
|
return;
|
|
961
|
-
const c =
|
|
961
|
+
const c = Ee(o);
|
|
962
962
|
r.issues.push({
|
|
963
963
|
origin: c,
|
|
964
964
|
code: "too_big",
|
|
@@ -973,7 +973,7 @@ const rr = (e) => {
|
|
|
973
973
|
var n;
|
|
974
974
|
I.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
975
975
|
const o = r.value;
|
|
976
|
-
return
|
|
976
|
+
return !$e(o) && o.length !== void 0;
|
|
977
977
|
}), e._zod.onattach.push((r) => {
|
|
978
978
|
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
979
979
|
t.minimum > o && (r._zod.bag.minimum = t.minimum);
|
|
@@ -981,7 +981,7 @@ const rr = (e) => {
|
|
|
981
981
|
const o = r.value;
|
|
982
982
|
if (o.length >= t.minimum)
|
|
983
983
|
return;
|
|
984
|
-
const c =
|
|
984
|
+
const c = Ee(o);
|
|
985
985
|
r.issues.push({
|
|
986
986
|
origin: c,
|
|
987
987
|
code: "too_small",
|
|
@@ -996,7 +996,7 @@ const rr = (e) => {
|
|
|
996
996
|
var n;
|
|
997
997
|
I.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
|
|
998
998
|
const o = r.value;
|
|
999
|
-
return
|
|
999
|
+
return !$e(o) && o.length !== void 0;
|
|
1000
1000
|
}), e._zod.onattach.push((r) => {
|
|
1001
1001
|
const o = r._zod.bag;
|
|
1002
1002
|
o.minimum = t.length, o.maximum = t.length, o.length = t.length;
|
|
@@ -1004,7 +1004,7 @@ const rr = (e) => {
|
|
|
1004
1004
|
const o = r.value, i = o.length;
|
|
1005
1005
|
if (i === t.length)
|
|
1006
1006
|
return;
|
|
1007
|
-
const c =
|
|
1007
|
+
const c = Ee(o), a = i > t.length;
|
|
1008
1008
|
r.issues.push({
|
|
1009
1009
|
origin: c,
|
|
1010
1010
|
...a ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
@@ -1048,7 +1048,7 @@ const rr = (e) => {
|
|
|
1048
1048
|
t.pattern ?? (t.pattern = sr), le.init(e, t);
|
|
1049
1049
|
}), _r = /* @__PURE__ */ s("$ZodCheckUpperCase", (e, t) => {
|
|
1050
1050
|
t.pattern ?? (t.pattern = ar), le.init(e, t);
|
|
1051
|
-
}),
|
|
1051
|
+
}), gr = /* @__PURE__ */ s("$ZodCheckIncludes", (e, t) => {
|
|
1052
1052
|
I.init(e, t);
|
|
1053
1053
|
const n = se(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
|
|
1054
1054
|
t.pattern = r, e._zod.onattach.push((o) => {
|
|
@@ -1065,7 +1065,7 @@ const rr = (e) => {
|
|
|
1065
1065
|
continue: !t.abort
|
|
1066
1066
|
});
|
|
1067
1067
|
};
|
|
1068
|
-
}),
|
|
1068
|
+
}), vr = /* @__PURE__ */ s("$ZodCheckStartsWith", (e, t) => {
|
|
1069
1069
|
I.init(e, t);
|
|
1070
1070
|
const n = new RegExp(`^${se(t.prefix)}.*`);
|
|
1071
1071
|
t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
|
|
@@ -1131,7 +1131,7 @@ const zr = {
|
|
|
1131
1131
|
major: 4,
|
|
1132
1132
|
minor: 1,
|
|
1133
1133
|
patch: 11
|
|
1134
|
-
},
|
|
1134
|
+
}, y = /* @__PURE__ */ s("$ZodType", (e, t) => {
|
|
1135
1135
|
var n;
|
|
1136
1136
|
e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = zr;
|
|
1137
1137
|
const r = [...e._zod.def.checks ?? []];
|
|
@@ -1146,18 +1146,18 @@ const zr = {
|
|
|
1146
1146
|
else {
|
|
1147
1147
|
const o = (c, a, f) => {
|
|
1148
1148
|
let d = W(c), l;
|
|
1149
|
-
for (const
|
|
1150
|
-
if (
|
|
1151
|
-
if (!
|
|
1149
|
+
for (const g of a) {
|
|
1150
|
+
if (g._zod.def.when) {
|
|
1151
|
+
if (!g._zod.def.when(c))
|
|
1152
1152
|
continue;
|
|
1153
1153
|
} else if (d)
|
|
1154
1154
|
continue;
|
|
1155
|
-
const p = c.issues.length,
|
|
1156
|
-
if (
|
|
1155
|
+
const p = c.issues.length, v = g._zod.check(c);
|
|
1156
|
+
if (v instanceof Promise && f?.async === !1)
|
|
1157
1157
|
throw new B();
|
|
1158
|
-
if (l ||
|
|
1158
|
+
if (l || v instanceof Promise)
|
|
1159
1159
|
l = (l ?? Promise.resolve()).then(async () => {
|
|
1160
|
-
await
|
|
1160
|
+
await v, c.issues.length !== p && (d || (d = W(c, p)));
|
|
1161
1161
|
});
|
|
1162
1162
|
else {
|
|
1163
1163
|
if (c.issues.length === p)
|
|
@@ -1196,17 +1196,17 @@ const zr = {
|
|
|
1196
1196
|
e["~standard"] = {
|
|
1197
1197
|
validate: (o) => {
|
|
1198
1198
|
try {
|
|
1199
|
-
const i =
|
|
1199
|
+
const i = En(e, o);
|
|
1200
1200
|
return i.success ? { value: i.data } : { issues: i.error?.issues };
|
|
1201
1201
|
} catch {
|
|
1202
|
-
return
|
|
1202
|
+
return xn(e, o).then((c) => c.success ? { value: c.data } : { issues: c.error?.issues });
|
|
1203
1203
|
}
|
|
1204
1204
|
},
|
|
1205
1205
|
vendor: "zod",
|
|
1206
1206
|
version: 1
|
|
1207
1207
|
};
|
|
1208
1208
|
}), Ae = /* @__PURE__ */ s("$ZodString", (e, t) => {
|
|
1209
|
-
|
|
1209
|
+
y.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? rr(e._zod.bag), e._zod.parse = (n, r) => {
|
|
1210
1210
|
if (t.coerce)
|
|
1211
1211
|
try {
|
|
1212
1212
|
n.value = String(n.value);
|
|
@@ -1221,9 +1221,9 @@ const zr = {
|
|
|
1221
1221
|
};
|
|
1222
1222
|
}), w = /* @__PURE__ */ s("$ZodStringFormat", (e, t) => {
|
|
1223
1223
|
le.init(e, t), Ae.init(e, t);
|
|
1224
|
-
}),
|
|
1224
|
+
}), yr = /* @__PURE__ */ s("$ZodGUID", (e, t) => {
|
|
1225
1225
|
t.pattern ?? (t.pattern = Vn), w.init(e, t);
|
|
1226
|
-
}),
|
|
1226
|
+
}), $r = /* @__PURE__ */ s("$ZodUUID", (e, t) => {
|
|
1227
1227
|
if (t.version) {
|
|
1228
1228
|
const r = {
|
|
1229
1229
|
v1: 1,
|
|
@@ -1241,9 +1241,9 @@ const zr = {
|
|
|
1241
1241
|
} else
|
|
1242
1242
|
t.pattern ?? (t.pattern = Me());
|
|
1243
1243
|
w.init(e, t);
|
|
1244
|
-
}),
|
|
1244
|
+
}), Zr = /* @__PURE__ */ s("$ZodEmail", (e, t) => {
|
|
1245
1245
|
t.pattern ?? (t.pattern = Wn), w.init(e, t);
|
|
1246
|
-
}),
|
|
1246
|
+
}), Er = /* @__PURE__ */ s("$ZodURL", (e, t) => {
|
|
1247
1247
|
w.init(e, t), e._zod.check = (n) => {
|
|
1248
1248
|
try {
|
|
1249
1249
|
const r = n.value.trim(), o = new URL(r);
|
|
@@ -1275,9 +1275,9 @@ const zr = {
|
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|
|
1277
1277
|
};
|
|
1278
|
-
}),
|
|
1278
|
+
}), xr = /* @__PURE__ */ s("$ZodEmoji", (e, t) => {
|
|
1279
1279
|
t.pattern ?? (t.pattern = Yn()), w.init(e, t);
|
|
1280
|
-
}),
|
|
1280
|
+
}), Tr = /* @__PURE__ */ s("$ZodNanoID", (e, t) => {
|
|
1281
1281
|
t.pattern ?? (t.pattern = Ln), w.init(e, t);
|
|
1282
1282
|
}), Ar = /* @__PURE__ */ s("$ZodCUID", (e, t) => {
|
|
1283
1283
|
t.pattern ?? (t.pattern = Cn), w.init(e, t);
|
|
@@ -1347,7 +1347,7 @@ const zr = {
|
|
|
1347
1347
|
}
|
|
1348
1348
|
};
|
|
1349
1349
|
});
|
|
1350
|
-
function
|
|
1350
|
+
function $t(e) {
|
|
1351
1351
|
if (e === "")
|
|
1352
1352
|
return !0;
|
|
1353
1353
|
if (e.length % 4 !== 0)
|
|
@@ -1362,7 +1362,7 @@ const Mr = /* @__PURE__ */ s("$ZodBase64", (e, t) => {
|
|
|
1362
1362
|
t.pattern ?? (t.pattern = Xn), w.init(e, t), e._zod.onattach.push((n) => {
|
|
1363
1363
|
n._zod.bag.contentEncoding = "base64";
|
|
1364
1364
|
}), e._zod.check = (n) => {
|
|
1365
|
-
|
|
1365
|
+
$t(n.value) || n.issues.push({
|
|
1366
1366
|
code: "invalid_format",
|
|
1367
1367
|
format: "base64",
|
|
1368
1368
|
input: n.value,
|
|
@@ -1372,13 +1372,13 @@ const Mr = /* @__PURE__ */ s("$ZodBase64", (e, t) => {
|
|
|
1372
1372
|
};
|
|
1373
1373
|
});
|
|
1374
1374
|
function Vr(e) {
|
|
1375
|
-
if (!
|
|
1375
|
+
if (!vt.test(e))
|
|
1376
1376
|
return !1;
|
|
1377
1377
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1378
|
-
return
|
|
1378
|
+
return $t(n);
|
|
1379
1379
|
}
|
|
1380
1380
|
const Wr = /* @__PURE__ */ s("$ZodBase64URL", (e, t) => {
|
|
1381
|
-
t.pattern ?? (t.pattern =
|
|
1381
|
+
t.pattern ?? (t.pattern = vt), w.init(e, t), e._zod.onattach.push((n) => {
|
|
1382
1382
|
n._zod.bag.contentEncoding = "base64url";
|
|
1383
1383
|
}), e._zod.check = (n) => {
|
|
1384
1384
|
Vr(n.value) || n.issues.push({
|
|
@@ -1416,8 +1416,8 @@ const Jr = /* @__PURE__ */ s("$ZodJWT", (e, t) => {
|
|
|
1416
1416
|
continue: !t.abort
|
|
1417
1417
|
});
|
|
1418
1418
|
};
|
|
1419
|
-
}),
|
|
1420
|
-
|
|
1419
|
+
}), Zt = /* @__PURE__ */ s("$ZodNumber", (e, t) => {
|
|
1420
|
+
y.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? ir, e._zod.parse = (n, r) => {
|
|
1421
1421
|
if (t.coerce)
|
|
1422
1422
|
try {
|
|
1423
1423
|
n.value = Number(n.value);
|
|
@@ -1436,9 +1436,9 @@ const Jr = /* @__PURE__ */ s("$ZodJWT", (e, t) => {
|
|
|
1436
1436
|
}), n;
|
|
1437
1437
|
};
|
|
1438
1438
|
}), Gr = /* @__PURE__ */ s("$ZodNumber", (e, t) => {
|
|
1439
|
-
lr.init(e, t),
|
|
1439
|
+
lr.init(e, t), Zt.init(e, t);
|
|
1440
1440
|
}), qr = /* @__PURE__ */ s("$ZodBoolean", (e, t) => {
|
|
1441
|
-
|
|
1441
|
+
y.init(e, t), e._zod.pattern = cr, e._zod.parse = (n, r) => {
|
|
1442
1442
|
if (t.coerce)
|
|
1443
1443
|
try {
|
|
1444
1444
|
n.value = !!n.value;
|
|
@@ -1453,9 +1453,9 @@ const Jr = /* @__PURE__ */ s("$ZodJWT", (e, t) => {
|
|
|
1453
1453
|
}), n;
|
|
1454
1454
|
};
|
|
1455
1455
|
}), Hr = /* @__PURE__ */ s("$ZodUnknown", (e, t) => {
|
|
1456
|
-
|
|
1456
|
+
y.init(e, t), e._zod.parse = (n) => n;
|
|
1457
1457
|
}), Xr = /* @__PURE__ */ s("$ZodNever", (e, t) => {
|
|
1458
|
-
|
|
1458
|
+
y.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
|
|
1459
1459
|
expected: "never",
|
|
1460
1460
|
code: "invalid_type",
|
|
1461
1461
|
input: n.value,
|
|
@@ -1466,7 +1466,7 @@ function Ve(e, t, n) {
|
|
|
1466
1466
|
e.issues.length && t.issues.push(...pt(n, e.issues)), t.value[n] = e.value;
|
|
1467
1467
|
}
|
|
1468
1468
|
const Kr = /* @__PURE__ */ s("$ZodArray", (e, t) => {
|
|
1469
|
-
|
|
1469
|
+
y.init(e, t), e._zod.parse = (n, r) => {
|
|
1470
1470
|
const o = n.value;
|
|
1471
1471
|
if (!Array.isArray(o))
|
|
1472
1472
|
return n.issues.push({
|
|
@@ -1490,7 +1490,7 @@ const Kr = /* @__PURE__ */ s("$ZodArray", (e, t) => {
|
|
|
1490
1490
|
function ie(e, t, n, r) {
|
|
1491
1491
|
e.issues.length && t.issues.push(...pt(n, e.issues)), e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1493
|
+
function Et(e) {
|
|
1494
1494
|
const t = Object.keys(e.shape);
|
|
1495
1495
|
for (const r of t)
|
|
1496
1496
|
if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
|
|
@@ -1504,7 +1504,7 @@ function yt(e) {
|
|
|
1504
1504
|
optionalKeys: new Set(n)
|
|
1505
1505
|
};
|
|
1506
1506
|
}
|
|
1507
|
-
function
|
|
1507
|
+
function xt(e, t, n, r, o, i) {
|
|
1508
1508
|
const c = [], a = o.keySet, f = o.catchall._zod, d = f.def.type;
|
|
1509
1509
|
for (const l of Object.keys(t)) {
|
|
1510
1510
|
if (a.has(l))
|
|
@@ -1513,8 +1513,8 @@ function Tt(e, t, n, r, o, i) {
|
|
|
1513
1513
|
c.push(l);
|
|
1514
1514
|
continue;
|
|
1515
1515
|
}
|
|
1516
|
-
const
|
|
1517
|
-
|
|
1516
|
+
const g = f.run({ value: t[l], issues: [] }, r);
|
|
1517
|
+
g instanceof Promise ? e.push(g.then((p) => ie(p, n, l, t))) : ie(g, n, l, t);
|
|
1518
1518
|
}
|
|
1519
1519
|
return c.length && n.issues.push({
|
|
1520
1520
|
code: "unrecognized_keys",
|
|
@@ -1524,7 +1524,7 @@ function Tt(e, t, n, r, o, i) {
|
|
|
1524
1524
|
}), e.length ? Promise.all(e).then(() => n) : n;
|
|
1525
1525
|
}
|
|
1526
1526
|
const Qr = /* @__PURE__ */ s("$ZodObject", (e, t) => {
|
|
1527
|
-
if (
|
|
1527
|
+
if (y.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
|
|
1528
1528
|
const a = t.shape;
|
|
1529
1529
|
Object.defineProperty(t, "shape", {
|
|
1530
1530
|
get: () => {
|
|
@@ -1535,15 +1535,15 @@ const Qr = /* @__PURE__ */ s("$ZodObject", (e, t) => {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
});
|
|
1537
1537
|
}
|
|
1538
|
-
const r =
|
|
1538
|
+
const r = ye(() => Et(t));
|
|
1539
1539
|
b(e._zod, "propValues", () => {
|
|
1540
1540
|
const a = t.shape, f = {};
|
|
1541
1541
|
for (const d in a) {
|
|
1542
1542
|
const l = a[d]._zod;
|
|
1543
1543
|
if (l.values) {
|
|
1544
1544
|
f[d] ?? (f[d] = /* @__PURE__ */ new Set());
|
|
1545
|
-
for (const
|
|
1546
|
-
f[d].add(
|
|
1545
|
+
for (const g of l.values)
|
|
1546
|
+
f[d].add(g);
|
|
1547
1547
|
}
|
|
1548
1548
|
}
|
|
1549
1549
|
return f;
|
|
@@ -1561,29 +1561,29 @@ const Qr = /* @__PURE__ */ s("$ZodObject", (e, t) => {
|
|
|
1561
1561
|
inst: e
|
|
1562
1562
|
}), a;
|
|
1563
1563
|
a.value = {};
|
|
1564
|
-
const l = [],
|
|
1564
|
+
const l = [], g = c.shape;
|
|
1565
1565
|
for (const p of c.keys) {
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1566
|
+
const x = g[p]._zod.run({ value: d[p], issues: [] }, f);
|
|
1567
|
+
x instanceof Promise ? l.push(x.then((R) => ie(R, a, p, d))) : ie(x, a, p, d);
|
|
1568
1568
|
}
|
|
1569
|
-
return i ?
|
|
1569
|
+
return i ? xt(l, d, a, f, r.value, e) : l.length ? Promise.all(l).then(() => a) : a;
|
|
1570
1570
|
};
|
|
1571
1571
|
}), eo = /* @__PURE__ */ s("$ZodObjectJIT", (e, t) => {
|
|
1572
1572
|
Qr.init(e, t);
|
|
1573
|
-
const n = e._zod.parse, r =
|
|
1574
|
-
const
|
|
1573
|
+
const n = e._zod.parse, r = ye(() => Et(t)), o = (p) => {
|
|
1574
|
+
const v = new kr(["shape", "payload", "ctx"]), x = r.value, R = (A) => {
|
|
1575
1575
|
const j = Le(A);
|
|
1576
1576
|
return `shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`;
|
|
1577
1577
|
};
|
|
1578
|
-
|
|
1579
|
-
const
|
|
1578
|
+
v.write("const input = payload.value;");
|
|
1579
|
+
const T = /* @__PURE__ */ Object.create(null);
|
|
1580
1580
|
let P = 0;
|
|
1581
|
-
for (const A of
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
for (const A of
|
|
1585
|
-
const j =
|
|
1586
|
-
|
|
1581
|
+
for (const A of x.keys)
|
|
1582
|
+
T[A] = `key_${P++}`;
|
|
1583
|
+
v.write("const newResult = {};");
|
|
1584
|
+
for (const A of x.keys) {
|
|
1585
|
+
const j = T[A], C = Le(A);
|
|
1586
|
+
v.write(`const ${j} = ${R(A)};`), v.write(`
|
|
1587
1587
|
if (${j}.issues.length) {
|
|
1588
1588
|
payload.issues = payload.issues.concat(${j}.issues.map(iss => ({
|
|
1589
1589
|
...iss,
|
|
@@ -1602,20 +1602,20 @@ const Qr = /* @__PURE__ */ s("$ZodObject", (e, t) => {
|
|
|
1602
1602
|
|
|
1603
1603
|
`);
|
|
1604
1604
|
}
|
|
1605
|
-
|
|
1606
|
-
const L =
|
|
1605
|
+
v.write("payload.value = newResult;"), v.write("return payload;");
|
|
1606
|
+
const L = v.compile();
|
|
1607
1607
|
return (A, j) => L(p, A, j);
|
|
1608
1608
|
};
|
|
1609
1609
|
let i;
|
|
1610
1610
|
const c = oe, a = !dt.jitless, d = a && hn.value, l = t.catchall;
|
|
1611
|
-
let
|
|
1612
|
-
e._zod.parse = (p,
|
|
1613
|
-
|
|
1614
|
-
const
|
|
1615
|
-
return c(
|
|
1611
|
+
let g;
|
|
1612
|
+
e._zod.parse = (p, v) => {
|
|
1613
|
+
g ?? (g = r.value);
|
|
1614
|
+
const x = p.value;
|
|
1615
|
+
return c(x) ? a && d && v?.async === !1 && v.jitless !== !0 ? (i || (i = o(t.shape)), p = i(p, v), l ? xt([], x, p, v, g, e) : p) : n(p, v) : (p.issues.push({
|
|
1616
1616
|
expected: "object",
|
|
1617
1617
|
code: "invalid_type",
|
|
1618
|
-
input:
|
|
1618
|
+
input: x,
|
|
1619
1619
|
inst: e
|
|
1620
1620
|
}), p);
|
|
1621
1621
|
};
|
|
@@ -1633,13 +1633,13 @@ function We(e, t, n, r) {
|
|
|
1633
1633
|
}), t);
|
|
1634
1634
|
}
|
|
1635
1635
|
const to = /* @__PURE__ */ s("$ZodUnion", (e, t) => {
|
|
1636
|
-
|
|
1636
|
+
y.init(e, t), b(e._zod, "optin", () => t.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0), b(e._zod, "optout", () => t.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0), b(e._zod, "values", () => {
|
|
1637
1637
|
if (t.options.every((o) => o._zod.values))
|
|
1638
1638
|
return new Set(t.options.flatMap((o) => Array.from(o._zod.values)));
|
|
1639
1639
|
}), b(e._zod, "pattern", () => {
|
|
1640
1640
|
if (t.options.every((o) => o._zod.pattern)) {
|
|
1641
1641
|
const o = t.options.map((i) => i._zod.pattern);
|
|
1642
|
-
return new RegExp(`^(${o.map((i) =>
|
|
1642
|
+
return new RegExp(`^(${o.map((i) => Ze(i.source)).join("|")})$`);
|
|
1643
1643
|
}
|
|
1644
1644
|
});
|
|
1645
1645
|
const n = t.options.length === 1, r = t.options[0]._zod.run;
|
|
@@ -1664,7 +1664,7 @@ const to = /* @__PURE__ */ s("$ZodUnion", (e, t) => {
|
|
|
1664
1664
|
return c ? Promise.all(a).then((f) => We(f, o, e, i)) : We(a, o, e, i);
|
|
1665
1665
|
};
|
|
1666
1666
|
}), no = /* @__PURE__ */ s("$ZodIntersection", (e, t) => {
|
|
1667
|
-
|
|
1667
|
+
y.init(e, t), e._zod.parse = (n, r) => {
|
|
1668
1668
|
const o = n.value, i = t.left._zod.run({ value: o, issues: [] }, r), c = t.right._zod.run({ value: o, issues: [] }, r);
|
|
1669
1669
|
return i instanceof Promise || c instanceof Promise ? Promise.all([i, c]).then(([f, d]) => Be(n, f, d)) : Be(n, i, c);
|
|
1670
1670
|
};
|
|
@@ -1713,7 +1713,7 @@ function Be(e, t, n) {
|
|
|
1713
1713
|
return e.value = r.data, e;
|
|
1714
1714
|
}
|
|
1715
1715
|
const ro = /* @__PURE__ */ s("$ZodEnum", (e, t) => {
|
|
1716
|
-
|
|
1716
|
+
y.init(e, t);
|
|
1717
1717
|
const n = dn(t.entries), r = new Set(n);
|
|
1718
1718
|
e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((o) => pn.has(typeof o)).map((o) => typeof o == "string" ? se(o) : o.toString()).join("|")})$`), e._zod.parse = (o, i) => {
|
|
1719
1719
|
const c = o.value;
|
|
@@ -1725,7 +1725,7 @@ const ro = /* @__PURE__ */ s("$ZodEnum", (e, t) => {
|
|
|
1725
1725
|
}), o;
|
|
1726
1726
|
};
|
|
1727
1727
|
}), oo = /* @__PURE__ */ s("$ZodTransform", (e, t) => {
|
|
1728
|
-
|
|
1728
|
+
y.init(e, t), e._zod.parse = (n, r) => {
|
|
1729
1729
|
if (r.direction === "backward")
|
|
1730
1730
|
throw new lt(e.constructor.name);
|
|
1731
1731
|
const o = t.transform(n.value, n);
|
|
@@ -1740,9 +1740,9 @@ function Ye(e, t) {
|
|
|
1740
1740
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1741
1741
|
}
|
|
1742
1742
|
const io = /* @__PURE__ */ s("$ZodOptional", (e, t) => {
|
|
1743
|
-
|
|
1743
|
+
y.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", b(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), b(e._zod, "pattern", () => {
|
|
1744
1744
|
const n = t.innerType._zod.pattern;
|
|
1745
|
-
return n ? new RegExp(`^(${
|
|
1745
|
+
return n ? new RegExp(`^(${Ze(n.source)})?$`) : void 0;
|
|
1746
1746
|
}), e._zod.parse = (n, r) => {
|
|
1747
1747
|
if (t.innerType._zod.optin === "optional") {
|
|
1748
1748
|
const o = t.innerType._zod.run(n, r);
|
|
@@ -1751,12 +1751,12 @@ const io = /* @__PURE__ */ s("$ZodOptional", (e, t) => {
|
|
|
1751
1751
|
return n.value === void 0 ? n : t.innerType._zod.run(n, r);
|
|
1752
1752
|
};
|
|
1753
1753
|
}), co = /* @__PURE__ */ s("$ZodNullable", (e, t) => {
|
|
1754
|
-
|
|
1754
|
+
y.init(e, t), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), b(e._zod, "pattern", () => {
|
|
1755
1755
|
const n = t.innerType._zod.pattern;
|
|
1756
|
-
return n ? new RegExp(`^(${
|
|
1756
|
+
return n ? new RegExp(`^(${Ze(n.source)}|null)$`) : void 0;
|
|
1757
1757
|
}), b(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
|
|
1758
1758
|
}), so = /* @__PURE__ */ s("$ZodDefault", (e, t) => {
|
|
1759
|
-
|
|
1759
|
+
y.init(e, t), e._zod.optin = "optional", b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1760
1760
|
if (r.direction === "backward")
|
|
1761
1761
|
return t.innerType._zod.run(n, r);
|
|
1762
1762
|
if (n.value === void 0)
|
|
@@ -1769,9 +1769,9 @@ function Je(e, t) {
|
|
|
1769
1769
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1770
1770
|
}
|
|
1771
1771
|
const ao = /* @__PURE__ */ s("$ZodPrefault", (e, t) => {
|
|
1772
|
-
|
|
1772
|
+
y.init(e, t), e._zod.optin = "optional", b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
|
|
1773
1773
|
}), uo = /* @__PURE__ */ s("$ZodNonOptional", (e, t) => {
|
|
1774
|
-
|
|
1774
|
+
y.init(e, t), b(e._zod, "values", () => {
|
|
1775
1775
|
const n = t.innerType._zod.values;
|
|
1776
1776
|
return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
|
|
1777
1777
|
}), e._zod.parse = (n, r) => {
|
|
@@ -1788,7 +1788,7 @@ function Ge(e, t) {
|
|
|
1788
1788
|
}), e;
|
|
1789
1789
|
}
|
|
1790
1790
|
const lo = /* @__PURE__ */ s("$ZodCatch", (e, t) => {
|
|
1791
|
-
|
|
1791
|
+
y.init(e, t), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), b(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
|
|
1792
1792
|
if (r.direction === "backward")
|
|
1793
1793
|
return t.innerType._zod.run(n, r);
|
|
1794
1794
|
const o = t.innerType._zod.run(n, r);
|
|
@@ -1807,7 +1807,7 @@ const lo = /* @__PURE__ */ s("$ZodCatch", (e, t) => {
|
|
|
1807
1807
|
}), n.issues = []), n);
|
|
1808
1808
|
};
|
|
1809
1809
|
}), fo = /* @__PURE__ */ s("$ZodPipe", (e, t) => {
|
|
1810
|
-
|
|
1810
|
+
y.init(e, t), b(e._zod, "values", () => t.in._zod.values), b(e._zod, "optin", () => t.in._zod.optin), b(e._zod, "optout", () => t.out._zod.optout), b(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
|
|
1811
1811
|
if (r.direction === "backward") {
|
|
1812
1812
|
const i = t.out._zod.run(n, r);
|
|
1813
1813
|
return i instanceof Promise ? i.then((c) => ee(c, t.in, r)) : ee(i, t.in, r);
|
|
@@ -1820,7 +1820,7 @@ function ee(e, t, n) {
|
|
|
1820
1820
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, n);
|
|
1821
1821
|
}
|
|
1822
1822
|
const ho = /* @__PURE__ */ s("$ZodReadonly", (e, t) => {
|
|
1823
|
-
|
|
1823
|
+
y.init(e, t), b(e._zod, "propValues", () => t.innerType._zod.propValues), b(e._zod, "values", () => t.innerType._zod.values), b(e._zod, "optin", () => t.innerType._zod.optin), b(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, r) => {
|
|
1824
1824
|
if (r.direction === "backward")
|
|
1825
1825
|
return t.innerType._zod.run(n, r);
|
|
1826
1826
|
const o = t.innerType._zod.run(n, r);
|
|
@@ -1831,7 +1831,7 @@ function qe(e) {
|
|
|
1831
1831
|
return e.value = Object.freeze(e.value), e;
|
|
1832
1832
|
}
|
|
1833
1833
|
const po = /* @__PURE__ */ s("$ZodCustom", (e, t) => {
|
|
1834
|
-
I.init(e, t),
|
|
1834
|
+
I.init(e, t), y.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
|
|
1835
1835
|
const r = n.value, o = t.fn(r);
|
|
1836
1836
|
if (o instanceof Promise)
|
|
1837
1837
|
return o.then((i) => He(i, n, r, e));
|
|
@@ -1891,13 +1891,13 @@ function _o() {
|
|
|
1891
1891
|
return new mo();
|
|
1892
1892
|
}
|
|
1893
1893
|
const te = /* @__PURE__ */ _o();
|
|
1894
|
-
function
|
|
1894
|
+
function go(e, t) {
|
|
1895
1895
|
return new e({
|
|
1896
1896
|
type: "string",
|
|
1897
1897
|
...h(t)
|
|
1898
1898
|
});
|
|
1899
1899
|
}
|
|
1900
|
-
function
|
|
1900
|
+
function vo(e, t) {
|
|
1901
1901
|
return new e({
|
|
1902
1902
|
type: "string",
|
|
1903
1903
|
format: "email",
|
|
@@ -1954,7 +1954,7 @@ function zo(e, t) {
|
|
|
1954
1954
|
...h(t)
|
|
1955
1955
|
});
|
|
1956
1956
|
}
|
|
1957
|
-
function
|
|
1957
|
+
function yo(e, t) {
|
|
1958
1958
|
return new e({
|
|
1959
1959
|
type: "string",
|
|
1960
1960
|
format: "url",
|
|
@@ -1963,7 +1963,7 @@ function $o(e, t) {
|
|
|
1963
1963
|
...h(t)
|
|
1964
1964
|
});
|
|
1965
1965
|
}
|
|
1966
|
-
function
|
|
1966
|
+
function $o(e, t) {
|
|
1967
1967
|
return new e({
|
|
1968
1968
|
type: "string",
|
|
1969
1969
|
format: "emoji",
|
|
@@ -1972,7 +1972,7 @@ function Zo(e, t) {
|
|
|
1972
1972
|
...h(t)
|
|
1973
1973
|
});
|
|
1974
1974
|
}
|
|
1975
|
-
function
|
|
1975
|
+
function Zo(e, t) {
|
|
1976
1976
|
return new e({
|
|
1977
1977
|
type: "string",
|
|
1978
1978
|
format: "nanoid",
|
|
@@ -1981,7 +1981,7 @@ function Eo(e, t) {
|
|
|
1981
1981
|
...h(t)
|
|
1982
1982
|
});
|
|
1983
1983
|
}
|
|
1984
|
-
function
|
|
1984
|
+
function Eo(e, t) {
|
|
1985
1985
|
return new e({
|
|
1986
1986
|
type: "string",
|
|
1987
1987
|
format: "cuid",
|
|
@@ -1990,7 +1990,7 @@ function yo(e, t) {
|
|
|
1990
1990
|
...h(t)
|
|
1991
1991
|
});
|
|
1992
1992
|
}
|
|
1993
|
-
function
|
|
1993
|
+
function xo(e, t) {
|
|
1994
1994
|
return new e({
|
|
1995
1995
|
type: "string",
|
|
1996
1996
|
format: "cuid2",
|
|
@@ -1999,7 +1999,7 @@ function To(e, t) {
|
|
|
1999
1999
|
...h(t)
|
|
2000
2000
|
});
|
|
2001
2001
|
}
|
|
2002
|
-
function
|
|
2002
|
+
function To(e, t) {
|
|
2003
2003
|
return new e({
|
|
2004
2004
|
type: "string",
|
|
2005
2005
|
format: "ulid",
|
|
@@ -2184,15 +2184,15 @@ function _e(e, t) {
|
|
|
2184
2184
|
});
|
|
2185
2185
|
}
|
|
2186
2186
|
function Qe(e, t) {
|
|
2187
|
-
return new
|
|
2187
|
+
return new yt({
|
|
2188
2188
|
check: "greater_than",
|
|
2189
2189
|
...h(t),
|
|
2190
2190
|
value: e,
|
|
2191
2191
|
inclusive: !1
|
|
2192
2192
|
});
|
|
2193
2193
|
}
|
|
2194
|
-
function
|
|
2195
|
-
return new
|
|
2194
|
+
function ge(e, t) {
|
|
2195
|
+
return new yt({
|
|
2196
2196
|
check: "greater_than",
|
|
2197
2197
|
...h(t),
|
|
2198
2198
|
value: e,
|
|
@@ -2206,7 +2206,7 @@ function et(e, t) {
|
|
|
2206
2206
|
value: e
|
|
2207
2207
|
});
|
|
2208
2208
|
}
|
|
2209
|
-
function
|
|
2209
|
+
function Tt(e, t) {
|
|
2210
2210
|
return new dr({
|
|
2211
2211
|
check: "max_length",
|
|
2212
2212
|
...h(t),
|
|
@@ -2250,7 +2250,7 @@ function Ho(e) {
|
|
|
2250
2250
|
});
|
|
2251
2251
|
}
|
|
2252
2252
|
function Xo(e, t) {
|
|
2253
|
-
return new
|
|
2253
|
+
return new gr({
|
|
2254
2254
|
check: "string_format",
|
|
2255
2255
|
format: "includes",
|
|
2256
2256
|
...h(t),
|
|
@@ -2258,7 +2258,7 @@ function Xo(e, t) {
|
|
|
2258
2258
|
});
|
|
2259
2259
|
}
|
|
2260
2260
|
function Ko(e, t) {
|
|
2261
|
-
return new
|
|
2261
|
+
return new vr({
|
|
2262
2262
|
check: "string_format",
|
|
2263
2263
|
format: "starts_with",
|
|
2264
2264
|
...h(t),
|
|
@@ -2354,22 +2354,22 @@ function mi(e) {
|
|
|
2354
2354
|
const _i = (e, t) => {
|
|
2355
2355
|
_t.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
|
|
2356
2356
|
format: {
|
|
2357
|
-
value: (n) =>
|
|
2357
|
+
value: (n) => Zn(e, n)
|
|
2358
2358
|
// enumerable: false,
|
|
2359
2359
|
},
|
|
2360
2360
|
flatten: {
|
|
2361
|
-
value: (n) =>
|
|
2361
|
+
value: (n) => $n(e, n)
|
|
2362
2362
|
// enumerable: false,
|
|
2363
2363
|
},
|
|
2364
2364
|
addIssue: {
|
|
2365
2365
|
value: (n) => {
|
|
2366
|
-
e.issues.push(n), e.message = JSON.stringify(e.issues,
|
|
2366
|
+
e.issues.push(n), e.message = JSON.stringify(e.issues, ve, 2);
|
|
2367
2367
|
}
|
|
2368
2368
|
// enumerable: false,
|
|
2369
2369
|
},
|
|
2370
2370
|
addIssues: {
|
|
2371
2371
|
value: (n) => {
|
|
2372
|
-
e.issues.push(...n), e.message = JSON.stringify(e.issues,
|
|
2372
|
+
e.issues.push(...n), e.message = JSON.stringify(e.issues, ve, 2);
|
|
2373
2373
|
}
|
|
2374
2374
|
// enumerable: false,
|
|
2375
2375
|
},
|
|
@@ -2382,12 +2382,12 @@ const _i = (e, t) => {
|
|
|
2382
2382
|
});
|
|
2383
2383
|
}, S = s("ZodError", _i, {
|
|
2384
2384
|
Parent: Error
|
|
2385
|
-
}),
|
|
2385
|
+
}), gi = /* @__PURE__ */ xe(S), vi = /* @__PURE__ */ Te(S), bi = /* @__PURE__ */ ae(S), wi = /* @__PURE__ */ ue(S), ki = /* @__PURE__ */ Tn(S), zi = /* @__PURE__ */ An(S), yi = /* @__PURE__ */ In(S), $i = /* @__PURE__ */ jn(S), Zi = /* @__PURE__ */ Sn(S), Ei = /* @__PURE__ */ On(S), xi = /* @__PURE__ */ Rn(S), Ti = /* @__PURE__ */ Pn(S), $ = /* @__PURE__ */ s("ZodType", (e, t) => (y.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(F(t, {
|
|
2386
2386
|
checks: [
|
|
2387
2387
|
...t.checks ?? [],
|
|
2388
2388
|
...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
2389
2389
|
]
|
|
2390
|
-
})), e.clone = (n, r) => O(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) =>
|
|
2390
|
+
})), e.clone = (n, r) => O(e, n, r), e.brand = () => e, e.register = ((n, r) => (n.add(e, r), e)), e.parse = (n, r) => gi(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => bi(e, n, r), e.parseAsync = async (n, r) => vi(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => wi(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => ki(e, n, r), e.decode = (n, r) => zi(e, n, r), e.encodeAsync = async (n, r) => yi(e, n, r), e.decodeAsync = async (n, r) => $i(e, n, r), e.safeEncode = (n, r) => Zi(e, n, r), e.safeDecode = (n, r) => Ei(e, n, r), e.safeEncodeAsync = async (n, r) => xi(e, n, r), e.safeDecodeAsync = async (n, r) => Ti(e, n, r), e.refine = (n, r) => e.check(bc(n, r)), e.superRefine = (n) => e.check(wc(n)), e.overwrite = (n) => e.check(H(n)), e.optional = () => ct(e), e.nullable = () => st(e), e.nullish = () => ct(st(e)), e.nonoptional = (n) => fc(e, n), e.array = () => Qi(e), e.or = (n) => nc([e, n]), e.and = (n) => oc(e, n), e.transform = (n) => at(e, cc(n)), e.default = (n) => uc(e, n), e.prefault = (n) => dc(e, n), e.catch = (n) => pc(e, n), e.pipe = (n) => at(e, n), e.readonly = () => gc(e), e.describe = (n) => {
|
|
2391
2391
|
const r = e.clone();
|
|
2392
2392
|
return te.add(r, { description: n }), r;
|
|
2393
2393
|
}, Object.defineProperty(e, "description", {
|
|
@@ -2401,29 +2401,29 @@ const _i = (e, t) => {
|
|
|
2401
2401
|
const r = e.clone();
|
|
2402
2402
|
return te.add(r, n[0]), r;
|
|
2403
2403
|
}, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), It = /* @__PURE__ */ s("_ZodString", (e, t) => {
|
|
2404
|
-
Ae.init(e, t),
|
|
2404
|
+
Ae.init(e, t), $.init(e, t);
|
|
2405
2405
|
const n = e._zod.bag;
|
|
2406
|
-
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(Go(...r)), e.includes = (...r) => e.check(Xo(...r)), e.startsWith = (...r) => e.check(Ko(...r)), e.endsWith = (...r) => e.check(Qo(...r)), e.min = (...r) => e.check(ce(...r)), e.max = (...r) => e.check(
|
|
2406
|
+
e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(Go(...r)), e.includes = (...r) => e.check(Xo(...r)), e.startsWith = (...r) => e.check(Ko(...r)), e.endsWith = (...r) => e.check(Qo(...r)), e.min = (...r) => e.check(ce(...r)), e.max = (...r) => e.check(Tt(...r)), e.length = (...r) => e.check(At(...r)), e.nonempty = (...r) => e.check(ce(1, ...r)), e.lowercase = (r) => e.check(qo(r)), e.uppercase = (r) => e.check(Ho(r)), e.trim = () => e.check(ti()), e.normalize = (...r) => e.check(ei(...r)), e.toLowerCase = () => e.check(ni()), e.toUpperCase = () => e.check(ri());
|
|
2407
2407
|
}), Ai = /* @__PURE__ */ s("ZodString", (e, t) => {
|
|
2408
|
-
Ae.init(e, t), It.init(e, t), e.email = (n) => e.check(
|
|
2408
|
+
Ae.init(e, t), It.init(e, t), e.email = (n) => e.check(vo(Ii, n)), e.url = (n) => e.check(yo(ji, n)), e.jwt = (n) => e.check(Do(Yi, n)), e.emoji = (n) => e.check($o(Si, n)), e.guid = (n) => e.check(Xe(tt, n)), e.uuid = (n) => e.check(bo(re, n)), e.uuidv4 = (n) => e.check(wo(re, n)), e.uuidv6 = (n) => e.check(ko(re, n)), e.uuidv7 = (n) => e.check(zo(re, n)), e.nanoid = (n) => e.check(Zo(Oi, n)), e.guid = (n) => e.check(Xe(tt, n)), e.cuid = (n) => e.check(Eo(Ri, n)), e.cuid2 = (n) => e.check(xo(Pi, n)), e.ulid = (n) => e.check(To(Ci, n)), e.base64 = (n) => e.check(Po(Vi, n)), e.base64url = (n) => e.check(Co(Wi, n)), e.xid = (n) => e.check(Ao(Ni, n)), e.ksuid = (n) => e.check(Io(Di, n)), e.ipv4 = (n) => e.check(jo(Ui, n)), e.ipv6 = (n) => e.check(So(Fi, n)), e.cidrv4 = (n) => e.check(Oo(Li, n)), e.cidrv6 = (n) => e.check(Ro(Mi, n)), e.e164 = (n) => e.check(No(Bi, n)), e.datetime = (n) => e.check(ui(n)), e.date = (n) => e.check(di(n)), e.time = (n) => e.check(hi(n)), e.duration = (n) => e.check(mi(n));
|
|
2409
2409
|
});
|
|
2410
2410
|
function ne(e) {
|
|
2411
|
-
return
|
|
2411
|
+
return go(Ai, e);
|
|
2412
2412
|
}
|
|
2413
2413
|
const k = /* @__PURE__ */ s("ZodStringFormat", (e, t) => {
|
|
2414
2414
|
w.init(e, t), It.init(e, t);
|
|
2415
2415
|
}), Ii = /* @__PURE__ */ s("ZodEmail", (e, t) => {
|
|
2416
|
-
|
|
2416
|
+
Zr.init(e, t), k.init(e, t);
|
|
2417
2417
|
}), tt = /* @__PURE__ */ s("ZodGUID", (e, t) => {
|
|
2418
|
-
|
|
2418
|
+
yr.init(e, t), k.init(e, t);
|
|
2419
2419
|
}), re = /* @__PURE__ */ s("ZodUUID", (e, t) => {
|
|
2420
|
-
|
|
2420
|
+
$r.init(e, t), k.init(e, t);
|
|
2421
2421
|
}), ji = /* @__PURE__ */ s("ZodURL", (e, t) => {
|
|
2422
|
-
|
|
2422
|
+
Er.init(e, t), k.init(e, t);
|
|
2423
2423
|
}), Si = /* @__PURE__ */ s("ZodEmoji", (e, t) => {
|
|
2424
|
-
Tr.init(e, t), k.init(e, t);
|
|
2425
|
-
}), Oi = /* @__PURE__ */ s("ZodNanoID", (e, t) => {
|
|
2426
2424
|
xr.init(e, t), k.init(e, t);
|
|
2425
|
+
}), Oi = /* @__PURE__ */ s("ZodNanoID", (e, t) => {
|
|
2426
|
+
Tr.init(e, t), k.init(e, t);
|
|
2427
2427
|
}), Ri = /* @__PURE__ */ s("ZodCUID", (e, t) => {
|
|
2428
2428
|
Ar.init(e, t), k.init(e, t);
|
|
2429
2429
|
}), Pi = /* @__PURE__ */ s("ZodCUID2", (e, t) => {
|
|
@@ -2451,7 +2451,7 @@ const k = /* @__PURE__ */ s("ZodStringFormat", (e, t) => {
|
|
|
2451
2451
|
}), Yi = /* @__PURE__ */ s("ZodJWT", (e, t) => {
|
|
2452
2452
|
Jr.init(e, t), k.init(e, t);
|
|
2453
2453
|
}), jt = /* @__PURE__ */ s("ZodNumber", (e, t) => {
|
|
2454
|
-
|
|
2454
|
+
Zt.init(e, t), $.init(e, t), e.gt = (r, o) => e.check(Qe(r, o)), e.gte = (r, o) => e.check(ge(r, o)), e.min = (r, o) => e.check(ge(r, o)), e.lt = (r, o) => e.check(Ke(r, o)), e.lte = (r, o) => e.check(_e(r, o)), e.max = (r, o) => e.check(_e(r, o)), e.int = (r) => e.check(rt(r)), e.safe = (r) => e.check(rt(r)), e.positive = (r) => e.check(Qe(0, r)), e.nonnegative = (r) => e.check(ge(0, r)), e.negative = (r) => e.check(Ke(0, r)), e.nonpositive = (r) => e.check(_e(0, r)), e.multipleOf = (r, o) => e.check(et(r, o)), e.step = (r, o) => e.check(et(r, o)), e.finite = () => e;
|
|
2455
2455
|
const n = e._zod.bag;
|
|
2456
2456
|
e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
|
|
2457
2457
|
});
|
|
@@ -2465,31 +2465,31 @@ function rt(e) {
|
|
|
2465
2465
|
return Wo(Ji, e);
|
|
2466
2466
|
}
|
|
2467
2467
|
const Gi = /* @__PURE__ */ s("ZodBoolean", (e, t) => {
|
|
2468
|
-
qr.init(e, t),
|
|
2468
|
+
qr.init(e, t), $.init(e, t);
|
|
2469
2469
|
});
|
|
2470
2470
|
function ot(e) {
|
|
2471
2471
|
return Bo(Gi, e);
|
|
2472
2472
|
}
|
|
2473
2473
|
const qi = /* @__PURE__ */ s("ZodUnknown", (e, t) => {
|
|
2474
|
-
Hr.init(e, t),
|
|
2474
|
+
Hr.init(e, t), $.init(e, t);
|
|
2475
2475
|
});
|
|
2476
2476
|
function it() {
|
|
2477
2477
|
return Yo(qi);
|
|
2478
2478
|
}
|
|
2479
2479
|
const Hi = /* @__PURE__ */ s("ZodNever", (e, t) => {
|
|
2480
|
-
Xr.init(e, t),
|
|
2480
|
+
Xr.init(e, t), $.init(e, t);
|
|
2481
2481
|
});
|
|
2482
2482
|
function Xi(e) {
|
|
2483
2483
|
return Jo(Hi, e);
|
|
2484
2484
|
}
|
|
2485
2485
|
const Ki = /* @__PURE__ */ s("ZodArray", (e, t) => {
|
|
2486
|
-
Kr.init(e, t),
|
|
2486
|
+
Kr.init(e, t), $.init(e, t), e.element = t.element, e.min = (n, r) => e.check(ce(n, r)), e.nonempty = (n) => e.check(ce(1, n)), e.max = (n, r) => e.check(Tt(n, r)), e.length = (n, r) => e.check(At(n, r)), e.unwrap = () => e.element;
|
|
2487
2487
|
});
|
|
2488
2488
|
function Qi(e, t) {
|
|
2489
2489
|
return oi(Ki, e, t);
|
|
2490
2490
|
}
|
|
2491
2491
|
const ec = /* @__PURE__ */ s("ZodObject", (e, t) => {
|
|
2492
|
-
eo.init(e, t),
|
|
2492
|
+
eo.init(e, t), $.init(e, t), b(e, "shape", () => t.shape), e.keyof = () => Ie(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: it() }), e.loose = () => e.clone({ ...e._zod.def, catchall: it() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Xi() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => bn(e, n), e.safeExtend = (n) => wn(e, n), e.merge = (n) => kn(e, n), e.pick = (n) => gn(e, n), e.omit = (n) => vn(e, n), e.partial = (...n) => zn(St, e, n[0]), e.required = (...n) => yn(Ot, e, n[0]);
|
|
2493
2493
|
});
|
|
2494
2494
|
function we(e, t) {
|
|
2495
2495
|
const n = {
|
|
@@ -2500,7 +2500,7 @@ function we(e, t) {
|
|
|
2500
2500
|
return new ec(n);
|
|
2501
2501
|
}
|
|
2502
2502
|
const tc = /* @__PURE__ */ s("ZodUnion", (e, t) => {
|
|
2503
|
-
to.init(e, t),
|
|
2503
|
+
to.init(e, t), $.init(e, t), e.options = t.options;
|
|
2504
2504
|
});
|
|
2505
2505
|
function nc(e, t) {
|
|
2506
2506
|
return new tc({
|
|
@@ -2510,7 +2510,7 @@ function nc(e, t) {
|
|
|
2510
2510
|
});
|
|
2511
2511
|
}
|
|
2512
2512
|
const rc = /* @__PURE__ */ s("ZodIntersection", (e, t) => {
|
|
2513
|
-
no.init(e, t),
|
|
2513
|
+
no.init(e, t), $.init(e, t);
|
|
2514
2514
|
});
|
|
2515
2515
|
function oc(e, t) {
|
|
2516
2516
|
return new rc({
|
|
@@ -2520,7 +2520,7 @@ function oc(e, t) {
|
|
|
2520
2520
|
});
|
|
2521
2521
|
}
|
|
2522
2522
|
const ke = /* @__PURE__ */ s("ZodEnum", (e, t) => {
|
|
2523
|
-
ro.init(e, t),
|
|
2523
|
+
ro.init(e, t), $.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2524
2524
|
const n = new Set(Object.keys(t.entries));
|
|
2525
2525
|
e.extract = (r, o) => {
|
|
2526
2526
|
const i = {};
|
|
@@ -2559,7 +2559,7 @@ function Ie(e, t) {
|
|
|
2559
2559
|
});
|
|
2560
2560
|
}
|
|
2561
2561
|
const ic = /* @__PURE__ */ s("ZodTransform", (e, t) => {
|
|
2562
|
-
oo.init(e, t),
|
|
2562
|
+
oo.init(e, t), $.init(e, t), e._zod.parse = (n, r) => {
|
|
2563
2563
|
if (r.direction === "backward")
|
|
2564
2564
|
throw new lt(e.constructor.name);
|
|
2565
2565
|
n.addIssue = (i) => {
|
|
@@ -2581,7 +2581,7 @@ function cc(e) {
|
|
|
2581
2581
|
});
|
|
2582
2582
|
}
|
|
2583
2583
|
const St = /* @__PURE__ */ s("ZodOptional", (e, t) => {
|
|
2584
|
-
io.init(e, t),
|
|
2584
|
+
io.init(e, t), $.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2585
2585
|
});
|
|
2586
2586
|
function ct(e) {
|
|
2587
2587
|
return new St({
|
|
@@ -2590,7 +2590,7 @@ function ct(e) {
|
|
|
2590
2590
|
});
|
|
2591
2591
|
}
|
|
2592
2592
|
const sc = /* @__PURE__ */ s("ZodNullable", (e, t) => {
|
|
2593
|
-
co.init(e, t),
|
|
2593
|
+
co.init(e, t), $.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2594
2594
|
});
|
|
2595
2595
|
function st(e) {
|
|
2596
2596
|
return new sc({
|
|
@@ -2599,7 +2599,7 @@ function st(e) {
|
|
|
2599
2599
|
});
|
|
2600
2600
|
}
|
|
2601
2601
|
const ac = /* @__PURE__ */ s("ZodDefault", (e, t) => {
|
|
2602
|
-
so.init(e, t),
|
|
2602
|
+
so.init(e, t), $.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
2603
2603
|
});
|
|
2604
2604
|
function uc(e, t) {
|
|
2605
2605
|
return new ac({
|
|
@@ -2611,7 +2611,7 @@ function uc(e, t) {
|
|
|
2611
2611
|
});
|
|
2612
2612
|
}
|
|
2613
2613
|
const lc = /* @__PURE__ */ s("ZodPrefault", (e, t) => {
|
|
2614
|
-
ao.init(e, t),
|
|
2614
|
+
ao.init(e, t), $.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2615
2615
|
});
|
|
2616
2616
|
function dc(e, t) {
|
|
2617
2617
|
return new lc({
|
|
@@ -2623,7 +2623,7 @@ function dc(e, t) {
|
|
|
2623
2623
|
});
|
|
2624
2624
|
}
|
|
2625
2625
|
const Ot = /* @__PURE__ */ s("ZodNonOptional", (e, t) => {
|
|
2626
|
-
uo.init(e, t),
|
|
2626
|
+
uo.init(e, t), $.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2627
2627
|
});
|
|
2628
2628
|
function fc(e, t) {
|
|
2629
2629
|
return new Ot({
|
|
@@ -2633,7 +2633,7 @@ function fc(e, t) {
|
|
|
2633
2633
|
});
|
|
2634
2634
|
}
|
|
2635
2635
|
const hc = /* @__PURE__ */ s("ZodCatch", (e, t) => {
|
|
2636
|
-
lo.init(e, t),
|
|
2636
|
+
lo.init(e, t), $.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
2637
2637
|
});
|
|
2638
2638
|
function pc(e, t) {
|
|
2639
2639
|
return new hc({
|
|
@@ -2643,7 +2643,7 @@ function pc(e, t) {
|
|
|
2643
2643
|
});
|
|
2644
2644
|
}
|
|
2645
2645
|
const mc = /* @__PURE__ */ s("ZodPipe", (e, t) => {
|
|
2646
|
-
fo.init(e, t),
|
|
2646
|
+
fo.init(e, t), $.init(e, t), e.in = t.in, e.out = t.out;
|
|
2647
2647
|
});
|
|
2648
2648
|
function at(e, t) {
|
|
2649
2649
|
return new mc({
|
|
@@ -2654,19 +2654,19 @@ function at(e, t) {
|
|
|
2654
2654
|
});
|
|
2655
2655
|
}
|
|
2656
2656
|
const _c = /* @__PURE__ */ s("ZodReadonly", (e, t) => {
|
|
2657
|
-
ho.init(e, t),
|
|
2657
|
+
ho.init(e, t), $.init(e, t), e.unwrap = () => e._zod.def.innerType;
|
|
2658
2658
|
});
|
|
2659
|
-
function
|
|
2659
|
+
function gc(e) {
|
|
2660
2660
|
return new _c({
|
|
2661
2661
|
type: "readonly",
|
|
2662
2662
|
innerType: e
|
|
2663
2663
|
});
|
|
2664
2664
|
}
|
|
2665
|
-
const
|
|
2666
|
-
po.init(e, t),
|
|
2665
|
+
const vc = /* @__PURE__ */ s("ZodCustom", (e, t) => {
|
|
2666
|
+
po.init(e, t), $.init(e, t);
|
|
2667
2667
|
});
|
|
2668
2668
|
function bc(e, t = {}) {
|
|
2669
|
-
return ii(
|
|
2669
|
+
return ii(vc, e, t);
|
|
2670
2670
|
}
|
|
2671
2671
|
function wc(e) {
|
|
2672
2672
|
return ci(e);
|
|
@@ -2704,22 +2704,22 @@ const zc = (e = "") => {
|
|
|
2704
2704
|
})));
|
|
2705
2705
|
}, [e]);
|
|
2706
2706
|
const o = V((l) => {
|
|
2707
|
-
const
|
|
2708
|
-
n((
|
|
2709
|
-
...
|
|
2707
|
+
const g = l.trim() ? l.trim().split(/\s+/).length : 0, p = l.length;
|
|
2708
|
+
n((v) => ({
|
|
2709
|
+
...v,
|
|
2710
2710
|
content: l,
|
|
2711
|
-
wordCount:
|
|
2711
|
+
wordCount: g,
|
|
2712
2712
|
characterCount: p,
|
|
2713
2713
|
hasUnsavedChanges: !0
|
|
2714
2714
|
}));
|
|
2715
2715
|
}, []), i = V((l) => {
|
|
2716
|
-
n((
|
|
2717
|
-
...
|
|
2716
|
+
n((g) => ({
|
|
2717
|
+
...g,
|
|
2718
2718
|
title: l,
|
|
2719
2719
|
hasUnsavedChanges: !0
|
|
2720
2720
|
}));
|
|
2721
|
-
}, []), c = V((l,
|
|
2722
|
-
document.execCommand(l, !1,
|
|
2721
|
+
}, []), c = V((l, g) => {
|
|
2722
|
+
document.execCommand(l, !1, g), r.current?.focus();
|
|
2723
2723
|
}, []), a = V(() => {
|
|
2724
2724
|
try {
|
|
2725
2725
|
return { success: !0, data: kc.parse({
|
|
@@ -2737,17 +2737,17 @@ const zc = (e = "") => {
|
|
|
2737
2737
|
}
|
|
2738
2738
|
}, [t]), f = V(
|
|
2739
2739
|
(l = { includeStyles: !0, includeMeta: !0 }) => {
|
|
2740
|
-
const
|
|
2741
|
-
if (!
|
|
2742
|
-
throw new Error(
|
|
2743
|
-
const { data: p } =
|
|
2744
|
-
let
|
|
2740
|
+
const g = a();
|
|
2741
|
+
if (!g.success)
|
|
2742
|
+
throw new Error(g.error);
|
|
2743
|
+
const { data: p } = g;
|
|
2744
|
+
let v = `<!DOCTYPE html>
|
|
2745
2745
|
<html>
|
|
2746
2746
|
<head>
|
|
2747
2747
|
<meta charset="UTF-8">
|
|
2748
2748
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
2749
2749
|
<title>${p?.title}</title>`;
|
|
2750
|
-
return l.includeStyles && (
|
|
2750
|
+
return l.includeStyles && (v += `
|
|
2751
2751
|
<style>
|
|
2752
2752
|
body {
|
|
2753
2753
|
font-family: Arial, sans-serif;
|
|
@@ -2761,21 +2761,21 @@ const zc = (e = "") => {
|
|
|
2761
2761
|
border-radius: 8px;
|
|
2762
2762
|
background: white;
|
|
2763
2763
|
}
|
|
2764
|
-
</style>`),
|
|
2764
|
+
</style>`), v += `
|
|
2765
2765
|
</head>
|
|
2766
|
-
<body>`, l.includeMeta && (
|
|
2766
|
+
<body>`, l.includeMeta && (v += `
|
|
2767
2767
|
<div class="document-meta">
|
|
2768
2768
|
<h1>${p?.title}</h1>
|
|
2769
2769
|
<p><small>Created: ${new Date(p?.metadata.createdAt ?? "").toLocaleString()} |
|
|
2770
2770
|
Words: ${p?.metadata.wordCount} |
|
|
2771
2771
|
Characters: ${p?.metadata.characterCount}</small></p>
|
|
2772
2772
|
<hr>
|
|
2773
|
-
</div>`),
|
|
2773
|
+
</div>`), v += `
|
|
2774
2774
|
<div class="editor-content">
|
|
2775
2775
|
${p?.content}
|
|
2776
2776
|
</div>
|
|
2777
2777
|
</body>
|
|
2778
|
-
</html>`,
|
|
2778
|
+
</html>`, v;
|
|
2779
2779
|
},
|
|
2780
2780
|
[a]
|
|
2781
2781
|
), d = V(() => {
|
|
@@ -2797,7 +2797,7 @@ const zc = (e = "") => {
|
|
|
2797
2797
|
exportToHTML: f,
|
|
2798
2798
|
clearEditor: d
|
|
2799
2799
|
};
|
|
2800
|
-
},
|
|
2800
|
+
}, Zc = ({
|
|
2801
2801
|
initialContent: e = "",
|
|
2802
2802
|
onSave: t,
|
|
2803
2803
|
onExport: n
|
|
@@ -2811,44 +2811,44 @@ const zc = (e = "") => {
|
|
|
2811
2811
|
getValidationResult: f,
|
|
2812
2812
|
exportToHTML: d,
|
|
2813
2813
|
clearEditor: l
|
|
2814
|
-
} = zc(e), [
|
|
2814
|
+
} = zc(e), [g, p] = ze(!1), v = () => {
|
|
2815
2815
|
if (f().success) {
|
|
2816
2816
|
const P = d();
|
|
2817
2817
|
t?.(r.content, P);
|
|
2818
2818
|
} else
|
|
2819
2819
|
p(!0), setTimeout(() => p(!1), 3e3);
|
|
2820
|
-
},
|
|
2820
|
+
}, x = () => {
|
|
2821
2821
|
try {
|
|
2822
|
-
const
|
|
2823
|
-
n?.(
|
|
2824
|
-
const P = new Blob([
|
|
2822
|
+
const T = d();
|
|
2823
|
+
n?.(T);
|
|
2824
|
+
const P = new Blob([T], { type: "text/html" }), L = URL.createObjectURL(P), A = document.createElement("a");
|
|
2825
2825
|
A.href = L, A.download = `${r.title.replace(/\s+/g, "_")}.html`, document.body.appendChild(A), A.click(), document.body.removeChild(A), URL.revokeObjectURL(L);
|
|
2826
|
-
} catch (
|
|
2827
|
-
alert("Export failed: " + (
|
|
2826
|
+
} catch (T) {
|
|
2827
|
+
alert("Export failed: " + (T instanceof Error ? T.message : "Unknown error"));
|
|
2828
2828
|
}
|
|
2829
2829
|
}, R = () => {
|
|
2830
2830
|
confirm("Are you sure you want to clear the editor? All unsaved changes will be lost.") && l();
|
|
2831
2831
|
};
|
|
2832
|
-
return /* @__PURE__ */ m.jsxs("div", { className: "
|
|
2833
|
-
/* @__PURE__ */ m.jsxs("div", { className: "
|
|
2832
|
+
return /* @__PURE__ */ m.jsxs("div", { className: "w-full max-w-6xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden", children: [
|
|
2833
|
+
/* @__PURE__ */ m.jsxs("div", { className: "p-6 border-b border-gray-200 bg-gray-50", children: [
|
|
2834
2834
|
/* @__PURE__ */ m.jsx(
|
|
2835
2835
|
"input",
|
|
2836
2836
|
{
|
|
2837
2837
|
type: "text",
|
|
2838
|
-
className: "
|
|
2838
|
+
className: "w-full bg-transparent text-2xl font-bold text-gray-800 outline-none placeholder-gray-400",
|
|
2839
2839
|
value: r.title,
|
|
2840
|
-
onChange: (
|
|
2840
|
+
onChange: (T) => c(T.target.value),
|
|
2841
2841
|
placeholder: "Document Title"
|
|
2842
2842
|
}
|
|
2843
2843
|
),
|
|
2844
|
-
|
|
2844
|
+
g && /* @__PURE__ */ m.jsx("div", { className: "text-red-600 text-sm mt-2 animate-fadeIn", children: "Please add content before saving" })
|
|
2845
2845
|
] }),
|
|
2846
2846
|
/* @__PURE__ */ m.jsx(
|
|
2847
2847
|
un,
|
|
2848
2848
|
{
|
|
2849
2849
|
onCommand: a,
|
|
2850
|
-
onSave:
|
|
2851
|
-
onExport:
|
|
2850
|
+
onSave: v,
|
|
2851
|
+
onExport: x,
|
|
2852
2852
|
onClear: R,
|
|
2853
2853
|
hasUnsavedChanges: r.hasUnsavedChanges
|
|
2854
2854
|
}
|
|
@@ -2857,9 +2857,9 @@ const zc = (e = "") => {
|
|
|
2857
2857
|
"div",
|
|
2858
2858
|
{
|
|
2859
2859
|
ref: o,
|
|
2860
|
-
className: "editor-content",
|
|
2860
|
+
className: "editor-content min-h-[500px] p-8 border-none outline-none resize-none text-gray-700 leading-relaxed prose max-w-none",
|
|
2861
2861
|
contentEditable: !0,
|
|
2862
|
-
onInput: (
|
|
2862
|
+
onInput: (T) => i(T.currentTarget.innerHTML)
|
|
2863
2863
|
}
|
|
2864
2864
|
),
|
|
2865
2865
|
/* @__PURE__ */ m.jsx(
|
|
@@ -2873,6 +2873,6 @@ const zc = (e = "") => {
|
|
|
2873
2873
|
] });
|
|
2874
2874
|
};
|
|
2875
2875
|
export {
|
|
2876
|
-
|
|
2876
|
+
Zc as TextEditor,
|
|
2877
2877
|
zc as useTextEditor
|
|
2878
2878
|
};
|