/* !!! This is code generated by Prisma. Do not edit directly. !!!
/* eslint-disable */
// biome-ignore-all lint: generated file
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
    if (kind === "m") throw new TypeError("Private method is not writable");
    if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
    if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var _b, _f, _g;
var _Rr_e, _h, _Bn_e, _j, _e_instances, _e_e, _e_t, _e_r, _e_n, _e_i, _e_o, _e_s, _e_a, _e_l, _e_u, _k, _ni_instances, _ni_e, _ni_t, _ni_r, _ni_n, _ni_i, _ni_o, _ni_s, _ni_a, _ni_l, _ni_u, _ni_p, _q, _e_e_1, _e_t_1, _e_r_1, _v, _Or_instances, _Or_e, _Or_t, _Or_r, _Or_n, _Or_i, _Or_o, _Or_s, _Or_a, _Or_l, _Or_u, _Or_p, _Or_c, _w, _qt_instances, _qt_e, _qt_t, _qt_r, _qt_n, _qt_i, _qt_o, _qt_s, _qt_a, _qt_l, _qt_u, _qt_p, _qt_c, _qt_d, _qt_m, _qt_f, _x, _e_e_2, _e_t_2, _e_r_2, _e_n_1, _e_i_1, _y, _Vr_e, _Vr_t, _Vr_r, _z, _Br_instances, _Br_e, _1, _Qr_instances, _Qr_e, _Qr_t, _Qr_r, _Qr_n, _Qr_i, _Qr_o, _Qr_s, _Qr_a, _Qr_l, _Qr_u, _2, _li_instances, _li_e, _li_t, _li_r, _li_n, _li_i, _3, _jt_instances, _jt_e, _jt_t, _jt_r, _jt_n, _jt_i, _jt_o, _jt_s, _jt_a, _jt_l, _jt_u, _jt_p, _jt_c, _jt_d, _jt_m, _jt_f, _jt_g, _jt_y, _jt_h, _4;
var nu = Object.create;
var Qt = Object.defineProperty;
var iu = Object.getOwnPropertyDescriptor;
var ou = Object.getOwnPropertyNames;
var su = Object.getPrototypeOf, au = Object.prototype.hasOwnProperty;
var bi = (e, t) => () => (e && (t = e(e = 0)), t);
var q = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), Ne = (e, t) => { for (var r in t)
    Qt(e, r, { get: t[r], enumerable: !0 }); }, xi = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function")
    for (let i of ou(t))
        !au.call(e, i) && i !== r && Qt(e, i, { get: () => t[i], enumerable: !(n = iu(t, i)) || n.enumerable }); return e; };
var B = (e, t, r) => (r = e != null ? nu(su(e)) : {}, xi(t || !e || !e.__esModule ? Qt(r, "default", { value: e, enumerable: !0 }) : r, e)), lu = e => xi(Qt({}, "__esModule", { value: !0 }), e);
var Fi = q((Af, Iu) => { Iu.exports = { name: "@prisma/engines-version", version: "7.8.0-6.3c6e192761c0362d496ed980de936e2f3cebcd3a", main: "index.js", types: "index.d.ts", license: "Apache-2.0", author: "Tim Suchanek <suchanek@prisma.io>", prisma: { enginesVersion: "3c6e192761c0362d496ed980de936e2f3cebcd3a" }, repository: { type: "git", url: "https://github.com/prisma/engines-wrapper.git", directory: "packages/engines-version" }, devDependencies: { "@types/node": "18.19.76", typescript: "4.9.5" }, files: ["index.js", "index.d.ts"], scripts: { build: "tsc -d" } }; });
var _i = q(Ht => {
    "use strict";
    Object.defineProperty(Ht, "__esModule", { value: !0 });
    Ht.enginesVersion = void 0;
    Ht.enginesVersion = Fi().prisma.enginesVersion;
});
var Li = q((Rf, $i) => {
    "use strict";
    $i.exports = e => { let t = e.match(/^[ \t]*(?=\S)/gm); return t ? t.reduce((r, n) => Math.min(r, n.length), 1 / 0) : 0; };
});
var Bi = q((Of, Ui) => {
    "use strict";
    Ui.exports = (e, t = 1, r) => { if (r = { indent: " ", includeEmptyLines: !1, ...r }, typeof e != "string")
        throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``); if (typeof t != "number")
        throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``); if (typeof r.indent != "string")
        throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``); if (t === 0)
        return e; let n = r.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm; return e.replace(n, r.indent.repeat(t)); };
});
var Ji = q(($f, Gt) => {
    "use strict";
    Gt.exports = (e = {}) => { let t; if (e.repoUrl)
        t = e.repoUrl;
    else if (e.user && e.repo)
        t = `https://github.com/${e.user}/${e.repo}`;
    else
        throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options"); let r = new URL(`${t}/issues/new`), n = ["body", "title", "labels", "template", "milestone", "assignee", "projects"]; for (let i of n) {
        let o = e[i];
        if (o !== void 0) {
            if (i === "labels" || i === "projects") {
                if (!Array.isArray(o))
                    throw new TypeError(`The \`${i}\` option should be an array`);
                o = o.join(",");
            }
            r.searchParams.set(i, o);
        }
    } return r.toString(); };
    Gt.exports.default = Gt.exports;
});
var un = q((Rg, Xi) => {
    "use strict";
    Xi.exports = function () { function e(t, r, n, i, o) { return t < r || n < r ? t > n ? n + 1 : t + 1 : i === o ? r : r + 1; } return function (t, r) { if (t === r)
        return 0; if (t.length > r.length) {
        var n = t;
        t = r, r = n;
    } for (var i = t.length, o = r.length; i > 0 && t.charCodeAt(i - 1) === r.charCodeAt(o - 1);)
        i--, o--; for (var s = 0; s < i && t.charCodeAt(s) === r.charCodeAt(s);)
        s++; if (i -= s, o -= s, i === 0 || o < 3)
        return o; var a = 0, l, u, c, p, d, m, g, x, w, k, P, A, U = []; for (l = 0; l < i; l++)
        U.push(l + 1), U.push(t.charCodeAt(s + l)); for (var Oe = U.length - 1; a < o - 3;)
        for (w = r.charCodeAt(s + (u = a)), k = r.charCodeAt(s + (c = a + 1)), P = r.charCodeAt(s + (p = a + 2)), A = r.charCodeAt(s + (d = a + 3)), m = a += 4, l = 0; l < Oe; l += 2)
            g = U[l], x = U[l + 1], u = e(g, u, c, w, x), c = e(u, c, p, k, x), p = e(c, p, d, P, x), m = e(p, d, m, A, x), U[l] = m, d = p, p = c, c = u, u = g; for (; a < o;)
        for (w = r.charCodeAt(s + (u = a)), m = ++a, l = 0; l < Oe; l += 2)
            g = U[l], U[l] = m = e(g, u, m, w, U[l + 1]), u = g; return m; }; }();
});
var io = bi(() => {
    "use strict";
});
var oo = bi(() => {
    "use strict";
});
var In = q(Se => {
    "use strict";
    Object.defineProperty(Se, "__esModule", { value: !0 });
    Se.anumber = kn;
    Se.abytes = Ss;
    Se.ahash = Dp;
    Se.aexists = Mp;
    Se.aoutput = Fp;
    function kn(e) { if (!Number.isSafeInteger(e) || e < 0)
        throw new Error("positive integer expected, got " + e); }
    function Np(e) { return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array"; }
    function Ss(e, ...t) { if (!Np(e))
        throw new Error("Uint8Array expected"); if (t.length > 0 && !t.includes(e.length))
        throw new Error("Uint8Array expected of length " + t + ", got length=" + e.length); }
    function Dp(e) { if (typeof e != "function" || typeof e.create != "function")
        throw new Error("Hash should be wrapped by utils.wrapConstructor"); kn(e.outputLen), kn(e.blockLen); }
    function Mp(e, t = !0) { if (e.destroyed)
        throw new Error("Hash instance has been destroyed"); if (t && e.finished)
        throw new Error("Hash#digest() has already been called"); }
    function Fp(e, t) { Ss(e); let r = t.outputLen; if (e.length < r)
        throw new Error("digestInto() expects output buffer of length at least " + r); }
});
var Hs = q(y => {
    "use strict";
    Object.defineProperty(y, "__esModule", { value: !0 });
    y.add5L = y.add5H = y.add4H = y.add4L = y.add3H = y.add3L = y.rotlBL = y.rotlBH = y.rotlSL = y.rotlSH = y.rotr32L = y.rotr32H = y.rotrBL = y.rotrBH = y.rotrSL = y.rotrSH = y.shrSL = y.shrSH = y.toBig = void 0;
    y.fromBig = Nn;
    y.split = vs;
    y.add = Vs;
    var Pr = BigInt(2 ** 32 - 1), On = BigInt(32);
    function Nn(e, t = !1) { return t ? { h: Number(e & Pr), l: Number(e >> On & Pr) } : { h: Number(e >> On & Pr) | 0, l: Number(e & Pr) | 0 }; }
    function vs(e, t = !1) { let r = new Uint32Array(e.length), n = new Uint32Array(e.length); for (let i = 0; i < e.length; i++) {
        let { h: o, l: s } = Nn(e[i], t);
        [r[i], n[i]] = [o, s];
    } return [r, n]; }
    var As = (e, t) => BigInt(e >>> 0) << On | BigInt(t >>> 0);
    y.toBig = As;
    var Cs = (e, t, r) => e >>> r;
    y.shrSH = Cs;
    var Rs = (e, t, r) => e << 32 - r | t >>> r;
    y.shrSL = Rs;
    var ks = (e, t, r) => e >>> r | t << 32 - r;
    y.rotrSH = ks;
    var Is = (e, t, r) => e << 32 - r | t >>> r;
    y.rotrSL = Is;
    var Os = (e, t, r) => e << 64 - r | t >>> r - 32;
    y.rotrBH = Os;
    var Ns = (e, t, r) => e >>> r - 32 | t << 64 - r;
    y.rotrBL = Ns;
    var Ds = (e, t) => t;
    y.rotr32H = Ds;
    var Ms = (e, t) => e;
    y.rotr32L = Ms;
    var Fs = (e, t, r) => e << r | t >>> 32 - r;
    y.rotlSH = Fs;
    var _s = (e, t, r) => t << r | e >>> 32 - r;
    y.rotlSL = _s;
    var $s = (e, t, r) => t << r - 32 | e >>> 64 - r;
    y.rotlBH = $s;
    var Ls = (e, t, r) => e << r - 32 | t >>> 64 - r;
    y.rotlBL = Ls;
    function Vs(e, t, r, n) { let i = (t >>> 0) + (n >>> 0); return { h: e + r + (i / 2 ** 32 | 0) | 0, l: i | 0 }; }
    var qs = (e, t, r) => (e >>> 0) + (t >>> 0) + (r >>> 0);
    y.add3L = qs;
    var js = (e, t, r, n) => t + r + n + (e / 2 ** 32 | 0) | 0;
    y.add3H = js;
    var Us = (e, t, r, n) => (e >>> 0) + (t >>> 0) + (r >>> 0) + (n >>> 0);
    y.add4L = Us;
    var Bs = (e, t, r, n, i) => t + r + n + i + (e / 2 ** 32 | 0) | 0;
    y.add4H = Bs;
    var Qs = (e, t, r, n, i) => (e >>> 0) + (t >>> 0) + (r >>> 0) + (n >>> 0) + (i >>> 0);
    y.add5L = Qs;
    var Js = (e, t, r, n, i, o) => t + r + n + i + o + (e / 2 ** 32 | 0) | 0;
    y.add5H = Js;
    var _p = { fromBig: Nn, split: vs, toBig: As, shrSH: Cs, shrSL: Rs, rotrSH: ks, rotrSL: Is, rotrBH: Os, rotrBL: Ns, rotr32H: Ds, rotr32L: Ms, rotlSH: Fs, rotlSL: _s, rotlBH: $s, rotlBL: Ls, add: Vs, add3L: qs, add3H: js, add4L: Us, add4H: Bs, add5H: Js, add5L: Qs };
    y.default = _p;
});
var zs = q(Tr => {
    "use strict";
    Object.defineProperty(Tr, "__esModule", { value: !0 });
    Tr.crypto = void 0;
    var ge = require("node:crypto");
    Tr.crypto = ge && typeof ge == "object" && "webcrypto" in ge ? ge.webcrypto : ge && typeof ge == "object" && "randomBytes" in ge ? ge : void 0;
});
var Ks = q(E => {
    "use strict";
    Object.defineProperty(E, "__esModule", { value: !0 });
    E.Hash = E.nextTick = E.byteSwapIfBE = E.isLE = void 0;
    E.isBytes = $p;
    E.u8 = Lp;
    E.u32 = Vp;
    E.createView = qp;
    E.rotr = jp;
    E.rotl = Up;
    E.byteSwap = Fn;
    E.byteSwap32 = Bp;
    E.bytesToHex = Jp;
    E.hexToBytes = Hp;
    E.asyncLoop = Gp;
    E.utf8ToBytes = Ws;
    E.toBytes = Sr;
    E.concatBytes = Wp;
    E.checkOpts = Kp;
    E.wrapConstructor = Zp;
    E.wrapConstructorWithOpts = Yp;
    E.wrapXOFConstructorWithOpts = Xp;
    E.randomBytes = ed;
    var We = zs(), Mn = In();
    function $p(e) { return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array"; }
    function Lp(e) { return new Uint8Array(e.buffer, e.byteOffset, e.byteLength); }
    function Vp(e) { return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4)); }
    function qp(e) { return new DataView(e.buffer, e.byteOffset, e.byteLength); }
    function jp(e, t) { return e << 32 - t | e >>> t; }
    function Up(e, t) { return e << t | e >>> 32 - t >>> 0; }
    E.isLE = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
    function Fn(e) { return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255; }
    E.byteSwapIfBE = E.isLE ? e => e : e => Fn(e);
    function Bp(e) { for (let t = 0; t < e.length; t++)
        e[t] = Fn(e[t]); }
    var Qp = Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
    function Jp(e) { (0, Mn.abytes)(e); let t = ""; for (let r = 0; r < e.length; r++)
        t += Qp[e[r]]; return t; }
    var le = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
    function Gs(e) { if (e >= le._0 && e <= le._9)
        return e - le._0; if (e >= le.A && e <= le.F)
        return e - (le.A - 10); if (e >= le.a && e <= le.f)
        return e - (le.a - 10); }
    function Hp(e) { if (typeof e != "string")
        throw new Error("hex string expected, got " + typeof e); let t = e.length, r = t / 2; if (t % 2)
        throw new Error("hex string expected, got unpadded hex of length " + t); let n = new Uint8Array(r); for (let i = 0, o = 0; i < r; i++, o += 2) {
        let s = Gs(e.charCodeAt(o)), a = Gs(e.charCodeAt(o + 1));
        if (s === void 0 || a === void 0) {
            let l = e[o] + e[o + 1];
            throw new Error('hex string expected, got non-hex character "' + l + '" at index ' + o);
        }
        n[i] = s * 16 + a;
    } return n; }
    var zp = async () => { };
    E.nextTick = zp;
    async function Gp(e, t, r) { let n = Date.now(); for (let i = 0; i < e; i++) {
        r(i);
        let o = Date.now() - n;
        o >= 0 && o < t || (await (0, E.nextTick)(), n += o);
    } }
    function Ws(e) { if (typeof e != "string")
        throw new Error("utf8ToBytes expected string, got " + typeof e); return new Uint8Array(new TextEncoder().encode(e)); }
    function Sr(e) { return typeof e == "string" && (e = Ws(e)), (0, Mn.abytes)(e), e; }
    function Wp(...e) { let t = 0; for (let n = 0; n < e.length; n++) {
        let i = e[n];
        (0, Mn.abytes)(i), t += i.length;
    } let r = new Uint8Array(t); for (let n = 0, i = 0; n < e.length; n++) {
        let o = e[n];
        r.set(o, i), i += o.length;
    } return r; }
    var Dn = class {
        clone() { return this._cloneInto(); }
    };
    E.Hash = Dn;
    function Kp(e, t) { if (t !== void 0 && {}.toString.call(t) !== "[object Object]")
        throw new Error("Options should be object or undefined"); return Object.assign(e, t); }
    function Zp(e) { let t = n => e().update(Sr(n)).digest(), r = e(); return t.outputLen = r.outputLen, t.blockLen = r.blockLen, t.create = () => e(), t; }
    function Yp(e) { let t = (n, i) => e(i).update(Sr(n)).digest(), r = e({}); return t.outputLen = r.outputLen, t.blockLen = r.blockLen, t.create = n => e(n), t; }
    function Xp(e) { let t = (n, i) => e(i).update(Sr(n)).digest(), r = e({}); return t.outputLen = r.outputLen, t.blockLen = r.blockLen, t.create = n => e(n), t; }
    function ed(e = 32) { if (We.crypto && typeof We.crypto.getRandomValues == "function")
        return We.crypto.getRandomValues(new Uint8Array(e)); if (We.crypto && typeof We.crypto.randomBytes == "function")
        return We.crypto.randomBytes(e); throw new Error("crypto.getRandomValues must be defined"); }
});
var ia = q(R => {
    "use strict";
    Object.defineProperty(R, "__esModule", { value: !0 });
    R.shake256 = R.shake128 = R.keccak_512 = R.keccak_384 = R.keccak_256 = R.keccak_224 = R.sha3_512 = R.sha3_384 = R.sha3_256 = R.sha3_224 = R.Keccak = void 0;
    R.keccakP = ra;
    var Ke = In(), It = Hs(), ue = Ks(), Xs = [], ea = [], ta = [], td = BigInt(0), kt = BigInt(1), rd = BigInt(2), nd = BigInt(7), id = BigInt(256), od = BigInt(113);
    for (let e = 0, t = kt, r = 1, n = 0; e < 24; e++) {
        [r, n] = [n, (2 * r + 3 * n) % 5], Xs.push(2 * (5 * n + r)), ea.push((e + 1) * (e + 2) / 2 % 64);
        let i = td;
        for (let o = 0; o < 7; o++)
            t = (t << kt ^ (t >> nd) * od) % id, t & rd && (i ^= kt << (kt << BigInt(o)) - kt);
        ta.push(i);
    }
    var [sd, ad] = (0, It.split)(ta, !0), Zs = (e, t, r) => r > 32 ? (0, It.rotlBH)(e, t, r) : (0, It.rotlSH)(e, t, r), Ys = (e, t, r) => r > 32 ? (0, It.rotlBL)(e, t, r) : (0, It.rotlSL)(e, t, r);
    function ra(e, t = 24) { let r = new Uint32Array(10); for (let n = 24 - t; n < 24; n++) {
        for (let s = 0; s < 10; s++)
            r[s] = e[s] ^ e[s + 10] ^ e[s + 20] ^ e[s + 30] ^ e[s + 40];
        for (let s = 0; s < 10; s += 2) {
            let a = (s + 8) % 10, l = (s + 2) % 10, u = r[l], c = r[l + 1], p = Zs(u, c, 1) ^ r[a], d = Ys(u, c, 1) ^ r[a + 1];
            for (let m = 0; m < 50; m += 10)
                e[s + m] ^= p, e[s + m + 1] ^= d;
        }
        let i = e[2], o = e[3];
        for (let s = 0; s < 24; s++) {
            let a = ea[s], l = Zs(i, o, a), u = Ys(i, o, a), c = Xs[s];
            i = e[c], o = e[c + 1], e[c] = l, e[c + 1] = u;
        }
        for (let s = 0; s < 50; s += 10) {
            for (let a = 0; a < 10; a++)
                r[a] = e[s + a];
            for (let a = 0; a < 10; a++)
                e[s + a] ^= ~r[(a + 2) % 10] & r[(a + 4) % 10];
        }
        e[0] ^= sd[n], e[1] ^= ad[n];
    } r.fill(0); }
    var Ot = class e extends ue.Hash {
        constructor(t, r, n, i = !1, o = 24) { if (super(), this.blockLen = t, this.suffix = r, this.outputLen = n, this.enableXOF = i, this.rounds = o, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, (0, Ke.anumber)(n), 0 >= this.blockLen || this.blockLen >= 200)
            throw new Error("Sha3 supports only keccak-f1600 function"); this.state = new Uint8Array(200), this.state32 = (0, ue.u32)(this.state); }
        keccak() { ue.isLE || (0, ue.byteSwap32)(this.state32), ra(this.state32, this.rounds), ue.isLE || (0, ue.byteSwap32)(this.state32), this.posOut = 0, this.pos = 0; }
        update(t) { (0, Ke.aexists)(this); let { blockLen: r, state: n } = this; t = (0, ue.toBytes)(t); let i = t.length; for (let o = 0; o < i;) {
            let s = Math.min(r - this.pos, i - o);
            for (let a = 0; a < s; a++)
                n[this.pos++] ^= t[o++];
            this.pos === r && this.keccak();
        } return this; }
        finish() { if (this.finished)
            return; this.finished = !0; let { state: t, suffix: r, pos: n, blockLen: i } = this; t[n] ^= r, (r & 128) !== 0 && n === i - 1 && this.keccak(), t[i - 1] ^= 128, this.keccak(); }
        writeInto(t) { (0, Ke.aexists)(this, !1), (0, Ke.abytes)(t), this.finish(); let r = this.state, { blockLen: n } = this; for (let i = 0, o = t.length; i < o;) {
            this.posOut >= n && this.keccak();
            let s = Math.min(n - this.posOut, o - i);
            t.set(r.subarray(this.posOut, this.posOut + s), i), this.posOut += s, i += s;
        } return t; }
        xofInto(t) { if (!this.enableXOF)
            throw new Error("XOF is not possible for this instance"); return this.writeInto(t); }
        xof(t) { return (0, Ke.anumber)(t), this.xofInto(new Uint8Array(t)); }
        digestInto(t) { if ((0, Ke.aoutput)(t, this), this.finished)
            throw new Error("digest() was already called"); return this.writeInto(t), this.destroy(), t; }
        digest() { return this.digestInto(new Uint8Array(this.outputLen)); }
        destroy() { this.destroyed = !0, this.state.fill(0); }
        _cloneInto(t) { let { blockLen: r, suffix: n, outputLen: i, rounds: o, enableXOF: s } = this; return t || (t = new e(r, n, i, s, o)), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = o, t.suffix = n, t.outputLen = i, t.enableXOF = s, t.destroyed = this.destroyed, t; }
    };
    R.Keccak = Ot;
    var ye = (e, t, r) => (0, ue.wrapConstructor)(() => new Ot(t, e, r));
    R.sha3_224 = ye(6, 144, 224 / 8);
    R.sha3_256 = ye(6, 136, 256 / 8);
    R.sha3_384 = ye(6, 104, 384 / 8);
    R.sha3_512 = ye(6, 72, 512 / 8);
    R.keccak_224 = ye(1, 144, 224 / 8);
    R.keccak_256 = ye(1, 136, 256 / 8);
    R.keccak_384 = ye(1, 104, 384 / 8);
    R.keccak_512 = ye(1, 72, 512 / 8);
    var na = (e, t, r) => (0, ue.wrapXOFConstructorWithOpts)((n = {}) => new Ot(t, e, n.dkLen === void 0 ? r : n.dkLen, !0));
    R.shake128 = na(31, 168, 128 / 8);
    R.shake256 = na(31, 136, 256 / 8);
});
var da = q((wx, he) => {
    "use strict";
    var { sha3_512: ld } = ia(), sa = 24, Nt = 32, _n = (e = 4, t = Math.random) => { let r = ""; for (; r.length < e;)
        r = r + Math.floor(t() * 36).toString(36); return r; };
    function aa(e) { let t = 8n, r = 0n; for (let n of e.values()) {
        let i = BigInt(n);
        r = (r << t) + i;
    } return r; }
    var la = (e = "") => aa(ld(e)).toString(36).slice(1), oa = Array.from({ length: 26 }, (e, t) => String.fromCharCode(t + 97)), ud = e => oa[Math.floor(e() * oa.length)], ua = ({ globalObj: e = typeof global < "u" ? global : typeof window < "u" ? window : {}, random: t = Math.random } = {}) => { let r = Object.keys(e).toString(), n = r.length ? r + _n(Nt, t) : _n(Nt, t); return la(n).substring(0, Nt); }, ca = e => () => e++, cd = 476782367, pa = ({ random: e = Math.random, counter: t = ca(Math.floor(e() * cd)), length: r = sa, fingerprint: n = ua({ random: e }) } = {}) => function () { let o = ud(e), s = Date.now().toString(36), a = t().toString(36), l = _n(r, e), u = `${s + l + a + n}`; return `${o + la(u).substring(1, r)}`; }, pd = pa(), dd = (e, { minLength: t = 2, maxLength: r = Nt } = {}) => { let n = e.length, i = /^[0-9a-z]+$/; try {
        if (typeof e == "string" && n >= t && n <= r && i.test(e))
            return !0;
    }
    finally { } return !1; };
    he.exports.getConstants = () => ({ defaultLength: sa, bigLength: Nt });
    he.exports.init = pa;
    he.exports.createId = pd;
    he.exports.bufToBigInt = aa;
    he.exports.createCounter = ca;
    he.exports.createFingerprint = ua;
    he.exports.isCuid = dd;
});
var ma = q((bx, Dt) => {
    "use strict";
    var { createId: md, init: fd, getConstants: gd, isCuid: yd } = da();
    Dt.exports.createId = md;
    Dt.exports.init = fd;
    Dt.exports.getConstants = gd;
    Dt.exports.isCuid = yd;
});
var zm = {};
Ne(zm, { AnyNull: () => O.AnyNull, DMMF: () => yt, DbNull: () => O.DbNull, Debug: () => _, Decimal: () => Xl.Decimal, Extensions: () => Wr, JsonNull: () => O.JsonNull, NullTypes: () => O.NullTypes, ObjectEnumValue: () => O.ObjectEnumValue, PrismaClientInitializationError: () => b.PrismaClientInitializationError, PrismaClientKnownRequestError: () => b.PrismaClientKnownRequestError, PrismaClientRustPanicError: () => b.PrismaClientRustPanicError, PrismaClientUnknownRequestError: () => b.PrismaClientUnknownRequestError, PrismaClientValidationError: () => b.PrismaClientValidationError, Public: () => Kr, Sql: () => oe.Sql, createParam: () => So, defineDmmfProperty: () => Io, deserializeJsonObject: () => Z, deserializeRawResult: () => Hr, dmmfToRuntimeDataModel: () => vi, empty: () => oe.empty, getPrismaClient: () => Kl, getRuntime: () => Yl, isAnyNull: () => O.isAnyNull, isDbNull: () => O.isDbNull, isJsonNull: () => O.isJsonNull, isObjectEnumValue: () => O.isObjectEnumValue, join: () => oe.join, makeStrictEnum: () => Zl, makeTypedQueryFactory: () => Oo, raw: () => oe.raw, serializeJsonQuery: () => pr, skip: () => cr, sqltag: () => oe.sql, warnOnce: () => ln });
module.exports = lu(zm);
var Wr = {};
Ne(Wr, { defineExtension: () => Ei, getExtensionContext: () => Pi });
function Ei(e) { return typeof e == "function" ? e : t => t.$extends(e); }
function Pi(e) { return e; }
var Kr = {};
Ne(Kr, { validator: () => Ti });
function Ti(...e) { return t => t; }
var Y = class {
    constructor() {
        this._map = new Map;
    }
    get(t) { var _b; return (_b = this._map.get(t)) === null || _b === void 0 ? void 0 : _b.value; }
    set(t, r) { this._map.set(t, { value: r }); }
    getOrCreate(t, r) { let n = this._map.get(t); if (n)
        return n.value; let i = r(); return this.set(t, i), i; }
};
function de(e) { return e.substring(0, 1).toLowerCase() + e.substring(1); }
function Si(e, t) { let r = {}; for (let n of e) {
    let i = n[t];
    r[i] = n;
} return r; }
function it(e) { let t; return { get() { return t || (t = { value: e() }), t.value; } }; }
function vi(e) { return { models: Zr(e.models), enums: Zr(e.enums), types: Zr(e.types) }; }
function Zr(e) { let t = {}; for (let { name: r, ...n } of e)
    t[r] = n; return t; }
var Ao = require("@prisma/client-runtime-utils");
var Jt = {};
Ne(Jt, { $: () => Ii, bgBlack: () => wu, bgBlue: () => Pu, bgCyan: () => Su, bgGreen: () => xu, bgMagenta: () => Tu, bgRed: () => bu, bgWhite: () => vu, bgYellow: () => Eu, black: () => fu, blue: () => xe, bold: () => z, cyan: () => se, dim: () => ot, gray: () => ut, green: () => at, grey: () => hu, hidden: () => du, inverse: () => pu, italic: () => cu, magenta: () => gu, red: () => be, reset: () => uu, strikethrough: () => mu, underline: () => st, white: () => yu, yellow: () => lt });
var Yr, Ai, Ci, Ri, ki = !0;
typeof process < "u" && ({ FORCE_COLOR: Yr, NODE_DISABLE_COLORS: Ai, NO_COLOR: Ci, TERM: Ri } = process.env || {}, ki = process.stdout && process.stdout.isTTY);
var Ii = { enabled: !Ai && Ci == null && Ri !== "dumb" && (Yr != null && Yr !== "0" || ki) };
function v(e, t) { let r = new RegExp(`\\x1b\\[${t}m`, "g"), n = `\x1B[${e}m`, i = `\x1B[${t}m`; return function (o) { return !Ii.enabled || o == null ? o : n + (~("" + o).indexOf(i) ? o.replace(r, i + n) : o) + i; }; }
var uu = v(0, 0), z = v(1, 22), ot = v(2, 22), cu = v(3, 23), st = v(4, 24), pu = v(7, 27), du = v(8, 28), mu = v(9, 29), fu = v(30, 39), be = v(31, 39), at = v(32, 39), lt = v(33, 39), xe = v(34, 39), gu = v(35, 39), se = v(36, 39), yu = v(37, 39), ut = v(90, 39), hu = v(90, 39), wu = v(40, 49), bu = v(41, 49), xu = v(42, 49), Eu = v(43, 49), Pu = v(44, 49), Tu = v(45, 49), Su = v(46, 49), vu = v(47, 49);
var Au = 100, Oi = ["green", "yellow", "blue", "magenta", "cyan", "red"], ct = [], Ni = Date.now(), Cu = 0, Xr = typeof process < "u" ? process.env : {};
(_b = globalThis.DEBUG) !== null && _b !== void 0 ? _b : (globalThis.DEBUG = (_f = Xr.DEBUG) !== null && _f !== void 0 ? _f : "");
(_g = globalThis.DEBUG_COLORS) !== null && _g !== void 0 ? _g : (globalThis.DEBUG_COLORS = Xr.DEBUG_COLORS ? Xr.DEBUG_COLORS === "true" : !0);
var pt = { enable(e) { typeof e == "string" && (globalThis.DEBUG = e); }, disable() { let e = globalThis.DEBUG; return globalThis.DEBUG = "", e; }, enabled(e) { let t = globalThis.DEBUG.split(",").map(i => i.replace(/[.+?^${}()|[\]\\]/g, "\\$&")), r = t.some(i => i === "" || i[0] === "-" ? !1 : e.match(RegExp(i.split("*").join(".*") + "$"))), n = t.some(i => i === "" || i[0] !== "-" ? !1 : e.match(RegExp(i.slice(1).split("*").join(".*") + "$"))); return r && !n; }, log: (...e) => { var _b; let [t, r, ...n] = e; ((_b = console.warn) !== null && _b !== void 0 ? _b : console.log)(`${t} ${r}`, ...n); }, formatters: {} };
function Ru(e) { let t = { color: Oi[Cu++ % Oi.length], enabled: pt.enabled(e), namespace: e, log: pt.log, extend: () => { } }, r = (...n) => { let { enabled: i, namespace: o, color: s, log: a } = t; if (n.length !== 0 && ct.push([o, ...n]), ct.length > Au && ct.shift(), pt.enabled(o) || i) {
    let l = n.map(c => typeof c == "string" ? c : ku(c)), u = `+${Date.now() - Ni}ms`;
    Ni = Date.now(), globalThis.DEBUG_COLORS ? a(Jt[s](z(o)), ...l, Jt[s](u)) : a(o, ...l, u);
} }; return new Proxy(r, { get: (n, i) => t[i], set: (n, i, o) => t[i] = o }); }
var _ = new Proxy(Ru, { get: (e, t) => pt[t], set: (e, t, r) => pt[t] = r });
function ku(e, t = 2) { let r = new Set; return JSON.stringify(e, (n, i) => { if (typeof i == "object" && i !== null) {
    if (r.has(i))
        return "[Circular *]";
    r.add(i);
}
else if (typeof i == "bigint")
    return i.toString(); return i; }, t); }
function Di(e = 7500) {
    let t = ct.map(([r, ...n]) => `${r} ${n.map(i => typeof i == "string" ? i : JSON.stringify(i)).join(" ")}`).join(`
`);
    return t.length < e ? t : t.slice(-e);
}
function Mi() { ct.length = 0; }
function ae(e, t) { throw new Error(t); }
var Vi = B(Li(), 1);
function en(e) { let t = (0, Vi.default)(e); if (t === 0)
    return e; let r = new RegExp(`^[ \\t]{${t}}`, "gm"); return e.replace(r, ""); }
var qi = "prisma+postgres", zt = `${qi}:`;
function ji(e) { var _b; return (_b = e === null || e === void 0 ? void 0 : e.toString().startsWith(`${zt}//`)) !== null && _b !== void 0 ? _b : !1; }
function tn(e) { if (!ji(e))
    return !1; let { host: t } = new URL(e); return t.includes("localhost") || t.includes("127.0.0.1") || t.includes("[::1]"); }
var mt = {};
Ne(mt, { error: () => Du, info: () => Nu, log: () => Ou, query: () => Mu, should: () => Qi, tags: () => dt, warn: () => rn });
var dt = { error: be("prisma:error"), warn: lt("prisma:warn"), info: se("prisma:info"), query: xe("prisma:query") }, Qi = { warn: () => !process.env.PRISMA_DISABLE_WARNINGS };
function Ou(...e) { console.log(...e); }
function rn(e, ...t) { Qi.warn() && console.warn(`${dt.warn} ${e}`, ...t); }
function Nu(e, ...t) { console.info(`${dt.info} ${e}`, ...t); }
function Du(e, ...t) { console.error(`${dt.error} ${e}`, ...t); }
function Mu(e, ...t) { console.log(`${dt.query} ${e}`, ...t); }
function nn({ onlyFirst: e = !1 } = {}) { let r = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"); return new RegExp(r, e ? void 0 : "g"); }
var Fu = nn();
function De(e) { if (typeof e != "string")
    throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``); return e.replace(Fu, ""); }
var ft = B(require("node:path"));
function on(e) { return ft.default.sep === ft.default.posix.sep ? e : e.split(ft.default.sep).join(ft.default.posix.sep); }
function sn(e, t) { return Object.prototype.hasOwnProperty.call(e, t); }
function Wt(e, t) { let r = {}; for (let n of Object.keys(e))
    r[n] = t(e[n], n); return r; }
function an(e, t) { if (e.length === 0)
    return; let r = e[0]; for (let n = 1; n < e.length; n++)
    t(r, e[n]) < 0 && (r = e[n]); return r; }
