prisma 6.6.0-integration-push-xmzqvqxpztks.5 → 6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,69 +1,69 @@
1
- "use strict";var pu=Object.create;var Mt=Object.defineProperty;var du=Object.getOwnPropertyDescriptor;var mu=Object.getOwnPropertyNames;var fu=Object.getPrototypeOf,gu=Object.prototype.hasOwnProperty;var Co=(e,r)=>()=>(e&&(r=e(e=0)),r);var ie=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Jr=(e,r)=>{for(var t in r)Mt(e,t,{get:r[t],enumerable:!0})},Ao=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of mu(r))!gu.call(e,i)&&i!==t&&Mt(e,i,{get:()=>r[i],enumerable:!(n=du(r,i))||n.enumerable});return e};var O=(e,r,t)=>(t=e!=null?pu(fu(e)):{},Ao(r||!e||!e.__esModule?Mt(t,"default",{value:e,enumerable:!0}):t,e)),hu=e=>Ao(Mt({},"__esModule",{value:!0}),e);var li=ie((Df,Xo)=>{"use strict";Xo.exports=(e,r=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n<i)}});var ts=ie((Nf,rs)=>{"use strict";var rc=require("os"),es=require("tty"),me=li(),{env:G}=process,Je;me("no-color")||me("no-colors")||me("color=false")||me("color=never")?Je=0:(me("color")||me("colors")||me("color=true")||me("color=always"))&&(Je=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?Je=1:G.FORCE_COLOR==="false"?Je=0:Je=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function ui(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ci(e,r){if(Je===0)return 0;if(me("color=16m")||me("color=full")||me("color=truecolor"))return 3;if(me("color=256"))return 2;if(e&&!r&&Je===void 0)return 0;let t=Je||0;if(G.TERM==="dumb")return t;if(process.platform==="win32"){let n=rc.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in G)||G.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let n=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:t}function tc(e){let r=ci(e,e&&e.isTTY);return ui(r)}rs.exports={supportsColor:tc,stdout:ui(ci(!0,es.isatty(1))),stderr:ui(ci(!0,es.isatty(2)))}});var os=ie((Lf,is)=>{"use strict";var nc=ts(),yr=li();function ns(e){if(/^\d{3,4}$/.test(e)){let t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let r=(e||"").split(".").map(t=>parseInt(t,10));return{major:r[0],minor:r[1],patch:r[2]}}function pi(e){let{env:r}=process;if("FORCE_HYPERLINK"in r)return!(r.FORCE_HYPERLINK.length>0&&parseInt(r.FORCE_HYPERLINK,10)===0);if(yr("no-hyperlink")||yr("no-hyperlinks")||yr("hyperlink=false")||yr("hyperlink=never"))return!1;if(yr("hyperlink=true")||yr("hyperlink=always")||"NETLIFY"in r)return!0;if(!nc.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in r||"TEAMCITY_VERSION"in r)return!1;if("TERM_PROGRAM"in r){let t=ns(r.TERM_PROGRAM_VERSION);switch(r.TERM_PROGRAM){case"iTerm.app":return t.major===3?t.minor>=1:t.major>3;case"WezTerm":return t.major>=20200620;case"vscode":return t.major>1||t.major===1&&t.minor>=72}}if("VTE_VERSION"in r){if(r.VTE_VERSION==="0.50.0")return!1;let t=ns(r.VTE_VERSION);return t.major>0||t.minor>=50}return!1}is.exports={supportsHyperlink:pi,stdout:pi(process.stdout),stderr:pi(process.stderr)}});var ss=ie((Hf,ic)=>{ic.exports={name:"@prisma/internals",version:"6.6.0-integration-push-xmzqvqxpztks.5",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.24.2","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"3.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var fi=ie((zf,ac)=>{ac.exports={name:"@prisma/engines-version",version:"6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"0302bd9e49a13a657a302c060e529d54b08fad04"},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 gi=ie(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.enginesVersion=void 0;Kt.enginesVersion=fi().prisma.enginesVersion});var ps=ie((hg,cs)=>{"use strict";cs.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var xi=ie((bg,fs)=>{"use strict";fs.exports=(e,r=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof r!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if(typeof t.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(r===0)return e;let n=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,t.indent.repeat(r))}});var Es=ie((Pg,ys)=>{"use strict";ys.exports=({onlyFirst:e=!1}={})=>{let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}});var Ri=ie((vg,bs)=>{"use strict";var yc=Es();bs.exports=e=>typeof e=="string"?e.replace(yc(),""):e});var ws=ie((Cg,Ec)=>{Ec.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var Ts=ie((Ag,Le)=>{"use strict";var Ci=require("fs"),Ai=require("path"),bc=require("os"),wc=require("crypto"),xc=ws(),Ii=xc.version,Pc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function vc(e){let r={},t=e.toString();t=t.replace(/\r\n?/mg,`
2
- `);let n;for(;(n=Pc.exec(t))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
3
- `),o=o.replace(/\\r/g,"\r")),r[i]=o}return r}function Tc(e){let r=vs(e),t=U.configDotenv({path:r});if(!t.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${r} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=Ps(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=Cc(t,a);o=U.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return U.parse(o)}function Rc(e){console.log(`[dotenv@${Ii}][INFO] ${e}`)}function Sc(e){console.log(`[dotenv@${Ii}][WARN] ${e}`)}function Zt(e){console.log(`[dotenv@${Ii}][DEBUG] ${e}`)}function Ps(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Cc(e,r){let t;try{t=new URL(r)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=t.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=t.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function vs(e){let r=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let t of e.path)Ci.existsSync(t)&&(r=t.endsWith(".vault")?t:`${t}.vault`);else r=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else r=Ai.resolve(process.cwd(),".env.vault");return Ci.existsSync(r)?r:null}function xs(e){return e[0]==="~"?Ai.join(bc.homedir(),e.slice(1)):e}function Ac(e){Rc("Loading env from encrypted .env.vault");let r=U._parseVault(e),t=process.env;return e&&e.processEnv!=null&&(t=e.processEnv),U.populate(t,r,e),{parsed:r}}function Ic(e){let r=Ai.resolve(process.cwd(),".env"),t="utf8",n=!!(e&&e.debug);e&&e.encoding?t=e.encoding:n&&Zt("No encoding is specified. UTF-8 is used by default");let i=[r];if(e&&e.path)if(!Array.isArray(e.path))i=[xs(e.path)];else{i=[];for(let l of e.path)i.push(xs(l))}let o,s={};for(let l of i)try{let u=U.parse(Ci.readFileSync(l,{encoding:t}));U.populate(s,u,e)}catch(u){n&&Zt(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),U.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function kc(e){if(Ps(e).length===0)return U.configDotenv(e);let r=vs(e);return r?U._configVault(e):(Sc(`You set DOTENV_KEY but you are missing a .env.vault file at ${r}. Did you forget to build it?`),U.configDotenv(e))}function Oc(e,r){let t=Buffer.from(r.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=wc.createDecipheriv("aes-256-gcm",t,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function _c(e,r,t={}){let n=!!(t&&t.debug),i=!!(t&&t.override);if(typeof r!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(r))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=r[o]),n&&Zt(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=r[o]}var U={configDotenv:Ic,_configVault:Ac,_parseVault:Tc,config:kc,decrypt:Oc,parse:vc,populate:_c};Le.exports.configDotenv=U.configDotenv;Le.exports._configVault=U._configVault;Le.exports._parseVault=U._parseVault;Le.exports.config=U.config;Le.exports.decrypt=U.decrypt;Le.exports.parse=U.parse;Le.exports.populate=U.populate;Le.exports=U});var As=ie((Ng,en)=>{"use strict";en.exports=(e={})=>{let r;if(e.repoUrl)r=e.repoUrl;else if(e.user&&e.repo)r=`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 t=new URL(`${r}/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(",")}t.searchParams.set(i,o)}}return t.toString()};en.exports.default=en.exports});var Vi=ie((cy,Zs)=>{"use strict";Zs.exports=function(){function e(r,t,n,i,o){return r<t||n<t?r>n?n+1:r+1:i===o?t:t+1}return function(r,t){if(r===t)return 0;if(r.length>t.length){var n=r;r=t,t=n}for(var i=r.length,o=t.length;i>0&&r.charCodeAt(i-1)===t.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&r.charCodeAt(s)===t.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,d,f,g,h,I,T,S,E,k=[];for(l=0;l<i;l++)k.push(l+1),k.push(r.charCodeAt(s+l));for(var fe=k.length-1;a<o-3;)for(I=t.charCodeAt(s+(u=a)),T=t.charCodeAt(s+(c=a+1)),S=t.charCodeAt(s+(p=a+2)),E=t.charCodeAt(s+(d=a+3)),f=a+=4,l=0;l<fe;l+=2)g=k[l],h=k[l+1],u=e(g,u,c,I,h),c=e(u,c,p,T,h),p=e(c,p,d,S,h),f=e(p,d,f,E,h),k[l]=f,d=p,p=c,c=u,u=g;for(;a<o;)for(I=t.charCodeAt(s+(u=a)),f=++a,l=0;l<fe;l+=2)g=k[l],k[l]=f=e(g,u,f,I,k[l+1]),u=g;return f}}()});var na=Co(()=>{"use strict"});var ia=Co(()=>{"use strict"});var nf={};Jr(nf,{Debug:()=>Xn,Decimal:()=>ve,Extensions:()=>Kn,MetricsClient:()=>Dr,PrismaClientInitializationError:()=>R,PrismaClientKnownRequestError:()=>Z,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>j,PrismaClientValidationError:()=>X,Public:()=>Yn,Sql:()=>se,createParam:()=>wa,defineDmmfProperty:()=>Sa,deserializeJsonResponse:()=>vr,deserializeRawResult:()=>Jn,dmmfToRuntimeDataModel:()=>Gs,empty:()=>Ia,getPrismaClient:()=>lu,getRuntime:()=>Ln,join:()=>Aa,makeStrictEnum:()=>uu,makeTypedQueryFactory:()=>Ca,objectEnumValues:()=>xn,raw:()=>Ki,serializeJsonQuery:()=>An,skip:()=>Cn,sqltag:()=>Yi,warnEnvConflicts:()=>cu,warnOnce:()=>tt});module.exports=hu(nf);var Kn={};Jr(Kn,{defineExtension:()=>Io,getExtensionContext:()=>ko});function Io(e){return typeof e=="function"?e:r=>r.$extends(e)}function ko(e){return e}var Yn={};Jr(Yn,{validator:()=>Oo});function Oo(...e){return r=>r}var $t={};Jr($t,{$:()=>Fo,bgBlack:()=>Su,bgBlue:()=>ku,bgCyan:()=>_u,bgGreen:()=>Au,bgMagenta:()=>Ou,bgRed:()=>Cu,bgWhite:()=>Du,bgYellow:()=>Iu,black:()=>Pu,blue:()=>nr,bold:()=>W,cyan:()=>_e,dim:()=>ke,gray:()=>Wr,green:()=>Ve,grey:()=>Ru,hidden:()=>wu,inverse:()=>bu,italic:()=>Eu,magenta:()=>vu,red:()=>pe,reset:()=>yu,strikethrough:()=>xu,underline:()=>z,white:()=>Tu,yellow:()=>Oe});var zn,_o,Do,No,Lo=!0;typeof process<"u"&&({FORCE_COLOR:zn,NODE_DISABLE_COLORS:_o,NO_COLOR:Do,TERM:No}=process.env||{},Lo=process.stdout&&process.stdout.isTTY);var Fo={enabled:!_o&&Do==null&&No!=="dumb"&&(zn!=null&&zn!=="0"||Lo)};function M(e,r){let t=new RegExp(`\\x1b\\[${r}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${r}m`;return function(o){return!Fo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(t,i+n):o)+i}}var yu=M(0,0),W=M(1,22),ke=M(2,22),Eu=M(3,23),z=M(4,24),bu=M(7,27),wu=M(8,28),xu=M(9,29),Pu=M(30,39),pe=M(31,39),Ve=M(32,39),Oe=M(33,39),nr=M(34,39),vu=M(35,39),_e=M(36,39),Tu=M(37,39),Wr=M(90,39),Ru=M(90,39),Su=M(40,49),Cu=M(41,49),Au=M(42,49),Iu=M(43,49),ku=M(44,49),Ou=M(45,49),_u=M(46,49),Du=M(47,49);var Nu=100,Mo=["green","yellow","blue","magenta","cyan","red"],Hr=[],$o=Date.now(),Lu=0,Zn=typeof process<"u"?process.env:{};globalThis.DEBUG??=Zn.DEBUG??"";globalThis.DEBUG_COLORS??=Zn.DEBUG_COLORS?Zn.DEBUG_COLORS==="true":!0;var Kr={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let r=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),t=r.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=r.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return t&&!n},log:(...e)=>{let[r,t,...n]=e;(console.warn??console.log)(`${r} ${t}`,...n)},formatters:{}};function Fu(e){let r={color:Mo[Lu++%Mo.length],enabled:Kr.enabled(e),namespace:e,log:Kr.log,extend:()=>{}},t=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=r;if(n.length!==0&&Hr.push([o,...n]),Hr.length>Nu&&Hr.shift(),Kr.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Mu(c)),u=`+${Date.now()-$o}ms`;$o=Date.now(),globalThis.DEBUG_COLORS?a($t[s](W(o)),...l,$t[s](u)):a(o,...l,u)}};return new Proxy(t,{get:(n,i)=>r[i],set:(n,i,o)=>r[i]=o})}var Xn=new Proxy(Fu,{get:(e,r)=>Kr[r],set:(e,r,t)=>Kr[r]=t});function Mu(e,r=2){let t=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(t.has(i))return"[Circular *]";t.add(i)}else if(typeof i=="bigint")return i.toString();return i},r)}function qo(e=7500){let r=Hr.map(([t,...n])=>`${t} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
- `);return r.length<e?r:r.slice(-e)}function Vo(){Hr.length=0}var L=Xn;var jo=O(require("fs"));function ei(){let e=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(e&&jo.default.existsSync(e))&&process.arch==="ia32")throw new Error('The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set `engineType = "binary"` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)')}var ri=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];var qt="libquery_engine";function Vt(e,r){let t=r==="url";return e.includes("windows")?t?"query_engine.dll.node":`query_engine-${e}.dll.node`:e.includes("darwin")?t?`${qt}.dylib.node`:`${qt}-${e}.dylib.node`:t?`${qt}.so.node`:`${qt}-${e}.so.node`}var Go=O(require("child_process")),si=O(require("fs/promises")),Gt=O(require("os"));var De=Symbol.for("@ts-pattern/matcher"),$u=Symbol.for("@ts-pattern/isVariadic"),Bt="@ts-pattern/anonymous-select-key",ti=e=>!!(e&&typeof e=="object"),jt=e=>e&&!!e[De],we=(e,r,t)=>{if(jt(e)){let n=e[De](),{matched:i,selections:o}=n.match(r);return i&&o&&Object.keys(o).forEach(s=>t(s,o[s])),i}if(ti(e)){if(!ti(r))return!1;if(Array.isArray(e)){if(!Array.isArray(r))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];jt(a)&&a[$u]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(r.length<n.length+i.length)return!1;let s=r.slice(0,n.length),a=i.length===0?[]:r.slice(-i.length),l=r.slice(n.length,i.length===0?1/0:-i.length);return n.every((u,c)=>we(u,s[c],t))&&i.every((u,c)=>we(u,a[c],t))&&(o.length===0||we(o[0],l,t))}return e.length===r.length&&e.every((s,a)=>we(s,r[a],t))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in r||jt(o=i)&&o[De]().matcherType==="optional")&&we(i,r[n],t);var o})}return Object.is(r,e)},Ge=e=>{var r,t,n;return ti(e)?jt(e)?(r=(t=(n=e[De]()).getSelectionKeys)==null?void 0:t.call(n))!=null?r:[]:Array.isArray(e)?Yr(e,Ge):Yr(Object.values(e),Ge):[]},Yr=(e,r)=>e.reduce((t,n)=>t.concat(r(n)),[]);function de(e){return Object.assign(e,{optional:()=>qu(e),and:r=>V(e,r),or:r=>Vu(e,r),select:r=>r===void 0?Bo(e):Bo(r,e)})}function qu(e){return de({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return r===void 0?(Ge(e).forEach(i=>n(i,void 0)),{matched:!0,selections:t}):{matched:we(e,r,n),selections:t}},getSelectionKeys:()=>Ge(e),matcherType:"optional"})})}function V(...e){return de({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return{matched:e.every(i=>we(i,r,n)),selections:t}},getSelectionKeys:()=>Yr(e,Ge),matcherType:"and"})})}function Vu(...e){return de({[De]:()=>({match:r=>{let t={},n=(i,o)=>{t[i]=o};return Yr(e,Ge).forEach(i=>n(i,void 0)),{matched:e.some(i=>we(i,r,n)),selections:t}},getSelectionKeys:()=>Yr(e,Ge),matcherType:"or"})})}function A(e){return{[De]:()=>({match:r=>({matched:!!e(r)})})}}function Bo(...e){let r=typeof e[0]=="string"?e[0]:void 0,t=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return de({[De]:()=>({match:n=>{let i={[r??Bt]:n};return{matched:t===void 0||we(t,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[r??Bt].concat(t===void 0?[]:Ge(t))})})}function Ee(e){return typeof e=="number"}function je(e){return typeof e=="string"}function Be(e){return typeof e=="bigint"}var yf=de(A(function(e){return!0}));var Ue=e=>Object.assign(de(e),{startsWith:r=>{return Ue(V(e,(t=r,A(n=>je(n)&&n.startsWith(t)))));var t},endsWith:r=>{return Ue(V(e,(t=r,A(n=>je(n)&&n.endsWith(t)))));var t},minLength:r=>Ue(V(e,(t=>A(n=>je(n)&&n.length>=t))(r))),length:r=>Ue(V(e,(t=>A(n=>je(n)&&n.length===t))(r))),maxLength:r=>Ue(V(e,(t=>A(n=>je(n)&&n.length<=t))(r))),includes:r=>{return Ue(V(e,(t=r,A(n=>je(n)&&n.includes(t)))));var t},regex:r=>{return Ue(V(e,(t=r,A(n=>je(n)&&!!n.match(t)))));var t}}),Ef=Ue(A(je)),be=e=>Object.assign(de(e),{between:(r,t)=>be(V(e,((n,i)=>A(o=>Ee(o)&&n<=o&&i>=o))(r,t))),lt:r=>be(V(e,(t=>A(n=>Ee(n)&&n<t))(r))),gt:r=>be(V(e,(t=>A(n=>Ee(n)&&n>t))(r))),lte:r=>be(V(e,(t=>A(n=>Ee(n)&&n<=t))(r))),gte:r=>be(V(e,(t=>A(n=>Ee(n)&&n>=t))(r))),int:()=>be(V(e,A(r=>Ee(r)&&Number.isInteger(r)))),finite:()=>be(V(e,A(r=>Ee(r)&&Number.isFinite(r)))),positive:()=>be(V(e,A(r=>Ee(r)&&r>0))),negative:()=>be(V(e,A(r=>Ee(r)&&r<0)))}),bf=be(A(Ee)),Qe=e=>Object.assign(de(e),{between:(r,t)=>Qe(V(e,((n,i)=>A(o=>Be(o)&&n<=o&&i>=o))(r,t))),lt:r=>Qe(V(e,(t=>A(n=>Be(n)&&n<t))(r))),gt:r=>Qe(V(e,(t=>A(n=>Be(n)&&n>t))(r))),lte:r=>Qe(V(e,(t=>A(n=>Be(n)&&n<=t))(r))),gte:r=>Qe(V(e,(t=>A(n=>Be(n)&&n>=t))(r))),positive:()=>Qe(V(e,A(r=>Be(r)&&r>0))),negative:()=>Qe(V(e,A(r=>Be(r)&&r<0)))}),wf=Qe(A(Be)),xf=de(A(function(e){return typeof e=="boolean"})),Pf=de(A(function(e){return typeof e=="symbol"})),vf=de(A(function(e){return e==null})),Tf=de(A(function(e){return e!=null}));var ni=class extends Error{constructor(r){let t;try{t=JSON.stringify(r)}catch{t=r}super(`Pattern matching error: no pattern matches value ${t}`),this.input=void 0,this.input=r}},ii={matched:!1,value:void 0};function gr(e){return new oi(e,ii)}var oi=class e{constructor(r,t){this.input=void 0,this.state=void 0,this.input=r,this.state=t}with(...r){if(this.state.matched)return this;let t=r[r.length-1],n=[r[0]],i;r.length===3&&typeof r[1]=="function"?i=r[1]:r.length>2&&n.push(...r.slice(1,r.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>we(u,this.input,a))||i&&!i(this.input)?ii:{matched:!0,value:t(o?Bt in s?s[Bt]:s:this.input,this.input)};return new e(this.input,l)}when(r,t){if(this.state.matched)return this;let n=!!r(this.input);return new e(this.input,n?{matched:!0,value:t(this.input,this.input)}:ii)}otherwise(r){return this.state.matched?this.state.value:r(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ni(this.input)}run(){return this.exhaustive()}returnType(){return this}};var Jo=require("util");var ju={warn:Oe("prisma:warn")},Bu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Ut(e,...r){Bu.warn()&&console.warn(`${ju.warn} ${e}`,...r)}var Uu=(0,Jo.promisify)(Go.default.exec),re=L("prisma:get-platform"),Qu=["1.0.x","1.1.x","3.0.x"];async function Wo(){let e=Gt.default.platform(),r=process.arch;if(e==="freebsd"){let s=await Jt("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:r}}}if(e!=="linux")return{platform:e,arch:r};let t=await Ju(),n=await ec(),i=Hu({arch:r,archFromUname:n,familyDistro:t.familyDistro}),{libssl:o}=await Ku(i);return{platform:"linux",libssl:o,arch:r,archFromUname:n,...t}}function Gu(e){let r=/^ID="?([^"\n]*)"?$/im,t=/^ID_LIKE="?([^"\n]*)"?$/im,n=r.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=t.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=gr({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return re(`Found distro info:
5
- ${JSON.stringify(a,null,2)}`),a}async function Ju(){let e="/etc/os-release";try{let r=await si.default.readFile(e,{encoding:"utf-8"});return Gu(r)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function Wu(e){let r=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(r){let t=`${r[1]}.x`;return Ho(t)}}function Uo(e){let r=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(r){let t=`${r[1]}${r[2]??".0"}.x`;return Ho(t)}}function Ho(e){let r=(()=>{if(Yo(e))return e;let t=e.split(".");return t[1]="0",t.join(".")})();if(Qu.includes(r))return r}function Hu(e){return gr(e).with({familyDistro:"musl"},()=>(re('Trying platform-specific paths for "alpine"'),["/lib","/usr/lib"])).with({familyDistro:"debian"},({archFromUname:r})=>(re('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${r}-linux-gnu`,`/lib/${r}-linux-gnu`])).with({familyDistro:"rhel"},()=>(re('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:r,arch:t,archFromUname:n})=>(re(`Don't know any platform-specific paths for "${r}" on ${t} (${n})`),[]))}async function Ku(e){let r='grep -v "libssl.so.0"',t=await Qo(e);if(t){re(`Found libssl.so file using platform-specific paths: ${t}`);let o=Uo(t);if(re(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}re('Falling back to "ldconfig" and other generic paths');let n=await Jt(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${r}`);if(n||(n=await Qo(["/lib64","/usr/lib64","/lib","/usr/lib"])),n){re(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=Uo(n);if(re(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Jt("openssl version -v");if(i){re(`Found openssl binary with version: ${i}`);let o=Wu(i);if(re(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return re("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Qo(e){for(let r of e){let t=await Yu(r);if(t)return t}}async function Yu(e){try{return(await si.default.readdir(e)).find(t=>t.startsWith("libssl.so.")&&!t.startsWith("libssl.so.0"))}catch(r){if(r.code==="ENOENT")return;throw r}}async function ir(){let{binaryTarget:e}=await Ko();return e}function zu(e){return e.binaryTarget!==void 0}async function ai(){let{memoized:e,...r}=await Ko();return r}var Qt={};async function Ko(){if(zu(Qt))return Promise.resolve({...Qt,memoized:!0});let e=await Wo(),r=Zu(e);return Qt={...e,binaryTarget:r},{...Qt,memoized:!1}}function Zu(e){let{platform:r,arch:t,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;r==="linux"&&!["x64","arm64"].includes(t)&&Ut(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${t}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(r==="linux"&&i===void 0){let c=gr({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");Ut(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}".
6
- ${c}`)}let u="debian";if(r==="linux"&&o===void 0&&re(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),r==="darwin"&&t==="arm64")return"darwin-arm64";if(r==="darwin")return"darwin";if(r==="win32")return"windows";if(r==="freebsd")return o;if(r==="openbsd")return"openbsd";if(r==="netbsd")return"netbsd";if(r==="linux"&&o==="nixos")return"linux-nixos";if(r==="linux"&&t==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(r==="linux"&&t==="arm")return`linux-arm-openssl-${i||l}`;if(r==="linux"&&o==="musl"){let c="linux-musl";return!i||Yo(i)?c:`${c}-openssl-${i}`}return r==="linux"&&o&&i?`${o}-openssl-${i}`:(r!=="linux"&&Ut(`Prisma detected unknown OS "${r}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function Xu(e){try{return await e()}catch{return}}function Jt(e){return Xu(async()=>{let r=await Uu(e);return re(`Command "${e}" successfully returned "${r.stdout}"`),r.stdout})}async function ec(){return typeof Gt.default.machine=="function"?Gt.default.machine():(await Jt("uname -m"))?.trim()}function Yo(e){return e.startsWith("1.")}var _="\x1B[",zr="\x1B]",hr="\x07",Wt=";",zo=process.env.TERM_PROGRAM==="Apple_Terminal",v={};v.cursorTo=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof r!="number"?_+(e+1)+"G":_+(r+1)+";"+(e+1)+"H"};v.cursorMove=(e,r)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let t="";return e<0?t+=_+-e+"D":e>0&&(t+=_+e+"C"),r<0?t+=_+-r+"A":r>0&&(t+=_+r+"B"),t};v.cursorUp=(e=1)=>_+e+"A";v.cursorDown=(e=1)=>_+e+"B";v.cursorForward=(e=1)=>_+e+"C";v.cursorBackward=(e=1)=>_+e+"D";v.cursorLeft=_+"G";v.cursorSavePosition=zo?"\x1B7":_+"s";v.cursorRestorePosition=zo?"\x1B8":_+"u";v.cursorGetPosition=_+"6n";v.cursorNextLine=_+"E";v.cursorPrevLine=_+"F";v.cursorHide=_+"?25l";v.cursorShow=_+"?25h";v.eraseLines=e=>{let r="";for(let t=0;t<e;t++)r+=v.eraseLine+(t<e-1?v.cursorUp():"");return e&&(r+=v.cursorLeft),r};v.eraseEndLine=_+"K";v.eraseStartLine=_+"1K";v.eraseLine=_+"2K";v.eraseDown=_+"J";v.eraseUp=_+"1J";v.eraseScreen=_+"2J";v.scrollUp=_+"S";v.scrollDown=_+"T";v.clearScreen="\x1Bc";v.clearTerminal=process.platform==="win32"?`${v.eraseScreen}${_}0f`:`${v.eraseScreen}${_}3J${_}H`;v.beep=hr;v.link=(e,r)=>[zr,"8",Wt,Wt,r,hr,e,zr,"8",Wt,Wt,hr].join("");v.image=(e,r={})=>{let t=`${zr}1337;File=inline=1`;return r.width&&(t+=`;width=${r.width}`),r.height&&(t+=`;height=${r.height}`),r.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0"),t+":"+e.toString("base64")+hr};v.iTerm={setCwd:(e=process.cwd())=>`${zr}50;CurrentDir=${e}${hr}`,annotation:(e,r={})=>{let t=`${zr}1337;`,n=typeof r.x<"u",i=typeof r.y<"u";if((n||i)&&!(n&&i&&typeof r.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),t+=r.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",r.length>0?t+=(n?[e,r.length,r.x,r.y]:[r.length,e]).join("|"):t+=e,t+hr}};var Zo=v;var Ht=O(os(),1);function or(e,r,{target:t="stdout",...n}={}){return Ht.default[t]?Zo.link(e,r):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,r):`${e} (\u200B${r}\u200B)`}or.isSupported=Ht.default.stdout;or.stderr=(e,r,t={})=>or(e,r,{target:"stderr",...t});or.stderr.isSupported=Ht.default.stderr;function di(e){return or(e,e,{fallback:z})}var oc=ss(),mi=oc.version;var as="library";function Er(e){let r=sc();return r||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":as)}function sc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}var lc=O(gi());var $=O(require("path")),uc=O(gi()),ag=L("prisma:engines");function ls(){return $.default.join(__dirname,"../")}var lg="libquery-engine";$.default.join(__dirname,"../query-engine-darwin");$.default.join(__dirname,"../query-engine-darwin-arm64");$.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");$.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");$.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");$.default.join(__dirname,"../query-engine-linux-static-x64");$.default.join(__dirname,"../query-engine-linux-static-arm64");$.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");$.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");$.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");$.default.join(__dirname,"../libquery_engine-darwin.dylib.node");$.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-musl.so.node");$.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");$.default.join(__dirname,"../query_engine-windows.dll.node");var hi=O(require("fs")),us=L("chmodPlusX");function yi(e){if(process.platform==="win32")return;let r=hi.default.statSync(e),t=r.mode|64|8|1;if(r.mode===t){us(`Execution permissions of ${e} are fine`);return}let n=t.toString(8).slice(-3);us(`Have to call chmodPlusX on ${e}`),hi.default.chmodSync(e,n)}function Ei(e){let r=e.e,t=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=r.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${di("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${ke(e.id)}\`).`,s=gr({message:r.message,code:r.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${t("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${t("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${t("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o}
1
+ "use strict";var lu=Object.create;var Mr=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty;var ie=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Jt=(e,t)=>{for(var r in t)Mr(e,r,{get:t[r],enumerable:!0})},Co=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!du.call(e,i)&&i!==r&&Mr(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var O=(e,t,r)=>(r=e!=null?lu(pu(e)):{},Co(t||!e||!e.__esModule?Mr(r,"default",{value:e,enumerable:!0}):r,e)),mu=e=>Co(Mr({},"__esModule",{value:!0}),e);var li=ie((Of,Zo)=>{"use strict";Zo.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var ts=ie((_f,es)=>{"use strict";var Zu=require("os"),Xo=require("tty"),me=li(),{env:G}=process,Je;me("no-color")||me("no-colors")||me("color=false")||me("color=never")?Je=0:(me("color")||me("colors")||me("color=true")||me("color=always"))&&(Je=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?Je=1:G.FORCE_COLOR==="false"?Je=0:Je=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function ui(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ci(e,t){if(Je===0)return 0;if(me("color=16m")||me("color=full")||me("color=truecolor"))return 3;if(me("color=256"))return 2;if(e&&!t&&Je===void 0)return 0;let r=Je||0;if(G.TERM==="dumb")return r;if(process.platform==="win32"){let n=Zu.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in G)||G.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let n=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:r}function Xu(e){let t=ci(e,e&&e.isTTY);return ui(t)}es.exports={supportsColor:Xu,stdout:ui(ci(!0,Xo.isatty(1))),stderr:ui(ci(!0,Xo.isatty(2)))}});var is=ie((Df,ns)=>{"use strict";var ec=ts(),ht=li();function rs(e){if(/^\d{3,4}$/.test(e)){let r=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(r[1],10),patch:parseInt(r[2],10)}}let t=(e||"").split(".").map(r=>parseInt(r,10));return{major:t[0],minor:t[1],patch:t[2]}}function pi(e){let{env:t}=process;if("FORCE_HYPERLINK"in t)return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0);if(ht("no-hyperlink")||ht("no-hyperlinks")||ht("hyperlink=false")||ht("hyperlink=never"))return!1;if(ht("hyperlink=true")||ht("hyperlink=always")||"NETLIFY"in t)return!0;if(!ec.supportsColor(e)||e&&!e.isTTY||process.platform==="win32"||"CI"in t||"TEAMCITY_VERSION"in t)return!1;if("TERM_PROGRAM"in t){let r=rs(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":return r.major===3?r.minor>=1:r.major>3;case"WezTerm":return r.major>=20200620;case"vscode":return r.major>1||r.major===1&&r.minor>=72}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0")return!1;let r=rs(t.VTE_VERSION);return r.major>0||r.minor>=50}return!1}ns.exports={supportsHyperlink:pi,stdout:pi(process.stdout),stderr:pi(process.stderr)}});var os=ie((Jf,tc)=>{tc.exports={name:"@prisma/internals",version:"6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.2",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@antfu/ni":"0.21.12","@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.4.7",esbuild:"0.24.2","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"3.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var fi=ie((Kf,ic)=>{ic.exports={name:"@prisma/engines-version",version:"6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"0302bd9e49a13a657a302c060e529d54b08fad04"},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 gi=ie(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.enginesVersion=void 0;Kr.enginesVersion=fi().prisma.enginesVersion});var cs=ie((fg,us)=>{"use strict";us.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var Pi=ie((Eg,ms)=>{"use strict";ms.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 ys=ie((xg,hs)=>{"use strict";hs.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Si=ie((Pg,Es)=>{"use strict";var fc=ys();Es.exports=e=>typeof e=="string"?e.replace(fc(),""):e});var bs=ie((Rg,gc)=>{gc.exports={name:"dotenv",version:"16.4.7",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var vs=ie((Sg,Le)=>{"use strict";var Ci=require("fs"),Ai=require("path"),hc=require("os"),yc=require("crypto"),Ec=bs(),Ii=Ec.version,bc=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function wc(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
2
+ `);let n;for(;(n=bc.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
3
+ `),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function xc(e){let t=Ps(e),r=U.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=xs(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=Tc(r,a);o=U.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return U.parse(o)}function Pc(e){console.log(`[dotenv@${Ii}][INFO] ${e}`)}function vc(e){console.log(`[dotenv@${Ii}][WARN] ${e}`)}function Zr(e){console.log(`[dotenv@${Ii}][DEBUG] ${e}`)}function xs(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function Tc(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function Ps(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Ci.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Ai.resolve(process.cwd(),".env.vault");return Ci.existsSync(t)?t:null}function ws(e){return e[0]==="~"?Ai.join(hc.homedir(),e.slice(1)):e}function Rc(e){Pc("Loading env from encrypted .env.vault");let t=U._parseVault(e),r=process.env;return e&&e.processEnv!=null&&(r=e.processEnv),U.populate(r,t,e),{parsed:t}}function Sc(e){let t=Ai.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Zr("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[ws(e.path)];else{i=[];for(let l of e.path)i.push(ws(l))}let o,s={};for(let l of i)try{let u=U.parse(Ci.readFileSync(l,{encoding:r}));U.populate(s,u,e)}catch(u){n&&Zr(`Failed to load ${l} ${u.message}`),o=u}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),U.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function Cc(e){if(xs(e).length===0)return U.configDotenv(e);let t=Ps(e);return t?U._configVault(e):(vc(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),U.configDotenv(e))}function Ac(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=yc.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function Ic(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&Zr(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var U={configDotenv:Sc,_configVault:Rc,_parseVault:xc,config:Cc,decrypt:Ac,parse:wc,populate:Ic};Le.exports.configDotenv=U.configDotenv;Le.exports._configVault=U._configVault;Le.exports._parseVault=U._parseVault;Le.exports.config=U.config;Le.exports.decrypt=U.decrypt;Le.exports.parse=U.parse;Le.exports.populate=U.populate;Le.exports=U});var Cs=ie((_g,en)=>{"use strict";en.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()};en.exports.default=en.exports});var Vi=ie((Jh,Ks)=>{"use strict";Ks.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,f,g,h,I,T,S,E,k=[];for(l=0;l<i;l++)k.push(l+1),k.push(t.charCodeAt(s+l));for(var fe=k.length-1;a<o-3;)for(I=r.charCodeAt(s+(u=a)),T=r.charCodeAt(s+(c=a+1)),S=r.charCodeAt(s+(p=a+2)),E=r.charCodeAt(s+(d=a+3)),f=a+=4,l=0;l<fe;l+=2)g=k[l],h=k[l+1],u=e(g,u,c,I,h),c=e(u,c,p,T,h),p=e(c,p,d,S,h),f=e(p,d,f,E,h),k[l]=f,d=p,p=c,c=u,u=g;for(;a<o;)for(I=r.charCodeAt(s+(u=a)),f=++a,l=0;l<fe;l+=2)g=k[l],k[l]=f=e(g,u,f,I,k[l+1]),u=g;return f}}()});var tf={};Jt(tf,{Debug:()=>Xn,Decimal:()=>ve,Extensions:()=>Kn,MetricsClient:()=>Dt,PrismaClientInitializationError:()=>R,PrismaClientKnownRequestError:()=>Z,PrismaClientRustPanicError:()=>ue,PrismaClientUnknownRequestError:()=>j,PrismaClientValidationError:()=>X,Public:()=>Yn,Sql:()=>se,createParam:()=>ha,defineDmmfProperty:()=>va,deserializeJsonResponse:()=>Pt,deserializeRawResult:()=>Jn,dmmfToRuntimeDataModel:()=>Pa,empty:()=>Sa,getPrismaClient:()=>ou,getRuntime:()=>Ln,join:()=>Ra,makeStrictEnum:()=>su,makeTypedQueryFactory:()=>Ta,objectEnumValues:()=>xn,raw:()=>Ki,serializeJsonQuery:()=>An,skip:()=>Cn,sqltag:()=>Yi,warnEnvConflicts:()=>au,warnOnce:()=>rr});module.exports=mu(tf);var Kn={};Jt(Kn,{defineExtension:()=>Ao,getExtensionContext:()=>Io});function Ao(e){return typeof e=="function"?e:t=>t.$extends(e)}function Io(e){return e}var Yn={};Jt(Yn,{validator:()=>ko});function ko(...e){return t=>t}var $r={};Jt($r,{$:()=>Lo,bgBlack:()=>vu,bgBlue:()=>Cu,bgCyan:()=>Iu,bgGreen:()=>Ru,bgMagenta:()=>Au,bgRed:()=>Tu,bgWhite:()=>ku,bgYellow:()=>Su,black:()=>bu,blue:()=>rt,bold:()=>W,cyan:()=>_e,dim:()=>ke,gray:()=>Wt,green:()=>Ve,grey:()=>Pu,hidden:()=>yu,inverse:()=>hu,italic:()=>gu,magenta:()=>wu,red:()=>pe,reset:()=>fu,strikethrough:()=>Eu,underline:()=>z,white:()=>xu,yellow:()=>Oe});var zn,Oo,_o,Do,No=!0;typeof process<"u"&&({FORCE_COLOR:zn,NODE_DISABLE_COLORS:Oo,NO_COLOR:_o,TERM:Do}=process.env||{},No=process.stdout&&process.stdout.isTTY);var Lo={enabled:!Oo&&_o==null&&Do!=="dumb"&&(zn!=null&&zn!=="0"||No)};function M(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Lo.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var fu=M(0,0),W=M(1,22),ke=M(2,22),gu=M(3,23),z=M(4,24),hu=M(7,27),yu=M(8,28),Eu=M(9,29),bu=M(30,39),pe=M(31,39),Ve=M(32,39),Oe=M(33,39),rt=M(34,39),wu=M(35,39),_e=M(36,39),xu=M(37,39),Wt=M(90,39),Pu=M(90,39),vu=M(40,49),Tu=M(41,49),Ru=M(42,49),Su=M(43,49),Cu=M(44,49),Au=M(45,49),Iu=M(46,49),ku=M(47,49);var Ou=100,Fo=["green","yellow","blue","magenta","cyan","red"],Ht=[],Mo=Date.now(),_u=0,Zn=typeof process<"u"?process.env:{};globalThis.DEBUG??=Zn.DEBUG??"";globalThis.DEBUG_COLORS??=Zn.DEBUG_COLORS?Zn.DEBUG_COLORS==="true":!0;var Kt={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 Du(e){let t={color:Fo[_u++%Fo.length],enabled:Kt.enabled(e),namespace:e,log:Kt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Ht.push([o,...n]),Ht.length>Ou&&Ht.shift(),Kt.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Nu(c)),u=`+${Date.now()-Mo}ms`;Mo=Date.now(),globalThis.DEBUG_COLORS?a($r[s](W(o)),...l,$r[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var Xn=new Proxy(Du,{get:(e,t)=>Kt[t],set:(e,t,r)=>Kt[t]=r});function Nu(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 $o(e=7500){let t=Ht.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
4
+ `);return t.length<e?t:t.slice(-e)}function qo(){Ht.length=0}var L=Xn;var Vo=O(require("fs"));function ei(){let e=process.env.PRISMA_QUERY_ENGINE_LIBRARY;if(!(e&&Vo.default.existsSync(e))&&process.arch==="ia32")throw new Error('The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set `engineType = "binary"` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)')}var ti=["darwin","darwin-arm64","debian-openssl-1.0.x","debian-openssl-1.1.x","debian-openssl-3.0.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","rhel-openssl-3.0.x","linux-arm64-openssl-1.1.x","linux-arm64-openssl-1.0.x","linux-arm64-openssl-3.0.x","linux-arm-openssl-1.1.x","linux-arm-openssl-1.0.x","linux-arm-openssl-3.0.x","linux-musl","linux-musl-openssl-3.0.x","linux-musl-arm64-openssl-1.1.x","linux-musl-arm64-openssl-3.0.x","linux-nixos","linux-static-x64","linux-static-arm64","windows","freebsd11","freebsd12","freebsd13","freebsd14","freebsd15","openbsd","netbsd","arm"];var qr="libquery_engine";function Vr(e,t){let r=t==="url";return e.includes("windows")?r?"query_engine.dll.node":`query_engine-${e}.dll.node`:e.includes("darwin")?r?`${qr}.dylib.node`:`${qr}-${e}.dylib.node`:r?`${qr}.so.node`:`${qr}-${e}.so.node`}var Qo=O(require("child_process")),si=O(require("fs/promises")),Gr=O(require("os"));var De=Symbol.for("@ts-pattern/matcher"),Lu=Symbol.for("@ts-pattern/isVariadic"),Br="@ts-pattern/anonymous-select-key",ri=e=>!!(e&&typeof e=="object"),jr=e=>e&&!!e[De],we=(e,t,r)=>{if(jr(e)){let n=e[De](),{matched:i,selections:o}=n.match(t);return i&&o&&Object.keys(o).forEach(s=>r(s,o[s])),i}if(ri(e)){if(!ri(t))return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=[],i=[],o=[];for(let s of e.keys()){let a=e[s];jr(a)&&a[Lu]?o.push(a):o.length?i.push(a):n.push(a)}if(o.length){if(o.length>1)throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");if(t.length<n.length+i.length)return!1;let s=t.slice(0,n.length),a=i.length===0?[]:t.slice(-i.length),l=t.slice(n.length,i.length===0?1/0:-i.length);return n.every((u,c)=>we(u,s[c],r))&&i.every((u,c)=>we(u,a[c],r))&&(o.length===0||we(o[0],l,r))}return e.length===t.length&&e.every((s,a)=>we(s,t[a],r))}return Reflect.ownKeys(e).every(n=>{let i=e[n];return(n in t||jr(o=i)&&o[De]().matcherType==="optional")&&we(i,t[n],r);var o})}return Object.is(t,e)},Ge=e=>{var t,r,n;return ri(e)?jr(e)?(t=(r=(n=e[De]()).getSelectionKeys)==null?void 0:r.call(n))!=null?t:[]:Array.isArray(e)?Yt(e,Ge):Yt(Object.values(e),Ge):[]},Yt=(e,t)=>e.reduce((r,n)=>r.concat(t(n)),[]);function de(e){return Object.assign(e,{optional:()=>Fu(e),and:t=>V(e,t),or:t=>Mu(e,t),select:t=>t===void 0?jo(e):jo(t,e)})}function Fu(e){return de({[De]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return t===void 0?(Ge(e).forEach(i=>n(i,void 0)),{matched:!0,selections:r}):{matched:we(e,t,n),selections:r}},getSelectionKeys:()=>Ge(e),matcherType:"optional"})})}function V(...e){return de({[De]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return{matched:e.every(i=>we(i,t,n)),selections:r}},getSelectionKeys:()=>Yt(e,Ge),matcherType:"and"})})}function Mu(...e){return de({[De]:()=>({match:t=>{let r={},n=(i,o)=>{r[i]=o};return Yt(e,Ge).forEach(i=>n(i,void 0)),{matched:e.some(i=>we(i,t,n)),selections:r}},getSelectionKeys:()=>Yt(e,Ge),matcherType:"or"})})}function A(e){return{[De]:()=>({match:t=>({matched:!!e(t)})})}}function jo(...e){let t=typeof e[0]=="string"?e[0]:void 0,r=e.length===2?e[1]:typeof e[0]=="string"?void 0:e[0];return de({[De]:()=>({match:n=>{let i={[t??Br]:n};return{matched:r===void 0||we(r,n,(o,s)=>{i[o]=s}),selections:i}},getSelectionKeys:()=>[t??Br].concat(r===void 0?[]:Ge(r))})})}function Ee(e){return typeof e=="number"}function je(e){return typeof e=="string"}function Be(e){return typeof e=="bigint"}var gf=de(A(function(e){return!0}));var Ue=e=>Object.assign(de(e),{startsWith:t=>{return Ue(V(e,(r=t,A(n=>je(n)&&n.startsWith(r)))));var r},endsWith:t=>{return Ue(V(e,(r=t,A(n=>je(n)&&n.endsWith(r)))));var r},minLength:t=>Ue(V(e,(r=>A(n=>je(n)&&n.length>=r))(t))),length:t=>Ue(V(e,(r=>A(n=>je(n)&&n.length===r))(t))),maxLength:t=>Ue(V(e,(r=>A(n=>je(n)&&n.length<=r))(t))),includes:t=>{return Ue(V(e,(r=t,A(n=>je(n)&&n.includes(r)))));var r},regex:t=>{return Ue(V(e,(r=t,A(n=>je(n)&&!!n.match(r)))));var r}}),hf=Ue(A(je)),be=e=>Object.assign(de(e),{between:(t,r)=>be(V(e,((n,i)=>A(o=>Ee(o)&&n<=o&&i>=o))(t,r))),lt:t=>be(V(e,(r=>A(n=>Ee(n)&&n<r))(t))),gt:t=>be(V(e,(r=>A(n=>Ee(n)&&n>r))(t))),lte:t=>be(V(e,(r=>A(n=>Ee(n)&&n<=r))(t))),gte:t=>be(V(e,(r=>A(n=>Ee(n)&&n>=r))(t))),int:()=>be(V(e,A(t=>Ee(t)&&Number.isInteger(t)))),finite:()=>be(V(e,A(t=>Ee(t)&&Number.isFinite(t)))),positive:()=>be(V(e,A(t=>Ee(t)&&t>0))),negative:()=>be(V(e,A(t=>Ee(t)&&t<0)))}),yf=be(A(Ee)),Qe=e=>Object.assign(de(e),{between:(t,r)=>Qe(V(e,((n,i)=>A(o=>Be(o)&&n<=o&&i>=o))(t,r))),lt:t=>Qe(V(e,(r=>A(n=>Be(n)&&n<r))(t))),gt:t=>Qe(V(e,(r=>A(n=>Be(n)&&n>r))(t))),lte:t=>Qe(V(e,(r=>A(n=>Be(n)&&n<=r))(t))),gte:t=>Qe(V(e,(r=>A(n=>Be(n)&&n>=r))(t))),positive:()=>Qe(V(e,A(t=>Be(t)&&t>0))),negative:()=>Qe(V(e,A(t=>Be(t)&&t<0)))}),Ef=Qe(A(Be)),bf=de(A(function(e){return typeof e=="boolean"})),wf=de(A(function(e){return typeof e=="symbol"})),xf=de(A(function(e){return e==null})),Pf=de(A(function(e){return e!=null}));var ni=class extends Error{constructor(t){let r;try{r=JSON.stringify(t)}catch{r=t}super(`Pattern matching error: no pattern matches value ${r}`),this.input=void 0,this.input=t}},ii={matched:!1,value:void 0};function ft(e){return new oi(e,ii)}var oi=class e{constructor(t,r){this.input=void 0,this.state=void 0,this.input=t,this.state=r}with(...t){if(this.state.matched)return this;let r=t[t.length-1],n=[t[0]],i;t.length===3&&typeof t[1]=="function"?i=t[1]:t.length>2&&n.push(...t.slice(1,t.length-1));let o=!1,s={},a=(u,c)=>{o=!0,s[u]=c},l=!n.some(u=>we(u,this.input,a))||i&&!i(this.input)?ii:{matched:!0,value:r(o?Br in s?s[Br]:s:this.input,this.input)};return new e(this.input,l)}when(t,r){if(this.state.matched)return this;let n=!!t(this.input);return new e(this.input,n?{matched:!0,value:r(this.input,this.input)}:ii)}otherwise(t){return this.state.matched?this.state.value:t(this.input)}exhaustive(){if(this.state.matched)return this.state.value;throw new ni(this.input)}run(){return this.exhaustive()}returnType(){return this}};var Go=require("util");var $u={warn:Oe("prisma:warn")},qu={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function Ur(e,...t){qu.warn()&&console.warn(`${$u.warn} ${e}`,...t)}var Vu=(0,Go.promisify)(Qo.default.exec),te=L("prisma:get-platform"),ju=["1.0.x","1.1.x","3.0.x"];async function Jo(){let e=Gr.default.platform(),t=process.arch;if(e==="freebsd"){let s=await Jr("freebsd-version");if(s&&s.trim().length>0){let l=/^(\d+)\.?/.exec(s);if(l)return{platform:"freebsd",targetDistro:`freebsd${l[1]}`,arch:t}}}if(e!=="linux")return{platform:e,arch:t};let r=await Uu(),n=await zu(),i=Gu({arch:t,archFromUname:n,familyDistro:r.familyDistro}),{libssl:o}=await Ju(i);return{platform:"linux",libssl:o,arch:t,archFromUname:n,...r}}function Bu(e){let t=/^ID="?([^"\n]*)"?$/im,r=/^ID_LIKE="?([^"\n]*)"?$/im,n=t.exec(e),i=n&&n[1]&&n[1].toLowerCase()||"",o=r.exec(e),s=o&&o[1]&&o[1].toLowerCase()||"",a=ft({id:i,idLike:s}).with({id:"alpine"},({id:l})=>({targetDistro:"musl",familyDistro:l,originalDistro:l})).with({id:"raspbian"},({id:l})=>({targetDistro:"arm",familyDistro:"debian",originalDistro:l})).with({id:"nixos"},({id:l})=>({targetDistro:"nixos",originalDistro:l,familyDistro:"nixos"})).with({id:"debian"},{id:"ubuntu"},({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).with({id:"rhel"},{id:"centos"},{id:"fedora"},({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).when(({idLike:l})=>l.includes("debian")||l.includes("ubuntu"),({id:l})=>({targetDistro:"debian",familyDistro:"debian",originalDistro:l})).when(({idLike:l})=>i==="arch"||l.includes("arch"),({id:l})=>({targetDistro:"debian",familyDistro:"arch",originalDistro:l})).when(({idLike:l})=>l.includes("centos")||l.includes("fedora")||l.includes("rhel")||l.includes("suse"),({id:l})=>({targetDistro:"rhel",familyDistro:"rhel",originalDistro:l})).otherwise(({id:l})=>({targetDistro:void 0,familyDistro:void 0,originalDistro:l}));return te(`Found distro info:
5
+ ${JSON.stringify(a,null,2)}`),a}async function Uu(){let e="/etc/os-release";try{let t=await si.default.readFile(e,{encoding:"utf-8"});return Bu(t)}catch{return{targetDistro:void 0,familyDistro:void 0,originalDistro:void 0}}}function Qu(e){let t=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(t){let r=`${t[1]}.x`;return Wo(r)}}function Bo(e){let t=/libssl\.so\.(\d)(\.\d)?/.exec(e);if(t){let r=`${t[1]}${t[2]??".0"}.x`;return Wo(r)}}function Wo(e){let t=(()=>{if(Ko(e))return e;let r=e.split(".");return r[1]="0",r.join(".")})();if(ju.includes(t))return t}function Gu(e){return ft(e).with({familyDistro:"musl"},()=>(te('Trying platform-specific paths for "alpine"'),["/lib","/usr/lib"])).with({familyDistro:"debian"},({archFromUname:t})=>(te('Trying platform-specific paths for "debian" (and "ubuntu")'),[`/usr/lib/${t}-linux-gnu`,`/lib/${t}-linux-gnu`])).with({familyDistro:"rhel"},()=>(te('Trying platform-specific paths for "rhel"'),["/lib64","/usr/lib64"])).otherwise(({familyDistro:t,arch:r,archFromUname:n})=>(te(`Don't know any platform-specific paths for "${t}" on ${r} (${n})`),[]))}async function Ju(e){let t='grep -v "libssl.so.0"',r=await Uo(e);if(r){te(`Found libssl.so file using platform-specific paths: ${r}`);let o=Bo(r);if(te(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"libssl-specific-path"}}te('Falling back to "ldconfig" and other generic paths');let n=await Jr(`ldconfig -p | sed "s/.*=>s*//" | sed "s|.*/||" | grep libssl | sort | ${t}`);if(n||(n=await Uo(["/lib64","/usr/lib64","/lib","/usr/lib"])),n){te(`Found libssl.so file using "ldconfig" or other generic paths: ${n}`);let o=Bo(n);if(te(`The parsed libssl version is: ${o}`),o)return{libssl:o,strategy:"ldconfig"}}let i=await Jr("openssl version -v");if(i){te(`Found openssl binary with version: ${i}`);let o=Qu(i);if(te(`The parsed openssl version is: ${o}`),o)return{libssl:o,strategy:"openssl-binary"}}return te("Couldn't find any version of libssl or OpenSSL in the system"),{}}async function Uo(e){for(let t of e){let r=await Wu(t);if(r)return r}}async function Wu(e){try{return(await si.default.readdir(e)).find(r=>r.startsWith("libssl.so.")&&!r.startsWith("libssl.so.0"))}catch(t){if(t.code==="ENOENT")return;throw t}}async function nt(){let{binaryTarget:e}=await Ho();return e}function Hu(e){return e.binaryTarget!==void 0}async function ai(){let{memoized:e,...t}=await Ho();return t}var Qr={};async function Ho(){if(Hu(Qr))return Promise.resolve({...Qr,memoized:!0});let e=await Jo(),t=Ku(e);return Qr={...e,binaryTarget:t},{...Qr,memoized:!1}}function Ku(e){let{platform:t,arch:r,archFromUname:n,libssl:i,targetDistro:o,familyDistro:s,originalDistro:a}=e;t==="linux"&&!["x64","arm64"].includes(r)&&Ur(`Prisma only officially supports Linux on amd64 (x86_64) and arm64 (aarch64) system architectures (detected "${r}" instead). If you are using your own custom Prisma engines, you can ignore this warning, as long as you've compiled the engines for your system architecture "${n}".`);let l="1.1.x";if(t==="linux"&&i===void 0){let c=ft({familyDistro:s}).with({familyDistro:"debian"},()=>"Please manually install OpenSSL via `apt-get update -y && apt-get install -y openssl` and try installing Prisma again. If you're running Prisma on Docker, add this command to your Dockerfile, or switch to an image that already has OpenSSL installed.").otherwise(()=>"Please manually install OpenSSL and try installing Prisma again.");Ur(`Prisma failed to detect the libssl/openssl version to use, and may not work as expected. Defaulting to "openssl-${l}".
6
+ ${c}`)}let u="debian";if(t==="linux"&&o===void 0&&te(`Distro is "${a}". Falling back to Prisma engines built for "${u}".`),t==="darwin"&&r==="arm64")return"darwin-arm64";if(t==="darwin")return"darwin";if(t==="win32")return"windows";if(t==="freebsd")return o;if(t==="openbsd")return"openbsd";if(t==="netbsd")return"netbsd";if(t==="linux"&&o==="nixos")return"linux-nixos";if(t==="linux"&&r==="arm64")return`${o==="musl"?"linux-musl-arm64":"linux-arm64"}-openssl-${i||l}`;if(t==="linux"&&r==="arm")return`linux-arm-openssl-${i||l}`;if(t==="linux"&&o==="musl"){let c="linux-musl";return!i||Ko(i)?c:`${c}-openssl-${i}`}return t==="linux"&&o&&i?`${o}-openssl-${i}`:(t!=="linux"&&Ur(`Prisma detected unknown OS "${t}" and may not work as expected. Defaulting to "linux".`),i?`${u}-openssl-${i}`:o?`${o}-openssl-${l}`:`${u}-openssl-${l}`)}async function Yu(e){try{return await e()}catch{return}}function Jr(e){return Yu(async()=>{let t=await Vu(e);return te(`Command "${e}" successfully returned "${t.stdout}"`),t.stdout})}async function zu(){return typeof Gr.default.machine=="function"?Gr.default.machine():(await Jr("uname -m"))?.trim()}function Ko(e){return e.startsWith("1.")}var _="\x1B[",zt="\x1B]",gt="\x07",Wr=";",Yo=process.env.TERM_PROGRAM==="Apple_Terminal",v={};v.cursorTo=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");return typeof t!="number"?_+(e+1)+"G":_+(t+1)+";"+(e+1)+"H"};v.cursorMove=(e,t)=>{if(typeof e!="number")throw new TypeError("The `x` argument is required");let r="";return e<0?r+=_+-e+"D":e>0&&(r+=_+e+"C"),t<0?r+=_+-t+"A":t>0&&(r+=_+t+"B"),r};v.cursorUp=(e=1)=>_+e+"A";v.cursorDown=(e=1)=>_+e+"B";v.cursorForward=(e=1)=>_+e+"C";v.cursorBackward=(e=1)=>_+e+"D";v.cursorLeft=_+"G";v.cursorSavePosition=Yo?"\x1B7":_+"s";v.cursorRestorePosition=Yo?"\x1B8":_+"u";v.cursorGetPosition=_+"6n";v.cursorNextLine=_+"E";v.cursorPrevLine=_+"F";v.cursorHide=_+"?25l";v.cursorShow=_+"?25h";v.eraseLines=e=>{let t="";for(let r=0;r<e;r++)t+=v.eraseLine+(r<e-1?v.cursorUp():"");return e&&(t+=v.cursorLeft),t};v.eraseEndLine=_+"K";v.eraseStartLine=_+"1K";v.eraseLine=_+"2K";v.eraseDown=_+"J";v.eraseUp=_+"1J";v.eraseScreen=_+"2J";v.scrollUp=_+"S";v.scrollDown=_+"T";v.clearScreen="\x1Bc";v.clearTerminal=process.platform==="win32"?`${v.eraseScreen}${_}0f`:`${v.eraseScreen}${_}3J${_}H`;v.beep=gt;v.link=(e,t)=>[zt,"8",Wr,Wr,t,gt,e,zt,"8",Wr,Wr,gt].join("");v.image=(e,t={})=>{let r=`${zt}1337;File=inline=1`;return t.width&&(r+=`;width=${t.width}`),t.height&&(r+=`;height=${t.height}`),t.preserveAspectRatio===!1&&(r+=";preserveAspectRatio=0"),r+":"+e.toString("base64")+gt};v.iTerm={setCwd:(e=process.cwd())=>`${zt}50;CurrentDir=${e}${gt}`,annotation:(e,t={})=>{let r=`${zt}1337;`,n=typeof t.x<"u",i=typeof t.y<"u";if((n||i)&&!(n&&i&&typeof t.length<"u"))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return e=e.replace(/\|/g,""),r+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",t.length>0?r+=(n?[e,t.length,t.x,t.y]:[t.length,e]).join("|"):r+=e,r+gt}};var zo=v;var Hr=O(is(),1);function it(e,t,{target:r="stdout",...n}={}){return Hr.default[r]?zo.link(e,t):n.fallback===!1?e:typeof n.fallback=="function"?n.fallback(e,t):`${e} (\u200B${t}\u200B)`}it.isSupported=Hr.default.stdout;it.stderr=(e,t,r={})=>it(e,t,{target:"stderr",...r});it.stderr.isSupported=Hr.default.stderr;function di(e){return it(e,e,{fallback:z})}var rc=os(),mi=rc.version;var ss="library";function yt(e){let t=nc();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":ss)}function nc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}var oc=O(gi());var $=O(require("path")),sc=O(gi()),og=L("prisma:engines");function as(){return $.default.join(__dirname,"../")}var sg="libquery-engine";$.default.join(__dirname,"../query-engine-darwin");$.default.join(__dirname,"../query-engine-darwin-arm64");$.default.join(__dirname,"../query-engine-debian-openssl-1.0.x");$.default.join(__dirname,"../query-engine-debian-openssl-1.1.x");$.default.join(__dirname,"../query-engine-debian-openssl-3.0.x");$.default.join(__dirname,"../query-engine-linux-static-x64");$.default.join(__dirname,"../query-engine-linux-static-arm64");$.default.join(__dirname,"../query-engine-rhel-openssl-1.0.x");$.default.join(__dirname,"../query-engine-rhel-openssl-1.1.x");$.default.join(__dirname,"../query-engine-rhel-openssl-3.0.x");$.default.join(__dirname,"../libquery_engine-darwin.dylib.node");$.default.join(__dirname,"../libquery_engine-darwin-arm64.dylib.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-debian-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-arm64-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-linux-musl.so.node");$.default.join(__dirname,"../libquery_engine-linux-musl-openssl-3.0.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-1.0.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-1.1.x.so.node");$.default.join(__dirname,"../libquery_engine-rhel-openssl-3.0.x.so.node");$.default.join(__dirname,"../query_engine-windows.dll.node");var hi=O(require("fs")),ls=L("chmodPlusX");function yi(e){if(process.platform==="win32")return;let t=hi.default.statSync(e),r=t.mode|64|8|1;if(t.mode===r){ls(`Execution permissions of ${e} are fine`);return}let n=r.toString(8).slice(-3);ls(`Have to call chmodPlusX on ${e}`),hi.default.chmodSync(e,n)}function Ei(e){let t=e.e,r=a=>`Prisma cannot find the required \`${a}\` system library in your system`,n=t.message.includes("cannot open shared object file"),i=`Please refer to the documentation about Prisma's system requirements: ${di("https://pris.ly/d/system-requirements")}`,o=`Unable to require(\`${ke(e.id)}\`).`,s=ft({message:t.message,code:t.code}).with({code:"ENOENT"},()=>"File does not exist.").when(({message:a})=>n&&a.includes("libz"),()=>`${r("libz")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libgcc_s"),()=>`${r("libgcc_s")}. Please install it and try again.`).when(({message:a})=>n&&a.includes("libssl"),()=>{let a=e.platformInfo.libssl?`openssl-${e.platformInfo.libssl}`:"openssl";return`${r("libssl")}. Please install ${a} and try again.`}).when(({message:a})=>a.includes("GLIBC"),()=>`Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${i}`).when(({message:a})=>e.platformInfo.platform==="linux"&&a.includes("symbol not found"),()=>`The Prisma engines are not compatible with your system ${e.platformInfo.originalDistro} on (${e.platformInfo.archFromUname}) which uses the \`${e.platformInfo.binaryTarget}\` binaryTarget by default. ${i}`).otherwise(()=>`The Prisma engines do not seem to be compatible with your system. ${i}`);return`${o}
7
7
  ${s}
8
8
 
9
- Details: ${r.message}`}var ds=O(ps(),1);function bi(e){let r=(0,ds.default)(e);if(r===0)return e;let t=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(t,"")}var ms="prisma+postgres",Yt=`${ms}:`;function wi(e){return e?.startsWith(`${Yt}//`)??!1}var gs=O(xi());function vi(e){return String(new Pi(e))}var Pi=class{constructor(r){this.config=r}toString(){let{config:r}=this,t=r.provider.fromEnvVar?`env("${r.provider.fromEnvVar}")`:r.provider.value,n=JSON.parse(JSON.stringify({provider:t,binaryTargets:cc(r.binaryTargets)}));return`generator ${r.name} {
10
- ${(0,gs.default)(pc(n),2)}
11
- }`}};function cc(e){let r;if(e.length>0){let t=e.find(n=>n.fromEnvVar!==null);t?r=`env("${t.fromEnvVar}")`:r=e.map(n=>n.native?"native":n.value)}else r=void 0;return r}function pc(e){let r=Object.keys(e).reduce((t,n)=>Math.max(t,n.length),0);return Object.entries(e).map(([t,n])=>`${t.padEnd(r)} = ${dc(n)}`).join(`
12
- `)}function dc(e){return JSON.parse(JSON.stringify(e,(r,t)=>Array.isArray(t)?`[${t.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(t)))}var Xr={};Jr(Xr,{error:()=>gc,info:()=>fc,log:()=>mc,query:()=>hc,should:()=>hs,tags:()=>Zr,warn:()=>Ti});var Zr={error:pe("prisma:error"),warn:Oe("prisma:warn"),info:_e("prisma:info"),query:nr("prisma:query")},hs={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function mc(...e){console.log(...e)}function Ti(e,...r){hs.warn()&&console.warn(`${Zr.warn} ${e}`,...r)}function fc(e,...r){console.info(`${Zr.info} ${e}`,...r)}function gc(e,...r){console.error(`${Zr.error} ${e}`,...r)}function hc(e,...r){console.log(`${Zr.query} ${e}`,...r)}function zt(e,r){if(!e)throw new Error(`${r}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function Ne(e,r){throw new Error(r)}var et=O(require("path"));function Si(e){return et.default.sep===et.default.posix.sep?e:e.split(et.default.sep).join(et.default.posix.sep)}var Oi=O(Ts()),Xt=O(require("fs"));var br=O(require("path"));function Rs(e){let r=e.ignoreProcessEnv?{}:process.env,t=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(r,p)?r[p]:e.parsed[p]||"",u=t(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(r,n)?r[n]:e.parsed[n];e.parsed[n]=t(i)}for(let n in e.parsed)r[n]=e.parsed[n];return e}var ki=L("prisma:tryLoadEnv");function rt({rootEnvPath:e,schemaEnvPath:r},t={conflictCheck:"none"}){let n=Ss(e);t.conflictCheck!=="none"&&Dc(n,r,t.conflictCheck);let i=null;return Cs(n?.path,r)||(i=Ss(r)),!n&&!i&&ki("No Environment variables loaded"),i?.dotenvResult.error?console.error(pe(W("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
13
- `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function Dc(e,r,t){let n=e?.dotenvResult.parsed,i=!Cs(e?.path,r);if(n&&r&&i&&Xt.default.existsSync(r)){let o=Oi.default.parse(Xt.default.readFileSync(r)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=br.default.relative(process.cwd(),e.path),l=br.default.relative(process.cwd(),r);if(t==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${z(a)} and ${z(l)}
9
+ Details: ${t.message}`}var ps=O(cs(),1);function bi(e){let t=(0,ps.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var ds="prisma+postgres",Yr=`${ds}:`;function wi(e){return e?.startsWith(`${Yr}//`)??!1}var Zt=O(require("path"));function xi(e){return Zt.default.sep===Zt.default.posix.sep?e:e.split(Zt.default.sep).join(Zt.default.posix.sep)}var fs=O(Pi());function Ti(e){return String(new vi(e))}var vi=class{constructor(t){this.config=t}toString(){let{config:t}=this,r=t.provider.fromEnvVar?`env("${t.provider.fromEnvVar}")`:t.provider.value,n=JSON.parse(JSON.stringify({provider:r,binaryTargets:ac(t.binaryTargets)}));return`generator ${t.name} {
10
+ ${(0,fs.default)(lc(n),2)}
11
+ }`}};function ac(e){let t;if(e.length>0){let r=e.find(n=>n.fromEnvVar!==null);r?t=`env("${r.fromEnvVar}")`:t=e.map(n=>n.native?"native":n.value)}else t=void 0;return t}function lc(e){let t=Object.keys(e).reduce((r,n)=>Math.max(r,n.length),0);return Object.entries(e).map(([r,n])=>`${r.padEnd(t)} = ${uc(n)}`).join(`
12
+ `)}function uc(e){return JSON.parse(JSON.stringify(e,(t,r)=>Array.isArray(r)?`[${r.map(n=>JSON.stringify(n)).join(", ")}]`:JSON.stringify(r)))}var er={};Jt(er,{error:()=>dc,info:()=>pc,log:()=>cc,query:()=>mc,should:()=>gs,tags:()=>Xt,warn:()=>Ri});var Xt={error:pe("prisma:error"),warn:Oe("prisma:warn"),info:_e("prisma:info"),query:rt("prisma:query")},gs={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function cc(...e){console.log(...e)}function Ri(e,...t){gs.warn()&&console.warn(`${Xt.warn} ${e}`,...t)}function pc(e,...t){console.info(`${Xt.info} ${e}`,...t)}function dc(e,...t){console.error(`${Xt.error} ${e}`,...t)}function mc(e,...t){console.log(`${Xt.query} ${e}`,...t)}function zr(e,t){if(!e)throw new Error(`${t}. This should never happen. If you see this error, please, open an issue at https://pris.ly/prisma-prisma-bug-report`)}function Ne(e,t){throw new Error(t)}var Oi=O(vs()),Xr=O(require("fs"));var Et=O(require("path"));function Ts(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var ki=L("prisma:tryLoadEnv");function tr({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=Rs(e);r.conflictCheck!=="none"&&kc(n,t,r.conflictCheck);let i=null;return Ss(n?.path,t)||(i=Rs(t)),!n&&!i&&ki("No Environment variables loaded"),i?.dotenvResult.error?console.error(pe(W("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
13
+ `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function kc(e,t,r){let n=e?.dotenvResult.parsed,i=!Ss(e?.path,t);if(n&&t&&i&&Xr.default.existsSync(t)){let o=Oi.default.parse(Xr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=Et.default.relative(process.cwd(),e.path),l=Et.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${z(a)} and ${z(l)}
14
14
  Conflicting env vars:
15
15
  ${s.map(c=>` ${W(c)}`).join(`
16
16
  `)}
17
17
 
18
18
  We suggest to move the contents of ${z(l)} to ${z(a)} to consolidate your env vars.
19
- `;throw new Error(u)}else if(t==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>W(c)).join(", ")} in ${z(a)} and ${z(l)}
19
+ `;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>W(c)).join(", ")} in ${z(a)} and ${z(l)}
20
20
  Env vars from ${z(l)} overwrite the ones from ${z(a)}
21
- `;console.warn(`${Oe("warn(prisma)")} ${u}`)}}}}function Ss(e){if(Nc(e)){ki(`Environment variables loaded from ${e}`);let r=Oi.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Rs(r),message:ke(`Environment variables loaded from ${br.default.relative(process.cwd(),e)}`),path:e}}else ki(`Environment variables not found at ${e}`);return null}function Cs(e,r){return e&&r&&br.default.resolve(e)===br.default.resolve(r)}function Nc(e){return!!(e&&Xt.default.existsSync(e))}function _i(e,r){return Object.prototype.hasOwnProperty.call(e,r)}function wr(e,r){let t={};for(let n of Object.keys(e))t[n]=r(e[n],n);return t}function Di(e,r){if(e.length===0)return;let t=e[0];for(let n=1;n<e.length;n++)r(t,e[n])<0&&(t=e[n]);return t}function x(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}var Is=new Set,tt=(e,r,...t)=>{Is.has(e)||(Is.add(e),Ti(r,...t))};var R=class e extends Error{clientVersion;errorCode;retryable;constructor(r,t,n){super(r),this.name="PrismaClientInitializationError",this.clientVersion=t,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};x(R,"PrismaClientInitializationError");var Z=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(r,{code:t,clientVersion:n,meta:i,batchRequestIdx:o}){super(r),this.name="PrismaClientKnownRequestError",this.code=t,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};x(Z,"PrismaClientKnownRequestError");var ue=class extends Error{clientVersion;constructor(r,t){super(r),this.name="PrismaClientRustPanicError",this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};x(ue,"PrismaClientRustPanicError");var j=class extends Error{clientVersion;batchRequestIdx;constructor(r,{clientVersion:t,batchRequestIdx:n}){super(r),this.name="PrismaClientUnknownRequestError",this.clientVersion=t,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};x(j,"PrismaClientUnknownRequestError");var X=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(r,{clientVersion:t}){super(r),this.clientVersion=t}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};x(X,"PrismaClientValidationError");var xr=9e15,Ye=1e9,Ni="0123456789abcdef",on="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",sn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Li={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-xr,maxE:xr,crypto:!1},Ds,Fe,w=!0,ln="[DecimalError] ",Ke=ln+"Invalid argument: ",Ns=ln+"Precision limit exceeded",Ls=ln+"crypto unavailable",Fs="[object Decimal]",ee=Math.floor,Q=Math.pow,Lc=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Fc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Mc=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ms=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,b=7,$c=9007199254740991,qc=on.length-1,Fi=sn.length-1,m={toStringTag:Fs};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};m.ceil=function(){return y(new this.constructor(this),this.e+1,2)};m.clampedTo=m.clamp=function(e,r){var t,n=this,i=n.constructor;if(e=new i(e),r=new i(r),!e.s||!r.s)return new i(NaN);if(e.gt(r))throw Error(Ke+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new i(n)};m.comparedTo=m.cmp=function(e){var r,t,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,r=0,t=n<i?n:i;r<t;++r)if(s[r]!==a[r])return s[r]>a[r]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};m.cosine=m.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+b,n.rounding=1,t=Vc(n,Bs(n,t)),n.precision=e,n.rounding=r,y(Fe==2||Fe==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)};m.cubeRoot=m.cbrt=function(){var e,r,t,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(w=!1,o=c.s*Q(c.s*c,1/3),!o||Math.abs(o)==1/0?(t=H(c.d),e=c.e,(o=(e-t.length+1)%3)&&(t+=o==1||o==-2?"0":"00"),o=Q(t,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new p(t),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=F(u.plus(c).times(a),u.plus(l),s+2,1),H(a.d).slice(0,s)===(t=H(n.d)).slice(0,s))if(t=t.slice(s-3,s+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,e+1,1),r=!n.times(n).times(n).eq(c));break}return w=!0,y(n,e,p.rounding,r)};m.decimalPlaces=m.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-ee(this.e/b))*b,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t};m.dividedBy=m.div=function(e){return F(this,new this.constructor(e))};m.dividedToIntegerBy=m.divToInt=function(e){var r=this,t=r.constructor;return y(F(r,new t(e),0,1,1),t.precision,t.rounding)};m.equals=m.eq=function(e){return this.cmp(e)===0};m.floor=function(){return y(new this.constructor(this),this.e+1,3)};m.greaterThan=m.gt=function(e){return this.cmp(e)>0};m.greaterThanOrEqualTo=m.gte=function(e){var r=this.cmp(e);return r==1||r===0};m.hyperbolicCosine=m.cosh=function(){var e,r,t,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;t=s.precision,n=s.rounding,s.precision=t+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),r=(1/cn(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),o=Pr(s,1,o.times(r),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=t,s.rounding=n,!0)};m.hyperbolicSine=m.sinh=function(){var e,r,t,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(r=o.precision,t=o.rounding,o.precision=r+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=Pr(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/cn(5,e)),i=Pr(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=r,o.rounding=t,y(i,r,t,!0)};m.hyperbolicTangent=m.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,F(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)};m.inverseCosine=m.acos=function(){var e=this,r=e.constructor,t=e.abs().cmp(1),n=r.precision,i=r.rounding;return t!==-1?t===0?e.isNeg()?xe(r,n,i):new r(0):new r(NaN):e.isZero()?xe(r,n+4,i).times(.5):(r.precision=n+6,r.rounding=1,e=new r(1).minus(e).div(e.plus(1)).sqrt().atan(),r.precision=n,r.rounding=i,e.times(2))};m.inverseHyperbolicCosine=m.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,w=!1,t=t.times(t).minus(1).sqrt().plus(t),w=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)};m.inverseHyperbolicSine=m.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,w=!1,t=t.times(t).plus(1).sqrt().plus(t),w=!0,n.precision=e,n.rounding=r,t.ln())};m.inverseHyperbolicTangent=m.atanh=function(){var e,r,t,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,r=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,r,!0):(o.precision=t=n-i.e,i=F(i.plus(1),new o(1).minus(i),t+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=r,i.times(.5))):new o(NaN)};m.inverseSine=m.asin=function(){var e,r,t,n,i=this,o=i.constructor;return i.isZero()?new o(i):(r=i.abs().cmp(1),t=o.precision,n=o.rounding,r!==-1?r===0?(e=xe(o,t+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=t+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=t,o.rounding=n,i.times(2)))};m.inverseTangent=m.atan=function(){var e,r,t,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=Fi)return s=xe(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Fi)return s=xe(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,t=Math.min(28,a/b+2|0),e=t;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(w=!1,r=Math.ceil(a/b),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[r]!==void 0)for(e=r;s.d[e]===o.d[e]&&e--;);return t&&(s=s.times(2<<t-1)),w=!0,y(s,c.precision=p,c.rounding=d,!0)};m.isFinite=function(){return!!this.d};m.isInteger=m.isInt=function(){return!!this.d&&ee(this.e/b)>this.d.length-2};m.isNaN=function(){return!this.s};m.isNegative=m.isNeg=function(){return this.s<0};m.isPositive=m.isPos=function(){return this.s>0};m.isZero=function(){return!!this.d&&this.d[0]===0};m.lessThan=m.lt=function(e){return this.cmp(e)<0};m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1};m.logarithm=m.log=function(e){var r,t,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,f=5;if(e==null)e=new c(10),r=!0;else{if(e=new c(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new c(NaN);r=e.eq(10)}if(t=u.d,u.s<0||!t||!t[0]||u.eq(1))return new c(t&&!t[0]?-1/0:u.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)o=!0;else{for(i=t[0];i%10===0;)i/=10;o=i!==1}if(w=!1,a=p+f,s=He(u,a),n=r?an(c,a+10):He(e,a),l=F(s,n,a,1),nt(l.d,i=p,d))do if(a+=10,s=He(u,a),n=r?an(c,a+10):He(e,a),l=F(s,n,a,1),!o){+H(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(nt(l.d,i+=10,d));return w=!0,y(l,p,d)};m.minus=m.sub=function(e){var r,t,n,i,o,s,a,l,u,c,p,d,f=this,g=f.constructor;if(e=new g(e),!f.d||!e.d)return!f.s||!e.s?e=new g(NaN):f.d?e.s=-e.s:e=new g(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,d=e.d,a=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(f);else return new g(l===3?-0:0);return w?y(e,a,l):e}if(t=ee(e.e/b),c=ee(f.e/b),u=u.slice(),o=c-t,o){for(p=o<0,p?(r=u,o=-o,s=d.length):(r=d,t=c,s=u.length),n=Math.max(Math.ceil(a/b),s)+2,o>n&&(o=n,r.length=1),r.reverse(),n=o;n--;)r.push(0);r.reverse()}else{for(n=u.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(u[n]!=d[n]){p=u[n]<d[n];break}o=0}for(p&&(r=u,u=d,d=r,e.s=-e.s),s=u.length,n=d.length-s;n>0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]<d[n]){for(i=n;i&&u[--i]===0;)u[i]=ge-1;--u[i],u[n]+=ge}u[n]-=d[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--t;return u[0]?(e.d=u,e.e=un(u,t),w?y(e,a,l):e):new g(l===3?-0:0)};m.modulo=m.mod=function(e){var r,t=this,n=t.constructor;return e=new n(e),!t.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||t.d&&!t.d[0]?y(new n(t),n.precision,n.rounding):(w=!1,n.modulo==9?(r=F(t,e.abs(),0,3,1),r.s*=e.s):r=F(t,e,0,n.modulo,1),r=r.times(e),w=!0,t.minus(r))};m.naturalExponential=m.exp=function(){return Mi(this)};m.naturalLogarithm=m.ln=function(){return He(this)};m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s,y(e)};m.plus=m.add=function(e){var r,t,n,i,o,s,a,l,u,c,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(u=p.d,c=e.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(p)),w?y(e,a,l):e;if(o=ee(p.e/b),n=ee(e.e/b),u=u.slice(),i=o-n,i){for(i<0?(t=u,i=-i,s=c.length):(t=c,n=o,s=u.length),o=Math.ceil(a/b),s=o>s?o+1:s+1,i>s&&(i=s,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,t=c,c=u,u=t),r=0;i;)r=(u[--i]=u[i]+c[i]+r)/ge|0,u[i]%=ge;for(r&&(u.unshift(r),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=un(u,n),w?y(e,a,l):e};m.precision=m.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ke+e);return t.d?(r=$s(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r};m.round=function(){var e=this,r=e.constructor;return y(new r(e),e.e+1,r.rounding)};m.sine=m.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+b,n.rounding=1,t=Bc(n,Bs(n,t)),n.precision=e,n.rounding=r,y(Fe>2?t.neg():t,e,r,!0)):new n(NaN)};m.squareRoot=m.sqrt=function(){var e,r,t,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(w=!1,u=Math.sqrt(+s),u==0||u==1/0?(r=H(a),(r.length+l)%2==0&&(r+="0"),u=Math.sqrt(r),l=ee((l+1)/2)-(l<0||l%2),u==1/0?r="5e"+l:(r=u.toExponential(),r=r.slice(0,r.indexOf("e")+1)+l),n=new c(r)):n=new c(u.toString()),t=(l=c.precision)+3;;)if(o=n,n=o.plus(F(s,o,t+2,1)).times(.5),H(o.d).slice(0,t)===(r=H(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}t+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return w=!0,y(n,l,c.rounding,e)};m.tangent=m.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=F(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,y(Fe==2||Fe==4?t.neg():t,e,r,!0)):new n(NaN)};m.times=m.mul=function(e){var r,t,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,f=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!f||!f[0])return new p(!e.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:!d||!f?e.s/0:e.s*0);for(t=ee(c.e/b)+ee(e.e/b),l=d.length,u=f.length,l<u&&(o=d,d=f,f=o,s=l,l=u,u=s),o=[],s=l+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(r=0,i=l+n;i>n;)a=o[i]+f[n]*d[i-n-1]+r,o[i--]=a%ge|0,r=a/ge|0;o[i]=(o[i]+r)%ge|0}for(;!o[--s];)o.pop();return r?++t:o.shift(),e.d=o,e.e=un(o,t),w?y(e,p.precision,p.rounding):e};m.toBinary=function(e,r){return $i(this,2,e,r)};m.toDecimalPlaces=m.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(oe(e,0,Ye),r===void 0?r=n.rounding:oe(r,0,8),y(t,e+t.e+1,r))};m.toExponential=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=Pe(n,!0):(oe(e,0,Ye),r===void 0?r=i.rounding:oe(r,0,8),n=y(new i(n),e+1,r),t=Pe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t};m.toFixed=function(e,r){var t,n,i=this,o=i.constructor;return e===void 0?t=Pe(i):(oe(e,0,Ye),r===void 0?r=o.rounding:oe(r,0,8),n=y(new o(i),e+i.e+1,r),t=Pe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t};m.toFraction=function(e){var r,t,n,i,o,s,a,l,u,c,p,d,f=this,g=f.d,h=f.constructor;if(!g)return new h(f);if(u=t=new h(1),n=l=new h(0),r=new h(n),o=r.e=$s(g)-f.e-1,s=o%b,r.d[0]=Q(10,s<0?b+s:s),e==null)e=o>0?r:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Ke+a);e=a.gt(r)?o>0?r:u:a}for(w=!1,a=new h(H(g)),c=h.precision,h.precision=o=g.length*b*2;p=F(a,r,0,1,1),i=t.plus(p.times(n)),i.cmp(e)!=1;)t=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=r,r=a.minus(p.times(i)),a=i;return i=F(e.minus(t),n,0,1,1),l=l.plus(i.times(u)),t=t.plus(i.times(n)),l.s=u.s=f.s,d=F(u,n,o,1).minus(f).abs().cmp(F(l,t,o,1).minus(f).abs())<1?[u,n]:[l,t],h.precision=c,w=!0,d};m.toHexadecimal=m.toHex=function(e,r){return $i(this,16,e,r)};m.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:oe(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(w=!1,t=F(t,e,0,r,1).times(e),w=!0,y(t)):(e.s=t.s,t=e),t};m.toNumber=function(){return+this};m.toOctal=function(e,r){return $i(this,8,e,r)};m.toPower=m.pow=function(e){var r,t,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(r=ee(e.e/b),r>=e.d.length-1&&(t=u<0?-u:u)<=$c)return i=qs(l,a,t,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(r<e.d.length-1)return new l(NaN);if(e.d[r]&1||(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return t=Q(+a,u),r=t==0||!isFinite(t)?ee(u*(Math.log("0."+H(a.d))/Math.LN10+a.e+1)):new l(t+"").e,r>l.maxE+1||r<l.minE-1?new l(r>0?s/0:0):(w=!1,l.rounding=a.s=1,t=Math.min(12,(r+"").length),i=Mi(e.times(He(a,n+t)),n),i.d&&(i=y(i,n+5,1),nt(i.d,n,o)&&(r=n+10,i=y(Mi(e.times(He(a,r+t)),r),r+5,1),+H(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,w=!0,l.rounding=o,y(i,n,o))};m.toPrecision=function(e,r){var t,n=this,i=n.constructor;return e===void 0?t=Pe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Ye),r===void 0?r=i.rounding:oe(r,0,8),n=y(new i(n),e,r),t=Pe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t};m.toSignificantDigits=m.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(oe(e,1,Ye),r===void 0?r=n.rounding:oe(r,0,8)),y(new n(t),e,r)};m.toString=function(){var e=this,r=e.constructor,t=Pe(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t};m.truncated=m.trunc=function(){return y(new this.constructor(this),this.e+1,1)};m.valueOf=m.toJSON=function(){var e=this,r=e.constructor,t=Pe(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function H(e){var r,t,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,r=1;r<i;r++)n=e[r]+"",t=b-n.length,t&&(o+=We(t)),o+=n;s=e[r],n=s+"",t=b-n.length,t&&(o+=We(t))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function oe(e,r,t){if(e!==~~e||e<r||e>t)throw Error(Ke+e)}function nt(e,r,t,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--r;return--r<0?(r+=b,i=0):(i=Math.ceil((r+1)/b),r%=b),o=Q(10,b-r),a=e[i]%o|0,n==null?r<3?(r==0?a=a/100|0:r==1&&(a=a/10|0),s=t<4&&a==99999||t>3&&a==49999||a==5e4||a==0):s=(t<4&&a+1==o||t>3&&a+1==o/2)&&(e[i+1]/o/100|0)==Q(10,r-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:r<4?(r==0?a=a/1e3|0:r==1?a=a/100|0:r==2&&(a=a/10|0),s=(n||t<4)&&a==9999||!n&&t>3&&a==4999):s=((n||t<4)&&a+1==o||!n&&t>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==Q(10,r-3)-1,s}function tn(e,r,t){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=r;for(i[0]+=Ni.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>t-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/t|0,i[n]%=t)}return i.reverse()}function Vc(e,r){var t,n,i;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),i=(1/cn(4,t)).toString()):(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=Pr(e,1,r.times(i),new e(1));for(var o=t;o--;){var s=r.times(r);r=s.times(s).minus(s).times(8).plus(1)}return e.precision-=t,r}var F=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function r(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(n[a]!=i[a]){l=n[a]>i[a]?1:-1;break}return l}function t(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,f,g,h,I,T,S,E,k,fe,le,Gr,B,ne,Ie,K,fr,Ft=n.constructor,Hn=n.s==i.s?1:-1,Y=n.d,N=i.d;if(!Y||!Y[0]||!N||!N[0])return new Ft(!n.s||!i.s||(Y?N&&Y[0]==N[0]:!N)?NaN:Y&&Y[0]==0||!N?Hn*0:Hn/0);for(l?(f=1,c=n.e-i.e):(l=ge,f=b,c=ee(n.e/f)-ee(i.e/f)),K=N.length,ne=Y.length,T=new Ft(Hn),S=T.d=[],p=0;N[p]==(Y[p]||0);p++);if(N[p]>(Y[p]||0)&&c--,o==null?(le=o=Ft.precision,s=Ft.rounding):a?le=o+(n.e-i.e)+1:le=o,le<0)S.push(1),g=!0;else{if(le=le/f+2|0,p=0,K==1){for(d=0,N=N[0],le++;(p<ne||d)&&le--;p++)Gr=d*l+(Y[p]||0),S[p]=Gr/N|0,d=Gr%N|0;g=d||p<ne}else{for(d=l/(N[0]+1)|0,d>1&&(N=e(N,d,l),Y=e(Y,d,l),K=N.length,ne=Y.length),B=K,E=Y.slice(0,K),k=E.length;k<K;)E[k++]=0;fr=N.slice(),fr.unshift(0),Ie=N[0],N[1]>=l/2&&++Ie;do d=0,u=r(N,E,K,k),u<0?(fe=E[0],K!=k&&(fe=fe*l+(E[1]||0)),d=fe/Ie|0,d>1?(d>=l&&(d=l-1),h=e(N,d,l),I=h.length,k=E.length,u=r(h,E,I,k),u==1&&(d--,t(h,K<I?fr:N,I,l))):(d==0&&(u=d=1),h=N.slice()),I=h.length,I<k&&h.unshift(0),t(E,h,k,l),u==-1&&(k=E.length,u=r(N,E,K,k),u<1&&(d++,t(E,K<k?fr:N,k,l))),k=E.length):u===0&&(d++,E=[0]),S[p++]=d,u&&E[0]?E[k++]=Y[B]||0:(E=[Y[B]],k=1);while((B++<ne||E[0]!==void 0)&&le--);g=E[0]!==void 0}S[0]||S.shift()}if(f==1)T.e=c,Ds=g;else{for(p=1,d=S[0];d>=10;d/=10)p++;T.e=p+c*f-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,r,t,n){var i,o,s,a,l,u,c,p,d,f=e.constructor;e:if(r!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=r-i,o<0)o+=b,s=r,c=p[d=0],l=c/Q(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/b),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=b,s=o-b+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=b,s=o-b+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||r<0||p[d+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=t<4?(l||n)&&(t==0||t==(e.s<0?3:2)):l>5||l==5&&(t==4||n||t==6&&(o>0?s>0?c/Q(10,i-s):0:p[d-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,u?(r-=e.e+1,p[0]=Q(10,(b-r%b)%b),e.e=-r||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=Q(10,b-o),p[d]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==ge&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=ge)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return w&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e<f.minE&&(e.e=0,e.d=[0])),e}function Pe(e,r,t){if(!e.isFinite())return js(e);var n,i=e.e,o=H(e.d),s=o.length;return r?(t&&(n=t-s)>0?o=o.charAt(0)+"."+o.slice(1)+We(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+We(-i-1)+o,t&&(n=t-s)>0&&(o+=We(n))):i>=s?(o+=We(i+1-s),t&&(n=t-i-1)>0&&(o=o+"."+We(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),t&&(n=t-s)>0&&(i+1===s&&(o+="."),o+=We(n))),o}function un(e,r){var t=e[0];for(r*=b;t>=10;t/=10)r++;return r}function an(e,r,t){if(r>qc)throw w=!0,t&&(e.precision=t),Error(Ns);return y(new e(on),r,1,!0)}function xe(e,r,t){if(r>Fi)throw Error(Ns);return y(new e(sn),r,t,!0)}function $s(e){var r=e.length-1,t=r*b+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function We(e){for(var r="";e--;)r+="0";return r}function qs(e,r,t,n){var i,o=new e(1),s=Math.ceil(n/b+4);for(w=!1;;){if(t%2&&(o=o.times(r),Os(o.d,s)&&(i=!0)),t=ee(t/2),t===0){t=o.d.length-1,i&&o.d[t]===0&&++o.d[t];break}r=r.times(r),Os(r.d,s)}return w=!0,o}function ks(e){return e.d[e.d.length-1]&1}function Vs(e,r,t){for(var n,i,o=new e(r[0]),s=0;++s<r.length;){if(i=new e(r[s]),!i.s){o=i;break}n=o.cmp(i),(n===t||n===0&&o.s===t)&&(o=i)}return o}function Mi(e,r){var t,n,i,o,s,a,l,u=0,c=0,p=0,d=e.constructor,f=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(r==null?(w=!1,l=g):l=r,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(Q(2,p))/Math.LN10*2+5|0,l+=n,t=o=s=new d(1),d.precision=l;;){if(o=y(o.times(e),l,1),t=t.times(++c),a=s.plus(F(o,t,l,1)),H(a.d).slice(0,l)===H(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(r==null)if(u<3&&nt(s.d,l-n,f,u))d.precision=l+=10,t=o=a=new d(1),c=0,u++;else return y(s,d.precision=g,f,w=!0);else return d.precision=g,s}s=a}}function He(e,r){var t,n,i,o,s,a,l,u,c,p,d,f=1,g=10,h=e,I=h.d,T=h.constructor,S=T.rounding,E=T.precision;if(h.s<0||!I||!I[0]||!h.e&&I[0]==1&&I.length==1)return new T(I&&!I[0]?-1/0:h.s!=1?NaN:I?0:h);if(r==null?(w=!1,c=E):c=r,T.precision=c+=g,t=H(I),n=t.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)h=h.times(e),t=H(h.d),n=t.charAt(0),f++;o=h.e,n>1?(h=new T("0."+t),o++):h=new T(n+"."+t.slice(1))}else return u=an(T,c+2,E).times(o+""),h=He(new T(n+"."+t.slice(1)),c-g).plus(u),T.precision=E,r==null?y(h,E,S,w=!0):h;for(p=h,l=s=h=F(h.minus(1),h.plus(1),c,1),d=y(h.times(h),c,1),i=3;;){if(s=y(s.times(d),c,1),u=l.plus(F(s,new T(i),c,1)),H(u.d).slice(0,c)===H(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(an(T,c+2,E).times(o+""))),l=F(l,new T(f),c,1),r==null)if(nt(l.d,c-g,S,a))T.precision=c+=g,u=s=h=F(p.minus(1),p.plus(1),c,1),d=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=E,S,w=!0);else return T.precision=E,l;l=u,i+=2}}function js(e){return String(e.s*e.s/0)}function nn(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(i=r.length;r.charCodeAt(i-1)===48;--i);if(r=r.slice(n,i),r){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%b,t<0&&(n+=b),n<i){for(n&&e.d.push(+r.slice(0,n)),i-=b;n<i;)e.d.push(+r.slice(n,n+=b));r=r.slice(n),n=b-r.length}else n-=i;for(;n--;)r+="0";e.d.push(+r),w&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function jc(e,r){var t,n,i,o,s,a,l,u,c;if(r.indexOf("_")>-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),Ms.test(r))return nn(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(Fc.test(r))t=16,r=r.toLowerCase();else if(Lc.test(r))t=2;else if(Mc.test(r))t=8;else throw Error(Ke+r);for(o=r.search(/p/i),o>0?(l=+r.slice(o+1),r=r.substring(2,o)):r=r.slice(2),o=r.indexOf("."),s=o>=0,n=e.constructor,s&&(r=r.replace(".",""),a=r.length,o=a-o,i=qs(n,new n(t),o,o*2)),u=tn(r,t,ge),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=un(u,c),e.d=u,w=!1,s&&(e=F(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?Q(2,l):sr.pow(2,l))),w=!0,e)}function Bc(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:Pr(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/cn(5,t)),r=Pr(e,2,r,r);for(var i,o=new e(5),s=new e(16),a=new e(20);t--;)i=r.times(r),r=r.times(o.plus(i.times(s.times(i).minus(a))));return r}function Pr(e,r,t,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/b);for(w=!1,l=t.times(t),a=new e(n);;){if(s=F(a.times(l),new e(r++*r++),c,1),a=i?n.plus(s):n.minus(s),n=F(s.times(l),new e(r++*r++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return w=!0,s.d.length=p+1,s}function cn(e,r){for(var t=e;--r;)t*=e;return t}function Bs(e,r){var t,n=r.s<0,i=xe(e,e.precision,1),o=i.times(.5);if(r=r.abs(),r.lte(o))return Fe=n?4:1,r;if(t=r.divToInt(i),t.isZero())Fe=n?3:2;else{if(r=r.minus(t.times(i)),r.lte(o))return Fe=ks(t)?n?2:3:n?4:1,r;Fe=ks(t)?n?1:4:n?3:2}return r.minus(i).abs()}function $i(e,r,t,n){var i,o,s,a,l,u,c,p,d,f=e.constructor,g=t!==void 0;if(g?(oe(t,1,Ye),n===void 0?n=f.rounding:oe(n,0,8)):(t=f.precision,n=f.rounding),!e.isFinite())c=js(e);else{for(c=Pe(e),s=c.indexOf("."),g?(i=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):i=r,s>=0&&(c=c.replace(".",""),d=new f(1),d.e=c.length-s,d.d=tn(Pe(d),10,i),d.e=d.d.length),p=tn(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=F(e,d,t,n,0,i),p=e.d,o=e.e,u=Ds),s=p[t],a=i/2,u=u||p[t+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[t-1]&1||n===(e.s<0?8:7)),p.length=t,u)for(;++p[--t]>i-1;)p[t]=0,t||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s<l;s++)c+=Ni.charAt(p[s]);if(g){if(l>1)if(r==16||r==8){for(s=r==16?4:3,--l;l%s;l++)c+="0";for(p=tn(c,i,r),l=p.length;!p[l-1];--l);for(s=1,c="1.";s<l;s++)c+=Ni.charAt(p[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}c=(r==16?"0x":r==2?"0b":r==8?"0o":"")+c}return e.s<0?"-"+c:c}function Os(e,r){if(e.length>r)return e.length=r,!0}function Uc(e){return new this(e).abs()}function Qc(e){return new this(e).acos()}function Gc(e){return new this(e).acosh()}function Jc(e,r){return new this(e).plus(r)}function Wc(e){return new this(e).asin()}function Hc(e){return new this(e).asinh()}function Kc(e){return new this(e).atan()}function Yc(e){return new this(e).atanh()}function zc(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,o=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=xe(this,o,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?xe(this,n,i):new this(0),t.s=e.s):!e.d||r.isZero()?(t=xe(this,o,1).times(.5),t.s=e.s):r.s<0?(this.precision=o,this.rounding=1,t=this.atan(F(e,r,o,1)),r=xe(this,o,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(F(e,r,o,1)),t}function Zc(e){return new this(e).cbrt()}function Xc(e){return y(e=new this(e),e.e+1,2)}function ep(e,r,t){return new this(e).clamp(r,t)}function rp(e){if(!e||typeof e!="object")throw Error(ln+"Object expected");var r,t,n,i=e.defaults===!0,o=["precision",1,Ye,"rounding",0,8,"toExpNeg",-xr,0,"toExpPos",0,xr,"maxE",0,xr,"minE",-xr,0,"modulo",0,9];for(r=0;r<o.length;r+=3)if(t=o[r],i&&(this[t]=Li[t]),(n=e[t])!==void 0)if(ee(n)===n&&n>=o[r+1]&&n<=o[r+2])this[t]=n;else throw Error(Ke+t+": "+n);if(t="crypto",i&&(this[t]=Li[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Ls);else this[t]=!1;else throw Error(Ke+t+": "+n);return this}function tp(e){return new this(e).cos()}function np(e){return new this(e).cosh()}function Us(e){var r,t,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,_s(o)){u.s=o.s,w?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e<i.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(l=typeof o,l==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;w?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return nn(u,o.toString())}if(l==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),Ms.test(o)?nn(u,o):jc(u,o);if(l==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,nn(u,o.toString());throw Error(Ke+o)}if(i.prototype=m,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=rp,i.clone=Us,i.isDecimal=_s,i.abs=Uc,i.acos=Qc,i.acosh=Gc,i.add=Jc,i.asin=Wc,i.asinh=Hc,i.atan=Kc,i.atanh=Yc,i.atan2=zc,i.cbrt=Zc,i.ceil=Xc,i.clamp=ep,i.cos=tp,i.cosh=np,i.div=ip,i.exp=op,i.floor=sp,i.hypot=ap,i.ln=lp,i.log=up,i.log10=pp,i.log2=cp,i.max=dp,i.min=mp,i.mod=fp,i.mul=gp,i.pow=hp,i.random=yp,i.round=Ep,i.sign=bp,i.sin=wp,i.sinh=xp,i.sqrt=Pp,i.sub=vp,i.sum=Tp,i.tan=Rp,i.tanh=Sp,i.trunc=Cp,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<n.length;)e.hasOwnProperty(t=n[r++])||(e[t]=this[t]);return i.config(e),i}function ip(e,r){return new this(e).div(r)}function op(e){return new this(e).exp()}function sp(e){return y(e=new this(e),e.e+1,3)}function ap(){var e,r,t=new this(0);for(w=!1,e=0;e<arguments.length;)if(r=new this(arguments[e++]),r.d)t.d&&(t=t.plus(r.times(r)));else{if(r.s)return w=!0,new this(1/0);t=r}return w=!0,t.sqrt()}function _s(e){return e instanceof sr||e&&e.toStringTag===Fs||!1}function lp(e){return new this(e).ln()}function up(e,r){return new this(e).log(r)}function cp(e){return new this(e).log(2)}function pp(e){return new this(e).log(10)}function dp(){return Vs(this,arguments,-1)}function mp(){return Vs(this,arguments,1)}function fp(e,r){return new this(e).mod(r)}function gp(e,r){return new this(e).mul(r)}function hp(e,r){return new this(e).pow(r)}function yp(e){var r,t,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:oe(e,1,Ye),n=Math.ceil(e/b),this.crypto)if(crypto.getRandomValues)for(r=crypto.getRandomValues(new Uint32Array(n));o<n;)i=r[o],i>=429e7?r[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);o<n;)i=r[o]+(r[o+1]<<8)+(r[o+2]<<16)+((r[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(r,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Ls);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=b,n&&e&&(i=Q(10,b-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)t=0,a=[0];else{for(t=-1;a[0]===0;t-=b)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<b&&(t-=b-n)}return s.e=t,s.d=a,s}function Ep(e){return y(e=new this(e),e.e+1,this.rounding)}function bp(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function wp(e){return new this(e).sin()}function xp(e){return new this(e).sinh()}function Pp(e){return new this(e).sqrt()}function vp(e,r){return new this(e).sub(r)}function Tp(){var e=0,r=arguments,t=new this(r[e]);for(w=!1;t.s&&++e<r.length;)t=t.plus(r[e]);return w=!0,y(t,this.precision,this.rounding)}function Rp(e){return new this(e).tan()}function Sp(e){return new this(e).tanh()}function Cp(e){return y(e=new this(e),e.e+1,1)}m[Symbol.for("nodejs.util.inspect.custom")]=m.toString;m[Symbol.toStringTag]="Decimal";var sr=m.constructor=Us(Li);on=new sr(on);sn=new sr(sn);var ve=sr;function vr(e){return e===null?e:Array.isArray(e)?e.map(vr):typeof e=="object"?Ap(e)?Ip(e):wr(e,vr):e}function Ap(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Ip({$type:e,value:r}){switch(e){case"BigInt":return BigInt(r);case"Bytes":{let{buffer:t,byteOffset:n,byteLength:i}=Buffer.from(r,"base64");return new Uint8Array(t,n,i)}case"DateTime":return new Date(r);case"Decimal":return new ve(r);case"Json":return JSON.parse(r);default:Ne(r,"Unknown tagged value")}}var Te=class{_map=new Map;get(r){return this._map.get(r)?.value}set(r,t){this._map.set(r,{value:t})}getOrCreate(r,t){let n=this._map.get(r);if(n)return n.value;let i=t();return this.set(r,i),i}};function ze(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Qs(e,r){let t={};for(let n of e){let i=n[r];t[i]=n}return t}function it(e){let r;return{get(){return r||(r={value:e()}),r.value}}}function Gs(e){return{models:qi(e.models),enums:qi(e.enums),types:qi(e.types)}}function qi(e){let r={};for(let{name:t,...n}of e)r[t]=n;return r}function Tr(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function pn(e){return e.toString()!=="Invalid Date"}function Rr(e){return sr.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 ot=(E=>(E.findUnique="findUnique",E.findUniqueOrThrow="findUniqueOrThrow",E.findFirst="findFirst",E.findFirstOrThrow="findFirstOrThrow",E.findMany="findMany",E.create="create",E.createMany="createMany",E.createManyAndReturn="createManyAndReturn",E.update="update",E.updateMany="updateMany",E.updateManyAndReturn="updateManyAndReturn",E.upsert="upsert",E.delete="delete",E.deleteMany="deleteMany",E.groupBy="groupBy",E.count="count",E.aggregate="aggregate",E.findRaw="findRaw",E.aggregateRaw="aggregateRaw",E))(ot||{});var zs=O(xi());var Ys=O(require("fs"));var Ws={keyword:_e,entity:_e,value:e=>W(nr(e)),punctuation:nr,directive:_e,function:_e,variable:e=>W(nr(e)),string:e=>W(Ve(e)),boolean:Oe,number:_e,comment:Wr};var kp=e=>e,dn={},Op=0,P={manual:dn.Prism&&dn.Prism.manual,disableWorkerMessageHandler:dn.Prism&&dn.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof he){let r=e;return new he(r.type,P.util.encode(r.content),r.alias)}else return Array.isArray(e)?e.map(P.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:++Op}),e.__id},clone:function e(r,t){let n,i,o=P.util.type(r);switch(t=t||{},o){case"Object":if(i=P.util.objId(r),t[i])return t[i];n={},t[i]=n;for(let s in r)r.hasOwnProperty(s)&&(n[s]=e(r[s],t));return n;case"Array":return i=P.util.objId(r),t[i]?t[i]:(n=[],t[i]=n,r.forEach(function(s,a){n[a]=e(s,t)}),n);default:return r}}},languages:{extend:function(e,r){let t=P.util.clone(P.languages[e]);for(let n in r)t[n]=r[n];return t},insertBefore:function(e,r,t,n){n=n||P.languages;let i=n[e],o={};for(let a in i)if(i.hasOwnProperty(a)){if(a==r)for(let l in t)t.hasOwnProperty(l)&&(o[l]=t[l]);t.hasOwnProperty(a)||(o[a]=i[a])}let s=n[e];return n[e]=o,P.languages.DFS(P.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(r,t,n,i){i=i||{};let o=P.util.objId;for(let s in r)if(r.hasOwnProperty(s)){t.call(r,s,r[s],n||s);let a=r[s],l=P.util.type(a);l==="Object"&&!i[o(a)]?(i[o(a)]=!0,e(a,t,null,i)):l==="Array"&&!i[o(a)]&&(i[o(a)]=!0,e(a,t,s,i))}}},plugins:{},highlight:function(e,r,t){let n={code:e,grammar:r,language:t};return P.hooks.run("before-tokenize",n),n.tokens=P.tokenize(n.code,n.grammar),P.hooks.run("after-tokenize",n),he.stringify(P.util.encode(n.tokens),n.language)},matchGrammar:function(e,r,t,n,i,o,s){for(let h in t){if(!t.hasOwnProperty(h)||!t[h])continue;if(h==s)return;let I=t[h];I=P.util.type(I)==="Array"?I:[I];for(let T=0;T<I.length;++T){let S=I[T],E=S.inside,k=!!S.lookbehind,fe=!!S.greedy,le=0,Gr=S.alias;if(fe&&!S.pattern.global){let B=S.pattern.toString().match(/[imuy]*$/)[0];S.pattern=RegExp(S.pattern.source,B+"g")}S=S.pattern||S;for(let B=n,ne=i;B<r.length;ne+=r[B].length,++B){let Ie=r[B];if(r.length>e.length)return;if(Ie instanceof he)continue;if(fe&&B!=r.length-1){S.lastIndex=ne;var p=S.exec(e);if(!p)break;var c=p.index+(k?p[1].length:0),d=p.index+p[0].length,a=B,l=ne;for(let N=r.length;a<N&&(l<d||!r[a].type&&!r[a-1].greedy);++a)l+=r[a].length,c>=l&&(++B,ne=l);if(r[B]instanceof he)continue;u=a-B,Ie=e.slice(ne,l),p.index-=ne}else{S.lastIndex=0;var p=S.exec(Ie),u=1}if(!p){if(o)break;continue}k&&(le=p[1]?p[1].length:0);var c=p.index+le,p=p[0].slice(le),d=c+p.length,f=Ie.slice(0,c),g=Ie.slice(d);let K=[B,u];f&&(++B,ne+=f.length,K.push(f));let fr=new he(h,E?P.tokenize(p,E):p,Gr,p,fe);if(K.push(fr),g&&K.push(g),Array.prototype.splice.apply(r,K),u!=1&&P.matchGrammar(e,r,t,B,ne,!0,h),o)break}}}},tokenize:function(e,r){let t=[e],n=r.rest;if(n){for(let i in n)r[i]=n[i];delete r.rest}return P.matchGrammar(e,t,r,0,0,!1),t},hooks:{all:{},add:function(e,r){let t=P.hooks.all;t[e]=t[e]||[],t[e].push(r)},run:function(e,r){let t=P.hooks.all[e];if(!(!t||!t.length))for(var n=0,i;i=t[n++];)i(r)}},Token:he};P.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:/[{}[\];(),.:]/};P.languages.javascript=P.languages.extend("clike",{"class-name":[P.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}/});P.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;P.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:P.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:P.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:P.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:P.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});P.languages.markup&&P.languages.markup.tag.addInlined("script","javascript");P.languages.js=P.languages.javascript;P.languages.typescript=P.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/});P.languages.ts=P.languages.typescript;function he(e,r,t,n,i){this.type=e,this.content=r,this.alias=t,this.length=(n||"").length|0,this.greedy=!!i}he.stringify=function(e,r){return typeof e=="string"?e:Array.isArray(e)?e.map(function(t){return he.stringify(t,r)}).join(""):_p(e.type)(e.content)};function _p(e){return Ws[e]||kp}function Hs(e){return Dp(e,P.languages.javascript)}function Dp(e,r){return P.tokenize(e,r).map(n=>he.stringify(n)).join("")}function Ks(e){return bi(e)}var mn=class e{firstLineNumber;lines;static read(r){let t;try{t=Ys.default.readFileSync(r,"utf-8")}catch{return null}return e.fromContent(t)}static fromContent(r){let t=r.split(/\r?\n/);return new e(1,t)}constructor(r,t){this.firstLineNumber=r,this.lines=t}get lastLineNumber(){return this.firstLineNumber+this.lines.length-1}mapLineAt(r,t){if(r<this.firstLineNumber||r>this.lines.length+this.firstLineNumber)return this;let n=r-this.firstLineNumber,i=[...this.lines];return i[n]=t(i[n]),new e(this.firstLineNumber,i)}mapLines(r){return new e(this.firstLineNumber,this.lines.map((t,n)=>r(t,this.firstLineNumber+n)))}lineAt(r){return this.lines[r-this.firstLineNumber]}prependSymbolAt(r,t){return this.mapLines((n,i)=>i===r?`${t} ${n}`:` ${n}`)}slice(r,t){let n=this.lines.slice(r-1,t).join(`
22
- `);return new e(r,Ks(n).split(`
23
- `))}highlight(){let r=Hs(this.toString());return new e(this.firstLineNumber,r.split(`
21
+ `;console.warn(`${Oe("warn(prisma)")} ${u}`)}}}}function Rs(e){if(Oc(e)){ki(`Environment variables loaded from ${e}`);let t=Oi.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Ts(t),message:ke(`Environment variables loaded from ${Et.default.relative(process.cwd(),e)}`),path:e}}else ki(`Environment variables not found at ${e}`);return null}function Ss(e,t){return e&&t&&Et.default.resolve(e)===Et.default.resolve(t)}function Oc(e){return!!(e&&Xr.default.existsSync(e))}function _i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Di=(e,t)=>e.reduce((r,n)=>(r[t(n)]=n,r),{});function bt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function Ni(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 x(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var As=new Set,rr=(e,t,...r)=>{As.has(e)||(As.add(e),Ri(t,...r))};var R=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};x(R,"PrismaClientInitializationError");var Z=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};x(Z,"PrismaClientKnownRequestError");var ue=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};x(ue,"PrismaClientRustPanicError");var j=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};x(j,"PrismaClientUnknownRequestError");var X=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};x(X,"PrismaClientValidationError");var wt=9e15,Ye=1e9,Li="0123456789abcdef",on="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",sn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Fi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-wt,maxE:wt,crypto:!1},_s,Fe,w=!0,ln="[DecimalError] ",Ke=ln+"Invalid argument: ",Ds=ln+"Precision limit exceeded",Ns=ln+"crypto unavailable",Ls="[object Decimal]",ee=Math.floor,Q=Math.pow,_c=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Dc=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Nc=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Fs=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,b=7,Lc=9007199254740991,Fc=on.length-1,Mi=sn.length-1,m={toStringTag:Ls};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};m.ceil=function(){return y(new this.constructor(this),this.e+1,2)};m.clampedTo=m.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Ke+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};m.comparedTo=m.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};m.cosine=m.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+b,n.rounding=1,r=Mc(n,js(n,r)),n.precision=e,n.rounding=t,y(Fe==2||Fe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};m.cubeRoot=m.cbrt=function(){var e,t,r,n,i,o,s,a,l,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(w=!1,o=c.s*Q(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=H(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Q(r,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=F(u.plus(c).times(a),u.plus(l),s+2,1),H(a.d).slice(0,s)===(r=H(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return w=!0,y(n,e,p.rounding,t)};m.decimalPlaces=m.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ee(this.e/b))*b,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};m.dividedBy=m.div=function(e){return F(this,new this.constructor(e))};m.dividedToIntegerBy=m.divToInt=function(e){var t=this,r=t.constructor;return y(F(t,new r(e),0,1,1),r.precision,r.rounding)};m.equals=m.eq=function(e){return this.cmp(e)===0};m.floor=function(){return y(new this.constructor(this),this.e+1,3)};m.greaterThan=m.gt=function(e){return this.cmp(e)>0};m.greaterThanOrEqualTo=m.gte=function(e){var t=this.cmp(e);return t==1||t===0};m.hyperbolicCosine=m.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/cn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=xt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=r,s.rounding=n,!0)};m.hyperbolicSine=m.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=xt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/cn(5,e)),i=xt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,y(i,t,r,!0)};m.hyperbolicTangent=m.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,F(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};m.inverseCosine=m.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?xe(t,n,i):new t(0):new t(NaN):e.isZero()?xe(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};m.inverseHyperbolicCosine=m.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,w=!1,r=r.times(r).minus(1).sqrt().plus(r),w=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};m.inverseHyperbolicSine=m.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,w=!1,r=r.times(r).plus(1).sqrt().plus(r),w=!0,n.precision=e,n.rounding=t,r.ln())};m.inverseHyperbolicTangent=m.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?y(new o(i),e,t,!0):(o.precision=r=n-i.e,i=F(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};m.inverseSine=m.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=xe(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};m.inverseTangent=m.atan=function(){var e,t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=Mi)return s=xe(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=Mi)return s=xe(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/b+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(w=!1,t=Math.ceil(a/b),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),w=!0,y(s,c.precision=p,c.rounding=d,!0)};m.isFinite=function(){return!!this.d};m.isInteger=m.isInt=function(){return!!this.d&&ee(this.e/b)>this.d.length-2};m.isNaN=function(){return!this.s};m.isNegative=m.isNeg=function(){return this.s<0};m.isPositive=m.isPos=function(){return this.s>0};m.isZero=function(){return!!this.d&&this.d[0]===0};m.lessThan=m.lt=function(e){return this.cmp(e)<0};m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1};m.logarithm=m.log=function(e){var t,r,n,i,o,s,a,l,u=this,c=u.constructor,p=c.precision,d=c.rounding,f=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(w=!1,a=p+f,s=He(u,a),n=t?an(c,a+10):He(e,a),l=F(s,n,a,1),nr(l.d,i=p,d))do if(a+=10,s=He(u,a),n=t?an(c,a+10):He(e,a),l=F(s,n,a,1),!o){+H(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(nr(l.d,i+=10,d));return w=!0,y(l,p,d)};m.minus=m.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,f=this,g=f.constructor;if(e=new g(e),!f.d||!e.d)return!f.s||!e.s?e=new g(NaN):f.d?e.s=-e.s:e=new g(e.d||f.s!==e.s?f:NaN),e;if(f.s!=e.s)return e.s=-e.s,f.plus(e);if(u=f.d,d=e.d,a=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(f);else return new g(l===3?-0:0);return w?y(e,a,l):e}if(r=ee(e.e/b),c=ee(f.e/b),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/b),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(u[n]!=d[n]){p=u[n]<d[n];break}o=0}for(p&&(t=u,u=d,d=t,e.s=-e.s),s=u.length,n=d.length-s;n>0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]<d[n]){for(i=n;i&&u[--i]===0;)u[i]=ge-1;--u[i],u[n]+=ge}u[n]-=d[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=un(u,r),w?y(e,a,l):e):new g(l===3?-0:0)};m.modulo=m.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?y(new n(r),n.precision,n.rounding):(w=!1,n.modulo==9?(t=F(r,e.abs(),0,3,1),t.s*=e.s):t=F(r,e,0,n.modulo,1),t=t.times(e),w=!0,r.minus(t))};m.naturalExponential=m.exp=function(){return $i(this)};m.naturalLogarithm=m.ln=function(){return He(this)};m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s,y(e)};m.plus=m.add=function(e){var t,r,n,i,o,s,a,l,u,c,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(u=p.d,c=e.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(p)),w?y(e,a,l):e;if(o=ee(p.e/b),n=ee(e.e/b),u=u.slice(),i=o-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=o,s=u.length),o=Math.ceil(a/b),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=un(u,n),w?y(e,a,l):e};m.precision=m.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ke+e);return r.d?(t=Ms(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};m.round=function(){var e=this,t=e.constructor;return y(new t(e),e.e+1,t.rounding)};m.sine=m.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+b,n.rounding=1,r=qc(n,js(n,r)),n.precision=e,n.rounding=t,y(Fe>2?r.neg():r,e,t,!0)):new n(NaN)};m.squareRoot=m.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(w=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=H(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=ee((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(F(s,o,r+2,1)).times(.5),H(o.d).slice(0,r)===(t=H(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return w=!0,y(n,l,c.rounding,e)};m.tangent=m.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=F(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,y(Fe==2||Fe==4?r.neg():r,e,t,!0)):new n(NaN)};m.times=m.mul=function(e){var t,r,n,i,o,s,a,l,u,c=this,p=c.constructor,d=c.d,f=(e=new p(e)).d;if(e.s*=c.s,!d||!d[0]||!f||!f[0])return new p(!e.s||d&&!d[0]&&!f||f&&!f[0]&&!d?NaN:!d||!f?e.s/0:e.s*0);for(r=ee(c.e/b)+ee(e.e/b),l=d.length,u=f.length,l<u&&(o=d,d=f,f=o,s=l,l=u,u=s),o=[],s=l+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+f[n]*d[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=un(o,r),w?y(e,p.precision,p.rounding):e};m.toBinary=function(e,t){return qi(this,2,e,t)};m.toDecimalPlaces=m.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(oe(e,0,Ye),t===void 0?t=n.rounding:oe(t,0,8),y(r,e+r.e+1,t))};m.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Pe(n,!0):(oe(e,0,Ye),t===void 0?t=i.rounding:oe(t,0,8),n=y(new i(n),e+1,t),r=Pe(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=Pe(i):(oe(e,0,Ye),t===void 0?t=o.rounding:oe(t,0,8),n=y(new o(i),e+i.e+1,t),r=Pe(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};m.toFraction=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,f=this,g=f.d,h=f.constructor;if(!g)return new h(f);if(u=r=new h(1),n=l=new h(0),t=new h(n),o=t.e=Ms(g)-f.e-1,s=o%b,t.d[0]=Q(10,s<0?b+s:s),e==null)e=o>0?t:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Ke+a);e=a.gt(t)?o>0?t:u:a}for(w=!1,a=new h(H(g)),c=h.precision,h.precision=o=g.length*b*2;p=F(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=F(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=f.s,d=F(u,n,o,1).minus(f).abs().cmp(F(l,r,o,1).minus(f).abs())<1?[u,n]:[l,r],h.precision=c,w=!0,d};m.toHexadecimal=m.toHex=function(e,t){return qi(this,16,e,t)};m.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:oe(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(w=!1,r=F(r,e,0,t,1).times(e),w=!0,y(r)):(e.s=r.s,r=e),r};m.toNumber=function(){return+this};m.toOctal=function(e,t){return qi(this,8,e,t)};m.toPower=m.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(t=ee(e.e/b),t>=e.d.length-1&&(r=u<0?-u:u)<=Lc)return i=$s(l,a,r,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if(e.d[t]&1||(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=Q(+a,u),t=r==0||!isFinite(r)?ee(u*(Math.log("0."+H(a.d))/Math.LN10+a.e+1)):new l(r+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(w=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=$i(e.times(He(a,n+r)),n),i.d&&(i=y(i,n+5,1),nr(i.d,n,o)&&(t=n+10,i=y($i(e.times(He(a,t+r)),t),t+5,1),+H(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,w=!0,l.rounding=o,y(i,n,o))};m.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Pe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(oe(e,1,Ye),t===void 0?t=i.rounding:oe(t,0,8),n=y(new i(n),e,t),r=Pe(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};m.toSignificantDigits=m.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(oe(e,1,Ye),t===void 0?t=n.rounding:oe(t,0,8)),y(new n(r),e,t)};m.toString=function(){var e=this,t=e.constructor,r=Pe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};m.truncated=m.trunc=function(){return y(new this.constructor(this),this.e+1,1)};m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,r=Pe(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function H(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=b-n.length,r&&(o+=We(r)),o+=n;s=e[t],n=s+"",r=b-n.length,r&&(o+=We(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function oe(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Ke+e)}function nr(e,t,r,n){var i,o,s,a;for(o=e[0];o>=10;o/=10)--t;return--t<0?(t+=b,i=0):(i=Math.ceil((t+1)/b),t%=b),o=Q(10,b-t),a=e[i]%o|0,n==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),s=r<4&&a==99999||r>3&&a==49999||a==5e4||a==0):s=(r<4&&a+1==o||r>3&&a+1==o/2)&&(e[i+1]/o/100|0)==Q(10,t-2)-1||(a==o/2||a==0)&&(e[i+1]/o/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),s=(n||r<4)&&a==9999||!n&&r>3&&a==4999):s=((n||r<4)&&a+1==o||!n&&r>3&&a+1==o/2)&&(e[i+1]/o/1e3|0)==Q(10,t-3)-1,s}function rn(e,t,r){for(var n,i=[0],o,s=0,a=e.length;s<a;){for(o=i.length;o--;)i[o]*=t;for(i[0]+=Li.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(i[n+1]===void 0&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}function Mc(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?(r=Math.ceil(n/3),i=(1/cn(4,r)).toString()):(r=16,i="2.3283064365386962890625e-10"),e.precision+=r,t=xt(e,1,t.times(i),new e(1));for(var o=r;o--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=r,t}var F=function(){function e(n,i,o){var s,a=0,l=n.length;for(n=n.slice();l--;)s=n[l]*i+a,n[l]=s%o|0,a=s/o|0;return a&&n.unshift(a),n}function t(n,i,o,s){var a,l;if(o!=s)l=o>s?1:-1;else for(a=l=0;a<o;a++)if(n[a]!=i[a]){l=n[a]>i[a]?1:-1;break}return l}function r(n,i,o,s){for(var a=0;o--;)n[o]-=a,a=n[o]<i[o]?1:0,n[o]=a*s+n[o]-i[o];for(;!n[0]&&n.length>1;)n.shift()}return function(n,i,o,s,a,l){var u,c,p,d,f,g,h,I,T,S,E,k,fe,le,Gt,B,ne,Ie,K,mt,Fr=n.constructor,Hn=n.s==i.s?1:-1,Y=n.d,N=i.d;if(!Y||!Y[0]||!N||!N[0])return new Fr(!n.s||!i.s||(Y?N&&Y[0]==N[0]:!N)?NaN:Y&&Y[0]==0||!N?Hn*0:Hn/0);for(l?(f=1,c=n.e-i.e):(l=ge,f=b,c=ee(n.e/f)-ee(i.e/f)),K=N.length,ne=Y.length,T=new Fr(Hn),S=T.d=[],p=0;N[p]==(Y[p]||0);p++);if(N[p]>(Y[p]||0)&&c--,o==null?(le=o=Fr.precision,s=Fr.rounding):a?le=o+(n.e-i.e)+1:le=o,le<0)S.push(1),g=!0;else{if(le=le/f+2|0,p=0,K==1){for(d=0,N=N[0],le++;(p<ne||d)&&le--;p++)Gt=d*l+(Y[p]||0),S[p]=Gt/N|0,d=Gt%N|0;g=d||p<ne}else{for(d=l/(N[0]+1)|0,d>1&&(N=e(N,d,l),Y=e(Y,d,l),K=N.length,ne=Y.length),B=K,E=Y.slice(0,K),k=E.length;k<K;)E[k++]=0;mt=N.slice(),mt.unshift(0),Ie=N[0],N[1]>=l/2&&++Ie;do d=0,u=t(N,E,K,k),u<0?(fe=E[0],K!=k&&(fe=fe*l+(E[1]||0)),d=fe/Ie|0,d>1?(d>=l&&(d=l-1),h=e(N,d,l),I=h.length,k=E.length,u=t(h,E,I,k),u==1&&(d--,r(h,K<I?mt:N,I,l))):(d==0&&(u=d=1),h=N.slice()),I=h.length,I<k&&h.unshift(0),r(E,h,k,l),u==-1&&(k=E.length,u=t(N,E,K,k),u<1&&(d++,r(E,K<k?mt:N,k,l))),k=E.length):u===0&&(d++,E=[0]),S[p++]=d,u&&E[0]?E[k++]=Y[B]||0:(E=[Y[B]],k=1);while((B++<ne||E[0]!==void 0)&&le--);g=E[0]!==void 0}S[0]||S.shift()}if(f==1)T.e=c,_s=g;else{for(p=1,d=S[0];d>=10;d/=10)p++;T.e=p+c*f-1,y(T,a?o+T.e+1:o,s,g)}return T}}();function y(e,t,r,n){var i,o,s,a,l,u,c,p,d,f=e.constructor;e:if(t!=null){if(p=e.d,!p)return e;for(i=1,a=p[0];a>=10;a/=10)i++;if(o=t-i,o<0)o+=b,s=t,c=p[d=0],l=c/Q(10,i-s-1)%10|0;else if(d=Math.ceil((o+1)/b),a=p.length,d>=a)if(n){for(;a++<=d;)p.push(0);c=l=0,i=1,o%=b,s=o-b+1}else break e;else{for(c=a=p[d],i=1;a>=10;a/=10)i++;o%=b,s=o-b+i,l=s<0?0:c/Q(10,i-s-1)%10|0}if(n=n||t<0||p[d+1]!==void 0||(s<0?c:c%Q(10,i-s-1)),u=r<4?(l||n)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||n||r==6&&(o>0?s>0?c/Q(10,i-s):0:p[d-1])%10&1||r==(e.s<0?8:7)),t<1||!p[0])return p.length=0,u?(t-=e.e+1,p[0]=Q(10,(b-t%b)%b),e.e=-t||0):p[0]=e.e=0,e;if(o==0?(p.length=d,a=1,d--):(p.length=d+1,a=Q(10,b-o),p[d]=s>0?(c/Q(10,i-s)%Q(10,s)|0)*a:0),u)for(;;)if(d==0){for(o=1,s=p[0];s>=10;s/=10)o++;for(s=p[0]+=a,a=1;s>=10;s/=10)a++;o!=a&&(e.e++,p[0]==ge&&(p[0]=1));break}else{if(p[d]+=a,p[d]!=ge)break;p[d--]=0,a=1}for(o=p.length;p[--o]===0;)p.pop()}return w&&(e.e>f.maxE?(e.d=null,e.e=NaN):e.e<f.minE&&(e.e=0,e.d=[0])),e}function Pe(e,t,r){if(!e.isFinite())return Vs(e);var n,i=e.e,o=H(e.d),s=o.length;return t?(r&&(n=r-s)>0?o=o.charAt(0)+"."+o.slice(1)+We(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(e.e<0?"e":"e+")+e.e):i<0?(o="0."+We(-i-1)+o,r&&(n=r-s)>0&&(o+=We(n))):i>=s?(o+=We(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+We(n))):((n=i+1)<s&&(o=o.slice(0,n)+"."+o.slice(n)),r&&(n=r-s)>0&&(i+1===s&&(o+="."),o+=We(n))),o}function un(e,t){var r=e[0];for(t*=b;r>=10;r/=10)t++;return t}function an(e,t,r){if(t>Fc)throw w=!0,r&&(e.precision=r),Error(Ds);return y(new e(on),t,1,!0)}function xe(e,t,r){if(t>Mi)throw Error(Ds);return y(new e(sn),t,r,!0)}function Ms(e){var t=e.length-1,r=t*b+1;if(t=e[t],t){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function We(e){for(var t="";e--;)t+="0";return t}function $s(e,t,r,n){var i,o=new e(1),s=Math.ceil(n/b+4);for(w=!1;;){if(r%2&&(o=o.times(t),ks(o.d,s)&&(i=!0)),r=ee(r/2),r===0){r=o.d.length-1,i&&o.d[r]===0&&++o.d[r];break}t=t.times(t),ks(t.d,s)}return w=!0,o}function Is(e){return e.d[e.d.length-1]&1}function qs(e,t,r){for(var n,i,o=new e(t[0]),s=0;++s<t.length;){if(i=new e(t[s]),!i.s){o=i;break}n=o.cmp(i),(n===r||n===0&&o.s===r)&&(o=i)}return o}function $i(e,t){var r,n,i,o,s,a,l,u=0,c=0,p=0,d=e.constructor,f=d.rounding,g=d.precision;if(!e.d||!e.d[0]||e.e>17)return new d(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(w=!1,l=g):l=t,a=new d(.03125);e.e>-2;)e=e.times(a),p+=5;for(n=Math.log(Q(2,p))/Math.LN10*2+5|0,l+=n,r=o=s=new d(1),d.precision=l;;){if(o=y(o.times(e),l,1),r=r.times(++c),a=s.plus(F(o,r,l,1)),H(a.d).slice(0,l)===H(s.d).slice(0,l)){for(i=p;i--;)s=y(s.times(s),l,1);if(t==null)if(u<3&&nr(s.d,l-n,f,u))d.precision=l+=10,r=o=a=new d(1),c=0,u++;else return y(s,d.precision=g,f,w=!0);else return d.precision=g,s}s=a}}function He(e,t){var r,n,i,o,s,a,l,u,c,p,d,f=1,g=10,h=e,I=h.d,T=h.constructor,S=T.rounding,E=T.precision;if(h.s<0||!I||!I[0]||!h.e&&I[0]==1&&I.length==1)return new T(I&&!I[0]?-1/0:h.s!=1?NaN:I?0:h);if(t==null?(w=!1,c=E):c=t,T.precision=c+=g,r=H(I),n=r.charAt(0),Math.abs(o=h.e)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)h=h.times(e),r=H(h.d),n=r.charAt(0),f++;o=h.e,n>1?(h=new T("0."+r),o++):h=new T(n+"."+r.slice(1))}else return u=an(T,c+2,E).times(o+""),h=He(new T(n+"."+r.slice(1)),c-g).plus(u),T.precision=E,t==null?y(h,E,S,w=!0):h;for(p=h,l=s=h=F(h.minus(1),h.plus(1),c,1),d=y(h.times(h),c,1),i=3;;){if(s=y(s.times(d),c,1),u=l.plus(F(s,new T(i),c,1)),H(u.d).slice(0,c)===H(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(an(T,c+2,E).times(o+""))),l=F(l,new T(f),c,1),t==null)if(nr(l.d,c-g,S,a))T.precision=c+=g,u=s=h=F(p.minus(1),p.plus(1),c,1),d=y(h.times(h),c,1),i=a=1;else return y(l,T.precision=E,S,w=!0);else return T.precision=E,l;l=u,i+=2}}function Vs(e){return String(e.s*e.s/0)}function nn(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;n++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(n,i),t){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%b,r<0&&(n+=b),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=b;n<i;)e.d.push(+t.slice(n,n+=b));t=t.slice(n),n=b-t.length}else n-=i;for(;n--;)t+="0";e.d.push(+t),w&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function $c(e,t){var r,n,i,o,s,a,l,u,c;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),Fs.test(t))return nn(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Dc.test(t))r=16,t=t.toLowerCase();else if(_c.test(t))r=2;else if(Nc.test(t))r=8;else throw Error(Ke+t);for(o=t.search(/p/i),o>0?(l=+t.slice(o+1),t=t.substring(2,o)):t=t.slice(2),o=t.indexOf("."),s=o>=0,n=e.constructor,s&&(t=t.replace(".",""),a=t.length,o=a-o,i=$s(n,new n(r),o,o*2)),u=rn(t,r,ge),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new n(e.s*0):(e.e=un(u,c),e.d=u,w=!1,s&&(e=F(e,i,a*4)),l&&(e=e.times(Math.abs(l)<54?Q(2,l):ot.pow(2,l))),w=!0,e)}function qc(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:xt(e,2,t,t);r=1.4*Math.sqrt(n),r=r>16?16:r|0,t=t.times(1/cn(5,r)),t=xt(e,2,t,t);for(var i,o=new e(5),s=new e(16),a=new e(20);r--;)i=t.times(t),t=t.times(o.plus(i.times(s.times(i).minus(a))));return t}function xt(e,t,r,n,i){var o,s,a,l,u=1,c=e.precision,p=Math.ceil(c/b);for(w=!1,l=r.times(r),a=new e(n);;){if(s=F(a.times(l),new e(t++*t++),c,1),a=i?n.plus(s):n.minus(s),n=F(s.times(l),new e(t++*t++),c,1),s=a.plus(n),s.d[p]!==void 0){for(o=p;s.d[o]===a.d[o]&&o--;);if(o==-1)break}o=a,a=n,n=s,s=o,u++}return w=!0,s.d.length=p+1,s}function cn(e,t){for(var r=e;--t;)r*=e;return r}function js(e,t){var r,n=t.s<0,i=xe(e,e.precision,1),o=i.times(.5);if(t=t.abs(),t.lte(o))return Fe=n?4:1,t;if(r=t.divToInt(i),r.isZero())Fe=n?3:2;else{if(t=t.minus(r.times(i)),t.lte(o))return Fe=Is(r)?n?2:3:n?4:1,t;Fe=Is(r)?n?1:4:n?3:2}return t.minus(i).abs()}function qi(e,t,r,n){var i,o,s,a,l,u,c,p,d,f=e.constructor,g=r!==void 0;if(g?(oe(r,1,Ye),n===void 0?n=f.rounding:oe(n,0,8)):(r=f.precision,n=f.rounding),!e.isFinite())c=Vs(e);else{for(c=Pe(e),s=c.indexOf("."),g?(i=2,t==16?r=r*4-3:t==8&&(r=r*3-2)):i=t,s>=0&&(c=c.replace(".",""),d=new f(1),d.e=c.length-s,d.d=rn(Pe(d),10,i),d.e=d.d.length),p=rn(c,10,i),o=l=p.length;p[--l]==0;)p.pop();if(!p[0])c=g?"0p+0":"0";else{if(s<0?o--:(e=new f(e),e.d=p,e.e=o,e=F(e,d,r,n,0,i),p=e.d,o=e.e,u=_s),s=p[r],a=i/2,u=u||p[r+1]!==void 0,u=n<4?(s!==void 0||u)&&(n===0||n===(e.s<0?3:2)):s>a||s===a&&(n===4||u||n===6&&p[r-1]&1||n===(e.s<0?8:7)),p.length=r,u)for(;++p[--r]>i-1;)p[r]=0,r||(++o,p.unshift(1));for(l=p.length;!p[l-1];--l);for(s=0,c="";s<l;s++)c+=Li.charAt(p[s]);if(g){if(l>1)if(t==16||t==8){for(s=t==16?4:3,--l;l%s;l++)c+="0";for(p=rn(c,i,t),l=p.length;!p[l-1];--l);for(s=1,c="1.";s<l;s++)c+=Li.charAt(p[s])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}c=(t==16?"0x":t==2?"0b":t==8?"0o":"")+c}return e.s<0?"-"+c:c}function ks(e,t){if(e.length>t)return e.length=t,!0}function Vc(e){return new this(e).abs()}function jc(e){return new this(e).acos()}function Bc(e){return new this(e).acosh()}function Uc(e,t){return new this(e).plus(t)}function Qc(e){return new this(e).asin()}function Gc(e){return new this(e).asinh()}function Jc(e){return new this(e).atan()}function Wc(e){return new this(e).atanh()}function Hc(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,o=n+4;return!e.s||!t.s?r=new this(NaN):!e.d&&!t.d?(r=xe(this,o,1).times(t.s>0?.25:.75),r.s=e.s):!t.d||e.isZero()?(r=t.s<0?xe(this,n,i):new this(0),r.s=e.s):!e.d||t.isZero()?(r=xe(this,o,1).times(.5),r.s=e.s):t.s<0?(this.precision=o,this.rounding=1,r=this.atan(F(e,t,o,1)),t=xe(this,o,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(F(e,t,o,1)),r}function Kc(e){return new this(e).cbrt()}function Yc(e){return y(e=new this(e),e.e+1,2)}function zc(e,t,r){return new this(e).clamp(t,r)}function Zc(e){if(!e||typeof e!="object")throw Error(ln+"Object expected");var t,r,n,i=e.defaults===!0,o=["precision",1,Ye,"rounding",0,8,"toExpNeg",-wt,0,"toExpPos",0,wt,"maxE",0,wt,"minE",-wt,0,"modulo",0,9];for(t=0;t<o.length;t+=3)if(r=o[t],i&&(this[r]=Fi[r]),(n=e[r])!==void 0)if(ee(n)===n&&n>=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Ke+r+": "+n);if(r="crypto",i&&(this[r]=Fi[r]),(n=e[r])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(Ns);else this[r]=!1;else throw Error(Ke+r+": "+n);return this}function Xc(e){return new this(e).cos()}function ep(e){return new this(e).cosh()}function Bs(e){var t,r,n;function i(o){var s,a,l,u=this;if(!(u instanceof i))return new i(o);if(u.constructor=i,Os(o)){u.s=o.s,w?!o.d||o.e>i.maxE?(u.e=NaN,u.d=null):o.e<i.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(l=typeof o,l==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(s=0,a=o;a>=10;a/=10)s++;w?s>i.maxE?(u.e=NaN,u.d=null):s<i.minE?(u.e=0,u.d=[0]):(u.e=s,u.d=[o]):(u.e=s,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return nn(u,o.toString())}if(l==="string")return(a=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(a===43&&(o=o.slice(1)),u.s=1),Fs.test(o)?nn(u,o):$c(u,o);if(l==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,nn(u,o.toString());throw Error(Ke+o)}if(i.prototype=m,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Zc,i.clone=Bs,i.isDecimal=Os,i.abs=Vc,i.acos=jc,i.acosh=Bc,i.add=Uc,i.asin=Qc,i.asinh=Gc,i.atan=Jc,i.atanh=Wc,i.atan2=Hc,i.cbrt=Kc,i.ceil=Yc,i.clamp=zc,i.cos=Xc,i.cosh=ep,i.div=tp,i.exp=rp,i.floor=np,i.hypot=ip,i.ln=op,i.log=sp,i.log10=lp,i.log2=ap,i.max=up,i.min=cp,i.mod=pp,i.mul=dp,i.pow=mp,i.random=fp,i.round=gp,i.sign=hp,i.sin=yp,i.sinh=Ep,i.sqrt=bp,i.sub=wp,i.sum=xp,i.tan=Pp,i.tanh=vp,i.trunc=Tp,e===void 0&&(e={}),e&&e.defaults!==!0)for(n=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<n.length;)e.hasOwnProperty(r=n[t++])||(e[r]=this[r]);return i.config(e),i}function tp(e,t){return new this(e).div(t)}function rp(e){return new this(e).exp()}function np(e){return y(e=new this(e),e.e+1,3)}function ip(){var e,t,r=new this(0);for(w=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return w=!0,new this(1/0);r=t}return w=!0,r.sqrt()}function Os(e){return e instanceof ot||e&&e.toStringTag===Ls||!1}function op(e){return new this(e).ln()}function sp(e,t){return new this(e).log(t)}function ap(e){return new this(e).log(2)}function lp(e){return new this(e).log(10)}function up(){return qs(this,arguments,-1)}function cp(){return qs(this,arguments,1)}function pp(e,t){return new this(e).mod(t)}function dp(e,t){return new this(e).mul(t)}function mp(e,t){return new this(e).pow(t)}function fp(e){var t,r,n,i,o=0,s=new this(1),a=[];if(e===void 0?e=this.precision:oe(e,1,Ye),n=Math.ceil(e/b),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));o<n;)i=t[o],i>=429e7?t[o]=crypto.getRandomValues(new Uint32Array(1))[0]:a[o++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(n*=4);o<n;)i=t[o]+(t[o+1]<<8)+(t[o+2]<<16)+((t[o+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,o):(a.push(i%1e7),o+=4);o=n/4}else throw Error(Ns);else for(;o<n;)a[o++]=Math.random()*1e7|0;for(n=a[--o],e%=b,n&&e&&(i=Q(10,b-e),a[o]=(n/i|0)*i);a[o]===0;o--)a.pop();if(o<0)r=0,a=[0];else{for(r=-1;a[0]===0;r-=b)a.shift();for(n=1,i=a[0];i>=10;i/=10)n++;n<b&&(r-=b-n)}return s.e=r,s.d=a,s}function gp(e){return y(e=new this(e),e.e+1,this.rounding)}function hp(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function yp(e){return new this(e).sin()}function Ep(e){return new this(e).sinh()}function bp(e){return new this(e).sqrt()}function wp(e,t){return new this(e).sub(t)}function xp(){var e=0,t=arguments,r=new this(t[e]);for(w=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return w=!0,y(r,this.precision,this.rounding)}function Pp(e){return new this(e).tan()}function vp(e){return new this(e).tanh()}function Tp(e){return y(e=new this(e),e.e+1,1)}m[Symbol.for("nodejs.util.inspect.custom")]=m.toString;m[Symbol.toStringTag]="Decimal";var ot=m.constructor=Bs(Fi);on=new ot(on);sn=new ot(sn);var ve=ot;function Pt(e){return e===null?e:Array.isArray(e)?e.map(Pt):typeof e=="object"?Rp(e)?Sp(e):bt(e,Pt):e}function Rp(e){return e!==null&&typeof e=="object"&&typeof e.$type=="string"}function Sp({$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 ve(t);case"Json":return JSON.parse(t);default:Ne(t,"Unknown tagged value")}}function vt(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Tt(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function pn(e){return e.toString()!=="Invalid Date"}function Rt(e){return ot.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 ir=(E=>(E.findUnique="findUnique",E.findUniqueOrThrow="findUniqueOrThrow",E.findFirst="findFirst",E.findFirstOrThrow="findFirstOrThrow",E.findMany="findMany",E.create="create",E.createMany="createMany",E.createManyAndReturn="createManyAndReturn",E.update="update",E.updateMany="updateMany",E.updateManyAndReturn="updateManyAndReturn",E.upsert="upsert",E.delete="delete",E.deleteMany="deleteMany",E.groupBy="groupBy",E.count="count",E.aggregate="aggregate",E.findRaw="findRaw",E.aggregateRaw="aggregateRaw",E))(ir||{});var Hs=O(Pi());var Ws=O(require("fs"));var Qs={keyword:_e,entity:_e,value:e=>W(rt(e)),punctuation:rt,directive:_e,function:_e,variable:e=>W(rt(e)),string:e=>W(Ve(e)),boolean:Oe,number:_e,comment:Wt};var Cp=e=>e,dn={},Ap=0,P={manual:dn.Prism&&dn.Prism.manual,disableWorkerMessageHandler:dn.Prism&&dn.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof he){let t=e;return new he(t.type,P.util.encode(t.content),t.alias)}else return Array.isArray(e)?e.map(P.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:++Ap}),e.__id},clone:function e(t,r){let n,i,o=P.util.type(t);switch(r=r||{},o){case"Object":if(i=P.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=P.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=P.util.clone(P.languages[e]);for(let n in t)r[n]=t[n];return r},insertBefore:function(e,t,r,n){n=n||P.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,P.languages.DFS(P.languages,function(a,l){l===s&&a!=e&&(this[a]=o)}),o},DFS:function e(t,r,n,i){i=i||{};let o=P.util.objId;for(let s in t)if(t.hasOwnProperty(s)){r.call(t,s,t[s],n||s);let a=t[s],l=P.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 P.hooks.run("before-tokenize",n),n.tokens=P.tokenize(n.code,n.grammar),P.hooks.run("after-tokenize",n),he.stringify(P.util.encode(n.tokens),n.language)},matchGrammar:function(e,t,r,n,i,o,s){for(let h in r){if(!r.hasOwnProperty(h)||!r[h])continue;if(h==s)return;let I=r[h];I=P.util.type(I)==="Array"?I:[I];for(let T=0;T<I.length;++T){let S=I[T],E=S.inside,k=!!S.lookbehind,fe=!!S.greedy,le=0,Gt=S.alias;if(fe&&!S.pattern.global){let B=S.pattern.toString().match(/[imuy]*$/)[0];S.pattern=RegExp(S.pattern.source,B+"g")}S=S.pattern||S;for(let B=n,ne=i;B<t.length;ne+=t[B].length,++B){let Ie=t[B];if(t.length>e.length)return;if(Ie instanceof he)continue;if(fe&&B!=t.length-1){S.lastIndex=ne;var p=S.exec(e);if(!p)break;var c=p.index+(k?p[1].length:0),d=p.index+p[0].length,a=B,l=ne;for(let N=t.length;a<N&&(l<d||!t[a].type&&!t[a-1].greedy);++a)l+=t[a].length,c>=l&&(++B,ne=l);if(t[B]instanceof he)continue;u=a-B,Ie=e.slice(ne,l),p.index-=ne}else{S.lastIndex=0;var p=S.exec(Ie),u=1}if(!p){if(o)break;continue}k&&(le=p[1]?p[1].length:0);var c=p.index+le,p=p[0].slice(le),d=c+p.length,f=Ie.slice(0,c),g=Ie.slice(d);let K=[B,u];f&&(++B,ne+=f.length,K.push(f));let mt=new he(h,E?P.tokenize(p,E):p,Gt,p,fe);if(K.push(mt),g&&K.push(g),Array.prototype.splice.apply(t,K),u!=1&&P.matchGrammar(e,t,r,B,ne,!0,h),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 P.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){let r=P.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){let r=P.hooks.all[e];if(!(!r||!r.length))for(var n=0,i;i=r[n++];)i(t)}},Token:he};P.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:/[{}[\];(),.:]/};P.languages.javascript=P.languages.extend("clike",{"class-name":[P.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}/});P.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;P.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:P.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:P.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:P.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:P.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});P.languages.markup&&P.languages.markup.tag.addInlined("script","javascript");P.languages.js=P.languages.javascript;P.languages.typescript=P.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/});P.languages.ts=P.languages.typescript;function he(e,t,r,n,i){this.type=e,this.content=t,this.alias=r,this.length=(n||"").length|0,this.greedy=!!i}he.stringify=function(e,t){return typeof e=="string"?e:Array.isArray(e)?e.map(function(r){return he.stringify(r,t)}).join(""):Ip(e.type)(e.content)};function Ip(e){return Qs[e]||Cp}function Gs(e){return kp(e,P.languages.javascript)}function kp(e,t){return P.tokenize(e,t).map(n=>he.stringify(n)).join("")}function Js(e){return bi(e)}var mn=class e{firstLineNumber;lines;static read(t){let r;try{r=Ws.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(`
22
+ `);return new e(t,Js(n).split(`
23
+ `))}highlight(){let t=Gs(this.toString());return new e(this.firstLineNumber,t.split(`
24
24
  `))}toString(){return this.lines.join(`
25
- `)}};var Np={red:pe,gray:Wr,dim:ke,bold:W,underline:z,highlightSource:e=>e.highlight()},Lp={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Fp({message:e,originalMethod:r,isPanic:t,callArguments:n}){return{functionName:`prisma.${r}()`,message:e,isPanic:t??!1,callArguments:n}}function Mp({callsite:e,message:r,originalMethod:t,isPanic:n,callArguments:i},o){let s=Fp({message:r,originalMethod:t,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=mn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=qp(c),d=$p(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 f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(f))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+f+1;g+=2,s.callArguments=(0,zs.default)(i,g).slice(g)}}return s}function $p(e){let r=Object.keys(ot).join("|"),n=new RegExp(String.raw`\.(${r})\(`).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 qp(e){let r=0;for(let t=0;t<e.length;t++){if(e.charAt(t)!==" ")return r;r++}return r}function Vp({functionName:e,location:r,message:t,isPanic:n,contextLines:i,callArguments:o},s){let a=[""],l=r?" 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}`)),r&&a.push(s.underline(jp(r))),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(t),a.join(`
26
- `)}function jp(e){let r=[e.fileName];return e.lineNumber&&r.push(String(e.lineNumber)),e.columnNumber&&r.push(String(e.columnNumber)),r.join(":")}function fn(e){let r=e.showColors?Np:Lp,t;return t=Mp(e,r),Vp(t,r)}var sa=O(Vi());function ra(e,r,t){let n=ta(e),i=Bp(n),o=Qp(i);o?gn(o,r,t):r.addErrorMessage(()=>"Unknown error")}function ta(e){return e.errors.flatMap(r=>r.kind==="Union"?ta(r):[r])}function Bp(e){let r=new Map,t=[];for(let n of e){if(n.kind!=="InvalidArgumentType"){t.push(n);continue}let i=`${n.selectionPath.join(".")}:${n.argumentPath.join(".")}`,o=r.get(i);o?r.set(i,{...n,argument:{...n.argument,typeNames:Up(o.argument.typeNames,n.argument.typeNames)}}):r.set(i,n)}return t.push(...r.values()),t}function Up(e,r){return[...new Set(e.concat(r))]}function Qp(e){return Di(e,(r,t)=>{let n=Xs(r),i=Xs(t);return n!==i?n-i:ea(r)-ea(t)})}function Xs(e){let r=0;return Array.isArray(e.selectionPath)&&(r+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(r+=e.argumentPath.length),r}function ea(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var ce=class{constructor(r,t){this.name=r;this.value=t}isRequired=!1;makeRequired(){return this.isRequired=!0,this}write(r){let{colors:{green:t}}=r.context;r.addMarginSymbol(t(this.isRequired?"+":"?")),r.write(t(this.name)),this.isRequired||r.write(t("?")),r.write(t(": ")),typeof this.value=="string"?r.write(t(this.value)):r.write(this.value)}};ia();var Sr=class{constructor(r=0,t){this.context=t;this.currentIndent=r}lines=[];currentLine="";currentIndent=0;marginSymbol;afterNextNewLineCallback;write(r){return typeof r=="string"?this.currentLine+=r:r.write(this),this}writeJoined(r,t,n=(i,o)=>o.write(i)){let i=t.length-1;for(let o=0;o<t.length;o++)n(t[o],this),o!==i&&this.write(r);return this}writeLine(r){return this.write(r).newLine()}newLine(){this.lines.push(this.indentedCurrentLine()),this.currentLine="",this.marginSymbol=void 0;let r=this.afterNextNewLineCallback;return this.afterNextNewLineCallback=void 0,r?.(),this}withIndent(r){return this.indent(),r(this),this.unindent(),this}afterNextNewline(r){return this.afterNextNewLineCallback=r,this}indent(){return this.currentIndent++,this}unindent(){return this.currentIndent>0&&this.currentIndent--,this}addMarginSymbol(r){return this.marginSymbol=r,this}toString(){return this.lines.concat(this.indentedCurrentLine()).join(`
27
- `)}getCurrentLineLength(){return this.currentLine.length}indentedCurrentLine(){let r=this.currentLine.padStart(this.currentLine.length+2*this.currentIndent);return this.marginSymbol?this.marginSymbol+r.slice(1):r}};na();var hn=class{constructor(r){this.value=r}write(r){r.write(this.value)}markAsError(){this.value.markAsError()}};var yn=e=>e,En={bold:yn,red:yn,green:yn,dim:yn,enabled:!1},oa={bold:W,red:pe,green:Ve,dim:ke,enabled:!0},Cr={write(e){e.writeLine(",")}};var Re=class{constructor(r){this.contents=r}isUnderlined=!1;color=r=>r;underline(){return this.isUnderlined=!0,this}setColor(r){return this.color=r,this}write(r){let t=r.getCurrentLineLength();r.write(this.color(this.contents)),this.isUnderlined&&r.afterNextNewline(()=>{r.write(" ".repeat(t)).writeLine(this.color("~".repeat(this.contents.length)))})}};var Ze=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var Ar=class extends Ze{items=[];addItem(r){return this.items.push(new hn(r)),this}getField(r){return this.items[r]}getPrintWidth(){return this.items.length===0?2:Math.max(...this.items.map(t=>t.value.getPrintWidth()))+2}write(r){if(this.items.length===0){this.writeEmpty(r);return}this.writeWithItems(r)}writeEmpty(r){let t=new Re("[]");this.hasError&&t.setColor(r.context.colors.red).underline(),r.write(t)}writeWithItems(r){let{colors:t}=r.context;r.writeLine("[").withIndent(()=>r.writeJoined(Cr,this.items).newLine()).write("]"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(t.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var Ir=class e extends Ze{fields={};suggestions=[];addField(r){this.fields[r.name]=r}addSuggestion(r){this.suggestions.push(r)}getField(r){return this.fields[r]}getDeepField(r){let[t,...n]=r,i=this.getField(t);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 Ar&&(a=o.value.getField(Number(s))),!a)return;o=a}return o}getDeepFieldValue(r){return r.length===0?this:this.getDeepField(r)?.value}hasField(r){return!!this.getField(r)}removeAllFields(){this.fields={}}removeField(r){delete this.fields[r]}getFields(){return this.fields}isEmpty(){return Object.keys(this.fields).length===0}getFieldValue(r){return this.getField(r)?.value}getDeepSubSelectionValue(r){let t=this;for(let n of r){if(!(t instanceof e))return;let i=t.getSubSelectionValue(n);if(!i)return;t=i}return t}getDeepSelectionParent(r){let t=this.getSelectionParent();if(!t)return;let n=t;for(let i of r){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 r=this.getField("select")?.value.asObject();if(r)return{kind:"select",value:r};let t=this.getField("include")?.value.asObject();if(t)return{kind:"include",value:t}}getSubSelectionValue(r){return this.getSelectionParent()?.value.fields[r].value}getPrintWidth(){let r=Object.values(this.fields);return r.length==0?2:Math.max(...r.map(n=>n.getPrintWidth()))+2}write(r){let t=Object.values(this.fields);if(t.length===0&&this.suggestions.length===0){this.writeEmpty(r);return}this.writeWithContents(r,t)}asObject(){return this}writeEmpty(r){let t=new Re("{}");this.hasError&&t.setColor(r.context.colors.red).underline(),r.write(t)}writeWithContents(r,t){r.writeLine("{").withIndent(()=>{r.writeJoined(Cr,[...t,...this.suggestions]).newLine()}),r.write("}"),this.hasError&&r.afterNextNewline(()=>{r.writeLine(r.context.colors.red("~".repeat(this.getPrintWidth())))})}};var J=class extends Ze{constructor(t){super();this.text=t}getPrintWidth(){return this.text.length}write(t){let n=new Re(this.text);this.hasError&&n.underline().setColor(t.context.colors.red),t.write(n)}asObject(){}};var st=class{fields=[];addField(r,t){return this.fields.push({write(n){let{green:i,dim:o}=n.context.colors;n.write(i(o(`${r}: ${t}`))).addMarginSymbol(i(o("+")))}}),this}write(r){let{colors:{green:t}}=r.context;r.writeLine(t("{")).withIndent(()=>{r.writeJoined(Cr,this.fields).newLine()}).write(t("}")).addMarginSymbol(t("+"))}};function gn(e,r,t){switch(e.kind){case"MutuallyExclusiveFields":Gp(e,r);break;case"IncludeOnScalar":Jp(e,r);break;case"EmptySelection":Wp(e,r,t);break;case"UnknownSelectionField":zp(e,r);break;case"InvalidSelectionValue":Zp(e,r);break;case"UnknownArgument":Xp(e,r);break;case"UnknownInputField":ed(e,r);break;case"RequiredArgumentMissing":rd(e,r);break;case"InvalidArgumentType":td(e,r);break;case"InvalidArgumentValue":nd(e,r);break;case"ValueTooLarge":id(e,r);break;case"SomeFieldsMissing":od(e,r);break;case"TooManyFieldsGiven":sd(e,r);break;case"Union":ra(e,r,t);break;default:throw new Error("not implemented: "+e.kind)}}function Gp(e,r){let t=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();t&&(t.getField(e.firstField)?.markAsError(),t.getField(e.secondField)?.markAsError()),r.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 Jp(e,r){let[t,n]=at(e.selectionPath),i=e.outputType,o=r.arguments.getDeepSelectionParent(t)?.value;if(o&&(o.getField(n)?.markAsError(),i))for(let s of i.fields)s.isRelation&&o.addSuggestion(new ce(s.name,"true"));r.addErrorMessage(s=>{let a=`Invalid scalar field ${s.red(`\`${n}\``)} for ${s.bold("include")} statement`;return i?a+=` on model ${s.bold(i.name)}. ${lt(s)}`:a+=".",a+=`
28
- Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Wp(e,r,t){let n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Hp(e,r,i);return}if(n.hasField("select")){Kp(e,r);return}}if(t?.[ze(e.outputType.name)]){Yp(e,r);return}r.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Hp(e,r,t){t.removeAllFields();for(let n of e.outputType.fields)t.addSuggestion(new ce(n.name,"false"));r.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 Kp(e,r){let t=e.outputType,n=r.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ua(n,t)),r.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(t.name)} must not be empty. ${lt(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(t.name)} needs ${o.bold("at least one truthy value")}.`)}function Yp(e,r){let t=new st;for(let i of e.outputType.fields)i.isRelation||t.addField(i.name,"false");let n=new ce("omit",t).makeRequired();if(e.selectionPath.length===0)r.arguments.addSuggestion(n);else{let[i,o]=at(e.selectionPath),a=r.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new Ir;l.addSuggestion(n),a.value=l}}r.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 zp(e,r){let t=ca(e.selectionPath,r);if(t.parentKind!=="unknown"){t.field.markAsError();let n=t.parent;switch(t.parentKind){case"select":ua(n,e.outputType);break;case"include":ad(n,e.outputType);break;case"omit":ld(n,e.outputType);break}}r.addErrorMessage(n=>{let i=[`Unknown field ${n.red(`\`${t.fieldName}\``)}`];return t.parentKind!=="unknown"&&i.push(`for ${n.bold(t.parentKind)} statement`),i.push(`on model ${n.bold(`\`${e.outputType.name}\``)}.`),i.push(lt(n)),i.join(" ")})}function Zp(e,r){let t=ca(e.selectionPath,r);t.parentKind!=="unknown"&&t.field.value.markAsError(),r.addErrorMessage(n=>`Invalid value for selection field \`${n.red(t.fieldName)}\`: ${e.underlyingError}`)}function Xp(e,r){let t=e.argumentPath[0],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(t)?.markAsError(),ud(n,e.arguments)),r.addErrorMessage(i=>aa(i,t,e.arguments.map(o=>o.name)))}function ed(e,r){let[t,n]=at(e.argumentPath),i=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(t)?.asObject();o&&pa(o,e.inputType)}r.addErrorMessage(o=>aa(o,n,e.inputType.fields.map(s=>s.name)))}function aa(e,r,t){let n=[`Unknown argument \`${e.red(r)}\`.`],i=pd(r,t);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),t.length>0&&n.push(lt(e)),n.join(" ")}function rd(e,r){let t;r.addErrorMessage(l=>t?.value instanceof J&&t.value.text==="null"?`Argument \`${l.green(o)}\` must not be ${l.red("null")}.`:`Argument \`${l.green(o)}\` is missing.`);let n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(!n)return;let[i,o]=at(e.argumentPath),s=new st,a=n.getDeepFieldValue(i)?.asObject();if(a)if(t=a.getField(o),t&&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 ce(o,s).makeRequired())}else{let l=e.inputTypes.map(la).join(" | ");a.addSuggestion(new ce(o,l).makeRequired())}}function la(e){return e.kind==="list"?`${la(e.elementType)}[]`:e.name}function td(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=bn("or",e.argument.typeNames.map(s=>i.green(s)));return`Argument \`${i.bold(t)}\`: Invalid value provided. Expected ${o}, provided ${i.red(e.inferredType)}.`})}function nd(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&n.getDeepFieldValue(e.argumentPath)?.markAsError(),r.addErrorMessage(i=>{let o=[`Invalid value for argument \`${i.bold(t)}\``];if(e.underlyingError&&o.push(`: ${e.underlyingError}`),o.push("."),e.argument.typeNames.length>0){let s=bn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function id(e,r){let t=e.argument.name,n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i;if(n){let s=n.getDeepField(e.argumentPath)?.value;s?.markAsError(),s instanceof J&&(i=s.text)}r.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(t)}\``),s.join(" ")})}function od(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getDeepFieldValue(e.argumentPath)?.asObject();i&&pa(i,e.inputType)}r.addErrorMessage(i=>{let o=[`Argument \`${i.bold(t)}\` of type ${i.bold(e.inputType.name)} needs`];return e.constraints.minFieldCount===1?e.constraints.requiredFields?o.push(`${i.green("at least one of")} ${bn("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(lt(i)),o.join(" ")})}function sd(e,r){let t=e.argumentPath[e.argumentPath.length-1],n=r.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject(),i=[];if(n){let o=n.getDeepFieldValue(e.argumentPath)?.asObject();o&&(o.markAsError(),i=Object.keys(o.getFields()))}r.addErrorMessage(o=>{let s=[`Argument \`${o.bold(t)}\` 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 ${bn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function ua(e,r){for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new ce(t.name,"true"))}function ad(e,r){for(let t of r.fields)t.isRelation&&!e.hasField(t.name)&&e.addSuggestion(new ce(t.name,"true"))}function ld(e,r){for(let t of r.fields)!e.hasField(t.name)&&!t.isRelation&&e.addSuggestion(new ce(t.name,"true"))}function ud(e,r){for(let t of r)e.hasField(t.name)||e.addSuggestion(new ce(t.name,t.typeNames.join(" | ")))}function ca(e,r){let[t,n]=at(e),i=r.arguments.getDeepSubSelectionValue(t)?.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 pa(e,r){if(r.kind==="object")for(let t of r.fields)e.hasField(t.name)||e.addSuggestion(new ce(t.name,t.typeNames.join(" | ")))}function at(e){let r=[...e],t=r.pop();if(!t)throw new Error("unexpected empty path");return[r,t]}function lt({green:e,enabled:r}){return"Available options are "+(r?`listed in ${e("green")}`:"marked with ?")+"."}function bn(e,r){if(r.length===1)return r[0];let t=[...r],n=t.pop();return`${t.join(", ")} ${e} ${n}`}var cd=3;function pd(e,r){let t=1/0,n;for(let i of r){let o=(0,sa.default)(e,i);o>cd||o<t&&(t=o,n=i)}return n}var ut=class{modelName;name;typeName;isList;isEnum;constructor(r,t,n,i,o){this.modelName=r,this.name=t,this.typeName=n,this.isList=i,this.isEnum=o}_toGraphQLInputType(){let r=this.isList?"List":"",t=this.isEnum?"Enum":"";return`${r}${t}${this.typeName}FieldRefInput<${this.modelName}>`}};function kr(e){return e instanceof ut}var wn=Symbol(),Bi=new WeakMap,Me=class{constructor(r){r===wn?Bi.set(this,`Prisma.${this._getName()}`):Bi.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return Bi.get(this)}},ct=class extends Me{_getNamespace(){return"NullTypes"}},pt=class extends ct{};Ui(pt,"DbNull");var dt=class extends ct{};Ui(dt,"JsonNull");var mt=class extends ct{};Ui(mt,"AnyNull");var xn={classes:{DbNull:pt,JsonNull:dt,AnyNull:mt},instances:{DbNull:new pt(wn),JsonNull:new dt(wn),AnyNull:new mt(wn)}};function Ui(e,r){Object.defineProperty(e,"name",{value:r,configurable:!0})}var da=": ",Pn=class{constructor(r,t){this.name=r;this.value=t}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+da.length}write(r){let t=new Re(this.name);this.hasError&&t.underline().setColor(r.context.colors.red),r.write(t).write(da).write(this.value)}};var Qi=class{arguments;errorMessages=[];constructor(r){this.arguments=r}write(r){r.write(this.arguments)}addErrorMessage(r){this.errorMessages.push(r)}renderAllMessages(r){return this.errorMessages.map(t=>t(r)).join(`
29
- `)}};function Or(e){return new Qi(ma(e))}function ma(e){let r=new Ir;for(let[t,n]of Object.entries(e)){let i=new Pn(t,fa(n));r.addField(i)}return r}function fa(e){if(typeof e=="string")return new J(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new J(String(e));if(typeof e=="bigint")return new J(`${e}n`);if(e===null)return new J("null");if(e===void 0)return new J("undefined");if(Rr(e))return new J(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new J(`Buffer.alloc(${e.byteLength})`):new J(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let r=pn(e)?e.toISOString():"Invalid Date";return new J(`new Date("${r}")`)}return e instanceof Me?new J(`Prisma.${e._getName()}`):kr(e)?new J(`prisma.${ze(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?dd(e):typeof e=="object"?ma(e):new J(Object.prototype.toString.call(e))}function dd(e){let r=new Ar;for(let t of e)r.addItem(fa(t));return r}function vn(e,r){let t=r==="pretty"?oa:En,n=e.renderAllMessages(t),i=new Sr(0,{colors:t}).write(e).toString();return{message:n,args:i}}function Tn({args:e,errors:r,errorFormat:t,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Or(e);for(let p of r)gn(p,a,s);let{message:l,args:u}=vn(a,t),c=fn({message:l,callsite:n,originalMethod:i,showColors:t==="pretty",callArguments:u});throw new X(c,{clientVersion:o})}function Se(e){return e.replace(/^./,r=>r.toLowerCase())}function ha(e,r,t){let n=Se(t);return!r.result||!(r.result.$allModels||r.result[n])?e:md({...e,...ga(r.name,e,r.result.$allModels),...ga(r.name,e,r.result[n])})}function md(e){let r=new Te,t=(n,i)=>r.getOrCreate(n,()=>i.has(n)?[n]:(i.add(n),e[n]?e[n].needs.flatMap(o=>t(o,i)):[n]));return wr(e,n=>({...n,needs:t(n.name,new Set)}))}function ga(e,r,t){return t?wr(t,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:fd(r,o,i)})):{}}function fd(e,r,t){let n=e?.[r]?.compute;return n?i=>t({...i,[r]:n(i)}):t}function ya(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(e[n.name])for(let i of n.needs)t[i]=!0;return t}function Ea(e,r){if(!r)return e;let t={...e};for(let n of Object.values(r))if(!e[n.name])for(let i of n.needs)delete t[i];return t}var Rn=class{constructor(r,t){this.extension=r;this.previous=t}computedFieldsCache=new Te;modelExtensionsCache=new Te;queryCallbacksCache=new Te;clientExtensions=it(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=it(()=>{let r=this.previous?.getAllBatchQueryCallbacks()??[],t=this.extension.query?.$__internalBatch;return t?r.concat(t):r});getAllComputedFields(r){return this.computedFieldsCache.getOrCreate(r,()=>ha(this.previous?.getAllComputedFields(r),this.extension,r))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(r){return this.modelExtensionsCache.getOrCreate(r,()=>{let t=Se(r);return!this.extension.model||!(this.extension.model[t]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(r):{...this.previous?.getAllModelExtensions(r),...this.extension.model.$allModels,...this.extension.model[t]}})}getAllQueryCallbacks(r,t){return this.queryCallbacksCache.getOrCreate(`${r}:${t}`,()=>{let n=this.previous?.getAllQueryCallbacks(r,t)??[],i=[],o=this.extension.query;return!o||!(o[r]||o.$allModels||o[t]||o.$allOperations)?n:(o[r]!==void 0&&(o[r][t]!==void 0&&i.push(o[r][t]),o[r].$allOperations!==void 0&&i.push(o[r].$allOperations)),r!=="$none"&&o.$allModels!==void 0&&(o.$allModels[t]!==void 0&&i.push(o.$allModels[t]),o.$allModels.$allOperations!==void 0&&i.push(o.$allModels.$allOperations)),o[t]!==void 0&&i.push(o[t]),o.$allOperations!==void 0&&i.push(o.$allOperations),n.concat(i))})}getAllBatchQueryCallbacks(){return this.batchCallbacks.get()}},_r=class e{constructor(r){this.head=r}static empty(){return new e}static single(r){return new e(new Rn(r))}isEmpty(){return this.head===void 0}append(r){return new e(new Rn(r,this.head))}getAllComputedFields(r){return this.head?.getAllComputedFields(r)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(r){return this.head?.getAllModelExtensions(r)}getAllQueryCallbacks(r,t){return this.head?.getAllQueryCallbacks(r,t)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var Sn=class{constructor(r){this.name=r}};function ba(e){return e instanceof Sn}function wa(e){return new Sn(e)}var xa=Symbol(),ft=class{constructor(r){if(r!==xa)throw new Error("Skip instance can not be constructed directly")}ifUndefined(r){return r===void 0?Cn:r}},Cn=new ft(xa);function Ce(e){return e instanceof ft}var gd={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"},Pa="explicitly `undefined` values are not allowed";function An({modelName:e,action:r,args:t,runtimeDataModel:n,extensions:i=_r.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new Gi({runtimeDataModel:n,modelName:e,action:r,rootArgs:t,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c});return{modelName:e,action:gd[r],query:gt(t,p)}}function gt({select:e,include:r,...t}={},n){let i=t.omit;return delete t.omit,{arguments:Ta(t,n),selection:hd(e,r,i,n)}}function hd(e,r,t,n){return e?(r?n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"include",secondField:"select",selectionPath:n.getSelectionPath()}):t&&n.throwValidationError({kind:"MutuallyExclusiveFields",firstField:"omit",secondField:"select",selectionPath:n.getSelectionPath()}),wd(e,n)):yd(n,r,t)}function yd(e,r,t){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),r&&Ed(n,r,e),bd(n,t,e),n}function Ed(e,r,t){for(let[n,i]of Object.entries(r)){if(Ce(i))continue;let o=t.nestSelection(n);if(Ji(i,o),i===!1||i===void 0){e[n]=!1;continue}let s=t.findField(n);if(s&&s.kind!=="object"&&t.throwValidationError({kind:"IncludeOnScalar",selectionPath:t.getSelectionPath().concat(n),outputType:t.getOutputTypeDescription()}),s){e[n]=gt(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=gt(i,o)}}function bd(e,r,t){let n=t.getComputedFields(),i={...t.getGlobalOmit(),...r},o=Ea(i,n);for(let[s,a]of Object.entries(o)){if(Ce(a))continue;Ji(a,t.nestSelection(s));let l=t.findField(s);n?.[s]&&!l||(e[s]=!a)}}function wd(e,r){let t={},n=r.getComputedFields(),i=ya(e,n);for(let[o,s]of Object.entries(i)){if(Ce(s))continue;let a=r.nestSelection(o);Ji(s,a);let l=r.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||Ce(s)){t[o]=!1;continue}if(s===!0){l?.kind==="object"?t[o]=gt({},a):t[o]=!0;continue}t[o]=gt(s,a)}}return t}function va(e,r){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(Tr(e)){if(pn(e))return{$type:"DateTime",value:e.toISOString()};r.throwValidationError({kind:"InvalidArgumentValue",selectionPath:r.getSelectionPath(),argumentPath:r.getArgumentPath(),argument:{name:r.getArgumentName(),typeNames:["Date"]},underlyingError:"Provided Date object is invalid"})}if(ba(e))return{$type:"Param",value:e.name};if(kr(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return xd(e,r);if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:n,byteLength:i}=e;return{$type:"Bytes",value:Buffer.from(t,n,i).toString("base64")}}if(Pd(e))return e.values;if(Rr(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Me){if(e!==xn.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(vd(e))return e.toJSON();if(typeof e=="object")return Ta(e,r);r.throwValidationError({kind:"InvalidArgumentValue",selectionPath:r.getSelectionPath(),argumentPath:r.getArgumentPath(),argument:{name:r.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 Ta(e,r){if(e.$type)return{$type:"Raw",value:e};let t={};for(let n in e){let i=e[n],o=r.nestArgument(n);Ce(i)||(i!==void 0?t[n]=va(i,o):r.isPreviewFeatureOn("strictUndefinedChecks")&&r.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:r.getSelectionPath(),argument:{name:r.getArgumentName(),typeNames:[]},underlyingError:Pa}))}return t}function xd(e,r){let t=[];for(let n=0;n<e.length;n++){let i=r.nestArgument(String(n)),o=e[n];if(o===void 0||Ce(o)){let s=o===void 0?"undefined":"Prisma.skip";r.throwValidationError({kind:"InvalidArgumentValue",selectionPath:i.getSelectionPath(),argumentPath:i.getArgumentPath(),argument:{name:`${r.getArgumentName()}[${n}]`,typeNames:[]},underlyingError:`Can not use \`${s}\` value within array. Use \`null\` or filter out \`${s}\` values`})}t.push(va(o,i))}return t}function Pd(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function vd(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Ji(e,r){e===void 0&&r.isPreviewFeatureOn("strictUndefinedChecks")&&r.throwValidationError({kind:"InvalidSelectionValue",selectionPath:r.getSelectionPath(),underlyingError:Pa})}var Gi=class e{constructor(r){this.params=r;this.params.modelName&&(this.modelOrType=this.params.runtimeDataModel.models[this.params.modelName]??this.params.runtimeDataModel.types[this.params.modelName])}modelOrType;throwValidationError(r){Tn({errors:[r],originalMethod:this.params.originalMethod,args:this.params.rootArgs??{},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(r=>({name:r.name,typeName:"boolean",isRelation:r.kind==="object"}))}}isRawAction(){return["executeRaw","queryRaw","runCommandRaw","findRaw","aggregateRaw"].includes(this.params.action)}isPreviewFeatureOn(r){return this.params.previewFeatures.includes(r)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(r){return this.modelOrType?.fields.find(t=>t.name===r)}nestSelection(r){let t=this.findField(r),n=t?.kind==="object"?t.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(r)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[ze(this.params.modelName)]??{}:{}}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:Ne(this.params.action,"Unknown action")}}nestArgument(r){return new e({...this.params,argumentPath:this.params.argumentPath.concat(r)})}};function Ra(e){if(!e._hasPreviewFlag("metrics"))throw new X("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var Dr=class{_client;constructor(r){this._client=r}prometheus(r){return Ra(this._client),this._client._engine.metrics({format:"prometheus",...r})}json(r){return Ra(this._client),this._client._engine.metrics({format:"json",...r})}};function Sa(e,r){let t=it(()=>Td(r));Object.defineProperty(e,"dmmf",{get:()=>t.get()})}function Td(e){return{datamodel:{models:Wi(e.models),enums:Wi(e.enums),types:Wi(e.types)}}}function Wi(e){return Object.entries(e).map(([r,t])=>({name:r,...t}))}var Hi=new WeakMap,In="$$PrismaTypedSql",ht=class{constructor(r,t){Hi.set(this,{sql:r,values:t}),Object.defineProperty(this,In,{value:In})}get sql(){return Hi.get(this).sql}get values(){return Hi.get(this).values}};function Ca(e){return(...r)=>new ht(e,r)}function kn(e){return e!=null&&e[In]===In}var iu=O(fi());var ou=require("async_hooks"),su=require("events"),au=O(require("fs")),Lt=O(require("path"));var se=class e{constructor(r,t){if(r.length-1!==t.length)throw r.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${r.length} strings to have ${r.length-1} values`);let n=t.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=r[0];let i=0,o=0;for(;i<t.length;){let s=t[i++],a=r[i];if(s instanceof e){this.strings[o]+=s.strings[0];let l=0;for(;l<s.values.length;)this.values[o++]=s.values[l++],this.strings[o]=s.strings[l];this.strings[o]+=a}else this.values[o++]=s,this.strings[o]=a}}get sql(){let r=this.strings.length,t=1,n=this.strings[0];for(;t<r;)n+=`?${this.strings[t++]}`;return n}get statement(){let r=this.strings.length,t=1,n=this.strings[0];for(;t<r;)n+=`:${t}${this.strings[t++]}`;return n}get text(){let r=this.strings.length,t=1,n=this.strings[0];for(;t<r;)n+=`$${t}${this.strings[t++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function Aa(e,r=",",t="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new se([t,...Array(e.length-1).fill(r),n],e)}function Ki(e){return new se([e],[])}var Ia=Ki("");function Yi(e,...r){return new se(e,r)}function yt(e){return{getKeys(){return Object.keys(e)},getPropertyValue(r){return e[r]}}}function te(e,r){return{getKeys(){return[e]},getPropertyValue(){return r()}}}function ar(e){let r=new Te;return{getKeys(){return e.getKeys()},getPropertyValue(t){return r.getOrCreate(t,()=>e.getPropertyValue(t))},getPropertyDescriptor(t){return e.getPropertyDescriptor?.(t)}}}var On={enumerable:!0,configurable:!0,writable:!0};function _n(e){let r=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>On,has:(t,n)=>r.has(n),set:(t,n,i)=>r.add(n)&&Reflect.set(t,n,i),ownKeys:()=>[...r]}}var ka=Symbol.for("nodejs.util.inspect.custom");function ye(e,r){let t=Rd(r),n=new Set,i=new Proxy(e,{get(o,s){if(n.has(s))return o[s];let a=t.get(s);return a?a.getPropertyValue(s):o[s]},has(o,s){if(n.has(s))return!0;let a=t.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Oa(Reflect.ownKeys(o),t),a=Oa(Array.from(t.keys()),t);return[...new Set([...s,...a,...n])]},set(o,s,a){return t.get(s)?.getPropertyDescriptor?.(s)?.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=t.get(s);return l?l.getPropertyDescriptor?{...On,...l?.getPropertyDescriptor(s)}:On:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[ka]=function(){let o={...this};return delete o[ka],o},i}function Rd(e){let r=new Map;for(let t of e){let n=t.getKeys();for(let i of n)r.set(i,t)}return r}function Oa(e,r){return e.filter(t=>r.get(t)?.has?.(t)??!0)}function Nr(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Lr(e,r){return{batch:e,transaction:r?.kind==="batch"?{isolationLevel:r.options.isolationLevel}:void 0}}function _a(e){if(e===void 0)return"";let r=Or(e);return new Sr(0,{colors:En}).write(r).toString()}var Sd="P2037";function Fr({error:e,user_facing_error:r},t,n){return r.error_code?new Z(Cd(r,n),{code:r.error_code,clientVersion:t,meta:r.meta,batchRequestIdx:r.batch_request_idx}):new j(e,{clientVersion:t,batchRequestIdx:r.batch_request_idx})}function Cd(e,r){let t=e.message;return(r==="postgresql"||r==="postgres"||r==="mysql")&&e.error_code===Sd&&(t+=`
30
- Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),t}var Et="<unknown>";function Da(e){var r=e.split(`
31
- `);return r.reduce(function(t,n){var i=kd(n)||_d(n)||Ld(n)||qd(n)||Md(n);return i&&t.push(i),t},[])}var Ad=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Id=/\((\S*)(?::(\d+))(?::(\d+))\)/;function kd(e){var r=Ad.exec(e);if(!r)return null;var t=r[2]&&r[2].indexOf("native")===0,n=r[2]&&r[2].indexOf("eval")===0,i=Id.exec(r[2]);return n&&i!=null&&(r[2]=i[1],r[3]=i[2],r[4]=i[3]),{file:t?null:r[2],methodName:r[1]||Et,arguments:t?[r[2]]:[],lineNumber:r[3]?+r[3]:null,column:r[4]?+r[4]:null}}var Od=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function _d(e){var r=Od.exec(e);return r?{file:r[2],methodName:r[1]||Et,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var Dd=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Nd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ld(e){var r=Dd.exec(e);if(!r)return null;var t=r[3]&&r[3].indexOf(" > eval")>-1,n=Nd.exec(r[3]);return t&&n!=null&&(r[3]=n[1],r[4]=n[2],r[5]=null),{file:r[3],methodName:r[1]||Et,arguments:r[2]?r[2].split(","):[],lineNumber:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}var Fd=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Md(e){var r=Fd.exec(e);return r?{file:r[3],methodName:r[1]||Et,arguments:[],lineNumber:+r[4],column:r[5]?+r[5]:null}:null}var $d=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function qd(e){var r=$d.exec(e);return r?{file:r[2],methodName:r[1]||Et,arguments:[],lineNumber:+r[3],column:r[4]?+r[4]:null}:null}var zi=class{getLocation(){return null}},Zi=class{_error;constructor(){this._error=new Error}getLocation(){let r=this._error.stack;if(!r)return null;let n=Da(r).find(i=>{if(!i.file)return!1;let o=Si(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.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 Xe(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new zi:new Zi}var Na={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Mr(e={}){let r=jd(e);return Object.entries(r).reduce((n,[i,o])=>(Na[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function jd(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Dn(e={}){return r=>(typeof e._count=="boolean"&&(r._count=r._count._all),r)}function La(e,r){let t=Dn(e);return r({action:"aggregate",unpacker:t,argsMapper:Mr})(e)}function Bd(e={}){let{select:r,...t}=e;return typeof r=="object"?Mr({...t,_count:r}):Mr({...t,_count:{_all:!0}})}function Ud(e={}){return typeof e.select=="object"?r=>Dn(e)(r)._count:r=>Dn(e)(r)._count._all}function Fa(e,r){return r({action:"count",unpacker:Ud(e),argsMapper:Bd})(e)}function Qd(e={}){let r=Mr(e);if(Array.isArray(r.by))for(let t of r.by)typeof t=="string"&&(r.select[t]=!0);else typeof r.by=="string"&&(r.select[r.by]=!0);return r}function Gd(e={}){return r=>(typeof e?._count=="boolean"&&r.forEach(t=>{t._count=t._count._all}),r)}function Ma(e,r){return r({action:"groupBy",unpacker:Gd(e),argsMapper:Qd})(e)}function $a(e,r,t){if(r==="aggregate")return n=>La(n,t);if(r==="count")return n=>Fa(n,t);if(r==="groupBy")return n=>Ma(n,t)}function qa(e,r){let t=r.fields.filter(i=>!i.relationName),n=Qs(t,"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 ut(e,o,s.type,s.isList,s.kind==="enum")},..._n(Object.keys(n))})}var Va=e=>Array.isArray(e)?e:e.split("."),Xi=(e,r)=>Va(r).reduce((t,n)=>t&&t[n],e),ja=(e,r,t)=>Va(r).reduceRight((n,i,o,s)=>Object.assign({},Xi(e,s.slice(0,o)),{[i]:n}),t);function Jd(e,r){return e===void 0||r===void 0?[]:[...r,"select",e]}function Wd(e,r,t){return r===void 0?e??{}:ja(r,t,e||!0)}function eo(e,r,t,n,i,o){let a=e._runtimeDataModel.models[r].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Xe(e._errorFormat),c=Jd(n,i),p=Wd(l,o,c),d=t({dataPath:c,callsite:u})(p),f=Hd(e,r);return new Proxy(d,{get(g,h){if(!f.includes(h))return g[h];let T=[a[h].type,t,h],S=[c,p];return eo(e,...T,...S)},..._n([...f,...Object.getOwnPropertyNames(d)])})}}function Hd(e,r){return e._runtimeDataModel.models[r].fields.filter(t=>t.kind==="object").map(t=>t.name)}var Kd=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Yd=["aggregate","count","groupBy"];function ro(e,r){let t=e._extensions.getAllModelExtensions(r)??{},n=[zd(e,r),Xd(e,r),yt(t),te("name",()=>r),te("$name",()=>r),te("$parent",()=>e._appliedParent)];return ye({},n)}function zd(e,r){let t=Se(r),n=Object.keys(ot).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=Xe(e._errorFormat);return e._createPrismaPromise(c=>{let p={args:l,dataPath:[],action:o,model:r,clientMethod:`${t}.${i}`,jsModelName:t,transaction:c,callsite:u};return e._request({...p,...a})},{action:o,args:l,model:r})};return Kd.includes(o)?eo(e,r,s):Zd(i)?$a(e,i,s):s({})}}}function Zd(e){return Yd.includes(e)}function Xd(e,r){return ar(te("fields",()=>{let t=e._runtimeDataModel.models[r];return qa(r,t)}))}function Ba(e){return e.replace(/^./,r=>r.toUpperCase())}var to=Symbol();function bt(e){let r=[em(e),rm(e),te(to,()=>e),te("$parent",()=>e._appliedParent)],t=e._extensions.getAllClientExtensions();return t&&r.push(yt(t)),ye(e,r)}function em(e){let r=Object.getPrototypeOf(e._originalClient),t=[...new Set(Object.getOwnPropertyNames(r))];return{getKeys(){return t},getPropertyValue(n){return e[n]}}}function rm(e){let r=Object.keys(e._runtimeDataModel.models),t=r.map(Se),n=[...new Set(r.concat(t))];return ar({getKeys(){return n},getPropertyValue(i){let o=Ba(i);if(e._runtimeDataModel.models[o]!==void 0)return ro(e,o);if(e._runtimeDataModel.models[i]!==void 0)return ro(e,i)},getPropertyDescriptor(i){if(!t.includes(i))return{enumerable:!1}}})}function Ua(e){return e[to]?e[to]:e}function Qa(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let t=e.client.__AccelerateEngine;this._originalClient._engine=new t(this._originalClient._accelerateEngineConfig)}let r=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return bt(r)}function Ga({result:e,modelName:r,select:t,omit:n,extensions:i}){let o=i.getAllComputedFields(r);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(Nr(u))}else if(t){if(!t[l.name])continue;let u=l.needs.filter(c=>!t[c]);u.length>0&&a.push(Nr(u))}tm(e,l.needs)&&s.push(nm(l,ye(e,s)))}return s.length>0||a.length>0?ye(e,[...s,...a]):e}function tm(e,r){return r.every(t=>_i(e,t))}function nm(e,r){return ar(te(e.name,()=>e.compute(r)))}function Nn({visitor:e,result:r,args:t,runtimeDataModel:n,modelName:i}){if(Array.isArray(r)){for(let s=0;s<r.length;s++)r[s]=Nn({result:r[s],args:t,modelName:i,runtimeDataModel:n,visitor:e});return r}let o=e(r,i,t)??r;return t.include&&Ja({includeOrSelect:t.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),t.select&&Ja({includeOrSelect:t.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function Ja({includeOrSelect:e,result:r,parentModelName:t,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||r[o]==null||Ce(s))continue;let l=n.models[t].fields.find(c=>c.name===o);if(!l||l.kind!=="object"||!l.relationName)continue;let u=typeof s=="object"?s:{};r[o]=Nn({visitor:i,result:r[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Wa({result:e,modelName:r,args:t,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[r]?e:Nn({result:e,args:t??{},modelName:r,runtimeDataModel:i,visitor:(a,l,u)=>{let c=Se(l);return Ga({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var im=["$connect","$disconnect","$on","$transaction","$use","$extends"],Ha=im;function Ka(e){if(e instanceof se)return om(e);if(kn(e))return sm(e);if(Array.isArray(e)){let t=[e[0]];for(let n=1;n<e.length;n++)t[n]=wt(e[n]);return t}let r={};for(let t in e)r[t]=wt(e[t]);return r}function om(e){return new se(e.strings,e.values)}function sm(e){return new ht(e.sql,e.values)}function wt(e){if(typeof e!="object"||e==null||e instanceof Me||kr(e))return e;if(Rr(e))return new ve(e.toFixed());if(Tr(e))return new Date(+e);if(ArrayBuffer.isView(e))return e.slice(0);if(Array.isArray(e)){let r=e.length,t;for(t=Array(r);r--;)t[r]=wt(e[r]);return t}if(typeof e=="object"){let r={};for(let t in e)t==="__proto__"?Object.defineProperty(r,t,{value:wt(e[t]),configurable:!0,enumerable:!0,writable:!0}):r[t]=wt(e[t]);return r}Ne(e,"Unknown value")}function za(e,r,t,n=0){return e._createPrismaPromise(i=>{let o=r.customDataProxyFetch;return"transaction"in r&&i!==void 0&&(r.transaction?.kind==="batch"&&r.transaction.lock.then(),r.transaction=i),n===t.length?e._executeRequest(r):t[n]({model:r.model,operation:r.model?r.action:r.clientMethod,args:Ka(r.args??{}),__internalParams:r,query:(s,a=r)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=rl(o,l),a.args=s,za(e,a,t,n+1)}})})}function Za(e,r){let{jsModelName:t,action:n,clientMethod:i}=r,o=t?n:i;if(e._extensions.isEmpty())return e._executeRequest(r);let s=e._extensions.getAllQueryCallbacks(t??"$none",o);return za(e,r,s)}function Xa(e){return r=>{let t={requests:r},n=r[0].extensions.getAllBatchQueryCallbacks();return n.length?el(t,n,0,e):e(t)}}function el(e,r,t,n){if(t===r.length)return n(e);let i=e.customDataProxyFetch,o=e.requests[0].transaction;return r[t]({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=rl(i,l),el(a,r,t+1,n)}})}var Ya=e=>e;function rl(e=Ya,r=Ya){return t=>e(r(t))}var tl=L("prisma:client"),nl={Vercel:"vercel","Netlify CI":"netlify"};function il({postinstall:e,ciName:r,clientVersion:t}){if(tl("checkPlatformCaching:postinstall",e),tl("checkPlatformCaching:ciName",r),e===!0&&r&&r in nl){let n=`Prisma has detected that this project was built on ${r}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process.
25
+ `)}};var Op={red:pe,gray:Wt,dim:ke,bold:W,underline:z,highlightSource:e=>e.highlight()},_p={red:e=>e,gray:e=>e,dim:e=>e,bold:e=>e,underline:e=>e,highlightSource:e=>e};function Dp({message:e,originalMethod:t,isPanic:r,callArguments:n}){return{functionName:`prisma.${t}()`,message:e,isPanic:r??!1,callArguments:n}}function Np({callsite:e,message:t,originalMethod:r,isPanic:n,callArguments:i},o){let s=Dp({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=mn.read(a.fileName)?.slice(l,a.lineNumber),c=u?.lineAt(a.lineNumber);if(u&&c){let p=Fp(c),d=Lp(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 f=String(u.lastLineNumber).length;if(s.contextLines=u.mapLines((g,h)=>o.gray(String(h).padStart(f))+" "+g).mapLines(g=>o.dim(g)).prependSymbolAt(a.lineNumber,o.bold(o.red("\u2192"))),i){let g=p+f+1;g+=2,s.callArguments=(0,Hs.default)(i,g).slice(g)}}return s}function Lp(e){let t=Object.keys(ir).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 Fp(e){let t=0;for(let r=0;r<e.length;r++){if(e.charAt(r)!==" ")return t;t++}return t}function Mp({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($p(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(`
26
+ `)}function $p(e){let t=[e.fileName];return e.lineNumber&&t.push(String(e.lineNumber)),e.columnNumber&&t.push(String(e.columnNumber)),t.join(":")}function fn(e){let t=e.showColors?Op:_p,r;return r=Np(e,t),Mp(r,t)}var ta=O(Vi());function Zs(e,t,r){let n=Xs(e),i=qp(n),o=jp(i);o?gn(o,t,r):t.addErrorMessage(()=>"Unknown error")}function Xs(e){return e.errors.flatMap(t=>t.kind==="Union"?Xs(t):[t])}function qp(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:Vp(o.argument.typeNames,n.argument.typeNames)}}):t.set(i,n)}return r.push(...t.values()),r}function Vp(e,t){return[...new Set(e.concat(t))]}function jp(e){return Ni(e,(t,r)=>{let n=Ys(t),i=Ys(r);return n!==i?n-i:zs(t)-zs(r)})}function Ys(e){let t=0;return Array.isArray(e.selectionPath)&&(t+=e.selectionPath.length),Array.isArray(e.argumentPath)&&(t+=e.argumentPath.length),t}function zs(e){switch(e.kind){case"InvalidArgumentValue":case"ValueTooLarge":return 20;case"InvalidArgumentType":return 10;case"RequiredArgumentMissing":return-10;default:return 0}}var ce=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)}};var St=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(`
27
+ `)}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}};var hn=class{constructor(t){this.value=t}write(t){t.write(this.value)}markAsError(){this.value.markAsError()}};var yn=e=>e,En={bold:yn,red:yn,green:yn,dim:yn,enabled:!1},ea={bold:W,red:pe,green:Ve,dim:ke,enabled:!0},Ct={write(e){e.writeLine(",")}};var Te=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 ze=class{hasError=!1;markAsError(){return this.hasError=!0,this}};var At=class extends ze{items=[];addItem(t){return this.items.push(new hn(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 Te("[]");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithItems(t){let{colors:r}=t.context;t.writeLine("[").withIndent(()=>t.writeJoined(Ct,this.items).newLine()).write("]"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(r.red("~".repeat(this.getPrintWidth())))})}asObject(){}};var It=class e extends ze{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 At&&(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 Te("{}");this.hasError&&r.setColor(t.context.colors.red).underline(),t.write(r)}writeWithContents(t,r){t.writeLine("{").withIndent(()=>{t.writeJoined(Ct,[...r,...this.suggestions]).newLine()}),t.write("}"),this.hasError&&t.afterNextNewline(()=>{t.writeLine(t.context.colors.red("~".repeat(this.getPrintWidth())))})}};var J=class extends ze{constructor(r){super();this.text=r}getPrintWidth(){return this.text.length}write(r){let n=new Te(this.text);this.hasError&&n.underline().setColor(r.context.colors.red),r.write(n)}asObject(){}};var or=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(Ct,this.fields).newLine()}).write(r("}")).addMarginSymbol(r("+"))}};function gn(e,t,r){switch(e.kind){case"MutuallyExclusiveFields":Up(e,t);break;case"IncludeOnScalar":Qp(e,t);break;case"EmptySelection":Gp(e,t,r);break;case"UnknownSelectionField":Kp(e,t);break;case"InvalidSelectionValue":Yp(e,t);break;case"UnknownArgument":zp(e,t);break;case"UnknownInputField":Zp(e,t);break;case"RequiredArgumentMissing":Xp(e,t);break;case"InvalidArgumentType":ed(e,t);break;case"InvalidArgumentValue":td(e,t);break;case"ValueTooLarge":rd(e,t);break;case"SomeFieldsMissing":nd(e,t);break;case"TooManyFieldsGiven":id(e,t);break;case"Union":Zs(e,t,r);break;default:throw new Error("not implemented: "+e.kind)}}function Up(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 Qp(e,t){let[r,n]=sr(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 ce(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)}. ${ar(s)}`:a+=".",a+=`
28
+ Note that ${s.bold("include")} statements only accept relation fields.`,a})}function Gp(e,t,r){let n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(n){let i=n.getField("omit")?.value.asObject();if(i){Jp(e,t,i);return}if(n.hasField("select")){Wp(e,t);return}}if(r?.[vt(e.outputType.name)]){Hp(e,t);return}t.addErrorMessage(()=>`Unknown field at "${e.selectionPath.join(".")} selection"`)}function Jp(e,t,r){r.removeAllFields();for(let n of e.outputType.fields)r.addSuggestion(new ce(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 Wp(e,t){let r=e.outputType,n=t.arguments.getDeepSelectionParent(e.selectionPath)?.value,i=n?.isEmpty()??!1;n&&(n.removeAllFields(),ia(n,r)),t.addErrorMessage(o=>i?`The ${o.red("`select`")} statement for type ${o.bold(r.name)} must not be empty. ${ar(o)}`:`The ${o.red("`select`")} statement for type ${o.bold(r.name)} needs ${o.bold("at least one truthy value")}.`)}function Hp(e,t){let r=new or;for(let i of e.outputType.fields)i.isRelation||r.addField(i.name,"false");let n=new ce("omit",r).makeRequired();if(e.selectionPath.length===0)t.arguments.addSuggestion(n);else{let[i,o]=sr(e.selectionPath),a=t.arguments.getDeepSelectionParent(i)?.value.asObject()?.getField(o);if(a){let l=a?.value.asObject()??new It;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 Kp(e,t){let r=oa(e.selectionPath,t);if(r.parentKind!=="unknown"){r.field.markAsError();let n=r.parent;switch(r.parentKind){case"select":ia(n,e.outputType);break;case"include":od(n,e.outputType);break;case"omit":sd(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(ar(n)),i.join(" ")})}function Yp(e,t){let r=oa(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 zp(e,t){let r=e.argumentPath[0],n=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();n&&(n.getField(r)?.markAsError(),ad(n,e.arguments)),t.addErrorMessage(i=>ra(i,r,e.arguments.map(o=>o.name)))}function Zp(e,t){let[r,n]=sr(e.argumentPath),i=t.arguments.getDeepSubSelectionValue(e.selectionPath)?.asObject();if(i){i.getDeepField(e.argumentPath)?.markAsError();let o=i.getDeepFieldValue(r)?.asObject();o&&sa(o,e.inputType)}t.addErrorMessage(o=>ra(o,n,e.inputType.fields.map(s=>s.name)))}function ra(e,t,r){let n=[`Unknown argument \`${e.red(t)}\`.`],i=ud(t,r);return i&&n.push(`Did you mean \`${e.green(i)}\`?`),r.length>0&&n.push(ar(e)),n.join(" ")}function Xp(e,t){let r;t.addErrorMessage(l=>r?.value instanceof J&&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]=sr(e.argumentPath),s=new or,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 ce(o,s).makeRequired())}else{let l=e.inputTypes.map(na).join(" | ");a.addSuggestion(new ce(o,l).makeRequired())}}function na(e){return e.kind==="list"?`${na(e.elementType)}[]`:e.name}function ed(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=bn("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 td(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=bn("or",e.argument.typeNames.map(a=>i.green(a)));o.push(` Expected ${s}.`)}return o.join("")})}function rd(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 J&&(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 nd(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&&sa(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")} ${bn("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(ar(i)),o.join(" ")})}function id(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 ${bn("and",i.map(a=>o.red(a)))}. Please choose`),e.constraints.maxFieldCount===1?s.push("one."):s.push(`${e.constraints.maxFieldCount}.`),s.join(" ")})}function ia(e,t){for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ce(r.name,"true"))}function od(e,t){for(let r of t.fields)r.isRelation&&!e.hasField(r.name)&&e.addSuggestion(new ce(r.name,"true"))}function sd(e,t){for(let r of t.fields)!e.hasField(r.name)&&!r.isRelation&&e.addSuggestion(new ce(r.name,"true"))}function ad(e,t){for(let r of t)e.hasField(r.name)||e.addSuggestion(new ce(r.name,r.typeNames.join(" | ")))}function oa(e,t){let[r,n]=sr(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 sa(e,t){if(t.kind==="object")for(let r of t.fields)e.hasField(r.name)||e.addSuggestion(new ce(r.name,r.typeNames.join(" | ")))}function sr(e){let t=[...e],r=t.pop();if(!r)throw new Error("unexpected empty path");return[t,r]}function ar({green:e,enabled:t}){return"Available options are "+(t?`listed in ${e("green")}`:"marked with ?")+"."}function bn(e,t){if(t.length===1)return t[0];let r=[...t],n=r.pop();return`${r.join(", ")} ${e} ${n}`}var ld=3;function ud(e,t){let r=1/0,n;for(let i of t){let o=(0,ta.default)(e,i);o>ld||o<r&&(r=o,n=i)}return n}function aa(e){return e.substring(0,1).toLowerCase()+e.substring(1)}var lr=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 kt(e){return e instanceof lr}var wn=Symbol(),ji=new WeakMap,Me=class{constructor(t){t===wn?ji.set(this,`Prisma.${this._getName()}`):ji.set(this,`new Prisma.${this._getNamespace()}.${this._getName()}()`)}_getName(){return this.constructor.name}toString(){return ji.get(this)}},ur=class extends Me{_getNamespace(){return"NullTypes"}},cr=class extends ur{};Bi(cr,"DbNull");var pr=class extends ur{};Bi(pr,"JsonNull");var dr=class extends ur{};Bi(dr,"AnyNull");var xn={classes:{DbNull:cr,JsonNull:pr,AnyNull:dr},instances:{DbNull:new cr(wn),JsonNull:new pr(wn),AnyNull:new dr(wn)}};function Bi(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var la=": ",Pn=class{constructor(t,r){this.name=t;this.value=r}hasError=!1;markAsError(){this.hasError=!0}getPrintWidth(){return this.name.length+this.value.getPrintWidth()+la.length}write(t){let r=new Te(this.name);this.hasError&&r.underline().setColor(t.context.colors.red),t.write(r).write(la).write(this.value)}};var Ui=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(`
29
+ `)}};function Ot(e){return new Ui(ua(e))}function ua(e){let t=new It;for(let[r,n]of Object.entries(e)){let i=new Pn(r,ca(n));t.addField(i)}return t}function ca(e){if(typeof e=="string")return new J(JSON.stringify(e));if(typeof e=="number"||typeof e=="boolean")return new J(String(e));if(typeof e=="bigint")return new J(`${e}n`);if(e===null)return new J("null");if(e===void 0)return new J("undefined");if(Rt(e))return new J(`new Prisma.Decimal("${e.toFixed()}")`);if(e instanceof Uint8Array)return Buffer.isBuffer(e)?new J(`Buffer.alloc(${e.byteLength})`):new J(`new Uint8Array(${e.byteLength})`);if(e instanceof Date){let t=pn(e)?e.toISOString():"Invalid Date";return new J(`new Date("${t}")`)}return e instanceof Me?new J(`Prisma.${e._getName()}`):kt(e)?new J(`prisma.${aa(e.modelName)}.$fields.${e.name}`):Array.isArray(e)?cd(e):typeof e=="object"?ua(e):new J(Object.prototype.toString.call(e))}function cd(e){let t=new At;for(let r of e)t.addItem(ca(r));return t}function vn(e,t){let r=t==="pretty"?ea:En,n=e.renderAllMessages(r),i=new St(0,{colors:r}).write(e).toString();return{message:n,args:i}}function Tn({args:e,errors:t,errorFormat:r,callsite:n,originalMethod:i,clientVersion:o,globalOmit:s}){let a=Ot(e);for(let p of t)gn(p,a,s);let{message:l,args:u}=vn(a,r),c=fn({message:l,callsite:n,originalMethod:i,showColors:r==="pretty",callArguments:u});throw new X(c,{clientVersion:o})}var Re=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 mr(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Se(e){return e.replace(/^./,t=>t.toLowerCase())}function da(e,t,r){let n=Se(r);return!t.result||!(t.result.$allModels||t.result[n])?e:pd({...e,...pa(t.name,e,t.result.$allModels),...pa(t.name,e,t.result[n])})}function pd(e){let t=new Re,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 bt(e,n=>({...n,needs:r(n.name,new Set)}))}function pa(e,t,r){return r?bt(r,({needs:n,compute:i},o)=>({name:o,needs:n?Object.keys(n).filter(s=>n[s]):[],compute:dd(t,o,i)})):{}}function dd(e,t,r){let n=e?.[t]?.compute;return n?i=>r({...i,[t]:n(i)}):r}function ma(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 fa(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 Rn=class{constructor(t,r){this.extension=t;this.previous=r}computedFieldsCache=new Re;modelExtensionsCache=new Re;queryCallbacksCache=new Re;clientExtensions=mr(()=>this.extension.client?{...this.previous?.getAllClientExtensions(),...this.extension.client}:this.previous?.getAllClientExtensions());batchCallbacks=mr(()=>{let t=this.previous?.getAllBatchQueryCallbacks()??[],r=this.extension.query?.$__internalBatch;return r?t.concat(r):t});getAllComputedFields(t){return this.computedFieldsCache.getOrCreate(t,()=>da(this.previous?.getAllComputedFields(t),this.extension,t))}getAllClientExtensions(){return this.clientExtensions.get()}getAllModelExtensions(t){return this.modelExtensionsCache.getOrCreate(t,()=>{let r=Se(t);return!this.extension.model||!(this.extension.model[r]||this.extension.model.$allModels)?this.previous?.getAllModelExtensions(t):{...this.previous?.getAllModelExtensions(t),...this.extension.model.$allModels,...this.extension.model[r]}})}getAllQueryCallbacks(t,r){return this.queryCallbacksCache.getOrCreate(`${t}:${r}`,()=>{let n=this.previous?.getAllQueryCallbacks(t,r)??[],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()}},_t=class e{constructor(t){this.head=t}static empty(){return new e}static single(t){return new e(new Rn(t))}isEmpty(){return this.head===void 0}append(t){return new e(new Rn(t,this.head))}getAllComputedFields(t){return this.head?.getAllComputedFields(t)}getAllClientExtensions(){return this.head?.getAllClientExtensions()}getAllModelExtensions(t){return this.head?.getAllModelExtensions(t)}getAllQueryCallbacks(t,r){return this.head?.getAllQueryCallbacks(t,r)??[]}getAllBatchQueryCallbacks(){return this.head?.getAllBatchQueryCallbacks()??[]}};var Sn=class{constructor(t){this.name=t}};function ga(e){return e instanceof Sn}function ha(e){return new Sn(e)}var ya=Symbol(),fr=class{constructor(t){if(t!==ya)throw new Error("Skip instance can not be constructed directly")}ifUndefined(t){return t===void 0?Cn:t}},Cn=new fr(ya);function Ce(e){return e instanceof fr}var md={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"},Ea="explicitly `undefined` values are not allowed";function An({modelName:e,action:t,args:r,runtimeDataModel:n,extensions:i=_t.empty(),callsite:o,clientMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c}){let p=new Qi({runtimeDataModel:n,modelName:e,action:t,rootArgs:r,callsite:o,extensions:i,selectionPath:[],argumentPath:[],originalMethod:s,errorFormat:a,clientVersion:l,previewFeatures:u,globalOmit:c});return{modelName:e,action:md[t],query:gr(r,p)}}function gr({select:e,include:t,...r}={},n){let i=r.omit;return delete r.omit,{arguments:wa(r,n),selection:fd(e,t,i,n)}}function fd(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()}),Ed(e,n)):gd(n,t,r)}function gd(e,t,r){let n={};return e.modelOrType&&!e.isRawAction()&&(n.$composites=!0,n.$scalars=!0),t&&hd(n,t,e),yd(n,r,e),n}function hd(e,t,r){for(let[n,i]of Object.entries(t)){if(Ce(i))continue;let o=r.nestSelection(n);if(Gi(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]=gr(i===!0?{}:i,o);continue}if(i===!0){e[n]=!0;continue}e[n]=gr(i,o)}}function yd(e,t,r){let n=r.getComputedFields(),i={...r.getGlobalOmit(),...t},o=fa(i,n);for(let[s,a]of Object.entries(o)){if(Ce(a))continue;Gi(a,r.nestSelection(s));let l=r.findField(s);n?.[s]&&!l||(e[s]=!a)}}function Ed(e,t){let r={},n=t.getComputedFields(),i=ma(e,n);for(let[o,s]of Object.entries(i)){if(Ce(s))continue;let a=t.nestSelection(o);Gi(s,a);let l=t.findField(o);if(!(n?.[o]&&!l)){if(s===!1||s===void 0||Ce(s)){r[o]=!1;continue}if(s===!0){l?.kind==="object"?r[o]=gr({},a):r[o]=!0;continue}r[o]=gr(s,a)}}return r}function ba(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(Tt(e)){if(pn(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(ga(e))return{$type:"Param",value:e.name};if(kt(e))return{$type:"FieldRef",value:{_ref:e.name,_container:e.modelName}};if(Array.isArray(e))return bd(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(wd(e))return e.values;if(Rt(e))return{$type:"Decimal",value:e.toFixed()};if(e instanceof Me){if(e!==xn.instances[e._getName()])throw new Error("Invalid ObjectEnumValue");return{$type:"Enum",value:e._getName()}}if(xd(e))return e.toJSON();if(typeof e=="object")return wa(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 wa(e,t){if(e.$type)return{$type:"Raw",value:e};let r={};for(let n in e){let i=e[n],o=t.nestArgument(n);Ce(i)||(i!==void 0?r[n]=ba(i,o):t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidArgumentValue",argumentPath:o.getArgumentPath(),selectionPath:t.getSelectionPath(),argument:{name:t.getArgumentName(),typeNames:[]},underlyingError:Ea}))}return r}function bd(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||Ce(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(ba(o,i))}return r}function wd(e){return typeof e=="object"&&e!==null&&e.__prismaRawParameters__===!0}function xd(e){return typeof e=="object"&&e!==null&&typeof e.toJSON=="function"}function Gi(e,t){e===void 0&&t.isPreviewFeatureOn("strictUndefinedChecks")&&t.throwValidationError({kind:"InvalidSelectionValue",selectionPath:t.getSelectionPath(),underlyingError:Ea})}var Qi=class e{constructor(t){this.params=t;this.params.modelName&&(this.modelOrType=this.params.runtimeDataModel.models[this.params.modelName]??this.params.runtimeDataModel.types[this.params.modelName])}modelOrType;throwValidationError(t){Tn({errors:[t],originalMethod:this.params.originalMethod,args:this.params.rootArgs??{},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)}getComputedFields(){if(this.params.modelName)return this.params.extensions.getAllComputedFields(this.params.modelName)}findField(t){return this.modelOrType?.fields.find(r=>r.name===t)}nestSelection(t){let r=this.findField(t),n=r?.kind==="object"?r.type:void 0;return new e({...this.params,modelName:n,selectionPath:this.params.selectionPath.concat(t)})}getGlobalOmit(){return this.params.modelName&&this.shouldApplyGlobalOmit()?this.params.globalOmit?.[vt(this.params.modelName)]??{}:{}}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:Ne(this.params.action,"Unknown action")}}nestArgument(t){return new e({...this.params,argumentPath:this.params.argumentPath.concat(t)})}};function xa(e){if(!e._hasPreviewFlag("metrics"))throw new X("`metrics` preview feature must be enabled in order to access metrics API",{clientVersion:e._clientVersion})}var Dt=class{_client;constructor(t){this._client=t}prometheus(t){return xa(this._client),this._client._engine.metrics({format:"prometheus",...t})}json(t){return xa(this._client),this._client._engine.metrics({format:"json",...t})}};function Pa(e){return{models:Ji(e.models),enums:Ji(e.enums),types:Ji(e.types)}}function Ji(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function va(e,t){let r=mr(()=>Pd(t));Object.defineProperty(e,"dmmf",{get:()=>r.get()})}function Pd(e){return{datamodel:{models:Wi(e.models),enums:Wi(e.enums),types:Wi(e.types)}}}function Wi(e){return Object.entries(e).map(([t,r])=>({name:t,...r}))}var Hi=new WeakMap,In="$$PrismaTypedSql",hr=class{constructor(t,r){Hi.set(this,{sql:t,values:r}),Object.defineProperty(this,In,{value:In})}get sql(){return Hi.get(this).sql}get values(){return Hi.get(this).values}};function Ta(e){return(...t)=>new hr(e,t)}function kn(e){return e!=null&&e[In]===In}var tu=O(fi());var ru=require("async_hooks"),nu=require("events"),iu=O(require("fs")),Lr=O(require("path"));var se=class e{constructor(t,r){if(t.length-1!==r.length)throw t.length===0?new TypeError("Expected at least 1 string"):new TypeError(`Expected ${t.length} strings to have ${t.length-1} values`);let n=r.reduce((s,a)=>s+(a instanceof e?a.values.length:1),0);this.values=new Array(n),this.strings=new Array(n+1),this.strings[0]=t[0];let i=0,o=0;for(;i<r.length;){let s=r[i++],a=t[i];if(s instanceof e){this.strings[o]+=s.strings[0];let l=0;for(;l<s.values.length;)this.values[o++]=s.values[l++],this.strings[o]=s.strings[l];this.strings[o]+=a}else this.values[o++]=s,this.strings[o]=a}}get sql(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`?${this.strings[r++]}`;return n}get statement(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`:${r}${this.strings[r++]}`;return n}get text(){let t=this.strings.length,r=1,n=this.strings[0];for(;r<t;)n+=`$${r}${this.strings[r++]}`;return n}inspect(){return{sql:this.sql,statement:this.statement,text:this.text,values:this.values}}};function Ra(e,t=",",r="",n=""){if(e.length===0)throw new TypeError("Expected `join([])` to be called with an array of multiple elements, but got an empty array");return new se([r,...Array(e.length-1).fill(t),n],e)}function Ki(e){return new se([e],[])}var Sa=Ki("");function Yi(e,...t){return new se(e,t)}function yr(e){return{getKeys(){return Object.keys(e)},getPropertyValue(t){return e[t]}}}function re(e,t){return{getKeys(){return[e]},getPropertyValue(){return t()}}}function st(e){let t=new Re;return{getKeys(){return e.getKeys()},getPropertyValue(r){return t.getOrCreate(r,()=>e.getPropertyValue(r))},getPropertyDescriptor(r){return e.getPropertyDescriptor?.(r)}}}var On={enumerable:!0,configurable:!0,writable:!0};function _n(e){let t=new Set(e);return{getPrototypeOf:()=>Object.prototype,getOwnPropertyDescriptor:()=>On,has:(r,n)=>t.has(n),set:(r,n,i)=>t.add(n)&&Reflect.set(r,n,i),ownKeys:()=>[...t]}}var Ca=Symbol.for("nodejs.util.inspect.custom");function ye(e,t){let r=vd(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){if(n.has(s))return!0;let a=r.get(s);return a?a.has?.(s)??!0:Reflect.has(o,s)},ownKeys(o){let s=Aa(Reflect.ownKeys(o),r),a=Aa(Array.from(r.keys()),r);return[...new Set([...s,...a,...n])]},set(o,s,a){return r.get(s)?.getPropertyDescriptor?.(s)?.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?{...On,...l?.getPropertyDescriptor(s)}:On:a},defineProperty(o,s,a){return n.add(s),Reflect.defineProperty(o,s,a)},getPrototypeOf:()=>Object.prototype});return i[Ca]=function(){let o={...this};return delete o[Ca],o},i}function vd(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 Aa(e,t){return e.filter(r=>t.get(r)?.has?.(r)??!0)}function Nt(e){return{getKeys(){return e},has(){return!1},getPropertyValue(){}}}function Lt(e,t){return{batch:e,transaction:t?.kind==="batch"?{isolationLevel:t.options.isolationLevel}:void 0}}function Ia(e){if(e===void 0)return"";let t=Ot(e);return new St(0,{colors:En}).write(t).toString()}var Td="P2037";function Ft({error:e,user_facing_error:t},r,n){return t.error_code?new Z(Rd(t,n),{code:t.error_code,clientVersion:r,meta:t.meta,batchRequestIdx:t.batch_request_idx}):new j(e,{clientVersion:r,batchRequestIdx:t.batch_request_idx})}function Rd(e,t){let r=e.message;return(t==="postgresql"||t==="postgres"||t==="mysql")&&e.error_code===Td&&(r+=`
30
+ Prisma Accelerate has built-in connection pooling to prevent such errors: https://pris.ly/client/error-accelerate`),r}var Er="<unknown>";function ka(e){var t=e.split(`
31
+ `);return t.reduce(function(r,n){var i=Ad(n)||kd(n)||Dd(n)||Md(n)||Ld(n);return i&&r.push(i),r},[])}var Sd=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|rsc|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Cd=/\((\S*)(?::(\d+))(?::(\d+))\)/;function Ad(e){var t=Sd.exec(e);if(!t)return null;var r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,i=Cd.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]||Er,arguments:r?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var Id=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|rsc|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function kd(e){var t=Id.exec(e);return t?{file:t[2],methodName:t[1]||Er,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var Od=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|rsc|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,_d=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Dd(e){var t=Od.exec(e);if(!t)return null;var r=t[3]&&t[3].indexOf(" > eval")>-1,n=_d.exec(t[3]);return r&&n!=null&&(t[3]=n[1],t[4]=n[2],t[5]=null),{file:t[3],methodName:t[1]||Er,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var Nd=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function Ld(e){var t=Nd.exec(e);return t?{file:t[3],methodName:t[1]||Er,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}:null}var Fd=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Md(e){var t=Fd.exec(e);return t?{file:t[2],methodName:t[1]||Er,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}:null}var zi=class{getLocation(){return null}},Zi=class{_error;constructor(){this._error=new Error}getLocation(){let t=this._error.stack;if(!t)return null;let n=ka(t).find(i=>{if(!i.file)return!1;let o=xi(i.file);return o!=="<anonymous>"&&!o.includes("@prisma")&&!o.includes("/packages/client/src/runtime/")&&!o.endsWith("/runtime/binary.js")&&!o.endsWith("/runtime/library.js")&&!o.endsWith("/runtime/edge.js")&&!o.endsWith("/runtime/edge-esm.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 Ze(e){return e==="minimal"?typeof $EnabledCallSite=="function"&&e!=="minimal"?new $EnabledCallSite:new zi:new Zi}var Oa={_avg:!0,_count:!0,_sum:!0,_min:!0,_max:!0};function Mt(e={}){let t=qd(e);return Object.entries(t).reduce((n,[i,o])=>(Oa[i]!==void 0?n.select[i]={select:o}:n[i]=o,n),{select:{}})}function qd(e={}){return typeof e._count=="boolean"?{...e,_count:{_all:e._count}}:e}function Dn(e={}){return t=>(typeof e._count=="boolean"&&(t._count=t._count._all),t)}function _a(e,t){let r=Dn(e);return t({action:"aggregate",unpacker:r,argsMapper:Mt})(e)}function Vd(e={}){let{select:t,...r}=e;return typeof t=="object"?Mt({...r,_count:t}):Mt({...r,_count:{_all:!0}})}function jd(e={}){return typeof e.select=="object"?t=>Dn(e)(t)._count:t=>Dn(e)(t)._count._all}function Da(e,t){return t({action:"count",unpacker:jd(e),argsMapper:Vd})(e)}function Bd(e={}){let t=Mt(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 Ud(e={}){return t=>(typeof e?._count=="boolean"&&t.forEach(r=>{r._count=r._count._all}),t)}function Na(e,t){return t({action:"groupBy",unpacker:Ud(e),argsMapper:Bd})(e)}function La(e,t,r){if(t==="aggregate")return n=>_a(n,r);if(t==="count")return n=>Da(n,r);if(t==="groupBy")return n=>Na(n,r)}function Fa(e,t){let r=t.fields.filter(i=>!i.relationName),n=Di(r,i=>i.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 lr(e,o,s.type,s.isList,s.kind==="enum")},..._n(Object.keys(n))})}var Ma=e=>Array.isArray(e)?e:e.split("."),Xi=(e,t)=>Ma(t).reduce((r,n)=>r&&r[n],e),$a=(e,t,r)=>Ma(t).reduceRight((n,i,o,s)=>Object.assign({},Xi(e,s.slice(0,o)),{[i]:n}),r);function Qd(e,t){return e===void 0||t===void 0?[]:[...t,"select",e]}function Gd(e,t,r){return t===void 0?e??{}:$a(t,r,e||!0)}function eo(e,t,r,n,i,o){let a=e._runtimeDataModel.models[t].fields.reduce((l,u)=>({...l,[u.name]:u}),{});return l=>{let u=Ze(e._errorFormat),c=Qd(n,i),p=Gd(l,o,c),d=r({dataPath:c,callsite:u})(p),f=Jd(e,t);return new Proxy(d,{get(g,h){if(!f.includes(h))return g[h];let T=[a[h].type,r,h],S=[c,p];return eo(e,...T,...S)},..._n([...f,...Object.getOwnPropertyNames(d)])})}}function Jd(e,t){return e._runtimeDataModel.models[t].fields.filter(r=>r.kind==="object").map(r=>r.name)}var Wd=["findUnique","findUniqueOrThrow","findFirst","findFirstOrThrow","create","update","upsert","delete"],Hd=["aggregate","count","groupBy"];function to(e,t){let r=e._extensions.getAllModelExtensions(t)??{},n=[Kd(e,t),zd(e,t),yr(r),re("name",()=>t),re("$name",()=>t),re("$parent",()=>e._appliedParent)];return ye({},n)}function Kd(e,t){let r=Se(t),n=Object.keys(ir).concat("count");return{getKeys(){return n},getPropertyValue(i){let o=i,s=a=>l=>{let u=Ze(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 Wd.includes(o)?eo(e,t,s):Yd(i)?La(e,i,s):s({})}}}function Yd(e){return Hd.includes(e)}function zd(e,t){return st(re("fields",()=>{let r=e._runtimeDataModel.models[t];return Fa(t,r)}))}function qa(e){return e.replace(/^./,t=>t.toUpperCase())}var ro=Symbol();function br(e){let t=[Zd(e),Xd(e),re(ro,()=>e),re("$parent",()=>e._appliedParent)],r=e._extensions.getAllClientExtensions();return r&&t.push(yr(r)),ye(e,t)}function Zd(e){let t=Object.getPrototypeOf(e._originalClient),r=[...new Set(Object.getOwnPropertyNames(t))];return{getKeys(){return r},getPropertyValue(n){return e[n]}}}function Xd(e){let t=Object.keys(e._runtimeDataModel.models),r=t.map(Se),n=[...new Set(t.concat(r))];return st({getKeys(){return n},getPropertyValue(i){let o=qa(i);if(e._runtimeDataModel.models[o]!==void 0)return to(e,o);if(e._runtimeDataModel.models[i]!==void 0)return to(e,i)},getPropertyDescriptor(i){if(!r.includes(i))return{enumerable:!1}}})}function Va(e){return e[ro]?e[ro]:e}function ja(e){if(typeof e=="function")return e(this);if(e.client?.__AccelerateEngine){let r=e.client.__AccelerateEngine;this._originalClient._engine=new r(this._originalClient._accelerateEngineConfig)}let t=Object.create(this._originalClient,{_extensions:{value:this._extensions.append(e)},_appliedParent:{value:this,configurable:!0},$use:{value:void 0},$on:{value:void 0}});return br(t)}function Ba({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(Nt(u))}else if(r){if(!r[l.name])continue;let u=l.needs.filter(c=>!r[c]);u.length>0&&a.push(Nt(u))}em(e,l.needs)&&s.push(tm(l,ye(e,s)))}return s.length>0||a.length>0?ye(e,[...s,...a]):e}function em(e,t){return t.every(r=>_i(e,r))}function tm(e,t){return st(re(e.name,()=>e.compute(t)))}function Nn({visitor:e,result:t,args:r,runtimeDataModel:n,modelName:i}){if(Array.isArray(t)){for(let s=0;s<t.length;s++)t[s]=Nn({result:t[s],args:r,modelName:i,runtimeDataModel:n,visitor:e});return t}let o=e(t,i,r)??t;return r.include&&Ua({includeOrSelect:r.include,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),r.select&&Ua({includeOrSelect:r.select,result:o,parentModelName:i,runtimeDataModel:n,visitor:e}),o}function Ua({includeOrSelect:e,result:t,parentModelName:r,runtimeDataModel:n,visitor:i}){for(let[o,s]of Object.entries(e)){if(!s||t[o]==null||Ce(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]=Nn({visitor:i,result:t[o],args:u,modelName:l.type,runtimeDataModel:n})}}function Qa({result:e,modelName:t,args:r,extensions:n,runtimeDataModel:i,globalOmit:o}){return n.isEmpty()||e==null||typeof e!="object"||!i.models[t]?e:Nn({result:e,args:r??{},modelName:t,runtimeDataModel:i,visitor:(a,l,u)=>{let c=Se(l);return Ba({result:a,modelName:c,select:u.select,omit:u.select?void 0:{...o?.[c],...u.omit},extensions:n})}})}var rm=["$connect","$disconnect","$on","$transaction","$use","$extends"],Ga=rm;function Ja(e){if(e instanceof se)return nm(e);if(kn(e))return im(e);if(Array.isArray(e)){let r=[e[0]];for(let n=1;n<e.length;n++)r[n]=wr(e[n]);return r}let t={};for(let r in e)t[r]=wr(e[r]);return t}function nm(e){return new se(e.strings,e.values)}function im(e){return new hr(e.sql,e.values)}function wr(e){if(typeof e!="object"||e==null||e instanceof Me||kt(e))return e;if(Rt(e))return new ve(e.toFixed());if(Tt(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]=wr(e[t]);return r}if(typeof e=="object"){let t={};for(let r in e)r==="__proto__"?Object.defineProperty(t,r,{value:wr(e[r]),configurable:!0,enumerable:!0,writable:!0}):t[r]=wr(e[r]);return t}Ne(e,"Unknown value")}function Ha(e,t,r,n=0){return e._createPrismaPromise(i=>{let o=t.customDataProxyFetch;return"transaction"in t&&i!==void 0&&(t.transaction?.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:Ja(t.args??{}),__internalParams:t,query:(s,a=t)=>{let l=a.customDataProxyFetch;return a.customDataProxyFetch=Za(o,l),a.args=s,Ha(e,a,r,n+1)}})})}function Ka(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??"$none",o);return Ha(e,t,s)}function Ya(e){return t=>{let r={requests:t},n=t[0].extensions.getAllBatchQueryCallbacks();return n.length?za(r,n,0,e):e(r)}}function za(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=Za(i,l),za(a,t,r+1,n)}})}var Wa=e=>e;function Za(e=Wa,t=Wa){return r=>e(t(r))}var Xa=L("prisma:client"),el={Vercel:"vercel","Netlify CI":"netlify"};function tl({postinstall:e,ciName:t,clientVersion:r}){if(Xa("checkPlatformCaching:postinstall",e),Xa("checkPlatformCaching:ciName",t),e===!0&&t&&t in el){let n=`Prisma has detected that this project was built on ${t}, which caches dependencies. This leads to an outdated Prisma Client because Prisma's auto-generation isn't triggered. To fix this, make sure to run the \`prisma generate\` command during the build process.
32
32
 
33
- Learn how: https://pris.ly/d/${nl[r]}-build`;throw console.error(n),new R(n,t)}}function ol(e,r){return e?e.datasources?e.datasources:e.datasourceUrl?{[r[0]]:{url:e.datasourceUrl}}:{}:{}}var am=()=>globalThis.process?.release?.name==="node",lm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,um=()=>!!globalThis.Deno,cm=()=>typeof globalThis.Netlify=="object",pm=()=>typeof globalThis.EdgeRuntime=="object",dm=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function mm(){return[[cm,"netlify"],[pm,"edge-light"],[dm,"workerd"],[um,"deno"],[lm,"bun"],[am,"node"]].flatMap(t=>t[0]()?[t[1]]:[]).at(0)??""}var fm={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 Ln(){let e=mm();return{id:e,prettyName:fm[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var cl=O(require("fs")),xt=O(require("path"));function Fn(e){let{runtimeBinaryTarget:r}=e;return`Add "${r}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it:
33
+ Learn how: https://pris.ly/d/${el[t]}-build`;throw console.error(n),new R(n,r)}}function rl(e,t){return e?e.datasources?e.datasources:e.datasourceUrl?{[t[0]]:{url:e.datasourceUrl}}:{}:{}}var om=()=>globalThis.process?.release?.name==="node",sm=()=>!!globalThis.Bun||!!globalThis.process?.versions?.bun,am=()=>!!globalThis.Deno,lm=()=>typeof globalThis.Netlify=="object",um=()=>typeof globalThis.EdgeRuntime=="object",cm=()=>globalThis.navigator?.userAgent==="Cloudflare-Workers";function pm(){return[[lm,"netlify"],[um,"edge-light"],[cm,"workerd"],[am,"deno"],[sm,"bun"],[om,"node"]].flatMap(r=>r[0]()?[r[1]]:[]).at(0)??""}var dm={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 Ln(){let e=pm();return{id:e,prettyName:dm[e]||e,isEdge:["workerd","deno","netlify","edge-light"].includes(e)}}var al=O(require("fs")),xr=O(require("path"));function Fn(e){let{runtimeBinaryTarget:t}=e;return`Add "${t}" to \`binaryTargets\` in the "schema.prisma" file and run \`prisma generate\` after saving it:
34
34
 
35
- ${gm(e)}`}function gm(e){let{generator:r,generatorBinaryTargets:t,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...t,i];return vi({...r,binaryTargets:o})}function er(e){let{runtimeBinaryTarget:r}=e;return`Prisma Client could not locate the Query Engine for runtime "${r}".`}function rr(e){let{searchedLocations:r}=e;return`The following locations have been searched:
36
- ${[...new Set(r)].map(i=>` ${i}`).join(`
37
- `)}`}function sl(e){let{runtimeBinaryTarget:r}=e;return`${er(e)}
35
+ ${mm(e)}`}function mm(e){let{generator:t,generatorBinaryTargets:r,runtimeBinaryTarget:n}=e,i={fromEnvVar:null,value:n},o=[...r,i];return Ti({...t,binaryTargets:o})}function Xe(e){let{runtimeBinaryTarget:t}=e;return`Prisma Client could not locate the Query Engine for runtime "${t}".`}function et(e){let{searchedLocations:t}=e;return`The following locations have been searched:
36
+ ${[...new Set(t)].map(i=>` ${i}`).join(`
37
+ `)}`}function nl(e){let{runtimeBinaryTarget:t}=e;return`${Xe(e)}
38
38
 
39
- This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${r}".
39
+ This happened because \`binaryTargets\` have been pinned, but the actual deployment also required "${t}".
40
40
  ${Fn(e)}
41
41
 
42
- ${rr(e)}`}function Mn(e){return`We would appreciate if you could take the time to share some information with us.
43
- Please help us by answering a few questions: https://pris.ly/${e}`}function $n(e){let{errorStack:r}=e;return r?.match(/\/\.next|\/next@|\/next\//)?`
42
+ ${et(e)}`}function Mn(e){return`We would appreciate if you could take the time to share some information with us.
43
+ Please help us by answering a few questions: https://pris.ly/${e}`}function $n(e){let{errorStack:t}=e;return t?.match(/\/\.next|\/next@|\/next\//)?`
44
44
 
45
- We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function al(e){let{queryEngineName:r}=e;return`${er(e)}${$n(e)}
45
+ We detected that you are using Next.js, learn how to fix this: https://pris.ly/d/engine-not-found-nextjs.`:""}function il(e){let{queryEngineName:t}=e;return`${Xe(e)}${$n(e)}
46
46
 
47
- This is likely caused by a bundler that has not copied "${r}" next to the resulting bundle.
48
- Ensure that "${r}" has been copied next to the bundle or in "${e.expectedLocation}".
47
+ This is likely caused by a bundler that has not copied "${t}" next to the resulting bundle.
48
+ Ensure that "${t}" has been copied next to the bundle or in "${e.expectedLocation}".
49
49
 
50
50
  ${Mn("engine-not-found-bundler-investigation")}
51
51
 
52
- ${rr(e)}`}function ll(e){let{runtimeBinaryTarget:r,generatorBinaryTargets:t}=e,n=t.find(i=>i.native);return`${er(e)}
52
+ ${et(e)}`}function ol(e){let{runtimeBinaryTarget:t,generatorBinaryTargets:r}=e,n=r.find(i=>i.native);return`${Xe(e)}
53
53
 
54
- This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${r}".
54
+ This happened because Prisma Client was generated for "${n?.value??"unknown"}", but the actual deployment required "${t}".
55
55
  ${Fn(e)}
56
56
 
57
- ${rr(e)}`}function ul(e){let{queryEngineName:r}=e;return`${er(e)}${$n(e)}
57
+ ${et(e)}`}function sl(e){let{queryEngineName:t}=e;return`${Xe(e)}${$n(e)}
58
58
 
59
- This is likely caused by tooling that has not copied "${r}" to the deployment folder.
60
- Ensure that you ran \`prisma generate\` and that "${r}" has been copied to "${e.expectedLocation}".
59
+ This is likely caused by tooling that has not copied "${t}" to the deployment folder.
60
+ Ensure that you ran \`prisma generate\` and that "${t}" has been copied to "${e.expectedLocation}".
61
61
 
62
62
  ${Mn("engine-not-found-tooling-investigation")}
63
63
 
64
- ${rr(e)}`}var hm=L("prisma:client:engines:resolveEnginePath"),ym=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function pl(e,r){let t={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??r.prismaPath;if(t!==void 0)return t;let{enginePath:n,searchedLocations:i}=await Em(e,r);if(hm("enginePath",n),n!==void 0&&e==="binary"&&yi(n),n!==void 0)return r.prismaPath=n;let o=await ir(),s=r.generator?.binaryTargets??[],a=s.some(d=>d.native),l=!s.some(d=>d.value===o),u=__filename.match(ym())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:r.generator,runtimeBinaryTarget:o,queryEngineName:dl(e,o),expectedLocation:xt.default.relative(process.cwd(),r.dirname),errorStack:new Error().stack},p;throw a&&l?p=ll(c):l?p=sl(c):u?p=al(c):p=ul(c),new R(p,r.clientVersion)}async function Em(engineType,config){let binaryTarget=await ir(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,xt.default.resolve(dirname,".."),config.generator?.output?.value??dirname,xt.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(ls());for(let e of searchLocations){let r=dl(engineType,binaryTarget),t=xt.default.join(e,r);if(searchedLocations.push(e),cl.default.existsSync(t))return{enginePath:t,searchedLocations}}return{enginePath:void 0,searchedLocations}}function dl(e,r){return e==="library"?Vt(r,"fs"):`query-engine-${r}${r==="windows"?".exe":""}`}var no=O(Ri());function ml(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,r=>`${r[0]}5`):""}function fl(e){return e.split(`
65
- `).map(r=>r.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(`
66
- `)}var gl=O(As());function hl({title:e,user:r="prisma",repo:t="prisma",template:n="bug_report.yml",body:i}){return(0,gl.default)({user:r,repo:t,template:n,title:e,body:i})}function yl({version:e,binaryTarget:r,title:t,description:n,engineVersion:i,database:o,query:s}){let a=qo(6e3-(s?.length??0)),l=fl((0,no.default)(a)),u=n?`# Description
64
+ ${et(e)}`}var fm=L("prisma:client:engines:resolveEnginePath"),gm=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function ll(e,t){let r={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??t.prismaPath;if(r!==void 0)return r;let{enginePath:n,searchedLocations:i}=await hm(e,t);if(fm("enginePath",n),n!==void 0&&e==="binary"&&yi(n),n!==void 0)return t.prismaPath=n;let o=await nt(),s=t.generator?.binaryTargets??[],a=s.some(d=>d.native),l=!s.some(d=>d.value===o),u=__filename.match(gm())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:t.generator,runtimeBinaryTarget:o,queryEngineName:ul(e,o),expectedLocation:xr.default.relative(process.cwd(),t.dirname),errorStack:new Error().stack},p;throw a&&l?p=ol(c):l?p=nl(c):u?p=il(c):p=sl(c),new R(p,t.clientVersion)}async function hm(engineType,config){let binaryTarget=await nt(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,xr.default.resolve(dirname,".."),config.generator?.output?.value??dirname,xr.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(as());for(let e of searchLocations){let t=ul(engineType,binaryTarget),r=xr.default.join(e,t);if(searchedLocations.push(e),al.default.existsSync(r))return{enginePath:r,searchedLocations}}return{enginePath:void 0,searchedLocations}}function ul(e,t){return e==="library"?Vr(t,"fs"):`query-engine-${t}${t==="windows"?".exe":""}`}var no=O(Si());function cl(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,t=>`${t[0]}5`):""}function pl(e){return e.split(`
65
+ `).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(`
66
+ `)}var dl=O(Cs());function ml({title:e,user:t="prisma",repo:r="prisma",template:n="bug_report.yml",body:i}){return(0,dl.default)({user:t,repo:r,template:n,title:e,body:i})}function fl({version:e,binaryTarget:t,title:r,description:n,engineVersion:i,database:o,query:s}){let a=$o(6e3-(s?.length??0)),l=pl((0,no.default)(a)),u=n?`# Description
67
67
  \`\`\`
68
68
  ${n}
69
69
  \`\`\``:"",c=(0,no.default)(`Hi Prisma Team! My Prisma Client just crashed. This is the report:
@@ -72,7 +72,7 @@ ${n}
72
72
  | Name | Version |
73
73
  |-----------------|--------------------|
74
74
  | Node | ${process.version?.padEnd(19)}|
75
- | OS | ${r?.padEnd(19)}|
75
+ | OS | ${t?.padEnd(19)}|
76
76
  | Prisma Client | ${e?.padEnd(19)}|
77
77
  | Query Engine | ${i?.padEnd(19)}|
78
78
  | Database | ${o?.padEnd(19)}|
@@ -96,9 +96,9 @@ ${l}
96
96
 
97
97
  ## Prisma Engine Query
98
98
  \`\`\`
99
- ${s?ml(s):""}
99
+ ${s?cl(s):""}
100
100
  \`\`\`
101
- `),p=hl({title:t,body:c});return`${t}
101
+ `),p=ml({title:r,body:c});return`${r}
102
102
 
103
103
  This is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.
104
104
 
@@ -107,28 +107,28 @@ ${z(p)}
107
107
  If you want the Prisma team to look into it, please open the link above \u{1F64F}
108
108
  To increase the chance of success, please post your schema and a snippet of
109
109
  how you used Prisma Client in the issue.
110
- `}function $r({inlineDatasources:e,overrideDatasources:r,env:t,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=r[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=t[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new R(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new R("error: Missing URL environment variable, value, or override.",n);return i}var qn=class extends Error{clientVersion;cause;constructor(r,t){super(r),this.clientVersion=t.clientVersion,this.cause=t.cause}get[Symbol.toStringTag](){return this.name}};var ae=class extends qn{isRetryable;constructor(r,t){super(r,t),this.isRetryable=t.isRetryable??!0}};function C(e,r){return{...e,isRetryable:r}}var qr=class extends ae{name="ForcedRetryError";code="P5001";constructor(r){super("This request must be retried",C(r,!0))}};x(qr,"ForcedRetryError");var lr=class extends ae{name="InvalidDatasourceError";code="P6001";constructor(r,t){super(r,C(t,!1))}};x(lr,"InvalidDatasourceError");var ur=class extends ae{name="NotImplementedYetError";code="P5004";constructor(r,t){super(r,C(t,!1))}};x(ur,"NotImplementedYetError");var q=class extends ae{response;constructor(r,t){super(r,t),this.response=t.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var cr=class extends q{name="SchemaMissingError";code="P5005";constructor(r){super("Schema needs to be uploaded",C(r,!0))}};x(cr,"SchemaMissingError");var io="This request could not be understood by the server",Pt=class extends q{name="BadRequestError";code="P5000";constructor(r,t,n){super(t||io,C(r,!1)),n&&(this.code=n)}};x(Pt,"BadRequestError");var vt=class extends q{name="HealthcheckTimeoutError";code="P5013";logs;constructor(r,t){super("Engine not started: healthcheck timeout",C(r,!0)),this.logs=t}};x(vt,"HealthcheckTimeoutError");var Tt=class extends q{name="EngineStartupError";code="P5014";logs;constructor(r,t,n){super(t,C(r,!0)),this.logs=n}};x(Tt,"EngineStartupError");var Rt=class extends q{name="EngineVersionNotSupportedError";code="P5012";constructor(r){super("Engine version is not supported",C(r,!1))}};x(Rt,"EngineVersionNotSupportedError");var oo="Request timed out",St=class extends q{name="GatewayTimeoutError";code="P5009";constructor(r,t=oo){super(t,C(r,!1))}};x(St,"GatewayTimeoutError");var bm="Interactive transaction error",Ct=class extends q{name="InteractiveTransactionError";code="P5015";constructor(r,t=bm){super(t,C(r,!1))}};x(Ct,"InteractiveTransactionError");var wm="Request parameters are invalid",At=class extends q{name="InvalidRequestError";code="P5011";constructor(r,t=wm){super(t,C(r,!1))}};x(At,"InvalidRequestError");var so="Requested resource does not exist",It=class extends q{name="NotFoundError";code="P5003";constructor(r,t=so){super(t,C(r,!1))}};x(It,"NotFoundError");var ao="Unknown server error",Vr=class extends q{name="ServerError";code="P5006";logs;constructor(r,t,n){super(t||ao,C(r,!0)),this.logs=n}};x(Vr,"ServerError");var lo="Unauthorized, check your connection string",kt=class extends q{name="UnauthorizedError";code="P5007";constructor(r,t=lo){super(t,C(r,!1))}};x(kt,"UnauthorizedError");var uo="Usage exceeded, retry again later",Ot=class extends q{name="UsageExceededError";code="P5008";constructor(r,t=uo){super(t,C(r,!0))}};x(Ot,"UsageExceededError");async function xm(e){let r;try{r=await e.text()}catch{return{type:"EmptyError"}}try{let t=JSON.parse(r);if(typeof t=="string")switch(t){case"InternalDataProxyError":return{type:"DataProxyError",body:t};default:return{type:"UnknownTextError",body:t}}if(typeof t=="object"&&t!==null){if("is_panic"in t&&"message"in t&&"error_code"in t)return{type:"QueryEngineError",body:t};if("EngineNotStarted"in t||"InteractiveTransactionMisrouted"in t||"InvalidRequestError"in t){let n=Object.values(t)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:t}:{type:"DataProxyError",body:t}}}return{type:"UnknownJsonError",body:t}}catch{return r===""?{type:"EmptyError"}:{type:"UnknownTextError",body:r}}}async function _t(e,r){if(e.ok)return;let t={clientVersion:r,response:e},n=await xm(e);if(n.type==="QueryEngineError")throw new Z(n.body.message,{code:n.body.error_code,clientVersion:r});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Vr(t,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new cr(t);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Rt(t);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Tt(t,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new R(i,r,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new vt(t,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Ct(t,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new At(t,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new kt(t,jr(lo,n));if(e.status===404)return new It(t,jr(so,n));if(e.status===429)throw new Ot(t,jr(uo,n));if(e.status===504)throw new St(t,jr(oo,n));if(e.status>=500)throw new Vr(t,jr(ao,n));if(e.status>=400)throw new Pt(t,jr(io,n))}function jr(e,r){return r.type==="EmptyError"?e:`${e}: ${JSON.stringify(r)}`}function El(e){let r=Math.pow(2,e)*50,t=Math.ceil(Math.random()*r)-Math.ceil(r/2),n=r+t;return new Promise(i=>setTimeout(()=>i(n),n))}var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function bl(e){let r=new TextEncoder().encode(e),t="",n=r.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=r[p]<<16|r[p+1]<<8|r[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,t+=$e[s]+$e[a]+$e[l]+$e[u];return i==1?(c=r[o],s=(c&252)>>2,a=(c&3)<<4,t+=$e[s]+$e[a]+"=="):i==2&&(c=r[o]<<8|r[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,t+=$e[s]+$e[a]+$e[l]+"="),t}function wl(e){if(!!e.generator?.previewFeatures.some(t=>t.toLowerCase().includes("metrics")))throw new R("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function Pm(e){return e[0]*1e3+e[1]/1e6}function co(e){return new Date(Pm(e))}var xl={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Dt=class extends ae{name="RequestError";code="P5010";constructor(r,t){super(`Cannot fetch data from service:
111
- ${r}`,C(t,!0))}};x(Dt,"RequestError");async function pr(e,r,t=n=>n){let{clientVersion:n,...i}=r,o=t(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new Dt(a,{clientVersion:n,cause:s})}}var Tm=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,Pl=L("prisma:client:dataproxyEngine");async function Rm(e,r){let t=xl["@prisma/engines-version"],n=r.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Tm.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=t.split("-")??[],[a,l,u]=s.split("."),c=Sm(`<=${a}.${l}.${u}`),p=await pr(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let d=await p.text();Pl("length of body fetched from unpkg.com",d.length);let f;try{f=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return f.version}throw new ur("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function vl(e,r){let t=await Rm(e,r);return Pl("version",t),t}function Sm(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var Tl=3,Vn=L("prisma:client:dataproxyEngine"),po=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:r,tracingHelper:t,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=r,this.tracingHelper=t,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:r,interactiveTransaction:t}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=r??this.tracingHelper.getTraceParent()),t&&(n["X-transaction-id"]=t.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let r=[];return this.tracingHelper.isEnabled()&&r.push("tracing"),this.logLevel&&r.push(this.logLevel),this.logQueries&&r.push("query"),r}},Nt=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;constructor(r){wl(r),this.config=r,this.env={...r.env,...typeof process<"u"?process.env:{}},this.inlineSchema=bl(r.inlineSchema),this.inlineDatasources=r.inlineDatasources,this.inlineSchemaHash=r.inlineSchemaHash,this.clientVersion=r.clientVersion,this.engineHash=r.engineVersion,this.logEmitter=r.logEmitter,this.tracingHelper=r.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[r,t]=this.extractHostAndApiKey();this.host=r,this.headerBuilder=new po({apiKey:t,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await vl(r,this.config),Vn("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(r){r?.logs?.length&&r.logs.forEach(t=>{switch(t.level){case"debug":case"trace":Vn(t);break;case"error":case"warn":case"info":{this.logEmitter.emit(t.level,{timestamp:co(t.timestamp),message:t.attributes.message??"",target:t.target});break}case"query":{this.logEmitter.emit("query",{query:t.attributes.query??"",timestamp:co(t.timestamp),duration:t.attributes.duration_ms??0,params:t.attributes.params??"",target:t.target});break}default:t.level}}),r?.traces?.length&&this.tracingHelper.dispatchEngineSpans(r.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(r){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${r}`}async uploadSchema(){let r={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(r,async()=>{let t=await pr(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});t.ok||Vn("schema response status",t.status);let n=await _t(t,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(r,{traceparent:t,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:r,traceparent:t,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(r,{traceparent:t,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Lr(r,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:t})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:r,traceparent:t,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await pr(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t,interactiveTransaction:i}),body:JSON.stringify(r),clientVersion:this.clientVersion},n);a.ok||Vn("graphql response status",a.status),await this.handleError(await _t(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(r,t,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[r]} transaction`,callback:async({logHttpCall:o})=>{if(r==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await pr(a,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await _t(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${r}`;o(s);let a=await pr(s,{method:"POST",headers:this.headerBuilder.build({traceparent:t.traceparent}),clientVersion:this.clientVersion});await this.handleError(await _t(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let r={clientVersion:this.clientVersion},t=Object.keys(this.inlineDatasources)[0],n=$r({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new lr(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!==Yt)throw new lr(`Error validating datasource \`${t}\`: the URL must start with the protocol \`prisma://\``,r);let l=a.get("api_key");if(l===null||l.length<1)throw new lr(`Error validating datasource \`${t}\`: the URL must contain a valid API key`,r);return[s,l]}metrics(){throw new ur("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(r){for(let t=0;;t++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${t})`,timestamp:new Date,target:""})};try{return await r.callback({logHttpCall:n})}catch(i){if(!(i instanceof ae)||!i.isRetryable)throw i;if(t>=Tl)throw i instanceof qr?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${t+1}/${Tl} failed for ${r.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await El(t);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(r){if(r instanceof cr)throw await this.uploadSchema(),new qr({clientVersion:this.clientVersion,cause:r});if(r)throw r}convertProtocolErrorsToClientError(r){return r.length===1?Fr(r[0],this.config.clientVersion,this.config.activeProvider):new j(JSON.stringify(r),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function mo(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function jn(e){return{ok:!0,value:e,map(r){return jn(r(e))},flatMap(r){return r(e)}}}function dr(e){return{ok:!1,error:e,map(){return dr(e)},flatMap(){return dr(e)}}}var fo=class{registeredErrors=[];consumeError(r){return this.registeredErrors[r]}registerNewError(r){let t=0;for(;this.registeredErrors[t]!==void 0;)t++;return this.registeredErrors[t]={error:r},t}},go=e=>{let r=new fo,t={adapterName:e.adapterName,errorRegistry:r,queryRaw:qe(r,e.queryRaw.bind(e)),executeRaw:qe(r,e.executeRaw.bind(e)),executeScript:qe(r,e.executeScript.bind(e)),dispose:qe(r,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await qe(r,e.startTransaction.bind(e))(...n)).map(o=>Cm(r,o))};return e.getConnectionInfo&&(t.getConnectionInfo=Am(r,e.getConnectionInfo.bind(e))),t},Cm=(e,r)=>({adapterName:r.adapterName,provider:r.provider,options:r.options,queryRaw:qe(e,r.queryRaw.bind(r)),executeRaw:qe(e,r.executeRaw.bind(r)),commit:qe(e,r.commit.bind(r)),rollback:qe(e,r.rollback.bind(r))});function qe(e,r){return async(...t)=>{try{return jn(await r(...t))}catch(n){if(mo(n))return dr(n.cause);let i=e.registerNewError(n);return dr({kind:"GenericJs",id:i})}}}function Am(e,r){return(...t)=>{try{return jn(r(...t))}catch(n){if(mo(n))return dr(n.cause);let i=e.registerNewError(n);return dr({kind:"GenericJs",id:i})}}}function Rl(e){if(e?.kind==="itx")return e.options.id}var yo=O(require("os")),Sl=O(require("path"));var ho=Symbol("PrismaLibraryEngineCache");function Im(){let e=globalThis;return e[ho]===void 0&&(e[ho]={}),e[ho]}function km(e){let r=Im();if(r[e]!==void 0)return r[e];let t=Sl.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=yo.default.constants.dlopen.RTLD_LAZY|yo.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,t,i),r[e]=n.exports,n.exports}var Cl={async loadLibrary(e){let r=await ai(),t=await pl("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>km(t))}catch(n){let i=Ei({e:n,platformInfo:r,id:t});throw new R(i,e.clientVersion)}}};var Eo,Al={async loadLibrary(e){let{clientVersion:r,adapter:t,engineWasm:n}=e;if(t===void 0)throw new R(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Ln().prettyName})`,r);if(n===void 0)throw new R("WASM engine was unexpectedly `undefined`",r);Eo===void 0&&(Eo=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new R("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",r);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a),u=l.exports.__wbindgen_start;return o.__wbg_set_wasm(l.exports),u(),o.QueryEngine})());let i=await Eo;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Om="P2036",Ae=L("prisma:client:libraryEngine");function _m(e){return e.item_type==="query"&&"query"in e}function Dm(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var Il=[...ri,"native"],Nm=0xffffffffffffffffn,bo=1n;function Lm(){let e=bo++;return bo>Nm&&(bo=1n),e}var Br=class{name="LibraryEngine";engine;libraryInstantiationPromise;libraryStartingPromise;libraryStoppingPromise;libraryStarted;executingQueryPromise;config;QueryEngineConstructor;libraryLoader;library;logEmitter;libQueryEnginePath;binaryTarget;datasourceOverrides;datamodel;logQueries;logLevel;lastQuery;loggerRustPanic;tracingHelper;adapterPromise;versionInfo;constructor(r,t){this.libraryLoader=t??Cl,r.engineWasm!==void 0&&(this.libraryLoader=t??Al),this.config=r,this.libraryStarted=!1,this.logQueries=r.logQueries??!1,this.logLevel=r.logLevel??"error",this.logEmitter=r.logEmitter,this.datamodel=r.inlineSchema,this.tracingHelper=r.tracingHelper,r.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(r.overrideDatasources)[0],i=r.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(r){return{applyPendingMigrations:r.applyPendingMigrations?.bind(r),commitTransaction:this.withRequestId(r.commitTransaction.bind(r)),connect:this.withRequestId(r.connect.bind(r)),disconnect:this.withRequestId(r.disconnect.bind(r)),metrics:r.metrics?.bind(r),query:this.withRequestId(r.query.bind(r)),rollbackTransaction:this.withRequestId(r.rollbackTransaction.bind(r)),sdlSchema:r.sdlSchema?.bind(r),startTransaction:this.withRequestId(r.startTransaction.bind(r)),trace:r.trace.bind(r)}}withRequestId(r){return async(...t)=>{let n=Lm().toString();try{return await r(...t,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(r,t,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(t),s;if(r==="start"){let l=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(l,o)}else r==="commit"?s=await this.engine?.commitTransaction(n.id,o):r==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if(Fm(a)){let l=this.getExternalAdapterError(a,i?.errorRegistry);throw l?l.error:new Z(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new j(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(Ae("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;ei(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let r=await this.tracingHelper.runInChildSpan("detect_platform",()=>ir());if(!Il.includes(r))throw new R(`Unknown ${pe("PRISMA_QUERY_ENGINE_LIBRARY")} ${pe(W(r))}. Possible binaryTargets: ${Ve(Il.join(", "))} or a path to the query engine library.
112
- You may have to run ${Ve("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}}parseEngineResponse(r){if(!r)throw new j("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new j("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let r=new WeakRef(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(go));let t=await this.adapterPromise;t&&Ae("Using driver adapter: %O",t),this.engine=this.wrapEngine(new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},n=>{r.deref()?.logger(n)},t))}catch(r){let t=r,n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}}}logger(r){let t=this.parseEngineResponse(r);t&&(t.level=t?.level.toLowerCase()??"unknown",_m(t)?this.logEmitter.emit("query",{timestamp:new Date,query:t.query,params:t.params,duration:Number(t.duration_ms),target:t.module_path}):Dm(t)?this.loggerRustPanic=new ue(wo(this,`${t.message}: ${t.reason} in ${t.file}:${t.line}:${t.column}`),this.config.clientVersion):this.logEmitter.emit(t.level,{timestamp:new Date,message:t.message,target:t.module_path}))}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Ae(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{Ae("library starting");try{let t={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(t)),this.libraryStarted=!0,Ae("library started")}catch(t){let n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Ae("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(n=>setTimeout(n,5)),Ae("library stopping");let t={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(t)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0,Ae("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",r),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(r){return this.library?.debugPanic(r)}async request(r,{traceparent:t,interactiveTransaction:n}){Ae(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:t}),o=JSON.stringify(r);try{await this.start();let s=await this.adapterPromise;this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],s?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof R)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new ue(wo(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new j(`${a.message}
113
- ${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(r,{transaction:t,traceparent:n}){Ae("requestBatch");let i=Lr(r,t);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Rl(t));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],o?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:l,errors:u}=a;if(Array.isArray(l))return l.map(c=>c.errors&&c.errors.length>0?this.loggerRustPanic??this.buildQueryError(c.errors[0],o?.errorRegistry):{data:c});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(r,t){if(r.user_facing_error.is_panic)return new ue(wo(this,r.user_facing_error.message),this.config.clientVersion);let n=this.getExternalAdapterError(r.user_facing_error,t);return n?n.error:Fr(r,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(r,t){if(r.error_code===Om&&t){let n=r.meta?.id;zt(typeof n=="number","Malformed external JS error received from the engine");let i=t.consumeError(n);return zt(i,"External error with reported id was not registered"),i}}async metrics(r){await this.start();let t=await this.engine.metrics(JSON.stringify(r));return r.format==="prometheus"?t:this.parseEngineResponse(t)}};function Fm(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function wo(e,r){return yl({binaryTarget:e.binaryTarget,title:r,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function kl({copyEngine:e=!0},r){let t;try{t=$r({inlineDatasources:r.inlineDatasources,overrideDatasources:r.overrideDatasources,env:{...r.env,...process.env},clientVersion:r.clientVersion})}catch{}let n=!!(t?.startsWith("prisma://")||wi(t));e&&n&&tt("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=Er(r.generator),o=n||!e,s=!!r.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let c;throw e?t?.startsWith("prisma://")?c=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new X(c.join(`
114
- `),{clientVersion:r.clientVersion})}return o?new Nt(r):a?new Br(r):new Br(r)}function Bn({generator:e}){return e?.previewFeatures??[]}var Ol=e=>({command:e});var _l=e=>e.strings.reduce((r,t,n)=>`${r}@P${n}${t}`);function Ur(e){try{return Dl(e,"fast")}catch{return Dl(e,"slow")}}function Dl(e,r){return JSON.stringify(e.map(t=>Ll(t,r)))}function Ll(e,r){if(Array.isArray(e))return e.map(t=>Ll(t,r));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(Tr(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(ve.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Mm(e))return{prisma__type:"bytes",prisma__value:Buffer.from(e).toString("base64")};if(ArrayBuffer.isView(e)){let{buffer:t,byteOffset:n,byteLength:i}=e;return{prisma__type:"bytes",prisma__value:Buffer.from(t,n,i).toString("base64")}}return typeof e=="object"&&r==="slow"?Fl(e):e}function Mm(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Fl(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Nl);let r={};for(let t of Object.keys(e))r[t]=Nl(e[t]);return r}function Nl(e){return typeof e=="bigint"?e.toString():Fl(e)}var $m=/^(\s*alter\s)/i,Ml=L("prisma:client");function xo(e,r,t,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&t.length>0&&$m.exec(r))throw new Error(`Running ALTER using ${n} is not supported
110
+ `}function $t({inlineDatasources:e,overrideDatasources:t,env:r,clientVersion:n}){let i,o=Object.keys(e)[0],s=e[o]?.url,a=t[o]?.url;if(o===void 0?i=void 0:a?i=a:s?.value?i=s.value:s?.fromEnvVar&&(i=r[s.fromEnvVar]),s?.fromEnvVar!==void 0&&i===void 0)throw new R(`error: Environment variable not found: ${s.fromEnvVar}.`,n);if(i===void 0)throw new R("error: Missing URL environment variable, value, or override.",n);return i}var qn=class extends Error{clientVersion;cause;constructor(t,r){super(t),this.clientVersion=r.clientVersion,this.cause=r.cause}get[Symbol.toStringTag](){return this.name}};var ae=class extends qn{isRetryable;constructor(t,r){super(t,r),this.isRetryable=r.isRetryable??!0}};function C(e,t){return{...e,isRetryable:t}}var qt=class extends ae{name="ForcedRetryError";code="P5001";constructor(t){super("This request must be retried",C(t,!0))}};x(qt,"ForcedRetryError");var at=class extends ae{name="InvalidDatasourceError";code="P6001";constructor(t,r){super(t,C(r,!1))}};x(at,"InvalidDatasourceError");var lt=class extends ae{name="NotImplementedYetError";code="P5004";constructor(t,r){super(t,C(r,!1))}};x(lt,"NotImplementedYetError");var q=class extends ae{response;constructor(t,r){super(t,r),this.response=r.response;let n=this.response.headers.get("prisma-request-id");if(n){let i=`(The request id was: ${n})`;this.message=this.message+" "+i}}};var ut=class extends q{name="SchemaMissingError";code="P5005";constructor(t){super("Schema needs to be uploaded",C(t,!0))}};x(ut,"SchemaMissingError");var io="This request could not be understood by the server",Pr=class extends q{name="BadRequestError";code="P5000";constructor(t,r,n){super(r||io,C(t,!1)),n&&(this.code=n)}};x(Pr,"BadRequestError");var vr=class extends q{name="HealthcheckTimeoutError";code="P5013";logs;constructor(t,r){super("Engine not started: healthcheck timeout",C(t,!0)),this.logs=r}};x(vr,"HealthcheckTimeoutError");var Tr=class extends q{name="EngineStartupError";code="P5014";logs;constructor(t,r,n){super(r,C(t,!0)),this.logs=n}};x(Tr,"EngineStartupError");var Rr=class extends q{name="EngineVersionNotSupportedError";code="P5012";constructor(t){super("Engine version is not supported",C(t,!1))}};x(Rr,"EngineVersionNotSupportedError");var oo="Request timed out",Sr=class extends q{name="GatewayTimeoutError";code="P5009";constructor(t,r=oo){super(r,C(t,!1))}};x(Sr,"GatewayTimeoutError");var ym="Interactive transaction error",Cr=class extends q{name="InteractiveTransactionError";code="P5015";constructor(t,r=ym){super(r,C(t,!1))}};x(Cr,"InteractiveTransactionError");var Em="Request parameters are invalid",Ar=class extends q{name="InvalidRequestError";code="P5011";constructor(t,r=Em){super(r,C(t,!1))}};x(Ar,"InvalidRequestError");var so="Requested resource does not exist",Ir=class extends q{name="NotFoundError";code="P5003";constructor(t,r=so){super(r,C(t,!1))}};x(Ir,"NotFoundError");var ao="Unknown server error",Vt=class extends q{name="ServerError";code="P5006";logs;constructor(t,r,n){super(r||ao,C(t,!0)),this.logs=n}};x(Vt,"ServerError");var lo="Unauthorized, check your connection string",kr=class extends q{name="UnauthorizedError";code="P5007";constructor(t,r=lo){super(r,C(t,!1))}};x(kr,"UnauthorizedError");var uo="Usage exceeded, retry again later",Or=class extends q{name="UsageExceededError";code="P5008";constructor(t,r=uo){super(r,C(t,!0))}};x(Or,"UsageExceededError");async function bm(e){let t;try{t=await e.text()}catch{return{type:"EmptyError"}}try{let r=JSON.parse(t);if(typeof r=="string")switch(r){case"InternalDataProxyError":return{type:"DataProxyError",body:r};default:return{type:"UnknownTextError",body:r}}if(typeof r=="object"&&r!==null){if("is_panic"in r&&"message"in r&&"error_code"in r)return{type:"QueryEngineError",body:r};if("EngineNotStarted"in r||"InteractiveTransactionMisrouted"in r||"InvalidRequestError"in r){let n=Object.values(r)[0].reason;return typeof n=="string"&&!["SchemaMissing","EngineVersionNotSupported"].includes(n)?{type:"UnknownJsonError",body:r}:{type:"DataProxyError",body:r}}}return{type:"UnknownJsonError",body:r}}catch{return t===""?{type:"EmptyError"}:{type:"UnknownTextError",body:t}}}async function _r(e,t){if(e.ok)return;let r={clientVersion:t,response:e},n=await bm(e);if(n.type==="QueryEngineError")throw new Z(n.body.message,{code:n.body.error_code,clientVersion:t});if(n.type==="DataProxyError"){if(n.body==="InternalDataProxyError")throw new Vt(r,"Internal Data Proxy error");if("EngineNotStarted"in n.body){if(n.body.EngineNotStarted.reason==="SchemaMissing")return new ut(r);if(n.body.EngineNotStarted.reason==="EngineVersionNotSupported")throw new Rr(r);if("EngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,logs:o}=n.body.EngineNotStarted.reason.EngineStartupError;throw new Tr(r,i,o)}if("KnownEngineStartupError"in n.body.EngineNotStarted.reason){let{msg:i,error_code:o}=n.body.EngineNotStarted.reason.KnownEngineStartupError;throw new R(i,t,o)}if("HealthcheckTimeout"in n.body.EngineNotStarted.reason){let{logs:i}=n.body.EngineNotStarted.reason.HealthcheckTimeout;throw new vr(r,i)}}if("InteractiveTransactionMisrouted"in n.body){let i={IDParseError:"Could not parse interactive transaction ID",NoQueryEngineFoundError:"Could not find Query Engine for the specified host and transaction ID",TransactionStartError:"Could not start interactive transaction"};throw new Cr(r,i[n.body.InteractiveTransactionMisrouted.reason])}if("InvalidRequestError"in n.body)throw new Ar(r,n.body.InvalidRequestError.reason)}if(e.status===401||e.status===403)throw new kr(r,jt(lo,n));if(e.status===404)return new Ir(r,jt(so,n));if(e.status===429)throw new Or(r,jt(uo,n));if(e.status===504)throw new Sr(r,jt(oo,n));if(e.status>=500)throw new Vt(r,jt(ao,n));if(e.status>=400)throw new Pr(r,jt(io,n))}function jt(e,t){return t.type==="EmptyError"?e:`${e}: ${JSON.stringify(t)}`}function gl(e){let t=Math.pow(2,e)*50,r=Math.ceil(Math.random()*t)-Math.ceil(t/2),n=t+r;return new Promise(i=>setTimeout(()=>i(n),n))}var $e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function hl(e){let t=new TextEncoder().encode(e),r="",n=t.byteLength,i=n%3,o=n-i,s,a,l,u,c;for(let p=0;p<o;p=p+3)c=t[p]<<16|t[p+1]<<8|t[p+2],s=(c&16515072)>>18,a=(c&258048)>>12,l=(c&4032)>>6,u=c&63,r+=$e[s]+$e[a]+$e[l]+$e[u];return i==1?(c=t[o],s=(c&252)>>2,a=(c&3)<<4,r+=$e[s]+$e[a]+"=="):i==2&&(c=t[o]<<8|t[o+1],s=(c&64512)>>10,a=(c&1008)>>4,l=(c&15)<<2,r+=$e[s]+$e[a]+$e[l]+"="),r}function yl(e){if(!!e.generator?.previewFeatures.some(r=>r.toLowerCase().includes("metrics")))throw new R("The `metrics` preview feature is not yet available with Accelerate.\nPlease remove `metrics` from the `previewFeatures` in your schema.\n\nMore information about Accelerate: https://pris.ly/d/accelerate",e.clientVersion)}function wm(e){return e[0]*1e3+e[1]/1e6}function co(e){return new Date(wm(e))}var El={"@prisma/debug":"workspace:*","@prisma/engines-version":"6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04","@prisma/fetch-engine":"workspace:*","@prisma/get-platform":"workspace:*"};var Dr=class extends ae{name="RequestError";code="P5010";constructor(t,r){super(`Cannot fetch data from service:
111
+ ${t}`,C(r,!0))}};x(Dr,"RequestError");async function ct(e,t,r=n=>n){let{clientVersion:n,...i}=t,o=r(fetch);try{return await o(e,i)}catch(s){let a=s.message??"Unknown error";throw new Dr(a,{clientVersion:n,cause:s})}}var Pm=/^[1-9][0-9]*\.[0-9]+\.[0-9]+$/,bl=L("prisma:client:dataproxyEngine");async function vm(e,t){let r=El["@prisma/engines-version"],n=t.clientVersion??"unknown";if(process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION)return process.env.PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION;if(e.includes("accelerate")&&n!=="0.0.0"&&n!=="in-memory")return n;let[i,o]=n?.split("-")??[];if(o===void 0&&Pm.test(i))return i;if(o!==void 0||n==="0.0.0"||n==="in-memory"){if(e.startsWith("localhost")||e.startsWith("127.0.0.1"))return"0.0.0";let[s]=r.split("-")??[],[a,l,u]=s.split("."),c=Tm(`<=${a}.${l}.${u}`),p=await ct(c,{clientVersion:n});if(!p.ok)throw new Error(`Failed to fetch stable Prisma version, unpkg.com status ${p.status} ${p.statusText}, response body: ${await p.text()||"<empty body>"}`);let d=await p.text();bl("length of body fetched from unpkg.com",d.length);let f;try{f=JSON.parse(d)}catch(g){throw console.error("JSON.parse error: body fetched from unpkg.com: ",d),g}return f.version}throw new lt("Only `major.minor.patch` versions are supported by Accelerate.",{clientVersion:n})}async function wl(e,t){let r=await vm(e,t);return bl("version",r),r}function Tm(e){return encodeURI(`https://unpkg.com/prisma@${e}/package.json`)}var xl=3,Vn=L("prisma:client:dataproxyEngine"),po=class{apiKey;tracingHelper;logLevel;logQueries;engineHash;constructor({apiKey:t,tracingHelper:r,logLevel:n,logQueries:i,engineHash:o}){this.apiKey=t,this.tracingHelper=r,this.logLevel=n,this.logQueries=i,this.engineHash=o}build({traceparent:t,interactiveTransaction:r}={}){let n={Authorization:`Bearer ${this.apiKey}`,"Prisma-Engine-Hash":this.engineHash};this.tracingHelper.isEnabled()&&(n.traceparent=t??this.tracingHelper.getTraceParent()),r&&(n["X-transaction-id"]=r.id);let i=this.buildCaptureSettings();return i.length>0&&(n["X-capture-telemetry"]=i.join(", ")),n}buildCaptureSettings(){let t=[];return this.tracingHelper.isEnabled()&&t.push("tracing"),this.logLevel&&t.push(this.logLevel),this.logQueries&&t.push("query"),t}},Nr=class{name="DataProxyEngine";inlineSchema;inlineSchemaHash;inlineDatasources;config;logEmitter;env;clientVersion;engineHash;tracingHelper;remoteClientVersion;host;headerBuilder;startPromise;constructor(t){yl(t),this.config=t,this.env={...t.env,...typeof process<"u"?process.env:{}},this.inlineSchema=hl(t.inlineSchema),this.inlineDatasources=t.inlineDatasources,this.inlineSchemaHash=t.inlineSchemaHash,this.clientVersion=t.clientVersion,this.engineHash=t.engineVersion,this.logEmitter=t.logEmitter,this.tracingHelper=t.tracingHelper}apiKey(){return this.headerBuilder.apiKey}version(){return this.engineHash}async start(){this.startPromise!==void 0&&await this.startPromise,this.startPromise=(async()=>{let[t,r]=this.extractHostAndApiKey();this.host=t,this.headerBuilder=new po({apiKey:r,tracingHelper:this.tracingHelper,logLevel:this.config.logLevel,logQueries:this.config.logQueries,engineHash:this.engineHash}),this.remoteClientVersion=await wl(t,this.config),Vn("host",this.host)})(),await this.startPromise}async stop(){}propagateResponseExtensions(t){t?.logs?.length&&t.logs.forEach(r=>{switch(r.level){case"debug":case"trace":Vn(r);break;case"error":case"warn":case"info":{this.logEmitter.emit(r.level,{timestamp:co(r.timestamp),message:r.attributes.message??"",target:r.target});break}case"query":{this.logEmitter.emit("query",{query:r.attributes.query??"",timestamp:co(r.timestamp),duration:r.attributes.duration_ms??0,params:r.attributes.params??"",target:r.target});break}default:r.level}}),t?.traces?.length&&this.tracingHelper.dispatchEngineSpans(t.traces)}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the remote query engine')}async url(t){return await this.start(),`https://${this.host}/${this.remoteClientVersion}/${this.inlineSchemaHash}/${t}`}async uploadSchema(){let t={name:"schemaUpload",internal:!0};return this.tracingHelper.runInChildSpan(t,async()=>{let r=await ct(await this.url("schema"),{method:"PUT",headers:this.headerBuilder.build(),body:this.inlineSchema,clientVersion:this.clientVersion});r.ok||Vn("schema response status",r.status);let n=await _r(r,this.clientVersion);if(n)throw this.logEmitter.emit("warn",{message:`Error while uploading schema: ${n.message}`,timestamp:new Date,target:""}),n;this.logEmitter.emit("info",{message:`Schema (re)uploaded (hash: ${this.inlineSchemaHash})`,timestamp:new Date,target:""})})}request(t,{traceparent:r,interactiveTransaction:n,customDataProxyFetch:i}){return this.requestInternal({body:t,traceparent:r,interactiveTransaction:n,customDataProxyFetch:i})}async requestBatch(t,{traceparent:r,transaction:n,customDataProxyFetch:i}){let o=n?.kind==="itx"?n.options:void 0,s=Lt(t,n);return(await this.requestInternal({body:s,customDataProxyFetch:i,interactiveTransaction:o,traceparent:r})).map(l=>(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l?this.convertProtocolErrorsToClientError(l.errors):l))}requestInternal({body:t,traceparent:r,customDataProxyFetch:n,interactiveTransaction:i}){return this.withRetry({actionGerund:"querying",callback:async({logHttpCall:o})=>{let s=i?`${i.payload.endpoint}/graphql`:await this.url("graphql");o(s);let a=await ct(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r,interactiveTransaction:i}),body:JSON.stringify(t),clientVersion:this.clientVersion},n);a.ok||Vn("graphql response status",a.status),await this.handleError(await _r(a,this.clientVersion));let l=await a.json();if(l.extensions&&this.propagateResponseExtensions(l.extensions),"errors"in l)throw this.convertProtocolErrorsToClientError(l.errors);return"batchResult"in l?l.batchResult:l}})}async transaction(t,r,n){let i={start:"starting",commit:"committing",rollback:"rolling back"};return this.withRetry({actionGerund:`${i[t]} transaction`,callback:async({logHttpCall:o})=>{if(t==="start"){let s=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel}),a=await this.url("transaction/start");o(a);let l=await ct(a,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),body:s,clientVersion:this.clientVersion});await this.handleError(await _r(l,this.clientVersion));let u=await l.json(),{extensions:c}=u;c&&this.propagateResponseExtensions(c);let p=u.id,d=u["data-proxy"].endpoint;return{id:p,payload:{endpoint:d}}}else{let s=`${n.payload.endpoint}/${t}`;o(s);let a=await ct(s,{method:"POST",headers:this.headerBuilder.build({traceparent:r.traceparent}),clientVersion:this.clientVersion});await this.handleError(await _r(a,this.clientVersion));let l=await a.json(),{extensions:u}=l;u&&this.propagateResponseExtensions(u);return}}})}extractHostAndApiKey(){let t={clientVersion:this.clientVersion},r=Object.keys(this.inlineDatasources)[0],n=$t({inlineDatasources:this.inlineDatasources,overrideDatasources:this.config.overrideDatasources,clientVersion:this.clientVersion,env:this.env}),i;try{i=new URL(n)}catch{throw new at(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t)}let{protocol:o,host:s,searchParams:a}=i;if(o!=="prisma:"&&o!==Yr)throw new at(`Error validating datasource \`${r}\`: the URL must start with the protocol \`prisma://\``,t);let l=a.get("api_key");if(l===null||l.length<1)throw new at(`Error validating datasource \`${r}\`: the URL must contain a valid API key`,t);return[s,l]}metrics(){throw new lt("Metrics are not yet supported for Accelerate",{clientVersion:this.clientVersion})}async withRetry(t){for(let r=0;;r++){let n=i=>{this.logEmitter.emit("info",{message:`Calling ${i} (n=${r})`,timestamp:new Date,target:""})};try{return await t.callback({logHttpCall:n})}catch(i){if(!(i instanceof ae)||!i.isRetryable)throw i;if(r>=xl)throw i instanceof qt?i.cause:i;this.logEmitter.emit("warn",{message:`Attempt ${r+1}/${xl} failed for ${t.actionGerund}: ${i.message??"(unknown)"}`,timestamp:new Date,target:""});let o=await gl(r);this.logEmitter.emit("warn",{message:`Retrying after ${o}ms`,timestamp:new Date,target:""})}}}async handleError(t){if(t instanceof ut)throw await this.uploadSchema(),new qt({clientVersion:this.clientVersion,cause:t});if(t)throw t}convertProtocolErrorsToClientError(t){return t.length===1?Ft(t[0],this.config.clientVersion,this.config.activeProvider):new j(JSON.stringify(t),{clientVersion:this.config.clientVersion})}applyPendingMigrations(){throw new Error("Method not implemented.")}};function mo(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}function jn(e){return{ok:!0,value:e,map(t){return jn(t(e))},flatMap(t){return t(e)}}}function pt(e){return{ok:!1,error:e,map(){return pt(e)},flatMap(){return pt(e)}}}var fo=class{registeredErrors=[];consumeError(t){return this.registeredErrors[t]}registerNewError(t){let r=0;for(;this.registeredErrors[r]!==void 0;)r++;return this.registeredErrors[r]={error:t},r}},go=e=>{let t=new fo,r={adapterName:e.adapterName,errorRegistry:t,queryRaw:qe(t,e.queryRaw.bind(e)),executeRaw:qe(t,e.executeRaw.bind(e)),executeScript:qe(t,e.executeScript.bind(e)),dispose:qe(t,e.dispose.bind(e)),provider:e.provider,startTransaction:async(...n)=>(await qe(t,e.startTransaction.bind(e))(...n)).map(o=>Rm(t,o))};return e.getConnectionInfo&&(r.getConnectionInfo=Sm(t,e.getConnectionInfo.bind(e))),r},Rm=(e,t)=>({adapterName:t.adapterName,provider:t.provider,options:t.options,queryRaw:qe(e,t.queryRaw.bind(t)),executeRaw:qe(e,t.executeRaw.bind(t)),commit:qe(e,t.commit.bind(t)),rollback:qe(e,t.rollback.bind(t))});function qe(e,t){return async(...r)=>{try{return jn(await t(...r))}catch(n){if(mo(n))return pt(n.cause);let i=e.registerNewError(n);return pt({kind:"GenericJs",id:i})}}}function Sm(e,t){return(...r)=>{try{return jn(t(...r))}catch(n){if(mo(n))return pt(n.cause);let i=e.registerNewError(n);return pt({kind:"GenericJs",id:i})}}}function Pl(e){if(e?.kind==="itx")return e.options.id}var yo=O(require("os")),vl=O(require("path"));var ho=Symbol("PrismaLibraryEngineCache");function Cm(){let e=globalThis;return e[ho]===void 0&&(e[ho]={}),e[ho]}function Am(e){let t=Cm();if(t[e]!==void 0)return t[e];let r=vl.default.toNamespacedPath(e),n={exports:{}},i=0;return process.platform!=="win32"&&(i=yo.default.constants.dlopen.RTLD_LAZY|yo.default.constants.dlopen.RTLD_DEEPBIND),process.dlopen(n,r,i),t[e]=n.exports,n.exports}var Tl={async loadLibrary(e){let t=await ai(),r=await ll("library",e);try{return e.tracingHelper.runInChildSpan({name:"loadLibrary",internal:!0},()=>Am(r))}catch(n){let i=Ei({e:n,platformInfo:t,id:r});throw new R(i,e.clientVersion)}}};var Eo,Rl={async loadLibrary(e){let{clientVersion:t,adapter:r,engineWasm:n}=e;if(r===void 0)throw new R(`The \`adapter\` option for \`PrismaClient\` is required in this context (${Ln().prettyName})`,t);if(n===void 0)throw new R("WASM engine was unexpectedly `undefined`",t);Eo===void 0&&(Eo=(async()=>{let o=n.getRuntime(),s=await n.getQueryEngineWasmModule();if(s==null)throw new R("The loaded wasm module was unexpectedly `undefined` or `null` once loaded",t);let a={"./query_engine_bg.js":o},l=new WebAssembly.Instance(s,a),u=l.exports.__wbindgen_start;return o.__wbg_set_wasm(l.exports),u(),o.QueryEngine})());let i=await Eo;return{debugPanic(){return Promise.reject("{}")},dmmf(){return Promise.resolve("{}")},version(){return{commit:"unknown",version:"unknown"}},QueryEngine:i}}};var Im="P2036",Ae=L("prisma:client:libraryEngine");function km(e){return e.item_type==="query"&&"query"in e}function Om(e){return"level"in e?e.level==="error"&&e.message==="PANIC":!1}var Sl=[...ti,"native"],_m=0xffffffffffffffffn,bo=1n;function Dm(){let e=bo++;return bo>_m&&(bo=1n),e}var Bt=class{name="LibraryEngine";engine;libraryInstantiationPromise;libraryStartingPromise;libraryStoppingPromise;libraryStarted;executingQueryPromise;config;QueryEngineConstructor;libraryLoader;library;logEmitter;libQueryEnginePath;binaryTarget;datasourceOverrides;datamodel;logQueries;logLevel;lastQuery;loggerRustPanic;tracingHelper;adapterPromise;versionInfo;constructor(t,r){this.libraryLoader=r??Tl,t.engineWasm!==void 0&&(this.libraryLoader=r??Rl),this.config=t,this.libraryStarted=!1,this.logQueries=t.logQueries??!1,this.logLevel=t.logLevel??"error",this.logEmitter=t.logEmitter,this.datamodel=t.inlineSchema,this.tracingHelper=t.tracingHelper,t.enableDebugLogs&&(this.logLevel="debug");let n=Object.keys(t.overrideDatasources)[0],i=t.overrideDatasources[n]?.url;n!==void 0&&i!==void 0&&(this.datasourceOverrides={[n]:i}),this.libraryInstantiationPromise=this.instantiateLibrary()}wrapEngine(t){return{applyPendingMigrations:t.applyPendingMigrations?.bind(t),commitTransaction:this.withRequestId(t.commitTransaction.bind(t)),connect:this.withRequestId(t.connect.bind(t)),disconnect:this.withRequestId(t.disconnect.bind(t)),metrics:t.metrics?.bind(t),query:this.withRequestId(t.query.bind(t)),rollbackTransaction:this.withRequestId(t.rollbackTransaction.bind(t)),sdlSchema:t.sdlSchema?.bind(t),startTransaction:this.withRequestId(t.startTransaction.bind(t)),trace:t.trace.bind(t)}}withRequestId(t){return async(...r)=>{let n=Dm().toString();try{return await t(...r,n)}finally{if(this.tracingHelper.isEnabled()){let i=await this.engine?.trace(n);if(i){let o=JSON.parse(i);this.tracingHelper.dispatchEngineSpans(o.spans)}}}}}async applyPendingMigrations(){throw new Error("Cannot call this method from this type of engine instance")}async transaction(t,r,n){await this.start();let i=await this.adapterPromise,o=JSON.stringify(r),s;if(t==="start"){let l=JSON.stringify({max_wait:n.maxWait,timeout:n.timeout,isolation_level:n.isolationLevel});s=await this.engine?.startTransaction(l,o)}else t==="commit"?s=await this.engine?.commitTransaction(n.id,o):t==="rollback"&&(s=await this.engine?.rollbackTransaction(n.id,o));let a=this.parseEngineResponse(s);if(Nm(a)){let l=this.getExternalAdapterError(a,i?.errorRegistry);throw l?l.error:new Z(a.message,{code:a.error_code,clientVersion:this.config.clientVersion,meta:a.meta})}else if(typeof a.message=="string")throw new j(a.message,{clientVersion:this.config.clientVersion});return a}async instantiateLibrary(){if(Ae("internalSetup"),this.libraryInstantiationPromise)return this.libraryInstantiationPromise;ei(),this.binaryTarget=await this.getCurrentBinaryTarget(),await this.tracingHelper.runInChildSpan("load_engine",()=>this.loadEngine()),this.version()}async getCurrentBinaryTarget(){{if(this.binaryTarget)return this.binaryTarget;let t=await this.tracingHelper.runInChildSpan("detect_platform",()=>nt());if(!Sl.includes(t))throw new R(`Unknown ${pe("PRISMA_QUERY_ENGINE_LIBRARY")} ${pe(W(t))}. Possible binaryTargets: ${Ve(Sl.join(", "))} or a path to the query engine library.
112
+ You may have to run ${Ve("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return t}}parseEngineResponse(t){if(!t)throw new j("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(t)}catch{throw new j("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let t=new WeakRef(this);this.adapterPromise||(this.adapterPromise=this.config.adapter?.connect()?.then(go));let r=await this.adapterPromise;r&&Ae("Using driver adapter: %O",r),this.engine=this.wrapEngine(new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json",enableTracing:this.tracingHelper.isEnabled()},n=>{t.deref()?.logger(n)},r))}catch(t){let r=t,n=this.parseInitError(r.message);throw typeof n=="string"?r:new R(n.message,this.config.clientVersion,n.error_code)}}}logger(t){let r=this.parseEngineResponse(t);r&&(r.level=r?.level.toLowerCase()??"unknown",km(r)?this.logEmitter.emit("query",{timestamp:new Date,query:r.query,params:r.params,duration:Number(r.duration_ms),target:r.module_path}):Om(r)?this.loggerRustPanic=new ue(wo(this,`${r.message}: ${r.reason} in ${r.file}:${r.line}:${r.column}`),this.config.clientVersion):this.logEmitter.emit(r.level,{timestamp:new Date,message:r.message,target:r.module_path}))}parseInitError(t){try{return JSON.parse(t)}catch{}return t}parseRequestError(t){try{return JSON.parse(t)}catch{}return t}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Ae(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let t=async()=>{Ae("library starting");try{let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(r)),this.libraryStarted=!0,Ae("library started")}catch(r){let n=this.parseInitError(r.message);throw typeof n=="string"?r:new R(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.tracingHelper.runInChildSpan("connect",t),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Ae("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let t=async()=>{await new Promise(n=>setTimeout(n,5)),Ae("library stopping");let r={traceparent:this.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(r)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,await(await this.adapterPromise)?.dispose(),this.adapterPromise=void 0,Ae("library stopped")};return this.libraryStoppingPromise=this.tracingHelper.runInChildSpan("disconnect",t),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(t){return this.library?.debugPanic(t)}async request(t,{traceparent:r,interactiveTransaction:n}){Ae(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:r}),o=JSON.stringify(t);try{await this.start();let s=await this.adapterPromise;this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let a=this.parseEngineResponse(await this.executingQueryPromise);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],s?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:a}}catch(s){if(s instanceof R)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new ue(wo(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new j(`${a.message}
113
+ ${a.backtrace}`,{clientVersion:this.config.clientVersion})}}async requestBatch(t,{transaction:r,traceparent:n}){Ae("requestBatch");let i=Lt(t,r);await this.start();let o=await this.adapterPromise;this.lastQuery=JSON.stringify(i),this.executingQueryPromise=this.engine.query(this.lastQuery,JSON.stringify({traceparent:n}),Pl(r));let s=await this.executingQueryPromise,a=this.parseEngineResponse(s);if(a.errors)throw a.errors.length===1?this.buildQueryError(a.errors[0],o?.errorRegistry):new j(JSON.stringify(a.errors),{clientVersion:this.config.clientVersion});let{batchResult:l,errors:u}=a;if(Array.isArray(l))return l.map(c=>c.errors&&c.errors.length>0?this.loggerRustPanic??this.buildQueryError(c.errors[0],o?.errorRegistry):{data:c});throw u&&u.length===1?new Error(u[0].error):new Error(JSON.stringify(a))}buildQueryError(t,r){if(t.user_facing_error.is_panic)return new ue(wo(this,t.user_facing_error.message),this.config.clientVersion);let n=this.getExternalAdapterError(t.user_facing_error,r);return n?n.error:Ft(t,this.config.clientVersion,this.config.activeProvider)}getExternalAdapterError(t,r){if(t.error_code===Im&&r){let n=t.meta?.id;zr(typeof n=="number","Malformed external JS error received from the engine");let i=r.consumeError(n);return zr(i,"External error with reported id was not registered"),i}}async metrics(t){await this.start();let r=await this.engine.metrics(JSON.stringify(t));return t.format==="prometheus"?r:this.parseEngineResponse(r)}};function Nm(e){return typeof e=="object"&&e!==null&&e.error_code!==void 0}function wo(e,t){return fl({binaryTarget:e.binaryTarget,title:t,version:e.config.clientVersion,engineVersion:e.versionInfo?.commit,database:e.config.activeProvider,query:e.lastQuery})}function Cl({copyEngine:e=!0},t){let r;try{r=$t({inlineDatasources:t.inlineDatasources,overrideDatasources:t.overrideDatasources,env:{...t.env,...process.env},clientVersion:t.clientVersion})}catch{}let n=!!(r?.startsWith("prisma://")||wi(r));e&&n&&rr("recommend--no-engine","In production, we recommend using `prisma generate --no-engine` (See: `prisma generate --help`)");let i=yt(t.generator),o=n||!e,s=!!t.adapter,a=i==="library",l=i==="binary",u=i==="client";if(o&&s||s&&!1){let c;throw e?r?.startsWith("prisma://")?c=["Prisma Client was configured to use the `adapter` option but the URL was a `prisma://` URL.","Please either use the `prisma://` URL or remove the `adapter` from the Prisma Client constructor."]:c=["Prisma Client was configured to use both the `adapter` and Accelerate, please chose one."]:c=["Prisma Client was configured to use the `adapter` option but `prisma generate` was run with `--no-engine`.","Please run `prisma generate` without `--no-engine` to be able to use Prisma Client with the adapter."],new X(c.join(`
114
+ `),{clientVersion:t.clientVersion})}return o?new Nr(t):a?new Bt(t):new Bt(t)}function Bn({generator:e}){return e?.previewFeatures??[]}var Al=e=>({command:e});var Il=e=>e.strings.reduce((t,r,n)=>`${t}@P${n}${r}`);function Ut(e){try{return kl(e,"fast")}catch{return kl(e,"slow")}}function kl(e,t){return JSON.stringify(e.map(r=>_l(r,t)))}function _l(e,t){if(Array.isArray(e))return e.map(r=>_l(r,t));if(typeof e=="bigint")return{prisma__type:"bigint",prisma__value:e.toString()};if(Tt(e))return{prisma__type:"date",prisma__value:e.toJSON()};if(ve.isDecimal(e))return{prisma__type:"decimal",prisma__value:e.toJSON()};if(Buffer.isBuffer(e))return{prisma__type:"bytes",prisma__value:e.toString("base64")};if(Lm(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"?Dl(e):e}function Lm(e){return e instanceof ArrayBuffer||e instanceof SharedArrayBuffer?!0:typeof e=="object"&&e!==null?e[Symbol.toStringTag]==="ArrayBuffer"||e[Symbol.toStringTag]==="SharedArrayBuffer":!1}function Dl(e){if(typeof e!="object"||e===null)return e;if(typeof e.toJSON=="function")return e.toJSON();if(Array.isArray(e))return e.map(Ol);let t={};for(let r of Object.keys(e))t[r]=Ol(e[r]);return t}function Ol(e){return typeof e=="bigint"?e.toString():Dl(e)}var Fm=/^(\s*alter\s)/i,Nl=L("prisma:client");function xo(e,t,r,n){if(!(e!=="postgresql"&&e!=="cockroachdb")&&r.length>0&&Fm.exec(t))throw new Error(`Running ALTER using ${n} is not supported
115
115
  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.
116
116
 
117
117
  Example:
118
118
  await prisma.$executeRawUnsafe(\`ALTER USER prisma WITH PASSWORD '\${password}'\`)
119
119
 
120
120
  More Information: https://pris.ly/d/execute-raw
121
- `)}var Po=({clientMethod:e,activeProvider:r})=>t=>{let n="",i;if(kn(t))n=t.sql,i={values:Ur(t.values),__prismaRawParameters__:!0};else if(Array.isArray(t)){let[o,...s]=t;n=o,i={values:Ur(s||[]),__prismaRawParameters__:!0}}else switch(r){case"sqlite":case"mysql":{n=t.sql,i={values:Ur(t.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=t.text,i={values:Ur(t.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=_l(t),i={values:Ur(t.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${r} provider does not support ${e}`)}return i?.values?Ml(`prisma.${e}(${n}, ${i.values})`):Ml(`prisma.${e}(${n})`),{query:n,parameters:i}},$l={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[r,...t]=e;return new se(r,t)}},ql={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function vo(e){return function(t,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Vl(t(s)):Vl(t(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 qm=mi.split(".")[0],Vm={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,r){return r()}},To=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(r){return this.getGlobalTracingHelper().getTraceParent(r)}dispatchEngineSpans(r){return this.getGlobalTracingHelper().dispatchEngineSpans(r)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(r,t){return this.getGlobalTracingHelper().runInChildSpan(r,t)}getGlobalTracingHelper(){let r=globalThis[`V${qm}_PRISMA_INSTRUMENTATION`],t=globalThis.PRISMA_INSTRUMENTATION;return r?.helper??t?.helper??Vm}};function jl(){return new To}function Bl(e,r=()=>{}){let t,n=new Promise(i=>t=i);return{then(i){return--e===0&&t(r()),i?.(n)}}}function Ul(e){return typeof e=="string"?e:e.reduce((r,t)=>{let n=typeof t=="string"?t:t.level;return n==="query"?r:r&&(t==="info"||r==="info")?"info":n},void 0)}var Un=class{_middlewares=[];use(r){this._middlewares.push(r)}get(r){return this._middlewares[r]}has(r){return!!this._middlewares[r]}length(){return this._middlewares.length}};var Gl=O(Ri());function Qn(e){return typeof e.batchRequestIdx=="number"}function Ql(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let r=[];return e.modelName&&r.push(e.modelName),e.query.arguments&&r.push(Ro(e.query.arguments)),r.push(Ro(e.query.selection)),r.join("")}function Ro(e){return`(${Object.keys(e).sort().map(t=>{let n=e[t];return typeof n=="object"&&n!==null?`(${t} ${Ro(n)})`:t}).join(" ")})`}var jm={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 So(e){return jm[e]}var Gn=class{constructor(r){this.options=r;this.batches={}}batches;tickActive=!1;request(r){let t=this.options.batchBy(r);return t?(this.batches[t]||(this.batches[t]=[],this.tickActive||(this.tickActive=!0,process.nextTick(()=>{this.dispatchBatches(),this.tickActive=!1}))),new Promise((n,i)=>{this.batches[t].push({request:r,resolve:n,reject:i})})):this.options.singleLoader(r)}dispatchBatches(){for(let r in this.batches){let t=this.batches[r];delete this.batches[r],t.length===1?this.options.singleLoader(t[0].request).then(n=>{n instanceof Error?t[0].reject(n):t[0].resolve(n)}).catch(n=>{t[0].reject(n)}):(t.sort((n,i)=>this.options.batchOrder(n.request,i.request)),this.options.batchLoader(t.map(n=>n.request)).then(n=>{if(n instanceof Error)for(let i=0;i<t.length;i++)t[i].reject(n);else for(let i=0;i<t.length;i++){let o=n[i];o instanceof Error?t[i].reject(o):t[i].resolve(o)}}).catch(n=>{for(let i=0;i<t.length;i++)t[i].reject(n)}))}}get[Symbol.toStringTag](){return"DataLoader"}};function mr(e,r){if(r===null)return r;switch(e){case"bigint":return BigInt(r);case"bytes":{let{buffer:t,byteOffset:n,byteLength:i}=Buffer.from(r,"base64");return new Uint8Array(t,n,i)}case"decimal":return new ve(r);case"datetime":case"date":return new Date(r);case"time":return new Date(`1970-01-01T${r}Z`);case"bigint-array":return r.map(t=>mr("bigint",t));case"bytes-array":return r.map(t=>mr("bytes",t));case"decimal-array":return r.map(t=>mr("decimal",t));case"datetime-array":return r.map(t=>mr("datetime",t));case"date-array":return r.map(t=>mr("date",t));case"time-array":return r.map(t=>mr("time",t));default:return r}}function Jn(e){let r=[],t=Bm(e);for(let n=0;n<e.rows.length;n++){let i=e.rows[n],o={...t};for(let s=0;s<i.length;s++)o[e.columns[s]]=mr(e.types[s],i[s]);r.push(o)}return r}function Bm(e){let r={};for(let t=0;t<e.columns.length;t++)r[e.columns[t]]=null;return r}var Um=L("prisma:client:request_handler"),Wn=class{client;dataloader;logEmitter;constructor(r,t){this.logEmitter=t,this.client=r,this.dataloader=new Gn({batchLoader:Xa(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=>So(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Qm(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Jl(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:So(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:Ql(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.kind==="batch"?n.transaction.index-i.transaction.index:0}})}async request(r){try{return await this.dataloader.request(r)}catch(t){let{clientMethod:n,callsite:i,transaction:o,args:s,modelName:a}=r;this.handleAndLogRequestError({error:t,clientMethod:n,callsite:i,transaction:o,args:s,modelName:a,globalOmit:r.globalOmit})}}mapQueryEngineResult({dataPath:r,unpacker:t},n){let i=n?.data,o=this.unpack(i,r,t);return process.env.PRISMA_CLIENT_GET_TIME?{data:o}:o}handleAndLogRequestError(r){try{this.handleRequestError(r)}catch(t){throw this.logEmitter&&this.logEmitter.emit("error",{message:t.message,target:r.clientMethod,timestamp:new Date}),t}}handleRequestError({error:r,clientMethod:t,callsite:n,transaction:i,args:o,modelName:s,globalOmit:a}){if(Um(r),Gm(r,i))throw r;if(r instanceof Z&&Jm(r)){let u=Wl(r.meta);Tn({args:o,errors:[u],callsite:n,errorFormat:this.client._errorFormat,originalMethod:t,clientVersion:this.client._clientVersion,globalOmit:a})}let l=r.message;if(n&&(l=fn({callsite:n,originalMethod:t,isPanic:r.isPanic,showColors:this.client._errorFormat==="pretty",message:l})),l=this.sanitizeMessage(l),r.code){let u=s?{modelName:s,...r.meta}:r.meta;throw new Z(l,{code:r.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:r.batchRequestIdx})}else{if(r.isPanic)throw new ue(l,this.client._clientVersion);if(r instanceof j)throw new j(l,{clientVersion:this.client._clientVersion,batchRequestIdx:r.batchRequestIdx});if(r instanceof R)throw new R(l,this.client._clientVersion);if(r instanceof ue)throw new ue(l,this.client._clientVersion)}throw r.clientVersion=this.client._clientVersion,r}sanitizeMessage(r){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Gl.default)(r):r}unpack(r,t,n){if(!r||(r.data&&(r=r.data),!r))return r;let i=Object.keys(r)[0],o=Object.values(r)[0],s=t.filter(u=>u!=="select"&&u!=="include"),a=Xi(o,s),l=i==="queryRaw"?Jn(a):vr(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Qm(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Jl(e)};Ne(e,"Unknown transaction kind")}}function Jl(e){return{id:e.id,payload:e.payload}}function Gm(e,r){return Qn(e)&&r?.kind==="batch"&&e.batchRequestIdx!==r.index}function Jm(e){return e.code==="P2009"||e.code==="P2012"}function Wl(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Wl)};if(Array.isArray(e.selectionPath)){let[,...r]=e.selectionPath;return{...e,selectionPath:r}}return e}var Hl="6.6.0-integration-push-xmzqvqxpztks.5";var Kl=Hl;var eu=O(Vi());var D=class extends Error{constructor(r){super(r+`
122
- Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};x(D,"PrismaClientConstructorValidationError");var Yl=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],zl=["pretty","colorless","minimal"],Zl=["info","query","warn","error"],Hm={datasources:(e,{datasourceNames:r})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[t,n]of Object.entries(e)){if(!r.includes(t)){let i=Qr(t,r)||` Available datasources: ${r.join(", ")}`;throw new D(`Unknown datasource ${t} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor.
123
- It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${t}" provided to PrismaClient constructor.
124
- It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new D(`Invalid value ${JSON.stringify(o)} for datasource "${t}" provided to PrismaClient constructor.
125
- It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,r)=>{if(!e&&Er(r.generator)==="client")throw new D('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new D('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Bn(r).includes("driverAdapters"))throw new D('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(Er(r.generator)==="binary")throw new D('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
126
- Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!zl.includes(e)){let r=Qr(e,zl);throw new D(`Invalid errorFormat ${e} provided to PrismaClient constructor.${r}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function r(t){if(typeof t=="string"&&!Zl.includes(t)){let n=Qr(t,Zl);throw new D(`Invalid log level "${t}" provided to PrismaClient constructor.${n}`)}}for(let t of e){r(t);let n={level:r,emit:i=>{let o=["stdout","event"];if(!o.includes(i)){let s=Qr(i,o);throw new D(`Invalid value ${JSON.stringify(i)} for "emit" in logLevel provided to PrismaClient constructor.${s}`)}}};if(t&&typeof t=="object")for(let[i,o]of Object.entries(t))if(n[i])n[i](o);else throw new D(`Invalid property ${i} for "log" provided to PrismaClient constructor`)}},transactionOptions:e=>{if(!e)return;let r=e.maxWait;if(r!=null&&r<=0)throw new D(`Invalid value ${r} for maxWait in "transactionOptions" provided to PrismaClient constructor. maxWait needs to be greater than 0`);let t=e.timeout;if(t!=null&&t<=0)throw new D(`Invalid value ${t} for timeout in "transactionOptions" provided to PrismaClient constructor. timeout needs to be greater than 0`)},omit:(e,r)=>{if(typeof e!="object")throw new D('"omit" option is expected to be an object.');if(e===null)throw new D('"omit" option can not be `null`');let t=[];for(let[n,i]of Object.entries(e)){let o=Ym(n,r.runtimeDataModel);if(!o){t.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){t.push({kind:"UnknownField",modelKey:n,fieldName:s});continue}if(l.relationName){t.push({kind:"RelationInOmit",modelKey:n,fieldName:s});continue}typeof a!="boolean"&&t.push({kind:"InvalidFieldValue",modelKey:n,fieldName:s})}}if(t.length>0)throw new D(zm(e,t))},__internal:e=>{if(!e)return;let r=["debug","engine","configOverride"];if(typeof e!="object")throw new D(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[t]of Object.entries(e))if(!r.includes(t)){let n=Qr(t,r);throw new D(`Invalid property ${JSON.stringify(t)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function ru(e,r){for(let[t,n]of Object.entries(e)){if(!Yl.includes(t)){let i=Qr(t,Yl);throw new D(`Unknown property ${t} provided to PrismaClient constructor.${i}`)}Hm[t](n,r)}if(e.datasourceUrl&&e.datasources)throw new D('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Qr(e,r){if(r.length===0||typeof e!="string")return"";let t=Km(e,r);return t?` Did you mean "${t}"?`:""}function Km(e,r){if(r.length===0)return null;let t=r.map(i=>({value:i,distance:(0,eu.default)(e,i)}));t.sort((i,o)=>i.distance<o.distance?-1:1);let n=t[0];return n.distance<3?n.value:null}function Ym(e,r){return Xl(r.models,e)??Xl(r.types,e)}function Xl(e,r){let t=Object.keys(e).find(n=>ze(n)===r);if(t)return e[t]}function zm(e,r){let t=Or(e);for(let o of r)switch(o.kind){case"UnknownModel":t.arguments.getField(o.modelKey)?.markAsError(),t.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":t.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),t.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":t.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),t.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":t.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),t.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=vn(t,"colorless");return`Error validating "omit" option:
121
+ `)}var Po=({clientMethod:e,activeProvider:t})=>r=>{let n="",i;if(kn(r))n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};else if(Array.isArray(r)){let[o,...s]=r;n=o,i={values:Ut(s||[]),__prismaRawParameters__:!0}}else switch(t){case"sqlite":case"mysql":{n=r.sql,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"cockroachdb":case"postgresql":case"postgres":{n=r.text,i={values:Ut(r.values),__prismaRawParameters__:!0};break}case"sqlserver":{n=Il(r),i={values:Ut(r.values),__prismaRawParameters__:!0};break}default:throw new Error(`The ${t} provider does not support ${e}`)}return i?.values?Nl(`prisma.${e}(${n}, ${i.values})`):Nl(`prisma.${e}(${n})`),{query:n,parameters:i}},Ll={requestArgsToMiddlewareArgs(e){return[e.strings,...e.values]},middlewareArgsToRequestArgs(e){let[t,...r]=e;return new se(t,r)}},Fl={requestArgsToMiddlewareArgs(e){return[e]},middlewareArgsToRequestArgs(e){return e[0]}};function vo(e){return function(r,n){let i,o=(s=e)=>{try{return s===void 0||s?.kind==="itx"?i??=Ml(r(s)):Ml(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 Ml(e){return typeof e.then=="function"?e:Promise.resolve(e)}var Mm=mi.split(".")[0],$m={isEnabled(){return!1},getTraceParent(){return"00-10-10-00"},dispatchEngineSpans(){},getActiveContext(){},runInChildSpan(e,t){return t()}},To=class{isEnabled(){return this.getGlobalTracingHelper().isEnabled()}getTraceParent(t){return this.getGlobalTracingHelper().getTraceParent(t)}dispatchEngineSpans(t){return this.getGlobalTracingHelper().dispatchEngineSpans(t)}getActiveContext(){return this.getGlobalTracingHelper().getActiveContext()}runInChildSpan(t,r){return this.getGlobalTracingHelper().runInChildSpan(t,r)}getGlobalTracingHelper(){let t=globalThis[`V${Mm}_PRISMA_INSTRUMENTATION`],r=globalThis.PRISMA_INSTRUMENTATION;return t?.helper??r?.helper??$m}};function $l(){return new To}function ql(e,t=()=>{}){let r,n=new Promise(i=>r=i);return{then(i){return--e===0&&r(t()),i?.(n)}}}function Vl(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 Un=class{_middlewares=[];use(t){this._middlewares.push(t)}get(t){return this._middlewares[t]}has(t){return!!this._middlewares[t]}length(){return this._middlewares.length}};var Bl=O(Si());function Qn(e){return typeof e.batchRequestIdx=="number"}function jl(e){if(e.action!=="findUnique"&&e.action!=="findUniqueOrThrow")return;let t=[];return e.modelName&&t.push(e.modelName),e.query.arguments&&t.push(Ro(e.query.arguments)),t.push(Ro(e.query.selection)),t.join("")}function Ro(e){return`(${Object.keys(e).sort().map(r=>{let n=e[r];return typeof n=="object"&&n!==null?`(${r} ${Ro(n)})`:r}).join(" ")})`}var qm={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 So(e){return qm[e]}var Gn=class{constructor(t){this.options=t;this.batches={}}batches;tickActive=!1;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"}};function dt(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 ve(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=>dt("bigint",r));case"bytes-array":return t.map(r=>dt("bytes",r));case"decimal-array":return t.map(r=>dt("decimal",r));case"datetime-array":return t.map(r=>dt("datetime",r));case"date-array":return t.map(r=>dt("date",r));case"time-array":return t.map(r=>dt("time",r));default:return t}}function Jn(e){let t=[],r=Vm(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]]=dt(e.types[s],i[s]);t.push(o)}return t}function Vm(e){let t={};for(let r=0;r<e.columns.length;r++)t[e.columns[r]]=null;return t}var jm=L("prisma:client:request_handler"),Wn=class{client;dataloader;logEmitter;constructor(t,r){this.logEmitter=r,this.client=t,this.dataloader=new Gn({batchLoader:Ya(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=>So(p.protocolQuery.action));return(await this.client._engine.requestBatch(a,{traceparent:l,transaction:Bm(o),containsWrite:u,customDataProxyFetch:i})).map((p,d)=>{if(p instanceof Error)return p;try{return this.mapQueryEngineResult(n[d],p)}catch(f){return f}})}),singleLoader:async n=>{let i=n.transaction?.kind==="itx"?Ul(n.transaction):void 0,o=await this.client._engine.request(n.protocolQuery,{traceparent:this.client._tracingHelper.getTraceParent(),interactiveTransaction:i,isWrite:So(n.protocolQuery.action),customDataProxyFetch:n.customDataProxyFetch});return this.mapQueryEngineResult(n,o)},batchBy:n=>n.transaction?.id?`transaction-${n.transaction.id}`:jl(n.protocolQuery),batchOrder(n,i){return n.transaction?.kind==="batch"&&i.transaction?.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?.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(jm(t),Um(t,i))throw t;if(t instanceof Z&&Qm(t)){let u=Ql(t.meta);Tn({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=fn({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 Z(l,{code:t.code,clientVersion:this.client._clientVersion,meta:u,batchRequestIdx:t.batchRequestIdx})}else{if(t.isPanic)throw new ue(l,this.client._clientVersion);if(t instanceof j)throw new j(l,{clientVersion:this.client._clientVersion,batchRequestIdx:t.batchRequestIdx});if(t instanceof R)throw new R(l,this.client._clientVersion);if(t instanceof ue)throw new ue(l,this.client._clientVersion)}throw t.clientVersion=this.client._clientVersion,t}sanitizeMessage(t){return this.client._errorFormat&&this.client._errorFormat!=="pretty"?(0,Bl.default)(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=Xi(o,s),l=i==="queryRaw"?Jn(a):Pt(a);return n?n(l):l}get[Symbol.toStringTag](){return"RequestHandler"}};function Bm(e){if(e){if(e.kind==="batch")return{kind:"batch",options:{isolationLevel:e.isolationLevel}};if(e.kind==="itx")return{kind:"itx",options:Ul(e)};Ne(e,"Unknown transaction kind")}}function Ul(e){return{id:e.id,payload:e.payload}}function Um(e,t){return Qn(e)&&t?.kind==="batch"&&e.batchRequestIdx!==t.index}function Qm(e){return e.code==="P2009"||e.code==="P2012"}function Ql(e){if(e.kind==="Union")return{kind:"Union",errors:e.errors.map(Ql)};if(Array.isArray(e.selectionPath)){let[,...t]=e.selectionPath;return{...e,selectionPath:t}}return e}var Gl="6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.2";var Jl=Gl;var zl=O(Vi());var D=class extends Error{constructor(t){super(t+`
122
+ Read more at https://pris.ly/d/client-constructor`),this.name="PrismaClientConstructorValidationError"}get[Symbol.toStringTag](){return"PrismaClientConstructorValidationError"}};x(D,"PrismaClientConstructorValidationError");var Wl=["datasources","datasourceUrl","errorFormat","adapter","log","transactionOptions","omit","__internal"],Hl=["pretty","colorless","minimal"],Kl=["info","query","warn","error"],Jm={datasources:(e,{datasourceNames:t})=>{if(e){if(typeof e!="object"||Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "datasources" provided to PrismaClient constructor`);for(let[r,n]of Object.entries(e)){if(!t.includes(r)){let i=Qt(r,t)||` Available datasources: ${t.join(", ")}`;throw new D(`Unknown datasource ${r} provided to PrismaClient constructor.${i}`)}if(typeof n!="object"||Array.isArray(n))throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
123
+ It should have this form: { url: "CONNECTION_STRING" }`);if(n&&typeof n=="object")for(let[i,o]of Object.entries(n)){if(i!=="url")throw new D(`Invalid value ${JSON.stringify(e)} for datasource "${r}" provided to PrismaClient constructor.
124
+ It should have this form: { url: "CONNECTION_STRING" }`);if(typeof o!="string")throw new D(`Invalid value ${JSON.stringify(o)} for datasource "${r}" provided to PrismaClient constructor.
125
+ It should have this form: { url: "CONNECTION_STRING" }`)}}}},adapter:(e,t)=>{if(!e&&yt(t.generator)==="client")throw new D('Using engine type "client" requires a driver adapter to be provided to PrismaClient constructor.');if(e===null)return;if(e===void 0)throw new D('"adapter" property must not be undefined, use null to conditionally disable driver adapters.');if(!Bn(t).includes("driverAdapters"))throw new D('"adapter" property can only be provided to PrismaClient constructor when "driverAdapters" preview feature is enabled.');if(yt(t.generator)==="binary")throw new D('Cannot use a driver adapter with the "binary" Query Engine. Please use the "library" Query Engine.')},datasourceUrl:e=>{if(typeof e<"u"&&typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "datasourceUrl" provided to PrismaClient constructor.
126
+ Expected string or undefined.`)},errorFormat:e=>{if(e){if(typeof e!="string")throw new D(`Invalid value ${JSON.stringify(e)} for "errorFormat" provided to PrismaClient constructor.`);if(!Hl.includes(e)){let t=Qt(e,Hl);throw new D(`Invalid errorFormat ${e} provided to PrismaClient constructor.${t}`)}}},log:e=>{if(!e)return;if(!Array.isArray(e))throw new D(`Invalid value ${JSON.stringify(e)} for "log" provided to PrismaClient constructor.`);function t(r){if(typeof r=="string"&&!Kl.includes(r)){let n=Qt(r,Kl);throw new D(`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=Qt(i,o);throw new D(`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 D(`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 D(`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 D(`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 D('"omit" option is expected to be an object.');if(e===null)throw new D('"omit" option can not be `null`');let r=[];for(let[n,i]of Object.entries(e)){let o=Hm(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 D(Km(e,r))},__internal:e=>{if(!e)return;let t=["debug","engine","configOverride"];if(typeof e!="object")throw new D(`Invalid value ${JSON.stringify(e)} for "__internal" to PrismaClient constructor`);for(let[r]of Object.entries(e))if(!t.includes(r)){let n=Qt(r,t);throw new D(`Invalid property ${JSON.stringify(r)} for "__internal" provided to PrismaClient constructor.${n}`)}}};function Zl(e,t){for(let[r,n]of Object.entries(e)){if(!Wl.includes(r)){let i=Qt(r,Wl);throw new D(`Unknown property ${r} provided to PrismaClient constructor.${i}`)}Jm[r](n,t)}if(e.datasourceUrl&&e.datasources)throw new D('Can not use "datasourceUrl" and "datasources" options at the same time. Pick one of them')}function Qt(e,t){if(t.length===0||typeof e!="string")return"";let r=Wm(e,t);return r?` Did you mean "${r}"?`:""}function Wm(e,t){if(t.length===0)return null;let r=t.map(i=>({value:i,distance:(0,zl.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 Hm(e,t){return Yl(t.models,e)??Yl(t.types,e)}function Yl(e,t){let r=Object.keys(e).find(n=>vt(n)===t);if(r)return e[r]}function Km(e,t){let r=Ot(e);for(let o of t)switch(o.kind){case"UnknownModel":r.arguments.getField(o.modelKey)?.markAsError(),r.addErrorMessage(()=>`Unknown model name: ${o.modelKey}.`);break;case"UnknownField":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>`Model "${o.modelKey}" does not have a field named "${o.fieldName}".`);break;case"RelationInOmit":r.arguments.getDeepField([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>'Relations are already excluded by default and can not be specified in "omit".');break;case"InvalidFieldValue":r.arguments.getDeepFieldValue([o.modelKey,o.fieldName])?.markAsError(),r.addErrorMessage(()=>"Omit field option value must be a boolean.");break}let{message:n,args:i}=vn(r,"colorless");return`Error validating "omit" option:
127
127
 
128
128
  ${i}
129
129
 
130
- ${n}`}function tu(e){return e.length===0?Promise.resolve([]):new Promise((r,t)=>{let n=new Array(e.length),i=null,o=!1,s=0,a=()=>{o||(s++,s===e.length&&(o=!0,i?t(i):r(n)))},l=u=>{o||(o=!0,t(u))};for(let u=0;u<e.length;u++)e[u].then(c=>{n[u]=c,a()},c=>{if(!Qn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var tr=L("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Zm={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},Xm=Symbol.for("prisma.client.transaction.id"),ef={id:0,nextId(){return++this.id}};function lu(e){class r{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Un;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=vo();constructor(n){e=n?.__internal?.configOverride?.(e)??e,il(e),n&&ru(n,e);let i=new su.EventEmitter().on("error",()=>{});this._extensions=_r.empty(),this._previewFeatures=Bn(e),this._clientVersion=e.clientVersion??Kl,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=jl();let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Lt.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Lt.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new R(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new R("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=!s&&rt(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&L.enable("prisma:client");let p=Lt.default.resolve(e.dirname,e.relativePath);au.default.existsSync(p)||(p=e.dirname),tr("dirname",e.dirname),tr("relativePath",e.relativePath),tr("cwd",p);let d=u.engine||{};if(l.errorFormat?this._errorFormat=l.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={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:d.allowTriggerPanic,datamodelPath:Lt.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Ul(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:ol(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:$r,getBatchRequestPayload:Lr,prismaGraphQLToJSError:Fr,PrismaClientUnknownRequestError:j,PrismaClientInitializationError:R,PrismaClientKnownRequestError:Z,debug:L("prisma:client:accelerateEngine"),engineVersion:iu.version,clientVersion:e.clientVersion}},tr("clientVersion",e.clientVersion),this._engine=kl(e,this._engineConfig),this._requestHandler=new Wn(this,i),l.log)for(let f of l.log){let g=typeof f=="string"?f:f.emit==="stdout"?f.level:null;g&&this.$on(g,h=>{Xr.log(`${Xr.tags[g]??""}`,h.message||h.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=bt(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$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{Vo()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Po({clientMethod:i,activeProvider:a}),callsite:Xe(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=nu(n,i);return xo(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new X("`$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=>(xo(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new X(`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:Ol,callsite:Xe(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:Po({clientMethod:i,activeProvider:a}),callsite:Xe(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",...nu(n,i));throw new X("`$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 X("`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=ef.nextId(),s=Bl(n.length),a=n.map((l,u)=>{if(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=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return tu(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return ye(bt(ye(Ua(this),[te("_appliedParent",()=>this._appliedParent._createItxClient(n)),te("_createPrismaPromise",()=>vo(n)),te(Xm,()=>n.id)])),[Nr(Ha)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.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.")}: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){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Zm,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,I=>c(u,T=>(I?.end(),l(T))));let{runInTransaction:p,args:d,...f}=u,g={...n,...f};d&&(g.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await Za(this,g);return g.model?Wa({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new ou.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:f}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>An({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 L.enabled("prisma:client")&&(tr("Prisma Client call:"),tr(`prisma.${i}(${_a(n)})`),tr("Generated request:"),tr(JSON.stringify(h,null,2)+`
131
- `)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,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:f})}catch(g){throw g.clientVersion=this._clientVersion,g}}$metrics=new Dr(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=Qa}return r}function nu(e,r){return rf(e)?[new se(e,r),$l]:[e,ql]}function rf(e){return Array.isArray(e)&&Array.isArray(e.raw)}var tf=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function uu(e){return new Proxy(e,{get(r,t){if(t in r)return r[t];if(!tf.has(t))throw new TypeError(`Invalid enum value: ${String(t)}`)}})}function cu(e){rt(e,{conflictCheck:"warn"})}0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
130
+ ${n}`}function Xl(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(!Qn(c)){l(c);return}c.batchRequestIdx===u?l(c):(i||(i=c),a())})})}var tt=L("prisma:client");typeof globalThis=="object"&&(globalThis.NODE_CLIENT=!0);var Ym={requestArgsToMiddlewareArgs:e=>e,middlewareArgsToRequestArgs:e=>e},zm=Symbol.for("prisma.client.transaction.id"),Zm={id:0,nextId(){return++this.id}};function ou(e){class t{_originalClient=this;_runtimeDataModel;_requestHandler;_connectionPromise;_disconnectionPromise;_engineConfig;_accelerateEngineConfig;_clientVersion;_errorFormat;_tracingHelper;_middlewares=new Un;_previewFeatures;_activeProvider;_globalOmit;_extensions;_engine;_appliedParent;_createPrismaPromise=vo();constructor(n){e=n?.__internal?.configOverride?.(e)??e,tl(e),n&&Zl(n,e);let i=new nu.EventEmitter().on("error",()=>{});this._extensions=_t.empty(),this._previewFeatures=Bn(e),this._clientVersion=e.clientVersion??Jl,this._activeProvider=e.activeProvider,this._globalOmit=n?.omit,this._tracingHelper=$l();let o={rootEnvPath:e.relativeEnvPaths.rootEnvPath&&Lr.default.resolve(e.dirname,e.relativeEnvPaths.rootEnvPath),schemaEnvPath:e.relativeEnvPaths.schemaEnvPath&&Lr.default.resolve(e.dirname,e.relativeEnvPaths.schemaEnvPath)},s;if(n?.adapter){s=n.adapter;let l=e.activeProvider==="postgresql"?"postgres":e.activeProvider;if(s.provider!==l)throw new R(`The Driver Adapter \`${s.adapterName}\`, based on \`${s.provider}\`, is not compatible with the provider \`${l}\` specified in the Prisma schema.`,this._clientVersion);if(n.datasources||n.datasourceUrl!==void 0)throw new R("Custom datasource configuration is not compatible with Prisma Driver Adapters. Please define the database connection string directly in the Driver Adapter configuration.",this._clientVersion)}let a=!s&&tr(o,{conflictCheck:"none"})||e.injectableEdgeEnv?.();try{let l=n??{},u=l.__internal??{},c=u.debug===!0;c&&L.enable("prisma:client");let p=Lr.default.resolve(e.dirname,e.relativePath);iu.default.existsSync(p)||(p=e.dirname),tt("dirname",e.dirname),tt("relativePath",e.relativePath),tt("cwd",p);let d=u.engine||{};if(l.errorFormat?this._errorFormat=l.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={cwd:p,dirname:e.dirname,enableDebugLogs:c,allowTriggerPanic:d.allowTriggerPanic,datamodelPath:Lr.default.join(e.dirname,e.filename??"schema.prisma"),prismaPath:d.binaryPath??void 0,engineEndpoint:d.endpoint,generator:e.generator,showColors:this._errorFormat==="pretty",logLevel:l.log&&Vl(l.log),logQueries:l.log&&!!(typeof l.log=="string"?l.log==="query":l.log.find(f=>typeof f=="string"?f==="query":f.level==="query")),env:a?.parsed??{},flags:[],engineWasm:e.engineWasm,compilerWasm:e.compilerWasm,clientVersion:e.clientVersion,engineVersion:e.engineVersion,previewFeatures:this._previewFeatures,activeProvider:e.activeProvider,inlineSchema:e.inlineSchema,overrideDatasources:rl(l,e.datasourceNames),inlineDatasources:e.inlineDatasources,inlineSchemaHash:e.inlineSchemaHash,tracingHelper:this._tracingHelper,transactionOptions:{maxWait:l.transactionOptions?.maxWait??2e3,timeout:l.transactionOptions?.timeout??5e3,isolationLevel:l.transactionOptions?.isolationLevel},logEmitter:i,isBundled:e.isBundled,adapter:s},this._accelerateEngineConfig={...this._engineConfig,accelerateUtils:{resolveDatasourceUrl:$t,getBatchRequestPayload:Lt,prismaGraphQLToJSError:Ft,PrismaClientUnknownRequestError:j,PrismaClientInitializationError:R,PrismaClientKnownRequestError:Z,debug:L("prisma:client:accelerateEngine"),engineVersion:tu.version,clientVersion:e.clientVersion}},tt("clientVersion",e.clientVersion),this._engine=Cl(e,this._engineConfig),this._requestHandler=new Wn(this,i),l.log)for(let f of l.log){let g=typeof f=="string"?f:f.emit==="stdout"?f.level:null;g&&this.$on(g,h=>{er.log(`${er.tags[g]??""}`,h.message||h.query)})}}catch(l){throw l.clientVersion=this._clientVersion,l}return this._appliedParent=br(this)}get[Symbol.toStringTag](){return"PrismaClient"}$use(n){this._middlewares.use(n)}$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{qo()}}$executeRawInternal(n,i,o,s){let a=this._activeProvider;return this._request({action:"executeRaw",args:o,transaction:n,clientMethod:i,argsMapper:Po({clientMethod:i,activeProvider:a}),callsite:Ze(this._errorFormat),dataPath:[],middlewareArgsMapper:s})}$executeRaw(n,...i){return this._createPrismaPromise(o=>{if(n.raw!==void 0||n.sql!==void 0){let[s,a]=eu(n,i);return xo(this._activeProvider,s.text,s.values,Array.isArray(n)?"prisma.$executeRaw`<SQL>`":"prisma.$executeRaw(sql`<SQL>`)"),this.$executeRawInternal(o,"$executeRaw",s,a)}throw new X("`$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=>(xo(this._activeProvider,n,i,"prisma.$executeRawUnsafe(<SQL>, [...values])"),this.$executeRawInternal(o,"$executeRawUnsafe",[n,...i])))}$runCommandRaw(n){if(e.activeProvider!=="mongodb")throw new X(`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:Al,callsite:Ze(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:Po({clientMethod:i,activeProvider:a}),callsite:Ze(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",...eu(n,i));throw new X("`$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 X("`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=Zm.nextId(),s=ql(n.length),a=n.map((l,u)=>{if(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=i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel,p={kind:"batch",id:o,index:u,isolationLevel:c,lock:s};return l.requestTransaction?.(p)??l});return Xl(a)}async _transactionWithCallback({callback:n,options:i}){let o={traceparent:this._tracingHelper.getTraceParent()},s={maxWait:i?.maxWait??this._engineConfig.transactionOptions.maxWait,timeout:i?.timeout??this._engineConfig.transactionOptions.timeout,isolationLevel:i?.isolationLevel??this._engineConfig.transactionOptions.isolationLevel},a=await this._engine.transaction("start",o,s),l;try{let u={kind:"itx",...a};l=await n(this._createItxClient(u)),await this._engine.transaction("commit",o,a)}catch(u){throw await this._engine.transaction("rollback",o,a).catch(()=>{}),u}return l}_createItxClient(n){return ye(br(ye(Va(this),[re("_appliedParent",()=>this._appliedParent._createItxClient(n)),re("_createPrismaPromise",()=>vo(n)),re(zm,()=>n.id)])),[Nt(Ga)])}$transaction(n,i){let o;typeof n=="function"?this._engineConfig.adapter?.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.")}: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){n.otelParentCtx=this._tracingHelper.getActiveContext();let i=n.middlewareArgsMapper??Ym,o={args:i.requestArgsToMiddlewareArgs(n.args),dataPath:n.dataPath,runInTransaction:!!n.transaction,action:n.action,model:n.model},s={middleware:{name:"middleware",middleware:!0,attributes:{method:"$use"},active:!1},operation:{name:"operation",attributes:{method:o.action,model:o.model,name:o.model?`${o.model}.${o.action}`:o.action}}},a=-1,l=async u=>{let c=this._middlewares.get(++a);if(c)return this._tracingHelper.runInChildSpan(s.middleware,I=>c(u,T=>(I?.end(),l(T))));let{runInTransaction:p,args:d,...f}=u,g={...n,...f};d&&(g.args=i.middlewareArgsToRequestArgs(d)),n.transaction!==void 0&&p===!1&&delete g.transaction;let h=await Ka(this,g);return g.model?Qa({result:h,modelName:g.model,args:g.args,extensions:this._extensions,runtimeDataModel:this._runtimeDataModel,globalOmit:this._globalOmit}):h};return this._tracingHelper.runInChildSpan(s.operation,()=>new ru.AsyncResource("prisma-client-request").runInAsyncScope(()=>l(o)))}async _executeRequest({args:n,clientMethod:i,dataPath:o,callsite:s,action:a,model:l,argsMapper:u,transaction:c,unpacker:p,otelParentCtx:d,customDataProxyFetch:f}){try{n=u?u(n):n;let g={name:"serialize"},h=this._tracingHelper.runInChildSpan(g,()=>An({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 L.enabled("prisma:client")&&(tt("Prisma Client call:"),tt(`prisma.${i}(${Ia(n)})`),tt("Generated request:"),tt(JSON.stringify(h,null,2)+`
131
+ `)),c?.kind==="batch"&&await c.lock,this._requestHandler.request({protocolQuery:h,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:f})}catch(g){throw g.clientVersion=this._clientVersion,g}}$metrics=new Dt(this);_hasPreviewFlag(n){return!!this._engineConfig.previewFeatures?.includes(n)}$applyPendingMigrations(){return this._engine.applyPendingMigrations()}$extends=ja}return t}function eu(e,t){return Xm(e)?[new se(e,t),Ll]:[e,Fl]}function Xm(e){return Array.isArray(e)&&Array.isArray(e.raw)}var ef=new Set(["toJSON","$$typeof","asymmetricMatch",Symbol.iterator,Symbol.toStringTag,Symbol.isConcatSpreadable,Symbol.toPrimitive]);function su(e){return new Proxy(e,{get(t,r){if(r in t)return t[r];if(!ef.has(r))throw new TypeError(`Invalid enum value: ${String(r)}`)}})}function au(e){tr(e,{conflictCheck:"warn"})}0&&(module.exports={Debug,Decimal,Extensions,MetricsClient,PrismaClientInitializationError,PrismaClientKnownRequestError,PrismaClientRustPanicError,PrismaClientUnknownRequestError,PrismaClientValidationError,Public,Sql,createParam,defineDmmfProperty,deserializeJsonResponse,deserializeRawResult,dmmfToRuntimeDataModel,empty,getPrismaClient,getRuntime,join,makeStrictEnum,makeTypedQueryFactory,objectEnumValues,raw,serializeJsonQuery,skip,sqltag,warnEnvConflicts,warnOnce});
132
132
  /*! Bundled license information:
133
133
 
134
134
  decimal.js/decimal.mjs: