@chaibuilder/sdk 4.0.0-beta.35 → 4.0.0-beta.37
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/{2SSKDMRQ-Ce8xH_EE.js → 2SSKDMRQ-B9Y7DUaU.js} +5 -5
- package/dist/{2SSKDMRQ-CZ0Vy6ir.cjs → 2SSKDMRQ-Dost66qm.cjs} +1 -1
- package/dist/{AP7HFJJL-DxRUcy8z.js → AP7HFJJL-Db0-YeT-.js} +1 -1
- package/dist/{AP7HFJJL-C_GhxNzR.cjs → AP7HFJJL-DxBuLcYj.cjs} +1 -1
- package/dist/{IconPicker-B-NfypT7.cjs → IconPicker-BCYCPK5M.cjs} +1 -1
- package/dist/{IconPicker-BzQ_r0nM.js → IconPicker-CQPu4qCk.js} +1 -1
- package/dist/{WDYDFRGG-DPPgf9Va.cjs → WDYDFRGG-BLnyHnIr.cjs} +1 -1
- package/dist/{WDYDFRGG-JMA9G17v.js → WDYDFRGG-DjIZGWcU.js} +6 -6
- package/dist/{actions-registery-CKEzH855.js → actions-registery-CMKfEXxX.js} +235 -301
- package/dist/{actions-registery-Byid-s6S.cjs → actions-registery-CqhNZFV3.cjs} +13 -13
- package/dist/actions.cjs +1 -1
- package/dist/actions.js +2 -2
- package/dist/{active-in-another-tab-CcCrhl7z.cjs → active-in-another-tab-D6BuBAvD.cjs} +1 -1
- package/dist/{active-in-another-tab-C-E0cjyu.js → active-in-another-tab-DvKdkseG.js} +4 -4
- package/dist/{add-new-language-page-D93yJKtJ.js → add-new-language-page-Bt-EHTdP.js} +3 -3
- package/dist/{add-new-language-page-DIAFT7Au.cjs → add-new-language-page-DXaV4Znu.cjs} +1 -1
- package/dist/{add-new-page-D2IBnynJ.cjs → add-new-page-D1X6uewl.cjs} +1 -1
- package/dist/{add-new-page-DaBpJeHK.js → add-new-page-JSrqASzg.js} +2 -2
- package/dist/{ai-panel-content-DAXG0iZN.js → ai-panel-content-BcU74IAG.js} +3 -3
- package/dist/{ai-panel-content-CZO5fG_R.cjs → ai-panel-content-Ci6Vp7Cf.cjs} +1 -1
- package/dist/{ai-panel-default-lang-CwnsdDO8.cjs → ai-panel-default-lang-CfuUmamx.cjs} +2 -2
- package/dist/{ai-panel-default-lang-KI9kwEt7.js → ai-panel-default-lang-CxEaZ63K.js} +4 -4
- package/dist/{ai-panel-other-lang-DgyCpBVD.js → ai-panel-other-lang-B1uL_scz.js} +3 -3
- package/dist/{ai-panel-other-lang-BpGRrcQQ.cjs → ai-panel-other-lang-BA1TOdh_.cjs} +1 -1
- package/dist/{ai-prompt-input-CJLPetgL.cjs → ai-prompt-input-BuP52voq.cjs} +1 -1
- package/dist/{ai-prompt-input-DO-zCSY_.js → ai-prompt-input-CrRc0Z7y.js} +1 -1
- package/dist/{ai-translation-prompt-BQ0OW9F_.cjs → ai-translation-prompt-D8N5bmVu.cjs} +1 -1
- package/dist/{ai-translation-prompt-Cs39rmRE.js → ai-translation-prompt-DFX27zHM.js} +1 -1
- package/dist/{apply-binding-C0xIYKCN.cjs → apply-binding-BuwI_Uf5.cjs} +9 -9
- package/dist/{apply-binding-Bu5W9YFY.js → apply-binding-RQRSIe56.js} +91 -89
- package/dist/{change-password-modal-CdrJct2d.cjs → change-password-modal-3rWUghQW.cjs} +1 -1
- package/dist/{change-password-modal-CfZ3KoDT.js → change-password-modal-kdADAvi2.js} +4 -4
- package/dist/{code-editor-B87D8cT6.js → code-editor-ClZiD7lg.js} +1 -1
- package/dist/{code-editor-BTs3K_My.cjs → code-editor-gqdLU-rU.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-BkHlxvfG.cjs → continue-editing-in-this-client-CIheMKdX.cjs} +1 -1
- package/dist/{continue-editing-in-this-client-BqgTDohA.js → continue-editing-in-this-client-Dl72_nLZ.js} +2 -2
- package/dist/core.cjs +1 -1
- package/dist/core.js +14 -14
- package/dist/{css-import-modal-DgXSYibP.cjs → css-import-modal-B2NoLsdZ.cjs} +1 -1
- package/dist/{css-import-modal-DIgM4T8d.js → css-import-modal-nJooZxLU.js} +1 -1
- package/dist/delete-page-BtG5kYkI.cjs +1 -0
- package/dist/delete-page-DNz6-CLI.js +84 -0
- package/dist/{design-token-usage-DMSy2KGp.cjs → design-token-usage-BBLfxzzo.cjs} +1 -1
- package/dist/{design-token-usage-DSpw3Kqi.js → design-token-usage-nTgxy81G.js} +1 -1
- package/dist/{digital-asset-manager-aSXb6slG.js → digital-asset-manager-BdNe83F3.js} +3 -3
- package/dist/{digital-asset-manager-BoNm3Q2W.cjs → digital-asset-manager-CASGSQ33.cjs} +1 -1
- package/dist/{duplicate-page-CwFCJNwW.cjs → duplicate-page-C7e9snhW.cjs} +1 -1
- package/dist/{duplicate-page-C46afThg.js → duplicate-page-DYxGlrmd.js} +6 -6
- package/dist/{dynamic-page-selector-txjqS5jX.cjs → dynamic-page-selector-Cot9d5fm.cjs} +1 -1
- package/dist/{dynamic-page-selector-IT9LZDro.js → dynamic-page-selector-Seiq-wJc.js} +2 -2
- package/dist/{image-editor-CpUpmlCT.cjs → image-editor-Cfn290vp.cjs} +1 -1
- package/dist/{image-editor-CdNLsyhd.js → image-editor-JNxRYYiG.js} +1 -1
- package/dist/{index-DZheQdw-.js → index-7OSd9ssH.js} +4922 -4677
- package/dist/{index-Bh0hrlXu.js → index-CHoZEbKv.js} +2013 -1857
- package/dist/index-P-2SvZA9.cjs +160 -0
- package/dist/index-d1_bmLx3.cjs +5 -0
- package/dist/{json-diff-viewer-D1Y_t-v4.js → json-diff-viewer-BzXIZ79o.js} +37 -37
- package/dist/{json-diff-viewer-CTsxzkiu.cjs → json-diff-viewer-CMd26XKs.cjs} +1 -1
- package/dist/{lang-panel-BUXBHMCZ.cjs → lang-panel-CxmuZt3k.cjs} +1 -1
- package/dist/{lang-panel-irJl_yAH.js → lang-panel-DPhpM-pr.js} +23 -23
- package/dist/{manage-design-tokens-Cdi3Ma4y.cjs → manage-design-tokens-B_-TrQgu.cjs} +1 -1
- package/dist/{manage-design-tokens-BxXReDdA.js → manage-design-tokens-QAUcjndy.js} +2 -2
- package/dist/{manage-design-tokens-modal-DyvSsIVv.js → manage-design-tokens-modal-BpkJx1YU.js} +2 -2
- package/dist/{manage-design-tokens-modal-Dr5lwyr_.cjs → manage-design-tokens-modal-Bug5H8PT.cjs} +1 -1
- package/dist/{mark-as-template-DqIqHM7P.js → mark-as-template-BEz6ecRQ.js} +2 -2
- package/dist/{mark-as-template-Dr-qn1H7.cjs → mark-as-template-mD6fOtmk.cjs} +1 -1
- package/dist/{nested-path-selector-content-D6f2I80h.cjs → nested-path-selector-content-BHPOfftZ.cjs} +1 -1
- package/dist/{nested-path-selector-content-B4p9qltN.js → nested-path-selector-content-CoovvfzI.js} +1 -1
- package/dist/{no-language-page-content-DQK5hRDH.js → no-language-page-content-BAHxTRff.js} +2 -2
- package/dist/{no-language-page-content-Cb8CviKU.cjs → no-language-page-content-DvBnZrhb.cjs} +1 -1
- package/dist/{no-language-page-dialog-J36heFUY.cjs → no-language-page-dialog-AU6R_Umm.cjs} +1 -1
- package/dist/{no-language-page-dialog-Bw_oSBFM.js → no-language-page-dialog-Di0PXuKT.js} +2 -2
- package/dist/{page-creator-CMJ9ZDbx.cjs → page-creator-D5tEK7Vm.cjs} +1 -1
- package/dist/{page-creator-C5g7z8W6.js → page-creator-VvmlAgTA.js} +51 -51
- package/dist/{page-lock-BWomVpCL.cjs → page-lock-B6d47DbD.cjs} +1 -1
- package/dist/{page-lock-C4R_Or95.js → page-lock-COOgRF1e.js} +2 -2
- package/dist/{page-locked-dialog-DMZLhad3.cjs → page-locked-dialog-BKTQmsMr.cjs} +1 -1
- package/dist/{page-locked-dialog-urg4T_WZ.js → page-locked-dialog-DSWy_zpi.js} +6 -6
- package/dist/{page-manager-new-D_Lwwz4w.js → page-manager-new-ABq5ZgFr.js} +70 -70
- package/dist/{page-manager-new-myexG-Df.cjs → page-manager-new-xSa6-2s3.cjs} +1 -1
- package/dist/{page-manager-search-and-filter-D56yGDSe.js → page-manager-search-and-filter-C6p6v1qj.js} +2 -2
- package/dist/{page-manager-search-and-filter-qv_E2tzW.cjs → page-manager-search-and-filter-DXgvy0ys.cjs} +1 -1
- package/dist/{page-revisions-content-BOaT_9og.cjs → page-revisions-content-BuNpklOO.cjs} +1 -1
- package/dist/{page-revisions-content-Dyi6EY_V.js → page-revisions-content-CAgq7kLY.js} +14 -14
- package/dist/pages.cjs +1 -1
- package/dist/pages.d.ts +1 -0
- package/dist/pages.js +4 -4
- package/dist/publish-pages-content-CX1nQ8PA.cjs +1 -0
- package/dist/{publish-pages-content-C0vWbTxI.js → publish-pages-content-Ct7VDbNE.js} +81 -74
- package/dist/render.cjs +1 -1
- package/dist/render.js +124 -123
- package/dist/{rte-widget-modal-BCFhKLqA.cjs → rte-widget-modal-CHxO3TQR.cjs} +1 -1
- package/dist/{rte-widget-modal-DcXHaT-t.js → rte-widget-modal-iLgUdcBu.js} +1 -1
- package/dist/{save-to-lib-Bw6DefI8.cjs → save-to-lib-C67fQ8_8.cjs} +1 -1
- package/dist/{save-to-lib-BN2EgYkx.js → save-to-lib-CAzWtI64.js} +21 -21
- package/dist/sdk.css +1 -1
- package/dist/{selected-block-display-BE83jvES.js → selected-block-display-B_6-n75b.js} +2 -2
- package/dist/{selected-block-display-DQ_eRZxQ.cjs → selected-block-display-DqC6ZtSA.cjs} +1 -1
- package/dist/{seo-panel-Bd5Yt35N.js → seo-panel-DGnUvVO2.js} +16 -16
- package/dist/{seo-panel-BZJ-bpPv.cjs → seo-panel-DQmVSmiq.cjs} +1 -1
- package/dist/{shared-json-ld-_tOID7Vv.cjs → shared-json-ld-BpcG0rtf.cjs} +1 -1
- package/dist/{shared-json-ld-FApiYd-N.js → shared-json-ld-CuMx_qAL.js} +11 -11
- package/dist/{slug-input-CQu9-5GT.cjs → slug-input-DHVDl_Dv.cjs} +1 -1
- package/dist/{slug-input-BCs8-IRf.js → slug-input-DcYoeQxL.js} +1 -1
- package/dist/supabase-actions.cjs +1 -1
- package/dist/supabase-actions.js +1 -1
- package/dist/{take-over-request-BfJbko6g.js → take-over-request-B2vspYrb.js} +8 -8
- package/dist/{take-over-request-CjcBgl4k.cjs → take-over-request-BJaH6pnu.cjs} +1 -1
- package/dist/{translation-warning-modal-BfFfRg7q.cjs → translation-warning-modal-BxV_8mCE.cjs} +1 -1
- package/dist/{translation-warning-modal-KLjj1aXN.js → translation-warning-modal-DEW8JWRh.js} +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/{unmark-as-template-DCoIaBeJ.cjs → unmark-as-template-BYjs9XbH.cjs} +1 -1
- package/dist/{unmark-as-template-vdqK9CiS.js → unmark-as-template-DEs6DnT4.js} +2 -2
- package/dist/{unpublish-page-5a9yi96y.js → unpublish-page-D-5iWXIB.js} +2 -2
- package/dist/{unpublish-page-CKeoMtlZ.cjs → unpublish-page-rlnt_4EX.cjs} +1 -1
- package/dist/{unpublished-partials-modal-Bx35iokR.cjs → unpublished-partials-modal-D50Hxk6N.cjs} +1 -1
- package/dist/{unpublished-partials-modal-UTkegPmZ.js → unpublished-partials-modal-Do2HSNYq.js} +1 -1
- package/dist/{web-preview-IfmBWYnZ.js → web-preview-DRp7Zk7f.js} +1 -1
- package/dist/{web-preview-DbcvvsU-.cjs → web-preview-Daz-wyo3.cjs} +1 -1
- package/package.json +1 -1
- package/dist/delete-page-BIP7fPy_.js +0 -71
- package/dist/delete-page-Vn6P6hEV.cjs +0 -1
- package/dist/index-D76nE1DU.cjs +0 -5
- package/dist/index-W4Ur56bi.cjs +0 -160
- package/dist/publish-pages-content-CqiZED9d.cjs +0 -1
|
@@ -2,10 +2,10 @@ var $u = Object.defineProperty;
|
|
|
2
2
|
var Mu = (e, t, r) => t in e ? $u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var Ae = (e, t, r) => Mu(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { a as Fu, d as zu, f as ua, g as Lu, e as Uu, h as Zu, i as ju } from "./register-partial-type-BjtdfKHE.js";
|
|
5
|
-
import { noop as Fa, omit as ca, isEmpty as
|
|
5
|
+
import { noop as Fa, omit as ca, isEmpty as Mt, isFunction as Hn, map as za, uniq as Jn, set as Yn, orderBy as Gu, get as Dt, has as Bu, each as Vu, first as qu, flattenDeep as Hu, pick as vn, compact as La, keys as Ua } from "lodash-es";
|
|
6
6
|
import { g as Ju } from "./_commonjsHelpers-C6fGbg64.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import Yu from "fs";
|
|
8
|
+
import Wu from "path";
|
|
9
9
|
import Ku from "os";
|
|
10
10
|
import Xu, { createHash as Qu } from "crypto";
|
|
11
11
|
import { drizzle as ec } from "drizzle-orm/postgres-js";
|
|
@@ -65,7 +65,7 @@ var ks = "vercel.ai.error", uc = Symbol.for(ks), Ba, Va, H = class Ps extends (V
|
|
|
65
65
|
static isInstance(e) {
|
|
66
66
|
return H.hasMarker(e, Ds);
|
|
67
67
|
}
|
|
68
|
-
}, $s = "AI_EmptyResponseBodyError", Ms = `vercel.ai.error.${$s}`, dc = Symbol.for(Ms), Ja,
|
|
68
|
+
}, $s = "AI_EmptyResponseBodyError", Ms = `vercel.ai.error.${$s}`, dc = Symbol.for(Ms), Ja, Ya, pc = class extends (Ya = H, Ja = dc, Ya) {
|
|
69
69
|
// used in isInstance
|
|
70
70
|
constructor({ message: e = "Empty response body" } = {}) {
|
|
71
71
|
super({ name: $s, message: e }), this[Ja] = !0;
|
|
@@ -77,18 +77,18 @@ var ks = "vercel.ai.error", uc = Symbol.for(ks), Ba, Va, H = class Ps extends (V
|
|
|
77
77
|
function or(e) {
|
|
78
78
|
return e == null ? "unknown error" : typeof e == "string" ? e : e instanceof Error ? e.message : JSON.stringify(e);
|
|
79
79
|
}
|
|
80
|
-
var Fs = "AI_InvalidArgumentError", zs = `vercel.ai.error.${Fs}`, fc = Symbol.for(zs),
|
|
80
|
+
var Fs = "AI_InvalidArgumentError", zs = `vercel.ai.error.${Fs}`, fc = Symbol.for(zs), Wa, Ka, gc = class extends (Ka = H, Wa = fc, Ka) {
|
|
81
81
|
constructor({
|
|
82
82
|
message: t,
|
|
83
83
|
cause: r,
|
|
84
84
|
argument: n
|
|
85
85
|
}) {
|
|
86
|
-
super({ name: Fs, message: t, cause: r }), this[
|
|
86
|
+
super({ name: Fs, message: t, cause: r }), this[Wa] = !0, this.argument = n;
|
|
87
87
|
}
|
|
88
88
|
static isInstance(t) {
|
|
89
89
|
return H.hasMarker(t, zs);
|
|
90
90
|
}
|
|
91
|
-
}, Ls = "AI_InvalidPromptError", Us = `vercel.ai.error.${Ls}`, hc = Symbol.for(Us), Xa, Qa,
|
|
91
|
+
}, Ls = "AI_InvalidPromptError", Us = `vercel.ai.error.${Ls}`, hc = Symbol.for(Us), Xa, Qa, Wt = class extends (Qa = H, Xa = hc, Qa) {
|
|
92
92
|
constructor({
|
|
93
93
|
prompt: e,
|
|
94
94
|
message: t,
|
|
@@ -111,7 +111,7 @@ Error message: ${or(t)}`,
|
|
|
111
111
|
static isInstance(e) {
|
|
112
112
|
return H.hasMarker(e, js);
|
|
113
113
|
}
|
|
114
|
-
}, Gs = "AI_TypeValidationError", Bs = `vercel.ai.error.${Gs}`, yc = Symbol.for(Bs), ro, no, Ft = class
|
|
114
|
+
}, Gs = "AI_TypeValidationError", Bs = `vercel.ai.error.${Gs}`, yc = Symbol.for(Bs), ro, no, Ft = class Wn extends (no = H, ro = yc, no) {
|
|
115
115
|
constructor({ value: t, cause: r }) {
|
|
116
116
|
super({
|
|
117
117
|
name: Gs,
|
|
@@ -137,7 +137,7 @@ Error message: ${or(r)}`,
|
|
|
137
137
|
value: t,
|
|
138
138
|
cause: r
|
|
139
139
|
}) {
|
|
140
|
-
return
|
|
140
|
+
return Wn.isInstance(r) && r.value === t ? r : new Wn({ value: t, cause: r });
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
function w(e, t, r) {
|
|
@@ -188,7 +188,7 @@ class Vs extends Error {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
const qs = {};
|
|
191
|
-
function
|
|
191
|
+
function It(e) {
|
|
192
192
|
return qs;
|
|
193
193
|
}
|
|
194
194
|
function Hs(e) {
|
|
@@ -226,7 +226,7 @@ function vc(e, t) {
|
|
|
226
226
|
return s % i / 10 ** o;
|
|
227
227
|
}
|
|
228
228
|
const ao = Symbol("evaluating");
|
|
229
|
-
function
|
|
229
|
+
function W(e, t, r) {
|
|
230
230
|
let n;
|
|
231
231
|
Object.defineProperty(e, t, {
|
|
232
232
|
get() {
|
|
@@ -250,7 +250,7 @@ function Ut(e, t, r) {
|
|
|
250
250
|
configurable: !0
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Ot(...e) {
|
|
254
254
|
const t = {};
|
|
255
255
|
for (const r of e) {
|
|
256
256
|
const n = Object.getOwnPropertyDescriptors(r);
|
|
@@ -289,14 +289,14 @@ function tr(e) {
|
|
|
289
289
|
const r = t.prototype;
|
|
290
290
|
return !(br(r) === !1 || Object.prototype.hasOwnProperty.call(r, "isPrototypeOf") === !1);
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function Ys(e) {
|
|
293
293
|
return tr(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
|
|
294
294
|
}
|
|
295
295
|
const Tc = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
296
296
|
function rr(e) {
|
|
297
297
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function Rt(e, t, r) {
|
|
300
300
|
const n = new e._zod.constr(t ?? e._zod.def);
|
|
301
301
|
return (!t || r != null && r.parent) && (n._zod.parent = e), n;
|
|
302
302
|
}
|
|
@@ -327,7 +327,7 @@ function Ic(e, t) {
|
|
|
327
327
|
const r = e._zod.def, n = r.checks;
|
|
328
328
|
if (n && n.length > 0)
|
|
329
329
|
throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
330
|
-
const o =
|
|
330
|
+
const o = Ot(e._zod.def, {
|
|
331
331
|
get shape() {
|
|
332
332
|
const s = {};
|
|
333
333
|
for (const i in t) {
|
|
@@ -339,13 +339,13 @@ function Ic(e, t) {
|
|
|
339
339
|
},
|
|
340
340
|
checks: []
|
|
341
341
|
});
|
|
342
|
-
return
|
|
342
|
+
return Rt(e, o);
|
|
343
343
|
}
|
|
344
344
|
function Sc(e, t) {
|
|
345
345
|
const r = e._zod.def, n = r.checks;
|
|
346
346
|
if (n && n.length > 0)
|
|
347
347
|
throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
348
|
-
const o =
|
|
348
|
+
const o = Ot(e._zod.def, {
|
|
349
349
|
get shape() {
|
|
350
350
|
const s = { ...e._zod.def.shape };
|
|
351
351
|
for (const i in t) {
|
|
@@ -357,7 +357,7 @@ function Sc(e, t) {
|
|
|
357
357
|
},
|
|
358
358
|
checks: []
|
|
359
359
|
});
|
|
360
|
-
return
|
|
360
|
+
return Rt(e, o);
|
|
361
361
|
}
|
|
362
362
|
function Ac(e, t) {
|
|
363
363
|
if (!tr(t))
|
|
@@ -369,27 +369,27 @@ function Ac(e, t) {
|
|
|
369
369
|
if (Object.getOwnPropertyDescriptor(o, s) !== void 0)
|
|
370
370
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
371
371
|
}
|
|
372
|
-
const a =
|
|
372
|
+
const a = Ot(e._zod.def, {
|
|
373
373
|
get shape() {
|
|
374
374
|
const o = { ...e._zod.def.shape, ...t };
|
|
375
375
|
return Ut(this, "shape", o), o;
|
|
376
376
|
}
|
|
377
377
|
});
|
|
378
|
-
return
|
|
378
|
+
return Rt(e, a);
|
|
379
379
|
}
|
|
380
380
|
function Nc(e, t) {
|
|
381
381
|
if (!tr(t))
|
|
382
382
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
383
|
-
const r =
|
|
383
|
+
const r = Ot(e._zod.def, {
|
|
384
384
|
get shape() {
|
|
385
385
|
const n = { ...e._zod.def.shape, ...t };
|
|
386
386
|
return Ut(this, "shape", n), n;
|
|
387
387
|
}
|
|
388
388
|
});
|
|
389
|
-
return
|
|
389
|
+
return Rt(e, r);
|
|
390
390
|
}
|
|
391
391
|
function Oc(e, t) {
|
|
392
|
-
const r =
|
|
392
|
+
const r = Ot(e._zod.def, {
|
|
393
393
|
get shape() {
|
|
394
394
|
const n = { ...e._zod.def.shape, ...t._zod.def.shape };
|
|
395
395
|
return Ut(this, "shape", n), n;
|
|
@@ -400,13 +400,13 @@ function Oc(e, t) {
|
|
|
400
400
|
checks: []
|
|
401
401
|
// delete existing checks
|
|
402
402
|
});
|
|
403
|
-
return
|
|
403
|
+
return Rt(e, r);
|
|
404
404
|
}
|
|
405
405
|
function Rc(e, t, r) {
|
|
406
406
|
const a = t._zod.def.checks;
|
|
407
407
|
if (a && a.length > 0)
|
|
408
408
|
throw new Error(".partial() cannot be used on object schemas containing refinements");
|
|
409
|
-
const s =
|
|
409
|
+
const s = Ot(t._zod.def, {
|
|
410
410
|
get shape() {
|
|
411
411
|
const i = t._zod.def.shape, l = { ...i };
|
|
412
412
|
if (r)
|
|
@@ -428,10 +428,10 @@ function Rc(e, t, r) {
|
|
|
428
428
|
},
|
|
429
429
|
checks: []
|
|
430
430
|
});
|
|
431
|
-
return
|
|
431
|
+
return Rt(t, s);
|
|
432
432
|
}
|
|
433
433
|
function xc(e, t, r) {
|
|
434
|
-
const n =
|
|
434
|
+
const n = Ot(t._zod.def, {
|
|
435
435
|
get shape() {
|
|
436
436
|
const a = t._zod.def.shape, o = { ...a };
|
|
437
437
|
if (r)
|
|
@@ -452,7 +452,7 @@ function xc(e, t, r) {
|
|
|
452
452
|
return Ut(this, "shape", o), o;
|
|
453
453
|
}
|
|
454
454
|
});
|
|
455
|
-
return
|
|
455
|
+
return Rt(t, n);
|
|
456
456
|
}
|
|
457
457
|
function Kt(e, t = 0) {
|
|
458
458
|
var r;
|
|
@@ -472,7 +472,7 @@ function Xt(e, t) {
|
|
|
472
472
|
function Hr(e) {
|
|
473
473
|
return typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function St(e, t, r) {
|
|
476
476
|
var a, o, s, i, l, u;
|
|
477
477
|
const n = { ...e, path: e.path ?? [] };
|
|
478
478
|
if (!e.message) {
|
|
@@ -493,7 +493,7 @@ function Ir(...e) {
|
|
|
493
493
|
inst: n
|
|
494
494
|
} : { ...t };
|
|
495
495
|
}
|
|
496
|
-
const
|
|
496
|
+
const Ws = (e, t) => {
|
|
497
497
|
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
498
498
|
value: e._zod,
|
|
499
499
|
enumerable: !1
|
|
@@ -504,7 +504,7 @@ const Ys = (e, t) => {
|
|
|
504
504
|
value: () => e.message,
|
|
505
505
|
enumerable: !1
|
|
506
506
|
});
|
|
507
|
-
}, Ks = w("$ZodError",
|
|
507
|
+
}, Ks = w("$ZodError", Ws), Xs = w("$ZodError", Ws, { Parent: Error });
|
|
508
508
|
function kc(e, t = (r) => r.message) {
|
|
509
509
|
const r = {}, n = [];
|
|
510
510
|
for (const a of e.issues)
|
|
@@ -537,7 +537,7 @@ const ha = (e) => (t, r, n, a) => {
|
|
|
537
537
|
if (s instanceof Promise)
|
|
538
538
|
throw new Qt();
|
|
539
539
|
if (s.issues.length) {
|
|
540
|
-
const i = new ((a == null ? void 0 : a.Err) ?? e)(s.issues.map((l) =>
|
|
540
|
+
const i = new ((a == null ? void 0 : a.Err) ?? e)(s.issues.map((l) => St(l, o, It())));
|
|
541
541
|
throw Js(i, a == null ? void 0 : a.callee), i;
|
|
542
542
|
}
|
|
543
543
|
return s.value;
|
|
@@ -545,7 +545,7 @@ const ha = (e) => (t, r, n, a) => {
|
|
|
545
545
|
const o = n ? Object.assign(n, { async: !0 }) : { async: !0 };
|
|
546
546
|
let s = t._zod.run({ value: r, issues: [] }, o);
|
|
547
547
|
if (s instanceof Promise && (s = await s), s.issues.length) {
|
|
548
|
-
const i = new ((a == null ? void 0 : a.Err) ?? e)(s.issues.map((l) =>
|
|
548
|
+
const i = new ((a == null ? void 0 : a.Err) ?? e)(s.issues.map((l) => St(l, o, It())));
|
|
549
549
|
throw Js(i, a == null ? void 0 : a.callee), i;
|
|
550
550
|
}
|
|
551
551
|
return s.value;
|
|
@@ -555,14 +555,14 @@ const ha = (e) => (t, r, n, a) => {
|
|
|
555
555
|
throw new Qt();
|
|
556
556
|
return o.issues.length ? {
|
|
557
557
|
success: !1,
|
|
558
|
-
error: new (e ?? Ks)(o.issues.map((s) =>
|
|
558
|
+
error: new (e ?? Ks)(o.issues.map((s) => St(s, a, It())))
|
|
559
559
|
} : { success: !0, data: o.value };
|
|
560
560
|
}, Cc = /* @__PURE__ */ _n(Xs), Tn = (e) => async (t, r, n) => {
|
|
561
561
|
const a = n ? Object.assign(n, { async: !0 }) : { async: !0 };
|
|
562
562
|
let o = t._zod.run({ value: r, issues: [] }, a);
|
|
563
563
|
return o instanceof Promise && (o = await o), o.issues.length ? {
|
|
564
564
|
success: !1,
|
|
565
|
-
error: new e(o.issues.map((s) =>
|
|
565
|
+
error: new e(o.issues.map((s) => St(s, a, It())))
|
|
566
566
|
} : { success: !0, data: o.value };
|
|
567
567
|
}, Dc = /* @__PURE__ */ Tn(Xs), $c = (e) => (t, r, n) => {
|
|
568
568
|
const a = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
@@ -576,7 +576,7 @@ const ha = (e) => (t, r, n, a) => {
|
|
|
576
576
|
}, Uc = (e) => (t, r, n) => _n(e)(t, r, n), Zc = (e) => async (t, r, n) => {
|
|
577
577
|
const a = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" };
|
|
578
578
|
return Tn(e)(t, r, a);
|
|
579
|
-
}, jc = (e) => async (t, r, n) => Tn(e)(t, r, n), Gc = /^[cC][^\s-]{8,}$/, Bc = /^[0-9a-z]+$/, Vc = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, qc = /^[0-9a-vA-V]{20}$/, Hc = /^[A-Za-z0-9]{27}$/, Jc = /^[a-zA-Z0-9_-]{21}$/,
|
|
579
|
+
}, jc = (e) => async (t, r, n) => Tn(e)(t, r, n), Gc = /^[cC][^\s-]{8,}$/, Bc = /^[0-9a-z]+$/, Vc = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, qc = /^[0-9a-vA-V]{20}$/, Hc = /^[A-Za-z0-9]{27}$/, Jc = /^[a-zA-Z0-9_-]{21}$/, Yc = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Wc = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, so = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Kc = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Xc = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
580
580
|
function Qc() {
|
|
581
581
|
return new RegExp(Xc, "u");
|
|
582
582
|
}
|
|
@@ -964,7 +964,7 @@ const Od = {
|
|
|
964
964
|
return o(u, n, l);
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
|
-
|
|
967
|
+
W(e, "~standard", () => ({
|
|
968
968
|
validate: (o) => {
|
|
969
969
|
var s;
|
|
970
970
|
try {
|
|
@@ -998,7 +998,7 @@ const Od = {
|
|
|
998
998
|
}), ve = /* @__PURE__ */ w("$ZodStringFormat", (e, t) => {
|
|
999
999
|
En.init(e, t), ya.init(e, t);
|
|
1000
1000
|
}), Rd = /* @__PURE__ */ w("$ZodGUID", (e, t) => {
|
|
1001
|
-
t.pattern ?? (t.pattern =
|
|
1001
|
+
t.pattern ?? (t.pattern = Wc), ve.init(e, t);
|
|
1002
1002
|
}), xd = /* @__PURE__ */ w("$ZodUUID", (e, t) => {
|
|
1003
1003
|
if (t.version) {
|
|
1004
1004
|
const n = {
|
|
@@ -1072,7 +1072,7 @@ const Od = {
|
|
|
1072
1072
|
}), jd = /* @__PURE__ */ w("$ZodISOTime", (e, t) => {
|
|
1073
1073
|
t.pattern ?? (t.pattern = id(t)), ve.init(e, t);
|
|
1074
1074
|
}), Gd = /* @__PURE__ */ w("$ZodISODuration", (e, t) => {
|
|
1075
|
-
t.pattern ?? (t.pattern =
|
|
1075
|
+
t.pattern ?? (t.pattern = Yc), ve.init(e, t);
|
|
1076
1076
|
}), Bd = /* @__PURE__ */ w("$ZodIPv4", (e, t) => {
|
|
1077
1077
|
t.pattern ?? (t.pattern = ed), ve.init(e, t), e._zod.bag.format = "ipv4";
|
|
1078
1078
|
}), Vd = /* @__PURE__ */ w("$ZodIPv6", (e, t) => {
|
|
@@ -1139,15 +1139,15 @@ const Jd = /* @__PURE__ */ w("$ZodBase64", (e, t) => {
|
|
|
1139
1139
|
});
|
|
1140
1140
|
};
|
|
1141
1141
|
});
|
|
1142
|
-
function
|
|
1142
|
+
function Yd(e) {
|
|
1143
1143
|
if (!Qs.test(e))
|
|
1144
1144
|
return !1;
|
|
1145
1145
|
const t = e.replace(/[-_]/g, (n) => n === "-" ? "+" : "/"), r = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
|
|
1146
1146
|
return si(r);
|
|
1147
1147
|
}
|
|
1148
|
-
const
|
|
1148
|
+
const Wd = /* @__PURE__ */ w("$ZodBase64URL", (e, t) => {
|
|
1149
1149
|
t.pattern ?? (t.pattern = Qs), ve.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (r) => {
|
|
1150
|
-
|
|
1150
|
+
Yd(r.value) || r.issues.push({
|
|
1151
1151
|
code: "invalid_format",
|
|
1152
1152
|
format: "base64url",
|
|
1153
1153
|
input: r.value,
|
|
@@ -1322,7 +1322,7 @@ const ip = /* @__PURE__ */ w("$ZodObject", (e, t) => {
|
|
|
1322
1322
|
});
|
|
1323
1323
|
}
|
|
1324
1324
|
const n = wn(() => li(t));
|
|
1325
|
-
|
|
1325
|
+
W(e._zod, "propValues", () => {
|
|
1326
1326
|
const i = t.shape, l = {};
|
|
1327
1327
|
for (const u in i) {
|
|
1328
1328
|
const c = i[u]._zod;
|
|
@@ -1433,14 +1433,14 @@ function lo(e, t, r, n) {
|
|
|
1433
1433
|
code: "invalid_union",
|
|
1434
1434
|
input: t.value,
|
|
1435
1435
|
inst: r,
|
|
1436
|
-
errors: e.map((o) => o.issues.map((s) =>
|
|
1436
|
+
errors: e.map((o) => o.issues.map((s) => St(s, n, It())))
|
|
1437
1437
|
}), t);
|
|
1438
1438
|
}
|
|
1439
1439
|
const ci = /* @__PURE__ */ w("$ZodUnion", (e, t) => {
|
|
1440
|
-
pe.init(e, t),
|
|
1440
|
+
pe.init(e, t), W(e._zod, "optin", () => t.options.some((a) => a._zod.optin === "optional") ? "optional" : void 0), W(e._zod, "optout", () => t.options.some((a) => a._zod.optout === "optional") ? "optional" : void 0), W(e._zod, "values", () => {
|
|
1441
1441
|
if (t.options.every((a) => a._zod.values))
|
|
1442
1442
|
return new Set(t.options.flatMap((a) => Array.from(a._zod.values)));
|
|
1443
|
-
}),
|
|
1443
|
+
}), W(e._zod, "pattern", () => {
|
|
1444
1444
|
if (t.options.every((a) => a._zod.pattern)) {
|
|
1445
1445
|
const a = t.options.map((o) => o._zod.pattern);
|
|
1446
1446
|
return new RegExp(`^(${a.map((o) => fa(o.source)).join("|")})$`);
|
|
@@ -1470,7 +1470,7 @@ const ci = /* @__PURE__ */ w("$ZodUnion", (e, t) => {
|
|
|
1470
1470
|
}), up = /* @__PURE__ */ w("$ZodDiscriminatedUnion", (e, t) => {
|
|
1471
1471
|
t.inclusive = !1, ci.init(e, t);
|
|
1472
1472
|
const r = e._zod.parse;
|
|
1473
|
-
|
|
1473
|
+
W(e._zod, "propValues", () => {
|
|
1474
1474
|
const a = {};
|
|
1475
1475
|
for (const o of t.options) {
|
|
1476
1476
|
const s = o._zod.propValues;
|
|
@@ -1633,7 +1633,7 @@ const dp = /* @__PURE__ */ w("$ZodRecord", (e, t) => {
|
|
|
1633
1633
|
t.mode === "loose" ? r.value[i] = a[i] : r.issues.push({
|
|
1634
1634
|
code: "invalid_key",
|
|
1635
1635
|
origin: "record",
|
|
1636
|
-
issues: l.issues.map((d) =>
|
|
1636
|
+
issues: l.issues.map((d) => St(d, n, It())),
|
|
1637
1637
|
input: i,
|
|
1638
1638
|
path: [i],
|
|
1639
1639
|
inst: e
|
|
@@ -1689,7 +1689,7 @@ function co(e, t) {
|
|
|
1689
1689
|
return e.issues.length && t === void 0 ? { issues: [], value: void 0 } : e;
|
|
1690
1690
|
}
|
|
1691
1691
|
const di = /* @__PURE__ */ w("$ZodOptional", (e, t) => {
|
|
1692
|
-
pe.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional",
|
|
1692
|
+
pe.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", W(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), W(e._zod, "pattern", () => {
|
|
1693
1693
|
const r = t.innerType._zod.pattern;
|
|
1694
1694
|
return r ? new RegExp(`^(${fa(r.source)})?$`) : void 0;
|
|
1695
1695
|
}), e._zod.parse = (r, n) => {
|
|
@@ -1700,14 +1700,14 @@ const di = /* @__PURE__ */ w("$ZodOptional", (e, t) => {
|
|
|
1700
1700
|
return r.value === void 0 ? r : t.innerType._zod.run(r, n);
|
|
1701
1701
|
};
|
|
1702
1702
|
}), hp = /* @__PURE__ */ w("$ZodExactOptional", (e, t) => {
|
|
1703
|
-
di.init(e, t),
|
|
1703
|
+
di.init(e, t), W(e._zod, "values", () => t.innerType._zod.values), W(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (r, n) => t.innerType._zod.run(r, n);
|
|
1704
1704
|
}), mp = /* @__PURE__ */ w("$ZodNullable", (e, t) => {
|
|
1705
|
-
pe.init(e, t),
|
|
1705
|
+
pe.init(e, t), W(e._zod, "optin", () => t.innerType._zod.optin), W(e._zod, "optout", () => t.innerType._zod.optout), W(e._zod, "pattern", () => {
|
|
1706
1706
|
const r = t.innerType._zod.pattern;
|
|
1707
1707
|
return r ? new RegExp(`^(${fa(r.source)}|null)$`) : void 0;
|
|
1708
|
-
}),
|
|
1708
|
+
}), W(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (r, n) => r.value === null ? r : t.innerType._zod.run(r, n);
|
|
1709
1709
|
}), yp = /* @__PURE__ */ w("$ZodDefault", (e, t) => {
|
|
1710
|
-
pe.init(e, t), e._zod.optin = "optional",
|
|
1710
|
+
pe.init(e, t), e._zod.optin = "optional", W(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
1711
1711
|
if (n.direction === "backward")
|
|
1712
1712
|
return t.innerType._zod.run(r, n);
|
|
1713
1713
|
if (r.value === void 0)
|
|
@@ -1720,9 +1720,9 @@ function po(e, t) {
|
|
|
1720
1720
|
return e.value === void 0 && (e.value = t.defaultValue), e;
|
|
1721
1721
|
}
|
|
1722
1722
|
const vp = /* @__PURE__ */ w("$ZodPrefault", (e, t) => {
|
|
1723
|
-
pe.init(e, t), e._zod.optin = "optional",
|
|
1723
|
+
pe.init(e, t), e._zod.optin = "optional", W(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => (n.direction === "backward" || r.value === void 0 && (r.value = t.defaultValue), t.innerType._zod.run(r, n));
|
|
1724
1724
|
}), wp = /* @__PURE__ */ w("$ZodNonOptional", (e, t) => {
|
|
1725
|
-
pe.init(e, t),
|
|
1725
|
+
pe.init(e, t), W(e._zod, "values", () => {
|
|
1726
1726
|
const r = t.innerType._zod.values;
|
|
1727
1727
|
return r ? new Set([...r].filter((n) => n !== void 0)) : void 0;
|
|
1728
1728
|
}), e._zod.parse = (r, n) => {
|
|
@@ -1739,26 +1739,26 @@ function fo(e, t) {
|
|
|
1739
1739
|
}), e;
|
|
1740
1740
|
}
|
|
1741
1741
|
const _p = /* @__PURE__ */ w("$ZodCatch", (e, t) => {
|
|
1742
|
-
pe.init(e, t),
|
|
1742
|
+
pe.init(e, t), W(e._zod, "optin", () => t.innerType._zod.optin), W(e._zod, "optout", () => t.innerType._zod.optout), W(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (r, n) => {
|
|
1743
1743
|
if (n.direction === "backward")
|
|
1744
1744
|
return t.innerType._zod.run(r, n);
|
|
1745
1745
|
const a = t.innerType._zod.run(r, n);
|
|
1746
1746
|
return a instanceof Promise ? a.then((o) => (r.value = o.value, o.issues.length && (r.value = t.catchValue({
|
|
1747
1747
|
...r,
|
|
1748
1748
|
error: {
|
|
1749
|
-
issues: o.issues.map((s) =>
|
|
1749
|
+
issues: o.issues.map((s) => St(s, n, It()))
|
|
1750
1750
|
},
|
|
1751
1751
|
input: r.value
|
|
1752
1752
|
}), r.issues = []), r)) : (r.value = a.value, a.issues.length && (r.value = t.catchValue({
|
|
1753
1753
|
...r,
|
|
1754
1754
|
error: {
|
|
1755
|
-
issues: a.issues.map((o) =>
|
|
1755
|
+
issues: a.issues.map((o) => St(o, n, It()))
|
|
1756
1756
|
},
|
|
1757
1757
|
input: r.value
|
|
1758
1758
|
}), r.issues = []), r);
|
|
1759
1759
|
};
|
|
1760
1760
|
}), Tp = /* @__PURE__ */ w("$ZodPipe", (e, t) => {
|
|
1761
|
-
pe.init(e, t),
|
|
1761
|
+
pe.init(e, t), W(e._zod, "values", () => t.in._zod.values), W(e._zod, "optin", () => t.in._zod.optin), W(e._zod, "optout", () => t.out._zod.optout), W(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (r, n) => {
|
|
1762
1762
|
if (n.direction === "backward") {
|
|
1763
1763
|
const o = t.out._zod.run(r, n);
|
|
1764
1764
|
return o instanceof Promise ? o.then((s) => Jr(s, t.in, n)) : Jr(o, t.in, n);
|
|
@@ -1771,10 +1771,10 @@ function Jr(e, t, r) {
|
|
|
1771
1771
|
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues }, r);
|
|
1772
1772
|
}
|
|
1773
1773
|
const Ep = /* @__PURE__ */ w("$ZodReadonly", (e, t) => {
|
|
1774
|
-
pe.init(e, t),
|
|
1774
|
+
pe.init(e, t), W(e._zod, "propValues", () => t.innerType._zod.propValues), W(e._zod, "values", () => t.innerType._zod.values), W(e._zod, "optin", () => {
|
|
1775
1775
|
var r, n;
|
|
1776
1776
|
return (n = (r = t.innerType) == null ? void 0 : r._zod) == null ? void 0 : n.optin;
|
|
1777
|
-
}),
|
|
1777
|
+
}), W(e._zod, "optout", () => {
|
|
1778
1778
|
var r, n;
|
|
1779
1779
|
return (n = (r = t.innerType) == null ? void 0 : r._zod) == null ? void 0 : n.optout;
|
|
1780
1780
|
}), e._zod.parse = (r, n) => {
|
|
@@ -1788,16 +1788,16 @@ function go(e) {
|
|
|
1788
1788
|
return e.value = Object.freeze(e.value), e;
|
|
1789
1789
|
}
|
|
1790
1790
|
const bp = /* @__PURE__ */ w("$ZodLazy", (e, t) => {
|
|
1791
|
-
pe.init(e, t),
|
|
1791
|
+
pe.init(e, t), W(e._zod, "innerType", () => t.getter()), W(e._zod, "pattern", () => {
|
|
1792
1792
|
var r, n;
|
|
1793
1793
|
return (n = (r = e._zod.innerType) == null ? void 0 : r._zod) == null ? void 0 : n.pattern;
|
|
1794
|
-
}),
|
|
1794
|
+
}), W(e._zod, "propValues", () => {
|
|
1795
1795
|
var r, n;
|
|
1796
1796
|
return (n = (r = e._zod.innerType) == null ? void 0 : r._zod) == null ? void 0 : n.propValues;
|
|
1797
|
-
}),
|
|
1797
|
+
}), W(e._zod, "optin", () => {
|
|
1798
1798
|
var r, n;
|
|
1799
1799
|
return ((n = (r = e._zod.innerType) == null ? void 0 : r._zod) == null ? void 0 : n.optin) ?? void 0;
|
|
1800
|
-
}),
|
|
1800
|
+
}), W(e._zod, "optout", () => {
|
|
1801
1801
|
var r, n;
|
|
1802
1802
|
return ((n = (r = e._zod.innerType) == null ? void 0 : r._zod) == null ? void 0 : n.optout) ?? void 0;
|
|
1803
1803
|
}), e._zod.parse = (r, n) => e._zod.innerType._zod.run(r, n);
|
|
@@ -2090,7 +2090,7 @@ function Jp(e, t) {
|
|
|
2090
2090
|
});
|
|
2091
2091
|
}
|
|
2092
2092
|
// @__NO_SIDE_EFFECTS__
|
|
2093
|
-
function
|
|
2093
|
+
function Yp(e, t) {
|
|
2094
2094
|
return new e({
|
|
2095
2095
|
type: "string",
|
|
2096
2096
|
format: "datetime",
|
|
@@ -2102,7 +2102,7 @@ function Wp(e, t) {
|
|
|
2102
2102
|
});
|
|
2103
2103
|
}
|
|
2104
2104
|
// @__NO_SIDE_EFFECTS__
|
|
2105
|
-
function
|
|
2105
|
+
function Wp(e, t) {
|
|
2106
2106
|
return new e({
|
|
2107
2107
|
type: "string",
|
|
2108
2108
|
format: "date",
|
|
@@ -2919,13 +2919,13 @@ const Uf = /* @__PURE__ */ w("ZodISODateTime", (e, t) => {
|
|
|
2919
2919
|
Ud.init(e, t), _e.init(e, t);
|
|
2920
2920
|
});
|
|
2921
2921
|
function Zf(e) {
|
|
2922
|
-
return /* @__PURE__ */
|
|
2922
|
+
return /* @__PURE__ */ Yp(Uf, e);
|
|
2923
2923
|
}
|
|
2924
2924
|
const jf = /* @__PURE__ */ w("ZodISODate", (e, t) => {
|
|
2925
2925
|
Zd.init(e, t), _e.init(e, t);
|
|
2926
2926
|
});
|
|
2927
2927
|
function Gf(e) {
|
|
2928
|
-
return /* @__PURE__ */
|
|
2928
|
+
return /* @__PURE__ */ Wp(jf, e);
|
|
2929
2929
|
}
|
|
2930
2930
|
const Bf = /* @__PURE__ */ w("ZodISOTime", (e, t) => {
|
|
2931
2931
|
jd.init(e, t), _e.init(e, t);
|
|
@@ -2968,21 +2968,21 @@ const Jf = (e, t) => {
|
|
|
2968
2968
|
// enumerable: false,
|
|
2969
2969
|
}
|
|
2970
2970
|
});
|
|
2971
|
-
},
|
|
2971
|
+
}, Ye = w("ZodError", Jf, {
|
|
2972
2972
|
Parent: Error
|
|
2973
|
-
}),
|
|
2973
|
+
}), Yf = /* @__PURE__ */ ha(Ye), Wf = /* @__PURE__ */ ma(Ye), Kf = /* @__PURE__ */ _n(Ye), zi = /* @__PURE__ */ Tn(Ye), Xf = /* @__PURE__ */ $c(Ye), Qf = /* @__PURE__ */ Mc(Ye), eg = /* @__PURE__ */ Fc(Ye), tg = /* @__PURE__ */ zc(Ye), rg = /* @__PURE__ */ Lc(Ye), ng = /* @__PURE__ */ Uc(Ye), ag = /* @__PURE__ */ Zc(Ye), og = /* @__PURE__ */ jc(Ye), fe = /* @__PURE__ */ w("ZodType", (e, t) => (pe.init(e, t), Object.assign(e["~standard"], {
|
|
2974
2974
|
jsonSchema: {
|
|
2975
2975
|
input: on(e, "input"),
|
|
2976
2976
|
output: on(e, "output")
|
|
2977
2977
|
}
|
|
2978
|
-
}), e.toJSONSchema = bf(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...r) => e.clone(
|
|
2978
|
+
}), e.toJSONSchema = bf(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...r) => e.clone(Ot(t, {
|
|
2979
2979
|
checks: [
|
|
2980
2980
|
...t.checks ?? [],
|
|
2981
2981
|
...r.map((n) => typeof n == "function" ? { _zod: { check: n, def: { check: "custom" }, onattach: [] } } : n)
|
|
2982
2982
|
]
|
|
2983
2983
|
}), {
|
|
2984
2984
|
parent: !0
|
|
2985
|
-
}), e.with = e.check, e.clone = (r, n) =>
|
|
2985
|
+
}), e.with = e.check, e.clone = (r, n) => Rt(e, r, n), e.brand = () => e, e.register = ((r, n) => (r.add(e, n), e)), e.parse = (r, n) => Yf(e, r, n, { callee: e.parse }), e.safeParse = (r, n) => Kf(e, r, n), e.parseAsync = async (r, n) => Wf(e, r, n, { callee: e.parseAsync }), e.safeParseAsync = async (r, n) => zi(e, r, n), e.spa = e.safeParseAsync, e.encode = (r, n) => Xf(e, r, n), e.decode = (r, n) => Qf(e, r, n), e.encodeAsync = async (r, n) => eg(e, r, n), e.decodeAsync = async (r, n) => tg(e, r, n), e.safeEncode = (r, n) => rg(e, r, n), e.safeDecode = (r, n) => ng(e, r, n), e.safeEncodeAsync = async (r, n) => ag(e, r, n), e.safeDecodeAsync = async (r, n) => og(e, r, n), e.refine = (r, n) => e.check(ah(r, n)), e.superRefine = (r) => e.check(oh(r)), e.overwrite = (r) => e.check(/* @__PURE__ */ sr(r)), e.optional = () => Io(e), e.exactOptional = () => Gg(e), e.nullable = () => So(e), e.nullish = () => Io(So(e)), e.nonoptional = (r) => Yg(e, r), e.array = () => Ge(e), e.or = (r) => $e([e, r]), e.and = (r) => Fg(e, r), e.transform = (r) => Ao(e, Zg(r)), e.default = (r) => qg(e, r), e.prefault = (r) => Jg(e, r), e.catch = (r) => Kg(e, r), e.pipe = (r) => Ao(e, r), e.readonly = () => eh(e), e.describe = (r) => {
|
|
2986
2986
|
const n = e.clone();
|
|
2987
2987
|
return vr.add(n, { description: r }), n;
|
|
2988
2988
|
}, Object.defineProperty(e, "description", {
|
|
@@ -3001,7 +3001,7 @@ const Jf = (e, t) => {
|
|
|
3001
3001
|
const r = e._zod.bag;
|
|
3002
3002
|
e.format = r.format ?? null, e.minLength = r.minimum ?? null, e.maxLength = r.maximum ?? null, e.regex = (...n) => e.check(/* @__PURE__ */ sf(...n)), e.includes = (...n) => e.check(/* @__PURE__ */ cf(...n)), e.startsWith = (...n) => e.check(/* @__PURE__ */ df(...n)), e.endsWith = (...n) => e.check(/* @__PURE__ */ pf(...n)), e.min = (...n) => e.check(/* @__PURE__ */ tn(...n)), e.max = (...n) => e.check(/* @__PURE__ */ pi(...n)), e.length = (...n) => e.check(/* @__PURE__ */ fi(...n)), e.nonempty = (...n) => e.check(/* @__PURE__ */ tn(1, ...n)), e.lowercase = (n) => e.check(/* @__PURE__ */ lf(n)), e.uppercase = (n) => e.check(/* @__PURE__ */ uf(n)), e.trim = () => e.check(/* @__PURE__ */ gf()), e.normalize = (...n) => e.check(/* @__PURE__ */ ff(...n)), e.toLowerCase = () => e.check(/* @__PURE__ */ hf()), e.toUpperCase = () => e.check(/* @__PURE__ */ mf()), e.slugify = () => e.check(/* @__PURE__ */ yf());
|
|
3003
3003
|
}), sg = /* @__PURE__ */ w("ZodString", (e, t) => {
|
|
3004
|
-
ya.init(e, t), Li.init(e, t), e.email = (r) => e.check(/* @__PURE__ */ Op(ig, r)), e.url = (r) => e.check(/* @__PURE__ */ Cp(lg, r)), e.jwt = (r) => e.check(/* @__PURE__ */ Jp(bg, r)), e.emoji = (r) => e.check(/* @__PURE__ */ Dp(ug, r)), e.guid = (r) => e.check(/* @__PURE__ */ yo(Eo, r)), e.uuid = (r) => e.check(/* @__PURE__ */ Rp(
|
|
3004
|
+
ya.init(e, t), Li.init(e, t), e.email = (r) => e.check(/* @__PURE__ */ Op(ig, r)), e.url = (r) => e.check(/* @__PURE__ */ Cp(lg, r)), e.jwt = (r) => e.check(/* @__PURE__ */ Jp(bg, r)), e.emoji = (r) => e.check(/* @__PURE__ */ Dp(ug, r)), e.guid = (r) => e.check(/* @__PURE__ */ yo(Eo, r)), e.uuid = (r) => e.check(/* @__PURE__ */ Rp(Yr, r)), e.uuidv4 = (r) => e.check(/* @__PURE__ */ xp(Yr, r)), e.uuidv6 = (r) => e.check(/* @__PURE__ */ kp(Yr, r)), e.uuidv7 = (r) => e.check(/* @__PURE__ */ Pp(Yr, r)), e.nanoid = (r) => e.check(/* @__PURE__ */ $p(cg, r)), e.guid = (r) => e.check(/* @__PURE__ */ yo(Eo, r)), e.cuid = (r) => e.check(/* @__PURE__ */ Mp(dg, r)), e.cuid2 = (r) => e.check(/* @__PURE__ */ Fp(pg, r)), e.ulid = (r) => e.check(/* @__PURE__ */ zp(fg, r)), e.base64 = (r) => e.check(/* @__PURE__ */ Vp(_g, r)), e.base64url = (r) => e.check(/* @__PURE__ */ qp(Tg, r)), e.xid = (r) => e.check(/* @__PURE__ */ Lp(gg, r)), e.ksuid = (r) => e.check(/* @__PURE__ */ Up(hg, r)), e.ipv4 = (r) => e.check(/* @__PURE__ */ Zp(mg, r)), e.ipv6 = (r) => e.check(/* @__PURE__ */ jp(yg, r)), e.cidrv4 = (r) => e.check(/* @__PURE__ */ Gp(vg, r)), e.cidrv6 = (r) => e.check(/* @__PURE__ */ Bp(wg, r)), e.e164 = (r) => e.check(/* @__PURE__ */ Hp(Eg, r)), e.datetime = (r) => e.check(Zf(r)), e.date = (r) => e.check(Gf(r)), e.time = (r) => e.check(Vf(r)), e.duration = (r) => e.check(Hf(r));
|
|
3005
3005
|
});
|
|
3006
3006
|
function x(e) {
|
|
3007
3007
|
return /* @__PURE__ */ Np(sg, e);
|
|
@@ -3012,7 +3012,7 @@ const _e = /* @__PURE__ */ w("ZodStringFormat", (e, t) => {
|
|
|
3012
3012
|
kd.init(e, t), _e.init(e, t);
|
|
3013
3013
|
}), Eo = /* @__PURE__ */ w("ZodGUID", (e, t) => {
|
|
3014
3014
|
Rd.init(e, t), _e.init(e, t);
|
|
3015
|
-
}),
|
|
3015
|
+
}), Yr = /* @__PURE__ */ w("ZodUUID", (e, t) => {
|
|
3016
3016
|
xd.init(e, t), _e.init(e, t);
|
|
3017
3017
|
}), lg = /* @__PURE__ */ w("ZodURL", (e, t) => {
|
|
3018
3018
|
Pd.init(e, t), _e.init(e, t);
|
|
@@ -3041,7 +3041,7 @@ const _e = /* @__PURE__ */ w("ZodStringFormat", (e, t) => {
|
|
|
3041
3041
|
}), _g = /* @__PURE__ */ w("ZodBase64", (e, t) => {
|
|
3042
3042
|
Jd.init(e, t), _e.init(e, t);
|
|
3043
3043
|
}), Tg = /* @__PURE__ */ w("ZodBase64URL", (e, t) => {
|
|
3044
|
-
|
|
3044
|
+
Wd.init(e, t), _e.init(e, t);
|
|
3045
3045
|
}), Eg = /* @__PURE__ */ w("ZodE164", (e, t) => {
|
|
3046
3046
|
Kd.init(e, t), _e.init(e, t);
|
|
3047
3047
|
}), bg = /* @__PURE__ */ w("ZodJWT", (e, t) => {
|
|
@@ -3097,7 +3097,7 @@ function Ge(e, t) {
|
|
|
3097
3097
|
return /* @__PURE__ */ vf(Pg, e, t);
|
|
3098
3098
|
}
|
|
3099
3099
|
const Cg = /* @__PURE__ */ w("ZodObject", (e, t) => {
|
|
3100
|
-
lp.init(e, t), fe.init(e, t), e._zod.processJSONSchema = (r, n, a) => Ai(e, r, n, a),
|
|
3100
|
+
lp.init(e, t), fe.init(e, t), e._zod.processJSONSchema = (r, n, a) => Ai(e, r, n, a), W(e, "shape", () => t.shape), e.keyof = () => ji(Object.keys(e._zod.def.shape)), e.catchall = (r) => e.clone({ ...e._zod.def, catchall: r }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: zt() }), e.loose = () => e.clone({ ...e._zod.def, catchall: zt() }), e.strict = () => e.clone({ ...e._zod.def, catchall: kg() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (r) => Ac(e, r), e.safeExtend = (r) => Nc(e, r), e.merge = (r) => Oc(e, r), e.pick = (r) => Ic(e, r), e.omit = (r) => Sc(e, r), e.partial = (...r) => Rc(Gi, e, r[0]), e.required = (...r) => xc(Bi, e, r[0]);
|
|
3101
3101
|
});
|
|
3102
3102
|
function B(e, t) {
|
|
3103
3103
|
const r = {
|
|
@@ -3141,7 +3141,7 @@ function Fg(e, t) {
|
|
|
3141
3141
|
const zg = /* @__PURE__ */ w("ZodRecord", (e, t) => {
|
|
3142
3142
|
dp.init(e, t), fe.init(e, t), e._zod.processJSONSchema = (r, n, a) => Ri(e, r, n, a), e.keyType = t.keyType, e.valueType = t.valueType;
|
|
3143
3143
|
});
|
|
3144
|
-
function
|
|
3144
|
+
function At(e, t, r) {
|
|
3145
3145
|
return new zg({
|
|
3146
3146
|
type: "record",
|
|
3147
3147
|
keyType: e,
|
|
@@ -3261,7 +3261,7 @@ function qg(e, t) {
|
|
|
3261
3261
|
type: "default",
|
|
3262
3262
|
innerType: e,
|
|
3263
3263
|
get defaultValue() {
|
|
3264
|
-
return typeof t == "function" ? t() :
|
|
3264
|
+
return typeof t == "function" ? t() : Ys(t);
|
|
3265
3265
|
}
|
|
3266
3266
|
});
|
|
3267
3267
|
}
|
|
@@ -3273,25 +3273,25 @@ function Jg(e, t) {
|
|
|
3273
3273
|
type: "prefault",
|
|
3274
3274
|
innerType: e,
|
|
3275
3275
|
get defaultValue() {
|
|
3276
|
-
return typeof t == "function" ? t() :
|
|
3276
|
+
return typeof t == "function" ? t() : Ys(t);
|
|
3277
3277
|
}
|
|
3278
3278
|
});
|
|
3279
3279
|
}
|
|
3280
3280
|
const Bi = /* @__PURE__ */ w("ZodNonOptional", (e, t) => {
|
|
3281
3281
|
wp.init(e, t), fe.init(e, t), e._zod.processJSONSchema = (r, n, a) => ki(e, r, n, a), e.unwrap = () => e._zod.def.innerType;
|
|
3282
3282
|
});
|
|
3283
|
-
function
|
|
3283
|
+
function Yg(e, t) {
|
|
3284
3284
|
return new Bi({
|
|
3285
3285
|
type: "nonoptional",
|
|
3286
3286
|
innerType: e,
|
|
3287
3287
|
...k(t)
|
|
3288
3288
|
});
|
|
3289
3289
|
}
|
|
3290
|
-
const
|
|
3290
|
+
const Wg = /* @__PURE__ */ w("ZodCatch", (e, t) => {
|
|
3291
3291
|
_p.init(e, t), fe.init(e, t), e._zod.processJSONSchema = (r, n, a) => Di(e, r, n, a), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
|
|
3292
3292
|
});
|
|
3293
3293
|
function Kg(e, t) {
|
|
3294
|
-
return new
|
|
3294
|
+
return new Wg({
|
|
3295
3295
|
type: "catch",
|
|
3296
3296
|
innerType: e,
|
|
3297
3297
|
catchValue: typeof t == "function" ? t : () => t
|
|
@@ -3898,7 +3898,7 @@ function wh(e) {
|
|
|
3898
3898
|
}
|
|
3899
3899
|
return e;
|
|
3900
3900
|
}
|
|
3901
|
-
function
|
|
3901
|
+
function Yi(e) {
|
|
3902
3902
|
const { stackTraceLimit: t } = Error;
|
|
3903
3903
|
try {
|
|
3904
3904
|
Error.stackTraceLimit = 0;
|
|
@@ -3911,23 +3911,23 @@ function Wi(e) {
|
|
|
3911
3911
|
Error.stackTraceLimit = t;
|
|
3912
3912
|
}
|
|
3913
3913
|
}
|
|
3914
|
-
function
|
|
3914
|
+
function Wi(e) {
|
|
3915
3915
|
if (e.type === "object" || Array.isArray(e.type) && e.type.includes("object")) {
|
|
3916
3916
|
e.additionalProperties = !1;
|
|
3917
3917
|
const { properties: r } = e;
|
|
3918
3918
|
if (r != null)
|
|
3919
3919
|
for (const n of Object.keys(r))
|
|
3920
|
-
r[n] =
|
|
3920
|
+
r[n] = Pt(r[n]);
|
|
3921
3921
|
}
|
|
3922
|
-
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(
|
|
3922
|
+
e.items != null && (e.items = Array.isArray(e.items) ? e.items.map(Pt) : Pt(e.items)), e.anyOf != null && (e.anyOf = e.anyOf.map(Pt)), e.allOf != null && (e.allOf = e.allOf.map(Pt)), e.oneOf != null && (e.oneOf = e.oneOf.map(Pt));
|
|
3923
3923
|
const { definitions: t } = e;
|
|
3924
3924
|
if (t != null)
|
|
3925
3925
|
for (const r of Object.keys(t))
|
|
3926
|
-
t[r] =
|
|
3926
|
+
t[r] = Pt(t[r]);
|
|
3927
3927
|
return e;
|
|
3928
3928
|
}
|
|
3929
|
-
function
|
|
3930
|
-
return typeof e == "boolean" ? e :
|
|
3929
|
+
function Pt(e) {
|
|
3930
|
+
return typeof e == "boolean" ? e : Wi(e);
|
|
3931
3931
|
}
|
|
3932
3932
|
var _h = Symbol(
|
|
3933
3933
|
"Let zodToJsonSchema decide on which parser to use"
|
|
@@ -4600,7 +4600,7 @@ var qh = (e, t) => {
|
|
|
4600
4600
|
function Jh(e, t) {
|
|
4601
4601
|
return ie(e.type._def, t);
|
|
4602
4602
|
}
|
|
4603
|
-
function
|
|
4603
|
+
function Yh(e, t) {
|
|
4604
4604
|
const n = {
|
|
4605
4605
|
type: "array",
|
|
4606
4606
|
uniqueItems: !0,
|
|
@@ -4611,7 +4611,7 @@ function Wh(e, t) {
|
|
|
4611
4611
|
};
|
|
4612
4612
|
return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n;
|
|
4613
4613
|
}
|
|
4614
|
-
function
|
|
4614
|
+
function Wh(e, t) {
|
|
4615
4615
|
return e.rest ? {
|
|
4616
4616
|
type: "array",
|
|
4617
4617
|
minItems: e.items.length,
|
|
@@ -4677,7 +4677,7 @@ var Qh = (e, t) => ie(e.innerType._def, t), em = (e, t, r) => {
|
|
|
4677
4677
|
case Z.ZodIntersection:
|
|
4678
4678
|
return kh(e, r);
|
|
4679
4679
|
case Z.ZodTuple:
|
|
4680
|
-
return
|
|
4680
|
+
return Wh(e, r);
|
|
4681
4681
|
case Z.ZodRecord:
|
|
4682
4682
|
return el(e, r);
|
|
4683
4683
|
case Z.ZodLiteral:
|
|
@@ -4693,7 +4693,7 @@ var Qh = (e, t) => ie(e.innerType._def, t), em = (e, t, r) => {
|
|
|
4693
4693
|
case Z.ZodMap:
|
|
4694
4694
|
return $h(e, r);
|
|
4695
4695
|
case Z.ZodSet:
|
|
4696
|
-
return
|
|
4696
|
+
return Yh(e, r);
|
|
4697
4697
|
case Z.ZodLazy:
|
|
4698
4698
|
return () => e.getter()._def;
|
|
4699
4699
|
case Z.ZodPromise:
|
|
@@ -4899,7 +4899,7 @@ function um(e, t) {
|
|
|
4899
4899
|
const n = (r = void 0) != null ? r : !1;
|
|
4900
4900
|
return bn(
|
|
4901
4901
|
// defer json schema creation to avoid unnecessary computation when only validation is needed
|
|
4902
|
-
() =>
|
|
4902
|
+
() => Wi(
|
|
4903
4903
|
Lf(e, {
|
|
4904
4904
|
target: "draft-7",
|
|
4905
4905
|
io: "input",
|
|
@@ -4956,7 +4956,7 @@ async function dm({
|
|
|
4956
4956
|
schema: t
|
|
4957
4957
|
}) {
|
|
4958
4958
|
try {
|
|
4959
|
-
const r =
|
|
4959
|
+
const r = Yi(e);
|
|
4960
4960
|
return t == null ? r : ra({ value: r, schema: t });
|
|
4961
4961
|
} catch (r) {
|
|
4962
4962
|
throw Qr.isInstance(r) || Ft.isInstance(r) ? r : new Qr({ text: e, cause: r });
|
|
@@ -4967,7 +4967,7 @@ async function tt({
|
|
|
4967
4967
|
schema: t
|
|
4968
4968
|
}) {
|
|
4969
4969
|
try {
|
|
4970
|
-
const r =
|
|
4970
|
+
const r = Yi(e);
|
|
4971
4971
|
return t == null ? { success: !0, value: r, rawValue: r } : await it({ value: r, schema: t });
|
|
4972
4972
|
} catch (r) {
|
|
4973
4973
|
return {
|
|
@@ -5301,7 +5301,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
5301
5301
|
static isInstance(e) {
|
|
5302
5302
|
return Ve.hasMarker(e) && Bo in e;
|
|
5303
5303
|
}
|
|
5304
|
-
}, sl = "GatewayRateLimitError", Sm = `vercel.ai.gateway.error.${sl}`, Ho = Symbol.for(Sm), Jo,
|
|
5304
|
+
}, sl = "GatewayRateLimitError", Sm = `vercel.ai.gateway.error.${sl}`, Ho = Symbol.for(Sm), Jo, Yo, Am = class extends (Yo = Ve, Jo = Ho, Yo) {
|
|
5305
5305
|
constructor({
|
|
5306
5306
|
message: e = "Rate limit exceeded",
|
|
5307
5307
|
statusCode: t = 429,
|
|
@@ -5312,13 +5312,13 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
5312
5312
|
static isInstance(e) {
|
|
5313
5313
|
return Ve.hasMarker(e) && Ho in e;
|
|
5314
5314
|
}
|
|
5315
|
-
}, il = "GatewayModelNotFoundError", Nm = `vercel.ai.gateway.error.${il}`,
|
|
5315
|
+
}, il = "GatewayModelNotFoundError", Nm = `vercel.ai.gateway.error.${il}`, Wo = Symbol.for(Nm), Om = ir(
|
|
5316
5316
|
() => Zt(
|
|
5317
5317
|
B({
|
|
5318
5318
|
modelId: x()
|
|
5319
5319
|
})
|
|
5320
5320
|
)
|
|
5321
|
-
), Ko, Xo, Rm = class extends (Xo = Ve, Ko =
|
|
5321
|
+
), Ko, Xo, Rm = class extends (Xo = Ve, Ko = Wo, Xo) {
|
|
5322
5322
|
constructor({
|
|
5323
5323
|
message: e = "Model not found",
|
|
5324
5324
|
statusCode: t = 404,
|
|
@@ -5328,7 +5328,7 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
5328
5328
|
super({ message: e, statusCode: t, cause: n }), this[Ko] = !0, this.name = il, this.type = "model_not_found", this.modelId = r;
|
|
5329
5329
|
}
|
|
5330
5330
|
static isInstance(e) {
|
|
5331
|
-
return Ve.hasMarker(e) &&
|
|
5331
|
+
return Ve.hasMarker(e) && Wo in e;
|
|
5332
5332
|
}
|
|
5333
5333
|
}, ll = "GatewayInternalServerError", xm = `vercel.ai.gateway.error.${ll}`, Qo = Symbol.for(xm), es, ts, rs = class extends (ts = Ve, es = Qo, ts) {
|
|
5334
5334
|
constructor({
|
|
@@ -5417,7 +5417,7 @@ var Cm = ir(
|
|
|
5417
5417
|
})
|
|
5418
5418
|
)
|
|
5419
5419
|
);
|
|
5420
|
-
function
|
|
5420
|
+
function Nt(e, t) {
|
|
5421
5421
|
var r;
|
|
5422
5422
|
return Ve.isInstance(e) ? e : Le.isInstance(e) ? ss({
|
|
5423
5423
|
response: Dm(e),
|
|
@@ -5474,7 +5474,7 @@ var $m = ir(
|
|
|
5474
5474
|
});
|
|
5475
5475
|
return e;
|
|
5476
5476
|
} catch (e) {
|
|
5477
|
-
throw await
|
|
5477
|
+
throw await Nt(e);
|
|
5478
5478
|
}
|
|
5479
5479
|
}
|
|
5480
5480
|
async getCredits() {
|
|
@@ -5493,7 +5493,7 @@ var $m = ir(
|
|
|
5493
5493
|
});
|
|
5494
5494
|
return t;
|
|
5495
5495
|
} catch (e) {
|
|
5496
|
-
throw await
|
|
5496
|
+
throw await Nt(e);
|
|
5497
5497
|
}
|
|
5498
5498
|
}
|
|
5499
5499
|
}, Mm = ir(
|
|
@@ -5582,7 +5582,7 @@ var $m = ir(
|
|
|
5582
5582
|
warnings: r
|
|
5583
5583
|
};
|
|
5584
5584
|
} catch (o) {
|
|
5585
|
-
throw await
|
|
5585
|
+
throw await Nt(o, await ar(a));
|
|
5586
5586
|
}
|
|
5587
5587
|
}
|
|
5588
5588
|
async doStream(e) {
|
|
@@ -5628,7 +5628,7 @@ var $m = ir(
|
|
|
5628
5628
|
response: { headers: s }
|
|
5629
5629
|
};
|
|
5630
5630
|
} catch (o) {
|
|
5631
|
-
throw await
|
|
5631
|
+
throw await Nt(o, await ar(a));
|
|
5632
5632
|
}
|
|
5633
5633
|
}
|
|
5634
5634
|
isFilePart(e) {
|
|
@@ -5714,7 +5714,7 @@ var $m = ir(
|
|
|
5714
5714
|
warnings: []
|
|
5715
5715
|
};
|
|
5716
5716
|
} catch (s) {
|
|
5717
|
-
throw await
|
|
5717
|
+
throw await Nt(s, await ar(o));
|
|
5718
5718
|
}
|
|
5719
5719
|
}
|
|
5720
5720
|
getUrl() {
|
|
@@ -5731,7 +5731,7 @@ var $m = ir(
|
|
|
5731
5731
|
B({
|
|
5732
5732
|
embeddings: Ge(Ge(sn())),
|
|
5733
5733
|
usage: B({ tokens: sn() }).nullish(),
|
|
5734
|
-
providerMetadata:
|
|
5734
|
+
providerMetadata: At(x(), At(x(), zt())).optional()
|
|
5735
5735
|
})
|
|
5736
5736
|
)
|
|
5737
5737
|
), Zm = class {
|
|
@@ -5802,7 +5802,7 @@ var $m = ir(
|
|
|
5802
5802
|
}
|
|
5803
5803
|
};
|
|
5804
5804
|
} catch (p) {
|
|
5805
|
-
throw
|
|
5805
|
+
throw Nt(p, await ar(d));
|
|
5806
5806
|
}
|
|
5807
5807
|
}
|
|
5808
5808
|
getUrl() {
|
|
@@ -5832,7 +5832,7 @@ var jm = B({
|
|
|
5832
5832
|
message: x()
|
|
5833
5833
|
})
|
|
5834
5834
|
).optional(),
|
|
5835
|
-
providerMetadata:
|
|
5835
|
+
providerMetadata: At(x(), jm).optional()
|
|
5836
5836
|
});
|
|
5837
5837
|
async function Bm() {
|
|
5838
5838
|
var e;
|
|
@@ -5846,7 +5846,7 @@ function Hm(e = {}) {
|
|
|
5846
5846
|
let s = 0;
|
|
5847
5847
|
const i = (r = mm(e.baseURL)) != null ? r : "https://ai-gateway.vercel.sh/v3/ai", l = async () => {
|
|
5848
5848
|
try {
|
|
5849
|
-
const v = await
|
|
5849
|
+
const v = await Ym(e);
|
|
5850
5850
|
return zr(
|
|
5851
5851
|
{
|
|
5852
5852
|
Authorization: `Bearer ${v.token}`,
|
|
@@ -5898,7 +5898,7 @@ function Hm(e = {}) {
|
|
|
5898
5898
|
headers: l,
|
|
5899
5899
|
fetch: e.fetch
|
|
5900
5900
|
}).getAvailableModels().then((g) => (a = g, g)).catch(async (g) => {
|
|
5901
|
-
throw await
|
|
5901
|
+
throw await Nt(
|
|
5902
5902
|
g,
|
|
5903
5903
|
await ar(await l())
|
|
5904
5904
|
);
|
|
@@ -5908,7 +5908,7 @@ function Hm(e = {}) {
|
|
|
5908
5908
|
headers: l,
|
|
5909
5909
|
fetch: e.fetch
|
|
5910
5910
|
}).getCredits().catch(async (v) => {
|
|
5911
|
-
throw await
|
|
5911
|
+
throw await Nt(
|
|
5912
5912
|
v,
|
|
5913
5913
|
await ar(await l())
|
|
5914
5914
|
);
|
|
@@ -5936,7 +5936,7 @@ function Hm(e = {}) {
|
|
|
5936
5936
|
return y.embeddingModel = E, y.textEmbeddingModel = E, y;
|
|
5937
5937
|
}
|
|
5938
5938
|
var Jm = Hm();
|
|
5939
|
-
async function
|
|
5939
|
+
async function Ym(e) {
|
|
5940
5940
|
const t = Xr({
|
|
5941
5941
|
settingValue: e.apiKey,
|
|
5942
5942
|
environmentVariableName: "AI_GATEWAY_API_KEY"
|
|
@@ -5949,7 +5949,7 @@ async function Wm(e) {
|
|
|
5949
5949
|
authMethod: "oidc"
|
|
5950
5950
|
};
|
|
5951
5951
|
}
|
|
5952
|
-
var
|
|
5952
|
+
var Wm = typeof globalThis == "object" ? globalThis : typeof self == "object" ? self : typeof window == "object" ? window : typeof global == "object" ? global : {}, $t = "1.9.0", us = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
5953
5953
|
function Km(e) {
|
|
5954
5954
|
var t = /* @__PURE__ */ new Set([e]), r = /* @__PURE__ */ new Set(), n = e.match(us);
|
|
5955
5955
|
if (!n)
|
|
@@ -5989,22 +5989,22 @@ function Km(e) {
|
|
|
5989
5989
|
return c.prerelease != null || a.major !== c.major ? o(l) : a.major === 0 ? a.minor === c.minor && a.patch <= c.patch ? s(l) : o(l) : a.minor <= c.minor ? s(l) : o(l);
|
|
5990
5990
|
};
|
|
5991
5991
|
}
|
|
5992
|
-
var Xm = Km(
|
|
5992
|
+
var Xm = Km($t), Qm = $t.split(".")[0], Nr = Symbol.for("opentelemetry.js.api." + Qm), Or = Wm;
|
|
5993
5993
|
function Sa(e, t, r, n) {
|
|
5994
5994
|
var a;
|
|
5995
5995
|
n === void 0 && (n = !1);
|
|
5996
5996
|
var o = Or[Nr] = (a = Or[Nr]) !== null && a !== void 0 ? a : {
|
|
5997
|
-
version:
|
|
5997
|
+
version: $t
|
|
5998
5998
|
};
|
|
5999
5999
|
if (!n && o[e]) {
|
|
6000
6000
|
var s = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + e);
|
|
6001
6001
|
return r.error(s.stack || s.message), !1;
|
|
6002
6002
|
}
|
|
6003
|
-
if (o.version !==
|
|
6004
|
-
var s = new Error("@opentelemetry/api: Registration of version v" + o.version + " for " + e + " does not match previously registered API v" +
|
|
6003
|
+
if (o.version !== $t) {
|
|
6004
|
+
var s = new Error("@opentelemetry/api: Registration of version v" + o.version + " for " + e + " does not match previously registered API v" + $t);
|
|
6005
6005
|
return r.error(s.stack || s.message), !1;
|
|
6006
6006
|
}
|
|
6007
|
-
return o[e] = t, r.debug("@opentelemetry/api: Registered a global for " + e + " v" +
|
|
6007
|
+
return o[e] = t, r.debug("@opentelemetry/api: Registered a global for " + e + " v" + $t + "."), !0;
|
|
6008
6008
|
}
|
|
6009
6009
|
function Rr(e) {
|
|
6010
6010
|
var t, r, n = (t = Or[Nr]) === null || t === void 0 ? void 0 : t.version;
|
|
@@ -6012,7 +6012,7 @@ function Rr(e) {
|
|
|
6012
6012
|
return (r = Or[Nr]) === null || r === void 0 ? void 0 : r[e];
|
|
6013
6013
|
}
|
|
6014
6014
|
function Aa(e, t) {
|
|
6015
|
-
t.debug("@opentelemetry/api: Unregistering a global for " + e + " v" +
|
|
6015
|
+
t.debug("@opentelemetry/api: Unregistering a global for " + e + " v" + $t + ".");
|
|
6016
6016
|
var r = Or[Nr];
|
|
6017
6017
|
r && delete r[e];
|
|
6018
6018
|
}
|
|
@@ -6581,7 +6581,7 @@ function Jy({
|
|
|
6581
6581
|
return `${n} ${JSON.stringify(e, null, 2)}`;
|
|
6582
6582
|
}
|
|
6583
6583
|
}
|
|
6584
|
-
var
|
|
6584
|
+
var Yy = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.", ps = !1, Pa = (e) => {
|
|
6585
6585
|
if (e.warnings.length === 0)
|
|
6586
6586
|
return;
|
|
6587
6587
|
const t = globalThis.AI_SDK_LOG_WARNINGS;
|
|
@@ -6590,7 +6590,7 @@ var Wy = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG
|
|
|
6590
6590
|
t(e);
|
|
6591
6591
|
return;
|
|
6592
6592
|
}
|
|
6593
|
-
ps || (ps = !0, console.info(
|
|
6593
|
+
ps || (ps = !0, console.info(Yy));
|
|
6594
6594
|
for (const r of e.warnings)
|
|
6595
6595
|
console.warn(
|
|
6596
6596
|
Jy({
|
|
@@ -6601,7 +6601,7 @@ var Wy = "AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG
|
|
|
6601
6601
|
);
|
|
6602
6602
|
}
|
|
6603
6603
|
};
|
|
6604
|
-
function
|
|
6604
|
+
function Wy({
|
|
6605
6605
|
provider: e,
|
|
6606
6606
|
modelId: t
|
|
6607
6607
|
}) {
|
|
@@ -6618,7 +6618,7 @@ function Yy({
|
|
|
6618
6618
|
});
|
|
6619
6619
|
}
|
|
6620
6620
|
function Ky(e) {
|
|
6621
|
-
return e.specificationVersion === "v3" ? e : (
|
|
6621
|
+
return e.specificationVersion === "v3" ? e : (Wy({
|
|
6622
6622
|
provider: e.provider,
|
|
6623
6623
|
modelId: e.modelId
|
|
6624
6624
|
}), new Proxy(e, {
|
|
@@ -6632,7 +6632,7 @@ function Ky(e) {
|
|
|
6632
6632
|
return {
|
|
6633
6633
|
...a,
|
|
6634
6634
|
finishReason: Jl(a.finishReason),
|
|
6635
|
-
usage:
|
|
6635
|
+
usage: Yl(a.usage)
|
|
6636
6636
|
};
|
|
6637
6637
|
};
|
|
6638
6638
|
case "doStream":
|
|
@@ -6658,7 +6658,7 @@ function Xy(e) {
|
|
|
6658
6658
|
r.enqueue({
|
|
6659
6659
|
...t,
|
|
6660
6660
|
finishReason: Jl(t.finishReason),
|
|
6661
|
-
usage:
|
|
6661
|
+
usage: Yl(t.usage)
|
|
6662
6662
|
});
|
|
6663
6663
|
break;
|
|
6664
6664
|
default:
|
|
@@ -6675,7 +6675,7 @@ function Jl(e) {
|
|
|
6675
6675
|
raw: void 0
|
|
6676
6676
|
};
|
|
6677
6677
|
}
|
|
6678
|
-
function
|
|
6678
|
+
function Yl(e) {
|
|
6679
6679
|
return {
|
|
6680
6680
|
inputTokens: {
|
|
6681
6681
|
total: e.inputTokens,
|
|
@@ -6812,14 +6812,14 @@ function nv({
|
|
|
6812
6812
|
))
|
|
6813
6813
|
return a.mediaType;
|
|
6814
6814
|
}
|
|
6815
|
-
var
|
|
6815
|
+
var Wl = "6.0.11", av = async ({ url: e }) => {
|
|
6816
6816
|
var t;
|
|
6817
6817
|
const r = e.toString();
|
|
6818
6818
|
try {
|
|
6819
6819
|
const n = await fetch(r, {
|
|
6820
6820
|
headers: zr(
|
|
6821
6821
|
{},
|
|
6822
|
-
`ai-sdk/${
|
|
6822
|
+
`ai-sdk/${Wl}`,
|
|
6823
6823
|
ba()
|
|
6824
6824
|
)
|
|
6825
6825
|
});
|
|
@@ -7278,12 +7278,12 @@ var kr = rh(
|
|
|
7278
7278
|
x(),
|
|
7279
7279
|
sn(),
|
|
7280
7280
|
wa(),
|
|
7281
|
-
|
|
7281
|
+
At(x(), kr.optional()),
|
|
7282
7282
|
Ge(kr)
|
|
7283
7283
|
])
|
|
7284
|
-
), we =
|
|
7284
|
+
), we = At(
|
|
7285
7285
|
x(),
|
|
7286
|
-
|
|
7286
|
+
At(x(), kr.optional())
|
|
7287
7287
|
), tu = B({
|
|
7288
7288
|
type: re("text"),
|
|
7289
7289
|
text: x(),
|
|
@@ -7366,7 +7366,7 @@ var kr = rh(
|
|
|
7366
7366
|
}),
|
|
7367
7367
|
B({
|
|
7368
7368
|
type: re("file-id"),
|
|
7369
|
-
fileId: $e([x(),
|
|
7369
|
+
fileId: $e([x(), At(x(), x())]),
|
|
7370
7370
|
providerOptions: we.optional()
|
|
7371
7371
|
}),
|
|
7372
7372
|
B({
|
|
@@ -7382,7 +7382,7 @@ var kr = rh(
|
|
|
7382
7382
|
}),
|
|
7383
7383
|
B({
|
|
7384
7384
|
type: re("image-file-id"),
|
|
7385
|
-
fileId: $e([x(),
|
|
7385
|
+
fileId: $e([x(), At(x(), x())]),
|
|
7386
7386
|
providerOptions: we.optional()
|
|
7387
7387
|
}),
|
|
7388
7388
|
B({
|
|
@@ -7449,19 +7449,19 @@ var kr = rh(
|
|
|
7449
7449
|
]);
|
|
7450
7450
|
async function au(e) {
|
|
7451
7451
|
if (e.prompt == null && e.messages == null)
|
|
7452
|
-
throw new
|
|
7452
|
+
throw new Wt({
|
|
7453
7453
|
prompt: e,
|
|
7454
7454
|
message: "prompt or messages must be defined"
|
|
7455
7455
|
});
|
|
7456
7456
|
if (e.prompt != null && e.messages != null)
|
|
7457
|
-
throw new
|
|
7457
|
+
throw new Wt({
|
|
7458
7458
|
prompt: e,
|
|
7459
7459
|
message: "prompt and messages cannot be defined at the same time"
|
|
7460
7460
|
});
|
|
7461
7461
|
if (e.system != null && typeof e.system != "string" && !xr(e.system).every(
|
|
7462
7462
|
(n) => typeof n == "object" && n !== null && "role" in n && n.role === "system"
|
|
7463
7463
|
))
|
|
7464
|
-
throw new
|
|
7464
|
+
throw new Wt({
|
|
7465
7465
|
prompt: e,
|
|
7466
7466
|
message: "system must be a string, SystemModelMessage, or array of SystemModelMessage"
|
|
7467
7467
|
});
|
|
@@ -7473,12 +7473,12 @@ async function au(e) {
|
|
|
7473
7473
|
else if (e.messages != null)
|
|
7474
7474
|
t = e.messages;
|
|
7475
7475
|
else
|
|
7476
|
-
throw new
|
|
7476
|
+
throw new Wt({
|
|
7477
7477
|
prompt: e,
|
|
7478
7478
|
message: "prompt or messages must be defined"
|
|
7479
7479
|
});
|
|
7480
7480
|
if (t.length === 0)
|
|
7481
|
-
throw new
|
|
7481
|
+
throw new Wt({
|
|
7482
7482
|
prompt: e,
|
|
7483
7483
|
message: "messages must not be empty"
|
|
7484
7484
|
});
|
|
@@ -7487,7 +7487,7 @@ async function au(e) {
|
|
|
7487
7487
|
schema: Ge(Ev)
|
|
7488
7488
|
});
|
|
7489
7489
|
if (!r.success)
|
|
7490
|
-
throw new
|
|
7490
|
+
throw new Wt({
|
|
7491
7491
|
prompt: e,
|
|
7492
7492
|
message: "The messages do not match the ModelMessage[] schema.",
|
|
7493
7493
|
cause: r.error
|
|
@@ -7553,17 +7553,17 @@ function su({
|
|
|
7553
7553
|
}
|
|
7554
7554
|
var bv = {
|
|
7555
7555
|
startSpan() {
|
|
7556
|
-
return
|
|
7556
|
+
return Wr;
|
|
7557
7557
|
},
|
|
7558
7558
|
startActiveSpan(e, t, r, n) {
|
|
7559
7559
|
if (typeof t == "function")
|
|
7560
|
-
return t(
|
|
7560
|
+
return t(Wr);
|
|
7561
7561
|
if (typeof r == "function")
|
|
7562
|
-
return r(
|
|
7562
|
+
return r(Wr);
|
|
7563
7563
|
if (typeof n == "function")
|
|
7564
|
-
return n(
|
|
7564
|
+
return n(Wr);
|
|
7565
7565
|
}
|
|
7566
|
-
},
|
|
7566
|
+
}, Wr = {
|
|
7567
7567
|
spanContext() {
|
|
7568
7568
|
return Iv;
|
|
7569
7569
|
},
|
|
@@ -8903,7 +8903,7 @@ async function ia({
|
|
|
8903
8903
|
abortSignal: i
|
|
8904
8904
|
}), ce = oa(z), ke = zr(
|
|
8905
8905
|
l ?? {},
|
|
8906
|
-
`ai/${
|
|
8906
|
+
`ai/${Wl}`
|
|
8907
8907
|
), be = su({
|
|
8908
8908
|
model: le,
|
|
8909
8909
|
telemetry: p,
|
|
@@ -8937,12 +8937,12 @@ async function ia({
|
|
|
8937
8937
|
tracer: Ze,
|
|
8938
8938
|
fn: async (jt) => {
|
|
8939
8939
|
var Gt, Me, Bt, Vt, lt, ut, Ur, ht;
|
|
8940
|
-
const ur = gt.messages, ct = [], { approvedToolApprovals: Zr, deniedToolApprovals: cr } = gu({ messages: ur }),
|
|
8940
|
+
const ur = gt.messages, ct = [], { approvedToolApprovals: Zr, deniedToolApprovals: cr } = gu({ messages: ur }), xt = Zr.filter(
|
|
8941
8941
|
(U) => !U.toolCall.providerExecuted
|
|
8942
8942
|
);
|
|
8943
|
-
if (cr.length > 0 ||
|
|
8943
|
+
if (cr.length > 0 || xt.length > 0) {
|
|
8944
8944
|
const U = await ys({
|
|
8945
|
-
toolCalls:
|
|
8945
|
+
toolCalls: xt.map(
|
|
8946
8946
|
(X) => X.toolCall
|
|
8947
8947
|
),
|
|
8948
8948
|
tools: t,
|
|
@@ -9007,7 +9007,7 @@ async function ia({
|
|
|
9007
9007
|
)
|
|
9008
9008
|
});
|
|
9009
9009
|
const jr = oa(z);
|
|
9010
|
-
let
|
|
9010
|
+
let Y, ge = [], he = [];
|
|
9011
9011
|
const oe = [], q = /* @__PURE__ */ new Map();
|
|
9012
9012
|
do {
|
|
9013
9013
|
const U = [...ur, ...ct], se = await (P == null ? void 0 : P({
|
|
@@ -9032,7 +9032,7 @@ async function ia({
|
|
|
9032
9032
|
toolChoice: (lt = se == null ? void 0 : se.toolChoice) != null ? lt : r,
|
|
9033
9033
|
activeTools: (ut = se == null ? void 0 : se.activeTools) != null ? ut : v
|
|
9034
9034
|
});
|
|
9035
|
-
|
|
9035
|
+
Y = await te(
|
|
9036
9036
|
() => {
|
|
9037
9037
|
var M;
|
|
9038
9038
|
return Cr({
|
|
@@ -9132,7 +9132,7 @@ async function ia({
|
|
|
9132
9132
|
}
|
|
9133
9133
|
);
|
|
9134
9134
|
const Te = await Promise.all(
|
|
9135
|
-
|
|
9135
|
+
Y.content.filter(
|
|
9136
9136
|
(M) => M.type === "tool-call"
|
|
9137
9137
|
).map(
|
|
9138
9138
|
(M) => yu({
|
|
@@ -9197,16 +9197,16 @@ async function ia({
|
|
|
9197
9197
|
if (!M.providerExecuted)
|
|
9198
9198
|
continue;
|
|
9199
9199
|
const Ie = t == null ? void 0 : t[M.toolName];
|
|
9200
|
-
(Ie == null ? void 0 : Ie.type) === "provider" && Ie.supportsDeferredResults && (
|
|
9200
|
+
(Ie == null ? void 0 : Ie.type) === "provider" && Ie.supportsDeferredResults && (Y.content.some(
|
|
9201
9201
|
(pt) => pt.type === "tool-result" && pt.toolCallId === M.toolCallId
|
|
9202
9202
|
) || q.set(M.toolCallId, {
|
|
9203
9203
|
toolName: M.toolName
|
|
9204
9204
|
}));
|
|
9205
9205
|
}
|
|
9206
|
-
for (const M of
|
|
9206
|
+
for (const M of Y.content)
|
|
9207
9207
|
M.type === "tool-result" && q.delete(M.toolCallId);
|
|
9208
|
-
const
|
|
9209
|
-
content:
|
|
9208
|
+
const kt = Mv({
|
|
9209
|
+
content: Y.content,
|
|
9210
9210
|
toolCalls: Te,
|
|
9211
9211
|
toolOutputs: he,
|
|
9212
9212
|
toolApprovalRequests: Object.values(Oe),
|
|
@@ -9214,26 +9214,26 @@ async function ia({
|
|
|
9214
9214
|
});
|
|
9215
9215
|
ct.push(
|
|
9216
9216
|
...await sa({
|
|
9217
|
-
content:
|
|
9217
|
+
content: kt,
|
|
9218
9218
|
tools: t
|
|
9219
9219
|
})
|
|
9220
9220
|
);
|
|
9221
9221
|
const yt = new wu({
|
|
9222
|
-
content:
|
|
9223
|
-
finishReason:
|
|
9224
|
-
rawFinishReason:
|
|
9225
|
-
usage: cu(
|
|
9226
|
-
warnings:
|
|
9227
|
-
providerMetadata:
|
|
9228
|
-
request: (Ur =
|
|
9222
|
+
content: kt,
|
|
9223
|
+
finishReason: Y.finishReason.unified,
|
|
9224
|
+
rawFinishReason: Y.finishReason.raw,
|
|
9225
|
+
usage: cu(Y.usage),
|
|
9226
|
+
warnings: Y.warnings,
|
|
9227
|
+
providerMetadata: Y.providerMetadata,
|
|
9228
|
+
request: (Ur = Y.request) != null ? Ur : {},
|
|
9229
9229
|
response: {
|
|
9230
|
-
...
|
|
9230
|
+
...Y.response,
|
|
9231
9231
|
// deep clone msgs to avoid mutating past messages in multi-step:
|
|
9232
9232
|
messages: structuredClone(ct)
|
|
9233
9233
|
}
|
|
9234
9234
|
});
|
|
9235
9235
|
Pa({
|
|
9236
|
-
warnings: (ht =
|
|
9236
|
+
warnings: (ht = Y.warnings) != null ? ht : [],
|
|
9237
9237
|
provider: X.provider,
|
|
9238
9238
|
model: X.modelId
|
|
9239
9239
|
}), oe.push(yt), await (N == null ? void 0 : N(yt));
|
|
@@ -9248,22 +9248,22 @@ async function ia({
|
|
|
9248
9248
|
await st({
|
|
9249
9249
|
telemetry: p,
|
|
9250
9250
|
attributes: {
|
|
9251
|
-
"ai.response.finishReason":
|
|
9251
|
+
"ai.response.finishReason": Y.finishReason.unified,
|
|
9252
9252
|
"ai.response.text": {
|
|
9253
|
-
output: () => hs(
|
|
9253
|
+
output: () => hs(Y.content)
|
|
9254
9254
|
},
|
|
9255
9255
|
"ai.response.toolCalls": {
|
|
9256
9256
|
output: () => {
|
|
9257
|
-
const U = vs(
|
|
9257
|
+
const U = vs(Y.content);
|
|
9258
9258
|
return U == null ? void 0 : JSON.stringify(U);
|
|
9259
9259
|
}
|
|
9260
9260
|
},
|
|
9261
9261
|
"ai.response.providerMetadata": JSON.stringify(
|
|
9262
|
-
|
|
9262
|
+
Y.providerMetadata
|
|
9263
9263
|
),
|
|
9264
9264
|
// TODO rename telemetry attributes to inputTokens and outputTokens
|
|
9265
|
-
"ai.usage.promptTokens":
|
|
9266
|
-
"ai.usage.completionTokens":
|
|
9265
|
+
"ai.usage.promptTokens": Y.usage.inputTokens.total,
|
|
9266
|
+
"ai.usage.completionTokens": Y.usage.outputTokens.total
|
|
9267
9267
|
}
|
|
9268
9268
|
})
|
|
9269
9269
|
);
|
|
@@ -10167,7 +10167,7 @@ function _s() {
|
|
|
10167
10167
|
reject: t
|
|
10168
10168
|
};
|
|
10169
10169
|
}
|
|
10170
|
-
function
|
|
10170
|
+
function Yv() {
|
|
10171
10171
|
let e = [], t = null, r = !1, n = _s();
|
|
10172
10172
|
const a = () => {
|
|
10173
10173
|
r = !0, n.resolve(), e.forEach((s) => s.cancel()), e = [], t == null || t.close();
|
|
@@ -10216,7 +10216,7 @@ function Wv() {
|
|
|
10216
10216
|
terminate: a
|
|
10217
10217
|
};
|
|
10218
10218
|
}
|
|
10219
|
-
function
|
|
10219
|
+
function Wv() {
|
|
10220
10220
|
var e, t;
|
|
10221
10221
|
return (t = (e = globalThis == null ? void 0 : globalThis.performance) == null ? void 0 : e.now()) != null ? t : Date.now();
|
|
10222
10222
|
}
|
|
@@ -10466,7 +10466,7 @@ function Qv({
|
|
|
10466
10466
|
onStepFinish: z,
|
|
10467
10467
|
experimental_context: le,
|
|
10468
10468
|
_internal: {
|
|
10469
|
-
now: L =
|
|
10469
|
+
now: L = Wv,
|
|
10470
10470
|
generateId: ee = Xv,
|
|
10471
10471
|
currentDate: te = () => /* @__PURE__ */ new Date()
|
|
10472
10472
|
} = {},
|
|
@@ -10688,11 +10688,11 @@ var tw = class {
|
|
|
10688
10688
|
const V = new $l({
|
|
10689
10689
|
message: "No output generated. Check the stream for errors."
|
|
10690
10690
|
});
|
|
10691
|
-
|
|
10691
|
+
Y._finishReason.reject(V), Y._rawFinishReason.reject(V), Y._totalUsage.reject(V), Y._steps.reject(V);
|
|
10692
10692
|
return;
|
|
10693
10693
|
}
|
|
10694
10694
|
const he = be ?? "other", oe = Ze ?? Bn();
|
|
10695
|
-
|
|
10695
|
+
Y._finishReason.resolve(he), Y._rawFinishReason.resolve(gt), Y._totalUsage.resolve(oe), Y._steps.resolve(Me);
|
|
10696
10696
|
const q = Me[Me.length - 1];
|
|
10697
10697
|
await (D == null ? void 0 : D({
|
|
10698
10698
|
finishReason: q.finishReason,
|
|
@@ -10746,7 +10746,7 @@ var tw = class {
|
|
|
10746
10746
|
Vt.end();
|
|
10747
10747
|
}
|
|
10748
10748
|
}
|
|
10749
|
-
}), ht =
|
|
10749
|
+
}), ht = Yv();
|
|
10750
10750
|
this.addStream = ht.addStream, this.closeStream = ht.close;
|
|
10751
10751
|
const ur = ht.stream.getReader();
|
|
10752
10752
|
let ct = new ReadableStream({
|
|
@@ -10789,12 +10789,12 @@ var tw = class {
|
|
|
10789
10789
|
const { maxRetries: Zr, retry: cr } = fu({
|
|
10790
10790
|
maxRetries: a,
|
|
10791
10791
|
abortSignal: o
|
|
10792
|
-
}),
|
|
10792
|
+
}), xt = iu(t), qe = oa(n), jr = su({
|
|
10793
10793
|
model: e,
|
|
10794
10794
|
telemetry: t,
|
|
10795
10795
|
headers: r,
|
|
10796
10796
|
settings: { ...qe, maxRetries: Zr }
|
|
10797
|
-
}),
|
|
10797
|
+
}), Y = this;
|
|
10798
10798
|
Cr({
|
|
10799
10799
|
name: "ai.streamText",
|
|
10800
10800
|
attributes: st({
|
|
@@ -10808,7 +10808,7 @@ var tw = class {
|
|
|
10808
10808
|
}
|
|
10809
10809
|
}
|
|
10810
10810
|
}),
|
|
10811
|
-
tracer:
|
|
10811
|
+
tracer: xt,
|
|
10812
10812
|
endWhenDone: !1,
|
|
10813
10813
|
fn: async (ge) => {
|
|
10814
10814
|
Vt = ge;
|
|
@@ -10834,7 +10834,7 @@ var tw = class {
|
|
|
10834
10834
|
De = Te;
|
|
10835
10835
|
}
|
|
10836
10836
|
});
|
|
10837
|
-
|
|
10837
|
+
Y.addStream(mt);
|
|
10838
10838
|
try {
|
|
10839
10839
|
for (const Oe of [
|
|
10840
10840
|
...X,
|
|
@@ -10851,13 +10851,13 @@ var tw = class {
|
|
|
10851
10851
|
const Ee = await Ca({
|
|
10852
10852
|
toolCall: Oe.toolCall,
|
|
10853
10853
|
tools: u,
|
|
10854
|
-
tracer:
|
|
10854
|
+
tracer: xt,
|
|
10855
10855
|
telemetry: t,
|
|
10856
10856
|
messages: oe,
|
|
10857
10857
|
abortSignal: o,
|
|
10858
10858
|
experimental_context: L,
|
|
10859
|
-
onPreliminaryToolResult: (
|
|
10860
|
-
De == null || De.enqueue(
|
|
10859
|
+
onPreliminaryToolResult: (kt) => {
|
|
10860
|
+
De == null || De.enqueue(kt);
|
|
10861
10861
|
}
|
|
10862
10862
|
});
|
|
10863
10863
|
Ee != null && (De == null || De.enqueue(Ee), Te.push(Ee));
|
|
@@ -10914,7 +10914,7 @@ var tw = class {
|
|
|
10914
10914
|
usage: X
|
|
10915
10915
|
}) {
|
|
10916
10916
|
var dt, De, mt, Te, Oe, Ee;
|
|
10917
|
-
const
|
|
10917
|
+
const kt = Y.includeRawChunks;
|
|
10918
10918
|
te = new mr();
|
|
10919
10919
|
const yt = [...oe, ...se], M = await (P == null ? void 0 : P({
|
|
10920
10920
|
model: e,
|
|
@@ -10981,7 +10981,7 @@ var tw = class {
|
|
|
10981
10981
|
"gen_ai.request.top_p": qe.topP
|
|
10982
10982
|
}
|
|
10983
10983
|
}),
|
|
10984
|
-
tracer:
|
|
10984
|
+
tracer: xt,
|
|
10985
10985
|
endWhenDone: !1,
|
|
10986
10986
|
fn: async (F) => ({
|
|
10987
10987
|
startTimestampMs: g(),
|
|
@@ -10996,14 +10996,14 @@ var tw = class {
|
|
|
10996
10996
|
providerOptions: Gr,
|
|
10997
10997
|
abortSignal: o,
|
|
10998
10998
|
headers: r,
|
|
10999
|
-
includeRawChunks:
|
|
10999
|
+
includeRawChunks: kt
|
|
11000
11000
|
})
|
|
11001
11001
|
})
|
|
11002
11002
|
})
|
|
11003
11003
|
), Pe = Kv({
|
|
11004
11004
|
tools: u,
|
|
11005
11005
|
generatorStream: Br,
|
|
11006
|
-
tracer:
|
|
11006
|
+
tracer: xt,
|
|
11007
11007
|
telemetry: t,
|
|
11008
11008
|
system: s,
|
|
11009
11009
|
messages: yt,
|
|
@@ -11014,16 +11014,16 @@ var tw = class {
|
|
|
11014
11014
|
}), vt = pr ?? {}, wt = [], fr = [];
|
|
11015
11015
|
let An;
|
|
11016
11016
|
const Nn = {};
|
|
11017
|
-
let Jt = "other", On,
|
|
11017
|
+
let Jt = "other", On, We = Bn(), Rn, $a = !0, nt = {
|
|
11018
11018
|
id: R(),
|
|
11019
11019
|
timestamp: $(),
|
|
11020
11020
|
modelId: e.modelId
|
|
11021
11021
|
}, Ma = "";
|
|
11022
|
-
|
|
11022
|
+
Y.addStream(
|
|
11023
11023
|
Pe.pipeThrough(
|
|
11024
11024
|
new TransformStream({
|
|
11025
11025
|
async transform(F, Ce) {
|
|
11026
|
-
var gr, hr, qr, Re,
|
|
11026
|
+
var gr, hr, qr, Re, Yt;
|
|
11027
11027
|
if (F.type === "stream-start") {
|
|
11028
11028
|
An = F.warnings;
|
|
11029
11029
|
return;
|
|
@@ -11092,11 +11092,11 @@ var tw = class {
|
|
|
11092
11092
|
break;
|
|
11093
11093
|
}
|
|
11094
11094
|
case "finish": {
|
|
11095
|
-
|
|
11095
|
+
We = F.usage, Jt = F.finishReason, On = F.rawFinishReason, Rn = F.providerMetadata;
|
|
11096
11096
|
const Se = g() - Vr;
|
|
11097
11097
|
ft.addEvent("ai.stream.finish"), ft.setAttributes({
|
|
11098
11098
|
"ai.response.msToFinish": Se,
|
|
11099
|
-
"ai.response.avgOutputTokensPerSecond": 1e3 * ((Re =
|
|
11099
|
+
"ai.response.avgOutputTokensPerSecond": 1e3 * ((Re = We.outputTokens) != null ? Re : 0) / Se
|
|
11100
11100
|
});
|
|
11101
11101
|
break;
|
|
11102
11102
|
}
|
|
@@ -11118,7 +11118,7 @@ var tw = class {
|
|
|
11118
11118
|
experimental_context: L
|
|
11119
11119
|
}), Ce.enqueue({
|
|
11120
11120
|
...F,
|
|
11121
|
-
dynamic: (
|
|
11121
|
+
dynamic: (Yt = F.dynamic) != null ? Yt : (Se == null ? void 0 : Se.type) === "dynamic",
|
|
11122
11122
|
title: Se == null ? void 0 : Se.title
|
|
11123
11123
|
});
|
|
11124
11124
|
break;
|
|
@@ -11143,7 +11143,7 @@ var tw = class {
|
|
|
11143
11143
|
break;
|
|
11144
11144
|
}
|
|
11145
11145
|
case "raw": {
|
|
11146
|
-
|
|
11146
|
+
kt && Ce.enqueue(F);
|
|
11147
11147
|
break;
|
|
11148
11148
|
}
|
|
11149
11149
|
default: {
|
|
@@ -11171,17 +11171,17 @@ var tw = class {
|
|
|
11171
11171
|
"ai.response.model": nt.modelId,
|
|
11172
11172
|
"ai.response.timestamp": nt.timestamp.toISOString(),
|
|
11173
11173
|
"ai.response.providerMetadata": JSON.stringify(Rn),
|
|
11174
|
-
"ai.usage.inputTokens":
|
|
11175
|
-
"ai.usage.outputTokens":
|
|
11176
|
-
"ai.usage.totalTokens":
|
|
11177
|
-
"ai.usage.reasoningTokens":
|
|
11178
|
-
"ai.usage.cachedInputTokens":
|
|
11174
|
+
"ai.usage.inputTokens": We.inputTokens,
|
|
11175
|
+
"ai.usage.outputTokens": We.outputTokens,
|
|
11176
|
+
"ai.usage.totalTokens": We.totalTokens,
|
|
11177
|
+
"ai.usage.reasoningTokens": We.reasoningTokens,
|
|
11178
|
+
"ai.usage.cachedInputTokens": We.cachedInputTokens,
|
|
11179
11179
|
// standardized gen-ai llm span attributes:
|
|
11180
11180
|
"gen_ai.response.finish_reasons": [Jt],
|
|
11181
11181
|
"gen_ai.response.id": nt.id,
|
|
11182
11182
|
"gen_ai.response.model": nt.modelId,
|
|
11183
|
-
"gen_ai.usage.input_tokens":
|
|
11184
|
-
"gen_ai.usage.output_tokens":
|
|
11183
|
+
"gen_ai.usage.input_tokens": We.inputTokens,
|
|
11184
|
+
"gen_ai.usage.output_tokens": We.outputTokens
|
|
11185
11185
|
}
|
|
11186
11186
|
})
|
|
11187
11187
|
);
|
|
@@ -11193,14 +11193,14 @@ var tw = class {
|
|
|
11193
11193
|
type: "finish-step",
|
|
11194
11194
|
finishReason: Jt,
|
|
11195
11195
|
rawFinishReason: On,
|
|
11196
|
-
usage:
|
|
11196
|
+
usage: We,
|
|
11197
11197
|
providerMetadata: Rn,
|
|
11198
11198
|
response: {
|
|
11199
11199
|
...nt,
|
|
11200
11200
|
headers: dr == null ? void 0 : dr.headers
|
|
11201
11201
|
}
|
|
11202
11202
|
});
|
|
11203
|
-
const gr = du(X,
|
|
11203
|
+
const gr = du(X, We);
|
|
11204
11204
|
await te.promise;
|
|
11205
11205
|
const hr = wt.filter(
|
|
11206
11206
|
(Re) => Re.providerExecuted !== !0
|
|
@@ -11210,8 +11210,8 @@ var tw = class {
|
|
|
11210
11210
|
for (const Re of wt) {
|
|
11211
11211
|
if (Re.providerExecuted !== !0)
|
|
11212
11212
|
continue;
|
|
11213
|
-
const
|
|
11214
|
-
(
|
|
11213
|
+
const Yt = u == null ? void 0 : u[Re.toolName];
|
|
11214
|
+
(Yt == null ? void 0 : Yt.type) === "provider" && Yt.supportsDeferredResults && (fr.some(
|
|
11215
11215
|
(Se) => Se.type === "tool-result" && Se.toolCallId === Re.toolCallId
|
|
11216
11216
|
) || Bt.set(Re.toolCallId, {
|
|
11217
11217
|
toolName: Re.toolName
|
|
@@ -11248,7 +11248,7 @@ var tw = class {
|
|
|
11248
11248
|
F.enqueue({
|
|
11249
11249
|
type: "error",
|
|
11250
11250
|
error: Re
|
|
11251
|
-
}),
|
|
11251
|
+
}), Y.closeStream();
|
|
11252
11252
|
}
|
|
11253
11253
|
} else
|
|
11254
11254
|
F.enqueue({
|
|
@@ -11256,7 +11256,7 @@ var tw = class {
|
|
|
11256
11256
|
finishReason: Jt,
|
|
11257
11257
|
rawFinishReason: On,
|
|
11258
11258
|
totalUsage: gr
|
|
11259
|
-
}),
|
|
11259
|
+
}), Y.closeStream();
|
|
11260
11260
|
}
|
|
11261
11261
|
})
|
|
11262
11262
|
)
|
|
@@ -11269,13 +11269,13 @@ var tw = class {
|
|
|
11269
11269
|
});
|
|
11270
11270
|
}
|
|
11271
11271
|
}).catch((ge) => {
|
|
11272
|
-
|
|
11272
|
+
Y.addStream(
|
|
11273
11273
|
new ReadableStream({
|
|
11274
11274
|
start(he) {
|
|
11275
11275
|
he.enqueue({ type: "error", error: ge }), he.close();
|
|
11276
11276
|
}
|
|
11277
11277
|
})
|
|
11278
|
-
),
|
|
11278
|
+
), Y.closeStream();
|
|
11279
11279
|
});
|
|
11280
11280
|
}
|
|
11281
11281
|
get steps() {
|
|
@@ -12126,7 +12126,7 @@ var Es;
|
|
|
12126
12126
|
function Su() {
|
|
12127
12127
|
if (Es) return at.exports;
|
|
12128
12128
|
Es = 1;
|
|
12129
|
-
const e =
|
|
12129
|
+
const e = Yu, t = Wu, r = Ku, n = Xu, o = lw.version, s = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
12130
12130
|
function i(h) {
|
|
12131
12131
|
const N = {};
|
|
12132
12132
|
let D = h.toString();
|
|
@@ -12950,12 +12950,12 @@ class Iw extends G {
|
|
|
12950
12950
|
if (!i)
|
|
12951
12951
|
throw new _(`Template page not found with ID: ${o.pageId}`, "TEMPLATE_PAGE_NOT_FOUND");
|
|
12952
12952
|
let u = i.blocks || [];
|
|
12953
|
-
if (u = u.map((d) => d._type === "GlobalBlock" && !
|
|
12953
|
+
if (u = u.map((d) => d._type === "GlobalBlock" && !Mt(d.globalBlock) ? {
|
|
12954
12954
|
...d,
|
|
12955
12955
|
_type: "PartialBlock",
|
|
12956
12956
|
partialBlockId: d.globalBlock
|
|
12957
12957
|
} : d), !(s.app === r)) {
|
|
12958
|
-
const d = s.name || "", p = u.filter((E) => E._type === "PartialBlock" && !
|
|
12958
|
+
const d = s.name || "", p = u.filter((E) => E._type === "PartialBlock" && !Mt(E.partialBlockId)), y = await Promise.all(
|
|
12959
12959
|
p.map(
|
|
12960
12960
|
({ partialBlockId: E }) => this.copyPartialBlockFromTemplate(E, d, r)
|
|
12961
12961
|
)
|
|
@@ -14121,7 +14121,7 @@ class Uw extends G {
|
|
|
14121
14121
|
if (!a || a.length === 0)
|
|
14122
14122
|
throw new _("Library item not found", "GET_LIBRARY_ITEM_FAILED");
|
|
14123
14123
|
const s = a[0], i = Array.isArray(s.blocks) ? [...s.blocks] : s.blocks;
|
|
14124
|
-
return s.libraryApp === r ?
|
|
14124
|
+
return s.libraryApp === r ? Yn(i, "0._libBlockId", s.id) : Yn(i, "0._libBlockId", void 0), {
|
|
14125
14125
|
id: s.id,
|
|
14126
14126
|
name: s.name,
|
|
14127
14127
|
blocks: i,
|
|
@@ -14303,7 +14303,7 @@ class Gw extends G {
|
|
|
14303
14303
|
const a = r ? f : ye, o = t.filter(({ _type: c }) => c === "GlobalBlock" || c === "PartialBlock");
|
|
14304
14304
|
if (o.length === 0)
|
|
14305
14305
|
return t;
|
|
14306
|
-
const s = o.map((c) =>
|
|
14306
|
+
const s = o.map((c) => Dt(c, "partialBlockId", Dt(c, "globalBlock", ""))).filter((c) => c !== "");
|
|
14307
14307
|
if (s.length === 0)
|
|
14308
14308
|
return t;
|
|
14309
14309
|
const { data: i, error: l } = await S(
|
|
@@ -14321,10 +14321,10 @@ class Gw extends G {
|
|
|
14321
14321
|
for (let c = 0; c < o.length; c++) {
|
|
14322
14322
|
const d = o[c];
|
|
14323
14323
|
if (!d) continue;
|
|
14324
|
-
const p =
|
|
14324
|
+
const p = Dt(d, "partialBlockId", Dt(d, "globalBlock", ""));
|
|
14325
14325
|
if (p === "") continue;
|
|
14326
14326
|
let y = u.get(p) ?? [];
|
|
14327
|
-
y.length > 0 && (y = y.map((v) => (
|
|
14327
|
+
y.length > 0 && (y = y.map((v) => (Mt(v._parent) && (v._parent = d._parent), Bu(d, "_show") && (v._show = d._show), v)));
|
|
14328
14328
|
const E = t.indexOf(d);
|
|
14329
14329
|
E !== -1 && t.splice(E, 1, ...y);
|
|
14330
14330
|
}
|
|
@@ -14361,7 +14361,7 @@ class Bw extends G {
|
|
|
14361
14361
|
var s;
|
|
14362
14362
|
a[o.id] = {
|
|
14363
14363
|
name: o.name,
|
|
14364
|
-
isPartial:
|
|
14364
|
+
isPartial: Mt(o.slug),
|
|
14365
14365
|
partialBlocks: o.partialBlocks ? (s = o.partialBlocks) == null ? void 0 : s.split("|").filter(Boolean) : [],
|
|
14366
14366
|
links: o.links ? o.links.split("|").filter(Boolean) : [],
|
|
14367
14367
|
designTokens: o.designTokens ?? {}
|
|
@@ -14458,7 +14458,7 @@ class Pu extends G {
|
|
|
14458
14458
|
throw ue("ERROR_GETTING_WEBSITE_PAGES", s);
|
|
14459
14459
|
if (!o || o.length === 0)
|
|
14460
14460
|
return [];
|
|
14461
|
-
const i = o.filter((d) => !
|
|
14461
|
+
const i = o.filter((d) => !Mt(d.slug)).map((d) => d.id), { data: l, error: u } = await S(
|
|
14462
14462
|
() => I.select({
|
|
14463
14463
|
pageId: ne.pageId
|
|
14464
14464
|
}).from(ne).where(Tt(ne.pageId, i))
|
|
@@ -14765,7 +14765,7 @@ class Hw extends G {
|
|
|
14765
14765
|
const n = await this.clonePage(r);
|
|
14766
14766
|
await this.addOnlinePage(n);
|
|
14767
14767
|
const a = [`page-${n.primaryPage ?? n.id}`];
|
|
14768
|
-
return
|
|
14768
|
+
return Mt(n.slug) && a.push(...await this.getPartialBlockUsage(n.primaryPage ?? n.id)), a;
|
|
14769
14769
|
}
|
|
14770
14770
|
/**
|
|
14771
14771
|
* Create a revision before publishing
|
|
@@ -14778,7 +14778,7 @@ class Hw extends G {
|
|
|
14778
14778
|
where: T(ye.id, r)
|
|
14779
14779
|
})
|
|
14780
14780
|
);
|
|
14781
|
-
if (a || !n || !
|
|
14781
|
+
if (a || !n || !Mt(n.primaryPage))
|
|
14782
14782
|
return !1;
|
|
14783
14783
|
const { error: o } = await S(
|
|
14784
14784
|
() => I.insert(Ne).values({
|
|
@@ -14921,7 +14921,7 @@ class Jw extends G {
|
|
|
14921
14921
|
return await I.update(f).set({ blocks: a }).where(T(f.id, n)), { success: !0, pageId: n };
|
|
14922
14922
|
}
|
|
14923
14923
|
}
|
|
14924
|
-
class
|
|
14924
|
+
class Yw extends G {
|
|
14925
14925
|
getValidationSchema() {
|
|
14926
14926
|
return m.object({
|
|
14927
14927
|
pageType: m.string(),
|
|
@@ -14943,7 +14943,7 @@ class Ww extends G {
|
|
|
14943
14943
|
}
|
|
14944
14944
|
}
|
|
14945
14945
|
}
|
|
14946
|
-
class
|
|
14946
|
+
class Ww extends G {
|
|
14947
14947
|
/**
|
|
14948
14948
|
* Define the validation schema for search pages action
|
|
14949
14949
|
*/
|
|
@@ -15357,7 +15357,7 @@ class e_ extends G {
|
|
|
15357
15357
|
}
|
|
15358
15358
|
getPartialBlocks(r) {
|
|
15359
15359
|
return La(
|
|
15360
|
-
r.filter((n) => n._type === "GlobalBlock" || n._type === "PartialBlock").map((n) =>
|
|
15360
|
+
r.filter((n) => n._type === "GlobalBlock" || n._type === "PartialBlock").map((n) => Dt(n, "partialBlockId", Dt(n, "globalBlock", !1)))
|
|
15361
15361
|
).join("|");
|
|
15362
15362
|
}
|
|
15363
15363
|
getLinks(r) {
|
|
@@ -15613,7 +15613,7 @@ class n_ extends G {
|
|
|
15613
15613
|
return b[0];
|
|
15614
15614
|
} else {
|
|
15615
15615
|
const v = lc(), b = [...s];
|
|
15616
|
-
|
|
15616
|
+
Yn(b, "0._libBlockId", v);
|
|
15617
15617
|
const P = {
|
|
15618
15618
|
id: v,
|
|
15619
15619
|
name: a,
|
|
@@ -15645,81 +15645,15 @@ class a_ extends G {
|
|
|
15645
15645
|
n.execute(),
|
|
15646
15646
|
a.execute(),
|
|
15647
15647
|
o.execute()
|
|
15648
|
-
])
|
|
15648
|
+
]);
|
|
15649
15649
|
return {
|
|
15650
15650
|
websiteSettings: s,
|
|
15651
15651
|
websitePages: i,
|
|
15652
15652
|
pageTypes: l,
|
|
15653
|
-
changes: d,
|
|
15654
15653
|
libraries: u,
|
|
15655
|
-
collections: c
|
|
15656
|
-
siteWideUsage: p
|
|
15654
|
+
collections: c
|
|
15657
15655
|
};
|
|
15658
15656
|
}
|
|
15659
|
-
/**
|
|
15660
|
-
* Derive changes from primary pages (lang = "").
|
|
15661
|
-
* Replicates the logic from GetChangesAction:
|
|
15662
|
-
* 1. Pages with changes (changes column is not null)
|
|
15663
|
-
* 2. Offline pages (online=false, no currentEditor) → changes: ["Take Online"]
|
|
15664
|
-
* 3. Theme / Design Token changes from the apps table (via websiteSettings)
|
|
15665
|
-
*/
|
|
15666
|
-
deriveChanges(t, r) {
|
|
15667
|
-
const n = t.filter((u) => u.changes !== null && u.changes !== void 0).map((u) => ({
|
|
15668
|
-
id: u.id,
|
|
15669
|
-
slug: u.slug,
|
|
15670
|
-
name: u.name,
|
|
15671
|
-
pageType: u.pageType,
|
|
15672
|
-
lang: u.lang,
|
|
15673
|
-
changes: u.changes,
|
|
15674
|
-
primaryPage: u.primaryPage,
|
|
15675
|
-
online: u.online,
|
|
15676
|
-
currentEditor: u.currentEditor
|
|
15677
|
-
})), a = t.filter((u) => u.currentEditor === null && u.online === !1).map((u) => ({
|
|
15678
|
-
id: u.id,
|
|
15679
|
-
slug: u.slug,
|
|
15680
|
-
name: u.name,
|
|
15681
|
-
pageType: u.pageType,
|
|
15682
|
-
lang: u.lang,
|
|
15683
|
-
changes: ["Take Online"],
|
|
15684
|
-
primaryPage: u.primaryPage,
|
|
15685
|
-
online: u.online
|
|
15686
|
-
})), o = new Set(a.map((u) => u.id)), i = [...n.filter((u) => !o.has(u.id)), ...a], l = (r == null ? void 0 : r.appChanges) ?? [];
|
|
15687
|
-
return l.includes("THEME") && i.push({
|
|
15688
|
-
id: "THEME",
|
|
15689
|
-
slug: "",
|
|
15690
|
-
name: "Theme",
|
|
15691
|
-
pageType: "theme",
|
|
15692
|
-
lang: "",
|
|
15693
|
-
changes: ["Updated"],
|
|
15694
|
-
primaryPage: null,
|
|
15695
|
-
online: !0
|
|
15696
|
-
}), l.includes("DESIGN_TOKENS") && i.push({
|
|
15697
|
-
id: "DESIGN_TOKENS",
|
|
15698
|
-
slug: "",
|
|
15699
|
-
name: "Design Tokens",
|
|
15700
|
-
pageType: "design_tokens",
|
|
15701
|
-
lang: "",
|
|
15702
|
-
changes: ["Updated"],
|
|
15703
|
-
primaryPage: null,
|
|
15704
|
-
online: !0
|
|
15705
|
-
}), i;
|
|
15706
|
-
}
|
|
15707
|
-
/**
|
|
15708
|
-
* Derive siteWideUsage from default language pages (lang = "").
|
|
15709
|
-
* Replicates the logic from GetSiteWideDataAction.
|
|
15710
|
-
*/
|
|
15711
|
-
deriveSiteWideUsage(t) {
|
|
15712
|
-
const r = {};
|
|
15713
|
-
for (const n of t)
|
|
15714
|
-
r[n.id] = {
|
|
15715
|
-
name: n.name,
|
|
15716
|
-
isPartial: It(n.slug),
|
|
15717
|
-
partialBlocks: n.partialBlocks ? n.partialBlocks.split("|").filter(Boolean) : [],
|
|
15718
|
-
links: n.links ? n.links.split("|").filter(Boolean) : [],
|
|
15719
|
-
designTokens: n.designTokens ?? {}
|
|
15720
|
-
};
|
|
15721
|
-
return r;
|
|
15722
|
-
}
|
|
15723
15657
|
}
|
|
15724
15658
|
class o_ extends G {
|
|
15725
15659
|
getValidationSchema() {
|
|
@@ -15750,7 +15684,7 @@ class o_ extends G {
|
|
|
15750
15684
|
}
|
|
15751
15685
|
}
|
|
15752
15686
|
}
|
|
15753
|
-
const
|
|
15687
|
+
const Ct = class Ct {
|
|
15754
15688
|
constructor() {
|
|
15755
15689
|
Ae(this, "actions", {});
|
|
15756
15690
|
Zu("page", {
|
|
@@ -15760,13 +15694,13 @@ const Dt = class Dt {
|
|
|
15760
15694
|
name: "Global Block",
|
|
15761
15695
|
helpText: "A global block can be reused in multiple pages.",
|
|
15762
15696
|
icon: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hash-icon lucide-hash"><line x1="4" x2="20" y1="9" y2="9"/><line x1="4" x2="20" y1="15" y2="15"/><line x1="10" x2="8" y1="3" y2="21"/><line x1="16" x2="14" y1="3" y2="21"/></svg>'
|
|
15763
|
-
}), this.register("ASK_AI", new Ew()), this.register("CHECK_USER_ACCESS", new bw()), this.register("CREATE_PAGE", new Iw()), this.register("DELETE_PAGE", new Aw()), this.register("DUPLICATE_PAGE", new Ow()), this.register("RESTORE_PAGE_REVISION", new Jw()), this.register("UPDATE_PAGE_METADATA", new t_()), this.register("GENERATE_SEO_FIELD", new Dw()), this.register("GENERATE_HTML_FROM_PROMPT", new Pw()), this.register("GET_REVISION_PAGE", new Gw()), this.register("UPDATE_PAGE", new e_()), this.register("GET_COMPARE_DATA", new Fw()), this.register("GET_SITE_WIDE_USAGE", new Bw()), this.register("GET_WEBSITE_DRAFT_SETTINGS", new Cu()), this.register("GET_WEBSITE_PAGES", new Pu()), this.register("GET_LIBRARIES", new xu()), this.register("GET_DRAFT_PAGE", new Ou()), this.register("GET_LANGUAGE_PAGES", new Ru()), this.register("UPSERT_LIBRARY_ITEM", new n_()), this.register("MARK_AS_TEMPLATE", new qw()), this.register("GET_LIBRARY_ITEM", new Uw()), this.register("GET_LIBRARY_ITEMS", new Zw()), this.register("DELETE_LIBRARY_ITEM", new Sw()), this.register("UNMARK_AS_TEMPLATE", new Xw()), this.register("GET_TEMPLATES_BY_TYPE", new Vw()), this.register("SEARCH_PAGES", new
|
|
15697
|
+
}), this.register("ASK_AI", new Ew()), this.register("CHECK_USER_ACCESS", new bw()), this.register("CREATE_PAGE", new Iw()), this.register("DELETE_PAGE", new Aw()), this.register("DUPLICATE_PAGE", new Ow()), this.register("RESTORE_PAGE_REVISION", new Jw()), this.register("UPDATE_PAGE_METADATA", new t_()), this.register("GENERATE_SEO_FIELD", new Dw()), this.register("GENERATE_HTML_FROM_PROMPT", new Pw()), this.register("GET_REVISION_PAGE", new Gw()), this.register("UPDATE_PAGE", new e_()), this.register("GET_COMPARE_DATA", new Fw()), this.register("GET_SITE_WIDE_USAGE", new Bw()), this.register("GET_WEBSITE_DRAFT_SETTINGS", new Cu()), this.register("GET_WEBSITE_PAGES", new Pu()), this.register("GET_LIBRARIES", new xu()), this.register("GET_DRAFT_PAGE", new Ou()), this.register("GET_LANGUAGE_PAGES", new Ru()), this.register("UPSERT_LIBRARY_ITEM", new n_()), this.register("MARK_AS_TEMPLATE", new qw()), this.register("GET_LIBRARY_ITEM", new Uw()), this.register("GET_LIBRARY_ITEMS", new Zw()), this.register("DELETE_LIBRARY_ITEM", new Sw()), this.register("UNMARK_AS_TEMPLATE", new Xw()), this.register("GET_TEMPLATES_BY_TYPE", new Vw()), this.register("SEARCH_PAGES", new Ww()), this.register("GET_PAGE_REVISIONS", new jw()), this.register("PUBLISH_CHANGES", new Hw()), this.register("UPDATE_WEBSITE_FIELDS", new r_()), this.register("TAKE_OFFLINE", new Kw()), this.register("GET_CHANGES", new Mw()), this.register("GET_LIBRARY_GROUPS", new Lw()), this.register("DELETE_PAGE_REVISION", new Nw()), this.register("GET_COLLECTIONS", new Nu()), this.register("GET_BLOCK_ASYNC_PROPS", new $w()), this.register("GET_BUILDER_PAGE_DATA", new Au()), this.register("GET_PAGE_TYPES", new ku()), this.register("SEARCH_PAGE_TYPE_ITEMS", new Yw()), this.register("GET_DYNAMIC_PAGES", new zw()), this.register("GET_WEBSITE_DATA", new a_()), this.register("GET_PAGE_ALL_DATA", new o_());
|
|
15764
15698
|
}
|
|
15765
15699
|
/**
|
|
15766
15700
|
* Get the singleton instance of the registry
|
|
15767
15701
|
*/
|
|
15768
15702
|
static getInstance() {
|
|
15769
|
-
return
|
|
15703
|
+
return Ct.instance || (Ct.instance = new Ct()), Ct.instance;
|
|
15770
15704
|
}
|
|
15771
15705
|
/**
|
|
15772
15706
|
* Register a new action handler
|
|
@@ -15782,7 +15716,7 @@ const Dt = class Dt {
|
|
|
15782
15716
|
* Get an action handler by name
|
|
15783
15717
|
*/
|
|
15784
15718
|
getAction(t) {
|
|
15785
|
-
return
|
|
15719
|
+
return Dt(this.actions, t);
|
|
15786
15720
|
}
|
|
15787
15721
|
/**
|
|
15788
15722
|
* Get all registered actions
|
|
@@ -15791,8 +15725,8 @@ const Dt = class Dt {
|
|
|
15791
15725
|
return this.actions;
|
|
15792
15726
|
}
|
|
15793
15727
|
};
|
|
15794
|
-
Ae(
|
|
15795
|
-
let yn =
|
|
15728
|
+
Ae(Ct, "instance");
|
|
15729
|
+
let yn = Ct;
|
|
15796
15730
|
const Du = (e) => yn.getInstance().getAction(e), b_ = yn.getInstance();
|
|
15797
15731
|
export {
|
|
15798
15732
|
_ as A,
|