function gt(e, t) { Object.defineProperty(e, "name", { value: t, configurable: !0 }); }
var Hi = new Set, ln = (e, t, ...r) => { Hi.has(e) || (Hi.add(e), rn(t, ...r)); };
function Me(e) { return e instanceof Date || Object.prototype.toString.call(e) === "[object Date]"; }
function Kt(e) { return e.toString() !== "Invalid Date"; }
var zi = require("@prisma/client-runtime-utils");
function Fe(e) { return zi.Decimal.isDecimal(e) ? !0 : e !== null && typeof e == "object" && typeof e.s == "number" && typeof e.e == "number" && typeof e.toFixed == "function" && Array.isArray(e.d); }
var wo = require("@prisma/client-runtime-utils");
var yt = {};
Ne(yt, { ModelAction: () => _e, datamodelEnumToSchemaEnum: () => _u });
function _u(e) { return { name: e.name, values: e.values.map(t => t.name) }; }
var _e = (A => (A.findUnique = "findUnique", A.findUniqueOrThrow = "findUniqueOrThrow", A.findFirst = "findFirst", A.findFirstOrThrow = "findFirstOrThrow", A.findMany = "findMany", A.create = "create", A.createMany = "createMany", A.createManyAndReturn = "createManyAndReturn", A.update = "update", A.updateMany = "updateMany", A.updateManyAndReturn = "updateManyAndReturn", A.upsert = "upsert", A.delete = "delete", A.deleteMany = "deleteMany", A.groupBy = "groupBy", A.count = "count", A.aggregate = "aggregate", A.findRaw = "findRaw", A.aggregateRaw = "aggregateRaw", A))(_e || {});
var Yi = B(Bi());
var Zi = B(require("node:fs"));
var Gi = { keyword: se, entity: se, value: e => z(xe(e)), punctuation: xe, directive: se, function: se, variable: e => z(xe(e)), string: e => z(at(e)), boolean: lt, number: se, comment: ut };
var $u = e => e, Zt = {}, Lu = 0, h = { manual: Zt.Prism && Zt.Prism.manual, disableWorkerMessageHandler: Zt.Prism && Zt.Prism.disableWorkerMessageHandler, util: { encode: function (e) { if (e instanceof G) {
            let t = e;
            return new G(t.type, h.util.encode(t.content), t.alias);
        }
        else
            return Array.isArray(e) ? e.map(h.util.encode) : e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " "); }, type: function (e) { return Object.prototype.toString.call(e).slice(8, -1); }, objId: function (e) { return e.__id || Object.defineProperty(e, "__id", { value: ++Lu }), e.__id; }, clone: function e(t, r) { let n, i, o = h.util.type(t); switch (r = r || {}, o) {
            case "Object":
                if (i = h.util.objId(t), r[i])
                    return r[i];
                n = {}, r[i] = n;
                for (let s in t)
                    t.hasOwnProperty(s) && (n[s] = e(t[s], r));
                return n;
            case "Array": return i = h.util.objId(t), r[i] ? r[i] : (n = [], r[i] = n, t.forEach(function (s, a) { n[a] = e(s, r); }), n);
            default: return t;
        } } }, languages: { extend: function (e, t) { let r = h.util.clone(h.languages[e]); for (let n in t)
            r[n] = t[n]; return r; }, insertBefore: function (e, t, r, n) { n = n || h.languages; let i = n[e], o = {}; for (let a in i)
            if (i.hasOwnProperty(a)) {
                if (a == t)
                    for (let l in r)
                        r.hasOwnProperty(l) && (o[l] = r[l]);
                r.hasOwnProperty(a) || (o[a] = i[a]);
            } let s = n[e]; return n[e] = o, h.languages.DFS(h.languages, function (a, l) { l === s && a != e && (this[a] = o); }), o; }, DFS: function e(t, r, n, i) { i = i || {}; let o = h.util.objId; for (let s in t)
            if (t.hasOwnProperty(s)) {
                r.call(t, s, t[s], n || s);
                let a = t[s], l = h.util.type(a);
                l === "Object" && !i[o(a)] ? (i[o(a)] = !0, e(a, r, null, i)) : l === "Array" && !i[o(a)] && (i[o(a)] = !0, e(a, r, s, i));
            } } }, plugins: {}, highlight: function (e, t, r) { let n = { code: e, grammar: t, language: r }; return h.hooks.run("before-tokenize", n), n.tokens = h.tokenize(n.code, n.grammar), h.hooks.run("after-tokenize", n), G.stringify(h.util.encode(n.tokens), n.language); }, matchGrammar: function (e, t, r, n, i, o, s) { for (let x in r) {
        if (!r.hasOwnProperty(x) || !r[x])
            continue;
        if (x == s)
            return;
        let w = r[x];
        w = h.util.type(w) === "Array" ? w : [w];
        for (let k = 0; k < w.length; ++k) {
            let P = w[k], A = P.inside, U = !!P.lookbehind, Oe = !!P.greedy, Gr = 0, eu = P.alias;
            if (Oe && !P.pattern.global) {
                let L = P.pattern.toString().match(/[imuy]*$/)[0];
                P.pattern = RegExp(P.pattern.source, L + "g");
            }
            P = P.pattern || P;
            for (let L = n, pe = i; L < t.length; pe += t[L].length, ++L) {
                let nt = t[L];
                if (t.length > e.length)
                    return;
                if (nt instanceof G)
                    continue;
                if (Oe && L != t.length - 1) {
                    P.lastIndex = pe;
                    var p = P.exec(e);
                    if (!p)
                        break;
                    var c = p.index + (U ? p[1].length : 0), d = p.index + p[0].length, a = L, l = pe;
                    for (let ru = t.length; a < ru && (l < d || !t[a].type && !t[a - 1].greedy); ++a)
                        l += t[a].length, c >= l && (++L, pe = l);
                    if (t[L] instanceof G)
                        continue;
                    u = a - L, nt = e.slice(pe, l), p.index -= pe;
                }
                else {
                    P.lastIndex = 0;
                    var p = P.exec(nt), u = 1;
                }
                if (!p) {
                    if (o)
                        break;
                    continue;
                }
                U && (Gr = p[1] ? p[1].length : 0);
                var c = p.index + Gr, p = p[0].slice(Gr), d = c + p.length, m = nt.slice(0, c), g = nt.slice(d);
                let Bt = [L, u];
                m && (++L, pe += m.length, Bt.push(m));
                let tu = new G(x, A ? h.tokenize(p, A) : p, eu, p, Oe);
                if (Bt.push(tu), g && Bt.push(g), Array.prototype.splice.apply(t, Bt), u != 1 && h.matchGrammar(e, t, r, L, pe, !0, x), o)
                    break;
            }
        }
    } }, tokenize: function (e, t) { let r = [e], n = t.rest; if (n) {
        for (let i in n)
            t[i] = n[i];
        delete t.rest;
    } return h.matchGrammar(e, r, t, 0, 0, !1), r; }, hooks: { all: {}, add: function (e, t) { let r = h.hooks.all; r[e] = r[e] || [], r[e].push(t); }, run: function (e, t) { let r = h.hooks.all[e]; if (!(!r || !r.length))
            for (var n = 0, i; i = r[n++];)
                i(t); } }, Token: G };
