UNPKG

mongodb-chatbot-ui

Version:

UI React components for the MongoDB Assistant

935 lines (926 loc) 97.2 kB
import q, { forwardRef as mt, createContext as Wt } from "react"; import { w as y, F as f, m as j, P as Mt, Y as Bt, d as Ue, n as Ne, X as Vt, U as kt } from "./index2.js"; import { r as bt } from "./index4.js"; import { Q as Gt } from "./index7.js"; import { b as Jt, g as Kt } from "./utils.js"; import { jsx as Xt } from "react/jsx-runtime"; function o(e, r, t) { return (r = function(n) { var i = function(s, l) { if (typeof s != "object" || !s) return s; var d = s[Symbol.toPrimitive]; if (d !== void 0) { var p = d.call(s, l); if (typeof p != "object") return p; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(s); }(n, "string"); return typeof i == "symbol" ? i : i + ""; }(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } var pr, gr, g = { Disabled: "disabled", Placeholder: "placeholder", Primary: "primary", Secondary: "secondary", Tertiary: "tertiary", InversePrimary: "inversePrimary", InverseSecondary: "inverseSecondary", Info: "info", Warning: "warning", Error: "error", Success: "success", Link: "link", OnError: "onError", OnSuccess: "onSuccess", OnSuccessLink: "onSuccessLink" }, c = { Default: "default", Hover: "hover", Focus: "focus" }, De = f.black, P = f.blue, _ = f.gray, T = f.green, G = f.red, qt = f.white, se = f.yellow, Yt = { background: o(o(o(o(o(o(o(o({}, g.Primary, o(o(o({}, c.Default, De), c.Hover, _.dark2), c.Focus, P.dark3)), g.Secondary, o(o(o({}, c.Default, _.dark4), c.Hover, _.dark2), c.Focus, P.dark3)), g.InversePrimary, o(o(o({}, c.Default, _.light2), c.Hover, _.light3), c.Focus, P.light2)), g.Info, o(o(o({}, c.Default, P.dark3), c.Hover, P.dark3), c.Focus, P.dark3)), g.Warning, o(o(o({}, c.Default, se.dark3), c.Hover, se.dark3), c.Focus, se.dark3)), g.Success, o(o(o({}, c.Default, T.dark3), c.Hover, T.dark3), c.Focus, T.dark3)), g.Error, o(o(o({}, c.Default, G.dark3), c.Hover, G.dark3), c.Focus, G.dark3)), g.Disabled, o(o(o({}, c.Default, _.dark3), c.Hover, _.dark3), c.Focus, _.dark3)), border: o(o(o(o(o(o(o(o({}, g.Primary, o(o(o({}, c.Default, _.base), c.Hover, _.base), c.Focus, P.light1)), g.Secondary, o(o(o({}, c.Default, _.dark2), c.Hover, _.dark2), c.Focus, P.light1)), g.Tertiary, o(o(o({}, c.Default, _.dark1), c.Hover, _.dark1), c.Focus, P.light1)), g.Success, o(o(o({}, c.Default, T.dark1), c.Hover, T.dark1), c.Focus, P.light1)), g.Error, o(o(o({}, c.Default, G.light1), c.Hover, G.light1), c.Focus, P.light1)), g.OnSuccess, o(o(o({}, c.Default, T.dark2), c.Hover, T.dark2), c.Focus, P.light1)), g.OnError, o(o(o({}, c.Default, G.dark2), c.Hover, G.dark2), c.Focus, P.light1)), g.Disabled, o(o(o({}, c.Default, _.dark2), c.Hover, _.dark2), c.Focus, _.dark2)), icon: o(o(o(o(o(o(o(o({}, g.Primary, o(o(o({}, c.Default, _.light1), c.Hover, _.light3), c.Focus, P.light3)), g.Secondary, o(o(o({}, c.Default, _.base), c.Hover, _.light3), c.Focus, P.light3)), g.InversePrimary, o(o(o({}, c.Default, qt), c.Hover, De), c.Focus, P.dark2)), g.Info, o(o(o({}, c.Default, P.light1), c.Hover, P.light1), c.Focus, P.light1)), g.Warning, o(o(o({}, c.Default, se.base), c.Hover, se.base), c.Focus, se.base)), g.Success, o(o(o({}, c.Default, T.base), c.Hover, T.base), c.Focus, T.base)), g.Error, o(o(o({}, c.Default, G.light1), c.Hover, G.light1), c.Focus, G.light1)), g.Disabled, o(o(o({}, c.Default, _.dark1), c.Hover, _.dark1), c.Focus, _.dark1)), text: (o(o(o(o(o(o(o(o(o(o(pr = {}, g.Primary, o(o(o({}, c.Default, _.light2), c.Hover, _.light2), c.Focus, P.light3)), g.Placeholder, o(o(o({}, c.Default, _.dark1), c.Hover, _.dark1), c.Focus, _.dark1)), g.Secondary, o(o(o({}, c.Default, _.light1), c.Hover, _.light2), c.Focus, P.light3)), g.InversePrimary, o(o(o({}, c.Default, De), c.Hover, De), c.Focus, P.dark2)), g.InverseSecondary, o(o(o({}, c.Default, _.dark2), c.Hover, De), c.Focus, P.dark2)), g.Disabled, o(o(o({}, c.Default, _.dark1), c.Hover, _.dark1), c.Focus, _.dark1)), g.Success, o(o(o({}, c.Default, T.light2), c.Hover, T.light2), c.Focus, T.light2)), g.Error, o(o(o({}, c.Default, G.light1), c.Hover, G.light1), c.Focus, G.light1)), g.OnSuccess, o(o(o({}, c.Default, T.light1), c.Hover, T.light1), c.Focus, T.light1)), g.OnSuccessLink, o(o(o({}, c.Default, T.light3), c.Hover, T.light3), c.Focus, T.light3)), o(o(pr, g.OnError, o(o(o({}, c.Default, G.light2), c.Hover, G.light2), c.Focus, G.light2)), g.Link, o(o(o({}, c.Default, P.light1), c.Hover, P.light1), c.Focus, P.light1))) }, le = f.black, O = f.blue, $ = f.gray, L = f.green, W = f.red, de = f.white, fe = f.yellow, Qt = { background: o(o(o(o(o(o(o(o({}, g.Primary, o(o(o({}, c.Default, de), c.Hover, $.light2), c.Focus, O.light3)), g.Secondary, o(o(o({}, c.Default, $.light3), c.Hover, $.light2), c.Focus, O.light3)), g.InversePrimary, o(o(o({}, c.Default, le), c.Hover, $.dark3), c.Focus, O.dark2)), g.Info, o(o(o({}, c.Default, O.light3), c.Hover, O.light3), c.Focus, O.light3)), g.Warning, o(o(o({}, c.Default, fe.light3), c.Hover, fe.light3), c.Focus, fe.light3)), g.Success, o(o(o({}, c.Default, L.light3), c.Hover, L.light3), c.Focus, L.light3)), g.Error, o(o(o({}, c.Default, W.light3), c.Hover, W.light3), c.Focus, W.light3)), g.Disabled, o(o(o({}, c.Default, $.light2), c.Hover, $.light2), c.Focus, $.light2)), border: o(o(o(o(o(o(o(o({}, g.Primary, o(o(o({}, c.Default, $.base), c.Hover, $.base), c.Focus, O.light1)), g.Secondary, o(o(o({}, c.Default, $.light2), c.Hover, $.light2), c.Focus, O.light1)), g.Tertiary, o(o(o({}, c.Default, $.light1), c.Hover, $.light1), c.Focus, O.light1)), g.Success, o(o(o({}, c.Default, L.dark1), c.Hover, L.dark1), c.Focus, O.light1)), g.Error, o(o(o({}, c.Default, W.base), c.Hover, W.base), c.Focus, O.light1)), g.Disabled, o(o(o({}, c.Default, $.light1), c.Hover, $.light1), c.Focus, $.light1)), g.OnSuccess, o(o(o({}, c.Default, L.light2), c.Hover, L.light2), c.Focus, L.light2)), g.OnError, o(o(o({}, c.Default, W.light2), c.Hover, W.light2), c.Focus, W.light2)), icon: o(o(o(o(o(o(o(o({}, g.Primary, o(o(o({}, c.Default, $.dark1), c.Hover, le), c.Focus, O.dark1)), g.Secondary, o(o(o({}, c.Default, $.base), c.Hover, le), c.Focus, O.dark1)), g.InversePrimary, o(o(o({}, c.Default, de), c.Hover, de), c.Focus, O.light2)), g.Info, o(o(o({}, c.Default, O.base), c.Hover, O.base), c.Focus, O.base)), g.Warning, o(o(o({}, c.Default, fe.dark2), c.Hover, fe.dark2), c.Focus, fe.dark2)), g.Success, o(o(o({}, c.Default, L.dark1), c.Hover, L.dark1), c.Focus, L.dark1)), g.Error, o(o(o({}, c.Default, W.base), c.Hover, W.base), c.Focus, W.base)), g.Disabled, o(o(o({}, c.Default, $.base), c.Hover, $.base), c.Focus, $.base)), text: (o(o(o(o(o(o(o(o(o(o(gr = {}, g.Primary, o(o(o({}, c.Default, le), c.Hover, le), c.Focus, O.dark1)), g.Secondary, o(o(o({}, c.Default, $.dark1), c.Hover, le), c.Focus, O.dark1)), g.InversePrimary, o(o(o({}, c.Default, de), c.Hover, de), c.Focus, O.light2)), g.InverseSecondary, o(o(o({}, c.Default, $.light1), c.Hover, de), c.Focus, O.light2)), g.Disabled, o(o(o({}, c.Default, $.base), c.Hover, $.base), c.Focus, $.base)), g.Success, o(o(o({}, c.Default, L.dark2), c.Hover, L.dark2), c.Focus, L.dark2)), g.Error, o(o(o({}, c.Default, W.base), c.Hover, W.base), c.Focus, W.base)), g.Placeholder, o(o(o({}, c.Default, $.base), c.Hover, $.base), c.Focus, $.base)), g.OnSuccess, o(o(o({}, c.Default, L.dark2), c.Hover, L.dark2), c.Focus, L.dark2)), g.OnSuccessLink, o(o(o({}, c.Default, L.dark3), c.Hover, L.dark3), c.Focus, L.dark3)), o(o(gr, g.OnError, o(o(o({}, c.Default, W.dark2), c.Hover, W.dark2), c.Focus, W.dark2)), g.Link, o(o(o({}, c.Default, O.base), c.Hover, O.base), c.Focus, O.base))) }; o(o({}, y.Dark, Yt), y.Light, Qt); var Le = { Dark: "dark", Light: "light" }, yt = o(o({}, Le.Light, { default: "0 0 0 2px ".concat(f.white, ", 0 0 0 4px ").concat(f.blue.light1), input: "0 0 0 3px ".concat(f.blue.light1) }), Le.Dark, { default: "0 0 0 2px ".concat(f.black, ", 0 0 0 4px ").concat(f.blue.light1), input: "0 0 0 3px ".concat(f.blue.light1) }), en = { default: "'Euclid Circular A', 'Helvetica Neue', Helvetica, Arial, sans-serif", serif: "'MongoDB Value Serif', 'Times New Roman', serif", code: "'Source Code Pro', Menlo, monospace" }; o(o({}, Le.Light, { gray: "0 0 0 3px ".concat(f.gray.light2), green: "0 0 0 3px ".concat(f.green.light2), red: "0 0 0 3px ".concat(f.red.light2) }), Le.Dark, { gray: "0 0 0 3px ".concat(f.gray.dark2), green: "0 0 0 3px ".concat(f.green.dark3), red: "0 0 0 3px ".concat(f.yellow.dark3) }); var rn = f.black, he = f.gray, tn = f.white; o(o({}, g.Primary, o({}, c.Default, he.base)), g.Secondary, o({}, c.Default, he.dark1)), o(o({}, g.Primary, o({}, c.Default, rn)), g.Secondary, o({}, c.Default, he.dark4)), o(o({}, g.Primary, o({}, c.Default, he.base)), g.Secondary, o({}, c.Default, he.light1)), o(o({}, g.Primary, o({}, c.Default, tn)), g.Secondary, o({}, c.Default, he.light3)); var ae = o(o({}, y.Light, { 1: "color-mix(in srgb, ".concat(f.black, " 15%, transparent)"), 2: "color-mix(in srgb, ".concat(f.black, " 20%, transparent)"), 3: "color-mix(in srgb, ".concat(f.black, " 60%, transparent)"), overflow: "color-mix(in srgb, ".concat(f.gray.dark1, " 30%, transparent)") }), y.Dark, { 1: "transparent", 2: "color-mix(in srgb, #000000 45%, transparent)", 3: "color-mix(in srgb, #000000 60%, transparent)", overflow: "color-mix(in srgb, #000000 30%, transparent)" }), We = o(o({}, y.Light, { 1: "0px 2px 4px 1px ".concat(ae[y.Light][1]), 2: "0px 18px 18px -15px ".concat(ae[y.Light][2]), 3: "0px 8px 20px -8px ".concat(ae[y.Light][3]), overflow: "0px 2px 4px 1px ".concat(ae[y.Light].overflow) }), y.Dark, { 1: "unset", 2: "0 18px 18px -15px ".concat(ae[y.Dark][2]), 3: "0 8px 20px -8px ".concat(ae[y.Dark][3]), overflow: "0px 2px 4px 1px ".concat(ae[y.Dark].overflow) }); o(o({}, y.Light, 2), y.Dark, 16); var nn = { faster: 100, default: 150, slower: 300, slowest: 500 }, vr = { Body1: 13, Body2: 16 }, mr = { body1: { fontSize: vr.Body1, lineHeight: 20 }, body2: { fontSize: vr.Body2, lineHeight: 28 }, code1: { fontSize: 13, lineHeight: 20 }, code2: { fontSize: 15, lineHeight: 24 }, disclaimer: { fontSize: 12, lineHeight: 20 }, large: { fontSize: 18, lineHeight: 24 } }; function Ye(e, r, t) { return (r = function(n) { var i = function(s, l) { if (typeof s != "object" || !s) return s; var d = s[Symbol.toPrimitive]; if (d !== void 0) { var p = d.call(s, l); if (typeof p != "object") return p; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(s); }(n, "string"); return typeof i == "symbol" ? i : i + ""; }(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function Qe() { return Qe = Object.assign ? Object.assign.bind() : function(e) { for (var r = 1; r < arguments.length; r++) { var t = arguments[r]; for (var n in t) ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]); } return e; }, Qe.apply(null, arguments); } function Ze(e, r) { return r || (r = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(r) } })); } var kr, br, yr, _r, wr, Dr = { None: "none", Clickable: "clickable" }, Ke = We[y.Light][1], on = We[y.Light][2], Xe = We[y.Dark][1], an = We[y.Dark][2], $r = yt.light.default, zr = yt.dark.default, Zr = Ye(Ye({}, y.Light, { containerStyle: j(kr || (kr = Ze([` border: 1px solid `, `; box-shadow: `, `; background-color: `, `; color: `, `; `])), f.gray.light2, Ke, f.white, f.gray.dark3), clickableStyle: j(br || (br = Ze([` cursor: pointer; &:focus { outline: none; box-shadow: `, ", ", `; } &:hover, &:active { border: 1px solid `, `; box-shadow: `, `; &:focus { box-shadow: `, ", ", `; } } `])), $r, Ke, f.gray.light2, on, $r, Ke) }), y.Dark, { containerStyle: j(yr || (yr = Ze([` border: 1px solid `, `; box-shadow: `, `; background-color: `, `; color: `, `; `])), f.gray.dark2, Xe, f.black, f.white), clickableStyle: j(_r || (_r = Ze([` cursor: pointer; &:focus { outline: none; box-shadow: `, ", ", `; } &:hover { box-shadow: `, `; &:focus { box-shadow: `, ", ", `; } } `])), Xe, zr, an, Xe, zr) }), cn = j(wr || (wr = Ze([` position: relative; transition: `, `ms ease-in-out; transition-property: border, box-shadow; border-radius: 24px; font-family: `, `; font-size: `, `px; line-height: `, `px; padding: 24px; min-height: 68px; // 48px + 20px (padding + line-height) `])), nn.default, en.default, mr.body1.fontSize, mr.body1.lineHeight), un = ["as", "className", "contentStyle", "darkMode"], _t = Mt(function(e, r) { var t = e.as, n = t === void 0 ? "div" : t, i = e.className, s = e.contentStyle, l = e.darkMode, d = function(b, Z) { if (b == null) return {}; var F, D, N = function(re, Je) { if (re == null) return {}; var Oe = {}; for (var K in re) if ({}.hasOwnProperty.call(re, K)) { if (Je.indexOf(K) !== -1) continue; Oe[K] = re[K]; } return Oe; }(b, Z); if (Object.getOwnPropertySymbols) { var ee = Object.getOwnPropertySymbols(b); for (D = 0; D < ee.length; D++) F = ee[D], Z.indexOf(F) === -1 && {}.propertyIsEnumerable.call(b, F) && (N[F] = b[F]); } return N; }(e, un), p = Bt(n, d, "div").Component; s === void 0 && ("onClick" in d && d.onClick !== void 0 || "href" in d && d.href) && (s = Dr.Clickable); var m = Ue(l).theme; return q.createElement(p, Qe({ ref: r, className: Ne(cn, Zr[m].containerStyle, Ye({}, Zr[m].clickableStyle, s === Dr.Clickable), i) }, d)); }); _t.displayName = "Card"; function a(e, r, t) { return (r = function(n) { var i = function(s, l) { if (typeof s != "object" || !s) return s; var d = s[Symbol.toPrimitive]; if (d !== void 0) { var p = d.call(s, l); if (typeof p != "object") return p; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(s); }(n, "string"); return typeof i == "symbol" ? i : i + ""; }(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } var Pr, Sr, v = { Disabled: "disabled", Placeholder: "placeholder", Primary: "primary", Secondary: "secondary", Tertiary: "tertiary", InversePrimary: "inversePrimary", InverseSecondary: "inverseSecondary", Info: "info", Warning: "warning", Error: "error", Success: "success", Link: "link", OnError: "onError", OnSuccess: "onSuccess", OnSuccessLink: "onSuccessLink" }, u = { Default: "default", Hover: "hover", Focus: "focus" }, $e = f.black, S = f.blue, w = f.gray, A = f.green, J = f.red, sn = f.white, pe = f.yellow, ln = { background: a(a(a(a(a(a(a(a({}, v.Primary, a(a(a({}, u.Default, $e), u.Hover, w.dark2), u.Focus, S.dark3)), v.Secondary, a(a(a({}, u.Default, w.dark4), u.Hover, w.dark2), u.Focus, S.dark3)), v.InversePrimary, a(a(a({}, u.Default, w.light2), u.Hover, w.light3), u.Focus, S.light2)), v.Info, a(a(a({}, u.Default, S.dark3), u.Hover, S.dark3), u.Focus, S.dark3)), v.Warning, a(a(a({}, u.Default, pe.dark3), u.Hover, pe.dark3), u.Focus, pe.dark3)), v.Success, a(a(a({}, u.Default, A.dark3), u.Hover, A.dark3), u.Focus, A.dark3)), v.Error, a(a(a({}, u.Default, J.dark3), u.Hover, J.dark3), u.Focus, J.dark3)), v.Disabled, a(a(a({}, u.Default, w.dark3), u.Hover, w.dark3), u.Focus, w.dark3)), border: a(a(a(a(a(a(a(a({}, v.Primary, a(a(a({}, u.Default, w.base), u.Hover, w.base), u.Focus, S.light1)), v.Secondary, a(a(a({}, u.Default, w.dark2), u.Hover, w.dark2), u.Focus, S.light1)), v.Tertiary, a(a(a({}, u.Default, w.dark1), u.Hover, w.dark1), u.Focus, S.light1)), v.Success, a(a(a({}, u.Default, A.dark1), u.Hover, A.dark1), u.Focus, S.light1)), v.Error, a(a(a({}, u.Default, J.light1), u.Hover, J.light1), u.Focus, S.light1)), v.OnSuccess, a(a(a({}, u.Default, A.dark2), u.Hover, A.dark2), u.Focus, S.light1)), v.OnError, a(a(a({}, u.Default, J.dark2), u.Hover, J.dark2), u.Focus, S.light1)), v.Disabled, a(a(a({}, u.Default, w.dark2), u.Hover, w.dark2), u.Focus, w.dark2)), icon: a(a(a(a(a(a(a(a({}, v.Primary, a(a(a({}, u.Default, w.light1), u.Hover, w.light3), u.Focus, S.light3)), v.Secondary, a(a(a({}, u.Default, w.base), u.Hover, w.light3), u.Focus, S.light3)), v.InversePrimary, a(a(a({}, u.Default, sn), u.Hover, $e), u.Focus, S.dark2)), v.Info, a(a(a({}, u.Default, S.light1), u.Hover, S.light1), u.Focus, S.light1)), v.Warning, a(a(a({}, u.Default, pe.base), u.Hover, pe.base), u.Focus, pe.base)), v.Success, a(a(a({}, u.Default, A.base), u.Hover, A.base), u.Focus, A.base)), v.Error, a(a(a({}, u.Default, J.light1), u.Hover, J.light1), u.Focus, J.light1)), v.Disabled, a(a(a({}, u.Default, w.dark1), u.Hover, w.dark1), u.Focus, w.dark1)), text: (a(a(a(a(a(a(a(a(a(a(Pr = {}, v.Primary, a(a(a({}, u.Default, w.light2), u.Hover, w.light2), u.Focus, S.light3)), v.Placeholder, a(a(a({}, u.Default, w.dark1), u.Hover, w.dark1), u.Focus, w.dark1)), v.Secondary, a(a(a({}, u.Default, w.light1), u.Hover, w.light2), u.Focus, S.light3)), v.InversePrimary, a(a(a({}, u.Default, $e), u.Hover, $e), u.Focus, S.dark2)), v.InverseSecondary, a(a(a({}, u.Default, w.dark2), u.Hover, $e), u.Focus, S.dark2)), v.Disabled, a(a(a({}, u.Default, w.dark1), u.Hover, w.dark1), u.Focus, w.dark1)), v.Success, a(a(a({}, u.Default, A.light2), u.Hover, A.light2), u.Focus, A.light2)), v.Error, a(a(a({}, u.Default, J.light1), u.Hover, J.light1), u.Focus, J.light1)), v.OnSuccess, a(a(a({}, u.Default, A.light1), u.Hover, A.light1), u.Focus, A.light1)), v.OnSuccessLink, a(a(a({}, u.Default, A.light3), u.Hover, A.light3), u.Focus, A.light3)), a(a(Pr, v.OnError, a(a(a({}, u.Default, J.light2), u.Hover, J.light2), u.Focus, J.light2)), v.Link, a(a(a({}, u.Default, S.light1), u.Hover, S.light1), u.Focus, S.light1))) }, ge = f.black, E = f.blue, z = f.gray, C = f.green, M = f.red, ve = f.white, me = f.yellow, dn = { background: a(a(a(a(a(a(a(a({}, v.Primary, a(a(a({}, u.Default, ve), u.Hover, z.light2), u.Focus, E.light3)), v.Secondary, a(a(a({}, u.Default, z.light3), u.Hover, z.light2), u.Focus, E.light3)), v.InversePrimary, a(a(a({}, u.Default, ge), u.Hover, z.dark3), u.Focus, E.dark2)), v.Info, a(a(a({}, u.Default, E.light3), u.Hover, E.light3), u.Focus, E.light3)), v.Warning, a(a(a({}, u.Default, me.light3), u.Hover, me.light3), u.Focus, me.light3)), v.Success, a(a(a({}, u.Default, C.light3), u.Hover, C.light3), u.Focus, C.light3)), v.Error, a(a(a({}, u.Default, M.light3), u.Hover, M.light3), u.Focus, M.light3)), v.Disabled, a(a(a({}, u.Default, z.light2), u.Hover, z.light2), u.Focus, z.light2)), border: a(a(a(a(a(a(a(a({}, v.Primary, a(a(a({}, u.Default, z.base), u.Hover, z.base), u.Focus, E.light1)), v.Secondary, a(a(a({}, u.Default, z.light2), u.Hover, z.light2), u.Focus, E.light1)), v.Tertiary, a(a(a({}, u.Default, z.light1), u.Hover, z.light1), u.Focus, E.light1)), v.Success, a(a(a({}, u.Default, C.dark1), u.Hover, C.dark1), u.Focus, E.light1)), v.Error, a(a(a({}, u.Default, M.base), u.Hover, M.base), u.Focus, E.light1)), v.Disabled, a(a(a({}, u.Default, z.light1), u.Hover, z.light1), u.Focus, z.light1)), v.OnSuccess, a(a(a({}, u.Default, C.light2), u.Hover, C.light2), u.Focus, C.light2)), v.OnError, a(a(a({}, u.Default, M.light2), u.Hover, M.light2), u.Focus, M.light2)), icon: a(a(a(a(a(a(a(a({}, v.Primary, a(a(a({}, u.Default, z.dark1), u.Hover, ge), u.Focus, E.dark1)), v.Secondary, a(a(a({}, u.Default, z.base), u.Hover, ge), u.Focus, E.dark1)), v.InversePrimary, a(a(a({}, u.Default, ve), u.Hover, ve), u.Focus, E.light2)), v.Info, a(a(a({}, u.Default, E.base), u.Hover, E.base), u.Focus, E.base)), v.Warning, a(a(a({}, u.Default, me.dark2), u.Hover, me.dark2), u.Focus, me.dark2)), v.Success, a(a(a({}, u.Default, C.dark1), u.Hover, C.dark1), u.Focus, C.dark1)), v.Error, a(a(a({}, u.Default, M.base), u.Hover, M.base), u.Focus, M.base)), v.Disabled, a(a(a({}, u.Default, z.base), u.Hover, z.base), u.Focus, z.base)), text: (a(a(a(a(a(a(a(a(a(a(Sr = {}, v.Primary, a(a(a({}, u.Default, ge), u.Hover, ge), u.Focus, E.dark1)), v.Secondary, a(a(a({}, u.Default, z.dark1), u.Hover, ge), u.Focus, E.dark1)), v.InversePrimary, a(a(a({}, u.Default, ve), u.Hover, ve), u.Focus, E.light2)), v.InverseSecondary, a(a(a({}, u.Default, z.light1), u.Hover, ve), u.Focus, E.light2)), v.Disabled, a(a(a({}, u.Default, z.base), u.Hover, z.base), u.Focus, z.base)), v.Success, a(a(a({}, u.Default, C.dark2), u.Hover, C.dark2), u.Focus, C.dark2)), v.Error, a(a(a({}, u.Default, M.base), u.Hover, M.base), u.Focus, M.base)), v.Placeholder, a(a(a({}, u.Default, z.base), u.Hover, z.base), u.Focus, z.base)), v.OnSuccess, a(a(a({}, u.Default, C.dark2), u.Hover, C.dark2), u.Focus, C.dark2)), v.OnSuccessLink, a(a(a({}, u.Default, C.dark3), u.Hover, C.dark3), u.Focus, C.dark3)), a(a(Sr, v.OnError, a(a(a({}, u.Default, M.dark2), u.Hover, M.dark2), u.Focus, M.dark2)), v.Link, a(a(a({}, u.Default, E.base), u.Hover, E.base), u.Focus, E.base))) }; a(a({}, y.Dark, ln), y.Light, dn); var Ce = { Dark: "dark", Light: "light" }; a(a({}, Ce.Light, { default: "0 0 0 2px ".concat(f.white, ", 0 0 0 4px ").concat(f.blue.light1), input: "0 0 0 3px ".concat(f.blue.light1) }), Ce.Dark, { default: "0 0 0 2px ".concat(f.black, ", 0 0 0 4px ").concat(f.blue.light1), input: "0 0 0 3px ".concat(f.blue.light1) }); a(a({}, Ce.Light, { gray: "0 0 0 3px ".concat(f.gray.light2), green: "0 0 0 3px ".concat(f.green.light2), red: "0 0 0 3px ".concat(f.red.light2) }), Ce.Dark, { gray: "0 0 0 3px ".concat(f.gray.dark2), green: "0 0 0 3px ".concat(f.green.dark3), red: "0 0 0 3px ".concat(f.yellow.dark3) }); var fn = f.black, ke = f.gray, hn = f.white; a(a({}, v.Primary, a({}, u.Default, ke.base)), v.Secondary, a({}, u.Default, ke.dark1)), a(a({}, v.Primary, a({}, u.Default, fn)), v.Secondary, a({}, u.Default, ke.dark4)), a(a({}, v.Primary, a({}, u.Default, ke.base)), v.Secondary, a({}, u.Default, ke.light1)), a(a({}, v.Primary, a({}, u.Default, hn)), v.Secondary, a({}, u.Default, ke.light3)); var ie = a(a({}, y.Light, { 1: "color-mix(in srgb, ".concat(f.black, " 15%, transparent)"), 2: "color-mix(in srgb, ".concat(f.black, " 20%, transparent)"), 3: "color-mix(in srgb, ".concat(f.black, " 60%, transparent)"), overflow: "color-mix(in srgb, ".concat(f.gray.dark1, " 30%, transparent)") }), y.Dark, { 1: "transparent", 2: "color-mix(in srgb, #000000 45%, transparent)", 3: "color-mix(in srgb, #000000 60%, transparent)", overflow: "color-mix(in srgb, #000000 30%, transparent)" }); a(a({}, y.Light, { 1: "0px 2px 4px 1px ".concat(ie[y.Light][1]), 2: "0px 18px 18px -15px ".concat(ie[y.Light][2]), 3: "0px 8px 20px -8px ".concat(ie[y.Light][3]), overflow: "0px 2px 4px 1px ".concat(ie[y.Light].overflow) }), y.Dark, { 1: "unset", 2: "0 18px 18px -15px ".concat(ie[y.Dark][2]), 3: "0 8px 20px -8px ".concat(ie[y.Dark][3]), overflow: "0px 2px 4px 1px ".concat(ie[y.Dark].overflow) }); a(a({}, y.Light, 2), y.Dark, 16); var te = { 0: 0, 25: 1, 50: 2, 100: 4, 150: 6, 200: 8, 300: 12, 400: 16, 500: 20, 600: 24, 800: 32, 900: 36, 1e3: 40, 1200: 48, 1400: 56, 1600: 64, 1800: 72, 1: 4, 2: 8, 3: 16, 4: 24, 5: 32, 6: 64, 7: 88 }; function B(e, r, t) { return (r = function(n) { var i = function(s, l) { if (typeof s != "object" || !s) return s; var d = s[Symbol.toPrimitive]; if (d !== void 0) { var p = d.call(s, l); if (typeof p != "object") return p; throw new TypeError("@@toPrimitive must return a primitive value."); } return String(s); }(n, "string"); return typeof i == "symbol" ? i : i + ""; }(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function Pe() { return Pe = Object.assign ? Object.assign.bind() : function(e) { for (var r = 1; r < arguments.length; r++) { var t = arguments[r]; for (var n in t) ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]); } return e; }, Pe.apply(null, arguments); } function xr(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); r && (n = n.filter(function(i) { return Object.getOwnPropertyDescriptor(e, i).enumerable; })), t.push.apply(t, n); } return t; } function qe(e) { for (var r = 1; r < arguments.length; r++) { var t = arguments[r] != null ? arguments[r] : {}; r % 2 ? xr(Object(t), !0).forEach(function(n) { B(e, n, t[n]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : xr(Object(t)).forEach(function(n) { Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n)); }); } return e; } function er(e, r) { if (e == null) return {}; var t, n, i = function(l, d) { if (l == null) return {}; var p = {}; for (var m in l) if ({}.hasOwnProperty.call(l, m)) { if (d.indexOf(m) !== -1) continue; p[m] = l[m]; } return p; }(e, r); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (n = 0; n < s.length; n++) t = s[n], r.indexOf(t) === -1 && {}.propertyIsEnumerable.call(e, t) && (i[t] = e[t]); } return i; } function V(e, r) { return r || (r = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(r) } })); } var Fr, Or, Er, Hr, Ir, jr, Lr, Cr, Tr, Ar, Rr, Ur, Nr, Wr, Mr, Br, wt = Vt("lg-chat-rich-link"), pn = j(Fr || (Fr = V([` box-shadow: none; padding: `, "px ", `px; border-radius: `, `px; text-decoration: none; min-height: initial; max-width: 100%; display: flex; align-items: center; gap: `, `px; & .`, ` { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } `])), te[100], te[200], te[200], te[200], wt), gn = B(B({}, y.Dark, j(Or || (Or = V([` background-color: `, `; &:hover { box-shadow: 0 0 0 3px `, `; } `])), f.gray.dark4, f.gray.dark2)), y.Light, j(Er || (Er = V([` background-color: `, `; &:hover { box-shadow: 0 0 0 3px `, `; } `])), f.gray.light3, f.gray.light2)), Vr = "gray", Gr = "blue", Jr = "green", Kr = "purple", Xr = "red", qr = "yellow", vn = j(Hr || (Hr = V([` display: inline-flex; gap: `, `px; align-items: center; border-radius: `, `px; padding: 0 `, `px; `])), te[50], te[100], te[100]), mn = B(B({}, y.Dark, B(B(B(B(B(B({}, Vr, j(Ir || (Ir = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.gray.dark2, f.gray.light1, f.gray.light2)), Gr, j(jr || (jr = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.blue.dark3, f.blue.light2, f.blue.light2)), Jr, j(Lr || (Lr = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.green.dark3, f.green.light2, f.green.light2)), Xr, j(Cr || (Cr = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.red.dark3, f.red.light2, f.red.light2)), Kr, j(Tr || (Tr = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.purple.dark3, f.purple.light2, f.purple.light2)), qr, j(Ar || (Ar = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.yellow.dark3, f.yellow.light2, f.yellow.light2))), y.Light, B(B(B(B(B(B({}, Vr, j(Rr || (Rr = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.gray.light2, f.gray.dark1, f.black)), Gr, j(Ur || (Ur = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.blue.light3, f.blue.dark2, f.blue.dark3)), Jr, j(Nr || (Nr = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.green.light3, f.green.dark2, f.green.dark3)), Xr, j(Wr || (Wr = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.red.light3, f.red.dark2, f.red.dark3)), Kr, j(Mr || (Mr = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.purple.light3, f.purple.dark2, f.purple.dark3)), qr, j(Br || (Br = V([` background-color: `, `; & svg { color: `, `; } & p { color: `, `; } `])), f.yellow.light3, f.yellow.dark2, f.yellow.dark3))), kn = function(e) { var r = e.darkMode, t = e.glyph, n = e.color, i = n === void 0 ? "gray" : n, s = e.label, l = Ue(r).theme; return q.createElement("div", { className: Ne(vn, mn[l][i]) }, t ? q.createElement(Gt, { glyph: t }) : null, q.createElement(bt, null, s)); }, Dt = { Article: { badgeColor: "green", badgeLabel: "Article", badgeGlyph: "Note" }, Blog: { badgeColor: "green", badgeLabel: "Blog", badgeGlyph: "SMS" }, Book: { badgeColor: "yellow", badgeLabel: "Book", badgeGlyph: "University" }, Code: { badgeColor: "gray", badgeLabel: "Code", badgeGlyph: "CodeBlock" }, Docs: { badgeColor: "blue", badgeLabel: "Docs", badgeGlyph: "Note" }, Learn: { badgeColor: "red", badgeLabel: "Learn", badgeGlyph: "Cap" }, Video: { badgeColor: "red", badgeLabel: "Video", badgeGlyph: "Play" }, Website: { badgeColor: "purple", badgeLabel: "Website", badgeGlyph: "Laptop" } }, bn = Object.keys(Dt); function yn(e) { return bn.includes(e); } var Yr, _n = ["darkMode", "onLinkClick"], wn = ["children", "badgeGlyph", "badgeLabel", "badgeColor", "href"], $t = mt(function(e, r) { var t = e.darkMode, n = e.onLinkClick, i = er(e, _n), s = Ue(t), l = s.darkMode, d = s.theme, p = qe(qe({ badgeGlyph: void 0, badgeLabel: void 0, badgeColor: void 0 }, "variant" in i && i.variant !== void 0 ? Dt[i.variant] : {}), i), m = p.children, b = p.badgeGlyph, Z = p.badgeLabel, F = p.badgeColor, D = p.href, N = er(p, wn), ee = Z !== void 0, re = D ? qe({ as: "a", href: D, ref: r, target: "_blank" }, N) : {}; return q.createElement(kt, { darkMode: l }, q.createElement(_t, Pe({ className: Ne(pn, gn[d]), title: m }, re, { onClick: function() { return n == null ? void 0 : n(i); } }), q.createElement(bt, { as: "span", className: wt }, m), ee ? q.createElement(kn, { color: F, label: Z, glyph: b }) : null)); }); $t.displayName = "RichLink"; var Dn = j(Yr || (Yr = V([` display: flex; flex-wrap: wrap; gap: `, "px ", `px; `])), te[200], te[300]), $n = function(e) { return Ne(Dn, e); }, zn = ["className", "darkMode", "links", "onLinkClick"], Zn = mt(function(e, r) { var t = e.className, n = e.darkMode, i = e.links, s = e.onLinkClick, l = er(e, zn), d = Ue(n).darkMode; return q.createElement(kt, { darkMode: d }, q.createElement("div", Pe({ className: $n(t), ref: r }, l), i.map(function(p) { return q.createElement($t, Pe({ key: p.href, onClick: function() { return s == null ? void 0 : s(p); } }, p)); }))); }); Zn.displayName = "RichLinksArea"; function h(e, r, t) { function n(d, p) { var m; Object.defineProperty(d, "_zod", { value: d._zod ?? {}, enumerable: !1 }), (m = d._zod).traits ?? (m.traits = /* @__PURE__ */ new Set()), d._zod.traits.add(e), r(d, p); for (const b in l.prototype) b in d || Object.defineProperty(d, b, { value: l.prototype[b].bind(d) }); d._zod.constr = l, d._zod.def = p; } const i = (t == null ? void 0 : t.Parent) ?? Object; class s extends i { } Object.defineProperty(s, "name", { value: e }); function l(d) { var p; const m = t != null && t.Parent ? new s() : this; n(m, d), (p = m._zod).deferred ?? (p.deferred = []); for (const b of m._zod.deferred) b(); return m; } return Object.defineProperty(l, "init", { value: n }), Object.defineProperty(l, Symbol.hasInstance, { value: (d) => { var p, m; return t != null && t.Parent && d instanceof t.Parent ? !0 : (m = (p = d == null ? void 0 : d._zod) == null ? void 0 : p.traits) == null ? void 0 : m.has(e); } }), Object.defineProperty(l, "name", { value: e }), l; } class ye extends Error { constructor() { super("Encountered Promise during synchronous parse. Use .parseAsync() instead."); } } class zt extends Error { constructor(r) { super(`Encountered unidirectional transform during encode: ${r}`), this.name = "ZodEncodeError"; } } const rr = {}; function ce(e) { return e && Object.assign(rr, e), rr; } function Pn(e) { const r = Object.values(e).filter((n) => typeof n == "number"); return Object.entries(e).filter(([n, i]) => r.indexOf(+n) === -1).map(([n, i]) => i); } function tr(e, r) { return typeof r == "bigint" ? r.toString() : r; } function ir(e) { return { get value() { { const r = e(); return Object.defineProperty(this, "value", { value: r }), r; } } }; } function cr(e) { return e == null; } function ur(e) { const r = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length; return e.slice(r, t); } const Qr = Symbol("evaluating"); function x(e, r, t) { let n; Object.defineProperty(e, r, { get() { if (n !== Qr) return n === void 0 && (n = Qr, n = t()), n; }, set(i) { Object.defineProperty(e, r, { value: i // configurable: true, }); }, configurable: !0 }); } function Sn(e) { return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e)); } function ne(e, r, t) { Object.defineProperty(e, r, { value: t, writable: !0, enumerable: !0, configurable: !0 }); } function _e(...e) { const r = {}; for (const t of e) { const n = Object.getOwnPropertyDescriptors(t); Object.assign(r, n); } return Object.defineProperties({}, r); } function et(e) { return JSON.stringify(e); } const Zt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => { }; function Te(e) { return typeof e == "object" && e !== null && !Array.isArray(e); } const xn = ir(() => { var e; if (typeof navigator < "u" && ((e = navigator == null ? void 0 : navigator.userAgent) != null && e.includes("Cloudflare"))) return !1; try { const r = Function; return new r(""), !0; } catch { return !1; } }); function Se(e) { if (Te(e) === !1) return !1; const r = e.constructor; if (r === void 0) return !0; const t = r.prototype; return !(Te(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1); } function Pt(e) { return Se(e) ? { ...e } : e; } const Fn = /* @__PURE__ */ new Set(["string", "number", "symbol"]); function Me(e) { return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); } function oe(e, r, t) { const n = new e._zod.constr(r ?? e._zod.def); return (!r || t != null && t.parent) && (n._zod.parent = e), n; } function k(e) { const r = e; if (!r) return {}; if (typeof r == "string") return { error: () => r }; if ((r == null ? void 0 : r.message) !== void 0) { if ((r == null ? void 0 : r.error) !== void 0) throw new Error("Cannot specify both `message` and `error` params"); r.error = r.message; } return delete r.message, typeof r.error == "string" ? { ...r, error: () => r.error } : r; } function On(e) { return Object.keys(e).filter((r) => e[r]._zod.optin === "optional" && e[r]._zod.optout === "optional"); } function En(e, r) { const t = e._zod.def, n = _e(e._zod.def, { get shape() { const i = {}; for (const s in r) { if (!(s in t.shape)) throw new Error(`Unrecognized key: "${s}"`); r[s] && (i[s] = t.shape[s]); } return ne(this, "shape", i), i; }, checks: [] }); return oe(e, n); } function Hn(e, r) { const t = e._zod.def, n = _e(e._zod.def, { get shape() { const i = { ...e._zod.def.shape }; for (const s in r) { if (!(s in t.shape)) throw new Error(`Unrecognized key: "${s}"`); r[s] && delete i[s]; } return ne(this, "shape", i), i; }, checks: [] }); return oe(e, n); } function In(e, r) { if (!Se(r)) throw new Error("Invalid input to extend: expected a plain object"); const t = e._zod.def.checks; if (t && t.length > 0) throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead."); const i = _e(e._zod.def, { get shape() { const s = { ...e._zod.def.shape, ...r }; return ne(this, "shape", s), s; }, checks: [] }); return oe(e, i); } function jn(e, r) { if (!Se(r)) throw new Error("Invalid input to safeExtend: expected a plain object"); const t = { ...e._zod.def, get shape() { const n = { ...e._zod.def.shape, ...r }; return ne(this, "shape", n), n; }, checks: e._zod.def.checks }; return oe(e, t); } function Ln(e, r) { const t = _e(e._zod.def, { get shape() { const n = { ...e._zod.def.shape, ...r._zod.def.shape }; return ne(this, "shape", n), n; }, get catchall() { return r._zod.def.catchall; }, checks: [] // delete existing checks }); return oe(e, t); } function Cn(e, r, t) { const n = _e(r._zod.def, { get shape() { const i = r._zod.def.shape, s = { ...i }; if (t) for (const l in t) { if (!(l in i)) throw new Error(`Unrecognized key: "${l}"`); t[l] && (s[l] = e ? new e({ type: "optional", innerType: i[l] }) : i[l]); } else for (const l in i) s[l] = e ? new e({ type: "optional", innerType: i[l] }) : i[l]; return ne(this, "shape", s), s; }, checks: [] }); return oe(r, n); } function Tn(e, r, t) { const n = _e(r._zod.def, { get shape() { const i = r._zod.def.shape, s = { ...i }; if (t) for (const l in t) { if (!(l in s)) throw new Error(`Unrecognized key: "${l}"`); t[l] && (s[l] = new e({ type: "nonoptional", innerType: i[l] })); } else for (const l in i) s[l] = new e({ type: "nonoptional", innerType: i[l] }); return ne(this, "shape", s), s; }, checks: [] }); return oe(r, n); } function be(e, r = 0) { var t; if (e.aborted === !0) return !0; for (let n = r; n < e.issues.length; n++) if (((t = e.issues[n]) == null ? void 0 : t.continue) !== !0) return !0; return !1; } function St(e, r) { return r.map((t) => { var n; return (n = t).path ?? (n.path = []), t.path.unshift(e), t; }); } function Ee(e) { return typeof e == "string" ? e : e == null ? void 0 : e.message; } function ue(e, r, t) { var i, s, l, d, p, m; const n = { ...e, path: e.path ?? [] }; if (!e.message) { const b = Ee((l = (s = (i = e.inst) == null ? void 0 : i._zod.def) == null ? void 0 : s.error) == null ? void 0 : l.call(s, e)) ?? Ee((d = r == null ? void 0 : r.error) == null ? void 0 : d.call(r, e)) ?? Ee((p = t.customError) == null ? void 0 : p.call(t, e)) ?? Ee((m = t.localeError) == null ? void 0 : m.call(t, e)) ?? "Invalid input"; n.message = b; } return delete n.inst, delete n.continue, r != null && r.reportInput || delete n.input, n; } function sr(e) { return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown"; } function xe(...e) { const [r, t, n] = e; return typeof r == "string" ? { message: r, code: "custom", input: t, inst: n } : { ...r }; } const xt = (e, r) => { e.name = "$ZodError", Object.defineProperty(e, "_zod", { value: e._zod, enumerable: !1 }), Object.defineProperty(e, "issues", { value: r, enumerable: !1 }), e.message = JSON.stringify(r, tr, 2), Object.defineProperty(e, "toString", { value: () => e.message, enumerable: !1 }); }, Ft = h("$ZodError", xt), Ot = h("$ZodError", xt, { Parent: Error }); function An(e, r = (t) => t.message) { const t = {}, n = []; for (const i of e.issues) i.path.length > 0 ? (t[i.path[0]] = t[i.path[0]] || [], t[i.path[0]].push(r(i))) : n.push(r(i)); return { formErrors: n, fieldErrors: t }; } function Rn(e, r) { const t = r || function(s) { return s.message; }, n = { _errors: [] }, i = (s) => { for (const l of s.issues) if (l.code === "invalid_union" && l.errors.length) l.errors.map((d) => i({ issues: d })); else if (l.code === "invalid_key") i({ issues: l.issues }); else if (l.code === "invalid_element") i({ issues: l.issues }); else if (l.path.length === 0) n._errors.push(t(l)); else { let d = n, p = 0; for (; p < l.path.length; ) { const m = l.path[p]; p === l.path.length - 1 ? (d[m] = d[m] || { _errors: [] }, d[m]._errors.push(t(l))) : d[m] = d[m] || { _errors: [] }, d = d[m], p++; } } }; return i(e), n; } const lr = (e) => (r, t, n, i) => { const s = n ? Object.assign(n, { async: !1 }) : { async: !1 }, l = r._zod.run({ value: t, issues: [] }, s); if (l instanceof Promise) throw new ye(); if (l.issues.length) { const d = new ((i == null ? void 0 : i.Err) ?? e)(l.issues.map((p) => ue(p, s, ce()))); throw Zt(d, i == null ? void 0 : i.callee), d; } return l.value; }, dr = (e) => async (r, t, n, i) => { const s = n ? Object.assign(n, { async: !0 }) : { async: !0 }; let l = r._zod.run({ value: t, issues: [] }, s); if (l instanceof Promise && (l = await l), l.issues.length) { const d = new ((i == null ? void 0 : i.Err) ?? e)(l.issues.map((p) => ue(p, s, ce()))); throw Zt(d, i == null ? void 0 : i.callee), d; } return l.value; }, Be = (e) => (r, t, n) => { const i = n ? { ...n, async: !1 } : { async: !1 }, s = r._zod.run({ value: t, issues: [] }, i); if (s instanceof Promise) throw new ye(); return s.issues.length ? { success: !1, error: new (e ?? Ft)(s.issues.map((l) => ue(l, i, ce()))) } : { success: !0, data: s.value }; }, Un = /* @__PURE__ */ Be(Ot), Ve = (e) => async (r, t, n) => { const i = n ? Object.assign(n, { async: !0 }) : { async: !0 }; let s = r._zod.run({ value: t, issues: [] }, i); return s instanceof Promise && (s = await s), s.issues.length ? { success: !1, error: new e(s.issues.map((l) => ue(l, i, ce()))) } : { success: !0, data: s.value }; }, Nn = /* @__PURE__ */ Ve(Ot), Wn = (e) => (r, t, n) => { const i = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" }; return lr(e)(r, t, i); }, Mn = (e) => (r, t, n) => lr(e)(r, t, n), Bn = (e) => async (r, t, n) => { const i = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" }; return dr(e)(r, t, i); }, Vn = (e) => async (r, t, n) => dr(e)(r, t, n), Gn = (e) => (r, t, n) => { const i = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" }; return Be(e)(r, t, i); }, Jn = (e) => (r, t, n) => Be(e)(r, t, n), Kn = (e) => async (r, t, n) => { const i = n ? Object.assign(n, { direction: "backward" }) : { direction: "backward" }; return Ve(e)(r, t, i); }, Xn = (e) => async (r, t, n) => Ve(e)(r, t, n), qn = /^[cC][^\s-]{8,}$/, Yn = /^[0-9a-z]+$/, Qn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, eo = /^[0-9a-vA-V]{20}$/, ro = /^[A-Za-z0-9]{27}$/, to = /^[a-zA-Z0-9_-]{21}$/, no = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, oo = /^([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})$/, rt = (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)$/, ao = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, io = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$"; function co() { return new RegExp(io, "u"); } const uo = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, so = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, lo = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, fo = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, ho = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Et = /^[A-Za-z0-9_-]*$/, po = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, go = /^\+(?:[0-9]){6,14}[0-9]$/, Ht = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", vo = /* @__PURE__ */ new RegExp(`^${Ht}$`); function It(e) { const r = "(?:[01]\\d|2[0-3]):[0-5]\\d"; return typeof e.precision == "number" ? e.precision === -1 ? `${r}` : e.precision === 0 ? `${r}:[0-5]\\d` : `${r}:[0-5]\\d\\.\\d{${e.precision}}` : `${r}(?::[0-5]\\d(?:\\.\\d+)?)?`; } function mo(e) { return new RegExp(`^${It(e)}$`); } function ko(e) { const r = It({ precision: e.precision }), t = ["Z"]; e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"); const n = `${r}(?:${t.join("|")})`; return new RegExp(`^${Ht}T(?:${n})$`); } const bo = (e) => { const r = e ? `[\\s\\S]{${(e == null ? void 0 : e.minimum) ?? 0},${(e == null ? void 0 : e.maximum) ?? ""}}` : "[\\s\\S]*"; return new RegExp(`^${r}$`); }, yo = /^[^A-Z]*$/, _o = /^[^a-z]*$/, Q = /* @__PURE__ */ h("$ZodCheck", (e, r) => { var t; e._zod ?? (e._zod = {}), e._zod.def = r, (t = e._zod).onattach ?? (t.onattach = []); }), wo = /* @__PURE__ */ h("$ZodCheckMaxLength", (e, r) => { var t; Q.init(e, r), (t = e._zod.def).when ?? (t.when = (n) => { const i = n.value; return !cr(i) && i.length !== void 0; }), e._zod.onattach.push((n) => { const i = n._zod.bag.maximum ?? Number.POSITIVE_INFINITY; r.maximum < i && (n._zod.bag.maximum = r.maximum); }), e._zod.check = (n) => { const i = n.value; if (i.length <= r.maximum) return; const l = sr(i); n.issues.push({ origin: l, code: "too_big", maximum: r.maximum, inclusive: !0, input: i, inst: e, continue: !r.abort }); }; }), Do = /* @__PURE__ */ h("$ZodCheckMinLength", (e, r) => { var t; Q.init(e, r), (t = e._zod.def).when ?? (t.when = (n) => { const i = n.value; return !cr(i) && i.length !== void 0; }), e._zod.onattach.push((n) => { const i = n._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; r.minimum > i && (n._zod.bag.minimum = r.minimum); }), e._zod.check = (n) => { const i = n.value; if (i.length >= r.minimum) return; const l = sr(i); n.issues.push({ origin: l, code: "too_small", minimum: r.minimum, inclusive: !0, input: i, inst: e, continue: !r.abort }); }; }), $o = /* @__PURE__ */ h("$ZodCheckLengthEquals", (e, r) => { var t; Q.init(e, r), (t = e._zod.def).when ?? (t.when = (n) => { const i = n.value; return !cr(i) && i.length !== void 0; }), e._zod.onattach.push((n) => { const i = n._zod.bag; i.minimum = r.length, i.maximum = r.length, i.length = r.length; }), e._zod.check = (n) => { const i = n.value, s = i.length; if (s === r.length) return; const l = sr(i), d = s > r.length; n.issues.push({ origin: l, ...d ? { code: "too_big", maximum: r.length } : { code: "too_small", minimum: r.length }, inclusive: !0, exact: !0, input: n.value, inst: e, continue: !r.abort }); }; }), Ge = /* @__PURE__ */ h("$ZodCheckStringFormat", (e, r) => { var t, n; Q.init(e, r), e._zod.onattach.push((i) => { const s = i._zod.bag; s.format = r.format, r.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r.pattern)); }), r.pattern ? (t = e._zod).check ?? (t.check = (i) => { r.pattern.lastIndex = 0, !r.pattern.test(i.value) && i.issues.push({ origin: "string", code: "invalid_format", format: r.format, input: i.value, ...r.pattern ? { pattern: r.pattern.toString() } : {}, inst: e, continue: !r.abort }); }) : (n = e._zod).check ?? (n.check = () => { }); }), zo = /* @__PURE__ */ h("$ZodCheckRegex", (e, r) => { Ge.init(e, r), e._zod.check = (t) => { r.pattern.lastIndex = 0, !r.pattern.test(t.value) && t.issues.push({ origin: "string", code: "invalid_format", format: "regex", input: t.value, pattern: r.pattern.toString(), inst: e, continue: !r.abort }); }; }), Zo = /* @__PURE__ */ h("$ZodCheckLowerCase", (e, r) => { r.pattern ?? (r.pattern = yo), Ge.init(e, r); }), Po = /* @__PURE__ */ h("$ZodCheckUpperCase", (e, r) => { r.pattern ?? (r.pattern = _o), Ge.init(e, r); }), So = /* @__PURE__ */ h("$ZodCheckIncludes", (e, r) => { Q.i