UNPKG

@prisma/client

Version:

Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.

10 lines • 186 kB
"use strict";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 hi=(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})},wi=(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)):{},wi(t||!e||!e.__esModule?Qt(r,"default",{value:e,enumerable:!0}):r,e)),lu=e=>wi(Qt({},"__esModule",{value:!0}),e);var Di=q((vf,Iu)=>{Iu.exports={name:"@prisma/engines-version",version:"7.6.0-1.75cbdc1eb7150937890ad5465d861175c6624711",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"75cbdc1eb7150937890ad5465d861175c6624711"},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 Mi=q(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.enginesVersion=void 0;Ht.enginesVersion=Di().prisma.enginesVersion});var _i=q((Cf,Fi)=>{"use strict";Fi.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var ji=q((If,qi)=>{"use strict";qi.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 Bi=q(($f,zt)=>{"use strict";zt.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()};zt.exports.default=zt.exports});var un=q((Rg,Zi)=>{"use strict";Zi.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,v,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)),v=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,v,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 ro=hi(()=>{"use strict"});var no=hi(()=>{"use strict"});var In=q(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.anumber=kn;Se.abytes=Ps;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 Ps(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){Ps(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Qs=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=Ts;y.add=$s;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 Ts(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 Ss=(e,t)=>BigInt(e>>>0)<<On|BigInt(t>>>0);y.toBig=Ss;var vs=(e,t,r)=>e>>>r;y.shrSH=vs;var As=(e,t,r)=>e<<32-r|t>>>r;y.shrSL=As;var Cs=(e,t,r)=>e>>>r|t<<32-r;y.rotrSH=Cs;var Rs=(e,t,r)=>e<<32-r|t>>>r;y.rotrSL=Rs;var ks=(e,t,r)=>e<<64-r|t>>>r-32;y.rotrBH=ks;var Is=(e,t,r)=>e>>>r-32|t<<64-r;y.rotrBL=Is;var Os=(e,t)=>t;y.rotr32H=Os;var Ns=(e,t)=>e;y.rotr32L=Ns;var Ds=(e,t,r)=>e<<r|t>>>32-r;y.rotlSH=Ds;var Ms=(e,t,r)=>t<<r|e>>>32-r;y.rotlSL=Ms;var Fs=(e,t,r)=>t<<r-32|e>>>64-r;y.rotlBH=Fs;var _s=(e,t,r)=>e<<r-32|t>>>64-r;y.rotlBL=_s;function $s(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Ls=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);y.add3L=Ls;var Vs=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;y.add3H=Vs;var qs=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);y.add4L=qs;var js=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;y.add4H=js;var Us=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);y.add5L=Us;var Bs=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;y.add5H=Bs;var _p={fromBig:Nn,split:Ts,toBig:Ss,shrSH:vs,shrSL:As,rotrSH:Cs,rotrSL:Rs,rotrBH:ks,rotrBL:Is,rotr32H:Os,rotr32L:Ns,rotlSH:Ds,rotlSL:Ms,rotlBH:Fs,rotlBL:_s,add:$s,add3L:Ls,add3H:Vs,add4L:qs,add4H:js,add5H:Bs,add5L:Us};y.default=_p});var Js=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 zs=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=zp;E.utf8ToBytes=Gs;E.toBytes=Sr;E.concatBytes=Wp;E.checkOpts=Kp;E.wrapConstructor=Zp;E.wrapConstructorWithOpts=Yp;E.wrapXOFConstructorWithOpts=Xp;E.randomBytes=ed;var We=Js(),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 ae={_0:48,_9:57,A:65,F:70,a:97,f:102};function Hs(e){if(e>=ae._0&&e<=ae._9)return e-ae._0;if(e>=ae.A&&e<=ae.F)return e-(ae.A-10);if(e>=ae.a&&e<=ae.f)return e-(ae.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=Hs(e.charCodeAt(o)),a=Hs(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 Gp=async()=>{};E.nextTick=Gp;async function zp(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 Gs(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=Gs(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 ra=q(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});C.shake256=C.shake128=C.keccak_512=C.keccak_384=C.keccak_256=C.keccak_224=C.sha3_512=C.sha3_384=C.sha3_256=C.sha3_224=C.Keccak=void 0;C.keccakP=ea;var Ke=In(),It=Qs(),le=zs(),Zs=[],Ys=[],Xs=[],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],Zs.push(2*(5*n+r)),Ys.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);Xs.push(i)}var[sd,ad]=(0,It.split)(Xs,!0),Ws=(e,t,r)=>r>32?(0,It.rotlBH)(e,t,r):(0,It.rotlSH)(e,t,r),Ks=(e,t,r)=>r>32?(0,It.rotlBL)(e,t,r):(0,It.rotlSL)(e,t,r);function ea(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=Ws(u,c,1)^r[a],d=Ks(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=Ys[s],l=Ws(i,o,a),u=Ks(i,o,a),c=Zs[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 le.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,le.u32)(this.state)}keccak(){le.isLE||(0,le.byteSwap32)(this.state32),ea(this.state32,this.rounds),le.isLE||(0,le.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,Ke.aexists)(this);let{blockLen:r,state:n}=this;t=(0,le.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}};C.Keccak=Ot;var ye=(e,t,r)=>(0,le.wrapConstructor)(()=>new Ot(t,e,r));C.sha3_224=ye(6,144,224/8);C.sha3_256=ye(6,136,256/8);C.sha3_384=ye(6,104,384/8);C.sha3_512=ye(6,72,512/8);C.keccak_224=ye(1,144,224/8);C.keccak_256=ye(1,136,256/8);C.keccak_384=ye(1,104,384/8);C.keccak_512=ye(1,72,512/8);var ta=(e,t,r)=>(0,le.wrapXOFConstructorWithOpts)((n={})=>new Ot(t,e,n.dkLen===void 0?r:n.dkLen,!0));C.shake128=ta(31,168,128/8);C.shake256=ta(31,136,256/8)});var ca=q((wx,he)=>{"use strict";var{sha3_512:ld}=ra(),ia=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 oa(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var sa=(e="")=>oa(ld(e)).toString(36).slice(1),na=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),ud=e=>na[Math.floor(e()*na.length)],aa=({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 sa(n).substring(0,Nt)},la=e=>()=>e++,cd=476782367,ua=({random:e=Math.random,counter:t=la(Math.floor(e()*cd)),length:r=ia,fingerprint:n=aa({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+sa(u).substring(1,r)}`},pd=ua(),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:ia,bigLength:Nt});he.exports.init=ua;he.exports.createId=pd;he.exports.bufToBigInt=oa;he.exports.createCounter=la;he.exports.createFingerprint=aa;he.exports.isCuid=dd});var pa=q((bx,Dt)=>{"use strict";var{createId:md,init:fd,getConstants:gd,isCuid:yd}=ca();Dt.exports.createId=md;Dt.exports.init=fd;Dt.exports.getConstants=gd;Dt.exports.isCuid=yd});var Gm={};Ne(Gm,{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:()=>ie.Sql,createParam:()=>Po,defineDmmfProperty:()=>Ro,deserializeJsonObject:()=>K,deserializeRawResult:()=>Hr,dmmfToRuntimeDataModel:()=>Ti,empty:()=>ie.empty,getPrismaClient:()=>Kl,getRuntime:()=>Yl,isAnyNull:()=>O.isAnyNull,isDbNull:()=>O.isDbNull,isJsonNull:()=>O.isJsonNull,isObjectEnumValue:()=>O.isObjectEnumValue,join:()=>ie.join,makeStrictEnum:()=>Zl,makeTypedQueryFactory:()=>ko,raw:()=>ie.raw,serializeJsonQuery:()=>pr,skip:()=>cr,sqltag:()=>ie.sql,warnOnce:()=>ln});module.exports=lu(Gm);var Wr={};Ne(Wr,{defineExtension:()=>bi,getExtensionContext:()=>xi});function bi(e){return typeof e=="function"?e:t=>t.$extends(e)}function xi(e){return e}var Kr={};Ne(Kr,{validator:()=>Ei});function Ei(...e){return t=>t}var Z=class{_map=new Map;get(t){return this._map.get(t)?.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 pe(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Pi(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 Ti(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 So=require("@prisma/client-runtime-utils");var Jt={};Ne(Jt,{$:()=>Ri,bgBlack:()=>wu,bgBlue:()=>Pu,bgCyan:()=>Su,bgGreen:()=>xu,bgMagenta:()=>Tu,bgRed:()=>bu,bgWhite:()=>vu,bgYellow:()=>Eu,black:()=>fu,blue:()=>xe,bold:()=>G,cyan:()=>oe,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,Si,vi,Ai,Ci=!0;typeof process<"u"&&({FORCE_COLOR:Yr,NODE_DISABLE_COLORS:Si,NO_COLOR:vi,TERM:Ai}=process.env||{},Ci=process.stdout&&process.stdout.isTTY);var Ri={enabled:!Si&&vi==null&&Ai!=="dumb"&&(Yr!=null&&Yr!=="0"||Ci)};function S(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ri.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var uu=S(0,0),G=S(1,22),ot=S(2,22),cu=S(3,23),st=S(4,24),pu=S(7,27),du=S(8,28),mu=S(9,29),fu=S(30,39),be=S(31,39),at=S(32,39),lt=S(33,39),xe=S(34,39),gu=S(35,39),oe=S(36,39),yu=S(37,39),ut=S(90,39),hu=S(90,39),wu=S(40,49),bu=S(41,49),xu=S(42,49),Eu=S(43,49),Pu=S(44,49),Tu=S(45,49),Su=S(46,49),vu=S(47,49);var Au=100,ki=["green","yellow","blue","magenta","cyan","red"],ct=[],Ii=Date.now(),Cu=0,Xr=typeof process<"u"?process.env:{};globalThis.DEBUG??=Xr.DEBUG??"";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)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function Ru(e){let t={color:ki[Cu++%ki.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()-Ii}ms`;Ii=Date.now(),globalThis.DEBUG_COLORS?a(Jt[s](G(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 Oi(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 Ni(){ct.length=0}var $i=B(_i(),1);function en(e){let t=(0,$i.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var Li="prisma+postgres",Gt=`${Li}:`;function Vi(e){return e?.toString().startsWith(`${Gt}//`)??!1}function tn(e){if(!Vi(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:()=>Ui,tags:()=>dt,warn:()=>rn});var dt={error:be("prisma:error"),warn:lt("prisma:warn"),info:oe("prisma:info"),query:xe("prisma:query")},Ui={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Ou(...e){console.log(...e)}function rn(e,...t){Ui.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 se(e,t){throw new Error(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 Qi=new Set,ln=(e,t,...r)=>{Qi.has(e)||(Qi.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 Ji=require("@prisma/client-runtime-utils");function Fe(e){return Ji.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 yo=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=(v=>(v.findUnique="findUnique",v.findUniqueOrThrow="findUniqueOrThrow",v.findFirst="findFirst",v.findFirstOrThrow="findFirstOrThrow",v.findMany="findMany",v.create="create",v.createMany="createMany",v.createManyAndReturn="createManyAndReturn",v.update="update",v.updateMany="updateMany",v.updateManyAndReturn="updateManyAndReturn",v.upsert="upsert",v.delete="delete",v.deleteMany="deleteMany",v.groupBy="groupBy",v.count="count",v.aggregate="aggregate",v.findRaw="findRaw",v.aggregateRaw="aggregateRaw",v))(_e||{});var Ki=B(ji());var Wi=B(require("node:fs"));var Hi={keyword:oe,entity:oe,value:e=>G(xe(e)),punctuation:xe,directive:oe,function:oe,variable:e=>G(xe(e)),string:e=>G(at(e)),boolean:lt,number:oe,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 z){let t=e;return new z(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),z.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],v=P.inside,U=!!P.lookbehind,Oe=!!P.greedy,zr=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,ce=i;L<t.length;ce+=t[L].length,++L){let nt=t[L];if(t.length>e.length)return;if(nt instanceof z)continue;if(Oe&&L!=t.length-1){P.lastIndex=ce;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=ce;for(let ru=t.length;a<ru&&(l<d||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++L,ce=l);if(t[L]instanceof z)continue;u=a-L,nt=e.slice(ce,l),p.index-=ce}else{P.lastIndex=0;var p=P.exec(nt),u=1}if(!p){if(o)break;continue}U&&(zr=p[1]?p[1].length:0);var c=p.index+zr,p=p[0].slice(zr),d=c+p.length,m=nt.slice(0,c),g=nt.slice(d);let Bt=[L,u];m&&(++L,ce+=m.length,Bt.push(m));let tu=new z(x,v?h.tokenize(p,v):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,ce,!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:z};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 z(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}z.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return z.stringify(r,t)}).join(""):Vu(e.type)(e.content)};function Vu(e){return Hi[e]||$u}function Gi(e){return qu(e,h.languages.javascript)}function qu(e,t){return h.tokenize(e,t).map(n=>z.stringify(n)).join("")}function zi(e){return en(e)}var Yt=class e{firstLineNumber;lines;static read(t){let r;try{r=Wi.default.readFileSync(t,"utf-8")}catch{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,zi(n).split(` `))}highlight(){let t=Gi(this.toString());return new e(this.firstLineNumber,t.split(` `))}toString(){return this.lines.join(` `)}};var ju={red:be,gray:ut,dim:ot,bold:G,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??!1,callArguments:n}}function Qu({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){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=Yt.read(a.fileName)?.slice(l,a.lineNumber),c=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,Ki.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 Gu({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(zu(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 zu(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),Gu(r,t)}var oo=B(un());function eo(e,t,r){let n=to(e),i=Wu(n),o=Zu(i);o?er(o,t,r):t.addErrorMessage(()=>"Unknown error")}function to(e){return e.errors.flatMap(t=>t.kind==="Union"?to(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=Yi(t),i=Yi(r);return n!==i?n-i:Xi(t)-Xi(r)})}function Yi(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function Xi(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.name=t;this.value=r}isRequired=!1;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)}};no();var $e=class{constructor(t=0,r){this.context=r;this.currentIndent=t}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;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?.(),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}};ro();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},io={bold:G,red:be,green:at,dim:ot,enabled:!0},Le={write(e){e.writeLine(",")}};var Y=class{constructor(t){this.contents=t}isUnderlined=!1;color=t=>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 de=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var Ve=class extends de{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 Y("[]");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 de{fields={};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){return t.length===0?this:this.getDeepField(t)?.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){return this.getField(t)?.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(){let t=this.getField("select")?.value.asObject();if(t)return{kind:"select",value:t};let r=this.getField("include")?.value.asObject();if(r)return{kind:"include",value:r}}getSubSelectionValue(t){return this.getSelectionParent()?.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 Y("{}");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 de{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Y(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var ht=class{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":eo(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Yu(e,t){let r=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();r&&(r.getField(e.firstField)?.markAsError(),r.getField(e.secondField)?.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){let[r,n]=je(e.selectionPath),i=e.outputType,o=t.arguments.getDeepSelectionParent(r)?.value;if(o&&(o.getField(n)?.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){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){tc(e,t,i);return}if(n.hasField("select")){rc(e,t);return}}if(r?.[pe(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){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),lo(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){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=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??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=uo(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":lo(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=uo(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){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),yc(n,e.arguments)),t.addErrorMessage(i=>so(i,r,e.arguments.map(o=>o.name)))}function ac(e,t){let[r,n]=je(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&co(o,e.inputType)}t.addErrorMessage(o=>so(o,n,e.inputType.fields.map(s=>s.name)))}function so(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){let r;t.addErrorMessage(l=>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=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=je(e.argumentPath),s=new ht,a=n.getDeepFieldValue(i)?.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(ao).join(" | ");a.addSuggestion(new j(o,l).makeRequired())}if(e.dependentArgumentPath){n.getDeepField(e.dependentArgumentPath)?.markAsError();let[,l]=je(e.dependentArgumentPath);t.addErrorMessage(u=>`Argument \`${u.green(o)}\` is required because argument \`${u.green(l)}\` was provided.`)}}}function ao(e){return e.kind==="list"?`${ao(e.elementType)}[]`:e.name}function uc(e,t){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.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){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.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){let r=e.argument.name,n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;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){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&co(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){let r=e.argumentPath[e.argumentPath.length-1],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.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 lo(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 uo(e,t){let[r,n]=je(e),i=t.arguments.getDeepSubSelectionValue(r)?.asObject();if(!i)return{parentKind:"unknown",fieldName:n};let o=i.getFieldValue("select")?.asObject(),s=i.getFieldValue("include")?.asObject(),a=i.getFieldValue("omit")?.asObject(),l=o?.getField(n);return o&&l?{parentKind:"select",parent:o,field:l,fieldName:n}:(l=s?.getField(n),s&&l?{parentKind:"include",field:l,parent:s,fieldName:n}:(l=a?.getField(n),a&&l?{parentKind:"omit",field:l,parent:a,fieldName:n}:{parentKind:"unknown",fieldName:n}))}function co(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,oo.default)(e,i);o>hc||o<r&&(r=o,n=i)}return n}var mo=require("@prisma/client-runtime-utils");var bt=class{modelName;name;typeName;isList;isEnum;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 po=": ",or=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+po.length}write(t){let r=new Y(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(po).write(this.value)}};var pn=class{arguments;errorMessages=[];constructor(t){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(fo(e))}function fo(e){let t=