h.languages.clike = { comment: [{ pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, lookbehind: !0 }, { pattern: /(^|[^\\:])\/\/.*/, lookbehind: !0, greedy: !0 }], string: { pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, greedy: !0 }, "class-name": { pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i, lookbehind: !0, inside: { punctuation: /[.\\]/ } }, keyword: /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, boolean: /\b(?:true|false)\b/, function: /\w+(?=\()/, number: /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, punctuation: /[{}[\];(),.:]/ };
h.languages.javascript = h.languages.extend("clike", { "class-name": [h.languages.clike["class-name"], { pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/, lookbehind: !0 }], keyword: [{ pattern: /((?:^|})\s*)(?:catch|finally)\b/, lookbehind: !0 }, { pattern: /(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, lookbehind: !0 }], number: /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/, function: /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, operator: /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/ });
h.languages.javascript["class-name"][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;
h.languages.insertBefore("javascript", "keyword", { regex: { pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/, lookbehind: !0, greedy: !0 }, "function-variable": { pattern: /[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/, alias: "function" }, parameter: [{ pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/, lookbehind: !0, inside: h.languages.javascript }, { pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i, inside: h.languages.javascript }, { pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/, lookbehind: !0, inside: h.languages.javascript }, { pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, lookbehind: !0, inside: h.languages.javascript }], constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/ });
h.languages.markup && h.languages.markup.tag.addInlined("script", "javascript");
h.languages.js = h.languages.javascript;
h.languages.typescript = h.languages.extend("javascript", { keyword: /\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/, builtin: /\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/ });
h.languages.ts = h.languages.typescript;
function G(e, t, r, n, i) { this.type = e, this.content = t, this.alias = r, this.length = (n || "").length | 0, this.greedy = !!i; }
G.stringify = function (e, t) { return typeof e == "string" ? e : Array.isArray(e) ? e.map(function (r) { return G.stringify(r, t); }).join("") : Vu(e.type)(e.content); };
function Vu(e) { return Gi[e] || $u; }
function Wi(e) { return qu(e, h.languages.javascript); }
function qu(e, t) { return h.tokenize(e, t).map(n => G.stringify(n)).join(""); }
function Ki(e) { return en(e); }
var Yt = class e {
    static read(t) { let r; try {
        r = Zi.default.readFileSync(t, "utf-8");
    }
    catch (_b) {
        return null;
    } return e.fromContent(r); }
    static fromContent(t) { let r = t.split(/\r?\n/); return new e(1, r); }
    constructor(t, r) { this.firstLineNumber = t, this.lines = r; }
    get lastLineNumber() { return this.firstLineNumber + this.lines.length - 1; }
    mapLineAt(t, r) { if (t < this.firstLineNumber || t > this.lines.length + this.firstLineNumber)
        return this; let n = t - this.firstLineNumber, i = [...this.lines]; return i[n] = r(i[n]), new e(this.firstLineNumber, i); }
    mapLines(t) { return new e(this.firstLineNumber, this.lines.map((r, n) => t(r, this.firstLineNumber + n))); }
    lineAt(t) { return this.lines[t - this.firstLineNumber]; }
    prependSymbolAt(t, r) { return this.mapLines((n, i) => i === t ? `${r} ${n}` : `  ${n}`); }
    slice(t, r) {
        let n = this.lines.slice(t - 1, r).join(`
`);
        return new e(t, Ki(n).split(`
`));
    }
    highlight() {
        let t = Wi(this.toString());
        return new e(this.firstLineNumber, t.split(`
`));
    }
    toString() {
        return this.lines.join(`
`);
    }
};
var ju = { red: be, gray: ut, dim: ot, bold: z, underline: st, highlightSource: e => e.highlight() }, Uu = { red: e => e, gray: e => e, dim: e => e, bold: e => e, underline: e => e, highlightSource: e => e };
function Bu({ message: e, originalMethod: t, isPanic: r, callArguments: n }) { return { functionName: `prisma.${t}()`, message: e, isPanic: r !== null && r !== void 0 ? r : !1, callArguments: n }; }
function Qu({ callsite: e, message: t, originalMethod: r, isPanic: n, callArguments: i }, o) { var _b; let s = Bu({ message: t, originalMethod: r, isPanic: n, callArguments: i }); if (!e || typeof window < "u" || process.env.NODE_ENV === "production")
    return s; let a = e.getLocation(); if (!a || !a.lineNumber || !a.columnNumber)
    return s; let l = Math.max(1, a.lineNumber - 3), u = (_b = Yt.read(a.fileName)) === null || _b === void 0 ? void 0 : _b.slice(l, a.lineNumber), c = u === null || u === void 0 ? void 0 : u.lineAt(a.lineNumber); if (u && c) {
    let p = Hu(c), d = Ju(c);
    if (!d)
        return s;
    s.functionName = `${d.code})`, s.location = a, n || (u = u.mapLineAt(a.lineNumber, g => g.slice(0, d.openingBraceIndex))), u = o.highlightSource(u);
    let m = String(u.lastLineNumber).length;
    if (s.contextLines = u.mapLines((g, x) => o.gray(String(x).padStart(m)) + " " + g).mapLines(g => o.dim(g)).prependSymbolAt(a.lineNumber, o.bold(o.red("\u2192"))), i) {
        let g = p + m + 1;
        g += 2, s.callArguments = (0, Yi.default)(i, g).slice(g);
    }
} return s; }
function Ju(e) { let t = Object.keys(_e).join("|"), n = new RegExp(String.raw `\.(${t})\(`).exec(e); if (n) {
    let i = n.index + n[0].length, o = e.lastIndexOf(" ", n.index) + 1;
    return { code: e.slice(o, i), openingBraceIndex: i };
} return null; }
function Hu(e) { let t = 0; for (let r = 0; r < e.length; r++) {
    if (e.charAt(r) !== " ")
        return t;
    t++;
} return t; }
function zu({ functionName: e, location: t, message: r, isPanic: n, contextLines: i, callArguments: o }, s) {
    let a = [""], l = t ? " in" : ":";
    if (n ? (a.push(s.red(`Oops, an unknown error occurred! This is ${s.bold("on us")}, you did nothing wrong.`)), a.push(s.red(`It occurred in the ${s.bold(`\`${e}\``)} invocation${l}`))) : a.push(s.red(`Invalid ${s.bold(`\`${e}\``)} invocation${l}`)), t && a.push(s.underline(Gu(t))), i) {
        a.push("");
        let u = [i.toString()];
        o && (u.push(o), u.push(s.dim(")"))), a.push(u.join("")), o && a.push("");
    }
    else
        a.push(""), o && a.push(o), a.push("");
    return a.push(r), a.join(`
`);
}
function Gu(e) { let t = [e.fileName]; return e.lineNumber && t.push(String(e.lineNumber)), e.columnNumber && t.push(String(e.columnNumber)), t.join(":"); }
function Xt(e) { let t = e.showColors ? ju : Uu, r; return r = Qu(e, t), zu(r, t); }
var ao = B(un());
function ro(e, t, r) { let n = no(e), i = Wu(n), o = Zu(i); o ? er(o, t, r) : t.addErrorMessage(() => "Unknown error"); }
function no(e) { return e.errors.flatMap(t => t.kind === "Union" ? no(t) : [t]); }
function Wu(e) { let t = new Map, r = []; for (let n of e) {
    if (n.kind !== "InvalidArgumentType") {
        r.push(n);
        continue;
    }
    let i = `${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`, o = t.get(i);
    o ? t.set(i, { ...n, argument: { ...n.argument, typeNames: Ku(o.argument.typeNames, n.argument.typeNames) } }) : t.set(i, n);
} return r.push(...t.values()), r; }
function Ku(e, t) { return [...new Set(e.concat(t))]; }
function Zu(e) { return an(e, (t, r) => { let n = eo(t), i = eo(r); return n !== i ? n - i : to(t) - to(r); }); }
function eo(e) { let t = 0; return Array.isArray(e.selectionPath) && (t += e.selectionPath.length), Array.isArray(e.argumentPath) && (t += e.argumentPath.length), t; }
function to(e) { switch (e.kind) {
    case "InvalidArgumentValue":
    case "ValueTooLarge": return 20;
    case "InvalidArgumentType": return 10;
    case "RequiredArgumentMissing": return -10;
    default: return 0;
} }
var j = class {
    constructor(t, r) {
        this.isRequired = !1;
        this.name = t;
        this.value = r;
    }
    makeRequired() { return this.isRequired = !0, this; }
    write(t) { let { colors: { green: r } } = t.context; t.addMarginSymbol(r(this.isRequired ? "+" : "?")), t.write(r(this.name)), this.isRequired || t.write(r("?")), t.write(r(": ")), typeof this.value == "string" ? t.write(r(this.value)) : t.write(this.value); }
};
oo();
var $e = class {
    constructor(t = 0, r) {
        this.lines = [];
        this.currentLine = "";
        this.currentIndent = 0;
        this.context = r;
        this.currentIndent = t;
    }
    write(t) { return typeof t == "string" ? this.currentLine += t : t.write(this), this; }
    writeJoined(t, r, n = (i, o) => o.write(i)) { let i = r.length - 1; for (let o = 0; o < r.length; o++)
        n(r[o], this), o !== i && this.write(t); return this; }
    writeLine(t) { return this.write(t).newLine(); }
    newLine() { this.lines.push(this.indentedCurrentLine()), this.currentLine = "", this.marginSymbol = void 0; let t = this.afterNextNewLineCallback; return this.afterNextNewLineCallback = void 0, t === null || t === void 0 ? void 0 : t(), this; }
    withIndent(t) { return this.indent(), t(this), this.unindent(), this; }
    afterNextNewline(t) { return this.afterNextNewLineCallback = t, this; }
    indent() { return this.currentIndent++, this; }
    unindent() { return this.currentIndent > 0 && this.currentIndent--, this; }
    addMarginSymbol(t) { return this.marginSymbol = t, this; }
    toString() {
        return this.lines.concat(this.indentedCurrentLine()).join(`
`);
    }
    getCurrentLineLength() { return this.currentLine.length; }
    indentedCurrentLine() { let t = this.currentLine.padStart(this.currentLine.length + 2 * this.currentIndent); return this.marginSymbol ? this.marginSymbol + t.slice(1) : t; }
};
io();
var tr = class {
    constructor(t) { this.value = t; }
    write(t) { t.write(this.value); }
    markAsError() { this.value.markAsError(); }
};
var rr = e => e, nr = { bold: rr, red: rr, green: rr, dim: rr, enabled: !1 }, so = { bold: z, red: be, green: at, dim: ot, enabled: !0 }, Le = { write(e) { e.writeLine(","); } };
var X = class {
    constructor(t) {
        this.isUnderlined = !1;
        this.color = t => t;
        this.contents = t;
    }
    underline() { return this.isUnderlined = !0, this; }
    setColor(t) { return this.color = t, this; }
    write(t) { let r = t.getCurrentLineLength(); t.write(this.color(this.contents)), this.isUnderlined && t.afterNextNewline(() => { t.write(" ".repeat(r)).writeLine(this.color("~".repeat(this.contents.length))); }); }
};
var me = class {
    constructor() {
        this.hasError = !1;
    }
    markAsError() { return this.hasError = !0, this; }
};
var Ve = class extends me {
    constructor() {
        super(...arguments);
        this.items = [];
    }
    addItem(t) { return this.items.push(new tr(t)), this; }
    getField(t) { return this.items[t]; }
    getPrintWidth() { return this.items.length === 0 ? 2 : Math.max(...this.items.map(r => r.value.getPrintWidth())) + 2; }
    write(t) { if (this.items.length === 0) {
        this.writeEmpty(t);
        return;
    } this.writeWithItems(t); }
    writeEmpty(t) { let r = new X("[]"); this.hasError && r.setColor(t.context.colors.red).underline(), t.write(r); }
    writeWithItems(t) { let { colors: r } = t.context; t.writeLine("[").withIndent(() => t.writeJoined(Le, this.items).newLine()).write("]"), this.hasError && t.afterNextNewline(() => { t.writeLine(r.red("~".repeat(this.getPrintWidth()))); }); }
    asObject() { }
};
var qe = class e extends me {
    constructor() {
        super(...arguments);
        this.fields = {};
        this.suggestions = [];
    }
    addField(t) { this.fields[t.name] = t; }
    addSuggestion(t) { this.suggestions.push(t); }
    getField(t) { return this.fields[t]; }
    getDeepField(t) { let [r, ...n] = t, i = this.getField(r); if (!i)
        return; let o = i; for (let s of n) {
        let a;
        if (o.value instanceof e ? a = o.value.getField(s) : o.value instanceof Ve && (a = o.value.getField(Number(s))), !a)
            return;
        o = a;
    } return o; }
    getDeepFieldValue(t) { var _b; return t.length === 0 ? this : (_b = this.getDeepField(t)) === null || _b === void 0 ? void 0 : _b.value; }
    hasField(t) { return !!this.getField(t); }
    removeAllFields() { this.fields = {}; }
    removeField(t) { delete this.fields[t]; }
    getFields() { return this.fields; }
    isEmpty() { return Object.keys(this.fields).length === 0; }
    getFieldValue(t) { var _b; return (_b = this.getField(t)) === null || _b === void 0 ? void 0 : _b.value; }
    getDeepSubSelectionValue(t) { let r = this; for (let n of t) {
        if (!(r instanceof e))
            return;
        let i = r.getSubSelectionValue(n);
        if (!i)
            return;
        r = i;
    } return r; }
    getDeepSelectionParent(t) { let r = this.getSelectionParent(); if (!r)
        return; let n = r; for (let i of t) {
        let o = n.value.getFieldValue(i);
        if (!o || !(o instanceof e))
            return;
        let s = o.getSelectionParent();
        if (!s)
            return;
        n = s;
    } return n; }
    getSelectionParent() { var _b, _f; let t = (_b = this.getField("select")) === null || _b === void 0 ? void 0 : _b.value.asObject(); if (t)
        return { kind: "select", value: t }; let r = (_f = this.getField("include")) === null || _f === void 0 ? void 0 : _f.value.asObject(); if (r)
        return { kind: "include", value: r }; }
    getSubSelectionValue(t) { var _b; return (_b = this.getSelectionParent()) === null || _b === void 0 ? void 0 : _b.value.fields[t].value; }
    getPrintWidth() { let t = Object.values(this.fields); return t.length == 0 ? 2 : Math.max(...t.map(n => n.getPrintWidth())) + 2; }
    write(t) { let r = Object.values(this.fields); if (r.length === 0 && this.suggestions.length === 0) {
        this.writeEmpty(t);
        return;
    } this.writeWithContents(t, r); }
    asObject() { return this; }
    writeEmpty(t) { let r = new X("{}"); this.hasError && r.setColor(t.context.colors.red).underline(), t.write(r); }
    writeWithContents(t, r) { t.writeLine("{").withIndent(() => { t.writeJoined(Le, [...r, ...this.suggestions]).newLine(); }), t.write("}"), this.hasError && t.afterNextNewline(() => { t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth()))); }); }
};
var I = class extends me {
    constructor(r) { super(); this.text = r; }
    getPrintWidth() { return this.text.length; }
    write(r) { let n = new X(this.text); this.hasError && n.underline().setColor(r.context.colors.red), r.write(n); }
    asObject() { }
};
var ht = class {
    constructor() {
        this.fields = [];
    }
    addField(t, r) { return this.fields.push({ write(n) { let { green: i, dim: o } = n.context.colors; n.write(i(o(`${t}: ${r}`))).addMarginSymbol(i(o("+"))); } }), this; }
    write(t) { let { colors: { green: r } } = t.context; t.writeLine(r("{")).withIndent(() => { t.writeJoined(Le, this.fields).newLine(); }).write(r("}")).addMarginSymbol(r("+")); }
};
function er(e, t, r) { switch (e.kind) {
    case "MutuallyExclusiveFields":
        Yu(e, t);
        break;
    case "IncludeOnScalar":
        Xu(e, t);
        break;
    case "EmptySelection":
        ec(e, t, r);
        break;
    case "UnknownSelectionField":
        ic(e, t);
        break;
    case "InvalidSelectionValue":
        oc(e, t);
        break;
    case "UnknownArgument":
        sc(e, t);
        break;
    case "UnknownInputField":
        ac(e, t);
        break;
    case "RequiredArgumentMissing":
        lc(e, t);
        break;
    case "InvalidArgumentType":
        uc(e, t);
        break;
    case "InvalidArgumentValue":
        cc(e, t);
        break;
    case "ValueTooLarge":
        pc(e, t);
        break;
    case "SomeFieldsMissing":
        dc(e, t);
        break;
    case "TooManyFieldsGiven":
        mc(e, t);
        break;
    case "Union":
        ro(e, t, r);
        break;
    default: throw new Error("not implemented: " + e.kind);
} }
function Yu(e, t) { var _b, _f, _g; let r = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(); r && ((_f = r.getField(e.firstField)) === null || _f === void 0 ? void 0 : _f.markAsError(), (_g = r.getField(e.secondField)) === null || _g === void 0 ? void 0 : _g.markAsError()), t.addErrorMessage(n => `Please ${n.bold("either")} use ${n.green(`\`${e.firstField}\``)} or ${n.green(`\`${e.secondField}\``)}, but ${n.red("not both")} at the same time.`); }
function Xu(e, t) {
    var _b, _f;
    let [r, n] = je(e.selectionPath), i = e.outputType, o = (_b = t.arguments.getDeepSelectionParent(r)) === null || _b === void 0 ? void 0 : _b.value;
    if (o && ((_f = o.getField(n)) === null || _f === void 0 ? void 0 : _f.markAsError(), i))
        for (let s of i.fields)
            s.isRelation && o.addSuggestion(new j(s.name, "true"));
    t.addErrorMessage(s => {
        let a = `Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;
        return i ? a += ` on model ${s.bold(i.name)}. ${wt(s)}` : a += ".", a += `
Note that ${s.bold("include")} statements only accept relation fields.`, a;
    });
}
function ec(e, t, r) { var _b, _f; let n = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(); if (n) {
    let i = (_f = n.getField("omit")) === null || _f === void 0 ? void 0 : _f.value.asObject();
    if (i) {
        tc(e, t, i);
        return;
    }
    if (n.hasField("select")) {
        rc(e, t);
        return;
    }
} if (r === null || r === void 0 ? void 0 : r[de(e.outputType.name)]) {
    nc(e, t);
    return;
} t.addErrorMessage(() => `Unknown field at "${e.selectionPath.join(".")} selection"`); }
function tc(e, t, r) { r.removeAllFields(); for (let n of e.outputType.fields)
    r.addSuggestion(new j(n.name, "false")); t.addErrorMessage(n => `The ${n.red("omit")} statement includes every field of the model ${n.bold(e.outputType.name)}. At least one field must be included in the result`); }
function rc(e, t) { var _b, _f; let r = e.outputType, n = (_b = t.arguments.getDeepSelectionParent(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.value, i = (_f = n === null || n === void 0 ? void 0 : n.isEmpty()) !== null && _f !== void 0 ? _f : !1; n && (n.removeAllFields(), co(n, r)), t.addErrorMessage(o => i ? `The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${wt(o)}` : `The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`); }
function nc(e, t) { var _b, _f, _g; let r = new ht; for (let i of e.outputType.fields)
    i.isRelation || r.addField(i.name, "false"); let n = new j("omit", r).makeRequired(); if (e.selectionPath.length === 0)
    t.arguments.addSuggestion(n);
else {
    let [i, o] = je(e.selectionPath), a = (_f = (_b = t.arguments.getDeepSelectionParent(i)) === null || _b === void 0 ? void 0 : _b.value.asObject()) === null || _f === void 0 ? void 0 : _f.getField(o);
    if (a) {
        let l = (_g = a === null || a === void 0 ? void 0 : a.value.asObject()) !== null && _g !== void 0 ? _g : new qe;
        l.addSuggestion(n), a.value = l;
    }
} t.addErrorMessage(i => `The global ${i.red("omit")} configuration excludes every field of the model ${i.bold(e.outputType.name)}. At least one field must be included in the result`); }
function ic(e, t) { let r = po(e.selectionPath, t); if (r.parentKind !== "unknown") {
    r.field.markAsError();
    let n = r.parent;
    switch (r.parentKind) {
        case "select":
            co(n, e.outputType);
            break;
        case "include":
            fc(n, e.outputType);
            break;
        case "omit":
            gc(n, e.outputType);
            break;
    }
} t.addErrorMessage(n => { let i = [`Unknown field ${n.red(`\`${r.fieldName}\``)}`]; return r.parentKind !== "unknown" && i.push(`for ${n.bold(r.parentKind)} statement`), i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`), i.push(wt(n)), i.join(" "); }); }
function oc(e, t) { let r = po(e.selectionPath, t); r.parentKind !== "unknown" && r.field.value.markAsError(), t.addErrorMessage(n => `Invalid value for selection field \`${n.red(r.fieldName)}\`: ${e.underlyingError}`); }
function sc(e, t) { var _b, _f; let r = e.argumentPath[0], n = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(); n && ((_f = n.getField(r)) === null || _f === void 0 ? void 0 : _f.markAsError(), yc(n, e.arguments)), t.addErrorMessage(i => lo(i, r, e.arguments.map(o => o.name))); }
function ac(e, t) { var _b, _f, _g; let [r, n] = je(e.argumentPath), i = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(); if (i) {
    (_f = i.getDeepField(e.argumentPath)) === null || _f === void 0 ? void 0 : _f.markAsError();
    let o = (_g = i.getDeepFieldValue(r)) === null || _g === void 0 ? void 0 : _g.asObject();
    o && mo(o, e.inputType);
} t.addErrorMessage(o => lo(o, n, e.inputType.fields.map(s => s.name))); }
function lo(e, t, r) { let n = [`Unknown argument \`${e.red(t)}\`.`], i = wc(t, r); return i && n.push(`Did you mean \`${e.green(i)}\`?`), r.length > 0 && n.push(wt(e)), n.join(" "); }
function lc(e, t) { var _b, _f, _g; let r; t.addErrorMessage(l => (r === null || r === void 0 ? void 0 : r.value) instanceof I && r.value.text === "null" ? `Argument \`${l.green(o)}\` must not be ${l.red("null")}.` : `Argument \`${l.green(o)}\` is missing.`); let n = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(); if (!n)
    return; let [i, o] = je(e.argumentPath), s = new ht, a = (_f = n.getDeepFieldValue(i)) === null || _f === void 0 ? void 0 : _f.asObject(); if (a) {
    if (r = a.getField(o), r && a.removeField(o), e.inputTypes.length === 1 && e.inputTypes[0].kind === "object") {
        for (let l of e.inputTypes[0].fields)
            s.addField(l.name, l.typeNames.join(" | "));
        a.addSuggestion(new j(o, s).makeRequired());
    }
    else {
        let l = e.inputTypes.map(uo).join(" | ");
        a.addSuggestion(new j(o, l).makeRequired());
    }
    if (e.dependentArgumentPath) {
        (_g = n.getDeepField(e.dependentArgumentPath)) === null || _g === void 0 ? void 0 : _g.markAsError();
        let [, l] = je(e.dependentArgumentPath);
        t.addErrorMessage(u => `Argument \`${u.green(o)}\` is required because argument \`${u.green(l)}\` was provided.`);
    }
} }
function uo(e) { return e.kind === "list" ? `${uo(e.elementType)}[]` : e.name; }
function uc(e, t) { var _b, _f; let r = e.argument.name, n = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(); n && ((_f = n.getDeepFieldValue(e.argumentPath)) === null || _f === void 0 ? void 0 : _f.markAsError()), t.addErrorMessage(i => { let o = ir("or", e.argument.typeNames.map(s => i.green(s))); return `Argument \`${i.bold(r)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`; }); }
function cc(e, t) { var _b, _f; let r = e.argument.name, n = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(); n && ((_f = n.getDeepFieldValue(e.argumentPath)) === null || _f === void 0 ? void 0 : _f.markAsError()), t.addErrorMessage(i => { let o = [`Invalid value for argument \`${i.bold(r)}\``]; if (e.underlyingError && o.push(`: ${e.underlyingError}`), o.push("."), e.argument.typeNames.length > 0) {
    let s = ir("or", e.argument.typeNames.map(a => i.green(a)));
    o.push(` Expected ${s}.`);
} return o.join(""); }); }
function pc(e, t) { var _b, _f; let r = e.argument.name, n = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(), i; if (n) {
    let s = (_f = n.getDeepField(e.argumentPath)) === null || _f === void 0 ? void 0 : _f.value;
    s === null || s === void 0 ? void 0 : s.markAsError(), s instanceof I && (i = s.text);
} t.addErrorMessage(o => { let s = ["Unable to fit value"]; return i && s.push(o.red(i)), s.push(`into a 64-bit signed integer for field \`${o.bold(r)}\``), s.join(" "); }); }
function dc(e, t) { var _b, _f; let r = e.argumentPath[e.argumentPath.length - 1], n = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(); if (n) {
    let i = (_f = n.getDeepFieldValue(e.argumentPath)) === null || _f === void 0 ? void 0 : _f.asObject();
    i && mo(i, e.inputType);
} t.addErrorMessage(i => { let o = [`Argument \`${i.bold(r)}\` of type ${i.bold(e.inputType.name)} needs`]; return e.constraints.minFieldCount === 1 ? e.constraints.requiredFields ? o.push(`${i.green("at least one of")} ${ir("or", e.constraints.requiredFields.map(s => `\`${i.bold(s)}\``))} arguments.`) : o.push(`${i.green("at least one")} argument.`) : o.push(`${i.green(`at least ${e.constraints.minFieldCount}`)} arguments.`), o.push(wt(i)), o.join(" "); }); }
function mc(e, t) { var _b, _f; let r = e.argumentPath[e.argumentPath.length - 1], n = (_b = t.arguments.getDeepSubSelectionValue(e.selectionPath)) === null || _b === void 0 ? void 0 : _b.asObject(), i = []; if (n) {
    let o = (_f = n.getDeepFieldValue(e.argumentPath)) === null || _f === void 0 ? void 0 : _f.asObject();
    o && (o.markAsError(), i = Object.keys(o.getFields()));
} t.addErrorMessage(o => { let s = [`Argument \`${o.bold(r)}\` of type ${o.bold(e.inputType.name)} needs`]; return e.constraints.minFieldCount === 1 && e.constraints.maxFieldCount == 1 ? s.push(`${o.green("exactly one")} argument,`) : e.constraints.maxFieldCount == 1 ? s.push(`${o.green("at most one")} argument,`) : s.push(`${o.green(`at most ${e.constraints.maxFieldCount}`)} arguments,`), s.push(`but you provided ${ir("and", i.map(a => o.red(a)))}. Please choose`), e.constraints.maxFieldCount === 1 ? s.push("one.") : s.push(`${e.constraints.maxFieldCount}.`), s.join(" "); }); }
function co(e, t) { for (let r of t.fields)
    e.hasField(r.name) || e.addSuggestion(new j(r.name, "true")); }
function fc(e, t) { for (let r of t.fields)
    r.isRelation && !e.hasField(r.name) && e.addSuggestion(new j(r.name, "true")); }
function gc(e, t) { for (let r of t.fields)
    !e.hasField(r.name) && !r.isRelation && e.addSuggestion(new j(r.name, "true")); }
function yc(e, t) { for (let r of t)
    e.hasField(r.name) || e.addSuggestion(new j(r.name, r.typeNames.join(" | "))); }
function po(e, t) { var _b, _f, _g, _5; let [r, n] = je(e), i = (_b = t.arguments.getDeepSubSelectionValue(r)) === null || _b === void 0 ? void 0 : _b.asObject(); if (!i)
    return { parentKind: "unknown", fieldName: n }; let o = (_f = i.getFieldValue("select")) === null || _f === void 0 ? void 0 : _f.asObject(), s = (_g = i.getFieldValue("include")) === null || _g === void 0 ? void 0 : _g.asObject(), a = (_5 = i.getFieldValue("omit")) === null || _5 === void 0 ? void 0 : _5.asObject(), l = o === null || o === void 0 ? void 0 : o.getField(n); return o && l ? { parentKind: "select", parent: o, field: l, fieldName: n } : (l = s === null || s === void 0 ? void 0 : s.getField(n), s && l ? { parentKind: "include", field: l, parent: s, fieldName: n } : (l = a === null || a === void 0 ? void 0 : a.getField(n), a && l ? { parentKind: "omit", field: l, parent: a, fieldName: n } : { parentKind: "unknown", fieldName: n })); }
function mo(e, t) { if (t.kind === "object")
    for (let r of t.fields)
        e.hasField(r.name) || e.addSuggestion(new j(r.name, r.typeNames.join(" | "))); }
function je(e) { let t = [...e], r = t.pop(); if (!r)
    throw new Error("unexpected empty path"); return [t, r]; }
function wt({ green: e, enabled: t }) { return "Available options are " + (t ? `listed in ${e("green")}` : "marked with ?") + "."; }
function ir(e, t) { if (t.length === 1)
    return t[0]; let r = [...t], n = r.pop(); return `${r.join(", ")} ${e} ${n}`; }
var hc = 3;
function wc(e, t) { let r = 1 / 0, n; for (let i of t) {
    let o = (0, ao.default)(e, i);
    o > hc || o < r && (r = o, n = i);
} return n; }
var go = require("@prisma/client-runtime-utils");
var bt = class {
    constructor(t, r, n, i, o) { this.modelName = t, this.name = r, this.typeName = n, this.isList = i, this.isEnum = o; }
    _toGraphQLInputType() { let t = this.isList ? "List" : "", r = this.isEnum ? "Enum" : ""; return `${t}${r}${this.typeName}FieldRefInput<${this.modelName}>`; }
};
function Ue(e) { return e instanceof bt; }
var fo = ": ", or = class {
    constructor(t, r) {
        this.hasError = !1;
        this.name = t;
        this.value = r;
    }
    markAsError() { this.hasError = !0; }
    getPrintWidth() { return this.name.length + this.value.getPrintWidth() + fo.length; }
    write(t) { let r = new X(this.name); this.hasError && r.underline().setColor(t.context.colors.red), t.write(r).write(fo).write(this.value); }
};
var pn = class {
    constructor(t) {
        this.errorMessages = [];
        this.arguments = t;
    }
    write(t) { t.write(this.arguments); }
    addErrorMessage(t) { this.errorMessages.push(t); }
    renderAllMessages(t) {
        return this.errorMessages.map(r => r(t)).join(`
`);
    }
};
function Be(e) { return new pn(yo(e)); }
function yo(e) { let t = new qe; for (let [r, n] of Object.entries(e)) {
    let i = new or(r, ho(n));
    t.addField(i);
} return t; }
function ho(e) { if (typeof e == "string")
    return new I(JSON.stringify(e)); if (typeof e == "number" || typeof e == "boolean")
    return new I(String(e)); if (typeof e == "bigint")
    return new I(`${e}n`); if (e === null)
    return new I("null"); if (e === void 0)
    return new I("undefined"); if (Fe(e))
    return new I(`new Prisma.Decimal("${e.toFixed()}")`); if (e instanceof Uint8Array)
    return Buffer.isBuffer(e) ? new I(`Buffer.alloc(${e.byteLength})`) : new I(`new Uint8Array(${e.byteLength})`); if (e instanceof Date) {
    let t = Kt(e) ? e.toISOString() : "Invalid Date";
    return new I(`new Date("${t}")`);
} return (0, go.isObjectEnumValue)(e) ? new I(`Prisma.${e._getName()}`) : Ue(e) ? new I(`prisma.${de(e.modelName)}.$fields.${e.name}`) : Array.isArray(e) ? bc(e) : typeof e == "object" ? yo(e) : new I(Object.prototype.toString.call(e)); }
function bc(e) { let t = new Ve; for (let r of e)
    t.addItem(ho(r)); return t; }
function sr(e, t) { let r = t === "pretty" ? so : nr, n = e.renderAllMessages(r), i = new $e(0, { colors: r }).write(e).toString(); return { message: n, args: i }; }
function ar({ args: e, errors: t, errorFormat: r, callsite: n, originalMethod: i, clientVersion: o, globalOmit: s }) { let a = Be(e); for (let p of t)
    er(p, a, s); let { message: l, args: u } = sr(a, r), c = Xt({ message: l, callsite: n, originalMethod: i, showColors: r === "pretty", callArguments: u }); throw new wo.PrismaClientValidationError(c, { clientVersion: o }); }
function ee(e) { return e.replace(/^./, t => t.toLowerCase()); }
function xo(e, t, r) { let n = ee(r); return !t.result || !(t.result.$allModels || t.result[n]) ? e : xc({ ...e, ...bo(t.name, e, t.result.$allModels), ...bo(t.name, e, t.result[n]) }); }
function xc(e) { let t = new Y, r = (n, i) => t.getOrCreate(n, () => i.has(n) ? [n] : (i.add(n), e[n] ? e[n].needs.flatMap(o => r(o, i)) : [n])); return Wt(e, n => ({ ...n, needs: r(n.name, new Set) })); }
function bo(e, t, r) { return r ? Wt(r, ({ needs: n, compute: i }, o) => ({ name: o, needs: n ? Object.keys(n).filter(s => n[s]) : [], compute: Ec(t, o, i) })) : {}; }
function Ec(e, t, r) { var _b; let n = (_b = e === null || e === void 0 ? void 0 : e[t]) === null || _b === void 0 ? void 0 : _b.compute; return n ? i => r({ ...i, [t]: n(i) }) : r; }
function Eo(e, t) { if (!t)
    return e; let r = { ...e }; for (let n of Object.values(t))
    if (e[n.name])
        for (let i of n.needs)
            r[i] = !0; return r; }
function Po(e, t) { if (!t)
    return e; let r = { ...e }; for (let n of Object.values(t))
    if (!e[n.name])
        for (let i of n.needs)
            delete r[i]; return r; }
var lr = class {
    constructor(t, r) {
        this.computedFieldsCache = new Y;
        this.modelExtensionsCache = new Y;
        this.queryCallbacksCache = new Y;
        this.clientExtensions = it(() => { var _b, _f; return this.extension.client ? { ...(_b = this.previous) === null || _b === void 0 ? void 0 : _b.getAllClientExtensions(), ...this.extension.client } : (_f = this.previous) === null || _f === void 0 ? void 0 : _f.getAllClientExtensions(); });
        this.batchCallbacks = it(() => { var _b, _f, _g; let t = (_f = (_b = this.previous) === null || _b === void 0 ? void 0 : _b.getAllBatchQueryCallbacks()) !== null && _f !== void 0 ? _f : [], r = (_g = this.extension.query) === null || _g === void 0 ? void 0 : _g.$__internalBatch; return r ? t.concat(r) : t; });
        this.extension = t;
        this.previous = r;
    }
    getAllComputedFields(t) { return this.computedFieldsCache.getOrCreate(t, () => { var _b; return xo((_b = this.previous) === null || _b === void 0 ? void 0 : _b.getAllComputedFields(t), this.extension, t); }); }
    getAllClientExtensions() { return this.clientExtensions.get(); }
    getAllModelExtensions(t) { return this.modelExtensionsCache.getOrCreate(t, () => { var _b, _f; let r = ee(t); return !this.extension.model || !(this.extension.model[r] || this.extension.model.$allModels) ? (_b = this.previous) === null || _b === void 0 ? void 0 : _b.getAllModelExtensions(t) : { ...(_f = this.previous) === null || _f === void 0 ? void 0 : _f.getAllModelExtensions(t), ...this.extension.model.$allModels, ...this.extension.model[r] }; }); }
    getAllQueryCallbacks(t, r) { return this.queryCallbacksCache.getOrCreate(`${t}:${r}`, () => { var _b, _f; let n = (_f = (_b = this.previous) === null || _b === void 0 ? void 0 : _b.getAllQueryCallbacks(t, r)) !== null && _f !== void 0 ? _f : [], i = [], o = this.extension.query; return !o || !(o[t] || o.$allModels || o[r] || o.$allOperations) ? n : (o[t] !== void 0 && (o[t][r] !== void 0 && i.push(o[t][r]), o[t].$allOperations !== void 0 && i.push(o[t].$allOperations)), t !== "$none" && o.$allModels !== void 0 && (o.$allModels[r] !== void 0 && i.push(o.$allModels[r]), o.$allModels.$allOperations !== void 0 && i.push(o.$allModels.$allOperations)), o[r] !== void 0 && i.push(o[r]), o.$allOperations !== void 0 && i.push(o.$allOperations), n.concat(i)); }); }
    getAllBatchQueryCallbacks() { return this.batchCallbacks.get(); }
}, Qe = class e {
    constructor(t) { this.head = t; }
    static empty() { return new e; }
    static single(t) { return new e(new lr(t)); }
    isEmpty() { return this.head === void 0; }
    append(t) { return new e(new lr(t, this.head)); }
    getAllComputedFields(t) { var _b; return (_b = this.head) === null || _b === void 0 ? void 0 : _b.getAllComputedFields(t); }
    getAllClientExtensions() { var _b; return (_b = this.head) === null || _b === void 0 ? void 0 : _b.getAllClientExtensions(); }
    getAllModelExtensions(t) { var _b; return (_b = this.head) === null || _b === void 0 ? void 0 : _b.getAllModelExtensions(t); }
    getAllQueryCallbacks(t, r) { var _b, _f; return (_f = (_b = this.head) === null || _b === void 0 ? void 0 : _b.getAllQueryCallbacks(t, r)) !== null && _f !== void 0 ? _f : []; }
    getAllBatchQueryCallbacks() { var _b, _f; return (_f = (_b = this.head) === null || _b === void 0 ? void 0 : _b.getAllBatchQueryCallbacks()) !== null && _f !== void 0 ? _f : []; }
};
var ur = class {
    constructor(t) { this.name = t; }
};
function To(e) { return e instanceof ur; }
function So(e) { return new ur(e); }
var vo = Symbol(), xt = class {
    constructor(t) { if (t !== vo)
        throw new Error("Skip instance can not be constructed directly"); }
    ifUndefined(t) { return t === void 0 ? cr : t; }
}, cr = new xt(vo);
function Q(e) { return e instanceof xt; }
var Pc = { findUnique: "findUnique", findUniqueOrThrow: "findUniqueOrThrow", findFirst: "findFirst", findFirstOrThrow: "findFirstOrThrow", findMany: "findMany", count: "aggregate", create: "createOne", createMany: "createMany", createManyAndReturn: "createManyAndReturn", update: "updateOne", updateMany: "updateMany", updateManyAndReturn: "updateManyAndReturn", upsert: "upsertOne", delete: "deleteOne", deleteMany: "deleteMany", executeRaw: "executeRaw", queryRaw: "queryRaw", aggregate: "aggregate", groupBy: "groupBy", runCommandRaw: "runCommandRaw", findRaw: "findRaw", aggregateRaw: "aggregateRaw" }, Co = "explicitly `undefined` values are not allowed";
function pr({ modelName: e, action: t, args: r, runtimeDataModel: n, extensions: i = Qe.empty(), callsite: o, clientMethod: s, errorFormat: a, clientVersion: l, previewFeatures: u, globalOmit: c, wrapRawValues: p }) { let d = new dn({ runtimeDataModel: n, modelName: e, action: t, rootArgs: r, callsite: o, extensions: i, selectionPath: [], argumentPath: [], originalMethod: s, errorFormat: a, clientVersion: l, previewFeatures: u, globalOmit: c, wrapRawValues: p }); return { modelName: e, action: Pc[t], query: Et(r, d) }; }
function Et({ select: e, include: t, ...r } = {}, n) { let i = r.omit; return delete r.omit, { arguments: ko(r, n), selection: Tc(e, t, i, n) }; }
function Tc(e, t, r, n) { return e ? (t ? n.throwValidationError({ kind: "MutuallyExclusiveFields", firstField: "include", secondField: "select", selectionPath: n.getSelectionPath() }) : r && n.throwValidationError({ kind: "MutuallyExclusiveFields", firstField: "omit", secondField: "select", selectionPath: n.getSelectionPath() }), Cc(e, n)) : Sc(n, t, r); }
function Sc(e, t, r) { let n = {}; return e.modelOrType && !e.isRawAction() && (n.$composites = !0, n.$scalars = !0), t && vc(n, t, e), Ac(n, r, e), n; }
function vc(e, t, r) { for (let [n, i] of Object.entries(t)) {
    if (Q(i))
        continue;
    let o = r.nestSelection(n);
    if (mn(i, o), i === !1 || i === void 0) {
        e[n] = !1;
        continue;
    }
    let s = r.findField(n);
    if (s && s.kind !== "object" && r.throwValidationError({ kind: "IncludeOnScalar", selectionPath: r.getSelectionPath().concat(n), outputType: r.getOutputTypeDescription() }), s) {
        e[n] = Et(i === !0 ? {} : i, o);
        continue;
    }
    if (i === !0) {
        e[n] = !0;
        continue;
    }
    e[n] = Et(i, o);
} }
function Ac(e, t, r) { let n = r.getComputedFields(), i = { ...r.getGlobalOmit(), ...t }, o = Po(i, n); for (let [s, a] of Object.entries(o)) {
    if (Q(a))
        continue;
    mn(a, r.nestSelection(s));
    let l = r.findField(s);
    (n === null || n === void 0 ? void 0 : n[s]) && !l || (e[s] = !a);
} }
function Cc(e, t) { let r = {}, n = t.getComputedFields(), i = Eo(e, n); for (let [o, s] of Object.entries(i)) {
    if (Q(s))
        continue;
    let a = t.nestSelection(o);
    mn(s, a);
    let l = t.findField(o);
    if (!((n === null || n === void 0 ? void 0 : n[o]) && !l)) {
        if (s === !1 || s === void 0 || Q(s)) {
            r[o] = !1;
            continue;
        }
        if (s === !0) {
            (l === null || l === void 0 ? void 0 : l.kind) === "object" ? r[o] = Et({}, a) : r[o] = !0;
            continue;
        }
        r[o] = Et(s, a);
    }
} return r; }
function Ro(e, t) { if (e === null)
    return null; if (typeof e == "string" || typeof e == "number" || typeof e == "boolean")
    return e; if (typeof e == "bigint")
    return { $type: "BigInt", value: String(e) }; if (Me(e)) {
    if (Kt(e))
        return { $type: "DateTime", value: e.toISOString() };
    t.throwValidationError({ kind: "InvalidArgumentValue", selectionPath: t.getSelectionPath(), argumentPath: t.getArgumentPath(), argument: { name: t.getArgumentName(), typeNames: ["Date"] }, underlyingError: "Provided Date object is invalid" });
} if (To(e))
    return { $type: "Param", value: e.name }; if (Ue(e))
    return { $type: "FieldRef", value: { _ref: e.name, _container: e.modelName } }; if (Array.isArray(e))
    return Rc(e, t); if (ArrayBuffer.isView(e)) {
    let { buffer: r, byteOffset: n, byteLength: i } = e;
    return { $type: "Bytes", value: Buffer.from(r, n, i).toString("base64") };
} if (kc(e))
    return e.values; if (Fe(e))
    return { $type: "Decimal", value: e.toFixed() }; if ((0, Ao.isObjectEnumValue)(e)) {
    let r = e._getName();
    if (r !== "DbNull" && r !== "JsonNull" && r !== "AnyNull")
        throw new Error(`Invalid ObjectEnumValue: expected DbNull, JsonNull, or AnyNull, got ${r}`);
    return { $type: "Enum", value: r };
} if (Ic(e))
    return e.toJSON(); if (typeof e == "object")
    return ko(e, t); t.throwValidationError({ kind: "InvalidArgumentValue", selectionPath: t.getSelectionPath(), argumentPath: t.getArgumentPath(), argument: { name: t.getArgumentName(), typeNames: [] }, underlyingError: `We could not serialize ${Object.prototype.toString.call(e)} value. Serialize the object to JSON or implement a ".toJSON()" method on it` }); }
function ko(e, t) { if (t.shouldWrapRawValues() && e.$type)
    return { $type: "Raw", value: e }; let r = {}; for (let n in e) {
    let i = e[n], o = t.nestArgument(n);
    Q(i) || (i !== void 0 ? r[n] = Ro(i, o) : t.isPreviewFeatureOn("strictUndefinedChecks") && t.throwValidationError({ kind: "InvalidArgumentValue", argumentPath: o.getArgumentPath(), selectionPath: t.getSelectionPath(), argument: { name: t.getArgumentName(), typeNames: [] }, underlyingError: Co }));
} return r; }
function Rc(e, t) { let r = []; for (let n = 0; n < e.length; n++) {
    let i = t.nestArgument(String(n)), o = e[n];
    if (o === void 0 || Q(o)) {
        let s = o === void 0 ? "undefined" : "Prisma.skip";
        t.throwValidationError({ kind: "InvalidArgumentValue", selectionPath: i.getSelectionPath(), argumentPath: i.getArgumentPath(), argument: { name: `${t.getArgumentName()}[${n}]`, typeNames: [] }, underlyingError: `Can not use \`${s}\` value within array. Use \`null\` or filter out \`${s}\` values` });
    }
    r.push(Ro(o, i));
} return r; }
function kc(e) { return typeof e == "object" && e !== null && e.__prismaRawParameters__ === !0; }
function Ic(e) { return typeof e == "object" && e !== null && typeof e.toJSON == "function"; }
function mn(e, t) { e === void 0 && t.isPreviewFeatureOn("strictUndefinedChecks") && t.throwValidationError({ kind: "InvalidSelectionValue", selectionPath: t.getSelectionPath(), underlyingError: Co }); }
var dn = class e {
    constructor(t) { var _b; this.params = t; this.params.modelName && (this.modelOrType = (_b = this.params.runtimeDataModel.models[this.params.modelName]) !== null && _b !== void 0 ? _b : this.params.runtimeDataModel.types[this.params.modelName]); }
    throwValidationError(t) { var _b; ar({ errors: [t], originalMethod: this.params.originalMethod, args: (_b = this.params.rootArgs) !== null && _b !== void 0 ? _b : {}, callsite: this.params.callsite, errorFormat: this.params.errorFormat, clientVersion: this.params.clientVersion, globalOmit: this.params.globalOmit }); }
    getSelectionPath() { return this.params.selectionPath; }
    getArgumentPath() { return this.params.argumentPath; }
    getArgumentName() { return this.params.argumentPath[this.params.argumentPath.length - 1]; }
    getOutputTypeDescription() { if (!(!this.params.modelName || !this.modelOrType))
        return { name: this.params.modelName, fields: this.modelOrType.fields.map(t => ({ name: t.name, typeName: "boolean", isRelation: t.kind === "object" })) }; }
    isRawAction() { return ["executeRaw", "queryRaw", "runCommandRaw", "findRaw", "aggregateRaw"].includes(this.params.action); }
    isPreviewFeatureOn(t) { return this.params.previewFeatures.includes(t); }
    shouldWrapRawValues() { var _b; return (_b = this.params.wrapRawValues) !== null && _b !== void 0 ? _b : !0; }
    getComputedFields() { if (this.params.modelName)
        return this.params.extensions.getAllComputedFields(this.params.modelName); }
    findField(t) { var _b; return (_b = this.modelOrType) === null || _b === void 0 ? void 0 : _b.fields.find(r => r.name === t); }
    nestSelection(t) { let r = this.findField(t), n = (r === null || r === void 0 ? void 0 : r.kind) === "object" ? r.type : void 0; return new e({ ...this.params, modelName: n, selectionPath: this.params.selectionPath.concat(t) }); }
    getGlobalOmit() { var _b, _f; return this.params.modelName && this.shouldApplyGlobalOmit() ? (_f = (_b = this.params.globalOmit) === null || _b === void 0 ? void 0 : _b[de(this.params.modelName)]) !== null && _f !== void 0 ? _f : {} : {}; }
    shouldApplyGlobalOmit() { switch (this.params.action) {
        case "findFirst":
        case "findFirstOrThrow":
        case "findUniqueOrThrow":
        case "findMany":
        case "upsert":
        case "findUnique":
        case "createManyAndReturn":
        case "create":
        case "update":
        case "updateManyAndReturn":
        case "delete": return !0;
        case "executeRaw":
        case "aggregateRaw":
        case "runCommandRaw":
        case "findRaw":
        case "createMany":
        case "deleteMany":
        case "groupBy":
        case "updateMany":
        case "count":
        case "aggregate":
        case "queryRaw": return !1;
        default: ae(this.params.action, "Unknown action");
    } }
    nestArgument(t) { return new e({ ...this.params, argumentPath: this.params.argumentPath.concat(t) }); }
};
function Io(e, t) { let r = it(() => Oc(t)); Object.defineProperty(e, "dmmf", { get: () => r.get() }); }
function Oc(e) { return { datamodel: { models: fn(e.models), enums: fn(e.enums), types: fn(e.types) } }; }
function fn(e) { return Object.entries(e).map(([t, r]) => ({ name: t, ...r })); }
var gn = new WeakMap, dr = "$$PrismaTypedSql", Pt = class {
    constructor(t, r) { gn.set(this, { sql: t, values: r }), Object.defineProperty(this, dr, { value: dr }); }
    get sql() { return gn.get(this).sql; }
    get values() { return gn.get(this).values; }
};
function Oo(e) { return (...t) => new Pt(e, t); }
function mr(e) { return e != null && e[dr] === dr; }
var Hl = require("@prisma/client-runtime-utils");
var zl = require("node:async_hooks"), Gl = require("node:events");
function Tt(e) { return { getKeys() { return Object.keys(e); }, getPropertyValue(t) { return e[t]; } }; }
function $(e, t) { return { getKeys() { return [e]; }, getPropertyValue() { return t(); } }; }
function Ee(e) { let t = new Y; return { getKeys() { return e.getKeys(); }, getPropertyValue(r) { return t.getOrCreate(r, () => e.getPropertyValue(r)); }, getPropertyDescriptor(r) { var _b; return (_b = e.getPropertyDescriptor) === null || _b === void 0 ? void 0 : _b.call(e, r); } }; }
var fr = { enumerable: !0, configurable: !0, writable: !0 };
function gr(e) { let t = new Set(e); return { getPrototypeOf: () => Object.prototype, getOwnPropertyDescriptor: () => fr, has: (r, n) => t.has(n), set: (r, n, i) => t.add(n) && Reflect.set(r, n, i), ownKeys: () => [...t] }; }
var No = Symbol.for("nodejs.util.inspect.custom");
function W(e, t) { let r = Nc(t), n = new Set, i = new Proxy(e, { get(o, s) { if (n.has(s))
        return o[s]; let a = r.get(s); return a ? a.getPropertyValue(s) : o[s]; }, has(o, s) { var _b, _f; if (n.has(s))
        return !0; let a = r.get(s); return a ? (_f = (_b = a.has) === null || _b === void 0 ? void 0 : _b.call(a, s)) !== null && _f !== void 0 ? _f : !0 : Reflect.has(o, s); }, ownKeys(o) { let s = Do(Reflect.ownKeys(o), r), a = Do(Array.from(r.keys()), r); return [...new Set([...s, ...a, ...n])]; }, set(o, s, a) { var _b, _f, _g; return ((_g = (_f = (_b = r.get(s)) === null || _b === void 0 ? void 0 : _b.getPropertyDescriptor) === null || _f === void 0 ? void 0 : _f.call(_b, s)) === null || _g === void 0 ? void 0 : _g.writable) === !1 ? !1 : (n.add(s), Reflect.set(o, s, a)); }, getOwnPropertyDescriptor(o, s) { let a = Reflect.getOwnPropertyDescriptor(o, s); if (a && !a.configurable)
        return a; let l = r.get(s); return l ? l.getPropertyDescriptor ? { ...fr, ...l === null || l === void 0 ? void 0 : l.getPropertyDescriptor(s) } : fr : a; }, defineProperty(o, s, a) { return n.add(s), Reflect.defineProperty(o, s, a); }, getPrototypeOf: () => Object.prototype }); return i[No] = function () { let o = { ...this }; return delete o[No], o; }, i; }
function Nc(e) { let t = new Map; for (let r of e) {
    let n = r.getKeys();
    for (let i of n)
        t.set(i, r);
} return t; }
function Do(e, t) { return e.filter(r => { var _b, _f, _g; return (_g = (_f = (_b = t.get(r)) === null || _b === void 0 ? void 0 : _b.has) === null || _f === void 0 ? void 0 : _f.call(_b, r)) !== null && _g !== void 0 ? _g : !0; }); }
function Je(e) { return { getKeys() { return e; }, has() { return !1; }, getPropertyValue() { } }; }
function Mo(e) { if (e === void 0)
    return ""; let t = Be(e); return new $e(0, { colors: nr }).write(t).toString(); }
var St = "<unknown>";
function Fo(e) {
    var t = e.split(`
`);
    return t.reduce(function (r, n) { var i = Fc(n) || $c(n) || qc(n) || Qc(n) || Uc(n); return i && r.push(i), r; }, []);
}
var Dc = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, Mc = /\((\S*)(?::(\d+))(?::(\d+))\)/;
function Fc(e) { var t = Dc.exec(e); if (!t)
    return null; var r = t[2] && t[2].indexOf("native") === 0, n = t[2] && t[2].indexOf("eval") === 0, i = Mc.exec(t[2]); return n && i != null && (t[2] = i[1], t[3] = i[2], t[4] = i[3]), { file: r ? null : t[2], methodName: t[1] || St, arguments: r ? [t[2]] : [], lineNumber: t[3] ? +t[3] : null, column: t[4] ? +t[4] : null }; }
var _c = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
function $c(e) { var t = _c.exec(e); return t ? { file: t[2], methodName: t[1] || St, arguments: [], lineNumber: +t[3], column: t[4] ? +t[4] : null } : null; }
var Lc = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i, Vc = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
function qc(e) { var t = Lc.exec(e); if (!t)
    return null; var r = t[3] && t[3].indexOf(" > eval") > -1, n = Vc.exec(t[3]); return r && n != null && (t[3] = n[1], t[4] = n[2], t[5] = null), { file: t[3], methodName: t[1] || St, arguments: t[2] ? t[2].split(",") : [], lineNumber: t[4] ? +t[4] : null, column: t[5] ? +t[5] : null }; }
var jc = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;
function Uc(e) { var t = jc.exec(e); return t ? { file: t[3], methodName: t[1] || St, arguments: [], lineNumber: +t[4], column: t[5] ? +t[5] : null } : null; }
var Bc = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;
function Qc(e) { var t = Bc.exec(e); return t ? { file: t[2], methodName: t[1] || St, arguments: [], lineNumber: +t[3], column: t[4] ? +t[4] : null } : null; }
var yn = class {
    getLocation() { return null; }
}, hn = class {
    constructor() { this._error = new Error; }
    getLocation() { let t = this._error.stack; if (!t)
        return null; let n = Fo(t).find(i => { if (!i.file)
        return !1; let o = on(i.file); return o !== "<anonymous>" && !o.includes("@prisma") && !o.includes("/packages/client/src/runtime/") && !o.endsWith("/runtime/client.js") && !o.startsWith("internal/") && !i.methodName.includes("new ") && !i.methodName.includes("getCallSite") && !i.methodName.includes("Proxy.") && i.methodName.split(".").length < 4; }); return !n || !n.file ? null : { fileName: n.file, lineNumber: n.lineNumber, columnNumber: n.column }; }
};
function fe(e) { return e === "minimal" ? typeof $EnabledCallSite == "function" && e !== "minimal" ? new $EnabledCallSite : new yn : new hn; }
var _o = { _avg: !0, _count: !0, _sum: !0, _min: !0, _max: !0 };
function He(e = {}) { let t = Hc(e); return Object.entries(t).reduce((n, [i, o]) => (_o[i] !== void 0 ? n.select[i] = { select: o } : n[i] = o, n), { select: {} }); }
function Hc(e = {}) { return typeof e._count == "boolean" ? { ...e, _count: { _all: e._count } } : e; }
function yr(e = {}) { return t => (typeof e._count == "boolean" && (t._count = t._count._all), t); }
function $o(e, t) { let r = yr(e); return t({ action: "aggregate", unpacker: r, argsMapper: He })(e); }
function zc(e = {}) { let { select: t, ...r } = e; return typeof t == "object" ? He({ ...r, _count: t }) : He({ ...r, _count: { _all: !0 } }); }
function Gc(e = {}) { return typeof e.select == "object" ? t => yr(e)(t)._count : t => yr(e)(t)._count._all; }
function Lo(e, t) { return t({ action: "count", unpacker: Gc(e), argsMapper: zc })(e); }
function Wc(e = {}) { let t = He(e); if (Array.isArray(t.by))
    for (let r of t.by)
        typeof r == "string" && (t.select[r] = !0);
else
    typeof t.by == "string" && (t.select[t.by] = !0); return t; }
function Kc(e = {}) { return t => (typeof (e === null || e === void 0 ? void 0 : e._count) == "boolean" && t.forEach(r => { r._count = r._count._all; }), t); }
function Vo(e, t) { return t({ action: "groupBy", unpacker: Kc(e), argsMapper: Wc })(e); }
function qo(e, t, r) { if (t === "aggregate")
    return n => $o(n, r); if (t === "count")
    return n => Lo(n, r); if (t === "groupBy")
    return n => Vo(n, r); }
function jo(e, t) { let r = t.fields.filter(i => !i.relationName), n = Si(r, "name"); return new Proxy({}, { get(i, o) { if (o in i || typeof o == "symbol")
        return i[o]; let s = n[o]; if (s)
        return new bt(e, o, s.type, s.isList, s.kind === "enum"); }, ...gr(Object.keys(n)) }); }
var Uo = e => Array.isArray(e) ? e : e.split("."), wn = (e, t) => Uo(t).reduce((r, n) => r && r[n], e), Bo = (e, t, r) => Uo(t).reduceRight((n, i, o, s) => Object.assign({}, wn(e, s.slice(0, o)), { [i]: n }), r);
function Zc(e, t) { return e === void 0 || t === void 0 ? [] : [...t, "select", e]; }
function Yc(e, t, r) { return t === void 0 ? e !== null && e !== void 0 ? e : {} : Bo(t, r, e || !0); }
function bn(e, t, r, n, i, o) { let a = e._runtimeDataModel.models[t].fields.reduce((l, u) => ({ ...l, [u.name]: u }), {}); return l => { let u = fe(e._errorFormat), c = Zc(n, i), p = Yc(l, o, c), d = r({ dataPath: c, callsite: u })(p), m = Xc(e, t); return new Proxy(d, { get(g, x) { if (!m.includes(x))
        return g[x]; let k = [a[x].type, r, x], P = [c, p]; return bn(e, ...k, ...P); }, ...gr([...m, ...Object.getOwnPropertyNames(d)]) }); }; }
function Xc(e, t) { return e._runtimeDataModel.models[t].fields.filter(r => r.kind === "object").map(r => r.name); }
var ep = ["findUnique", "findUniqueOrThrow", "findFirst", "findFirstOrThrow", "create", "update", "upsert", "delete"], tp = ["aggregate", "count", "groupBy"];
function xn(e, t) { var _b; let r = (_b = e._extensions.getAllModelExtensions(t)) !== null && _b !== void 0 ? _b : {}, n = [rp(e, t), ip(e, t), Tt(r), $("name", () => t), $("$name", () => t), $("$parent", () => e._appliedParent)]; return W({}, n); }
function rp(e, t) { let r = ee(t), n = Object.keys(_e).concat("count"); return { getKeys() { return n; }, getPropertyValue(i) { let o = i, s = a => l => { let u = fe(e._errorFormat); return e._createPrismaPromise(c => { let p = { args: l, dataPath: [], action: o, model: t, clientMethod: `${r}.${i}`, jsModelName: r, transaction: c, callsite: u }; return e._request({ ...p, ...a }); }, { action: o, args: l, model: t }); }; return ep.includes(o) ? bn(e, t, s) : np(i) ? qo(e, i, s) : s({}); } }; }
function np(e) { return tp.includes(e); }
function ip(e, t) { return Ee($("fields", () => { let r = e._runtimeDataModel.models[t]; return jo(t, r); })); }
function Qo(e) { return e.replace(/^./, t => t.toUpperCase()); }
var En = Symbol();
function vt(e) { let t = [op(e), sp(e), $(En, () => e), $("$parent", () => e._appliedParent)], r = e._extensions.getAllClientExtensions(); return r && t.push(Tt(r)), W(e, t); }
function op(e) { let t = Object.getPrototypeOf(e._originalClient), r = [...new Set(Object.getOwnPropertyNames(t))]; return { getKeys() { return r; }, getPropertyValue(n) { return e[n]; } }; }
function sp(e) { let t = Object.keys(e._runtimeDataModel.models), r = t.map(ee), n = [...new Set(t.concat(r))]; return Ee({ getKeys() { return n; }, getPropertyValue(i) { let o = Qo(i); if (e._runtimeDataModel.models[o] !== void 0)
        return xn(e, o); if (e._runtimeDataModel.models[i] !== void 0)
        return xn(e, i); }, getPropertyDescriptor(i) { if (!r.includes(i))
        return { enumerable: !1 }; } }); }
function Jo(e) { return e[En] ? e[En] : e; }
function Ho(e) { if (typeof e == "function")
    return e(this); let t = Object.create(this._originalClient, { _extensions: { value: this._extensions.append(e) }, _appliedParent: { value: this, configurable: !0 }, $on: { value: void 0 } }); return vt(t); }
function zo({ result: e, modelName: t, select: r, omit: n, extensions: i }) { let o = i.getAllComputedFields(t); if (!o)
    return e; let s = [], a = []; for (let l of Object.values(o)) {
    if (n) {
        if (n[l.name])
            continue;
        let u = l.needs.filter(c => n[c]);
        u.length > 0 && a.push(Je(u));
    }
    else if (r) {
        if (!r[l.name])
            continue;
        let u = l.needs.filter(c => !r[c]);
        u.length > 0 && a.push(Je(u));
    }
    ap(e, l.needs) && s.push(lp(l, W(e, s)));
} return s.length > 0 || a.length > 0 ? W(e, [...s, ...a]) : e; }
function ap(e, t) { return t.every(r => sn(e, r)); }
function lp(e, t) { return Ee($(e.name, () => e.compute(t))); }
function hr({ visitor: e, result: t, args: r, runtimeDataModel: n, modelName: i }) { var _b; if (Array.isArray(t)) {
    for (let s = 0; s < t.length; s++)
        t[s] = hr({ result: t[s], args: r, modelName: i, runtimeDataModel: n, visitor: e });
    return t;
} let o = (_b = e(t, i, r)) !== null && _b !== void 0 ? _b : t; return r.include && Go({ includeOrSelect: r.include, result: o, parentModelName: i, runtimeDataModel: n, visitor: e }), r.select && Go({ includeOrSelect: r.select, result: o, parentModelName: i, runtimeDataModel: n, visitor: e }), o; }
function Go({ includeOrSelect: e, result: t, parentModelName: r, runtimeDataModel: n, visitor: i }) { for (let [o, s] of Object.entries(e)) {
    if (!s || t[o] == null || Q(s))
        continue;
    let l = n.models[r].fields.find(c => c.name === o);
    if (!l || l.kind !== "object" || !l.relationName)
        continue;
    let u = typeof s == "object" ? s : {};
    t[o] = hr({ visitor: i, result: t[o], args: u, modelName: l.type, runtimeDataModel: n });
} }
function Wo({ result: e, modelName: t, args: r, extensions: n, runtimeDataModel: i, globalOmit: o }) { return n.isEmpty() || e == null || typeof e != "object" || !i.models[t] ? e : hr({ result: e, args: r !== null && r !== void 0 ? r : {}, modelName: t, runtimeDataModel: i, visitor: (a, l, u) => { let c = ee(l); return zo({ result: a, modelName: c, select: u.select, omit: u.select ? void 0 : { ...o === null || o === void 0 ? void 0 : o[c], ...u.omit }, extensions: n }); } }); }
var Pe = require("@prisma/client-runtime-utils");
var up = ["$connect", "$disconnect", "$on", "$use", "$extends"], Ko = up;
function Zo(e) { if (e instanceof Pe.Sql)
    return cp(e); if (mr(e))
    return pp(e); if (Array.isArray(e)) {
    let r = [e[0]];
    for (let n = 1; n < e.length; n++)
        r[n] = At(e[n]);
    return r;
} let t = {}; for (let r in e)
    t[r] = At(e[r]); return t; }
function cp(e) { return new Pe.Sql(e.strings, e.values); }
function pp(e) { return new Pt(e.sql, e.values); }
function At(e) { if (typeof e != "object" || e == null || (0, Pe.isObjectEnumValue)(e) || Ue(e) || Q(e))
    return e; if (Fe(e))
    return new Pe.Decimal(e.toFixed()); if (Me(e))
    return new Date(+e); if (ArrayBuffer.isView(e))
    return e.slice(0); if (Array.isArray(e)) {
    let t = e.length, r;
    for (r = Array(t); t--;)
        r[t] = At(e[t]);
    return r;
} if (typeof e == "object") {
    let t = {};
    for (let r in e)
        r === "__proto__" ? Object.defineProperty(t, r, { value: At(e[r]), configurable: !0, enumerable: !0, writable: !0 }) : t[r] = At(e[r]);
    return t;
} ae(e, "Unknown value"); }
function Xo(e, t, r, n = 0) { return e._createPrismaPromise(i => { var _b, _f; let o = t.customDataProxyFetch; return "transaction" in t && i !== void 0 && (((_b = t.transaction) === null || _b === void 0 ? void 0 : _b.kind) === "batch" && t.transaction.lock.then(), t.transaction = i), n === r.length ? e._executeRequest(t) : r[n]({ model: t.model, operation: t.model ? t.action : t.clientMethod, args: Zo((_f = t.args) !== null && _f !== void 0 ? _f : {}), __internalParams: t, query: (s, a = t) => { let l = a.customDataProxyFetch; return a.customDataProxyFetch = ns(o, l), a.args = s, Xo(e, a, r, n + 1); } }); }); }
function es(e, t) { let { jsModelName: r, action: n, clientMethod: i } = t, o = r ? n : i; if (e._extensions.isEmpty())
    return e._executeRequest(t); let s = e._extensions.getAllQueryCallbacks(r !== null && r !== void 0 ? r : "$none", o); return Xo(e, t, s); }
function ts(e) { return t => { let r = { requests: t }, n = t[0].extensions.getAllBatchQueryCallbacks(); return n.length ? rs(r, n, 0, e) : e(r); }; }
function rs(e, t, r, n) { if (r === t.length)
    return n(e); let i = e.customDataProxyFetch, o = e.requests[0].transaction; return t[r]({ args: { queries: e.requests.map(s => ({ model: s.modelName, operation: s.action, args: s.args })), transaction: o ? { isolationLevel: o.kind === "batch" ? o.isolationLevel : void 0 } : void 0 }, __internalParams: e, query(s, a = e) { let l = a.customDataProxyFetch; return a.customDataProxyFetch = ns(i, l), rs(a, t, r + 1, n); } }); }
var Yo = e => e;
function ns(e = Yo, t = Yo) { return r => e(t(r)); }
function os({ dataPath: e, modelName: t, args: r, runtimeDataModel: n }) { let i = { modelName: t, args: r !== null && r !== void 0 ? r : {} }, o = dp(e); if (!o || o.length === 0)
    return i; let s = t, a = r !== null && r !== void 0 ? r : {}; for (let l of o) {
    let u = n.models[s];
    if (!u)
        return i;
    let c = u.fields.find(p => p.name === l);
    if (!c)
        throw new Error(`Could not resolve relation field "${l}" on model "${s}" from dataPath "${e.join(".")}"`);
    if (c.kind !== "object" || !c.relationName)
        return i;
    s = c.type, a = mp(a, l);
} return { modelName: s, args: a }; }
function dp(e) { let t = []; for (let r = 0; r < e.length; r += 2) {
    let n = e[r], i = e[r + 1];
    if (n !== "select" && n !== "include" || i === void 0)
        return;
    t.push(i);
} return t; }
function mp(e, t) { var _b, _f; let r = (_b = e.select) === null || _b === void 0 ? void 0 : _b[t]; if (is(r))
    return r; let n = (_f = e.include) === null || _f === void 0 ? void 0 : _f[t]; return is(n) ? n : {}; }
function is(e) { return !!e && typeof e == "object" && !Array.isArray(e); }
var ps = require("@prisma/client-runtime-utils");
var Ct = require("@prisma/client-runtime-utils");
function T(e, t) { throw new Error(t); }
function Pn(e, t) { return e === t || e !== null && t !== null && typeof e == "object" && typeof t == "object" && Object.keys(e).length === Object.keys(t).length && Object.keys(e).every(r => Pn(e[r], t[r])); }
function ze(e, t) { let r = Object.keys(e), n = Object.keys(t); return (r.length < n.length ? r : n).every(o => { var _b, _f; if (typeof e[o] == typeof t[o] && typeof e[o] != "object")
    return e[o] === t[o]; if (Ct.Decimal.isDecimal(e[o]) || Ct.Decimal.isDecimal(t[o])) {
    let s = ss(e[o]), a = ss(t[o]);
    return s && a && s.equals(a);
}
else if (e[o] instanceof Uint8Array || t[o] instanceof Uint8Array) {
    let s = as(e[o]), a = as(t[o]);
    return s && a && s.equals(a);
}
else {
    if (e[o] instanceof Date || t[o] instanceof Date)
        return ((_b = ls(e[o])) === null || _b === void 0 ? void 0 : _b.getTime()) === ((_f = ls(t[o])) === null || _f === void 0 ? void 0 : _f.getTime());
    if (typeof e[o] == "bigint" || typeof t[o] == "bigint")
        return us(e[o]) === us(t[o]);
    if (typeof e[o] == "number" || typeof t[o] == "number")
        return cs(e[o]) === cs(t[o]);
} return Pn(e[o], t[o]); }); }
function ss(e) { return Ct.Decimal.isDecimal(e) ? e : typeof e == "number" || typeof e == "string" ? new Ct.Decimal(e) : void 0; }
function as(e) { return Buffer.isBuffer(e) ? e : e instanceof Uint8Array ? Buffer.from(e.buffer, e.byteOffset, e.byteLength) : typeof e == "string" ? Buffer.from(e, "base64") : void 0; }
function ls(e) { return e instanceof Date ? e : typeof e == "string" || typeof e == "number" ? new Date(e) : void 0; }
function us(e) { return typeof e == "bigint" ? e : typeof e == "number" || typeof e == "string" ? BigInt(e) : void 0; }
function cs(e) { return typeof e == "number" ? e : typeof e == "string" ? Number(e) : void 0; }
function K(e) { return JSON.stringify(e, (t, r) => typeof r == "bigint" ? r.toString() : ArrayBuffer.isView(r) ? Buffer.from(r.buffer, r.byteOffset, r.byteLength).toString("base64") : r); }
function fp(e) { return e !== null && typeof e == "object" && typeof e.$type == "string"; }
function gp(e, t) { let r = {}; for (let n of Object.keys(e))
    r[n] = t(e[n], n); return r; }
function Z(e) { return e === null ? e : Array.isArray(e) ? e.map(Z) : typeof e == "object" ? fp(e) ? yp(e) : e.constructor !== null && e.constructor.name !== "Object" ? e : gp(e, Z) : e; }
function yp({ $type: e, value: t }) { switch (e) {
    case "BigInt": return BigInt(t);
    case "Bytes": {
        let { buffer: r, byteOffset: n, byteLength: i } = Buffer.from(t, "base64");
        return new Uint8Array(r, n, i);
    }
    case "DateTime": return new Date(t);
    case "Decimal": return new ps.Decimal(t);
    case "Json": return JSON.parse(t);
    case "Raw": return t;
    case "FieldRef": throw new Error("FieldRef tagged values cannot be deserialized to JavaScript values");
    case "Enum": return t;
    default: T(t, "Unknown tagged value");
} }
function wr(e) { return e.name === "DriverAdapterError" && typeof e.cause == "object"; }
var f = { Int32: 0, Int64: 1, Float: 2, Double: 3, Numeric: 4, Boolean: 5, Character: 6, Text: 7, Date: 8, Time: 9, DateTime: 10, Json: 11, Enum: 12, Bytes: 13, Set: 14, Uuid: 15, Int32Array: 64, Int64Array: 65, FloatArray: 66, DoubleArray: 67, NumericArray: 68, BooleanArray: 69, CharacterArray: 70, TextArray: 71, DateArray: 72, TimeArray: 73, DateTimeArray: 74, JsonArray: 75, EnumArray: 76, BytesArray: 77, UuidArray: 78, UnknownNumber: 128 };
var N = class extends Error {
    constructor(t, r, n) {
        this.name = "UserFacingError";
        super(t), this.code = r, this.meta = n !== null && n !== void 0 ? n : {};
    }
    toQueryResponseErrorObject() { return { error: this.message, user_facing_error: { is_panic: !1, message: this.message, meta: this.meta, error_code: this.code } }; }
};
function Ge(e) { if (!wr(e))
    throw e; let t = hp(e), r = ds(e); throw !t || !r ? e : new N(r, t, { driverAdapterError: e }); }
function Sn(e) { var _b, _f; throw wr(e) ? new N(`Raw query failed. Code: \`${(_b = e.cause.originalCode) !== null && _b !== void 0 ? _b : "N/A"}\`. Message: \`${(_f = e.cause.originalMessage) !== null && _f !== void 0 ? _f : ds(e)}\``, "P2010", { driverAdapterError: e }) : e; }
function hp(e) { switch (e.cause.kind) {
    case "AuthenticationFailed": return "P1000";
    case "DatabaseNotReachable": return "P1001";
    case "DatabaseDoesNotExist": return "P1003";
    case "SocketTimeout": return "P1008";
    case "DatabaseAlreadyExists": return "P1009";
    case "DatabaseAccessDenied": return "P1010";
    case "TlsConnectionError": return "P1011";
    case "ConnectionClosed": return "P1017";
    case "TransactionAlreadyClosed": return "P1018";
    case "LengthMismatch": return "P2000";
    case "UniqueConstraintViolation": return "P2002";
    case "ForeignKeyConstraintViolation": return "P2003";
    case "InvalidInputValue": return "P2007";
    case "UnsupportedNativeDataType": return "P2010";
    case "NullConstraintViolation": return "P2011";
    case "ValueOutOfRange": return "P2020";
    case "TableDoesNotExist": return "P2021";
    case "ColumnNotFound": return "P2022";
    case "InvalidIsolationLevel":
    case "InconsistentColumnData": return "P2023";
    case "MissingFullTextSearchIndex": return "P2030";
    case "TransactionWriteConflict": return "P2034";
    case "GenericJs": return "P2036";
    case "TooManyConnections": return "P2037";
    case "postgres":
    case "sqlite":
    case "mysql":
    case "mssql": return;
    default: T(e.cause, `Unknown error: ${K(e.cause)}`);
} }
function ds(e) { var _b, _f, _g, _5, _6, _7, _8; switch (e.cause.kind) {
    case "AuthenticationFailed": return `Authentication failed against the database server, the provided database credentials for \`${(_b = e.cause.user) !== null && _b !== void 0 ? _b : "(not available)"}\` are not valid`;
    case "DatabaseNotReachable": {
        let t = e.cause.host && e.cause.port ? `${e.cause.host}:${e.cause.port}` : e.cause.host;
        return `Can't reach database server${t ? ` at ${t}` : ""}`;
    }
    case "DatabaseDoesNotExist": return `Database \`${(_f = e.cause.db) !== null && _f !== void 0 ? _f : "(not available)"}\` does not exist on the database server`;
    case "SocketTimeout": return "Operation has timed out";
    case "DatabaseAlreadyExists": return `Database \`${(_g = e.cause.db) !== null && _g !== void 0 ? _g : "(not available)"}\` already exists on the database server`;
    case "DatabaseAccessDenied": return `User was denied access on the database \`${(_5 = e.cause.db) !== null && _5 !== void 0 ? _5 : "(not available)"}\``;
    case "TlsConnectionError": return `Error opening a TLS connection: ${e.cause.reason}`;
    case "ConnectionClosed": return "Server has closed the connection.";
    case "TransactionAlreadyClosed": return e.cause.cause;
    case "LengthMismatch": return `The provided value for the column is too long for the column's type. Column: ${(_6 = e.cause.column) !== null && _6 !== void 0 ? _6 : "(not available)"}`;
    case "UniqueConstraintViolation": return `Unique constraint failed on the ${Tn(e.cause.constraint)}`;
    case "ForeignKeyConstraintViolation": return `Foreign key constraint violated on the ${Tn(e.cause.constraint)}`;
    case "UnsupportedNativeDataType": return `Failed to deserialize column of type '${e.cause.type}'. If you're using $queryRaw and this column is explicitly marked as \`Unsupported\` in your Prisma schema, try casting this column to any supported Prisma type such as \`String\`.`;
    case "NullConstraintViolation": return `Null constraint violation on the ${Tn(e.cause.constraint)}`;
    case "ValueOutOfRange": return `Value out of range for the type: ${e.cause.cause}`;
    case "TableDoesNotExist": return `The table \`${(_7 = e.cause.table) !== null && _7 !== void 0 ? _7 : "(not available)"}\` does not exist in the current database.`;
    case "ColumnNotFound": return `The column \`${(_8 = e.cause.column) !== null && _8 !== void 0 ? _8 : "(not available)"}\` does not exist in the current database.`;
    case "InvalidIsolationLevel": return `Error in connector: Conversion error: ${e.cause.level}`;
    case "InconsistentColumnData": return `Inconsistent column data: ${e.cause.cause}`;
    case "MissingFullTextSearchIndex": return "Cannot find a fulltext index to use for the native search, try adding a @@fulltext([Fields...]) to your schema";
    case "TransactionWriteConflict": return "Transaction failed due to a write conflict or a deadlock. Please retry your transaction";
    case "GenericJs": return `Error in external connector (id ${e.cause.id})`;
    case "TooManyConnections": return `Too many database connections opened: ${e.cause.cause}`;
    case "InvalidInputValue": return `Invalid input value: ${e.cause.message}`;
    case "sqlite":
    case "postgres":
    case "mysql":
    case "mssql": return;
    default: T(e.cause, `Unknown error: ${K(e.cause)}`);
} }
function Tn(e) { return e && "fields" in e ? `fields: (${e.fields.map(t => `\`${t}\``).join(", ")})` : e && "index" in e ? `constraint: \`${e.index}\`` : e && "foreignKey" in e ? "foreign key" : "(not available)"; }
function wp(e) { if (typeof e != "object" || e === null)
    return !1; let t = e; return "$type" in t && t.$type === "Param" || "prisma__type" in t && t.prisma__type === "param"; }
