prisma
Version:
Prisma is an open-source database toolkit. It includes a JavaScript/TypeScript ORM for Node.js, migrations and a modern GUI to view and edit the data in your database. You can use Prisma in new projects or add it to an existing one.
13 lines (12 loc) • 229 kB
JavaScript
"use strict";var Iu=Object.create;var Zr=Object.defineProperty;var ku=Object.getOwnPropertyDescriptor;var Ou=Object.getOwnPropertyNames;var Du=Object.getPrototypeOf,Nu=Object.prototype.hasOwnProperty;var zo=(e,t)=>()=>(e&&(t=e(e=0)),t);var Z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t)=>{for(var r in t)Zr(e,r,{get:t[r],enumerable:!0})},Yo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ou(t))!Nu.call(e,i)&&i!==r&&Zr(e,i,{get:()=>t[i],enumerable:!(n=ku(t,i))||n.enumerable});return e};var H=(e,t,r)=>(r=e!=null?Iu(Du(e)):{},Yo(t||!e||!e.__esModule?Zr(r,"default",{value:e,enumerable:!0}):r,e)),_u=e=>Yo(Zr({},"__esModule",{value:!0}),e);var ps=Z((Iy,rp)=>{rp.exports={name:"@prisma/internals",version:"6.16.3",description:"This package is intended for Prisma's internal use",main:"dist/index.js",types:"dist/index.d.ts",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/internals"},homepage:"https://www.prisma.io",author:"Tim Suchanek <suchanek@prisma.io>",bugs:"https://github.com/prisma/prisma/issues",license:"Apache-2.0",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",test:"dotenv -e ../../.db.env -- jest --silent",prepublishOnly:"pnpm run build"},files:["README.md","dist","!**/libquery_engine*","!dist/get-generators/engines/*","scripts"],devDependencies:{"@babel/helper-validator-identifier":"7.25.9","@opentelemetry/api":"1.9.0","@swc/core":"1.11.5","@swc/jest":"0.2.37","@types/babel__helper-validator-identifier":"7.15.2","@types/jest":"29.5.14","@types/node":"18.19.76","@types/resolve":"1.20.6",archiver:"6.0.2","checkpoint-client":"1.1.33","cli-truncate":"4.0.0",dotenv:"16.5.0",empathic:"2.0.0","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-directory":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/driver-adapter-utils":"workspace:*","@prisma/engines":"workspace:*","@prisma/fetch-engine":"workspace:*","@prisma/generator":"workspace:*","@prisma/generator-helper":"workspace:*","@prisma/get-platform":"workspace:*","@prisma/prisma-schema-wasm":"6.16.1-1.bb420e667c1820a8c05a38023385f6cc7ef8e83a","@prisma/schema-engine-wasm":"6.16.1-1.bb420e667c1820a8c05a38023385f6cc7ef8e83a","@prisma/schema-files-loader":"workspace:*",arg:"5.0.2",prompts:"2.4.2"},peerDependencies:{typescript:">=5.1.0"},peerDependenciesMeta:{typescript:{optional:!0}},sideEffects:!1}});var Ei=Z((Vy,sp)=>{sp.exports={name:"@prisma/engines-version",version:"6.16.1-1.bb420e667c1820a8c05a38023385f6cc7ef8e83a",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"bb420e667c1820a8c05a38023385f6cc7ef8e83a"},repository:{type:"git",url:"https://github.com/prisma/engines-wrapper.git",directory:"packages/engines-version"},devDependencies:{"@types/node":"18.19.76",typescript:"4.9.5"},files:["index.js","index.d.ts"],scripts:{build:"tsc -d"}}});var ds=Z(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.enginesVersion=void 0;tn.enginesVersion=Ei().prisma.enginesVersion});var fs=Z((Uy,ms)=>{"use strict";ms.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var ws=Z((Qy,hs)=>{"use strict";hs.exports=(e,t=1,r)=>{if(r={indent:" ",includeEmptyLines:!1,...r},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof r.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r.indent}\``);if(t===0)return e;let n=r.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(n,r.indent.repeat(t))}});var xs=Z((Yy,dp)=>{dp.exports={name:"dotenv",version:"16.5.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var As=Z((Zy,ke)=>{"use strict";var Ai=require("node:fs"),Ci=require("node:path"),mp=require("node:os"),fp=require("node:crypto"),gp=xs(),Ps=gp.version,yp=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function hp(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
`);let n;for(;(n=yp.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function wp(e){let t=Ts(e),r=B.configDotenv({path:t});if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=vs(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=xp(r,a);o=B.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return B.parse(o)}function Ep(e){console.log(`[dotenv@${Ps}][WARN] ${e}`)}function rr(e){console.log(`[dotenv@${Ps}][DEBUG] ${e}`)}function vs(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function xp(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let l=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw l.code="INVALID_DOTENV_KEY",l}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function Ts(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Ai.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Ci.resolve(process.cwd(),".env.vault");return Ai.existsSync(t)?t:null}function bs(e){return e[0]==="~"?Ci.join(mp.homedir(),e.slice(1)):e}function bp(e){!!(e&&e.debug)&&rr("Loading env from encrypted .env.vault");let r=B._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),B.populate(n,r,e),{parsed:r}}function Pp(e){let t=Ci.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&rr("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[bs(e.path)];else{i=[];for(let l of e.path)i.push(bs(l))}let o,s={};for(let l of i)try{let c=B.parse(Ai.readFileSync(l,{encoding:r}));B.populate(s,c,e)}catch(c){n&&rr(`Failed to load ${l} ${c.message}`),o=c}let a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),B.populate(a,s,e),o?{parsed:s,error:o}:{parsed:s}}function vp(e){if(vs(e).length===0)return B.configDotenv(e);let t=Ts(e);return t?B._configVault(e):(Ep(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),B.configDotenv(e))}function Tp(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=fp.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",c=s.message==="Unsupported state or unable to authenticate data";if(a||l){let u=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw u.code="INVALID_DOTENV_KEY",u}else if(c){let u=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw u.code="DECRYPTION_FAILED",u}else throw s}}function Ap(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override);if(typeof t!="object"){let o=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw o.code="OBJECT_REQUIRED",o}for(let o of Object.keys(t))Object.prototype.hasOwnProperty.call(e,o)?(i===!0&&(e[o]=t[o]),n&&rr(i===!0?`"${o}" is already defined and WAS overwritten`:`"${o}" is already defined and was NOT overwritten`)):e[o]=t[o]}var B={configDotenv:Pp,_configVault:bp,_parseVault:wp,config:vp,decrypt:Tp,parse:hp,populate:Ap};ke.exports.configDotenv=B.configDotenv;ke.exports._configVault=B._configVault;ke.exports._parseVault=B._parseVault;ke.exports.config=B.config;ke.exports.decrypt=B.decrypt;ke.exports.parse=B.parse;ke.exports.populate=B.populate;ke.exports=B});var Is=Z((ih,sn)=>{"use strict";sn.exports=(e={})=>{let t;if(e.repoUrl)t=e.repoUrl;else if(e.user&&e.repo)t=`https://github.com/${e.user}/${e.repo}`;else throw new Error("You need to specify either the `repoUrl` option or both the `user` and `repo` options");let r=new URL(`${t}/issues/new`),n=["body","title","labels","template","milestone","assignee","projects"];for(let i of n){let o=e[i];if(o!==void 0){if(i==="labels"||i==="projects"){if(!Array.isArray(o))throw new TypeError(`The \`${i}\` option should be an array`);o=o.join(",")}r.searchParams.set(i,o)}}return r.toString()};sn.exports.default=sn.exports});var Li=Z((kw,Xs)=>{"use strict";Xs.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,c,u,p,d,m,y,g,I,A,C,w,k=[];for(l=0;l<i;l++)k.push(l+1),k.push(t.charCodeAt(s+l));for(var fe=k.length-1;a<o-3;)for(I=r.charCodeAt(s+(c=a)),A=r.charCodeAt(s+(u=a+1)),C=r.charCodeAt(s+(p=a+2)),w=r.charCodeAt(s+(d=a+3)),m=a+=4,l=0;l<fe;l+=2)y=k[l],g=k[l+1],c=e(y,c,u,I,g),u=e(c,u,p,A,g),p=e(u,p,d,C,g),m=e(p,d,m,w,g),k[l]=m,d=p,p=u,u=c,c=y;for(;a<o;)for(I=r.charCodeAt(s+(c=a)),m=++a,l=0;l<fe;l+=2)y=k[l],k[l]=m=e(y,c,m,I,k[l+1]),c=y;return m}}()});var ia=zo(()=>{"use strict"});var oa=zo(()=>{"use strict"});var lo=Z(et=>{"use strict";Object.defineProperty(et,"__esModule",{value:!0});et.anumber=ao;et.abytes=Al;et.ahash=ff;et.aexists=gf;et.aoutput=yf;function ao(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function mf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Al(e,...t){if(!mf(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ff(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");ao(e.outputLen),ao(e.blockLen)}function gf(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function yf(e,t){Al(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Jl=Z(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.add5L=v.add5H=v.add4H=v.add4L=v.add3H=v.add3L=v.rotlBL=v.rotlBH=v.rotlSL=v.rotlSH=v.rotr32L=v.rotr32H=v.rotrBL=v.rotrBH=v.rotrSL=v.rotrSH=v.shrSL=v.shrSH=v.toBig=void 0;v.fromBig=uo;v.split=Cl;v.add=ql;var Bn=BigInt(2**32-1),co=BigInt(32);function uo(e,t=!1){return t?{h:Number(e&Bn),l:Number(e>>co&Bn)}:{h:Number(e>>co&Bn)|0,l:Number(e&Bn)|0}}function Cl(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=uo(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var Rl=(e,t)=>BigInt(e>>>0)<<co|BigInt(t>>>0);v.toBig=Rl;var Sl=(e,t,r)=>e>>>r;v.shrSH=Sl;var Il=(e,t,r)=>e<<32-r|t>>>r;v.shrSL=Il;var kl=(e,t,r)=>e>>>r|t<<32-r;v.rotrSH=kl;var Ol=(e,t,r)=>e<<32-r|t>>>r;v.rotrSL=Ol;var Dl=(e,t,r)=>e<<64-r|t>>>r-32;v.rotrBH=Dl;var Nl=(e,t,r)=>e>>>r-32|t<<64-r;v.rotrBL=Nl;var _l=(e,t)=>t;v.rotr32H=_l;var Ml=(e,t)=>e;v.rotr32L=Ml;var Fl=(e,t,r)=>e<<r|t>>>32-r;v.rotlSH=Fl;var Ll=(e,t,r)=>t<<r|e>>>32-r;v.rotlSL=Ll;var $l=(e,t,r)=>t<<r-32|e>>>64-r;v.rotlBH=$l;var Vl=(e,t,r)=>e<<r-32|t>>>64-r;v.rotlBL=Vl;function ql(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Ul=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);v.add3L=Ul;var jl=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;v.add3H=jl;var Bl=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);v.add4L=Bl;var Ql=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;v.add4H=Ql;var Hl=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);v.add5L=Hl;var Gl=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;v.add5H=Gl;var hf={fromBig:uo,split:Cl,toBig:Rl,shrSH:Sl,shrSL:Il,rotrSH:kl,rotrSL:Ol,rotrBH:Dl,rotrBL:Nl,rotr32H:_l,rotr32L:Ml,rotlSH:Fl,rotlSL:Ll,rotlBH:$l,rotlBL:Vl,add:ql,add3L:Ul,add3H:jl,add4L:Bl,add4H:Ql,add5H:Gl,add5L:Hl};v.default=hf});var Wl=Z(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.crypto=void 0;var He=require("node:crypto");Qn.crypto=He&&typeof He=="object"&&"webcrypto"in He?He.webcrypto:He&&typeof He=="object"&&"randomBytes"in He?He:void 0});var Yl=Z(S=>{"use strict";Object.defineProperty(S,"__esModule",{value:!0});S.Hash=S.nextTick=S.byteSwapIfBE=S.isLE=void 0;S.isBytes=wf;S.u8=Ef;S.u32=xf;S.createView=bf;S.rotr=Pf;S.rotl=vf;S.byteSwap=fo;S.byteSwap32=Tf;S.bytesToHex=Cf;S.hexToBytes=Rf;S.asyncLoop=If;S.utf8ToBytes=zl;S.toBytes=Hn;S.concatBytes=kf;S.checkOpts=Of;S.wrapConstructor=Df;S.wrapConstructorWithOpts=Nf;S.wrapXOFConstructorWithOpts=_f;S.randomBytes=Mf;var Nt=Wl(),mo=lo();function wf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ef(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function xf(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function bf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Pf(e,t){return e<<32-t|e>>>t}function vf(e,t){return e<<t|e>>>32-t>>>0}S.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function fo(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}S.byteSwapIfBE=S.isLE?e=>e:e=>fo(e);function Tf(e){for(let t=0;t<e.length;t++)e[t]=fo(e[t])}var Af=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Cf(e){(0,mo.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=Af[e[r]];return t}var _e={_0:48,_9:57,A:65,F:70,a:97,f:102};function Kl(e){if(e>=_e._0&&e<=_e._9)return e-_e._0;if(e>=_e.A&&e<=_e.F)return e-(_e.A-10);if(e>=_e.a&&e<=_e.f)return e-(_e.a-10)}function Rf(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){let s=Kl(e.charCodeAt(o)),a=Kl(e.charCodeAt(o+1));if(s===void 0||a===void 0){let l=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}n[i]=s*16+a}return n}var Sf=async()=>{};S.nextTick=Sf;async function If(e,t,r){let n=Date.now();for(let i=0;i<e;i++){r(i);let o=Date.now()-n;o>=0&&o<t||(await(0,S.nextTick)(),n+=o)}}function zl(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Hn(e){return typeof e=="string"&&(e=zl(e)),(0,mo.abytes)(e),e}function kf(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,mo.abytes)(i),t+=i.length}let r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){let o=e[n];r.set(o,i),i+=o.length}return r}var po=class{clone(){return this._cloneInto()}};S.Hash=po;function Of(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(e,t)}function Df(e){let t=n=>e().update(Hn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Nf(e){let t=(n,i)=>e(i).update(Hn(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function _f(e){let t=(n,i)=>e(i).update(Hn(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Mf(e=32){if(Nt.crypto&&typeof Nt.crypto.getRandomValues=="function")return Nt.crypto.getRandomValues(new Uint8Array(e));if(Nt.crypto&&typeof Nt.crypto.randomBytes=="function")return Nt.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var oc=Z(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.shake256=V.shake128=V.keccak_512=V.keccak_384=V.keccak_256=V.keccak_224=V.sha3_512=V.sha3_384=V.sha3_256=V.sha3_224=V.Keccak=void 0;V.keccakP=nc;var _t=lo(),Ar=Jl(),Me=Yl(),ec=[],tc=[],rc=[],Ff=BigInt(0),Tr=BigInt(1),Lf=BigInt(2),$f=BigInt(7),Vf=BigInt(256),qf=BigInt(113);for(let e=0,t=Tr,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],ec.push(2*(5*n+r)),tc.push((e+1)*(e+2)/2%64);let i=Ff;for(let o=0;o<7;o++)t=(t<<Tr^(t>>$f)*qf)%Vf,t&Lf&&(i^=Tr<<(Tr<<BigInt(o))-Tr);rc.push(i)}var[Uf,jf]=(0,Ar.split)(rc,!0),Zl=(e,t,r)=>r>32?(0,Ar.rotlBH)(e,t,r):(0,Ar.rotlSH)(e,t,r),Xl=(e,t,r)=>r>32?(0,Ar.rotlBL)(e,t,r):(0,Ar.rotlSL)(e,t,r);function nc(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,c=r[l],u=r[l+1],p=Zl(c,u,1)^r[a],d=Xl(c,u,1)^r[a+1];for(let m=0;m<50;m+=10)e[s+m]^=p,e[s+m+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=tc[s],l=Zl(i,o,a),c=Xl(i,o,a),u=ec[s];i=e[u],o=e[u+1],e[u]=l,e[u+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Uf[n],e[1]^=jf[n]}r.fill(0)}var Cr=class e extends Me.Hash{constructor(t,r,n,i=!1,o=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,_t.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,Me.u32)(this.state)}keccak(){Me.isLE||(0,Me.byteSwap32)(this.state32),nc(this.state32,this.rounds),Me.isLE||(0,Me.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,_t.aexists)(this);let{blockLen:r,state:n}=this;t=(0,Me.toBytes)(t);let i=t.length;for(let o=0;o<i;){let s=Math.min(r-this.pos,i-o);for(let a=0;a<s;a++)n[this.pos++]^=t[o++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:i}=this;t[n]^=r,(r&128)!==0&&n===i-1&&this.keccak(),t[i-1]^=128,this.keccak()}writeInto(t){(0,_t.aexists)(this,!1),(0,_t.abytes)(t),this.finish();let r=this.state,{blockLen:n}=this;for(let i=0,o=t.length;i<o;){this.posOut>=n&&this.keccak();let s=Math.min(n-this.posOut,o-i);t.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return(0,_t.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,_t.aoutput)(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:i,rounds:o,enableXOF:s}=this;return t||(t=new e(r,n,i,s,o)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=i,t.enableXOF=s,t.destroyed=this.destroyed,t}};V.Keccak=Cr;var Ge=(e,t,r)=>(0,Me.wrapConstructor)(()=>new Cr(t,e,r));V.sha3_224=Ge(6,144,224/8);V.sha3_256=Ge(6,136,256/8);V.sha3_384=Ge(6,104,384/8);V.sha3_512=Ge(6,72,512/8);V.keccak_224=Ge(1,144,224/8);V.keccak_256=Ge(1,136,256/8);V.keccak_384=Ge(1,104,384/8);V.keccak_512=Ge(1,72,512/8);var ic=(e,t,r)=>(0,Me.wrapXOFConstructorWithOpts)((n={})=>new Cr(t,e,n.dkLen===void 0?r:n.dkLen,!0));V.shake128=ic(31,168,128/8);V.shake256=ic(31,136,256/8)});var mc=Z((LP,Je)=>{"use strict";var{sha3_512:Bf}=oc(),ac=24,Rr=32,go=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function lc(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var cc=(e="")=>lc(Bf(e)).toString(36).slice(1),sc=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),Qf=e=>sc[Math.floor(e()*sc.length)],uc=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+go(Rr,t):go(Rr,t);return cc(n).substring(0,Rr)},pc=e=>()=>e++,Hf=476782367,dc=({random:e=Math.random,counter:t=pc(Math.floor(e()*Hf)),length:r=ac,fingerprint:n=uc({random:e})}={})=>function(){let o=Qf(e),s=Date.now().toString(36),a=t().toString(36),l=go(r,e),c=`${s+l+a+n}`;return`${o+cc(c).substring(1,r)}`},Gf=dc(),Jf=(e,{minLength:t=2,maxLength:r=Rr}={})=>{let n=e.length,i=/^[0-9a-z]+$/;try{if(typeof e=="string"&&n>=t&&n<=r&&i.test(e))return!0}finally{}return!1};Je.exports.getConstants=()=>({defaultLength:ac,bigLength:Rr});Je.exports.init=dc;Je.exports.createId=Gf;Je.exports.bufToBigInt=lc;Je.exports.createCounter=pc;Je.exports.createFingerprint=uc;Je.exports.isCuid=Jf});var fc=Z(($P,Sr)=>{"use strict";var{createId:Wf,init:Kf,getConstants:zf,isCuid:Yf}=mc();Sr.exports.createId=Wf;Sr.exports.init=Kf;Sr.exports.getConstants=zf;Sr.exports.isCuid=Yf});var hy={};ut(hy,{DMMF:()=>ar,Debug:()=>q,Decimal:()=>ne,Extensions:()=>fi,MetricsClient:()=>Rt,PrismaClientInitializationError:()=>N,PrismaClientKnownRequestError:()=>U,PrismaClientRustPanicError:()=>re,PrismaClientUnknownRequestError:()=>J,PrismaClientValidationError:()=>X,Public:()=>gi,Sql:()=>ce,createParam:()=>ba,defineDmmfProperty:()=>Ra,deserializeJsonResponse:()=>Qe,deserializeRawResult:()=>ui,dmmfToRuntimeDataModel:()=>Ns,empty:()=>ka,getPrismaClient:()=>Cu,getRuntime:()=>Mc,join:()=>Ia,makeStrictEnum:()=>Ru,makeTypedQueryFactory:()=>Sa,objectEnumValues:()=>Cn,raw:()=>Gi,serializeJsonQuery:()=>Nn,skip:()=>Dn,sqltag:()=>Ji,warnEnvConflicts:()=>Su,warnOnce:()=>ir});module.exports=_u(hy);var fi={};ut(fi,{defineExtension:()=>Zo,getExtensionContext:()=>Xo});function Zo(e){return typeof e=="function"?e:t=>t.$extends(e)}function Xo(e){return e}var gi={};ut(gi,{validator:()=>es});function es(...e){return t=>t}var Xr={};ut(Xr,{$:()=>os,bgBlack:()=>Qu,bgBlue:()=>Wu,bgCyan:()=>zu,bgGreen:()=>Gu,bgMagenta:()=>Ku,bgRed:()=>Hu,bgWhite:()=>Yu,bgYellow:()=>Ju,black:()=>qu,blue:()=>Ye,bold:()=>te,cyan:()=>Se,dim:()=>Ke,gray:()=>zt,green:()=>Kt,grey:()=>Bu,hidden:()=>$u,inverse:()=>Lu,italic:()=>Fu,magenta:()=>Uu,red:()=>Re,reset:()=>Mu,strikethrough:()=>Vu,underline:()=>ae,white:()=>ju,yellow:()=>ze});var yi,ts,rs,ns,is=!0;typeof process<"u"&&({FORCE_COLOR:yi,NODE_DISABLE_COLORS:ts,NO_COLOR:rs,TERM:ns}=process.env||{},is=process.stdout&&process.stdout.isTTY);var os={enabled:!ts&&rs==null&&ns!=="dumb"&&(yi!=null&&yi!=="0"||is)};function F(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!os.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Mu=F(0,0),te=F(1,22),Ke=F(2,22),Fu=F(3,23),ae=F(4,24),Lu=F(7,27),$u=F(8,28),Vu=F(9,29),qu=F(30,39),Re=F(31,39),Kt=F(32,39),ze=F(33,39),Ye=F(34,39),Uu=F(35,39),Se=F(36,39),ju=F(37,39),zt=F(90,39),Bu=F(90,39),Qu=F(40,49),Hu=F(41,49),Gu=F(42,49),Ju=F(43,49),Wu=F(44,49),Ku=F(45,49),zu=F(46,49),Yu=F(47,49);var Zu=100,ss=["green","yellow","blue","magenta","cyan","red"],Yt=[],as=Date.now(),Xu=0,hi=typeof process<"u"?process.env:{};globalThis.DEBUG??=hi.DEBUG??"";globalThis.DEBUG_COLORS??=hi.DEBUG_COLORS?hi.DEBUG_COLORS==="true":!0;var Zt={enable(e){typeof e=="string"&&(globalThis.DEBUG=e)},disable(){let e=globalThis.DEBUG;return globalThis.DEBUG="",e},enabled(e){let t=globalThis.DEBUG.split(",").map(i=>i.replace(/[.+?^${}()|[\]\\]/g,"\\$&")),r=t.some(i=>i===""||i[0]==="-"?!1:e.match(RegExp(i.split("*").join(".*")+"$"))),n=t.some(i=>i===""||i[0]!=="-"?!1:e.match(RegExp(i.slice(1).split("*").join(".*")+"$")));return r&&!n},log:(...e)=>{let[t,r,...n]=e;(console.warn??console.log)(`${t} ${r}`,...n)},formatters:{}};function ep(e){let t={color:ss[Xu++%ss.length],enabled:Zt.enabled(e),namespace:e,log:Zt.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Yt.push([o,...n]),Yt.length>Zu&&Yt.shift(),Zt.enabled(o)||i){let l=n.map(u=>typeof u=="string"?u:tp(u)),c=`+${Date.now()-as}ms`;as=Date.now(),globalThis.DEBUG_COLORS?a(Xr[s](te(o)),...l,Xr[s](c)):a(o,...l,c)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var q=new Proxy(ep,{get:(e,t)=>Zt[t],set:(e,t,r)=>Zt[t]=r});function tp(e,t=2){let r=new Set;return JSON.stringify(e,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular *]";r.add(i)}else if(typeof i=="bigint")return i.toString();return i},t)}function ls(e=7500){let t=Yt.map(([r,...n])=>`${r} ${n.map(i=>typeof i=="string"?i:JSON.stringify(i)).join(" ")}`).join(`
`);return t.length<e?t:t.slice(-e)}function cs(){Yt.length=0}var us=q;var np=ps(),wi=np.version;function pt(e){let t=ip();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":op())}function ip(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function op(){return"library"}function en(e){return e.name==="DriverAdapterError"&&typeof e.cause=="object"}var x={Int32:0,Int64:1,Float:2,Double:3,Numeric:4,Boolean:5,Character:6,Text:7,Date:8,Time:9,DateTime:10,Json:11,Enum:12,Bytes:13,Set:14,Uuid:15,Int32Array:64,Int64Array:65,FloatArray:66,DoubleArray:67,NumericArray:68,BooleanArray:69,CharacterArray:70,TextArray:71,DateArray:72,TimeArray:73,DateTimeArray:74,JsonArray:75,EnumArray:76,BytesArray:77,UuidArray:78,UnknownNumber:128};var gs=H(fs(),1);function xi(e){let t=(0,gs.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var ys="prisma+postgres",rn=`${ys}:`;function nn(e){return e?.toString().startsWith(`${rn}//`)??!1}function bi(e){if(!nn(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")||t.includes("[::1]")}var er={};ut(er,{error:()=>cp,info:()=>lp,log:()=>ap,query:()=>up,should:()=>Es,tags:()=>Xt,warn:()=>Pi});var Xt={error:Re("prisma:error"),warn:ze("prisma:warn"),info:Se("prisma:info"),query:Ye("prisma:query")},Es={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function ap(...e){console.log(...e)}function Pi(e,...t){Es.warn()&&console.warn(`${Xt.warn} ${e}`,...t)}function lp(e,...t){console.info(`${Xt.info} ${e}`,...t)}function cp(e,...t){console.error(`${Xt.error} ${e}`,...t)}function up(e,...t){console.log(`${Xt.query} ${e}`,...t)}function Ie(e,t){throw new Error(t)}function vi({onlyFirst:e=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?void 0:"g")}var pp=vi();function dt(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(pp,"")}var tr=H(require("node:path"));function Ti(e){return tr.default.sep===tr.default.posix.sep?e:e.split(tr.default.sep).join(tr.default.posix.sep)}var Si=H(As()),on=H(require("node:fs"));var mt=H(require("node:path"));function Cs(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],c,u;if(l==="\\")u=a[0],c=u.replace("\\$","$");else{let p=a[2];u=a[0].substring(l.length),c=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",c=r(c)}return o.replace(u,c)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var Ri=us("prisma:tryLoadEnv");function nr({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=Rs(e);r.conflictCheck!=="none"&&Cp(n,t,r.conflictCheck);let i=null;return Ss(n?.path,t)||(i=Rs(t)),!n&&!i&&Ri("No Environment variables loaded"),i?.dotenvResult.error?console.error(Re(te("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(`
`),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function Cp(e,t,r){let n=e?.dotenvResult.parsed,i=!Ss(e?.path,t);if(n&&t&&i&&on.default.existsSync(t)){let o=Si.default.parse(on.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=mt.default.relative(process.cwd(),e.path),l=mt.default.relative(process.cwd(),t);if(r==="error"){let c=`There is a conflict between env var${s.length>1?"s":""} in ${ae(a)} and ${ae(l)}
Conflicting env vars:
${s.map(u=>` ${te(u)}`).join(`
`)}
We suggest to move the contents of ${ae(l)} to ${ae(a)} to consolidate your env vars.
`;throw new Error(c)}else if(r==="warn"){let c=`Conflict for env var${s.length>1?"s":""} ${s.map(u=>te(u)).join(", ")} in ${ae(a)} and ${ae(l)}
Env vars from ${ae(l)} overwrite the ones from ${ae(a)}
`;console.warn(`${ze("warn(prisma)")} ${c}`)}}}}function Rs(e){if(Rp(e)){Ri(`Environment variables loaded from ${e}`);let t=Si.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:Cs(t),message:Ke(`Environment variables loaded from ${mt.default.relative(process.cwd(),e)}`),path:e}}else Ri(`Environment variables not found at ${e}`);return null}function Ss(e,t){return e&&t&&mt.default.resolve(e)===mt.default.resolve(t)}function Rp(e){return!!(e&&on.default.existsSync(e))}function Ii(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function an(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function ki(e,t){if(e.length===0)return;let r=e[0];for(let n=1;n<e.length;n++)t(r,e[n])<0&&(r=e[n]);return r}function P(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var ks=new Set,ir=(e,t,...r)=>{ks.has(e)||(ks.add(e),Pi(t,...r))};var N=class e extends Error{clientVersion;errorCode;retryable;constructor(t,r,n){super(t),this.name="PrismaClientInitializationError",this.clientVersion=r,this.errorCode=n,Error.captureStackTrace(e)}get[Symbol.toStringTag](){return"PrismaClientInitializationError"}};P(N,"PrismaClientInitializationError");var U=class extends Error{code;meta;clientVersion;batchRequestIdx;constructor(t,{code:r,clientVersion:n,meta:i,batchRequestIdx:o}){super(t),this.name="PrismaClientKnownRequestError",this.code=r,this.clientVersion=n,this.meta=i,Object.defineProperty(this,"batchRequestIdx",{value:o,enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return"PrismaClientKnownRequestError"}};P(U,"PrismaClientKnownRequestError");var re=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};P(re,"PrismaClientRustPanicError");var J=class extends Error{clientVersion;batchRequestIdx;constructor(t,{clientVersion:r,batchRequestIdx:n}){super(t),this.name="PrismaClientUnknownRequestError",this.clientVersion=r,Object.defineProperty(this,"batchRequestIdx",{value:n,writable:!0,enumerable:!1})}get[Symbol.toStringTag](){return"PrismaClientUnknownRequestError"}};P(J,"PrismaClientUnknownRequestError");var X=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};P(X,"PrismaClientValidationError");var Ee=class{_map=new Map;get(t){return this._map.get(t)?.value}set(t,r){this._map.set(t,{value:r})}getOrCreate(t,r){let n=this._map.get(t);if(n)return n.value;let i=r();return this.set(t,i),i}};function Le(e){return e.substring(0,1).toLowerCase()+e.substring(1)}function Ds(e,t){let r={};for(let n of e){let i=n[t];r[i]=n}return r}function or(e){let t;return{get(){return t||(t={value:e()}),t.value}}}function Ns(e){return{models:Oi(e.models),enums:Oi(e.enums),types:Oi(e.types)}}function Oi(e){let t={};for(let{name:r,...n}of e)t[r]=n;return t}function ft(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function ln(e){return e.toString()!=="Invalid Date"}var gt=9e15,Ue=1e9,Di="0123456789abcdef",pn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",dn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ni={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-gt,maxE:gt,crypto:!1},Ls,Oe,b=!0,fn="[DecimalError] ",qe=fn+"Invalid argument: ",$s=fn+"Precision limit exceeded",Vs=fn+"crypto unavailable",qs="[object Decimal]",ee=Math.floor,Q=Math.pow,Sp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ip=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,kp=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Us=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,E=7,Op=9007199254740991,Dp=pn.length-1,_i=dn.length-1,f={toStringTag:qs};f.absoluteValue=f.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),h(e)};f.ceil=function(){return h(new this.constructor(this),this.e+1,2)};f.clampedTo=f.clamp=function(e,t){var r,n=this,i=n.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(qe+t);return r=n.cmp(e),r<0?e:n.cmp(t)>0?t:new i(n)};f.comparedTo=f.cmp=function(e){var t,r,n,i,o=this,s=o.d,a=(e=new o.constructor(e)).d,l=o.s,c=e.s;if(!s||!a)return!l||!c?NaN:l!==c?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-c:0;if(l!==c)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};f.cosine=f.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=Np(n,Gs(n,r)),n.precision=e,n.rounding=t,h(Oe==2||Oe==3?r.neg():r,e,t,!0)):new n(1):new n(NaN)};f.cubeRoot=f.cbrt=function(){var e,t,r,n,i,o,s,a,l,c,u=this,p=u.constructor;if(!u.isFinite()||u.isZero())return new p(u);for(b=!1,o=u.s*Q(u.s*u,1/3),!o||Math.abs(o)==1/0?(r=W(u.d),e=u.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=Q(r,1/3),e=ee((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=u.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),c=l.plus(u),n=M(c.plus(u).times(a),c.plus(l),s+2,1),W(a.d).slice(0,s)===(r=W(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(h(a,e+1,0),a.times(a).times(a).eq(u))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(h(n,e+1,1),t=!n.times(n).times(n).eq(u));break}return b=!0,h(n,e,p.rounding,t)};f.decimalPlaces=f.dp=function(){var e,t=this.d,r=NaN;if(t){if(e=t.length-1,r=(e-ee(this.e/E))*E,e=t[e],e)for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r};f.dividedBy=f.div=function(e){return M(this,new this.constructor(e))};f.dividedToIntegerBy=f.divToInt=function(e){var t=this,r=t.constructor;return h(M(t,new r(e),0,1,1),r.precision,r.rounding)};f.equals=f.eq=function(e){return this.cmp(e)===0};f.floor=function(){return h(new this.constructor(this),this.e+1,3)};f.greaterThan=f.gt=function(e){return this.cmp(e)>0};f.greaterThanOrEqualTo=f.gte=function(e){var t=this.cmp(e);return t==1||t===0};f.hyperbolicCosine=f.cosh=function(){var e,t,r,n,i,o=this,s=o.constructor,a=new s(1);if(!o.isFinite())return new s(o.s?1/0:NaN);if(o.isZero())return a;r=s.precision,n=s.rounding,s.precision=r+Math.max(o.e,o.sd())+4,s.rounding=1,i=o.d.length,i<32?(e=Math.ceil(i/3),t=(1/yn(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=yt(s,1,o.times(t),new s(1),!0);for(var l,c=e,u=new s(8);c--;)l=o.times(o),o=a.minus(l.times(u.minus(l.times(u))));return h(o,s.precision=r,s.rounding=n,!0)};f.hyperbolicSine=f.sinh=function(){var e,t,r,n,i=this,o=i.constructor;if(!i.isFinite()||i.isZero())return new o(i);if(t=o.precision,r=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,n=i.d.length,n<3)i=yt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/yn(5,e)),i=yt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),c=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(c))))}return o.precision=t,o.rounding=r,h(i,t,r,!0)};f.hyperbolicTangent=f.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,M(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)};f.inverseCosine=f.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return r!==-1?r===0?e.isNeg()?xe(t,n,i):new t(0):new t(NaN):e.isZero()?xe(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))};f.inverseHyperbolicCosine=f.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,b=!1,r=r.times(r).minus(1).sqrt().plus(r),b=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)};f.inverseHyperbolicSine=f.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,b=!1,r=r.times(r).plus(1).sqrt().plus(r),b=!0,n.precision=e,n.rounding=t,r.ln())};f.inverseHyperbolicTangent=f.atanh=function(){var e,t,r,n,i=this,o=i.constructor;return i.isFinite()?i.e>=0?new o(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=o.precision,t=o.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?h(new o(i),e,t,!0):(o.precision=r=n-i.e,i=M(i.plus(1),new o(1).minus(i),r+e,1),o.precision=e+4,o.rounding=1,i=i.ln(),o.precision=e,o.rounding=t,i.times(.5))):new o(NaN)};f.inverseSine=f.asin=function(){var e,t,r,n,i=this,o=i.constructor;return i.isZero()?new o(i):(t=i.abs().cmp(1),r=o.precision,n=o.rounding,t!==-1?t===0?(e=xe(o,r+4,n).times(.5),e.s=i.s,e):new o(NaN):(o.precision=r+6,o.rounding=1,i=i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=n,i.times(2)))};f.inverseTangent=f.atan=function(){var e,t,r,n,i,o,s,a,l,c=this,u=c.constructor,p=u.precision,d=u.rounding;if(c.isFinite()){if(c.isZero())return new u(c);if(c.abs().eq(1)&&p+4<=_i)return s=xe(u,p+4,d).times(.25),s.s=c.s,s}else{if(!c.s)return new u(NaN);if(p+4<=_i)return s=xe(u,p+4,d).times(.5),s.s=c.s,s}for(u.precision=a=p+10,u.rounding=1,r=Math.min(28,a/E+2|0),e=r;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(b=!1,t=Math.ceil(a/E),n=1,l=c.times(c),s=new u(c),i=c;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),b=!0,h(s,u.precision=p,u.rounding=d,!0)};f.isFinite=function(){return!!this.d};f.isInteger=f.isInt=function(){return!!this.d&&ee(this.e/E)>this.d.length-2};f.isNaN=function(){return!this.s};f.isNegative=f.isNeg=function(){return this.s<0};f.isPositive=f.isPos=function(){return this.s>0};f.isZero=function(){return!!this.d&&this.d[0]===0};f.lessThan=f.lt=function(e){return this.cmp(e)<0};f.lessThanOrEqualTo=f.lte=function(e){return this.cmp(e)<1};f.logarithm=f.log=function(e){var t,r,n,i,o,s,a,l,c=this,u=c.constructor,p=u.precision,d=u.rounding,m=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new u(r&&!r[0]?-1/0:c.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(b=!1,a=p+m,s=Ve(c,a),n=t?mn(u,a+10):Ve(e,a),l=M(s,n,a,1),sr(l.d,i=p,d))do if(a+=10,s=Ve(c,a),n=t?mn(u,a+10):Ve(e,a),l=M(s,n,a,1),!o){+W(l.d).slice(i+1,i+15)+1==1e14&&(l=h(l,p+1,0));break}while(sr(l.d,i+=10,d));return b=!0,h(l,p,d)};f.minus=f.sub=function(e){var t,r,n,i,o,s,a,l,c,u,p,d,m=this,y=m.constructor;if(e=new y(e),!m.d||!e.d)return!m.s||!e.s?e=new y(NaN):m.d?e.s=-e.s:e=new y(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(c=m.d,d=e.d,a=y.precision,l=y.rounding,!c[0]||!d[0]){if(d[0])e.s=-e.s;else if(c[0])e=new y(m);else return new y(l===3?-0:0);return b?h(e,a,l):e}if(r=ee(e.e/E),u=ee(m.e/E),c=c.slice(),o=u-r,o){for(p=o<0,p?(t=c,o=-o,s=d.length):(t=d,r=u,s=c.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=c.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(c[n]!=d[n]){p=c[n]<d[n];break}o=0}for(p&&(t=c,c=d,d=t,e.s=-e.s),s=c.length,n=d.length-s;n>0;--n)c[s++]=0;for(n=d.length;n>o;){if(c[--n]<d[n]){for(i=n;i&&c[--i]===0;)c[i]=ge-1;--c[i],c[n]+=ge}c[n]-=d[n]}for(;c[--s]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(e.d=c,e.e=gn(c,r),b?h(e,a,l):e):new y(l===3?-0:0)};f.modulo=f.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?h(new n(r),n.precision,n.rounding):(b=!1,n.modulo==9?(t=M(r,e.abs(),0,3,1),t.s*=e.s):t=M(r,e,0,n.modulo,1),t=t.times(e),b=!0,r.minus(t))};f.naturalExponential=f.exp=function(){return Mi(this)};f.naturalLogarithm=f.ln=function(){return Ve(this)};f.negated=f.neg=function(){var e=new this.constructor(this);return e.s=-e.s,h(e)};f.plus=f.add=function(e){var t,r,n,i,o,s,a,l,c,u,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(c=p.d,u=e.d,a=d.precision,l=d.rounding,!c[0]||!u[0])return u[0]||(e=new d(p)),b?h(e,a,l):e;if(o=ee(p.e/E),n=ee(e.e/E),c=c.slice(),i=o-n,i){for(i<0?(r=c,i=-i,s=u.length):(r=u,n=o,s=c.length),o=Math.ceil(a/E),s=o>s?o+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=c.length,i=u.length,s-i<0&&(i=s,r=u,u=c,c=r),t=0;i;)t=(c[--i]=c[i]+u[i]+t)/ge|0,c[i]%=ge;for(t&&(c.unshift(t),++n),s=c.length;c[--s]==0;)c.pop();return e.d=c,e.e=gn(c,n),b?h(e,a,l):e};f.precision=f.sd=function(e){var t,r=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(qe+e);return r.d?(t=js(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};f.round=function(){var e=this,t=e.constructor;return h(new t(e),e.e+1,t.rounding)};f.sine=f.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+E,n.rounding=1,r=Mp(n,Gs(n,r)),n.precision=e,n.rounding=t,h(Oe>2?r.neg():r,e,t,!0)):new n(NaN)};f.squareRoot=f.sqrt=function(){var e,t,r,n,i,o,s=this,a=s.d,l=s.e,c=s.s,u=s.constructor;if(c!==1||!a||!a[0])return new u(!c||c<0&&(!a||a[0])?NaN:a?s:1/0);for(b=!1,c=Math.sqrt(+s),c==0||c==1/0?(t=W(a),(t.length+l)%2==0&&(t+="0"),c=Math.sqrt(t),l=ee((l+1)/2)-(l<0||l%2),c==1/0?t="5e"+l:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new u(t)):n=new u(c.toString()),r=(l=u.precision)+3;;)if(o=n,n=o.plus(M(s,o,r+2,1)).times(.5),W(o.d).slice(0,r)===(t=W(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(h(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(h(n,l+1,1),e=!n.times(n).eq(s));break}return b=!0,h(n,l,u.rounding,e)};f.tangent=f.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,r=r.sin(),r.s=1,r=M(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,h(Oe==2||Oe==4?r.neg():r,e,t,!0)):new n(NaN)};f.times=f.mul=function(e){var t,r,n,i,o,s,a,l,c,u=this,p=u.constructor,d=u.d,m=(e=new p(e)).d;if(e.s*=u.s,!d||!d[0]||!m||!m[0])return new p(!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?NaN:!d||!m?e.s/0:e.s*0);for(r=ee(u.e/E)+ee(e.e/E),l=d.length,c=m.length,l<c&&(o=d,d=m,m=o,s=l,l=c,c=s),o=[],s=l+c,n=s;n--;)o.push(0);for(n=c;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+m[n]*d[i-n-1]+t,o[i--]=a%ge|0,t=a/ge|0;o[i]=(o[i]+t)%ge|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=gn(o,r),b?h(e,p.precision,p.rounding):e};f.toBinary=function(e,t){return Fi(this,2,e,t)};f.toDecimalPlaces=f.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(le(e,0,Ue),t===void 0?t=n.rounding:le(t,0,8),h(r,e+r.e+1,t))};f.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=be(n,!0):(le(e,0,Ue),t===void 0?t=i.rounding:le(t,0,8),n=h(new i(n),e+1,t),r=be(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?r=be(i):(le(e,0,Ue),t===void 0?t=o.rounding:le(t,0,8),n=h(new o(i),e+i.e+1,t),r=be(n,!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r};f.toFraction=function(e){var t,r,n,i,o,s,a,l,c,u,p,d,m=this,y=m.d,g=m.constructor;if(!y)return new g(m);if(c=r=new g(1),n=l=new g(0),t=new g(n),o=t.e=js(y)-m.e-1,s=o%E,t.d[0]=Q(10,s<0?E+s:s),e==null)e=o>0?t:c;else{if(a=new g(e),!a.isInt()||a.lt(c))throw Error(qe+a);e=a.gt(t)?o>0?t:c:a}for(b=!1,a=new g(W(y)),u=g.precision,g.precision=o=y.length*E*2;p=M(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=c,c=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=M(e.minus(r),n,0,1,1),l=l.plus(i.times(c)),r=r.plus(i.times(n)),l.s=c.s=m.s,d=M(c,n,o,1).minus(m).abs().cmp(M(l,r,o,1).minus(m).abs())<1?[c,n]:[l,r],g.precision=u,b=!0,d};f.toHexadecimal=f.toHex=function(e,t){return Fi(this,16,e,t)};f.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),e==null){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),t===void 0?t=n.rounding:le(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(b=!1,r=M(r,e,0,t,1).times(e),b=!0,h(r)):(e.s=r.s,r=e),r};f.toNumber=function(){return+this};f.toOctal=function(e,t){return Fi(this,8,e,t)};f.toPower=f.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,c=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(Q(+a,c));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return h(a,n,o);if(t=ee(e.e/E),t>=e.d.length-1&&(r=c<0?-c:c)<=Op)return i=Bs(l,a,r,n),e.s<0?new l(1).div(i):h(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=Q(+a,c),t=r==0||!isFinite(r)?ee(c*(Math.log("0."+W(a.d))/Math.LN10+a.e+1)):new l(r+"").e,t>l.maxE+1||t<l.minE-1?new l(t>0?s/0:0):(b=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=M