@8wave/ai-elements 0.74.0 → 0.77.0
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/_chunks/{PkStreamingMarkdown-orhL2kzD.js → PkStreamingMarkdown-COZApJzT.js} +22 -22
- package/dist/_chunks/PkStreamingMarkdown-COZApJzT.js.map +1 -0
- package/dist/_chunks/{PkToolShowArtifact-c_vCWUpQ.js → PkToolShowArtifact-BZQixk9z.js} +7 -7
- package/dist/_chunks/{PkToolShowArtifact-c_vCWUpQ.js.map → PkToolShowArtifact-BZQixk9z.js.map} +1 -1
- package/dist/_chunks/{PkToolShowCalendarEvent-D2VHu1V3.js → PkToolShowCalendarEvent-BEqn5iEb.js} +12 -12
- package/dist/_chunks/{PkToolShowCalendarEvent-D2VHu1V3.js.map → PkToolShowCalendarEvent-BEqn5iEb.js.map} +1 -1
- package/dist/_chunks/{PkToolShowComparison-C2ZUH0w4.js → PkToolShowComparison-p34r0Hhd.js} +7 -7
- package/dist/_chunks/{PkToolShowComparison-C2ZUH0w4.js.map → PkToolShowComparison-p34r0Hhd.js.map} +1 -1
- package/dist/_chunks/PkToolShowContactForm-thS7c8iL.js +1658 -0
- package/dist/_chunks/PkToolShowContactForm-thS7c8iL.js.map +1 -0
- package/dist/_chunks/{PkToolShowEmail-BuyCHUU5.js → PkToolShowEmail-Be8FvWjw.js} +11 -11
- package/dist/_chunks/{PkToolShowEmail-BuyCHUU5.js.map → PkToolShowEmail-Be8FvWjw.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-ByldZ0nj.js → PkToolShowImageGallery-DmJztS-Z.js} +5 -5
- package/dist/_chunks/{PkToolShowImageGallery-ByldZ0nj.js.map → PkToolShowImageGallery-DmJztS-Z.js.map} +1 -1
- package/dist/_chunks/{PkToolShowLocation-BCFnC5c7.js → PkToolShowLocation-DOoLCHzS.js} +9 -9
- package/dist/_chunks/{PkToolShowLocation-BCFnC5c7.js.map → PkToolShowLocation-DOoLCHzS.js.map} +1 -1
- package/dist/_chunks/{PkToolShowMessage-6Bsfi3BC.js → PkToolShowMessage-DgeULbdQ.js} +10 -10
- package/dist/_chunks/{PkToolShowMessage-6Bsfi3BC.js.map → PkToolShowMessage-DgeULbdQ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowMultipleChoice-BLNTD2lK.js → PkToolShowMultipleChoice-CpGyn_bZ.js} +3 -3
- package/dist/_chunks/{PkToolShowMultipleChoice-BLNTD2lK.js.map → PkToolShowMultipleChoice-CpGyn_bZ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-B4S5_m-f.js → PkToolShowProductList-DEo7XogW.js} +4 -4
- package/dist/_chunks/{PkToolShowProductList-B4S5_m-f.js.map → PkToolShowProductList-DEo7XogW.js.map} +1 -1
- package/dist/_chunks/{PkToolShowQrCode-BVZlzYDq.js → PkToolShowQrCode-UE4uSyvJ.js} +7 -7
- package/dist/_chunks/{PkToolShowQrCode-BVZlzYDq.js.map → PkToolShowQrCode-UE4uSyvJ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-BQo5DRwt.js → PkToolShowSources-BMXftK6O.js} +10 -9
- package/dist/_chunks/PkToolShowSources-BMXftK6O.js.map +1 -0
- package/dist/_chunks/{PkToolShowSuggestedReply-BxDI6yp_.js → PkToolShowSuggestedReply-CPAnHI0c.js} +3 -3
- package/dist/_chunks/{PkToolShowSuggestedReply-BxDI6yp_.js.map → PkToolShowSuggestedReply-CPAnHI0c.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWeather-DR6egBIP.js → PkToolShowWeather-DcSUbzx0.js} +4 -4
- package/dist/_chunks/{PkToolShowWeather-DR6egBIP.js.map → PkToolShowWeather-DcSUbzx0.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-D8RngE-F.js → PkToolShowWebPages-aH_GarEV.js} +5 -5
- package/dist/_chunks/{PkToolShowWebPages-D8RngE-F.js.map → PkToolShowWebPages-aH_GarEV.js.map} +1 -1
- package/dist/_chunks/{PkUrl-CI17WkYu.js → PkUrl-BHD0_pal.js} +2 -2
- package/dist/_chunks/{PkUrl-CI17WkYu.js.map → PkUrl-BHD0_pal.js.map} +1 -1
- package/dist/_chunks/{VvCheckbox.es-kmMsWlkU.js → VvCheckbox.es-ohF87NOe.js} +3 -3
- package/dist/_chunks/{VvCheckbox.es-kmMsWlkU.js.map → VvCheckbox.es-ohF87NOe.js.map} +1 -1
- package/dist/_chunks/{VvCheckboxGroup.es-BRRmuO9h.js → VvCheckboxGroup.es-DZCbyLN0.js} +109 -109
- package/dist/_chunks/{VvCheckboxGroup.es-BRRmuO9h.js.map → VvCheckboxGroup.es-DZCbyLN0.js.map} +1 -1
- package/dist/_chunks/{VvCombobox.es-pTM53Z4B.js → VvCombobox.es-YLPD7MpO.js} +256 -256
- package/dist/_chunks/{VvCombobox.es-pTM53Z4B.js.map → VvCombobox.es-YLPD7MpO.js.map} +1 -1
- package/dist/_chunks/{VvInputText.es-DO39OSWk.js → VvInputText.es-DAnAXfBO.js} +190 -190
- package/dist/_chunks/{VvInputText.es-DO39OSWk.js.map → VvInputText.es-DAnAXfBO.js.map} +1 -1
- package/dist/_chunks/{VvRadio.es-BpQAJbon.js → VvRadio.es-Do9oyNtV.js} +3 -3
- package/dist/_chunks/{VvRadio.es-BpQAJbon.js.map → VvRadio.es-Do9oyNtV.js.map} +1 -1
- package/dist/_chunks/{VvRadioGroup.es-BSBrmx9w.js → VvRadioGroup.es-BHcqcJFC.js} +11 -11
- package/dist/_chunks/{VvRadioGroup.es-BSBrmx9w.js.map → VvRadioGroup.es-BHcqcJFC.js.map} +1 -1
- package/dist/_chunks/{VvSelect.es-DALpUK5j.js → VvSelect.es-CP_y02fy.js} +8 -8
- package/dist/_chunks/{VvSelect.es-DALpUK5j.js.map → VvSelect.es-CP_y02fy.js.map} +1 -1
- package/dist/_chunks/{VvTextarea.es-C9dwYLOG.js → VvTextarea.es-DetA_2DM.js} +250 -250
- package/dist/_chunks/{VvTextarea.es-C9dwYLOG.js.map → VvTextarea.es-DetA_2DM.js.map} +1 -1
- package/dist/_chunks/{dist-DtF6poRc.js → dist-yqV26MWM.js} +132 -120
- package/dist/_chunks/dist-yqV26MWM.js.map +1 -0
- package/dist/_chunks/{esm-0nyRYwmP.js → esm-DLxNpT06.js} +7 -7
- package/dist/_chunks/{esm-0nyRYwmP.js.map → esm-DLxNpT06.js.map} +1 -1
- package/dist/_chunks/{floating-ui.vue-B5ZV-j8C.js → floating-ui.vue-tVPpNXUc.js} +3 -3
- package/dist/_chunks/{floating-ui.vue-B5ZV-j8C.js.map → floating-ui.vue-tVPpNXUc.js.map} +1 -1
- package/dist/_chunks/{iconify-C1EOwL90.js → iconify-y0w2FIJH.js} +3 -3
- package/dist/_chunks/{iconify-C1EOwL90.js.map → iconify-y0w2FIJH.js.map} +1 -1
- package/dist/_chunks/{index.es-BGFmj59S.js → index.es-7fUi-rc0.js} +452 -452
- package/dist/_chunks/{index.es-BGFmj59S.js.map → index.es-7fUi-rc0.js.map} +1 -1
- package/dist/_chunks/{schemas-Bp3a8tYV.js → schemas-aPiXCaCc.js} +1309 -945
- package/dist/_chunks/schemas-aPiXCaCc.js.map +1 -0
- package/dist/_chunks/{src-C_wl-KYN.js → src-BfoQF6Z3.js} +2 -2
- package/dist/_chunks/{src-C_wl-KYN.js.map → src-BfoQF6Z3.js.map} +1 -1
- package/dist/_chunks/{useLightbox-CH1KeVqr.js → useLightbox-DL_oVBep.js} +3 -3
- package/dist/_chunks/{useLightbox-CH1KeVqr.js.map → useLightbox-DL_oVBep.js.map} +1 -1
- package/dist/_chunks/{vue-i18n-KvYvoek4.js → vue-i18n-DAH6nDTN.js} +3 -3
- package/dist/_chunks/{vue-i18n-KvYvoek4.js.map → vue-i18n-DAH6nDTN.js.map} +1 -1
- package/dist/_chunks/{vue.runtime.esm-bundler-BmggS4HU.js → vue.runtime.esm-bundler-Dq29dQrz.js} +16 -10
- package/dist/_chunks/vue.runtime.esm-bundler-Dq29dQrz.js.map +1 -0
- package/dist/ai-elements.es.js +4637 -3428
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotFeedbackForm.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Media-Bic_vfSX.js → Media-kK7BnZGr.js} +4 -4
- package/dist-vue/_chunks/Media-kK7BnZGr.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-woRkjgP5.js → PkChatbot-B9RSkQmJ.js} +7 -7
- package/dist-vue/_chunks/{PkChatbot-woRkjgP5.js.map → PkChatbot-B9RSkQmJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-D-lx1URv.js → PkChatbotFeedbackForm-lj9CHdhn.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotFeedbackForm-D-lx1URv.js.map → PkChatbotFeedbackForm-lj9CHdhn.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-LHE0HZ9z.js → PkChatbotInput-C5QSmt21.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-LHE0HZ9z.js.map → PkChatbotInput-C5QSmt21.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-BxTeEm3j.js → PkChatbotMessages-DOeUT6YL.js} +7 -7
- package/dist-vue/_chunks/PkChatbotMessages-DOeUT6YL.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-BoEfZeco.js → PkChatbotViewChat-C2FuDayB.js} +6 -6
- package/dist-vue/_chunks/{PkChatbotViewChat-BoEfZeco.js.map → PkChatbotViewChat-C2FuDayB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-DvVc1arX.js → PkChatbotViewConversations-2xc0o-fO.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-DvVc1arX.js.map → PkChatbotViewConversations-2xc0o-fO.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-Dev_6pki.js → PkChatbotViewProfile-CoT1JnMk.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-Dev_6pki.js.map → PkChatbotViewProfile-CoT1JnMk.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-B4gnJ4hk.js → PkStreamingMarkdown-BAhC3uGK.js} +20 -20
- package/dist-vue/_chunks/PkStreamingMarkdown-BAhC3uGK.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-EvbUZSOf.js → PkToolShowArtifact-RzrDPcEQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-EvbUZSOf.js.map → PkToolShowArtifact-RzrDPcEQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-CsDOqSJK.js → PkToolShowContactForm-5H4jfq1F.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowContactForm-CsDOqSJK.js.map → PkToolShowContactForm-5H4jfq1F.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-ZtXFkIHt.js → PkToolShowSources-Dv0uuvqS.js} +5 -4
- package/dist-vue/_chunks/PkToolShowSources-Dv0uuvqS.js.map +1 -0
- package/dist-vue/_chunks/{ZodError-Ca0wCsGp.js → ZodError-C_est8SY.js} +2 -2
- package/dist-vue/_chunks/{ZodError-Ca0wCsGp.js.map → ZodError-C_est8SY.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-YJegM3ni.js → createChatbotApiClient-CvDRMmDa.js} +3 -3
- package/dist-vue/_chunks/createChatbotApiClient-CvDRMmDa.js.map +1 -0
- package/dist-vue/_chunks/{index.es-CrPSzhoZ.js → index.es-Dk_HaA08.js} +4 -4
- package/dist-vue/_chunks/{index.es-CrPSzhoZ.js.map → index.es-Dk_HaA08.js.map} +1 -1
- package/dist-vue/_chunks/{schemas-sa2dDEGb.js → schemas-Clx4oKCB.js} +1309 -945
- package/dist-vue/_chunks/schemas-Clx4oKCB.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-DGL81KJa.js → useChatbotStore-DMDbzuub.js} +1061 -1000
- package/dist-vue/_chunks/useChatbotStore-DMDbzuub.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +6 -6
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +8 -8
- package/dist-vue/apps/web-component/src/lib.d.ts +29 -0
- package/dist-vue/apps/web-component/src/main.d.ts +0 -0
- package/dist-vue/apps/web-component/src/modules/applicationInsights.d.ts +38 -0
- package/dist-vue/composables.js +2 -2
- package/dist-vue/index.js +2852 -2876
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/packages/auth/src/add-member-to-organization.d.ts +5 -0
- package/dist-vue/packages/auth/src/anonymous-reauth-plugin.d.ts +11 -0
- package/dist-vue/packages/auth/src/external-auth-plugin.d.ts +2 -0
- package/dist-vue/packages/auth/src/index.d.ts +3477 -8
- package/dist-vue/packages/auth/src/media-helpers.d.ts +13 -0
- package/dist-vue/packages/auth/src/organization-auto-join.d.ts +1 -0
- package/dist-vue/packages/components/src/PkEditorMarkdown.d.ts +1 -1
- package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +2 -2
- package/dist-vue/packages/components/src/PkEditorWyswyg.d.ts +1 -1
- package/dist-vue/packages/components/src/PkFieldset.d.ts +3 -3
- package/dist-vue/packages/components/src/composables/index.d.ts +3 -0
- package/dist-vue/packages/components/src/composables/useChatbotError.d.ts +11 -11
- package/dist-vue/packages/composable/src/constants.d.ts +5 -0
- package/dist-vue/packages/composable/src/useDialog.d.ts +3 -3
- package/dist-vue/packages/composable/src/useSettingsStore.d.ts +4 -5
- package/dist-vue/packages/models/src/schema/Agent.d.ts +27 -27
- package/dist-vue/packages/models/src/schema/AgentEndpoint.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/Document.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +5 -5
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +10 -10
- package/dist-vue/packages/models/src/schema/constants.d.ts +3 -1
- package/package.json +4 -4
- package/dist/_chunks/PkStreamingMarkdown-orhL2kzD.js.map +0 -1
- package/dist/_chunks/PkToolShowContactForm-6C4uWDtf.js +0 -1103
- package/dist/_chunks/PkToolShowContactForm-6C4uWDtf.js.map +0 -1
- package/dist/_chunks/PkToolShowSources-BQo5DRwt.js.map +0 -1
- package/dist/_chunks/dist-DtF6poRc.js.map +0 -1
- package/dist/_chunks/schemas-Bp3a8tYV.js.map +0 -1
- package/dist/_chunks/vue.runtime.esm-bundler-BmggS4HU.js.map +0 -1
- package/dist-vue/_chunks/Media-Bic_vfSX.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-BxTeEm3j.js.map +0 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-B4gnJ4hk.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowSources-ZtXFkIHt.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-YJegM3ni.js.map +0 -1
- package/dist-vue/_chunks/schemas-sa2dDEGb.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-DGL81KJa.js.map +0 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +0 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-D9KsE1-l.js";
|
|
2
|
-
import { t } from "./createChatbotApiClient-
|
|
3
|
-
import { C as n, S as r, _ as i, a, b as o, c as s, d as c, g as l, i as u, m as d, n as f, o as p, p as m, r as h, s as g, u as ee, v as _, y as v } from "./schemas-
|
|
2
|
+
import { t } from "./createChatbotApiClient-CvDRMmDa.js";
|
|
3
|
+
import { C as n, S as r, _ as i, a, b as o, c as s, d as c, g as l, i as u, m as d, n as f, o as p, p as m, r as h, s as g, u as ee, v as _, y as v } from "./schemas-Clx4oKCB.js";
|
|
4
4
|
import { _ as te, g as ne, h as re, s as ie } from "./src-EtGd6cRz.js";
|
|
5
|
-
import { a as y, i as b, n as x, r as S, t as C } from "./ZodError-
|
|
5
|
+
import { a as y, i as b, n as x, r as S, t as C } from "./ZodError-C_est8SY.js";
|
|
6
6
|
import { t as ae } from "./useSafeLocalStorage-BDPvGrtd.js";
|
|
7
7
|
import { computed as w, getCurrentInstance as oe, isReadonly as se, onMounted as ce, onUnmounted as le, reactive as ue, ref as T, toRefs as E, watch as de, watchEffect as fe } from "vue";
|
|
8
8
|
import { useI18n as pe } from "vue-i18n";
|
|
@@ -46,7 +46,7 @@ Error message: ${k(t)}`,
|
|
|
46
46
|
static isInstance(e) {
|
|
47
47
|
return O.hasMarker(e, Te);
|
|
48
48
|
}
|
|
49
|
-
}, Oe = "AI_TypeValidationError", ke = `vercel.ai.error.${Oe}`, Ae = Symbol.for(ke), je, Me,
|
|
49
|
+
}, Oe = "AI_TypeValidationError", ke = `vercel.ai.error.${Oe}`, Ae = Symbol.for(ke), je, Me, M = class e extends (Me = O, je = Ae, Me) {
|
|
50
50
|
constructor({ value: e, cause: t, context: n }) {
|
|
51
51
|
let r = "Type validation failed";
|
|
52
52
|
if (n?.field && (r += ` for ${n.field}`), n?.entityName || n?.entityId) {
|
|
@@ -71,7 +71,7 @@ Error message: ${k(t)}`,
|
|
|
71
71
|
context: r
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, Ne = (e, t) => {
|
|
75
75
|
let n;
|
|
76
76
|
switch (e.code) {
|
|
77
77
|
case x.invalid_type:
|
|
@@ -125,13 +125,13 @@ Error message: ${k(t)}`,
|
|
|
125
125
|
default: n = t.defaultError, y.assertNever(e);
|
|
126
126
|
}
|
|
127
127
|
return { message: n };
|
|
128
|
-
},
|
|
129
|
-
function
|
|
130
|
-
return
|
|
128
|
+
}, Pe = Ne;
|
|
129
|
+
function Fe() {
|
|
130
|
+
return Pe;
|
|
131
131
|
}
|
|
132
132
|
//#endregion
|
|
133
|
-
//#region ../../node_modules/.pnpm/zod@4.3
|
|
134
|
-
var
|
|
133
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/helpers/parseUtil.js
|
|
134
|
+
var Ie = (e) => {
|
|
135
135
|
let { data: t, path: n, errorMaps: r, issueData: i } = e, a = [...n, ...i.path || []], o = {
|
|
136
136
|
...i,
|
|
137
137
|
path: a
|
|
@@ -152,8 +152,8 @@ var Le = (e) => {
|
|
|
152
152
|
message: s
|
|
153
153
|
};
|
|
154
154
|
};
|
|
155
|
-
function
|
|
156
|
-
let n =
|
|
155
|
+
function N(e, t) {
|
|
156
|
+
let n = Fe(), r = Ie({
|
|
157
157
|
issueData: t,
|
|
158
158
|
data: e.data,
|
|
159
159
|
path: e.path,
|
|
@@ -161,12 +161,12 @@ function M(e, t) {
|
|
|
161
161
|
e.common.contextualErrorMap,
|
|
162
162
|
e.schemaErrorMap,
|
|
163
163
|
n,
|
|
164
|
-
n ===
|
|
164
|
+
n === Ne ? void 0 : Ne
|
|
165
165
|
].filter((e) => !!e)
|
|
166
166
|
});
|
|
167
167
|
e.common.issues.push(r);
|
|
168
168
|
}
|
|
169
|
-
var
|
|
169
|
+
var P = class e {
|
|
170
170
|
constructor() {
|
|
171
171
|
this.value = "valid";
|
|
172
172
|
}
|
|
@@ -179,7 +179,7 @@ var N = class e {
|
|
|
179
179
|
static mergeArray(e, t) {
|
|
180
180
|
let n = [];
|
|
181
181
|
for (let r of t) {
|
|
182
|
-
if (r.status === "aborted") return
|
|
182
|
+
if (r.status === "aborted") return F;
|
|
183
183
|
r.status === "dirty" && e.dirty(), n.push(r.value);
|
|
184
184
|
}
|
|
185
185
|
return {
|
|
@@ -202,7 +202,7 @@ var N = class e {
|
|
|
202
202
|
let n = {};
|
|
203
203
|
for (let r of t) {
|
|
204
204
|
let { key: t, value: i } = r;
|
|
205
|
-
if (t.status === "aborted" || i.status === "aborted") return
|
|
205
|
+
if (t.status === "aborted" || i.status === "aborted") return F;
|
|
206
206
|
t.status === "dirty" && e.dirty(), i.status === "dirty" && e.dirty(), t.value !== "__proto__" && (i.value !== void 0 || r.alwaysSet) && (n[t.value] = i.value);
|
|
207
207
|
}
|
|
208
208
|
return {
|
|
@@ -210,27 +210,27 @@ var N = class e {
|
|
|
210
210
|
value: n
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
},
|
|
213
|
+
}, F = Object.freeze({ status: "aborted" }), Le = (e) => ({
|
|
214
214
|
status: "dirty",
|
|
215
215
|
value: e
|
|
216
|
-
}),
|
|
216
|
+
}), I = (e) => ({
|
|
217
217
|
status: "valid",
|
|
218
218
|
value: e
|
|
219
|
-
}),
|
|
219
|
+
}), Re = (e) => e.status === "aborted", ze = (e) => e.status === "dirty", Be = (e) => e.status === "valid", Ve = (e) => typeof Promise < "u" && e instanceof Promise, L;
|
|
220
220
|
(function(e) {
|
|
221
221
|
e.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, e.toString = (e) => typeof e == "string" ? e : e?.message;
|
|
222
|
-
})(
|
|
222
|
+
})(L ||= {});
|
|
223
223
|
//#endregion
|
|
224
|
-
//#region ../../node_modules/.pnpm/zod@4.3
|
|
225
|
-
var
|
|
224
|
+
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v3/types.js
|
|
225
|
+
var R = class {
|
|
226
226
|
constructor(e, t, n, r) {
|
|
227
227
|
this._cachedPath = [], this.parent = e, this.data = t, this._path = n, this._key = r;
|
|
228
228
|
}
|
|
229
229
|
get path() {
|
|
230
230
|
return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
231
231
|
}
|
|
232
|
-
},
|
|
233
|
-
if (
|
|
232
|
+
}, He = (e, t) => {
|
|
233
|
+
if (Be(t)) return {
|
|
234
234
|
success: !0,
|
|
235
235
|
data: t.value
|
|
236
236
|
};
|
|
@@ -244,7 +244,7 @@ var L = class {
|
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
246
|
};
|
|
247
|
-
function
|
|
247
|
+
function z(e) {
|
|
248
248
|
if (!e) return {};
|
|
249
249
|
let { errorMap: t, invalid_type_error: n, required_error: r, description: i } = e;
|
|
250
250
|
if (t && (n || r)) throw Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.");
|
|
@@ -259,7 +259,7 @@ function R(e) {
|
|
|
259
259
|
description: i
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
|
-
var
|
|
262
|
+
var B = class {
|
|
263
263
|
get description() {
|
|
264
264
|
return this._def.description;
|
|
265
265
|
}
|
|
@@ -278,7 +278,7 @@ var z = class {
|
|
|
278
278
|
}
|
|
279
279
|
_processInputParams(e) {
|
|
280
280
|
return {
|
|
281
|
-
status: new
|
|
281
|
+
status: new P(),
|
|
282
282
|
ctx: {
|
|
283
283
|
common: e.parent.common,
|
|
284
284
|
data: e.data,
|
|
@@ -291,7 +291,7 @@ var z = class {
|
|
|
291
291
|
}
|
|
292
292
|
_parseSync(e) {
|
|
293
293
|
let t = this._parse(e);
|
|
294
|
-
if (
|
|
294
|
+
if (Ve(t)) throw Error("Synchronous parse encountered promise.");
|
|
295
295
|
return t;
|
|
296
296
|
}
|
|
297
297
|
_parseAsync(e) {
|
|
@@ -316,7 +316,7 @@ var z = class {
|
|
|
316
316
|
data: e,
|
|
317
317
|
parsedType: b(e)
|
|
318
318
|
};
|
|
319
|
-
return
|
|
319
|
+
return He(n, this._parseSync({
|
|
320
320
|
data: e,
|
|
321
321
|
path: n.path,
|
|
322
322
|
parent: n
|
|
@@ -340,7 +340,7 @@ var z = class {
|
|
|
340
340
|
path: [],
|
|
341
341
|
parent: t
|
|
342
342
|
});
|
|
343
|
-
return
|
|
343
|
+
return Be(n) ? { value: n.value } : { issues: t.common.issues };
|
|
344
344
|
} catch (e) {
|
|
345
345
|
e?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
|
|
346
346
|
issues: [],
|
|
@@ -351,7 +351,7 @@ var z = class {
|
|
|
351
351
|
data: e,
|
|
352
352
|
path: [],
|
|
353
353
|
parent: t
|
|
354
|
-
}).then((e) =>
|
|
354
|
+
}).then((e) => Be(e) ? { value: e.value } : { issues: t.common.issues });
|
|
355
355
|
}
|
|
356
356
|
async parseAsync(e, t) {
|
|
357
357
|
let n = await this.safeParseAsync(e, t);
|
|
@@ -375,7 +375,7 @@ var z = class {
|
|
|
375
375
|
path: n.path,
|
|
376
376
|
parent: n
|
|
377
377
|
});
|
|
378
|
-
return
|
|
378
|
+
return He(n, await (Ve(r) ? r : Promise.resolve(r)));
|
|
379
379
|
}
|
|
380
380
|
refine(e, t) {
|
|
381
381
|
let n = (e) => typeof t == "string" || t === void 0 ? { message: t } : typeof t == "function" ? t(e) : t;
|
|
@@ -391,9 +391,9 @@ var z = class {
|
|
|
391
391
|
return this._refinement((n, r) => e(n) ? !0 : (r.addIssue(typeof t == "function" ? t(n, r) : t), !1));
|
|
392
392
|
}
|
|
393
393
|
_refinement(e) {
|
|
394
|
-
return new
|
|
394
|
+
return new W({
|
|
395
395
|
schema: this,
|
|
396
|
-
typeName:
|
|
396
|
+
typeName: K.ZodEffects,
|
|
397
397
|
effect: {
|
|
398
398
|
type: "refinement",
|
|
399
399
|
refinement: e
|
|
@@ -411,31 +411,31 @@ var z = class {
|
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
413
|
optional() {
|
|
414
|
-
return
|
|
414
|
+
return G.create(this, this._def);
|
|
415
415
|
}
|
|
416
416
|
nullable() {
|
|
417
|
-
return
|
|
417
|
+
return Ht.create(this, this._def);
|
|
418
418
|
}
|
|
419
419
|
nullish() {
|
|
420
420
|
return this.nullable().optional();
|
|
421
421
|
}
|
|
422
422
|
array() {
|
|
423
|
-
return
|
|
423
|
+
return Tt.create(this);
|
|
424
424
|
}
|
|
425
425
|
promise() {
|
|
426
|
-
return
|
|
426
|
+
return Vt.create(this, this._def);
|
|
427
427
|
}
|
|
428
428
|
or(e) {
|
|
429
|
-
return
|
|
429
|
+
return Dt.create([this, e], this._def);
|
|
430
430
|
}
|
|
431
431
|
and(e) {
|
|
432
|
-
return
|
|
432
|
+
return At.create(this, e, this._def);
|
|
433
433
|
}
|
|
434
434
|
transform(e) {
|
|
435
|
-
return new
|
|
436
|
-
...
|
|
435
|
+
return new W({
|
|
436
|
+
...z(this._def),
|
|
437
437
|
schema: this,
|
|
438
|
-
typeName:
|
|
438
|
+
typeName: K.ZodEffects,
|
|
439
439
|
effect: {
|
|
440
440
|
type: "transform",
|
|
441
441
|
transform: e
|
|
@@ -444,27 +444,27 @@ var z = class {
|
|
|
444
444
|
}
|
|
445
445
|
default(e) {
|
|
446
446
|
let t = typeof e == "function" ? e : () => e;
|
|
447
|
-
return new
|
|
448
|
-
...
|
|
447
|
+
return new Ut({
|
|
448
|
+
...z(this._def),
|
|
449
449
|
innerType: this,
|
|
450
450
|
defaultValue: t,
|
|
451
|
-
typeName:
|
|
451
|
+
typeName: K.ZodDefault
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
brand() {
|
|
455
|
-
return new
|
|
456
|
-
typeName:
|
|
455
|
+
return new Kt({
|
|
456
|
+
typeName: K.ZodBranded,
|
|
457
457
|
type: this,
|
|
458
|
-
...
|
|
458
|
+
...z(this._def)
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
461
|
catch(e) {
|
|
462
462
|
let t = typeof e == "function" ? e : () => e;
|
|
463
|
-
return new
|
|
464
|
-
...
|
|
463
|
+
return new Wt({
|
|
464
|
+
...z(this._def),
|
|
465
465
|
innerType: this,
|
|
466
466
|
catchValue: t,
|
|
467
|
-
typeName:
|
|
467
|
+
typeName: K.ZodCatch
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
470
|
describe(e) {
|
|
@@ -475,10 +475,10 @@ var z = class {
|
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
pipe(e) {
|
|
478
|
-
return
|
|
478
|
+
return qt.create(this, e);
|
|
479
479
|
}
|
|
480
480
|
readonly() {
|
|
481
|
-
return
|
|
481
|
+
return Jt.create(this);
|
|
482
482
|
}
|
|
483
483
|
isOptional() {
|
|
484
484
|
return this.safeParse(void 0).success;
|
|
@@ -486,25 +486,25 @@ var z = class {
|
|
|
486
486
|
isNullable() {
|
|
487
487
|
return this.safeParse(null).success;
|
|
488
488
|
}
|
|
489
|
-
},
|
|
490
|
-
function
|
|
489
|
+
}, Ue = /^c[^\s-]{8,}$/i, We = /^[0-9a-z]+$/, Ge = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Ke = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, qe = /^[a-z0-9_-]{21}$/i, Je = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Ye = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Xe = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Ze = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", Qe, $e = /^(?:(?: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])$/, et = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, tt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, nt = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, rt = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, it = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, at = "((\\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])))", ot = RegExp(`^${at}$`);
|
|
490
|
+
function st(e) {
|
|
491
491
|
let t = "[0-5]\\d";
|
|
492
492
|
e.precision ? t = `${t}\\.\\d{${e.precision}}` : e.precision ?? (t = `${t}(\\.\\d+)?`);
|
|
493
493
|
let n = e.precision ? "+" : "?";
|
|
494
494
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`;
|
|
495
495
|
}
|
|
496
|
-
function
|
|
497
|
-
return RegExp(`^${
|
|
496
|
+
function ct(e) {
|
|
497
|
+
return RegExp(`^${st(e)}$`);
|
|
498
498
|
}
|
|
499
|
-
function
|
|
500
|
-
let t = `${
|
|
499
|
+
function lt(e) {
|
|
500
|
+
let t = `${at}T${st(e)}`, n = [];
|
|
501
501
|
return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = `${t}(${n.join("|")})`, RegExp(`^${t}$`);
|
|
502
502
|
}
|
|
503
|
-
function
|
|
504
|
-
return !!((t === "v4" || !t) &&
|
|
503
|
+
function ut(e, t) {
|
|
504
|
+
return !!((t === "v4" || !t) && $e.test(e) || (t === "v6" || !t) && tt.test(e));
|
|
505
505
|
}
|
|
506
|
-
function
|
|
507
|
-
if (!
|
|
506
|
+
function dt(e, t) {
|
|
507
|
+
if (!Je.test(e)) return !1;
|
|
508
508
|
try {
|
|
509
509
|
let [n] = e.split(".");
|
|
510
510
|
if (!n) return !1;
|
|
@@ -514,21 +514,21 @@ function ft(e, t) {
|
|
|
514
514
|
return !1;
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
|
-
function
|
|
518
|
-
return !!((t === "v4" || !t) &&
|
|
517
|
+
function ft(e, t) {
|
|
518
|
+
return !!((t === "v4" || !t) && et.test(e) || (t === "v6" || !t) && nt.test(e));
|
|
519
519
|
}
|
|
520
|
-
var
|
|
520
|
+
var pt = class e extends B {
|
|
521
521
|
_parse(e) {
|
|
522
522
|
if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== S.string) {
|
|
523
523
|
let t = this._getOrReturnCtx(e);
|
|
524
|
-
return
|
|
524
|
+
return N(t, {
|
|
525
525
|
code: x.invalid_type,
|
|
526
526
|
expected: S.string,
|
|
527
527
|
received: t.parsedType
|
|
528
|
-
}),
|
|
528
|
+
}), F;
|
|
529
529
|
}
|
|
530
|
-
let t = new
|
|
531
|
-
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n),
|
|
530
|
+
let t = new P(), n;
|
|
531
|
+
for (let r of this._def.checks) if (r.kind === "min") e.data.length < r.value && (n = this._getOrReturnCtx(e, n), N(n, {
|
|
532
532
|
code: x.too_small,
|
|
533
533
|
minimum: r.value,
|
|
534
534
|
type: "string",
|
|
@@ -536,7 +536,7 @@ var mt = class e extends z {
|
|
|
536
536
|
exact: !1,
|
|
537
537
|
message: r.message
|
|
538
538
|
}), t.dirty());
|
|
539
|
-
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n),
|
|
539
|
+
else if (r.kind === "max") e.data.length > r.value && (n = this._getOrReturnCtx(e, n), N(n, {
|
|
540
540
|
code: x.too_big,
|
|
541
541
|
maximum: r.value,
|
|
542
542
|
type: "string",
|
|
@@ -546,14 +546,14 @@ var mt = class e extends z {
|
|
|
546
546
|
}), t.dirty());
|
|
547
547
|
else if (r.kind === "length") {
|
|
548
548
|
let i = e.data.length > r.value, a = e.data.length < r.value;
|
|
549
|
-
(i || a) && (n = this._getOrReturnCtx(e, n), i ?
|
|
549
|
+
(i || a) && (n = this._getOrReturnCtx(e, n), i ? N(n, {
|
|
550
550
|
code: x.too_big,
|
|
551
551
|
maximum: r.value,
|
|
552
552
|
type: "string",
|
|
553
553
|
inclusive: !0,
|
|
554
554
|
exact: !0,
|
|
555
555
|
message: r.message
|
|
556
|
-
}) : a &&
|
|
556
|
+
}) : a && N(n, {
|
|
557
557
|
code: x.too_small,
|
|
558
558
|
minimum: r.value,
|
|
559
559
|
type: "string",
|
|
@@ -561,37 +561,37 @@ var mt = class e extends z {
|
|
|
561
561
|
exact: !0,
|
|
562
562
|
message: r.message
|
|
563
563
|
}), t.dirty());
|
|
564
|
-
} else if (r.kind === "email")
|
|
564
|
+
} else if (r.kind === "email") Xe.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
565
565
|
validation: "email",
|
|
566
566
|
code: x.invalid_string,
|
|
567
567
|
message: r.message
|
|
568
568
|
}), t.dirty());
|
|
569
|
-
else if (r.kind === "emoji")
|
|
569
|
+
else if (r.kind === "emoji") Qe ||= new RegExp(Ze, "u"), Qe.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
570
570
|
validation: "emoji",
|
|
571
571
|
code: x.invalid_string,
|
|
572
572
|
message: r.message
|
|
573
573
|
}), t.dirty());
|
|
574
|
-
else if (r.kind === "uuid")
|
|
574
|
+
else if (r.kind === "uuid") Ke.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
575
575
|
validation: "uuid",
|
|
576
576
|
code: x.invalid_string,
|
|
577
577
|
message: r.message
|
|
578
578
|
}), t.dirty());
|
|
579
|
-
else if (r.kind === "nanoid")
|
|
579
|
+
else if (r.kind === "nanoid") qe.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
580
580
|
validation: "nanoid",
|
|
581
581
|
code: x.invalid_string,
|
|
582
582
|
message: r.message
|
|
583
583
|
}), t.dirty());
|
|
584
|
-
else if (r.kind === "cuid")
|
|
584
|
+
else if (r.kind === "cuid") Ue.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
585
585
|
validation: "cuid",
|
|
586
586
|
code: x.invalid_string,
|
|
587
587
|
message: r.message
|
|
588
588
|
}), t.dirty());
|
|
589
|
-
else if (r.kind === "cuid2")
|
|
589
|
+
else if (r.kind === "cuid2") We.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
590
590
|
validation: "cuid2",
|
|
591
591
|
code: x.invalid_string,
|
|
592
592
|
message: r.message
|
|
593
593
|
}), t.dirty());
|
|
594
|
-
else if (r.kind === "ulid")
|
|
594
|
+
else if (r.kind === "ulid") Ge.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
595
595
|
validation: "ulid",
|
|
596
596
|
code: x.invalid_string,
|
|
597
597
|
message: r.message
|
|
@@ -599,64 +599,64 @@ var mt = class e extends z {
|
|
|
599
599
|
else if (r.kind === "url") try {
|
|
600
600
|
new URL(e.data);
|
|
601
601
|
} catch {
|
|
602
|
-
n = this._getOrReturnCtx(e, n),
|
|
602
|
+
n = this._getOrReturnCtx(e, n), N(n, {
|
|
603
603
|
validation: "url",
|
|
604
604
|
code: x.invalid_string,
|
|
605
605
|
message: r.message
|
|
606
606
|
}), t.dirty();
|
|
607
607
|
}
|
|
608
|
-
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n),
|
|
608
|
+
else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
609
609
|
validation: "regex",
|
|
610
610
|
code: x.invalid_string,
|
|
611
611
|
message: r.message
|
|
612
|
-
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n),
|
|
612
|
+
}), t.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
613
613
|
code: x.invalid_string,
|
|
614
614
|
validation: {
|
|
615
615
|
includes: r.value,
|
|
616
616
|
position: r.position
|
|
617
617
|
},
|
|
618
618
|
message: r.message
|
|
619
|
-
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n),
|
|
619
|
+
}), t.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
620
620
|
code: x.invalid_string,
|
|
621
621
|
validation: { startsWith: r.value },
|
|
622
622
|
message: r.message
|
|
623
|
-
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n),
|
|
623
|
+
}), t.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
624
624
|
code: x.invalid_string,
|
|
625
625
|
validation: { endsWith: r.value },
|
|
626
626
|
message: r.message
|
|
627
|
-
}), t.dirty()) : r.kind === "datetime" ?
|
|
627
|
+
}), t.dirty()) : r.kind === "datetime" ? lt(r).test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
628
628
|
code: x.invalid_string,
|
|
629
629
|
validation: "datetime",
|
|
630
630
|
message: r.message
|
|
631
|
-
}), t.dirty()) : r.kind === "date" ?
|
|
631
|
+
}), t.dirty()) : r.kind === "date" ? ot.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
632
632
|
code: x.invalid_string,
|
|
633
633
|
validation: "date",
|
|
634
634
|
message: r.message
|
|
635
|
-
}), t.dirty()) : r.kind === "time" ?
|
|
635
|
+
}), t.dirty()) : r.kind === "time" ? ct(r).test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
636
636
|
code: x.invalid_string,
|
|
637
637
|
validation: "time",
|
|
638
638
|
message: r.message
|
|
639
|
-
}), t.dirty()) : r.kind === "duration" ?
|
|
639
|
+
}), t.dirty()) : r.kind === "duration" ? Ye.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
640
640
|
validation: "duration",
|
|
641
641
|
code: x.invalid_string,
|
|
642
642
|
message: r.message
|
|
643
|
-
}), t.dirty()) : r.kind === "ip" ?
|
|
643
|
+
}), t.dirty()) : r.kind === "ip" ? ut(e.data, r.version) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
644
644
|
validation: "ip",
|
|
645
645
|
code: x.invalid_string,
|
|
646
646
|
message: r.message
|
|
647
|
-
}), t.dirty()) : r.kind === "jwt" ?
|
|
647
|
+
}), t.dirty()) : r.kind === "jwt" ? dt(e.data, r.alg) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
648
648
|
validation: "jwt",
|
|
649
649
|
code: x.invalid_string,
|
|
650
650
|
message: r.message
|
|
651
|
-
}), t.dirty()) : r.kind === "cidr" ?
|
|
651
|
+
}), t.dirty()) : r.kind === "cidr" ? ft(e.data, r.version) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
652
652
|
validation: "cidr",
|
|
653
653
|
code: x.invalid_string,
|
|
654
654
|
message: r.message
|
|
655
|
-
}), t.dirty()) : r.kind === "base64" ?
|
|
655
|
+
}), t.dirty()) : r.kind === "base64" ? rt.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
656
656
|
validation: "base64",
|
|
657
657
|
code: x.invalid_string,
|
|
658
658
|
message: r.message
|
|
659
|
-
}), t.dirty()) : r.kind === "base64url" ?
|
|
659
|
+
}), t.dirty()) : r.kind === "base64url" ? it.test(e.data) || (n = this._getOrReturnCtx(e, n), N(n, {
|
|
660
660
|
validation: "base64url",
|
|
661
661
|
code: x.invalid_string,
|
|
662
662
|
message: r.message
|
|
@@ -670,7 +670,7 @@ var mt = class e extends z {
|
|
|
670
670
|
return this.refinement((t) => e.test(t), {
|
|
671
671
|
validation: t,
|
|
672
672
|
code: x.invalid_string,
|
|
673
|
-
...
|
|
673
|
+
...L.errToObj(n)
|
|
674
674
|
});
|
|
675
675
|
}
|
|
676
676
|
_addCheck(t) {
|
|
@@ -682,79 +682,79 @@ var mt = class e extends z {
|
|
|
682
682
|
email(e) {
|
|
683
683
|
return this._addCheck({
|
|
684
684
|
kind: "email",
|
|
685
|
-
...
|
|
685
|
+
...L.errToObj(e)
|
|
686
686
|
});
|
|
687
687
|
}
|
|
688
688
|
url(e) {
|
|
689
689
|
return this._addCheck({
|
|
690
690
|
kind: "url",
|
|
691
|
-
...
|
|
691
|
+
...L.errToObj(e)
|
|
692
692
|
});
|
|
693
693
|
}
|
|
694
694
|
emoji(e) {
|
|
695
695
|
return this._addCheck({
|
|
696
696
|
kind: "emoji",
|
|
697
|
-
...
|
|
697
|
+
...L.errToObj(e)
|
|
698
698
|
});
|
|
699
699
|
}
|
|
700
700
|
uuid(e) {
|
|
701
701
|
return this._addCheck({
|
|
702
702
|
kind: "uuid",
|
|
703
|
-
...
|
|
703
|
+
...L.errToObj(e)
|
|
704
704
|
});
|
|
705
705
|
}
|
|
706
706
|
nanoid(e) {
|
|
707
707
|
return this._addCheck({
|
|
708
708
|
kind: "nanoid",
|
|
709
|
-
...
|
|
709
|
+
...L.errToObj(e)
|
|
710
710
|
});
|
|
711
711
|
}
|
|
712
712
|
cuid(e) {
|
|
713
713
|
return this._addCheck({
|
|
714
714
|
kind: "cuid",
|
|
715
|
-
...
|
|
715
|
+
...L.errToObj(e)
|
|
716
716
|
});
|
|
717
717
|
}
|
|
718
718
|
cuid2(e) {
|
|
719
719
|
return this._addCheck({
|
|
720
720
|
kind: "cuid2",
|
|
721
|
-
...
|
|
721
|
+
...L.errToObj(e)
|
|
722
722
|
});
|
|
723
723
|
}
|
|
724
724
|
ulid(e) {
|
|
725
725
|
return this._addCheck({
|
|
726
726
|
kind: "ulid",
|
|
727
|
-
...
|
|
727
|
+
...L.errToObj(e)
|
|
728
728
|
});
|
|
729
729
|
}
|
|
730
730
|
base64(e) {
|
|
731
731
|
return this._addCheck({
|
|
732
732
|
kind: "base64",
|
|
733
|
-
...
|
|
733
|
+
...L.errToObj(e)
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
736
|
base64url(e) {
|
|
737
737
|
return this._addCheck({
|
|
738
738
|
kind: "base64url",
|
|
739
|
-
...
|
|
739
|
+
...L.errToObj(e)
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
742
|
jwt(e) {
|
|
743
743
|
return this._addCheck({
|
|
744
744
|
kind: "jwt",
|
|
745
|
-
...
|
|
745
|
+
...L.errToObj(e)
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
748
|
ip(e) {
|
|
749
749
|
return this._addCheck({
|
|
750
750
|
kind: "ip",
|
|
751
|
-
...
|
|
751
|
+
...L.errToObj(e)
|
|
752
752
|
});
|
|
753
753
|
}
|
|
754
754
|
cidr(e) {
|
|
755
755
|
return this._addCheck({
|
|
756
756
|
kind: "cidr",
|
|
757
|
-
...
|
|
757
|
+
...L.errToObj(e)
|
|
758
758
|
});
|
|
759
759
|
}
|
|
760
760
|
datetime(e) {
|
|
@@ -769,7 +769,7 @@ var mt = class e extends z {
|
|
|
769
769
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
770
770
|
offset: e?.offset ?? !1,
|
|
771
771
|
local: e?.local ?? !1,
|
|
772
|
-
...
|
|
772
|
+
...L.errToObj(e?.message)
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
775
|
date(e) {
|
|
@@ -786,20 +786,20 @@ var mt = class e extends z {
|
|
|
786
786
|
}) : this._addCheck({
|
|
787
787
|
kind: "time",
|
|
788
788
|
precision: e?.precision === void 0 ? null : e?.precision,
|
|
789
|
-
...
|
|
789
|
+
...L.errToObj(e?.message)
|
|
790
790
|
});
|
|
791
791
|
}
|
|
792
792
|
duration(e) {
|
|
793
793
|
return this._addCheck({
|
|
794
794
|
kind: "duration",
|
|
795
|
-
...
|
|
795
|
+
...L.errToObj(e)
|
|
796
796
|
});
|
|
797
797
|
}
|
|
798
798
|
regex(e, t) {
|
|
799
799
|
return this._addCheck({
|
|
800
800
|
kind: "regex",
|
|
801
801
|
regex: e,
|
|
802
|
-
...
|
|
802
|
+
...L.errToObj(t)
|
|
803
803
|
});
|
|
804
804
|
}
|
|
805
805
|
includes(e, t) {
|
|
@@ -807,46 +807,46 @@ var mt = class e extends z {
|
|
|
807
807
|
kind: "includes",
|
|
808
808
|
value: e,
|
|
809
809
|
position: t?.position,
|
|
810
|
-
...
|
|
810
|
+
...L.errToObj(t?.message)
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
813
|
startsWith(e, t) {
|
|
814
814
|
return this._addCheck({
|
|
815
815
|
kind: "startsWith",
|
|
816
816
|
value: e,
|
|
817
|
-
...
|
|
817
|
+
...L.errToObj(t)
|
|
818
818
|
});
|
|
819
819
|
}
|
|
820
820
|
endsWith(e, t) {
|
|
821
821
|
return this._addCheck({
|
|
822
822
|
kind: "endsWith",
|
|
823
823
|
value: e,
|
|
824
|
-
...
|
|
824
|
+
...L.errToObj(t)
|
|
825
825
|
});
|
|
826
826
|
}
|
|
827
827
|
min(e, t) {
|
|
828
828
|
return this._addCheck({
|
|
829
829
|
kind: "min",
|
|
830
830
|
value: e,
|
|
831
|
-
...
|
|
831
|
+
...L.errToObj(t)
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
834
|
max(e, t) {
|
|
835
835
|
return this._addCheck({
|
|
836
836
|
kind: "max",
|
|
837
837
|
value: e,
|
|
838
|
-
...
|
|
838
|
+
...L.errToObj(t)
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
841
|
length(e, t) {
|
|
842
842
|
return this._addCheck({
|
|
843
843
|
kind: "length",
|
|
844
844
|
value: e,
|
|
845
|
-
...
|
|
845
|
+
...L.errToObj(t)
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
848
|
nonempty(e) {
|
|
849
|
-
return this.min(1,
|
|
849
|
+
return this.min(1, L.errToObj(e));
|
|
850
850
|
}
|
|
851
851
|
trim() {
|
|
852
852
|
return new e({
|
|
@@ -925,54 +925,54 @@ var mt = class e extends z {
|
|
|
925
925
|
return e;
|
|
926
926
|
}
|
|
927
927
|
};
|
|
928
|
-
|
|
928
|
+
pt.create = (e) => new pt({
|
|
929
929
|
checks: [],
|
|
930
|
-
typeName:
|
|
930
|
+
typeName: K.ZodString,
|
|
931
931
|
coerce: e?.coerce ?? !1,
|
|
932
|
-
...
|
|
932
|
+
...z(e)
|
|
933
933
|
});
|
|
934
|
-
function
|
|
934
|
+
function mt(e, t) {
|
|
935
935
|
let n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, i = n > r ? n : r;
|
|
936
936
|
return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / 10 ** i;
|
|
937
937
|
}
|
|
938
|
-
var
|
|
938
|
+
var ht = class e extends B {
|
|
939
939
|
constructor() {
|
|
940
940
|
super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
|
|
941
941
|
}
|
|
942
942
|
_parse(e) {
|
|
943
943
|
if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== S.number) {
|
|
944
944
|
let t = this._getOrReturnCtx(e);
|
|
945
|
-
return
|
|
945
|
+
return N(t, {
|
|
946
946
|
code: x.invalid_type,
|
|
947
947
|
expected: S.number,
|
|
948
948
|
received: t.parsedType
|
|
949
|
-
}),
|
|
949
|
+
}), F;
|
|
950
950
|
}
|
|
951
|
-
let t, n = new
|
|
952
|
-
for (let r of this._def.checks) r.kind === "int" ? y.isInteger(e.data) || (t = this._getOrReturnCtx(e, t),
|
|
951
|
+
let t, n = new P();
|
|
952
|
+
for (let r of this._def.checks) r.kind === "int" ? y.isInteger(e.data) || (t = this._getOrReturnCtx(e, t), N(t, {
|
|
953
953
|
code: x.invalid_type,
|
|
954
954
|
expected: "integer",
|
|
955
955
|
received: "float",
|
|
956
956
|
message: r.message
|
|
957
|
-
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
957
|
+
}), n.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), N(t, {
|
|
958
958
|
code: x.too_small,
|
|
959
959
|
minimum: r.value,
|
|
960
960
|
type: "number",
|
|
961
961
|
inclusive: r.inclusive,
|
|
962
962
|
exact: !1,
|
|
963
963
|
message: r.message
|
|
964
|
-
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
964
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), N(t, {
|
|
965
965
|
code: x.too_big,
|
|
966
966
|
maximum: r.value,
|
|
967
967
|
type: "number",
|
|
968
968
|
inclusive: r.inclusive,
|
|
969
969
|
exact: !1,
|
|
970
970
|
message: r.message
|
|
971
|
-
}), n.dirty()) : r.kind === "multipleOf" ?
|
|
971
|
+
}), n.dirty()) : r.kind === "multipleOf" ? mt(e.data, r.value) !== 0 && (t = this._getOrReturnCtx(e, t), N(t, {
|
|
972
972
|
code: x.not_multiple_of,
|
|
973
973
|
multipleOf: r.value,
|
|
974
974
|
message: r.message
|
|
975
|
-
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t),
|
|
975
|
+
}), n.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (t = this._getOrReturnCtx(e, t), N(t, {
|
|
976
976
|
code: x.not_finite,
|
|
977
977
|
message: r.message
|
|
978
978
|
}), n.dirty()) : y.assertNever(r);
|
|
@@ -982,16 +982,16 @@ var gt = class e extends z {
|
|
|
982
982
|
};
|
|
983
983
|
}
|
|
984
984
|
gte(e, t) {
|
|
985
|
-
return this.setLimit("min", e, !0,
|
|
985
|
+
return this.setLimit("min", e, !0, L.toString(t));
|
|
986
986
|
}
|
|
987
987
|
gt(e, t) {
|
|
988
|
-
return this.setLimit("min", e, !1,
|
|
988
|
+
return this.setLimit("min", e, !1, L.toString(t));
|
|
989
989
|
}
|
|
990
990
|
lte(e, t) {
|
|
991
|
-
return this.setLimit("max", e, !0,
|
|
991
|
+
return this.setLimit("max", e, !0, L.toString(t));
|
|
992
992
|
}
|
|
993
993
|
lt(e, t) {
|
|
994
|
-
return this.setLimit("max", e, !1,
|
|
994
|
+
return this.setLimit("max", e, !1, L.toString(t));
|
|
995
995
|
}
|
|
996
996
|
setLimit(t, n, r, i) {
|
|
997
997
|
return new e({
|
|
@@ -1000,7 +1000,7 @@ var gt = class e extends z {
|
|
|
1000
1000
|
kind: t,
|
|
1001
1001
|
value: n,
|
|
1002
1002
|
inclusive: r,
|
|
1003
|
-
message:
|
|
1003
|
+
message: L.toString(i)
|
|
1004
1004
|
}]
|
|
1005
1005
|
});
|
|
1006
1006
|
}
|
|
@@ -1013,7 +1013,7 @@ var gt = class e extends z {
|
|
|
1013
1013
|
int(e) {
|
|
1014
1014
|
return this._addCheck({
|
|
1015
1015
|
kind: "int",
|
|
1016
|
-
message:
|
|
1016
|
+
message: L.toString(e)
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
1019
|
positive(e) {
|
|
@@ -1021,7 +1021,7 @@ var gt = class e extends z {
|
|
|
1021
1021
|
kind: "min",
|
|
1022
1022
|
value: 0,
|
|
1023
1023
|
inclusive: !1,
|
|
1024
|
-
message:
|
|
1024
|
+
message: L.toString(e)
|
|
1025
1025
|
});
|
|
1026
1026
|
}
|
|
1027
1027
|
negative(e) {
|
|
@@ -1029,7 +1029,7 @@ var gt = class e extends z {
|
|
|
1029
1029
|
kind: "max",
|
|
1030
1030
|
value: 0,
|
|
1031
1031
|
inclusive: !1,
|
|
1032
|
-
message:
|
|
1032
|
+
message: L.toString(e)
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
1035
|
nonpositive(e) {
|
|
@@ -1037,7 +1037,7 @@ var gt = class e extends z {
|
|
|
1037
1037
|
kind: "max",
|
|
1038
1038
|
value: 0,
|
|
1039
1039
|
inclusive: !0,
|
|
1040
|
-
message:
|
|
1040
|
+
message: L.toString(e)
|
|
1041
1041
|
});
|
|
1042
1042
|
}
|
|
1043
1043
|
nonnegative(e) {
|
|
@@ -1045,20 +1045,20 @@ var gt = class e extends z {
|
|
|
1045
1045
|
kind: "min",
|
|
1046
1046
|
value: 0,
|
|
1047
1047
|
inclusive: !0,
|
|
1048
|
-
message:
|
|
1048
|
+
message: L.toString(e)
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
1051
|
multipleOf(e, t) {
|
|
1052
1052
|
return this._addCheck({
|
|
1053
1053
|
kind: "multipleOf",
|
|
1054
1054
|
value: e,
|
|
1055
|
-
message:
|
|
1055
|
+
message: L.toString(t)
|
|
1056
1056
|
});
|
|
1057
1057
|
}
|
|
1058
1058
|
finite(e) {
|
|
1059
1059
|
return this._addCheck({
|
|
1060
1060
|
kind: "finite",
|
|
1061
|
-
message:
|
|
1061
|
+
message: L.toString(e)
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
1064
|
safe(e) {
|
|
@@ -1066,12 +1066,12 @@ var gt = class e extends z {
|
|
|
1066
1066
|
kind: "min",
|
|
1067
1067
|
inclusive: !0,
|
|
1068
1068
|
value: -(2 ** 53 - 1),
|
|
1069
|
-
message:
|
|
1069
|
+
message: L.toString(e)
|
|
1070
1070
|
})._addCheck({
|
|
1071
1071
|
kind: "max",
|
|
1072
1072
|
inclusive: !0,
|
|
1073
1073
|
value: 2 ** 53 - 1,
|
|
1074
|
-
message:
|
|
1074
|
+
message: L.toString(e)
|
|
1075
1075
|
});
|
|
1076
1076
|
}
|
|
1077
1077
|
get minValue() {
|
|
@@ -1094,13 +1094,13 @@ var gt = class e extends z {
|
|
|
1094
1094
|
return Number.isFinite(t) && Number.isFinite(e);
|
|
1095
1095
|
}
|
|
1096
1096
|
};
|
|
1097
|
-
|
|
1097
|
+
ht.create = (e) => new ht({
|
|
1098
1098
|
checks: [],
|
|
1099
|
-
typeName:
|
|
1099
|
+
typeName: K.ZodNumber,
|
|
1100
1100
|
coerce: e?.coerce || !1,
|
|
1101
|
-
...
|
|
1101
|
+
...z(e)
|
|
1102
1102
|
});
|
|
1103
|
-
var
|
|
1103
|
+
var gt = class e extends B {
|
|
1104
1104
|
constructor() {
|
|
1105
1105
|
super(...arguments), this.min = this.gte, this.max = this.lte;
|
|
1106
1106
|
}
|
|
@@ -1111,20 +1111,20 @@ var _t = class e extends z {
|
|
|
1111
1111
|
return this._getInvalidInput(e);
|
|
1112
1112
|
}
|
|
1113
1113
|
if (this._getType(e) !== S.bigint) return this._getInvalidInput(e);
|
|
1114
|
-
let t, n = new
|
|
1115
|
-
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1114
|
+
let t, n = new P();
|
|
1115
|
+
for (let r of this._def.checks) r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (t = this._getOrReturnCtx(e, t), N(t, {
|
|
1116
1116
|
code: x.too_small,
|
|
1117
1117
|
type: "bigint",
|
|
1118
1118
|
minimum: r.value,
|
|
1119
1119
|
inclusive: r.inclusive,
|
|
1120
1120
|
message: r.message
|
|
1121
|
-
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t),
|
|
1121
|
+
}), n.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (t = this._getOrReturnCtx(e, t), N(t, {
|
|
1122
1122
|
code: x.too_big,
|
|
1123
1123
|
type: "bigint",
|
|
1124
1124
|
maximum: r.value,
|
|
1125
1125
|
inclusive: r.inclusive,
|
|
1126
1126
|
message: r.message
|
|
1127
|
-
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t),
|
|
1127
|
+
}), n.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (t = this._getOrReturnCtx(e, t), N(t, {
|
|
1128
1128
|
code: x.not_multiple_of,
|
|
1129
1129
|
multipleOf: r.value,
|
|
1130
1130
|
message: r.message
|
|
@@ -1136,23 +1136,23 @@ var _t = class e extends z {
|
|
|
1136
1136
|
}
|
|
1137
1137
|
_getInvalidInput(e) {
|
|
1138
1138
|
let t = this._getOrReturnCtx(e);
|
|
1139
|
-
return
|
|
1139
|
+
return N(t, {
|
|
1140
1140
|
code: x.invalid_type,
|
|
1141
1141
|
expected: S.bigint,
|
|
1142
1142
|
received: t.parsedType
|
|
1143
|
-
}),
|
|
1143
|
+
}), F;
|
|
1144
1144
|
}
|
|
1145
1145
|
gte(e, t) {
|
|
1146
|
-
return this.setLimit("min", e, !0,
|
|
1146
|
+
return this.setLimit("min", e, !0, L.toString(t));
|
|
1147
1147
|
}
|
|
1148
1148
|
gt(e, t) {
|
|
1149
|
-
return this.setLimit("min", e, !1,
|
|
1149
|
+
return this.setLimit("min", e, !1, L.toString(t));
|
|
1150
1150
|
}
|
|
1151
1151
|
lte(e, t) {
|
|
1152
|
-
return this.setLimit("max", e, !0,
|
|
1152
|
+
return this.setLimit("max", e, !0, L.toString(t));
|
|
1153
1153
|
}
|
|
1154
1154
|
lt(e, t) {
|
|
1155
|
-
return this.setLimit("max", e, !1,
|
|
1155
|
+
return this.setLimit("max", e, !1, L.toString(t));
|
|
1156
1156
|
}
|
|
1157
1157
|
setLimit(t, n, r, i) {
|
|
1158
1158
|
return new e({
|
|
@@ -1161,7 +1161,7 @@ var _t = class e extends z {
|
|
|
1161
1161
|
kind: t,
|
|
1162
1162
|
value: n,
|
|
1163
1163
|
inclusive: r,
|
|
1164
|
-
message:
|
|
1164
|
+
message: L.toString(i)
|
|
1165
1165
|
}]
|
|
1166
1166
|
});
|
|
1167
1167
|
}
|
|
@@ -1176,7 +1176,7 @@ var _t = class e extends z {
|
|
|
1176
1176
|
kind: "min",
|
|
1177
1177
|
value: BigInt(0),
|
|
1178
1178
|
inclusive: !1,
|
|
1179
|
-
message:
|
|
1179
|
+
message: L.toString(e)
|
|
1180
1180
|
});
|
|
1181
1181
|
}
|
|
1182
1182
|
negative(e) {
|
|
@@ -1184,7 +1184,7 @@ var _t = class e extends z {
|
|
|
1184
1184
|
kind: "max",
|
|
1185
1185
|
value: BigInt(0),
|
|
1186
1186
|
inclusive: !1,
|
|
1187
|
-
message:
|
|
1187
|
+
message: L.toString(e)
|
|
1188
1188
|
});
|
|
1189
1189
|
}
|
|
1190
1190
|
nonpositive(e) {
|
|
@@ -1192,7 +1192,7 @@ var _t = class e extends z {
|
|
|
1192
1192
|
kind: "max",
|
|
1193
1193
|
value: BigInt(0),
|
|
1194
1194
|
inclusive: !0,
|
|
1195
|
-
message:
|
|
1195
|
+
message: L.toString(e)
|
|
1196
1196
|
});
|
|
1197
1197
|
}
|
|
1198
1198
|
nonnegative(e) {
|
|
@@ -1200,14 +1200,14 @@ var _t = class e extends z {
|
|
|
1200
1200
|
kind: "min",
|
|
1201
1201
|
value: BigInt(0),
|
|
1202
1202
|
inclusive: !0,
|
|
1203
|
-
message:
|
|
1203
|
+
message: L.toString(e)
|
|
1204
1204
|
});
|
|
1205
1205
|
}
|
|
1206
1206
|
multipleOf(e, t) {
|
|
1207
1207
|
return this._addCheck({
|
|
1208
1208
|
kind: "multipleOf",
|
|
1209
1209
|
value: e,
|
|
1210
|
-
message:
|
|
1210
|
+
message: L.toString(t)
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
1213
|
get minValue() {
|
|
@@ -1221,50 +1221,50 @@ var _t = class e extends z {
|
|
|
1221
1221
|
return e;
|
|
1222
1222
|
}
|
|
1223
1223
|
};
|
|
1224
|
-
|
|
1224
|
+
gt.create = (e) => new gt({
|
|
1225
1225
|
checks: [],
|
|
1226
|
-
typeName:
|
|
1226
|
+
typeName: K.ZodBigInt,
|
|
1227
1227
|
coerce: e?.coerce ?? !1,
|
|
1228
|
-
...
|
|
1228
|
+
...z(e)
|
|
1229
1229
|
});
|
|
1230
|
-
var
|
|
1230
|
+
var _t = class extends B {
|
|
1231
1231
|
_parse(e) {
|
|
1232
1232
|
if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== S.boolean) {
|
|
1233
1233
|
let t = this._getOrReturnCtx(e);
|
|
1234
|
-
return
|
|
1234
|
+
return N(t, {
|
|
1235
1235
|
code: x.invalid_type,
|
|
1236
1236
|
expected: S.boolean,
|
|
1237
1237
|
received: t.parsedType
|
|
1238
|
-
}),
|
|
1238
|
+
}), F;
|
|
1239
1239
|
}
|
|
1240
|
-
return
|
|
1240
|
+
return I(e.data);
|
|
1241
1241
|
}
|
|
1242
1242
|
};
|
|
1243
|
-
|
|
1244
|
-
typeName:
|
|
1243
|
+
_t.create = (e) => new _t({
|
|
1244
|
+
typeName: K.ZodBoolean,
|
|
1245
1245
|
coerce: e?.coerce || !1,
|
|
1246
|
-
...
|
|
1246
|
+
...z(e)
|
|
1247
1247
|
});
|
|
1248
|
-
var
|
|
1248
|
+
var vt = class e extends B {
|
|
1249
1249
|
_parse(e) {
|
|
1250
1250
|
if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== S.date) {
|
|
1251
1251
|
let t = this._getOrReturnCtx(e);
|
|
1252
|
-
return
|
|
1252
|
+
return N(t, {
|
|
1253
1253
|
code: x.invalid_type,
|
|
1254
1254
|
expected: S.date,
|
|
1255
1255
|
received: t.parsedType
|
|
1256
|
-
}),
|
|
1256
|
+
}), F;
|
|
1257
1257
|
}
|
|
1258
|
-
if (Number.isNaN(e.data.getTime())) return
|
|
1259
|
-
let t = new
|
|
1260
|
-
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n),
|
|
1258
|
+
if (Number.isNaN(e.data.getTime())) return N(this._getOrReturnCtx(e), { code: x.invalid_date }), F;
|
|
1259
|
+
let t = new P(), n;
|
|
1260
|
+
for (let r of this._def.checks) r.kind === "min" ? e.data.getTime() < r.value && (n = this._getOrReturnCtx(e, n), N(n, {
|
|
1261
1261
|
code: x.too_small,
|
|
1262
1262
|
message: r.message,
|
|
1263
1263
|
inclusive: !0,
|
|
1264
1264
|
exact: !1,
|
|
1265
1265
|
minimum: r.value,
|
|
1266
1266
|
type: "date"
|
|
1267
|
-
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n),
|
|
1267
|
+
}), t.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (n = this._getOrReturnCtx(e, n), N(n, {
|
|
1268
1268
|
code: x.too_big,
|
|
1269
1269
|
message: r.message,
|
|
1270
1270
|
inclusive: !0,
|
|
@@ -1287,14 +1287,14 @@ var yt = class e extends z {
|
|
|
1287
1287
|
return this._addCheck({
|
|
1288
1288
|
kind: "min",
|
|
1289
1289
|
value: e.getTime(),
|
|
1290
|
-
message:
|
|
1290
|
+
message: L.toString(t)
|
|
1291
1291
|
});
|
|
1292
1292
|
}
|
|
1293
1293
|
max(e, t) {
|
|
1294
1294
|
return this._addCheck({
|
|
1295
1295
|
kind: "max",
|
|
1296
1296
|
value: e.getTime(),
|
|
1297
|
-
message:
|
|
1297
|
+
message: L.toString(t)
|
|
1298
1298
|
});
|
|
1299
1299
|
}
|
|
1300
1300
|
get minDate() {
|
|
@@ -1308,129 +1308,129 @@ var yt = class e extends z {
|
|
|
1308
1308
|
return e == null ? null : new Date(e);
|
|
1309
1309
|
}
|
|
1310
1310
|
};
|
|
1311
|
-
|
|
1311
|
+
vt.create = (e) => new vt({
|
|
1312
1312
|
checks: [],
|
|
1313
1313
|
coerce: e?.coerce || !1,
|
|
1314
|
-
typeName:
|
|
1315
|
-
...
|
|
1314
|
+
typeName: K.ZodDate,
|
|
1315
|
+
...z(e)
|
|
1316
1316
|
});
|
|
1317
|
-
var
|
|
1317
|
+
var yt = class extends B {
|
|
1318
1318
|
_parse(e) {
|
|
1319
1319
|
if (this._getType(e) !== S.symbol) {
|
|
1320
1320
|
let t = this._getOrReturnCtx(e);
|
|
1321
|
-
return
|
|
1321
|
+
return N(t, {
|
|
1322
1322
|
code: x.invalid_type,
|
|
1323
1323
|
expected: S.symbol,
|
|
1324
1324
|
received: t.parsedType
|
|
1325
|
-
}),
|
|
1325
|
+
}), F;
|
|
1326
1326
|
}
|
|
1327
|
-
return
|
|
1327
|
+
return I(e.data);
|
|
1328
1328
|
}
|
|
1329
1329
|
};
|
|
1330
|
-
|
|
1331
|
-
typeName:
|
|
1332
|
-
...
|
|
1330
|
+
yt.create = (e) => new yt({
|
|
1331
|
+
typeName: K.ZodSymbol,
|
|
1332
|
+
...z(e)
|
|
1333
1333
|
});
|
|
1334
|
-
var
|
|
1334
|
+
var bt = class extends B {
|
|
1335
1335
|
_parse(e) {
|
|
1336
1336
|
if (this._getType(e) !== S.undefined) {
|
|
1337
1337
|
let t = this._getOrReturnCtx(e);
|
|
1338
|
-
return
|
|
1338
|
+
return N(t, {
|
|
1339
1339
|
code: x.invalid_type,
|
|
1340
1340
|
expected: S.undefined,
|
|
1341
1341
|
received: t.parsedType
|
|
1342
|
-
}),
|
|
1342
|
+
}), F;
|
|
1343
1343
|
}
|
|
1344
|
-
return
|
|
1344
|
+
return I(e.data);
|
|
1345
1345
|
}
|
|
1346
1346
|
};
|
|
1347
|
-
|
|
1348
|
-
typeName:
|
|
1349
|
-
...
|
|
1347
|
+
bt.create = (e) => new bt({
|
|
1348
|
+
typeName: K.ZodUndefined,
|
|
1349
|
+
...z(e)
|
|
1350
1350
|
});
|
|
1351
|
-
var
|
|
1351
|
+
var xt = class extends B {
|
|
1352
1352
|
_parse(e) {
|
|
1353
1353
|
if (this._getType(e) !== S.null) {
|
|
1354
1354
|
let t = this._getOrReturnCtx(e);
|
|
1355
|
-
return
|
|
1355
|
+
return N(t, {
|
|
1356
1356
|
code: x.invalid_type,
|
|
1357
1357
|
expected: S.null,
|
|
1358
1358
|
received: t.parsedType
|
|
1359
|
-
}),
|
|
1359
|
+
}), F;
|
|
1360
1360
|
}
|
|
1361
|
-
return
|
|
1361
|
+
return I(e.data);
|
|
1362
1362
|
}
|
|
1363
1363
|
};
|
|
1364
|
-
|
|
1365
|
-
typeName:
|
|
1366
|
-
...
|
|
1364
|
+
xt.create = (e) => new xt({
|
|
1365
|
+
typeName: K.ZodNull,
|
|
1366
|
+
...z(e)
|
|
1367
1367
|
});
|
|
1368
|
-
var
|
|
1368
|
+
var St = class extends B {
|
|
1369
1369
|
constructor() {
|
|
1370
1370
|
super(...arguments), this._any = !0;
|
|
1371
1371
|
}
|
|
1372
1372
|
_parse(e) {
|
|
1373
|
-
return
|
|
1373
|
+
return I(e.data);
|
|
1374
1374
|
}
|
|
1375
1375
|
};
|
|
1376
|
-
|
|
1377
|
-
typeName:
|
|
1378
|
-
...
|
|
1376
|
+
St.create = (e) => new St({
|
|
1377
|
+
typeName: K.ZodAny,
|
|
1378
|
+
...z(e)
|
|
1379
1379
|
});
|
|
1380
|
-
var
|
|
1380
|
+
var Ct = class extends B {
|
|
1381
1381
|
constructor() {
|
|
1382
1382
|
super(...arguments), this._unknown = !0;
|
|
1383
1383
|
}
|
|
1384
1384
|
_parse(e) {
|
|
1385
|
-
return
|
|
1385
|
+
return I(e.data);
|
|
1386
1386
|
}
|
|
1387
1387
|
};
|
|
1388
|
-
|
|
1389
|
-
typeName:
|
|
1390
|
-
...
|
|
1388
|
+
Ct.create = (e) => new Ct({
|
|
1389
|
+
typeName: K.ZodUnknown,
|
|
1390
|
+
...z(e)
|
|
1391
1391
|
});
|
|
1392
|
-
var
|
|
1392
|
+
var V = class extends B {
|
|
1393
1393
|
_parse(e) {
|
|
1394
1394
|
let t = this._getOrReturnCtx(e);
|
|
1395
|
-
return
|
|
1395
|
+
return N(t, {
|
|
1396
1396
|
code: x.invalid_type,
|
|
1397
1397
|
expected: S.never,
|
|
1398
1398
|
received: t.parsedType
|
|
1399
|
-
}),
|
|
1399
|
+
}), F;
|
|
1400
1400
|
}
|
|
1401
1401
|
};
|
|
1402
|
-
|
|
1403
|
-
typeName:
|
|
1404
|
-
...
|
|
1402
|
+
V.create = (e) => new V({
|
|
1403
|
+
typeName: K.ZodNever,
|
|
1404
|
+
...z(e)
|
|
1405
1405
|
});
|
|
1406
|
-
var
|
|
1406
|
+
var wt = class extends B {
|
|
1407
1407
|
_parse(e) {
|
|
1408
1408
|
if (this._getType(e) !== S.undefined) {
|
|
1409
1409
|
let t = this._getOrReturnCtx(e);
|
|
1410
|
-
return
|
|
1410
|
+
return N(t, {
|
|
1411
1411
|
code: x.invalid_type,
|
|
1412
1412
|
expected: S.void,
|
|
1413
1413
|
received: t.parsedType
|
|
1414
|
-
}),
|
|
1414
|
+
}), F;
|
|
1415
1415
|
}
|
|
1416
|
-
return
|
|
1416
|
+
return I(e.data);
|
|
1417
1417
|
}
|
|
1418
1418
|
};
|
|
1419
|
-
|
|
1420
|
-
typeName:
|
|
1421
|
-
...
|
|
1419
|
+
wt.create = (e) => new wt({
|
|
1420
|
+
typeName: K.ZodVoid,
|
|
1421
|
+
...z(e)
|
|
1422
1422
|
});
|
|
1423
|
-
var
|
|
1423
|
+
var Tt = class e extends B {
|
|
1424
1424
|
_parse(e) {
|
|
1425
1425
|
let { ctx: t, status: n } = this._processInputParams(e), r = this._def;
|
|
1426
|
-
if (t.parsedType !== S.array) return
|
|
1426
|
+
if (t.parsedType !== S.array) return N(t, {
|
|
1427
1427
|
code: x.invalid_type,
|
|
1428
1428
|
expected: S.array,
|
|
1429
1429
|
received: t.parsedType
|
|
1430
|
-
}),
|
|
1430
|
+
}), F;
|
|
1431
1431
|
if (r.exactLength !== null) {
|
|
1432
1432
|
let e = t.data.length > r.exactLength.value, i = t.data.length < r.exactLength.value;
|
|
1433
|
-
(e || i) && (
|
|
1433
|
+
(e || i) && (N(t, {
|
|
1434
1434
|
code: e ? x.too_big : x.too_small,
|
|
1435
1435
|
minimum: i ? r.exactLength.value : void 0,
|
|
1436
1436
|
maximum: e ? r.exactLength.value : void 0,
|
|
@@ -1440,23 +1440,23 @@ var Et = class e extends z {
|
|
|
1440
1440
|
message: r.exactLength.message
|
|
1441
1441
|
}), n.dirty());
|
|
1442
1442
|
}
|
|
1443
|
-
if (r.minLength !== null && t.data.length < r.minLength.value && (
|
|
1443
|
+
if (r.minLength !== null && t.data.length < r.minLength.value && (N(t, {
|
|
1444
1444
|
code: x.too_small,
|
|
1445
1445
|
minimum: r.minLength.value,
|
|
1446
1446
|
type: "array",
|
|
1447
1447
|
inclusive: !0,
|
|
1448
1448
|
exact: !1,
|
|
1449
1449
|
message: r.minLength.message
|
|
1450
|
-
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (
|
|
1450
|
+
}), n.dirty()), r.maxLength !== null && t.data.length > r.maxLength.value && (N(t, {
|
|
1451
1451
|
code: x.too_big,
|
|
1452
1452
|
maximum: r.maxLength.value,
|
|
1453
1453
|
type: "array",
|
|
1454
1454
|
inclusive: !0,
|
|
1455
1455
|
exact: !1,
|
|
1456
1456
|
message: r.maxLength.message
|
|
1457
|
-
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new
|
|
1458
|
-
let i = [...t.data].map((e, n) => r.type._parseSync(new
|
|
1459
|
-
return
|
|
1457
|
+
}), n.dirty()), t.common.async) return Promise.all([...t.data].map((e, n) => r.type._parseAsync(new R(t, e, t.path, n)))).then((e) => P.mergeArray(n, e));
|
|
1458
|
+
let i = [...t.data].map((e, n) => r.type._parseSync(new R(t, e, t.path, n)));
|
|
1459
|
+
return P.mergeArray(n, i);
|
|
1460
1460
|
}
|
|
1461
1461
|
get element() {
|
|
1462
1462
|
return this._def.type;
|
|
@@ -1466,7 +1466,7 @@ var Et = class e extends z {
|
|
|
1466
1466
|
...this._def,
|
|
1467
1467
|
minLength: {
|
|
1468
1468
|
value: t,
|
|
1469
|
-
message:
|
|
1469
|
+
message: L.toString(n)
|
|
1470
1470
|
}
|
|
1471
1471
|
});
|
|
1472
1472
|
}
|
|
@@ -1475,7 +1475,7 @@ var Et = class e extends z {
|
|
|
1475
1475
|
...this._def,
|
|
1476
1476
|
maxLength: {
|
|
1477
1477
|
value: t,
|
|
1478
|
-
message:
|
|
1478
|
+
message: L.toString(n)
|
|
1479
1479
|
}
|
|
1480
1480
|
});
|
|
1481
1481
|
}
|
|
@@ -1484,7 +1484,7 @@ var Et = class e extends z {
|
|
|
1484
1484
|
...this._def,
|
|
1485
1485
|
exactLength: {
|
|
1486
1486
|
value: t,
|
|
1487
|
-
message:
|
|
1487
|
+
message: L.toString(n)
|
|
1488
1488
|
}
|
|
1489
1489
|
});
|
|
1490
1490
|
}
|
|
@@ -1492,35 +1492,35 @@ var Et = class e extends z {
|
|
|
1492
1492
|
return this.min(1, e);
|
|
1493
1493
|
}
|
|
1494
1494
|
};
|
|
1495
|
-
|
|
1495
|
+
Tt.create = (e, t) => new Tt({
|
|
1496
1496
|
type: e,
|
|
1497
1497
|
minLength: null,
|
|
1498
1498
|
maxLength: null,
|
|
1499
1499
|
exactLength: null,
|
|
1500
|
-
typeName:
|
|
1501
|
-
...
|
|
1500
|
+
typeName: K.ZodArray,
|
|
1501
|
+
...z(t)
|
|
1502
1502
|
});
|
|
1503
|
-
function
|
|
1504
|
-
if (e instanceof
|
|
1503
|
+
function Et(e) {
|
|
1504
|
+
if (e instanceof H) {
|
|
1505
1505
|
let t = {};
|
|
1506
1506
|
for (let n in e.shape) {
|
|
1507
1507
|
let r = e.shape[n];
|
|
1508
|
-
t[n] =
|
|
1508
|
+
t[n] = G.create(Et(r));
|
|
1509
1509
|
}
|
|
1510
|
-
return new
|
|
1510
|
+
return new H({
|
|
1511
1511
|
...e._def,
|
|
1512
1512
|
shape: () => t
|
|
1513
1513
|
});
|
|
1514
|
-
} else if (e instanceof
|
|
1514
|
+
} else if (e instanceof Tt) return new Tt({
|
|
1515
1515
|
...e._def,
|
|
1516
|
-
type:
|
|
1516
|
+
type: Et(e.element)
|
|
1517
1517
|
});
|
|
1518
|
-
else if (e instanceof
|
|
1519
|
-
else if (e instanceof
|
|
1520
|
-
else if (e instanceof
|
|
1518
|
+
else if (e instanceof G) return G.create(Et(e.unwrap()));
|
|
1519
|
+
else if (e instanceof Ht) return Ht.create(Et(e.unwrap()));
|
|
1520
|
+
else if (e instanceof jt) return jt.create(e.items.map((e) => Et(e)));
|
|
1521
1521
|
else return e;
|
|
1522
1522
|
}
|
|
1523
|
-
var
|
|
1523
|
+
var H = class e extends B {
|
|
1524
1524
|
constructor() {
|
|
1525
1525
|
super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
|
|
1526
1526
|
}
|
|
@@ -1535,14 +1535,14 @@ var V = class e extends z {
|
|
|
1535
1535
|
_parse(e) {
|
|
1536
1536
|
if (this._getType(e) !== S.object) {
|
|
1537
1537
|
let t = this._getOrReturnCtx(e);
|
|
1538
|
-
return
|
|
1538
|
+
return N(t, {
|
|
1539
1539
|
code: x.invalid_type,
|
|
1540
1540
|
expected: S.object,
|
|
1541
1541
|
received: t.parsedType
|
|
1542
|
-
}),
|
|
1542
|
+
}), F;
|
|
1543
1543
|
}
|
|
1544
1544
|
let { status: t, ctx: n } = this._processInputParams(e), { shape: r, keys: i } = this._getCached(), a = [];
|
|
1545
|
-
if (!(this._def.catchall instanceof
|
|
1545
|
+
if (!(this._def.catchall instanceof V && this._def.unknownKeys === "strip")) for (let e in n.data) i.includes(e) || a.push(e);
|
|
1546
1546
|
let o = [];
|
|
1547
1547
|
for (let e of i) {
|
|
1548
1548
|
let t = r[e], i = n.data[e];
|
|
@@ -1551,11 +1551,11 @@ var V = class e extends z {
|
|
|
1551
1551
|
status: "valid",
|
|
1552
1552
|
value: e
|
|
1553
1553
|
},
|
|
1554
|
-
value: t._parse(new
|
|
1554
|
+
value: t._parse(new R(n, i, n.path, e)),
|
|
1555
1555
|
alwaysSet: e in n.data
|
|
1556
1556
|
});
|
|
1557
1557
|
}
|
|
1558
|
-
if (this._def.catchall instanceof
|
|
1558
|
+
if (this._def.catchall instanceof V) {
|
|
1559
1559
|
let e = this._def.unknownKeys;
|
|
1560
1560
|
if (e === "passthrough") for (let e of a) o.push({
|
|
1561
1561
|
key: {
|
|
@@ -1567,7 +1567,7 @@ var V = class e extends z {
|
|
|
1567
1567
|
value: n.data[e]
|
|
1568
1568
|
}
|
|
1569
1569
|
});
|
|
1570
|
-
else if (e === "strict") a.length > 0 && (
|
|
1570
|
+
else if (e === "strict") a.length > 0 && (N(n, {
|
|
1571
1571
|
code: x.unrecognized_keys,
|
|
1572
1572
|
keys: a
|
|
1573
1573
|
}), t.dirty());
|
|
@@ -1581,7 +1581,7 @@ var V = class e extends z {
|
|
|
1581
1581
|
status: "valid",
|
|
1582
1582
|
value: t
|
|
1583
1583
|
},
|
|
1584
|
-
value: e._parse(new
|
|
1584
|
+
value: e._parse(new R(n, r, n.path, t)),
|
|
1585
1585
|
alwaysSet: t in n.data
|
|
1586
1586
|
});
|
|
1587
1587
|
}
|
|
@@ -1597,18 +1597,18 @@ var V = class e extends z {
|
|
|
1597
1597
|
});
|
|
1598
1598
|
}
|
|
1599
1599
|
return e;
|
|
1600
|
-
}).then((e) =>
|
|
1600
|
+
}).then((e) => P.mergeObjectSync(t, e)) : P.mergeObjectSync(t, o);
|
|
1601
1601
|
}
|
|
1602
1602
|
get shape() {
|
|
1603
1603
|
return this._def.shape();
|
|
1604
1604
|
}
|
|
1605
1605
|
strict(t) {
|
|
1606
|
-
return
|
|
1606
|
+
return L.errToObj, new e({
|
|
1607
1607
|
...this._def,
|
|
1608
1608
|
unknownKeys: "strict",
|
|
1609
1609
|
...t === void 0 ? {} : { errorMap: (e, n) => {
|
|
1610
1610
|
let r = this._def.errorMap?.(e, n).message ?? n.defaultError;
|
|
1611
|
-
return e.code === "unrecognized_keys" ? { message:
|
|
1611
|
+
return e.code === "unrecognized_keys" ? { message: L.errToObj(t).message ?? r } : { message: r };
|
|
1612
1612
|
} }
|
|
1613
1613
|
});
|
|
1614
1614
|
}
|
|
@@ -1641,7 +1641,7 @@ var V = class e extends z {
|
|
|
1641
1641
|
...this._def.shape(),
|
|
1642
1642
|
...t._def.shape()
|
|
1643
1643
|
}),
|
|
1644
|
-
typeName:
|
|
1644
|
+
typeName: K.ZodObject
|
|
1645
1645
|
});
|
|
1646
1646
|
}
|
|
1647
1647
|
setKey(e, t) {
|
|
@@ -1670,7 +1670,7 @@ var V = class e extends z {
|
|
|
1670
1670
|
});
|
|
1671
1671
|
}
|
|
1672
1672
|
deepPartial() {
|
|
1673
|
-
return
|
|
1673
|
+
return Et(this);
|
|
1674
1674
|
}
|
|
1675
1675
|
partial(t) {
|
|
1676
1676
|
let n = {};
|
|
@@ -1688,7 +1688,7 @@ var V = class e extends z {
|
|
|
1688
1688
|
for (let e of y.objectKeys(this.shape)) if (t && !t[e]) n[e] = this.shape[e];
|
|
1689
1689
|
else {
|
|
1690
1690
|
let t = this.shape[e];
|
|
1691
|
-
for (; t instanceof
|
|
1691
|
+
for (; t instanceof G;) t = t._def.innerType;
|
|
1692
1692
|
n[e] = t;
|
|
1693
1693
|
}
|
|
1694
1694
|
return new e({
|
|
@@ -1697,39 +1697,39 @@ var V = class e extends z {
|
|
|
1697
1697
|
});
|
|
1698
1698
|
}
|
|
1699
1699
|
keyof() {
|
|
1700
|
-
return
|
|
1700
|
+
return Rt(y.objectKeys(this.shape));
|
|
1701
1701
|
}
|
|
1702
1702
|
};
|
|
1703
|
-
|
|
1703
|
+
H.create = (e, t) => new H({
|
|
1704
1704
|
shape: () => e,
|
|
1705
1705
|
unknownKeys: "strip",
|
|
1706
|
-
catchall:
|
|
1707
|
-
typeName:
|
|
1708
|
-
...
|
|
1709
|
-
}),
|
|
1706
|
+
catchall: V.create(),
|
|
1707
|
+
typeName: K.ZodObject,
|
|
1708
|
+
...z(t)
|
|
1709
|
+
}), H.strictCreate = (e, t) => new H({
|
|
1710
1710
|
shape: () => e,
|
|
1711
1711
|
unknownKeys: "strict",
|
|
1712
|
-
catchall:
|
|
1713
|
-
typeName:
|
|
1714
|
-
...
|
|
1715
|
-
}),
|
|
1712
|
+
catchall: V.create(),
|
|
1713
|
+
typeName: K.ZodObject,
|
|
1714
|
+
...z(t)
|
|
1715
|
+
}), H.lazycreate = (e, t) => new H({
|
|
1716
1716
|
shape: e,
|
|
1717
1717
|
unknownKeys: "strip",
|
|
1718
|
-
catchall:
|
|
1719
|
-
typeName:
|
|
1720
|
-
...
|
|
1718
|
+
catchall: V.create(),
|
|
1719
|
+
typeName: K.ZodObject,
|
|
1720
|
+
...z(t)
|
|
1721
1721
|
});
|
|
1722
|
-
var
|
|
1722
|
+
var Dt = class extends B {
|
|
1723
1723
|
_parse(e) {
|
|
1724
1724
|
let { ctx: t } = this._processInputParams(e), n = this._def.options;
|
|
1725
1725
|
function r(e) {
|
|
1726
1726
|
for (let t of e) if (t.result.status === "valid") return t.result;
|
|
1727
1727
|
for (let n of e) if (n.result.status === "dirty") return t.common.issues.push(...n.ctx.common.issues), n.result;
|
|
1728
1728
|
let n = e.map((e) => new C(e.ctx.common.issues));
|
|
1729
|
-
return
|
|
1729
|
+
return N(t, {
|
|
1730
1730
|
code: x.invalid_union,
|
|
1731
1731
|
unionErrors: n
|
|
1732
|
-
}),
|
|
1732
|
+
}), F;
|
|
1733
1733
|
}
|
|
1734
1734
|
if (t.common.async) return Promise.all(n.map(async (e) => {
|
|
1735
1735
|
let n = {
|
|
@@ -1772,29 +1772,29 @@ var Ot = class extends z {
|
|
|
1772
1772
|
}
|
|
1773
1773
|
if (e) return t.common.issues.push(...e.ctx.common.issues), e.result;
|
|
1774
1774
|
let i = r.map((e) => new C(e));
|
|
1775
|
-
return
|
|
1775
|
+
return N(t, {
|
|
1776
1776
|
code: x.invalid_union,
|
|
1777
1777
|
unionErrors: i
|
|
1778
|
-
}),
|
|
1778
|
+
}), F;
|
|
1779
1779
|
}
|
|
1780
1780
|
}
|
|
1781
1781
|
get options() {
|
|
1782
1782
|
return this._def.options;
|
|
1783
1783
|
}
|
|
1784
1784
|
};
|
|
1785
|
-
|
|
1785
|
+
Dt.create = (e, t) => new Dt({
|
|
1786
1786
|
options: e,
|
|
1787
|
-
typeName:
|
|
1788
|
-
...
|
|
1787
|
+
typeName: K.ZodUnion,
|
|
1788
|
+
...z(t)
|
|
1789
1789
|
});
|
|
1790
|
-
var
|
|
1790
|
+
var U = (e) => e instanceof It ? U(e.schema) : e instanceof W ? U(e.innerType()) : e instanceof Lt ? [e.value] : e instanceof zt ? e.options : e instanceof Bt ? y.objectValues(e.enum) : e instanceof Ut ? U(e._def.innerType) : e instanceof bt ? [void 0] : e instanceof xt ? [null] : e instanceof G ? [void 0, ...U(e.unwrap())] : e instanceof Ht ? [null, ...U(e.unwrap())] : e instanceof Kt || e instanceof Jt ? U(e.unwrap()) : e instanceof Wt ? U(e._def.innerType) : [], Ot = class e extends B {
|
|
1791
1791
|
_parse(e) {
|
|
1792
1792
|
let { ctx: t } = this._processInputParams(e);
|
|
1793
|
-
if (t.parsedType !== S.object) return
|
|
1793
|
+
if (t.parsedType !== S.object) return N(t, {
|
|
1794
1794
|
code: x.invalid_type,
|
|
1795
1795
|
expected: S.object,
|
|
1796
1796
|
received: t.parsedType
|
|
1797
|
-
}),
|
|
1797
|
+
}), F;
|
|
1798
1798
|
let n = this.discriminator, r = t.data[n], i = this.optionsMap.get(r);
|
|
1799
1799
|
return i ? t.common.async ? i._parseAsync({
|
|
1800
1800
|
data: t.data,
|
|
@@ -1804,11 +1804,11 @@ var kt = (e) => e instanceof Rt ? kt(e.schema) : e instanceof H ? kt(e.innerType
|
|
|
1804
1804
|
data: t.data,
|
|
1805
1805
|
path: t.path,
|
|
1806
1806
|
parent: t
|
|
1807
|
-
}) : (
|
|
1807
|
+
}) : (N(t, {
|
|
1808
1808
|
code: x.invalid_union_discriminator,
|
|
1809
1809
|
options: Array.from(this.optionsMap.keys()),
|
|
1810
1810
|
path: [n]
|
|
1811
|
-
}),
|
|
1811
|
+
}), F);
|
|
1812
1812
|
}
|
|
1813
1813
|
get discriminator() {
|
|
1814
1814
|
return this._def.discriminator;
|
|
@@ -1822,7 +1822,7 @@ var kt = (e) => e instanceof Rt ? kt(e.schema) : e instanceof H ? kt(e.innerType
|
|
|
1822
1822
|
static create(t, n, r) {
|
|
1823
1823
|
let i = /* @__PURE__ */ new Map();
|
|
1824
1824
|
for (let e of n) {
|
|
1825
|
-
let n =
|
|
1825
|
+
let n = U(e.shape[t]);
|
|
1826
1826
|
if (!n.length) throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);
|
|
1827
1827
|
for (let r of n) {
|
|
1828
1828
|
if (i.has(r)) throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);
|
|
@@ -1830,15 +1830,15 @@ var kt = (e) => e instanceof Rt ? kt(e.schema) : e instanceof H ? kt(e.innerType
|
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
1832
|
return new e({
|
|
1833
|
-
typeName:
|
|
1833
|
+
typeName: K.ZodDiscriminatedUnion,
|
|
1834
1834
|
discriminator: t,
|
|
1835
1835
|
options: n,
|
|
1836
1836
|
optionsMap: i,
|
|
1837
|
-
...
|
|
1837
|
+
...z(r)
|
|
1838
1838
|
});
|
|
1839
1839
|
}
|
|
1840
1840
|
};
|
|
1841
|
-
function
|
|
1841
|
+
function kt(e, t) {
|
|
1842
1842
|
let n = b(e), r = b(t);
|
|
1843
1843
|
if (e === t) return {
|
|
1844
1844
|
valid: !0,
|
|
@@ -1850,7 +1850,7 @@ function jt(e, t) {
|
|
|
1850
1850
|
...t
|
|
1851
1851
|
};
|
|
1852
1852
|
for (let n of r) {
|
|
1853
|
-
let r =
|
|
1853
|
+
let r = kt(e[n], t[n]);
|
|
1854
1854
|
if (!r.valid) return { valid: !1 };
|
|
1855
1855
|
i[n] = r.data;
|
|
1856
1856
|
}
|
|
@@ -1862,7 +1862,7 @@ function jt(e, t) {
|
|
|
1862
1862
|
if (e.length !== t.length) return { valid: !1 };
|
|
1863
1863
|
let n = [];
|
|
1864
1864
|
for (let r = 0; r < e.length; r++) {
|
|
1865
|
-
let i = e[r], a = t[r], o =
|
|
1865
|
+
let i = e[r], a = t[r], o = kt(i, a);
|
|
1866
1866
|
if (!o.valid) return { valid: !1 };
|
|
1867
1867
|
n.push(o.data);
|
|
1868
1868
|
}
|
|
@@ -1876,15 +1876,15 @@ function jt(e, t) {
|
|
|
1876
1876
|
};
|
|
1877
1877
|
else return { valid: !1 };
|
|
1878
1878
|
}
|
|
1879
|
-
var
|
|
1879
|
+
var At = class extends B {
|
|
1880
1880
|
_parse(e) {
|
|
1881
1881
|
let { status: t, ctx: n } = this._processInputParams(e), r = (e, r) => {
|
|
1882
|
-
if (
|
|
1883
|
-
let i =
|
|
1884
|
-
return i.valid ? ((
|
|
1882
|
+
if (Re(e) || Re(r)) return F;
|
|
1883
|
+
let i = kt(e.value, r.value);
|
|
1884
|
+
return i.valid ? ((ze(e) || ze(r)) && t.dirty(), {
|
|
1885
1885
|
status: t.value,
|
|
1886
1886
|
value: i.data
|
|
1887
|
-
}) : (
|
|
1887
|
+
}) : (N(n, { code: x.invalid_intersection_types }), F);
|
|
1888
1888
|
};
|
|
1889
1889
|
return n.common.async ? Promise.all([this._def.left._parseAsync({
|
|
1890
1890
|
data: n.data,
|
|
@@ -1905,28 +1905,28 @@ var Mt = class extends z {
|
|
|
1905
1905
|
}));
|
|
1906
1906
|
}
|
|
1907
1907
|
};
|
|
1908
|
-
|
|
1908
|
+
At.create = (e, t, n) => new At({
|
|
1909
1909
|
left: e,
|
|
1910
1910
|
right: t,
|
|
1911
|
-
typeName:
|
|
1912
|
-
...
|
|
1911
|
+
typeName: K.ZodIntersection,
|
|
1912
|
+
...z(n)
|
|
1913
1913
|
});
|
|
1914
|
-
var
|
|
1914
|
+
var jt = class e extends B {
|
|
1915
1915
|
_parse(e) {
|
|
1916
1916
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
1917
|
-
if (n.parsedType !== S.array) return
|
|
1917
|
+
if (n.parsedType !== S.array) return N(n, {
|
|
1918
1918
|
code: x.invalid_type,
|
|
1919
1919
|
expected: S.array,
|
|
1920
1920
|
received: n.parsedType
|
|
1921
|
-
}),
|
|
1922
|
-
if (n.data.length < this._def.items.length) return
|
|
1921
|
+
}), F;
|
|
1922
|
+
if (n.data.length < this._def.items.length) return N(n, {
|
|
1923
1923
|
code: x.too_small,
|
|
1924
1924
|
minimum: this._def.items.length,
|
|
1925
1925
|
inclusive: !0,
|
|
1926
1926
|
exact: !1,
|
|
1927
1927
|
type: "array"
|
|
1928
|
-
}),
|
|
1929
|
-
!this._def.rest && n.data.length > this._def.items.length && (
|
|
1928
|
+
}), F;
|
|
1929
|
+
!this._def.rest && n.data.length > this._def.items.length && (N(n, {
|
|
1930
1930
|
code: x.too_big,
|
|
1931
1931
|
maximum: this._def.items.length,
|
|
1932
1932
|
inclusive: !0,
|
|
@@ -1935,9 +1935,9 @@ var Nt = class e extends z {
|
|
|
1935
1935
|
}), t.dirty());
|
|
1936
1936
|
let r = [...n.data].map((e, t) => {
|
|
1937
1937
|
let r = this._def.items[t] || this._def.rest;
|
|
1938
|
-
return r ? r._parse(new
|
|
1938
|
+
return r ? r._parse(new R(n, e, n.path, t)) : null;
|
|
1939
1939
|
}).filter((e) => !!e);
|
|
1940
|
-
return n.common.async ? Promise.all(r).then((e) =>
|
|
1940
|
+
return n.common.async ? Promise.all(r).then((e) => P.mergeArray(t, e)) : P.mergeArray(t, r);
|
|
1941
1941
|
}
|
|
1942
1942
|
get items() {
|
|
1943
1943
|
return this._def.items;
|
|
@@ -1949,16 +1949,16 @@ var Nt = class e extends z {
|
|
|
1949
1949
|
});
|
|
1950
1950
|
}
|
|
1951
1951
|
};
|
|
1952
|
-
|
|
1952
|
+
jt.create = (e, t) => {
|
|
1953
1953
|
if (!Array.isArray(e)) throw Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
1954
|
-
return new
|
|
1954
|
+
return new jt({
|
|
1955
1955
|
items: e,
|
|
1956
|
-
typeName:
|
|
1956
|
+
typeName: K.ZodTuple,
|
|
1957
1957
|
rest: null,
|
|
1958
|
-
...
|
|
1958
|
+
...z(t)
|
|
1959
1959
|
});
|
|
1960
1960
|
};
|
|
1961
|
-
var
|
|
1961
|
+
var Mt = class e extends B {
|
|
1962
1962
|
get keySchema() {
|
|
1963
1963
|
return this._def.keyType;
|
|
1964
1964
|
}
|
|
@@ -1967,36 +1967,36 @@ var Pt = class e extends z {
|
|
|
1967
1967
|
}
|
|
1968
1968
|
_parse(e) {
|
|
1969
1969
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
1970
|
-
if (n.parsedType !== S.object) return
|
|
1970
|
+
if (n.parsedType !== S.object) return N(n, {
|
|
1971
1971
|
code: x.invalid_type,
|
|
1972
1972
|
expected: S.object,
|
|
1973
1973
|
received: n.parsedType
|
|
1974
|
-
}),
|
|
1974
|
+
}), F;
|
|
1975
1975
|
let r = [], i = this._def.keyType, a = this._def.valueType;
|
|
1976
1976
|
for (let e in n.data) r.push({
|
|
1977
|
-
key: i._parse(new
|
|
1978
|
-
value: a._parse(new
|
|
1977
|
+
key: i._parse(new R(n, e, n.path, e)),
|
|
1978
|
+
value: a._parse(new R(n, n.data[e], n.path, e)),
|
|
1979
1979
|
alwaysSet: e in n.data
|
|
1980
1980
|
});
|
|
1981
|
-
return n.common.async ?
|
|
1981
|
+
return n.common.async ? P.mergeObjectAsync(t, r) : P.mergeObjectSync(t, r);
|
|
1982
1982
|
}
|
|
1983
1983
|
get element() {
|
|
1984
1984
|
return this._def.valueType;
|
|
1985
1985
|
}
|
|
1986
1986
|
static create(t, n, r) {
|
|
1987
|
-
return n instanceof
|
|
1987
|
+
return n instanceof B ? new e({
|
|
1988
1988
|
keyType: t,
|
|
1989
1989
|
valueType: n,
|
|
1990
|
-
typeName:
|
|
1991
|
-
...
|
|
1990
|
+
typeName: K.ZodRecord,
|
|
1991
|
+
...z(r)
|
|
1992
1992
|
}) : new e({
|
|
1993
|
-
keyType:
|
|
1993
|
+
keyType: pt.create(),
|
|
1994
1994
|
valueType: t,
|
|
1995
|
-
typeName:
|
|
1996
|
-
...
|
|
1995
|
+
typeName: K.ZodRecord,
|
|
1996
|
+
...z(n)
|
|
1997
1997
|
});
|
|
1998
1998
|
}
|
|
1999
|
-
},
|
|
1999
|
+
}, Nt = class extends B {
|
|
2000
2000
|
get keySchema() {
|
|
2001
2001
|
return this._def.keyType;
|
|
2002
2002
|
}
|
|
@@ -2005,21 +2005,21 @@ var Pt = class e extends z {
|
|
|
2005
2005
|
}
|
|
2006
2006
|
_parse(e) {
|
|
2007
2007
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2008
|
-
if (n.parsedType !== S.map) return
|
|
2008
|
+
if (n.parsedType !== S.map) return N(n, {
|
|
2009
2009
|
code: x.invalid_type,
|
|
2010
2010
|
expected: S.map,
|
|
2011
2011
|
received: n.parsedType
|
|
2012
|
-
}),
|
|
2012
|
+
}), F;
|
|
2013
2013
|
let r = this._def.keyType, i = this._def.valueType, a = [...n.data.entries()].map(([e, t], a) => ({
|
|
2014
|
-
key: r._parse(new
|
|
2015
|
-
value: i._parse(new
|
|
2014
|
+
key: r._parse(new R(n, e, n.path, [a, "key"])),
|
|
2015
|
+
value: i._parse(new R(n, t, n.path, [a, "value"]))
|
|
2016
2016
|
}));
|
|
2017
2017
|
if (n.common.async) {
|
|
2018
2018
|
let e = /* @__PURE__ */ new Map();
|
|
2019
2019
|
return Promise.resolve().then(async () => {
|
|
2020
2020
|
for (let n of a) {
|
|
2021
2021
|
let r = await n.key, i = await n.value;
|
|
2022
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
2022
|
+
if (r.status === "aborted" || i.status === "aborted") return F;
|
|
2023
2023
|
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
2024
2024
|
}
|
|
2025
2025
|
return {
|
|
@@ -2031,7 +2031,7 @@ var Pt = class e extends z {
|
|
|
2031
2031
|
let e = /* @__PURE__ */ new Map();
|
|
2032
2032
|
for (let n of a) {
|
|
2033
2033
|
let r = n.key, i = n.value;
|
|
2034
|
-
if (r.status === "aborted" || i.status === "aborted") return
|
|
2034
|
+
if (r.status === "aborted" || i.status === "aborted") return F;
|
|
2035
2035
|
(r.status === "dirty" || i.status === "dirty") && t.dirty(), e.set(r.value, i.value);
|
|
2036
2036
|
}
|
|
2037
2037
|
return {
|
|
@@ -2041,29 +2041,29 @@ var Pt = class e extends z {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
}
|
|
2043
2043
|
};
|
|
2044
|
-
|
|
2044
|
+
Nt.create = (e, t, n) => new Nt({
|
|
2045
2045
|
valueType: t,
|
|
2046
2046
|
keyType: e,
|
|
2047
|
-
typeName:
|
|
2048
|
-
...
|
|
2047
|
+
typeName: K.ZodMap,
|
|
2048
|
+
...z(n)
|
|
2049
2049
|
});
|
|
2050
|
-
var
|
|
2050
|
+
var Pt = class e extends B {
|
|
2051
2051
|
_parse(e) {
|
|
2052
2052
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2053
|
-
if (n.parsedType !== S.set) return
|
|
2053
|
+
if (n.parsedType !== S.set) return N(n, {
|
|
2054
2054
|
code: x.invalid_type,
|
|
2055
2055
|
expected: S.set,
|
|
2056
2056
|
received: n.parsedType
|
|
2057
|
-
}),
|
|
2057
|
+
}), F;
|
|
2058
2058
|
let r = this._def;
|
|
2059
|
-
r.minSize !== null && n.data.size < r.minSize.value && (
|
|
2059
|
+
r.minSize !== null && n.data.size < r.minSize.value && (N(n, {
|
|
2060
2060
|
code: x.too_small,
|
|
2061
2061
|
minimum: r.minSize.value,
|
|
2062
2062
|
type: "set",
|
|
2063
2063
|
inclusive: !0,
|
|
2064
2064
|
exact: !1,
|
|
2065
2065
|
message: r.minSize.message
|
|
2066
|
-
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (
|
|
2066
|
+
}), t.dirty()), r.maxSize !== null && n.data.size > r.maxSize.value && (N(n, {
|
|
2067
2067
|
code: x.too_big,
|
|
2068
2068
|
maximum: r.maxSize.value,
|
|
2069
2069
|
type: "set",
|
|
@@ -2075,7 +2075,7 @@ var It = class e extends z {
|
|
|
2075
2075
|
function a(e) {
|
|
2076
2076
|
let n = /* @__PURE__ */ new Set();
|
|
2077
2077
|
for (let r of e) {
|
|
2078
|
-
if (r.status === "aborted") return
|
|
2078
|
+
if (r.status === "aborted") return F;
|
|
2079
2079
|
r.status === "dirty" && t.dirty(), n.add(r.value);
|
|
2080
2080
|
}
|
|
2081
2081
|
return {
|
|
@@ -2083,7 +2083,7 @@ var It = class e extends z {
|
|
|
2083
2083
|
value: n
|
|
2084
2084
|
};
|
|
2085
2085
|
}
|
|
2086
|
-
let o = [...n.data.values()].map((e, t) => i._parse(new
|
|
2086
|
+
let o = [...n.data.values()].map((e, t) => i._parse(new R(n, e, n.path, t)));
|
|
2087
2087
|
return n.common.async ? Promise.all(o).then((e) => a(e)) : a(o);
|
|
2088
2088
|
}
|
|
2089
2089
|
min(t, n) {
|
|
@@ -2091,7 +2091,7 @@ var It = class e extends z {
|
|
|
2091
2091
|
...this._def,
|
|
2092
2092
|
minSize: {
|
|
2093
2093
|
value: t,
|
|
2094
|
-
message:
|
|
2094
|
+
message: L.toString(n)
|
|
2095
2095
|
}
|
|
2096
2096
|
});
|
|
2097
2097
|
}
|
|
@@ -2100,7 +2100,7 @@ var It = class e extends z {
|
|
|
2100
2100
|
...this._def,
|
|
2101
2101
|
maxSize: {
|
|
2102
2102
|
value: t,
|
|
2103
|
-
message:
|
|
2103
|
+
message: L.toString(n)
|
|
2104
2104
|
}
|
|
2105
2105
|
});
|
|
2106
2106
|
}
|
|
@@ -2111,33 +2111,33 @@ var It = class e extends z {
|
|
|
2111
2111
|
return this.min(1, e);
|
|
2112
2112
|
}
|
|
2113
2113
|
};
|
|
2114
|
-
|
|
2114
|
+
Pt.create = (e, t) => new Pt({
|
|
2115
2115
|
valueType: e,
|
|
2116
2116
|
minSize: null,
|
|
2117
2117
|
maxSize: null,
|
|
2118
|
-
typeName:
|
|
2119
|
-
...
|
|
2118
|
+
typeName: K.ZodSet,
|
|
2119
|
+
...z(t)
|
|
2120
2120
|
});
|
|
2121
|
-
var
|
|
2121
|
+
var Ft = class e extends B {
|
|
2122
2122
|
constructor() {
|
|
2123
2123
|
super(...arguments), this.validate = this.implement;
|
|
2124
2124
|
}
|
|
2125
2125
|
_parse(e) {
|
|
2126
2126
|
let { ctx: t } = this._processInputParams(e);
|
|
2127
|
-
if (t.parsedType !== S.function) return
|
|
2127
|
+
if (t.parsedType !== S.function) return N(t, {
|
|
2128
2128
|
code: x.invalid_type,
|
|
2129
2129
|
expected: S.function,
|
|
2130
2130
|
received: t.parsedType
|
|
2131
|
-
}),
|
|
2131
|
+
}), F;
|
|
2132
2132
|
function n(e, n) {
|
|
2133
|
-
return
|
|
2133
|
+
return Ie({
|
|
2134
2134
|
data: e,
|
|
2135
2135
|
path: t.path,
|
|
2136
2136
|
errorMaps: [
|
|
2137
2137
|
t.common.contextualErrorMap,
|
|
2138
2138
|
t.schemaErrorMap,
|
|
2139
|
-
|
|
2140
|
-
|
|
2139
|
+
Fe(),
|
|
2140
|
+
Ne
|
|
2141
2141
|
].filter((e) => !!e),
|
|
2142
2142
|
issueData: {
|
|
2143
2143
|
code: x.invalid_arguments,
|
|
@@ -2146,14 +2146,14 @@ var Lt = class e extends z {
|
|
|
2146
2146
|
});
|
|
2147
2147
|
}
|
|
2148
2148
|
function r(e, n) {
|
|
2149
|
-
return
|
|
2149
|
+
return Ie({
|
|
2150
2150
|
data: e,
|
|
2151
2151
|
path: t.path,
|
|
2152
2152
|
errorMaps: [
|
|
2153
2153
|
t.common.contextualErrorMap,
|
|
2154
2154
|
t.schemaErrorMap,
|
|
2155
|
-
|
|
2156
|
-
|
|
2155
|
+
Fe(),
|
|
2156
|
+
Ne
|
|
2157
2157
|
].filter((e) => !!e),
|
|
2158
2158
|
issueData: {
|
|
2159
2159
|
code: x.invalid_return_type,
|
|
@@ -2162,9 +2162,9 @@ var Lt = class e extends z {
|
|
|
2162
2162
|
});
|
|
2163
2163
|
}
|
|
2164
2164
|
let i = { errorMap: t.common.contextualErrorMap }, a = t.data;
|
|
2165
|
-
if (this._def.returns instanceof
|
|
2165
|
+
if (this._def.returns instanceof Vt) {
|
|
2166
2166
|
let e = this;
|
|
2167
|
-
return
|
|
2167
|
+
return I(async function(...t) {
|
|
2168
2168
|
let o = new C([]), s = await e._def.args.parseAsync(t, i).catch((e) => {
|
|
2169
2169
|
throw o.addIssue(n(t, e)), o;
|
|
2170
2170
|
}), c = await Reflect.apply(a, this, s);
|
|
@@ -2174,7 +2174,7 @@ var Lt = class e extends z {
|
|
|
2174
2174
|
});
|
|
2175
2175
|
} else {
|
|
2176
2176
|
let e = this;
|
|
2177
|
-
return
|
|
2177
|
+
return I(function(...t) {
|
|
2178
2178
|
let o = e._def.args.safeParse(t, i);
|
|
2179
2179
|
if (!o.success) throw new C([n(t, o.error)]);
|
|
2180
2180
|
let s = Reflect.apply(a, this, o.data), c = e._def.returns.safeParse(s, i);
|
|
@@ -2192,7 +2192,7 @@ var Lt = class e extends z {
|
|
|
2192
2192
|
args(...t) {
|
|
2193
2193
|
return new e({
|
|
2194
2194
|
...this._def,
|
|
2195
|
-
args:
|
|
2195
|
+
args: jt.create(t).rest(Ct.create())
|
|
2196
2196
|
});
|
|
2197
2197
|
}
|
|
2198
2198
|
returns(t) {
|
|
@@ -2209,13 +2209,13 @@ var Lt = class e extends z {
|
|
|
2209
2209
|
}
|
|
2210
2210
|
static create(t, n, r) {
|
|
2211
2211
|
return new e({
|
|
2212
|
-
args: t ||
|
|
2213
|
-
returns: n ||
|
|
2214
|
-
typeName:
|
|
2215
|
-
...
|
|
2212
|
+
args: t || jt.create([]).rest(Ct.create()),
|
|
2213
|
+
returns: n || Ct.create(),
|
|
2214
|
+
typeName: K.ZodFunction,
|
|
2215
|
+
...z(r)
|
|
2216
2216
|
});
|
|
2217
2217
|
}
|
|
2218
|
-
},
|
|
2218
|
+
}, It = class extends B {
|
|
2219
2219
|
get schema() {
|
|
2220
2220
|
return this._def.getter();
|
|
2221
2221
|
}
|
|
@@ -2228,20 +2228,20 @@ var Lt = class e extends z {
|
|
|
2228
2228
|
});
|
|
2229
2229
|
}
|
|
2230
2230
|
};
|
|
2231
|
-
|
|
2231
|
+
It.create = (e, t) => new It({
|
|
2232
2232
|
getter: e,
|
|
2233
|
-
typeName:
|
|
2234
|
-
...
|
|
2233
|
+
typeName: K.ZodLazy,
|
|
2234
|
+
...z(t)
|
|
2235
2235
|
});
|
|
2236
|
-
var
|
|
2236
|
+
var Lt = class extends B {
|
|
2237
2237
|
_parse(e) {
|
|
2238
2238
|
if (e.data !== this._def.value) {
|
|
2239
2239
|
let t = this._getOrReturnCtx(e);
|
|
2240
|
-
return
|
|
2240
|
+
return N(t, {
|
|
2241
2241
|
received: t.data,
|
|
2242
2242
|
code: x.invalid_literal,
|
|
2243
2243
|
expected: this._def.value
|
|
2244
|
-
}),
|
|
2244
|
+
}), F;
|
|
2245
2245
|
}
|
|
2246
2246
|
return {
|
|
2247
2247
|
status: "valid",
|
|
@@ -2252,37 +2252,37 @@ var zt = class extends z {
|
|
|
2252
2252
|
return this._def.value;
|
|
2253
2253
|
}
|
|
2254
2254
|
};
|
|
2255
|
-
|
|
2255
|
+
Lt.create = (e, t) => new Lt({
|
|
2256
2256
|
value: e,
|
|
2257
|
-
typeName:
|
|
2258
|
-
...
|
|
2257
|
+
typeName: K.ZodLiteral,
|
|
2258
|
+
...z(t)
|
|
2259
2259
|
});
|
|
2260
|
-
function
|
|
2261
|
-
return new
|
|
2260
|
+
function Rt(e, t) {
|
|
2261
|
+
return new zt({
|
|
2262
2262
|
values: e,
|
|
2263
|
-
typeName:
|
|
2264
|
-
...
|
|
2263
|
+
typeName: K.ZodEnum,
|
|
2264
|
+
...z(t)
|
|
2265
2265
|
});
|
|
2266
2266
|
}
|
|
2267
|
-
var
|
|
2267
|
+
var zt = class e extends B {
|
|
2268
2268
|
_parse(e) {
|
|
2269
2269
|
if (typeof e.data != "string") {
|
|
2270
2270
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2271
|
-
return
|
|
2271
|
+
return N(t, {
|
|
2272
2272
|
expected: y.joinValues(n),
|
|
2273
2273
|
received: t.parsedType,
|
|
2274
2274
|
code: x.invalid_type
|
|
2275
|
-
}),
|
|
2275
|
+
}), F;
|
|
2276
2276
|
}
|
|
2277
2277
|
if (this._cache ||= new Set(this._def.values), !this._cache.has(e.data)) {
|
|
2278
2278
|
let t = this._getOrReturnCtx(e), n = this._def.values;
|
|
2279
|
-
return
|
|
2279
|
+
return N(t, {
|
|
2280
2280
|
received: t.data,
|
|
2281
2281
|
code: x.invalid_enum_value,
|
|
2282
2282
|
options: n
|
|
2283
|
-
}),
|
|
2283
|
+
}), F;
|
|
2284
2284
|
}
|
|
2285
|
-
return
|
|
2285
|
+
return I(e.data);
|
|
2286
2286
|
}
|
|
2287
2287
|
get options() {
|
|
2288
2288
|
return this._def.values;
|
|
@@ -2315,69 +2315,69 @@ var Vt = class e extends z {
|
|
|
2315
2315
|
});
|
|
2316
2316
|
}
|
|
2317
2317
|
};
|
|
2318
|
-
|
|
2319
|
-
var
|
|
2318
|
+
zt.create = Rt;
|
|
2319
|
+
var Bt = class extends B {
|
|
2320
2320
|
_parse(e) {
|
|
2321
2321
|
let t = y.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e);
|
|
2322
2322
|
if (n.parsedType !== S.string && n.parsedType !== S.number) {
|
|
2323
2323
|
let e = y.objectValues(t);
|
|
2324
|
-
return
|
|
2324
|
+
return N(n, {
|
|
2325
2325
|
expected: y.joinValues(e),
|
|
2326
2326
|
received: n.parsedType,
|
|
2327
2327
|
code: x.invalid_type
|
|
2328
|
-
}),
|
|
2328
|
+
}), F;
|
|
2329
2329
|
}
|
|
2330
2330
|
if (this._cache ||= new Set(y.getValidEnumValues(this._def.values)), !this._cache.has(e.data)) {
|
|
2331
2331
|
let e = y.objectValues(t);
|
|
2332
|
-
return
|
|
2332
|
+
return N(n, {
|
|
2333
2333
|
received: n.data,
|
|
2334
2334
|
code: x.invalid_enum_value,
|
|
2335
2335
|
options: e
|
|
2336
|
-
}),
|
|
2336
|
+
}), F;
|
|
2337
2337
|
}
|
|
2338
|
-
return
|
|
2338
|
+
return I(e.data);
|
|
2339
2339
|
}
|
|
2340
2340
|
get enum() {
|
|
2341
2341
|
return this._def.values;
|
|
2342
2342
|
}
|
|
2343
2343
|
};
|
|
2344
|
-
|
|
2344
|
+
Bt.create = (e, t) => new Bt({
|
|
2345
2345
|
values: e,
|
|
2346
|
-
typeName:
|
|
2347
|
-
...
|
|
2346
|
+
typeName: K.ZodNativeEnum,
|
|
2347
|
+
...z(t)
|
|
2348
2348
|
});
|
|
2349
|
-
var
|
|
2349
|
+
var Vt = class extends B {
|
|
2350
2350
|
unwrap() {
|
|
2351
2351
|
return this._def.type;
|
|
2352
2352
|
}
|
|
2353
2353
|
_parse(e) {
|
|
2354
2354
|
let { ctx: t } = this._processInputParams(e);
|
|
2355
|
-
return t.parsedType !== S.promise && t.common.async === !1 ? (
|
|
2355
|
+
return t.parsedType !== S.promise && t.common.async === !1 ? (N(t, {
|
|
2356
2356
|
code: x.invalid_type,
|
|
2357
2357
|
expected: S.promise,
|
|
2358
2358
|
received: t.parsedType
|
|
2359
|
-
}),
|
|
2359
|
+
}), F) : I((t.parsedType === S.promise ? t.data : Promise.resolve(t.data)).then((e) => this._def.type.parseAsync(e, {
|
|
2360
2360
|
path: t.path,
|
|
2361
2361
|
errorMap: t.common.contextualErrorMap
|
|
2362
2362
|
})));
|
|
2363
2363
|
}
|
|
2364
2364
|
};
|
|
2365
|
-
|
|
2365
|
+
Vt.create = (e, t) => new Vt({
|
|
2366
2366
|
type: e,
|
|
2367
|
-
typeName:
|
|
2368
|
-
...
|
|
2367
|
+
typeName: K.ZodPromise,
|
|
2368
|
+
...z(t)
|
|
2369
2369
|
});
|
|
2370
|
-
var
|
|
2370
|
+
var W = class extends B {
|
|
2371
2371
|
innerType() {
|
|
2372
2372
|
return this._def.schema;
|
|
2373
2373
|
}
|
|
2374
2374
|
sourceType() {
|
|
2375
|
-
return this._def.schema._def.typeName ===
|
|
2375
|
+
return this._def.schema._def.typeName === K.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2376
2376
|
}
|
|
2377
2377
|
_parse(e) {
|
|
2378
2378
|
let { status: t, ctx: n } = this._processInputParams(e), r = this._def.effect || null, i = {
|
|
2379
2379
|
addIssue: (e) => {
|
|
2380
|
-
|
|
2380
|
+
N(n, e), e.fatal ? t.abort() : t.dirty();
|
|
2381
2381
|
},
|
|
2382
2382
|
get path() {
|
|
2383
2383
|
return n.path;
|
|
@@ -2386,22 +2386,22 @@ var H = class extends z {
|
|
|
2386
2386
|
if (i.addIssue = i.addIssue.bind(i), r.type === "preprocess") {
|
|
2387
2387
|
let e = r.transform(n.data, i);
|
|
2388
2388
|
if (n.common.async) return Promise.resolve(e).then(async (e) => {
|
|
2389
|
-
if (t.value === "aborted") return
|
|
2389
|
+
if (t.value === "aborted") return F;
|
|
2390
2390
|
let r = await this._def.schema._parseAsync({
|
|
2391
2391
|
data: e,
|
|
2392
2392
|
path: n.path,
|
|
2393
2393
|
parent: n
|
|
2394
2394
|
});
|
|
2395
|
-
return r.status === "aborted" ?
|
|
2395
|
+
return r.status === "aborted" ? F : r.status === "dirty" || t.value === "dirty" ? Le(r.value) : r;
|
|
2396
2396
|
});
|
|
2397
2397
|
{
|
|
2398
|
-
if (t.value === "aborted") return
|
|
2398
|
+
if (t.value === "aborted") return F;
|
|
2399
2399
|
let r = this._def.schema._parseSync({
|
|
2400
2400
|
data: e,
|
|
2401
2401
|
path: n.path,
|
|
2402
2402
|
parent: n
|
|
2403
2403
|
});
|
|
2404
|
-
return r.status === "aborted" ?
|
|
2404
|
+
return r.status === "aborted" ? F : r.status === "dirty" || t.value === "dirty" ? Le(r.value) : r;
|
|
2405
2405
|
}
|
|
2406
2406
|
}
|
|
2407
2407
|
if (r.type === "refinement") {
|
|
@@ -2417,7 +2417,7 @@ var H = class extends z {
|
|
|
2417
2417
|
path: n.path,
|
|
2418
2418
|
parent: n
|
|
2419
2419
|
});
|
|
2420
|
-
return r.status === "aborted" ?
|
|
2420
|
+
return r.status === "aborted" ? F : (r.status === "dirty" && t.dirty(), e(r.value), {
|
|
2421
2421
|
status: t.value,
|
|
2422
2422
|
value: r.value
|
|
2423
2423
|
});
|
|
@@ -2425,7 +2425,7 @@ var H = class extends z {
|
|
|
2425
2425
|
data: n.data,
|
|
2426
2426
|
path: n.path,
|
|
2427
2427
|
parent: n
|
|
2428
|
-
}).then((n) => n.status === "aborted" ?
|
|
2428
|
+
}).then((n) => n.status === "aborted" ? F : (n.status === "dirty" && t.dirty(), e(n.value).then(() => ({
|
|
2429
2429
|
status: t.value,
|
|
2430
2430
|
value: n.value
|
|
2431
2431
|
}))));
|
|
@@ -2436,7 +2436,7 @@ var H = class extends z {
|
|
|
2436
2436
|
path: n.path,
|
|
2437
2437
|
parent: n
|
|
2438
2438
|
});
|
|
2439
|
-
if (!
|
|
2439
|
+
if (!Be(e)) return F;
|
|
2440
2440
|
let a = r.transform(e.value, i);
|
|
2441
2441
|
if (a instanceof Promise) throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2442
2442
|
return {
|
|
@@ -2447,54 +2447,54 @@ var H = class extends z {
|
|
|
2447
2447
|
data: n.data,
|
|
2448
2448
|
path: n.path,
|
|
2449
2449
|
parent: n
|
|
2450
|
-
}).then((e) =>
|
|
2450
|
+
}).then((e) => Be(e) ? Promise.resolve(r.transform(e.value, i)).then((e) => ({
|
|
2451
2451
|
status: t.value,
|
|
2452
2452
|
value: e
|
|
2453
|
-
})) :
|
|
2453
|
+
})) : F);
|
|
2454
2454
|
y.assertNever(r);
|
|
2455
2455
|
}
|
|
2456
2456
|
};
|
|
2457
|
-
|
|
2457
|
+
W.create = (e, t, n) => new W({
|
|
2458
2458
|
schema: e,
|
|
2459
|
-
typeName:
|
|
2459
|
+
typeName: K.ZodEffects,
|
|
2460
2460
|
effect: t,
|
|
2461
|
-
...
|
|
2462
|
-
}),
|
|
2461
|
+
...z(n)
|
|
2462
|
+
}), W.createWithPreprocess = (e, t, n) => new W({
|
|
2463
2463
|
schema: t,
|
|
2464
2464
|
effect: {
|
|
2465
2465
|
type: "preprocess",
|
|
2466
2466
|
transform: e
|
|
2467
2467
|
},
|
|
2468
|
-
typeName:
|
|
2469
|
-
...
|
|
2468
|
+
typeName: K.ZodEffects,
|
|
2469
|
+
...z(n)
|
|
2470
2470
|
});
|
|
2471
|
-
var
|
|
2471
|
+
var G = class extends B {
|
|
2472
2472
|
_parse(e) {
|
|
2473
|
-
return this._getType(e) === S.undefined ?
|
|
2473
|
+
return this._getType(e) === S.undefined ? I(void 0) : this._def.innerType._parse(e);
|
|
2474
2474
|
}
|
|
2475
2475
|
unwrap() {
|
|
2476
2476
|
return this._def.innerType;
|
|
2477
2477
|
}
|
|
2478
2478
|
};
|
|
2479
|
-
|
|
2479
|
+
G.create = (e, t) => new G({
|
|
2480
2480
|
innerType: e,
|
|
2481
|
-
typeName:
|
|
2482
|
-
...
|
|
2481
|
+
typeName: K.ZodOptional,
|
|
2482
|
+
...z(t)
|
|
2483
2483
|
});
|
|
2484
|
-
var
|
|
2484
|
+
var Ht = class extends B {
|
|
2485
2485
|
_parse(e) {
|
|
2486
|
-
return this._getType(e) === S.null ?
|
|
2486
|
+
return this._getType(e) === S.null ? I(null) : this._def.innerType._parse(e);
|
|
2487
2487
|
}
|
|
2488
2488
|
unwrap() {
|
|
2489
2489
|
return this._def.innerType;
|
|
2490
2490
|
}
|
|
2491
2491
|
};
|
|
2492
|
-
|
|
2492
|
+
Ht.create = (e, t) => new Ht({
|
|
2493
2493
|
innerType: e,
|
|
2494
|
-
typeName:
|
|
2495
|
-
...
|
|
2494
|
+
typeName: K.ZodNullable,
|
|
2495
|
+
...z(t)
|
|
2496
2496
|
});
|
|
2497
|
-
var
|
|
2497
|
+
var Ut = class extends B {
|
|
2498
2498
|
_parse(e) {
|
|
2499
2499
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2500
2500
|
return t.parsedType === S.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
|
|
@@ -2507,13 +2507,13 @@ var Gt = class extends z {
|
|
|
2507
2507
|
return this._def.innerType;
|
|
2508
2508
|
}
|
|
2509
2509
|
};
|
|
2510
|
-
|
|
2510
|
+
Ut.create = (e, t) => new Ut({
|
|
2511
2511
|
innerType: e,
|
|
2512
|
-
typeName:
|
|
2512
|
+
typeName: K.ZodDefault,
|
|
2513
2513
|
defaultValue: typeof t.default == "function" ? t.default : () => t.default,
|
|
2514
|
-
...
|
|
2514
|
+
...z(t)
|
|
2515
2515
|
});
|
|
2516
|
-
var
|
|
2516
|
+
var Wt = class extends B {
|
|
2517
2517
|
_parse(e) {
|
|
2518
2518
|
let { ctx: t } = this._processInputParams(e), n = {
|
|
2519
2519
|
...t,
|
|
@@ -2526,7 +2526,7 @@ var Kt = class extends z {
|
|
|
2526
2526
|
path: n.path,
|
|
2527
2527
|
parent: { ...n }
|
|
2528
2528
|
});
|
|
2529
|
-
return
|
|
2529
|
+
return Ve(r) ? r.then((e) => ({
|
|
2530
2530
|
status: "valid",
|
|
2531
2531
|
value: e.status === "valid" ? e.value : this._def.catchValue({
|
|
2532
2532
|
get error() {
|
|
@@ -2548,21 +2548,21 @@ var Kt = class extends z {
|
|
|
2548
2548
|
return this._def.innerType;
|
|
2549
2549
|
}
|
|
2550
2550
|
};
|
|
2551
|
-
|
|
2551
|
+
Wt.create = (e, t) => new Wt({
|
|
2552
2552
|
innerType: e,
|
|
2553
|
-
typeName:
|
|
2553
|
+
typeName: K.ZodCatch,
|
|
2554
2554
|
catchValue: typeof t.catch == "function" ? t.catch : () => t.catch,
|
|
2555
|
-
...
|
|
2555
|
+
...z(t)
|
|
2556
2556
|
});
|
|
2557
|
-
var
|
|
2557
|
+
var Gt = class extends B {
|
|
2558
2558
|
_parse(e) {
|
|
2559
2559
|
if (this._getType(e) !== S.nan) {
|
|
2560
2560
|
let t = this._getOrReturnCtx(e);
|
|
2561
|
-
return
|
|
2561
|
+
return N(t, {
|
|
2562
2562
|
code: x.invalid_type,
|
|
2563
2563
|
expected: S.nan,
|
|
2564
2564
|
received: t.parsedType
|
|
2565
|
-
}),
|
|
2565
|
+
}), F;
|
|
2566
2566
|
}
|
|
2567
2567
|
return {
|
|
2568
2568
|
status: "valid",
|
|
@@ -2570,11 +2570,11 @@ var qt = class extends z {
|
|
|
2570
2570
|
};
|
|
2571
2571
|
}
|
|
2572
2572
|
};
|
|
2573
|
-
|
|
2574
|
-
typeName:
|
|
2575
|
-
...
|
|
2573
|
+
Gt.create = (e) => new Gt({
|
|
2574
|
+
typeName: K.ZodNaN,
|
|
2575
|
+
...z(e)
|
|
2576
2576
|
});
|
|
2577
|
-
var
|
|
2577
|
+
var Kt = class extends B {
|
|
2578
2578
|
_parse(e) {
|
|
2579
2579
|
let { ctx: t } = this._processInputParams(e), n = t.data;
|
|
2580
2580
|
return this._def.type._parse({
|
|
@@ -2586,7 +2586,7 @@ var Jt = class extends z {
|
|
|
2586
2586
|
unwrap() {
|
|
2587
2587
|
return this._def.type;
|
|
2588
2588
|
}
|
|
2589
|
-
},
|
|
2589
|
+
}, qt = class e extends B {
|
|
2590
2590
|
_parse(e) {
|
|
2591
2591
|
let { status: t, ctx: n } = this._processInputParams(e);
|
|
2592
2592
|
if (n.common.async) return (async () => {
|
|
@@ -2595,7 +2595,7 @@ var Jt = class extends z {
|
|
|
2595
2595
|
path: n.path,
|
|
2596
2596
|
parent: n
|
|
2597
2597
|
});
|
|
2598
|
-
return e.status === "aborted" ?
|
|
2598
|
+
return e.status === "aborted" ? F : e.status === "dirty" ? (t.dirty(), Le(e.value)) : this._def.out._parseAsync({
|
|
2599
2599
|
data: e.value,
|
|
2600
2600
|
path: n.path,
|
|
2601
2601
|
parent: n
|
|
@@ -2607,7 +2607,7 @@ var Jt = class extends z {
|
|
|
2607
2607
|
path: n.path,
|
|
2608
2608
|
parent: n
|
|
2609
2609
|
});
|
|
2610
|
-
return e.status === "aborted" ?
|
|
2610
|
+
return e.status === "aborted" ? F : e.status === "dirty" ? (t.dirty(), {
|
|
2611
2611
|
status: "dirty",
|
|
2612
2612
|
value: e.value
|
|
2613
2613
|
}) : this._def.out._parseSync({
|
|
@@ -2621,81 +2621,146 @@ var Jt = class extends z {
|
|
|
2621
2621
|
return new e({
|
|
2622
2622
|
in: t,
|
|
2623
2623
|
out: n,
|
|
2624
|
-
typeName:
|
|
2624
|
+
typeName: K.ZodPipeline
|
|
2625
2625
|
});
|
|
2626
2626
|
}
|
|
2627
|
-
},
|
|
2627
|
+
}, Jt = class extends B {
|
|
2628
2628
|
_parse(e) {
|
|
2629
|
-
let t = this._def.innerType._parse(e), n = (e) => (
|
|
2630
|
-
return
|
|
2629
|
+
let t = this._def.innerType._parse(e), n = (e) => (Be(e) && (e.value = Object.freeze(e.value)), e);
|
|
2630
|
+
return Ve(t) ? t.then((e) => n(e)) : n(t);
|
|
2631
2631
|
}
|
|
2632
2632
|
unwrap() {
|
|
2633
2633
|
return this._def.innerType;
|
|
2634
2634
|
}
|
|
2635
2635
|
};
|
|
2636
|
-
|
|
2636
|
+
Jt.create = (e, t) => new Jt({
|
|
2637
2637
|
innerType: e,
|
|
2638
|
-
typeName:
|
|
2639
|
-
...
|
|
2640
|
-
}),
|
|
2641
|
-
var
|
|
2638
|
+
typeName: K.ZodReadonly,
|
|
2639
|
+
...z(t)
|
|
2640
|
+
}), H.lazycreate;
|
|
2641
|
+
var K;
|
|
2642
2642
|
(function(e) {
|
|
2643
2643
|
e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly";
|
|
2644
|
-
})(
|
|
2644
|
+
})(K ||= {}), pt.create, ht.create, Gt.create, gt.create, _t.create, vt.create, yt.create, bt.create, xt.create, St.create, Ct.create, V.create, wt.create, Tt.create, H.create, H.strictCreate, Dt.create, Ot.create, At.create, jt.create, Mt.create, Nt.create, Pt.create, Ft.create, It.create, Lt.create, zt.create, Bt.create, Vt.create, W.create, G.create, Ht.create, W.createWithPreprocess, qt.create;
|
|
2645
2645
|
//#endregion
|
|
2646
|
-
//#region ../../node_modules/.pnpm/eventsource-parser@3.0.
|
|
2647
|
-
var
|
|
2646
|
+
//#region ../../node_modules/.pnpm/eventsource-parser@3.0.8/node_modules/eventsource-parser/dist/index.js
|
|
2647
|
+
var Yt = class extends Error {
|
|
2648
2648
|
constructor(e, t) {
|
|
2649
2649
|
super(e), this.name = "ParseError", this.type = t.type, this.field = t.field, this.value = t.value, this.line = t.line;
|
|
2650
2650
|
}
|
|
2651
|
-
};
|
|
2652
|
-
function
|
|
2653
|
-
function
|
|
2651
|
+
}, Xt = 10, Zt = 13, Qt = 32;
|
|
2652
|
+
function $t(e) {}
|
|
2653
|
+
function en(e) {
|
|
2654
2654
|
if (typeof e == "function") throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");
|
|
2655
|
-
let { onEvent: t =
|
|
2656
|
-
function u(e) {
|
|
2657
|
-
let t = o ? e.replace(/^\xEF\xBB\xBF/, "") : e, [n, r] = en(`${a}${t}`);
|
|
2658
|
-
for (let e of n) d(e);
|
|
2659
|
-
a = r, o = !1;
|
|
2660
|
-
}
|
|
2655
|
+
let { onEvent: t = $t, onError: n = $t, onRetry: r = $t, onComment: i } = e, a = [], o = !0, s, c = "", l = 0, u;
|
|
2661
2656
|
function d(e) {
|
|
2662
|
-
if (e ===
|
|
2663
|
-
|
|
2657
|
+
if (o && (o = !1, e.charCodeAt(0) === 239 && e.charCodeAt(1) === 187 && e.charCodeAt(2) === 191 && (e = e.slice(3))), a.length === 0) {
|
|
2658
|
+
let t = f(e);
|
|
2659
|
+
t !== "" && a.push(t);
|
|
2664
2660
|
return;
|
|
2665
2661
|
}
|
|
2666
|
-
if (e.
|
|
2667
|
-
|
|
2662
|
+
if (e.indexOf("\n") === -1 && e.indexOf("\r") === -1) {
|
|
2663
|
+
a.push(e);
|
|
2664
|
+
return;
|
|
2665
|
+
}
|
|
2666
|
+
a.push(e);
|
|
2667
|
+
let t = a.join("");
|
|
2668
|
+
a.length = 0;
|
|
2669
|
+
let n = f(t);
|
|
2670
|
+
n !== "" && a.push(n);
|
|
2671
|
+
}
|
|
2672
|
+
function f(e) {
|
|
2673
|
+
let n = 0;
|
|
2674
|
+
if (e.indexOf("\r") === -1) {
|
|
2675
|
+
let r = e.indexOf("\n", n);
|
|
2676
|
+
for (; r !== -1;) {
|
|
2677
|
+
if (n === r) {
|
|
2678
|
+
l > 0 && t({
|
|
2679
|
+
id: s,
|
|
2680
|
+
event: u,
|
|
2681
|
+
data: c
|
|
2682
|
+
}), s = void 0, c = "", l = 0, u = void 0, n = r + 1, r = e.indexOf("\n", n);
|
|
2683
|
+
continue;
|
|
2684
|
+
}
|
|
2685
|
+
let i = e.charCodeAt(n);
|
|
2686
|
+
if (tn(e, n, i)) {
|
|
2687
|
+
let i = e.charCodeAt(n + 5) === Qt ? n + 6 : n + 5, a = e.slice(i, r);
|
|
2688
|
+
if (l === 0 && e.charCodeAt(r + 1) === Xt) {
|
|
2689
|
+
t({
|
|
2690
|
+
id: s,
|
|
2691
|
+
event: u,
|
|
2692
|
+
data: a
|
|
2693
|
+
}), s = void 0, c = "", u = void 0, n = r + 2, r = e.indexOf("\n", n);
|
|
2694
|
+
continue;
|
|
2695
|
+
}
|
|
2696
|
+
c = l === 0 ? a : `${c}
|
|
2697
|
+
${a}`, l++;
|
|
2698
|
+
} else nn(e, n, i) ? u = e.slice(e.charCodeAt(n + 6) === Qt ? n + 7 : n + 6, r) || void 0 : p(e, n, r);
|
|
2699
|
+
n = r + 1, r = e.indexOf("\n", n);
|
|
2700
|
+
}
|
|
2701
|
+
return e.slice(n);
|
|
2702
|
+
}
|
|
2703
|
+
for (; n < e.length;) {
|
|
2704
|
+
let t = e.indexOf("\r", n), r = e.indexOf("\n", n), i = -1;
|
|
2705
|
+
if (t !== -1 && r !== -1 ? i = t < r ? t : r : t === -1 ? r !== -1 && (i = r) : i = t === e.length - 1 ? -1 : t, i === -1) break;
|
|
2706
|
+
p(e, n, i), n = i + 1, e.charCodeAt(n - 1) === Zt && e.charCodeAt(n) === Xt && n++;
|
|
2707
|
+
}
|
|
2708
|
+
return e.slice(n);
|
|
2709
|
+
}
|
|
2710
|
+
function p(e, t, n) {
|
|
2711
|
+
if (t === n) {
|
|
2712
|
+
h();
|
|
2668
2713
|
return;
|
|
2669
2714
|
}
|
|
2670
|
-
let
|
|
2671
|
-
if (t
|
|
2672
|
-
let
|
|
2673
|
-
|
|
2715
|
+
let r = e.charCodeAt(t);
|
|
2716
|
+
if (tn(e, t, r)) {
|
|
2717
|
+
let r = e.charCodeAt(t + 5) === Qt ? t + 6 : t + 5, i = e.slice(r, n);
|
|
2718
|
+
c = l === 0 ? i : `${c}
|
|
2719
|
+
${i}`, l++;
|
|
2674
2720
|
return;
|
|
2675
2721
|
}
|
|
2676
|
-
|
|
2722
|
+
if (nn(e, t, r)) {
|
|
2723
|
+
u = e.slice(e.charCodeAt(t + 6) === Qt ? t + 7 : t + 6, n) || void 0;
|
|
2724
|
+
return;
|
|
2725
|
+
}
|
|
2726
|
+
if (r === 105 && e.charCodeAt(t + 1) === 100 && e.charCodeAt(t + 2) === 58) {
|
|
2727
|
+
let r = e.slice(e.charCodeAt(t + 3) === Qt ? t + 4 : t + 3, n);
|
|
2728
|
+
s = r.includes("\0") ? void 0 : r;
|
|
2729
|
+
return;
|
|
2730
|
+
}
|
|
2731
|
+
if (r === 58) {
|
|
2732
|
+
i && i(e.slice(t, n).slice(e.charCodeAt(t + 1) === Qt ? 2 : 1));
|
|
2733
|
+
return;
|
|
2734
|
+
}
|
|
2735
|
+
let a = e.slice(t, n), o = a.indexOf(":");
|
|
2736
|
+
if (o === -1) {
|
|
2737
|
+
m(a, "", a);
|
|
2738
|
+
return;
|
|
2739
|
+
}
|
|
2740
|
+
let d = a.slice(0, o), f = a.charCodeAt(o + 1) === Qt ? 2 : 1;
|
|
2741
|
+
m(d, a.slice(o + f), a);
|
|
2677
2742
|
}
|
|
2678
|
-
function
|
|
2743
|
+
function m(e, t, i) {
|
|
2679
2744
|
switch (e) {
|
|
2680
2745
|
case "event":
|
|
2681
|
-
|
|
2746
|
+
u = t || void 0;
|
|
2682
2747
|
break;
|
|
2683
2748
|
case "data":
|
|
2684
|
-
c = `${c}
|
|
2685
|
-
|
|
2749
|
+
c = l === 0 ? t : `${c}
|
|
2750
|
+
${t}`, l++;
|
|
2686
2751
|
break;
|
|
2687
2752
|
case "id":
|
|
2688
2753
|
s = t.includes("\0") ? void 0 : t;
|
|
2689
2754
|
break;
|
|
2690
2755
|
case "retry":
|
|
2691
|
-
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new
|
|
2756
|
+
/^\d+$/.test(t) ? r(parseInt(t, 10)) : n(new Yt(`Invalid \`retry\` value: "${t}"`, {
|
|
2692
2757
|
type: "invalid-retry",
|
|
2693
2758
|
value: t,
|
|
2694
2759
|
line: i
|
|
2695
2760
|
}));
|
|
2696
2761
|
break;
|
|
2697
2762
|
default:
|
|
2698
|
-
n(new
|
|
2763
|
+
n(new Yt(`Unknown field "${e.length > 20 ? `${e.slice(0, 20)}\u2026` : e}"`, {
|
|
2699
2764
|
type: "unknown-field",
|
|
2700
2765
|
field: e,
|
|
2701
2766
|
value: t,
|
|
@@ -2704,43 +2769,39 @@ function $t(e) {
|
|
|
2704
2769
|
break;
|
|
2705
2770
|
}
|
|
2706
2771
|
}
|
|
2707
|
-
function
|
|
2708
|
-
|
|
2772
|
+
function h() {
|
|
2773
|
+
l > 0 && t({
|
|
2709
2774
|
id: s,
|
|
2710
|
-
event:
|
|
2711
|
-
data: c
|
|
2712
|
-
}), s = void 0, c = "", l =
|
|
2713
|
-
}
|
|
2714
|
-
function
|
|
2715
|
-
|
|
2775
|
+
event: u,
|
|
2776
|
+
data: c
|
|
2777
|
+
}), s = void 0, c = "", l = 0, u = void 0;
|
|
2778
|
+
}
|
|
2779
|
+
function g(e = {}) {
|
|
2780
|
+
if (e.consume && a.length > 0) {
|
|
2781
|
+
let e = a.join("");
|
|
2782
|
+
p(e, 0, e.length);
|
|
2783
|
+
}
|
|
2784
|
+
o = !0, s = void 0, c = "", l = 0, u = void 0, a.length = 0;
|
|
2716
2785
|
}
|
|
2717
2786
|
return {
|
|
2718
|
-
feed:
|
|
2719
|
-
reset:
|
|
2787
|
+
feed: d,
|
|
2788
|
+
reset: g
|
|
2720
2789
|
};
|
|
2721
2790
|
}
|
|
2722
|
-
function
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
n = e.slice(r);
|
|
2728
|
-
break;
|
|
2729
|
-
} else {
|
|
2730
|
-
let n = e.slice(r, o);
|
|
2731
|
-
t.push(n), r = o + 1, e[r - 1] === "\r" && e[r] === "\n" && r++;
|
|
2732
|
-
}
|
|
2733
|
-
}
|
|
2734
|
-
return [t, n];
|
|
2791
|
+
function tn(e, t, n) {
|
|
2792
|
+
return n === 100 && e.charCodeAt(t + 1) === 97 && e.charCodeAt(t + 2) === 116 && e.charCodeAt(t + 3) === 97 && e.charCodeAt(t + 4) === 58;
|
|
2793
|
+
}
|
|
2794
|
+
function nn(e, t, n) {
|
|
2795
|
+
return n === 101 && e.charCodeAt(t + 1) === 118 && e.charCodeAt(t + 2) === 101 && e.charCodeAt(t + 3) === 110 && e.charCodeAt(t + 4) === 116 && e.charCodeAt(t + 5) === 58;
|
|
2735
2796
|
}
|
|
2736
2797
|
//#endregion
|
|
2737
|
-
//#region ../../node_modules/.pnpm/eventsource-parser@3.0.
|
|
2738
|
-
var
|
|
2798
|
+
//#region ../../node_modules/.pnpm/eventsource-parser@3.0.8/node_modules/eventsource-parser/dist/stream.js
|
|
2799
|
+
var rn = class extends TransformStream {
|
|
2739
2800
|
constructor({ onError: e, onRetry: t, onComment: n } = {}) {
|
|
2740
2801
|
let r;
|
|
2741
2802
|
super({
|
|
2742
2803
|
start(i) {
|
|
2743
|
-
r =
|
|
2804
|
+
r = en({
|
|
2744
2805
|
onEvent: (e) => {
|
|
2745
2806
|
i.enqueue(e);
|
|
2746
2807
|
},
|
|
@@ -2756,7 +2817,7 @@ var tn = class extends TransformStream {
|
|
|
2756
2817
|
}
|
|
2757
2818
|
});
|
|
2758
2819
|
}
|
|
2759
|
-
}, { btoa:
|
|
2820
|
+
}, { btoa: an, atob: on } = globalThis, sn = ({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
2760
2821
|
let i = () => {
|
|
2761
2822
|
let e = n.length, r = Array(t);
|
|
2762
2823
|
for (let i = 0; i < t; i++) r[i] = n[Math.random() * e | 0];
|
|
@@ -2768,8 +2829,8 @@ var tn = class extends TransformStream {
|
|
|
2768
2829
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
2769
2830
|
});
|
|
2770
2831
|
return () => `${e}${r}${i()}`;
|
|
2771
|
-
},
|
|
2772
|
-
function
|
|
2832
|
+
}, cn = sn();
|
|
2833
|
+
function ln(e) {
|
|
2773
2834
|
if (e == null) return {};
|
|
2774
2835
|
let t = {};
|
|
2775
2836
|
if (e instanceof Headers) e.forEach((e, n) => {
|
|
@@ -2781,12 +2842,12 @@ function sn(e) {
|
|
|
2781
2842
|
}
|
|
2782
2843
|
return t;
|
|
2783
2844
|
}
|
|
2784
|
-
var
|
|
2785
|
-
function
|
|
2845
|
+
var un = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/, dn = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
2846
|
+
function fn(e) {
|
|
2786
2847
|
let t = JSON.parse(e);
|
|
2787
|
-
return typeof t != "object" || !t ||
|
|
2848
|
+
return typeof t != "object" || !t || un.test(e) === !1 && dn.test(e) === !1 ? t : pn(t);
|
|
2788
2849
|
}
|
|
2789
|
-
function
|
|
2850
|
+
function pn(e) {
|
|
2790
2851
|
let t = [e];
|
|
2791
2852
|
for (; t.length;) {
|
|
2792
2853
|
let e = t;
|
|
@@ -2801,34 +2862,34 @@ function dn(e) {
|
|
|
2801
2862
|
}
|
|
2802
2863
|
return e;
|
|
2803
2864
|
}
|
|
2804
|
-
function
|
|
2865
|
+
function mn(e) {
|
|
2805
2866
|
let { stackTraceLimit: t } = Error;
|
|
2806
2867
|
try {
|
|
2807
2868
|
Error.stackTraceLimit = 0;
|
|
2808
2869
|
} catch {
|
|
2809
|
-
return
|
|
2870
|
+
return fn(e);
|
|
2810
2871
|
}
|
|
2811
2872
|
try {
|
|
2812
|
-
return
|
|
2873
|
+
return fn(e);
|
|
2813
2874
|
} finally {
|
|
2814
2875
|
Error.stackTraceLimit = t;
|
|
2815
2876
|
}
|
|
2816
2877
|
}
|
|
2817
|
-
function
|
|
2878
|
+
function hn(e) {
|
|
2818
2879
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
2819
2880
|
e.additionalProperties = !1;
|
|
2820
2881
|
let { properties: t } = e;
|
|
2821
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
2882
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = gn(t[e]);
|
|
2822
2883
|
}
|
|
2823
|
-
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(
|
|
2884
|
+
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(gn) : gn(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(gn)), e.allOf != null && (e.allOf = e.allOf.map(gn)), e.oneOf != null && (e.oneOf = e.oneOf.map(gn));
|
|
2824
2885
|
let { definitions: t } = e;
|
|
2825
|
-
if (t != null) for (let e of Object.keys(t)) t[e] =
|
|
2886
|
+
if (t != null) for (let e of Object.keys(t)) t[e] = gn(t[e]);
|
|
2826
2887
|
return e;
|
|
2827
2888
|
}
|
|
2828
|
-
function
|
|
2829
|
-
return typeof e == "boolean" ? e :
|
|
2889
|
+
function gn(e) {
|
|
2890
|
+
return typeof e == "boolean" ? e : hn(e);
|
|
2830
2891
|
}
|
|
2831
|
-
var
|
|
2892
|
+
var _n = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), vn = {
|
|
2832
2893
|
name: void 0,
|
|
2833
2894
|
$refStrategy: "root",
|
|
2834
2895
|
basePath: ["#"],
|
|
@@ -2848,24 +2909,24 @@ var hn = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to u
|
|
|
2848
2909
|
emailStrategy: "format:email",
|
|
2849
2910
|
base64Strategy: "contentEncoding:base64",
|
|
2850
2911
|
nameStrategy: "ref"
|
|
2851
|
-
},
|
|
2852
|
-
...
|
|
2912
|
+
}, yn = (e) => typeof e == "string" ? {
|
|
2913
|
+
...vn,
|
|
2853
2914
|
name: e
|
|
2854
2915
|
} : {
|
|
2855
|
-
...
|
|
2916
|
+
...vn,
|
|
2856
2917
|
...e
|
|
2857
2918
|
};
|
|
2858
|
-
function
|
|
2919
|
+
function q() {
|
|
2859
2920
|
return {};
|
|
2860
2921
|
}
|
|
2861
|
-
function
|
|
2922
|
+
function bn(e, t) {
|
|
2862
2923
|
let n = { type: "array" };
|
|
2863
|
-
return e.type?._def && e.type?._def?.typeName !==
|
|
2924
|
+
return e.type?._def && e.type?._def?.typeName !== K.ZodAny && (n.items = Z(e.type._def, {
|
|
2864
2925
|
...t,
|
|
2865
2926
|
currentPath: [...t.currentPath, "items"]
|
|
2866
2927
|
})), e.minLength && (n.minItems = e.minLength.value), e.maxLength && (n.maxItems = e.maxLength.value), e.exactLength && (n.minItems = e.exactLength.value, n.maxItems = e.exactLength.value), n;
|
|
2867
2928
|
}
|
|
2868
|
-
function
|
|
2929
|
+
function xn(e) {
|
|
2869
2930
|
let t = {
|
|
2870
2931
|
type: "integer",
|
|
2871
2932
|
format: "int64"
|
|
@@ -2884,16 +2945,16 @@ function yn(e) {
|
|
|
2884
2945
|
}
|
|
2885
2946
|
return t;
|
|
2886
2947
|
}
|
|
2887
|
-
function
|
|
2948
|
+
function Sn() {
|
|
2888
2949
|
return { type: "boolean" };
|
|
2889
2950
|
}
|
|
2890
|
-
function
|
|
2891
|
-
return
|
|
2951
|
+
function Cn(e, t) {
|
|
2952
|
+
return Z(e.type._def, t);
|
|
2892
2953
|
}
|
|
2893
|
-
var
|
|
2894
|
-
function
|
|
2954
|
+
var wn = (e, t) => Z(e.innerType._def, t);
|
|
2955
|
+
function Tn(e, t, n) {
|
|
2895
2956
|
let r = n ?? t.dateStrategy;
|
|
2896
|
-
if (Array.isArray(r)) return { anyOf: r.map((n, r) =>
|
|
2957
|
+
if (Array.isArray(r)) return { anyOf: r.map((n, r) => Tn(e, t, n)) };
|
|
2897
2958
|
switch (r) {
|
|
2898
2959
|
case "string":
|
|
2899
2960
|
case "format:date-time": return {
|
|
@@ -2904,10 +2965,10 @@ function Cn(e, t, n) {
|
|
|
2904
2965
|
type: "string",
|
|
2905
2966
|
format: "date"
|
|
2906
2967
|
};
|
|
2907
|
-
case "integer": return
|
|
2968
|
+
case "integer": return En(e);
|
|
2908
2969
|
}
|
|
2909
2970
|
}
|
|
2910
|
-
var
|
|
2971
|
+
var En = (e) => {
|
|
2911
2972
|
let t = {
|
|
2912
2973
|
type: "integer",
|
|
2913
2974
|
format: "unix-time"
|
|
@@ -2922,31 +2983,31 @@ var wn = (e) => {
|
|
|
2922
2983
|
}
|
|
2923
2984
|
return t;
|
|
2924
2985
|
};
|
|
2925
|
-
function
|
|
2986
|
+
function Dn(e, t) {
|
|
2926
2987
|
return {
|
|
2927
|
-
...
|
|
2988
|
+
...Z(e.innerType._def, t),
|
|
2928
2989
|
default: e.defaultValue()
|
|
2929
2990
|
};
|
|
2930
2991
|
}
|
|
2931
|
-
function
|
|
2932
|
-
return t.effectStrategy === "input" ?
|
|
2992
|
+
function On(e, t) {
|
|
2993
|
+
return t.effectStrategy === "input" ? Z(e.schema._def, t) : q();
|
|
2933
2994
|
}
|
|
2934
|
-
function
|
|
2995
|
+
function kn(e) {
|
|
2935
2996
|
return {
|
|
2936
2997
|
type: "string",
|
|
2937
2998
|
enum: Array.from(e.values)
|
|
2938
2999
|
};
|
|
2939
3000
|
}
|
|
2940
|
-
var
|
|
2941
|
-
function
|
|
2942
|
-
let n = [
|
|
3001
|
+
var An = (e) => "type" in e && e.type === "string" ? !1 : "allOf" in e;
|
|
3002
|
+
function jn(e, t) {
|
|
3003
|
+
let n = [Z(e.left._def, {
|
|
2943
3004
|
...t,
|
|
2944
3005
|
currentPath: [
|
|
2945
3006
|
...t.currentPath,
|
|
2946
3007
|
"allOf",
|
|
2947
3008
|
"0"
|
|
2948
3009
|
]
|
|
2949
|
-
}),
|
|
3010
|
+
}), Z(e.right._def, {
|
|
2950
3011
|
...t,
|
|
2951
3012
|
currentPath: [
|
|
2952
3013
|
...t.currentPath,
|
|
@@ -2955,7 +3016,7 @@ function kn(e, t) {
|
|
|
2955
3016
|
]
|
|
2956
3017
|
})].filter((e) => !!e), r = [];
|
|
2957
3018
|
return n.forEach((e) => {
|
|
2958
|
-
if (
|
|
3019
|
+
if (An(e)) r.push(...e.allOf);
|
|
2959
3020
|
else {
|
|
2960
3021
|
let t = e;
|
|
2961
3022
|
if ("additionalProperties" in e && e.additionalProperties === !1) {
|
|
@@ -2966,19 +3027,19 @@ function kn(e, t) {
|
|
|
2966
3027
|
}
|
|
2967
3028
|
}), r.length ? { allOf: r } : void 0;
|
|
2968
3029
|
}
|
|
2969
|
-
function
|
|
3030
|
+
function Mn(e) {
|
|
2970
3031
|
let t = typeof e.value;
|
|
2971
3032
|
return t !== "bigint" && t !== "number" && t !== "boolean" && t !== "string" ? { type: Array.isArray(e.value) ? "array" : "object" } : {
|
|
2972
3033
|
type: t === "bigint" ? "integer" : t,
|
|
2973
3034
|
const: e.value
|
|
2974
3035
|
};
|
|
2975
3036
|
}
|
|
2976
|
-
var
|
|
3037
|
+
var Nn = void 0, J = {
|
|
2977
3038
|
cuid: /^[cC][^\s-]{8,}$/,
|
|
2978
3039
|
cuid2: /^[0-9a-z]+$/,
|
|
2979
3040
|
ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
|
|
2980
3041
|
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
|
|
2981
|
-
emoji: () => (
|
|
3042
|
+
emoji: () => (Nn === void 0 && (Nn = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Nn),
|
|
2982
3043
|
uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
|
|
2983
3044
|
ipv4: /^(?:(?: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])$/,
|
|
2984
3045
|
ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
|
|
@@ -2989,7 +3050,7 @@ var jn = void 0, K = {
|
|
|
2989
3050
|
nanoid: /^[a-zA-Z0-9_-]{21}$/,
|
|
2990
3051
|
jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/
|
|
2991
3052
|
};
|
|
2992
|
-
function
|
|
3053
|
+
function Pn(e, t) {
|
|
2993
3054
|
let n = { type: "string" };
|
|
2994
3055
|
if (e.checks) for (let r of e.checks) switch (r.kind) {
|
|
2995
3056
|
case "min":
|
|
@@ -3001,87 +3062,87 @@ function Mn(e, t) {
|
|
|
3001
3062
|
case "email":
|
|
3002
3063
|
switch (t.emailStrategy) {
|
|
3003
3064
|
case "format:email":
|
|
3004
|
-
|
|
3065
|
+
Y(n, "email", r.message, t);
|
|
3005
3066
|
break;
|
|
3006
3067
|
case "format:idn-email":
|
|
3007
|
-
|
|
3068
|
+
Y(n, "idn-email", r.message, t);
|
|
3008
3069
|
break;
|
|
3009
3070
|
case "pattern:zod":
|
|
3010
|
-
|
|
3071
|
+
X(n, J.email, r.message, t);
|
|
3011
3072
|
break;
|
|
3012
3073
|
}
|
|
3013
3074
|
break;
|
|
3014
3075
|
case "url":
|
|
3015
|
-
|
|
3076
|
+
Y(n, "uri", r.message, t);
|
|
3016
3077
|
break;
|
|
3017
3078
|
case "uuid":
|
|
3018
|
-
|
|
3079
|
+
Y(n, "uuid", r.message, t);
|
|
3019
3080
|
break;
|
|
3020
3081
|
case "regex":
|
|
3021
|
-
|
|
3082
|
+
X(n, r.regex, r.message, t);
|
|
3022
3083
|
break;
|
|
3023
3084
|
case "cuid":
|
|
3024
|
-
|
|
3085
|
+
X(n, J.cuid, r.message, t);
|
|
3025
3086
|
break;
|
|
3026
3087
|
case "cuid2":
|
|
3027
|
-
|
|
3088
|
+
X(n, J.cuid2, r.message, t);
|
|
3028
3089
|
break;
|
|
3029
3090
|
case "startsWith":
|
|
3030
|
-
|
|
3091
|
+
X(n, RegExp(`^${Fn(r.value, t)}`), r.message, t);
|
|
3031
3092
|
break;
|
|
3032
3093
|
case "endsWith":
|
|
3033
|
-
|
|
3094
|
+
X(n, RegExp(`${Fn(r.value, t)}$`), r.message, t);
|
|
3034
3095
|
break;
|
|
3035
3096
|
case "datetime":
|
|
3036
|
-
|
|
3097
|
+
Y(n, "date-time", r.message, t);
|
|
3037
3098
|
break;
|
|
3038
3099
|
case "date":
|
|
3039
|
-
|
|
3100
|
+
Y(n, "date", r.message, t);
|
|
3040
3101
|
break;
|
|
3041
3102
|
case "time":
|
|
3042
|
-
|
|
3103
|
+
Y(n, "time", r.message, t);
|
|
3043
3104
|
break;
|
|
3044
3105
|
case "duration":
|
|
3045
|
-
|
|
3106
|
+
Y(n, "duration", r.message, t);
|
|
3046
3107
|
break;
|
|
3047
3108
|
case "length":
|
|
3048
3109
|
n.minLength = typeof n.minLength == "number" ? Math.max(n.minLength, r.value) : r.value, n.maxLength = typeof n.maxLength == "number" ? Math.min(n.maxLength, r.value) : r.value;
|
|
3049
3110
|
break;
|
|
3050
3111
|
case "includes":
|
|
3051
|
-
|
|
3112
|
+
X(n, RegExp(Fn(r.value, t)), r.message, t);
|
|
3052
3113
|
break;
|
|
3053
3114
|
case "ip":
|
|
3054
|
-
r.version !== "v6" &&
|
|
3115
|
+
r.version !== "v6" && Y(n, "ipv4", r.message, t), r.version !== "v4" && Y(n, "ipv6", r.message, t);
|
|
3055
3116
|
break;
|
|
3056
3117
|
case "base64url":
|
|
3057
|
-
|
|
3118
|
+
X(n, J.base64url, r.message, t);
|
|
3058
3119
|
break;
|
|
3059
3120
|
case "jwt":
|
|
3060
|
-
|
|
3121
|
+
X(n, J.jwt, r.message, t);
|
|
3061
3122
|
break;
|
|
3062
3123
|
case "cidr":
|
|
3063
|
-
r.version !== "v6" &&
|
|
3124
|
+
r.version !== "v6" && X(n, J.ipv4Cidr, r.message, t), r.version !== "v4" && X(n, J.ipv6Cidr, r.message, t);
|
|
3064
3125
|
break;
|
|
3065
3126
|
case "emoji":
|
|
3066
|
-
|
|
3127
|
+
X(n, J.emoji(), r.message, t);
|
|
3067
3128
|
break;
|
|
3068
3129
|
case "ulid":
|
|
3069
|
-
|
|
3130
|
+
X(n, J.ulid, r.message, t);
|
|
3070
3131
|
break;
|
|
3071
3132
|
case "base64":
|
|
3072
3133
|
switch (t.base64Strategy) {
|
|
3073
3134
|
case "format:binary":
|
|
3074
|
-
|
|
3135
|
+
Y(n, "binary", r.message, t);
|
|
3075
3136
|
break;
|
|
3076
3137
|
case "contentEncoding:base64":
|
|
3077
3138
|
n.contentEncoding = "base64";
|
|
3078
3139
|
break;
|
|
3079
3140
|
case "pattern:zod":
|
|
3080
|
-
|
|
3141
|
+
X(n, J.base64, r.message, t);
|
|
3081
3142
|
break;
|
|
3082
3143
|
}
|
|
3083
3144
|
break;
|
|
3084
|
-
case "nanoid":
|
|
3145
|
+
case "nanoid": X(n, J.nanoid, r.message, t);
|
|
3085
3146
|
case "toLowerCase":
|
|
3086
3147
|
case "toUpperCase":
|
|
3087
3148
|
case "trim": break;
|
|
@@ -3089,28 +3150,28 @@ function Mn(e, t) {
|
|
|
3089
3150
|
}
|
|
3090
3151
|
return n;
|
|
3091
3152
|
}
|
|
3092
|
-
function
|
|
3093
|
-
return t.patternStrategy === "escape" ?
|
|
3153
|
+
function Fn(e, t) {
|
|
3154
|
+
return t.patternStrategy === "escape" ? Ln(e) : e;
|
|
3094
3155
|
}
|
|
3095
|
-
var
|
|
3096
|
-
function
|
|
3156
|
+
var In = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
3157
|
+
function Ln(e) {
|
|
3097
3158
|
let t = "";
|
|
3098
|
-
for (let n = 0; n < e.length; n++)
|
|
3159
|
+
for (let n = 0; n < e.length; n++) In.has(e[n]) || (t += "\\"), t += e[n];
|
|
3099
3160
|
return t;
|
|
3100
3161
|
}
|
|
3101
|
-
function
|
|
3162
|
+
function Y(e, t, n, r) {
|
|
3102
3163
|
e.format || e.anyOf?.some((e) => e.format) ? (e.anyOf ||= [], e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push({
|
|
3103
3164
|
format: t,
|
|
3104
3165
|
...n && r.errorMessages && { errorMessage: { format: n } }
|
|
3105
3166
|
})) : e.format = t;
|
|
3106
3167
|
}
|
|
3107
|
-
function
|
|
3168
|
+
function X(e, t, n, r) {
|
|
3108
3169
|
e.pattern || e.allOf?.some((e) => e.pattern) ? (e.allOf ||= [], e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push({
|
|
3109
|
-
pattern:
|
|
3170
|
+
pattern: Rn(t, r),
|
|
3110
3171
|
...n && r.errorMessages && { errorMessage: { pattern: n } }
|
|
3111
|
-
})) : e.pattern =
|
|
3172
|
+
})) : e.pattern = Rn(t, r);
|
|
3112
3173
|
}
|
|
3113
|
-
function
|
|
3174
|
+
function Rn(e, t) {
|
|
3114
3175
|
if (!t.applyRegexFlags || !e.flags) return e.source;
|
|
3115
3176
|
let n = {
|
|
3116
3177
|
i: e.flags.includes("i"),
|
|
@@ -3157,26 +3218,26 @@ function In(e, t) {
|
|
|
3157
3218
|
}
|
|
3158
3219
|
return i;
|
|
3159
3220
|
}
|
|
3160
|
-
function
|
|
3221
|
+
function zn(e, t) {
|
|
3161
3222
|
let n = {
|
|
3162
3223
|
type: "object",
|
|
3163
|
-
additionalProperties:
|
|
3224
|
+
additionalProperties: Z(e.valueType._def, {
|
|
3164
3225
|
...t,
|
|
3165
3226
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
3166
3227
|
}) ?? t.allowedAdditionalProperties
|
|
3167
3228
|
};
|
|
3168
|
-
if (e.keyType?._def.typeName ===
|
|
3169
|
-
let { type: r, ...i } =
|
|
3229
|
+
if (e.keyType?._def.typeName === K.ZodString && e.keyType._def.checks?.length) {
|
|
3230
|
+
let { type: r, ...i } = Pn(e.keyType._def, t);
|
|
3170
3231
|
return {
|
|
3171
3232
|
...n,
|
|
3172
3233
|
propertyNames: i
|
|
3173
3234
|
};
|
|
3174
|
-
} else if (e.keyType?._def.typeName ===
|
|
3235
|
+
} else if (e.keyType?._def.typeName === K.ZodEnum) return {
|
|
3175
3236
|
...n,
|
|
3176
3237
|
propertyNames: { enum: e.keyType._def.values }
|
|
3177
3238
|
};
|
|
3178
|
-
else if (e.keyType?._def.typeName ===
|
|
3179
|
-
let { type: r, ...i } =
|
|
3239
|
+
else if (e.keyType?._def.typeName === K.ZodBranded && e.keyType._def.type._def.typeName === K.ZodString && e.keyType._def.type._def.checks?.length) {
|
|
3240
|
+
let { type: r, ...i } = Cn(e.keyType._def, t);
|
|
3180
3241
|
return {
|
|
3181
3242
|
...n,
|
|
3182
3243
|
propertyNames: i
|
|
@@ -3184,13 +3245,13 @@ function Ln(e, t) {
|
|
|
3184
3245
|
}
|
|
3185
3246
|
return n;
|
|
3186
3247
|
}
|
|
3187
|
-
function
|
|
3188
|
-
return t.mapStrategy === "record" ?
|
|
3248
|
+
function Bn(e, t) {
|
|
3249
|
+
return t.mapStrategy === "record" ? zn(e, t) : {
|
|
3189
3250
|
type: "array",
|
|
3190
3251
|
maxItems: 125,
|
|
3191
3252
|
items: {
|
|
3192
3253
|
type: "array",
|
|
3193
|
-
items: [
|
|
3254
|
+
items: [Z(e.keyType._def, {
|
|
3194
3255
|
...t,
|
|
3195
3256
|
currentPath: [
|
|
3196
3257
|
...t.currentPath,
|
|
@@ -3198,7 +3259,7 @@ function Rn(e, t) {
|
|
|
3198
3259
|
"items",
|
|
3199
3260
|
"0"
|
|
3200
3261
|
]
|
|
3201
|
-
}) ||
|
|
3262
|
+
}) || q(), Z(e.valueType._def, {
|
|
3202
3263
|
...t,
|
|
3203
3264
|
currentPath: [
|
|
3204
3265
|
...t.currentPath,
|
|
@@ -3206,37 +3267,37 @@ function Rn(e, t) {
|
|
|
3206
3267
|
"items",
|
|
3207
3268
|
"1"
|
|
3208
3269
|
]
|
|
3209
|
-
}) ||
|
|
3270
|
+
}) || q()],
|
|
3210
3271
|
minItems: 2,
|
|
3211
3272
|
maxItems: 2
|
|
3212
3273
|
}
|
|
3213
3274
|
};
|
|
3214
3275
|
}
|
|
3215
|
-
function
|
|
3276
|
+
function Vn(e) {
|
|
3216
3277
|
let t = e.values, n = Object.keys(e.values).filter((e) => typeof t[t[e]] != "number").map((e) => t[e]), r = Array.from(new Set(n.map((e) => typeof e)));
|
|
3217
3278
|
return {
|
|
3218
3279
|
type: r.length === 1 ? r[0] === "string" ? "string" : "number" : ["string", "number"],
|
|
3219
3280
|
enum: n
|
|
3220
3281
|
};
|
|
3221
3282
|
}
|
|
3222
|
-
function
|
|
3223
|
-
return { not:
|
|
3283
|
+
function Hn() {
|
|
3284
|
+
return { not: q() };
|
|
3224
3285
|
}
|
|
3225
|
-
function
|
|
3286
|
+
function Un() {
|
|
3226
3287
|
return { type: "null" };
|
|
3227
3288
|
}
|
|
3228
|
-
var
|
|
3289
|
+
var Wn = {
|
|
3229
3290
|
ZodString: "string",
|
|
3230
3291
|
ZodNumber: "number",
|
|
3231
3292
|
ZodBigInt: "integer",
|
|
3232
3293
|
ZodBoolean: "boolean",
|
|
3233
3294
|
ZodNull: "null"
|
|
3234
3295
|
};
|
|
3235
|
-
function
|
|
3296
|
+
function Gn(e, t) {
|
|
3236
3297
|
let n = e.options instanceof Map ? Array.from(e.options.values()) : e.options;
|
|
3237
|
-
if (n.every((e) => e._def.typeName in
|
|
3298
|
+
if (n.every((e) => e._def.typeName in Wn && (!e._def.checks || !e._def.checks.length))) {
|
|
3238
3299
|
let e = n.reduce((e, t) => {
|
|
3239
|
-
let n =
|
|
3300
|
+
let n = Wn[t._def.typeName];
|
|
3240
3301
|
return n && !e.includes(n) ? [...e, n] : e;
|
|
3241
3302
|
}, []);
|
|
3242
3303
|
return { type: e.length > 1 ? e : e[0] };
|
|
@@ -3263,10 +3324,10 @@ function Un(e, t) {
|
|
|
3263
3324
|
type: "string",
|
|
3264
3325
|
enum: n.reduce((e, t) => [...e, ...t._def.values.filter((t) => !e.includes(t))], [])
|
|
3265
3326
|
};
|
|
3266
|
-
return
|
|
3327
|
+
return Kn(e, t);
|
|
3267
3328
|
}
|
|
3268
|
-
var
|
|
3269
|
-
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) =>
|
|
3329
|
+
var Kn = (e, t) => {
|
|
3330
|
+
let n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map((e, n) => Z(e._def, {
|
|
3270
3331
|
...t,
|
|
3271
3332
|
currentPath: [
|
|
3272
3333
|
...t.currentPath,
|
|
@@ -3276,15 +3337,15 @@ var Wn = (e, t) => {
|
|
|
3276
3337
|
})).filter((e) => !!e && (!t.strictUnions || typeof e == "object" && Object.keys(e).length > 0));
|
|
3277
3338
|
return n.length ? { anyOf: n } : void 0;
|
|
3278
3339
|
};
|
|
3279
|
-
function
|
|
3340
|
+
function qn(e, t) {
|
|
3280
3341
|
if ([
|
|
3281
3342
|
"ZodString",
|
|
3282
3343
|
"ZodNumber",
|
|
3283
3344
|
"ZodBigInt",
|
|
3284
3345
|
"ZodBoolean",
|
|
3285
3346
|
"ZodNull"
|
|
3286
|
-
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [
|
|
3287
|
-
let n =
|
|
3347
|
+
].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Wn[e.innerType._def.typeName], "null"] };
|
|
3348
|
+
let n = Z(e.innerType._def, {
|
|
3288
3349
|
...t,
|
|
3289
3350
|
currentPath: [
|
|
3290
3351
|
...t.currentPath,
|
|
@@ -3294,7 +3355,7 @@ function Gn(e, t) {
|
|
|
3294
3355
|
});
|
|
3295
3356
|
return n && { anyOf: [n, { type: "null" }] };
|
|
3296
3357
|
}
|
|
3297
|
-
function
|
|
3358
|
+
function Jn(e) {
|
|
3298
3359
|
let t = { type: "number" };
|
|
3299
3360
|
if (!e.checks) return t;
|
|
3300
3361
|
for (let n of e.checks) switch (n.kind) {
|
|
@@ -3313,7 +3374,7 @@ function Kn(e) {
|
|
|
3313
3374
|
}
|
|
3314
3375
|
return t;
|
|
3315
3376
|
}
|
|
3316
|
-
function
|
|
3377
|
+
function Yn(e, t) {
|
|
3317
3378
|
let n = {
|
|
3318
3379
|
type: "object",
|
|
3319
3380
|
properties: {}
|
|
@@ -3321,7 +3382,7 @@ function qn(e, t) {
|
|
|
3321
3382
|
for (let e in i) {
|
|
3322
3383
|
let a = i[e];
|
|
3323
3384
|
if (a === void 0 || a._def === void 0) continue;
|
|
3324
|
-
let o =
|
|
3385
|
+
let o = Zn(a), s = Z(a._def, {
|
|
3325
3386
|
...t,
|
|
3326
3387
|
currentPath: [
|
|
3327
3388
|
...t.currentPath,
|
|
@@ -3337,11 +3398,11 @@ function qn(e, t) {
|
|
|
3337
3398
|
s !== void 0 && (n.properties[e] = s, o || r.push(e));
|
|
3338
3399
|
}
|
|
3339
3400
|
r.length && (n.required = r);
|
|
3340
|
-
let a =
|
|
3401
|
+
let a = Xn(e, t);
|
|
3341
3402
|
return a !== void 0 && (n.additionalProperties = a), n;
|
|
3342
3403
|
}
|
|
3343
|
-
function
|
|
3344
|
-
if (e.catchall._def.typeName !== "ZodNever") return
|
|
3404
|
+
function Xn(e, t) {
|
|
3405
|
+
if (e.catchall._def.typeName !== "ZodNever") return Z(e.catchall._def, {
|
|
3345
3406
|
...t,
|
|
3346
3407
|
currentPath: [...t.currentPath, "additionalProperties"]
|
|
3347
3408
|
});
|
|
@@ -3351,16 +3412,16 @@ function Jn(e, t) {
|
|
|
3351
3412
|
case "strip": return t.removeAdditionalStrategy === "strict" ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties;
|
|
3352
3413
|
}
|
|
3353
3414
|
}
|
|
3354
|
-
function
|
|
3415
|
+
function Zn(e) {
|
|
3355
3416
|
try {
|
|
3356
3417
|
return e.isOptional();
|
|
3357
3418
|
} catch {
|
|
3358
3419
|
return !0;
|
|
3359
3420
|
}
|
|
3360
3421
|
}
|
|
3361
|
-
var
|
|
3362
|
-
if (t.currentPath.toString() === t.propertyPath?.toString()) return
|
|
3363
|
-
let n =
|
|
3422
|
+
var Qn = (e, t) => {
|
|
3423
|
+
if (t.currentPath.toString() === t.propertyPath?.toString()) return Z(e.innerType._def, t);
|
|
3424
|
+
let n = Z(e.innerType._def, {
|
|
3364
3425
|
...t,
|
|
3365
3426
|
currentPath: [
|
|
3366
3427
|
...t.currentPath,
|
|
@@ -3368,11 +3429,11 @@ var Xn = (e, t) => {
|
|
|
3368
3429
|
"1"
|
|
3369
3430
|
]
|
|
3370
3431
|
});
|
|
3371
|
-
return n ? { anyOf: [{ not:
|
|
3372
|
-
},
|
|
3373
|
-
if (t.pipeStrategy === "input") return
|
|
3374
|
-
if (t.pipeStrategy === "output") return
|
|
3375
|
-
let n =
|
|
3432
|
+
return n ? { anyOf: [{ not: q() }, n] } : q();
|
|
3433
|
+
}, $n = (e, t) => {
|
|
3434
|
+
if (t.pipeStrategy === "input") return Z(e.in._def, t);
|
|
3435
|
+
if (t.pipeStrategy === "output") return Z(e.out._def, t);
|
|
3436
|
+
let n = Z(e.in._def, {
|
|
3376
3437
|
...t,
|
|
3377
3438
|
currentPath: [
|
|
3378
3439
|
...t.currentPath,
|
|
@@ -3380,7 +3441,7 @@ var Xn = (e, t) => {
|
|
|
3380
3441
|
"0"
|
|
3381
3442
|
]
|
|
3382
3443
|
});
|
|
3383
|
-
return { allOf: [n,
|
|
3444
|
+
return { allOf: [n, Z(e.out._def, {
|
|
3384
3445
|
...t,
|
|
3385
3446
|
currentPath: [
|
|
3386
3447
|
...t.currentPath,
|
|
@@ -3389,25 +3450,25 @@ var Xn = (e, t) => {
|
|
|
3389
3450
|
]
|
|
3390
3451
|
})].filter((e) => e !== void 0) };
|
|
3391
3452
|
};
|
|
3392
|
-
function
|
|
3393
|
-
return
|
|
3453
|
+
function er(e, t) {
|
|
3454
|
+
return Z(e.type._def, t);
|
|
3394
3455
|
}
|
|
3395
|
-
function
|
|
3456
|
+
function tr(e, t) {
|
|
3396
3457
|
let n = {
|
|
3397
3458
|
type: "array",
|
|
3398
3459
|
uniqueItems: !0,
|
|
3399
|
-
items:
|
|
3460
|
+
items: Z(e.valueType._def, {
|
|
3400
3461
|
...t,
|
|
3401
3462
|
currentPath: [...t.currentPath, "items"]
|
|
3402
3463
|
})
|
|
3403
3464
|
};
|
|
3404
3465
|
return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
|
|
3405
3466
|
}
|
|
3406
|
-
function
|
|
3467
|
+
function nr(e, t) {
|
|
3407
3468
|
return e.rest ? {
|
|
3408
3469
|
type: "array",
|
|
3409
3470
|
minItems: e.items.length,
|
|
3410
|
-
items: e.items.map((e, n) =>
|
|
3471
|
+
items: e.items.map((e, n) => Z(e._def, {
|
|
3411
3472
|
...t,
|
|
3412
3473
|
currentPath: [
|
|
3413
3474
|
...t.currentPath,
|
|
@@ -3415,7 +3476,7 @@ function er(e, t) {
|
|
|
3415
3476
|
`${n}`
|
|
3416
3477
|
]
|
|
3417
3478
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], []),
|
|
3418
|
-
additionalItems:
|
|
3479
|
+
additionalItems: Z(e.rest._def, {
|
|
3419
3480
|
...t,
|
|
3420
3481
|
currentPath: [...t.currentPath, "additionalItems"]
|
|
3421
3482
|
})
|
|
@@ -3423,7 +3484,7 @@ function er(e, t) {
|
|
|
3423
3484
|
type: "array",
|
|
3424
3485
|
minItems: e.items.length,
|
|
3425
3486
|
maxItems: e.items.length,
|
|
3426
|
-
items: e.items.map((e, n) =>
|
|
3487
|
+
items: e.items.map((e, n) => Z(e._def, {
|
|
3427
3488
|
...t,
|
|
3428
3489
|
currentPath: [
|
|
3429
3490
|
...t.currentPath,
|
|
@@ -3433,65 +3494,65 @@ function er(e, t) {
|
|
|
3433
3494
|
})).reduce((e, t) => t === void 0 ? e : [...e, t], [])
|
|
3434
3495
|
};
|
|
3435
3496
|
}
|
|
3436
|
-
function
|
|
3437
|
-
return { not:
|
|
3497
|
+
function rr() {
|
|
3498
|
+
return { not: q() };
|
|
3438
3499
|
}
|
|
3439
|
-
function
|
|
3440
|
-
return
|
|
3500
|
+
function ir() {
|
|
3501
|
+
return q();
|
|
3441
3502
|
}
|
|
3442
|
-
var
|
|
3503
|
+
var ar = (e, t) => Z(e.innerType._def, t), or = (e, t, n) => {
|
|
3443
3504
|
switch (t) {
|
|
3444
|
-
case
|
|
3445
|
-
case
|
|
3446
|
-
case
|
|
3447
|
-
case
|
|
3448
|
-
case
|
|
3449
|
-
case
|
|
3450
|
-
case
|
|
3451
|
-
case
|
|
3452
|
-
case
|
|
3453
|
-
case
|
|
3454
|
-
case
|
|
3455
|
-
case
|
|
3456
|
-
case
|
|
3457
|
-
case
|
|
3458
|
-
case
|
|
3459
|
-
case
|
|
3460
|
-
case
|
|
3461
|
-
case
|
|
3462
|
-
case
|
|
3463
|
-
case
|
|
3464
|
-
case
|
|
3465
|
-
case
|
|
3466
|
-
case
|
|
3467
|
-
case
|
|
3468
|
-
case
|
|
3469
|
-
case
|
|
3470
|
-
case
|
|
3471
|
-
case
|
|
3472
|
-
case
|
|
3473
|
-
case
|
|
3474
|
-
case
|
|
3475
|
-
case
|
|
3476
|
-
case
|
|
3477
|
-
case
|
|
3478
|
-
case
|
|
3479
|
-
case
|
|
3505
|
+
case K.ZodString: return Pn(e, n);
|
|
3506
|
+
case K.ZodNumber: return Jn(e);
|
|
3507
|
+
case K.ZodObject: return Yn(e, n);
|
|
3508
|
+
case K.ZodBigInt: return xn(e);
|
|
3509
|
+
case K.ZodBoolean: return Sn();
|
|
3510
|
+
case K.ZodDate: return Tn(e, n);
|
|
3511
|
+
case K.ZodUndefined: return rr();
|
|
3512
|
+
case K.ZodNull: return Un();
|
|
3513
|
+
case K.ZodArray: return bn(e, n);
|
|
3514
|
+
case K.ZodUnion:
|
|
3515
|
+
case K.ZodDiscriminatedUnion: return Gn(e, n);
|
|
3516
|
+
case K.ZodIntersection: return jn(e, n);
|
|
3517
|
+
case K.ZodTuple: return nr(e, n);
|
|
3518
|
+
case K.ZodRecord: return zn(e, n);
|
|
3519
|
+
case K.ZodLiteral: return Mn(e);
|
|
3520
|
+
case K.ZodEnum: return kn(e);
|
|
3521
|
+
case K.ZodNativeEnum: return Vn(e);
|
|
3522
|
+
case K.ZodNullable: return qn(e, n);
|
|
3523
|
+
case K.ZodOptional: return Qn(e, n);
|
|
3524
|
+
case K.ZodMap: return Bn(e, n);
|
|
3525
|
+
case K.ZodSet: return tr(e, n);
|
|
3526
|
+
case K.ZodLazy: return () => e.getter()._def;
|
|
3527
|
+
case K.ZodPromise: return er(e, n);
|
|
3528
|
+
case K.ZodNaN:
|
|
3529
|
+
case K.ZodNever: return Hn();
|
|
3530
|
+
case K.ZodEffects: return On(e, n);
|
|
3531
|
+
case K.ZodAny: return q();
|
|
3532
|
+
case K.ZodUnknown: return ir();
|
|
3533
|
+
case K.ZodDefault: return Dn(e, n);
|
|
3534
|
+
case K.ZodBranded: return Cn(e, n);
|
|
3535
|
+
case K.ZodReadonly: return ar(e, n);
|
|
3536
|
+
case K.ZodCatch: return wn(e, n);
|
|
3537
|
+
case K.ZodPipeline: return $n(e, n);
|
|
3538
|
+
case K.ZodFunction:
|
|
3539
|
+
case K.ZodVoid:
|
|
3540
|
+
case K.ZodSymbol: return;
|
|
3480
3541
|
default: return /* @__PURE__ */ ((e) => void 0)(t);
|
|
3481
3542
|
}
|
|
3482
|
-
},
|
|
3543
|
+
}, sr = (e, t) => {
|
|
3483
3544
|
let n = 0;
|
|
3484
3545
|
for (; n < e.length && n < t.length && e[n] === t[n]; n++);
|
|
3485
3546
|
return [(e.length - n).toString(), ...t.slice(n)].join("/");
|
|
3486
3547
|
};
|
|
3487
|
-
function
|
|
3548
|
+
function Z(e, t, n = !1) {
|
|
3488
3549
|
let r = t.seen.get(e);
|
|
3489
3550
|
if (t.override) {
|
|
3490
3551
|
let i = t.override?.call(t, e, t, r, n);
|
|
3491
|
-
if (i !==
|
|
3552
|
+
if (i !== _n) return i;
|
|
3492
3553
|
}
|
|
3493
3554
|
if (r && !n) {
|
|
3494
|
-
let e =
|
|
3555
|
+
let e = cr(r, t);
|
|
3495
3556
|
if (e !== void 0) return e;
|
|
3496
3557
|
}
|
|
3497
3558
|
let i = {
|
|
@@ -3500,22 +3561,22 @@ function Y(e, t, n = !1) {
|
|
|
3500
3561
|
jsonSchema: void 0
|
|
3501
3562
|
};
|
|
3502
3563
|
t.seen.set(e, i);
|
|
3503
|
-
let a =
|
|
3504
|
-
if (o &&
|
|
3564
|
+
let a = or(e, e.typeName, t), o = typeof a == "function" ? Z(a(), t) : a;
|
|
3565
|
+
if (o && lr(e, t, o), t.postProcess) {
|
|
3505
3566
|
let n = t.postProcess(o, e, t);
|
|
3506
3567
|
return i.jsonSchema = o, n;
|
|
3507
3568
|
}
|
|
3508
3569
|
return i.jsonSchema = o, o;
|
|
3509
3570
|
}
|
|
3510
|
-
var
|
|
3571
|
+
var cr = (e, t) => {
|
|
3511
3572
|
switch (t.$refStrategy) {
|
|
3512
3573
|
case "root": return { $ref: e.path.join("/") };
|
|
3513
|
-
case "relative": return { $ref:
|
|
3574
|
+
case "relative": return { $ref: sr(t.currentPath, e.path) };
|
|
3514
3575
|
case "none":
|
|
3515
|
-
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),
|
|
3576
|
+
case "seen": return e.path.length < t.currentPath.length && e.path.every((e, n) => t.currentPath[n] === e) ? (console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`), q()) : t.$refStrategy === "seen" ? q() : void 0;
|
|
3516
3577
|
}
|
|
3517
|
-
},
|
|
3518
|
-
let t =
|
|
3578
|
+
}, lr = (e, t, n) => (e.description && (n.description = e.description), n), ur = (e) => {
|
|
3579
|
+
let t = yn(e), n = t.name === void 0 ? t.basePath : [
|
|
3519
3580
|
...t.basePath,
|
|
3520
3581
|
t.definitionPath,
|
|
3521
3582
|
t.name
|
|
@@ -3534,25 +3595,25 @@ var or = (e, t) => {
|
|
|
3534
3595
|
jsonSchema: void 0
|
|
3535
3596
|
}]))
|
|
3536
3597
|
};
|
|
3537
|
-
},
|
|
3538
|
-
let n =
|
|
3598
|
+
}, dr = (e, t) => {
|
|
3599
|
+
let n = ur(t), r = typeof t == "object" && t.definitions ? Object.entries(t.definitions).reduce((e, [t, r]) => ({
|
|
3539
3600
|
...e,
|
|
3540
|
-
[t]:
|
|
3601
|
+
[t]: Z(r._def, {
|
|
3541
3602
|
...n,
|
|
3542
3603
|
currentPath: [
|
|
3543
3604
|
...n.basePath,
|
|
3544
3605
|
n.definitionPath,
|
|
3545
3606
|
t
|
|
3546
3607
|
]
|
|
3547
|
-
}, !0) ??
|
|
3548
|
-
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a =
|
|
3608
|
+
}, !0) ?? q()
|
|
3609
|
+
}), {}) : void 0, i = typeof t == "string" ? t : t?.nameStrategy === "title" ? void 0 : t?.name, a = Z(e._def, i === void 0 ? n : {
|
|
3549
3610
|
...n,
|
|
3550
3611
|
currentPath: [
|
|
3551
3612
|
...n.basePath,
|
|
3552
3613
|
n.definitionPath,
|
|
3553
3614
|
i
|
|
3554
3615
|
]
|
|
3555
|
-
}, !1) ??
|
|
3616
|
+
}, !1) ?? q(), o = typeof t == "object" && t.name !== void 0 && t.nameStrategy === "title" ? t.name : void 0;
|
|
3556
3617
|
o !== void 0 && (a.title = o);
|
|
3557
3618
|
let s = i === void 0 ? r ? {
|
|
3558
3619
|
...a,
|
|
@@ -3569,14 +3630,14 @@ var or = (e, t) => {
|
|
|
3569
3630
|
}
|
|
3570
3631
|
};
|
|
3571
3632
|
return s.$schema = "http://json-schema.org/draft-07/schema#", s;
|
|
3572
|
-
},
|
|
3573
|
-
function
|
|
3633
|
+
}, fr = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
3634
|
+
function pr(e) {
|
|
3574
3635
|
let t;
|
|
3575
3636
|
return () => (t ??= e(), t);
|
|
3576
3637
|
}
|
|
3577
|
-
function
|
|
3638
|
+
function mr(e, { validate: t } = {}) {
|
|
3578
3639
|
return {
|
|
3579
|
-
[
|
|
3640
|
+
[fr]: !0,
|
|
3580
3641
|
_type: void 0,
|
|
3581
3642
|
get jsonSchema() {
|
|
3582
3643
|
return typeof e == "function" && (e = e()), e;
|
|
@@ -3584,33 +3645,33 @@ function fr(e, { validate: t } = {}) {
|
|
|
3584
3645
|
validate: t
|
|
3585
3646
|
};
|
|
3586
3647
|
}
|
|
3587
|
-
function
|
|
3588
|
-
return typeof e == "object" && !!e &&
|
|
3648
|
+
function hr(e) {
|
|
3649
|
+
return typeof e == "object" && !!e && fr in e && e[fr] === !0 && "jsonSchema" in e && "validate" in e;
|
|
3589
3650
|
}
|
|
3590
|
-
function
|
|
3591
|
-
return e == null ?
|
|
3651
|
+
function gr(e) {
|
|
3652
|
+
return e == null ? mr({
|
|
3592
3653
|
properties: {},
|
|
3593
3654
|
additionalProperties: !1
|
|
3594
|
-
}) :
|
|
3655
|
+
}) : hr(e) ? e : "~standard" in e ? e["~standard"].vendor === "zod" ? xr(e) : _r(e) : e();
|
|
3595
3656
|
}
|
|
3596
|
-
function
|
|
3597
|
-
return
|
|
3657
|
+
function _r(e) {
|
|
3658
|
+
return mr(() => hn(e["~standard"].jsonSchema.input({ target: "draft-07" })), { validate: async (t) => {
|
|
3598
3659
|
let n = await e["~standard"].validate(t);
|
|
3599
3660
|
return "value" in n ? {
|
|
3600
3661
|
success: !0,
|
|
3601
3662
|
value: n.value
|
|
3602
3663
|
} : {
|
|
3603
3664
|
success: !1,
|
|
3604
|
-
error: new
|
|
3665
|
+
error: new M({
|
|
3605
3666
|
value: t,
|
|
3606
3667
|
cause: n.issues
|
|
3607
3668
|
})
|
|
3608
3669
|
};
|
|
3609
3670
|
} });
|
|
3610
3671
|
}
|
|
3611
|
-
function
|
|
3672
|
+
function vr(e, t) {
|
|
3612
3673
|
let n = t?.useReferences ?? !1;
|
|
3613
|
-
return
|
|
3674
|
+
return mr(() => dr(e, { $refStrategy: n ? "root" : "none" }), { validate: async (t) => {
|
|
3614
3675
|
let n = await e.safeParseAsync(t);
|
|
3615
3676
|
return n.success ? {
|
|
3616
3677
|
success: !0,
|
|
@@ -3621,9 +3682,9 @@ function gr(e, t) {
|
|
|
3621
3682
|
};
|
|
3622
3683
|
} });
|
|
3623
3684
|
}
|
|
3624
|
-
function
|
|
3685
|
+
function yr(e, t) {
|
|
3625
3686
|
let i = t?.useReferences ?? !1;
|
|
3626
|
-
return
|
|
3687
|
+
return mr(() => hn(n(e, {
|
|
3627
3688
|
target: "draft-7",
|
|
3628
3689
|
io: "input",
|
|
3629
3690
|
reused: i ? "ref" : "inline"
|
|
@@ -3638,27 +3699,27 @@ function _r(e, t) {
|
|
|
3638
3699
|
};
|
|
3639
3700
|
} });
|
|
3640
3701
|
}
|
|
3641
|
-
function
|
|
3702
|
+
function br(e) {
|
|
3642
3703
|
return "_zod" in e;
|
|
3643
3704
|
}
|
|
3644
|
-
function
|
|
3645
|
-
return
|
|
3705
|
+
function xr(e, t) {
|
|
3706
|
+
return br(e) ? yr(e, t) : vr(e, t);
|
|
3646
3707
|
}
|
|
3647
|
-
async function
|
|
3648
|
-
let r = await
|
|
3708
|
+
async function Sr({ value: e, schema: t, context: n }) {
|
|
3709
|
+
let r = await Cr({
|
|
3649
3710
|
value: e,
|
|
3650
3711
|
schema: t,
|
|
3651
3712
|
context: n
|
|
3652
3713
|
});
|
|
3653
|
-
if (!r.success) throw
|
|
3714
|
+
if (!r.success) throw M.wrap({
|
|
3654
3715
|
value: e,
|
|
3655
3716
|
cause: r.error,
|
|
3656
3717
|
context: n
|
|
3657
3718
|
});
|
|
3658
3719
|
return r.value;
|
|
3659
3720
|
}
|
|
3660
|
-
async function
|
|
3661
|
-
let r =
|
|
3721
|
+
async function Cr({ value: e, schema: t, context: n }) {
|
|
3722
|
+
let r = gr(t);
|
|
3662
3723
|
try {
|
|
3663
3724
|
if (r.validate == null) return {
|
|
3664
3725
|
success: !0,
|
|
@@ -3672,7 +3733,7 @@ async function xr({ value: e, schema: t, context: n }) {
|
|
|
3672
3733
|
rawValue: e
|
|
3673
3734
|
} : {
|
|
3674
3735
|
success: !1,
|
|
3675
|
-
error:
|
|
3736
|
+
error: M.wrap({
|
|
3676
3737
|
value: e,
|
|
3677
3738
|
cause: t.error,
|
|
3678
3739
|
context: n
|
|
@@ -3682,7 +3743,7 @@ async function xr({ value: e, schema: t, context: n }) {
|
|
|
3682
3743
|
} catch (t) {
|
|
3683
3744
|
return {
|
|
3684
3745
|
success: !1,
|
|
3685
|
-
error:
|
|
3746
|
+
error: M.wrap({
|
|
3686
3747
|
value: e,
|
|
3687
3748
|
cause: t,
|
|
3688
3749
|
context: n
|
|
@@ -3691,14 +3752,14 @@ async function xr({ value: e, schema: t, context: n }) {
|
|
|
3691
3752
|
};
|
|
3692
3753
|
}
|
|
3693
3754
|
}
|
|
3694
|
-
async function
|
|
3755
|
+
async function wr({ text: e, schema: t }) {
|
|
3695
3756
|
try {
|
|
3696
|
-
let n =
|
|
3757
|
+
let n = mn(e);
|
|
3697
3758
|
return t == null ? {
|
|
3698
3759
|
success: !0,
|
|
3699
3760
|
value: n,
|
|
3700
3761
|
rawValue: n
|
|
3701
|
-
} : await
|
|
3762
|
+
} : await Cr({
|
|
3702
3763
|
value: n,
|
|
3703
3764
|
schema: t
|
|
3704
3765
|
});
|
|
@@ -3713,88 +3774,88 @@ async function Sr({ text: e, schema: t }) {
|
|
|
3713
3774
|
};
|
|
3714
3775
|
}
|
|
3715
3776
|
}
|
|
3716
|
-
function
|
|
3717
|
-
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
3718
|
-
e !== "[DONE]" && n.enqueue(await
|
|
3777
|
+
function Tr({ stream: e, schema: t }) {
|
|
3778
|
+
return e.pipeThrough(new TextDecoderStream()).pipeThrough(new rn()).pipeThrough(new TransformStream({ async transform({ data: e }, n) {
|
|
3779
|
+
e !== "[DONE]" && n.enqueue(await wr({
|
|
3719
3780
|
text: e,
|
|
3720
3781
|
schema: t
|
|
3721
3782
|
}));
|
|
3722
3783
|
} }));
|
|
3723
3784
|
}
|
|
3724
|
-
async function
|
|
3785
|
+
async function Er(e) {
|
|
3725
3786
|
return typeof e == "function" && (e = e()), Promise.resolve(e);
|
|
3726
3787
|
}
|
|
3727
3788
|
//#endregion
|
|
3728
|
-
//#region ../../node_modules/.pnpm/ai@6.0.138_zod@4.3
|
|
3729
|
-
var
|
|
3730
|
-
for (var n in t)
|
|
3789
|
+
//#region ../../node_modules/.pnpm/ai@6.0.138_zod@4.4.3/node_modules/ai/dist/index.mjs
|
|
3790
|
+
var Dr = Object.defineProperty, Or = (e, t) => {
|
|
3791
|
+
for (var n in t) Dr(e, n, {
|
|
3731
3792
|
get: t[n],
|
|
3732
3793
|
enumerable: !0
|
|
3733
3794
|
});
|
|
3734
|
-
},
|
|
3795
|
+
}, kr = "AI_NoObjectGeneratedError", Ar = `vercel.ai.error.${kr}`, jr = Symbol.for(Ar), Mr, Nr = class extends O {
|
|
3735
3796
|
constructor({ message: e = "No object generated.", cause: t, text: n, response: r, usage: i, finishReason: a }) {
|
|
3736
3797
|
super({
|
|
3737
|
-
name:
|
|
3798
|
+
name: kr,
|
|
3738
3799
|
message: e,
|
|
3739
3800
|
cause: t
|
|
3740
|
-
}), this[
|
|
3801
|
+
}), this[Mr] = !0, this.text = n, this.response = r, this.usage = i, this.finishReason = a;
|
|
3741
3802
|
}
|
|
3742
3803
|
static isInstance(e) {
|
|
3743
|
-
return O.hasMarker(e,
|
|
3804
|
+
return O.hasMarker(e, Ar);
|
|
3744
3805
|
}
|
|
3745
3806
|
};
|
|
3746
|
-
|
|
3747
|
-
var
|
|
3807
|
+
Mr = jr;
|
|
3808
|
+
var Pr = "AI_UIMessageStreamError", Fr = `vercel.ai.error.${Pr}`, Ir = Symbol.for(Fr), Lr, Rr = class extends O {
|
|
3748
3809
|
constructor({ chunkType: e, chunkId: t, message: n }) {
|
|
3749
3810
|
super({
|
|
3750
|
-
name:
|
|
3811
|
+
name: Pr,
|
|
3751
3812
|
message: n
|
|
3752
|
-
}), this[
|
|
3813
|
+
}), this[Lr] = !0, this.chunkType = e, this.chunkId = t;
|
|
3753
3814
|
}
|
|
3754
3815
|
static isInstance(e) {
|
|
3755
|
-
return O.hasMarker(e,
|
|
3816
|
+
return O.hasMarker(e, Fr);
|
|
3756
3817
|
}
|
|
3757
3818
|
};
|
|
3758
|
-
|
|
3759
|
-
var
|
|
3819
|
+
Lr = Ir;
|
|
3820
|
+
var zr = v([
|
|
3760
3821
|
_(),
|
|
3761
3822
|
h(Uint8Array),
|
|
3762
3823
|
h(ArrayBuffer),
|
|
3763
3824
|
g((e) => globalThis.Buffer?.isBuffer(e) ?? !1, { message: "Must be a Buffer" })
|
|
3764
|
-
]),
|
|
3825
|
+
]), Br = ee(() => v([
|
|
3765
3826
|
u(),
|
|
3766
3827
|
_(),
|
|
3767
3828
|
m(),
|
|
3768
3829
|
p(),
|
|
3769
|
-
l(_(),
|
|
3770
|
-
a(
|
|
3771
|
-
])), Q = l(_(), l(_(),
|
|
3830
|
+
l(_(), Br.optional()),
|
|
3831
|
+
a(Br)
|
|
3832
|
+
])), Q = l(_(), l(_(), Br.optional())), Vr = d({
|
|
3772
3833
|
type: c("text"),
|
|
3773
3834
|
text: _(),
|
|
3774
3835
|
providerOptions: Q.optional()
|
|
3775
|
-
}),
|
|
3836
|
+
}), Hr = d({
|
|
3776
3837
|
type: c("image"),
|
|
3777
|
-
image: v([
|
|
3838
|
+
image: v([zr, h(URL)]),
|
|
3778
3839
|
mediaType: _().optional(),
|
|
3779
3840
|
providerOptions: Q.optional()
|
|
3780
|
-
}),
|
|
3841
|
+
}), Ur = d({
|
|
3781
3842
|
type: c("file"),
|
|
3782
|
-
data: v([
|
|
3843
|
+
data: v([zr, h(URL)]),
|
|
3783
3844
|
filename: _().optional(),
|
|
3784
3845
|
mediaType: _(),
|
|
3785
3846
|
providerOptions: Q.optional()
|
|
3786
|
-
}),
|
|
3847
|
+
}), Wr = d({
|
|
3787
3848
|
type: c("reasoning"),
|
|
3788
3849
|
text: _(),
|
|
3789
3850
|
providerOptions: Q.optional()
|
|
3790
|
-
}),
|
|
3851
|
+
}), Gr = d({
|
|
3791
3852
|
type: c("tool-call"),
|
|
3792
3853
|
toolCallId: _(),
|
|
3793
3854
|
toolName: _(),
|
|
3794
3855
|
input: o(),
|
|
3795
3856
|
providerOptions: Q.optional(),
|
|
3796
3857
|
providerExecuted: p().optional()
|
|
3797
|
-
}),
|
|
3858
|
+
}), Kr = s("type", [
|
|
3798
3859
|
d({
|
|
3799
3860
|
type: c("text"),
|
|
3800
3861
|
value: _(),
|
|
@@ -3802,7 +3863,7 @@ var Fr = v([
|
|
|
3802
3863
|
}),
|
|
3803
3864
|
d({
|
|
3804
3865
|
type: c("json"),
|
|
3805
|
-
value:
|
|
3866
|
+
value: Br,
|
|
3806
3867
|
providerOptions: Q.optional()
|
|
3807
3868
|
}),
|
|
3808
3869
|
d({
|
|
@@ -3817,7 +3878,7 @@ var Fr = v([
|
|
|
3817
3878
|
}),
|
|
3818
3879
|
d({
|
|
3819
3880
|
type: c("error-json"),
|
|
3820
|
-
value:
|
|
3881
|
+
value: Br,
|
|
3821
3882
|
providerOptions: Q.optional()
|
|
3822
3883
|
}),
|
|
3823
3884
|
d({
|
|
@@ -3872,17 +3933,17 @@ var Fr = v([
|
|
|
3872
3933
|
})
|
|
3873
3934
|
]))
|
|
3874
3935
|
})
|
|
3875
|
-
]),
|
|
3936
|
+
]), qr = d({
|
|
3876
3937
|
type: c("tool-result"),
|
|
3877
3938
|
toolCallId: _(),
|
|
3878
3939
|
toolName: _(),
|
|
3879
|
-
output:
|
|
3940
|
+
output: Kr,
|
|
3880
3941
|
providerOptions: Q.optional()
|
|
3881
|
-
}),
|
|
3942
|
+
}), Jr = d({
|
|
3882
3943
|
type: c("tool-approval-request"),
|
|
3883
3944
|
approvalId: _(),
|
|
3884
3945
|
toolCallId: _()
|
|
3885
|
-
}),
|
|
3946
|
+
}), Yr = d({
|
|
3886
3947
|
type: c("tool-approval-response"),
|
|
3887
3948
|
approvalId: _(),
|
|
3888
3949
|
approved: p(),
|
|
@@ -3897,31 +3958,31 @@ v([
|
|
|
3897
3958
|
d({
|
|
3898
3959
|
role: c("user"),
|
|
3899
3960
|
content: v([_(), a(v([
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3961
|
+
Vr,
|
|
3962
|
+
Hr,
|
|
3963
|
+
Ur
|
|
3903
3964
|
]))]),
|
|
3904
3965
|
providerOptions: Q.optional()
|
|
3905
3966
|
}),
|
|
3906
3967
|
d({
|
|
3907
3968
|
role: c("assistant"),
|
|
3908
3969
|
content: v([_(), a(v([
|
|
3909
|
-
Lr,
|
|
3910
|
-
zr,
|
|
3911
|
-
Br,
|
|
3912
3970
|
Vr,
|
|
3913
3971
|
Ur,
|
|
3914
|
-
Wr
|
|
3972
|
+
Wr,
|
|
3973
|
+
Gr,
|
|
3974
|
+
qr,
|
|
3975
|
+
Jr
|
|
3915
3976
|
]))]),
|
|
3916
3977
|
providerOptions: Q.optional()
|
|
3917
3978
|
}),
|
|
3918
3979
|
d({
|
|
3919
3980
|
role: c("tool"),
|
|
3920
|
-
content: a(v([
|
|
3981
|
+
content: a(v([qr, Yr])),
|
|
3921
3982
|
providerOptions: Q.optional()
|
|
3922
3983
|
})
|
|
3923
3984
|
]);
|
|
3924
|
-
function
|
|
3985
|
+
function Xr(e, t) {
|
|
3925
3986
|
if (e === void 0 && t === void 0) return;
|
|
3926
3987
|
if (e === void 0) return t;
|
|
3927
3988
|
if (t === void 0) return e;
|
|
@@ -3930,18 +3991,18 @@ function Kr(e, t) {
|
|
|
3930
3991
|
let i = t[r];
|
|
3931
3992
|
if (i === void 0) continue;
|
|
3932
3993
|
let a = r in e ? e[r] : void 0, o = typeof i == "object" && !!i && !Array.isArray(i) && !(i instanceof Date) && !(i instanceof RegExp), s = typeof a == "object" && !!a && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof RegExp);
|
|
3933
|
-
o && s ? n[r] =
|
|
3994
|
+
o && s ? n[r] = Xr(a, i) : n[r] = i;
|
|
3934
3995
|
}
|
|
3935
3996
|
return n;
|
|
3936
3997
|
}
|
|
3937
|
-
|
|
3938
|
-
array: () =>
|
|
3939
|
-
choice: () =>
|
|
3940
|
-
json: () =>
|
|
3941
|
-
object: () =>
|
|
3942
|
-
text: () =>
|
|
3998
|
+
Or({}, {
|
|
3999
|
+
array: () => ti,
|
|
4000
|
+
choice: () => ni,
|
|
4001
|
+
json: () => ri,
|
|
4002
|
+
object: () => ei,
|
|
4003
|
+
text: () => $r
|
|
3943
4004
|
});
|
|
3944
|
-
function
|
|
4005
|
+
function Zr(e) {
|
|
3945
4006
|
let t = ["ROOT"], n = -1, r = null;
|
|
3946
4007
|
function i(e, i, a) {
|
|
3947
4008
|
switch (e) {
|
|
@@ -4143,16 +4204,16 @@ function qr(e) {
|
|
|
4143
4204
|
}
|
|
4144
4205
|
return s;
|
|
4145
4206
|
}
|
|
4146
|
-
async function
|
|
4207
|
+
async function Qr(e) {
|
|
4147
4208
|
if (e === void 0) return {
|
|
4148
4209
|
value: void 0,
|
|
4149
4210
|
state: "undefined-input"
|
|
4150
4211
|
};
|
|
4151
|
-
let t = await
|
|
4212
|
+
let t = await wr({ text: e });
|
|
4152
4213
|
return t.success ? {
|
|
4153
4214
|
value: t.value,
|
|
4154
4215
|
state: "successful-parse"
|
|
4155
|
-
} : (t = await
|
|
4216
|
+
} : (t = await wr({ text: Zr(e) }), t.success ? {
|
|
4156
4217
|
value: t.value,
|
|
4157
4218
|
state: "repaired-parse"
|
|
4158
4219
|
} : {
|
|
@@ -4160,7 +4221,7 @@ async function Jr(e) {
|
|
|
4160
4221
|
state: "failed-parse"
|
|
4161
4222
|
});
|
|
4162
4223
|
}
|
|
4163
|
-
var
|
|
4224
|
+
var $r = () => ({
|
|
4164
4225
|
name: "text",
|
|
4165
4226
|
responseFormat: Promise.resolve({ type: "text" }),
|
|
4166
4227
|
async parseCompleteOutput({ text: e }) {
|
|
@@ -4170,19 +4231,19 @@ var Yr = () => ({
|
|
|
4170
4231
|
return { partial: e };
|
|
4171
4232
|
},
|
|
4172
4233
|
createElementStreamTransform() {}
|
|
4173
|
-
}),
|
|
4174
|
-
let r =
|
|
4234
|
+
}), ei = ({ schema: e, name: t, description: n }) => {
|
|
4235
|
+
let r = gr(e);
|
|
4175
4236
|
return {
|
|
4176
4237
|
name: "object",
|
|
4177
|
-
responseFormat:
|
|
4238
|
+
responseFormat: Er(r.jsonSchema).then((e) => ({
|
|
4178
4239
|
type: "json",
|
|
4179
4240
|
schema: e,
|
|
4180
4241
|
...t != null && { name: t },
|
|
4181
4242
|
...n != null && { description: n }
|
|
4182
4243
|
})),
|
|
4183
4244
|
async parseCompleteOutput({ text: e }, t) {
|
|
4184
|
-
let n = await
|
|
4185
|
-
if (!n.success) throw new
|
|
4245
|
+
let n = await wr({ text: e });
|
|
4246
|
+
if (!n.success) throw new Nr({
|
|
4186
4247
|
message: "No object generated: could not parse the response.",
|
|
4187
4248
|
cause: n.error,
|
|
4188
4249
|
text: e,
|
|
@@ -4190,11 +4251,11 @@ var Yr = () => ({
|
|
|
4190
4251
|
usage: t.usage,
|
|
4191
4252
|
finishReason: t.finishReason
|
|
4192
4253
|
});
|
|
4193
|
-
let i = await
|
|
4254
|
+
let i = await Cr({
|
|
4194
4255
|
value: n.value,
|
|
4195
4256
|
schema: r
|
|
4196
4257
|
});
|
|
4197
|
-
if (!i.success) throw new
|
|
4258
|
+
if (!i.success) throw new Nr({
|
|
4198
4259
|
message: "No object generated: response did not match schema.",
|
|
4199
4260
|
cause: i.error,
|
|
4200
4261
|
text: e,
|
|
@@ -4205,7 +4266,7 @@ var Yr = () => ({
|
|
|
4205
4266
|
return i.value;
|
|
4206
4267
|
},
|
|
4207
4268
|
async parsePartialOutput({ text: e }) {
|
|
4208
|
-
let t = await
|
|
4269
|
+
let t = await Qr(e);
|
|
4209
4270
|
switch (t.state) {
|
|
4210
4271
|
case "failed-parse":
|
|
4211
4272
|
case "undefined-input": return;
|
|
@@ -4215,11 +4276,11 @@ var Yr = () => ({
|
|
|
4215
4276
|
},
|
|
4216
4277
|
createElementStreamTransform() {}
|
|
4217
4278
|
};
|
|
4218
|
-
},
|
|
4219
|
-
let r =
|
|
4279
|
+
}, ti = ({ element: e, name: t, description: n }) => {
|
|
4280
|
+
let r = gr(e);
|
|
4220
4281
|
return {
|
|
4221
4282
|
name: "array",
|
|
4222
|
-
responseFormat:
|
|
4283
|
+
responseFormat: Er(r.jsonSchema).then((e) => {
|
|
4223
4284
|
let { $schema: r, ...i } = e;
|
|
4224
4285
|
return {
|
|
4225
4286
|
type: "json",
|
|
@@ -4238,8 +4299,8 @@ var Yr = () => ({
|
|
|
4238
4299
|
};
|
|
4239
4300
|
}),
|
|
4240
4301
|
async parseCompleteOutput({ text: e }, t) {
|
|
4241
|
-
let n = await
|
|
4242
|
-
if (!n.success) throw new
|
|
4302
|
+
let n = await wr({ text: e });
|
|
4303
|
+
if (!n.success) throw new Nr({
|
|
4243
4304
|
message: "No object generated: could not parse the response.",
|
|
4244
4305
|
cause: n.error,
|
|
4245
4306
|
text: e,
|
|
@@ -4248,9 +4309,9 @@ var Yr = () => ({
|
|
|
4248
4309
|
finishReason: t.finishReason
|
|
4249
4310
|
});
|
|
4250
4311
|
let i = n.value;
|
|
4251
|
-
if (typeof i != "object" || !i || !("elements" in i) || !Array.isArray(i.elements)) throw new
|
|
4312
|
+
if (typeof i != "object" || !i || !("elements" in i) || !Array.isArray(i.elements)) throw new Nr({
|
|
4252
4313
|
message: "No object generated: response did not match schema.",
|
|
4253
|
-
cause: new
|
|
4314
|
+
cause: new M({
|
|
4254
4315
|
value: i,
|
|
4255
4316
|
cause: "response must be an object with an elements array"
|
|
4256
4317
|
}),
|
|
@@ -4260,11 +4321,11 @@ var Yr = () => ({
|
|
|
4260
4321
|
finishReason: t.finishReason
|
|
4261
4322
|
});
|
|
4262
4323
|
for (let n of i.elements) {
|
|
4263
|
-
let i = await
|
|
4324
|
+
let i = await Cr({
|
|
4264
4325
|
value: n,
|
|
4265
4326
|
schema: r
|
|
4266
4327
|
});
|
|
4267
|
-
if (!i.success) throw new
|
|
4328
|
+
if (!i.success) throw new Nr({
|
|
4268
4329
|
message: "No object generated: response did not match schema.",
|
|
4269
4330
|
cause: i.error,
|
|
4270
4331
|
text: e,
|
|
@@ -4276,7 +4337,7 @@ var Yr = () => ({
|
|
|
4276
4337
|
return i.elements;
|
|
4277
4338
|
},
|
|
4278
4339
|
async parsePartialOutput({ text: e }) {
|
|
4279
|
-
let t = await
|
|
4340
|
+
let t = await Qr(e);
|
|
4280
4341
|
switch (t.state) {
|
|
4281
4342
|
case "failed-parse":
|
|
4282
4343
|
case "undefined-input": return;
|
|
@@ -4286,7 +4347,7 @@ var Yr = () => ({
|
|
|
4286
4347
|
if (typeof e != "object" || !e || !("elements" in e) || !Array.isArray(e.elements)) return;
|
|
4287
4348
|
let n = t.state === "repaired-parse" && e.elements.length > 0 ? e.elements.slice(0, -1) : e.elements, i = [];
|
|
4288
4349
|
for (let e of n) {
|
|
4289
|
-
let t = await
|
|
4350
|
+
let t = await Cr({
|
|
4290
4351
|
value: e,
|
|
4291
4352
|
schema: r
|
|
4292
4353
|
});
|
|
@@ -4303,7 +4364,7 @@ var Yr = () => ({
|
|
|
4303
4364
|
} });
|
|
4304
4365
|
}
|
|
4305
4366
|
};
|
|
4306
|
-
},
|
|
4367
|
+
}, ni = ({ options: e, name: t, description: n }) => ({
|
|
4307
4368
|
name: "choice",
|
|
4308
4369
|
responseFormat: Promise.resolve({
|
|
4309
4370
|
type: "json",
|
|
@@ -4321,8 +4382,8 @@ var Yr = () => ({
|
|
|
4321
4382
|
...n != null && { description: n }
|
|
4322
4383
|
}),
|
|
4323
4384
|
async parseCompleteOutput({ text: t }, n) {
|
|
4324
|
-
let r = await
|
|
4325
|
-
if (!r.success) throw new
|
|
4385
|
+
let r = await wr({ text: t });
|
|
4386
|
+
if (!r.success) throw new Nr({
|
|
4326
4387
|
message: "No object generated: could not parse the response.",
|
|
4327
4388
|
cause: r.error,
|
|
4328
4389
|
text: t,
|
|
@@ -4331,9 +4392,9 @@ var Yr = () => ({
|
|
|
4331
4392
|
finishReason: n.finishReason
|
|
4332
4393
|
});
|
|
4333
4394
|
let i = r.value;
|
|
4334
|
-
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new
|
|
4395
|
+
if (typeof i != "object" || !i || !("result" in i) || typeof i.result != "string" || !e.includes(i.result)) throw new Nr({
|
|
4335
4396
|
message: "No object generated: response did not match schema.",
|
|
4336
|
-
cause: new
|
|
4397
|
+
cause: new M({
|
|
4337
4398
|
value: i,
|
|
4338
4399
|
cause: "response must be an object that contains a choice value."
|
|
4339
4400
|
}),
|
|
@@ -4345,7 +4406,7 @@ var Yr = () => ({
|
|
|
4345
4406
|
return i.result;
|
|
4346
4407
|
},
|
|
4347
4408
|
async parsePartialOutput({ text: t }) {
|
|
4348
|
-
let n = await
|
|
4409
|
+
let n = await Qr(t);
|
|
4349
4410
|
switch (n.state) {
|
|
4350
4411
|
case "failed-parse":
|
|
4351
4412
|
case "undefined-input": return;
|
|
@@ -4359,7 +4420,7 @@ var Yr = () => ({
|
|
|
4359
4420
|
}
|
|
4360
4421
|
},
|
|
4361
4422
|
createElementStreamTransform() {}
|
|
4362
|
-
}),
|
|
4423
|
+
}), ri = ({ name: e, description: t } = {}) => ({
|
|
4363
4424
|
name: "json",
|
|
4364
4425
|
responseFormat: Promise.resolve({
|
|
4365
4426
|
type: "json",
|
|
@@ -4367,8 +4428,8 @@ var Yr = () => ({
|
|
|
4367
4428
|
...t != null && { description: t }
|
|
4368
4429
|
}),
|
|
4369
4430
|
async parseCompleteOutput({ text: e }, t) {
|
|
4370
|
-
let n = await
|
|
4371
|
-
if (!n.success) throw new
|
|
4431
|
+
let n = await wr({ text: e });
|
|
4432
|
+
if (!n.success) throw new Nr({
|
|
4372
4433
|
message: "No object generated: could not parse the response.",
|
|
4373
4434
|
cause: n.error,
|
|
4374
4435
|
text: e,
|
|
@@ -4379,7 +4440,7 @@ var Yr = () => ({
|
|
|
4379
4440
|
return n.value;
|
|
4380
4441
|
},
|
|
4381
4442
|
async parsePartialOutput({ text: e }) {
|
|
4382
|
-
let t = await
|
|
4443
|
+
let t = await Qr(e);
|
|
4383
4444
|
switch (t.state) {
|
|
4384
4445
|
case "failed-parse":
|
|
4385
4446
|
case "undefined-input": return;
|
|
@@ -4389,11 +4450,11 @@ var Yr = () => ({
|
|
|
4389
4450
|
},
|
|
4390
4451
|
createElementStreamTransform() {}
|
|
4391
4452
|
});
|
|
4392
|
-
|
|
4453
|
+
sn({
|
|
4393
4454
|
prefix: "aitxt",
|
|
4394
4455
|
size: 24
|
|
4395
4456
|
}), TransformStream;
|
|
4396
|
-
var
|
|
4457
|
+
var ii = pr(() => xr(v([
|
|
4397
4458
|
i({
|
|
4398
4459
|
type: c("text-start"),
|
|
4399
4460
|
id: _(),
|
|
@@ -4546,22 +4607,22 @@ var ei = dr(() => yr(v([
|
|
|
4546
4607
|
messageMetadata: o()
|
|
4547
4608
|
})
|
|
4548
4609
|
])));
|
|
4549
|
-
function
|
|
4610
|
+
function ai(e) {
|
|
4550
4611
|
return e.type.startsWith("data-");
|
|
4551
4612
|
}
|
|
4552
|
-
function
|
|
4613
|
+
function oi(e) {
|
|
4553
4614
|
return e.type.startsWith("tool-");
|
|
4554
4615
|
}
|
|
4555
|
-
function
|
|
4616
|
+
function si(e) {
|
|
4556
4617
|
return e.type === "dynamic-tool";
|
|
4557
4618
|
}
|
|
4558
|
-
function
|
|
4559
|
-
return
|
|
4619
|
+
function ci(e) {
|
|
4620
|
+
return oi(e) || si(e);
|
|
4560
4621
|
}
|
|
4561
|
-
function
|
|
4622
|
+
function li(e) {
|
|
4562
4623
|
return e.type.split("-").slice(1).join("-");
|
|
4563
4624
|
}
|
|
4564
|
-
function
|
|
4625
|
+
function ui({ lastMessage: e, messageId: t }) {
|
|
4565
4626
|
return {
|
|
4566
4627
|
message: e?.role === "assistant" ? e : {
|
|
4567
4628
|
id: t,
|
|
@@ -4574,12 +4635,12 @@ function oi({ lastMessage: e, messageId: t }) {
|
|
|
4574
4635
|
partialToolCalls: {}
|
|
4575
4636
|
};
|
|
4576
4637
|
}
|
|
4577
|
-
function
|
|
4638
|
+
function di({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdateMessageJob: r, onError: i, onToolCall: a, onData: o }) {
|
|
4578
4639
|
return e.pipeThrough(new TransformStream({ async transform(e, s) {
|
|
4579
4640
|
await r(async ({ state: r, write: c }) => {
|
|
4580
4641
|
function l(e) {
|
|
4581
|
-
let t = r.message.parts.filter(
|
|
4582
|
-
if (t == null) throw new
|
|
4642
|
+
let t = r.message.parts.filter(ci).find((t) => t.toolCallId === e);
|
|
4643
|
+
if (t == null) throw new Rr({
|
|
4583
4644
|
chunkType: "tool-invocation",
|
|
4584
4645
|
chunkId: e,
|
|
4585
4646
|
message: `No tool invocation found for tool call ID "${e}".`
|
|
@@ -4587,7 +4648,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4587
4648
|
return t;
|
|
4588
4649
|
}
|
|
4589
4650
|
function u(e) {
|
|
4590
|
-
let t = r.message.parts.find((t) =>
|
|
4651
|
+
let t = r.message.parts.find((t) => oi(t) && t.toolCallId === e.toolCallId), n = e, i = t;
|
|
4591
4652
|
if (t != null) {
|
|
4592
4653
|
t.state = e.state, i.input = n.input, i.output = n.output, i.errorText = n.errorText, i.rawInput = n.rawInput, i.preliminary = n.preliminary, e.title !== void 0 && (i.title = e.title), i.providerExecuted = n.providerExecuted ?? t.providerExecuted;
|
|
4593
4654
|
let r = n.providerMetadata;
|
|
@@ -4636,8 +4697,8 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4636
4697
|
}
|
|
4637
4698
|
async function f(e) {
|
|
4638
4699
|
if (e != null) {
|
|
4639
|
-
let n = r.message.metadata == null ? e :
|
|
4640
|
-
t != null && await
|
|
4700
|
+
let n = r.message.metadata == null ? e : Xr(r.message.metadata, e);
|
|
4701
|
+
t != null && await Sr({
|
|
4641
4702
|
value: n,
|
|
4642
4703
|
schema: t,
|
|
4643
4704
|
context: {
|
|
@@ -4660,7 +4721,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4660
4721
|
}
|
|
4661
4722
|
case "text-delta": {
|
|
4662
4723
|
let t = r.activeTextParts[e.id];
|
|
4663
|
-
if (t == null) throw new
|
|
4724
|
+
if (t == null) throw new Rr({
|
|
4664
4725
|
chunkType: "text-delta",
|
|
4665
4726
|
chunkId: e.id,
|
|
4666
4727
|
message: `Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`
|
|
@@ -4670,7 +4731,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4670
4731
|
}
|
|
4671
4732
|
case "text-end": {
|
|
4672
4733
|
let t = r.activeTextParts[e.id];
|
|
4673
|
-
if (t == null) throw new
|
|
4734
|
+
if (t == null) throw new Rr({
|
|
4674
4735
|
chunkType: "text-end",
|
|
4675
4736
|
chunkId: e.id,
|
|
4676
4737
|
message: `Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`
|
|
@@ -4690,7 +4751,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4690
4751
|
}
|
|
4691
4752
|
case "reasoning-delta": {
|
|
4692
4753
|
let t = r.activeReasoningParts[e.id];
|
|
4693
|
-
if (t == null) throw new
|
|
4754
|
+
if (t == null) throw new Rr({
|
|
4694
4755
|
chunkType: "reasoning-delta",
|
|
4695
4756
|
chunkId: e.id,
|
|
4696
4757
|
message: `Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`
|
|
@@ -4700,7 +4761,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4700
4761
|
}
|
|
4701
4762
|
case "reasoning-end": {
|
|
4702
4763
|
let t = r.activeReasoningParts[e.id];
|
|
4703
|
-
if (t == null) throw new
|
|
4764
|
+
if (t == null) throw new Rr({
|
|
4704
4765
|
chunkType: "reasoning-end",
|
|
4705
4766
|
chunkId: e.id,
|
|
4706
4767
|
message: `Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`
|
|
@@ -4736,7 +4797,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4736
4797
|
}), c();
|
|
4737
4798
|
break;
|
|
4738
4799
|
case "tool-input-start": {
|
|
4739
|
-
let t = r.message.parts.filter(
|
|
4800
|
+
let t = r.message.parts.filter(oi);
|
|
4740
4801
|
r.partialToolCalls[e.toolCallId] = {
|
|
4741
4802
|
text: "",
|
|
4742
4803
|
toolName: e.toolName,
|
|
@@ -4764,13 +4825,13 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4764
4825
|
}
|
|
4765
4826
|
case "tool-input-delta": {
|
|
4766
4827
|
let t = r.partialToolCalls[e.toolCallId];
|
|
4767
|
-
if (t == null) throw new
|
|
4828
|
+
if (t == null) throw new Rr({
|
|
4768
4829
|
chunkType: "tool-input-delta",
|
|
4769
4830
|
chunkId: e.toolCallId,
|
|
4770
4831
|
message: `Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`
|
|
4771
4832
|
});
|
|
4772
4833
|
t.text += e.inputTextDelta;
|
|
4773
|
-
let { value: n } = await
|
|
4834
|
+
let { value: n } = await Qr(t.text);
|
|
4774
4835
|
t.dynamic ? d({
|
|
4775
4836
|
toolCallId: e.toolCallId,
|
|
4776
4837
|
toolName: t.toolName,
|
|
@@ -4806,7 +4867,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4806
4867
|
}), c(), a && !e.providerExecuted && await a({ toolCall: e });
|
|
4807
4868
|
break;
|
|
4808
4869
|
case "tool-input-error": {
|
|
4809
|
-
let t = r.message.parts.filter(
|
|
4870
|
+
let t = r.message.parts.filter(ci).find((t) => t.toolCallId === e.toolCallId);
|
|
4810
4871
|
(t == null ? e.dynamic : t.type === "dynamic-tool") ? d({
|
|
4811
4872
|
toolCallId: e.toolCallId,
|
|
4812
4873
|
toolName: e.toolName,
|
|
@@ -4851,7 +4912,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4851
4912
|
title: t.title
|
|
4852
4913
|
}) : u({
|
|
4853
4914
|
toolCallId: e.toolCallId,
|
|
4854
|
-
toolName:
|
|
4915
|
+
toolName: li(t),
|
|
4855
4916
|
state: "output-available",
|
|
4856
4917
|
input: t.input,
|
|
4857
4918
|
output: e.output,
|
|
@@ -4875,7 +4936,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4875
4936
|
title: t.title
|
|
4876
4937
|
}) : u({
|
|
4877
4938
|
toolCallId: e.toolCallId,
|
|
4878
|
-
toolName:
|
|
4939
|
+
toolName: li(t),
|
|
4879
4940
|
state: "output-error",
|
|
4880
4941
|
input: t.input,
|
|
4881
4942
|
rawInput: t.rawInput,
|
|
@@ -4904,10 +4965,10 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4904
4965
|
case "error":
|
|
4905
4966
|
i?.(Error(e.errorText));
|
|
4906
4967
|
break;
|
|
4907
|
-
default: if (
|
|
4968
|
+
default: if (ai(e)) {
|
|
4908
4969
|
if (n?.[e.type] != null) {
|
|
4909
4970
|
let t = r.message.parts.findIndex((t) => "id" in t && "data" in t && t.id === e.id && t.type === e.type), i = t >= 0 ? t : r.message.parts.length;
|
|
4910
|
-
await
|
|
4971
|
+
await Sr({
|
|
4911
4972
|
value: e.data,
|
|
4912
4973
|
schema: n[e.type],
|
|
4913
4974
|
context: {
|
|
@@ -4930,7 +4991,7 @@ function si({ stream: e, messageMetadataSchema: t, dataPartSchemas: n, runUpdate
|
|
|
4930
4991
|
});
|
|
4931
4992
|
} }));
|
|
4932
4993
|
}
|
|
4933
|
-
async function
|
|
4994
|
+
async function fi({ stream: e, onError: t }) {
|
|
4934
4995
|
let n = e.getReader();
|
|
4935
4996
|
try {
|
|
4936
4997
|
for (;;) {
|
|
@@ -4943,14 +5004,14 @@ async function ci({ stream: e, onError: t }) {
|
|
|
4943
5004
|
n.releaseLock();
|
|
4944
5005
|
}
|
|
4945
5006
|
}
|
|
4946
|
-
|
|
5007
|
+
sn({
|
|
4947
5008
|
prefix: "aitxt",
|
|
4948
5009
|
size: 24
|
|
4949
|
-
}),
|
|
5010
|
+
}), sn({
|
|
4950
5011
|
prefix: "aiobj",
|
|
4951
5012
|
size: 24
|
|
4952
5013
|
});
|
|
4953
|
-
var
|
|
5014
|
+
var pi = class {
|
|
4954
5015
|
constructor() {
|
|
4955
5016
|
this.queue = [], this.isProcessing = !1;
|
|
4956
5017
|
}
|
|
@@ -4972,11 +5033,11 @@ var li = class {
|
|
|
4972
5033
|
});
|
|
4973
5034
|
}
|
|
4974
5035
|
};
|
|
4975
|
-
|
|
5036
|
+
sn({
|
|
4976
5037
|
prefix: "aiobj",
|
|
4977
5038
|
size: 24
|
|
4978
5039
|
});
|
|
4979
|
-
async function
|
|
5040
|
+
async function mi(e) {
|
|
4980
5041
|
if (e == null) return [];
|
|
4981
5042
|
if (!globalThis.FileList || !(e instanceof globalThis.FileList)) throw Error("FileList is not supported in the current environment");
|
|
4982
5043
|
return Promise.all(Array.from(e).map(async (e) => {
|
|
@@ -4994,14 +5055,14 @@ async function ui(e) {
|
|
|
4994
5055
|
};
|
|
4995
5056
|
}));
|
|
4996
5057
|
}
|
|
4997
|
-
var
|
|
5058
|
+
var hi = class {
|
|
4998
5059
|
constructor({ api: e = "/api/chat", credentials: t, headers: n, body: r, fetch: i, prepareSendMessagesRequest: a, prepareReconnectToStreamRequest: o }) {
|
|
4999
5060
|
this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
|
|
5000
5061
|
}
|
|
5001
5062
|
async sendMessages({ abortSignal: e, ...t }) {
|
|
5002
|
-
let n = await
|
|
5003
|
-
...
|
|
5004
|
-
...
|
|
5063
|
+
let n = await Er(this.body), r = await Er(this.headers), i = await Er(this.credentials), a = {
|
|
5064
|
+
...ln(r),
|
|
5065
|
+
...ln(t.headers)
|
|
5005
5066
|
}, o = await this.prepareSendMessagesRequest?.call(this, {
|
|
5006
5067
|
api: this.api,
|
|
5007
5068
|
id: t.chatId,
|
|
@@ -5015,7 +5076,7 @@ var di = class {
|
|
|
5015
5076
|
requestMetadata: t.metadata,
|
|
5016
5077
|
trigger: t.trigger,
|
|
5017
5078
|
messageId: t.messageId
|
|
5018
|
-
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a :
|
|
5079
|
+
}), s = o?.api ?? this.api, c = o?.headers === void 0 ? a : ln(o.headers), l = o?.body === void 0 ? {
|
|
5019
5080
|
...n,
|
|
5020
5081
|
...t.body,
|
|
5021
5082
|
id: t.chatId,
|
|
@@ -5037,9 +5098,9 @@ var di = class {
|
|
|
5037
5098
|
return this.processResponseStream(d.body);
|
|
5038
5099
|
}
|
|
5039
5100
|
async reconnectToStream(e) {
|
|
5040
|
-
let t = await
|
|
5041
|
-
...
|
|
5042
|
-
...
|
|
5101
|
+
let t = await Er(this.body), n = await Er(this.headers), r = await Er(this.credentials), i = {
|
|
5102
|
+
...ln(n),
|
|
5103
|
+
...ln(e.headers)
|
|
5043
5104
|
}, a = await this.prepareReconnectToStreamRequest?.call(this, {
|
|
5044
5105
|
api: this.api,
|
|
5045
5106
|
id: e.chatId,
|
|
@@ -5050,7 +5111,7 @@ var di = class {
|
|
|
5050
5111
|
headers: i,
|
|
5051
5112
|
credentials: r,
|
|
5052
5113
|
requestMetadata: e.metadata
|
|
5053
|
-
}), o = a?.api ?? `${this.api}/${e.chatId}/stream`, s = a?.headers === void 0 ? i :
|
|
5114
|
+
}), o = a?.api ?? `${this.api}/${e.chatId}/stream`, s = a?.headers === void 0 ? i : ln(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
5054
5115
|
method: "GET",
|
|
5055
5116
|
headers: s,
|
|
5056
5117
|
credentials: c
|
|
@@ -5060,22 +5121,22 @@ var di = class {
|
|
|
5060
5121
|
if (!l.body) throw Error("The response body is empty.");
|
|
5061
5122
|
return this.processResponseStream(l.body);
|
|
5062
5123
|
}
|
|
5063
|
-
},
|
|
5124
|
+
}, gi = class extends hi {
|
|
5064
5125
|
constructor(e = {}) {
|
|
5065
5126
|
super(e);
|
|
5066
5127
|
}
|
|
5067
5128
|
processResponseStream(e) {
|
|
5068
|
-
return
|
|
5129
|
+
return Tr({
|
|
5069
5130
|
stream: e,
|
|
5070
|
-
schema:
|
|
5131
|
+
schema: ii
|
|
5071
5132
|
}).pipeThrough(new TransformStream({ async transform(e, t) {
|
|
5072
5133
|
if (!e.success) throw e.error;
|
|
5073
5134
|
t.enqueue(e.value);
|
|
5074
5135
|
} }));
|
|
5075
5136
|
}
|
|
5076
|
-
},
|
|
5077
|
-
constructor({ generateId: e =
|
|
5078
|
-
this.activeResponse = void 0, this.jobExecutor = new
|
|
5137
|
+
}, _i = class {
|
|
5138
|
+
constructor({ generateId: e = cn, id: t = e(), transport: n = new gi(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
|
|
5139
|
+
this.activeResponse = void 0, this.jobExecutor = new pi(), this.sendMessage = async (e, t) => {
|
|
5079
5140
|
if (e == null) {
|
|
5080
5141
|
await this.makeRequest({
|
|
5081
5142
|
trigger: "submit-message",
|
|
@@ -5085,7 +5146,7 @@ var di = class {
|
|
|
5085
5146
|
return;
|
|
5086
5147
|
}
|
|
5087
5148
|
let n;
|
|
5088
|
-
if (n = "text" in e || "files" in e ? { parts: [...Array.isArray(e.files) ? e.files : await
|
|
5149
|
+
if (n = "text" in e || "files" in e ? { parts: [...Array.isArray(e.files) ? e.files : await mi(e.files), ..."text" in e && e.text != null ? [{
|
|
5089
5150
|
type: "text",
|
|
5090
5151
|
text: e.text
|
|
5091
5152
|
}] : []] } : e, e.messageId != null) {
|
|
@@ -5125,7 +5186,7 @@ var di = class {
|
|
|
5125
5186
|
}, this.clearError = () => {
|
|
5126
5187
|
this.status === "error" && (this.state.error = void 0, this.setStatus({ status: "ready" }));
|
|
5127
5188
|
}, this.addToolApprovalResponse = async ({ id: e, approved: t, reason: n, options: r }) => this.jobExecutor.run(async () => {
|
|
5128
|
-
let i = this.state.messages, a = i[i.length - 1], o = (r) =>
|
|
5189
|
+
let i = this.state.messages, a = i[i.length - 1], o = (r) => ci(r) && r.state === "approval-requested" && r.approval.id === e ? {
|
|
5129
5190
|
...r,
|
|
5130
5191
|
state: "approval-responded",
|
|
5131
5192
|
approval: {
|
|
@@ -5145,7 +5206,7 @@ var di = class {
|
|
|
5145
5206
|
});
|
|
5146
5207
|
});
|
|
5147
5208
|
}), this.addToolOutput = async ({ state: e = "output-available", toolCallId: t, output: n, errorText: r, options: i }) => this.jobExecutor.run(async () => {
|
|
5148
|
-
let a = this.state.messages, o = a[a.length - 1], s = (i) =>
|
|
5209
|
+
let a = this.state.messages, o = a[a.length - 1], s = (i) => ci(i) && i.toolCallId === t ? {
|
|
5149
5210
|
...i,
|
|
5150
5211
|
state: e,
|
|
5151
5212
|
output: n,
|
|
@@ -5214,7 +5275,7 @@ var di = class {
|
|
|
5214
5275
|
let s = this.lastMessage, c = !1, l = !1, u = !1;
|
|
5215
5276
|
try {
|
|
5216
5277
|
let a = {
|
|
5217
|
-
state:
|
|
5278
|
+
state: ui({
|
|
5218
5279
|
lastMessage: this.state.snapshot(s),
|
|
5219
5280
|
messageId: this.generateId()
|
|
5220
5281
|
}),
|
|
@@ -5233,8 +5294,8 @@ var di = class {
|
|
|
5233
5294
|
body: r,
|
|
5234
5295
|
trigger: e,
|
|
5235
5296
|
messageId: i
|
|
5236
|
-
}), await
|
|
5237
|
-
stream:
|
|
5297
|
+
}), await fi({
|
|
5298
|
+
stream: di({
|
|
5238
5299
|
stream: l,
|
|
5239
5300
|
onToolCall: this.onToolCall,
|
|
5240
5301
|
onData: this.onData,
|
|
@@ -5284,41 +5345,41 @@ var di = class {
|
|
|
5284
5345
|
});
|
|
5285
5346
|
}
|
|
5286
5347
|
};
|
|
5287
|
-
function
|
|
5348
|
+
function vi({ messages: e }) {
|
|
5288
5349
|
let t = e[e.length - 1];
|
|
5289
5350
|
if (!t || t.role !== "assistant") return !1;
|
|
5290
|
-
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(
|
|
5351
|
+
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(ci).filter((e) => !e.providerExecuted);
|
|
5291
5352
|
return r.length > 0 && r.every((e) => e.state === "output-available" || e.state === "output-error");
|
|
5292
5353
|
}
|
|
5293
5354
|
//#endregion
|
|
5294
5355
|
//#region ../../node_modules/.pnpm/@ai-sdk+provider@1.1.3/node_modules/@ai-sdk/provider/dist/index.mjs
|
|
5295
|
-
var
|
|
5356
|
+
var yi = "vercel.ai.error", bi = Symbol.for(yi), xi, Si = class e extends Error {
|
|
5296
5357
|
constructor({ name: e, message: t, cause: n }) {
|
|
5297
|
-
super(t), this[
|
|
5358
|
+
super(t), this[xi] = !0, this.name = e, this.cause = n;
|
|
5298
5359
|
}
|
|
5299
5360
|
static isInstance(t) {
|
|
5300
|
-
return e.hasMarker(t,
|
|
5361
|
+
return e.hasMarker(t, yi);
|
|
5301
5362
|
}
|
|
5302
5363
|
static hasMarker(e, t) {
|
|
5303
5364
|
let n = Symbol.for(t);
|
|
5304
5365
|
return typeof e == "object" && !!e && n in e && typeof e[n] == "boolean" && e[n] === !0;
|
|
5305
5366
|
}
|
|
5306
5367
|
};
|
|
5307
|
-
|
|
5308
|
-
var
|
|
5368
|
+
xi = bi;
|
|
5369
|
+
var Ci = Si, wi = "AI_InvalidArgumentError", Ti = `vercel.ai.error.${wi}`, Ei = Symbol.for(Ti), Di, Oi = class extends Ci {
|
|
5309
5370
|
constructor({ message: e, cause: t, argument: n }) {
|
|
5310
5371
|
super({
|
|
5311
|
-
name:
|
|
5372
|
+
name: wi,
|
|
5312
5373
|
message: e,
|
|
5313
5374
|
cause: t
|
|
5314
|
-
}), this[
|
|
5375
|
+
}), this[Di] = !0, this.argument = n;
|
|
5315
5376
|
}
|
|
5316
5377
|
static isInstance(e) {
|
|
5317
|
-
return
|
|
5378
|
+
return Ci.hasMarker(e, Ti);
|
|
5318
5379
|
}
|
|
5319
5380
|
};
|
|
5320
|
-
|
|
5321
|
-
var
|
|
5381
|
+
Di = Ei;
|
|
5382
|
+
var ki = (e, t = 21) => (n = t) => {
|
|
5322
5383
|
let r = "", i = n | 0;
|
|
5323
5384
|
for (; i--;) r += e[Math.random() * e.length | 0];
|
|
5324
5385
|
return r;
|
|
@@ -5388,39 +5449,39 @@ var Ti = (e, t = 21) => (n = t) => {
|
|
|
5388
5449
|
}
|
|
5389
5450
|
t.exports = s, t.exports.default = s, t.exports.parse = s, t.exports.safeParse = c, t.exports.scan = o;
|
|
5390
5451
|
})))();
|
|
5391
|
-
var
|
|
5392
|
-
let i =
|
|
5452
|
+
var Ai = (({ prefix: e, size: t = 16, alphabet: n = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", separator: r = "-" } = {}) => {
|
|
5453
|
+
let i = ki(n, t);
|
|
5393
5454
|
if (e == null) return i;
|
|
5394
|
-
if (n.includes(r)) throw new
|
|
5455
|
+
if (n.includes(r)) throw new Oi({
|
|
5395
5456
|
argument: "separator",
|
|
5396
5457
|
message: `The separator "${r}" must not be part of the alphabet "${n}".`
|
|
5397
5458
|
});
|
|
5398
5459
|
return (t) => `${e}${r}${i(t)}`;
|
|
5399
|
-
})(), { btoa:
|
|
5400
|
-
function
|
|
5460
|
+
})(), { btoa: ji, atob: Mi } = globalThis, Ni = /* @__PURE__ */ new WeakMap(), Pi = 0;
|
|
5461
|
+
function Fi(e) {
|
|
5401
5462
|
if (!e.length) return "";
|
|
5402
5463
|
for (var t = "arg", n = 0; n < e.length; ++n) {
|
|
5403
5464
|
var r = void 0;
|
|
5404
|
-
e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) :
|
|
5465
|
+
e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) : Ni.has(e[n]) ? r = Ni.get(e[n]) : (r = Pi, Ni.set(e[n], Pi++)), t += "@" + r;
|
|
5405
5466
|
}
|
|
5406
5467
|
return t;
|
|
5407
5468
|
}
|
|
5408
5469
|
//#endregion
|
|
5409
|
-
//#region ../../node_modules/.pnpm/swrv@1.1.0_vue@3.5.
|
|
5410
|
-
function
|
|
5470
|
+
//#region ../../node_modules/.pnpm/swrv@1.1.0_vue@3.5.34_typescript@6.0.3_/node_modules/swrv/esm/cache/index.js
|
|
5471
|
+
function Ii(e) {
|
|
5411
5472
|
if (typeof e == "function") try {
|
|
5412
5473
|
e = e();
|
|
5413
5474
|
} catch {
|
|
5414
5475
|
e = "";
|
|
5415
5476
|
}
|
|
5416
|
-
return e = Array.isArray(e) ?
|
|
5477
|
+
return e = Array.isArray(e) ? Fi(e) : String(e || ""), e;
|
|
5417
5478
|
}
|
|
5418
|
-
var
|
|
5479
|
+
var Li = function() {
|
|
5419
5480
|
function e(e) {
|
|
5420
5481
|
e === void 0 && (e = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = e;
|
|
5421
5482
|
}
|
|
5422
5483
|
return e.prototype.serializeKey = function(e) {
|
|
5423
|
-
return
|
|
5484
|
+
return Ii(e);
|
|
5424
5485
|
}, e.prototype.get = function(e) {
|
|
5425
5486
|
var t = this.serializeKey(e);
|
|
5426
5487
|
return this.items.get(t);
|
|
@@ -5441,16 +5502,16 @@ var Ni = function() {
|
|
|
5441
5502
|
}, e;
|
|
5442
5503
|
}();
|
|
5443
5504
|
//#endregion
|
|
5444
|
-
//#region ../../node_modules/.pnpm/swrv@1.1.0_vue@3.5.
|
|
5445
|
-
function
|
|
5505
|
+
//#region ../../node_modules/.pnpm/swrv@1.1.0_vue@3.5.34_typescript@6.0.3_/node_modules/swrv/esm/lib/web-preset.js
|
|
5506
|
+
function Ri() {
|
|
5446
5507
|
return navigator.onLine === void 0 ? !0 : navigator.onLine;
|
|
5447
5508
|
}
|
|
5448
|
-
function
|
|
5509
|
+
function zi() {
|
|
5449
5510
|
return typeof document < "u" && document.visibilityState !== void 0 ? document.visibilityState !== "hidden" : !0;
|
|
5450
5511
|
}
|
|
5451
|
-
var
|
|
5452
|
-
isOnline:
|
|
5453
|
-
isDocumentVisible:
|
|
5512
|
+
var Bi = {
|
|
5513
|
+
isOnline: Ri,
|
|
5514
|
+
isDocumentVisible: zi,
|
|
5454
5515
|
fetcher: function(e) {
|
|
5455
5516
|
return fetch(e).then(function(e) {
|
|
5456
5517
|
return e.json();
|
|
@@ -5461,7 +5522,7 @@ var Ii = {
|
|
|
5461
5522
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
5462
5523
|
return e;
|
|
5463
5524
|
}, $.apply(this, arguments);
|
|
5464
|
-
},
|
|
5525
|
+
}, Vi = function(e, t, n, r) {
|
|
5465
5526
|
function i(e) {
|
|
5466
5527
|
return e instanceof n ? e : new n(function(t) {
|
|
5467
5528
|
t(e);
|
|
@@ -5487,7 +5548,7 @@ var Ii = {
|
|
|
5487
5548
|
}
|
|
5488
5549
|
c((r = r.apply(e, t || [])).next());
|
|
5489
5550
|
});
|
|
5490
|
-
},
|
|
5551
|
+
}, Hi = function(e, t) {
|
|
5491
5552
|
var n = {
|
|
5492
5553
|
label: 0,
|
|
5493
5554
|
sent: function() {
|
|
@@ -5560,7 +5621,7 @@ var Ii = {
|
|
|
5560
5621
|
done: !0
|
|
5561
5622
|
};
|
|
5562
5623
|
}
|
|
5563
|
-
},
|
|
5624
|
+
}, Ui = function(e, t) {
|
|
5564
5625
|
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
5565
5626
|
if (!n) return e;
|
|
5566
5627
|
var r = n.call(e), i, a = [], o;
|
|
@@ -5576,11 +5637,11 @@ var Ii = {
|
|
|
5576
5637
|
}
|
|
5577
5638
|
}
|
|
5578
5639
|
return a;
|
|
5579
|
-
},
|
|
5640
|
+
}, Wi = function(e, t, n) {
|
|
5580
5641
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
5581
5642
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
5582
|
-
},
|
|
5583
|
-
cache:
|
|
5643
|
+
}, Gi = new Li(), Ki = new Li(), qi = new Li(), Ji = {
|
|
5644
|
+
cache: Gi,
|
|
5584
5645
|
refreshInterval: 0,
|
|
5585
5646
|
ttl: 0,
|
|
5586
5647
|
serverTTL: 1e3,
|
|
@@ -5590,15 +5651,15 @@ var Ii = {
|
|
|
5590
5651
|
shouldRetryOnError: !0,
|
|
5591
5652
|
errorRetryInterval: 5e3,
|
|
5592
5653
|
errorRetryCount: 5,
|
|
5593
|
-
fetcher:
|
|
5594
|
-
isOnline:
|
|
5595
|
-
isDocumentVisible:
|
|
5654
|
+
fetcher: Bi.fetcher,
|
|
5655
|
+
isOnline: Bi.isOnline,
|
|
5656
|
+
isDocumentVisible: Bi.isDocumentVisible
|
|
5596
5657
|
};
|
|
5597
|
-
function
|
|
5598
|
-
var r =
|
|
5599
|
-
r ? r.data.push(t) :
|
|
5658
|
+
function Yi(e, t, n) {
|
|
5659
|
+
var r = Ki.get(e);
|
|
5660
|
+
r ? r.data.push(t) : Ki.set(e, [t], n > 0 ? n + 5e3 : n);
|
|
5600
5661
|
}
|
|
5601
|
-
function
|
|
5662
|
+
function Xi(e, t, n) {
|
|
5602
5663
|
if (n.isDocumentVisible() && !(n.errorRetryCount !== void 0 && t > n.errorRetryCount)) {
|
|
5603
5664
|
var r = Math.min(t || 0, n.errorRetryCount), i = r * n.errorRetryInterval;
|
|
5604
5665
|
setTimeout(function() {
|
|
@@ -5609,13 +5670,13 @@ function Ki(e, t, n) {
|
|
|
5609
5670
|
}, i);
|
|
5610
5671
|
}
|
|
5611
5672
|
}
|
|
5612
|
-
var
|
|
5613
|
-
return n === void 0 && (n =
|
|
5673
|
+
var Zi = function(e, t, n, r) {
|
|
5674
|
+
return n === void 0 && (n = Gi), r === void 0 && (r = Ji.ttl), Vi(void 0, void 0, void 0, function() {
|
|
5614
5675
|
var i, a, o, s, c, l, u;
|
|
5615
|
-
return
|
|
5676
|
+
return Hi(this, function(d) {
|
|
5616
5677
|
switch (d.label) {
|
|
5617
5678
|
case 0:
|
|
5618
|
-
if (
|
|
5679
|
+
if (!$i(t)) return [3, 5];
|
|
5619
5680
|
d.label = 1;
|
|
5620
5681
|
case 1: return d.trys.push([
|
|
5621
5682
|
1,
|
|
@@ -5637,7 +5698,7 @@ var qi = function(e, t, n, r) {
|
|
|
5637
5698
|
} catch (e) {
|
|
5638
5699
|
console.error("swrv(mutate): failed to set cache", e);
|
|
5639
5700
|
}
|
|
5640
|
-
return l =
|
|
5701
|
+
return l = Ki.get(e), l && l.data.length && (u = l.data.filter(function(t) {
|
|
5641
5702
|
return t.key === e;
|
|
5642
5703
|
}), u.forEach(function(e, t) {
|
|
5643
5704
|
c.data !== void 0 && (e.data = c.data), e.error = c.error, e.isValidating = c.isValidating, e.isLoading = c.isValidating, t !== u.length - 1 && delete u[t];
|
|
@@ -5646,9 +5707,9 @@ var qi = function(e, t, n, r) {
|
|
|
5646
5707
|
});
|
|
5647
5708
|
});
|
|
5648
5709
|
};
|
|
5649
|
-
function
|
|
5710
|
+
function Qi() {
|
|
5650
5711
|
for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
|
|
5651
|
-
var r, i, a = $({},
|
|
5712
|
+
var r, i, a = $({}, Ji), o = !1, s = !1, c = oe(), l = c?.proxy || c;
|
|
5652
5713
|
if (!l) return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."), null;
|
|
5653
5714
|
var u = l?.$isServer || !1;
|
|
5654
5715
|
t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = $($({}, a), t[2]));
|
|
@@ -5663,26 +5724,26 @@ function Ji() {
|
|
|
5663
5724
|
key: null
|
|
5664
5725
|
});
|
|
5665
5726
|
var m = function(t, n) {
|
|
5666
|
-
return
|
|
5727
|
+
return Vi(e, void 0, void 0, function() {
|
|
5667
5728
|
var e, r, s, c, l, u, h, g = this;
|
|
5668
|
-
return
|
|
5729
|
+
return Hi(this, function(ee) {
|
|
5669
5730
|
switch (ee.label) {
|
|
5670
5731
|
case 0: return e = p.data === void 0, r = f.value, r ? (s = a.cache.get(r), c = s && s.data, p.isValidating = !0, p.isLoading = !c, c && (p.data = c.data, p.error = c.error), l = t || i, !l || !a.isDocumentVisible() && !e || n?.forceRevalidate !== void 0 && !n?.forceRevalidate || s && (u = !!(Date.now() - s.createdAt >= a.dedupingInterval || n?.forceRevalidate), !u) ? (p.isValidating = !1, p.isLoading = !1, [2]) : (h = function() {
|
|
5671
|
-
return
|
|
5732
|
+
return Vi(g, void 0, void 0, function() {
|
|
5672
5733
|
var e, t, i, s;
|
|
5673
|
-
return
|
|
5734
|
+
return Hi(this, function(c) {
|
|
5674
5735
|
switch (c.label) {
|
|
5675
|
-
case 0: return e =
|
|
5736
|
+
case 0: return e = qi.get(r), e ? [3, 2] : (t = Array.isArray(r) ? r : [r], i = l.apply(void 0, Wi([], Ui(t), !1)), qi.set(r, i, a.dedupingInterval), [4, Zi(r, i, a.cache, d)]);
|
|
5676
5737
|
case 1: return c.sent(), [3, 4];
|
|
5677
|
-
case 2: return [4,
|
|
5738
|
+
case 2: return [4, Zi(r, e.data, a.cache, d)];
|
|
5678
5739
|
case 3: c.sent(), c.label = 4;
|
|
5679
|
-
case 4: return p.isValidating = !1, p.isLoading = !1,
|
|
5740
|
+
case 4: return p.isValidating = !1, p.isLoading = !1, qi.delete(r), p.error !== void 0 && (s = !o && a.shouldRetryOnError && (n ? n.shouldRetryOnError : !0), s && Xi(m, n ? n.errorRetryCount : 1, a)), [2];
|
|
5680
5741
|
}
|
|
5681
5742
|
});
|
|
5682
5743
|
});
|
|
5683
5744
|
}, c && a.revalidateDebounce ? (setTimeout(function() {
|
|
5684
|
-
return
|
|
5685
|
-
return
|
|
5745
|
+
return Vi(g, void 0, void 0, function() {
|
|
5746
|
+
return Hi(this, function(e) {
|
|
5686
5747
|
switch (e.label) {
|
|
5687
5748
|
case 0: return o ? [3, 2] : [4, h()];
|
|
5688
5749
|
case 1: e.sent(), e.label = 2;
|
|
@@ -5698,16 +5759,16 @@ function Ji() {
|
|
|
5698
5759
|
});
|
|
5699
5760
|
});
|
|
5700
5761
|
}, h = function() {
|
|
5701
|
-
return
|
|
5702
|
-
return
|
|
5762
|
+
return Vi(e, void 0, void 0, function() {
|
|
5763
|
+
return Hi(this, function(e) {
|
|
5703
5764
|
return [2, m(null, { shouldRetryOnError: !1 })];
|
|
5704
5765
|
});
|
|
5705
5766
|
});
|
|
5706
5767
|
}, g = null;
|
|
5707
5768
|
ce(function() {
|
|
5708
5769
|
var t = function() {
|
|
5709
|
-
return
|
|
5710
|
-
return
|
|
5770
|
+
return Vi(e, void 0, void 0, function() {
|
|
5771
|
+
return Hi(this, function(e) {
|
|
5711
5772
|
switch (e.label) {
|
|
5712
5773
|
case 0: return !p.error && a.isOnline() ? [4, m()] : [3, 2];
|
|
5713
5774
|
case 1: return e.sent(), [3, 3];
|
|
@@ -5720,28 +5781,28 @@ function Ji() {
|
|
|
5720
5781
|
a.refreshInterval && (g = setTimeout(t, a.refreshInterval)), a.revalidateOnFocus && (document.addEventListener("visibilitychange", h, !1), window.addEventListener("focus", h, !1));
|
|
5721
5782
|
}), le(function() {
|
|
5722
5783
|
o = !0, g && clearTimeout(g), a.revalidateOnFocus && (document.removeEventListener("visibilitychange", h, !1), window.removeEventListener("focus", h, !1));
|
|
5723
|
-
var e =
|
|
5784
|
+
var e = Ki.get(f.value);
|
|
5724
5785
|
e && (e.data = e.data.filter(function(e) {
|
|
5725
5786
|
return e !== p;
|
|
5726
5787
|
}));
|
|
5727
5788
|
});
|
|
5728
5789
|
try {
|
|
5729
5790
|
de(f, function(e) {
|
|
5730
|
-
se(f) || (f.value = e), p.key = e, p.isValidating = !!e,
|
|
5791
|
+
se(f) || (f.value = e), p.key = e, p.isValidating = !!e, Yi(f.value, p, d), !u && !s && f.value && m(), s = !1;
|
|
5731
5792
|
}, { immediate: !0 });
|
|
5732
5793
|
} catch {}
|
|
5733
5794
|
return $($({}, E(p)), { mutate: function(e, t) {
|
|
5734
5795
|
return m(e, $($({}, t), { forceRevalidate: !0 }));
|
|
5735
5796
|
} });
|
|
5736
5797
|
}
|
|
5737
|
-
function
|
|
5798
|
+
function $i(e) {
|
|
5738
5799
|
return typeof e == "object" && !!e && typeof e.then == "function";
|
|
5739
5800
|
}
|
|
5740
5801
|
//#endregion
|
|
5741
|
-
//#region ../../node_modules/.pnpm/swrv@1.1.0_vue@3.5.
|
|
5742
|
-
var
|
|
5743
|
-
|
|
5744
|
-
var
|
|
5802
|
+
//#region ../../node_modules/.pnpm/swrv@1.1.0_vue@3.5.34_typescript@6.0.3_/node_modules/swrv/esm/index.js
|
|
5803
|
+
var ea = Qi;
|
|
5804
|
+
ea.default;
|
|
5805
|
+
var ta = class {
|
|
5745
5806
|
constructor(e) {
|
|
5746
5807
|
this.statusRef = T("ready"), this.errorRef = T(void 0), this.pushMessage = (e) => {
|
|
5747
5808
|
this.messagesRef.value = [...this.messagesRef.value, e];
|
|
@@ -5769,18 +5830,18 @@ var Zi = class {
|
|
|
5769
5830
|
set error(e) {
|
|
5770
5831
|
this.errorRef.value = e;
|
|
5771
5832
|
}
|
|
5772
|
-
},
|
|
5833
|
+
}, na = class extends _i {
|
|
5773
5834
|
constructor({ messages: e, ...t }) {
|
|
5774
5835
|
super({
|
|
5775
5836
|
...t,
|
|
5776
|
-
state: new
|
|
5837
|
+
state: new ta(e)
|
|
5777
5838
|
});
|
|
5778
5839
|
}
|
|
5779
5840
|
};
|
|
5780
|
-
|
|
5841
|
+
ea.default;
|
|
5781
5842
|
//#endregion
|
|
5782
5843
|
//#region ../../packages/composable/src/chatbot/useChatbotStore.ts
|
|
5783
|
-
function
|
|
5844
|
+
function ra(e) {
|
|
5784
5845
|
return me(`chatbot-${e}`, () => {
|
|
5785
5846
|
let { t: n, te: r, locale: i } = pe({ useScope: "global" }), a = T(""), o = T(), s = T(e), c = T(), l = T(), u = T(), d = T(), f = T(), p = T(), m = T(), h = T(), g = T(), ee = T(), _ = T(), v = T(), y = T(), b = w(() => l.value === "reasoning"), x = w(() => b.value ? ee.value?.filter((e) => ![
|
|
5786
5847
|
"upvote",
|
|
@@ -5788,7 +5849,7 @@ function $i(e) {
|
|
|
5788
5849
|
"feedback"
|
|
5789
5850
|
].includes(e)) : ee.value), S = ae(w(() => `${s.value}-chatId`), null);
|
|
5790
5851
|
fe(() => {
|
|
5791
|
-
S.value ||=
|
|
5852
|
+
S.value ||= Ai();
|
|
5792
5853
|
});
|
|
5793
5854
|
let C = w({
|
|
5794
5855
|
get: () => S.value,
|
|
@@ -5807,7 +5868,7 @@ function $i(e) {
|
|
|
5807
5868
|
function ue(e) {
|
|
5808
5869
|
if (le(e)) {
|
|
5809
5870
|
let e = D.value.messages.filter((e) => e.role === "user"), t = e[e.length - 1], n = t ? ie(t) : void 0;
|
|
5810
|
-
C.value =
|
|
5871
|
+
C.value = Ai(), D.value.clearError(), oe.value = void 0, n && D.value.sendMessage({ text: n });
|
|
5811
5872
|
return;
|
|
5812
5873
|
}
|
|
5813
5874
|
re.error(e), oe.value = e, ce.value && (se.value = !0);
|
|
@@ -5816,9 +5877,9 @@ function $i(e) {
|
|
|
5816
5877
|
baseUrl: a.value,
|
|
5817
5878
|
basePath: o.value,
|
|
5818
5879
|
headers: () => m.value
|
|
5819
|
-
})), me = T(null), D = w(() => new
|
|
5880
|
+
})), me = T(null), D = w(() => new na({
|
|
5820
5881
|
id: C.value,
|
|
5821
|
-
transport: new
|
|
5882
|
+
transport: new gi({
|
|
5822
5883
|
api: E.value.getChatEndpoint(s.value, b.value ? "reasoning" : "chat"),
|
|
5823
5884
|
prepareSendMessagesRequest: ({ messages: e, id: t }) => ({ body: {
|
|
5824
5885
|
id: t,
|
|
@@ -5846,13 +5907,13 @@ function $i(e) {
|
|
|
5846
5907
|
onToolCall: ({ toolCall: e }) => {
|
|
5847
5908
|
re.log("Tool call:", e);
|
|
5848
5909
|
},
|
|
5849
|
-
sendAutomaticallyWhen:
|
|
5910
|
+
sendAutomaticallyWhen: vi,
|
|
5850
5911
|
onError: ue
|
|
5851
5912
|
})), he = w(() => {
|
|
5852
5913
|
let e = d.value?.initialMessage;
|
|
5853
5914
|
return e?.[i.value] ? e[i.value] : r("message.defaultAgentWelcome") ? n("message.defaultAgentWelcome") : "";
|
|
5854
5915
|
}), ge = w(() => ({
|
|
5855
|
-
id:
|
|
5916
|
+
id: Ai(),
|
|
5856
5917
|
role: "assistant",
|
|
5857
5918
|
parts: [{
|
|
5858
5919
|
type: "text",
|
|
@@ -5916,14 +5977,14 @@ function $i(e) {
|
|
|
5916
5977
|
let t = ye.value.findIndex((t) => t.messageId === e.messageId);
|
|
5917
5978
|
t >= 0 ? ye.value[t] = e : ye.value.push(e);
|
|
5918
5979
|
}
|
|
5919
|
-
function
|
|
5980
|
+
function M(e) {
|
|
5920
5981
|
let t = _e.value, n = t.findIndex((t) => t.id === e.id), r = ie(e) ?? "";
|
|
5921
5982
|
return {
|
|
5922
5983
|
userQuestion: ie(t.slice(0, n).reverse().find((e) => e.role === "user") ?? e) ?? "",
|
|
5923
5984
|
assistantMessage: r
|
|
5924
5985
|
};
|
|
5925
5986
|
}
|
|
5926
|
-
async function
|
|
5987
|
+
async function Ne(e, t) {
|
|
5927
5988
|
await Promise.all([
|
|
5928
5989
|
Ae(e, t),
|
|
5929
5990
|
ke(e),
|
|
@@ -5932,7 +5993,7 @@ function $i(e) {
|
|
|
5932
5993
|
e && (me.value = e);
|
|
5933
5994
|
});
|
|
5934
5995
|
}
|
|
5935
|
-
async function
|
|
5996
|
+
async function Pe() {
|
|
5936
5997
|
let e = De.value.trim(), t = A.value.filter((e) => e.state === "done" && e.mediaSource !== void 0).map((e) => ({
|
|
5937
5998
|
type: "file",
|
|
5938
5999
|
mediaType: e.mediaSource.mimeType,
|
|
@@ -5940,31 +6001,31 @@ function $i(e) {
|
|
|
5940
6001
|
filename: e.mediaSource.name,
|
|
5941
6002
|
providerMetadata: { "8bot": { media: e.mediaSource } }
|
|
5942
6003
|
}));
|
|
5943
|
-
b.value && _e.value.length > 0 && await
|
|
6004
|
+
b.value && _e.value.length > 0 && await N(), j.value = e, Oe.value = D.value.messages.length;
|
|
5944
6005
|
let n = D.value.sendMessage;
|
|
5945
6006
|
n({
|
|
5946
6007
|
text: e,
|
|
5947
6008
|
files: t.length > 0 ? t : void 0
|
|
5948
|
-
}), De.value = "",
|
|
6009
|
+
}), De.value = "", Ie();
|
|
5949
6010
|
}
|
|
5950
|
-
async function
|
|
6011
|
+
async function Fe() {
|
|
5951
6012
|
let e = j.value.length > 0;
|
|
5952
6013
|
await D.value.stop(), e && (De.value = j.value, D.value.messages = D.value.messages.slice(0, Oe.value), j.value = "");
|
|
5953
6014
|
}
|
|
5954
6015
|
de(() => D.value.status, (e) => {
|
|
5955
6016
|
e === "ready" && j.value.length > 0 && (j.value = "");
|
|
5956
6017
|
});
|
|
5957
|
-
function
|
|
6018
|
+
function Ie(e = !1) {
|
|
5958
6019
|
for (let t of A.value) (e || t.state !== "done") && URL.revokeObjectURL(t.localUrl);
|
|
5959
6020
|
A.value = [];
|
|
5960
6021
|
}
|
|
5961
|
-
async function
|
|
5962
|
-
return j.value = "", await
|
|
6022
|
+
async function N() {
|
|
6023
|
+
return j.value = "", await Fe(), C.value = Ai(), D.value.clearError(), oe.value = void 0, se.value = !1, Ie(!0), z("chat"), C.value;
|
|
5963
6024
|
}
|
|
5964
|
-
async function
|
|
5965
|
-
D.value.status !== "ready" && (j.value = "", await
|
|
6025
|
+
async function P(e) {
|
|
6026
|
+
D.value.status !== "ready" && (j.value = "", await Fe()), await D.value.regenerate(e);
|
|
5966
6027
|
}
|
|
5967
|
-
function
|
|
6028
|
+
function F(e) {
|
|
5968
6029
|
if (e.tool === "requestGeolocation") {
|
|
5969
6030
|
let t = e.output;
|
|
5970
6031
|
"latitude" in t && (me.value = {
|
|
@@ -5976,8 +6037,8 @@ function $i(e) {
|
|
|
5976
6037
|
}
|
|
5977
6038
|
D.value.addToolOutput(e);
|
|
5978
6039
|
}
|
|
5979
|
-
async function
|
|
5980
|
-
let t =
|
|
6040
|
+
async function Le(e) {
|
|
6041
|
+
let t = Ai(), n = {
|
|
5981
6042
|
id: t,
|
|
5982
6043
|
file: e,
|
|
5983
6044
|
localUrl: URL.createObjectURL(e),
|
|
@@ -6000,8 +6061,8 @@ function $i(e) {
|
|
|
6000
6061
|
} : e);
|
|
6001
6062
|
}
|
|
6002
6063
|
}
|
|
6003
|
-
async function
|
|
6004
|
-
let { userQuestion: n, assistantMessage: r } =
|
|
6064
|
+
async function I(e, t) {
|
|
6065
|
+
let { userQuestion: n, assistantMessage: r } = M(e);
|
|
6005
6066
|
Me(await E.value.submitMessageFeedback({
|
|
6006
6067
|
messageId: e.id,
|
|
6007
6068
|
chatId: C.value,
|
|
@@ -6011,19 +6072,19 @@ function $i(e) {
|
|
|
6011
6072
|
assistantMessage: r
|
|
6012
6073
|
}));
|
|
6013
6074
|
}
|
|
6014
|
-
async function
|
|
6015
|
-
await
|
|
6075
|
+
async function Re(e) {
|
|
6076
|
+
await I(e, "upvote");
|
|
6016
6077
|
}
|
|
6017
|
-
async function
|
|
6018
|
-
await
|
|
6078
|
+
async function ze(e) {
|
|
6079
|
+
await I(e, "downvote");
|
|
6019
6080
|
}
|
|
6020
|
-
function
|
|
6081
|
+
function Be(e) {
|
|
6021
6082
|
Se.value = !1, Ce.value = void 0, be.value = e;
|
|
6022
6083
|
}
|
|
6023
|
-
async function
|
|
6084
|
+
async function Ve(e) {
|
|
6024
6085
|
if (be.value) try {
|
|
6025
6086
|
xe.value = !0, Se.value = !1, Ce.value = void 0;
|
|
6026
|
-
let { userQuestion: t, assistantMessage: n } =
|
|
6087
|
+
let { userQuestion: t, assistantMessage: n } = M(be.value);
|
|
6027
6088
|
Me(await E.value.submitMessageFeedback({
|
|
6028
6089
|
messageId: be.value.id,
|
|
6029
6090
|
chatId: C.value,
|
|
@@ -6038,7 +6099,7 @@ function $i(e) {
|
|
|
6038
6099
|
xe.value = !1;
|
|
6039
6100
|
}
|
|
6040
6101
|
}
|
|
6041
|
-
async function
|
|
6102
|
+
async function L(e) {
|
|
6042
6103
|
try {
|
|
6043
6104
|
Te.value = !0, we.value = !1, Ee.value = void 0, await E.value.submitLead({
|
|
6044
6105
|
agentId: s.value,
|
|
@@ -6051,17 +6112,17 @@ function $i(e) {
|
|
|
6051
6112
|
Te.value = !1;
|
|
6052
6113
|
}
|
|
6053
6114
|
}
|
|
6054
|
-
async function
|
|
6115
|
+
async function R(e, t) {
|
|
6055
6116
|
let n = await E.value.updateChatTitle(s.value, e, t);
|
|
6056
6117
|
k.value = k.value.map((t) => t.id === e ? {
|
|
6057
6118
|
...t,
|
|
6058
6119
|
title: n.title
|
|
6059
6120
|
} : t);
|
|
6060
6121
|
}
|
|
6061
|
-
async function
|
|
6062
|
-
await E.value.deleteChat(s.value, e), k.value = k.value.filter((t) => t.id !== e), C.value === e && await
|
|
6122
|
+
async function He(e) {
|
|
6123
|
+
await E.value.deleteChat(s.value, e), k.value = k.value.filter((t) => t.id !== e), C.value === e && await N();
|
|
6063
6124
|
}
|
|
6064
|
-
function
|
|
6125
|
+
function z(e) {
|
|
6065
6126
|
ve.value = e;
|
|
6066
6127
|
}
|
|
6067
6128
|
return {
|
|
@@ -6101,27 +6162,27 @@ function $i(e) {
|
|
|
6101
6162
|
isLeadSubmitted: we,
|
|
6102
6163
|
isLoadingSubmitLead: Te,
|
|
6103
6164
|
submitLeadError: Ee,
|
|
6104
|
-
initialize:
|
|
6165
|
+
initialize: Ne,
|
|
6105
6166
|
loadConversations: ke,
|
|
6106
|
-
handleSubmit:
|
|
6107
|
-
stopGeneration:
|
|
6108
|
-
startNewChat:
|
|
6109
|
-
regenerate:
|
|
6110
|
-
addToolOutput:
|
|
6111
|
-
handleFileSelect:
|
|
6112
|
-
clearPendingAttachments:
|
|
6113
|
-
onUpvote:
|
|
6114
|
-
onDownvote:
|
|
6115
|
-
onFeedback:
|
|
6116
|
-
onFeedbackSubmit:
|
|
6117
|
-
onLeadSubmit:
|
|
6118
|
-
navigate:
|
|
6119
|
-
renameChatTitle:
|
|
6120
|
-
deleteChat:
|
|
6167
|
+
handleSubmit: Pe,
|
|
6168
|
+
stopGeneration: Fe,
|
|
6169
|
+
startNewChat: N,
|
|
6170
|
+
regenerate: P,
|
|
6171
|
+
addToolOutput: F,
|
|
6172
|
+
handleFileSelect: Le,
|
|
6173
|
+
clearPendingAttachments: Ie,
|
|
6174
|
+
onUpvote: Re,
|
|
6175
|
+
onDownvote: ze,
|
|
6176
|
+
onFeedback: Be,
|
|
6177
|
+
onFeedbackSubmit: Ve,
|
|
6178
|
+
onLeadSubmit: L,
|
|
6179
|
+
navigate: z,
|
|
6180
|
+
renameChatTitle: R,
|
|
6181
|
+
deleteChat: He
|
|
6121
6182
|
};
|
|
6122
6183
|
})();
|
|
6123
6184
|
}
|
|
6124
6185
|
//#endregion
|
|
6125
|
-
export {
|
|
6186
|
+
export { K as a, rn as i, ea as n, Ai as r, ra as t };
|
|
6126
6187
|
|
|
6127
|
-
//# sourceMappingURL=useChatbotStore-
|
|
6188
|
+
//# sourceMappingURL=useChatbotStore-DMDbzuub.js.map
|