function bp(e) { var _b; return "prisma__type" in e ? (_b = e.prisma__value) === null || _b === void 0 ? void 0 : _b.name : e.value.name; }
function xp(e, t) { let r = {}; for (let [n, i] of Object.entries(e))
    if (r[n] = i, wp(i)) {
        let o = bp(i);
        o && o in t && (r[n] = t[o]);
    } return r; }
function ms(e, t, r = {}) { let n = e.map(o => t.keys.reduce((s, a) => (s[a] = Z(o[a]), s), {})), i = new Set(t.nestedSelection); return t.arguments.map(o => { let s = xp(o, r), a = n.findIndex(l => ze(l, s)); if (a === -1)
    return t.expectNonEmpty ? new N("An operation failed because it depends on one or more records that were required but not found", "P2025") : null; {
    let l = Object.entries(e[a]).filter(([u]) => i.has(u));
    return Object.fromEntries(l);
} }); }
var ys = require("@prisma/client-runtime-utils");
var C = class extends N {
    constructor(t, r) {
        super(t, "P2023", r);
        this.name = "DataMapperError";
    }
}, fs = new WeakMap;
function Ep(e) { let t = fs.get(e); return t || (t = Object.entries(e), fs.set(e, t)), t; }
function hs(e, t, r) { switch (t.type) {
    case "affectedRows":
        if (typeof e != "number")
            throw new C(`Expected an affected rows count, got: ${typeof e} (${e})`);
        return { count: e };
    case "object": return An(e, t.fields, r, t.skipNulls);
    case "field": return vn(e, "<result>", t.fieldType, r);
    default: T(t, `Invalid data mapping type: '${t.type}'`);
} }
function An(e, t, r, n) { if (e === null)
    return null; if (Array.isArray(e)) {
    let i = e;
    return n && (i = i.filter(o => o !== null)), i.map(o => gs(o, t, r));
} if (typeof e == "object")
    return gs(e, t, r); if (typeof e == "string") {
    let i;
    try {
        i = JSON.parse(e);
    }
    catch (o) {
        throw new C("Expected an array or object, got a string that is not valid JSON", { cause: o });
    }
    return An(i, t, r, n);
} throw new C(`Expected an array or an object, got: ${typeof e}`); }
function gs(e, t, r) { if (typeof e != "object")
    throw new C(`Expected an object, but got '${typeof e}'`); let n = {}; for (let [i, o] of Ep(t))
    switch (o.type) {
        case "affectedRows": throw new C(`Unexpected 'AffectedRows' node in data mapping for field '${i}'`);
        case "object": {
            let { serializedName: s, fields: a, skipNulls: l } = o;
            if (s !== null && !Object.hasOwn(e, s))
                throw new C(`Missing data field (Object): '${i}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`);
            let u = s !== null ? e[s] : e;
            n[i] = An(u, a, r, l);
            break;
        }
        case "field":
            {
                let s = o.dbName;
                if (Object.hasOwn(e, s))
                    n[i] = Pp(e[s], s, o.fieldType, r);
                else
                    throw new C(`Missing data field (Value): '${s}'; node: ${JSON.stringify(o)}; data: ${JSON.stringify(e)}`);
            }
            break;
        default: T(o, `DataMapper: Invalid data mapping node type: '${o.type}'`);
    } return n; }
