UNPKG

next

Version:

The React Framework

1 lines • 283 kB
(()=>{var __webpack_modules__={4816:(e,t,s)=>{"use strict";e.exports=t;const r=s(9896);const o=s(6928);const a=s(1825);const c=s(1916);const u=s(7650);const d=s(4434).EventEmitter;const h=s(9023).inherits;const f=["clean","install","reinstall","build","rebuild","package","testpackage","publish","unpublish","info","testbinary","reveal","configure"];const p={};Object.defineProperty(t,"find",{get:function(){return s(2520).find},enumerable:true});function Run({package_json_path:e="./package.json",argv:t}){this.package_json_path=e;this.commands={};const s=this;f.forEach((e=>{s.commands[e]=function(t,r){c.verbose("command",e,t);return require("./"+e)(s,t,r)}}));this.parseArgv(t);this.binaryHostSet=false}h(Run,d);t.Run=Run;const y=Run.prototype;y.package=s(9355);y.configDefs={help:Boolean,arch:String,debug:Boolean,directory:String,proxy:String,loglevel:String,acl:String};y.shorthands={release:"--no-debug",C:"--directory",debug:"--debug",j:"--jobs",silent:"--loglevel=silent",silly:"--loglevel=silly",verbose:"--loglevel=verbose"};y.aliases=p;y.parseArgv=function parseOpts(e){this.opts=a(this.configDefs,this.shorthands,e);this.argv=this.opts.argv.remain.slice();const t=this.todo=[];e=this.argv.map((e=>{if(e in this.aliases){e=this.aliases[e]}return e}));e.slice().forEach((s=>{if(s in this.commands){const r=e.splice(0,e.indexOf(s));e.shift();if(t.length>0){t[t.length-1].args=r}t.push({name:s,args:[]})}}));if(t.length>0){t[t.length-1].args=e.splice(0)}let s=this.package_json_path;if(this.opts.directory){s=o.join(this.opts.directory,s)}this.package_json=JSON.parse(r.readFileSync(s));this.todo=u.expand_commands(this.package_json,this.opts,t);const d="npm_config_";Object.keys(process.env).forEach((e=>{if(e.indexOf(d)!==0)return;const t=process.env[e];if(e===d+"loglevel"){c.level=t}else{e=e.substring(d.length);if(e==="argv"){if(this.opts.argv&&this.opts.argv.remain&&this.opts.argv.remain.length){}else{this.opts[e]=t}}else{this.opts[e]=t}}}));if(this.opts.loglevel){c.level=this.opts.loglevel}c.resume()};y.setBinaryHostProperty=function(e){if(this.binaryHostSet){return this.package_json.binary.host}const t=this.package_json;if(!t||!t.binary||t.binary.host){return""}if(!t.binary.staging_host||!t.binary.production_host){return""}let s="production_host";if(e==="publish"||e==="unpublish"){s="staging_host"}const r=process.env.node_pre_gyp_s3_host;if(r==="staging"||r==="production"){s=`${r}_host`}else if(this.opts["s3_host"]==="staging"||this.opts["s3_host"]==="production"){s=`${this.opts["s3_host"]}_host`}else if(this.opts["s3_host"]||r){throw new Error(`invalid s3_host ${this.opts["s3_host"]||r}`)}t.binary.host=t.binary[s];this.binaryHostSet=true;return t.binary.host};y.usage=function usage(){const e=[""," Usage: node-pre-gyp <command> [options]",""," where <command> is one of:",f.map((e=>" - "+e+" - "+require("./"+e).usage)).join("\n"),"","node-pre-gyp@"+this.version+" "+o.resolve(__dirname,".."),"node@"+process.versions.node].join("\n");return e};Object.defineProperty(y,"version",{get:function(){return this.package.version},enumerable:true})},2520:(e,t,s)=>{"use strict";const r=s(4816);const o=s(7548);const a=s(7650);const c=s(9896).existsSync||s(6928).existsSync;const u=s(6928);e.exports=t;t.usage="Finds the require path for the node-pre-gyp installed module";t.validate=function(e,t){o.validate_config(e,t)};t.find=function(e,t){if(!c(e)){throw new Error(e+"does not exist")}const s=new r.Run({package_json_path:e,argv:process.argv});s.setBinaryHostProperty();const d=s.package_json;o.validate_config(d,t);let h;if(a.get_napi_build_versions(d,t)){h=a.get_best_napi_build_version(d,t)}t=t||{};if(!t.module_root)t.module_root=u.dirname(e);const f=o.evaluate(d,t,h);return f.module}},1916:(e,t,s)=>{"use strict";const{createConsola:r}=s(86);const o=r({stdout:process.stderr});e.exports=t=o},7650:(e,t,s)=>{"use strict";const r=s(9896);e.exports=t;const o=process.version.substr(1).replace(/-.*$/,"").split(".").map((e=>+e));const a=["build","clean","configure","package","publish","reveal","testbinary","testpackage","unpublish"];const c="napi_build_version=";e.exports.get_napi_version=function(){let e=process.versions.napi;if(!e){if(o[0]===9&&o[1]>=3)e=2;else if(o[0]===8)e=1}return e};e.exports.get_napi_version_as_string=function(t){const s=e.exports.get_napi_version(t);return s?""+s:""};e.exports.validate_package_json=function(t,s){const r=t.binary;const o=pathOK(r.module_path);const a=pathOK(r.remote_path);const c=pathOK(r.package_name);const u=e.exports.get_napi_build_versions(t,s,true);const d=e.exports.get_napi_build_versions_raw(t);if(u){u.forEach((e=>{if(!(parseInt(e,10)===e&&e>0)){throw new Error("All values specified in napi_versions must be positive integers.")}}))}if(u&&(!o||!a&&!c)){throw new Error("When napi_versions is specified; module_path and either remote_path or "+"package_name must contain the substitution string '{napi_build_version}`.")}if((o||a||c)&&!d){throw new Error("When the substitution string '{napi_build_version}` is specified in "+"module_path, remote_path, or package_name; napi_versions must also be specified.")}if(u&&!e.exports.get_best_napi_build_version(t,s)&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(s?s.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}if(d&&!u&&e.exports.build_napi_only(t)){throw new Error("The Node-API version of this Node instance is "+e.exports.get_napi_version(s?s.target:undefined)+". "+"This module supports Node-API version(s) "+e.exports.get_napi_build_versions_raw(t)+". "+"This Node instance cannot run this module.")}};function pathOK(e){return e&&(e.indexOf("{napi_build_version}")!==-1||e.indexOf("{node_napi_label}")!==-1)}e.exports.expand_commands=function(t,s,r){const o=[];const u=e.exports.get_napi_build_versions(t,s);r.forEach((r=>{if(u&&r.name==="install"){const a=e.exports.get_best_napi_build_version(t,s);const u=a?[c+a]:[];o.push({name:r.name,args:u})}else if(u&&a.indexOf(r.name)!==-1){u.forEach((e=>{const t=r.args.slice();t.push(c+e);o.push({name:r.name,args:t})}))}else{o.push(r)}}));return o};e.exports.get_napi_build_versions=function(t,r,o){const a=s(1916);let c=[];const u=e.exports.get_napi_version(r?r.target:undefined);if(t.binary&&t.binary.napi_versions){t.binary.napi_versions.forEach((e=>{const t=c.indexOf(e)!==-1;if(!t&&u&&e<=u){c.push(e)}else if(o&&!t&&u){a.info("This Node instance does not support builds for Node-API version",e)}}))}if(r&&r["build-latest-napi-version-only"]){let e=0;c.forEach((t=>{if(t>e)e=t}));c=e?[e]:[]}return c.length?c:undefined};e.exports.get_napi_build_versions_raw=function(e){const t=[];if(e.binary&&e.binary.napi_versions){e.binary.napi_versions.forEach((e=>{if(t.indexOf(e)===-1){t.push(e)}}))}return t.length?t:undefined};e.exports.get_command_arg=function(e){return c+e};e.exports.get_napi_build_version_from_command_args=function(e){for(let t=0;t<e.length;t++){const s=e[t];if(s.indexOf(c)===0){return parseInt(s.substr(c.length),10)}}return undefined};e.exports.swap_build_dir_out=function(t){if(t){r.rmSync(e.exports.get_build_dir(t),{recursive:true,force:true});r.renameSync("build",e.exports.get_build_dir(t))}};e.exports.swap_build_dir_in=function(t){if(t){r.rmSync("build",{recursive:true,force:true});r.renameSync(e.exports.get_build_dir(t),"build")}};e.exports.get_build_dir=function(e){return"build-tmp-napi-v"+e};e.exports.get_best_napi_build_version=function(t,s){let r=0;const o=e.exports.get_napi_build_versions(t,s);if(o){const t=e.exports.get_napi_version(s?s.target:undefined);o.forEach((e=>{if(e>r&&e<=t){r=e}}))}return r===0?undefined:r};e.exports.build_napi_only=function(e){return e.binary&&e.binary.package_name&&e.binary.package_name.indexOf("{node_napi_label}")===-1}},7548:(e,t,s)=>{"use strict";e.exports=t;const r=s(6928);const o=s(1808);const a=s(7016);const c=s(748);const u=s(7650);let d;if(process.env.NODE_PRE_GYP_ABI_CROSSWALK){d=require(process.env.NODE_PRE_GYP_ABI_CROSSWALK)}else{d=s(7638)}const h={};Object.keys(d).forEach((e=>{const t=e.split(".")[0];if(!h[t]){h[t]=e}}));function get_electron_abi(e,t){if(!e){throw new Error("get_electron_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if electron is the target.")}const s=o.parse(t);return e+"-v"+s.major+"."+s.minor}e.exports.get_electron_abi=get_electron_abi;function get_node_webkit_abi(e,t){if(!e){throw new Error("get_node_webkit_abi requires valid runtime arg")}if(typeof t==="undefined"){throw new Error("Empty target version is not supported if node-webkit is the target.")}return e+"-v"+t}e.exports.get_node_webkit_abi=get_node_webkit_abi;function get_node_abi(e,t){if(!e){throw new Error("get_node_abi requires valid runtime arg")}if(!t){throw new Error("get_node_abi requires valid process.versions object")}const s=o.parse(t.node);if(s.major===0&&s.minor%2){return e+"-v"+t.node}else{return t.modules?e+"-v"+ +t.modules:"v8-"+t.v8.split(".").slice(0,2).join(".")}}e.exports.get_node_abi=get_node_abi;function get_runtime_abi(e,t){if(!e){throw new Error("get_runtime_abi requires valid runtime arg")}if(e==="node-webkit"){return get_node_webkit_abi(e,t||process.versions["node-webkit"])}else if(e==="electron"){return get_electron_abi(e,t||process.versions.electron)}else{if(e!=="node"){throw new Error("Unknown Runtime: '"+e+"'")}if(!t){return get_node_abi(e,process.versions)}else{let s;if(d[t]){s=d[t]}else{const e=t.split(".").map((e=>+e));if(e.length!==3){throw new Error("Unknown target version: "+t)}const r=e[0];let o=e[1];let a=e[2];if(r===1){while(true){if(o>0)--o;if(a>0)--a;const e=""+r+"."+o+"."+a;if(d[e]){s=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}if(o===0&&a===0){break}}}else if(r>=2){if(h[r]){s=d[h[r]];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+h[r]+" as ABI compatible target")}}else if(r===0){if(e[1]%2===0){while(--a>0){const e=""+r+"."+o+"."+a;if(d[e]){s=d[e];console.log("Warning: node-pre-gyp could not find exact match for "+t);console.log("Warning: but node-pre-gyp successfully choose "+e+" as ABI compatible target");break}}}}}if(!s){throw new Error("Unsupported target version: "+t)}const r={node:t,v8:s.v8+".0",modules:s.node_abi>1?s.node_abi:undefined};return get_node_abi(e,r)}}}e.exports.get_runtime_abi=get_runtime_abi;const f=["module_name","module_path","host"];function validate_config(e,t){const s=e.name+" package.json is not node-pre-gyp ready:\n";const r=[];if(!e.main){r.push("main")}if(!e.version){r.push("version")}if(!e.name){r.push("name")}if(!e.binary){r.push("binary")}const o=e.binary;if(o){f.forEach((e=>{if(!o[e]||typeof o[e]!=="string"){r.push("binary."+e)}}))}if(r.length>=1){throw new Error(s+"package.json must declare these properties: \n"+r.join("\n"))}if(o){const e=a.parse(o.host).protocol;if(e==="http:"){throw new Error("'host' protocol ("+e+") is invalid - only 'https:' is accepted")}}u.validate_package_json(e,t)}e.exports.validate_config=validate_config;function eval_template(e,t){Object.keys(t).forEach((s=>{const r="{"+s+"}";while(e.indexOf(r)>-1){e=e.replace(r,t[s])}}));return e}function fix_slashes(e){if(e.slice(-1)!=="/"){return e+"/"}return e}function drop_double_slashes(e){return e.replace(/\/\//g,"/")}function get_process_runtime(e){let t="node";if(e["node-webkit"]){t="node-webkit"}else if(e.electron){t="electron"}return t}e.exports.get_process_runtime=get_process_runtime;const p="{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz";const y="";e.exports.evaluate=function(e,t,s){t=t||{};validate_config(e,t);const d=e.version;const h=o.parse(d);const f=t.runtime||get_process_runtime(process.versions);const g={name:e.name,configuration:t.debug?"Debug":"Release",debug:t.debug,module_name:e.binary.module_name,version:h.version,prerelease:h.prerelease.length?h.prerelease.join("."):"",build:h.build.length?h.build.join("."):"",major:h.major,minor:h.minor,patch:h.patch,runtime:f,node_abi:get_runtime_abi(f,t.target),node_abi_napi:u.get_napi_version(t.target)?"napi":get_runtime_abi(f,t.target),napi_version:u.get_napi_version(t.target),napi_build_version:s||"",node_napi_label:s?"napi-v"+s:get_runtime_abi(f,t.target),target:t.target||"",platform:t.target_platform||process.platform,target_platform:t.target_platform||process.platform,arch:t.target_arch||process.arch,target_arch:t.target_arch||process.arch,libc:t.target_libc||c.familySync()||"unknown",module_main:e.main,toolset:t.toolset||"",bucket:e.binary.bucket,region:e.binary.region,s3ForcePathStyle:e.binary.s3ForcePathStyle||false,acl:t.acl||e.binary.acl||"public-read"};const v=g.module_name.replace("-","_");const _=process.env["npm_config_"+v+"_binary_host_mirror"]||e.binary.host;g.host=fix_slashes(eval_template(_,g));g.module_path=eval_template(e.binary.module_path,g);if(t.module_root){g.module_path=r.join(t.module_root,g.module_path)}else{g.module_path=r.resolve(g.module_path)}g.module=r.join(g.module_path,g.module_name+".node");g.remote_path=e.binary.remote_path?drop_double_slashes(fix_slashes(eval_template(e.binary.remote_path,g))):y;const w=e.binary.package_name?e.binary.package_name:p;g.package_name=eval_template(w,g);g.staged_tarball=r.join("build/stage",g.remote_path,g.package_name);if(g.s3ForcePathStyle){g.hosted_path=a.resolve(g.host,drop_double_slashes(`${g.bucket}/${g.remote_path}`))}else{g.hosted_path=a.resolve(g.host,g.remote_path)}g.hosted_tarball=a.resolve(g.hosted_path,g.package_name);return g}},3559:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t["default"]=analyze;const o=r(s(6928));const a=s(1973);const c=s(7574);const u=s(8222);const d=s(7413);const h=r(s(8441));const f=s(4065);const p=s(7686);const y=s(4720);const g=s(7458);const v=s(6282);const _=r(s(2690));const w=r(s(5501));const x=r(s(909));const S=r(s(4816));const k=s(7016);const E=d.Parser.extend(s(2487).PV);const O=r(s(857));const j=r(s(7016));const A=s(1981);const T=r(s(4988));const P={cwd:()=>X,env:{NODE_ENV:u.UNKNOWN,[u.UNKNOWN]:true},[u.UNKNOWN]:true};const L=Symbol();const F=Symbol();const R=Symbol();const C=Symbol();const I=Symbol();const D=Symbol();const N=Symbol();const M=Symbol();const W=Symbol();const B=Symbol();const $=Symbol();const z={access:M,accessSync:M,createReadStream:M,exists:M,existsSync:M,fstat:M,fstatSync:M,lstat:M,lstatSync:M,open:M,readdir:W,readdirSync:W,readFile:M,readFileSync:M,stat:M,statSync:M};const U={...z,pathExists:M,pathExistsSync:M,readJson:M,readJSON:M,readJsonSync:M,readJSONSync:M};const q=Symbol();const G=Symbol();const V={register:q,createRequire:G};const H=Object.assign(Object.create(null),{bindings:{default:B},express:{default:function(){return{[u.UNKNOWN]:true,set:L,engine:F}}},fs:{default:z,...z},module:{default:V,...V},"fs-extra":{default:U,...U},"graceful-fs":{default:z,...z},process:{default:P,...P},path:{default:{}},os:{default:O.default,...O.default},url:{default:j.default,...j.default},"@mapbox/node-pre-gyp":{default:S.default,...S.default},"node-pre-gyp":g.pregyp,"node-pre-gyp/lib/pre-binding":g.pregyp,"node-pre-gyp/lib/pre-binding.js":g.pregyp,"node-gyp-build":{default:$},"@aminya/node-gyp-build":{default:$},nbind:{init:R,default:{init:R}},"resolve-from":{default:T.default},"strong-globalize":{default:{SetRootDir:C},SetRootDir:C},pkginfo:{default:N},pino:{default:{[u.UNKNOWN]:true,transport:I},transport:I},fastify:{default:D}});const K={_interopRequireDefault:v.normalizeDefaultRequire,_interopRequireWildcard:v.normalizeWildcardRequire,__importDefault:v.normalizeDefaultRequire,__importStar:v.normalizeWildcardRequire,MONGOOSE_DRIVER_PATH:undefined,URL:k.URL,Object:{assign:Object.assign}};K.global=K.GLOBAL=K.globalThis=K;const J=Symbol();g.pregyp.find[J]=true;const Y=H.path;Object.keys(o.default).forEach((e=>{const t=o.default[e];if(typeof t==="function"){const s=function mockPath(){return t.apply(mockPath,arguments)};s[J]=true;Y[e]=Y.default[e]=s}else{Y[e]=Y.default[e]=t}}));Y.resolve=Y.default.resolve=function(...e){return o.default.resolve.apply(this,[X,...e])};Y.resolve[J]=true;const Q=new Set([".h",".cmake",".c",".cpp"]);const Z=new Set(["CHANGELOG.md","README.md","readme.md","changelog.md"]);let X;const ee=/^\/[^\/]+|^[a-z]:[\\/][^\\/]+/i;function isAbsolutePathOrUrl(e){if(e instanceof k.URL)return e.protocol==="file:";if(typeof e==="string"){if(e.startsWith("file:")){try{new k.URL(e);return true}catch{return false}}return ee.test(e)}return false}const te=Symbol();const ie=/([\/\\]\*\*[\/\\]\*)+/g;async function processPinoTransportObject(e,t){for(const s of e.properties){if(s.type==="Property"&&!s.computed&&s.key.type==="Identifier"){if(s.key.name==="target"&&s.value.type==="Literal"){await t(s.value)}else if((s.key.name==="targets"||s.key.name==="pipeline")&&s.value.type==="ArrayExpression"){for(const e of s.value.elements){if(e&&e.type==="ObjectExpression"){for(const s of e.properties){if(s.type==="Property"&&!s.computed&&s.key.type==="Identifier"&&s.key.name==="target"&&s.value.type==="Literal"){await t(s.value)}}}}}}}}async function analyze(e,t,s){const r=new Set;const d=new Set;const v=new Set;const S=o.default.dirname(e);X=s.cwd;const O=(0,y.getPackageBase)(e);const emitAssetDirectory=e=>{if(!s.analysis.emitGlobs)return;e=e.replaceAll(o.default.sep,o.default.posix.sep);const t=e.indexOf(u.WILDCARD);const a=t===-1?e.length:e.lastIndexOf(o.default.posix.sep,t);const c=e.substring(0,a);const d=e.slice(a);const h=d.replace(u.wildcardRegEx,((e,t)=>d[t-1]===o.default.posix.sep?"**/*":"*")).replace(ie,"/**/*")||"/**/*";if(s.ignoreFn(o.default.relative(s.base,c+h)))return;j=j.then((async()=>{if(s.log)console.log("Globbing "+c+h);const e=await(0,p.glob)(c+h,{mark:true,ignore:c+"/**/node_modules/**/*",dot:true,nodir:true});e.filter((e=>!Q.has(o.default.extname(e))&&!Z.has(o.default.basename(e)))).forEach((e=>r.add(e)))}))};let j=Promise.resolve();t=t.replace(/^#![^\n\r]*[\r\n]/,"");let z;let U=false;try{z=E.parse(t,{ecmaVersion:"latest",allowReturnOutsideFunction:true});U=false}catch(t){const r=t&&t.message&&t.message.includes("sourceType: module");if(!r){s.warnings.add(new Error(`Failed to parse ${e} as script:\n${t&&t.message}`))}}if(!z){try{z=E.parse(t,{ecmaVersion:"latest",sourceType:"module",allowAwaitOutsideFunction:true});U=true}catch(t){s.warnings.add(new Error(`Failed to parse ${e} as module:\n${t&&t.message}`));return{assets:r,deps:d,imports:v,isESM:false}}}const V=(0,k.pathToFileURL)(e).href;const Y=Object.assign(Object.create(null),{__dirname:{shadowDepth:0,value:{value:o.default.resolve(e,"..")}},__filename:{shadowDepth:0,value:{value:e}},process:{shadowDepth:0,value:{value:P}}});if(!U||s.mixedModules){Y.require={shadowDepth:0,value:{value:{[u.FUNCTION](e){d.add(e);const t=H[e.startsWith("node:")?e.slice(5):e];return t.default},resolve(t){return(0,w.default)(t,e,s)}}}};Y.require.value.value.resolve[J]=true}function setKnownBinding(e,t){if(e==="require"&&"value"in t&&t.value!==te){return}Y[e]={shadowDepth:0,value:t}}function getKnownBinding(e){const t=Y[e];if(t){if(t.shadowDepth===0){return t.value}}return undefined}function hasKnownBindingValue(e){const t=Y[e];return t&&t.shadowDepth===0}if((U||s.mixedModules)&&isAst(z)){for(const e of z.body){if(e.type==="ImportDeclaration"){const t=String(e.source.value);d.add(t);const s=H[t.startsWith("node:")?t.slice(5):t];if(s){for(const t of e.specifiers){if(t.type==="ImportNamespaceSpecifier")setKnownBinding(t.local.name,{value:s});else if(t.type==="ImportDefaultSpecifier"&&"default"in s)setKnownBinding(t.local.name,{value:s.default});else if(t.type==="ImportSpecifier"&&t.imported.name in s)setKnownBinding(t.local.name,{value:s[t.imported.name]})}}}else if(e.type==="ExportNamedDeclaration"||e.type==="ExportAllDeclaration"){if(e.source)d.add(String(e.source.value))}}}async function computePureStaticValue(e,t=true){const s=Object.create(null);Object.keys(K).forEach((e=>{s[e]={value:K[e]}}));Object.keys(Y).forEach((e=>{s[e]=getKnownBinding(e)}));s["import.meta"]={url:V};const r=await(0,u.evaluate)(e,s,t);return r}let se;let ne;let re=false;function emitWildcardRequire(e){if(!s.analysis.emitGlobs||!e.startsWith("./")&&!e.startsWith("../"))return;e=o.default.resolve(S,e).replaceAll(o.default.sep,o.default.posix.sep);const t=e.indexOf(u.WILDCARD);const r=t===-1?e.length:e.lastIndexOf(o.default.posix.sep,t);const a=e.substring(0,r);const c=e.slice(r);let h=c.replace(u.wildcardRegEx,((e,t)=>c[t-1]===o.default.posix.sep?"**/*":"*"))||"/**/*";if(!h.endsWith("*"))h+="?("+(s.ts?".ts|.tsx|":"")+".js|.json|.node)";if(s.ignoreFn(o.default.relative(s.base,a+h)))return;j=j.then((async()=>{if(s.log)console.log("Globbing "+a+h);const e=await(0,p.glob)(a+h,{mark:true,ignore:a+"/**/node_modules/**/*",nodir:true});e.filter((e=>!Q.has(o.default.extname(e))&&!Z.has(o.default.basename(e)))).forEach((e=>d.add(e)))}))}async function processRequireArg(e,t=false){if(e.type==="ConditionalExpression"){await processRequireArg(e.consequent,t);await processRequireArg(e.alternate,t);return}if(e.type==="LogicalExpression"){await processRequireArg(e.left,t);await processRequireArg(e.right,t);return}let s=await computePureStaticValue(e,true);if(!s)return;function add(e){(t?v:d).add(e)}if("value"in s&&typeof s.value==="string"){if(!s.wildcards)add(s.value);else if(s.wildcards.length>=1)emitWildcardRequire(s.value)}else{if("ifTrue"in s&&typeof s.ifTrue==="string")add(s.ifTrue);if("else"in s&&typeof s.else==="string")add(s.else)}}let oe=(0,c.attachScopes)(z,"scope");if(isAst(z)){(0,A.handleWrappers)(z);await(0,_.default)({id:e,ast:z,emitDependency:e=>d.add(e),emitAsset:e=>r.add(e),emitAssetDirectory:emitAssetDirectory,job:s})}async function backtrack(e,t){if(!se)throw new Error("Internal error: No staticChildNode for backtrack.");const s=await computePureStaticValue(e,true);if(s){if("value"in s&&typeof s.value!=="symbol"||"ifTrue"in s&&typeof s.ifTrue!=="symbol"&&typeof s.else!=="symbol"){ne=s;se=e;if(t)t.skip();return}}await emitStaticChildAsset()}await(0,a.asyncWalk)(z,{async enter(t,a){const c=t;const u=a;if(c.scope){oe=c.scope;for(const e in c.scope.declarations){if(e in Y)Y[e].shadowDepth++}}if(se)return;if(!u)return;if(c.type==="Identifier"){if((0,f.isIdentifierRead)(c,u)&&s.analysis.computeFileReferences){let e;if(typeof(e=getKnownBinding(c.name)?.value)==="string"&&e.match(ee)||e&&(typeof e==="function"||typeof e==="object")&&e[J]){ne={value:typeof e==="string"?e:undefined};se=c;await backtrack(u,this)}}}else if(s.analysis.computeFileReferences&&c.type==="MemberExpression"&&c.object.type==="MetaProperty"&&c.object.meta.name==="import"&&c.object.property.name==="meta"&&(c.property.computed?c.property.value:c.property.name)==="url"){ne={value:V};se=c;await backtrack(u,this)}else if(c.type==="ImportExpression"){await processRequireArg(c.source,true);return}else if(c.type==="CallExpression"){if((!U||s.mixedModules)&&c.callee.type==="Identifier"&&c.arguments.length){if(c.callee.name==="require"&&Y.require&&Y.require.shadowDepth===0){await processRequireArg(c.arguments[0]);return}}else if((!U||s.mixedModules)&&c.callee.type==="MemberExpression"&&c.callee.object.type==="Identifier"&&c.callee.object.name==="module"&&"module"in Y===false&&c.callee.property.type==="Identifier"&&!c.callee.computed&&c.callee.property.name==="require"&&c.arguments.length){await processRequireArg(c.arguments[0]);return}else if((!U||s.mixedModules)&&c.callee.type==="MemberExpression"&&c.callee.object.type==="Identifier"&&c.callee.object.name==="require"&&Y.require&&Y.require.shadowDepth===0&&c.callee.property.type==="Identifier"&&!c.callee.computed&&c.callee.property.name==="resolve"&&c.arguments.length){await processRequireArg(c.arguments[0]);return}const t=s.analysis.evaluatePureExpressions&&await computePureStaticValue(c.callee,false);if(t&&"value"in t&&typeof t.value==="function"&&t.value[J]&&s.analysis.computeFileReferences){ne=await computePureStaticValue(c,true);if(ne&&u){se=c;await backtrack(u,this)}}else if(t&&"value"in t&&typeof t.value==="symbol"){switch(t.value){case te:if(c.arguments.length===1&&c.arguments[0].type==="Literal"&&c.callee.type==="Identifier"&&(!Y.require||Y.require.shadowDepth===0)){await processRequireArg(c.arguments[0])}break;case B:if(c.arguments.length){const e=await computePureStaticValue(c.arguments[0],false);if(e&&"value"in e&&e.value){let t;if(typeof e.value==="object")t=e.value;else if(typeof e.value==="string")t={bindings:e.value};if(!t.path){t.path=true}t.module_root=O;let s;try{s=(0,h.default)(t)}catch(e){}if(s){ne={value:s};se=c;await emitStaticChildAsset()}}}break;case $:if(c.arguments.length){const e=await computePureStaticValue(c.arguments[0],false);if(e&&"value"in e&&e.value){const t=e.value;let s;try{const e=c?.callee?.arguments?.[0]?.value||"node-gyp-build";const r=(0,T.default)(t,e);s=require(r).path(t)}catch(e){try{s=x.default.path(t)}catch(e){}}if(s){ne={value:s};se=c;await emitStaticChildAsset()}}}break;case R:if(c.arguments.length){const e=await computePureStaticValue(c.arguments[0],false);if(e&&"value"in e&&(typeof e.value==="string"||typeof e.value==="undefined")){const t=(0,g.nbind)(e.value);if(t&&t.path){d.add(o.default.relative(S,t.path).replace(/\\/g,"/"));return this.skip()}}}break;case L:if(c.arguments.length===2&&c.arguments[0].type==="Literal"&&c.arguments[0].value==="view engine"&&!re){await processRequireArg(c.arguments[1]);return this.skip()}break;case F:re=true;break;case I:if(c.arguments.length>=1&&c.arguments[0].type==="ObjectExpression"){await processPinoTransportObject(c.arguments[0],processRequireArg);return this.skip()}break;case D:if(c.arguments.length>=1&&c.arguments[0].type==="ObjectExpression"){for(const e of c.arguments[0].properties){if(e.type==="Property"&&!e.computed&&e.key.type==="Identifier"&&e.key.name==="logger"&&e.value.type==="ObjectExpression"){for(const t of e.value.properties){if(t.type==="Property"&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="transport"&&t.value.type==="ObjectExpression"){await processPinoTransportObject(t.value,processRequireArg)}}}}}break;case M:case W:if(c.arguments[0]&&s.analysis.computeFileReferences){ne=await computePureStaticValue(c.arguments[0],true);if(ne){se=c.arguments[0];if(t.value===W&&c.arguments[0].type==="Identifier"&&c.arguments[0].name==="__dirname"){emitAssetDirectory(S)}else{await backtrack(u,this)}return this.skip()}}break;case C:if(c.arguments[0]){const e=await computePureStaticValue(c.arguments[0],false);if(e&&"value"in e&&e.value)emitAssetDirectory(e.value+"/intl");return this.skip()}break;case N:let a=o.default.resolve(e,"../package.json");const f=o.default.resolve("/package.json");while(a!==f&&await s.stat(a)===null)a=o.default.resolve(a,"../../package.json");if(a!==f)r.add(a);break;case q:if(c.arguments.length&&c.arguments[0].type==="Literal"){const e=c.arguments[0].value;if(e.startsWith(".")){const t=c.arguments.length>1?await computePureStaticValue(c.arguments[1]):undefined;if(t&&"value"in t){const s=t.value instanceof k.URL?t.value.href:typeof t.value==="string"?t.value:t.value.parentURL;const r=new k.URL(e,s).href;const a=V.slice(0,V.lastIndexOf("/"));const c=o.default.relative(a,r);const u=c.startsWith(".")?c:"./"+c;v.add(u)}}else{v.add(e)}}break}}else if(t&&"value"in t&&typeof t.value==="object"&&t.value!==null&&t.value.transport===I&&c.arguments.length>=1&&c.arguments[0].type==="ObjectExpression"){for(const e of c.arguments[0].properties){if(e.type==="Property"&&!e.computed&&e.key.type==="Identifier"&&e.key.name==="transport"&&e.value.type==="ObjectExpression"){await processPinoTransportObject(e.value,processRequireArg)}}}}else if(c.type==="VariableDeclaration"&&u&&!(0,f.isVarLoop)(u)&&s.analysis.evaluatePureExpressions){for(const e of c.declarations){if(!e.init)continue;const t=await computePureStaticValue(e.init,true);if(t){if(e.id.type==="Identifier"){setKnownBinding(e.id.name,t)}else if(e.id.type==="ObjectPattern"&&"value"in t){for(const s of e.id.properties){if(s.type!=="Property"||s.key.type!=="Identifier"||s.value.type!=="Identifier"||typeof t.value!=="object"||t.value===null||!(s.key.name in t.value))continue;setKnownBinding(s.value.name,{value:t.value[s.key.name]})}}if(!("value"in t)&&isAbsolutePathOrUrl(t.ifTrue)&&isAbsolutePathOrUrl(t.else)){ne=t;se=e.init;await emitStaticChildAsset()}}}}else if(c.type==="AssignmentExpression"&&u&&!(0,f.isLoop)(u)&&s.analysis.evaluatePureExpressions){if(!hasKnownBindingValue(c.left.name)){const e=await computePureStaticValue(c.right,false);if(e&&"value"in e){if(c.left.type==="Identifier"){setKnownBinding(c.left.name,e)}else if(c.left.type==="ObjectPattern"){for(const t of c.left.properties){if(t.type!=="Property"||t.key.type!=="Identifier"||t.value.type!=="Identifier"||typeof e.value!=="object"||e.value===null||!(t.key.name in e.value))continue;setKnownBinding(t.value.name,{value:e.value[t.key.name]})}}if(isAbsolutePathOrUrl(e.value)){ne=e;se=c.right;await emitStaticChildAsset()}}}}else if((!U||s.mixedModules)&&(c.type==="FunctionDeclaration"||c.type==="FunctionExpression"||c.type==="ArrowFunctionExpression")&&(c.arguments||c.params)[0]&&(c.arguments||c.params)[0].type==="Identifier"){let e;let t;if((c.type==="ArrowFunctionExpression"||c.type==="FunctionExpression")&&u&&u.type==="VariableDeclarator"&&u.id.type==="Identifier"){e=u.id;t=c.arguments||c.params}else if(c.id){e=c.id;t=c.arguments||c.params}if(e&&c.body.body){let s,r=false;for(let e=0;e<c.body.body.length;e++){if(c.body.body[e].type==="VariableDeclaration"&&!s){s=c.body.body[e].declarations.find((e=>e&&e.id&&e.id.type==="Identifier"&&e.init&&e.init.type==="CallExpression"&&e.init.callee.type==="Identifier"&&e.init.callee.name==="require"&&Y.require.shadowDepth===0&&e.init.arguments[0]&&e.init.arguments[0].type==="Identifier"&&e.init.arguments[0].name===t[0].name))}if(s&&c.body.body[e].type==="ReturnStatement"&&c.body.body[e].argument&&c.body.body[e].argument.type==="Identifier"&&c.body.body[e].argument.name===s.id.name){r=true;break}}if(r)setKnownBinding(e.name,{value:te})}}if(c.type==="CallExpression"&&c.callee.type==="MemberExpression"&&c.callee.object.type==="Identifier"&&c.callee.object.name==="module"&&c.callee.property.type==="Identifier"&&c.callee.property.name==="createRequire"){if(u.type==="VariableDeclarator"&&u.id.type==="Identifier"){const e=u.id.name;setKnownBinding(e,{value:te})}}if(c.type==="CallExpression"&&c.callee.type==="Identifier"&&c.callee.name==="createRequire"){const e=getKnownBinding("createRequire");if(e&&"value"in e&&e.value===G){if(u.type==="VariableDeclarator"&&u.id.type==="Identifier"){const e=u.id.name;setKnownBinding(e,{value:te})}}}},async leave(e,t){const s=e;const r=t;if(s.scope){if(oe.parent){oe=oe.parent}for(const e in s.scope.declarations){if(e in Y){if(Y[e].shadowDepth>0)Y[e].shadowDepth--;else delete Y[e]}}}if(se&&r)await backtrack(r,this)}});await j;return{assets:r,deps:d,imports:v,isESM:U};async function emitAssetPath(t){const a=t.indexOf(u.WILDCARD);const c=a===-1?t.length:t.lastIndexOf(o.default.sep,a);const d=t.substring(0,c);try{var h=await s.stat(d);if(h===null){throw new Error("file not found")}}catch(e){return}if(a!==-1&&h.isFile())return;if(O){const r=e.substring(0,e.indexOf(o.default.sep+"node_modules"))+o.default.sep+"node_modules"+o.default.sep;if(!t.startsWith(r)){if(s.log)console.log("Skipping asset emission of "+t+" for "+e+" as it is outside the package base "+O);return}}if(h.isFile()){if(s.ignoreFn(o.default.relative(s.base,t)))return;r.add(t)}else if(h.isDirectory()){if(s.ignoreFn(o.default.relative(s.base,t)))return;if(validWildcard(t))emitAssetDirectory(t)}}function validWildcard(t){let r="";if(t.endsWith(o.default.sep))r=o.default.sep;else if(t.endsWith(o.default.sep+u.WILDCARD))r=o.default.sep+u.WILDCARD;else if(t.endsWith(u.WILDCARD))r=u.WILDCARD;if(t===S+r)return false;if(t===X+r)return false;if(t.endsWith(o.default.sep+"node_modules"+r))return false;if(S.startsWith(t.slice(0,t.length-r.length)+o.default.sep))return false;if(O){const r=e.substring(0,e.indexOf(o.default.sep+"node_modules"))+o.default.sep+"node_modules"+o.default.sep;if(!t.startsWith(r)){if(s.log)console.log("Skipping asset emission of "+t.replace(u.wildcardRegEx,"*")+" for "+e+" as it is outside the package base "+O);return false}}return true}function resolveAbsolutePathOrUrl(e){return e instanceof k.URL?(0,k.fileURLToPath)(e):e.startsWith("file:")?(0,k.fileURLToPath)(new k.URL(e)):o.default.resolve(e)}async function emitStaticChildAsset(){if(!ne){return}if("value"in ne&&isAbsolutePathOrUrl(ne.value)){try{const e=resolveAbsolutePathOrUrl(ne.value);await emitAssetPath(e)}catch(e){}}else if("ifTrue"in ne&&"else"in ne&&isAbsolutePathOrUrl(ne.ifTrue)&&isAbsolutePathOrUrl(ne.else)){let e;try{e=resolveAbsolutePathOrUrl(ne.ifTrue)}catch(e){}let t;try{t=resolveAbsolutePathOrUrl(ne.else)}catch(e){}if(e)await emitAssetPath(e);if(t)await emitAssetPath(t)}else if(se&&se.type==="ArrayExpression"&&"value"in ne&&ne.value instanceof Array){for(const e of ne.value){try{const t=resolveAbsolutePathOrUrl(e);await emitAssetPath(t)}catch(e){}}}se=ne=undefined}}function isAst(e){return"body"in e}},5876:function(e,t,s){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.CachedFileSystem=void 0;const o=s(6928);const a=r(s(8692));const c=s(4261);const u=a.default.promises.readFile;const d=a.default.promises.readlink;const h=a.default.promises.stat;class CachedFileSystem{fileCache;statCache;symlinkCache;fileIOQueue;constructor({cache:e,fileIOConcurrency:t}){this.fileIOQueue=new c.Sema(t);this.fileCache=e?.fileCache??new Map;this.statCache=e?.statCache??new Map;this.symlinkCache=e?.symlinkCache??new Map;if(e){e.fileCache=this.fileCache;e.statCache=this.statCache;e.symlinkCache=this.symlinkCache}}async readlink(e){const t=this.symlinkCache.get(e);if(t!==undefined)return t;const s=this.executeFileIO(e,this._internalReadlink);this.symlinkCache.set(e,s);return s}async readFile(e){const t=this.fileCache.get(e);if(t!==undefined)return t;const s=this.executeFileIO(e,this._internalReadFile);this.fileCache.set(e,s);return s}async stat(e){const t=this.statCache.get(e);if(t!==undefined)return t;const s=this.executeFileIO(e,this._internalStat);this.statCache.set(e,s);return s}async _internalReadlink(e){try{const t=await d(e);const s=this.statCache.get(e);if(s)this.statCache.set((0,o.resolve)(e,t),s);return t}catch(e){if(e.code!=="EINVAL"&&e.code!=="ENOENT"&&e.code!=="UNKNOWN")throw e;return null}}async _internalReadFile(e){try{return(await u(e)).toString()}catch(e){if(e.code==="ENOENT"||e.code==="EISDIR"){return null}throw e}}async _internalStat(e){try{return await h(e)}catch(e){if(e.code==="ENOENT"){return null}throw e}}async executeFileIO(e,t){await this.fileIOQueue.acquire();try{return await t.call(this,e)}finally{this.fileIOQueue.release()}}}t.CachedFileSystem=CachedFileSystem},9631:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){if(r===undefined)r=s;var o=Object.getOwnPropertyDescriptor(t,s);if(!o||("get"in o?!t.__esModule:o.writable||o.configurable)){o={enumerable:true,get:function(){return t[s]}}}Object.defineProperty(e,r,o)}:function(e,t,s,r){if(r===undefined)r=s;e[r]=t[s]});var o=this&&this.__exportStar||function(e,t){for(var s in e)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(t,s))r(t,e,s)};var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.resolve=t.nodeFileTrace=void 0;o(s(9046),t);var c=s(6910);Object.defineProperty(t,"nodeFileTrace",{enumerable:true,get:function(){return c.nodeFileTrace}});const u=a(s(5501));t.resolve=u.default},6910:function(e,t,s){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,s,r){if(r===undefined)r=s;var o=Object.getOwnPropertyDescriptor(t,s);if(!o||("get"in o?!t.__esModule:o.writable||o.configurable)){o={enumerable:true,get:function(){return t[s]}}}Object.defineProperty(e,r,o)}:function(e,t,s,r){if(r===undefined)r=s;e[r]=t[s]});var o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var a=this&&this.__importStar||function(){var ownKeys=function(e){ownKeys=Object.getOwnPropertyNames||function(e){var t=[];for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s))t[t.length]=s;return t};return ownKeys(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s=ownKeys(e),a=0;a<s.length;a++)if(s[a]!=="default")r(t,e,s[a]);o(t,e);return t}}();var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.Job=void 0;t.nodeFileTrace=nodeFileTrace;const u=s(6928);const d=c(s(3559));const h=a(s(5501));const f=s(7298);const p=s(6353);const y=s(5876);function inPath(e,t){const s=(0,u.join)(t,u.sep);return e.startsWith(s)&&e!==s}async function nodeFileTrace(e,t={}){const s=new Job(t);if(t.readFile)s.readFile=t.readFile;if(t.stat)s.stat=t.stat;if(t.readlink)s.readlink=t.readlink;if(t.resolve)s.resolve=t.resolve;s.ts=true;await Promise.all(e.map((async e=>{const t=(0,u.resolve)(e);await s.emitFile(t,"initial");return s.emitDependency(t)})));const r={fileList:s.fileList,esmFileList:s.esmFileList,reasons:s.reasons,warnings:s.warnings};return r}class Job{ts;base;cwd;conditions;exportsOnly;moduleSyncCatchall;paths;ignoreFn;log;depth;mixedModules;analysis;analysisCache;fileList;esmFileList;processed;warnings;reasons=new Map;cachedFileSystem;remappings=new Map;constructor({base:e=process.cwd(),processCwd:t,exports:s,conditions:r=s||["node"],exportsOnly:o=false,moduleSyncCatchall:a=false,paths:c={},ignore:d,log:h=false,mixedModules:p=false,ts:g=true,analysis:v={},cache:_,fileIOConcurrency:w=1024,depth:x=Infinity}){this.ts=g;e=(0,u.resolve)(e);this.ignoreFn=e=>{if(e.startsWith(".."+u.sep))return true;return false};if(typeof d==="string")d=[d];if(typeof d==="function"){const e=d;this.ignoreFn=t=>{if(t.startsWith(".."+u.sep))return true;if(e(t))return true;return false}}else if(Array.isArray(d)){const t=d.map((t=>(0,u.relative)(e,(0,u.resolve)(e||process.cwd(),t))));this.ignoreFn=e=>{if(e.startsWith(".."+u.sep))return true;if((0,f.isMatch)(e,t))return true;return false}}this.base=e;this.cwd=(0,u.resolve)(t||e);this.conditions=r;this.exportsOnly=o;this.moduleSyncCatchall=a;const S={};for(const t of Object.keys(c)){const s=c[t].endsWith("/");const r=(0,u.resolve)(e,c[t]);S[t]=r+(s?"/":"")}this.paths=S;this.log=h;this.depth=x;this.mixedModules=p;this.cachedFileSystem=new y.CachedFileSystem({cache:_,fileIOConcurrency:w});this.analysis={};if(v!==false){Object.assign(this.analysis,{emitGlobs:true,computeFileReferences:true,evaluatePureExpressions:true},v===true?{}:v)}this.analysisCache=_&&_.analysisCache||new Map;if(_){_.analysisCache=this.analysisCache}this.fileList=new Set;this.esmFileList=new Set;this.processed=new Set;this.warnings=new Set}addRemapping(e,t){if(e===t)return;let s=this.remappings.get(e);if(!s){s=new Set;this.remappings.set(e,s)}s.add(t)}async readlink(e){return this.cachedFileSystem.readlink(e)}async isFile(e){const t=await this.stat(e);if(t)return t.isFile();return false}async isDir(e){const t=await this.stat(e);if(t)return t.isDirectory();return false}async stat(e){return this.cachedFileSystem.stat(e)}maybeEmitDep=async(e,t,s,r)=>{let o="";let a;try{o=await this.resolve(e,t,this,s)}catch(r){a=r;try{if(this.ts&&e.endsWith(".js")&&r instanceof h.NotFoundError){const r=e.slice(0,-3)+".ts";o=await this.resolve(r,t,this,s);a=undefined}}catch(e){a=e}}if(a){this.warnings.add(new Error(`Failed to resolve dependency "${e}":\n${a?.message}`));return}if(Array.isArray(o)){for(const e of o){if(e.startsWith("node:"))return;await this.emitDependency(e,t,r)}}else{if(o.startsWith("node:"))return;await this.emitDependency(o,t,r)}};async resolve(e,t,s,r){return(0,h.default)(e,t,s,r)}async readFile(e){return this.cachedFileSystem.readFile(e)}async realpath(e,t,s=new Set){if(s.has(e))throw new Error("Recursive symlink detected resolving "+e);s.add(e);const r=await this.readlink(e);if(r){const o=(0,u.dirname)(e);const a=(0,u.resolve)(o,r);const c=await this.realpath(o,t);if(inPath(e,c))await this.emitFile(e,"resolve",t,true);return this.realpath(a,t,s)}if(!inPath(e,this.base))return e;return(0,u.join)(await this.realpath((0,u.dirname)(e),t,s),(0,u.basename)(e))}async emitFile(e,t,s,r=false){if(!r){e=await this.realpath(e,s)}e=(0,u.relative)(this.base,e);if(s){s=(0,u.relative)(this.base,s)}let o=this.reasons.get(e);if(!o){o={type:[t],ignored:false,parents:new Set};this.reasons.set(e,o)}else if(!o.type.includes(t)){o.type.push(t)}if(s&&this.ignoreFn(e,s)){if(!this.fileList.has(e)&&o){o.ignored=true}return false}if(s){o.parents.add(s)}this.fileList.add(e);return true}async getPjsonBoundary(e){const t=e.indexOf(u.sep);let s;while((s=e.lastIndexOf(u.sep))>t){e=e.slice(0,s);if(await this.isFile(e+u.sep+"package.json"))return e}return undefined}async emitDependency(e,t,s=this.depth){if(s<0)throw new Error("invariant - depth option cannot be negative");const r=await this.realpath(e,t);if(this.processed.has(r)){if(t){await this.emitFile(e,"dependency",t)}return}this.processed.add(r);const o=this.remappings.get(r);if(o){await Promise.all([...o].map((async e=>this.emitDependency(e,r,s))))}const a=await this.emitFile(e,"dependency",t);if(!a)return;if(r.endsWith(".json"))return;if(r.endsWith(".node"))return await(0,p.sharedLibEmit)(r,this);if(r.endsWith(".js")||r.endsWith(".ts")){const e=await this.getPjsonBoundary(r);if(e)await this.emitFile(e+u.sep+"package.json","resolve",r)}if(s===0)return;let c;const h=this.analysisCache.get(r);if(h){c=h}else{const e=await this.readFile(r);if(e===null)throw new Error("File "+r+" does not exist.");c=await(0,d.default)(r,e.toString(),this);this.analysisCache.set(r,c)}const{deps:f,imports:y,assets:g,isESM:v}=c;if(v){this.esmFileList.add((0,u.relative)(this.base,r))}await Promise.all([...[...g].map((async e=>{const t=(0,u.extname)(e);if(t===".js"||t===".mjs"||t===".node"||t===""||this.ts&&(t===".ts"||t===".tsx")&&e.startsWith(this.base)&&e.slice(this.base.length).indexOf(u.sep+"node_modules"+u.sep)===-1)await this.emitDependency(e,r,s-1);else await this.emitFile(e,"asset",r)})),...[...f].map((async e=>this.maybeEmitDep(e,r,!v,s-1))),...[...y].map((async e=>this.maybeEmitDep(e,r,false,s-1)))])}}t.Job=Job},5501:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NotFoundError=void 0;t["default"]=resolveDependency;const r=s(6928);const o=s(3339);const a=s(8904);async function resolveDependency(e,t,s,o=true){let a;if((0,r.isAbsolute)(e)||e==="."||e===".."||e.startsWith("./")||e.startsWith("../")){const o=e.endsWith("/");a=await resolvePath((0,r.resolve)(t,"..",e)+(o?"/":""),t,s)}else if(e[0]==="#"){a=await packageImportsResolve(e,t,s,o)}else{a=await resolvePackage(e,t,s,o)}if(Array.isArray(a)){return Promise.all(a.map((e=>s.realpath(e,t))))}else if(a.startsWith("node:")){return a}else{return s.realpath(a,t)}}async function resolvePath(e,t,s){const r=await resolveFile(e,t,s)||await resolveDir(e,t,s);if(!r){throw new NotFoundError(e,t)}return r}async function resolveFile(e,t,s){if(e.endsWith("/"))return undefined;e=await s.realpath(e,t);if(await s.isFile(e))return e;if(s.ts&&e.startsWith(s.base)&&e.slice(s.base.length).indexOf(r.sep+"node_modules"+r.sep)===-1&&await s.isFile(e+".ts"))return e+".ts";if(s.ts&&e.startsWith(s.base)&&e.slice(s.base.length).indexOf(r.sep+"node_modules"+r.sep)===-1&&await s.isFile(e+".tsx"))return e+".tsx";if(await s.isFile(e+".js"))return e+".js";if(await s.isFile(e+".json"))return e+".json";if(await s.isFile(e+".node"))return e+".node";return undefined}async function resolveDir(e,t,s){if(e.endsWith("/"))e=e.slice(0,-1);if(!await s.isDir(e))return;const o=await getPkgCfg(e,s);if(o&&typeof o.main==="string"){const a=await resolveFile((0,r.resolve)(e,o.main),t,s)||await resolveFile((0,r.resolve)(e,o.main,"index"),t,s);if(a){await s.emitFile(e+r.sep+"package.json","resolve",t);return a}}return resolveFile((0,r.resolve)(e,"index"),t,s)}class NotFoundError extends Error{code;constructor(e,t){super("Cannot find module '"+e+"' loaded from "+t);this.code="MODULE_NOT_FOUND"}}t.NotFoundError=NotFoundError;const c=new Set(o.builtinModules);const u=(0,a.getNodeMajorVersion)()>=22;function getPkgName(e){const t=e.split("/");if(e[0]==="@"&&t.length>1)return t.length>1?t.slice(0,2).join("/"):null;return t.length?t[0]:null}async function getPkgCfg(e,t){const s=await t.readFile(e+r.sep+"package.json");if(s){try{return JSON.parse(s.toString())}catch(e){}}return undefined}function getExportsTarget(e,t,s,r){if(typeof e==="string"){return e}else if(e===null){return e}else if(Array.isArray(e)){for(const o of e){const e=getExportsTarget(o,t,s,r);if(e===null||typeof e==="string"&&e.startsWith("./"))return e}}else if(typeof e==="object"){for(const o of Object.keys(e)){if(o==="default"||o==="require"&&s||o==="import"&&!s||o==="module-sync"&&r||t.includes(o)){const a=getExportsTarget(e[o],t,s,r);if(a!==undefined)return a}}}return undefined}function addExportsTargetPath(e,t,s,r){if(typeof s!=="string"||!s.startsWith("./"))return;const o=r?s.slice(1).replace(/\*/g,r):s.slice(1);const a=t+o;if(!e.includes(a)){e.push(a)}}async function validateAndResolvePaths(e,t,s,r){const o=[];for(const a of e){if(r){const e=await resolveFile(a,t,s)||await resolveDir(a,t,s);if(!e)throw new NotFoundError(a,t);o.push(e)}else{if(!await s.isFile(a))throw new NotFoundError(a,t);o.push(a)}}return o}async function resolveExportsImports(e,t,s,r,o,a,c){let d;if(o){if(!(typeof t==="object"&&!Array.isArray(t)&&t!==null))return undefined;d=t}else if(typeof t==="string"||Array.isArray(t)||t===null||typeof t==="object"&&Object.keys(t).length&&Object.keys(t)[0][0]!=="."){d={".":t}}else{d=t}if(s in d){const t=getExportsTarget(d[s],r.conditions,a,u);if(typeof t==="string"&&t.startsWith("./")){const o=e+t.slice(1);const h=[o];const f=d[s];if(typeof f==="object"&&f!==null&&!Array.isArray(f)&&"module-sync"in f&&(u||r.moduleSyncCatchall)){const t=getExportsTarget(f["module-sync"],r.conditions,a,true);addExportsTargetPath(h,e,t);const s=a&&"require"in f?"require":!a&&"import"in f?"import":"default";const o=getExportsTarget(f[s],r.conditions,a,false);addExportsTargetPath(h,e,o)}return await validateAndResolvePaths(h,c,r,a)}else if(o&&typeof t==="string"){const e=await resolveDependency(t,c,r,a);return Array.isArray(e)?e:[e]}}for(const t of Object.keys(d).sort(((e,t)=>t.length-e.length))){if(t.endsWith("*")&&s.startsWith(t.slice(0,-1))){const o=getExportsTarget(d[t],r.conditions,a,u);if(typeof o==="string"&&o.startsWith("./")){const u=e+o.slice(1).replace(/\*/g,s.slice(t.length-1));const h=[u];const f=s.slice(t.length-1);const p=d[t];if(r.moduleSyncCatchall&&typeof p==="object"&&p!==null&&!Array.isArray(p)&&"module-sync"in p){const t=getExportsTarget(p["module-sync"],r.conditions,a,true);addExportsTargetPath(h,e,t,f);const s=a&&"require"in p?"require":!a&&"import"in p?"import":"default";const o=getExportsTarget(p[s],r.conditions,a,false);addExportsTargetPath(h,e,o,f)}return await validateAndResolvePaths(h,c,r,a)}}if(!t.endsWith("/"))continue;if(s.startsWith(t)){const o=getExportsTarget(d[t],r.conditions,a,u);if(typeof o==="string"&&o.endsWith("/")&&o.startsWith("./")){const u=e+o.slice(1)+s.slice(t.length);return await validateAndResolvePaths([u],c,r,a)}}}return undefined}async function resolveRemappings(e,t,s,o){if(o.conditions?.includes("browser")){const{browser:a}=t;if(!a){return}if(typeof a==="object"){for(const[t,c]of Object.entries(a)){if(typeof c!=="string"){continue}if(!t.startsWith("./")||!c.startsWith("./")){continue}const a=await resolveFile(e+r.sep+t,s,o);const u=await resolveFile(e+r.sep+c,s,o);if(a&&u){o.addRemapping(a,u)}}}}}async function packageImportsResolve(e,t,s,o){if(e!=="#"&&!e.startsWith("#/")&&s.conditions){const a=await s.getPjsonBoundary(t);if(a){const c=await getPkgCfg(a,s);const{imports:u}=c||{};if(c&&u!==null&&u!==undefined){const c=await resolveExportsImports(a,u,e,s,true,o,t);if(c){await s.emitFile(a+r.sep+"package.json","resolve",t);return c}}}}throw new NotFoundError(e,t)}async function resolvePackage(e,t,s,o){let a=t;if(c.has(e))return"node:"+e;if(e.startsWith("node:"))return e;const u=getPkgName(e)||"";let d;if(s.conditions){const a=await s.getPjsonBoundary(t);if(a){const c=await getPkgCfg(a,s);const{exports:h}=c||{};if(c&&c.name&&c.name===u&&h!==null&&h!==undefined){d=await resolveExportsImports(a,h,"."+e.slice(u.length),s,false,o,t);if(d)await s.emitFile(a+r.sep+"package.json","resolve",t)}}}let h;const f=a.indexOf(r.sep);while((h=a.lastIndexOf(r.sep))>f){a=a.slice(0,h);const c=a+r.sep+"node_modules";const f=await s.stat(c);if(!f||!f.isDirectory())continue;const p=await getPkgCfg(c+r.sep+u,s);const{exports:y}=p||{};if(p){await resolveRemappings(c+r.sep+u,p,t,s)}if(s.conditions&&y!==undefined&&y!==null&&!d){let a;if(!s.exportsOnly)a=await resolveFile(c+r.sep+e,t,s)||await resolveDir(c+r.sep+e,t,s);const d=await resolveExportsImports(c+r.sep+u,y,"."+e.slice(u.length),s,false,o,t);if(d){await s.emitFile(c+r.sep+u+r.sep+"package.json","resolve",t);if(a&&!d.includes(a))return[...d,a];return d}if(a)return a}else{const o=await resolveFile(c+r.sep+e,t,s)||await resolveDir(c+r.sep+e,t,s);if(o){if(d){if(Array.isArray(d)){if(!d.includes(o))return[o,...d];return d}else if(d!==o){return[o,d]}}return o}}}if(d)return d;if(Object.hasOwnProperty.call(s.paths,e)){return s.paths[e]}for(const r of Object.keys(s.paths)){if(r.endsWith("/")&&e.startsWith(r)){const o=s.paths[r]+e.slice(