text: module.exports=function(e,t){"use strict";var n={};function __webpack_require__(t){if(n[t]){return n[t].exports}var r=n[t]={i:t,l:false,exports:{}};e[t].call(r.exports,r,r.exports,__webpack_require__);r.l=true;return r.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(911)}t(__webpack_require__);return startup()}({6:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getPlatform=t.getOpenSSLVersion=t.parseOpenSSLVersion=t.resolveDistro=t.parseDistro=t.getos=void 0;const i=r(n(87));const s=r(n(747));const o=n(669);const a=n(129);const u=o.promisify(s.default.readFile);const l=o.promisify(s.default.exists);async function getos(){const e=i.default.platform();if(e!=="linux"){return{platform:e}}return{platform:"linux",libssl:await getOpenSSLVersion(),distro:await resolveDistro()}}t.getos=getos;function parseDistro(e){const t=/^ID="?([^"\n]*)"?$/im;const n=/^ID_LIKE="?([^"\n]*)"?$/im;const r=t.exec(e);const i=r&&r[1]&&r[1].toLowerCase()||"";const s=n.exec(e);const o=s&&s[1]&&s[1].toLowerCase()||"";if(i==="raspbian"){return"arm"}if(i==="nixos"){return"nixos"}if(o.includes("centos")||o.includes("fedora")||o.includes("rhel")||i==="fedora"){return"rhel"}if(o.includes("debian")||o.includes("ubuntu")||i==="debian"){return"debian"}return}t.parseDistro=parseDistro;async function resolveDistro(){const e="/etc/os-release";const t="/etc/alpine-release";if(await l(t)){return"musl"}else if(await l(e)){return parseDistro(await u(e,"utf-8"))}else{return}}t.resolveDistro=resolveDistro;function parseOpenSSLVersion(e){const t=/^OpenSSL\s(\d+\.\d+)\.\d+/.exec(e);if(t){return t[1]+".x"}return}t.parseOpenSSLVersion=parseOpenSSLVersion;async function getOpenSSLVersion(){const[e,t]=await Promise.all([gracefulExec(`openssl version -v`),gracefulExec(`\n      ls -l /lib64 | grep ssl;\n      ls -l /usr/lib64 | grep ssl;\n    `)]);if(e){const t=parseOpenSSLVersion(e);if(t){return t}}if(t){const e=/libssl\.so\.(\d+\.\d+)\.\d+/.exec(t);if(e){return e[1]+".x"}}return undefined}t.getOpenSSLVersion=getOpenSSLVersion;async function gracefulExec(e){return new Promise(t=>{try{a.exec(e,(e,n)=>{t(String(n))})}catch(e){t(undefined);return undefined}})}async function getPlatform(){const{platform:e,libssl:t,distro:n}=await getos();if(e==="darwin"){return"darwin"}if(e==="win32"){return"windows"}if(e==="freebsd"){return"freebsd"}if(e==="openbsd"){return"openbsd"}if(e==="netbsd"){return"netbsd"}if(e==="linux"&&n==="musl"){return"linux-musl"}if(e==="linux"&&n&&t){return n+"-openssl-"+t}if(t){return"debian-openssl-"+t}if(n){return n+"-openssl-1.1.x"}return"debian-openssl-1.1.x"}t.getPlatform=getPlatform},49:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.mayBeCompatible=t.platforms=void 0;t.platforms=["darwin","debian-openssl-1.0.x","debian-openssl-1.1.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","linux-musl","windows","freebsd","openbsd","netbsd","nixos","arm"];function mayBeCompatible(e,t){if(e==="native"||t==="native"){return true}if(e==="darwin"||t==="darwin"){return false}if(e==="windows"||t==="windows"){return false}return true}t.mayBeCompatible=mayBeCompatible},50:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.lowerCase=t.capitalize=t.uniqBy=t.unionBy=t.destroyCircular=t.inputTypeToJson=t.getOutputTypeName=t.getInputTypeName=t.stringifyInputType=t.getSuggestion=t.graphQLToJSType=t.getGraphQLType=t.wrapWithList=t.stringifyGraphQLType=t.JSTypeToGraphQLType=t.GraphQLScalarToJSTypeTable=t.isScalar=t.ScalarTypeTable=t.keyBy=void 0;const i=r(n(815));const s=r(n(367));const o=r(n(241));t.keyBy=((e,t)=>{return e.reduce((e,n)=>{e[t(n)]=n;return e},{})});t.ScalarTypeTable={String:true,Int:true,Float:true,Boolean:true,Long:true,DateTime:true,ID:true,UUID:true,Json:true};function isScalar(e){if(typeof e!=="string"){return false}return t.ScalarTypeTable[e]||false}t.isScalar=isScalar;t.GraphQLScalarToJSTypeTable={String:"string",Int:"number",Float:"number",Boolean:"boolean",Long:"number",DateTime:["Date","string"],ID:"string",UUID:"string",Json:"object"};t.JSTypeToGraphQLType={string:"String",boolean:"Boolean",object:"Json"};function stringifyGraphQLType(e){if(typeof e==="string"){return e}return e.name}t.stringifyGraphQLType=stringifyGraphQLType;function wrapWithList(e,t){if(t){return`List<${e}>`}return e}t.wrapWithList=wrapWithList;function getGraphQLType(e,n){if(e===null){return"null"}if(Array.isArray(e)){let t=e.reduce((e,t)=>{const r=getGraphQLType(t,n);if(!e.includes(r)){e.push(r)}return e},[]);if(t.includes("Float")&&t.includes("Int")){t=["Float"]}return`List<${t.join(" | ")}>`}const r=typeof e;if(r==="number"){if(Math.trunc(e)===e){return"Int"}else{return"Float"}}if(Object.prototype.toString.call(e)==="[object Date]"){return"DateTime"}if(r==="string"){if(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)){return"UUID"}const t=new Date(e);if(n&&typeof n==="object"&&n.values&&n.values.includes(e)){return n.name}if(t.toString()==="Invalid Date"){return"String"}if(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/.test(e)){return"DateTime"}}return t.JSTypeToGraphQLType[r]}t.getGraphQLType=getGraphQLType;function graphQLToJSType(e){return t.GraphQLScalarToJSTypeTable[e]}t.graphQLToJSType=graphQLToJSType;function getSuggestion(e,t){const n=t.reduce((t,n)=>{const r=o.default(e,n);if(r<t.distance){return{distance:r,str:n}}return t},{distance:Math.min(Math.floor(e.length)*1.1,...t.map(e=>e.length*3)),str:null});return n.str}t.getSuggestion=getSuggestion;function stringifyInputType(e,t=false){if(typeof e==="string"){return e}if(e.values){return`enum ${e.name} {\n${s.default(e.values.join(", "),2)}\n}`}else{const n=s.default(e.fields.map(e=>{const n=e.inputType[0];const r=`${e.name}`;const s=`${t?i.default.green(r):r}${n.isRequired?"":"?"}: ${i.default.white(e.inputType.map(e=>argIsInputType(e.type)?e.type.name:wrapWithList(stringifyGraphQLType(e.type),e.isList)).join(" | "))}`;if(!n.isRequired){return i.default.dim(s)}return s}).join("\n"),2);return`${i.default.dim("type")} ${i.default.bold.dim(e.name)} ${i.default.dim("{")}\n${n}\n${i.default.dim("}")}`}}t.stringifyInputType=stringifyInputType;function argIsInputType(e){if(typeof e==="string"){return false}return true}function getInputTypeName(e){if(typeof e==="string"){return e}return e.name}t.getInputTypeName=getInputTypeName;function getOutputTypeName(e){if(typeof e==="string"){return e}return e.name}t.getOutputTypeName=getOutputTypeName;function inputTypeToJson(e,t,n=false){if(typeof e==="string"){return e}if(e.values){return e.values.join(" | ")}const r=e;const i=t&&r.fields.every(e=>e.inputType[0].kind==="object")&&!r.isWhereType&&!r.atLeastOne;if(n){return getInputTypeName(e)}return r.fields.reduce((e,t)=>{const n=t.inputType[0];e[t.name+(n.isRequired?"":"?")]=t.isRelationFilter&&!i&&!n.isRequired?getInputTypeName(n.type):inputTypeToJson(n.type,n.isRequired,true);return e},{})}t.inputTypeToJson=inputTypeToJson;function destroyCircular(e,t=[]){const n=Array.isArray(e)?[]:{};t.push(e);for(const r of Object.keys(e)){const i=e[r];if(typeof i==="function"){continue}if(!i||typeof i!=="object"){n[r]=i;continue}if(t.indexOf(e[r])===-1){n[r]=destroyCircular(e[r],t.slice(0));continue}n[r]="[Circular]"}if(typeof e.name==="string"){n.name=e.name}if(typeof e.message==="string"){n.message=e.message}if(typeof e.stack==="string"){n.stack=e.stack}return n}t.destroyCircular=destroyCircular;function unionBy(e,t,n){const r={};for(const t of e){r[n(t)]=t}for(const e of t){const t=n(e);if(!r[t]){r[t]=e}}return Object.values(r)}t.unionBy=unionBy;function uniqBy(e,t){const n={};for(const r of e){n[t(r)]=r}return Object.values(n)}t.uniqBy=uniqBy;function capitalize(e){return e[0].toUpperCase()+e.slice(1)}t.capitalize=capitalize;function lowerCase(e){return e.substring(0,1).toLowerCase()+e.substring(1)}t.lowerCase=lowerCase},87:function(e){e.exports=require("os")},94:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.printDatamodelObject=t.GeneratorConfigClass=t.printGeneratorConfig=void 0;const i=r(n(367));function printGeneratorConfig(e){return String(new GeneratorConfigClass(e))}t.printGeneratorConfig=printGeneratorConfig;class GeneratorConfigClass{constructor(e){this.config=e}toString(){const{config:e}=this;const t=JSON.parse(JSON.stringify({provider:e.provider,binaryTargets:e.binaryTargets||undefined}));return`generator ${e.name} {\n${i.default(printDatamodelObject(t),2)}\n}`}}t.GeneratorConfigClass=GeneratorConfigClass;function printDatamodelObject(e){const t=Object.keys(e).reduce((e,t)=>Math.max(e,t.length),0);return Object.entries(e).map(([e,n])=>`${e.padEnd(t)} = ${niceStringify(n)}`).join("\n")}t.printDatamodelObject=printDatamodelObject;function niceStringify(e){return JSON.parse(JSON.stringify(e,(e,t)=>{if(Array.isArray(t)){return`[${t.map(e=>JSON.stringify(e)).join(", ")}]`}return JSON.stringify(t)}))}},129:function(e){e.exports=require("child_process")},133:function(e,t,n){function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=n(947);Object.keys(e).forEach(t=>{createDebug[t]=e[t]});createDebug.instances=[];createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let n=0;n<e.length;n++){t=(t<<5)-t+e.charCodeAt(n);t|=0}return createDebug.colors[Math.abs(t)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(e){let t;function debug(...e){if(!debug.enabled){return}const n=debug;const r=Number(new Date);const i=r-(t||r);n.diff=i;n.prev=t;n.curr=r;t=r;e[0]=createDebug.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,r)=>{if(t==="%%"){return t}s++;const i=createDebug.formatters[r];if(typeof i==="function"){const r=e[s];t=i.call(n,r);e.splice(s,1);s--}return t});createDebug.formatArgs.call(n,e);const o=n.log||createDebug.log;o.apply(n,e)}debug.namespace=e;debug.enabled=createDebug.enabled(e);debug.useColors=createDebug.useColors();debug.color=selectColor(e);debug.destroy=destroy;debug.extend=extend;if(typeof createDebug.init==="function"){createDebug.init(debug)}createDebug.instances.push(debug);return debug}function destroy(){const e=createDebug.instances.indexOf(this);if(e!==-1){createDebug.instances.splice(e,1);return true}return false}function extend(e,t){const n=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);n.log=this.log;return n}function enable(e){createDebug.save(e);createDebug.names=[];createDebug.skips=[];let t;const n=(typeof e==="string"?e:"").split(/[\s,]+/);const r=n.length;for(t=0;t<r;t++){if(!n[t]){continue}e=n[t].replace(/\*/g,".*?");if(e[0]==="-"){createDebug.skips.push(new RegExp("^"+e.substr(1)+"$"))}else{createDebug.names.push(new RegExp("^"+e+"$"))}}for(t=0;t<createDebug.instances.length;t++){const e=createDebug.instances[t];e.enabled=createDebug.enabled(e.namespace)}}function disable(){const e=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map(e=>"-"+e)].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let t;let n;for(t=0,n=createDebug.skips.length;t<n;t++){if(createDebug.skips[t].test(e)){return false}}for(t=0,n=createDebug.names.length;t<n;t++){if(createDebug.names[t].test(e)){return true}}return false}function toNamespace(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}function coerce(e){if(e instanceof Error){return e.stack||e.message}return e}createDebug.enable(createDebug.load());return createDebug}e.exports=setup},180:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.convertLog=t.isRustError=void 0;function isRustError(e){return typeof e.is_panic!=="undefined"}t.isRustError=isRustError;function convertLog(e){const t=isQueryLog(e.fields);const n=t?"query":e.level.toLowerCase();return{...e,level:n,timestamp:new Date((new Date).getFullYear()+" "+e.timestamp)}}t.convertLog=convertLog;function isQueryLog(e){return Boolean(e.query)}},196:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getErrorMessageWithLink=t.PrismaClientInitializationError=t.PrismaClientRustPanicError=t.PrismaClientUnknownRequestError=t.PrismaClientKnownRequestError=t.getMessage=t.PrismaQueryEngineError=void 0;const i=n(180);const s=n(737);const o=n(212);const a=r(n(980));class PrismaQueryEngineError extends Error{constructor(e,t){super(e);this.code=t}}t.PrismaQueryEngineError=PrismaQueryEngineError;function getMessage(e){if(typeof e==="string"){return e}else if(i.isRustError(e)){return e.message}else if(e.fields&&e.fields.message){if(e.fields.reason){return`${e.fields.message}: ${e.fields.reason}`}return e.fields.message}else{return JSON.stringify(e)}}t.getMessage=getMessage;class PrismaClientKnownRequestError extends Error{constructor(e,t,n){super(e);this.code=t;this.meta=n}}t.PrismaClientKnownRequestError=PrismaClientKnownRequestError;class PrismaClientUnknownRequestError extends Error{constructor(e){super(e)}}t.PrismaClientUnknownRequestError=PrismaClientUnknownRequestError;class PrismaClientRustPanicError extends Error{constructor(e){super(e)}}t.PrismaClientRustPanicError=PrismaClientRustPanicError;class PrismaClientInitializationError extends Error{constructor(e){super(e)}}t.PrismaClientInitializationError=PrismaClientInitializationError;function getErrorMessageWithLink({version:e,platform:t,title:n,description:r}){const i=s.getLogs();const u=r?`# Description\n${r}`:"";const l=a.default(`Hi Prisma Team! My Prisma Client just crashed. This is the report:\n## Versions\n\n| Name     | Version            |\n|----------|--------------------|\n| Node     | ${process.version.padEnd(19)}| \n| OS       | ${t.padEnd(19)}|\n| Prisma   | ${e.padEnd(19)}|\n\n## Logs\n\`\`\`\n${i}\n\`\`\`\n${u}`);const c=o.getGithubIssueUrl({title:n,body:l});return`${n}\n\nThis is a non-recoverable error which probably happens when the Prisma Query Engine has a panic.\nIf you want the Prisma team to look into it, please cmd+click on the link below \nand press the "Submit new issue" button 🙏\n\n${o.link(c)}\n\nThanks!\n`}t.getErrorMessageWithLink=getErrorMessageWithLink},212:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getGithubIssueUrl=t.link=t.fixPlatforms=t.plusX=void 0;const i=r(n(747));const s=r(n(975));const o=r(n(272));const a=r(n(815));const u=r(n(737));const l=u.default("plusX");function plusX(e){const t=i.default.statSync(e);const n=t.mode|64|8|1;if(t.mode===n){l(`Execution permissions of ${e} are fine`);return}const r=n.toString(8).slice(-3);l(`Have to call plusX on ${e}`);i.default.chmodSync(e,r)}t.plusX=plusX;function fixPlatforms(e,t){e=e||[];if(!e.includes("native")){return["native",...e]}return[...e,t]}t.fixPlatforms=fixPlatforms;function link(e){return s.default(e,e,{fallback:e=>a.default.underline(e)})}t.link=link;function getGithubIssueUrl({title:e,user:t="prisma",repo:n="prisma-client-js",template:r="bug_report.md",body:i}){return o.default({user:t,repo:n,template:r,title:e,body:i})}t.getGithubIssueUrl=getGithubIssueUrl},234:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.filterObject=void 0;function filterObject(e,t){if(!e||typeof e!=="object"||typeof e.hasOwnProperty!=="function"){return e}const n={};for(const r in e){const i=e[r];if(e.hasOwnProperty(r)&&t(r,i)){n[r]=i}}return n}t.filterObject=filterObject},241:function(e){"use strict";e.exports=function(){function _min(e,t,n,r,i){return e<t||n<t?e>n?n+1:e+1:r===i?t:t+1}return function(e,t){if(e===t){return 0}if(e.length>t.length){var n=e;e=t;t=n}var r=e.length;var i=t.length;while(r>0&&e.charCodeAt(r-1)===t.charCodeAt(i-1)){r--;i--}var s=0;while(s<r&&e.charCodeAt(s)===t.charCodeAt(s)){s++}r-=s;i-=s;if(r===0||i<3){return i}var o=0;var a;var u;var l;var c;var f;var p;var d;var g;var h;var m;var y;var b;var w=[];for(a=0;a<r;a++){w.push(a+1);w.push(e.charCodeAt(s+a))}var _=w.length-1;for(;o<i-3;){h=t.charCodeAt(s+(u=o));m=t.charCodeAt(s+(l=o+1));y=t.charCodeAt(s+(c=o+2));b=t.charCodeAt(s+(f=o+3));p=o+=4;for(a=0;a<_;a+=2){d=w[a];g=w[a+1];u=_min(d,u,l,h,g);l=_min(u,l,c,m,g);c=_min(l,c,f,y,g);p=_min(c,f,p,b,g);w[a]=p;f=c;c=l;l=u;u=d}}for(;o<i;){h=t.charCodeAt(s+(u=o));p=++o;for(a=0;a<_;a+=2){d=w[a];w[a]=p=_min(d,u,p,h,w[a+1]);u=d}}return p}}()},244:function(e,t,n){"use strict";e=n.nmd(e);const r=(e,t)=>(...n)=>{const r=e(...n);return`[${r+t}m`};const i=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`};const s=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};const o=e=>e;const a=(e,t,n)=>[e,t,n];const u=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true});return r},enumerable:true,configurable:true})};let l;const c=(e,t,r,i)=>{if(l===undefined){l=n(901)}const s=i?10:0;const o={};for(const[n,i]of Object.entries(l)){const a=n==="ansi16"?"ansi":n;if(n===t){o[a]=e(r,s)}else if(typeof i==="object"){o[a]=e(i[t],s)}}return o};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright;t.bgColor.bgGray=t.bgColor.bgBlackBright;t.color.grey=t.color.blackBright;t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(const[n,r]of Object.entries(t)){for(const[n,i]of Object.entries(r)){t[n]={open:`[${i[0]}m`,close:`[${i[1]}m`};r[n]=t[n];e.set(i[0],i[1])}Object.defineProperty(t,n,{value:r,enumerable:false})}Object.defineProperty(t,"codes",{value:e,enumerable:false});t.color.close="[39m";t.bgColor.close="[49m";u(t.color,"ansi",()=>c(r,"ansi16",o,false));u(t.color,"ansi256",()=>c(i,"ansi256",o,false));u(t.color,"ansi16m",()=>c(s,"rgb",a,false));u(t.bgColor,"ansi",()=>c(r,"ansi16",o,true));u(t.bgColor,"ansi256",()=>c(i,"ansi256",o,true));u(t.bgColor,"ansi16m",()=>c(s,"rgb",a,true));return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},245:function(e,t,n){const r=n(747);const i=n(622);function log(e){console.log(`[dotenv][DEBUG] ${e}`)}const s="\n";const o=/^\s*([\w.-]+)\s*=\s*(.*)?\s*$/;const a=/\\n/g;const u=/\n|\r|\r\n/;function parse(e,t){const n=Boolean(t&&t.debug);const r={};e.toString().split(u).forEach(function(e,t){const i=e.match(o);if(i!=null){const e=i[1];let t=i[2]||"";const n=t.length-1;const o=t[0]==='"'&&t[n]==='"';const u=t[0]==="'"&&t[n]==="'";if(u||o){t=t.substring(1,n);if(o){t=t.replace(a,s)}}else{t=t.trim()}r[e]=t}else if(n){log(`did not match key and value when parsing line ${t+1}: ${e}`)}});return r}function config(e){let t=i.resolve(process.cwd(),".env");let n="utf8";let s=false;if(e){if(e.path!=null){t=e.path}if(e.encoding!=null){n=e.encoding}if(e.debug!=null){s=true}}try{const e=parse(r.readFileSync(t,{encoding:n}),{debug:s});Object.keys(e).forEach(function(t){if(!Object.prototype.hasOwnProperty.call(process.env,t)){process.env[t]=e[t]}else if(s){log(`"${t}" is already defined in \`process.env\` and will not be overwritten`)}});return{parsed:e}}catch(e){return{error:e}}}e.exports.config=config;e.exports.parse=parse},271:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.printStack=void 0;const a=o(n(815));const u=s(n(958));const l=n(546);const c=n(786);const f=o(n(737));const p=f.default("printStack");function renderN(e,t){const n=String(t).length;const r=String(e).length;if(r>=n){return String(e)}return" ".repeat(n-r)+e}t.printStack=(({callsite:e,originalMethod:t,onUs:r})=>{const i=20;let s=":";let o="\n";let f="";let d=0;let g=`prisma.${t}()`;p("callsite",e);if(e&&typeof window==="undefined"){const t=u.parse(e);const p=t.find((e,t)=>{if(t<2){if(e.methodName.includes("Object.")){return false}}return e.file&&!e.file.includes("@prisma")&&!e.methodName.includes("new ")&&e.methodName.split(".").length<4});if(process.env.NODE_ENV!=="production"&&p&&p.file&&p.lineNumber&&p.column&&!p.file.startsWith("internal/")){const t=p.file;const u=p.lineNumber;s=e?` in\n${a.default.underline(`${p.file}:${p.lineNumber}:${p.column}`)}`:"";const h=process.stdout.rows||20;const m=Math.max(0,u-5);const y=i+u-m;if(h>y){const e=n(747);if(e.existsSync(t)){const n=e.readFileSync(t,"utf-8");const i=n.split("\n").slice(m,u).join("\n");const p=c.dedent(i).split("\n");const h=p[p.length-1];if(!h||h.trim()===""){s=":"}else{const e=/(\S+(create|updateMany|deleteMany|update|delete|findMany|findOne)\()/;const t=h.match(e);if(t){g=`${t[1]})`}const n=h.indexOf("{");const i=l.highlightTS(p.map((e,t,i)=>!r&&t===i.length-1?e.slice(0,n>-1?n:e.length-1):e).join("\n")).split("\n");o="\n"+i.map((e,t)=>a.default.grey(renderN(t+m+1,u+m+1)+" ")+a.default.reset()+e).map((e,t,n)=>t===n.length-1?`${a.default.red.bold("→")} ${a.default.dim(e)}`:a.default.dim("  "+e)).join("\n");if(!t){o+="\n\n"}f=")";d=String(u+m+1).length+getIndent(h)+1+(t?2:0)}}}}}function getIndent(e){let t=0;for(let n=0;n<e.length;n++){if(e.charAt(n)!==" "){return t}t++}return t}const h=r?a.default.red(`Oops, an unknown error occured! This is ${a.default.bold("on us")}, you did nothing wrong.\nIt occured in the ${a.default.bold(`\`${g}\``)} invocation${s}`):a.default.red(`Invalid ${a.default.bold(`\`${g}\``)} invocation${s}`);const m=`\n${h}\n${o}${a.default.reset()}`;return{indent:d,stack:m,afterLines:f,lastErrorHeight:i}})},272:function(e){"use strict";e.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")}const n=new URL(`${t}/issues/new`);const r=["body","title","labels","template","milestone","assignee","projects"];for(const t of r){let r=e[t];if(r===undefined){continue}if(t==="labels"||t==="projects"){if(!Array.isArray(r)){throw new TypeError(`The \`${t}\` option should be an array`)}r=r.join(",")}n.searchParams.set(t,r)}return n.toString()});e.exports.default=e.exports},284:function(e,t,n){t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0;let i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{if(e==="%%"){return}r++;if(e==="%c"){i=r}});t.splice(i,0,n)}function log(...e){return typeof console==="object"&&console.log&&console.log(...e)}function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=n(133)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},293:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.createLineStream=void 0;var r=n(413),i=n(669);function byline(t,n){return e.exports.createStream(t,n)}t.default=byline;e.exports.createStream=function(e,t){if(e){return createLineStream(e,t)}else{return new LineStream(t)}};function createLineStream(e,t){if(!e){throw new Error("expected readStream")}if(!e.readable){throw new Error("readStream must be readable")}var n=new LineStream(t);e.pipe(n);return n}t.createLineStream=createLineStream;e.exports.LineStream=LineStream;function LineStream(e){r.Transform.call(this,e);e=e||{};this._readableState.objectMode=true;this._lineBuffer=[];this._keepEmptyLines=e.keepEmptyLines||false;this._lastChunkEndedWithCR=false;this.on("pipe",function(e){if(!this.encoding){if(e instanceof r.Readable){this.encoding=e._readableState.encoding}}})}i.inherits(LineStream,r.Transform);LineStream.prototype._transform=function(e,t,n){t=t||"utf8";if(Buffer.isBuffer(e)){if(t=="buffer"){e=e.toString();t="utf8"}else{e=e.toString(t)}}this._chunkEncoding=t;var r=e.split(/\r\n|\r|\n/g);if(this._lastChunkEndedWithCR&&e[0]=="\n"){r.shift()}if(this._lineBuffer.length>0){this._lineBuffer[this._lineBuffer.length-1]+=r[0];r.shift()}this._lastChunkEndedWithCR=e[e.length-1]=="\r";this._lineBuffer=this._lineBuffer.concat(r);this._pushBuffer(t,1,n)};LineStream.prototype._pushBuffer=function(e,t,n){while(this._lineBuffer.length>t){var r=this._lineBuffer.shift();if(this._keepEmptyLines||r.length>0){if(!this.push(this._reencode(r,e))){var i=this;setImmediate(function(){i._pushBuffer(e,t,n)});return}}}n()};LineStream.prototype._flush=function(e){this._pushBuffer(this._chunkEncoding,0,e)};LineStream.prototype._reencode=function(e,t){if(this.encoding&&this.encoding!=t){return Buffer.from(e,t).toString(this.encoding)}else if(this.encoding){return e}else{return Buffer.from(e,t)}}},367:function(e){"use strict";e.exports=((e,t=1,n)=>{n={indent:" ",includeEmptyLines:false,...n};if(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 n.indent!=="string"){throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``)}if(t===0){return e}const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))})},373:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DMMFClass=void 0;const r=n(50);function getLogger(){return(...e)=>{}}class DMMFClass{constructor({datamodel:e,schema:t,mappings:n}){this.outputTypeMap={};this.outputTypeToMergedOutputType=(e=>{const t=this.modelMap[e.name];return{...e,isEmbedded:t?t.isEmbedded:false,fields:e.fields}});this.datamodel=e;this.schema=t;this.mappings=n;const r=getLogger();r(`starting`);this.enumMap=this.getEnumMap();r(`enumMap`);this.queryType=this.getQueryType();r(`queryType`);this.mutationType=this.getMutationType();r(`mutationType`);this.modelMap=this.getModelMap();r(`modelMap`);this.outputTypes=this.getOutputTypes();r(`outputTypes`);this.outputTypeMap=this.getMergedOutputTypeMap();r(`outputTypes map`);this.resolveOutputTypes(this.outputTypes);r(`resolve Output Types`);this.inputTypes=this.schema.inputTypes;this.inputTypeMap=this.getInputTypeMap();r(`input type map`);this.resolveInputTypes(this.inputTypes);r(`input types`);this.resolveFieldArgumentTypes(this.outputTypes,this.inputTypeMap);r(`resolve fields `);r(`merge things...`);this.queryType=this.outputTypeMap.Query;this.mutationType=this.outputTypeMap.Mutation;this.outputTypes=this.outputTypes;r(`done`)}getField(e){return this.queryType.fields.find(t=>t.name===e)||this.mutationType.fields.find(t=>t.name===e)}resolveOutputTypes(e){for(const t of e){for(const e of t.fields){if(typeof e.outputType.type==="string"&&!r.ScalarTypeTable[e.outputType.type]){e.outputType.type=this.outputTypeMap[e.outputType.type]||this.enumMap[e.outputType.type]||e.outputType.type}}}}resolveInputTypes(e){for(const t of e){for(const e of t.fields){const t=e.inputType[0].type;if(typeof t==="string"&&!r.ScalarTypeTable[t]&&(this.inputTypeMap[t]||this.enumMap[t])){e.inputType[0].type=this.inputTypeMap[t]||this.enumMap[t]||e.inputType[0].type}const n=e.inputType[1]&&e.inputType[1].type;if(typeof n==="string"&&!r.ScalarTypeTable[n]&&(this.inputTypeMap[n]||this.enumMap[n])){e.inputType[1].type=this.inputTypeMap[n]||this.enumMap[n]||e.inputType[1].type}}}}resolveFieldArgumentTypes(e,t){for(const n of e){for(const e of n.fields){for(const n of e.args){const e=n.inputType[0].type;if(typeof e==="string"&&!r.ScalarTypeTable[e]){n.inputType[0].type=t[e]||this.enumMap[e]||n.inputType[0].type}const i=n.inputType[1]&&n.inputType[1].type;if(i&&typeof i==="string"&&!r.ScalarTypeTable[i]){n.inputType[1].type=t[i]||this.enumMap[i]||n.inputType[1].type}}}}}getQueryType(){return this.schema.outputTypes.find(e=>e.name==="Query")}getMutationType(){return this.schema.outputTypes.find(e=>e.name==="Mutation")}getOutputTypes(){return this.schema.outputTypes.map(this.outputTypeToMergedOutputType)}getEnumMap(){return r.keyBy(this.schema.enums,e=>e.name)}getModelMap(){return r.keyBy(this.datamodel.models,e=>e.name)}getMergedOutputTypeMap(){return r.keyBy(this.outputTypes,e=>e.name)}getInputTypeMap(){return r.keyBy(this.schema.inputTypes,e=>e.name)}}t.DMMFClass=DMMFClass},380:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var i=arguments.length,s=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)if(o=e[a])s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s;return i>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:true});const i=n(669);const s=n(383);class Sql{constructor(e,t){this.rawStrings=e;this.rawValues=t;if(e.length===0){throw new TypeError("Expected at least 1 string")}if(e.length-1!==t.length){throw new TypeError(`Expected ${e.length} strings to have ${e.length-1} values`)}}get values(){const e=[];for(const t of this.rawValues){if(t instanceof Sql){e.push(...t.values)}else{e.push(t)}}return e}get strings(){const e=[this.rawStrings[0]];for(let t=1;t<this.rawStrings.length;t++){const n=this.rawValues[t-1];if(n instanceof Sql){e[e.length-1]+=n.strings[0];e.push(...n.strings.slice(1));e[e.length-1]+=this.rawStrings[t]}else{e.push(this.rawStrings[t])}}return e}get text(){return this.strings.reduce((e,t,n)=>`${e}$${n}${t}`)}get sql(){return this.strings.join("?")}[i.inspect.custom](){return{text:this.text,sql:this.sql,values:this.values}}}r([s.cache],Sql.prototype,"values",null);r([s.cache],Sql.prototype,"strings",null);r([s.cache],Sql.prototype,"text",null);r([s.cache],Sql.prototype,"sql",null);t.Sql=Sql;Object.defineProperty(Sql.prototype,"text",{enumerable:true});Object.defineProperty(Sql.prototype,"values",{enumerable:true});Object.defineProperty(Sql.prototype,"sql",{enumerable:true});function join(e,t=","){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 Sql(["",...Array(e.length-1).fill(t),""],e)}t.join=join;function raw(e){return new Sql([e],[])}t.raw=raw;t.empty=raw("");function sqltag(e,...t){return new Sql(e.raw,t)}t.sqltag=sqltag;t.default=sqltag},383:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function cache(e,t,n){var r=n.get;if(!r)throw new TypeError("Getter property descriptor expected");n.get=function(){var e=r.call(this);Object.defineProperty(this,t,{configurable:n.configurable,enumerable:n.enumerable,writable:false,value:e});return e}}t.cache=cache},384:function(e){"use strict";e.exports=(e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")})},395:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.deepExtend=void 0;function isSpecificValue(e){return e instanceof Buffer||e instanceof Date||e instanceof RegExp?true:false}function cloneSpecificValue(e){if(e instanceof Buffer){const t=Buffer.alloc?Buffer.alloc(e.length):new Buffer(e.length);e.copy(t);return t}else if(e instanceof Date){return new Date(e.getTime())}else if(e instanceof RegExp){return new RegExp(e)}else{throw new Error("Unexpected situation")}}function deepCloneArray(e){const n=[];e.forEach(function(e,r){if(typeof e==="object"&&e!==null){if(Array.isArray(e)){n[r]=deepCloneArray(e)}else if(isSpecificValue(e)){n[r]=cloneSpecificValue(e)}else{n[r]=t.deepExtend({},e)}}else{n[r]=e}});return n}function safeGetProperty(e,t){return t==="__proto__"?undefined:e[t]}t.deepExtend=function(e,...n){if(!e||typeof e!=="object"){return false}if(n.length===0){return e}let r,i;for(const s of n){if(typeof s!=="object"||s===null||Array.isArray(s)){continue}for(const n of Object.keys(s)){i=safeGetProperty(e,n);r=safeGetProperty(s,n);if(r===e){continue}else if(typeof r!=="object"||r===null){e[n]=r;continue}else if(Array.isArray(r)){e[n]=deepCloneArray(r);continue}else if(isSpecificValue(r)){e[n]=cloneSpecificValue(r);continue}else if(typeof i!=="object"||i===null||Array.isArray(i)){e[n]=t.deepExtend({},r);continue}else{e[n]=t.deepExtend(i,r);continue}}}return e}},399:function(e,t,n){const r=n(583);function buildGraph(){const e={};const t=Object.keys(r);for(let n=t.length,r=0;r<n;r++){e[t[r]]={distance:-1,parent:null}}return e}function deriveBFS(e){const t=buildGraph();const n=[e];t[e].distance=0;while(n.length){const e=n.pop();const i=Object.keys(r[e]);for(let r=i.length,s=0;s<r;s++){const r=i[s];const o=t[r];if(o.distance===-1){o.distance=t[e].distance+1;o.parent=e;n.unshift(r)}}}return t}function link(e,t){return function(n){return t(e(n))}}function wrapConversion(e,t){const n=[t[e].parent,e];let i=r[t[e].parent][e];let s=t[e].parent;while(t[s].parent){n.unshift(t[s].parent);i=link(r[t[s].parent][s],i);s=t[s].parent}i.conversion=n;return i}e.exports=function(e){const t=deriveBFS(e);const n={};const r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){const e=r[i];const s=t[e];if(s.parent===null){continue}n[e]=wrapConversion(e,t)}return n}},413:function(e){e.exports=require("stream")},421:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(196);Object.defineProperty(t,"PrismaClientKnownRequestError",{enumerable:true,get:function(){return r.PrismaClientKnownRequestError}});Object.defineProperty(t,"PrismaClientUnknownRequestError",{enumerable:true,get:function(){return r.PrismaClientUnknownRequestError}});Object.defineProperty(t,"PrismaClientInitializationError",{enumerable:true,get:function(){return r.PrismaClientInitializationError}});Object.defineProperty(t,"PrismaClientRustPanicError",{enumerable:true,get:function(){return r.PrismaClientRustPanicError}});var i=n(655);Object.defineProperty(t,"Engine",{enumerable:true,get:function(){return i.NodeEngine}});var s=n(599);Object.defineProperty(t,"getInternalDatamodelJson",{enumerable:true,get:function(){return s.getInternalDatamodelJson}});var o=n(94);Object.defineProperty(t,"printGeneratorConfig",{enumerable:true,get:function(){return o.printGeneratorConfig}});var a=n(212);Object.defineProperty(t,"fixPlatforms",{enumerable:true,get:function(){return a.fixPlatforms}})},485:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=(e=>Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t)))},494:function(e){"use strict";const t=(e,t,n)=>{let r=e.indexOf(t);if(r===-1){return e}const i=t.length;let s=0;let o="";do{o+=e.substr(s,r-s)+t+n;s=r+i;r=e.indexOf(t,s)}while(r!==-1);o+=e.substr(s);return o};const n=(e,t,n,r)=>{let i=0;let s="";do{const o=e[r-1]==="\r";s+=e.substr(i,(o?r-1:r)-i)+t+(o?"\r\n":"\n")+n;i=r+1;r=e.indexOf("\n",i)}while(r!==-1);s+=e.substr(i);return s};e.exports={stringReplaceAll:t,stringEncaseCRLFWithFirstIndex:n}},508:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Dataloader=void 0;class Dataloader{constructor(e){this.options=e;this.tickActive=false;this.batches={}}request(e){const t=this.options.batchBy(e);if(!t){return this.options.singleLoader(e)}if(!this.batches[t]){this.batches[t]=[];if(!this.tickActive){this.tickActive=true;process.nextTick(()=>{this.dispatchBatches();this.tickActive=false})}}return new Promise((n,r)=>{this.batches[t].push({request:e,resolve:n,reject:r})})}dispatchBatches(){for(const e in this.batches){const t=this.batches[e];delete this.batches[e];if(t.length===1){this.options.singleLoader(t[0].request).then(e=>{if(e instanceof Error){t[0].reject(e)}else{t[0].resolve(e)}}).catch(e=>{t[0].reject(e)})}else{this.options.batchLoader(t.map(e=>e.request)).then(e=>{if(e instanceof Error){for(let n=0;n<t.length;n++){t[n].reject(e)}}else{for(let n=0;n<t.length;n++){const r=e[n];if(r instanceof Error){t[n].reject(r)}else{t[n].resolve(r)}}}}).catch(e=>{for(let n=0;n<t.length;n++){t[n].reject(e)}})}}}}t.Dataloader=Dataloader},513:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=n(914);const i=n(384);const s=n(485).default;const o=(e,t,n)=>{const o=[];return function stringifyObject(e,t={},n="",a=[]){t.indent=t.indent||"\t";let u;if(t.inlineCharacterLimit===undefined){u={newLine:"\n",newLineOrSpace:"\n",pad:n,indent:n+t.indent}}else{u={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"}}const l=e=>{if(t.inlineCharacterLimit===undefined){return e}const r=e.replace(new RegExp(u.newLine,"g"),"").replace(new RegExp(u.newLineOrSpace,"g")," ").replace(new RegExp(u.pad+"|"+u.indent,"g"),"");if(r.length<=t.inlineCharacterLimit){return r}return e.replace(new RegExp(u.newLine+"|"+u.newLineOrSpace,"g"),"\n").replace(new RegExp(u.pad,"g"),n).replace(new RegExp(u.indent,"g"),n+t.indent)};if(o.indexOf(e)!==-1){return'"[Circular]"'}if(e===null||e===undefined||typeof e==="number"||typeof e==="boolean"||typeof e==="function"||typeof e==="symbol"||r(e)){return String(e)}if(e instanceof Date){return`new Date('${e.toISOString()}')`}if(Array.isArray(e)){if(e.length===0){return"[]"}o.push(e);const r="["+u.newLine+e.map((r,i)=>{const s=e.length-1===i?u.newLine:","+u.newLineOrSpace;let o=stringifyObject(r,t,n+t.indent,[...a,i]);if(t.transformValue){o=t.transformValue(e,i,o)}return u.indent+o+s}).join("")+u.pad+"]";o.pop();return l(r)}if(i(e)){let r=Object.keys(e).concat(s(e));if(t.filter){r=r.filter(n=>t.filter(e,n))}if(r.length===0){return"{}"}o.push(e);const i="{"+u.newLine+r.map((i,s)=>{const o=r.length-1===s?u.newLine:","+u.newLineOrSpace;const l=typeof i==="symbol";const c=!l&&/^[a-z$_][a-z$_0-9]*$/i.test(i);const f=l||c?i:stringifyObject(i,t,undefined,[...a,i]);let p=stringifyObject(e[i],t,n+t.indent,[...a,i]);if(t.transformValue){p=t.transformValue(e,i,p)}let d=u.indent+String(f)+": "+p+o;if(t.transformLine){d=t.transformLine({obj:e,indent:u.indent,key:f,stringifiedValue:p,value:e[i],eol:o,originalLine:d,path:a.concat(f)})}return d}).join("")+u.pad+"}";o.pop();return l(i)}e=String(e).replace(/[\r\n]/g,e=>e==="\n"?"\\n":"\\r");if(t.singleQuotes===false){e=e.replace(/"/g,'\\"');return`"${e}"`}e=e.replace(/\\?'/g,"\\'");return`'${e}'`}(e,t,n)};t.default=o},517:function(e,t,n){"use strict";const r=n(651);const i=n(863);function parseVersion(e){if(/^\d{3,4}$/.test(e)){const t=/(\d{1,2})(\d{2})/.exec(e);return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}const t=(e||"").split(".").map(e=>parseInt(e,10));return{major:t[0],minor:t[1],patch:t[2]}}function supportsHyperlink(e){const{env:t}=process;if("FORCE_HYPERLINK"in t){return!(t.FORCE_HYPERLINK.length>0&&parseInt(t.FORCE_HYPERLINK,10)===0)}if(i("no-hyperlink")||i("no-hyperlinks")||i("hyperlink=false")||i("hyperlink=never")){return false}if(i("hyperlink=true")||i("hyperlink=always")){return true}if(!r.supportsColor(e)){return false}if(e&&!e.isTTY){return false}if(process.platform==="win32"){return false}if("CI"in t){return false}if("TEAMCITY_VERSION"in t){return false}if("TERM_PROGRAM"in t){const e=parseVersion(t.TERM_PROGRAM_VERSION);switch(t.TERM_PROGRAM){case"iTerm.app":if(e.major===3){return e.minor>=1}return e.major>3}}if("VTE_VERSION"in t){if(t.VTE_VERSION==="0.50.0"){return false}const e=parseVersion(t.VTE_VERSION);return e.major>0||e.minor>=50}return false}e.exports={supportsHyperlink:supportsHyperlink,stdout:supportsHyperlink(process.stdout),stderr:supportsHyperlink(process.stderr)}},523:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.flatMap=void 0;function flatten(e){return Array.prototype.concat.apply([],e)}function flatMap(e,t,n){return flatten(e.map(t,n))}t.flatMap=flatMap},532:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.omit=void 0;function omit(e,t){const n={};const r=Array.isArray(t)?t:[t];for(const t in e){if(e.hasOwnProperty(t)&&!r.includes(t)){n[t]=e[t]}}return n}t.omit=omit},546:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.highlightTS=void 0;const r=n(962);function highlightTS(e){return highlight(e,r.Prism.languages.javascript)}t.highlightTS=highlightTS;function highlight(e,t){const n=r.Prism.tokenize(e,t);return n.map(e=>r.Token.stringify(e)).join("")}},554:function(e){"use strict";e.exports=(e=>{const t=e.match(/^[ \t]*(?=\S)/gm);if(!t){return 0}return Math.min.apply(Math,t.map(e=>e.length))})},583:function(e,t,n){const r=n(908);const i={};for(const e of Object.keys(r)){i[r[e]]=e}const s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=s;for(const e of Object.keys(s)){if(!("channels"in s[e])){throw new Error("missing channels property: "+e)}if(!("labels"in s[e])){throw new Error("missing channel labels property: "+e)}if(s[e].labels.length!==s[e].channels){throw new Error("channel and label counts mismatch: "+e)}const{channels:t,labels:n}=s[e];delete s[e].channels;delete s[e].labels;Object.defineProperty(s[e],"channels",{value:t});Object.defineProperty(s[e],"labels",{value:n})}s.rgb.hsl=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const i=Math.min(t,n,r);const s=Math.max(t,n,r);const o=s-i;let a;let u;if(s===i){a=0}else if(t===s){a=(n-r)/o}else if(n===s){a=2+(r-t)/o}else if(r===s){a=4+(t-n)/o}a=Math.min(a*60,360);if(a<0){a+=360}const l=(i+s)/2;if(s===i){u=0}else if(l<=.5){u=o/(s+i)}else{u=o/(2-s-i)}return[a,u*100,l*100]};s.rgb.hsv=function(e){let t;let n;let r;let i;let s;const o=e[0]/255;const a=e[1]/255;const u=e[2]/255;const l=Math.max(o,a,u);const c=l-Math.min(o,a,u);const f=function(e){return(l-e)/6/c+1/2};if(c===0){i=0;s=0}else{s=c/l;t=f(o);n=f(a);r=f(u);if(o===l){i=r-n}else if(a===l){i=1/3+t-r}else if(u===l){i=2/3+n-t}if(i<0){i+=1}else if(i>1){i-=1}}return[i*360,s*100,l*100]};s.rgb.hwb=function(e){const t=e[0];const n=e[1];let r=e[2];const i=s.rgb.hsl(e)[0];const o=1/255*Math.min(t,Math.min(n,r));r=1-1/255*Math.max(t,Math.max(n,r));return[i,o*100,r*100]};s.rgb.cmyk=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const i=Math.min(1-t,1-n,1-r);const s=(1-t-i)/(1-i)||0;const o=(1-n-i)/(1-i)||0;const a=(1-r-i)/(1-i)||0;return[s*100,o*100,a*100,i*100]};function comparativeDistance(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}s.rgb.keyword=function(e){const t=i[e];if(t){return t}let n=Infinity;let s;for(const t of Object.keys(r)){const i=r[t];const o=comparativeDistance(e,i);if(o<n){n=o;s=t}}return s};s.keyword.rgb=function(e){return r[e]};s.rgb.xyz=function(e){let t=e[0]/255;let n=e[1]/255;let r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92;n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const i=t*.4124+n*.3576+r*.1805;const s=t*.2126+n*.7152+r*.0722;const o=t*.0193+n*.1192+r*.9505;return[i*100,s*100,o*100]};s.rgb.lab=function(e){const t=s.rgb.xyz(e);let n=t[0];let r=t[1];let i=t[2];n/=95.047;r/=100;i/=108.883;n=n>.008856?n**(1/3):7.787*n+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;i=i>.008856?i**(1/3):7.787*i+16/116;const o=116*r-16;const a=500*(n-r);const u=200*(r-i);return[o,a,u]};s.hsl.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const r=e[2]/100;let i;let s;let o;if(n===0){o=r*255;return[o,o,o]}if(r<.5){i=r*(1+n)}else{i=r+n-r*n}const a=2*r-i;const u=[0,0,0];for(let e=0;e<3;e++){s=t+1/3*-(e-1);if(s<0){s++}if(s>1){s--}if(6*s<1){o=a+(i-a)*6*s}else if(2*s<1){o=i}else if(3*s<2){o=a+(i-a)*(2/3-s)*6}else{o=a}u[e]=o*255}return u};s.hsl.hsv=function(e){const t=e[0];let n=e[1]/100;let r=e[2]/100;let i=n;const s=Math.max(r,.01);r*=2;n*=r<=1?r:2-r;i*=s<=1?s:2-s;const o=(r+n)/2;const a=r===0?2*i/(s+i):2*n/(r+n);return[t,a*100,o*100]};s.hsv.rgb=function(e){const t=e[0]/60;const n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6;const s=t-Math.floor(t);const o=255*r*(1-n);const a=255*r*(1-n*s);const u=255*r*(1-n*(1-s));r*=255;switch(i){case 0:return[r,u,o];case 1:return[a,r,o];case 2:return[o,r,u];case 3:return[o,a,r];case 4:return[u,o,r];case 5:return[r,o,a]}};s.hsv.hsl=function(e){const t=e[0];const n=e[1]/100;const r=e[2]/100;const i=Math.max(r,.01);let s;let o;o=(2-n)*r;const a=(2-n)*i;s=n*i;s/=a<=1?a:2-a;s=s||0;o/=2;return[t,s*100,o*100]};s.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100;let r=e[2]/100;const i=n+r;let s;if(i>1){n/=i;r/=i}const o=Math.floor(6*t);const a=1-r;s=6*t-o;if((o&1)!==0){s=1-s}const u=n+s*(a-n);let l;let c;let f;switch(o){default:case 6:case 0:l=a;c=u;f=n;break;case 1:l=u;c=a;f=n;break;case 2:l=n;c=a;f=u;break;case 3:l=n;c=u;f=a;break;case 4:l=u;c=n;f=a;break;case 5:l=a;c=n;f=u;break}return[l*255,c*255,f*255]};s.cmyk.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const r=e[2]/100;const i=e[3]/100;const s=1-Math.min(1,t*(1-i)+i);const o=1-Math.min(1,n*(1-i)+i);const a=1-Math.min(1,r*(1-i)+i);return[s*255,o*255,a*255]};s.xyz.rgb=function(e){const t=e[0]/100;const n=e[1]/100;const r=e[2]/100;let i;let s;let o;i=t*3.2406+n*-1.5372+r*-.4986;s=t*-.9689+n*1.8758+r*.0415;o=t*.0557+n*-.204+r*1.057;i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92;s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92;o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92;i=Math.min(Math.max(0,i),1);s=Math.min(Math.max(0,s),1);o=Math.min(Math.max(0,o),1);return[i*255,s*255,o*255]};s.xyz.lab=function(e){let t=e[0];let n=e[1];let r=e[2];t/=95.047;n/=100;r/=108.883;t=t>.008856?t**(1/3):7.787*t+16/116;n=n>.008856?n**(1/3):7.787*n+16/116;r=r>.008856?r**(1/3):7.787*r+16/116;const i=116*n-16;const s=500*(t-n);const o=200*(n-r);return[i,s,o]};s.lab.xyz=function(e){const t=e[0];const n=e[1];const r=e[2];let i;let s;let o;s=(t+16)/116;i=n/500+s;o=s-r/200;const a=s**3;const u=i**3;const l=o**3;s=a>.008856?a:(s-16/116)/7.787;i=u>.008856?u:(i-16/116)/7.787;o=l>.008856?l:(o-16/116)/7.787;i*=95.047;s*=100;o*=108.883;return[i,s,o]};s.lab.lch=function(e){const t=e[0];const n=e[1];const r=e[2];let i;const s=Math.atan2(r,n);i=s*360/2/Math.PI;if(i<0){i+=360}const o=Math.sqrt(n*n+r*r);return[t,o,i]};s.lch.lab=function(e){const t=e[0];const n=e[1];const r=e[2];const i=r/360*2*Math.PI;const s=n*Math.cos(i);const o=n*Math.sin(i);return[t,s,o]};s.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=t===null?s.rgb.hsv(e)[2]:t;o=Math.round(o/50);if(o===0){return 30}let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));if(o===2){a+=60}return a};s.hsv.ansi16=function(e){return s.rgb.ansi16(s.hsv.rgb(e),e[2])};s.rgb.ansi256=function(e){const t=e[0];const n=e[1];const r=e[2];if(t===n&&n===r){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}const i=16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5);return i};s.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}const n=(~~(e>50)+1)*.5;const r=(t&1)*n*255;const i=(t>>1&1)*n*255;const s=(t>>2&1)*n*255;return[r,i,s]};s.ansi256.rgb=function(e){if(e>=232){const t=(e-232)*10+8;return[t,t,t]}e-=16;let t;const n=Math.floor(e/36)/5*255;const r=Math.floor((t=e%36)/6)/5*255;const i=t%6/5*255;return[n,r,i]};s.rgb.hex=function(e){const t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);const n=t.toString(16).toUpperCase();return"000000".substring(n.length)+n};s.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}let n=t[0];if(t[0].length===3){n=n.split("").map(e=>{return e+e}).join("")}const r=parseInt(n,16);const i=r>>16&255;const s=r>>8&255;const o=r&255;return[i,s,o]};s.rgb.hcg=function(e){const t=e[0]/255;const n=e[1]/255;const r=e[2]/255;const i=Math.max(Math.max(t,n),r);const s=Math.min(Math.min(t,n),r);const o=i-s;let a;let u;if(o<1){a=s/(1-o)}else{a=0}if(o<=0){u=0}else if(i===t){u=(n-r)/o%6}else if(i===n){u=2+(r-t)/o}else{u=4+(t-n)/o}u/=6;u%=1;return[u*360,o*100,a*100]};s.hsl.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=n<.5?2*t*n:2*t*(1-n);let i=0;if(r<1){i=(n-.5*r)/(1-r)}return[e[0],r*100,i*100]};s.hsv.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=t*n;let i=0;if(r<1){i=(n-r)/(1-r)}return[e[0],r*100,i*100]};s.hcg.rgb=function(e){const t=e[0]/360;const n=e[1]/100;const r=e[2]/100;if(n===0){return[r*255,r*255,r*255]}const i=[0,0,0];const s=t%1*6;const o=s%1;const a=1-o;let u=0;switch(Math.floor(s)){case 0:i[0]=1;i[1]=o;i[2]=0;break;case 1:i[0]=a;i[1]=1;i[2]=0;break;case 2:i[0]=0;i[1]=1;i[2]=o;break;case 3:i[0]=0;i[1]=a;i[2]=1;break;case 4:i[0]=o;i[1]=0;i[2]=1;break;default:i[0]=1;i[1]=0;i[2]=a}u=(1-n)*r;return[(n*i[0]+u)*255,(n*i[1]+u)*255,(n*i[2]+u)*255]};s.hcg.hsv=function(e){const t=e[1]/100;const n=e[2]/100;const r=t+n*(1-t);let i=0;if(r>0){i=t/r}return[e[0],i*100,r*100]};s.hcg.hsl=function(e){const t=e[1]/100;const n=e[2]/100;const r=n*(1-t)+.5*t;let i=0;if(r>0&&r<.5){i=t/(2*r)}else if(r>=.5&&r<1){i=t/(2*(1-r))}return[e[0],i*100,r*100]};s.hcg.hwb=function(e){const t=e[1]/100;const n=e[2]/100;const r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};s.hwb.hcg=function(e){const t=e[1]/100;const n=e[2]/100;const r=1-n;const i=r-t;let s=0;if(i<1){s=(r-i)/(1-i)}return[e[0],i*100,s*100]};s.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};s.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};s.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};s.gray.hsl=function(e){return[0,0,e[0]]};s.gray.hsv=s.gray.hsl;s.gray.hwb=function(e){return[0,100,e[0]]};s.gray.cmyk=function(e){return[0,0,0,e[0]]};s.gray.lab=function(e){return[e[0],0,0]};s.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255;const n=(t<<16)+(t<<8)+t;const r=n.toString(16).toUpperCase();return"000000".substring(r.length)+r};s.rgb.gray=function(e){const t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},599:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getInternalDatamodelJson=void 0;const i=r(n(622));const s=n(129);const o=r(n(293));function getInternalDatamodelJson(e,t=i.default.join(__dirname,"../schema-inferrer-bin")){return new Promise((n,r)=>{const i=s.spawn(t,{stdio:["pipe","pipe",process.stderr]});i.on("error",function(e){console.error("[schema-inferrer-bin] error: %s",e);r(e)});i.on("exit",function(e,t){if(e!==0){console.error("[schema-inferrer-bin] exit: code=%s signal=%s",e,t)}r()});const a=o.default(i.stdout);a.on("data",e=>{const t=JSON.parse(e);const r=Buffer.from(JSON.stringify(t)).toString("base64");n(r)});const u=e.replace(/\n/g," ");i.stdin.write(JSON.stringify({dataModel:u})+"\n")})}t.getInternalDatamodelJson=getInternalDatamodelJson},603:function(e,t,n){if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=n(284)}else{e.exports=n(954)}},605:function(e){e.exports=require("http")},614:function(e){e.exports=require("events")},622:function(e){e.exports=require("path")},623:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.theme=t.identity=t.brightBlue=t.blue=t.darkBrightBlue=t.orange=void 0;const i=r(n(815));t.orange=i.default.rgb(246,145,95);t.darkBrightBlue=i.default.rgb(107,139,140);t.blue=i.default.cyan;t.brightBlue=i.default.rgb(127,155,155);t.identity=(e=>e);t.theme={keyword:t.blue,entity:t.blue,value:t.brightBlue,punctuation:t.darkBrightBlue,directive:t.blue,function:t.blue,variable:t.brightBlue,string:i.default.greenBright,boolean:t.orange,number:i.default.cyan,comment:i.default.grey}},631:function(e){e.exports=require("net")},646:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.deepSet=t.deepGet=void 0;const n=e=>Array.isArray(e)?e:e.split(".");t.deepGet=((e,t)=>n(t).reduce((e,t)=>e&&e[t],e));t.deepSet=((e,r,i)=>n(r).reduceRight((n,r,i,s)=>Object.assign({},t.deepGet(e,s.slice(0,i)),{[r]:n}),i))},648:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.visit=void 0;const r=n(983);function visit(e,t){const n=e.children.map(e=>visitField(e,t));if(e.children.length===n.length&&e.children.every((e,t)=>e===n[t])){return e}const i=new r.Document(e.type,n);return i}t.visit=visit;function visitField(e,t){const n=e.args?e.args.args.map(e=>visitArg(e,t)):undefined;const i=n?new r.Args(n):undefined;const s=e.children?e.children.map(e=>visitField(e,t)):undefined;const o=!i&&!e.args||e.args&&i&&(e.args.args.length===i.args.length&&e.args.args.every((e,t)=>e===i.args[t]));const a=!e.children&&!s||e.children&&s&&e.children.length===s.length&&e.children.every((e,t)=>e===s[t]);if(o&&a){return e}return new r.Field({name:e.name,args:i,children:s,error:e.error,schemaField:e.schemaField})}function isArgsArray(e){if(Array.isArray(e)){return e.every(e=>e instanceof r.Args)}return false}function visitArg(e,t){function mapArgs(e){const{args:n}=e;const i=n.map(e=>visitArg(e,t));if(i.length!==n.length||n.find((e,t)=>e!==i[t])){return new r.Args(i)}return e}const n=t.Arg.enter(e)||e;let i=n.value;if(isArgsArray(n.value)){i=n.value.map(mapArgs)}else if(n.value instanceof r.Args){i=mapArgs(n.value)}if(i!==n.value){return new r.Arg({key:n.key,value:i,error:n.error,argType:n.argType,isEnum:n.isEnum})}return n}},651:function(e,t,n){"use strict";const r=n(87);const i=n(867);const s=n(863);const{env:o}=process;let a;if(s("no-color")||s("no-colors")||s("color=false")||s("color=never")){a=0}else if(s("color")||s("colors")||s("color=true")||s("color=always")){a=1}if("FORCE_COLOR"in o){if(o.FORCE_COLOR==="true"){a=1}else if(o.FORCE_COLOR==="false"){a=0}else{a=o.FORCE_COLOR.length===0?1:Math.min(parseInt(o.FORCE_COLOR,10),3)}}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e,t){if(a===0){return 0}if(s("color=16m")||s("color=full")||s("color=truecolor")){return 3}if(s("color=256")){return 2}if(e&&!t&&a===undefined){return 0}const n=a||0;if(o.TERM==="dumb"){return n}if(process.platform==="win32"){const e=r.release().split(".");if(Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in o){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in o)||o.CI_NAME==="codeship"){return 1}return n}if("TEAMCITY_VERSION"in o){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(o.TEAMCITY_VERSION)?1:0}if("GITHUB_ACTIONS"in o){return 1}if(o.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in o){const e=parseInt((o.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(o.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(o.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(o.TERM)){return 1}if("COLORTERM"in o){return 1}return n}function getSupportLevel(e){const t=supportsColor(e,e&&e.isTTY);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:translateLevel(supportsColor(true,i.isatty(1))),stderr:translateLevel(supportsColor(true,i.isatty(2)))}},655:function(__unusedmodule,exports,__webpack_require__){"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:true});exports.NodeEngine=void 0;const Engine_1=__webpack_require__(196);const debug_1=__importDefault(__webpack_require__(603));const get_platform_1=__webpack_require__(812);const path_1=__importDefault(__webpack_require__(622));const net_1=__importDefault(__webpack_require__(631));const fs_1=__importDefault(__webpack_require__(747));const chalk_1=__importDefault(__webpack_require__(815));const printGeneratorConfig_1=__webpack_require__(94);const util_1=__webpack_require__(212);const util_2=__webpack_require__(669);const events_1=__importDefault(__webpack_require__(614));const log_1=__webpack_require__(180);const child_process_1=__webpack_require__(129);const byline_1=__importDefault(__webpack_require__(293));const h1client_1=__webpack_require__(723);const debug=debug_1.default("engine");const exists=util_2.promisify(fs_1.default.exists);const readdir=util_2.promisify(fs_1.default.readdir);const knownPlatforms=["native","darwin","debian-openssl-1.0.x","debian-openssl-1.1.x","rhel-openssl-1.0.x","rhel-openssl-1.1.x","linux-musl","windows","freebsd","openbsd","netbsd","nixos","arm"];const children=[];class NodeEngine{constructor({cwd:e,datamodelPath:t,prismaPath:n,generator:r,datasources:i,showColors:s,logLevel:o,logQueries:a,env:u,flags:l,clientVersion:c,...f}){this.exiting=false;this.managementApiEnabled=false;this.ready=false;this.stderrLogs="";this.stdoutLogs="";this.handleRequestError=(e=>{var t,n,r,i;debug({error:e});let s;if(this.currentRequestPromise.isCanceled&&this.lastError){if(this.lastError.is_panic){s=new Engine_1.PrismaClientRustPanicError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:Engine_1.getMessage(this.lastError),version:this.clientVersion}));this.lastPanic=s}else{s=new Engine_1.PrismaClientUnknownRequestError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:Engine_1.getMessage(this.lastError),version:this.clientVersion}))}}else if(this.currentRequestPromise.isCanceled&&this.lastErrorLog){if(((n=(t=this.lastErrorLog)===null||t===void 0?void 0:t.fields)===null||n===void 0?void 0:n.message)==="PANIC"){s=new Engine_1.PrismaClientRustPanicError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:Engine_1.getMessage(this.lastErrorLog),version:this.clientVersion}));this.lastPanic=s}else{s=new Engine_1.PrismaClientUnknownRequestError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:Engine_1.getMessage(this.lastErrorLog),version:this.clientVersion}))}}else if(e.code&&e.code==="ECONNRESET"||e.code==="ECONNREFUSED"){if(this.lastError){if(this.lastError.is_panic){s=new Engine_1.PrismaClientRustPanicError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:Engine_1.getMessage(this.lastError),version:this.clientVersion}));this.lastPanic=s}else{s=new Engine_1.PrismaClientUnknownRequestError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:Engine_1.getMessage(this.lastError),version:this.clientVersion}))}}else if(this.lastErrorLog){if(((i=(r=this.lastErrorLog)===null||r===void 0?void 0:r.fields)===null||i===void 0?void 0:i.message)==="PANIC"){s=new Engine_1.PrismaClientRustPanicError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:Engine_1.getMessage(this.lastErrorLog),version:this.clientVersion}));this.lastPanic=s}else{s=new Engine_1.PrismaClientUnknownRequestError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:Engine_1.getMessage(this.lastErrorLog),version:this.clientVersion}))}}if(!s){const e=this.stderrLogs||this.stdoutLogs;s=new Engine_1.PrismaClientUnknownRequestError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:`Unknown error in Prisma Client`,version:this.clientVersion,description:e}))}}if(s){throw s}throw e});this.env=u;this.cwd=this.resolveCwd(e);this.debug=f.debug||false;this.datamodelPath=t;this.prismaPath=process.env.PRISMA_QUERY_ENGINE_BINARY||n;this.generator=r;this.datasources=i;this.logEmitter=new events_1.default;this.showColors=s||false;this.logLevel=o;this.logQueries=a||false;this.clientVersion=c;this.flags=l||[];this.logEmitter.on("error",e=>{if(this.debug){debug_1.default("engine:log")(e)}if(e instanceof Error){debug_1.default("engine:error")(e)}else{this.lastErrorLog=e;if(e.fields.message==="PANIC"){this.handlePanic(e)}}});if(this.platform){if(!knownPlatforms.includes(this.platform)&&!fs_1.default.existsSync(this.platform)){throw new Engine_1.PrismaClientInitializationError(`Unknown ${chalk_1.default.red("PRISMA_QUERY_ENGINE_BINARY")} ${chalk_1.default.redBright.bold(this.platform)}. Possible binaryTargets: ${chalk_1.default.greenBright(knownPlatforms.join(", "))} or a path to the query engine binary.\nYou may have to run ${chalk_1.default.greenBright("prisma generate")} for your changes to take effect.`)}}else{this.getPlatform()}if(this.debug){debug_1.default.enable("*")}}resolveCwd(e){if(e&&fs_1.default.existsSync(e)&&fs_1.default.lstatSync(e).isDirectory()){return e}return process.cwd()}on(e,t){this.logEmitter.on(e,t)}async getPlatform(){if(this.platformPromise){return this.platformPromise}this.platformPromise=get_platform_1.getPlatform();return this.platformPromise}getQueryEnginePath(e,t=__dirname){let n=path_1.default.join(t,`query-engine-${e}`);if(e==="windows"){n=`${n}.exe`}return n}handlePanic(e){this.child.kill();if(this.currentRequestPromise){this.currentRequestPromise.cancel()}}async resolvePrismaPath(){if(this.prismaPath){return this.prismaPath}const platform=await this.getPlatform();if(this.platform&&this.platform!==platform){this.incorrectlyPinnedPlatform=this.platform}this.platform=this.platform||platform;const fileName=eval(`require('path').basename(__filename)`);if(fileName==="NodeEngine.js"){return this.getQueryEnginePath(this.platform,path_1.default.resolve(__dirname,`..`))}else{const dotPrismaPath=await this.getQueryEnginePath(this.platform,eval(`require('path').join(__dirname, '../../../.prisma/client')`));debug({dotPrismaPath:dotPrismaPath});if(fs_1.default.existsSync(dotPrismaPath)){return dotPrismaPath}const dirnamePath=await this.getQueryEnginePath(this.platform,eval("__dirname"));debug({dirnamePath:dirnamePath});if(fs_1.default.existsSync(dirnamePath)){return dirnamePath}const parentDirName=await this.getQueryEnginePath(this.platform,path_1.default.join(eval("__dirname"),".."));debug({parentDirName:parentDirName});if(fs_1.default.existsSync(parentDirName)){return parentDirName}const datamodelDirName=await this.getQueryEnginePath(this.platform,path_1.default.dirname(this.datamodelPath));if(fs_1.default.existsSync(datamodelDirName)){return datamodelDirName}const cwdPath=await this.getQueryEnginePath(this.platform,this.cwd);if(fs_1.default.existsSync(cwdPath)){return cwdPath}const prismaPath=await this.getQueryEnginePath(this.platform);debug({prismaPath:prismaPath});return prismaPath}}async getPrismaPath(){const e=await this.resolvePrismaPath();const t=await this.getPlatform();if(!await exists(e)){const n=this.incorrectlyPinnedPlatform?`\nYou incorrectly pinned it to ${chalk_1.default.redBright.bold(`${this.incorrectlyPinnedPlatform}`)}\n`:"";const r=path_1.default.dirname(e);const i=fs_1.default.existsSync(r);let s=[];if(i){s=await readdir(r)}let o=`Query engine binary for current platform "${chalk_1.default.bold(t)}" could not be found.${n}\nThis probably happens, because you built Prisma Client on a different platform.\n(Prisma Client looked in "${chalk_1.default.underline(e)}")\n\nFiles in ${r}:\n\n${s.map(e=>`  ${e}`).join("\n")}\n`;if(this.generator){if(this.generator.binaryTargets.includes(this.platform)||this.generator.binaryTargets.includes("native")){o+=`\nYou already added the platform${this.generator.binaryTargets.length>1?"s":""} ${this.generator.binaryTargets.map(e=>`"${chalk_1.default.bold(e)}"`).join(", ")} to the "${chalk_1.default.underline("generator")}" block\nin the "schema.prisma" file as described in https://pris.ly/d/client-generator,\nbut something went wrong. That's suboptimal.\n\nPlease create an issue at https://github.com/prisma/prisma-client-js/issues/new`}else{o+=`\n\nTo solve this problem, add the platform "${this.platform}" to the "${chalk_1.default.underline("generator")}" block in the "schema.prisma" file:\n${chalk_1.default.greenBright(this.getFixedGenerator())}\n\nThen run "${chalk_1.default.greenBright("prisma generate")}" for your changes to take effect.\nRead more about deploying Prisma Client: https://pris.ly/d/client-generator`}}else{o+=`\n\nRead more about deploying Prisma Client: https://pris.ly/d/client-generator\n`}throw new Engine_1.PrismaClientInitializationError(o)}if(this.incorrectlyPinnedPlatform){console.error(`${chalk_1.default.yellow("Warning:")} You pinned the platform ${chalk_1.default.bold(this.incorrectlyPinnedPlatform)}, but Prisma Client detects ${chalk_1.default.bold(await this.getPlatform())}.\nThis means you should very likely pin the platform ${chalk_1.default.greenBright(await this.getPlatform())} instead.\n${chalk_1.default.dim("In case we're mistaken, please report this to us 🙏.")}`)}if(process.platform!=="win32"){util_1.plusX(e)}return e}getFixedGenerator(){const e={...this.generator,binaryTargets:util_1.fixPlatforms(this.generator.binaryTargets,this.platform)};return printGeneratorConfig_1.printGeneratorConfig(e)}printDatasources(){if(this.datasources){return JSON.stringify(this.datasources)}return"[]"}async start(){if(!this.startPromise){this.startPromise=this.internalStart()}return this.startPromise}internalStart(){return new Promise(async(e,t)=>{try{this.lastPanic=undefined;this.port=await this.getFreePort();const n={PRISMA_DML_PATH:this.datamodelPath,PORT:String(this.port),RUST_BACKTRACE:"1",RUST_LOG:"info"};if(this.logQueries||this.logLevel==="info"){n.RUST_LOG="info";if(this.logQueries){n.LOG_QUERIES="true"}}if(this.logLevel==="warn"){n.RUST_LOG="warn"}if(this.datasources){n.OVERWRITE_DATASOURCES=this.printDatasources()}if(!process.env.NO_COLOR&&this.showColors){n.CLICOLOR_FORCE="1"}debug({cwd:this.cwd});const r=await this.getPrismaPath();const i=["--enable-raw-queries",...this.flags];debug({flags:i});this.child=child_process_1.spawn(r,i,{env:{...this.env,...process.env,...n},cwd:this.cwd,stdio:["ignore","pipe","pipe"]});children.push(this.child);byline_1.default(this.child.stderr).on("data",e=>{const t=String(e);debug("stderr",t);try{const e=JSON.parse(t);if(typeof e.is_panic!=="undefined"){debug(e);this.lastError=e;if(this.engineStartDeferred){const e=new Engine_1.PrismaClientInitializationError(this.lastError.message);this.engineStartDeferred.reject(e)}}}catch(e){if(!t.includes("Printing to stderr")&&!t.includes("Listening on ")){this.stderrLogs+="\n"+t}}});byline_1.default(this.child.stdout).on("data",e=>{var t;const n=String(e);try{const e=JSON.parse(n);debug("stdout",e);if(this.engineStartDeferred&&e.level==="INFO"&&e.target==="query_engine::server"&&((t=e.fields)===null||t===void 0?void 0:t.message.startsWith("Started http server"))){this.engineStartDeferred.resolve();this.engineStartDeferred=undefined}if(typeof e.is_panic==="undefined"){const t=log_1.convertLog(e);this.logEmitter.emit(t.level,t)}else{this.lastError=e}}catch(e){}});this.child.on("exit",e=>{this.exitCode=e;if(e!==0&&this.engineStartDeferred){const e=new Engine_1.PrismaClientInitializationError(this.stderrLogs);this.engineStartDeferred.reject(e)}if(!this.child){return}if(this.lastError){return}if(this.lastErrorLog){this.lastErrorLog.target="exit";return}if(e===126){this.lastErrorLog={timestamp:new Date,target:"exit",level:"error",fields:{message:`Couldn't start query engine as it's not executable on this operating system.\nYou very likely have the wrong "binaryTarget" defined in the schema.prisma file.`}}}else{this.lastErrorLog={target:"exit",timestamp:new Date,level:"error",fields:{message:(this.stderrLogs||"")+(this.stdoutLogs||"")+`\nExit code: ${e}`}}}});this.child.on("error",e=>{this.lastError={message:e.message,backtrace:"Could not start query engine",is_panic:false};t(e)});this.child.on("close",(e,t)=>{var n;if(e===null&&t==="SIGABRT"&&this.child){const e=new Engine_1.PrismaClientRustPanicError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:`Panic in Query Engine with SIGABRT signal`,description:this.stderrLogs,version:this.clientVersion}));this.logEmitter.emit("error",e)}else if(e===255&&t===null&&((n=this.lastErrorLog)===null||n===void 0?void 0:n.fields.message)==="PANIC"&&!this.lastPanic){const e=new Engine_1.PrismaClientRustPanicError(Engine_1.getErrorMessageWithLink({platform:this.platform,title:`${this.lastErrorLog.fields.message}: ${this.lastErrorLog.fields.reason} in\n${this.lastErrorLog.fields.file}:${this.lastErrorLog.fields.line}:${this.lastErrorLog.fields.column}`,version:this.clientVersion}));this.logEmitter.emit("error",e)}});if(this.lastError){return t(new Engine_1.PrismaClientInitializationError(Engine_1.getMessage(this.lastError)))}if(this.lastErrorLog){return t(new Engine_1.PrismaClientInitializationError(Engine_1.getMessage(this.lastErrorLog)))}try{await new Promise((e,t)=>{this.engineStartDeferred={resolve:e,reject:t}})}catch(e){this.child.kill();throw e}this.url=`http://localhost:${this.port}`;e()}catch(e){t(e)}})}async stop(){await this.start();if(this.currentRequestPromise){try{await this.currentRequestPromise}catch(e){}}if(this.child){debug(`Stopping Prisma engine`);this.exiting=true;this.child.kill();delete this.child}}getFreePort(){return new Promise((e,t)=>{const n=net_1.default.createServer(e=>e.end(""));n.unref();n.on("error",t);n.listen(0,()=>{const r=n.address();const i=typeof r==="string"?parseInt(r.split(":").slice(-1)[0],10):r.port;n.close(n=>{if(n){t(n)}e(i)})})})}async request(e){await this.start();if(!this.child){throw new Engine_1.PrismaClientUnknownRequestError(`Can't perform request, as the Engine has already been stopped`)}this.currentRequestPromise=h1client_1.h1Post(this.port,stringifyQuery(e));return this.currentRequestPromise.then(({data:e,headers:t})=>{if(e.errors){if(e.errors.length===1){throw this.graphQLToJSError(e.errors[0])}throw new Error(JSON.stringify(e.errors))}const n=parseInt(t["x-elapsed"])/1e3;return{data:e,elapsed:n}}).catch(this.handleRequestError)}async requestBatch(e){await this.start();if(!this.child){throw new Engine_1.PrismaClientUnknownRequestError(`Can't perform request, as the Engine has already been stopped`)}const t={};const n={batch:e.map(e=>({query:e,variables:t}))};this.currentRequestPromise=h1client_1.h1Post(this.port,JSON.stringify(n));return this.currentRequestPromise.then(({data:e,headers:t})=>{const n=parseInt(t["x-elapsed"])/1e3;if(Array.isArray(e)){return e.map(e=>{if(e.errors){return this.graphQLToJSError(e.errors[0])}return{data:e,elapsed:n}})}else{if(e.errors&&e.errors.length===1){throw new Error(e.errors[0].error)}throw new Error(JSON.stringify(e))}}).catch(this.handleRequestError)}graphQLToJSError(e){if(e.user_facing_error.error_code){return new Engine_1.PrismaClientKnownRequestError(e.user_facing_error.message,e.user_facing_error.error_code,e.user_facing_error.meta)}return new Engine_1.PrismaClientUnknownRequestError(e.user_facing_error.message)}}exports.NodeEngine=NodeEngine;function stringifyQuery(e){return`{"variables":{},"query":${JSON.stringify(e)}}`}function exitHandler(e=false){return()=>{for(const e of children){if(!e.killed){e.kill()}}if(e){process.exit()}}}process.on("beforeExit",exitHandler());process.on("exit",exitHandler());process.on("SIGINT",exitHandler(true));process.on("SIGUSR1",exitHandler(true));process.on("SIGUSR2",exitHandler(true))},668:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getOperation=t.PrismaClientFetcher=t.getPrismaClient=void 0;const a=n(373);const u=n(944);const l=o(n(622));const c=n(911);const f=n(655);const p=n(983);const d=o(n(737));const g=d.default("prisma-client");const h=o(n(747));const m=o(n(815));const y=s(n(380));const b=n(245);const w=n(721);const _=n(784);const v=n(50);const P=n(646);const T=n(508);const E=n(271);const C=o(n(980));const O=n(788);const $=n(532);function getPrismaClient(e){class NewPrismaClient{constructor(t){var n,r,i;const s=t!==null&&t!==void 0?t:{};const o=(n=s.__internal)!==null&&n!==void 0?n:{};const u=o.debug===true;if(u){d.default.enable("prisma-client")}if(o.hooks){this.hooks=o.hooks}let c=(r=e.sqliteDatasourceOverrides)!==null&&r!==void 0?r:[];c=c.map(t=>({name:t.name,url:"file:"+l.default.resolve(e.dirname,t.url)}));const p=Object.entries(s.datasources||{}).map(([e,t])=>({name:e,url:t}));const y=_.mergeBy(c,p,e=>e.name);const b=o.engine||{};if(s.errorFormat){this.errorFormat=s.errorFormat}else if(process.env.NODE_ENV==="production"){this.errorFormat="minimal"}else if(process.env.NO_COLOR){this.errorFormat="colorless"}else{this.errorFormat="colorless"}this.measurePerformance=o.measurePerformance||false;const v=this.readEnv();this.dmmf=new a.DMMFClass(e.document);this.internalDatasources=e.internalDatasources;let P=l.default.resolve(e.dirname,e.relativePath);if(!h.default.existsSync(P)){P=e.dirname}this.engineConfig={cwd:P,debug:u,datamodelPath:l.default.join(e.dirname,"schema.prisma"),prismaPath:(i=b.binaryPath)!==null&&i!==void 0?i:undefined,datasources:y,generator:e.generator,showColors:this.errorFormat==="pretty",logLevel:s.log&&w.getLogLevel(s.log),logQueries:s.log&&Boolean(typeof s.log==="string"?s.log==="query":s.log.find(e=>typeof e==="string"?e==="query":e.level==="query")),env:v,flags:[],clientVersion:e.clientVersion};const T=$.omit(this.engineConfig,["env","datasources"]);g({engineConfig:T});this.engine=new f.NodeEngine(this.engineConfig);this.fetcher=new PrismaClientFetcher(this,false,this.hooks);if(s.log){for(const e of s.log){const t=typeof e==="string"?e:e.emit==="stdout"?e.level:null;if(t){this.on(t,e=>{const n={query:"blue",info:"cyan",warn:"yellow",error:"red"};console.error(m.default[n[t]](`prisma:${t}`.padEnd(13))+(e.message||e.query))})}}}this.bootstrapClient()}readEnv(){const t=l.default.resolve(e.dirname,e.relativePath,".env");if(h.default.existsSync(t)){return b.parse(h.default.readFileSync(t,"utf-8"))}return{}}on(e,t){this.engine.on(e,n=>{const r=n.fields;if(e==="query"){t({timestamp:n.timestamp,query:r.query,params:r.params,duration:r.duration_ms,target:n.target})}else{t({timestamp:n.timestamp,message:r.message,target:n.target})}})}async connect(){if(this.disconnectionPromise){await this.disconnectionPromise}if(this.connectionPromise){return this.connectionPromise}this.connectionPromise=this.engine.start();return this.connectionPromise}async runDisconnect(){await this.engine.stop();delete this.connectionPromise;this.engine=new f.NodeEngine(this.engineConfig);delete this.disconnectionPromise}async disconnect(){if(!this.disconnectionPromise){this.disconnectionPromise=this.runDisconnect()}return this.disconnectionPromise}async raw(e,...t){var n;let r="";let i=undefined;const s=((n=this.internalDatasources[0])===null||n===void 0?void 0:n.connectorType)==="postgresql"?"text":"sql";g(`Prisma Client call:`);if(Array.isArray(e)){const n=y.sqltag(e,...t);r=n[s];i={values:JSON.stringify(n.values),__prismaRawParamaters__:true}}else if("string"===typeof e){r=e;if(t.length){i={values:JSON.stringify(t),__prismaRawParamaters__:true}}}else{r=e[s];i={values:JSON.stringify(e.values),__prismaRawParamaters__:true}}if(i===null||i===void 0?void 0:i.values){g(`prisma.raw(${r}, ${i.values})`)}else{g(`prisma.raw(${r})`)}const o=p.makeDocument({dmmf:this.dmmf,rootField:"executeRaw",rootTypeName:"mutation",select:{query:r,parameters:i}});o.validate({query:r,parameters:i},false,"raw",this.errorFormat);const a=String(o);g(`Generated request:`);g(a+"\n");return this.fetcher.request({document:o,rootField:"executeRaw",typeName:"raw",isList:false,dataPath:[],clientMethod:"raw"})}bootstrapClient(){const e=this.dmmf.mappings.reduce((t,n)=>{const r=v.lowerCase(n.model);const i=this.dmmf.modelMap[n.model];if(!i){throw new Error(`Invalid mapping ${n.model}, can't find model`)}const s=({operation:t,actionName:s,rootField:o,args:a,dataPath:u,isList:l})=>{u=u!==null&&u!==void 0?u:[];l=l!==null&&l!==void 0?l:false;const c=this.errorFormat!=="minimal"?(new Error).stack:undefined;const f=`${r}.${s}`;let d=p.makeDocument({dmmf:this.dmmf,rootField:o,rootTypeName:t,select:a});d.validate(a,false,`${r}.${s}`,this.errorFormat,c);d=p.transformDocument(d);const h=String(d);g(`Prisma Client call:`);g(`prisma.${f}(${O.printJsonWithErrors(a,[],[],[])})`);g(`Generated request:`);g(h+"\n");let m;const y=new CollectTimestamps("PrismaClient");const b={then:(e,t)=>{if(!m){m=this.fetcher.request({document:d,clientMethod:f,typeName:n.model,dataPath:u,isList:l,rootField:o,collectTimestamps:y,callsite:c})}return m.then(e,t)},catch:e=>{if(!m){m=this.fetcher.request({document:d,clientMethod:f,typeName:n.model,dataPath:u,isList:l,rootField:o,collectTimestamps:y,callsite:c})}return m.catch(e)},finally:e=>{if(!m){m=this.fetcher.request({document:d,clientMethod:f,typeName:n.model,dataPath:u,isList:l,rootField:o,collectTimestamps:y,callsite:c})}return m.finally(e)},_collectTimestamps:y};for(const n of i.fields.filter(e=>e.kind==="object")){b[n.name]=(r=>{const i=u.includes("select")?"select":u.includes("include")?"include":"select";const l=[...u,i,n.name];const c=P.deepSet(a,l,r||true);return e[n.type]({operation:t,actionName:s,rootField:o,args:c,dataPath:l,isList:n.isList})})}return b};t[i.name]=s;return t},{});for(const t of this.dmmf.mappings){const n=v.lowerCase(t.model);const r={model:true,plural:true,aggregate:true};const i=Object.entries(t).reduce((n,[i,s])=>{if(!r[i]){const r=getOperation(i);n[i]=(n=>e[t.model]({operation:r,actionName:i,rootField:s,args:n}))}return n},{});i.count=(n=>e[t.model]({operation:"query",actionName:"count",rootField:t.aggregate,args:n?{select:{count:n}}:undefined,dataPath:["count"]}));this[n]=i}}}return NewPrismaClient}t.getPrismaClient=getPrismaClient;class PrismaClientFetcher{constructor(e,t=false,n){this.prisma=e;this.debug=t;this.hooks=n;this.dataloader=new T.Dataloader({batchLoader:async e=>{const t=e.map(e=>String(e.document));await this.prisma.connect();return this.prisma.engine.requestBatch(t)},singleLoader:async e=>{const t=String(e.document);await this.prisma.connect();return this.prisma.engine.request(t)},batchBy:e=>{var t;if(!e.document.children[0].name.startsWith("findOne")){return null}const n=e.document.children[0].children.join(",");const r=(t=e.document.children[0].args)===null||t===void 0?void 0:t.args.map(e=>{if(e.value instanceof p.Args){return e.key+"-"+e.value.args.map(e=>e.key).join(",")}return e.key}).join(",");return`${e.document.children[0].name}|${r}|${n}`}})}async request({document:e,dataPath:t=[],rootField:n,typeName:r,isList:i,callsite:s,collectTimestamps:o,clientMethod:a}){if(this.hooks&&this.hooks.beforeRequest){const s=String(e);this.hooks.beforeRequest({query:s,path:t,rootField:n,typeName:r,document:e,isList:i})}try{o&&o.record("Pre-engine_request");const{data:r,elapsed:i}=await this.dataloader.request({document:e});o&&o.record("Post-engine_request");o&&o.record("Pre-unpack");const u=this.unpack(e,r,t,n);o&&o.record("Post-unpack");o&&o.addResults({engine_request_rust:i});if(process.env.PRISMA_CLIENT_GET_TIME){return{data:u,elapsed:i}}return u}catch(e){let t=e.message;if(s){const{stack:n}=E.printStack({callsite:s,originalMethod:a,onUs:e.isPanic});t=n+"\n  "+e.message}t=this.sanitizeMessage(t);if(e.code){throw new c.PrismaClientKnownRequestError(t,e.code,e.meta)}else if(e.isPanic){throw new c.PrismaClientRustPanicError(t)}else if(e instanceof c.PrismaClientUnknownRequestError){throw new c.PrismaClientUnknownRequestError(t)}else if(e instanceof c.PrismaClientInitializationError){throw new c.PrismaClientInitializationError(t)}else if(e instanceof c.PrismaClientRustPanicError){throw new c.PrismaClientRustPanicError(t)}throw e}}sanitizeMessage(e){if(this.prisma.errorFormat&&this.prisma.errorFormat!=="pretty"){return C.default(e)}return e}unpack(e,t,n,r){if(t.data){t=t.data}const i=[];if(r){i.push(r)}i.push(...n.filter(e=>e!=="select"&&e!=="include"));return p.unpack({document:e,data:t,path:i})}}t.PrismaClientFetcher=PrismaClientFetcher;class CollectTimestamps{constructor(e){this.records=[];this.start=undefined;this.additionalResults={};this.start={name:e,value:process.hrtime()}}record(e){this.records.push({name:e,value:process.hrtime()})}elapsed(e,t){const n=[t[0]-e[0],t[1]-e[1]];const r=n[0]*1e9+n[1];const i=r/1e6;return i}addResults(e){Object.assign(this.additionalResults,e)}getResults(){const e=this.records.reduce((e,t)=>{const n=t.name.split("-")[1];if(e[n]){e[n]=this.elapsed(e[n],t.value)}else{e[n]=t.value}return e},{});Object.assign(e,{total:this.elapsed(this.start.value,this.records[this.records.length-1].value),...this.additionalResults});return e}}function getOperation(e){if(e===u.DMMF.ModelAction.findMany||e===u.DMMF.ModelAction.findOne){return"query"}return"mutation"}t.getOperation=getOperation},669:function(e){e.exports=require("util")},721:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getLogLevel=void 0;function getLogLevel(e){if(typeof e==="string"){return e}return e.reduce((e,t)=>{const n=typeof t==="string"?t:t.level;if(n==="query"){return e}if(!e){return n}if(t==="info"||e==="info"){return"info"}return n},undefined)}t.getLogLevel=getLogLevel},723:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.h1Post=void 0;const i=r(n(605));const s=new i.default.Agent({keepAlive:true,maxSockets:100});function h1Post(e,t){return new Promise((n,r)=>{const o=i.default.request({agent:s,hostname:"localhost",path:"/",method:"POST",port:e,headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(t)}},e=>{const t=[];e.on("data",e=>{t.push(e)});e.on("end",()=>{n({data:JSON.parse(Buffer.concat(t)),headers:e.headers})})});o.on("error",r);o.write(t);o.end()})}t.h1Post=h1Post},737:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getLogs=void 0;const i=r(n(603));const s=[];const o=100;const a=[];const u=new Map;const l=process.env.DEBUG?process.env.DEBUG+",":"";const c=i.default.skips.slice();const f=i.default.names.slice();function isEnabledByEnvVar(e){if(e[e.length-1]==="*"){return true}for(const t of c){if(t.test(e)){return false}}for(const t of f){if(t.test(e)){return true}}return false}function Debug(e){const t=i.default(e);a.push(e);i.default.enable(l+a.join(","));if(isEnabledByEnvVar(e)){u.set(e,true)}const n=(e,...n)=>{return t(e,...n)};n.log=console.error.bind(console);n.color=t.color;n.namespace=t.namespace;n.enabled=t.enabled;n.destroy=t.destroy;n.extend=t.extend;t.log=((...t)=>{s.push(t);if(s.length>o){s.shift()}if(u.has(e)){n.log(...t)}});return n}t.default=Debug;Debug.enable=(e=>{u.set(e,true)});Debug.enabled=(e=>u.has(e));function getLogs(e=3e4){let t=s.map(e=>e.join("  ")).join("\n");if(t.length<e){return t}return t.slice(-e)}t.getLogs=getLogs},746:function(e){"use strict";e.exports=(({onlyFirst:e=false}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[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?undefined:"g")})},747:function(e){e.exports=require("fs")},784:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.mergeBy=void 0;function mergeBy(e,t,r){const i=n(e,r);const s=n(t,r);const o=Object.values(s).map(e=>e[e.length-1]);const a=Object.keys(s);Object.entries(i).forEach(([e,t])=>{if(!a.includes(e)){o.push(t[t.length-1])}});return o}t.mergeBy=mergeBy;const n=(e,t)=>{return e.reduce((e,n)=>{const r=t(n);if(!e[r]){e[r]=[]}e[r].push(n);return e},{})}},786:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.dedent=void 0;const i=r(n(898));function dedent(e){return i.default(e)}t.dedent=dedent},788:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.printJsonWithErrors=void 0;const i=r(n(815));const s=r(n(980));const o=n(646);const a=r(n(513));const u="@@__DIM_POINTER__@@";function printJsonWithErrors(e,t,n,r=[]){let s=e;for(const{path:e,type:t}of r){s=o.deepSet(s,e,t)}return a.default(s,{indent:"  ",transformLine:({indent:e,key:s,value:o,stringifiedValue:a,eol:l,path:c})=>{const f=c.join(".");const p=t.includes(f);const d=n.includes(f);const g=r.find(e=>e.path===f);let h=a;if(g){if(typeof o==="string"){h=h.slice(1,h.length-1)}const t=g.isRequired?"":"?";const n=g.isRequired?"+":"?";const r=g.isRequired?i.default.greenBright:i.default.green;let a=r(prefixLines(s+t+": "+h+l,e,n));if(!g.isRequired){a=i.default.dim(a)}return a}else{const t=r.some(e=>f.startsWith(e.path));const n=s[s.length-2]==="?";if(n){s=s.slice(1,s.length-1)}if(n&&typeof o==="object"&&o!==null){h=h.split("\n").map((e,t,n)=>t===n.length-1?e+u:e).join("\n")}if(t&&typeof o==="string"){h=h.slice(1,h.length-1);if(!n){h=i.default.bold(h)}}if((typeof o!=="object"||o===null)&&!d&&!t){h=i.default.dim(h)}const c=p?i.default.redBright(s):s;h=d?i.default.redBright(h):h;let g=e+c+": "+h+(t?l:i.default.dim(l));if(p||d){const t=g.split("\n");const n=String(s).length;const r=p?i.default.redBright("~".repeat(n)):" ".repeat(n);const u=d?getValueLength(e,s,o,a):0;const l=Boolean(d&&typeof o==="object"&&o!==null);const c=d?"  "+i.default.redBright("~".repeat(u)):"";if(r&&r.length>0&&!l){t.splice(1,0,e+r+c)}if(r&&r.length>0&&l){t.splice(t.length-1,0,e.slice(0,e.length-2)+c)}g=t.join("\n")}return g}}})}t.printJsonWithErrors=printJsonWithErrors;function getValueLength(e,t,n,r){if(n===null){return 4}if(typeof n==="string"){return n.length+2}if(typeof n==="object"){return getLongestLine(`${t}: ${s.default(r)}`)-e.length}return String(n).length}function getLongestLine(e){return e.split("\n").reduce((e,t)=>t.length>e?t.length:e,0)}function prefixLines(e,t,n){return e.split("\n").map((e,r,i)=>r===0?n+t.slice(1)+e:r<i.length-1?n+e.slice(1):e).map(e=>{return s.default(e).includes(u)?i.default.dim(e.replace(u,"")):e.includes("?")?i.default.dim(e):e}).join("\n")}},812:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(6);Object.defineProperty(t,"getPlatform",{enumerable:true,get:function(){return r.getPlatform}});Object.defineProperty(t,"getos",{enumerable:true,get:function(){return r.getos}});var i=n(49);Object.defineProperty(t,"mayBeCompatible",{enumerable:true,get:function(){return i.mayBeCompatible}});var s=n(49);Object.defineProperty(t,"platforms",{enumerable:true,get:function(){return s.platforms}})},815:function(e,t,n){"use strict";const r=n(244);const{stdout:i,stderr:s}=n(651);const{stringReplaceAll:o,stringEncaseCRLFWithFirstIndex:a}=n(494);const u=["ansi","ansi","ansi256","ansi16m"];const l=Object.create(null);const c=(e,t={})=>{if(t.level>3||t.level<0){throw new Error("The `level` option should be an integer from 0 to 3")}const n=i?i.level:0;e.level=t.level===undefined?n:t.level};class ChalkClass{constructor(e){return f(e)}}const f=e=>{const t={};c(t,e);t.template=((...e)=>b(t.template,...e));Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=(()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")});t.template.Instance=ChalkClass;return t.template};function Chalk(e){return f(e)}for(const[e,t]of Object.entries(r)){l[e]={get(){const n=h(this,g(t.open,t.close,this._styler),this._isEmpty);Object.defineProperty(this,e,{value:n});return n}}}l.visible={get(){const e=h(this,this._styler,true);Object.defineProperty(this,"visible",{value:e});return e}};const p=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of p){l[e]={get(){const{level:t}=this;return function(...n){const i=g(r.color[u[t]][e](...n),r.color.close,this._styler);return h(this,i,this._isEmpty)}}}}for(const e of p){const t="bg"+e[0].toUpperCase()+e.slice(1);l[t]={get(){const{level:t}=this;return function(...n){const i=g(r.bgColor[u[t]][e](...n),r.bgColor.close,this._styler);return h(this,i,this._isEmpty)}}}}const d=Object.defineProperties(()=>{},{...l,level:{enumerable:true,get(){return this._generator.level},set(e){this._generator.level=e}}});const g=(e,t,n)=>{let r;let i;if(n===undefined){r=e;i=t}else{r=n.openAll+e;i=t+n.closeAll}return{open:e,close:t,openAll:r,closeAll:i,parent:n}};const h=(e,t,n)=>{const r=(...e)=>{return m(r,e.length===1?""+e[0]:e.join(" "))};r.__proto__=d;r._generator=e;r._styler=t;r._isEmpty=n;return r};const m=(e,t)=>{if(e.level<=0||!t){return e._isEmpty?"":t}let n=e._styler;if(n===undefined){return t}const{openAll:r,closeAll:i}=n;if(t.indexOf("")!==-1){while(n!==undefined){t=o(t,n.close,n.open);n=n.parent}}const s=t.indexOf("\n");if(s!==-1){t=a(t,i,r,s)}return r+t+i};let y;const b=(e,...t)=>{const[r]=t;if(!Array.isArray(r)){return t.join(" ")}const i=t.slice(1);const s=[r.raw[0]];for(let e=1;e<r.length;e++){s.push(String(i[e-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[e]))}if(y===undefined){y=n(889)}return y(e,s.join(""))};Object.defineProperties(Chalk.prototype,l);const w=Chalk();w.supportsColor=i;w.stderr=Chalk({level:s?s.level:0});w.stderr.supportsColor=s;w.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};e.exports=w},846:function(e){"use strict";const t=e.exports;e.exports.default=t;const n="[";const r="]";const i="";const s=";";const o=process.env.TERM_PROGRAM==="Apple_Terminal";t.cursorTo=((e,t)=>{if(typeof e!=="number"){throw new TypeError("The `x` argument is required")}if(typeof t!=="number"){return n+(e+1)+"G"}return n+(t+1)+";"+(e+1)+"H"});t.cursorMove=((e,t)=>{if(typeof e!=="number"){throw new TypeError("The `x` argument is required")}let r="";if(e<0){r+=n+-e+"D"}else if(e>0){r+=n+e+"C"}if(t<0){r+=n+-t+"A"}else if(t>0){r+=n+t+"B"}return r});t.cursorUp=((e=1)=>n+e+"A");t.cursorDown=((e=1)=>n+e+"B");t.cursorForward=((e=1)=>n+e+"C");t.cursorBackward=((e=1)=>n+e+"D");t.cursorLeft=n+"G";t.cursorSavePosition=o?"7":n+"s";t.cursorRestorePosition=o?"8":n+"u";t.cursorGetPosition=n+"6n";t.cursorNextLine=n+"E";t.cursorPrevLine=n+"F";t.cursorHide=n+"?25l";t.cursorShow=n+"?25h";t.eraseLines=(e=>{let n="";for(let r=0;r<e;r++){n+=t.eraseLine+(r<e-1?t.cursorUp():"")}if(e){n+=t.cursorLeft}return n});t.eraseEndLine=n+"K";t.eraseStartLine=n+"1K";t.eraseLine=n+"2K";t.eraseDown=n+"J";t.eraseUp=n+"1J";t.eraseScreen=n+"2J";t.scrollUp=n+"S";t.scrollDown=n+"T";t.clearScreen="c";t.clearTerminal=process.platform==="win32"?`${t.eraseScreen}${n}0f`:`${t.eraseScreen}${n}3J${n}H`;t.beep=i;t.link=((e,t)=>{return[r,"8",s,s,t,i,e,r,"8",s,s,i].join("")});t.image=((e,t={})=>{let n=`${r}1337;File=inline=1`;if(t.width){n+=`;width=${t.width}`}if(t.height){n+=`;height=${t.height}`}if(t.preserveAspectRatio===false){n+=";preserveAspectRatio=0"}return n+":"+e.toString("base64")+i});t.iTerm={setCwd:(e=process.cwd())=>`${r}50;CurrentDir=${e}${i}`,annotation:(e,t={})=>{let n=`${r}1337;`;const s=typeof t.x!=="undefined";const o=typeof t.y!=="undefined";if((s||o)&&!(s&&o&&typeof t.length!=="undefined")){throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined")}e=e.replace(/\|/g,"");n+=t.isHidden?"AddHiddenAnnotation=":"AddAnnotation=";if(t.length>0){n+=(s?[e,t.length,t.x,t.y]:[t.length,e]).join("|")}else{n+=e}return n+i}}},863:function(e){"use strict";e.exports=((e,t=process.argv)=>{const n=e.startsWith("-")?"":e.length===1?"-":"--";const r=t.indexOf(n+e);const i=t.indexOf("--");return r!==-1&&(i===-1||r<i)})},867:function(e){e.exports=require("tty")},889:function(e){"use strict";const t=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const n=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const r=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const i=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi;const s=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){const t=e[0]==="u";const n=e[1]==="{";if(t&&!n&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}if(t&&n){return String.fromCodePoint(parseInt(e.slice(2,-1),16))}return s.get(e)||e}function parseArguments(e,t){const n=[];const s=t.trim().split(/\s*,\s*/g);let o;for(const t of s){const s=Number(t);if(!Number.isNaN(s)){n.push(s)}else if(o=t.match(r)){n.push(o[2].replace(i,(e,t,n)=>t?unescape(t):n))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return n}function parseStyle(e){n.lastIndex=0;const t=[];let r;while((r=n.exec(e))!==null){const e=r[1];if(r[2]){const n=parseArguments(e,r[2]);t.push([e].concat(n))}else{t.push([e])}}return t}function buildStyle(e,t){const n={};for(const e of t){for(const t of e.styles){n[t[0]]=e.inverse?null:t.slice(1)}}let r=e;for(const[e,t]of Object.entries(n)){if(!Array.isArray(t)){continue}if(!(e in r)){throw new Error(`Unknown Chalk style: ${e}`)}r=t.length>0?r[e](...t):r[e]}return r}e.exports=((e,n)=>{const r=[];const i=[];let s=[];n.replace(t,(t,n,o,a,u,l)=>{if(n){s.push(unescape(n))}else if(a){const t=s.join("");s=[];i.push(r.length===0?t:buildStyle(e,r)(t));r.push({inverse:o,styles:parseStyle(a)})}else if(u){if(r.length===0){throw new Error("Found extraneous } in Chalk template literal")}i.push(buildStyle(e,r)(s.join("")));s=[];r.pop()}else{s.push(l)}});i.push(s.join(""));if(r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")})},898:function(e,t,n){"use strict";const r=n(554);e.exports=(e=>{const t=r(e);if(t===0){return e}const n=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(n,"")})},901:function(e,t,n){const r=n(583);const i=n(399);const s={};const o=Object.keys(r);function wrapRaw(e){const t=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}return e(t)};if("conversion"in e){t.conversion=e.conversion}return t}function wrapRounded(e){const t=function(...t){const n=t[0];if(n===undefined||n===null){return n}if(n.length>1){t=n}const r=e(t);if(typeof r==="object"){for(let e=r.length,t=0;t<e;t++){r[t]=Math.round(r[t])}}return r};if("conversion"in e){t.conversion=e.conversion}return t}o.forEach(e=>{s[e]={};Object.defineProperty(s[e],"channels",{value:r[e].channels});Object.defineProperty(s[e],"labels",{value:r[e].labels});const t=i(e);const n=Object.keys(t);n.forEach(n=>{const r=t[n];s[e][n]=wrapRounded(r);s[e][n].raw=wrapRaw(r)})});e.exports=s},908:function(e){"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},911:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){if(r===undefined)r=n;Object.defineProperty(e,r,{enumerable:true,get:function(){return t[n]}})}:function(e,t,n,r){if(r===undefined)r=n;e[r]=t[n]});var i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))r(t,e,n);i(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});var o=n(944);Object.defineProperty(t,"DMMF",{enumerable:true,get:function(){return o.DMMF}});var a=n(373);Object.defineProperty(t,"DMMFClass",{enumerable:true,get:function(){return a.DMMFClass}});var u=n(983);Object.defineProperty(t,"makeDocument",{enumerable:true,get:function(){return u.makeDocument}});Object.defineProperty(t,"transformDocument",{enumerable:true,get:function(){return u.transformDocument}});Object.defineProperty(t,"unpack",{enumerable:true,get:function(){return u.unpack}});Object.defineProperty(t,"PrismaClientValidationError",{enumerable:true,get:function(){return u.PrismaClientValidationError}});var l=n(737);Object.defineProperty(t,"debugLib",{enumerable:true,get:function(){return l.default}});var c=n(421);Object.defineProperty(t,"Engine",{enumerable:true,get:function(){return c.Engine}});Object.defineProperty(t,"PrismaClientKnownRequestError",{enumerable:true,get:function(){return c.PrismaClientKnownRequestError}});Object.defineProperty(t,"PrismaClientUnknownRequestError",{enumerable:true,get:function(){return c.PrismaClientUnknownRequestError}});Object.defineProperty(t,"PrismaClientInitializationError",{enumerable:true,get:function(){return c.PrismaClientInitializationError}});Object.defineProperty(t,"PrismaClientRustPanicError",{enumerable:true,get:function(){return c.PrismaClientRustPanicError}});var f=n(668);Object.defineProperty(t,"getPrismaClient",{enumerable:true,get:function(){return f.getPrismaClient}});t.sqltag=s(n(380))},914:function(e){"use strict";e.exports=(e=>Object.prototype.toString.call(e)==="[object RegExp]")},944:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DMMF=void 0;var n;(function(e){let t;(function(e){e["findOne"]="findOne";e["findMany"]="findMany";e["create"]="create";e["update"]="update";e["updateMany"]="updateMany";e["upsert"]="upsert";e["delete"]="delete";e["deleteMany"]="deleteMany"})(t=e.ModelAction||(e.ModelAction={}))})(n=t.DMMF||(t.DMMF={}))},947:function(e){var t=1e3;var n=t*60;var r=n*60;var i=r*24;var s=i*7;var o=i*365.25;e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0){return parse(e)}else if(n==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var u=parseFloat(a[1]);var l=(a[2]||"ms").toLowerCase();switch(l){case"years":case"year":case"yrs":case"yr":case"y":return u*o;case"weeks":case"week":case"w":return u*s;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*r;case"minutes":case"minute":case"mins":case"min":case"m":return u*n;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return undefined}}function fmtShort(e){var s=Math.abs(e);if(s>=i){return Math.round(e/i)+"d"}if(s>=r){return Math.round(e/r)+"h"}if(s>=n){return Math.round(e/n)+"m"}if(s>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var s=Math.abs(e);if(s>=i){return plural(e,s,i,"day")}if(s>=r){return plural(e,s,r,"hour")}if(s>=n){return plural(e,s,n,"minute")}if(s>=t){return plural(e,s,t,"second")}return e+" ms"}function plural(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}},954:function(e,t,n){const r=n(867);const i=n(669);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.colors=[6,2,3,4,5,1];try{const e=n(651);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>{return/^debug_/i.test(e)}).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>{return t.toUpperCase()});let r=process.env[t];if(/^(yes|on|true|enabled)$/i.test(r)){r=true}else if(/^(no|off|false|disabled)$/i.test(r)){r=false}else if(r==="null"){r=null}else{r=Number(r)}e[n]=r;return e},{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):r.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:n,useColors:r}=this;if(r){const r=this.color;const i="[3"+(r<8?r:"8;5;"+r);const s=`  ${i};1m${n} [0m`;t[0]=s+t[0].split("\n").join("\n"+s);t.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else{t[0]=getDate()+n+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(i.format(...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++){e.inspectOpts[n[r]]=t.inspectOpts[n[r]]}}e.exports=n(133)(t);const{formatters:s}=e.exports;s.o=function(e){this.inspectOpts.colors=this.useColors;return i.inspect(e,this.inspectOpts).replace(/\s*\n\s*/g," ")};s.O=function(e){this.inspectOpts.colors=this.useColors;return i.inspect(e,this.inspectOpts)}},958:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n="<unknown>";function parse(e){var t=e.split("\n");return t.reduce(function(e,t){var n=parseChrome(t)||parseWinjs(t)||parseGecko(t)||parseNode(t)||parseJSC(t);if(n){e.push(n)}return e},[])}var r=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;var i=/\((\S*)(?::(\d+))(?::(\d+))\)/;function parseChrome(e){var t=r.exec(e);if(!t){return null}var s=t[2]&&t[2].indexOf("native")===0;var o=t[2]&&t[2].indexOf("eval")===0;var a=i.exec(t[2]);if(o&&a!=null){t[2]=a[1];t[3]=a[2];t[4]=a[3]}return{file:!s?t[2]:null,methodName:t[1]||n,arguments:s?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}var s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function parseWinjs(e){var t=s.exec(e);if(!t){return null}return{file:t[2],methodName:t[1]||n,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}}var o=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i;var a=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function parseGecko(e){var t=o.exec(e);if(!t){return null}var r=t[3]&&t[3].indexOf(" > eval")>-1;var i=a.exec(t[3]);if(r&&i!=null){t[3]=i[1];t[4]=i[2];t[5]=null}return{file:t[3],methodName:t[1]||n,arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}var u=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;function parseJSC(e){var t=u.exec(e);if(!t){return null}return{file:t[3],methodName:t[1]||n,arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}}var l=/^\s*at (?:((?:\[object object\])?[^\\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;function parseNode(e){var t=l.exec(e);if(!t){return null}return{file:t[2],methodName:t[1]||n,arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}}t.parse=parse},962:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Token=t.Prism=void 0;const r=n(623);var i={};var s=0;t.Prism={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function(e){if(e instanceof Token){const n=e;return new Token(n.type,t.Prism.util.encode(n.content),n.alias)}else if(Array.isArray(e)){return e.map(t.Prism.util.encode)}else{return 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){if(!e["__id"]){Object.defineProperty(e,"__id",{value:++s})}return e["__id"]},clone:function deepClone(e,n){var r,i,s=t.Prism.util.type(e);n=n||{};switch(s){case"Object":i=t.Prism.util.objId(e);if(n[i]){return n[i]}r={};n[i]=r;for(var o in e){if(e.hasOwnProperty(o)){r[o]=deepClone(e[o],n)}}return r;case"Array":i=t.Prism.util.objId(e);if(n[i]){return n[i]}r=[];n[i]=r;e.forEach(function(e,t){r[t]=deepClone(e,n)});return r;default:return e}}},languages:{extend:function(e,n){var r=t.Prism.util.clone(t.Prism.languages[e]);for(var i in n){r[i]=n[i]}return r},insertBefore:function(e,n,r,i){i=i||t.Prism.languages;var s=i[e];var o={};for(var a in s){if(s.hasOwnProperty(a)){if(a==n){for(var u in r){if(r.hasOwnProperty(u)){o[u]=r[u]}}}if(!r.hasOwnProperty(a)){o[a]=s[a]}}}var l=i[e];i[e]=o;t.Prism.languages.DFS(t.Prism.languages,function(t,n){if(n===l&&t!=e){this[t]=o}});return o},DFS:function DFS(e,n,r,i){i=i||{};var s=t.Prism.util.objId;for(var o in e){if(e.hasOwnProperty(o)){n.call(e,o,e[o],r||o);var a=e[o],u=t.Prism.util.type(a);if(u==="Object"&&!i[s(a)]){i[s(a)]=true;DFS(a,n,null,i)}else if(u==="Array"&&!i[s(a)]){i[s(a)]=true;DFS(a,n,o,i)}}}}},plugins:{},highlight:function(e,n,r){var i={code:e,grammar:n,language:r};t.Prism.hooks.run("before-tokenize",i);i.tokens=t.Prism.tokenize(i.code,i.grammar);t.Prism.hooks.run("after-tokenize",i);return Token.stringify(t.Prism.util.encode(i.tokens),i.language)},matchGrammar:function(e,n,r,i,s,o,a){for(var u in r){if(!r.hasOwnProperty(u)||!r[u]){continue}if(u==a){return}var l=r[u];l=t.Prism.util.type(l)==="Array"?l:[l];for(var c=0;c<l.length;++c){var f=l[c],p=f.inside,d=!!f.lookbehind,g=!!f.greedy,h=0,m=f.alias;if(g&&!f.pattern.global){var y=f.pattern.toString().match(/[imuy]*$/)[0];f.pattern=RegExp(f.pattern.source,y+"g")}f=f.pattern||f;for(var b=i,w=s;b<n.length;w+=n[b].length,++b){var _=n[b];if(n.length>e.length){return}if(_ instanceof Token){continue}if(g&&b!=n.length-1){f.lastIndex=w;var v=f.exec(e);if(!v){break}var P=v.index+(d?v[1].length:0),T=v.index+v[0].length,E=b,C=w;for(var O=n.length;E<O&&(C<T||!n[E].type&&!n[E-1].greedy);++E){C+=n[E].length;if(P>=C){++b;w=C}}if(n[b]instanceof Token){continue}$=E-b;_=e.slice(w,C);v.index-=w}else{f.lastIndex=0;var v=f.exec(_),$=1}if(!v){if(o){break}continue}if(d){h=v[1]?v[1].length:0}var P=v.index+h,v=v[0].slice(h),T=P+v.length,j=_.slice(0,P),A=_.slice(T);var S=[b,$];if(j){++b;w+=j.length;S.push(j)}var F=new Token(u,p?t.Prism.tokenize(v,p):v,m,v,g);S.push(F);if(A){S.push(A)}Array.prototype.splice.apply(n,S);if($!=1)t.Prism.matchGrammar(e,n,r,b,w,true,u);if(o)break}}}},tokenize:function(e,n){var r=[e];var i=n.rest;if(i){for(var s in i){n[s]=i[s]}delete n.rest}t.Prism.matchGrammar(e,r,n,0,0,false);return r},hooks:{all:{},add:function(e,n){var r=t.Prism.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.Prism.hooks.all[e];if(!r||!r.length){return}for(var i=0,s;s=r[i++];){s(n)}}},Token:Token};t.Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:true},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:true,greedy:true}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:true},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[\w.\\]+/i,lookbehind:true,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:/[{}[\];(),.:]/};t.Prism.languages.javascript=t.Prism.languages.extend("clike",{"class-name":[t.Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:true}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:true},{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:true}],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}/});t.Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/;t.Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^\/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:true,greedy:true},"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:true,inside:t.Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:t.Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:true,inside:t.Prism.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:true,inside:t.Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});t.Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|[^\\`])*`/,greedy:true,inside:{interpolation:{pattern:/\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:t.Prism.languages.javascript}},string:/[\s\S]+/}}});if(t.Prism.languages.markup){t.Prism.languages.markup.tag.addInlined("script","javascript")}t.Prism.languages.js=t.Prism.languages.javascript;t.Prism.languages.typescript=t.Prism.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/});t.Prism.languages.ts=t.Prism.languages.typescript;function Token(e,t,n,r,i){this.type=e;this.content=t;this.alias=n;this.length=(r||"").length|0;this.greedy=!!i}t.Token=Token;Token.stringify=function(e,t){if(typeof e=="string"){return e}if(Array.isArray(e)){return e.map(function(e){return Token.stringify(e,t)}).join("")}return getColorForSyntaxKind(e.type)(e.content)};function getColorForSyntaxKind(e){return r.theme[e]||r.identity}},975:function(e,t,n){"use strict";const r=n(846);const i=n(517);const s=(e,t,{target:n="stdout",...s}={})=>{if(!i[n]){if(s.fallback===false){return e}return typeof s.fallback==="function"?s.fallback(e,t):`${e} (​${t}​)`}return r.link(e,t)};e.exports=((e,t,n={})=>s(e,t,n));e.exports.stderr=((e,t,n={})=>s(e,t,{target:"stderr",...n}));e.exports.isSupported=i.stdout;e.exports.stderr.isSupported=i.stderr},980:function(e,t,n){"use strict";const r=n(746);e.exports=(e=>typeof e==="string"?e.replace(r(),""):e)},983:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getField=t.mapJson=t.mapDates=t.unpack=t.isInputArgType=t.selectionToFields=t.transformDocument=t.makeDocument=t.Arg=t.Args=t.Field=t.PrismaClientValidationError=t.Document=void 0;const i=r(n(815));const s=r(n(367));const o=n(50);const a=n(395);const u=n(646);const l=n(234);const c=n(532);const f=n(788);const p=n(271);const d=r(n(513));const g=n(648);const h=r(n(980));const m=n(523);const y=2;class Document{constructor(e,t){this.type=e;this.children=t;this.printFieldError=(({error:e,path:t},n,r)=>{if(e.type==="emptySelect"){const t=r?"":` Available options are listed in ${i.default.greenBright.dim("green")}.`;return`The ${i.default.redBright("`select`")} statement for type ${i.default.bold(o.getOutputTypeName(e.field.outputType.type))} must not be empty.${t}`}if(e.type==="emptyInclude"){if(n.length===0){return`${i.default.bold(o.getOutputTypeName(e.field.outputType.type))} does not have any relation and therefore can't have an ${i.default.redBright("`include`")} statement.`}const t=r?"":` Available options are listed in ${i.default.greenBright.dim("green")}.`;return`The ${i.default.redBright("`include`")} statement for type ${i.default.bold(o.getOutputTypeName(e.field.outputType.type))} must not be empty.${t}`}if(e.type==="noTrueSelect"){const t=r?"":` Available options are listed in ${i.default.greenBright.dim("green")}.`;return`The ${i.default.redBright("`select`")} statement for type ${i.default.bold(o.getOutputTypeName(e.field.outputType.type))} needs ${i.default.bold("at least one truthy value")}.`}if(e.type==="includeAndSelect"){return`Please ${i.default.bold("either")} use ${i.default.greenBright("`include`")} or ${i.default.greenBright("`select`")}, but ${i.default.redBright("not both")} at the same time.`}if(e.type==="invalidFieldName"){const t=e.isInclude?"include":"select";const s=e.isIncludeScalar?"Invalid scalar":"Unknown";const o=r?"":e.isInclude&&n.length===0?`\nThis model has no relations, so you can't use ${i.default.redBright("include")} with it.`:` Available options are listed in ${i.default.greenBright.dim("green")}.`;let a=`${s} field ${i.default.redBright(`\`${e.providedName}\``)} for ${i.default.bold(t)} statement on model ${i.default.bold.white(e.modelName)}.${o}`;if(e.didYouMean){a+=` Did you mean ${i.default.greenBright(`\`${e.didYouMean}\``)}?`}if(e.isIncludeScalar){a+=`\nNote, that ${i.default.bold("include")} statements only accept relation fields.`}return a}if(e.type==="invalidFieldType"){const t=`Invalid value ${i.default.redBright(`${d.default(e.providedValue)}`)} of type ${i.default.redBright(o.getGraphQLType(e.providedValue,undefined))} for field ${i.default.bold(`${e.fieldName}`)} on model ${i.default.bold.white(e.modelName)}. Expected either ${i.default.greenBright("true")} or ${i.default.greenBright("false")}.`;return t}});this.printArgError=(({error:e,path:t},n,r)=>{if(e.type==="invalidName"){let s=`Unknown arg ${i.default.redBright(`\`${e.providedName}\``)} in ${i.default.bold(t.join("."))} for type ${i.default.bold(e.outputType?e.outputType.name:o.getInputTypeName(e.originalType))}.`;if(e.didYouMeanField){s+=`\n→ Did you forget to wrap it with \`${i.default.greenBright("select")}\`? ${i.default.dim("e.g. "+i.default.greenBright(`{ select: { ${e.providedName}: ${e.providedValue} } }`))}`}else if(e.didYouMeanArg){s+=` Did you mean \`${i.default.greenBright(e.didYouMeanArg)}\`?`;if(!n&&!r){s+=` ${i.default.dim("Available args:")}\n`+o.stringifyInputType(e.originalType,true)}}else{if(e.originalType.fields.length===0){s+=` The field ${i.default.bold(e.originalType.name)} has no arguments.`}else if(!n&&!r){s+=` Available args:\n\n`+o.stringifyInputType(e.originalType,true)}}return s}if(e.type==="invalidType"){let t=d.default(e.providedValue,{indent:"  "});const n=t.split("\n").length>1;if(n){t=`\n${t}\n`}if(e.requiredType.bestFittingType.kind==="enum"){return`Argument ${i.default.bold(e.argName)}: Provided value ${i.default.redBright(t)}${n?"":" "}of type ${i.default.redBright(o.getGraphQLType(e.providedValue))} on ${i.default.bold(`prisma.${this.children[0].name}`)} is not a ${i.default.greenBright(o.wrapWithList(o.stringifyGraphQLType(e.requiredType.bestFittingType.kind),e.requiredType.bestFittingType.isList))}.\n→ Possible values: ${e.requiredType.bestFittingType.type.values.map(t=>i.default.greenBright(`${o.stringifyGraphQLType(e.requiredType.bestFittingType.type)}.${t}`)).join(", ")}`}let r=".";if(isInputArgType(e.requiredType.bestFittingType.type)){r=":\n"+o.stringifyInputType(e.requiredType.bestFittingType.type)}let s=`${e.requiredType.inputType.map(t=>i.default.greenBright(o.wrapWithList(o.stringifyGraphQLType(t.type),e.requiredType.bestFittingType.isList))).join(" or ")}${r}`;const a=e.requiredType.inputType.length===2&&e.requiredType.inputType.find(e=>isInputArgType(e.type))||null;if(a){s+=`\n`+o.stringifyInputType(a.type,true)}return`Argument ${i.default.bold(e.argName)}: Got invalid value ${i.default.redBright(t)}${n?"":" "}on ${i.default.bold(`prisma.${this.children[0].name}`)}. Provided ${i.default.redBright(o.getGraphQLType(e.providedValue))}, expected ${s}`}if(e.type==="invalidNullArg"){const n=t.length===1&&t[0]===e.name?"":` for ${i.default.bold(`${t.join(".")}`)}`;const r=` Please use ${i.default.bold.greenBright("undefined")} instead.`;return`Argument ${i.default.greenBright(e.name)}${n} must not be ${i.default.bold("null")}.${r}`}if(e.type==="missingArg"){const n=t.length===1&&t[0]===e.missingName?"":` for ${i.default.bold(`${t.join(".")}`)}`;return`Argument ${i.default.greenBright(e.missingName)}${n} is missing.`}if(e.type==="atLeastOne"){const n=r?"":` Available args are listed in ${i.default.dim.green("green")}.`;return`Argument ${i.default.bold(t.join("."))} of type ${i.default.bold(e.inputType.name)} needs ${i.default.greenBright("at least one")} argument.${n}`}if(e.type==="atMostOne"){const n=r?"":` Please choose one. ${i.default.dim("Available args:")} \n${o.stringifyInputType(e.inputType,true)}`;return`Argument ${i.default.bold(t.join("."))} of type ${i.default.bold(e.inputType.name)} needs ${i.default.greenBright("exactly one")} argument, but you provided ${e.providedKeys.map(e=>i.default.redBright(e)).join(" and ")}.${n}`}});this.type=e;this.children=t}toString(){return`${this.type} {\n${s.default(this.children.map(String).join("\n"),y)}\n}`}validate(e,t=false,n,r,a){if(!e){e={}}const u=this.children.filter(e=>e.hasInvalidChild||e.hasInvalidArg);if(u.length===0){return}const l=[];const c=[];const d=e&&e.select?"select":e.include?"include":undefined;for(const e of u){const n=e.collectErrors(d);l.push(...n.fieldErrors.map(e=>({...e,path:t?e.path:e.path.slice(1)})));c.push(...n.argErrors.map(e=>({...e,path:t?e.path:e.path.slice(1)})))}const g=this.children[0].name;const m=t?this.type:g;const y=[];const b=[];const w=[];for(const t of l){const n=this.normalizePath(t.path,e).join(".");if(t.error.type==="invalidFieldName"){y.push(n);const e=t.error.outputType;const{isInclude:r}=t.error;e.fields.filter(e=>r?e.outputType.kind==="object":true).forEach(e=>{const t=n.split(".");w.push({path:`${t.slice(0,t.length-1).join(".")}.${e.name}`,type:"true",isRequired:false})})}else if(t.error.type==="includeAndSelect"){y.push("select");y.push("include")}else{b.push(n)}if(t.error.type==="emptySelect"||t.error.type==="noTrueSelect"||t.error.type==="emptyInclude"){const n=this.normalizePath(t.path,e);const r=n.slice(0,n.length-1).join(".");const i=t.error.field.outputType.type;i.fields.filter(e=>t.error.type==="emptyInclude"?e.outputType.kind==="object":true).forEach(e=>{w.push({path:`${r}.${e.name}`,type:"true",isRequired:false})})}}for(const t of c){const n=this.normalizePath(t.path,e).join(".");if(t.error.type==="invalidName"){y.push(n)}else if(t.error.type!=="missingArg"&&t.error.type!=="atLeastOne"){b.push(n)}else if(t.error.type==="missingArg"){const e=t.error.missingType.length===1?t.error.missingType[0].type:t.error.missingType.map(e=>o.getInputTypeName(e.type)).join(" | ");w.push({path:n,type:o.inputTypeToJson(e,true,n.split("where.").length===2),isRequired:t.error.missingType[0].isRequired})}}const _=o=>{const a=c.some(e=>e.error.type==="missingArg"&&e.error.missingType[0].isRequired);const u=c.some(e=>e.error.type==="missingArg"&&!e.error.missingType[0].isRequired);const d=u||a;let _="";if(a){_+=`\n${i.default.dim("Note: Lines with ")}${i.default.reset.greenBright("+")} ${i.default.dim("are required")}`}if(u){if(_.length===0){_="\n"}if(a){_+=i.default.dim(`, lines with ${i.default.green("?")} are optional`)}else{_+=i.default.dim(`Note: Lines with ${i.default.green("?")} are optional`)}_+=i.default.dim(".")}const v=`${c.filter(e=>e.error.type!=="missingArg"||e.error.missingType[0].isRequired).map(e=>this.printArgError(e,d,r==="minimal")).join("\n")}\n${l.map(e=>this.printFieldError(e,w,r==="minimal")).join("\n")}`;if(r==="minimal"){return h.default(v)}const{stack:P,indent:T,afterLines:E}=p.printStack({callsite:o,originalMethod:n||m});const C=`${P}${s.default(f.printJsonWithErrors(t?{[g]:e}:e,y,b,w),T).slice(T)}${i.default.dim(E)}\n\n${v}${_}\n`;if(process.env.NO_COLOR||r==="colorless"){return h.default(C)}return C};const v=new PrismaClientValidationError(_(a));if(process.env.NODE_ENV!=="production"){Object.defineProperty(v,"render",{get:()=>_,enumerable:false})}throw v}normalizePath(e,t){const n=e.slice();const r=[];let i;let s=t;while((i=n.shift())!==undefined){if(!Array.isArray(s)&&i===0){continue}if(i==="select"){if(!s[i]){s=s.include}else{s=s[i]}}else if(s[i]){s=s[i]}r.push(i)}return r}}t.Document=Document;class PrismaClientValidationError extends Error{}t.PrismaClientValidationError=PrismaClientValidationError;class Field{constructor({name:e,args:t,children:n,error:r,schemaField:i}){this.name=e;this.args=t;this.children=n;this.error=r;this.schemaField=i;this.hasInvalidChild=n?n.some(e=>Boolean(e.error||e.hasInvalidArg||e.hasInvalidChild)):false;this.hasInvalidArg=t?t.hasInvalidArg:false}toString(){let e=this.name;if(this.error){return e+" # INVALID_FIELD"}if(this.args&&this.args.args&&this.args.args.length>0){if(this.args.args.length===1){e+=`(${this.args.toString()})`}else{e+=`(\n${s.default(this.args.toString(),y)}\n)`}}if(this.children){e+=` {\n${s.default(this.children.map(String).join("\n"),y)}\n}`}return e}collectErrors(e="select"){const t=[];const n=[];if(this.error){t.push({path:[this.name],error:this.error})}if(this.children){for(const r of this.children){const i=r.collectErrors(e);t.push(...i.fieldErrors.map(t=>({...t,path:[this.name,e,...t.path]})));n.push(...i.argErrors.map(t=>({...t,path:[this.name,e,...t.path]})))}}if(this.args){n.push(...this.args.collectErrors().map(e=>({...e,path:[this.name,...e.path]})))}return{fieldErrors:t,argErrors:n}}}t.Field=Field;class Args{constructor(e=[]){this.args=e;this.hasInvalidArg=e?e.some(e=>Boolean(e.hasError)):false}toString(){if(this.args.length===0){return""}return`${this.args.map(e=>e.toString()).filter(e=>e).join("\n")}`}collectErrors(){if(!this.hasInvalidArg){return[]}return m.flatMap(this.args,e=>e.collectErrors())}}t.Args=Args;function stringify(e,t,n,r,i){if(i){if(e.values&&e.__prismaRawParamaters__){return JSON.stringify(e.values)}return JSON.stringify(JSON.stringify(e))}if(e===undefined){return null}if(e===null){return"null"}if(r&&typeof e==="string"){return e}if(r&&Array.isArray(e)){return`[${e.join(", ")}]`}return JSON.stringify(e,t,n)}class Arg{constructor({key:e,value:t,argType:n,isEnum:r=false,error:i,schemaArg:s}){this.key=e;this.value=t;this.argType=n;this.isEnum=r;this.error=i;this.schemaArg=s;this.isNullable=(s===null||s===void 0?void 0:s.inputType.reduce((e,t)=>e&&t.isNullable,true))||false;this.hasError=Boolean(i)||(t instanceof Args?t.hasInvalidArg:false)||Array.isArray(t)&&t.some(e=>e instanceof Args?e.hasInvalidArg:false)}_toString(e,t){if(typeof e==="undefined"){return undefined}if(e instanceof Args){return`${t}: {\n${s.default(e.toString(),2)}\n}`}if(Array.isArray(e)){const n=!e.some(e=>typeof e==="object");return`${t}: [${n?"":"\n"}${s.default(e.map(e=>{if(e instanceof Args){return`{\n${s.default(e.toString(),y)}\n}`}return stringify(e,null,2,this.isEnum)}).join(`,${n?" ":"\n"}`),n?0:y)}${n?"":"\n"}]`}return`${t}: ${stringify(e,null,2,this.isEnum,this.argType==="Json")}`}toString(){return this._toString(this.value,this.key)}collectErrors(){if(!this.hasError){return[]}const e=[];if(this.error){e.push({error:this.error,path:[this.key]})}if(Array.isArray(this.value)){e.push(...m.flatMap(this.value,(e,t)=>{if(!e.collectErrors){return[]}return e.collectErrors().map(e=>{return{...e,path:[this.key,t,...e.path]}})}))}if(this.value instanceof Args){e.push(...this.value.collectErrors().map(e=>({...e,path:[this.key,...e.path]})))}return e}}t.Arg=Arg;function makeDocument({dmmf:e,rootTypeName:t,rootField:n,select:r}){if(!r){r={}}const i=t==="query"?e.queryType:e.mutationType;const s={args:[],outputType:{isList:false,isRequired:true,type:i,kind:"object"},name:t};const o=selectionToFields(e,{[n]:r},s,[t]);return new Document(t,o)}t.makeDocument=makeDocument;function transformDocument(e){function transformWhereArgs(e){return new Args(m.flatMap(e.args,e=>{if(isArgsArray(e.value)){const t=e.value.map(e=>{return transformWhereArgs(e)});return[new Arg({...e,value:t})]}else if(e.value instanceof Args){if(e.schemaArg&&!e.schemaArg.isRelationFilter){return e.value.args.map(t=>{return new Arg({key:getFilterArgName(e.key,t.key),value:t.value,argType:u.deepGet(e,["value","args","0","argType"]),schemaArg:t.schemaArg})})}}return[e]}))}function transformOrderArg(e){if(e.value instanceof Args){const t=e.value.args[0];if(t&&t.value){return new Arg({...e,isEnum:true,value:`${t.key}_${t.value.toString().toUpperCase()}`})}}return e}return g.visit(e,{Arg:{enter(e){const{argType:t,schemaArg:n}=e;if(!t){return undefined}if(isInputArgType(t)){if(t.isOrderType){return transformOrderArg(e)}if(t.isWhereType&&n){let t=e.value;if(isArgsArray(e.value)){t=e.value.map(e=>transformWhereArgs(e))}else if(e.value instanceof Args){t=transformWhereArgs(e.value)}return new Arg({...e,value:t})}}return undefined}}})}t.transformDocument=transformDocument;function isArgsArray(e){if(Array.isArray(e)){return e.every(e=>e instanceof Args)}return false}function getFilterArgName(e,t){if(t==="equals"){return e}return`${e}_${convertToSnakeCase(t)}`}function convertToSnakeCase(e){return e.split(/(?=[A-Z])/).join("_").toLowerCase()}function selectionToFields(e,t,n,r){const i=n.outputType.type;return Object.entries(t).reduce((t,[n,s])=>{const u=i.fields.find(e=>e.name===n);if(!u){t.push(new Field({name:n,children:[],error:{type:"invalidFieldName",modelName:i.name,providedName:n,didYouMean:o.getSuggestion(n,i.fields.map(e=>e.name)),outputType:i}}));return t}if(typeof s!=="boolean"&&u.outputType.kind==="scalar"&&u.name!=="executeRaw"&&i.name!=="Query"&&!n.startsWith("aggregate")&&u.name!=="count"){t.push(new Field({name:n,children:[],error:{type:"invalidFieldType",modelName:i.name,fieldName:n,providedValue:s}}));return t}if(s===false){return t}const l={name:u.name,fields:u.args};const f=typeof s==="object"?c.omit(s,["include","select"]):undefined;const p=f?objectToArgs(f,l,[],typeof u==="string"?undefined:u.outputType.type):undefined;const d=u.outputType.kind==="object";if(s){if(s.select&&s.include){t.push(new Field({name:n,children:[new Field({name:"include",args:new Args,error:{type:"includeAndSelect",field:u}})]}))}else if(s.include){const e=Object.keys(s.include);if(e.length===0){t.push(new Field({name:n,children:[new Field({name:"include",args:new Args,error:{type:"emptyInclude",field:u}})]}));return t}if(u.outputType.kind==="object"){const n=u.outputType.type;const r=n.fields.filter(e=>e.outputType.kind==="object").map(e=>e.name);const i=e.filter(e=>!r.includes(e));if(i.length>0){t.push(...i.map(e=>new Field({name:e,children:[new Field({name:e,args:new Args,error:{type:"invalidFieldName",modelName:n.name,outputType:n,providedName:e,didYouMean:o.getSuggestion(e,r)||undefined,isInclude:true,isIncludeScalar:n.fields.some(t=>t.name===e)}})]})));return t}}}else if(s.select){const e=Object.values(s.select);if(e.length===0){t.push(new Field({name:n,children:[new Field({name:"select",args:new Args,error:{type:"emptySelect",field:u}})]}));return t}const r=e.filter(e=>e);if(r.length===0){t.push(new Field({name:n,children:[new Field({name:"select",args:new Args,error:{type:"noTrueSelect",field:u}})]}));return t}}}const g=d?getDefaultSelection(u.outputType.type):null;let h=g;if(s){if(s.select){h=s.select}else if(s.include){h=a.deepExtend(g,s.include)}}const m=h!==false&&d?selectionToFields(e,h,u,[...r,n]):undefined;t.push(new Field({name:n,args:p,children:m,schemaField:u}));return t},[])}t.selectionToFields=selectionToFields;function getDefaultSelection(e){return e.fields.reduce((e,t)=>{if(t.outputType.kind==="scalar"||t.outputType.kind==="enum"){e[t.name]=true}else{if(t.outputType.type.isEmbedded){e[t.name]={select:getDefaultSelection(t.outputType.type)}}}return e},{})}function getInvalidTypeArg(e,t,n,r){const i=new Arg({key:e,value:t,isEnum:r.kind==="enum",argType:r.type,error:{type:"invalidType",providedValue:t,argName:e,requiredType:{inputType:n.inputType,bestFittingType:r}}});return i}function hasCorrectScalarType(e,t,n){const{type:r}=n;const i=t.inputType[0].isList;const s=o.wrapWithList(o.stringifyGraphQLType(r),i);const a=o.getGraphQLType(e,r);if(i&&a==="List<>"){return true}if(s==="Json"){return true}if(a==="DateTime"&&s==="String"){return true}if(a==="List<DateTime>"&&s==="List<String>"){return true}if(a==="UUID"&&s==="String"){return true}if(a==="List<UUID>"&&s==="List<String>"){return true}if(a==="String"&&s==="ID"){return true}if(a==="List<String>"&&s==="List<ID>"){return true}if(a==="Int"&&s==="Float"){return true}if(a==="List<Int>"&&s==="List<Float>"){return true}if(a==="Int"&&s==="Long"){return true}if(a==="List<Int>"&&s==="List<Long>"){return true}if(a===s){return true}if(!n.isRequired&&e===null){return true}return false}const b=e=>l.filterObject(e,(e,t)=>t!==undefined);function valueToArg(e,t,n){const r=n.inputType[0];if(typeof t==="undefined"){if(!r.isRequired){return null}return new Arg({key:e,value:t,isEnum:r.kind==="enum",error:{type:"missingArg",missingName:e,missingType:n.inputType,atLeastOne:false,atMostOne:false}})}if(t===null&&n.inputType.length===1){const e=n.inputType[0];if(isInputArgType(e.type)&&e.type.isOrderType){return null}}const i=n.inputType[0].isNullable||(n.inputType.length>1?n.inputType[1].isNullable:false);const s=n.inputType[0].isRequired||(n.inputType.length>1?n.inputType[1].isRequired:false);if(t===null&&!i&&!s){const i=isInputArgType(n.inputType[0].type)?n.inputType[0].type.atLeastOne:false;if(!i){return new Arg({key:e,value:t,isEnum:r.kind==="enum",error:{type:"invalidNullArg",name:e,invalidType:n.inputType,atLeastOne:false,atMostOne:false}})}}if(!r.isList){const i=n.inputType.map(i=>{if(isInputArgType(i.type)){if(typeof t!=="object"){return getInvalidTypeArg(e,t,n,i)}else{let s=b(t);if(i.type.isWhereType&&s){for(const e of i.type.fields){if(e.nullEqualsUndefined&&s[e.name]===null){delete s[e.name]}}}if(i.type.isOrderType){s=l.filterObject(s,(e,t)=>t!==null)}let o;const a=Object.keys(s||{});const u=a.length;if(u===0&&i.type.atLeastOne){o={type:"atLeastOne",key:e,inputType:i.type}}if(u>1&&i.type.atMostOne){o={type:"atMostOne",key:e,inputType:i.type,providedKeys:a}}return new Arg({key:e,value:s===null?null:objectToArgs(s,i.type,n.inputType),isEnum:r.kind==="enum",error:o,argType:i.type,schemaArg:n})}}else{return scalarToArg(e,t,n,i)}});if(i.length===1){return i[0]}const s=i.find(e=>!e.hasError);if(s){return s}const o=(e,t)=>{if(t===null&&(e==="null"||!isInputArgType(e))){return true}return isInputArgType(e)?typeof t==="object":typeof t!=="object"};if(i.length>1){const e=i.filter(e=>o(e.argType,t));const n=e.length>0?e:i;const r=n.reduce((e,t)=>{const n=t.collectErrors().length;if(n<e.numErrors){return{arg:t,numErrors:n}}return e},{arg:null,numErrors:Infinity});return r.arg}}if(n.inputType.length>1){throw new Error(`List types with union input types are not supported`)}if(!Array.isArray(t)){t=[t]}if(r.kind==="enum"||r.kind==="scalar"){return scalarToArg(e,t,n,r)}const o=r.type;const a=o.atLeastOne?t.some(e=>!e||Object.keys(b(e)).length===0):false;const u=a?{inputType:o,key:e,type:"atLeastOne"}:undefined;return new Arg({key:e,value:t.map(i=>{if(typeof i!=="object"||!t){return getInvalidTypeArg(e,i,n,r)}return objectToArgs(i,r.type)}),isEnum:false,argType:r.type,schemaArg:n,error:u})}function isInputArgType(e){if(typeof e==="string"){return false}if(e.hasOwnProperty("values")){return false}return true}t.isInputArgType=isInputArgType;function scalarToArg(e,t,n,r){if(hasCorrectScalarType(t,n,r)){return new Arg({key:e,value:t,isEnum:n.inputType[0].kind==="enum",argType:r.type,schemaArg:n})}return getInvalidTypeArg(e,t,n,r)}function objectToArgs(e,t,n,r){const i=b(e);const{fields:s}=t;const a=s.filter(e=>e.inputType.some(e=>e.isRequired)).map(e=>[e.name,undefined]);const u=o.unionBy(Object.entries(i||{}),a,e=>e[0]);const l=u.reduce((e,[i,a])=>{const u=s.find(e=>e.name===i);if(!u){const u=typeof a==="boolean"&&r&&r.fields.some(e=>e.name===i)?i:null;e.push(new Arg({key:i,value:a,error:{type:"invalidName",providedName:i,providedValue:a,didYouMeanField:u,didYouMeanArg:!u&&o.getSuggestion(i,[...s.map(e=>e.name),"select"])||undefined,originalType:t,possibilities:n,outputType:r}}));return e}const l=valueToArg(i,a,u);if(l){e.push(l)}return e},[]);if(u.length===0&&t.atLeastOne||l.find(e=>e.error&&e.error.type==="missingArg")){const e=t.fields.filter(e=>!u.some(([t])=>t===e.name));l.push(...e.map(e=>{const n=e.inputType[0];return new Arg({key:e.name,value:undefined,isEnum:n.kind==="enum",error:{type:"missingArg",missingName:e.name,missingType:e.inputType,atLeastOne:t.atLeastOne||false,atMostOne:t.atMostOne||false}})}))}return new Args(l)}function unpack({document:e,path:t,data:n}){const r=u.deepGet(n,t);if(r==="undefined"){return null}if(typeof r!=="object"){return r}const i=getField(e,t);const s=mapDates({field:i,data:r});return mapJson({field:i,data:s})}t.unpack=unpack;function mapDates({field:e,data:t}){if(!t||typeof t!=="object"||!e.children||!e.schemaField){return t}for(const n of e.children){if(n.schemaField&&n.schemaField.outputType.type==="DateTime"){if(Array.isArray(t)){for(const e of t){if(typeof e[n.name]!=="undefined"){e[n.name]=e[n.name]?new Date(e[n.name]):e[n.name]}}}else{if(typeof t[n.name]!=="undefined"){t[n.name]=t[n.name]?new Date(t[n.name]):t[n.name]}}}if(n.schemaField&&n.schemaField.outputType.kind==="object"){if(Array.isArray(t)){t.forEach(e=>mapDates({field:n,data:e[n.name]}))}else{mapDates({field:n,data:t[n.name]})}}}return t}t.mapDates=mapDates;function mapJson({field:e,data:t}){if(!t||typeof t!=="object"||!e.children||!e.schemaField){return t}for(const n of e.children){if(n.schemaField&&n.schemaField.outputType.type==="Json"){if(Array.isArray(t)){for(const e of t){if(typeof e[n.name]!=="undefined"){e[n.name]=e[n.name]?JSON.parse(e[n.name]):e[n.name]}}}else{if(typeof t[n.name]!=="undefined"){t[n.name]=t[n.name]?JSON.parse(t[n.name]):t[n.name]}}}if(n.schemaField&&n.schemaField.outputType.kind==="object"){if(Array.isArray(t)){t.forEach(e=>mapJson({field:n,data:e[n.name]}))}else{mapJson({field:n,data:t[n.name]})}}}return t}t.mapJson=mapJson;function getField(e,t){const n=t.slice();const r=n.shift();let i=e.children.find(e=>e.name===r);if(!i){throw new Error(`Could not find field ${r} in document ${e}`)}while(n.length>0){const e=n.shift();if(!i.children){throw new Error(`Can't get children for field ${i} with child ${e}`)}const t=i.children.find(t=>t.name===e);if(!t){throw new Error(`Can't find child ${e} of field ${i}`)}i=t}return i}t.getField=getField}},function(e){"use strict";!function(){e.nmd=function(e){e.paths=[];if(!e.children)e.children=[];Object.defineProperty(e,"loaded",{enumerable:true,get:function(){return e.l}});Object.defineProperty(e,"id",{enumerable:true,get:function(){return e.i}});return e}}()});
  //# sourceMappingURL=index.js.map