function Pp(e, t, r, n) { return e === null ? r.arity === "list" ? [] : null : r.arity === "list" ? e.map((o, s) => vn(o, `${t}[${s}]`, r, n)) : vn(e, t, r, n); }
function vn(e, t, r, n) { switch (r.type) {
    case "unsupported": return e;
    case "string": {
        if (typeof e != "string")
            throw new C(`Expected a string in column '${t}', got ${typeof e}: ${e}`);
        return e;
    }
    case "int": switch (typeof e) {
        case "number": return Math.trunc(e);
        case "string": {
            let i = Math.trunc(Number(e));
            if (Number.isNaN(i) || !Number.isFinite(i))
                throw new C(`Expected an integer in column '${t}', got string: ${e}`);
            if (!Number.isSafeInteger(i))
                throw new C(`Integer value in column '${t}' is too large to represent as a JavaScript number without loss of precision, got: ${e}. Consider using BigInt type.`);
            return i;
        }
        default: throw new C(`Expected an integer in column '${t}', got ${typeof e}: ${e}`);
    }
    case "bigint": {
        if (typeof e != "number" && typeof e != "string")
            throw new C(`Expected a bigint in column '${t}', got ${typeof e}: ${e}`);
        return { $type: "BigInt", value: e };
    }
    case "float": {
        if (typeof e == "number")
            return e;
        if (typeof e == "string") {
            let i = Number(e);
            if (Number.isNaN(i) && !/^[-+]?nan$/.test(e.toLowerCase()))
                throw new C(`Expected a float in column '${t}', got string: ${e}`);
            return i;
        }
        throw new C(`Expected a float in column '${t}', got ${typeof e}: ${e}`);
    }
    case "boolean": {
        if (typeof e == "boolean")
            return e;
        if (typeof e == "number")
            return e === 1;
        if (typeof e == "string") {
            if (e === "true" || e === "TRUE" || e === "1")
                return !0;
            if (e === "false" || e === "FALSE" || e === "0")
                return !1;
            throw new C(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`);
        }
        if (Array.isArray(e) || e instanceof Uint8Array) {
            for (let i of e)
                if (i !== 0)
                    return !0;
            return !1;
        }
        throw new C(`Expected a boolean in column '${t}', got ${typeof e}: ${e}`);
    }
    case "decimal":
        if (typeof e != "number" && typeof e != "string" && !ys.Decimal.isDecimal(e))
            throw new C(`Expected a decimal in column '${t}', got ${typeof e}: ${e}`);
        return { $type: "Decimal", value: e };
    case "datetime": {
        if (typeof e == "string")
            return { $type: "DateTime", value: Sp(e) };
        if (typeof e == "number" || e instanceof Date)
            return { $type: "DateTime", value: e };
        throw new C(`Expected a date in column '${t}', got ${typeof e}: ${e}`);
    }
    case "object": return { $type: "Json", value: K(e) };
    case "json": return { $type: "Json", value: `${e}` };
    case "bytes": {
        switch (r.encoding) {
            case "base64":
                if (typeof e != "string")
                    throw new C(`Expected a base64-encoded byte array in column '${t}', got ${typeof e}: ${e}`);
                return { $type: "Bytes", value: e };
            case "hex":
                if (typeof e != "string" || !e.startsWith("\\x"))
                    throw new C(`Expected a hex-encoded byte array in column '${t}', got ${typeof e}: ${e}`);
                return { $type: "Bytes", value: Buffer.from(e.slice(2), "hex").toString("base64") };
            case "array":
                if (Array.isArray(e))
                    return { $type: "Bytes", value: Buffer.from(e).toString("base64") };
                if (e instanceof Uint8Array)
                    return { $type: "Bytes", value: Buffer.from(e).toString("base64") };
                throw new C(`Expected a byte array in column '${t}', got ${typeof e}: ${e}`);
            default: T(r.encoding, `DataMapper: Unknown bytes encoding: ${r.encoding}`);
        }
        break;
    }
    case "enum": {
        let i = n[r.name];
        if (i === void 0)
            throw new C(`Unknown enum '${r.name}'`);
        let o = i[`${e}`];
        if (o === void 0)
            throw new C(`Value '${e}' not found in enum '${r.name}'`);
        return o;
    }
    default: T(r, `DataMapper: Unknown result type: ${r.type}`);
} }
var Tp = /\d{2}:\d{2}:\d{2}(?:\.\d+)?(Z|[+-]\d{2}(:?\d{2})?)?$/;
function Sp(e) { let t = Tp.exec(e); if (t === null)
    return `${e}T00:00:00Z`; let r = e, [n, i, o] = t; if (i !== void 0 && i !== "Z" && o === void 0 ? r = `${e}:00` : i === void 0 && (r = `${e}Z`), n.length === e.length)
    return `1970-01-01T${r}`; let s = t.index - 1; return r[s] === " " && (r = `${r.slice(0, s)}T${r.slice(s + 1)}`), r; }
function J(e) { if (typeof e != "object")
    return e; var t, r, n = Object.prototype.toString.call(e); if (n === "[object Object]") {
    if (e.constructor !== Object && typeof e.constructor == "function") {
        r = new e.constructor;
        for (t in e)
            e.hasOwnProperty(t) && r[t] !== e[t] && (r[t] = J(e[t]));
    }
    else {
        r = {};
        for (t in e)
            t === "__proto__" ? Object.defineProperty(r, t, { value: J(e[t]), configurable: !0, enumerable: !0, writable: !0 }) : r[t] = J(e[t]);
    }
    return r;
} if (n === "[object Array]") {
    for (t = e.length, r = Array(t); t--;)
        r[t] = J(e[t]);
    return r;
} return n === "[object Set]" ? (r = new Set, e.forEach(function (i) { r.add(J(i)); }), r) : n === "[object Map]" ? (r = new Map, e.forEach(function (i, o) { r.set(J(o), J(i)); }), r) : n === "[object Date]" ? new Date(+e) : n === "[object RegExp]" ? (r = new RegExp(e.source, e.flags), r.lastIndex = e.lastIndex, r) : n === "[object DataView]" ? new e.constructor(J(e.buffer)) : n === "[object ArrayBuffer]" ? e.slice(0) : n.slice(-6) === "Array]" ? new e.constructor(e) : e; }
function vp(e) { let t = Object.entries(e); return t.length === 0 ? "" : (t.sort(([n], [i]) => n.localeCompare(i)), `/*${t.map(([n, i]) => { let o = encodeURIComponent(n), s = encodeURIComponent(i).replace(/'/g, "\\'"); return `${o}='${s}'`; }).join(",")}*/`); }
function br(e, t) { let r = {}; for (let n of e) {
    let i = n(J(t));
    for (let [o, s] of Object.entries(i))
        s !== void 0 && (r[o] = s);
} return r; }
function ws(e, t) { let r = br(e, t); return vp(r); }
function bs(e, t) { return t ? `${e} ${t}` : e; }
var Rt;
(function (e) { e[e.INTERNAL = 0] = "INTERNAL", e[e.SERVER = 1] = "SERVER", e[e.CLIENT = 2] = "CLIENT", e[e.PRODUCER = 3] = "PRODUCER", e[e.CONSUMER = 4] = "CONSUMER"; })(Rt || (Rt = {}));
function Ap(e) { switch (e) {
    case "postgresql":
    case "postgres":
    case "prisma+postgres": return "postgresql";
    case "sqlserver": return "mssql";
    case "mysql":
    case "sqlite":
    case "cockroachdb":
    case "mongodb": return e;
    default: T(e, `Unknown provider: ${e}`);
} }
async function xr({ query: e, tracingHelper: t, provider: r, onQuery: n, execute: i }) { let o = n === void 0 ? i : async () => { let s = new Date, a = performance.now(), l = await i(), u = performance.now(); return n({ timestamp: s, duration: u - a, query: e.sql, params: e.args }), l; }; return t.isEnabled() ? await t.runInChildSpan({ name: "db_query", kind: Rt.CLIENT, attributes: { "db.query.text": e.sql, "db.system.name": Ap(r) } }, o) : o(); }
function Te(e, t) { var r = "000000000" + e; return r.substr(r.length - t); }
var xs = B(require("node:os"), 1);
function Cp() { try {
    return xs.default.hostname();
}
catch (_b) {
    return process.env._CLUSTER_NETWORK_NAME_ || process.env.COMPUTERNAME || "hostname";
} }
var Es = 2, Rp = Te(process.pid.toString(36), Es), Ps = Cp(), kp = Ps.length, Ip = Te(Ps.split("").reduce(function (e, t) { return +e + t.charCodeAt(0); }, +kp + 36).toString(36), Es);
function Cn() { return Rp + Ip; }
function Er(e) { return typeof e == "string" && /^c[a-z0-9]{20,32}$/.test(e); }
function Rn(e) { let n = Math.pow(36, 4), i = 0; function o() { return Te((Math.random() * n << 0).toString(36), 4); } function s() { return i = i < n ? i : 0, i++, i - 1; } function a() { var l = "c", u = new Date().getTime().toString(36), c = Te(s().toString(36), 4), p = e(), d = o() + o(); return l + u + c + p + d; } return a.fingerprint = e, a.isCuid = Er, a; }
var Op = Rn(Cn);
var Ts = Op;
var Pa = B(ma());
var $n = require("node:crypto");
var fa = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
var hd = 128, ve, Ze;
function wd(e) { !ve || ve.length < e ? (ve = Buffer.allocUnsafe(e * hd), $n.webcrypto.getRandomValues(ve), Ze = 0) : Ze + e > ve.length && ($n.webcrypto.getRandomValues(ve), Ze = 0), Ze += e; }
function Ln(e = 21) { wd(e |= 0); let t = ""; for (let r = Ze - e; r < Ze; r++)
    t += fa[ve[r] & 63]; return t; }
var Mt = B(require("node:crypto"), 1);
var ya = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Ft = 32;
var bd = 16, ha = 10, ga = 0xffffffffffff;
var Ae;
(function (e) { e.Base32IncorrectEncoding = "B32_ENC_INVALID", e.DecodeTimeInvalidCharacter = "DEC_TIME_CHAR", e.DecodeTimeValueMalformed = "DEC_TIME_MALFORMED", e.EncodeTimeNegative = "ENC_TIME_NEG", e.EncodeTimeSizeExceeded = "ENC_TIME_SIZE_EXCEED", e.EncodeTimeValueMalformed = "ENC_TIME_MALFORMED", e.PRNGDetectFailure = "PRNG_DETECT", e.ULIDInvalid = "ULID_INVALID", e.Unexpected = "UNEXPECTED", e.UUIDInvalid = "UUID_INVALID"; })(Ae || (Ae = {}));
var Ce = class extends Error {
    constructor(t, r) { super(`${r} (${t})`), this.name = "ULIDError", this.code = t; }
};
function xd(e) { let t = Math.floor(e() * Ft); return t === Ft && (t = Ft - 1), ya.charAt(t); }
function Ed(e) { var _b; let t = Pd(), r = t && (t.crypto || t.msCrypto) || (typeof Mt.default < "u" ? Mt.default : null); if (typeof (r === null || r === void 0 ? void 0 : r.getRandomValues) == "function")
    return () => { let n = new Uint8Array(1); return r.getRandomValues(n), n[0] / 255; }; if (typeof (r === null || r === void 0 ? void 0 : r.randomBytes) == "function")
    return () => r.randomBytes(1).readUInt8() / 255; if ((_b = Mt.default) === null || _b === void 0 ? void 0 : _b.randomBytes)
    return () => Mt.default.randomBytes(1).readUInt8() / 255; throw new Ce(Ae.PRNGDetectFailure, "Failed to find a reliable PRNG"); }
function Pd() { return vd() ? self : typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : null; }
function Td(e, t) { let r = ""; for (; e > 0; e--)
    r = xd(t) + r; return r; }
function Sd(e, t = ha) { if (isNaN(e))
    throw new Ce(Ae.EncodeTimeValueMalformed, `Time must be a number: ${e}`); if (e > ga)
    throw new Ce(Ae.EncodeTimeSizeExceeded, `Cannot encode a time larger than ${ga}: ${e}`); if (e < 0)
    throw new Ce(Ae.EncodeTimeNegative, `Time must be positive: ${e}`); if (Number.isInteger(e) === !1)
    throw new Ce(Ae.EncodeTimeValueMalformed, `Time must be an integer: ${e}`); let r, n = ""; for (let i = t; i > 0; i--)
    r = e % Ft, n = ya.charAt(r) + n, e = (e - r) / Ft; return n; }
function vd() { return typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope; }
function wa(e, t) { let r = t || Ed(), n = !e || isNaN(e) ? Date.now() : e; return Sd(n, ha) + Td(bd, r); }
var D = [];
for (let e = 0; e < 256; ++e)
    D.push((e + 256).toString(16).slice(1));
function vr(e, t = 0) { return (D[e[t + 0]] + D[e[t + 1]] + D[e[t + 2]] + D[e[t + 3]] + "-" + D[e[t + 4]] + D[e[t + 5]] + "-" + D[e[t + 6]] + D[e[t + 7]] + "-" + D[e[t + 8]] + D[e[t + 9]] + "-" + D[e[t + 10]] + D[e[t + 11]] + D[e[t + 12]] + D[e[t + 13]] + D[e[t + 14]] + D[e[t + 15]]).toLowerCase(); }
var ba = require("node:crypto"), Cr = new Uint8Array(256), Ar = Cr.length;
function Ye() { return Ar > Cr.length - 16 && ((0, ba.randomFillSync)(Cr), Ar = 0), Cr.slice(Ar, Ar += 16); }
var xa = require("node:crypto"), Vn = { randomUUID: xa.randomUUID };
function Ad(e, t, r) { var _b, _f, _g; if (Vn.randomUUID && !t && !e)
    return Vn.randomUUID(); e = e || {}; let n = (_g = (_b = e.random) !== null && _b !== void 0 ? _b : (_f = e.rng) === null || _f === void 0 ? void 0 : _f.call(e)) !== null && _g !== void 0 ? _g : Ye(); if (n.length < 16)
    throw new Error("Random bytes length must be >= 16"); if (n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, t) {
    if (r = r || 0, r < 0 || r + 16 > t.length)
        throw new RangeError(`UUID byte range ${r}:${r + 15} is out of buffer bounds`);
    for (let i = 0; i < 16; ++i)
        t[r + i] = n[i];
    return t;
} return vr(n); }
var qn = Ad;
var jn = {};
function Cd(e, t, r) { var _b, _f, _g; let n; if (e)
    n = Ea((_g = (_b = e.random) !== null && _b !== void 0 ? _b : (_f = e.rng) === null || _f === void 0 ? void 0 : _f.call(e)) !== null && _g !== void 0 ? _g : Ye(), e.msecs, e.seq, t, r);
else {
    let i = Date.now(), o = Ye();
    Rd(jn, i, o), n = Ea(o, jn.msecs, jn.seq, t, r);
} return t !== null && t !== void 0 ? t : vr(n); }
function Rd(e, t, r) { var _b, _f; return (_b = e.msecs) !== null && _b !== void 0 ? _b : (e.msecs = -1 / 0), (_f = e.seq) !== null && _f !== void 0 ? _f : (e.seq = 0), t > e.msecs ? (e.seq = r[6] << 23 | r[7] << 16 | r[8] << 8 | r[9], e.msecs = t) : (e.seq = e.seq + 1 | 0, e.seq === 0 && e.msecs++), e; }
function Ea(e, t, r, n, i = 0) { if (e.length < 16)
    throw new Error("Random bytes length must be >= 16"); if (!n)
    n = new Uint8Array(16), i = 0;
else if (i < 0 || i + 16 > n.length)
    throw new RangeError(`UUID byte range ${i}:${i + 15} is out of buffer bounds`); return t !== null && t !== void 0 ? t : (t = Date.now()), r !== null && r !== void 0 ? r : (r = e[6] * 127 << 24 | e[7] << 16 | e[8] << 8 | e[9]), n[i++] = t / 1099511627776 & 255, n[i++] = t / 4294967296 & 255, n[i++] = t / 16777216 & 255, n[i++] = t / 65536 & 255, n[i++] = t / 256 & 255, n[i++] = t & 255, n[i++] = 112 | r >>> 28 & 15, n[i++] = r >>> 20 & 255, n[i++] = 128 | r >>> 14 & 63, n[i++] = r >>> 6 & 255, n[i++] = r << 2 & 255 | e[10] & 3, n[i++] = e[11], n[i++] = e[12], n[i++] = e[13], n[i++] = e[14], n[i++] = e[15], n; }
var Un = Cd;
var Rr = (_h = class {
        constructor() {
            _Rr_e.set(this, {});
            this.register("uuid", new Qn), this.register("cuid", new Jn), this.register("ulid", new Hn), this.register("nanoid", new zn), this.register("product", new Gn);
        }
        snapshot() { return Object.create(__classPrivateFieldGet(this, _Rr_e, "f"), { now: { value: new Bn } }); }
        register(t, r) { __classPrivateFieldGet(this, _Rr_e, "f")[t] = r; }
    },
    _Rr_e = new WeakMap(),
    _h), Bn = (_j = class {
        constructor() {
            _Bn_e.set(this, void 0);
        }
        generate() { return __classPrivateFieldGet(this, _Bn_e, "f") === void 0 && (__classPrivateFieldSet(this, _Bn_e, new Date, "f")), __classPrivateFieldGet(this, _Bn_e, "f").toISOString(); }
    },
    _Bn_e = new WeakMap(),
    _j), Qn = class {
    generate(t) { if (t === 4)
        return qn(); if (t === 7)
        return Un(); throw new Error("Invalid UUID generator arguments"); }
}, Jn = class {
    generate(t) { if (t === 1)
        return Ts(); if (t === 2)
        return (0, Pa.createId)(); throw new Error("Invalid CUID generator arguments"); }
}, Hn = class {
    generate() { return wa(); }
}, zn = class {
    generate(t) { if (typeof t == "number")
        return Ln(t); if (t === void 0)
        return Ln(); throw new Error("Invalid Nanoid generator arguments"); }
}, Gn = class {
    generate(t, r) { if (t === void 0 || r === void 0)
        throw new Error("Invalid Product generator arguments"); return Array.isArray(t) && Array.isArray(r) ? t.flatMap(n => r.map(i => [n, i])) : Array.isArray(t) ? t.map(n => [n, r]) : Array.isArray(r) ? r.map(n => [t, n]) : [[t, r]]; }
};
function kr(e, t) { return e == null ? e : typeof e == "string" ? kr(JSON.parse(e), t) : Array.isArray(e) ? Id(e, t) : kd(e, t); }
function kd(e, t) { if (t.pagination) {
    let { skip: r, take: n, cursor: i } = t.pagination;
    if (r !== null && r > 0 || n === 0 || i !== null && !ze(e, i))
        return null;
} return Sa(e, t.nested); }
function Sa(e, t) { for (let [r, n] of Object.entries(t))
    e[r] = kr(e[r], n); return e; }
function Id(e, t) { if (t.distinct !== null) {
    let r = t.linkingFields !== null ? [...t.distinct, ...t.linkingFields] : t.distinct;
    e = Od(e, r);
} return t.pagination && (e = Nd(e, t.pagination, t.linkingFields)), t.reverse && e.reverse(), Object.keys(t.nested).length === 0 ? e : e.map(r => Sa(r, t.nested)); }
function Od(e, t) { let r = new Set, n = []; for (let i of e) {
    let o = Xe(i, t);
    r.has(o) || (r.add(o), n.push(i));
} return n; }
function Nd(e, t, r) { if (r === null)
    return Ta(e, t); let n = new Map; for (let o of e) {
    let s = Xe(o, r);
    n.has(s) || n.set(s, []), n.get(s).push(o);
} let i = Array.from(n.entries()); return i.sort(([o], [s]) => o < s ? -1 : o > s ? 1 : 0), i.flatMap(([, o]) => Ta(o, t)); }
function Ta(e, { cursor: t, skip: r, take: n }) { let i = t !== null ? e.findIndex(a => ze(a, t)) : 0; if (i === -1)
    return []; let o = i + (r !== null && r !== void 0 ? r : 0), s = n !== null ? o + n : e.length; return e.slice(o, s); }
function Xe(e, t, r) { let n = t.map((i, o) => (r === null || r === void 0 ? void 0 : r[o]) ? e[i] !== null ? r[o](e[i]) : null : e[i]); return JSON.stringify(n); }
function Wn(e) { return typeof e == "object" && e !== null && e.prisma__type === "param"; }
function Kn(e) { return typeof e == "object" && e !== null && e.prisma__type === "generatorCall"; }
function Xn(e, t, r, n) { let i = e.args.map(o => H(o, t, r)); switch (e.type) {
    case "rawSql": return [Fd(e.sql, i, e.argTypes)];
    case "templateSql": return (e.chunkable ? $d(e.fragments, i, n) : [i]).map(s => { let a = Dd(e.fragments, e.placeholderFormat, s, e.argTypes); if (n !== void 0 && a.args.length > n)
        throw new N("The query parameter limit supported by your database is exceeded.", "P2029"); return a; });
    default: T(e.type, "Invalid query type");
} }
function H(e, t, r) { for (; _d(e);)
    if (Wn(e)) {
        let n = t[e.prisma__value.name];
        if (n === void 0)
            throw new Error(`Missing value for query variable ${e.prisma__value.name}`);
        e.prisma__value.type === "DateTime" && typeof n == "string" ? e = new Date(n) : e = n;
    }
    else if (Kn(e)) {
        let { name: n, args: i } = e.prisma__value, o = r[n];
        if (!o)
            throw new Error(`Encountered an unknown generator '${n}'`);
        e = o.generate(...i.map(s => H(s, t, r)));
    }
    else
        T(e, `Unexpected unevaluated value type: ${e}`); return Array.isArray(e) && (e = e.map(n => H(n, t, r))), e; }
function Dd(e, t, r, n) { let i = "", o = { placeholderNumber: 1 }, s = [], a = []; for (let l of Yn(e, r, n)) {
    if (i += Md(l, t, o), l.type === "stringChunk")
        continue;
    let u = s.length, c = s.push(...va(l)) - u;
    if (l.argType.arity === "tuple") {
        if (c % l.argType.elements.length !== 0)
            throw new Error(`Malformed query template. Expected the number of parameters to match the tuple arity, but got ${c} parameters for a tuple of arity ${l.argType.elements.length}.`);
        for (let p = 0; p < c / l.argType.elements.length; p++)
            a.push(...l.argType.elements);
    }
    else
        for (let p = 0; p < c; p++)
            a.push(l.argType);
} return { sql: i, args: s, argTypes: a }; }
function Md(e, t, r) { let n = e.type; switch (n) {
    case "parameter": return Zn(t, r.placeholderNumber++);
    case "stringChunk": return e.chunk;
    case "parameterTuple": return `(${e.value.length == 0 ? "NULL" : e.value.map(() => { let o = Zn(t, r.placeholderNumber++); return `${e.itemPrefix}${o}${e.itemSuffix}`; }).join(e.itemSeparator)})`;
    case "parameterTupleList": return e.value.map(i => { let o = i.map(() => Zn(t, r.placeholderNumber++)).join(e.itemSeparator); return `${e.itemPrefix}${o}${e.itemSuffix}`; }).join(e.groupSeparator);
    default: T(n, "Invalid fragment type");
} }
function Zn(e, t) { return e.hasNumbering ? `${e.prefix}${t}` : e.prefix; }
function Fd(e, t, r) { return { sql: e, args: t, argTypes: r }; }
function _d(e) { return Wn(e) || Kn(e); }
function* Yn(e, t, r) { let n = 0; for (let i of e)
    switch (i.type) {
        case "parameter": {
            if (n >= t.length)
                throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);
            yield { ...i, value: t[n], argType: r === null || r === void 0 ? void 0 : r[n] }, n++;
            break;
        }
        case "stringChunk": {
            yield i;
            break;
        }
        case "parameterTuple": {
            if (n >= t.length)
                throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);
            let o = t[n];
            yield { ...i, value: Array.isArray(o) ? o : [o], argType: r === null || r === void 0 ? void 0 : r[n] }, n++;
            break;
        }
        case "parameterTupleList": {
            if (n >= t.length)
                throw new Error(`Malformed query template. Fragments attempt to read over ${t.length} parameters.`);
            let o = t[n];
            if (!Array.isArray(o))
                throw new Error("Malformed query template. Tuple list expected.");
            if (o.length === 0)
                throw new Error("Malformed query template. Tuple list cannot be empty.");
            for (let s of o)
                if (!Array.isArray(s))
                    throw new Error("Malformed query template. Tuple expected.");
            yield { ...i, value: o, argType: r === null || r === void 0 ? void 0 : r[n] }, n++;
            break;
        }
    } }
function* va(e) { switch (e.type) {
    case "parameter":
        yield e.value;
        break;
    case "stringChunk": break;
    case "parameterTuple":
        yield* e.value;
        break;
    case "parameterTupleList":
        for (let t of e.value)
            yield* t;
        break;
} }
function $d(e, t, r) { let n = 0, i = 0; for (let s of Yn(e, t, void 0)) {
    let a = 0;
    for (let l of va(s))
        a++;
    i = Math.max(i, a), n += a;
} let o = [[]]; for (let s of Yn(e, t, void 0))
    switch (s.type) {
        case "parameter": {
            for (let a of o)
                a.push(s.value);
            break;
        }
        case "stringChunk": break;
        case "parameterTuple": {
            let a = s.value.length, l = [];
            if (r && o.length === 1 && a === i && n > r && n - a < r) {
                let u = r - (n - a);
                l = Ld(s.value, u);
            }
            else
                l = [s.value];
            o = o.flatMap(u => l.map(c => [...u, c]));
            break;
        }
        case "parameterTupleList": {
            let a = s.value.reduce((p, d) => p + d.length, 0), l = [], u = [], c = 0;
            for (let p of s.value)
                r && o.length === 1 && a === i && u.length > 0 && n - a + c + p.length > r && (l.push(u), u = [], c = 0), u.push(p), c += p.length;
            u.length > 0 && l.push(u), o = o.flatMap(p => l.map(d => [...p, d]));
            break;
        }
    } return o; }
function Ld(e, t) { let r = []; for (let n = 0; n < e.length; n += t)
    r.push(e.slice(n, n + t)); return r; }
function Aa(e) { return e.rows.map(t => t.reduce((r, n, i) => (r[e.columnNames[i]] = n, r), {})); }
function Ca(e) { return { columns: e.columnNames, types: e.columnTypes.map(t => Vd(t)), rows: e.rows.map(t => t.map((r, n) => _t(r, e.columnTypes[n]))) }; }
function _t(e, t) { if (e === null)
    return null; switch (t) {
    case f.Int32: switch (typeof e) {
        case "number": return Math.trunc(e);
        case "string": return Math.trunc(Number(e));
        default: throw new Error(`Cannot serialize value of type ${typeof e} as Int32`);
    }
    case f.Int32Array:
        if (!Array.isArray(e))
            throw new Error(`Cannot serialize value of type ${typeof e} as Int32Array`);
        return e.map(r => _t(r, f.Int32));
    case f.Int64: switch (typeof e) {
        case "number": return BigInt(Math.trunc(e));
        case "string": return e;
        default: throw new Error(`Cannot serialize value of type ${typeof e} as Int64`);
    }
    case f.Int64Array:
        if (!Array.isArray(e))
            throw new Error(`Cannot serialize value of type ${typeof e} as Int64Array`);
        return e.map(r => _t(r, f.Int64));
    case f.Json: switch (typeof e) {
        case "string": return JSON.parse(e);
        default: throw new Error(`Cannot serialize value of type ${typeof e} as Json`);
    }
    case f.JsonArray:
        if (!Array.isArray(e))
            throw new Error(`Cannot serialize value of type ${typeof e} as JsonArray`);
        return e.map(r => _t(r, f.Json));
    case f.Boolean: switch (typeof e) {
        case "boolean": return e;
        case "string": return e === "true" || e === "1";
        case "number": return e === 1;
        default: throw new Error(`Cannot serialize value of type ${typeof e} as Boolean`);
    }
    case f.BooleanArray:
        if (!Array.isArray(e))
            throw new Error(`Cannot serialize value of type ${typeof e} as BooleanArray`);
        return e.map(r => _t(r, f.Boolean));
    default: return e;
} }
function Vd(e) { switch (e) {
    case f.Int32: return "int";
    case f.Int64: return "bigint";
    case f.Float: return "float";
    case f.Double: return "double";
    case f.Text: return "string";
    case f.Enum: return "enum";
    case f.Bytes: return "bytes";
    case f.Boolean: return "bool";
    case f.Character: return "char";
    case f.Numeric: return "decimal";
    case f.Json: return "json";
    case f.Uuid: return "uuid";
    case f.DateTime: return "datetime";
    case f.Date: return "date";
    case f.Time: return "time";
    case f.Int32Array: return "int-array";
    case f.Int64Array: return "bigint-array";
    case f.FloatArray: return "float-array";
    case f.DoubleArray: return "double-array";
    case f.TextArray: return "string-array";
    case f.EnumArray: return "string-array";
    case f.BytesArray: return "bytes-array";
    case f.BooleanArray: return "bool-array";
    case f.CharacterArray: return "char-array";
    case f.NumericArray: return "decimal-array";
    case f.JsonArray: return "json-array";
    case f.UuidArray: return "uuid-array";
    case f.DateTimeArray: return "datetime-array";
    case f.DateArray: return "date-array";
    case f.TimeArray: return "time-array";
    case f.UnknownNumber: return "unknown";
    case f.Set: return "string";
    default: T(e, `Unexpected column type: ${e}`);
} }
function Ra(e, t, r) { if (!t.every(n => ei(e, n))) {
    let n = qd(e, r), i = jd(r);
    throw new N(n, i, r.context);
} }
function ei(e, t) { switch (t.type) {
    case "rowCountEq": return Array.isArray(e) ? e.length === t.args : e === null ? t.args === 0 : t.args === 1;
    case "rowCountNeq": return Array.isArray(e) ? e.length !== t.args : e === null ? t.args !== 0 : t.args !== 1;
    case "affectedRowCountEq": return e === t.args;
    case "never": return !1;
    default: T(t, `Unknown rule type: ${t.type}`);
} }
function qd(e, t) { switch (t.errorIdentifier) {
    case "RELATION_VIOLATION": return `The change you are trying to make would violate the required relation '${t.context.relation}' between the \`${t.context.modelA}\` and \`${t.context.modelB}\` models.`;
    case "MISSING_RECORD": return `An operation failed because it depends on one or more records that were required but not found. No record was found for ${t.context.operation}.`;
    case "MISSING_RELATED_RECORD": {
        let r = t.context.neededFor ? ` (needed to ${t.context.neededFor})` : "";
        return `An operation failed because it depends on one or more records that were required but not found. No '${t.context.model}' record${r} was found for ${t.context.operation} on ${t.context.relationType} relation '${t.context.relation}'.`;
    }
    case "INCOMPLETE_CONNECT_INPUT": return `An operation failed because it depends on one or more records that were required but not found. Expected ${t.context.expectedRows} records to be connected, found only ${Array.isArray(e) ? e.length : e}.`;
    case "INCOMPLETE_CONNECT_OUTPUT": return `The required connected records were not found. Expected ${t.context.expectedRows} records to be connected after connect operation on ${t.context.relationType} relation '${t.context.relation}', found ${Array.isArray(e) ? e.length : e}.`;
    case "RECORDS_NOT_CONNECTED": return `The records for relation \`${t.context.relation}\` between the \`${t.context.parent}\` and \`${t.context.child}\` models are not connected.`;
    default: T(t, `Unknown error identifier: ${t}`);
} }
function jd(e) { switch (e.errorIdentifier) {
    case "RELATION_VIOLATION": return "P2014";
    case "RECORDS_NOT_CONNECTED": return "P2017";
    case "INCOMPLETE_CONNECT_OUTPUT": return "P2018";
    case "MISSING_RECORD":
    case "MISSING_RELATED_RECORD":
    case "INCOMPLETE_CONNECT_INPUT": return "P2025";
    default: T(e, `Unknown error identifier: ${e}`);
} }
var $t = (_k = class e {
        constructor({ onQuery: t, tracingHelper: r, serializer: n, rawSerializer: i, provider: o, connectionInfo: s }) {
            _e_instances.add(this);
            _e_e.set(this, void 0);
            _e_t.set(this, new Rr);
            _e_r.set(this, void 0);
            _e_n.set(this, void 0);
            _e_i.set(this, void 0);
            _e_o.set(this, void 0);
            _e_s.set(this, void 0);
            __classPrivateFieldSet(this, _e_e, t, "f"), __classPrivateFieldSet(this, _e_r, r, "f"), __classPrivateFieldSet(this, _e_n, n, "f"), __classPrivateFieldSet(this, _e_i, i !== null && i !== void 0 ? i : n, "f"), __classPrivateFieldSet(this, _e_o, o, "f"), __classPrivateFieldSet(this, _e_s, s, "f");
        }
        static forSql(t) { return new _k({ onQuery: t.onQuery, tracingHelper: t.tracingHelper, serializer: Aa, rawSerializer: Ca, provider: t.provider, connectionInfo: t.connectionInfo }); }
        async run(t, r) { let { value: n } = await this.interpretNode(t, { ...r, generators: __classPrivateFieldGet(this, _e_t, "f").snapshot() }).catch(i => Ge(i)); return n; }
        async interpretNode(t, r) { var _b; switch (t.type) {
            case "value": return { value: H(t.args, r.scope, r.generators) };
            case "seq": {
                let n;
                for (let i of t.args)
                    n = await this.interpretNode(i, r);
                return n !== null && n !== void 0 ? n : { value: void 0 };
            }
            case "get": return { value: r.scope[t.args.name] };
            case "let": {
                let n = Object.create(r.scope);
                for (let i of t.args.bindings) {
                    let { value: o } = await this.interpretNode(i.expr, { ...r, scope: n });
                    n[i.name] = o;
                }
                return this.interpretNode(t.args.expr, { ...r, scope: n });
            }
            case "getFirstNonEmpty": {
                for (let n of t.args.names) {
                    let i = r.scope[n];
                    if (!ka(i))
                        return { value: i };
                }
                return { value: [] };
            }
            case "concat": {
                let n = await Promise.all(t.args.map(i => this.interpretNode(i, r).then(o => o.value)));
                return { value: n.length > 0 ? n.reduce((i, o) => i.concat(ti(o)), []) : [] };
            }
            case "sum": {
                let n = await Promise.all(t.args.map(i => this.interpretNode(i, r).then(o => o.value)));
                return { value: n.length > 0 ? n.reduce((i, o) => te(i) + te(o)) : 0 };
            }
            case "execute": {
                let n = Xn(t.args, r.scope, r.generators, __classPrivateFieldGet(this, _e_instances, "m", _e_a).call(this)), i = 0;
                for (let o of n) {
                    let s = Ia(o, r.sqlCommenter);
                    i += await __classPrivateFieldGet(this, _e_instances, "m", _e_u).call(this, s, r.queryable, () => r.queryable.executeRaw(ri(s)).catch(a => t.args.type === "rawSql" ? Sn(a) : Ge(a)));
                }
                return { value: i };
            }
            case "query": {
                let n = Xn(t.args, r.scope, r.generators, __classPrivateFieldGet(this, _e_instances, "m", _e_a).call(this)), i;
                for (let o of n) {
                    let s = Ia(o, r.sqlCommenter), a = await __classPrivateFieldGet(this, _e_instances, "m", _e_u).call(this, s, r.queryable, () => r.queryable.queryRaw(ri(s)).catch(l => t.args.type === "rawSql" ? Sn(l) : Ge(l)));
                    i === void 0 ? i = a : (i.rows.push(...a.rows), i.lastInsertId = a.lastInsertId);
                }
                return { value: t.args.type === "rawSql" ? __classPrivateFieldGet(this, _e_i, "f").call(this, i) : __classPrivateFieldGet(this, _e_n, "f").call(this, i), lastInsertId: i === null || i === void 0 ? void 0 : i.lastInsertId };
            }
            case "reverse": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args, r);
                return { value: Array.isArray(n) ? n.reverse() : n, lastInsertId: i };
            }
            case "unique": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args, r);
                if (!Array.isArray(n))
                    return { value: n, lastInsertId: i };
                if (n.length > 1)
                    throw new Error(`Expected zero or one element, got ${n.length}`);
                return { value: (_b = n[0]) !== null && _b !== void 0 ? _b : null, lastInsertId: i };
            }
            case "required": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args, r);
                if (ka(n))
                    throw new Error("Required value is empty");
                return { value: n, lastInsertId: i };
            }
            case "mapField": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args.records, r);
                return { value: Oa(n, t.args.field), lastInsertId: i };
            }
            case "join": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args.parent, r);
                if (n === null)
                    return { value: null, lastInsertId: i };
                let o = await Promise.all(t.args.children.map(async (s) => ({ joinExpr: s, childRecords: (await this.interpretNode(s.child, r)).value })));
                return { value: Ud(n, o, t.args.canAssumeStrictEquality), lastInsertId: i };
            }
            case "transaction": {
                if (!r.transactionManager.enabled)
                    return this.interpretNode(t.args, r);
                let n = r.transactionManager.manager, i = await n.startInternalTransaction(), o = await n.getTransaction(i, "query");
                try {
                    let s = await this.interpretNode(t.args, { ...r, queryable: o });
                    return await n.commitTransaction(i.id), s;
                }
                catch (s) {
                    throw await n.rollbackTransaction(i.id), s;
                }
            }
            case "dataMap": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args.expr, r);
                return { value: hs(n, t.args.structure, t.args.enums), lastInsertId: i };
            }
            case "validate": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args.expr, r);
                return Ra(n, t.args.rules, t.args), { value: n, lastInsertId: i };
            }
            case "if": {
                let { value: n } = await this.interpretNode(t.args.value, r);
                return ei(n, t.args.rule) ? await this.interpretNode(t.args.then, r) : await this.interpretNode(t.args.else, r);
            }
            case "unit": return { value: void 0 };
            case "diff": {
                let { value: n } = await this.interpretNode(t.args.from, r), { value: i } = await this.interpretNode(t.args.to, r), o = a => a !== null ? Xe(Lt(a), t.args.fields) : null, s = new Set(ti(i).map(o));
                return { value: ti(n).filter(a => !s.has(o(a))) };
            }
            case "process": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args.expr, r), o = ri(t.args.operations);
                return Na(o, r.scope, r.generators), { value: kr(n, o), lastInsertId: i };
            }
            case "initializeRecord": {
                let { lastInsertId: n } = await this.interpretNode(t.args.expr, r), i = {};
                for (let [o, s] of Object.entries(t.args.fields))
                    i[o] = Qd(s, n, r.scope, r.generators);
                return { value: i, lastInsertId: n };
            }
            case "mapRecord": {
                let { value: n, lastInsertId: i } = await this.interpretNode(t.args.expr, r), o = n === null ? {} : Lt(n);
                for (let [s, a] of Object.entries(t.args.fields))
                    o[s] = Jd(a, o[s], r.scope, r.generators);
                return { value: o, lastInsertId: i };
            }
            default: T(t, `Unexpected node type: ${t.type}`);
        } }
    },
    _e_e = new WeakMap(),
    _e_t = new WeakMap(),
    _e_r = new WeakMap(),
    _e_n = new WeakMap(),
    _e_i = new WeakMap(),
    _e_o = new WeakMap(),
    _e_s = new WeakMap(),
    _e_instances = new WeakSet(),
    _e_a = function _e_a() { var _b; return ((_b = __classPrivateFieldGet(this, _e_s, "f")) === null || _b === void 0 ? void 0 : _b.maxBindValues) !== void 0 ? __classPrivateFieldGet(this, _e_s, "f").maxBindValues : __classPrivateFieldGet(this, _e_instances, "m", _e_l).call(this); },
    _e_l = function _e_l() { if (__classPrivateFieldGet(this, _e_o, "f") !== void 0)
        switch (__classPrivateFieldGet(this, _e_o, "f")) {
            case "cockroachdb":
            case "postgres":
            case "postgresql":
            case "prisma+postgres": return 32766;
            case "mysql": return 65535;
            case "sqlite": return 999;
            case "sqlserver": return 2098;
            case "mongodb": return;
            default: T(__classPrivateFieldGet(this, _e_o, "f"), `Unexpected provider: ${__classPrivateFieldGet(this, _e_o, "f")}`);
        } },
    _e_u = function _e_u(t, r, n) { var _b; return xr({ query: t, execute: n, provider: (_b = __classPrivateFieldGet(this, _e_o, "f")) !== null && _b !== void 0 ? _b : r.provider, tracingHelper: __classPrivateFieldGet(this, _e_r, "f"), onQuery: __classPrivateFieldGet(this, _e_e, "f") }); },
    _k);
function ka(e) { return Array.isArray(e) ? e.length === 0 : e == null; }
function ti(e) { return Array.isArray(e) ? e : [e]; }
function te(e) { if (typeof e == "number")
    return e; if (typeof e == "string")
    return Number(e); throw new Error(`Expected number, got ${typeof e}`); }
function Lt(e) { if (typeof e == "object" && e !== null)
    return e; throw new Error(`Expected object, got ${typeof e}`); }
function Oa(e, t) { var _b; return Array.isArray(e) ? e.map(r => Oa(r, t)) : typeof e == "object" && e !== null ? (_b = e[t]) !== null && _b !== void 0 ? _b : null : e; }
function Ud(e, t, r) { var _b; for (let { joinExpr: n, childRecords: i } of t) {
    let o = n.on.map(([c]) => c), s = n.on.map(([, c]) => c), a = {}, l = Array.isArray(e) ? e : [e];
    for (let c of l) {
        let p = Lt(c), d = Xe(p, o);
        a[d] || (a[d] = []), a[d].push(p), n.isRelationUnique ? p[n.parentField] = null : p[n.parentField] = [];
    }
    let u = r ? void 0 : Bd(l, o);
    for (let c of Array.isArray(i) ? i : [i]) {
        if (c === null)
            continue;
        let p = Xe(Lt(c), s, u);
        for (let d of (_b = a[p]) !== null && _b !== void 0 ? _b : [])
            n.isRelationUnique ? d[n.parentField] = c : d[n.parentField].push(c);
    }
} return e; }
function Bd(e, t) { function r(o) { switch (o) {
    case "number": return Number;
    case "string": return String;
    case "boolean": return Boolean;
    case "bigint": return BigInt;
    default: return;
} } let n = Array.from({ length: t.length }), i = 0; for (let o of e) {
    let s = Lt(o);
    for (let [a, l] of t.entries())
        if (s[l] !== null && n[a] === void 0) {
            let u = r(typeof s[l]);
            u !== void 0 && (n[a] = u), i++;
        }
    if (i === t.length)
        break;
} return n; }
function Qd(e, t, r, n) { switch (e.type) {
    case "value": return H(e.value, r, n);
    case "lastInsertId": return t;
    default: T(e, `Unexpected field initializer type: ${e.type}`);
} }
function Jd(e, t, r, n) { switch (e.type) {
    case "set": return H(e.value, r, n);
    case "add": return te(t) + te(H(e.value, r, n));
    case "subtract": return te(t) - te(H(e.value, r, n));
    case "multiply": return te(t) * te(H(e.value, r, n));
    case "divide": {
        let i = te(t), o = te(H(e.value, r, n));
        return o === 0 ? null : i / o;
    }
    default: T(e, `Unexpected field operation type: ${e.type}`);
} }
function Ia(e, t) { if (!t || t.plugins.length === 0)
    return e; let r = ws(t.plugins, { query: t.queryInfo, sql: e.sql }); return r ? { ...e, sql: bs(e.sql, r) } : e; }
function Na(e, t, r) { var _b; let n = (_b = e.pagination) === null || _b === void 0 ? void 0 : _b.cursor; if (n)
    for (let [i, o] of Object.entries(n))
        n[i] = H(o, t, r); for (let i of Object.values(e.nested))
    Na(i, t, r); }
function ri(e) { return J(e); }
function Da(e) { return new ni(e).deserialize(); }
function Hd(e) { return Buffer.from(e, "base64url"); }
var ni = (_q = class {
        constructor(t) {
            _ni_instances.add(this);
            _ni_e.set(this, void 0);
            _ni_t.set(this, void 0);
            _ni_r.set(this, 0);
            __classPrivateFieldSet(this, _ni_e, t, "f");
            let r = Hd(t.graph);
            __classPrivateFieldSet(this, _ni_t, new DataView(r.buffer, r.byteOffset, r.byteLength), "f");
        }
        deserialize() { let { inputNodeCount: t, outputNodeCount: r, rootCount: n } = __classPrivateFieldGet(this, _ni_instances, "m", _ni_a).call(this), i = __classPrivateFieldGet(this, _ni_instances, "m", _ni_l).call(this, t), o = __classPrivateFieldGet(this, _ni_instances, "m", _ni_u).call(this, r), s = __classPrivateFieldGet(this, _ni_instances, "m", _ni_p).call(this, n); return { strings: __classPrivateFieldGet(this, _ni_e, "f").strings, inputNodes: i, outputNodes: o, roots: s }; }
    },
    _ni_e = new WeakMap(),
    _ni_t = new WeakMap(),
    _ni_r = new WeakMap(),
    _ni_instances = new WeakSet(),
    _ni_n = function _ni_n() { var _b, _f; let t = 0, r = 0, n; do
        n = __classPrivateFieldGet(this, _ni_t, "f").getUint8((__classPrivateFieldSet(this, _ni_r, (_f = __classPrivateFieldGet(this, _ni_r, "f"), _b = _f++, _f), "f"), _b)), t |= (n & 127) << r, r += 7;
    while (n >= 128); return t; },
    _ni_i = function _ni_i() { let t = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this); return t === 0 ? void 0 : t - 1; },
    _ni_o = function _ni_o() { let t = __classPrivateFieldGet(this, _ni_t, "f").getUint8(__classPrivateFieldGet(this, _ni_r, "f")); return __classPrivateFieldSet(this, _ni_r, __classPrivateFieldGet(this, _ni_r, "f") + 1, "f"), t; },
    _ni_s = function _ni_s() { let t = __classPrivateFieldGet(this, _ni_t, "f").getUint16(__classPrivateFieldGet(this, _ni_r, "f"), !0); return __classPrivateFieldSet(this, _ni_r, __classPrivateFieldGet(this, _ni_r, "f") + 2, "f"), t; },
    _ni_a = function _ni_a() { let t = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this), r = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this), n = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this); return { inputNodeCount: t, outputNodeCount: r, rootCount: n }; },
    _ni_l = function _ni_l(t) { let r = []; for (let n = 0; n < t; n++) {
        let i = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this), o = {};
        for (let s = 0; s < i; s++) {
            let a = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this), l = __classPrivateFieldGet(this, _ni_instances, "m", _ni_s).call(this), u = __classPrivateFieldGet(this, _ni_instances, "m", _ni_i).call(this), c = __classPrivateFieldGet(this, _ni_instances, "m", _ni_i).call(this), d = { flags: __classPrivateFieldGet(this, _ni_instances, "m", _ni_o).call(this) };
            l !== 0 && (d.scalarMask = l), u !== void 0 && (d.childNodeId = u), c !== void 0 && (d.enumNameIndex = c), o[a] = d;
        }
        r.push({ edges: o });
    } return r; },
    _ni_u = function _ni_u(t) { let r = []; for (let n = 0; n < t; n++) {
        let i = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this), o = {};
        for (let s = 0; s < i; s++) {
            let a = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this), l = __classPrivateFieldGet(this, _ni_instances, "m", _ni_i).call(this), u = __classPrivateFieldGet(this, _ni_instances, "m", _ni_i).call(this), c = {};
            l !== void 0 && (c.argsNodeId = l), u !== void 0 && (c.outputNodeId = u), o[a] = c;
        }
        r.push({ edges: o });
    } return r; },
    _ni_p = function _ni_p(t) { let r = {}; for (let n = 0; n < t; n++) {
        let i = __classPrivateFieldGet(this, _ni_instances, "m", _ni_n).call(this), o = __classPrivateFieldGet(this, _ni_instances, "m", _ni_i).call(this), s = __classPrivateFieldGet(this, _ni_instances, "m", _ni_i).call(this), a = __classPrivateFieldGet(this, _ni_e, "f").strings[i], l = {};
        o !== void 0 && (l.argsNodeId = o), s !== void 0 && (l.outputNodeId = s), r[a] = l;
    } return r; },
    _q);
var Vt = (_v = class e {
        constructor(t, r) {
            _e_e_1.set(this, void 0);
            _e_t_1.set(this, void 0);
            _e_r_1.set(this, void 0);
            __classPrivateFieldSet(this, _e_e_1, t, "f"), __classPrivateFieldSet(this, _e_r_1, r, "f"), __classPrivateFieldSet(this, _e_t_1, new Map, "f");
            for (let n = 0; n < t.strings.length; n++)
                __classPrivateFieldGet(this, _e_t_1, "f").set(t.strings[n], n);
        }
        static deserialize(t, r) { let n = Da(t); return new _v(n, r); }
        static fromData(t, r) { return new _v(t, r); }
        root(t) { let r = __classPrivateFieldGet(this, _e_e_1, "f").roots[t]; if (r)
            return { argsNodeId: r.argsNodeId, outputNodeId: r.outputNodeId }; }
        inputNode(t) { if (!(t === void 0 || t < 0 || t >= __classPrivateFieldGet(this, _e_e_1, "f").inputNodes.length))
            return { id: t }; }
        outputNode(t) { if (!(t === void 0 || t < 0 || t >= __classPrivateFieldGet(this, _e_e_1, "f").outputNodes.length))
            return { id: t }; }
        inputEdge(t, r) { var _b; if (!t)
            return; let n = __classPrivateFieldGet(this, _e_e_1, "f").inputNodes[t.id]; if (!n)
            return; let i = __classPrivateFieldGet(this, _e_t_1, "f").get(r); if (i === void 0)
            return; let o = n.edges[i]; if (o)
            return { flags: o.flags, childNodeId: o.childNodeId, scalarMask: (_b = o.scalarMask) !== null && _b !== void 0 ? _b : 0, enumNameIndex: o.enumNameIndex }; }
        outputEdge(t, r) { if (!t)
            return; let n = __classPrivateFieldGet(this, _e_e_1, "f").outputNodes[t.id]; if (!n)
            return; let i = __classPrivateFieldGet(this, _e_t_1, "f").get(r); if (i === void 0)
            return; let o = n.edges[i]; if (o)
            return { argsNodeId: o.argsNodeId, outputNodeId: o.outputNodeId }; }
        enumValues(t) { if ((t === null || t === void 0 ? void 0 : t.enumNameIndex) === void 0)
            return; let r = __classPrivateFieldGet(this, _e_e_1, "f").strings[t.enumNameIndex]; if (r)
            return __classPrivateFieldGet(this, _e_r_1, "f").call(this, r); }
        getString(t) { return __classPrivateFieldGet(this, _e_e_1, "f").strings[t]; }
    },
    _e_e_1 = new WeakMap(),
    _e_t_1 = new WeakMap(),
    _e_r_1 = new WeakMap(),
    _v), re = { ParamScalar: 1, ParamEnum: 2, ParamListScalar: 4, ParamListEnum: 8, ListObject: 16, Object: 32 }, M = { String: 1, Int: 2, BigInt: 4, Float: 8, Decimal: 16, Boolean: 32, DateTime: 64, Json: 128, Bytes: 256 };
