@gamaro.io/widget 1.0.1 → 1.1.1
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/README.md +21 -20
- package/THIRD_PARTY_NOTICES.md +34 -0
- package/dist/loader.d.ts +6 -6
- package/dist/types.d.ts +5 -0
- package/dist/widget.es.js +166 -119
- package/dist/widget.umd.js +36 -11
- package/package.json +11 -10
package/dist/widget.es.js
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @gamaro.io/widget bundles zod (https://github.com/colinhacks/zod):
|
|
3
|
+
*
|
|
4
|
+
* MIT License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2025 Colin McDonnell
|
|
7
|
+
*
|
|
8
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
9
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
10
|
+
* in the Software without restriction, including without limitation the rights
|
|
11
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
12
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
13
|
+
* furnished to do so, subject to the following conditions:
|
|
14
|
+
*
|
|
15
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
16
|
+
* copies or substantial portions of the Software.
|
|
17
|
+
*
|
|
18
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
+
* SOFTWARE.
|
|
25
|
+
*/
|
|
1
26
|
var ar = {
|
|
2
27
|
instant: 0,
|
|
3
28
|
fast: 150,
|
|
@@ -163,7 +188,7 @@ function yn(e) {
|
|
|
163
188
|
}
|
|
164
189
|
var hr = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
165
190
|
};
|
|
166
|
-
function
|
|
191
|
+
function Ee(e) {
|
|
167
192
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
168
193
|
}
|
|
169
194
|
var wn = /* @__PURE__ */ rt(() => {
|
|
@@ -175,11 +200,11 @@ var wn = /* @__PURE__ */ rt(() => {
|
|
|
175
200
|
}
|
|
176
201
|
});
|
|
177
202
|
function de(e) {
|
|
178
|
-
if (
|
|
203
|
+
if (Ee(e) === !1) return !1;
|
|
179
204
|
const t = e.constructor;
|
|
180
205
|
if (t === void 0 || typeof t != "function") return !0;
|
|
181
206
|
const r = t.prototype;
|
|
182
|
-
return !(
|
|
207
|
+
return !(Ee(r) === !1 || Object.prototype.hasOwnProperty.call(r, "isPrototypeOf") === !1);
|
|
183
208
|
}
|
|
184
209
|
function pr(e) {
|
|
185
210
|
return de(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
|
|
@@ -242,7 +267,7 @@ function Re(e, t) {
|
|
|
242
267
|
}
|
|
243
268
|
return n;
|
|
244
269
|
}
|
|
245
|
-
function
|
|
270
|
+
function En(e, t) {
|
|
246
271
|
const r = e._zod.def, n = r.checks;
|
|
247
272
|
if (n && n.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
248
273
|
const i = new Set(Re(e, t)), o = {};
|
|
@@ -251,7 +276,7 @@ function $n(e, t) {
|
|
|
251
276
|
checks: []
|
|
252
277
|
}));
|
|
253
278
|
}
|
|
254
|
-
function
|
|
279
|
+
function $n(e, t) {
|
|
255
280
|
if (!de(t)) throw new Error("Invalid input to extend: expected a plain object");
|
|
256
281
|
const r = e._zod.def.checks;
|
|
257
282
|
if (r && r.length > 0) {
|
|
@@ -602,7 +627,7 @@ var Jn = {
|
|
|
602
627
|
});
|
|
603
628
|
}
|
|
604
629
|
}));
|
|
605
|
-
}, Wn = l("$ZodError", kr),
|
|
630
|
+
}, Wn = l("$ZodError", kr), gu = l("$ZodError", kr, void 0, { Parent: Error });
|
|
606
631
|
function Vn(e, t, r) {
|
|
607
632
|
return Object.prototype.hasOwnProperty.call(e, t) || (t === "__proto__" ? Object.defineProperty(e, t, {
|
|
608
633
|
value: r(),
|
|
@@ -809,11 +834,11 @@ var Qn = async (e, t, r) => {
|
|
|
809
834
|
function pi(e) {
|
|
810
835
|
return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`);
|
|
811
836
|
}
|
|
812
|
-
var mi = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, gi = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,
|
|
837
|
+
var mi = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, gi = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, Et = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, vi = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, bi = "^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";
|
|
813
838
|
function _i() {
|
|
814
839
|
return new RegExp(bi, "u");
|
|
815
840
|
}
|
|
816
|
-
var yi = /^(?:(?: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])$/, wi = /^(([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}|:))$/, ki = /^((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])$/, Oi = /^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, zi = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Si = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,
|
|
841
|
+
var yi = /^(?:(?: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])$/, wi = /^(([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}|:))$/, ki = /^((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])$/, Oi = /^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, zi = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Si = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/, Ei = /^https?$/, $i = /^\+[1-9]\d{6,14}$/, zr = "(?:(?:\\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])))";
|
|
817
842
|
function Ii(e) {
|
|
818
843
|
return new RegExp(`^${e}$`);
|
|
819
844
|
}
|
|
@@ -840,16 +865,16 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
840
865
|
}), lt = (e) => {
|
|
841
866
|
const t = e.value;
|
|
842
867
|
return !gn(t) && t.length !== void 0;
|
|
843
|
-
},
|
|
868
|
+
}, $e = {
|
|
844
869
|
number: "number",
|
|
845
870
|
bigint: "bigint",
|
|
846
871
|
object: "date"
|
|
847
872
|
}, Sr = /* @__PURE__ */ l("$ZodCheckLessThan", (e, t) => {
|
|
848
873
|
T.init(e, t);
|
|
849
|
-
const r =
|
|
874
|
+
const r = $e[typeof t.value];
|
|
850
875
|
e._zod.check = (n) => {
|
|
851
876
|
(t.inclusive ? n.value <= t.value : n.value < t.value) || n.issues.push({
|
|
852
|
-
origin:
|
|
877
|
+
origin: $e[typeof n.value] ?? r,
|
|
853
878
|
code: "too_big",
|
|
854
879
|
maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
855
880
|
input: n.value,
|
|
@@ -858,12 +883,12 @@ var Zi = /^[\s\S]{0,}$/, Ci = /^-?\d+(?:\.\d+)?$/, Ri = /^(?:true|false)$/i, Ni
|
|
|
858
883
|
continue: !t.abort
|
|
859
884
|
});
|
|
860
885
|
};
|
|
861
|
-
}),
|
|
886
|
+
}), Er = /* @__PURE__ */ l("$ZodCheckGreaterThan", (e, t) => {
|
|
862
887
|
T.init(e, t);
|
|
863
|
-
const r =
|
|
888
|
+
const r = $e[typeof t.value];
|
|
864
889
|
e._zod.check = (n) => {
|
|
865
890
|
(t.inclusive ? n.value >= t.value : n.value > t.value) || n.issues.push({
|
|
866
|
-
origin:
|
|
891
|
+
origin: $e[typeof n.value] ?? r,
|
|
867
892
|
code: "too_small",
|
|
868
893
|
minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
|
|
869
894
|
input: n.value,
|
|
@@ -1169,10 +1194,10 @@ ${t.join(`
|
|
|
1169
1194
|
set "~standard"(e) {
|
|
1170
1195
|
B(this, "~standard", e);
|
|
1171
1196
|
}
|
|
1172
|
-
}),
|
|
1197
|
+
}), $r = (e, t) => e.issues.length ? { issues: e.issues.map((r) => te(r, t, W())) } : { value: e.value };
|
|
1173
1198
|
async function Yi(e, t) {
|
|
1174
1199
|
const r = { async: !0 };
|
|
1175
|
-
return
|
|
1200
|
+
return $r(await e._zod.run({
|
|
1176
1201
|
value: t,
|
|
1177
1202
|
issues: []
|
|
1178
1203
|
}, r), r);
|
|
@@ -1186,7 +1211,7 @@ function Ir(e) {
|
|
|
1186
1211
|
value: t,
|
|
1187
1212
|
issues: []
|
|
1188
1213
|
}, r);
|
|
1189
|
-
if (!(n instanceof Promise)) return
|
|
1214
|
+
if (!(n instanceof Promise)) return $r(n, r);
|
|
1190
1215
|
} catch {
|
|
1191
1216
|
}
|
|
1192
1217
|
return Yi(e, t);
|
|
@@ -1225,8 +1250,8 @@ var ft = /* @__PURE__ */ l("$ZodString", (e, t) => {
|
|
|
1225
1250
|
v8: 8
|
|
1226
1251
|
}[t.version];
|
|
1227
1252
|
if (r === void 0) throw new Error(`Invalid UUID version: "${t.version}"`);
|
|
1228
|
-
t.pattern ?? (t.pattern =
|
|
1229
|
-
} else t.pattern ?? (t.pattern =
|
|
1253
|
+
t.pattern ?? (t.pattern = Et(r));
|
|
1254
|
+
} else t.pattern ?? (t.pattern = Et());
|
|
1230
1255
|
O.init(e, t);
|
|
1231
1256
|
}), eo = /* @__PURE__ */ l("$ZodEmail", (e, t) => {
|
|
1232
1257
|
t.pattern ?? (t.pattern = vi), O.init(e, t);
|
|
@@ -1242,7 +1267,7 @@ function to(e, t) {
|
|
|
1242
1267
|
return !("normalize" in t) && !("hostname" in t) && !("protocol" in t) ? Ar(e) || 2 : ro(e, t);
|
|
1243
1268
|
}
|
|
1244
1269
|
function ro(e, t) {
|
|
1245
|
-
if (!t.normalize && t.protocol?.source ===
|
|
1270
|
+
if (!t.normalize && t.protocol?.source === Ei.source && !/^https?:\/\//i.test(e)) return 1;
|
|
1246
1271
|
try {
|
|
1247
1272
|
if (typeof URL < "u") {
|
|
1248
1273
|
const r = URL;
|
|
@@ -1254,7 +1279,7 @@ function ro(e, t) {
|
|
|
1254
1279
|
}
|
|
1255
1280
|
}
|
|
1256
1281
|
var no = /[\t\n\r]/g;
|
|
1257
|
-
function
|
|
1282
|
+
function $t(e) {
|
|
1258
1283
|
return e.replace(no, "");
|
|
1259
1284
|
}
|
|
1260
1285
|
function io(e, t) {
|
|
@@ -1289,7 +1314,7 @@ var so = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
|
1289
1314
|
return;
|
|
1290
1315
|
}
|
|
1291
1316
|
if (i === !0) {
|
|
1292
|
-
r.value =
|
|
1317
|
+
r.value = $t(n);
|
|
1293
1318
|
return;
|
|
1294
1319
|
}
|
|
1295
1320
|
t.hostname && !io(i, t.hostname) && r.issues.push({
|
|
@@ -1308,7 +1333,7 @@ var so = /* @__PURE__ */ l("$ZodURL", (e, t) => {
|
|
|
1308
1333
|
input: r.value,
|
|
1309
1334
|
inst: e,
|
|
1310
1335
|
continue: !t.abort
|
|
1311
|
-
}), r.value = t.normalize ? i.href :
|
|
1336
|
+
}), r.value = t.normalize ? i.href : $t(n);
|
|
1312
1337
|
return;
|
|
1313
1338
|
} catch {
|
|
1314
1339
|
r.issues.push({
|
|
@@ -1401,14 +1426,14 @@ var Zr = /^[0-9a-zA-Z+/]*={0,2}$/, So = /* @__PURE__ */ l("$ZodBase64", (e, t) =
|
|
|
1401
1426
|
});
|
|
1402
1427
|
};
|
|
1403
1428
|
}), dt = /^[A-Za-z0-9_-]*$/;
|
|
1404
|
-
function
|
|
1429
|
+
function Eo(e) {
|
|
1405
1430
|
if (!dt.test(e)) return !1;
|
|
1406
1431
|
const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/");
|
|
1407
1432
|
return Pr(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
|
|
1408
1433
|
}
|
|
1409
|
-
var
|
|
1434
|
+
var $o = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
|
|
1410
1435
|
t.pattern ?? (t.pattern = dt), O.init(e, t), e._zod.check = (r) => {
|
|
1411
|
-
|
|
1436
|
+
Eo(r.value) || r.issues.push({
|
|
1412
1437
|
code: "invalid_format",
|
|
1413
1438
|
format: "base64url",
|
|
1414
1439
|
input: r.value,
|
|
@@ -1417,7 +1442,7 @@ var Eo = /* @__PURE__ */ l("$ZodBase64URL", (e, t) => {
|
|
|
1417
1442
|
});
|
|
1418
1443
|
};
|
|
1419
1444
|
}), Io = /* @__PURE__ */ l("$ZodE164", (e, t) => {
|
|
1420
|
-
t.pattern ?? (t.pattern =
|
|
1445
|
+
t.pattern ?? (t.pattern = $i), O.init(e, t);
|
|
1421
1446
|
});
|
|
1422
1447
|
function Ao(e, t = null) {
|
|
1423
1448
|
try {
|
|
@@ -1599,7 +1624,7 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1599
1624
|
}
|
|
1600
1625
|
return d;
|
|
1601
1626
|
});
|
|
1602
|
-
const o =
|
|
1627
|
+
const o = Ee, s = t.catchall;
|
|
1603
1628
|
let a;
|
|
1604
1629
|
const c = M.memoizer;
|
|
1605
1630
|
c?.attach(e), e._zod.parse = (u, f) => {
|
|
@@ -1625,7 +1650,7 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1625
1650
|
value: d[b],
|
|
1626
1651
|
issues: []
|
|
1627
1652
|
}, f);
|
|
1628
|
-
oe instanceof Promise ? h.push(oe.then((
|
|
1653
|
+
oe instanceof Promise ? h.push(oe.then(($) => Ie($, u, b, d, N, ie))) : Ie(oe, u, b, d, N, ie);
|
|
1629
1654
|
}
|
|
1630
1655
|
return s ? Nr(h, d, u, f, i.value, e, m === !0) : h.length ? Promise.all(h).then(() => u) : u;
|
|
1631
1656
|
};
|
|
@@ -1637,26 +1662,26 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1637
1662
|
inst: e,
|
|
1638
1663
|
memo: i,
|
|
1639
1664
|
syms: v
|
|
1640
|
-
}), _ = (
|
|
1641
|
-
let ${
|
|
1642
|
-
for (let i = 0; i < ${
|
|
1643
|
-
const iss = ${
|
|
1665
|
+
}), _ = ($) => `shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`, N = ($, w) => `
|
|
1666
|
+
let ${$}_ab = false;
|
|
1667
|
+
for (let i = 0; i < ${$}.issues.length; i++) {
|
|
1668
|
+
const iss = ${$}.issues[i];
|
|
1644
1669
|
iss.path = iss.path ? [${w}, ...iss.path] : [${w}];
|
|
1645
1670
|
payload.issues.push(iss);
|
|
1646
|
-
if (iss.continue !== true) ${
|
|
1671
|
+
if (iss.continue !== true) ${$}_ab = true;
|
|
1647
1672
|
}
|
|
1648
|
-
if (${
|
|
1673
|
+
if (${$}_ab && ctx && ctx.abortEarly) {
|
|
1649
1674
|
payload.value = newResult;
|
|
1650
1675
|
return payload;
|
|
1651
1676
|
}`;
|
|
1652
1677
|
b.write("const input = payload.value;");
|
|
1653
1678
|
const ie = /* @__PURE__ */ Object.create(null);
|
|
1654
1679
|
let oe = 0;
|
|
1655
|
-
for (const
|
|
1680
|
+
for (const $ of m.allKeys) ie[$] = `key_${oe++}`;
|
|
1656
1681
|
b.write(i ? "const newResult = memo.alloc(inst, payload, {}, ctx);" : "const newResult = {};");
|
|
1657
|
-
for (const
|
|
1658
|
-
if (
|
|
1659
|
-
const w = ie[
|
|
1682
|
+
for (const $ of m.allKeys) {
|
|
1683
|
+
if ($ === "__proto__") continue;
|
|
1684
|
+
const w = ie[$], j = typeof $ == "symbol" ? `syms[${v.indexOf($)}]` : _n($), xe = `${j} in input`, vt = p[$], Me = vt?._zod?.optin, bt = Me !== void 0, cn = vt?._zod?.optout === "optional";
|
|
1660
1685
|
if (b.write(`const ${w} = ${_(j)};`), bt && cn) {
|
|
1661
1686
|
const un = Me === "optional" ? `${w}_present` : `${w}.value !== undefined || ${w}_present`;
|
|
1662
1687
|
b.write(`
|
|
@@ -1704,7 +1729,7 @@ var xo = /* @__PURE__ */ l("$ZodObject", (e, t) => {
|
|
|
1704
1729
|
return b.write("payload.value = newResult;"), b.write("return payload;"), b.compile();
|
|
1705
1730
|
};
|
|
1706
1731
|
let s;
|
|
1707
|
-
const a =
|
|
1732
|
+
const a = Ee, c = !M.jitless, f = c && wn.value, d = t.catchall;
|
|
1708
1733
|
let h;
|
|
1709
1734
|
e._zod.parse = (p, m) => {
|
|
1710
1735
|
h ?? (h = n.value);
|
|
@@ -2507,7 +2532,7 @@ function Ss(e, t) {
|
|
|
2507
2532
|
});
|
|
2508
2533
|
}
|
|
2509
2534
|
// @__NO_SIDE_EFFECTS__
|
|
2510
|
-
function
|
|
2535
|
+
function Es(e, t) {
|
|
2511
2536
|
return new e({
|
|
2512
2537
|
type: "string",
|
|
2513
2538
|
format: "cidrv6",
|
|
@@ -2517,7 +2542,7 @@ function $s(e, t) {
|
|
|
2517
2542
|
});
|
|
2518
2543
|
}
|
|
2519
2544
|
// @__NO_SIDE_EFFECTS__
|
|
2520
|
-
function
|
|
2545
|
+
function $s(e, t) {
|
|
2521
2546
|
return new e({
|
|
2522
2547
|
type: "string",
|
|
2523
2548
|
format: "base64",
|
|
@@ -2652,7 +2677,7 @@ function Be(e, t) {
|
|
|
2652
2677
|
}
|
|
2653
2678
|
// @__NO_SIDE_EFFECTS__
|
|
2654
2679
|
function Lt(e, t) {
|
|
2655
|
-
return new
|
|
2680
|
+
return new Er({
|
|
2656
2681
|
check: "greater_than",
|
|
2657
2682
|
...g(t),
|
|
2658
2683
|
value: e,
|
|
@@ -2661,7 +2686,7 @@ function Lt(e, t) {
|
|
|
2661
2686
|
}
|
|
2662
2687
|
// @__NO_SIDE_EFFECTS__
|
|
2663
2688
|
function Je(e, t) {
|
|
2664
|
-
return new
|
|
2689
|
+
return new Er({
|
|
2665
2690
|
check: "greater_than",
|
|
2666
2691
|
...g(t),
|
|
2667
2692
|
value: e,
|
|
@@ -3356,7 +3381,7 @@ var ka = (e, t, r, n) => {
|
|
|
3356
3381
|
I(s, t, n);
|
|
3357
3382
|
const a = t.seen.get(e);
|
|
3358
3383
|
a.ref = s;
|
|
3359
|
-
},
|
|
3384
|
+
}, Ea = (e, t, r, n) => {
|
|
3360
3385
|
const i = e._zod.def;
|
|
3361
3386
|
I(i.innerType, t, n);
|
|
3362
3387
|
const o = t.seen.get(e);
|
|
@@ -3388,7 +3413,7 @@ function ve(e, t, r) {
|
|
|
3388
3413
|
}
|
|
3389
3414
|
});
|
|
3390
3415
|
}
|
|
3391
|
-
var
|
|
3416
|
+
var $a = (e, t) => {
|
|
3392
3417
|
Wn.init(e, t), e.name = "ZodError";
|
|
3393
3418
|
const r = Object.getPrototypeOf(e);
|
|
3394
3419
|
Gt.has(r) || (Gt.add(r), ve(r, "format", (n) => (i) => Hn(n, i)), ve(r, "flatten", (n) => (i) => Kn(n, i)), ve(r, "addIssue", (n) => (i) => {
|
|
@@ -3402,14 +3427,14 @@ var Ea = (e, t) => {
|
|
|
3402
3427
|
return this.issues.length === 0;
|
|
3403
3428
|
}
|
|
3404
3429
|
}));
|
|
3405
|
-
}, C = /* @__PURE__ */ l("ZodError",
|
|
3430
|
+
}, C = /* @__PURE__ */ l("ZodError", $a, void 0, { Parent: Error }), Ia = /* @__PURE__ */ st(C), Aa = /* @__PURE__ */ at(C), Ta = /* @__PURE__ */ ct(C), Pa = /* @__PURE__ */ ut(C), Za = /* @__PURE__ */ ei(C), Ca = /* @__PURE__ */ ti(C), Ra = /* @__PURE__ */ ri(C), Na = /* @__PURE__ */ ni(C), ja = /* @__PURE__ */ ii(C), xa = /* @__PURE__ */ oi(C), Ma = /* @__PURE__ */ si(C), Da = /* @__PURE__ */ ai(C);
|
|
3406
3431
|
function La() {
|
|
3407
3432
|
M.localeError || W(os());
|
|
3408
3433
|
}
|
|
3409
3434
|
function pt() {
|
|
3410
3435
|
M.memoizer || W({ memoizer: rs() });
|
|
3411
3436
|
}
|
|
3412
|
-
var
|
|
3437
|
+
var E = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e.type = t.type, e), {
|
|
3413
3438
|
check(...e) {
|
|
3414
3439
|
const t = this.def;
|
|
3415
3440
|
return this.clone(Z(t, { checks: [...t.checks ?? [], ...e.map((r) => typeof r == "function" ? { _zod: {
|
|
@@ -3470,7 +3495,7 @@ var $ = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3470
3495
|
return Sc(this, e);
|
|
3471
3496
|
},
|
|
3472
3497
|
prefault(e) {
|
|
3473
|
-
return
|
|
3498
|
+
return $c(this, e);
|
|
3474
3499
|
},
|
|
3475
3500
|
catch(e) {
|
|
3476
3501
|
return Tc(this, e);
|
|
@@ -3569,7 +3594,7 @@ var $ = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3569
3594
|
return this._zod.def;
|
|
3570
3595
|
}
|
|
3571
3596
|
}), Qr = /* @__PURE__ */ l("_ZodString", (e, t) => {
|
|
3572
|
-
ft.init(e, t),
|
|
3597
|
+
ft.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => ca(e, r, n, i);
|
|
3573
3598
|
}, /* @__PURE__ */ yr({
|
|
3574
3599
|
format: (e) => x(e).format ?? null,
|
|
3575
3600
|
minLength: (e) => x(e).minimum ?? null,
|
|
@@ -3663,7 +3688,7 @@ var $ = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3663
3688
|
return this.check(/* @__PURE__ */ ys(Qa, e));
|
|
3664
3689
|
},
|
|
3665
3690
|
base64(e) {
|
|
3666
|
-
return this.check(/* @__PURE__ */
|
|
3691
|
+
return this.check(/* @__PURE__ */ $s(sc, e));
|
|
3667
3692
|
},
|
|
3668
3693
|
base64url(e) {
|
|
3669
3694
|
return this.check(/* @__PURE__ */ Is(ac, e));
|
|
@@ -3684,7 +3709,7 @@ var $ = /* @__PURE__ */ l("ZodType", (e, t) => (La(), S.init(e, t), e.def = t, e
|
|
|
3684
3709
|
return this.check(/* @__PURE__ */ Ss(ic, e));
|
|
3685
3710
|
},
|
|
3686
3711
|
cidrv6(e) {
|
|
3687
|
-
return this.check(/* @__PURE__ */
|
|
3712
|
+
return this.check(/* @__PURE__ */ Es(oc, e));
|
|
3688
3713
|
},
|
|
3689
3714
|
e164(e) {
|
|
3690
3715
|
return this.check(/* @__PURE__ */ As(cc, e));
|
|
@@ -3748,13 +3773,13 @@ var z = /* @__PURE__ */ l("ZodStringFormat", (e, t) => {
|
|
|
3748
3773
|
}), sc = /* @__PURE__ */ l("ZodBase64", (e, t) => {
|
|
3749
3774
|
So.init(e, t), z.init(e, t);
|
|
3750
3775
|
}), ac = /* @__PURE__ */ l("ZodBase64URL", (e, t) => {
|
|
3751
|
-
|
|
3776
|
+
$o.init(e, t), z.init(e, t);
|
|
3752
3777
|
}), cc = /* @__PURE__ */ l("ZodE164", (e, t) => {
|
|
3753
3778
|
Io.init(e, t), z.init(e, t);
|
|
3754
3779
|
}), uc = /* @__PURE__ */ l("ZodJWT", (e, t) => {
|
|
3755
3780
|
To.init(e, t), z.init(e, t);
|
|
3756
3781
|
}), en = /* @__PURE__ */ l("ZodNumber", (e, t) => {
|
|
3757
|
-
Cr.init(e, t),
|
|
3782
|
+
Cr.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => ua(e, r, n, i), e.isFinite = !0;
|
|
3758
3783
|
}, /* @__PURE__ */ yr({
|
|
3759
3784
|
minValue: (e) => {
|
|
3760
3785
|
const { minimum: t, exclusiveMinimum: r } = x(e);
|
|
@@ -3826,25 +3851,25 @@ function qt(e) {
|
|
|
3826
3851
|
return /* @__PURE__ */ js(lc, e);
|
|
3827
3852
|
}
|
|
3828
3853
|
var fc = /* @__PURE__ */ l("ZodBoolean", (e, t) => {
|
|
3829
|
-
Zo.init(e, t),
|
|
3854
|
+
Zo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => la(e, r, n, i);
|
|
3830
3855
|
});
|
|
3831
3856
|
function F(e) {
|
|
3832
3857
|
return /* @__PURE__ */ xs(fc, e);
|
|
3833
3858
|
}
|
|
3834
3859
|
var dc = /* @__PURE__ */ l("ZodUnknown", (e, t) => {
|
|
3835
|
-
Co.init(e, t),
|
|
3860
|
+
Co.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => da(e, r, n, i);
|
|
3836
3861
|
});
|
|
3837
3862
|
function Yt() {
|
|
3838
3863
|
return /* @__PURE__ */ Ms(dc);
|
|
3839
3864
|
}
|
|
3840
3865
|
var hc = /* @__PURE__ */ l("ZodNever", (e, t) => {
|
|
3841
|
-
Ro.init(e, t),
|
|
3866
|
+
Ro.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => fa(e, r, n, i);
|
|
3842
3867
|
});
|
|
3843
3868
|
function pc(e) {
|
|
3844
3869
|
return /* @__PURE__ */ Ds(hc, e);
|
|
3845
3870
|
}
|
|
3846
3871
|
var mc = /* @__PURE__ */ l("ZodArray", (e, t) => {
|
|
3847
|
-
pt(), No.init(e, t),
|
|
3872
|
+
pt(), No.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => ga(e, r, n, i), e.element = t.element;
|
|
3848
3873
|
}, {
|
|
3849
3874
|
min(e, t) {
|
|
3850
3875
|
return this.check(/* @__PURE__ */ Ae(e, t));
|
|
@@ -3866,7 +3891,7 @@ function mt(e, t) {
|
|
|
3866
3891
|
return /* @__PURE__ */ Ys(mc, e, t);
|
|
3867
3892
|
}
|
|
3868
3893
|
var gc = /* @__PURE__ */ l("ZodObject", (e, t) => {
|
|
3869
|
-
pt(), Mo.init(e, t),
|
|
3894
|
+
pt(), Mo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => va(e, r, n, i), Mn(e, "shape", (r) => r._zod.def.shape, !1);
|
|
3870
3895
|
}, {
|
|
3871
3896
|
keyof() {
|
|
3872
3897
|
return P(Object.keys(this._zod.def.shape));
|
|
@@ -3887,7 +3912,7 @@ var gc = /* @__PURE__ */ l("ZodObject", (e, t) => {
|
|
|
3887
3912
|
return this.clone(Z(this._zod.def, { catchall: void 0 }));
|
|
3888
3913
|
},
|
|
3889
3914
|
extend(e) {
|
|
3890
|
-
return
|
|
3915
|
+
return $n(this, e);
|
|
3891
3916
|
},
|
|
3892
3917
|
safeExtend(e) {
|
|
3893
3918
|
return In(this, e);
|
|
@@ -3899,7 +3924,7 @@ var gc = /* @__PURE__ */ l("ZodObject", (e, t) => {
|
|
|
3899
3924
|
return Sn(this, e);
|
|
3900
3925
|
},
|
|
3901
3926
|
omit(e) {
|
|
3902
|
-
return
|
|
3927
|
+
return En(this, e);
|
|
3903
3928
|
},
|
|
3904
3929
|
partial(...e) {
|
|
3905
3930
|
return wt(rn, this, e[0]);
|
|
@@ -3920,7 +3945,7 @@ function R(e, t) {
|
|
|
3920
3945
|
return new gc(r);
|
|
3921
3946
|
}
|
|
3922
3947
|
var vc = /* @__PURE__ */ l("ZodUnion", (e, t) => {
|
|
3923
|
-
Do.init(e, t),
|
|
3948
|
+
Do.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => ba(e, r, n, i), e.options = t.options;
|
|
3924
3949
|
});
|
|
3925
3950
|
function tn(e, t) {
|
|
3926
3951
|
return new vc({
|
|
@@ -3930,7 +3955,7 @@ function tn(e, t) {
|
|
|
3930
3955
|
});
|
|
3931
3956
|
}
|
|
3932
3957
|
var bc = /* @__PURE__ */ l("ZodIntersection", (e, t) => {
|
|
3933
|
-
Lo.init(e, t),
|
|
3958
|
+
Lo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => _a(e, r, n, i);
|
|
3934
3959
|
});
|
|
3935
3960
|
function _c(e, t) {
|
|
3936
3961
|
return new bc({
|
|
@@ -3940,7 +3965,7 @@ function _c(e, t) {
|
|
|
3940
3965
|
});
|
|
3941
3966
|
}
|
|
3942
3967
|
var et = /* @__PURE__ */ l("ZodEnum", (e, t) => {
|
|
3943
|
-
Uo.init(e, t),
|
|
3968
|
+
Uo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (n, i, o) => ha(e, n, i, o), e.enum = t.entries, e.options = [...e._zod.values];
|
|
3944
3969
|
const r = new Set(Object.keys(t.entries));
|
|
3945
3970
|
e.extract = (n, i) => {
|
|
3946
3971
|
const o = {};
|
|
@@ -3973,7 +3998,7 @@ function P(e, t) {
|
|
|
3973
3998
|
});
|
|
3974
3999
|
}
|
|
3975
4000
|
var yc = /* @__PURE__ */ l("ZodTransform", (e, t) => {
|
|
3976
|
-
pt(), Fo.init(e, t),
|
|
4001
|
+
pt(), Fo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => ma(e, r, n, i), e._zod.parse = (r, n) => {
|
|
3977
4002
|
if (n.direction === "backward") throw new wr(e.constructor.name);
|
|
3978
4003
|
r.addIssue = (o) => {
|
|
3979
4004
|
if (typeof o == "string") r.issues.push(he(o, r.value, t));
|
|
@@ -3993,7 +4018,7 @@ function wc(e) {
|
|
|
3993
4018
|
});
|
|
3994
4019
|
}
|
|
3995
4020
|
var rn = /* @__PURE__ */ l("ZodOptional", (e, t) => {
|
|
3996
|
-
jr.init(e, t),
|
|
4021
|
+
jr.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => Xr(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
3997
4022
|
});
|
|
3998
4023
|
function Xt(e) {
|
|
3999
4024
|
return new rn({
|
|
@@ -4002,7 +4027,7 @@ function Xt(e) {
|
|
|
4002
4027
|
});
|
|
4003
4028
|
}
|
|
4004
4029
|
var nn = /* @__PURE__ */ l("ZodExactOptional", (e, t) => {
|
|
4005
|
-
Bo.init(e, t),
|
|
4030
|
+
Bo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => Xr(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4006
4031
|
});
|
|
4007
4032
|
function kc(e) {
|
|
4008
4033
|
return new nn({
|
|
@@ -4011,7 +4036,7 @@ function kc(e) {
|
|
|
4011
4036
|
});
|
|
4012
4037
|
}
|
|
4013
4038
|
var Oc = /* @__PURE__ */ l("ZodNullable", (e, t) => {
|
|
4014
|
-
Jo.init(e, t),
|
|
4039
|
+
Jo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => ya(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4015
4040
|
});
|
|
4016
4041
|
function Qt(e) {
|
|
4017
4042
|
return new Oc({
|
|
@@ -4020,7 +4045,7 @@ function Qt(e) {
|
|
|
4020
4045
|
});
|
|
4021
4046
|
}
|
|
4022
4047
|
var zc = /* @__PURE__ */ l("ZodDefault", (e, t) => {
|
|
4023
|
-
Wo.init(e, t),
|
|
4048
|
+
Wo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => ka(e, r, n, i), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
|
|
4024
4049
|
});
|
|
4025
4050
|
function Sc(e, t) {
|
|
4026
4051
|
return new zc({
|
|
@@ -4031,11 +4056,11 @@ function Sc(e, t) {
|
|
|
4031
4056
|
}
|
|
4032
4057
|
});
|
|
4033
4058
|
}
|
|
4034
|
-
var
|
|
4035
|
-
Vo.init(e, t),
|
|
4059
|
+
var Ec = /* @__PURE__ */ l("ZodPrefault", (e, t) => {
|
|
4060
|
+
Vo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => Oa(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4036
4061
|
});
|
|
4037
|
-
function
|
|
4038
|
-
return new
|
|
4062
|
+
function $c(e, t) {
|
|
4063
|
+
return new Ec({
|
|
4039
4064
|
type: "prefault",
|
|
4040
4065
|
innerType: e,
|
|
4041
4066
|
get defaultValue() {
|
|
@@ -4044,7 +4069,7 @@ function Ec(e, t) {
|
|
|
4044
4069
|
});
|
|
4045
4070
|
}
|
|
4046
4071
|
var on = /* @__PURE__ */ l("ZodNonOptional", (e, t) => {
|
|
4047
|
-
Ko.init(e, t),
|
|
4072
|
+
Ko.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => wa(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4048
4073
|
});
|
|
4049
4074
|
function Ic(e, t) {
|
|
4050
4075
|
return new on({
|
|
@@ -4054,7 +4079,7 @@ function Ic(e, t) {
|
|
|
4054
4079
|
});
|
|
4055
4080
|
}
|
|
4056
4081
|
var Ac = /* @__PURE__ */ l("ZodCatch", (e, t) => {
|
|
4057
|
-
Ho.init(e, t),
|
|
4082
|
+
Ho.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => za(e, r, n, i), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
4058
4083
|
});
|
|
4059
4084
|
function Tc(e, t) {
|
|
4060
4085
|
return new Ac({
|
|
@@ -4064,7 +4089,7 @@ function Tc(e, t) {
|
|
|
4064
4089
|
});
|
|
4065
4090
|
}
|
|
4066
4091
|
var Pc = /* @__PURE__ */ l("ZodPipe", (e, t) => {
|
|
4067
|
-
Go.init(e, t),
|
|
4092
|
+
Go.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => Sa(e, r, n, i), e.in = t.in, e.out = t.out;
|
|
4068
4093
|
});
|
|
4069
4094
|
function er(e, t) {
|
|
4070
4095
|
return new Pc({
|
|
@@ -4074,7 +4099,7 @@ function er(e, t) {
|
|
|
4074
4099
|
});
|
|
4075
4100
|
}
|
|
4076
4101
|
var Zc = /* @__PURE__ */ l("ZodReadonly", (e, t) => {
|
|
4077
|
-
qo.init(e, t),
|
|
4102
|
+
qo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => Ea(e, r, n, i), e.unwrap = () => e._zod.def.innerType;
|
|
4078
4103
|
});
|
|
4079
4104
|
function Cc(e) {
|
|
4080
4105
|
return new Zc({
|
|
@@ -4083,7 +4108,7 @@ function Cc(e) {
|
|
|
4083
4108
|
});
|
|
4084
4109
|
}
|
|
4085
4110
|
var sn = /* @__PURE__ */ l("ZodCustom", (e, t) => {
|
|
4086
|
-
Yo.init(e, t),
|
|
4111
|
+
Yo.init(e, t), E.init(e, t), e._zod.processJSONSchema = (r, n, i) => pa(e, r, n, i);
|
|
4087
4112
|
});
|
|
4088
4113
|
function Rc(e, t) {
|
|
4089
4114
|
return /* @__PURE__ */ Xs(sn, e ?? (() => !0), t);
|
|
@@ -4105,7 +4130,7 @@ var We = /^#[0-9a-fA-F]{6}$/, Ve = "Color must be a 6-digit hex code (e.g. '#3B8
|
|
|
4105
4130
|
"dark",
|
|
4106
4131
|
"auto"
|
|
4107
4132
|
]).describe("Widget color scheme: 'light' (default), 'dark', or 'auto' (follows the visitor's prefers-color-scheme).").optional()
|
|
4108
|
-
}),
|
|
4133
|
+
}), vu = P([
|
|
4109
4134
|
"mobile",
|
|
4110
4135
|
"tablet",
|
|
4111
4136
|
"desktop"
|
|
@@ -4120,7 +4145,7 @@ var We = /^#[0-9a-fA-F]{6}$/, Ve = "Color must be a 6-digit hex code (e.g. '#3B8
|
|
|
4120
4145
|
enabled: F().describe("Enable responsive behavior (default: true)").optional(),
|
|
4121
4146
|
breakpoints: xc.describe("Custom breakpoint values").optional()
|
|
4122
4147
|
});
|
|
4123
|
-
var
|
|
4148
|
+
var bu = R({
|
|
4124
4149
|
theme: gt.describe("Custom theme configuration").optional(),
|
|
4125
4150
|
position: an.describe("Widget position (default: 'bottom-right')").optional(),
|
|
4126
4151
|
open: F().describe("Initial open state (default: false)").optional(),
|
|
@@ -4161,7 +4186,7 @@ var gu = R({
|
|
|
4161
4186
|
}).nullable().describe("Primary conversion objective"),
|
|
4162
4187
|
identityVerificationRequired: F().describe("Whether HMAC identity verification is required"),
|
|
4163
4188
|
widget: Dc.nullable().describe("Admin-configured widget runtime config (theme, position, language, showProfile, open). Null when the application has not yet persisted a widget_config JSONB.")
|
|
4164
|
-
}), Uc = P(["user", "assistant"]).describe("Message sender role"),
|
|
4189
|
+
}), Uc = P(["user", "assistant"]).describe("Message sender role"), _u = R({
|
|
4165
4190
|
role: Uc.describe("Message sender role"),
|
|
4166
4191
|
content: k().max(1e4).describe("Message content (max 10000 characters)")
|
|
4167
4192
|
}), Fc = {
|
|
@@ -4184,7 +4209,7 @@ var gu = R({
|
|
|
4184
4209
|
CTA_CLICKED: "gamaro:cta-clicked",
|
|
4185
4210
|
LEAD_CAPTURED: "gamaro:lead-captured",
|
|
4186
4211
|
IDENTITY_VERIFIED: "gamaro:identity-verified"
|
|
4187
|
-
},
|
|
4212
|
+
}, yu = R({
|
|
4188
4213
|
reason: P(["timeout", "error"]).describe("Why the iframe load failed (timeout vs. transport error)"),
|
|
4189
4214
|
attempts: Pe().int().min(1).describe("Total attempts made before giving up (e.g. 3 = 1 + 2 retries)")
|
|
4190
4215
|
}).describe("Payload emitted with the widget-unavailable SDK event (#867)"), Bc = P([
|
|
@@ -4230,7 +4255,7 @@ var gu = R({
|
|
|
4230
4255
|
"500-2000",
|
|
4231
4256
|
"2000-5000",
|
|
4232
4257
|
"> 5000"
|
|
4233
|
-
]).describe("Monthly budget range in EUR"),
|
|
4258
|
+
]).describe("Monthly budget range in EUR"), wu = R({
|
|
4234
4259
|
userType: Bc.optional().describe("User type: prospect, partner, or unknown"),
|
|
4235
4260
|
sector: Jc.optional().describe("Business sector"),
|
|
4236
4261
|
companySize: Wc.optional().describe("Company size range"),
|
|
@@ -4346,7 +4371,12 @@ async function tu(e) {
|
|
|
4346
4371
|
}
|
|
4347
4372
|
throw new X("error", r);
|
|
4348
4373
|
}
|
|
4349
|
-
var ru = "0.1.0", _e = "https://gamaro.io/app", nu =
|
|
4374
|
+
var ru = "0.1.0", _e = "https://gamaro.io/app", nu = [
|
|
4375
|
+
1e3,
|
|
4376
|
+
2e3,
|
|
4377
|
+
3e3,
|
|
4378
|
+
4e3
|
|
4379
|
+
], iu = 0.3, ou = 0, su = {
|
|
4350
4380
|
mobile: 480,
|
|
4351
4381
|
tablet: 768
|
|
4352
4382
|
}, rr = {
|
|
@@ -4362,18 +4392,18 @@ var ru = "0.1.0", _e = "https://gamaro.io/app", nu = 0, iu = {
|
|
|
4362
4392
|
width: "380px",
|
|
4363
4393
|
height: "600px"
|
|
4364
4394
|
}
|
|
4365
|
-
},
|
|
4395
|
+
}, au = 100, cu = {
|
|
4366
4396
|
position: "fixed",
|
|
4367
4397
|
zIndex: "999999",
|
|
4368
4398
|
border: "none",
|
|
4369
4399
|
overflow: "hidden"
|
|
4370
|
-
}, ae = `${ar.slow}ms`, nr = `${ar.base}ms`,
|
|
4400
|
+
}, ae = `${ar.slow}ms`, nr = `${ar.base}ms`, uu = [
|
|
4371
4401
|
`width ${ae} ${K.emphasized}`,
|
|
4372
4402
|
`height ${ae} ${K.emphasized}`,
|
|
4373
4403
|
`border-radius ${ae} ${K.emphasized}`,
|
|
4374
4404
|
`box-shadow ${ae} ${K.emphasized}`,
|
|
4375
4405
|
`transform ${ae} ${K.emphasized}`
|
|
4376
|
-
].join(", "),
|
|
4406
|
+
].join(", "), lu = [`opacity ${nr} ${K.standard}`, `background ${nr} ${K.standard}`].join(", ");
|
|
4377
4407
|
function ir() {
|
|
4378
4408
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
4379
4409
|
}
|
|
@@ -4386,12 +4416,12 @@ var ye = {
|
|
|
4386
4416
|
bottom: "20px",
|
|
4387
4417
|
left: "20px"
|
|
4388
4418
|
}
|
|
4389
|
-
},
|
|
4419
|
+
}, fu = {
|
|
4390
4420
|
width: "100%",
|
|
4391
4421
|
height: "100%",
|
|
4392
4422
|
border: "none",
|
|
4393
4423
|
backgroundColor: "transparent"
|
|
4394
|
-
},
|
|
4424
|
+
}, du = class {
|
|
4395
4425
|
get applicationId() {
|
|
4396
4426
|
return this._applicationId;
|
|
4397
4427
|
}
|
|
@@ -4402,7 +4432,7 @@ var ye = {
|
|
|
4402
4432
|
baseUrl: _e,
|
|
4403
4433
|
debug: !1,
|
|
4404
4434
|
...e
|
|
4405
|
-
}, this.instanceId = ++
|
|
4435
|
+
}, this.instanceId = ++ou, this.debugLog = ln(this.config.debug ?? !1), this.renderSkeleton(), this.resolveConfig();
|
|
4406
4436
|
}
|
|
4407
4437
|
renderSkeleton() {
|
|
4408
4438
|
this.config.position !== "inline" && (this.container = this.createContainer(), this.renderSkeletonInto(this.container), document.body.appendChild(this.container));
|
|
@@ -4417,7 +4447,7 @@ var ye = {
|
|
|
4417
4447
|
"background: #9ca3af",
|
|
4418
4448
|
"cursor: default",
|
|
4419
4449
|
"opacity: 0.6",
|
|
4420
|
-
`transition: ${ir() ? "none" :
|
|
4450
|
+
`transition: ${ir() ? "none" : lu}`
|
|
4421
4451
|
].join(";"), e.appendChild(t), this.skeletonButton = t, t;
|
|
4422
4452
|
}
|
|
4423
4453
|
setSkeletonStateUnavailable() {
|
|
@@ -4428,16 +4458,18 @@ var ye = {
|
|
|
4428
4458
|
this.fetchAbortController = new AbortController();
|
|
4429
4459
|
const t = (r) => Yc(this.config.apiKey, e, this.fetchAbortController?.signal).then((n) => this.applyServerConfig(n)).catch((n) => {
|
|
4430
4460
|
const i = n instanceof Y ? n.code : "UNKNOWN_ERROR", o = n instanceof Error ? n.message : "Unknown config fetch error";
|
|
4431
|
-
if (
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
message: o
|
|
4439
|
-
});
|
|
4461
|
+
if (i === "ABORTED" || this.isDestroyed) return;
|
|
4462
|
+
const s = nu[r];
|
|
4463
|
+
if (s !== void 0 && this.isTransientFetchError(i)) {
|
|
4464
|
+
const a = s * (1 + (Math.random() * 2 - 1) * iu);
|
|
4465
|
+
return Se(`Config fetch failed transiently (${i}), retrying in ${Math.round(a)}ms`), new Promise((c) => setTimeout(() => {
|
|
4466
|
+
this.isDestroyed || c(t(r + 1));
|
|
4467
|
+
}, a));
|
|
4440
4468
|
}
|
|
4469
|
+
ze(`Config fetch failed — widget stays in degraded mode: ${o}`), this.emit("error", {
|
|
4470
|
+
code: i,
|
|
4471
|
+
message: o
|
|
4472
|
+
});
|
|
4441
4473
|
});
|
|
4442
4474
|
t(0);
|
|
4443
4475
|
}
|
|
@@ -4529,7 +4561,7 @@ var ye = {
|
|
|
4529
4561
|
boxShadow: "0 4px 20px rgba(0, 0, 0, 0.1)"
|
|
4530
4562
|
});
|
|
4531
4563
|
else {
|
|
4532
|
-
Object.assign(e.style,
|
|
4564
|
+
Object.assign(e.style, cu);
|
|
4533
4565
|
const t = ye[this.config.position ?? "bottom-right"];
|
|
4534
4566
|
Object.assign(e.style, t), e.style.width = "60px", e.style.height = "60px", e.style.borderRadius = "50%";
|
|
4535
4567
|
}
|
|
@@ -4537,7 +4569,7 @@ var ye = {
|
|
|
4537
4569
|
}
|
|
4538
4570
|
createIframe() {
|
|
4539
4571
|
const e = document.createElement("iframe");
|
|
4540
|
-
return e.id = `gamaro-widget-iframe-${this.instanceId}`, e.src = this.buildIframeUrl(), e.setAttribute("title", "Gamaro Chat Widget"), e.setAttribute("allow", "clipboard-write; geolocation"), Object.assign(e.style,
|
|
4572
|
+
return e.id = `gamaro-widget-iframe-${this.instanceId}`, e.src = this.buildIframeUrl(), e.setAttribute("title", "Gamaro Chat Widget"), e.setAttribute("allow", "clipboard-write; geolocation"), Object.assign(e.style, fu), e;
|
|
4541
4573
|
}
|
|
4542
4574
|
buildIframeUrl() {
|
|
4543
4575
|
const e = this.config.baseUrl ?? _e, t = new URL("/app/widget/embed", e);
|
|
@@ -4546,7 +4578,7 @@ var ye = {
|
|
|
4546
4578
|
setupViewportListener() {
|
|
4547
4579
|
if (this.config.position === "inline" || this.config.responsive?.enabled === !1) return;
|
|
4548
4580
|
const e = {
|
|
4549
|
-
...
|
|
4581
|
+
...su,
|
|
4550
4582
|
...this.config.responsive?.breakpoints
|
|
4551
4583
|
};
|
|
4552
4584
|
this.mobileMediaQuery = window.matchMedia(`(max-width: ${e.mobile}px)`), this.tabletMediaQuery = window.matchMedia(`(max-width: ${e.tablet}px)`), this.viewportChangeHandler = () => this.handleViewportChange(), this.mobileMediaQuery.addEventListener("change", this.viewportChangeHandler), this.tabletMediaQuery.addEventListener("change", this.viewportChangeHandler), this.currentViewportMode = this.getViewportMode(), this.log("Initial viewport mode:", this.currentViewportMode);
|
|
@@ -4558,13 +4590,13 @@ var ye = {
|
|
|
4558
4590
|
type: "gamaro:viewport",
|
|
4559
4591
|
mode: e
|
|
4560
4592
|
}, this.resolveReadyOrigin()));
|
|
4561
|
-
},
|
|
4593
|
+
}, au);
|
|
4562
4594
|
}
|
|
4563
4595
|
getViewportMode() {
|
|
4564
4596
|
return this.mobileMediaQuery?.matches ? "mobile" : this.tabletMediaQuery?.matches ? "tablet" : "desktop";
|
|
4565
4597
|
}
|
|
4566
4598
|
applyContainerTransition() {
|
|
4567
|
-
this.container && (this.container.style.transition = ir() ? "none" :
|
|
4599
|
+
this.container && (this.container.style.transition = ir() ? "none" : uu);
|
|
4568
4600
|
}
|
|
4569
4601
|
updateContainerForViewport(e) {
|
|
4570
4602
|
if (!this.container) return;
|
|
@@ -4654,6 +4686,21 @@ var ye = {
|
|
|
4654
4686
|
stage: e.stage,
|
|
4655
4687
|
previousStage: e.previousStage
|
|
4656
4688
|
});
|
|
4689
|
+
break;
|
|
4690
|
+
case "gamaro:cta-shown":
|
|
4691
|
+
case "gamaro:cta-clicked": {
|
|
4692
|
+
const { ctaType: t, objectiveId: r } = e;
|
|
4693
|
+
this.emit(e.type === "gamaro:cta-shown" ? "cta-shown" : "cta-clicked", {
|
|
4694
|
+
ctaType: t,
|
|
4695
|
+
...r && { objectiveId: r }
|
|
4696
|
+
});
|
|
4697
|
+
break;
|
|
4698
|
+
}
|
|
4699
|
+
case "gamaro:lead-captured":
|
|
4700
|
+
this.emit("lead-captured", {
|
|
4701
|
+
hasEmail: e.hasEmail,
|
|
4702
|
+
hasPhone: e.hasPhone
|
|
4703
|
+
});
|
|
4657
4704
|
}
|
|
4658
4705
|
}
|
|
4659
4706
|
sendConfig() {
|
|
@@ -4782,11 +4829,11 @@ var ye = {
|
|
|
4782
4829
|
this.debugLog(e, ...r);
|
|
4783
4830
|
}
|
|
4784
4831
|
};
|
|
4785
|
-
function
|
|
4786
|
-
return new
|
|
4832
|
+
function hu(e) {
|
|
4833
|
+
return new du(e);
|
|
4787
4834
|
}
|
|
4788
4835
|
var tt = /* @__PURE__ */ new WeakSet();
|
|
4789
|
-
function
|
|
4836
|
+
function pu(e) {
|
|
4790
4837
|
const t = e.getAttribute("data-api-key") ?? void 0;
|
|
4791
4838
|
if (!t)
|
|
4792
4839
|
return ze("Missing required data-api-key attribute on script tag"), null;
|
|
@@ -4801,7 +4848,7 @@ function du(e) {
|
|
|
4801
4848
|
...a && { userHash: a }
|
|
4802
4849
|
};
|
|
4803
4850
|
}
|
|
4804
|
-
function
|
|
4851
|
+
function mu() {
|
|
4805
4852
|
if (document.currentScript instanceof HTMLScriptElement) return document.currentScript;
|
|
4806
4853
|
const e = document.querySelectorAll("script[src]");
|
|
4807
4854
|
for (const t of e) {
|
|
@@ -4813,7 +4860,7 @@ function hu() {
|
|
|
4813
4860
|
function or() {
|
|
4814
4861
|
const e = document.querySelectorAll("script[data-api-key]");
|
|
4815
4862
|
if (e.length === 0) {
|
|
4816
|
-
const t =
|
|
4863
|
+
const t = mu();
|
|
4817
4864
|
t && t.hasAttribute("data-api-key") && !tt.has(t) && sr(t);
|
|
4818
4865
|
return;
|
|
4819
4866
|
}
|
|
@@ -4822,9 +4869,9 @@ function or() {
|
|
|
4822
4869
|
function sr(e) {
|
|
4823
4870
|
if (tt.has(e)) return;
|
|
4824
4871
|
tt.add(e);
|
|
4825
|
-
const t =
|
|
4872
|
+
const t = pu(e);
|
|
4826
4873
|
if (!t) return;
|
|
4827
|
-
const r =
|
|
4874
|
+
const r = hu(t);
|
|
4828
4875
|
window.Gamaro || (window.Gamaro = r), window.GamaroApps || (window.GamaroApps = /* @__PURE__ */ new Map()), r.on("ready", () => {
|
|
4829
4876
|
r.applicationId && window.GamaroApps && window.GamaroApps.set(r.applicationId, r);
|
|
4830
4877
|
}), Se(`Widget v${r.version} initializing...`);
|
|
@@ -4832,16 +4879,16 @@ function sr(e) {
|
|
|
4832
4879
|
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", or) : or());
|
|
4833
4880
|
export {
|
|
4834
4881
|
Y as ConfigFetchError,
|
|
4835
|
-
|
|
4882
|
+
du as GamaroWidget,
|
|
4836
4883
|
or as __autoInit,
|
|
4837
|
-
|
|
4838
|
-
|
|
4884
|
+
mu as __getCurrentScript,
|
|
4885
|
+
pu as __parseScriptAttributes,
|
|
4839
4886
|
Lc as applicationConfigResponseSchema,
|
|
4840
|
-
|
|
4841
|
-
|
|
4887
|
+
wu as b2bProfileSchema,
|
|
4888
|
+
hu as createWidget,
|
|
4842
4889
|
Yc as fetchApplicationConfig,
|
|
4843
4890
|
gt as themeConfigSchema,
|
|
4844
|
-
|
|
4845
|
-
|
|
4891
|
+
bu as widgetConfigSchema,
|
|
4892
|
+
_u as widgetMessageSchema,
|
|
4846
4893
|
an as widgetPositionSchema
|
|
4847
4894
|
};
|