UNPKG

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) • 213 kB
"use strict";var Ec=Object.create;var Wr=Object.defineProperty;var xc=Object.getOwnPropertyDescriptor;var bc=Object.getOwnPropertyNames;var Pc=Object.getPrototypeOf,vc=Object.prototype.hasOwnProperty;var qo=(e,t)=>()=>(e&&(t=e(e=0)),t);var W=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),lt=(e,t)=>{for(var r in t)Wr(e,r,{get:t[r],enumerable:!0})},Uo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of bc(t))!vc.call(e,i)&&i!==r&&Wr(e,i,{get:()=>t[i],enumerable:!(n=xc(t,i))||n.enumerable});return e};var j=(e,t,r)=>(r=e!=null?Ec(Pc(e)):{},Uo(t||!e||!e.__esModule?Wr(r,"default",{value:e,enumerable:!0}):r,e)),Tc=e=>Uo(Wr({},"__esModule",{value:!0}),e);var ts=W((ih,Gc)=>{Gc.exports={name:"@prisma/internals",version:"6.9.0",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",esbuild:"0.25.1","escape-string-regexp":"5.0.0",execa:"5.1.1","fast-glob":"3.3.3","find-up":"7.0.0","fp-ts":"2.16.9","fs-extra":"11.3.0","fs-jetpack":"5.1.0","global-dirs":"4.0.0",globby:"11.1.0","identifier-regex":"1.0.0","indent-string":"4.0.0","is-windows":"1.0.2","is-wsl":"3.1.0",jest:"29.7.0","jest-junit":"16.0.0",kleur:"4.1.5","mock-stdin":"1.0.0","new-github-issue-url":"0.2.1","node-fetch":"3.3.2","npm-packlist":"5.1.3",open:"7.4.2","p-map":"4.0.0","read-package-up":"11.0.0",resolve:"1.22.10","string-width":"7.2.0","strip-ansi":"6.0.1","strip-indent":"4.0.0","temp-dir":"2.0.0",tempy:"1.0.1","terminal-link":"4.0.0",tmp:"0.2.3","ts-node":"10.9.2","ts-pattern":"5.6.2","ts-toolbelt":"9.6.0",typescript:"5.4.5",yarn:"1.22.22"},dependencies:{"@prisma/config":"workspace:*","@prisma/debug":"workspace:*","@prisma/dmmf":"workspace:*","@prisma/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.9.0-10.81e4af48011447c3cc503a190e86995b66d2a28e","@prisma/schema-engine-wasm":"6.9.0-10.81e4af48011447c3cc503a190e86995b66d2a28e","@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 ns=W((ah,rs)=>{"use strict";rs.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((r,n)=>Math.min(r,n.length),1/0):0}});var as=W((ch,ss)=>{"use strict";ss.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 cs=W((dh,us)=>{"use strict";us.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var mi=W((mh,ps)=>{"use strict";var ep=cs();ps.exports=e=>typeof e=="string"?e.replace(ep(),""):e});var ds=W((hh,tp)=>{tp.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 ys=W((yh,Re)=>{"use strict";var gi=require("node:fs"),hi=require("node:path"),rp=require("node:os"),np=require("node:crypto"),ip=ds(),fs=ip.version,op=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function sp(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,` `);let n;for(;(n=op.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 ap(e){let t=hs(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=gs(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),l=up(r,a);o=B.decrypt(l.ciphertext,l.key);break}catch(a){if(s+1>=i)throw a}return B.parse(o)}function lp(e){console.log(`[dotenv@${fs}][WARN] ${e}`)}function Kt(e){console.log(`[dotenv@${fs}][DEBUG] ${e}`)}function gs(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 up(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 hs(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)gi.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=hi.resolve(process.cwd(),".env.vault");return gi.existsSync(t)?t:null}function ms(e){return e[0]==="~"?hi.join(rp.homedir(),e.slice(1)):e}function cp(e){!!(e&&e.debug)&&Kt("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=hi.resolve(process.cwd(),".env"),r="utf8",n=!!(e&&e.debug);e&&e.encoding?r=e.encoding:n&&Kt("No encoding is specified. UTF-8 is used by default");let i=[t];if(e&&e.path)if(!Array.isArray(e.path))i=[ms(e.path)];else{i=[];for(let l of e.path)i.push(ms(l))}let o,s={};for(let l of i)try{let u=B.parse(gi.readFileSync(l,{encoding:r}));B.populate(s,u,e)}catch(u){n&&Kt(`Failed to load ${l} ${u.message}`),o=u}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 dp(e){if(gs(e).length===0)return B.configDotenv(e);let t=hs(e);return t?B._configVault(e):(lp(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),B.configDotenv(e))}function mp(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=np.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,l=s.message==="Invalid key length",u=s.message==="Unsupported state or unable to authenticate data";if(a||l){let c=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw c.code="INVALID_DOTENV_KEY",c}else if(u){let c=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw c.code="DECRYPTION_FAILED",c}else throw s}}function fp(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&&Kt(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:cp,_parseVault:ap,config:dp,decrypt:mp,parse:sp,populate:fp};Re.exports.configDotenv=B.configDotenv;Re.exports._configVault=B._configVault;Re.exports._parseVault=B._parseVault;Re.exports.config=B.config;Re.exports.decrypt=B.decrypt;Re.exports.parse=B.parse;Re.exports.populate=B.populate;Re.exports=B});var bs=W((vh,Zr)=>{"use strict";Zr.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()};Zr.exports.default=Zr.exports});var Si=W((Zy,Hs)=>{"use strict";Hs.exports=function(){function e(t,r,n,i,o){return t<r||n<r?t>n?n+1:t+1:i===o?r:r+1}return function(t,r){if(t===r)return 0;if(t.length>r.length){var n=t;t=r,r=n}for(var i=t.length,o=r.length;i>0&&t.charCodeAt(i-1)===r.charCodeAt(o-1);)i--,o--;for(var s=0;s<i&&t.charCodeAt(s)===r.charCodeAt(s);)s++;if(i-=s,o-=s,i===0||o<3)return o;var a=0,l,u,c,p,d,m,g,h,I,T,C,w,O=[];for(l=0;l<i;l++)O.push(l+1),O.push(t.charCodeAt(s+l));for(var me=O.length-1;a<o-3;)for(I=r.charCodeAt(s+(u=a)),T=r.charCodeAt(s+(c=a+1)),C=r.charCodeAt(s+(p=a+2)),w=r.charCodeAt(s+(d=a+3)),m=a+=4,l=0;l<me;l+=2)g=O[l],h=O[l+1],u=e(g,u,c,I,h),c=e(u,c,p,T,h),p=e(c,p,d,C,h),m=e(p,d,m,w,h),O[l]=m,d=p,p=c,c=u,u=g;for(;a<o;)for(I=r.charCodeAt(s+(u=a)),m=++a,l=0;l<me;l+=2)g=O[l],O[l]=m=e(g,u,m,I,O[l+1]),u=g;return m}}()});var zs=qo(()=>{"use strict"});var Ys=qo(()=>{"use strict"});var ba=W((Sx,lm)=>{lm.exports={name:"@prisma/engines-version",version:"6.9.0-10.81e4af48011447c3cc503a190e86995b66d2a28e",main:"index.js",types:"index.d.ts",license:"Apache-2.0",author:"Tim Suchanek <suchanek@prisma.io>",prisma:{enginesVersion:"81e4af48011447c3cc503a190e86995b66d2a28e"},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 Xi=W(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.anumber=Zi;Ze.abytes=ml;Ze.ahash=cf;Ze.aexists=pf;Ze.aoutput=df;function Zi(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function uf(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function ml(e,...t){if(!uf(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 cf(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Zi(e.outputLen),Zi(e.blockLen)}function pf(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 df(e,t){ml(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}});var Ml=W(P=>{"use strict";Object.defineProperty(P,"__esModule",{value:!0});P.add5L=P.add5H=P.add4H=P.add4L=P.add3H=P.add3L=P.rotlBL=P.rotlBH=P.rotlSL=P.rotlSH=P.rotr32L=P.rotr32H=P.rotrBL=P.rotrBH=P.rotrSL=P.rotrSH=P.shrSL=P.shrSH=P.toBig=void 0;P.fromBig=to;P.split=fl;P.add=Rl;var Ln=BigInt(2**32-1),eo=BigInt(32);function to(e,t=!1){return t?{h:Number(e&Ln),l:Number(e>>eo&Ln)}:{h:Number(e>>eo&Ln)|0,l:Number(e&Ln)|0}}function fl(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}=to(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}var gl=(e,t)=>BigInt(e>>>0)<<eo|BigInt(t>>>0);P.toBig=gl;var hl=(e,t,r)=>e>>>r;P.shrSH=hl;var yl=(e,t,r)=>e<<32-r|t>>>r;P.shrSL=yl;var wl=(e,t,r)=>e>>>r|t<<32-r;P.rotrSH=wl;var El=(e,t,r)=>e<<32-r|t>>>r;P.rotrSL=El;var xl=(e,t,r)=>e<<64-r|t>>>r-32;P.rotrBH=xl;var bl=(e,t,r)=>e>>>r-32|t<<64-r;P.rotrBL=bl;var Pl=(e,t)=>t;P.rotr32H=Pl;var vl=(e,t)=>e;P.rotr32L=vl;var Tl=(e,t,r)=>e<<r|t>>>32-r;P.rotlSH=Tl;var Al=(e,t,r)=>t<<r|e>>>32-r;P.rotlSL=Al;var Cl=(e,t,r)=>t<<r-32|e>>>64-r;P.rotlBH=Cl;var Sl=(e,t,r)=>e<<r-32|t>>>64-r;P.rotlBL=Sl;function Rl(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}var Il=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);P.add3L=Il;var kl=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;P.add3H=kl;var Ol=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);P.add4L=Ol;var Dl=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0;P.add4H=Dl;var _l=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);P.add5L=_l;var Nl=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0;P.add5H=Nl;var mf={fromBig:to,split:fl,toBig:gl,shrSH:hl,shrSL:yl,rotrSH:wl,rotrSL:El,rotrBH:xl,rotrBL:bl,rotr32H:Pl,rotr32L:vl,rotlSH:Tl,rotlSL:Al,rotlBH:Cl,rotlBL:Sl,add:Rl,add3L:Il,add3H:kl,add4L:Ol,add4H:Dl,add5H:Nl,add5L:_l};P.default=mf});var Ll=W(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.crypto=void 0;var je=require("node:crypto");Fn.crypto=je&&typeof je=="object"&&"webcrypto"in je?je.webcrypto:je&&typeof je=="object"&&"randomBytes"in je?je:void 0});var Vl=W(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.Hash=R.nextTick=R.byteSwapIfBE=R.isLE=void 0;R.isBytes=ff;R.u8=gf;R.u32=hf;R.createView=yf;R.rotr=wf;R.rotl=Ef;R.byteSwap=io;R.byteSwap32=xf;R.bytesToHex=Pf;R.hexToBytes=vf;R.asyncLoop=Af;R.utf8ToBytes=$l;R.toBytes=$n;R.concatBytes=Cf;R.checkOpts=Sf;R.wrapConstructor=Rf;R.wrapConstructorWithOpts=If;R.wrapXOFConstructorWithOpts=kf;R.randomBytes=Of;var Rt=Ll(),no=Xi();function ff(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function gf(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function hf(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function yf(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function wf(e,t){return e<<32-t|e>>>t}function Ef(e,t){return e<<t|e>>>32-t>>>0}R.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function io(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}R.byteSwapIfBE=R.isLE?e=>e:e=>io(e);function xf(e){for(let t=0;t<e.length;t++)e[t]=io(e[t])}var bf=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pf(e){(0,no.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=bf[e[r]];return t}var Oe={_0:48,_9:57,A:65,F:70,a:97,f:102};function Fl(e){if(e>=Oe._0&&e<=Oe._9)return e-Oe._0;if(e>=Oe.A&&e<=Oe.F)return e-(Oe.A-10);if(e>=Oe.a&&e<=Oe.f)return e-(Oe.a-10)}function vf(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=Fl(e.charCodeAt(o)),a=Fl(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 Tf=async()=>{};R.nextTick=Tf;async function Af(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,R.nextTick)(),n+=o)}}function $l(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function $n(e){return typeof e=="string"&&(e=$l(e)),(0,no.abytes)(e),e}function Cf(...e){let t=0;for(let n=0;n<e.length;n++){let i=e[n];(0,no.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 ro=class{clone(){return this._cloneInto()}};R.Hash=ro;function Sf(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 Rf(e){let t=n=>e().update($n(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function If(e){let t=(n,i)=>e(i).update($n(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function kf(e){let t=(n,i)=>e(i).update($n(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Of(e=32){if(Rt.crypto&&typeof Rt.crypto.getRandomValues=="function")return Rt.crypto.getRandomValues(new Uint8Array(e));if(Rt.crypto&&typeof Rt.crypto.randomBytes=="function")return Rt.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}});var Wl=W(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.shake256=F.shake128=F.keccak_512=F.keccak_384=F.keccak_256=F.keccak_224=F.sha3_512=F.sha3_384=F.sha3_256=F.sha3_224=F.Keccak=void 0;F.keccakP=Hl;var It=Xi(),xr=Ml(),De=Vl(),jl=[],Bl=[],Ql=[],Df=BigInt(0),Er=BigInt(1),_f=BigInt(2),Nf=BigInt(7),Mf=BigInt(256),Lf=BigInt(113);for(let e=0,t=Er,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],jl.push(2*(5*n+r)),Bl.push((e+1)*(e+2)/2%64);let i=Df;for(let o=0;o<7;o++)t=(t<<Er^(t>>Nf)*Lf)%Mf,t&_f&&(i^=Er<<(Er<<BigInt(o))-Er);Ql.push(i)}var[Ff,$f]=(0,xr.split)(Ql,!0),ql=(e,t,r)=>r>32?(0,xr.rotlBH)(e,t,r):(0,xr.rotlSH)(e,t,r),Ul=(e,t,r)=>r>32?(0,xr.rotlBL)(e,t,r):(0,xr.rotlSL)(e,t,r);function Hl(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,l=(s+2)%10,u=r[l],c=r[l+1],p=ql(u,c,1)^r[a],d=Ul(u,c,1)^r[a+1];for(let m=0;m<50;m+=10)e[s+m]^=p,e[s+m+1]^=d}let i=e[2],o=e[3];for(let s=0;s<24;s++){let a=Bl[s],l=ql(i,o,a),u=Ul(i,o,a),c=jl[s];i=e[c],o=e[c+1],e[c]=l,e[c+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=Ff[n],e[1]^=$f[n]}r.fill(0)}var br=class e extends De.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,It.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,De.u32)(this.state)}keccak(){De.isLE||(0,De.byteSwap32)(this.state32),Hl(this.state32,this.rounds),De.isLE||(0,De.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(t){(0,It.aexists)(this);let{blockLen:r,state:n}=this;t=(0,De.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,It.aexists)(this,!1),(0,It.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,It.anumber)(t),this.xofInto(new Uint8Array(t))}digestInto(t){if((0,It.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}};F.Keccak=br;var Be=(e,t,r)=>(0,De.wrapConstructor)(()=>new br(t,e,r));F.sha3_224=Be(6,144,224/8);F.sha3_256=Be(6,136,256/8);F.sha3_384=Be(6,104,384/8);F.sha3_512=Be(6,72,512/8);F.keccak_224=Be(1,144,224/8);F.keccak_256=Be(1,136,256/8);F.keccak_384=Be(1,104,384/8);F.keccak_512=Be(1,72,512/8);var Gl=(e,t,r)=>(0,De.wrapXOFConstructorWithOpts)((n={})=>new br(t,e,n.dkLen===void 0?r:n.dkLen,!0));F.shake128=Gl(31,168,128/8);F.shake256=Gl(31,136,256/8)});var tu=W((iP,Qe)=>{"use strict";var{sha3_512:Vf}=Wl(),Kl=24,Pr=32,oo=(e=4,t=Math.random)=>{let r="";for(;r.length<e;)r=r+Math.floor(t()*36).toString(36);return r};function zl(e){let t=8n,r=0n;for(let n of e.values()){let i=BigInt(n);r=(r<<t)+i}return r}var Yl=(e="")=>zl(Vf(e)).toString(36).slice(1),Jl=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),qf=e=>Jl[Math.floor(e()*Jl.length)],Zl=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Math.random}={})=>{let r=Object.keys(e).toString(),n=r.length?r+oo(Pr,t):oo(Pr,t);return Yl(n).substring(0,Pr)},Xl=e=>()=>e++,Uf=476782367,eu=({random:e=Math.random,counter:t=Xl(Math.floor(e()*Uf)),length:r=Kl,fingerprint:n=Zl({random:e})}={})=>function(){let o=qf(e),s=Date.now().toString(36),a=t().toString(36),l=oo(r,e),u=`${s+l+a+n}`;return`${o+Yl(u).substring(1,r)}`},jf=eu(),Bf=(e,{minLength:t=2,maxLength:r=Pr}={})=>{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};Qe.exports.getConstants=()=>({defaultLength:Kl,bigLength:Pr});Qe.exports.init=eu;Qe.exports.createId=jf;Qe.exports.bufToBigInt=zl;Qe.exports.createCounter=Xl;Qe.exports.createFingerprint=Zl;Qe.exports.isCuid=Bf});var ru=W((oP,vr)=>{"use strict";var{createId:Qf,init:Hf,getConstants:Gf,isCuid:Wf}=tu();vr.exports.createId=Qf;vr.exports.init=Hf;vr.exports.getConstants=Gf;vr.exports.isCuid=Wf});var Gg={};lt(Gg,{DMMF:()=>er,Debug:()=>q,Decimal:()=>K,Extensions:()=>oi,MetricsClient:()=>Tt,PrismaClientInitializationError:()=>k,PrismaClientKnownRequestError:()=>Q,PrismaClientRustPanicError:()=>ne,PrismaClientUnknownRequestError:()=>X,PrismaClientValidationError:()=>ee,Public:()=>si,Sql:()=>le,createParam:()=>ma,defineDmmfProperty:()=>Ea,deserializeJsonResponse:()=>$e,deserializeRawResult:()=>ti,dmmfToRuntimeDataModel:()=>Vs,empty:()=>va,getPrismaClient:()=>hc,getRuntime:()=>_n,join:()=>Pa,makeStrictEnum:()=>yc,makeTypedQueryFactory:()=>xa,objectEnumValues:()=>wn,raw:()=>Li,serializeJsonQuery:()=>An,skip:()=>Tn,sqltag:()=>Fi,warnEnvConflicts:()=>wc,warnOnce:()=>Yt});module.exports=Tc(Gg);var oi={};lt(oi,{defineExtension:()=>jo,getExtensionContext:()=>Bo});function jo(e){return typeof e=="function"?e:t=>t.$extends(e)}function Bo(e){return e}var si={};lt(si,{validator:()=>Qo});function Qo(...e){return t=>t}var Jr={};lt(Jr,{$:()=>Ko,bgBlack:()=>Nc,bgBlue:()=>$c,bgCyan:()=>qc,bgGreen:()=>Lc,bgMagenta:()=>Vc,bgRed:()=>Mc,bgWhite:()=>Uc,bgYellow:()=>Fc,black:()=>kc,blue:()=>Je,bold:()=>re,cyan:()=>Se,dim:()=>Ge,gray:()=>Bt,green:()=>jt,grey:()=>_c,hidden:()=>Rc,inverse:()=>Sc,italic:()=>Cc,magenta:()=>Oc,red:()=>Ce,reset:()=>Ac,strikethrough:()=>Ic,underline:()=>se,white:()=>Dc,yellow:()=>We});var ai,Ho,Go,Wo,Jo=!0;typeof process<"u"&&({FORCE_COLOR:ai,NODE_DISABLE_COLORS:Ho,NO_COLOR:Go,TERM:Wo}=process.env||{},Jo=process.stdout&&process.stdout.isTTY);var Ko={enabled:!Ho&&Go==null&&Wo!=="dumb"&&(ai!=null&&ai!=="0"||Jo)};function M(e,t){let r=new RegExp(`\\x1b\\[${t}m`,"g"),n=`\x1B[${e}m`,i=`\x1B[${t}m`;return function(o){return!Ko.enabled||o==null?o:n+(~(""+o).indexOf(i)?o.replace(r,i+n):o)+i}}var Ac=M(0,0),re=M(1,22),Ge=M(2,22),Cc=M(3,23),se=M(4,24),Sc=M(7,27),Rc=M(8,28),Ic=M(9,29),kc=M(30,39),Ce=M(31,39),jt=M(32,39),We=M(33,39),Je=M(34,39),Oc=M(35,39),Se=M(36,39),Dc=M(37,39),Bt=M(90,39),_c=M(90,39),Nc=M(40,49),Mc=M(41,49),Lc=M(42,49),Fc=M(43,49),$c=M(44,49),Vc=M(45,49),qc=M(46,49),Uc=M(47,49);var jc=100,zo=["green","yellow","blue","magenta","cyan","red"],Qt=[],Yo=Date.now(),Bc=0,li=typeof process<"u"?process.env:{};globalThis.DEBUG??=li.DEBUG??"";globalThis.DEBUG_COLORS??=li.DEBUG_COLORS?li.DEBUG_COLORS==="true":!0;var Ht={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 Qc(e){let t={color:zo[Bc++%zo.length],enabled:Ht.enabled(e),namespace:e,log:Ht.log,extend:()=>{}},r=(...n)=>{let{enabled:i,namespace:o,color:s,log:a}=t;if(n.length!==0&&Qt.push([o,...n]),Qt.length>jc&&Qt.shift(),Ht.enabled(o)||i){let l=n.map(c=>typeof c=="string"?c:Hc(c)),u=`+${Date.now()-Yo}ms`;Yo=Date.now(),globalThis.DEBUG_COLORS?a(Jr[s](re(o)),...l,Jr[s](u)):a(o,...l,u)}};return new Proxy(r,{get:(n,i)=>t[i],set:(n,i,o)=>t[i]=o})}var q=new Proxy(Qc,{get:(e,t)=>Ht[t],set:(e,t,r)=>Ht[t]=r});function Hc(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 Zo(e=7500){let t=Qt.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 Xo(){Qt.length=0}var es=q;var Wc=ts(),ui=Wc.version;function ut(e){let t=Jc();return t||(e?.config.engineType==="library"?"library":e?.config.engineType==="binary"?"binary":e?.config.engineType==="client"?"client":Kc(e))}function Jc(){let e=process.env.PRISMA_CLIENT_ENGINE_TYPE;return e==="library"?"library":e==="binary"?"binary":e==="client"?"client":void 0}function Kc(e){return e?.previewFeatures.includes("queryCompiler")?"client":"library"}var is=j(ns(),1);function ci(e){let t=(0,is.default)(e);if(t===0)return e;let r=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(r,"")}var os="prisma+postgres",Kr=`${os}:`;function zr(e){return e?.toString().startsWith(`${Kr}//`)??!1}function pi(e){if(!zr(e))return!1;let{host:t}=new URL(e);return t.includes("localhost")||t.includes("127.0.0.1")}var Wt={};lt(Wt,{error:()=>Zc,info:()=>Yc,log:()=>zc,query:()=>Xc,should:()=>ls,tags:()=>Gt,warn:()=>di});var Gt={error:Ce("prisma:error"),warn:We("prisma:warn"),info:Se("prisma:info"),query:Je("prisma:query")},ls={warn:()=>!process.env.PRISMA_DISABLE_WARNINGS};function zc(...e){console.log(...e)}function di(e,...t){ls.warn()&&console.warn(`${Gt.warn} ${e}`,...t)}function Yc(e,...t){console.info(`${Gt.info} ${e}`,...t)}function Zc(e,...t){console.error(`${Gt.error} ${e}`,...t)}function Xc(e,...t){console.log(`${Gt.query} ${e}`,...t)}function fe(e,t){throw new Error(t)}var Jt=j(require("node:path"));function fi(e){return Jt.default.sep===Jt.default.posix.sep?e:e.split(Jt.default.sep).join(Jt.default.posix.sep)}var wi=j(ys()),Yr=j(require("node:fs"));var ct=j(require("node:path"));function ws(e){let t=e.ignoreProcessEnv?{}:process.env,r=n=>n.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g)?.reduce(function(o,s){let a=/(.?)\${([a-zA-Z0-9_]+)?}/g.exec(s);if(!a)return o;let l=a[1],u,c;if(l==="\\")c=a[0],u=c.replace("\\$","$");else{let p=a[2];c=a[0].substring(l.length),u=Object.hasOwnProperty.call(t,p)?t[p]:e.parsed[p]||"",u=r(u)}return o.replace(c,u)},n)??n;for(let n in e.parsed){let i=Object.hasOwnProperty.call(t,n)?t[n]:e.parsed[n];e.parsed[n]=r(i)}for(let n in e.parsed)t[n]=e.parsed[n];return e}var yi=es("prisma:tryLoadEnv");function zt({rootEnvPath:e,schemaEnvPath:t},r={conflictCheck:"none"}){let n=Es(e);r.conflictCheck!=="none"&&gp(n,t,r.conflictCheck);let i=null;return xs(n?.path,t)||(i=Es(t)),!n&&!i&&yi("No Environment variables loaded"),i?.dotenvResult.error?console.error(Ce(re("Schema Env Error: "))+i.dotenvResult.error):{message:[n?.message,i?.message].filter(Boolean).join(` `),parsed:{...n?.dotenvResult?.parsed,...i?.dotenvResult?.parsed}}}function gp(e,t,r){let n=e?.dotenvResult.parsed,i=!xs(e?.path,t);if(n&&t&&i&&Yr.default.existsSync(t)){let o=wi.default.parse(Yr.default.readFileSync(t)),s=[];for(let a in o)n[a]===o[a]&&s.push(a);if(s.length>0){let a=ct.default.relative(process.cwd(),e.path),l=ct.default.relative(process.cwd(),t);if(r==="error"){let u=`There is a conflict between env var${s.length>1?"s":""} in ${se(a)} and ${se(l)} Conflicting env vars: ${s.map(c=>` ${re(c)}`).join(` `)} We suggest to move the contents of ${se(l)} to ${se(a)} to consolidate your env vars. `;throw new Error(u)}else if(r==="warn"){let u=`Conflict for env var${s.length>1?"s":""} ${s.map(c=>re(c)).join(", ")} in ${se(a)} and ${se(l)} Env vars from ${se(l)} overwrite the ones from ${se(a)} `;console.warn(`${We("warn(prisma)")} ${u}`)}}}}function Es(e){if(hp(e)){yi(`Environment variables loaded from ${e}`);let t=wi.default.config({path:e,debug:process.env.DOTENV_CONFIG_DEBUG?!0:void 0});return{dotenvResult:ws(t),message:Ge(`Environment variables loaded from ${ct.default.relative(process.cwd(),e)}`),path:e}}else yi(`Environment variables not found at ${e}`);return null}function xs(e,t){return e&&t&&ct.default.resolve(e)===ct.default.resolve(t)}function hp(e){return!!(e&&Yr.default.existsSync(e))}function Ei(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function pt(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n],n);return r}function xi(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 b(e,t){Object.defineProperty(e,"name",{value:t,configurable:!0})}var Ps=new Set,Yt=(e,t,...r)=>{Ps.has(e)||(Ps.add(e),di(t,...r))};var k=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"}};b(k,"PrismaClientInitializationError");var Q=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"}};b(Q,"PrismaClientKnownRequestError");var ne=class extends Error{clientVersion;constructor(t,r){super(t),this.name="PrismaClientRustPanicError",this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientRustPanicError"}};b(ne,"PrismaClientRustPanicError");var X=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"}};b(X,"PrismaClientUnknownRequestError");var ee=class extends Error{name="PrismaClientValidationError";clientVersion;constructor(t,{clientVersion:r}){super(t),this.clientVersion=r}get[Symbol.toStringTag](){return"PrismaClientValidationError"}};b(ee,"PrismaClientValidationError");var dt=9e15,Fe=1e9,bi="0123456789abcdef",tn="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",rn="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Pi={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-dt,maxE:dt,crypto:!1},Ss,Ie,x=!0,on="[DecimalError] ",Le=on+"Invalid argument: ",Rs=on+"Precision limit exceeded",Is=on+"crypto unavailable",ks="[object Decimal]",te=Math.floor,H=Math.pow,yp=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,wp=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ep=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Os=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ge=1e7,E=7,xp=9007199254740991,bp=tn.length-1,vi=rn.length-1,f={toStringTag:ks};f.absoluteValue=f.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),y(e)};f.ceil=function(){return y(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(Le+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,u=e.s;if(!s||!a)return!l||!u?NaN:l!==u?l:s===a?0:!s^l<0?1:-1;if(!s[0]||!a[0])return s[0]?l:a[0]?-u:0;if(l!==u)return l;if(o.e!==e.e)return o.e>e.e^l<0?1:-1;for(n=s.length,i=a.length,t=0,r=n<i?n:i;t<r;++t)if(s[t]!==a[t])return s[t]>a[t]^l<0?1:-1;return n===i?0:n>i^l<0?1:-1};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=Pp(n,Ls(n,r)),n.precision=e,n.rounding=t,y(Ie==2||Ie==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,u,c=this,p=c.constructor;if(!c.isFinite()||c.isZero())return new p(c);for(x=!1,o=c.s*H(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=J(c.d),e=c.e,(o=(e-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=H(r,1/3),e=te((e+1)/3)-(e%3==(e<0?-1:2)),o==1/0?r="5e"+e:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+e),n=new p(r),n.s=c.s):n=new p(o.toString()),s=(e=p.precision)+3;;)if(a=n,l=a.times(a).times(a),u=l.plus(c),n=N(u.plus(c).times(a),u.plus(l),s+2,1),J(a.d).slice(0,s)===(r=J(n.d)).slice(0,s))if(r=r.slice(s-3,s+1),r=="9999"||!i&&r=="4999"){if(!i&&(y(a,e+1,0),a.times(a).times(a).eq(c))){n=a;break}s+=4,i=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(n,e+1,1),t=!n.times(n).times(n).eq(c));break}return x=!0,y(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-te(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 N(this,new this.constructor(e))};f.dividedToIntegerBy=f.divToInt=function(e){var t=this,r=t.constructor;return y(N(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 y(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/an(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),o=mt(s,1,o.times(t),new s(1),!0);for(var l,u=e,c=new s(8);u--;)l=o.times(o),o=a.minus(l.times(c.minus(l.times(c))));return y(o,s.precision=r,s.rounding=n,!0)};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=mt(o,2,i,i,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,i=i.times(1/an(5,e)),i=mt(o,2,i,i,!0);for(var s,a=new o(5),l=new o(16),u=new o(20);e--;)s=i.times(i),i=i.times(a.plus(s.times(l.times(s).plus(u))))}return o.precision=t,o.rounding=r,y(i,t,r,!0)};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,N(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()?we(t,n,i):new t(0):new t(NaN):e.isZero()?we(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,x=!1,r=r.times(r).minus(1).sqrt().plus(r),x=!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,x=!1,r=r.times(r).plus(1).sqrt().plus(r),x=!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?y(new o(i),e,t,!0):(o.precision=r=n-i.e,i=N(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=we(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,u=this,c=u.constructor,p=c.precision,d=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&p+4<=vi)return s=we(c,p+4,d).times(.25),s.s=u.s,s}else{if(!u.s)return new c(NaN);if(p+4<=vi)return s=we(c,p+4,d).times(.5),s.s=u.s,s}for(c.precision=a=p+10,c.rounding=1,r=Math.min(28,a/E+2|0),e=r;e;--e)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(x=!1,t=Math.ceil(a/E),n=1,l=u.times(u),s=new c(u),i=u;e!==-1;)if(i=i.times(l),o=s.minus(i.div(n+=2)),i=i.times(l),s=o.plus(i.div(n+=2)),s.d[t]!==void 0)for(e=t;s.d[e]===o.d[e]&&e--;);return r&&(s=s.times(2<<r-1)),x=!0,y(s,c.precision=p,c.rounding=d,!0)};f.isFinite=function(){return!!this.d};f.isInteger=f.isInt=function(){return!!this.d&&te(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,u=this,c=u.constructor,p=c.precision,d=c.rounding,m=5;if(e==null)e=new c(10),t=!0;else{if(e=new c(e),r=e.d,e.s<0||!r||!r[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(t)if(r.length>1)o=!0;else{for(i=r[0];i%10===0;)i/=10;o=i!==1}if(x=!1,a=p+m,s=Me(u,a),n=t?nn(c,a+10):Me(e,a),l=N(s,n,a,1),Zt(l.d,i=p,d))do if(a+=10,s=Me(u,a),n=t?nn(c,a+10):Me(e,a),l=N(s,n,a,1),!o){+J(l.d).slice(i+1,i+15)+1==1e14&&(l=y(l,p+1,0));break}while(Zt(l.d,i+=10,d));return x=!0,y(l,p,d)};f.minus=f.sub=function(e){var t,r,n,i,o,s,a,l,u,c,p,d,m=this,g=m.constructor;if(e=new g(e),!m.d||!e.d)return!m.s||!e.s?e=new g(NaN):m.d?e.s=-e.s:e=new g(e.d||m.s!==e.s?m:NaN),e;if(m.s!=e.s)return e.s=-e.s,m.plus(e);if(u=m.d,d=e.d,a=g.precision,l=g.rounding,!u[0]||!d[0]){if(d[0])e.s=-e.s;else if(u[0])e=new g(m);else return new g(l===3?-0:0);return x?y(e,a,l):e}if(r=te(e.e/E),c=te(m.e/E),u=u.slice(),o=c-r,o){for(p=o<0,p?(t=u,o=-o,s=d.length):(t=d,r=c,s=u.length),n=Math.max(Math.ceil(a/E),s)+2,o>n&&(o=n,t.length=1),t.reverse(),n=o;n--;)t.push(0);t.reverse()}else{for(n=u.length,s=d.length,p=n<s,p&&(s=n),n=0;n<s;n++)if(u[n]!=d[n]){p=u[n]<d[n];break}o=0}for(p&&(t=u,u=d,d=t,e.s=-e.s),s=u.length,n=d.length-s;n>0;--n)u[s++]=0;for(n=d.length;n>o;){if(u[--n]<d[n]){for(i=n;i&&u[--i]===0;)u[i]=ge-1;--u[i],u[n]+=ge}u[n]-=d[n]}for(;u[--s]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(e.d=u,e.e=sn(u,r),x?y(e,a,l):e):new g(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]?y(new n(r),n.precision,n.rounding):(x=!1,n.modulo==9?(t=N(r,e.abs(),0,3,1),t.s*=e.s):t=N(r,e,0,n.modulo,1),t=t.times(e),x=!0,r.minus(t))};f.naturalExponential=f.exp=function(){return Ti(this)};f.naturalLogarithm=f.ln=function(){return Me(this)};f.negated=f.neg=function(){var e=new this.constructor(this);return e.s=-e.s,y(e)};f.plus=f.add=function(e){var t,r,n,i,o,s,a,l,u,c,p=this,d=p.constructor;if(e=new d(e),!p.d||!e.d)return!p.s||!e.s?e=new d(NaN):p.d||(e=new d(e.d||p.s===e.s?p:NaN)),e;if(p.s!=e.s)return e.s=-e.s,p.minus(e);if(u=p.d,c=e.d,a=d.precision,l=d.rounding,!u[0]||!c[0])return c[0]||(e=new d(p)),x?y(e,a,l):e;if(o=te(p.e/E),n=te(e.e/E),u=u.slice(),i=o-n,i){for(i<0?(r=u,i=-i,s=c.length):(r=c,n=o,s=u.length),o=Math.ceil(a/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=u.length,i=c.length,s-i<0&&(i=s,r=c,c=u,u=r),t=0;i;)t=(u[--i]=u[i]+c[i]+t)/ge|0,u[i]%=ge;for(t&&(u.unshift(t),++n),s=u.length;u[--s]==0;)u.pop();return e.d=u,e.e=sn(u,n),x?y(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(Le+e);return r.d?(t=Ds(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t};f.round=function(){var e=this,t=e.constructor;return y(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=Tp(n,Ls(n,r)),n.precision=e,n.rounding=t,y(Ie>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,u=s.s,c=s.constructor;if(u!==1||!a||!a[0])return new c(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);for(x=!1,u=Math.sqrt(+s),u==0||u==1/0?(t=J(a),(t.length+l)%2==0&&(t+="0"),u=Math.sqrt(t),l=te((l+1)/2)-(l<0||l%2),u==1/0?t="5e"+l:(t=u.toExponential(),t=t.slice(0,t.indexOf("e")+1)+l),n=new c(t)):n=new c(u.toString()),r=(l=c.precision)+3;;)if(o=n,n=o.plus(N(s,o,r+2,1)).times(.5),J(o.d).slice(0,r)===(t=J(n.d)).slice(0,r))if(t=t.slice(r-3,r+1),t=="9999"||!i&&t=="4999"){if(!i&&(y(o,l+1,0),o.times(o).eq(s))){n=o;break}r+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(y(n,l+1,1),e=!n.times(n).eq(s));break}return x=!0,y(n,l,c.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=N(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,y(Ie==2||Ie==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,u,c=this,p=c.constructor,d=c.d,m=(e=new p(e)).d;if(e.s*=c.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=te(c.e/E)+te(e.e/E),l=d.length,u=m.length,l<u&&(o=d,d=m,m=o,s=l,l=u,u=s),o=[],s=l+u,n=s;n--;)o.push(0);for(n=u;--n>=0;){for(t=0,i=l+n;i>n;)a=o[i]+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=sn(o,r),x?y(e,p.precision,p.rounding):e};f.toBinary=function(e,t){return Ai(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:(ae(e,0,Fe),t===void 0?t=n.rounding:ae(t,0,8),y(r,e+r.e+1,t))};f.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ee(n,!0):(ae(e,0,Fe),t===void 0?t=i.rounding:ae(t,0,8),n=y(new i(n),e+1,t),r=Ee(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=Ee(i):(ae(e,0,Fe),t===void 0?t=o.rounding:ae(t,0,8),n=y(new o(i),e+i.e+1,t),r=Ee(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,u,c,p,d,m=this,g=m.d,h=m.constructor;if(!g)return new h(m);if(u=r=new h(1),n=l=new h(0),t=new h(n),o=t.e=Ds(g)-m.e-1,s=o%E,t.d[0]=H(10,s<0?E+s:s),e==null)e=o>0?t:u;else{if(a=new h(e),!a.isInt()||a.lt(u))throw Error(Le+a);e=a.gt(t)?o>0?t:u:a}for(x=!1,a=new h(J(g)),c=h.precision,h.precision=o=g.length*E*2;p=N(a,t,0,1,1),i=r.plus(p.times(n)),i.cmp(e)!=1;)r=n,n=i,i=u,u=l.plus(p.times(i)),l=i,i=t,t=a.minus(p.times(i)),a=i;return i=N(e.minus(r),n,0,1,1),l=l.plus(i.times(u)),r=r.plus(i.times(n)),l.s=u.s=m.s,d=N(u,n,o,1).minus(m).abs().cmp(N(l,r,o,1).minus(m).abs())<1?[u,n]:[l,r],h.precision=c,x=!0,d};f.toHexadecimal=f.toHex=function(e,t){return Ai(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:ae(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]?(x=!1,r=N(r,e,0,t,1).times(e),x=!0,y(r)):(e.s=r.s,r=e),r};f.toNumber=function(){return+this};f.toOctal=function(e,t){return Ai(this,8,e,t)};f.toPower=f.pow=function(e){var t,r,n,i,o,s,a=this,l=a.constructor,u=+(e=new l(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new l(H(+a,u));if(a=new l(a),a.eq(1))return a;if(n=l.precision,o=l.rounding,e.eq(1))return y(a,n,o);if(t=te(e.e/E),t>=e.d.length-1&&(r=u<0?-u:u)<=xp)return i=_s(l,a,r,n),e.s<0?new l(1).div(i):y(i,n,o);if(s=a.s,s<0){if(t<e.d.length-1)return new l(NaN);if((e.d[t]&1)==0&&(s=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=s,a}return r=H(+a,u),t=r==0||!isFinite(r)?te(u*(Math.log("0."+J(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):(x=!1,l.rounding=a.s=1,r=Math.min(12,(t+"").length),i=Ti(e.times(Me(a,n+r)),n),i.d&&(i=y(i,n+5,1),Zt(i.d,n,o)&&(t=n+10,i=y(Ti(e.times(Me(a,t+r)),t),t+5,1),+J(i.d).slice(n+1,n+15)+1==1e14&&(i=y(i,n+1,0)))),i.s=s,x=!0,l.rounding=o,y(i,n,o))};f.toPrecision=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ee(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(ae(e,1,Fe),t===void 0?t=i.rounding:ae(t,0,8),n=y(new i(n),e,t),r=Ee(n,e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r};f.toSignificantDigits=f.toSD=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ae(e,1,Fe),t===void 0?t=n.rounding:ae(t,0,8)),y(new n(r),e,t)};f.toString=function(){var e=this,t=e.constructor,r=Ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r};f.truncated=f.trunc=function(){return y(new this.constructor(this),this.e+1,1)};f.valueOf=f.toJSON=function(){var e=this,t=e.constructor,r=Ee(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};function J(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;t<i;t++)n=e[t]+"",r=E-n.length,r&&(o+=Ne(r)),o+=n;s=e[t],n=s+"",r=E-n.length,r&&(o+=Ne(r))}else if(s===0)return"0";for(;s%10===0;)s/=10;return o+s}function ae(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Le+e)}functio