function ne(e, t) { return (e.flags & t) !== 0; }
function we(e) { return e.scalarMask; }
var zd = new Set(["DateTime", "Decimal", "BigInt", "Bytes", "Json", "Raw"]);
function Ir(e) { if (e == null)
    return { kind: "null" }; if (typeof e == "string")
    return { kind: "primitive", value: e }; if (typeof e == "number")
    return { kind: "primitive", value: e }; if (typeof e == "boolean")
    return { kind: "primitive", value: e }; if (Array.isArray(e))
    return { kind: "array", items: e }; if (typeof e == "object") {
    let t = e;
    if ("$type" in t && typeof t.$type == "string") {
        let r = t.$type;
        return zd.has(r) ? { kind: "taggedScalar", tag: r, value: t.value } : { kind: "structural", value: t.value };
    }
    return { kind: "object", entries: t };
} return { kind: "structural", value: e }; }
function Ma(e) { return typeof e == "object" && e !== null && !Array.isArray(e) && !("$type" in e); }
function Fa(e) { return typeof e == "object" && e !== null && "$type" in e && typeof e.$type == "string"; }
function ii(e, t) { let r = new Or(t), n = e.modelName ? `${e.modelName}.${e.action}` : e.action, i = t.root(n); return { parameterizedQuery: { ...e, query: r.parameterizeFieldSelection(e.query, i === null || i === void 0 ? void 0 : i.argsNodeId, i === null || i === void 0 ? void 0 : i.outputNodeId) }, placeholderValues: r.getPlaceholderValues() }; }
function oi(e, t) { let r = new Or(t), n = []; for (let i = 0; i < e.batch.length; i++) {
    let o = e.batch[i], s = o.modelName ? `${o.modelName}.${o.action}` : o.action, a = t.root(s);
    n.push({ ...o, query: r.parameterizeFieldSelection(o.query, a === null || a === void 0 ? void 0 : a.argsNodeId, a === null || a === void 0 ? void 0 : a.outputNodeId) });
} return { parameterizedBatch: { ...e, batch: n }, placeholderValues: r.getPlaceholderValues() }; }
var Or = (_w = class {
        constructor(t) {
            _Or_instances.add(this);
            _Or_e.set(this, void 0);
            _Or_t.set(this, new Map);
            _Or_r.set(this, new Map);
            _Or_n.set(this, 1);
            __classPrivateFieldSet(this, _Or_e, t, "f");
        }
        getPlaceholderValues() { return Object.fromEntries(__classPrivateFieldGet(this, _Or_t, "f")); }
        parameterizeFieldSelection(t, r, n) { let i = __classPrivateFieldGet(this, _Or_e, "f").inputNode(r), o = __classPrivateFieldGet(this, _Or_e, "f").outputNode(n), s = { ...t }; return t.arguments && t.arguments.$type !== "Raw" && (s.arguments = __classPrivateFieldGet(this, _Or_instances, "m", _Or_o).call(this, t.arguments, i)), t.selection && (s.selection = __classPrivateFieldGet(this, _Or_instances, "m", _Or_c).call(this, t.selection, o)), s; }
    },
    _Or_e = new WeakMap(),
    _Or_t = new WeakMap(),
    _Or_r = new WeakMap(),
    _Or_n = new WeakMap(),
    _Or_instances = new WeakSet(),
    _Or_i = function _Or_i(t, r) { var _b, _f; let n = Wd(t, r), i = __classPrivateFieldGet(this, _Or_r, "f").get(n); if (i !== void 0)
        return _a(i, r); let o = `%${__classPrivateFieldSet(this, _Or_n, (_f = __classPrivateFieldGet(this, _Or_n, "f"), _b = _f++, _f), "f"), _b}`; return __classPrivateFieldGet(this, _Or_r, "f").set(n, o), __classPrivateFieldGet(this, _Or_t, "f").set(o, t), _a(o, r); },
    _Or_o = function _Or_o(t, r) { if (!r)
        return t; let n = {}; for (let [i, o] of Object.entries(t)) {
        let s = __classPrivateFieldGet(this, _Or_e, "f").inputEdge(r, i);
        s ? n[i] = __classPrivateFieldGet(this, _Or_instances, "m", _Or_s).call(this, o, s) : n[i] = o;
    } return n; },
    _Or_s = function _Or_s(t, r) { let n = Ir(t); switch (n.kind) {
        case "null": return t;
        case "structural": return t;
        case "primitive": return __classPrivateFieldGet(this, _Or_instances, "m", _Or_a).call(this, n.value, r);
        case "taggedScalar": return __classPrivateFieldGet(this, _Or_instances, "m", _Or_l).call(this, t, n.tag, r);
        case "array": return __classPrivateFieldGet(this, _Or_instances, "m", _Or_u).call(this, n.items, t, r);
        case "object": return __classPrivateFieldGet(this, _Or_instances, "m", _Or_p).call(this, n.entries, r);
        default: throw new Error(`Unknown value kind ${n.kind}`);
    } },
    _Or_a = function _Or_a(t, r) { if (ne(r, re.ParamEnum) && r.enumNameIndex !== void 0 && typeof t == "string") {
        let o = __classPrivateFieldGet(this, _Or_e, "f").enumValues(r);
        if (o && Object.hasOwn(o, t)) {
            let s = { type: "Enum" };
            return __classPrivateFieldGet(this, _Or_instances, "m", _Or_i).call(this, o[t], s);
        }
    } if (!ne(r, re.ParamScalar))
        return t; let n = we(r); if (n === 0)
        return t; let i = si(t); return La(i, n) ? (n & M.Json && (t = JSON.stringify(t)), __classPrivateFieldGet(this, _Or_instances, "m", _Or_i).call(this, t, i)) : t; },
    _Or_l = function _Or_l(t, r, n) { if (!ne(n, re.ParamScalar))
        return t; let i = we(n); if (i === 0 || !qa(r, i))
        return t; let o = Va(t.$type), s = ja(t); return __classPrivateFieldGet(this, _Or_instances, "m", _Or_i).call(this, s, o); },
    _Or_u = function _Or_u(t, r, n) { if (ne(n, re.ParamScalar) && we(n) & M.Json) {
        let i = K(Z(t)), o = { type: "Json" };
        return __classPrivateFieldGet(this, _Or_instances, "m", _Or_i).call(this, i, o);
    } if (ne(n, re.ParamEnum)) {
        let i = __classPrivateFieldGet(this, _Or_e, "f").enumValues(n);
        if (i && t.every(o => typeof o == "string" && Object.hasOwn(i, o))) {
            let o = { type: "List", inner: { type: "Enum" } };
            return __classPrivateFieldGet(this, _Or_instances, "m", _Or_i).call(this, t, o);
        }
    } if (ne(n, re.ParamListScalar) && t.every(o => em(o, n)) && t.length > 0) {
        let o = t.map(l => tm(l)), a = { type: "List", inner: Yd(t) };
        return __classPrivateFieldGet(this, _Or_instances, "m", _Or_i).call(this, o, a);
    } if (ne(n, re.ListObject)) {
        let i = __classPrivateFieldGet(this, _Or_e, "f").inputNode(n.childNodeId);
        if (i)
            return t.map(o => Ma(o) ? __classPrivateFieldGet(this, _Or_instances, "m", _Or_o).call(this, o, i) : o);
    } return r; },
    _Or_p = function _Or_p(t, r) { if (ne(r, re.Object)) {
        let i = __classPrivateFieldGet(this, _Or_e, "f").inputNode(r.childNodeId);
        if (i)
            return __classPrivateFieldGet(this, _Or_instances, "m", _Or_o).call(this, t, i);
    } if (we(r) & M.Json) {
        let i = K(Z(t)), o = { type: "Json" };
        return __classPrivateFieldGet(this, _Or_instances, "m", _Or_i).call(this, i, o);
    } return t; },
    _Or_c = function _Or_c(t, r) { if (!t || !r)
        return t; let n = {}; for (let [i, o] of Object.entries(t)) {
        if (i === "$scalars" || i === "$composites" || typeof o == "boolean") {
            n[i] = o;
            continue;
        }
        let s = __classPrivateFieldGet(this, _Or_e, "f").outputEdge(r, i);
        if (s) {
            let a = o, l = __classPrivateFieldGet(this, _Or_e, "f").inputNode(s.argsNodeId), u = __classPrivateFieldGet(this, _Or_e, "f").outputNode(s.outputNodeId), c = { selection: a.selection ? __classPrivateFieldGet(this, _Or_instances, "m", _Or_c).call(this, a.selection, u) : {} };
            a.arguments && (c.arguments = __classPrivateFieldGet(this, _Or_instances, "m", _Or_o).call(this, a.arguments, l)), n[i] = c;
        }
        else
            n[i] = o;
    } return n; },
    _w);
function _a(e, t) { return { $type: "Param", value: { name: e, ...t } }; }
function $a(e) { return e.type === "List" ? `List<${$a(e.inner)}>` : e.type; }
function Gd(e) { return ArrayBuffer.isView(e) ? Buffer.from(e.buffer, e.byteOffset, e.byteLength).toString("base64") : JSON.stringify(e); }
function Wd(e, t) { let r = $a(t), n = Gd(e); return `${r}:${n}`; }
var Kd = 2 ** 31 - 1, Zd = -(2 ** 31);
function si(e) { switch (typeof e) {
    case "boolean": return { type: "Boolean" };
    case "number": return Number.isInteger(e) ? Zd <= e && e <= Kd ? { type: "Int" } : { type: "BigInt" } : { type: "Float" };
    case "string": return { type: "String" };
    default: throw new Error("unreachable");
} }
function La({ type: e }, t) { switch (e) {
    case "Boolean": return (t & M.Boolean) !== 0;
    case "Int": return (t & (M.Int | M.BigInt | M.Float)) !== 0;
    case "BigInt": return (t & M.BigInt) !== 0;
    case "Float": return (t & M.Float) !== 0;
    case "String": return (t & M.String) !== 0;
    default: return !1;
} }
function Va(e) { switch (e) {
    case "BigInt":
    case "Bytes":
    case "DateTime":
    case "Json": return { type: e };
    case "Decimal": return { type: "Float" };
    default: return;
} }
function Yd(e) { var _b; let t = { type: "Any" }; for (let r of e) {
    let n = Ir(r), i;
    switch (n.kind) {
        case "primitive":
            i = si(n.value);
            break;
        case "taggedScalar":
            i = (_b = Va(n.tag)) !== null && _b !== void 0 ? _b : { type: "Any" };
            break;
        default: return { type: "Any" };
    }
    t = Xd(t, i);
} return t; }
function Xd(e, t) { if (e.type === "Any")
    return t; if (t.type === "Any" || e.type === t.type)
    return e; let r = { Int: 0, BigInt: 1, Float: 2 }, n = r[e.type], i = r[t.type]; return n !== void 0 && i !== void 0 ? n >= i ? e : t : { type: "Any" }; }
function qa(e, t) { switch (e) {
    case "DateTime": return (t & M.DateTime) !== 0;
    case "Decimal": return (t & M.Decimal) !== 0;
    case "BigInt": return (t & M.BigInt) !== 0;
    case "Bytes": return (t & M.Bytes) !== 0;
    case "Json": return (t & M.Json) !== 0;
    default: return !1;
} }
function em(e, t) { let r = Ir(e); switch (r.kind) {
    case "structural": return !1;
    case "null": return !1;
    case "primitive": {
        let n = si(r.value), i = we(t);
        return i !== 0 && La(n, i);
    }
    case "taggedScalar": {
        let n = we(t);
        return n !== 0 && qa(r.tag, n);
    }
    default: return !1;
} }
function tm(e) { return Fa(e) ? ja(e) : e; }
function ja(e) { return e.value; }
async function rm() { var _b; return (_b = globalThis.crypto) !== null && _b !== void 0 ? _b : await Promise.resolve().then(() => __importStar(require("node:crypto"))); }
async function Ua() { return (await rm()).randomUUID(); }
async function Ba(e, t) { return new Promise(r => { e.addEventListener(t, r, { once: !0 }); }); }
var V = class extends N {
    constructor(t, r) {
        super("Transaction API error: " + t, "P2028", r);
        this.name = "TransactionManagerError";
    }
}, Re = class extends V {
    constructor() { super("Transaction not found. Transaction ID is invalid, refers to an old closed transaction Prisma doesn't have information about anymore, or was obtained before disconnecting."); }
}, Nr = class extends V {
    constructor(t) { super(`Transaction already closed: A ${t} cannot be executed on a committed transaction.`); }
}, Dr = class extends V {
    constructor(t) { super(`Transaction already closed: A ${t} cannot be executed on a transaction that was rolled back.`); }
}, Mr = class extends V {
    constructor() { super("Unable to start a transaction in the given time."); }
}, Fr = class extends V {
    constructor(t, { timeout: r, timeTaken: n }) { super(`A ${t} cannot be executed on an expired transaction. The timeout for this transaction was ${r} ms, however ${n} ms passed since the start of the transaction. Consider increasing the interactive transaction timeout or doing less work in the transaction.`, { operation: t, timeout: r, timeTaken: n }); }
}, ie = class extends V {
    constructor(t) { super(`Internal Consistency Error: ${t}`); }
}, _r = class extends V {
    constructor(t) { super(`Invalid isolation level: ${t}`, { isolationLevel: t }); }
};
var nm = 100, et = _("prisma:client:transactionManager"), im = () => ({ sql: "COMMIT", args: [], argTypes: [] }), om = () => ({ sql: "ROLLBACK", args: [], argTypes: [] }), sm = () => ({ sql: '-- Implicit "COMMIT" query via underlying driver', args: [], argTypes: [] }), am = () => ({ sql: '-- Implicit "ROLLBACK" query via underlying driver', args: [], argTypes: [] }), qt = (_x = class {
        constructor({ driverAdapter: t, transactionOptions: r, tracingHelper: n, onQuery: i, provider: o }) {
            _qt_instances.add(this);
            this.transactions = new Map;
            this.closedTransactions = [];
            _qt_e.set(this, void 0);
            _qt_t.set(this, void 0);
            this.driverAdapter = t, this.transactionOptions = r, this.tracingHelper = n, __classPrivateFieldSet(this, _qt_e, i, "f"), __classPrivateFieldSet(this, _qt_t, o, "f");
        }
        async startInternalTransaction(t) { let r = t !== void 0 ? __classPrivateFieldGet(this, _qt_instances, "m", _qt_m).call(this, t) : {}; return await this.tracingHelper.runInChildSpan("start_transaction", () => __classPrivateFieldGet(this, _qt_instances, "m", _qt_r).call(this, r)); }
        async startTransaction(t) { let r = t !== void 0 ? __classPrivateFieldGet(this, _qt_instances, "m", _qt_m).call(this, t) : this.transactionOptions; return await this.tracingHelper.runInChildSpan("start_transaction", () => __classPrivateFieldGet(this, _qt_instances, "m", _qt_r).call(this, r)); }
        async commitTransaction(t) { return await this.tracingHelper.runInChildSpan("commit_transaction", async () => { await __classPrivateFieldGet(this, _qt_instances, "m", _qt_p).call(this, t, "commit", async (r) => { if (r.depth > 1) {
            if (!r.transaction)
                throw new Re;
            let n = r.savepoints.at(-1);
            if (!n)
                throw new ie(`Missing savepoint for nested commit. Depth: ${r.depth}, transactionId: ${r.id}`);
            try {
                await __classPrivateFieldGet(this, _qt_instances, "m", _qt_a).call(this, r.transaction, n);
            }
            finally {
                r.savepoints.pop(), r.depth -= 1;
            }
            return;
        } await __classPrivateFieldGet(this, _qt_instances, "m", _qt_d).call(this, r, "committed"); }); }); }
        async rollbackTransaction(t) { return await this.tracingHelper.runInChildSpan("rollback_transaction", async () => { await __classPrivateFieldGet(this, _qt_instances, "m", _qt_p).call(this, t, "rollback", async (r) => { if (r.depth > 1) {
            if (!r.transaction)
                throw new Re;
            let n = r.savepoints.at(-1);
            if (!n)
                throw new ie(`Missing savepoint for nested rollback. Depth: ${r.depth}, transactionId: ${r.id}`);
            try {
                await __classPrivateFieldGet(this, _qt_instances, "m", _qt_s).call(this, r.transaction)(n), await __classPrivateFieldGet(this, _qt_instances, "m", _qt_a).call(this, r.transaction, n);
            }
            finally {
                r.savepoints.pop(), r.depth -= 1;
            }
            return;
        } await __classPrivateFieldGet(this, _qt_instances, "m", _qt_d).call(this, r, "rolled_back"); }); }); }
        async getTransaction(t, r) { let n = __classPrivateFieldGet(this, _qt_instances, "m", _qt_n).call(this, t.id, r); if (n.status === "closing" && (await n.closing, n = __classPrivateFieldGet(this, _qt_instances, "m", _qt_n).call(this, t.id, r)), !n.transaction)
            throw new Re; return n.transaction; }
        async cancelAllTransactions() { await Promise.allSettled([...this.transactions.values()].map(t => __classPrivateFieldGet(this, _qt_instances, "m", _qt_c).call(this, t, async () => { let r = this.transactions.get(t.id); r && await __classPrivateFieldGet(this, _qt_instances, "m", _qt_d).call(this, r, "rolled_back"); }))); }
    },
    _qt_e = new WeakMap(),
    _qt_t = new WeakMap(),
    _qt_instances = new WeakSet(),
    _qt_r = async function _qt_r(t) { var _b; if (t.newTxId)
        return await __classPrivateFieldGet(this, _qt_instances, "m", _qt_p).call(this, t.newTxId, "start", async (s) => { if (s.status !== "running")
            throw new ie(`Transaction in invalid state ${s.status} when starting a nested transaction.`); if (!s.transaction)
            throw new ie("Transaction missing underlying driver transaction when starting a nested transaction."); s.depth += 1; let a = __classPrivateFieldGet(this, _qt_instances, "m", _qt_i).call(this, s); s.savepoints.push(a); try {
            await __classPrivateFieldGet(this, _qt_instances, "m", _qt_o).call(this, s.transaction)(a);
        }
        catch (l) {
            throw s.depth -= 1, s.savepoints.pop(), l;
        } return { id: s.id }; }); let r = { id: await Ua(), status: "waiting", timer: void 0, timeout: t.timeout, startedAt: Date.now(), transaction: void 0, operationQueue: Promise.resolve(), depth: 1, savepoints: [], savepointCounter: 0 }, n = new AbortController, i = Qa(() => n.abort(), t.maxWait); (_b = i === null || i === void 0 ? void 0 : i.unref) === null || _b === void 0 ? void 0 : _b.call(i); let o = this.driverAdapter.startTransaction(t.isolationLevel).catch(Ge); switch ((r.transaction = await Promise.race([o.finally(() => clearTimeout(i)), Ba(n.signal, "abort").then(() => { })]), this.transactions.set(r.id, r), r.status)) {
        case "waiting":
            if (n.signal.aborted)
                throw o.then(s => s.rollback()).catch(s => et("error in discarded transaction:", s)), await __classPrivateFieldGet(this, _qt_instances, "m", _qt_d).call(this, r, "timed_out"), new Mr;
            return r.status = "running", r.timer = __classPrivateFieldGet(this, _qt_instances, "m", _qt_u).call(this, r.id, t.timeout), { id: r.id };
        case "timed_out":
        case "running":
        case "committed":
        case "rolled_back": throw new ie(`Transaction in invalid state ${r.status} although it just finished startup.`);
        default: T(r.status, "Unknown transaction status.");
    } },
    _qt_n = function _qt_n(t, r) { let n = this.transactions.get(t); if (!n) {
        let i = this.closedTransactions.find(o => o.id === t);
        if (i)
            switch (et("Transaction already closed.", { transactionId: t, status: i.status }), i.status) {
                case "closing":
                case "waiting":
                case "running": throw new ie("Active transaction found in closed transactions list.");
                case "committed": throw new Nr(r);
                case "rolled_back": throw new Dr(r);
                case "timed_out": throw new Fr(r, { timeout: i.timeout, timeTaken: Date.now() - i.startedAt });
            }
        else
            throw et("Transaction not found.", t), new Re;
    } if (["committed", "rolled_back", "timed_out"].includes(n.status))
        throw new ie("Closed transaction found in active transactions map."); return n; },
    _qt_i = function _qt_i(t) { return `prisma_sp_${t.savepointCounter++}`; },
    _qt_o = function _qt_o(t) { if (t.createSavepoint)
        return t.createSavepoint.bind(t); throw new V(`Nested transactions are not supported by adapter "${t.adapterName}" (${t.provider}): createSavepoint is not implemented.`); },
    _qt_s = function _qt_s(t) { if (t.rollbackToSavepoint)
        return t.rollbackToSavepoint.bind(t); throw new V(`Nested transactions are not supported by adapter "${t.adapterName}" (${t.provider}): rollbackToSavepoint is not implemented.`); },
    _qt_a = async function _qt_a(t, r) { t.releaseSavepoint && await t.releaseSavepoint(r); },
    _qt_l = function _qt_l(t) { et("Transaction already committed or rolled back when timeout happened.", t); },
    _qt_u = function _qt_u(t, r) { var _b; let n = Date.now(), i = Qa(async () => { et("Transaction timed out.", { transactionId: t, timeoutStartedAt: n, timeout: r }); let o = this.transactions.get(t); if (!o) {
        __classPrivateFieldGet(this, _qt_instances, "m", _qt_l).call(this, t);
        return;
    } await __classPrivateFieldGet(this, _qt_instances, "m", _qt_c).call(this, o, async () => { let s = this.transactions.get(t); s && ["running", "waiting"].includes(s.status) ? await __classPrivateFieldGet(this, _qt_instances, "m", _qt_d).call(this, s, "timed_out") : __classPrivateFieldGet(this, _qt_instances, "m", _qt_l).call(this, t); }); }, r); return (_b = i === null || i === void 0 ? void 0 : i.unref) === null || _b === void 0 ? void 0 : _b.call(i), i; },
    _qt_p = async function _qt_p(t, r, n) { let i = __classPrivateFieldGet(this, _qt_instances, "m", _qt_n).call(this, t, r); return await __classPrivateFieldGet(this, _qt_instances, "m", _qt_c).call(this, i, async () => { let o = __classPrivateFieldGet(this, _qt_instances, "m", _qt_n).call(this, t, r); return await n(o); }); },
    _qt_c = async function _qt_c(t, r) { let n = t.operationQueue, i; t.operationQueue = new Promise(o => { i = o; }), await n; try {
        return await r();
    }
    finally {
        i();
    } },
    _qt_d = async function _qt_d(t, r) { let n = async () => { et("Closing transaction.", { transactionId: t.id, status: r }); try {
        if (t.transaction && r === "committed")
            if (t.transaction.options.usePhantomQuery)
                await __classPrivateFieldGet(this, _qt_instances, "m", _qt_f).call(this, sm(), t.transaction, () => t.transaction.commit());
            else {
                let i = im();
                await __classPrivateFieldGet(this, _qt_instances, "m", _qt_f).call(this, i, t.transaction, () => t.transaction.executeRaw(i)).then(() => t.transaction.commit(), o => { let s = () => Promise.reject(o); return t.transaction.rollback().then(s, s); });
            }
        else if (t.transaction)
            if (t.transaction.options.usePhantomQuery)
                await __classPrivateFieldGet(this, _qt_instances, "m", _qt_f).call(this, am(), t.transaction, () => t.transaction.rollback());
            else {
                let i = om();
                try {
                    await __classPrivateFieldGet(this, _qt_instances, "m", _qt_f).call(this, i, t.transaction, () => t.transaction.executeRaw(i));
                }
                finally {
                    await t.transaction.rollback();
                }
            }
    }
    finally {
        t.status = r, clearTimeout(t.timer), t.timer = void 0, this.transactions.delete(t.id), this.closedTransactions.push(t), this.closedTransactions.length > nm && this.closedTransactions.shift();
    } }; t.status === "closing" ? (await t.closing, __classPrivateFieldGet(this, _qt_instances, "m", _qt_n).call(this, t.id, r === "committed" ? "commit" : "rollback")) : await Object.assign(t, { status: "closing", reason: r, closing: n() }).closing; },
    _qt_m = function _qt_m(t) { if (!t.timeout)
        throw new V("timeout is required"); if (!t.maxWait)
        throw new V("maxWait is required"); if (t.isolationLevel === "SNAPSHOT")
        throw new _r(t.isolationLevel); return { ...t, timeout: t.timeout, maxWait: t.maxWait }; },
    _qt_f = function _qt_f(t, r, n) { var _b; return xr({ query: t, execute: n, provider: (_b = __classPrivateFieldGet(this, _qt_t, "f")) !== null && _b !== void 0 ? _b : r.provider, tracingHelper: this.tracingHelper, onQuery: __classPrivateFieldGet(this, _qt_e, "f") }); },
    _x);
function Qa(e, t) { return t !== void 0 ? setTimeout(e, t) : void 0; }
var F = require("@prisma/client-runtime-utils");
var $r = "7.8.0";
var Ja = { bigint: "bigint", date: "datetime", decimal: "decimal", bytes: "bytes" };
function za(e) { let t; try {
    t = JSON.parse(e);
}
catch (i) {
    throw new Error(`Received invalid serialized parameters: ${i.message}`);
} if (!Array.isArray(t))
    throw new Error("Received invalid serialized parameters: expected an array"); let r = t.map(i => Ga(i)), n = t.map(i => um(i)); return { args: r, argTypes: n }; }
function Ga(e) { if (Array.isArray(e))
    return e.map(t => Ga(t)); if (typeof e == "object" && e !== null && "prisma__value" in e) {
    if (!("prisma__type" in e))
        throw new Error("Invalid serialized parameter, prisma__type should be present when prisma__value is present");
    return `${e.prisma__value}`;
} return typeof e == "object" && e !== null ? JSON.stringify(e) : e; }
function um(e) { return Array.isArray(e) ? { scalarType: e.length > 0 ? Ha(e[0]) : "unknown", arity: "list" } : { scalarType: Ha(e), arity: "scalar" }; }
function Ha(e) { return typeof e == "object" && e !== null && "prisma__type" in e && typeof e.prisma__type == "string" && e.prisma__type in Ja ? Ja[e.prisma__type] : typeof e == "number" ? "decimal" : typeof e == "string" ? "string" : "unknown"; }
function Wa(e, t) { return { batch: e, transaction: (t === null || t === void 0 ? void 0 : t.kind) === "batch" ? { isolationLevel: t.options.isolationLevel } : void 0 }; }
function Ka(e) { return e ? e.replace(/".*"/g, '"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g, t => `${t[0]}5`) : ""; }
function Za(e) {
    return e.split(`
`).map(t => t.replace(/^\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)\s*/, "").replace(/\+\d+\s*ms$/, "")).join(`
`);
}
var Ya = B(Ji());
function Xa({ title: e, user: t = "prisma", repo: r = "prisma", template: n = "bug_report.yml", body: i }) { return (0, Ya.default)({ user: t, repo: r, template: n, title: e, body: i }); }
function el({ version: e, binaryTarget: t, title: r, description: n, engineVersion: i, database: o, query: s }) {
    var _b, _f;
    let a = Di(6e3 - ((_b = s === null || s === void 0 ? void 0 : s.length) !== null && _b !== void 0 ? _b : 0)), l = Za(De(a)), u = n ? `# Description
\`\`\`
${n}
\`\`\`` : "", c = De(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
## Versions

| Name            | Version            |
|-----------------|--------------------|
| Node            | ${(_f = process.version) === null || _f === void 0 ? void 0 : _f.padEnd(19)}| 
| OS              | ${t === null || t === void 0 ? void 0 : t.padEnd(19)}|
| Prisma Client   | ${e === null || e === void 0 ? void 0 : e.padEnd(19)}|
| Query Engine    | ${i === null || i === void 0 ? void 0 : i.padEnd(19)}|
| Database        | ${o === null || o === void 0 ? void 0 : o.padEnd(19)}|

${u}

## Logs
\`\`\`
${l}
\`\`\`

## Client Snippet
\`\`\`ts
// PLEASE FILL YOUR CODE SNIPPET HERE
\`\`\`

## Schema
\`\`\`prisma
// PLEASE ADD YOUR SCHEMA HERE IF POSSIBLE
\`\`\`

## Prisma Engine Query
\`\`\`
${s ? Ka(s) : ""}
\`\`\`
`), p = Xa({ title: r, body: c });
    return `${r}

This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.

${st(p)}

If you want the Prisma team to look into it, please open the link above \u{1F64F}
To increase the chance of success, please post your schema and a snippet of
how you used Prisma Client in the issue. 
`;
}
var Lr = (_y = class e {
        constructor(t, r, n) {
            var _b;
            _e_e_2.set(this, void 0);
            _e_t_2.set(this, void 0);
            _e_r_2.set(this, void 0);
            _e_n_1.set(this, void 0);
            _e_i_1.set(this, void 0);
            __classPrivateFieldSet(this, _e_e_2, t, "f"), __classPrivateFieldSet(this, _e_t_2, r, "f"), __classPrivateFieldSet(this, _e_r_2, n, "f"), __classPrivateFieldSet(this, _e_n_1, (_b = r.getConnectionInfo) === null || _b === void 0 ? void 0 : _b.call(r), "f"), __classPrivateFieldSet(this, _e_i_1, $t.forSql({ onQuery: __classPrivateFieldGet(this, _e_e_2, "f").onQuery, tracingHelper: __classPrivateFieldGet(this, _e_e_2, "f").tracingHelper, provider: __classPrivateFieldGet(this, _e_e_2, "f").provider, connectionInfo: __classPrivateFieldGet(this, _e_n_1, "f") }), "f");
        }
        static async connect(t) { let r, n; try {
            r = await t.driverAdapterFactory.connect(), n = new qt({ driverAdapter: r, transactionOptions: t.transactionOptions, tracingHelper: t.tracingHelper, onQuery: t.onQuery, provider: t.provider });
        }
        catch (i) {
            throw await (r === null || r === void 0 ? void 0 : r.dispose()), i;
        } return new _y(t, r, n); }
        getConnectionInfo() { var _b; let t = (_b = __classPrivateFieldGet(this, _e_n_1, "f")) !== null && _b !== void 0 ? _b : { supportsRelationJoins: !1 }; return Promise.resolve({ provider: __classPrivateFieldGet(this, _e_t_2, "f").provider, connectionInfo: t }); }
        async execute({ plan: t, placeholderValues: r, transaction: n, batchIndex: i, queryInfo: o }) { let s = n ? await __classPrivateFieldGet(this, _e_r_2, "f").getTransaction(n, i !== void 0 ? "batch query" : "query") : __classPrivateFieldGet(this, _e_t_2, "f"); return await __classPrivateFieldGet(this, _e_i_1, "f").run(t, { queryable: s, transactionManager: n ? { enabled: !1 } : { enabled: !0, manager: __classPrivateFieldGet(this, _e_r_2, "f") }, scope: r, sqlCommenter: __classPrivateFieldGet(this, _e_e_2, "f").sqlCommenters && { plugins: __classPrivateFieldGet(this, _e_e_2, "f").sqlCommenters, queryInfo: o } }); }
        async startTransaction(t) { return { ...await __classPrivateFieldGet(this, _e_r_2, "f").startTransaction(t), payload: void 0 }; }
        async commitTransaction(t) { await __classPrivateFieldGet(this, _e_r_2, "f").commitTransaction(t.id); }
        async rollbackTransaction(t) { await __classPrivateFieldGet(this, _e_r_2, "f").rollbackTransaction(t.id); }
        async disconnect() { try {
            await __classPrivateFieldGet(this, _e_r_2, "f").cancelAllTransactions();
        }
        finally {
            await __classPrivateFieldGet(this, _e_t_2, "f").dispose();
        } }
        apiKey() { return null; }
    },
    _e_e_2 = new WeakMap(),
    _e_t_2 = new WeakMap(),
    _e_r_2 = new WeakMap(),
    _e_n_1 = new WeakMap(),
    _e_i_1 = new WeakMap(),
    _y);
var Vr = (_z = class {
        constructor(t = 1e3) {
            _Vr_e.set(this, void 0);
            _Vr_t.set(this, void 0);
            _Vr_r.set(this, void 0);
            __classPrivateFieldSet(this, _Vr_e, new Map, "f"), __classPrivateFieldSet(this, _Vr_t, new Map, "f"), __classPrivateFieldSet(this, _Vr_r, t, "f");
        }
        getSingle(t) { let r = __classPrivateFieldGet(this, _Vr_e, "f").get(t); return r && (__classPrivateFieldGet(this, _Vr_e, "f").delete(t), __classPrivateFieldGet(this, _Vr_e, "f").set(t, r)), r; }
        setSingle(t, r) { if (__classPrivateFieldGet(this, _Vr_e, "f").has(t)) {
            __classPrivateFieldGet(this, _Vr_e, "f").delete(t), __classPrivateFieldGet(this, _Vr_e, "f").set(t, r);
            return;
        } if (__classPrivateFieldGet(this, _Vr_e, "f").size >= __classPrivateFieldGet(this, _Vr_r, "f")) {
            let n = __classPrivateFieldGet(this, _Vr_e, "f").keys().next().value;
            n !== void 0 && __classPrivateFieldGet(this, _Vr_e, "f").delete(n);
        } __classPrivateFieldGet(this, _Vr_e, "f").set(t, r); }
        getBatch(t) { let r = __classPrivateFieldGet(this, _Vr_t, "f").get(t); return r && (__classPrivateFieldGet(this, _Vr_t, "f").delete(t), __classPrivateFieldGet(this, _Vr_t, "f").set(t, r)), r; }
        setBatch(t, r) { if (__classPrivateFieldGet(this, _Vr_t, "f").has(t)) {
            __classPrivateFieldGet(this, _Vr_t, "f").delete(t), __classPrivateFieldGet(this, _Vr_t, "f").set(t, r);
            return;
        } if (__classPrivateFieldGet(this, _Vr_t, "f").size >= __classPrivateFieldGet(this, _Vr_r, "f")) {
            let n = __classPrivateFieldGet(this, _Vr_t, "f").keys().next().value;
            n !== void 0 && __classPrivateFieldGet(this, _Vr_t, "f").delete(n);
        } __classPrivateFieldGet(this, _Vr_t, "f").set(t, r); }
        clear() { __classPrivateFieldGet(this, _Vr_e, "f").clear(), __classPrivateFieldGet(this, _Vr_t, "f").clear(); }
        get size() { return __classPrivateFieldGet(this, _Vr_e, "f").size + __classPrivateFieldGet(this, _Vr_t, "f").size; }
        get singleCacheSize() { return __classPrivateFieldGet(this, _Vr_e, "f").size; }
        get batchCacheSize() { return __classPrivateFieldGet(this, _Vr_t, "f").size; }
    },
    _Vr_e = new WeakMap(),
    _Vr_t = new WeakMap(),
    _Vr_r = new WeakMap(),
    _z);
var sl = require("@prisma/client-runtime-utils");
var qr = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
function tl(e, t, r) { let n = r || {}, i = n.encode || encodeURIComponent; if (typeof i != "function")
    throw new TypeError("option encode is invalid"); if (!qr.test(e))
    throw new TypeError("argument name is invalid"); let o = i(t); if (o && !qr.test(o))
    throw new TypeError("argument val is invalid"); let s = e + "=" + o; if (n.maxAge !== void 0 && n.maxAge !== null) {
    let a = n.maxAge - 0;
    if (Number.isNaN(a) || !Number.isFinite(a))
        throw new TypeError("option maxAge is invalid");
    s += "; Max-Age=" + Math.floor(a);
} if (n.domain) {
    if (!qr.test(n.domain))
        throw new TypeError("option domain is invalid");
    s += "; Domain=" + n.domain;
} if (n.path) {
    if (!qr.test(n.path))
        throw new TypeError("option path is invalid");
    s += "; Path=" + n.path;
} if (n.expires) {
    if (!cm(n.expires) || Number.isNaN(n.expires.valueOf()))
        throw new TypeError("option expires is invalid");
    s += "; Expires=" + n.expires.toUTCString();
} if (n.httpOnly && (s += "; HttpOnly"), n.secure && (s += "; Secure"), n.priority)
    switch (typeof n.priority == "string" ? n.priority.toLowerCase() : n.priority) {
        case "low": {
            s += "; Priority=Low";
            break;
        }
        case "medium": {
            s += "; Priority=Medium";
            break;
        }
        case "high": {
            s += "; Priority=High";
            break;
        }
        default: throw new TypeError("option priority is invalid");
    } if (n.sameSite)
    switch (typeof n.sameSite == "string" ? n.sameSite.toLowerCase() : n.sameSite) {
        case !0: {
            s += "; SameSite=Strict";
            break;
        }
        case "lax": {
            s += "; SameSite=Lax";
            break;
        }
        case "strict": {
            s += "; SameSite=Strict";
            break;
        }
        case "none": {
            s += "; SameSite=None";
            break;
        }
        default: throw new TypeError("option sameSite is invalid");
    } return n.partitioned && (s += "; Partitioned"), s; }
function cm(e) { return Object.prototype.toString.call(e) === "[object Date]" || e instanceof Date; }
function rl(e, t) { let r = (e || "").split(";").filter(l => typeof l == "string" && !!l.trim()), n = r.shift() || "", i = pm(n), o = i.name, s = i.value; try {
    s = (t === null || t === void 0 ? void 0 : t.decode) === !1 ? s : ((t === null || t === void 0 ? void 0 : t.decode) || decodeURIComponent)(s);
}
catch (_b) { } let a = { name: o, value: s }; for (let l of r) {
    let u = l.split("="), c = (u.shift() || "").trimStart().toLowerCase(), p = u.join("=");
    switch (c) {
        case "expires": {
            a.expires = new Date(p);
            break;
        }
        case "max-age": {
            a.maxAge = Number.parseInt(p, 10);
            break;
        }
        case "secure": {
            a.secure = !0;
            break;
        }
        case "httponly": {
            a.httpOnly = !0;
            break;
        }
        case "samesite": {
            a.sameSite = p;
            break;
        }
        default: a[c] = p;
    }
} return a; }
function pm(e) { let t = "", r = "", n = e.split("="); return n.length > 1 ? (t = n.shift(), r = n.join("=")) : r = e, { name: t, value: r }; }
var jr = class extends Error {
    constructor(t, r) { super(t), this.clientVersion = r.clientVersion, this.cause = r.cause; }
    get [Symbol.toStringTag]() { return this.name; }
};
var Ur = class extends jr {
    constructor(t, r) { var _b; super(t, r), this.isRetryable = (_b = r.isRetryable) !== null && _b !== void 0 ? _b : !0; }
};
function nl(e, t) { return { ...e, isRetryable: t }; }
var ke = class extends Ur {
    constructor(t, r) {
        super(t, nl(r, !1));
        this.name = "InvalidDatasourceError";
        this.code = "P6001";
    }
};
gt(ke, "InvalidDatasourceError");
function il(e) { let t = { clientVersion: e.clientVersion }, r; try {
    r = new URL(e.accelerateUrl);
}
catch (l) {
    let u = l.message;
    throw new ke(`Error validating \`accelerateUrl\`, the URL cannot be parsed, reason: ${u}`, t);
} let { protocol: n, searchParams: i } = r; if (n !== "prisma:" && n !== zt)
    throw new ke("Error validating `accelerateUrl`: the URL must start with the protocol `prisma://` or `prisma+postgres://`", t); let o = i.get("api_key"); if (o === null || o.length < 1)
    throw new ke("Error validating `accelerateUrl`: the URL must contain a valid API key", t); let s = tn(r) ? "http:" : "https:"; process.env.TEST_CLIENT_ENGINE_REMOTE_EXECUTOR && r.searchParams.has("use_http") && (s = "http:"); let a = new URL(r.href.replace(n, s)); return { apiKey: o, url: a }; }
var ol = B(_i()), Br = (_1 = class {
        constructor({ apiKey: t, tracingHelper: r, logLevel: n, logQueries: i, engineHash: o }) {
            _Br_instances.add(this);
            this.apiKey = t, this.tracingHelper = r, this.logLevel = n, this.logQueries = i, this.engineHash = o;
        }
        build({ traceparent: t, transactionId: r } = {}) { let n = { Accept: "application/json", Authorization: `Bearer ${this.apiKey}`, "Content-Type": "application/json", "Prisma-Engine-Hash": this.engineHash, "Prisma-Engine-Version": ol.enginesVersion }; this.tracingHelper.isEnabled() && (n.traceparent = t !== null && t !== void 0 ? t : this.tracingHelper.getTraceParent()), r && (n["X-Transaction-Id"] = r); let i = __classPrivateFieldGet(this, _Br_instances, "m", _Br_e).call(this); return i.length > 0 && (n["X-Capture-Telemetry"] = i.join(", ")), n; }
    },
    _Br_instances = new WeakSet(),
    _Br_e = function _Br_e() { let t = []; return this.tracingHelper.isEnabled() && t.push("tracing"), this.logLevel && t.push(this.logLevel), this.logQueries && t.push("query"), t; },
    _1);
function dm(e) { return e[0] * 1e3 + e[1] / 1e6; }
function ai(e) { return new Date(dm(e)); }
var al = _("prisma:client:clientEngine:remoteExecutor"), Qr = (_2 = class {
        constructor(t) {
            _Qr_instances.add(this);
            _Qr_e.set(this, void 0);
            _Qr_t.set(this, void 0);
            _Qr_r.set(this, void 0);
            _Qr_n.set(this, void 0);
            _Qr_i.set(this, void 0);
            _Qr_o.set(this, void 0);
            __classPrivateFieldSet(this, _Qr_e, t.clientVersion, "f"), __classPrivateFieldSet(this, _Qr_n, t.logEmitter, "f"), __classPrivateFieldSet(this, _Qr_i, t.tracingHelper, "f"), __classPrivateFieldSet(this, _Qr_o, t.sqlCommenters, "f");
            let { url: r, apiKey: n } = il({ clientVersion: t.clientVersion, accelerateUrl: t.accelerateUrl });
            __classPrivateFieldSet(this, _Qr_r, new li(r), "f"), __classPrivateFieldSet(this, _Qr_t, new Br({ apiKey: n, engineHash: t.clientVersion, logLevel: t.logLevel, logQueries: t.logQueries, tracingHelper: t.tracingHelper }), "f");
        }
        async getConnectionInfo() { return await __classPrivateFieldGet(this, _Qr_instances, "m", _Qr_s).call(this, { path: "/connection-info", method: "GET" }); }
        async execute({ plan: t, placeholderValues: r, batchIndex: n, model: i, operation: o, transaction: s, customFetch: a, queryInfo: l }) { var _b; let u = l && ((_b = __classPrivateFieldGet(this, _Qr_o, "f")) === null || _b === void 0 ? void 0 : _b.length) ? br(__classPrivateFieldGet(this, _Qr_o, "f"), { query: l }) : void 0; return (await __classPrivateFieldGet(this, _Qr_instances, "m", _Qr_s).call(this, { path: s ? `/transaction/${s.id}/query` : "/query", method: "POST", body: { model: i, operation: o, plan: t, params: r, comments: u && Object.keys(u).length > 0 ? u : void 0 }, batchRequestIdx: n, fetch: a })).data; }
        async startTransaction(t) { return { ...await __classPrivateFieldGet(this, _Qr_instances, "m", _Qr_s).call(this, { path: "/transaction/start", method: "POST", body: t }), payload: void 0 }; }
        async commitTransaction(t) { await __classPrivateFieldGet(this, _Qr_instances, "m", _Qr_s).call(this, { path: `/transaction/${t.id}/commit`, method: "POST" }); }
        async rollbackTransaction(t) { await __classPrivateFieldGet(this, _Qr_instances, "m", _Qr_s).call(this, { path: `/transaction/${t.id}/rollback`, method: "POST" }); }
        disconnect() { return Promise.resolve(); }
        apiKey() { return __classPrivateFieldGet(this, _Qr_t, "f").apiKey; }
    },
    _Qr_e = new WeakMap(),
    _Qr_t = new WeakMap(),
    _Qr_r = new WeakMap(),
    _Qr_n = new WeakMap(),
    _Qr_i = new WeakMap(),
    _Qr_o = new WeakMap(),
    _Qr_instances = new WeakSet(),
    _Qr_s = async function _Qr_s({ path: t, method: r, body: n, fetch: i = globalThis.fetch, batchRequestIdx: o }) { let s = await __classPrivateFieldGet(this, _Qr_r, "f").request({ method: r, path: t, headers: __classPrivateFieldGet(this, _Qr_t, "f").build(), body: n, fetch: i }); s.ok || await __classPrivateFieldGet(this, _Qr_instances, "m", _Qr_a).call(this, s, o); let a = await s.json(); return typeof a.extensions == "object" && a.extensions !== null && __classPrivateFieldGet(this, _Qr_instances, "m", _Qr_l).call(this, a.extensions), a; },
    _Qr_a = async function _Qr_a(t, r) { let n = t.headers.get("Prisma-Error-Code"), i = await t.text(), o, s = i; try {
        o = JSON.parse(i);
    }
    catch (_b) {
        o = {};
    } typeof o.code == "string" && (n = o.code), typeof o.error == "string" ? s = o.error : typeof o.message == "string" ? s = o.message : typeof o.InvalidRequestError == "object" && o.InvalidRequestError !== null && typeof o.InvalidRequestError.reason == "string" && (s = o.InvalidRequestError.reason), s = s || `HTTP ${t.status}: ${t.statusText}`; let a = typeof o.meta == "object" && o.meta !== null ? o.meta : o; throw new sl.PrismaClientKnownRequestError(s, { clientVersion: __classPrivateFieldGet(this, _Qr_e, "f"), code: n !== null && n !== void 0 ? n : "P6000", batchRequestIdx: r, meta: a }); },
    _Qr_l = function _Qr_l(t) { if (t.logs)
        for (let r of t.logs)
            __classPrivateFieldGet(this, _Qr_instances, "m", _Qr_u).call(this, r); t.spans && __classPrivateFieldGet(this, _Qr_i, "f").dispatchEngineSpans(t.spans); },
    _Qr_u = function _Qr_u(t) { var _b, _f, _g, _5, _6, _7; switch (t.level) {
        case "debug":
        case "trace":
            al(t);
            break;
        case "error":
        case "warn":
        case "info": {
            __classPrivateFieldGet(this, _Qr_n, "f").emit(t.level, { timestamp: ai(t.timestamp), message: (_b = t.attributes.message) !== null && _b !== void 0 ? _b : "", target: (_f = t.target) !== null && _f !== void 0 ? _f : "RemoteExecutor" });
            break;
        }
        case "query": {
            __classPrivateFieldGet(this, _Qr_n, "f").emit("query", { query: (_g = t.attributes.query) !== null && _g !== void 0 ? _g : "", timestamp: ai(t.timestamp), duration: (_5 = t.attributes.duration_ms) !== null && _5 !== void 0 ? _5 : 0, params: (_6 = t.attributes.params) !== null && _6 !== void 0 ? _6 : "", target: (_7 = t.target) !== null && _7 !== void 0 ? _7 : "RemoteExecutor" });
            break;
        }
        default: throw new Error(`Unexpected log level: ${t.level}`);
    } },
    _2), li = (_3 = class {
        constructor(t) {
            _li_instances.add(this);
            _li_e.set(this, void 0);
            _li_t.set(this, void 0);
            _li_r.set(this, void 0);
            __classPrivateFieldSet(this, _li_e, t, "f"), __classPrivateFieldSet(this, _li_t, new Map, "f");
        }
        async request({ method: t, path: r, headers: n, body: i, fetch: o }) { var _b; let s = new URL(r, __classPrivateFieldGet(this, _li_e, "f")), a = __classPrivateFieldGet(this, _li_instances, "m", _li_n).call(this, s); a && (n.Cookie = a), __classPrivateFieldGet(this, _li_r, "f") && (n["Accelerate-Query-Engine-Jwt"] = __classPrivateFieldGet(this, _li_r, "f")); let l = await o(s.href, { method: t, body: i !== void 0 ? JSON.stringify(i) : void 0, headers: n }); return al(t, s, l.status, l.statusText), __classPrivateFieldSet(this, _li_r, (_b = l.headers.get("Accelerate-Query-Engine-Jwt")) !== null && _b !== void 0 ? _b : void 0, "f"), __classPrivateFieldGet(this, _li_instances, "m", _li_i).call(this, s, l), l; }
    },
    _li_e = new WeakMap(),
    _li_t = new WeakMap(),
    _li_r = new WeakMap(),
    _li_instances = new WeakSet(),
    _li_n = function _li_n(t) { var _b, _f; let r = [], n = new Date; for (let [i, o] of __classPrivateFieldGet(this, _li_t, "f")) {
        if (o.expires && o.expires < n) {
            __classPrivateFieldGet(this, _li_t, "f").delete(i);
            continue;
        }
        let s = (_b = o.domain) !== null && _b !== void 0 ? _b : t.hostname, a = (_f = o.path) !== null && _f !== void 0 ? _f : "/";
        t.hostname.endsWith(s) && t.pathname.startsWith(a) && r.push(tl(o.name, o.value));
    } return r.length > 0 ? r.join("; ") : void 0; },
    _li_i = function _li_i(t, r) { var _b, _f, _g, _5; let n = ((_f = (_b = r.headers).getSetCookie) === null || _f === void 0 ? void 0 : _f.call(_b)) || []; if (n.length === 0) {
        let i = r.headers.get("Set-Cookie");
        i && n.push(i);
    } for (let i of n) {
        let o = rl(i), s = (_g = o.domain) !== null && _g !== void 0 ? _g : t.hostname, a = (_5 = o.path) !== null && _5 !== void 0 ? _5 : "/", l = `${s}:${a}:${o.name}`;
        __classPrivateFieldGet(this, _li_t, "f").set(l, { name: o.name, value: o.value, domain: s, path: a, expires: o.expires });
    } },
    _3);
var ci = require("@prisma/client-runtime-utils"), ui = {}, ll = { async loadQueryCompiler(e) { let { clientVersion: t, compilerWasm: r } = e; if (r === void 0)
        throw new ci.PrismaClientInitializationError("WASM query compiler was unexpectedly `undefined`", t); let n; return e.activeProvider === void 0 || ui[e.activeProvider] === void 0 ? (n = (async () => { let i = await r.getRuntime(), o = await r.getQueryCompilerWasmModule(); if (o == null)
        throw new ci.PrismaClientInitializationError("The loaded wasm module was unexpectedly `undefined` or `null` once loaded", t); let s = { [r.importName]: i }, a = new WebAssembly.Instance(o, s), l = a.exports.__wbindgen_start; return i.__wbg_set_wasm(a.exports), l(), i.QueryCompiler; })(), e.activeProvider !== void 0 && (ui[e.activeProvider] = n)) : n = ui[e.activeProvider], await n; } };
var mm = "P2038", ce = _("prisma:client:clientEngine"), dl = globalThis;
dl.PRISMA_WASM_PANIC_REGISTRY = { set_message(e) { throw new F.PrismaClientRustPanicError(e, $r); } };
var jt = (_4 = class {
        constructor(t, r) {
            var _b, _f;
            _jt_instances.add(this);
            this.name = "ClientEngine";
            _jt_e.set(this, void 0);
            _jt_t.set(this, { type: "disconnected" });
            _jt_r.set(this, void 0);
            _jt_n.set(this, void 0);
            _jt_i.set(this, void 0);
            _jt_o.set(this, void 0);
            _jt_s.set(this, void 0);
            if (t.accelerateUrl !== void 0)
                __classPrivateFieldSet(this, _jt_n, { remote: !0, accelerateUrl: t.accelerateUrl }, "f");
            else if (t.adapter)
                __classPrivateFieldSet(this, _jt_n, { remote: !1, driverAdapterFactory: t.adapter }, "f"), ce("Using driver adapter: %O", t.adapter);
            else
                throw new F.PrismaClientInitializationError("Missing configured driver adapter. Engine type `client` requires an active driver adapter. Please check your PrismaClient initialization code.", t.clientVersion, mm);
            __classPrivateFieldSet(this, _jt_r, r !== null && r !== void 0 ? r : ll, "f"), this.config = t, this.logQueries = (_b = t.logQueries) !== null && _b !== void 0 ? _b : !1, this.logLevel = (_f = t.logLevel) !== null && _f !== void 0 ? _f : "error", this.logEmitter = t.logEmitter, this.datamodel = t.inlineSchema, this.tracingHelper = t.tracingHelper, __classPrivateFieldSet(this, _jt_i, t.queryPlanCacheMaxSize === 0 ? void 0 : new Vr(t.queryPlanCacheMaxSize), "f"), __classPrivateFieldSet(this, _jt_o, Vt.deserialize(t.parameterizationSchema, n => { var _b; if (!Object.hasOwn(t.runtimeDataModel.enums, n))
                return; let i = {}; for (let o of t.runtimeDataModel.enums[n].values)
                i[o.name] = (_b = o.dbName) !== null && _b !== void 0 ? _b : o.name; return i; }), "f"), t.enableDebugLogs && (this.logLevel = "debug"), this.logQueries && (__classPrivateFieldSet(this, _jt_s, n => { this.logEmitter.emit("query", { ...n, params: K(n.params), target: "ClientEngine" }); }, "f"));
        }
        onBeforeExit() { throw new Error('"beforeExit" hook is not applicable to the client engine, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.'); }
        async start() { await __classPrivateFieldGet(this, _jt_instances, "m", _jt_a).call(this); }
        async stop() { switch (__classPrivateFieldGet(this, _jt_t, "f").type) {
            case "disconnected": return;
            case "connecting": return await __classPrivateFieldGet(this, _jt_t, "f").promise, await this.stop();
            case "connected": {
                let t = __classPrivateFieldGet(this, _jt_t, "f").engine, r = this.tracingHelper.runInChildSpan("disconnect", async () => { try {
                    await t.executor.disconnect(), t.queryCompiler.free();
                }
                finally {
                    __classPrivateFieldSet(this, _jt_t, { type: "disconnected" }, "f");
                } });
                return __classPrivateFieldSet(this, _jt_t, { type: "disconnecting", promise: r }, "f"), await r;
            }
            case "disconnecting": return await __classPrivateFieldGet(this, _jt_t, "f").promise;
        } }
        version() { return "unknown"; }
        async transaction(t, r, n) { let i, { executor: o } = await __classPrivateFieldGet(this, _jt_instances, "m", _jt_a).call(this); try {
            if (t === "start") {
                let s = n;
                i = await o.startTransaction({ ...s, isolationLevel: __classPrivateFieldGet(this, _jt_instances, "m", _jt_y).call(this, s.isolationLevel) });
            }
            else if (t === "commit") {
                let s = n;
                await o.commitTransaction(s);
            }
            else if (t === "rollback") {
                let s = n;
                await o.rollbackTransaction(s);
            }
            else
                ae(t, "Invalid transaction action.");
        }
        catch (s) {
            throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_c).call(this, s);
        } return i ? { id: i.id, payload: void 0 } : void 0; }
        async request(t, { interactiveTransaction: r, customDataProxyFetch: n }) { var _b, _f; ce("sending request"); let { executor: i, queryCompiler: o } = await __classPrivateFieldGet(this, _jt_instances, "m", _jt_a).call(this).catch(l => { throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_c).call(this, l, JSON.stringify(t)); }), s, a = {}; if (cl(t))
            s = pl(t);
        else {
            let { parameterizedQuery: l, placeholderValues: u } = ii(t, __classPrivateFieldGet(this, _jt_o, "f")), c = JSON.stringify(l);
            a = u;
            let p = t.action !== "createMany" && t.action !== "createManyAndReturn", d = p ? (_b = __classPrivateFieldGet(this, _jt_i, "f")) === null || _b === void 0 ? void 0 : _b.getSingle(c) : void 0;
            d ? (ce("query plan cache hit"), s = d) : (ce("query plan cache miss"), s = __classPrivateFieldGet(this, _jt_instances, "m", _jt_f).call(this, l, c, o), p && ((_f = __classPrivateFieldGet(this, _jt_i, "f")) === null || _f === void 0 ? void 0 : _f.setSingle(c, s)));
        } try {
            ce("query plan created", s);
            let l = await i.execute({ plan: s, model: t.modelName, operation: t.action, placeholderValues: a, transaction: r, batchIndex: void 0, customFetch: n === null || n === void 0 ? void 0 : n(globalThis.fetch), queryInfo: { type: "single", modelName: t.modelName, action: t.action, query: t.query } });
            return ce("query plan executed"), { data: { [t.action]: l } };
        }
        catch (l) {
            throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_c).call(this, l, JSON.stringify(t));
        } }
        async requestBatch(t, { transaction: r, customDataProxyFetch: n }) { var _b, _f, _g, _5, _6; if (t.length === 0)
            return []; let i = t[0].action, o = t[0].modelName, s = Wa(t, r), a = JSON.stringify(s), { executor: l, queryCompiler: u } = await __classPrivateFieldGet(this, _jt_instances, "m", _jt_a).call(this).catch(m => { throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_c).call(this, m, a); }), c = o === void 0, p, d = {}; if (c)
            p = __classPrivateFieldGet(this, _jt_instances, "m", _jt_g).call(this, t, a, u);
        else {
            let { parameterizedBatch: m, placeholderValues: g } = oi(s, __classPrivateFieldGet(this, _jt_o, "f")), x = JSON.stringify(m);
            d = g;
            let w = (_b = __classPrivateFieldGet(this, _jt_i, "f")) === null || _b === void 0 ? void 0 : _b.getBatch(x);
            if (w)
                ce("batch query plan cache hit"), p = w;
            else {
                ce("batch query plan cache miss");
                try {
                    p = __classPrivateFieldGet(this, _jt_instances, "m", _jt_g).call(this, m.batch, x, u), (_f = __classPrivateFieldGet(this, _jt_i, "f")) === null || _f === void 0 ? void 0 : _f.setBatch(x, p);
                }
                catch (k) {
                    throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_d).call(this, k);
                }
            }
        } try {
            let m;
            switch (((r === null || r === void 0 ? void 0 : r.kind) === "itx" && (m = r.options), p.type)) {
                case "multi": {
                    if ((r === null || r === void 0 ? void 0 : r.kind) !== "itx") {
                        let w = r === null || r === void 0 ? void 0 : r.options, k = { maxWait: (_g = w === null || w === void 0 ? void 0 : w.maxWait) !== null && _g !== void 0 ? _g : this.config.transactionOptions.maxWait, timeout: (_5 = w === null || w === void 0 ? void 0 : w.timeout) !== null && _5 !== void 0 ? _5 : this.config.transactionOptions.timeout, isolationLevel: (_6 = w === null || w === void 0 ? void 0 : w.isolationLevel) !== null && _6 !== void 0 ? _6 : this.config.transactionOptions.isolationLevel };
                        m = await this.transaction("start", {}, k);
                    }
                    let g = [], x = !1;
                    for (let [w, k] of p.plans.entries())
                        try {
                            let P = await l.execute({ plan: k, placeholderValues: d, model: t[w].modelName, operation: t[w].action, batchIndex: w, transaction: m, customFetch: n === null || n === void 0 ? void 0 : n(globalThis.fetch), queryInfo: { type: "single", ...t[w] } });
                            g.push({ data: { [t[w].action]: P } });
                        }
                        catch (P) {
                            g.push(P), x = !0;
                            break;
                        }
                    return m !== void 0 && (r === null || r === void 0 ? void 0 : r.kind) !== "itx" && (x ? await this.transaction("rollback", {}, m) : await this.transaction("commit", {}, m)), g;
                }
                case "compacted": {
                    if (!t.every(w => w.action === i && w.modelName === o)) {
                        let w = t.map(P => P.action).join(", "), k = t.map(P => P.modelName).join(", ");
                        throw new Error(`Internal error: All queries in a compacted batch must have the same action and model name, but received actions: [${w}] and model names: [${k}]. This indicates a bug in the client. Please report this issue to the Prisma team with your query details.`);
                    }
                    if (o === void 0)
                        throw new Error("Internal error: A compacted batch cannot contain raw queries. This indicates a bug in the client. Please report this issue to the Prisma team with your query details.");
                    let g = await l.execute({ plan: p.plan, placeholderValues: d, model: o, operation: i, batchIndex: void 0, transaction: m, customFetch: n === null || n === void 0 ? void 0 : n(globalThis.fetch), queryInfo: { type: "compacted", action: i, modelName: o, queries: t } });
                    return ms(g, p, d).map(w => ({ data: { [i]: w } }));
                }
            }
        }
        catch (m) {
            throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_c).call(this, m, a);
        } }
        async apiKey() { let { executor: t } = await __classPrivateFieldGet(this, _jt_instances, "m", _jt_a).call(this); return t.apiKey(); }
    },
    _jt_e = new WeakMap(),
    _jt_t = new WeakMap(),
    _jt_r = new WeakMap(),
    _jt_n = new WeakMap(),
    _jt_i = new WeakMap(),
    _jt_o = new WeakMap(),
    _jt_s = new WeakMap(),
    _jt_instances = new WeakSet(),
    _jt_a = async function _jt_a() { switch (__classPrivateFieldGet(this, _jt_t, "f").type) {
        case "disconnected": {
            let t = this.tracingHelper.runInChildSpan("connect", async () => { let r, n; try {
                r = await __classPrivateFieldGet(this, _jt_instances, "m", _jt_l).call(this), n = await __classPrivateFieldGet(this, _jt_instances, "m", _jt_u).call(this, r);
            }
            catch (o) {
                throw __classPrivateFieldSet(this, _jt_t, { type: "disconnected" }, "f"), n === null || n === void 0 ? void 0 : n.free(), await (r === null || r === void 0 ? void 0 : r.disconnect()), o;
            } let i = { executor: r, queryCompiler: n }; return __classPrivateFieldSet(this, _jt_t, { type: "connected", engine: i }, "f"), i; });
            return __classPrivateFieldSet(this, _jt_t, { type: "connecting", promise: t }, "f"), await t;
        }
        case "connecting": return await __classPrivateFieldGet(this, _jt_t, "f").promise;
        case "connected": return __classPrivateFieldGet(this, _jt_t, "f").engine;
        case "disconnecting": return await __classPrivateFieldGet(this, _jt_t, "f").promise, await __classPrivateFieldGet(this, _jt_instances, "m", _jt_a).call(this);
    } },
    _jt_l = async function _jt_l() { return __classPrivateFieldGet(this, _jt_n, "f").remote ? new Qr({ clientVersion: this.config.clientVersion, accelerateUrl: __classPrivateFieldGet(this, _jt_n, "f").accelerateUrl, logEmitter: this.logEmitter, logLevel: this.logLevel, logQueries: this.logQueries, tracingHelper: this.tracingHelper, sqlCommenters: this.config.sqlCommenters }) : await Lr.connect({ driverAdapterFactory: __classPrivateFieldGet(this, _jt_n, "f").driverAdapterFactory, tracingHelper: this.tracingHelper, transactionOptions: { ...this.config.transactionOptions, isolationLevel: __classPrivateFieldGet(this, _jt_instances, "m", _jt_y).call(this, this.config.transactionOptions.isolationLevel) }, onQuery: __classPrivateFieldGet(this, _jt_s, "f"), provider: this.config.activeProvider, sqlCommenters: this.config.sqlCommenters }); },
    _jt_u = async function _jt_u(t) { let r = __classPrivateFieldGet(this, _jt_e, "f"); r === void 0 && (r = await __classPrivateFieldGet(this, _jt_r, "f").loadQueryCompiler(this.config), __classPrivateFieldSet(this, _jt_e, r, "f")); let { provider: n, connectionInfo: i } = await t.getConnectionInfo(); try {
        return __classPrivateFieldGet(this, _jt_instances, "m", _jt_m).call(this, () => new r({ datamodel: this.datamodel, provider: n, connectionInfo: i }), void 0, !1);
    }
    catch (o) {
        throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_p).call(this, o);
    } },
    _jt_p = function _jt_p(t) { if (t instanceof F.PrismaClientRustPanicError)
        return t; try {
        let r = JSON.parse(t.message);
        return new F.PrismaClientInitializationError(r.message, this.config.clientVersion, r.error_code);
    }
    catch (_b) {
        return t;
    } },
    _jt_c = function _jt_c(t, r) {
        var _b;
        if (t instanceof F.PrismaClientInitializationError)
            return t;
        if (t.code === "GenericFailure" && ((_b = t.message) === null || _b === void 0 ? void 0 : _b.startsWith("PANIC:")))
            return new F.PrismaClientRustPanicError(ul(this, t.message, r), this.config.clientVersion);
        if (t instanceof N)
            return new F.PrismaClientKnownRequestError(t.message, { code: t.code, meta: t.meta, clientVersion: this.config.clientVersion });
        try {
            let n = JSON.parse(t);
            return new F.PrismaClientUnknownRequestError(`${n.message}
${n.backtrace}`, { clientVersion: this.config.clientVersion });
        }
        catch (_f) {
            return t;
        }
    },
    _jt_d = function _jt_d(t) { return t instanceof F.PrismaClientRustPanicError ? t : typeof t.message == "string" && typeof t.code == "string" ? new F.PrismaClientKnownRequestError(t.message, { code: t.code, meta: t.meta, clientVersion: this.config.clientVersion }) : typeof t.message == "string" ? new F.PrismaClientUnknownRequestError(t.message, { clientVersion: this.config.clientVersion }) : t; },
    _jt_m = function _jt_m(t, r, n = !0) { let i = dl.PRISMA_WASM_PANIC_REGISTRY.set_message, o; global.PRISMA_WASM_PANIC_REGISTRY.set_message = s => { o = s; }; try {
        return t();
    }
    finally {
        if (global.PRISMA_WASM_PANIC_REGISTRY.set_message = i, o)
            throw __classPrivateFieldSet(this, _jt_e, void 0, "f"), n && this.stop().catch(s => ce("failed to disconnect:", s)), new F.PrismaClientRustPanicError(ul(this, o, r), this.config.clientVersion);
    } },
    _jt_f = function _jt_f(t, r, n) { try {
        return __classPrivateFieldGet(this, _jt_instances, "m", _jt_m).call(this, () => __classPrivateFieldGet(this, _jt_instances, "m", _jt_h).call(this, { queries: [t], execute: () => n.compile(r) }));
    }
    catch (i) {
        throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_d).call(this, i);
    } },
    _jt_g = function _jt_g(t, r, n) { if (t.every(cl))
        return { type: "multi", plans: t.map(i => pl(i)) }; try {
        return __classPrivateFieldGet(this, _jt_instances, "m", _jt_m).call(this, () => __classPrivateFieldGet(this, _jt_instances, "m", _jt_h).call(this, { queries: t, execute: () => n.compileBatch(r) }));
    }
    catch (i) {
        throw __classPrivateFieldGet(this, _jt_instances, "m", _jt_d).call(this, i);
    } },
    _jt_y = function _jt_y(t) { switch (t) {
        case void 0: return;
        case "ReadUncommitted": return "READ UNCOMMITTED";
        case "ReadCommitted": return "READ COMMITTED";
        case "RepeatableRead": return "REPEATABLE READ";
        case "Serializable": return "SERIALIZABLE";
        case "Snapshot": return "SNAPSHOT";
        default: throw new F.PrismaClientKnownRequestError(`Inconsistent column data: Conversion failed: Invalid isolation level \`${t}\``, { code: "P2023", clientVersion: this.config.clientVersion, meta: { providedIsolationLevel: t } });
    } },
    _jt_h = function _jt_h({ queries: t, execute: r }) { return this.tracingHelper.runInChildSpan({ name: "compile", attributes: { models: t.map(n => n.modelName).filter(n => n !== void 0), actions: t.map(n => n.action) } }, r); },
    _4);
function ul(e, t, r) { return el({ binaryTarget: void 0, title: t, version: e.config.clientVersion, engineVersion: "unknown", database: e.config.activeProvider, query: r }); }
function cl(e) { return e.action === "queryRaw" || e.action === "executeRaw"; }
function pl(e) { let t = e.query.arguments.query, { args: r, argTypes: n } = za(e.query.arguments.parameters); return { type: e.action === "queryRaw" ? "query" : "execute", args: { type: "rawSql", sql: t, args: r, argTypes: n } }; }
function ml(e) { return new jt(e); }
var fl = e => ({ command: e });
var Pl = require("@prisma/client-runtime-utils");
var gl = e => e.strings.reduce((t, r, n) => `${t}@P${n}${r}`);
var wl = require("@prisma/client-runtime-utils");
function tt(e) { try {
    return yl(e, "fast");
}
catch (_b) {
    return yl(e, "slow");
} }
function yl(e, t) { return JSON.stringify(e.map(r => bl(r, t))); }
function bl(e, t) { if (Array.isArray(e))
    return e.map(r => bl(r, t)); if (typeof e == "bigint")
    return { prisma__type: "bigint", prisma__value: e.toString() }; if (Me(e))
    return { prisma__type: "date", prisma__value: e.toJSON() }; if (wl.Decimal.isDecimal(e))
    return { prisma__type: "decimal", prisma__value: e.toJSON() }; if (Buffer.isBuffer(e))
    return { prisma__type: "bytes", prisma__value: e.toString("base64") }; if (fm(e))
    return { prisma__type: "bytes", prisma__value: Buffer.from(e).toString("base64") }; if (ArrayBuffer.isView(e)) {
    let { buffer: r, byteOffset: n, byteLength: i } = e;
    return { prisma__type: "bytes", prisma__value: Buffer.from(r, n, i).toString("base64") };
} return typeof e == "object" && t === "slow" ? xl(e) : e; }
function fm(e) { return e instanceof ArrayBuffer || e instanceof SharedArrayBuffer ? !0 : typeof e == "object" && e !== null ? e[Symbol.toStringTag] === "ArrayBuffer" || e[Symbol.toStringTag] === "SharedArrayBuffer" : !1; }
function xl(e) { if (typeof e != "object" || e === null)
    return e; if (typeof e.toJSON == "function")
    return e.toJSON(); if (Array.isArray(e))
    return e.map(hl); let t = {}; for (let r of Object.keys(e))
    t[r] = hl(e[r]); return t; }
function hl(e) { return typeof e == "bigint" ? e.toString() : xl(e); }
var gm = /^(\s*alter\s)/i, El = _("prisma:client");
function pi(e, t, r, n) {
    if (!(e !== "postgresql" && e !== "cockroachdb") && r.length > 0 && gm.exec(t))
        throw new Error(`Running ALTER using ${n} is not supported
Using the example below you can still execute your query with Prisma, but please note that it is vulnerable to SQL injection attacks and requires you to take care of input sanitization.

Example:
  await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)

More Information: https://pris.ly/d/execute-raw
`);
}
var di = ({ clientMethod: e, activeProvider: t }) => r => { let n = "", i; if (mr(r))
    n = r.sql, i = { values: tt(r.values), __prismaRawParameters__: !0 };
else if (Array.isArray(r)) {
    let [o, ...s] = r;
    n = o, i = { values: tt(s || []), __prismaRawParameters__: !0 };
}
else
    switch (t) {
        case "sqlite":
        case "mysql": {
            n = r.sql, i = { values: tt(r.values), __prismaRawParameters__: !0 };
            break;
        }
        case "cockroachdb":
        case "postgresql":
        case "postgres": {
            n = r.text, i = { values: tt(r.values), __prismaRawParameters__: !0 };
            break;
        }
        case "sqlserver": {
            n = gl(r), i = { values: tt(r.values), __prismaRawParameters__: !0 };
            break;
        }
        default: throw new Error(`The ${t} provider does not support ${e}`);
    } return (i === null || i === void 0 ? void 0 : i.values) ? El(`prisma.${e}(${n}, ${i.values})`) : El(`prisma.${e}(${n})`), { query: n, parameters: i }; }, Tl = { requestArgsToMiddlewareArgs(e) { return [e.strings, ...e.values]; }, middlewareArgsToRequestArgs(e) { let [t, ...r] = e; return new Pl.Sql(t, r); } }, Sl = { requestArgsToMiddlewareArgs(e) { return [e]; }, middlewareArgsToRequestArgs(e) { return e[0]; } };
function mi(e) { return function (r, n) { let i, o = (s = e) => { try {
    return s === void 0 || (s === null || s === void 0 ? void 0 : s.kind) === "itx" ? i !== null && i !== void 0 ? i : (i = vl(r(s))) : vl(r(s));
}
catch (a) {
    return Promise.reject(a);
} }; return { get spec() { return n; }, then(s, a) { return o().then(s, a); }, catch(s) { return o().catch(s); }, finally(s) { return o().finally(s); }, requestTransaction(s) { let a = o(s); return a.requestTransaction ? a.requestTransaction(s) : a; }, [Symbol.toStringTag]: "PrismaPromise" }; }; }
function vl(e) { return typeof e.then == "function" ? e : Promise.resolve(e); }
var Al = { name: "@prisma/instrumentation-contract", version: "7.8.0", description: "Shared types and utilities for Prisma instrumentation", main: "dist/index.js", module: "dist/index.mjs", types: "dist/index.d.ts", exports: { ".": { require: { types: "./dist/index.d.ts", default: "./dist/index.js" }, import: { types: "./dist/index.d.mts", default: "./dist/index.mjs" } } }, license: "Apache-2.0", homepage: "https://www.prisma.io", repository: { type: "git", url: "https://github.com/prisma/prisma.git", directory: "packages/instrumentation-contract" }, bugs: "https://github.com/prisma/prisma/issues", scripts: { dev: "DEV=true tsx helpers/build.ts", build: "tsx helpers/build.ts", prepublishOnly: "pnpm run build", test: "vitest run" }, files: ["dist"], sideEffects: !1, devDependencies: { "@opentelemetry/api": "1.9.0" }, peerDependencies: { "@opentelemetry/api": "^1.8" } };
var hm = Al.version.split(".")[0], wm = "PRISMA_INSTRUMENTATION", bm = `V${hm}_PRISMA_INSTRUMENTATION`, Cl = globalThis;
function Rl() { var _b; let e = Cl[bm]; return (e === null || e === void 0 ? void 0 : e.helper) ? e.helper : (_b = Cl[wm]) === null || _b === void 0 ? void 0 : _b.helper; }
var xm = { isEnabled() { return !1; }, getTraceParent() { return "00-10-10-00"; }, dispatchEngineSpans() { }, getActiveContext() { }, runInChildSpan(e, t) { return t(); } }, fi = class {
    isEnabled() { return this.getTracingHelper().isEnabled(); }
    getTraceParent(t) { return this.getTracingHelper().getTraceParent(t); }
    dispatchEngineSpans(t) { return this.getTracingHelper().dispatchEngineSpans(t); }
    getActiveContext() { return this.getTracingHelper().getActiveContext(); }
    runInChildSpan(t, r) { return this.getTracingHelper().runInChildSpan(t, r); }
    getTracingHelper() { var _b; return (_b = Rl()) !== null && _b !== void 0 ? _b : xm; }
};
function kl() { return new fi; }
function Il(e, t = () => { }) { let r, n = new Promise(i => r = i); return { then(i) { return --e === 0 && r(t()), i === null || i === void 0 ? void 0 : i(n); } }; }
function Ol(e) { return typeof e == "string" ? e : e.reduce((t, r) => { let n = typeof r == "string" ? r : r.level; return n === "query" ? t : t && (r === "info" || t === "info") ? "info" : n; }, void 0); }
var Dl = require("@prisma/client-runtime-utils");
function yi(e) { if (e.action !== "findUnique" && e.action !== "findUniqueOrThrow")
    return; let t = []; return e.modelName && t.push(e.modelName), e.query.arguments && t.push(gi(e.query.arguments)), t.push(gi(e.query.selection)), t.join(""); }
function gi(e) { return `(${Object.keys(e).sort().map(r => { let n = e[r]; return typeof n == "object" && n !== null ? `(${r} ${gi(n)})` : r; }).join(" ")})`; }
var Em = { aggregate: !1, aggregateRaw: !1, createMany: !0, createManyAndReturn: !0, createOne: !0, deleteMany: !0, deleteOne: !0, executeRaw: !0, findFirst: !1, findFirstOrThrow: !1, findMany: !1, findRaw: !1, findUnique: !1, findUniqueOrThrow: !1, groupBy: !1, queryRaw: !1, runCommandRaw: !0, updateMany: !0, updateManyAndReturn: !0, updateOne: !0, upsertOne: !0 };
function hi(e) { return Em[e]; }
var Jr = class {
    constructor(t) {
        this.tickActive = !1;
        this.options = t;
        this.batches = {};
    }
    request(t) { let r = this.options.batchBy(t); return r ? (this.batches[r] || (this.batches[r] = [], this.tickActive || (this.tickActive = !0, process.nextTick(() => { this.dispatchBatches(), this.tickActive = !1; }))), new Promise((n, i) => { this.batches[r].push({ request: t, resolve: n, reject: i }); })) : this.options.singleLoader(t); }
    dispatchBatches() { for (let t in this.batches) {
        let r = this.batches[t];
        delete this.batches[t], r.length === 1 ? this.options.singleLoader(r[0].request).then(n => { n instanceof Error ? r[0].reject(n) : r[0].resolve(n); }).catch(n => { r[0].reject(n); }) : (r.sort((n, i) => this.options.batchOrder(n.request, i.request)), this.options.batchLoader(r.map(n => n.request)).then(n => { if (n instanceof Error)
            for (let i = 0; i < r.length; i++)
                r[i].reject(n);
        else
            for (let i = 0; i < r.length; i++) {
                let o = n[i];
                o instanceof Error ? r[i].reject(o) : r[i].resolve(o);
            } }).catch(n => { for (let i = 0; i < r.length; i++)
            r[i].reject(n); }));
    } }
    get [Symbol.toStringTag]() { return "DataLoader"; }
};
var Nl = require("@prisma/client-runtime-utils");
function Ie(e, t) { if (t === null)
    return t; switch (e) {
    case "bigint": return BigInt(t);
    case "bytes": {
        let { buffer: r, byteOffset: n, byteLength: i } = Buffer.from(t, "base64");
        return new Uint8Array(r, n, i);
    }
    case "decimal": return new Nl.Decimal(t);
    case "datetime":
    case "date": return new Date(t);
    case "time": return new Date(`1970-01-01T${t}Z`);
    case "bigint-array": return t.map(r => Ie("bigint", r));
    case "bytes-array": return t.map(r => Ie("bytes", r));
    case "decimal-array": return t.map(r => Ie("decimal", r));
    case "datetime-array": return t.map(r => Ie("datetime", r));
    case "date-array": return t.map(r => Ie("date", r));
    case "time-array": return t.map(r => Ie("time", r));
    default: return t;
} }
function Hr(e) { let t = [], r = Pm(e); for (let n = 0; n < e.rows.length; n++) {
    let i = e.rows[n], o = { ...r };
    for (let s = 0; s < i.length; s++)
        o[e.columns[s]] = Ie(e.types[s], i[s]);
    t.push(o);
} return t; }
function Pm(e) { let t = {}; for (let r = 0; r < e.columns.length; r++)
    t[e.columns[r]] = null; return t; }
var Tm = _("prisma:client:request_handler"), zr = class {
    constructor(t, r) { this.logEmitter = r, this.client = t, this.dataloader = new Jr({ batchLoader: ts(async ({ requests: n, customDataProxyFetch: i }) => { let { transaction: o, otelParentCtx: s } = n[0], a = n.map(p => p.protocolQuery), l = this.client._tracingHelper.getTraceParent(s), u = n.some(p => hi(p.protocolQuery.action)); return (await this.client._engine.requestBatch(a, { traceparent: l, transaction: Sm(o), containsWrite: u, customDataProxyFetch: i })).map((p, d) => { if (p instanceof Error)
            return p; try {
            return this.mapQueryEngineResult(n[d], p);
        }
        catch (m) {
            return m;
        } }); }), singleLoader: async (n) => { var _b; let i = ((_b = n.transaction) === null || _b === void 0 ? void 0 : _b.kind) === "itx" ? Ml(n.transaction) : void 0, o = await this.client._engine.request(n.protocolQuery, { traceparent: this.client._tracingHelper.getTraceParent(), interactiveTransaction: i, isWrite: hi(n.protocolQuery.action), customDataProxyFetch: n.customDataProxyFetch }); return this.mapQueryEngineResult(n, o); }, batchBy: n => { var _b, _f; if (((_b = n.transaction) === null || _b === void 0 ? void 0 : _b.kind) === "itx") {
            let i = yi(n.protocolQuery);
            return `itx-${n.transaction.id}${i ? `-${i}` : ""}`;
        } return ((_f = n.transaction) === null || _f === void 0 ? void 0 : _f.id) ? `transaction-${n.transaction.id}` : yi(n.protocolQuery); }, batchOrder(n, i) { var _b, _f; return ((_b = n.transaction) === null || _b === void 0 ? void 0 : _b.kind) === "batch" && ((_f = i.transaction) === null || _f === void 0 ? void 0 : _f.kind) === "batch" ? n.transaction.index - i.transaction.index : 0; } }); }
    async request(t) { try {
        return await this.dataloader.request(t);
    }
    catch (r) {
        let { clientMethod: n, callsite: i, transaction: o, args: s, modelName: a } = t;
        this.handleAndLogRequestError({ error: r, clientMethod: n, callsite: i, transaction: o, args: s, modelName: a, globalOmit: t.globalOmit });
    } }
    mapQueryEngineResult({ dataPath: t, unpacker: r }, n) { let i = n === null || n === void 0 ? void 0 : n.data, o = this.unpack(i, t, r); return process.env.PRISMA_CLIENT_GET_TIME ? { data: o } : o; }
    handleAndLogRequestError(t) { try {
        this.handleRequestError(t);
    }
    catch (r) {
        throw this.logEmitter && this.logEmitter.emit("error", { message: r.message, target: t.clientMethod, timestamp: new Date }), r;
    } }
    handleRequestError({ error: t, clientMethod: r, callsite: n, transaction: i, args: o, modelName: s, globalOmit: a }) { if (Tm(t), vm(t, i))
        throw t; if (t instanceof b.PrismaClientKnownRequestError && Am(t)) {
        let u = Fl(t.meta);
        ar({ args: o, errors: [u], callsite: n, errorFormat: this.client._errorFormat, originalMethod: r, clientVersion: this.client._clientVersion, globalOmit: a });
    } let l = t.message; if (n && (l = Xt({ callsite: n, originalMethod: r, isPanic: t.isPanic, showColors: this.client._errorFormat === "pretty", message: l })), l = this.sanitizeMessage(l), t.code) {
        let u = s ? { modelName: s, ...t.meta } : t.meta;
        throw new b.PrismaClientKnownRequestError(l, { code: t.code, clientVersion: this.client._clientVersion, meta: u, batchRequestIdx: t.batchRequestIdx });
    }
    else {
        if (t.isPanic)
            throw new b.PrismaClientRustPanicError(l, this.client._clientVersion);
        if (t instanceof b.PrismaClientUnknownRequestError)
            throw new b.PrismaClientUnknownRequestError(l, { clientVersion: this.client._clientVersion, batchRequestIdx: t.batchRequestIdx });
        if (t instanceof b.PrismaClientInitializationError)
            throw new b.PrismaClientInitializationError(l, this.client._clientVersion);
        if (t instanceof b.PrismaClientRustPanicError)
            throw new b.PrismaClientRustPanicError(l, this.client._clientVersion);
    } throw t.clientVersion = this.client._clientVersion, t; }
    sanitizeMessage(t) { return this.client._errorFormat && this.client._errorFormat !== "pretty" ? De(t) : t; }
    unpack(t, r, n) { if (!t || (t.data && (t = t.data), !t))
        return t; let i = Object.keys(t)[0], o = Object.values(t)[0], s = r.filter(u => u !== "select" && u !== "include"), a = wn(o, s), l = i === "queryRaw" ? Hr(a) : Z(a); return n ? n(l) : l; }
    get [Symbol.toStringTag]() { return "RequestHandler"; }
};
function Sm(e) { if (e) {
    if (e.kind === "batch")
        return { kind: "batch", options: { isolationLevel: e.isolationLevel, maxWait: e.maxWait, timeout: e.timeout } };
    if (e.kind === "itx")
        return { kind: "itx", options: Ml(e) };
    ae(e, "Unknown transaction kind");
} }
function Ml(e) { return { id: e.id, payload: e.payload }; }
function vm(e, t) { return (0, Dl.hasBatchIndex)(e) && (t === null || t === void 0 ? void 0 : t.kind) === "batch" && e.batchRequestIdx !== t.index; }
function Am(e) { return e.code === "P2009" || e.code === "P2012"; }
function Fl(e) { if (e.kind === "Union")
    return { kind: "Union", errors: e.errors.map(Fl) }; if (Array.isArray(e.selectionPath)) {
    let [, ...t] = e.selectionPath;
    return { ...e, selectionPath: t };
} return e; }
var wi = $r;
var ql = B(un());
var S = class extends Error {
    constructor(t) {
        super(t + `
Read more at https://pris.ly/d/client-constructor`), this.name = "PrismaClientConstructorValidationError";
    }
    get [Symbol.toStringTag]() { return "PrismaClientConstructorValidationError"; }
};
gt(S, "PrismaClientConstructorValidationError");
var _l = ["errorFormat", "adapter", "accelerateUrl", "log", "transactionOptions", "omit", "comments", "queryPlanCacheMaxSize", "__internal"], $l = ["pretty", "colorless", "minimal"], Ll = ["info", "query", "warn", "error"], Cm = { adapter: () => { }, accelerateUrl: e => { if (e !== void 0) {
        if (typeof e != "string")
            throw new S(`Invalid value ${JSON.stringify(e)} for "accelerateUrl" provided to PrismaClient constructor.`);
        if (e.trim().length === 0)
            throw new S('"accelerateUrl" provided to PrismaClient constructor must be a non-empty string.');
    } }, errorFormat: e => { if (e) {
        if (typeof e != "string")
            throw new S(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);
        if (!$l.includes(e)) {
            let t = Ut(e, $l);
            throw new S(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`);
        }
    } }, log: e => { if (!e)
        return; if (!Array.isArray(e))
        throw new S(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`); function t(r) { if (typeof r == "string" && !Ll.includes(r)) {
        let n = Ut(r, Ll);
        throw new S(`Invalid log level "${r}" provided to PrismaClient constructor.${n}`);
    } } for (let r of e) {
        t(r);
        let n = { level: t, emit: i => { let o = ["stdout", "event"]; if (!o.includes(i)) {
                let s = Ut(i, o);
                throw new S(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`);
            } } };
        if (r && typeof r == "object")
            for (let [i, o] of Object.entries(r))
                if (n[i])
                    n[i](o);
                else
                    throw new S(`Invalid property ${i} for "log" provided to PrismaClient constructor`);
    } }, transactionOptions: e => { if (!e)
        return; let t = e.maxWait; if (t != null && t <= 0)
        throw new S(`Invalid value ${t} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`); let r = e.timeout; if (r != null && r <= 0)
        throw new S(`Invalid value ${r} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`); }, omit: (e, t) => { if (typeof e != "object")
        throw new S('"omit" option is expected to be an object.'); if (e === null)
        throw new S('"omit" option can not be `null`'); let r = []; for (let [n, i] of Object.entries(e)) {
        let o = Im(n, t.runtimeDataModel);
        if (!o) {
            r.push({ kind: "UnknownModel", modelKey: n });
            continue;
        }
        for (let [s, a] of Object.entries(i)) {
            let l = o.fields.find(u => u.name === s);
            if (!l) {
                r.push({ kind: "UnknownField", modelKey: n, fieldName: s });
                continue;
            }
            if (l.relationName) {
                r.push({ kind: "RelationInOmit", modelKey: n, fieldName: s });
                continue;
            }
            typeof a != "boolean" && r.push({ kind: "InvalidFieldValue", modelKey: n, fieldName: s });
        }
    } if (r.length > 0)
        throw new S(Om(e, r)); }, queryPlanCacheMaxSize: e => { if (e !== void 0) {
        if (typeof e != "number")
            throw new S(`Invalid value ${JSON.stringify(e)} for "queryPlanCacheMaxSize" provided to PrismaClient constructor. Expected a number.`);
        if (!Number.isInteger(e))
            throw new S(`Invalid value ${e} for "queryPlanCacheMaxSize" provided to PrismaClient constructor. Expected an integer.`);
        if (e < 0)
            throw new S(`Invalid value ${e} for "queryPlanCacheMaxSize" provided to PrismaClient constructor. Cache size needs to be greater or equal to 0.`);
    } }, comments: e => { if (e !== void 0) {
        if (!Array.isArray(e))
            throw new S(`Invalid value ${JSON.stringify(e)} for "comments" provided to PrismaClient constructor. Expected an array of SQL commenter plugins.`);
        for (let t = 0; t < e.length; t++)
            if (typeof e[t] != "function")
                throw new S(`Invalid value at index ${t} for "comments" provided to PrismaClient constructor. Each plugin must be a function.`);
    } }, __internal: e => { if (!e)
        return; let t = ["debug", "engine", "configOverride"]; if (typeof e != "object")
        throw new S(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`); for (let [r] of Object.entries(e))
        if (!t.includes(r)) {
            let n = Ut(r, t);
            throw new S(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`);
        } } };
function Rm(e) { let t = e.adapter !== void 0, r = e.accelerateUrl !== void 0; if (t && r)
    throw new S('The "adapter" and "accelerateUrl" options are mutually exclusive. Please provide only one of them.'); if (!t && !r)
    throw new S('Using engine type "client" requires either "adapter" or "accelerateUrl" to be provided to PrismaClient constructor.'); }
function jl(e, t) { for (let [r, n] of Object.entries(e)) {
    if (!_l.includes(r)) {
        let i = Ut(r, _l);
        throw new S(`Unknown property ${r} provided to PrismaClient constructor.${i}`);
    }
    Cm[r](n, t);
} Rm(e); }
function Ut(e, t) { if (t.length === 0 || typeof e != "string")
    return ""; let r = km(e, t); return r ? ` Did you mean "${r}"?` : ""; }
function km(e, t) { if (t.length === 0)
    return null; let r = t.map(i => ({ value: i, distance: (0, ql.default)(e, i) })); r.sort((i, o) => i.distance < o.distance ? -1 : 1); let n = r[0]; return n.distance < 3 ? n.value : null; }
function Im(e, t) { var _b; return (_b = Vl(t.models, e)) !== null && _b !== void 0 ? _b : Vl(t.types, e); }
function Vl(e, t) { let r = Object.keys(e).find(n => de(n) === t); if (r)
    return e[r]; }
function Om(e, t) {
    var _b, _f, _g, _5;
    let r = Be(e);
    for (let o of t)
        switch (o.kind) {
            case "UnknownModel":
                (_b = r.arguments.getField(o.modelKey)) === null || _b === void 0 ? void 0 : _b.markAsError(), r.addErrorMessage(() => `Unknown model name: ${o.modelKey}.`);
                break;
            case "UnknownField":
                (_f = r.arguments.getDeepField([o.modelKey, o.fieldName])) === null || _f === void 0 ? void 0 : _f.markAsError(), r.addErrorMessage(() => `Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);
                break;
            case "RelationInOmit":
                (_g = r.arguments.getDeepField([o.modelKey, o.fieldName])) === null || _g === void 0 ? void 0 : _g.markAsError(), r.addErrorMessage(() => 'Relations are already excluded by default and can not be specified in "omit".');
                break;
            case "InvalidFieldValue":
                (_5 = r.arguments.getDeepFieldValue([o.modelKey, o.fieldName])) === null || _5 === void 0 ? void 0 : _5.markAsError(), r.addErrorMessage(() => "Omit field option value must be a boolean.");
                break;
        }
    let { message: n, args: i } = sr(r, "colorless");
    return `Error validating "omit" option:

${i}

${n}`;
}
var Ul = require("@prisma/client-runtime-utils");
function Bl(e) { return e.length === 0 ? Promise.resolve([]) : new Promise((t, r) => { let n = new Array(e.length), i = null, o = !1, s = 0, a = () => { o || (s++, s === e.length && (o = !0, i ? r(i) : t(n))); }, l = u => { o || (o = !0, r(u)); }; for (let u = 0; u < e.length; u++)
    e[u].then(c => { n[u] = c, a(); }, c => { if (!(0, Ul.hasBatchIndex)(c)) {
        l(c);
        return;
    } c.batchRequestIdx === u ? l(c) : (i || (i = c), a()); }); }); }
var rt = _("prisma:client");
typeof globalThis == "object" && (globalThis.NODE_CLIENT = !0);
var Nm = { requestArgsToMiddlewareArgs: e => e, middlewareArgsToRequestArgs: e => e }, Wl = Symbol.for("prisma.client.transaction.scope_context");
function Ql(e) { let r = e[Wl]; if (r === void 0)
    return { kind: "top-level" }; if (Dm(r))
    return r; throw new Error("Internal error: inconsistent transaction scope context."); }
function Dm(e) { if (typeof e != "object" || e === null)
    return !1; let t = e; return t.kind === "nested" && typeof t.txId == "string" && typeof t.scopeId == "string" && Mm(t.scopeState); }
function Mm(e) { return typeof e != "object" || e === null ? !1 : Array.isArray(e.stack); }
function Fm() { var _b; return typeof ((_b = globalThis.crypto) === null || _b === void 0 ? void 0 : _b.randomUUID) == "function" ? globalThis.crypto.randomUUID() : `${Date.now()}-${Math.random().toString(16).slice(2)}`; }
var _m = { id: 0, nextId() { return ++this.id; } };
function Kl(e) {
    class t {
        constructor(n) {
            var _b, _f, _g, _5, _6, _7, _8, _10, _11, _12;
            this._originalClient = this;
            this._createPrismaPromise = mi();
            this.$extends = Ho;
            if (!n)
                throw new b.PrismaClientInitializationError("`PrismaClient` needs to be constructed with a non-empty, valid `PrismaClientOptions`:\n\n```\nnew PrismaClient({\n  ...\n})\n```\n\nor\n\n```\nconstructor() {\n  super({ ... });\n}\n```\n          ", wi);
            e = (_g = (_f = (_b = n.__internal) === null || _b === void 0 ? void 0 : _b.configOverride) === null || _f === void 0 ? void 0 : _f.call(_b, e)) !== null && _g !== void 0 ? _g : e, jl(n, e);
            let i = new Gl.EventEmitter().on("error", () => { });
            this._extensions = Qe.empty(), this._previewFeatures = e.previewFeatures, this._clientVersion = (_5 = e.clientVersion) !== null && _5 !== void 0 ? _5 : wi, this._activeProvider = e.activeProvider, this._globalOmit = n === null || n === void 0 ? void 0 : n.omit, this._tracingHelper = kl();
            let o;
            if (n.adapter) {
                o = n.adapter;
                let s = e.activeProvider === "postgresql" || e.activeProvider === "cockroachdb" ? "postgres" : e.activeProvider;
                if (o.provider !== s)
                    throw new b.PrismaClientInitializationError(`The Driver Adapter \`${o.adapterName}\`, based on \`${o.provider}\`, is not compatible with the provider \`${s}\` specified in the Prisma schema.`, this._clientVersion);
            }
            try {
                let s = n !== null && n !== void 0 ? n : {}, l = ((_6 = s.__internal) !== null && _6 !== void 0 ? _6 : {}).debug === !0;
                if (l && _.enable("prisma:client"), s.errorFormat ? this._errorFormat = s.errorFormat : process.env.NODE_ENV === "production" ? this._errorFormat = "minimal" : process.env.NO_COLOR ? this._errorFormat = "colorless" : this._errorFormat = "colorless", this._runtimeDataModel = e.runtimeDataModel, this._engineConfig = { enableDebugLogs: l, logLevel: s.log && Ol(s.log), logQueries: s.log && !!(typeof s.log == "string" ? s.log === "query" : s.log.find(u => typeof u == "string" ? u === "query" : u.level === "query")), compilerWasm: e.compilerWasm, clientVersion: e.clientVersion, previewFeatures: this._previewFeatures, activeProvider: e.activeProvider, inlineSchema: e.inlineSchema, tracingHelper: this._tracingHelper, transactionOptions: { maxWait: (_8 = (_7 = s.transactionOptions) === null || _7 === void 0 ? void 0 : _7.maxWait) !== null && _8 !== void 0 ? _8 : 2e3, timeout: (_11 = (_10 = s.transactionOptions) === null || _10 === void 0 ? void 0 : _10.timeout) !== null && _11 !== void 0 ? _11 : 5e3, isolationLevel: (_12 = s.transactionOptions) === null || _12 === void 0 ? void 0 : _12.isolationLevel }, logEmitter: i, adapter: o, accelerateUrl: s.accelerateUrl, sqlCommenters: s.comments, parameterizationSchema: e.parameterizationSchema, runtimeDataModel: e.runtimeDataModel, queryPlanCacheMaxSize: n.queryPlanCacheMaxSize }, this._accelerateEngineConfig = Object.create(this._engineConfig), this._accelerateEngineConfig.accelerateUtils = { resolveDatasourceUrl: () => {
                        if (s.accelerateUrl)
                            return s.accelerateUrl;
                        throw new b.PrismaClientInitializationError(`\`accelerateUrl\` is required when using \`@prisma/extension-accelerate\`:

new PrismaClient({
  accelerateUrl: "prisma://...",
}).$extends(withAccelerate())
`, e.clientVersion);
                    } }, rt("clientVersion", e.clientVersion), this._engine = ml(this._engineConfig), this._requestHandler = new zr(this, i), s.log)
                    for (let u of s.log) {
                        let c = typeof u == "string" ? u : u.emit === "stdout" ? u.level : null;
                        c && this.$on(c, p => { var _b; mt.log(`${(_b = mt.tags[c]) !== null && _b !== void 0 ? _b : ""}`, p.message || p.query); });
                    }
            }
            catch (s) {
                throw s.clientVersion = this._clientVersion, s;
            }
            return this._appliedParent = vt(this);
        }
        get [Symbol.toStringTag]() { return "PrismaClient"; }
        $on(n, i) { return n === "beforeExit" ? this._engine.onBeforeExit(i) : n && this._engineConfig.logEmitter.on(n, i), this; }
        $connect() { try {
            return this._engine.start();
        }
        catch (n) {
            throw n.clientVersion = this._clientVersion, n;
        } }
        async $disconnect() { try {
            await this._engine.stop();
        }
        catch (n) {
            throw n.clientVersion = this._clientVersion, n;
        }
        finally {
            Mi();
        } }
        $executeRawInternal(n, i, o, s) { let a = this._activeProvider; return this._request({ action: "executeRaw", args: o, transaction: n, clientMethod: i, argsMapper: di({ clientMethod: i, activeProvider: a }), callsite: fe(this._errorFormat), dataPath: [], middlewareArgsMapper: s }); }
        $executeRaw(n, ...i) { return this._createPrismaPromise(o => { if (n.raw !== void 0 || n.sql !== void 0) {
            let [s, a] = Jl(n, i);
            return pi(this._activeProvider, s.text, s.values, Array.isArray(n) ? "prisma.$executeRaw`<SQL>`" : "prisma.$executeRaw(sql`<SQL>`)"), this.$executeRawInternal(o, "$executeRaw", s, a);
        } throw new b.PrismaClientValidationError("`$executeRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#executeraw\n", { clientVersion: this._clientVersion }); }); }
        $executeRawUnsafe(n, ...i) { return this._createPrismaPromise(o => (pi(this._activeProvider, n, i, "prisma.$executeRawUnsafe(<SQL>, [...values])"), this.$executeRawInternal(o, "$executeRawUnsafe", [n, ...i]))); }
        $runCommandRaw(n) { if (e.activeProvider !== "mongodb")
            throw new b.PrismaClientValidationError(`The ${e.activeProvider} provider does not support $runCommandRaw. Use the mongodb provider.`, { clientVersion: this._clientVersion }); return this._createPrismaPromise(i => this._request({ args: n, clientMethod: "$runCommandRaw", dataPath: [], action: "runCommandRaw", argsMapper: fl, callsite: fe(this._errorFormat), transaction: i })); }
        async $queryRawInternal(n, i, o, s) { let a = this._activeProvider; return this._request({ action: "queryRaw", args: o, transaction: n, clientMethod: i, argsMapper: di({ clientMethod: i, activeProvider: a }), callsite: fe(this._errorFormat), dataPath: [], middlewareArgsMapper: s }); }
        $queryRaw(n, ...i) { return this._createPrismaPromise(o => { if (n.raw !== void 0 || n.sql !== void 0)
            return this.$queryRawInternal(o, "$queryRaw", ...Jl(n, i)); throw new b.PrismaClientValidationError("`$queryRaw` is a tag function, please use it like the following:\n```\nconst result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`\n```\n\nOr read our docs at https://www.prisma.io/docs/concepts/components/prisma-client/raw-database-access#queryraw\n", { clientVersion: this._clientVersion }); }); }
        $queryRawTyped(n) { return this._createPrismaPromise(i => { if (!this._hasPreviewFlag("typedSql"))
            throw new b.PrismaClientValidationError("`typedSql` preview feature must be enabled in order to access $queryRawTyped API", { clientVersion: this._clientVersion }); return this.$queryRawInternal(i, "$queryRawTyped", n); }); }
        $queryRawUnsafe(n, ...i) { return this._createPrismaPromise(o => this.$queryRawInternal(o, "$queryRawUnsafe", [n, ...i])); }
        _transactionWithArray({ promises: n, options: i }) { let o = _m.nextId(), s = Il(n.length), a = n.map((l, u) => { var _b, _f, _g, _5, _6; if ((l === null || l === void 0 ? void 0 : l[Symbol.toStringTag]) !== "PrismaPromise")
            throw new Error("All elements of the array need to be Prisma Client promises. Hint: Please make sure you are not awaiting the Prisma client calls you intended to pass in the $transaction function."); let c = (_b = i === null || i === void 0 ? void 0 : i.isolationLevel) !== null && _b !== void 0 ? _b : this._engineConfig.transactionOptions.isolationLevel, p = { kind: "batch", id: o, index: u, isolationLevel: c, maxWait: (_f = i === null || i === void 0 ? void 0 : i.maxWait) !== null && _f !== void 0 ? _f : this._engineConfig.transactionOptions.maxWait, timeout: (_g = i === null || i === void 0 ? void 0 : i.timeout) !== null && _g !== void 0 ? _g : this._engineConfig.transactionOptions.timeout, lock: s }; return (_6 = (_5 = l.requestTransaction) === null || _5 === void 0 ? void 0 : _5.call(l, p)) !== null && _6 !== void 0 ? _6 : l; }); return Bl(a); }
        async _transactionWithCallback({ callback: n, options: i = {} }) { var _b, _f, _g; let o = Ql(this), s = o.kind === "nested", a = s ? o.scopeState : { stack: [] }, l = a.stack, u = Fm(); if (s) {
            if (l.at(-1) !== o.scopeId)
                throw new Error("Concurrent nested transactions are not supported");
            i.newTxId = o.txId;
        } l.push(u); let c = { traceparent: this._tracingHelper.getTraceParent() }, p = { maxWait: (_b = i === null || i === void 0 ? void 0 : i.maxWait) !== null && _b !== void 0 ? _b : this._engineConfig.transactionOptions.maxWait, timeout: (_f = i === null || i === void 0 ? void 0 : i.timeout) !== null && _f !== void 0 ? _f : this._engineConfig.transactionOptions.timeout, isolationLevel: (_g = i === null || i === void 0 ? void 0 : i.isolationLevel) !== null && _g !== void 0 ? _g : this._engineConfig.transactionOptions.isolationLevel, newTxId: i.newTxId }, d; try {
            d = await this._engine.transaction("start", c, p);
        }
        catch (g) {
            throw l.at(-1) === u && l.pop(), g;
        } let m; try {
            let g = { kind: "itx", ...d };
            if (m = await n(this._createItxClient(g, u, a)), s) {
                if (l.at(-1) !== u)
                    throw new Error("Nested transactions must be closed in reverse order of creation.");
            }
            else if (l.length !== 1)
                throw new Error("Cannot close transaction while a nested transaction is still active.");
            await this._engine.transaction("commit", c, d);
        }
        catch (g) {
            let w = l.at(-1) !== u ? Math.max(1, l.length) : 1;
            for (let k = 0; k < w; k++)
                await this._engine.transaction("rollback", c, d).catch(P => { rt("rollback attempt %d/%d failed: %O", k + 1, w, P); });
            throw g;
        }
        finally {
            l.at(-1) === u ? l.pop() : l.length = 0;
        } return m; }
        _createItxClient(n, i, o) { let s = { kind: "nested", txId: n.id, scopeId: i, scopeState: o }; return W(vt(W(Jo(this), [$("_appliedParent", () => this._appliedParent._createItxClient(n, i, o)), $("_createPrismaPromise", () => mi(n)), $(Wl, () => s)])), [Je(Ko)]); }
        $transaction(n, i) { var _b; let o; typeof n == "function" ? ((_b = this._engineConfig.adapter) === null || _b === void 0 ? void 0 : _b.adapterName) === "@prisma/adapter-d1" ? o = () => { throw new Error("Cloudflare D1 does not support interactive transactions. We recommend you to refactor your queries with that limitation in mind, and use batch transactions with `prisma.$transactions([])` where applicable."); } : e.activeProvider === "mongodb" && Ql(this).kind === "nested" ? o = () => { throw new b.PrismaClientValidationError(`The ${e.activeProvider} provider does not support nested transactions`, { clientVersion: this._clientVersion }); } : o = () => this._transactionWithCallback({ callback: n, options: i }) : o = () => this._transactionWithArray({ promises: n, options: i }); let s = { name: "transaction", attributes: { method: "$transaction" } }; return this._tracingHelper.runInChildSpan(s, o); }
        _request(n) { var _b; n.otelParentCtx = this._tracingHelper.getActiveContext(); let i = (_b = n.middlewareArgsMapper) !== null && _b !== void 0 ? _b : Nm, o = { args: i.requestArgsToMiddlewareArgs(n.args), dataPath: n.dataPath, runInTransaction: !!n.transaction, action: n.action, model: n.model }, s = { operation: { name: "operation", attributes: { method: o.action, model: o.model, name: o.model ? `${o.model}.${o.action}` : o.action } } }, a = async (l) => { let { runInTransaction: u, args: c, ...p } = l, d = { ...n, ...p }; c && (d.args = i.middlewareArgsToRequestArgs(c)), n.transaction !== void 0 && u === !1 && delete d.transaction; let m = await es(this, d); if (!d.model)
            return m; let g = os({ dataPath: d.dataPath, modelName: d.model, args: d.args, runtimeDataModel: this._runtimeDataModel }); return Wo({ result: m, modelName: g.modelName, args: g.args, extensions: this._extensions, runtimeDataModel: this._runtimeDataModel, globalOmit: this._globalOmit }); }; return this._tracingHelper.runInChildSpan(s.operation, () => new zl.AsyncResource("prisma-client-request").runInAsyncScope(() => a(o))); }
        async _executeRequest({ args: n, clientMethod: i, dataPath: o, callsite: s, action: a, model: l, argsMapper: u, transaction: c, unpacker: p, otelParentCtx: d, customDataProxyFetch: m }) {
            try {
                n = u ? u(n) : n;
                let g = { name: "serialize" }, x = this._tracingHelper.runInChildSpan(g, () => pr({ modelName: l, runtimeDataModel: this._runtimeDataModel, action: a, args: n, clientMethod: i, callsite: s, extensions: this._extensions, errorFormat: this._errorFormat, clientVersion: this._clientVersion, previewFeatures: this._previewFeatures, globalOmit: this._globalOmit }));
                return _.enabled("prisma:client") && (rt("Prisma Client call:"), rt(`prisma.${i}(${Mo(n)})`), rt("Generated request:"), rt(JSON.stringify(x, null, 2) + `
`)), (c === null || c === void 0 ? void 0 : c.kind) === "batch" && await c.lock, this._requestHandler.request({ protocolQuery: x, modelName: l, action: a, clientMethod: i, dataPath: o, callsite: s, args: n, extensions: this._extensions, transaction: c, unpacker: p, otelParentCtx: d, otelChildCtx: this._tracingHelper.getActiveContext(), globalOmit: this._globalOmit, customDataProxyFetch: m });
            }
            catch (g) {
                throw g.clientVersion = this._clientVersion, g;
            }
        }
        _hasPreviewFlag(n) { var _b; return !!((_b = this._engineConfig.previewFeatures) === null || _b === void 0 ? void 0 : _b.includes(n)); }
    }
    return t;
}
function Jl(e, t) { return $m(e) ? [new Hl.Sql(e, t), Tl] : [e, Sl]; }
function $m(e) { return Array.isArray(e) && Array.isArray(e.raw); }
var Lm = new Set(["toJSON", "$$typeof", "asymmetricMatch", Symbol.iterator, Symbol.toStringTag, Symbol.isConcatSpreadable, Symbol.toPrimitive]);
function Zl(e) { return new Proxy(e, { get(t, r) { if (r in t)
        return t[r]; if (!Lm.has(r))
        throw new TypeError(`Invalid enum value: ${String(r)}`); } }); }
var Vm = () => { var _b, _f; return ((_f = (_b = globalThis.process) === null || _b === void 0 ? void 0 : _b.release) === null || _f === void 0 ? void 0 : _f.name) === "node"; }, qm = () => { var _b, _f; return !!globalThis.Bun || !!((_f = (_b = globalThis.process) === null || _b === void 0 ? void 0 : _b.versions) === null || _f === void 0 ? void 0 : _f.bun); }, jm = () => !!globalThis.Deno, Um = () => typeof globalThis.Netlify == "object", Bm = () => typeof globalThis.EdgeRuntime == "object", Qm = () => { var _b; return ((_b = globalThis.navigator) === null || _b === void 0 ? void 0 : _b.userAgent) === "Cloudflare-Workers"; };
function Jm() { var _b; return (_b = [[Um, "netlify"], [Bm, "edge-light"], [Qm, "workerd"], [jm, "deno"], [qm, "bun"], [Vm, "node"]].flatMap(r => r[0]() ? [r[1]] : []).at(0)) !== null && _b !== void 0 ? _b : ""; }
var Hm = { node: "Node.js", workerd: "Cloudflare Workers", deno: "Deno and Deno Deploy", netlify: "Netlify Edge Functions", "edge-light": "Edge Runtime (Vercel Edge Functions, Vercel Edge Middleware, Next.js (Pages Router) Edge API Routes, Next.js (App Router) Edge Route Handlers or Next.js Middleware)" };
function Yl() { let e = Jm(); return { id: e, prettyName: Hm[e] || e, isEdge: ["workerd", "deno", "netlify", "edge-light"].includes(e) }; }
var b = require("@prisma/client-runtime-utils"), oe = require("@prisma/client-runtime-utils"), O = require("@prisma/client-runtime-utils"), Xl = require("@prisma/client-runtime-utils");
0 && (module.exports = { AnyNull, DMMF, DbNull, Debug, Decimal, Extensions, JsonNull, NullTypes, ObjectEnumValue, PrismaClientInitializationError, PrismaClientKnownRequestError, PrismaClientRustPanicError, PrismaClientUnknownRequestError, PrismaClientValidationError, Public, Sql, createParam, defineDmmfProperty, deserializeJsonObject, deserializeRawResult, dmmfToRuntimeDataModel, empty, getPrismaClient, getRuntime, isAnyNull, isDbNull, isJsonNull, isObjectEnumValue, join, makeStrictEnum, makeTypedQueryFactory, raw, serializeJsonQuery, skip, sqltag, warnOnce });
